| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262662636626466265662666626766268662696627066271662726627366274662756627666277662786627966280662816628266283662846628566286662876628866289662906629166292662936629466295662966629766298662996630066301663026630366304663056630666307663086630966310663116631266313663146631566316663176631866319663206632166322663236632466325663266632766328663296633066331663326633366334663356633666337663386633966340663416634266343663446634566346663476634866349663506635166352663536635466355663566635766358663596636066361663626636366364663656636666367663686636966370663716637266373663746637566376663776637866379663806638166382663836638466385663866638766388663896639066391663926639366394663956639666397663986639966400664016640266403664046640566406664076640866409664106641166412664136641466415664166641766418664196642066421664226642366424664256642666427664286642966430664316643266433664346643566436664376643866439664406644166442664436644466445664466644766448664496645066451664526645366454664556645666457664586645966460664616646266463664646646566466664676646866469664706647166472664736647466475664766647766478664796648066481664826648366484664856648666487664886648966490664916649266493664946649566496664976649866499665006650166502665036650466505665066650766508665096651066511665126651366514665156651666517665186651966520665216652266523665246652566526665276652866529665306653166532665336653466535665366653766538665396654066541665426654366544665456654666547665486654966550665516655266553665546655566556665576655866559665606656166562665636656466565665666656766568665696657066571665726657366574665756657666577665786657966580665816658266583665846658566586665876658866589665906659166592665936659466595665966659766598665996660066601666026660366604666056660666607666086660966610666116661266613666146661566616666176661866619666206662166622666236662466625666266662766628666296663066631666326663366634666356663666637666386663966640666416664266643666446664566646666476664866649666506665166652666536665466655666566665766658666596666066661666626666366664666656666666667666686666966670666716667266673666746667566676666776667866679666806668166682666836668466685666866668766688666896669066691666926669366694666956669666697666986669966700667016670266703667046670566706667076670866709667106671166712667136671466715667166671766718667196672066721667226672366724667256672666727667286672966730667316673266733667346673566736667376673866739667406674166742667436674466745667466674766748667496675066751667526675366754667556675666757667586675966760667616676266763667646676566766667676676866769667706677166772667736677466775667766677766778667796678066781667826678366784667856678666787667886678966790667916679266793667946679566796667976679866799668006680166802668036680466805668066680766808668096681066811668126681366814668156681666817668186681966820668216682266823668246682566826668276682866829668306683166832668336683466835668366683766838668396684066841668426684366844668456684666847668486684966850668516685266853668546685566856668576685866859668606686166862668636686466865668666686766868668696687066871668726687366874668756687666877668786687966880668816688266883668846688566886668876688866889668906689166892668936689466895668966689766898668996690066901669026690366904669056690666907669086690966910669116691266913669146691566916669176691866919669206692166922669236692466925669266692766928669296693066931669326693366934669356693666937669386693966940669416694266943669446694566946669476694866949669506695166952669536695466955669566695766958669596696066961669626696366964669656696666967669686696966970669716697266973669746697566976669776697866979669806698166982669836698466985669866698766988669896699066991669926699366994669956699666997669986699967000670016700267003670046700567006670076700867009670106701167012670136701467015670166701767018670196702067021670226702367024670256702667027670286702967030670316703267033670346703567036670376703867039670406704167042670436704467045670466704767048670496705067051670526705367054670556705667057670586705967060670616706267063670646706567066670676706867069670706707167072670736707467075670766707767078670796708067081670826708367084670856708667087670886708967090670916709267093670946709567096670976709867099671006710167102671036710467105671066710767108671096711067111671126711367114671156711667117671186711967120671216712267123671246712567126671276712867129671306713167132671336713467135671366713767138671396714067141671426714367144671456714667147671486714967150671516715267153671546715567156671576715867159671606716167162671636716467165671666716767168671696717067171671726717367174671756717667177671786717967180671816718267183671846718567186671876718867189671906719167192671936719467195671966719767198671996720067201672026720367204672056720667207672086720967210672116721267213672146721567216672176721867219672206722167222672236722467225672266722767228672296723067231672326723367234672356723667237672386723967240672416724267243672446724567246672476724867249672506725167252672536725467255672566725767258672596726067261672626726367264672656726667267672686726967270672716727267273672746727567276672776727867279672806728167282672836728467285672866728767288672896729067291672926729367294672956729667297672986729967300673016730267303673046730567306673076730867309673106731167312673136731467315673166731767318673196732067321673226732367324673256732667327673286732967330673316733267333673346733567336673376733867339673406734167342673436734467345673466734767348673496735067351673526735367354673556735667357673586735967360673616736267363673646736567366673676736867369673706737167372673736737467375673766737767378673796738067381673826738367384673856738667387673886738967390673916739267393673946739567396673976739867399674006740167402674036740467405674066740767408674096741067411674126741367414674156741667417674186741967420674216742267423674246742567426674276742867429674306743167432674336743467435674366743767438674396744067441674426744367444674456744667447674486744967450674516745267453674546745567456674576745867459674606746167462674636746467465674666746767468674696747067471674726747367474674756747667477674786747967480674816748267483674846748567486674876748867489674906749167492674936749467495674966749767498674996750067501675026750367504675056750667507675086750967510675116751267513675146751567516675176751867519675206752167522675236752467525675266752767528675296753067531675326753367534675356753667537675386753967540675416754267543675446754567546675476754867549675506755167552675536755467555675566755767558675596756067561675626756367564675656756667567675686756967570675716757267573675746757567576675776757867579675806758167582675836758467585675866758767588675896759067591675926759367594675956759667597675986759967600676016760267603676046760567606676076760867609676106761167612676136761467615676166761767618676196762067621676226762367624676256762667627676286762967630676316763267633676346763567636676376763867639676406764167642676436764467645676466764767648676496765067651676526765367654676556765667657676586765967660676616766267663676646766567666676676766867669676706767167672676736767467675676766767767678676796768067681676826768367684676856768667687676886768967690676916769267693676946769567696676976769867699677006770167702677036770467705677066770767708677096771067711677126771367714677156771667717677186771967720677216772267723677246772567726677276772867729677306773167732677336773467735677366773767738677396774067741677426774367744677456774667747677486774967750677516775267753677546775567756677576775867759677606776167762677636776467765677666776767768677696777067771677726777367774677756777667777677786777967780677816778267783677846778567786677876778867789677906779167792677936779467795677966779767798677996780067801678026780367804678056780667807678086780967810678116781267813678146781567816678176781867819678206782167822678236782467825678266782767828678296783067831678326783367834678356783667837678386783967840678416784267843678446784567846678476784867849678506785167852678536785467855678566785767858678596786067861678626786367864678656786667867678686786967870678716787267873678746787567876678776787867879678806788167882678836788467885678866788767888678896789067891678926789367894678956789667897678986789967900679016790267903679046790567906679076790867909679106791167912679136791467915679166791767918679196792067921679226792367924679256792667927679286792967930679316793267933679346793567936679376793867939679406794167942679436794467945679466794767948679496795067951679526795367954679556795667957679586795967960679616796267963679646796567966679676796867969679706797167972679736797467975679766797767978679796798067981679826798367984679856798667987679886798967990679916799267993679946799567996679976799867999680006800168002680036800468005680066800768008680096801068011680126801368014680156801668017680186801968020680216802268023680246802568026680276802868029680306803168032680336803468035680366803768038680396804068041680426804368044680456804668047680486804968050680516805268053680546805568056680576805868059680606806168062680636806468065680666806768068680696807068071680726807368074680756807668077680786807968080680816808268083680846808568086680876808868089680906809168092680936809468095680966809768098680996810068101681026810368104681056810668107681086810968110681116811268113681146811568116681176811868119681206812168122681236812468125681266812768128681296813068131681326813368134681356813668137681386813968140681416814268143681446814568146681476814868149681506815168152681536815468155681566815768158681596816068161681626816368164681656816668167681686816968170681716817268173681746817568176681776817868179681806818168182681836818468185681866818768188681896819068191681926819368194681956819668197681986819968200682016820268203682046820568206682076820868209682106821168212682136821468215682166821768218682196822068221682226822368224682256822668227682286822968230682316823268233682346823568236682376823868239682406824168242682436824468245682466824768248682496825068251682526825368254682556825668257682586825968260682616826268263682646826568266682676826868269682706827168272682736827468275682766827768278682796828068281682826828368284682856828668287682886828968290682916829268293682946829568296682976829868299683006830168302683036830468305683066830768308683096831068311683126831368314683156831668317683186831968320683216832268323683246832568326683276832868329683306833168332683336833468335683366833768338683396834068341683426834368344683456834668347683486834968350683516835268353683546835568356683576835868359683606836168362683636836468365683666836768368683696837068371683726837368374683756837668377683786837968380683816838268383683846838568386683876838868389683906839168392683936839468395683966839768398683996840068401684026840368404684056840668407684086840968410684116841268413684146841568416684176841868419684206842168422684236842468425684266842768428684296843068431684326843368434684356843668437684386843968440684416844268443684446844568446684476844868449684506845168452684536845468455684566845768458684596846068461684626846368464684656846668467684686846968470684716847268473684746847568476684776847868479684806848168482684836848468485684866848768488684896849068491684926849368494684956849668497684986849968500685016850268503685046850568506685076850868509685106851168512685136851468515685166851768518685196852068521685226852368524685256852668527685286852968530685316853268533685346853568536685376853868539685406854168542685436854468545685466854768548685496855068551685526855368554685556855668557685586855968560685616856268563685646856568566685676856868569685706857168572685736857468575685766857768578685796858068581685826858368584685856858668587685886858968590685916859268593685946859568596685976859868599686006860168602686036860468605686066860768608686096861068611686126861368614686156861668617686186861968620686216862268623686246862568626686276862868629686306863168632686336863468635686366863768638686396864068641686426864368644686456864668647686486864968650686516865268653686546865568656686576865868659686606866168662686636866468665686666866768668686696867068671686726867368674686756867668677686786867968680686816868268683686846868568686686876868868689686906869168692686936869468695686966869768698686996870068701687026870368704687056870668707687086870968710687116871268713687146871568716687176871868719687206872168722687236872468725687266872768728687296873068731687326873368734687356873668737687386873968740687416874268743687446874568746687476874868749687506875168752687536875468755687566875768758687596876068761687626876368764687656876668767687686876968770687716877268773687746877568776687776877868779687806878168782687836878468785687866878768788687896879068791687926879368794687956879668797687986879968800688016880268803688046880568806688076880868809688106881168812688136881468815688166881768818688196882068821688226882368824688256882668827688286882968830688316883268833688346883568836688376883868839688406884168842688436884468845688466884768848688496885068851688526885368854688556885668857688586885968860688616886268863688646886568866688676886868869688706887168872688736887468875688766887768878688796888068881688826888368884688856888668887688886888968890688916889268893688946889568896688976889868899689006890168902689036890468905689066890768908689096891068911689126891368914689156891668917689186891968920689216892268923689246892568926689276892868929689306893168932689336893468935689366893768938689396894068941689426894368944689456894668947689486894968950689516895268953689546895568956689576895868959689606896168962689636896468965689666896768968689696897068971689726897368974689756897668977689786897968980689816898268983689846898568986689876898868989689906899168992689936899468995689966899768998689996900069001690026900369004690056900669007690086900969010690116901269013690146901569016690176901869019690206902169022690236902469025690266902769028690296903069031690326903369034690356903669037690386903969040690416904269043690446904569046690476904869049690506905169052690536905469055690566905769058690596906069061690626906369064690656906669067690686906969070690716907269073690746907569076690776907869079690806908169082690836908469085690866908769088690896909069091690926909369094690956909669097690986909969100691016910269103691046910569106691076910869109691106911169112691136911469115691166911769118691196912069121691226912369124691256912669127691286912969130691316913269133691346913569136691376913869139691406914169142691436914469145691466914769148691496915069151691526915369154691556915669157691586915969160691616916269163691646916569166691676916869169691706917169172691736917469175691766917769178691796918069181691826918369184691856918669187691886918969190691916919269193691946919569196691976919869199692006920169202692036920469205692066920769208692096921069211692126921369214692156921669217692186921969220692216922269223692246922569226692276922869229692306923169232692336923469235692366923769238692396924069241692426924369244692456924669247692486924969250692516925269253692546925569256692576925869259692606926169262692636926469265692666926769268692696927069271692726927369274692756927669277692786927969280692816928269283692846928569286692876928869289692906929169292692936929469295692966929769298692996930069301693026930369304693056930669307693086930969310693116931269313693146931569316693176931869319693206932169322693236932469325693266932769328693296933069331693326933369334693356933669337693386933969340693416934269343693446934569346693476934869349693506935169352693536935469355693566935769358693596936069361693626936369364693656936669367693686936969370693716937269373693746937569376693776937869379693806938169382693836938469385693866938769388693896939069391693926939369394693956939669397693986939969400694016940269403694046940569406694076940869409694106941169412694136941469415694166941769418694196942069421694226942369424694256942669427694286942969430694316943269433694346943569436694376943869439694406944169442694436944469445694466944769448694496945069451694526945369454694556945669457694586945969460694616946269463694646946569466694676946869469694706947169472694736947469475694766947769478694796948069481694826948369484694856948669487694886948969490694916949269493694946949569496694976949869499695006950169502695036950469505695066950769508695096951069511695126951369514695156951669517695186951969520695216952269523695246952569526695276952869529695306953169532695336953469535695366953769538695396954069541695426954369544695456954669547695486954969550695516955269553695546955569556695576955869559695606956169562695636956469565695666956769568695696957069571695726957369574695756957669577695786957969580695816958269583695846958569586695876958869589695906959169592695936959469595695966959769598695996960069601696026960369604696056960669607696086960969610696116961269613696146961569616696176961869619696206962169622696236962469625696266962769628696296963069631696326963369634696356963669637696386963969640696416964269643696446964569646696476964869649696506965169652696536965469655696566965769658696596966069661696626966369664696656966669667696686966969670696716967269673696746967569676696776967869679696806968169682696836968469685696866968769688696896969069691696926969369694696956969669697696986969969700697016970269703697046970569706697076970869709697106971169712697136971469715697166971769718697196972069721697226972369724697256972669727697286972969730697316973269733697346973569736697376973869739697406974169742697436974469745697466974769748697496975069751697526975369754697556975669757697586975969760697616976269763697646976569766697676976869769697706977169772697736977469775697766977769778697796978069781697826978369784697856978669787697886978969790697916979269793697946979569796697976979869799698006980169802698036980469805698066980769808698096981069811698126981369814698156981669817698186981969820698216982269823698246982569826698276982869829698306983169832698336983469835698366983769838698396984069841698426984369844698456984669847698486984969850698516985269853698546985569856698576985869859698606986169862698636986469865698666986769868698696987069871698726987369874698756987669877698786987969880698816988269883698846988569886698876988869889698906989169892698936989469895698966989769898698996990069901699026990369904699056990669907699086990969910699116991269913699146991569916699176991869919699206992169922699236992469925699266992769928699296993069931699326993369934699356993669937699386993969940699416994269943699446994569946699476994869949699506995169952699536995469955699566995769958699596996069961699626996369964699656996669967699686996969970699716997269973699746997569976699776997869979699806998169982699836998469985699866998769988699896999069991699926999369994699956999669997699986999970000700017000270003700047000570006700077000870009700107001170012700137001470015700167001770018700197002070021700227002370024700257002670027700287002970030700317003270033700347003570036700377003870039700407004170042700437004470045700467004770048700497005070051700527005370054700557005670057700587005970060700617006270063700647006570066700677006870069700707007170072700737007470075700767007770078700797008070081700827008370084700857008670087700887008970090700917009270093700947009570096700977009870099701007010170102701037010470105701067010770108701097011070111701127011370114701157011670117701187011970120701217012270123701247012570126701277012870129701307013170132701337013470135701367013770138701397014070141701427014370144701457014670147701487014970150701517015270153701547015570156701577015870159701607016170162701637016470165701667016770168701697017070171701727017370174701757017670177701787017970180701817018270183701847018570186701877018870189701907019170192701937019470195701967019770198701997020070201702027020370204702057020670207702087020970210702117021270213702147021570216702177021870219702207022170222702237022470225702267022770228702297023070231702327023370234702357023670237702387023970240702417024270243702447024570246702477024870249702507025170252702537025470255702567025770258702597026070261702627026370264702657026670267702687026970270702717027270273702747027570276702777027870279702807028170282702837028470285702867028770288702897029070291702927029370294702957029670297702987029970300703017030270303703047030570306703077030870309703107031170312703137031470315703167031770318703197032070321703227032370324703257032670327703287032970330703317033270333703347033570336703377033870339703407034170342703437034470345703467034770348703497035070351703527035370354703557035670357703587035970360703617036270363703647036570366703677036870369703707037170372703737037470375703767037770378703797038070381703827038370384703857038670387703887038970390703917039270393703947039570396703977039870399704007040170402704037040470405704067040770408704097041070411704127041370414704157041670417704187041970420704217042270423704247042570426704277042870429704307043170432704337043470435704367043770438704397044070441704427044370444704457044670447704487044970450704517045270453704547045570456704577045870459704607046170462704637046470465704667046770468704697047070471704727047370474704757047670477704787047970480704817048270483704847048570486704877048870489704907049170492704937049470495704967049770498704997050070501705027050370504705057050670507705087050970510705117051270513705147051570516705177051870519705207052170522705237052470525705267052770528705297053070531705327053370534705357053670537705387053970540705417054270543705447054570546705477054870549705507055170552705537055470555705567055770558705597056070561705627056370564705657056670567705687056970570705717057270573705747057570576705777057870579705807058170582705837058470585705867058770588705897059070591705927059370594705957059670597705987059970600706017060270603706047060570606706077060870609706107061170612706137061470615706167061770618706197062070621706227062370624706257062670627706287062970630706317063270633706347063570636706377063870639706407064170642706437064470645706467064770648706497065070651706527065370654706557065670657706587065970660706617066270663706647066570666706677066870669706707067170672706737067470675706767067770678706797068070681706827068370684706857068670687706887068970690706917069270693706947069570696706977069870699707007070170702707037070470705707067070770708707097071070711707127071370714707157071670717707187071970720707217072270723707247072570726707277072870729707307073170732707337073470735707367073770738707397074070741707427074370744707457074670747707487074970750707517075270753707547075570756707577075870759707607076170762707637076470765707667076770768707697077070771707727077370774707757077670777707787077970780707817078270783707847078570786707877078870789707907079170792707937079470795707967079770798707997080070801708027080370804708057080670807708087080970810708117081270813708147081570816708177081870819708207082170822708237082470825708267082770828708297083070831708327083370834708357083670837708387083970840708417084270843708447084570846708477084870849708507085170852708537085470855708567085770858708597086070861708627086370864708657086670867708687086970870708717087270873708747087570876708777087870879708807088170882708837088470885708867088770888708897089070891708927089370894708957089670897708987089970900709017090270903709047090570906709077090870909709107091170912709137091470915709167091770918709197092070921709227092370924709257092670927709287092970930709317093270933709347093570936709377093870939709407094170942709437094470945709467094770948709497095070951709527095370954709557095670957709587095970960709617096270963709647096570966709677096870969709707097170972709737097470975709767097770978709797098070981709827098370984709857098670987709887098970990709917099270993709947099570996709977099870999710007100171002710037100471005710067100771008710097101071011710127101371014710157101671017710187101971020710217102271023710247102571026710277102871029710307103171032710337103471035710367103771038710397104071041710427104371044710457104671047710487104971050710517105271053710547105571056710577105871059710607106171062710637106471065710667106771068710697107071071710727107371074710757107671077710787107971080710817108271083710847108571086710877108871089710907109171092710937109471095710967109771098710997110071101711027110371104711057110671107711087110971110711117111271113711147111571116711177111871119711207112171122711237112471125711267112771128711297113071131711327113371134711357113671137711387113971140711417114271143711447114571146711477114871149711507115171152711537115471155711567115771158711597116071161711627116371164711657116671167711687116971170711717117271173711747117571176711777117871179711807118171182711837118471185711867118771188711897119071191711927119371194711957119671197711987119971200712017120271203712047120571206712077120871209712107121171212712137121471215712167121771218712197122071221712227122371224712257122671227712287122971230712317123271233712347123571236712377123871239712407124171242712437124471245712467124771248712497125071251712527125371254712557125671257712587125971260712617126271263712647126571266712677126871269712707127171272712737127471275712767127771278712797128071281712827128371284712857128671287712887128971290712917129271293712947129571296712977129871299713007130171302713037130471305713067130771308713097131071311713127131371314713157131671317713187131971320713217132271323713247132571326713277132871329713307133171332713337133471335713367133771338713397134071341713427134371344713457134671347713487134971350713517135271353713547135571356713577135871359713607136171362713637136471365713667136771368713697137071371713727137371374713757137671377713787137971380713817138271383713847138571386713877138871389713907139171392713937139471395713967139771398713997140071401714027140371404714057140671407714087140971410714117141271413714147141571416714177141871419714207142171422714237142471425714267142771428714297143071431714327143371434714357143671437714387143971440714417144271443714447144571446714477144871449714507145171452714537145471455714567145771458714597146071461714627146371464714657146671467714687146971470714717147271473714747147571476714777147871479714807148171482714837148471485714867148771488714897149071491714927149371494714957149671497714987149971500715017150271503715047150571506715077150871509715107151171512715137151471515715167151771518715197152071521715227152371524715257152671527715287152971530715317153271533715347153571536715377153871539715407154171542715437154471545715467154771548715497155071551715527155371554715557155671557715587155971560715617156271563715647156571566715677156871569715707157171572715737157471575715767157771578715797158071581715827158371584715857158671587715887158971590715917159271593715947159571596715977159871599716007160171602716037160471605716067160771608716097161071611716127161371614716157161671617716187161971620716217162271623716247162571626716277162871629716307163171632716337163471635716367163771638716397164071641716427164371644716457164671647716487164971650716517165271653716547165571656716577165871659716607166171662716637166471665716667166771668716697167071671716727167371674716757167671677716787167971680716817168271683716847168571686716877168871689716907169171692716937169471695716967169771698716997170071701717027170371704717057170671707717087170971710717117171271713717147171571716717177171871719717207172171722717237172471725717267172771728717297173071731717327173371734717357173671737717387173971740717417174271743717447174571746717477174871749717507175171752717537175471755717567175771758717597176071761717627176371764717657176671767717687176971770717717177271773717747177571776717777177871779717807178171782717837178471785717867178771788717897179071791717927179371794717957179671797717987179971800718017180271803718047180571806718077180871809718107181171812718137181471815718167181771818718197182071821718227182371824718257182671827718287182971830718317183271833718347183571836718377183871839718407184171842718437184471845718467184771848718497185071851718527185371854718557185671857718587185971860718617186271863718647186571866718677186871869718707187171872718737187471875718767187771878718797188071881718827188371884718857188671887718887188971890718917189271893718947189571896718977189871899719007190171902719037190471905719067190771908719097191071911719127191371914719157191671917719187191971920719217192271923719247192571926719277192871929719307193171932719337193471935719367193771938719397194071941719427194371944719457194671947719487194971950719517195271953719547195571956719577195871959719607196171962719637196471965719667196771968719697197071971719727197371974719757197671977719787197971980719817198271983719847198571986719877198871989719907199171992719937199471995719967199771998719997200072001720027200372004720057200672007720087200972010720117201272013720147201572016720177201872019720207202172022720237202472025720267202772028720297203072031720327203372034720357203672037720387203972040720417204272043720447204572046720477204872049720507205172052720537205472055720567205772058720597206072061720627206372064720657206672067720687206972070720717207272073720747207572076720777207872079720807208172082720837208472085720867208772088720897209072091720927209372094720957209672097720987209972100721017210272103721047210572106721077210872109721107211172112721137211472115721167211772118721197212072121721227212372124721257212672127721287212972130721317213272133721347213572136721377213872139721407214172142721437214472145721467214772148721497215072151721527215372154721557215672157721587215972160721617216272163721647216572166721677216872169721707217172172721737217472175721767217772178721797218072181721827218372184721857218672187721887218972190721917219272193721947219572196721977219872199722007220172202722037220472205722067220772208722097221072211722127221372214722157221672217722187221972220722217222272223722247222572226722277222872229722307223172232722337223472235722367223772238722397224072241722427224372244722457224672247722487224972250722517225272253722547225572256722577225872259722607226172262722637226472265722667226772268722697227072271722727227372274722757227672277722787227972280722817228272283722847228572286722877228872289722907229172292722937229472295722967229772298722997230072301723027230372304723057230672307723087230972310723117231272313723147231572316723177231872319723207232172322723237232472325723267232772328723297233072331723327233372334723357233672337723387233972340723417234272343723447234572346723477234872349723507235172352723537235472355723567235772358723597236072361723627236372364723657236672367723687236972370723717237272373723747237572376723777237872379723807238172382723837238472385723867238772388723897239072391723927239372394723957239672397723987239972400724017240272403724047240572406724077240872409724107241172412724137241472415724167241772418724197242072421724227242372424724257242672427724287242972430724317243272433724347243572436724377243872439724407244172442724437244472445724467244772448724497245072451724527245372454724557245672457724587245972460724617246272463724647246572466724677246872469724707247172472724737247472475724767247772478724797248072481724827248372484724857248672487724887248972490724917249272493724947249572496724977249872499725007250172502725037250472505725067250772508725097251072511725127251372514725157251672517725187251972520725217252272523725247252572526725277252872529725307253172532725337253472535725367253772538725397254072541725427254372544725457254672547725487254972550725517255272553725547255572556725577255872559725607256172562725637256472565725667256772568725697257072571725727257372574725757257672577725787257972580725817258272583725847258572586725877258872589725907259172592725937259472595725967259772598725997260072601726027260372604726057260672607726087260972610726117261272613726147261572616726177261872619726207262172622726237262472625726267262772628726297263072631726327263372634726357263672637726387263972640726417264272643726447264572646726477264872649726507265172652726537265472655726567265772658726597266072661726627266372664726657266672667726687266972670726717267272673726747267572676726777267872679726807268172682726837268472685726867268772688726897269072691726927269372694726957269672697726987269972700727017270272703727047270572706727077270872709727107271172712727137271472715727167271772718727197272072721727227272372724727257272672727727287272972730727317273272733727347273572736727377273872739727407274172742727437274472745727467274772748727497275072751727527275372754727557275672757727587275972760727617276272763727647276572766727677276872769727707277172772727737277472775727767277772778727797278072781727827278372784727857278672787727887278972790727917279272793727947279572796727977279872799728007280172802728037280472805728067280772808728097281072811728127281372814728157281672817728187281972820728217282272823728247282572826728277282872829728307283172832728337283472835728367283772838728397284072841728427284372844728457284672847728487284972850728517285272853728547285572856728577285872859728607286172862728637286472865728667286772868728697287072871728727287372874728757287672877728787287972880728817288272883728847288572886728877288872889728907289172892728937289472895728967289772898728997290072901729027290372904729057290672907729087290972910729117291272913729147291572916729177291872919729207292172922729237292472925729267292772928729297293072931729327293372934729357293672937729387293972940729417294272943729447294572946729477294872949729507295172952729537295472955729567295772958729597296072961729627296372964729657296672967729687296972970729717297272973729747297572976729777297872979729807298172982729837298472985729867298772988729897299072991729927299372994729957299672997729987299973000730017300273003730047300573006730077300873009730107301173012730137301473015730167301773018730197302073021730227302373024730257302673027730287302973030730317303273033730347303573036730377303873039730407304173042730437304473045730467304773048730497305073051730527305373054730557305673057730587305973060730617306273063730647306573066730677306873069730707307173072730737307473075730767307773078730797308073081730827308373084730857308673087730887308973090730917309273093730947309573096730977309873099731007310173102731037310473105731067310773108731097311073111731127311373114731157311673117731187311973120731217312273123731247312573126731277312873129731307313173132731337313473135731367313773138731397314073141731427314373144731457314673147731487314973150731517315273153731547315573156731577315873159731607316173162731637316473165731667316773168731697317073171731727317373174731757317673177731787317973180731817318273183731847318573186731877318873189731907319173192731937319473195731967319773198731997320073201732027320373204732057320673207732087320973210732117321273213732147321573216732177321873219732207322173222732237322473225732267322773228732297323073231732327323373234732357323673237732387323973240732417324273243732447324573246732477324873249732507325173252732537325473255732567325773258732597326073261732627326373264732657326673267732687326973270732717327273273732747327573276732777327873279732807328173282732837328473285732867328773288732897329073291732927329373294732957329673297732987329973300733017330273303733047330573306733077330873309733107331173312733137331473315733167331773318733197332073321733227332373324733257332673327733287332973330733317333273333733347333573336733377333873339733407334173342733437334473345733467334773348733497335073351733527335373354733557335673357733587335973360733617336273363733647336573366733677336873369733707337173372733737337473375733767337773378733797338073381733827338373384733857338673387733887338973390733917339273393733947339573396733977339873399734007340173402734037340473405734067340773408734097341073411734127341373414734157341673417734187341973420734217342273423734247342573426734277342873429734307343173432734337343473435734367343773438734397344073441734427344373444734457344673447734487344973450734517345273453734547345573456734577345873459734607346173462734637346473465734667346773468734697347073471734727347373474734757347673477734787347973480734817348273483734847348573486734877348873489734907349173492734937349473495734967349773498734997350073501735027350373504735057350673507735087350973510735117351273513735147351573516735177351873519735207352173522735237352473525735267352773528735297353073531735327353373534735357353673537735387353973540735417354273543735447354573546735477354873549735507355173552735537355473555735567355773558735597356073561735627356373564735657356673567735687356973570735717357273573735747357573576735777357873579735807358173582735837358473585735867358773588735897359073591735927359373594735957359673597735987359973600736017360273603736047360573606736077360873609736107361173612736137361473615736167361773618736197362073621736227362373624736257362673627736287362973630736317363273633736347363573636736377363873639736407364173642736437364473645736467364773648736497365073651736527365373654736557365673657736587365973660736617366273663736647366573666736677366873669736707367173672736737367473675736767367773678736797368073681736827368373684736857368673687736887368973690736917369273693736947369573696736977369873699737007370173702737037370473705737067370773708737097371073711737127371373714737157371673717737187371973720737217372273723737247372573726737277372873729737307373173732737337373473735737367373773738737397374073741737427374373744737457374673747737487374973750737517375273753737547375573756737577375873759737607376173762737637376473765737667376773768737697377073771737727377373774737757377673777737787377973780737817378273783737847378573786737877378873789737907379173792737937379473795737967379773798737997380073801738027380373804738057380673807738087380973810738117381273813738147381573816738177381873819738207382173822738237382473825738267382773828738297383073831738327383373834738357383673837738387383973840738417384273843738447384573846738477384873849738507385173852738537385473855738567385773858738597386073861738627386373864738657386673867738687386973870738717387273873738747387573876738777387873879738807388173882738837388473885738867388773888738897389073891738927389373894738957389673897738987389973900739017390273903739047390573906739077390873909739107391173912739137391473915739167391773918739197392073921739227392373924739257392673927739287392973930739317393273933739347393573936739377393873939739407394173942739437394473945739467394773948739497395073951739527395373954739557395673957739587395973960739617396273963739647396573966739677396873969739707397173972739737397473975739767397773978739797398073981739827398373984739857398673987739887398973990739917399273993739947399573996739977399873999740007400174002740037400474005740067400774008740097401074011740127401374014740157401674017740187401974020740217402274023740247402574026740277402874029740307403174032740337403474035740367403774038740397404074041740427404374044740457404674047740487404974050740517405274053740547405574056740577405874059740607406174062740637406474065740667406774068740697407074071740727407374074740757407674077740787407974080740817408274083740847408574086740877408874089740907409174092740937409474095740967409774098740997410074101741027410374104741057410674107741087410974110741117411274113741147411574116741177411874119741207412174122741237412474125741267412774128741297413074131741327413374134741357413674137741387413974140741417414274143741447414574146741477414874149741507415174152741537415474155741567415774158741597416074161741627416374164741657416674167741687416974170741717417274173741747417574176741777417874179741807418174182741837418474185741867418774188741897419074191741927419374194741957419674197741987419974200742017420274203742047420574206742077420874209742107421174212742137421474215742167421774218742197422074221742227422374224742257422674227742287422974230742317423274233742347423574236742377423874239742407424174242742437424474245742467424774248742497425074251742527425374254742557425674257742587425974260742617426274263742647426574266742677426874269742707427174272742737427474275742767427774278742797428074281742827428374284742857428674287742887428974290742917429274293742947429574296742977429874299743007430174302743037430474305743067430774308743097431074311743127431374314743157431674317743187431974320743217432274323743247432574326743277432874329743307433174332743337433474335743367433774338743397434074341743427434374344743457434674347743487434974350743517435274353743547435574356743577435874359743607436174362743637436474365743667436774368743697437074371743727437374374743757437674377743787437974380743817438274383743847438574386743877438874389743907439174392743937439474395743967439774398743997440074401744027440374404744057440674407744087440974410744117441274413744147441574416744177441874419744207442174422744237442474425744267442774428744297443074431744327443374434744357443674437744387443974440744417444274443744447444574446744477444874449744507445174452744537445474455744567445774458744597446074461744627446374464744657446674467744687446974470744717447274473744747447574476744777447874479744807448174482744837448474485744867448774488744897449074491744927449374494744957449674497744987449974500745017450274503745047450574506745077450874509745107451174512745137451474515745167451774518745197452074521745227452374524745257452674527745287452974530745317453274533745347453574536745377453874539745407454174542745437454474545745467454774548745497455074551745527455374554745557455674557745587455974560745617456274563745647456574566745677456874569745707457174572745737457474575745767457774578745797458074581745827458374584745857458674587745887458974590745917459274593745947459574596745977459874599746007460174602746037460474605746067460774608746097461074611746127461374614746157461674617746187461974620746217462274623746247462574626746277462874629746307463174632746337463474635746367463774638746397464074641746427464374644746457464674647746487464974650746517465274653746547465574656746577465874659746607466174662746637466474665746667466774668746697467074671746727467374674746757467674677746787467974680746817468274683746847468574686746877468874689746907469174692746937469474695746967469774698746997470074701747027470374704747057470674707747087470974710747117471274713747147471574716747177471874719747207472174722747237472474725747267472774728747297473074731747327473374734747357473674737747387473974740747417474274743747447474574746747477474874749747507475174752747537475474755747567475774758747597476074761747627476374764747657476674767747687476974770747717477274773747747477574776747777477874779747807478174782747837478474785747867478774788747897479074791747927479374794747957479674797747987479974800748017480274803748047480574806748077480874809748107481174812748137481474815748167481774818748197482074821748227482374824748257482674827748287482974830748317483274833748347483574836748377483874839748407484174842748437484474845748467484774848748497485074851748527485374854748557485674857748587485974860748617486274863748647486574866748677486874869748707487174872748737487474875748767487774878748797488074881748827488374884748857488674887748887488974890748917489274893748947489574896748977489874899749007490174902749037490474905749067490774908749097491074911749127491374914749157491674917749187491974920749217492274923749247492574926749277492874929749307493174932749337493474935749367493774938749397494074941749427494374944749457494674947749487494974950749517495274953749547495574956749577495874959749607496174962749637496474965749667496774968749697497074971749727497374974749757497674977749787497974980749817498274983749847498574986749877498874989749907499174992749937499474995749967499774998749997500075001750027500375004750057500675007750087500975010750117501275013750147501575016750177501875019750207502175022750237502475025750267502775028750297503075031750327503375034750357503675037750387503975040750417504275043750447504575046750477504875049750507505175052750537505475055750567505775058750597506075061750627506375064750657506675067750687506975070750717507275073750747507575076750777507875079750807508175082750837508475085750867508775088750897509075091750927509375094750957509675097750987509975100751017510275103751047510575106751077510875109751107511175112751137511475115751167511775118751197512075121751227512375124751257512675127751287512975130751317513275133751347513575136751377513875139751407514175142751437514475145751467514775148751497515075151751527515375154751557515675157751587515975160751617516275163751647516575166751677516875169751707517175172751737517475175751767517775178751797518075181751827518375184751857518675187751887518975190751917519275193751947519575196751977519875199752007520175202752037520475205752067520775208752097521075211752127521375214752157521675217752187521975220752217522275223752247522575226752277522875229752307523175232752337523475235752367523775238752397524075241752427524375244752457524675247752487524975250752517525275253752547525575256752577525875259752607526175262752637526475265752667526775268752697527075271752727527375274752757527675277752787527975280752817528275283752847528575286752877528875289752907529175292752937529475295752967529775298752997530075301753027530375304753057530675307753087530975310753117531275313753147531575316753177531875319753207532175322753237532475325753267532775328753297533075331753327533375334753357533675337753387533975340753417534275343753447534575346753477534875349753507535175352753537535475355753567535775358753597536075361753627536375364753657536675367753687536975370753717537275373753747537575376753777537875379753807538175382753837538475385753867538775388753897539075391753927539375394753957539675397753987539975400754017540275403754047540575406754077540875409754107541175412754137541475415754167541775418754197542075421754227542375424754257542675427754287542975430754317543275433754347543575436754377543875439754407544175442754437544475445754467544775448754497545075451754527545375454754557545675457754587545975460754617546275463754647546575466754677546875469754707547175472754737547475475754767547775478754797548075481754827548375484754857548675487754887548975490754917549275493754947549575496754977549875499755007550175502755037550475505755067550775508755097551075511755127551375514755157551675517755187551975520755217552275523755247552575526755277552875529755307553175532755337553475535755367553775538755397554075541755427554375544755457554675547755487554975550755517555275553755547555575556755577555875559755607556175562755637556475565755667556775568755697557075571755727557375574755757557675577755787557975580755817558275583755847558575586755877558875589755907559175592755937559475595755967559775598755997560075601756027560375604756057560675607756087560975610756117561275613756147561575616756177561875619756207562175622756237562475625756267562775628756297563075631756327563375634756357563675637756387563975640756417564275643756447564575646756477564875649756507565175652756537565475655756567565775658756597566075661756627566375664756657566675667756687566975670756717567275673756747567575676756777567875679756807568175682756837568475685756867568775688756897569075691756927569375694756957569675697756987569975700757017570275703757047570575706757077570875709757107571175712757137571475715757167571775718757197572075721757227572375724757257572675727757287572975730757317573275733757347573575736757377573875739757407574175742757437574475745757467574775748757497575075751757527575375754757557575675757757587575975760757617576275763757647576575766757677576875769757707577175772757737577475775757767577775778757797578075781757827578375784757857578675787757887578975790757917579275793757947579575796757977579875799758007580175802758037580475805758067580775808758097581075811758127581375814758157581675817758187581975820758217582275823758247582575826758277582875829758307583175832758337583475835758367583775838758397584075841758427584375844758457584675847758487584975850758517585275853758547585575856758577585875859758607586175862758637586475865758667586775868758697587075871758727587375874758757587675877758787587975880758817588275883758847588575886758877588875889758907589175892758937589475895758967589775898758997590075901759027590375904759057590675907759087590975910759117591275913759147591575916759177591875919759207592175922759237592475925759267592775928759297593075931759327593375934759357593675937759387593975940759417594275943759447594575946759477594875949759507595175952759537595475955759567595775958759597596075961759627596375964759657596675967759687596975970759717597275973759747597575976759777597875979759807598175982759837598475985759867598775988759897599075991759927599375994759957599675997759987599976000760017600276003760047600576006760077600876009760107601176012760137601476015760167601776018760197602076021760227602376024760257602676027760287602976030760317603276033760347603576036760377603876039760407604176042760437604476045760467604776048760497605076051760527605376054760557605676057760587605976060760617606276063760647606576066760677606876069760707607176072760737607476075760767607776078760797608076081760827608376084760857608676087760887608976090760917609276093760947609576096760977609876099761007610176102761037610476105761067610776108761097611076111761127611376114761157611676117761187611976120761217612276123761247612576126761277612876129761307613176132761337613476135761367613776138761397614076141761427614376144761457614676147761487614976150761517615276153761547615576156761577615876159761607616176162761637616476165761667616776168761697617076171761727617376174761757617676177761787617976180761817618276183761847618576186761877618876189761907619176192761937619476195761967619776198761997620076201762027620376204762057620676207762087620976210762117621276213762147621576216762177621876219762207622176222762237622476225762267622776228762297623076231762327623376234762357623676237762387623976240762417624276243762447624576246762477624876249762507625176252762537625476255762567625776258762597626076261762627626376264762657626676267762687626976270762717627276273762747627576276762777627876279762807628176282762837628476285762867628776288762897629076291762927629376294762957629676297762987629976300763017630276303763047630576306763077630876309763107631176312763137631476315763167631776318763197632076321763227632376324763257632676327763287632976330763317633276333763347633576336763377633876339763407634176342763437634476345763467634776348763497635076351763527635376354763557635676357763587635976360763617636276363763647636576366763677636876369763707637176372763737637476375763767637776378763797638076381763827638376384763857638676387763887638976390763917639276393763947639576396763977639876399764007640176402764037640476405764067640776408764097641076411764127641376414764157641676417764187641976420764217642276423764247642576426764277642876429764307643176432764337643476435764367643776438764397644076441764427644376444764457644676447764487644976450764517645276453764547645576456764577645876459764607646176462764637646476465764667646776468764697647076471764727647376474764757647676477764787647976480764817648276483764847648576486764877648876489764907649176492764937649476495764967649776498764997650076501765027650376504765057650676507765087650976510765117651276513765147651576516765177651876519765207652176522765237652476525765267652776528765297653076531765327653376534765357653676537765387653976540765417654276543765447654576546765477654876549765507655176552765537655476555765567655776558765597656076561765627656376564765657656676567765687656976570765717657276573765747657576576765777657876579765807658176582765837658476585765867658776588765897659076591765927659376594765957659676597765987659976600766017660276603766047660576606766077660876609766107661176612766137661476615766167661776618766197662076621766227662376624766257662676627766287662976630766317663276633766347663576636766377663876639766407664176642766437664476645766467664776648766497665076651766527665376654766557665676657766587665976660766617666276663766647666576666766677666876669766707667176672766737667476675766767667776678766797668076681766827668376684766857668676687766887668976690766917669276693766947669576696766977669876699767007670176702767037670476705767067670776708767097671076711767127671376714767157671676717767187671976720767217672276723767247672576726767277672876729767307673176732767337673476735767367673776738767397674076741767427674376744767457674676747767487674976750767517675276753767547675576756767577675876759767607676176762767637676476765767667676776768767697677076771767727677376774767757677676777767787677976780767817678276783767847678576786767877678876789767907679176792767937679476795767967679776798767997680076801768027680376804768057680676807768087680976810768117681276813768147681576816768177681876819768207682176822768237682476825768267682776828768297683076831768327683376834768357683676837768387683976840768417684276843768447684576846768477684876849768507685176852768537685476855768567685776858768597686076861768627686376864768657686676867768687686976870768717687276873768747687576876768777687876879768807688176882768837688476885768867688776888768897689076891768927689376894768957689676897768987689976900769017690276903769047690576906769077690876909769107691176912769137691476915769167691776918769197692076921769227692376924769257692676927769287692976930769317693276933769347693576936769377693876939769407694176942769437694476945769467694776948769497695076951769527695376954769557695676957769587695976960769617696276963769647696576966769677696876969769707697176972769737697476975769767697776978769797698076981769827698376984769857698676987769887698976990769917699276993769947699576996769977699876999770007700177002770037700477005770067700777008770097701077011770127701377014770157701677017770187701977020770217702277023770247702577026770277702877029770307703177032770337703477035770367703777038770397704077041770427704377044770457704677047770487704977050770517705277053770547705577056770577705877059770607706177062770637706477065770667706777068770697707077071770727707377074770757707677077770787707977080770817708277083770847708577086770877708877089770907709177092770937709477095770967709777098770997710077101771027710377104771057710677107771087710977110771117711277113771147711577116771177711877119771207712177122771237712477125771267712777128771297713077131771327713377134771357713677137771387713977140771417714277143771447714577146771477714877149771507715177152771537715477155771567715777158771597716077161771627716377164771657716677167771687716977170771717717277173771747717577176771777717877179771807718177182771837718477185771867718777188771897719077191771927719377194771957719677197771987719977200772017720277203772047720577206772077720877209772107721177212772137721477215772167721777218772197722077221772227722377224772257722677227772287722977230772317723277233772347723577236772377723877239772407724177242772437724477245772467724777248772497725077251772527725377254772557725677257772587725977260772617726277263772647726577266772677726877269772707727177272772737727477275772767727777278772797728077281772827728377284772857728677287772887728977290772917729277293772947729577296772977729877299773007730177302773037730477305773067730777308773097731077311773127731377314773157731677317773187731977320773217732277323773247732577326773277732877329773307733177332773337733477335773367733777338773397734077341773427734377344773457734677347773487734977350773517735277353773547735577356773577735877359773607736177362773637736477365773667736777368773697737077371773727737377374773757737677377773787737977380773817738277383773847738577386773877738877389773907739177392773937739477395773967739777398773997740077401774027740377404774057740677407774087740977410774117741277413774147741577416774177741877419774207742177422774237742477425774267742777428774297743077431774327743377434774357743677437774387743977440774417744277443774447744577446774477744877449774507745177452774537745477455774567745777458774597746077461774627746377464774657746677467774687746977470774717747277473774747747577476774777747877479774807748177482774837748477485774867748777488774897749077491774927749377494774957749677497774987749977500775017750277503775047750577506775077750877509775107751177512775137751477515775167751777518775197752077521775227752377524775257752677527775287752977530775317753277533775347753577536775377753877539775407754177542775437754477545775467754777548775497755077551775527755377554775557755677557775587755977560775617756277563775647756577566775677756877569775707757177572775737757477575775767757777578775797758077581775827758377584775857758677587775887758977590775917759277593775947759577596775977759877599776007760177602776037760477605776067760777608776097761077611776127761377614776157761677617776187761977620776217762277623776247762577626776277762877629776307763177632776337763477635776367763777638776397764077641776427764377644776457764677647776487764977650776517765277653776547765577656776577765877659776607766177662776637766477665776667766777668776697767077671776727767377674776757767677677776787767977680776817768277683776847768577686776877768877689776907769177692776937769477695776967769777698776997770077701777027770377704777057770677707777087770977710777117771277713777147771577716777177771877719777207772177722777237772477725777267772777728777297773077731777327773377734777357773677737777387773977740777417774277743777447774577746777477774877749777507775177752777537775477755777567775777758777597776077761777627776377764777657776677767777687776977770777717777277773777747777577776777777777877779777807778177782777837778477785777867778777788777897779077791777927779377794777957779677797777987779977800778017780277803778047780577806778077780877809778107781177812778137781477815778167781777818778197782077821778227782377824778257782677827778287782977830778317783277833778347783577836778377783877839778407784177842778437784477845778467784777848778497785077851778527785377854778557785677857778587785977860778617786277863778647786577866778677786877869778707787177872778737787477875778767787777878778797788077881778827788377884778857788677887778887788977890778917789277893778947789577896778977789877899779007790177902779037790477905779067790777908779097791077911779127791377914779157791677917779187791977920779217792277923779247792577926779277792877929779307793177932779337793477935779367793777938779397794077941779427794377944779457794677947779487794977950779517795277953779547795577956779577795877959779607796177962779637796477965779667796777968779697797077971779727797377974779757797677977779787797977980779817798277983779847798577986779877798877989779907799177992779937799477995779967799777998779997800078001780027800378004780057800678007780087800978010780117801278013780147801578016780177801878019780207802178022780237802478025780267802778028780297803078031780327803378034780357803678037780387803978040780417804278043780447804578046780477804878049780507805178052780537805478055780567805778058780597806078061780627806378064780657806678067780687806978070780717807278073780747807578076780777807878079780807808178082780837808478085780867808778088780897809078091780927809378094780957809678097780987809978100781017810278103781047810578106781077810878109781107811178112781137811478115781167811778118781197812078121781227812378124781257812678127781287812978130781317813278133781347813578136781377813878139781407814178142781437814478145781467814778148781497815078151781527815378154781557815678157781587815978160781617816278163781647816578166781677816878169781707817178172781737817478175781767817778178781797818078181781827818378184781857818678187781887818978190781917819278193781947819578196781977819878199782007820178202782037820478205782067820778208782097821078211782127821378214782157821678217782187821978220782217822278223782247822578226782277822878229782307823178232782337823478235782367823778238782397824078241782427824378244782457824678247782487824978250782517825278253782547825578256782577825878259782607826178262782637826478265782667826778268782697827078271782727827378274782757827678277782787827978280782817828278283782847828578286782877828878289782907829178292782937829478295782967829778298782997830078301783027830378304783057830678307783087830978310783117831278313783147831578316783177831878319783207832178322783237832478325783267832778328783297833078331783327833378334783357833678337783387833978340783417834278343783447834578346783477834878349783507835178352783537835478355783567835778358783597836078361783627836378364783657836678367783687836978370783717837278373783747837578376783777837878379783807838178382783837838478385783867838778388783897839078391783927839378394783957839678397783987839978400784017840278403784047840578406784077840878409784107841178412784137841478415784167841778418784197842078421784227842378424784257842678427784287842978430784317843278433784347843578436784377843878439784407844178442784437844478445784467844778448784497845078451784527845378454784557845678457784587845978460784617846278463784647846578466784677846878469784707847178472784737847478475784767847778478784797848078481784827848378484784857848678487784887848978490784917849278493784947849578496784977849878499785007850178502785037850478505785067850778508785097851078511785127851378514785157851678517785187851978520785217852278523785247852578526785277852878529785307853178532785337853478535785367853778538785397854078541785427854378544785457854678547785487854978550785517855278553785547855578556785577855878559785607856178562785637856478565785667856778568785697857078571785727857378574785757857678577785787857978580785817858278583785847858578586785877858878589785907859178592785937859478595785967859778598785997860078601786027860378604786057860678607786087860978610786117861278613786147861578616786177861878619786207862178622786237862478625786267862778628786297863078631786327863378634786357863678637786387863978640786417864278643786447864578646786477864878649786507865178652786537865478655786567865778658786597866078661786627866378664786657866678667786687866978670786717867278673786747867578676786777867878679786807868178682786837868478685786867868778688786897869078691786927869378694786957869678697786987869978700787017870278703787047870578706787077870878709787107871178712787137871478715787167871778718787197872078721787227872378724787257872678727787287872978730787317873278733787347873578736787377873878739787407874178742787437874478745787467874778748787497875078751787527875378754787557875678757787587875978760787617876278763787647876578766787677876878769787707877178772787737877478775787767877778778787797878078781787827878378784787857878678787787887878978790787917879278793787947879578796787977879878799788007880178802788037880478805788067880778808788097881078811788127881378814788157881678817788187881978820788217882278823788247882578826788277882878829788307883178832788337883478835788367883778838788397884078841788427884378844788457884678847788487884978850788517885278853788547885578856788577885878859788607886178862788637886478865788667886778868788697887078871788727887378874788757887678877788787887978880788817888278883788847888578886788877888878889788907889178892788937889478895788967889778898788997890078901789027890378904789057890678907789087890978910789117891278913789147891578916789177891878919789207892178922789237892478925789267892778928789297893078931789327893378934789357893678937789387893978940789417894278943789447894578946789477894878949789507895178952789537895478955789567895778958789597896078961789627896378964789657896678967789687896978970789717897278973789747897578976789777897878979789807898178982789837898478985789867898778988789897899078991789927899378994789957899678997789987899979000790017900279003790047900579006790077900879009790107901179012790137901479015790167901779018790197902079021790227902379024790257902679027790287902979030790317903279033790347903579036790377903879039790407904179042790437904479045790467904779048790497905079051790527905379054790557905679057790587905979060790617906279063790647906579066790677906879069790707907179072790737907479075790767907779078790797908079081790827908379084790857908679087790887908979090790917909279093790947909579096790977909879099791007910179102791037910479105791067910779108791097911079111791127911379114791157911679117791187911979120791217912279123791247912579126791277912879129791307913179132791337913479135791367913779138791397914079141791427914379144791457914679147791487914979150791517915279153791547915579156791577915879159791607916179162791637916479165791667916779168791697917079171791727917379174791757917679177791787917979180791817918279183791847918579186791877918879189791907919179192791937919479195791967919779198791997920079201792027920379204792057920679207792087920979210792117921279213792147921579216792177921879219792207922179222792237922479225792267922779228792297923079231792327923379234792357923679237792387923979240792417924279243792447924579246792477924879249792507925179252792537925479255792567925779258792597926079261792627926379264792657926679267792687926979270792717927279273792747927579276792777927879279792807928179282792837928479285792867928779288792897929079291792927929379294792957929679297792987929979300793017930279303793047930579306793077930879309793107931179312793137931479315793167931779318793197932079321793227932379324793257932679327793287932979330793317933279333793347933579336793377933879339793407934179342793437934479345793467934779348793497935079351793527935379354793557935679357793587935979360793617936279363793647936579366793677936879369793707937179372793737937479375793767937779378793797938079381793827938379384793857938679387793887938979390793917939279393793947939579396793977939879399794007940179402794037940479405794067940779408794097941079411794127941379414794157941679417794187941979420794217942279423794247942579426794277942879429794307943179432794337943479435794367943779438794397944079441794427944379444794457944679447794487944979450794517945279453794547945579456794577945879459794607946179462794637946479465794667946779468794697947079471794727947379474794757947679477794787947979480794817948279483794847948579486794877948879489794907949179492794937949479495794967949779498794997950079501795027950379504795057950679507795087950979510795117951279513795147951579516795177951879519795207952179522795237952479525795267952779528795297953079531795327953379534795357953679537795387953979540795417954279543795447954579546795477954879549795507955179552795537955479555795567955779558795597956079561795627956379564795657956679567795687956979570795717957279573795747957579576795777957879579795807958179582795837958479585795867958779588795897959079591795927959379594795957959679597795987959979600796017960279603796047960579606796077960879609796107961179612796137961479615796167961779618796197962079621796227962379624796257962679627796287962979630796317963279633796347963579636796377963879639796407964179642796437964479645796467964779648796497965079651796527965379654796557965679657796587965979660796617966279663796647966579666796677966879669796707967179672796737967479675796767967779678796797968079681796827968379684796857968679687796887968979690796917969279693796947969579696796977969879699797007970179702797037970479705797067970779708797097971079711797127971379714797157971679717797187971979720797217972279723797247972579726797277972879729797307973179732797337973479735797367973779738797397974079741797427974379744797457974679747797487974979750797517975279753797547975579756797577975879759797607976179762797637976479765797667976779768797697977079771797727977379774797757977679777797787977979780797817978279783797847978579786797877978879789797907979179792797937979479795797967979779798797997980079801798027980379804798057980679807798087980979810798117981279813798147981579816798177981879819798207982179822798237982479825798267982779828798297983079831798327983379834798357983679837798387983979840798417984279843798447984579846798477984879849798507985179852798537985479855798567985779858798597986079861798627986379864798657986679867798687986979870798717987279873798747987579876798777987879879798807988179882798837988479885798867988779888798897989079891798927989379894798957989679897798987989979900799017990279903799047990579906799077990879909799107991179912799137991479915799167991779918799197992079921799227992379924799257992679927799287992979930799317993279933799347993579936799377993879939799407994179942799437994479945799467994779948799497995079951799527995379954799557995679957799587995979960799617996279963799647996579966799677996879969799707997179972799737997479975799767997779978799797998079981799827998379984799857998679987799887998979990799917999279993799947999579996799977999879999800008000180002800038000480005800068000780008800098001080011800128001380014800158001680017800188001980020800218002280023800248002580026800278002880029800308003180032800338003480035800368003780038800398004080041800428004380044800458004680047800488004980050800518005280053800548005580056800578005880059800608006180062800638006480065800668006780068800698007080071800728007380074800758007680077800788007980080800818008280083800848008580086800878008880089800908009180092800938009480095800968009780098800998010080101801028010380104801058010680107801088010980110801118011280113801148011580116801178011880119801208012180122801238012480125801268012780128801298013080131801328013380134801358013680137801388013980140801418014280143801448014580146801478014880149801508015180152801538015480155801568015780158801598016080161801628016380164801658016680167801688016980170801718017280173801748017580176801778017880179801808018180182801838018480185801868018780188801898019080191801928019380194801958019680197801988019980200802018020280203802048020580206802078020880209802108021180212802138021480215802168021780218802198022080221802228022380224802258022680227802288022980230802318023280233802348023580236802378023880239802408024180242802438024480245802468024780248802498025080251802528025380254802558025680257802588025980260802618026280263802648026580266802678026880269802708027180272802738027480275802768027780278802798028080281802828028380284802858028680287802888028980290802918029280293802948029580296802978029880299803008030180302803038030480305803068030780308803098031080311803128031380314803158031680317803188031980320803218032280323803248032580326803278032880329803308033180332803338033480335803368033780338803398034080341803428034380344803458034680347803488034980350803518035280353803548035580356803578035880359803608036180362803638036480365803668036780368803698037080371803728037380374803758037680377803788037980380803818038280383803848038580386803878038880389803908039180392803938039480395803968039780398803998040080401804028040380404804058040680407804088040980410804118041280413804148041580416804178041880419804208042180422804238042480425804268042780428804298043080431804328043380434804358043680437804388043980440804418044280443804448044580446804478044880449804508045180452804538045480455804568045780458804598046080461804628046380464804658046680467804688046980470804718047280473804748047580476804778047880479804808048180482804838048480485804868048780488804898049080491804928049380494804958049680497804988049980500805018050280503805048050580506805078050880509805108051180512805138051480515805168051780518805198052080521805228052380524805258052680527805288052980530805318053280533805348053580536805378053880539805408054180542805438054480545805468054780548805498055080551805528055380554805558055680557805588055980560805618056280563805648056580566805678056880569805708057180572805738057480575805768057780578805798058080581805828058380584805858058680587805888058980590805918059280593805948059580596805978059880599806008060180602806038060480605806068060780608806098061080611806128061380614806158061680617806188061980620806218062280623806248062580626806278062880629806308063180632806338063480635806368063780638806398064080641806428064380644806458064680647806488064980650806518065280653806548065580656806578065880659806608066180662806638066480665806668066780668806698067080671806728067380674806758067680677806788067980680806818068280683806848068580686806878068880689806908069180692806938069480695806968069780698806998070080701807028070380704807058070680707807088070980710807118071280713807148071580716807178071880719807208072180722807238072480725807268072780728807298073080731807328073380734807358073680737807388073980740807418074280743807448074580746807478074880749807508075180752807538075480755807568075780758807598076080761807628076380764807658076680767807688076980770807718077280773807748077580776807778077880779807808078180782807838078480785807868078780788807898079080791807928079380794807958079680797807988079980800808018080280803808048080580806808078080880809808108081180812808138081480815808168081780818808198082080821808228082380824808258082680827808288082980830808318083280833808348083580836808378083880839808408084180842808438084480845808468084780848808498085080851808528085380854808558085680857808588085980860808618086280863808648086580866808678086880869808708087180872808738087480875808768087780878808798088080881808828088380884808858088680887808888088980890808918089280893808948089580896808978089880899809008090180902809038090480905809068090780908809098091080911809128091380914809158091680917809188091980920809218092280923809248092580926809278092880929809308093180932809338093480935809368093780938809398094080941809428094380944809458094680947809488094980950809518095280953809548095580956809578095880959809608096180962809638096480965809668096780968809698097080971809728097380974809758097680977809788097980980809818098280983809848098580986809878098880989809908099180992809938099480995809968099780998809998100081001810028100381004810058100681007810088100981010810118101281013810148101581016810178101881019810208102181022810238102481025810268102781028810298103081031810328103381034810358103681037810388103981040810418104281043810448104581046810478104881049810508105181052810538105481055810568105781058810598106081061810628106381064810658106681067810688106981070810718107281073810748107581076810778107881079810808108181082810838108481085810868108781088810898109081091810928109381094810958109681097810988109981100811018110281103811048110581106811078110881109811108111181112811138111481115811168111781118811198112081121811228112381124811258112681127811288112981130811318113281133811348113581136811378113881139811408114181142811438114481145811468114781148811498115081151811528115381154811558115681157811588115981160811618116281163811648116581166811678116881169811708117181172811738117481175811768117781178811798118081181811828118381184811858118681187811888118981190811918119281193811948119581196811978119881199812008120181202812038120481205812068120781208812098121081211812128121381214812158121681217812188121981220812218122281223812248122581226812278122881229812308123181232812338123481235812368123781238812398124081241812428124381244812458124681247812488124981250812518125281253812548125581256812578125881259812608126181262812638126481265812668126781268812698127081271812728127381274812758127681277812788127981280812818128281283812848128581286812878128881289812908129181292812938129481295812968129781298812998130081301813028130381304813058130681307813088130981310813118131281313813148131581316813178131881319813208132181322813238132481325813268132781328813298133081331813328133381334813358133681337813388133981340813418134281343813448134581346813478134881349813508135181352813538135481355813568135781358813598136081361813628136381364813658136681367813688136981370813718137281373813748137581376813778137881379813808138181382813838138481385813868138781388813898139081391813928139381394813958139681397813988139981400814018140281403814048140581406814078140881409814108141181412814138141481415814168141781418814198142081421814228142381424814258142681427814288142981430814318143281433814348143581436814378143881439814408144181442814438144481445814468144781448814498145081451814528145381454814558145681457814588145981460814618146281463814648146581466814678146881469814708147181472814738147481475814768147781478814798148081481814828148381484814858148681487814888148981490814918149281493814948149581496814978149881499815008150181502815038150481505815068150781508815098151081511815128151381514815158151681517815188151981520815218152281523815248152581526815278152881529815308153181532815338153481535815368153781538815398154081541815428154381544815458154681547815488154981550815518155281553815548155581556815578155881559815608156181562815638156481565815668156781568815698157081571815728157381574815758157681577815788157981580815818158281583815848158581586815878158881589815908159181592815938159481595815968159781598815998160081601816028160381604816058160681607816088160981610816118161281613816148161581616816178161881619816208162181622816238162481625816268162781628816298163081631816328163381634816358163681637816388163981640816418164281643816448164581646816478164881649816508165181652816538165481655816568165781658816598166081661816628166381664816658166681667816688166981670816718167281673816748167581676816778167881679816808168181682816838168481685816868168781688816898169081691816928169381694816958169681697816988169981700817018170281703817048170581706817078170881709817108171181712817138171481715817168171781718817198172081721817228172381724817258172681727817288172981730817318173281733817348173581736817378173881739817408174181742817438174481745817468174781748817498175081751817528175381754817558175681757817588175981760817618176281763817648176581766817678176881769817708177181772817738177481775817768177781778817798178081781817828178381784817858178681787817888178981790817918179281793817948179581796817978179881799818008180181802818038180481805818068180781808818098181081811818128181381814818158181681817818188181981820818218182281823818248182581826818278182881829818308183181832818338183481835818368183781838818398184081841818428184381844818458184681847818488184981850818518185281853818548185581856818578185881859818608186181862818638186481865818668186781868818698187081871818728187381874818758187681877818788187981880818818188281883818848188581886818878188881889818908189181892818938189481895818968189781898818998190081901819028190381904819058190681907819088190981910819118191281913819148191581916819178191881919819208192181922819238192481925819268192781928819298193081931819328193381934819358193681937819388193981940819418194281943819448194581946819478194881949819508195181952819538195481955819568195781958819598196081961819628196381964819658196681967819688196981970819718197281973819748197581976819778197881979819808198181982819838198481985819868198781988819898199081991819928199381994819958199681997819988199982000820018200282003820048200582006820078200882009820108201182012820138201482015820168201782018820198202082021820228202382024820258202682027820288202982030820318203282033820348203582036820378203882039820408204182042820438204482045820468204782048820498205082051820528205382054820558205682057820588205982060820618206282063820648206582066820678206882069820708207182072820738207482075820768207782078820798208082081820828208382084820858208682087820888208982090820918209282093820948209582096820978209882099821008210182102821038210482105821068210782108821098211082111821128211382114821158211682117821188211982120821218212282123821248212582126821278212882129821308213182132821338213482135821368213782138821398214082141821428214382144821458214682147821488214982150821518215282153821548215582156821578215882159821608216182162821638216482165821668216782168821698217082171821728217382174821758217682177821788217982180821818218282183821848218582186821878218882189821908219182192821938219482195821968219782198821998220082201822028220382204822058220682207822088220982210822118221282213822148221582216822178221882219822208222182222822238222482225822268222782228822298223082231822328223382234822358223682237822388223982240822418224282243822448224582246822478224882249822508225182252822538225482255822568225782258822598226082261822628226382264822658226682267822688226982270822718227282273822748227582276822778227882279822808228182282822838228482285822868228782288822898229082291822928229382294822958229682297822988229982300823018230282303823048230582306823078230882309823108231182312823138231482315823168231782318823198232082321823228232382324823258232682327823288232982330823318233282333823348233582336823378233882339823408234182342823438234482345823468234782348823498235082351823528235382354823558235682357823588235982360823618236282363823648236582366823678236882369823708237182372823738237482375823768237782378823798238082381823828238382384823858238682387823888238982390823918239282393823948239582396823978239882399824008240182402824038240482405824068240782408824098241082411824128241382414824158241682417824188241982420824218242282423824248242582426824278242882429824308243182432824338243482435824368243782438824398244082441824428244382444824458244682447824488244982450824518245282453824548245582456824578245882459824608246182462824638246482465824668246782468824698247082471824728247382474824758247682477824788247982480824818248282483824848248582486824878248882489824908249182492824938249482495824968249782498824998250082501825028250382504825058250682507825088250982510825118251282513825148251582516825178251882519825208252182522825238252482525825268252782528825298253082531825328253382534825358253682537825388253982540825418254282543825448254582546825478254882549825508255182552825538255482555825568255782558825598256082561825628256382564825658256682567825688256982570825718257282573825748257582576825778257882579825808258182582825838258482585825868258782588825898259082591825928259382594825958259682597825988259982600826018260282603826048260582606826078260882609826108261182612826138261482615826168261782618826198262082621826228262382624826258262682627826288262982630826318263282633826348263582636826378263882639826408264182642826438264482645826468264782648826498265082651826528265382654826558265682657826588265982660826618266282663826648266582666826678266882669826708267182672826738267482675826768267782678826798268082681826828268382684826858268682687826888268982690826918269282693826948269582696826978269882699827008270182702 |
- /*!
- * DevExtreme (dx.viz.debug.js)
- * Version: 19.1.16
- * Build date: Tue Oct 18 2022
- *
- * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
- * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
- */
- "use strict";
- ! function(modules) {
- var installedModules = {};
- function __webpack_require__(moduleId) {
- if (installedModules[moduleId]) {
- return installedModules[moduleId].exports
- }
- var module = installedModules[moduleId] = {
- i: moduleId,
- l: false,
- exports: {}
- };
- modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- module.l = true;
- return module.exports
- }
- __webpack_require__.m = modules;
- __webpack_require__.c = installedModules;
- __webpack_require__.d = function(exports, name, getter) {
- if (!__webpack_require__.o(exports, name)) {
- Object.defineProperty(exports, name, {
- configurable: false,
- enumerable: true,
- get: getter
- })
- }
- };
- __webpack_require__.n = function(module) {
- var getter = module && module.__esModule ? function() {
- return module.default
- } : function() {
- return module
- };
- __webpack_require__.d(getter, "a", getter);
- return getter
- };
- __webpack_require__.o = function(object, property) {
- return Object.prototype.hasOwnProperty.call(object, property)
- };
- __webpack_require__.p = "";
- return __webpack_require__(__webpack_require__.s = 865)
- }([
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/utils/extend.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isPlainObject = __webpack_require__( /*! ./type */ 1).isPlainObject;
- var extendFromObject = function(target, source, overrideExistingValues) {
- target = target || {};
- for (var prop in source) {
- if (Object.prototype.hasOwnProperty.call(source, prop)) {
- var value = source[prop];
- if (!(prop in target) || overrideExistingValues) {
- target[prop] = value
- }
- }
- }
- return target
- };
- var extend = function extend(target) {
- target = target || {};
- var i = 1;
- var deep = false;
- if ("boolean" === typeof target) {
- deep = target;
- target = arguments[1] || {};
- i++
- }
- for (; i < arguments.length; i++) {
- var source = arguments[i];
- if (null == source) {
- continue
- }
- for (var key in source) {
- var targetValue = target[key];
- var sourceValue = source[key];
- var sourceValueIsArray = false;
- var clone;
- if ("__proto__" === key || target === sourceValue) {
- continue
- }
- if (deep && sourceValue && (isPlainObject(sourceValue) || (sourceValueIsArray = Array.isArray(sourceValue)))) {
- if (sourceValueIsArray) {
- clone = targetValue && Array.isArray(targetValue) ? targetValue : []
- } else {
- clone = targetValue && isPlainObject(targetValue) ? targetValue : {}
- }
- target[key] = extend(deep, clone, sourceValue)
- } else {
- if (void 0 !== sourceValue) {
- target[key] = sourceValue
- }
- }
- }
- }
- return target
- };
- exports.extend = extend;
- exports.extendFromObject = extendFromObject
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/core/utils/type.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var types = {
- "[object Array]": "array",
- "[object Date]": "date",
- "[object Object]": "object",
- "[object String]": "string",
- "[object Null]": "null"
- };
- var type = function(object) {
- var typeOfObject = Object.prototype.toString.call(object);
- return "object" === _typeof(object) ? types[typeOfObject] || "object" : _typeof(object)
- };
- var isBoolean = function(object) {
- return "boolean" === typeof object
- };
- var isExponential = function(value) {
- return isNumeric(value) && value.toString().indexOf("e") !== -1
- };
- var isDate = function(object) {
- return "date" === type(object)
- };
- var isDefined = function(object) {
- return null !== object && void 0 !== object
- };
- var isFunction = function(object) {
- return "function" === typeof object
- };
- var isString = function(object) {
- return "string" === typeof object
- };
- var isNumeric = function(object) {
- return "number" === typeof object && isFinite(object) || !isNaN(object - parseFloat(object))
- };
- var isObject = function(object) {
- return "object" === type(object)
- };
- var isEmptyObject = function(object) {
- var property;
- for (property in object) {
- return false
- }
- return true
- };
- var isPlainObject = function(object) {
- if (!object || "[object Object]" !== Object.prototype.toString.call(object)) {
- return false
- }
- var proto = Object.getPrototypeOf(object);
- var ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
- return "function" === typeof ctor && Object.toString.call(ctor) === Object.toString.call(Object)
- };
- var isPrimitive = function(value) {
- return ["object", "array", "function"].indexOf(type(value)) === -1
- };
- var isWindow = function(object) {
- return null != object && object === object.window
- };
- var isRenderer = function(object) {
- return !!(object.jquery || object.dxRenderer)
- };
- var isPromise = function(object) {
- return object && isFunction(object.then)
- };
- var isDeferred = function(object) {
- return object && isFunction(object.done) && isFunction(object.fail)
- };
- exports.isBoolean = isBoolean;
- exports.isExponential = isExponential;
- exports.isDate = isDate;
- exports.isDefined = isDefined;
- exports.isFunction = isFunction;
- exports.isString = isString;
- exports.isNumeric = isNumeric;
- exports.isObject = isObject;
- exports.isEmptyObject = isEmptyObject;
- exports.isPlainObject = isPlainObject;
- exports.isPrimitive = isPrimitive;
- exports.isWindow = isWindow;
- exports.isRenderer = isRenderer;
- exports.isPromise = isPromise;
- exports.isDeferred = isDeferred;
- exports.type = type
- },
- /*!***********************************************!*\
- !*** ./artifacts/transpiled/core/renderer.js ***!
- \***********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var rendererBase = __webpack_require__( /*! ./renderer_base */ 253);
- module.exports = rendererBase.get()
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/iterator.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var map = function(values, callback) {
- if (Array.isArray(values)) {
- return values.map(callback)
- }
- var result = [];
- for (var key in values) {
- result.push(callback(values[key], key))
- }
- return result
- };
- var each = function(values, callback) {
- if (!values) {
- return
- }
- if ("length" in values) {
- for (var i = 0; i < values.length; i++) {
- if (false === callback.call(values[i], i, values[i])) {
- break
- }
- }
- } else {
- for (var key in values) {
- if (false === callback.call(values[key], key, values[key])) {
- break
- }
- }
- }
- return values
- };
- var reverseEach = function(array, callback) {
- if (!array || !("length" in array) || 0 === array.length) {
- return
- }
- for (var i = array.length - 1; i >= 0; i--) {
- if (false === callback.call(array[i], i, array[i])) {
- break
- }
- }
- };
- exports.map = map;
- exports.each = each;
- exports.reverseEach = reverseEach
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/utils/common.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _config = __webpack_require__( /*! ../config */ 31);
- var _config2 = _interopRequireDefault(_config);
- var _guid = __webpack_require__( /*! ../guid */ 40);
- var _guid2 = _interopRequireDefault(_guid);
- var _deferred = __webpack_require__( /*! ../utils/deferred */ 6);
- var _iterator = __webpack_require__( /*! ./iterator */ 3);
- var _data = __webpack_require__( /*! ./data */ 20);
- var _type = __webpack_require__( /*! ./type */ 1);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var ensureDefined = function(value, defaultValue) {
- return (0, _type.isDefined)(value) ? value : defaultValue
- };
- var executeAsync = function(action, context) {
- var deferred = new _deferred.Deferred;
- var normalizedContext = context || this;
- var task = {
- promise: deferred.promise(),
- abort: function() {
- clearTimeout(timerId);
- deferred.rejectWith(normalizedContext)
- }
- };
- var callback = function() {
- var result = action.call(normalizedContext);
- if (result && result.done && (0, _type.isFunction)(result.done)) {
- result.done(function() {
- deferred.resolveWith(normalizedContext)
- })
- } else {
- deferred.resolveWith(normalizedContext)
- }
- };
- var timerId = (arguments[2] || setTimeout)(callback, "number" === typeof context ? context : 0);
- return task
- };
- var delayedFuncs = [];
- var delayedNames = [];
- var delayedDeferreds = [];
- var executingName;
- var deferExecute = function(name, func, deferred) {
- if (executingName && executingName !== name) {
- delayedFuncs.push(func);
- delayedNames.push(name);
- deferred = deferred || new _deferred.Deferred;
- delayedDeferreds.push(deferred);
- return deferred
- } else {
- var oldExecutingName = executingName;
- var currentDelayedCount = delayedDeferreds.length;
- executingName = name;
- var result = func();
- if (!result) {
- if (delayedDeferreds.length > currentDelayedCount) {
- result = _deferred.when.apply(this, delayedDeferreds.slice(currentDelayedCount))
- } else {
- if (deferred) {
- deferred.resolve()
- }
- }
- }
- executingName = oldExecutingName;
- if (deferred && result && result.done) {
- result.done(deferred.resolve).fail(deferred.reject)
- }
- if (!executingName && delayedFuncs.length) {
- ("render" === delayedNames.shift() ? deferRender : deferUpdate)(delayedFuncs.shift(), delayedDeferreds.shift())
- }
- return result || (0, _deferred.when)()
- }
- };
- var deferRender = function(func, deferred) {
- return deferExecute("render", func, deferred)
- };
- var deferUpdate = function(func, deferred) {
- return deferExecute("update", func, deferred)
- };
- var deferRenderer = function(func) {
- return function() {
- var that = this;
- return deferExecute("render", function() {
- return func.call(that)
- })
- }
- };
- var deferUpdater = function(func) {
- return function() {
- var that = this;
- return deferExecute("update", function() {
- return func.call(that)
- })
- }
- };
- var findBestMatches = function(targetFilter, items, mapFn) {
- var bestMatches = [];
- var maxMatchCount = 0;
- (0, _iterator.each)(items, function(index, itemSrc) {
- var matchCount = 0;
- var item = mapFn ? mapFn(itemSrc) : itemSrc;
- (0, _iterator.each)(targetFilter, function(paramName, targetValue) {
- var value = item[paramName];
- if (void 0 === value) {
- return
- }
- if (match(value, targetValue)) {
- matchCount++;
- return
- }
- matchCount = -1;
- return false
- });
- if (matchCount < maxMatchCount) {
- return
- }
- if (matchCount > maxMatchCount) {
- bestMatches.length = 0;
- maxMatchCount = matchCount
- }
- bestMatches.push(itemSrc)
- });
- return bestMatches
- };
- var match = function(value, targetValue) {
- if (Array.isArray(value) && Array.isArray(targetValue)) {
- var mismatch = false;
- (0, _iterator.each)(value, function(index, valueItem) {
- if (valueItem !== targetValue[index]) {
- mismatch = true;
- return false
- }
- });
- if (mismatch) {
- return false
- }
- return true
- }
- if (value === targetValue) {
- return true
- }
- return false
- };
- var splitPair = function(raw) {
- switch (_typeof(raw)) {
- case "string":
- return raw.split(/\s+/, 2);
- case "object":
- return [raw.x || raw.h, raw.y || raw.v];
- case "number":
- return [raw];
- default:
- return raw
- }
- };
- var normalizeKey = function(id) {
- var key = (0, _type.isString)(id) ? id : id.toString();
- var arr = key.match(/[^a-zA-Z0-9_]/g);
- arr && (0, _iterator.each)(arr, function(_, sign) {
- key = key.replace(sign, "__" + sign.charCodeAt() + "__")
- });
- return key
- };
- var denormalizeKey = function(key) {
- var arr = key.match(/__\d+__/g);
- arr && arr.forEach(function(char) {
- var charCode = parseInt(char.replace("__", ""));
- key = key.replace(char, String.fromCharCode(charCode))
- });
- return key
- };
- var isArraysEqualByValue = function(array1, array2, deep) {
- if (array1.length !== array2.length) {
- return false
- }
- for (var i = 0; i < array1.length; i++) {
- if (!equalByValue(array1[i], array2[i], deep + 1)) {
- return false
- }
- }
- return true
- };
- var isObjectsEqualByValue = function(object1, object2, deep) {
- for (var propertyName in object1) {
- if (Object.prototype.hasOwnProperty.call(object1, propertyName) && !equalByValue(object1[propertyName], object2[propertyName], deep + 1)) {
- return false
- }
- }
- for (var _propertyName in object2) {
- if (!(_propertyName in object1)) {
- return false
- }
- }
- return true
- };
- var pairToObject = function(raw, preventRound) {
- var pair = splitPair(raw);
- var h = preventRound ? parseFloat(pair && pair[0]) : parseInt(pair && pair[0], 10);
- var v = preventRound ? parseFloat(pair && pair[1]) : parseInt(pair && pair[1], 10);
- if (!isFinite(h)) {
- h = 0
- }
- if (!isFinite(v)) {
- v = h
- }
- return {
- h: h,
- v: v
- }
- };
- var maxEqualityDeep = 3;
- var equalByValue = function(object1, object2, deep) {
- deep = deep || 0;
- object1 = (0, _data.toComparable)(object1, true);
- object2 = (0, _data.toComparable)(object2, true);
- if (object1 === object2 || deep >= maxEqualityDeep) {
- return true
- }
- if ((0, _type.isObject)(object1) && (0, _type.isObject)(object2)) {
- return isObjectsEqualByValue(object1, object2, deep)
- } else {
- if (Array.isArray(object1) && Array.isArray(object2)) {
- return isArraysEqualByValue(object1, object2, deep)
- }
- }
- return false
- };
- var getKeyHash = function(key) {
- if (key instanceof _guid2.default) {
- return key.toString()
- } else {
- if ((0, _type.isObject)(key) || Array.isArray(key)) {
- try {
- var keyHash = JSON.stringify(key);
- return "{}" === keyHash ? key : keyHash
- } catch (e) {
- return key
- }
- }
- }
- return key
- };
- var escapeRegExp = function(string) {
- return string.replace(/[[\]{}\-()*+?.\\^$|\s]/g, "\\$&")
- };
- var applyServerDecimalSeparator = function(value) {
- var separator = (0, _config2.default)().serverDecimalSeparator;
- if ((0, _type.isDefined)(value)) {
- value = value.toString().replace(".", separator)
- }
- return value
- };
- var noop = function() {};
- var asyncNoop = function() {
- return (new _deferred.Deferred).resolve().promise()
- };
- var grep = function(elements, checkFunction, invert) {
- var result = [];
- var expectedCheck = !invert;
- for (var i = 0; i < elements.length; i++) {
- var check = !!checkFunction(elements[i], i);
- if (check === expectedCheck) {
- result.push(elements[i])
- }
- }
- return result
- };
- exports.ensureDefined = ensureDefined;
- exports.executeAsync = executeAsync;
- exports.deferRender = deferRender;
- exports.deferRenderer = deferRenderer;
- exports.deferUpdate = deferUpdate;
- exports.deferUpdater = deferUpdater;
- exports.pairToObject = pairToObject;
- exports.splitPair = splitPair;
- exports.findBestMatches = findBestMatches;
- exports.normalizeKey = normalizeKey;
- exports.denormalizeKey = denormalizeKey;
- exports.equalByValue = equalByValue;
- exports.getKeyHash = getKeyHash;
- exports.escapeRegExp = escapeRegExp;
- exports.applyServerDecimalSeparator = applyServerDecimalSeparator;
- exports.noop = noop;
- exports.asyncNoop = asyncNoop;
- exports.grep = grep
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/events/core/events_engine.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var registerEventCallbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 122);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var injector = __webpack_require__( /*! ../../core/utils/dependency_injector */ 54);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var isWindow = typeUtils.isWindow;
- var isFunction = typeUtils.isFunction;
- var isString = typeUtils.isString;
- var errors = __webpack_require__( /*! ../../core/errors */ 21);
- var WeakMap = __webpack_require__( /*! ../../core/polyfills/weak_map */ 176);
- var hookTouchProps = __webpack_require__( /*! ../../events/core/hook_touch_props */ 254);
- var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
- var EMPTY_EVENT_NAME = "dxEmptyEventType";
- var NATIVE_EVENTS_TO_SUBSCRIBE = {
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- };
- var NATIVE_EVENTS_TO_TRIGGER = {
- focusin: "focus",
- focusout: "blur"
- };
- var NO_BUBBLE_EVENTS = ["blur", "focus", "load"];
- var forcePassiveFalseEventNames = ["touchmove", "wheel", "mousewheel", "touchstart"];
- var matchesSafe = function(target, selector) {
- return !isWindow(target) && "#document" !== target.nodeName && domAdapter.elementMatches(target, selector)
- };
- var elementDataMap = new WeakMap;
- var guid = 0;
- var skipEvent;
- var special = function() {
- var specialData = {};
- registerEventCallbacks.add(function(eventName, eventObject) {
- specialData[eventName] = eventObject
- });
- return {
- getField: function(eventName, field) {
- return specialData[eventName] && specialData[eventName][field]
- },
- callMethod: function(eventName, methodName, context, args) {
- return specialData[eventName] && specialData[eventName][methodName] && specialData[eventName][methodName].apply(context, args)
- }
- }
- }();
- var applyForEach = function applyForEach(args, method) {
- var element = args[0];
- if (!element) {
- return
- }
- if (domAdapter.isNode(element) || isWindow(element)) {
- method.apply(eventsEngine, args)
- } else {
- if (!isString(element) && "length" in element) {
- var itemArgs = Array.prototype.slice.call(args, 0);
- Array.prototype.forEach.call(element, function(itemElement) {
- itemArgs[0] = itemElement;
- applyForEach(itemArgs, method)
- })
- } else {
- throw errors.Error("E0025")
- }
- }
- };
- var getHandler = function(method) {
- return function() {
- applyForEach(arguments, method)
- }
- };
- var detectPassiveEventHandlersSupport = function() {
- var isSupported = false;
- try {
- var options = Object.defineProperty({}, "passive", {
- get: function() {
- isSupported = true;
- return true
- }
- });
- window.addEventListener("test", null, options)
- } catch (e) {}
- return isSupported
- };
- var passiveEventHandlersSupported = callOnce(detectPassiveEventHandlersSupport);
- var getHandlersController = function(element, eventName) {
- var elementData = elementDataMap.get(element);
- eventName = eventName || "";
- var eventNameParts = eventName.split(".");
- var namespaces = eventNameParts.slice(1);
- var eventNameIsDefined = !!eventNameParts[0];
- eventName = eventNameParts[0] || EMPTY_EVENT_NAME;
- if (!elementData) {
- elementData = {};
- elementDataMap.set(element, elementData)
- }
- if (!elementData[eventName]) {
- elementData[eventName] = {
- handleObjects: [],
- nativeHandler: null
- }
- }
- var eventData = elementData[eventName];
- return {
- addHandler: function(handler, selector, data) {
- var callHandler = function(e, extraParameters) {
- var handlerArgs = [e];
- var target = e.currentTarget;
- var relatedTarget = e.relatedTarget;
- var secondaryTargetIsInside;
- var result;
- if (eventName in NATIVE_EVENTS_TO_SUBSCRIBE) {
- secondaryTargetIsInside = relatedTarget && target && (relatedTarget === target || target.contains(relatedTarget))
- }
- if (void 0 !== extraParameters) {
- handlerArgs.push(extraParameters)
- }
- special.callMethod(eventName, "handle", element, [e, data]);
- if (!secondaryTargetIsInside) {
- result = handler.apply(target, handlerArgs)
- }
- if (false === result) {
- e.preventDefault();
- e.stopPropagation()
- }
- };
- var wrappedHandler = function(e, extraParameters) {
- if (skipEvent && e.type === skipEvent) {
- return
- }
- e.data = data;
- e.delegateTarget = element;
- if (selector) {
- var currentTarget = e.target;
- while (currentTarget && currentTarget !== element) {
- if (matchesSafe(currentTarget, selector)) {
- e.currentTarget = currentTarget;
- callHandler(e, extraParameters)
- }
- currentTarget = currentTarget.parentNode
- }
- } else {
- e.currentTarget = e.delegateTarget || e.target;
- callHandler(e, extraParameters)
- }
- };
- var handleObject = {
- handler: handler,
- wrappedHandler: wrappedHandler,
- selector: selector,
- type: eventName,
- data: data,
- namespace: namespaces.join("."),
- namespaces: namespaces,
- guid: ++guid
- };
- eventData.handleObjects.push(handleObject);
- var firstHandlerForTheType = 1 === eventData.handleObjects.length;
- var shouldAddNativeListener = firstHandlerForTheType && eventNameIsDefined;
- var nativeListenerOptions;
- if (shouldAddNativeListener) {
- shouldAddNativeListener = !special.callMethod(eventName, "setup", element, [data, namespaces, handler])
- }
- if (shouldAddNativeListener) {
- eventData.nativeHandler = getNativeHandler(eventName);
- if (passiveEventHandlersSupported() && forcePassiveFalseEventNames.indexOf(eventName) > -1) {
- nativeListenerOptions = {
- passive: false
- }
- }
- eventData.removeListener = domAdapter.listen(element, NATIVE_EVENTS_TO_SUBSCRIBE[eventName] || eventName, eventData.nativeHandler, nativeListenerOptions)
- }
- special.callMethod(eventName, "add", element, [handleObject])
- },
- removeHandler: function(handler, selector) {
- var removeByEventName = function(eventName) {
- var eventData = elementData[eventName];
- if (!eventData.handleObjects.length) {
- delete elementData[eventName];
- return
- }
- var removedHandler;
- eventData.handleObjects = eventData.handleObjects.filter(function(handleObject) {
- var skip = namespaces.length && !isSubset(handleObject.namespaces, namespaces) || handler && handleObject.handler !== handler || selector && handleObject.selector !== selector;
- if (!skip) {
- removedHandler = handleObject.handler;
- special.callMethod(eventName, "remove", element, [handleObject])
- }
- return skip
- });
- var lastHandlerForTheType = !eventData.handleObjects.length;
- var shouldRemoveNativeListener = lastHandlerForTheType && eventName !== EMPTY_EVENT_NAME;
- if (shouldRemoveNativeListener) {
- special.callMethod(eventName, "teardown", element, [namespaces, removedHandler]);
- if (eventData.nativeHandler) {
- eventData.removeListener()
- }
- delete elementData[eventName]
- }
- };
- if (eventNameIsDefined) {
- removeByEventName(eventName)
- } else {
- for (var name in elementData) {
- removeByEventName(name)
- }
- }
- var elementDataIsEmpty = 0 === Object.keys(elementData).length;
- if (elementDataIsEmpty) {
- elementDataMap.delete(element)
- }
- },
- callHandlers: function(event, extraParameters) {
- var forceStop = false;
- var handleCallback = function(handleObject) {
- if (forceStop) {
- return
- }
- if (!namespaces.length || isSubset(handleObject.namespaces, namespaces)) {
- handleObject.wrappedHandler(event, extraParameters);
- forceStop = event.isImmediatePropagationStopped()
- }
- };
- eventData.handleObjects.forEach(handleCallback);
- if (namespaces.length && elementData[EMPTY_EVENT_NAME]) {
- elementData[EMPTY_EVENT_NAME].handleObjects.forEach(handleCallback)
- }
- }
- }
- };
- var getNativeHandler = function(subscribeName) {
- return function(event, extraParameters) {
- var handlersController = getHandlersController(this, subscribeName);
- event = eventsEngine.Event(event);
- handlersController.callHandlers(event, extraParameters)
- }
- };
- var isSubset = function(original, checked) {
- for (var i = 0; i < checked.length; i++) {
- if (original.indexOf(checked[i]) < 0) {
- return false
- }
- }
- return true
- };
- var normalizeOnArguments = function(callback) {
- return function(element, eventName, selector, data, handler) {
- if (!handler) {
- handler = data;
- data = void 0
- }
- if ("string" !== typeof selector) {
- data = selector;
- selector = void 0
- }
- if (!handler && "string" === typeof eventName) {
- handler = data || selector;
- selector = void 0;
- data = void 0
- }
- callback(element, eventName, selector, data, handler)
- }
- };
- var normalizeOffArguments = function(callback) {
- return function(element, eventName, selector, handler) {
- if ("function" === typeof selector) {
- handler = selector;
- selector = void 0
- }
- callback(element, eventName, selector, handler)
- }
- };
- var normalizeTriggerArguments = function(callback) {
- return function(element, src, extraParameters) {
- if ("string" === typeof src) {
- src = {
- type: src
- }
- }
- if (!src.target) {
- src.target = element
- }
- src.currentTarget = element;
- if (!src.delegateTarget) {
- src.delegateTarget = element
- }
- if (!src.type && src.originalEvent) {
- src.type = src.originalEvent.type
- }
- callback(element, src instanceof eventsEngine.Event ? src : eventsEngine.Event(src), extraParameters)
- }
- };
- var normalizeEventArguments = function(callback) {
- return function(src, config) {
- if (!(this instanceof eventsEngine.Event)) {
- return new eventsEngine.Event(src, config)
- }
- if (!src) {
- src = {}
- }
- if ("string" === typeof src) {
- src = {
- type: src
- }
- }
- if (!config) {
- config = {}
- }
- callback.call(this, src, config)
- }
- };
- var iterate = function(callback) {
- var iterateEventNames = function(element, eventName) {
- if (eventName && eventName.indexOf(" ") > -1) {
- var args = Array.prototype.slice.call(arguments, 0);
- eventName.split(" ").forEach(function(eventName) {
- args[1] = eventName;
- callback.apply(this, args)
- })
- } else {
- callback.apply(this, arguments)
- }
- };
- return function(element, eventName) {
- if ("object" === _typeof(eventName)) {
- var args = Array.prototype.slice.call(arguments, 0);
- for (var name in eventName) {
- args[1] = name;
- args[args.length - 1] = eventName[name];
- iterateEventNames.apply(this, args)
- }
- } else {
- iterateEventNames.apply(this, arguments)
- }
- }
- };
- var callNativeMethod = function(eventName, element) {
- var nativeMethodName = NATIVE_EVENTS_TO_TRIGGER[eventName] || eventName;
- var isLinkClickEvent = function(eventName, element) {
- return "click" === eventName && "a" === element.localName
- };
- if (isLinkClickEvent(eventName, element)) {
- return
- }
- if (isFunction(element[nativeMethodName])) {
- skipEvent = eventName;
- element[nativeMethodName]();
- skipEvent = void 0
- }
- };
- var calculateWhich = function(event) {
- var setForMouseEvent = function(event) {
- var mouseEventRegex = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
- return !event.which && void 0 !== event.button && mouseEventRegex.test(event.type)
- };
- var setForKeyEvent = function(event) {
- return null == event.which && 0 === event.type.indexOf("key")
- };
- if (setForKeyEvent(event)) {
- return null != event.charCode ? event.charCode : event.keyCode
- }
- if (setForMouseEvent(event)) {
- var whichByButton = {
- 1: 1,
- 2: 3,
- 3: 1,
- 4: 2
- };
- return whichByButton[event.button]
- }
- return event.which
- };
- var eventsEngine = injector({
- on: getHandler(normalizeOnArguments(iterate(function(element, eventName, selector, data, handler) {
- var handlersController = getHandlersController(element, eventName);
- handlersController.addHandler(handler, selector, data)
- }))),
- one: getHandler(normalizeOnArguments(function(element, eventName, selector, data, handler) {
- var oneTimeHandler = function oneTimeHandler() {
- eventsEngine.off(element, eventName, selector, oneTimeHandler);
- handler.apply(this, arguments)
- };
- eventsEngine.on(element, eventName, selector, data, oneTimeHandler)
- })),
- off: getHandler(normalizeOffArguments(iterate(function(element, eventName, selector, handler) {
- var handlersController = getHandlersController(element, eventName);
- handlersController.removeHandler(handler, selector)
- }))),
- trigger: getHandler(normalizeTriggerArguments(function(element, event, extraParameters) {
- var eventName = event.type;
- var handlersController = getHandlersController(element, event.type);
- special.callMethod(eventName, "trigger", element, [event, extraParameters]);
- handlersController.callHandlers(event, extraParameters);
- var noBubble = special.getField(eventName, "noBubble") || event.isPropagationStopped() || NO_BUBBLE_EVENTS.indexOf(eventName) !== -1;
- if (!noBubble) {
- var parents = [];
- var getParents = function getParents(element) {
- var parent = element.parentNode;
- if (parent) {
- parents.push(parent);
- getParents(parent)
- }
- };
- getParents(element);
- parents.push(window);
- var i = 0;
- while (parents[i] && !event.isPropagationStopped()) {
- var parentDataByEvent = getHandlersController(parents[i], event.type);
- parentDataByEvent.callHandlers(extend(event, {
- currentTarget: parents[i]
- }), extraParameters);
- i++
- }
- }
- if (element.nodeType || isWindow(element)) {
- special.callMethod(eventName, "_default", element, [event, extraParameters]);
- callNativeMethod(eventName, element)
- }
- })),
- triggerHandler: getHandler(normalizeTriggerArguments(function(element, event, extraParameters) {
- var handlersController = getHandlersController(element, event.type);
- handlersController.callHandlers(event, extraParameters)
- }))
- });
- var initEvent = function(EventClass) {
- if (EventClass) {
- eventsEngine.Event = EventClass;
- eventsEngine.Event.prototype = EventClass.prototype
- }
- };
- initEvent(normalizeEventArguments(function(src, config) {
- var that = this;
- var propagationStopped = false;
- var immediatePropagationStopped = false;
- var defaultPrevented = false;
- extend(that, src);
- if (src instanceof eventsEngine.Event || windowUtils.hasWindow() && src instanceof window.Event) {
- that.originalEvent = src;
- that.currentTarget = void 0
- }
- if (!(src instanceof eventsEngine.Event)) {
- extend(that, {
- isPropagationStopped: function() {
- return !!(propagationStopped || that.originalEvent && that.originalEvent.propagationStopped)
- },
- stopPropagation: function() {
- propagationStopped = true;
- that.originalEvent && that.originalEvent.stopPropagation()
- },
- isImmediatePropagationStopped: function() {
- return immediatePropagationStopped
- },
- stopImmediatePropagation: function() {
- this.stopPropagation();
- immediatePropagationStopped = true;
- that.originalEvent && that.originalEvent.stopImmediatePropagation()
- },
- isDefaultPrevented: function() {
- return !!(defaultPrevented || that.originalEvent && that.originalEvent.defaultPrevented)
- },
- preventDefault: function() {
- defaultPrevented = true;
- that.originalEvent && that.originalEvent.preventDefault()
- }
- })
- }
- addProperty("which", calculateWhich, that);
- if (0 === src.type.indexOf("touch")) {
- delete config.pageX;
- delete config.pageY
- }
- extend(that, config);
- that.guid = ++guid
- }));
- var addProperty = function(propName, hook, eventInstance) {
- Object.defineProperty(eventInstance || eventsEngine.Event.prototype, propName, {
- enumerable: true,
- configurable: true,
- get: function() {
- return this.originalEvent && hook(this.originalEvent)
- },
- set: function(value) {
- Object.defineProperty(this, propName, {
- enumerable: true,
- configurable: true,
- writable: true,
- value: value
- })
- }
- })
- };
- hookTouchProps(addProperty);
- var beforeSetStrategy = Callbacks();
- var afterSetStrategy = Callbacks();
- eventsEngine.set = function(engine) {
- beforeSetStrategy.fire();
- eventsEngine.inject(engine);
- initEvent(engine.Event);
- afterSetStrategy.fire()
- };
- eventsEngine.subscribeGlobal = function() {
- applyForEach(arguments, normalizeOnArguments(function() {
- var args = arguments;
- eventsEngine.on.apply(this, args);
- beforeSetStrategy.add(function() {
- var offArgs = Array.prototype.slice.call(args, 0);
- offArgs.splice(3, 1);
- eventsEngine.off.apply(this, offArgs)
- });
- afterSetStrategy.add(function() {
- eventsEngine.on.apply(this, args)
- })
- }))
- };
- eventsEngine.forcePassiveFalseEventNames = forcePassiveFalseEventNames;
- eventsEngine.passiveEventHandlersSupported = passiveEventHandlersSupported;
- eventsEngine.elementDataMap = elementDataMap;
- eventsEngine.detectPassiveEventHandlersSupport = detectPassiveEventHandlersSupport;
- module.exports = eventsEngine
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/deferred.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ../utils/type */ 1);
- var isPromise = typeUtils.isPromise;
- var isDeferred = typeUtils.isDeferred;
- var extend = __webpack_require__( /*! ../utils/extend */ 0).extend;
- var Callbacks = __webpack_require__( /*! ../utils/callbacks */ 26);
- var deferredConfig = [{
- method: "resolve",
- handler: "done",
- state: "resolved"
- }, {
- method: "reject",
- handler: "fail",
- state: "rejected"
- }, {
- method: "notify",
- handler: "progress"
- }];
- var _Deferred = function() {
- var that = this;
- this._state = "pending";
- this._promise = {};
- deferredConfig.forEach(function(config) {
- var methodName = config.method;
- this[methodName + "Callbacks"] = new Callbacks;
- this[methodName] = function() {
- return this[methodName + "With"](this._promise, arguments)
- }.bind(this);
- this._promise[config.handler] = function(handler) {
- if (!handler) {
- return this
- }
- var callbacks = that[methodName + "Callbacks"];
- if (callbacks.fired()) {
- handler.apply(that[methodName + "Context"], that[methodName + "Args"])
- } else {
- callbacks.add(function(context, args) {
- handler.apply(context, args)
- }.bind(this))
- }
- return this
- }
- }.bind(this));
- this._promise.always = function(handler) {
- return this.done(handler).fail(handler)
- };
- this._promise.catch = function(handler) {
- return this.then(null, handler)
- };
- this._promise.then = function(resolve, reject) {
- var result = new _Deferred;
- ["done", "fail"].forEach(function(method) {
- var callback = "done" === method ? resolve : reject;
- this[method](function() {
- if (!callback) {
- result["done" === method ? "resolve" : "reject"].apply(this, arguments);
- return
- }
- var callbackResult = callback && callback.apply(this, arguments);
- if (isDeferred(callbackResult)) {
- callbackResult.done(result.resolve).fail(result.reject)
- } else {
- if (isPromise(callbackResult)) {
- callbackResult.then(result.resolve, result.reject)
- } else {
- result.resolve.apply(this, typeUtils.isDefined(callbackResult) ? [callbackResult] : arguments)
- }
- }
- })
- }.bind(this));
- return result.promise()
- };
- this._promise.state = function() {
- return that._state
- };
- this._promise.promise = function(args) {
- return args ? extend(args, that._promise) : that._promise
- };
- this._promise.promise(this)
- };
- deferredConfig.forEach(function(config) {
- var methodName = config.method;
- var state = config.state;
- _Deferred.prototype[methodName + "With"] = function(context, args) {
- var callbacks = this[methodName + "Callbacks"];
- if ("pending" === this.state()) {
- this[methodName + "Args"] = args;
- this[methodName + "Context"] = context;
- if (state) {
- this._state = state
- }
- callbacks.fire(context, args)
- }
- return this
- }
- });
- exports.fromPromise = function(promise, context) {
- if (isDeferred(promise)) {
- return promise
- } else {
- if (isPromise(promise)) {
- var d = new _Deferred;
- promise.then(function() {
- d.resolveWith.apply(d, [context].concat([
- [].slice.call(arguments)
- ]))
- }, function() {
- d.rejectWith.apply(d, [context].concat([
- [].slice.call(arguments)
- ]))
- });
- return d
- }
- }
- return (new _Deferred).resolveWith(context, [promise])
- };
- var when = function() {
- if (1 === arguments.length) {
- return exports.fromPromise(arguments[0])
- }
- var values = [].slice.call(arguments);
- var contexts = [];
- var resolvedCount = 0;
- var deferred = new _Deferred;
- var updateState = function(i) {
- return function(value) {
- contexts[i] = this;
- values[i] = arguments.length > 1 ? [].slice.call(arguments) : value;
- resolvedCount++;
- if (resolvedCount === values.length) {
- deferred.resolveWith(contexts, values)
- }
- }
- };
- for (var i = 0; i < values.length; i++) {
- if (isDeferred(values[i])) {
- values[i].promise().done(updateState(i)).fail(deferred.reject)
- } else {
- resolvedCount++
- }
- }
- if (resolvedCount === values.length) {
- deferred.resolveWith(contexts, values)
- }
- return deferred.promise()
- };
- exports.setStrategy = function(value) {
- _Deferred = value.Deferred;
- when = value.when
- };
- exports.Deferred = function() {
- return new _Deferred
- };
- exports.when = function() {
- return when.apply(this, arguments)
- }
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/utils/window.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
- var _hasWindow = "undefined" !== typeof window;
- var windowObject = _hasWindow && window;
- if (!windowObject) {
- windowObject = {};
- windowObject.window = windowObject
- }
- module.exports = {
- hasWindow: function() {
- return _hasWindow
- },
- getWindow: function() {
- return windowObject
- },
- hasProperty: function(prop) {
- return this.hasWindow() && prop in windowObject
- },
- defaultScreenFactorFunc: function(width) {
- if (width < 768) {
- return "xs"
- } else {
- if (width < 992) {
- return "sm"
- } else {
- if (width < 1200) {
- return "md"
- } else {
- return "lg"
- }
- }
- }
- },
- getCurrentScreenFactor: function(screenFactorCallback) {
- var screenFactorFunc = screenFactorCallback || this.defaultScreenFactorFunc;
- var windowWidth = domAdapter.getDocumentElement().clientWidth;
- return screenFactorFunc(windowWidth)
- },
- getNavigator: function() {
- return this.hasWindow() ? windowObject.navigator : {
- userAgent: ""
- }
- }
- }
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/events/utils.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _events_engine = __webpack_require__( /*! ./core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _errors = __webpack_require__( /*! ../core/errors */ 21);
- var _errors2 = _interopRequireDefault(_errors);
- var _selectors = __webpack_require__( /*! ../ui/widget/selectors */ 66);
- var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
- var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var KEY_MAP = {
- backspace: "backspace",
- tab: "tab",
- enter: "enter",
- escape: "escape",
- pageup: "pageUp",
- pagedown: "pageDown",
- end: "end",
- home: "home",
- arrowleft: "leftArrow",
- arrowup: "upArrow",
- arrowright: "rightArrow",
- arrowdown: "downArrow",
- "delete": "del",
- " ": "space",
- f: "F",
- a: "A",
- "*": "asterisk",
- "-": "minus",
- alt: "alt",
- control: "control",
- shift: "shift",
- left: "leftArrow",
- up: "upArrow",
- right: "rightArrow",
- down: "downArrow",
- multiply: "asterisk",
- spacebar: "space",
- del: "del",
- subtract: "minus",
- esc: "escape"
- };
- var LEGACY_KEY_CODES = {
- 8: "backspace",
- 9: "tab",
- 13: "enter",
- 27: "escape",
- 33: "pageUp",
- 34: "pageDown",
- 35: "end",
- 36: "home",
- 37: "leftArrow",
- 38: "upArrow",
- 39: "rightArrow",
- 40: "downArrow",
- 46: "del",
- 32: "space",
- 70: "F",
- 65: "A",
- 106: "asterisk",
- 109: "minus",
- 189: "minus",
- 173: "minus",
- 16: "shift",
- 17: "control",
- 18: "alt"
- };
- var eventSource = function() {
- var EVENT_SOURCES_REGEX = {
- dx: /^dx/i,
- mouse: /(mouse|wheel)/i,
- touch: /^touch/i,
- keyboard: /^key/i,
- pointer: /^(ms)?pointer/i
- };
- return function(e) {
- var result = "other";
- (0, _iterator.each)(EVENT_SOURCES_REGEX, function(key) {
- if (this.test(e.type)) {
- result = key;
- return false
- }
- });
- return result
- }
- }();
- var isDxEvent = function(e) {
- return "dx" === eventSource(e)
- };
- var isNativeMouseEvent = function(e) {
- return "mouse" === eventSource(e)
- };
- var isNativeTouchEvent = function(e) {
- return "touch" === eventSource(e)
- };
- var isPointerEvent = function(e) {
- return "pointer" === eventSource(e)
- };
- var isMouseEvent = function(e) {
- return isNativeMouseEvent(e) || (isPointerEvent(e) || isDxEvent(e)) && "mouse" === e.pointerType
- };
- var isDxMouseWheelEvent = function(e) {
- return e && "dxmousewheel" === e.type
- };
- var isTouchEvent = function(e) {
- return isNativeTouchEvent(e) || (isPointerEvent(e) || isDxEvent(e)) && "touch" === e.pointerType
- };
- var isKeyboardEvent = function(e) {
- return "keyboard" === eventSource(e)
- };
- var isFakeClickEvent = function(e) {
- return 0 === e.screenX && !e.offsetX && 0 === e.pageX
- };
- var eventData = function(e) {
- return {
- x: e.pageX,
- y: e.pageY,
- time: e.timeStamp
- }
- };
- var eventDelta = function(from, to) {
- return {
- x: to.x - from.x,
- y: to.y - from.y,
- time: to.time - from.time || 1
- }
- };
- var hasTouches = function(e) {
- if (isNativeTouchEvent(e)) {
- return (e.originalEvent.touches || []).length
- }
- if (isDxEvent(e)) {
- return (e.pointers || []).length
- }
- return 0
- };
- var needSkipEvent = function(e) {
- var target = e.target;
- var $target = (0, _renderer2.default)(target);
- var touchInInput = $target.is("input, textarea, select");
- if ($target.is(".dx-skip-gesture-event *, .dx-skip-gesture-event")) {
- return true
- }
- if (isDxMouseWheelEvent(e)) {
- var isTextArea = $target.is("textarea") && $target.hasClass("dx-texteditor-input");
- if (isTextArea) {
- return false
- }
- var isContentEditable = target.isContentEditable || target.hasAttribute("contenteditable");
- if (isContentEditable) {
- return false
- }
- var isInputFocused = $target.is("input[type='number'], textarea, select") && $target.is(":focus");
- return isInputFocused
- }
- if (isMouseEvent(e)) {
- return touchInInput || e.which > 1
- }
- if (isTouchEvent(e)) {
- return touchInInput && (0, _selectors.focused)($target)
- }
- };
- var fixMethod = function(e) {
- return e
- };
- var setEventFixMethod = function(func) {
- fixMethod = func
- };
- var copyEvent = function(originalEvent) {
- return fixMethod(_events_engine2.default.Event(originalEvent, originalEvent), originalEvent)
- };
- var createEvent = function(originalEvent, args) {
- var event = copyEvent(originalEvent);
- if (args) {
- (0, _extend.extend)(event, args)
- }
- return event
- };
- var fireEvent = function(props) {
- var event = createEvent(props.originalEvent, props);
- _events_engine2.default.trigger(props.delegateTarget || event.target, event);
- return event
- };
- var addNamespace = function addNamespace(eventNames, namespace) {
- if (!namespace) {
- throw _errors2.default.Error("E0017")
- }
- if ("string" === typeof eventNames) {
- if (eventNames.indexOf(" ") === -1) {
- return eventNames + "." + namespace
- }
- return addNamespace(eventNames.split(/\s+/g), namespace)
- }(0, _iterator.each)(eventNames, function(index, eventName) {
- eventNames[index] = eventName + "." + namespace
- });
- return eventNames.join(" ")
- };
- var normalizeKeyName = function(event) {
- var isKeySupported = !!event.key;
- var key = isKeySupported ? event.key : event.which;
- if (!key) {
- return
- }
- if (isKeySupported) {
- key = KEY_MAP[key.toLowerCase()] || key
- } else {
- key = LEGACY_KEY_CODES[key] || String.fromCharCode(key)
- }
- return key
- };
- var getChar = function(event) {
- return event.key || String.fromCharCode(event.which)
- };
- module.exports = {
- eventSource: eventSource,
- isPointerEvent: isPointerEvent,
- isMouseEvent: isMouseEvent,
- isDxMouseWheelEvent: isDxMouseWheelEvent,
- isTouchEvent: isTouchEvent,
- isKeyboardEvent: isKeyboardEvent,
- isFakeClickEvent: isFakeClickEvent,
- hasTouches: hasTouches,
- eventData: eventData,
- eventDelta: eventDelta,
- needSkipEvent: needSkipEvent,
- createEvent: createEvent,
- fireEvent: fireEvent,
- addNamespace: addNamespace,
- setEventFixMethod: setEventFixMethod,
- normalizeKeyName: normalizeKeyName,
- getChar: getChar
- }
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/core/component_registrator.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ./renderer */ 2);
- var callbacks = __webpack_require__( /*! ./component_registrator_callbacks */ 153);
- var errors = __webpack_require__( /*! ./errors */ 21);
- var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 131);
- var registerComponent = function(name, namespace, componentClass) {
- if (!componentClass) {
- componentClass = namespace
- } else {
- namespace[name] = componentClass
- }
- publicComponentUtils.name(componentClass, name);
- callbacks.fire(name, componentClass)
- };
- var registerRendererComponent = function(name, componentClass) {
- $.fn[name] = function(options) {
- var isMemberInvoke = "string" === typeof options;
- var result;
- if (isMemberInvoke) {
- var memberName = options;
- var memberArgs = [].slice.call(arguments).slice(1);
- this.each(function() {
- var instance = componentClass.getInstance(this);
- if (!instance) {
- throw errors.Error("E0009", name)
- }
- var member = instance[memberName];
- var memberValue = member.apply(instance, memberArgs);
- if (void 0 === result) {
- result = memberValue
- }
- })
- } else {
- this.each(function() {
- var instance = componentClass.getInstance(this);
- if (instance) {
- instance.option(options)
- } else {
- new componentClass(this, options)
- }
- });
- result = this
- }
- return result
- }
- };
- callbacks.add(registerRendererComponent);
- module.exports = registerComponent
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/viz/core/utils.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
- var dateToMilliseconds = __webpack_require__( /*! ../../core/utils/date */ 22).dateToMilliseconds;
- var isDefined = typeUtils.isDefined;
- var isNumber = typeUtils.isNumeric;
- var isExponential = typeUtils.isExponential;
- var _math = Math;
- var _round = _math.round;
- var _sqrt = Math.sqrt;
- var PI = Math.PI;
- var MAX_PIXEL_COUNT = 1e10;
- var PI_DIV_180 = PI / 180;
- var LN10 = Math.LN10;
- var cosFunc = Math.cos;
- var sinFunc = Math.sin;
- var abs = Math.abs;
- var log = Math.log;
- var floor = Math.floor;
- var ceil = Math.ceil;
- var max = Math.max;
- var _isNaN = isNaN;
- var _Number = Number;
- var _NaN = NaN;
- var getLog = function(value, base) {
- if (!value) {
- return _NaN
- }
- return Math.log(value) / Math.log(base)
- };
- var getAdjustedLog10 = function(value) {
- return adjust(getLog(value, 10))
- };
- var raiseTo = function(power, base) {
- return Math.pow(base, power)
- };
- var normalizeAngle = function(angle) {
- return (angle % 360 + 360) % 360
- };
- var convertAngleToRendererSpace = function(angle) {
- return 90 - angle
- };
- var degreesToRadians = function(value) {
- return PI * value / 180
- };
- var getCosAndSin = function(angle) {
- var angleInRadians = degreesToRadians(angle);
- return {
- cos: cosFunc(angleInRadians),
- sin: sinFunc(angleInRadians)
- }
- };
- var DECIMAL_ORDER_THRESHOLD = 1e-14;
- var getDistance = function(x1, y1, x2, y2) {
- var diffX = x2 - x1;
- var diffY = y2 - y1;
- return Math.sqrt(diffY * diffY + diffX * diffX)
- };
- var getDecimalOrder = function(number) {
- var n = abs(number);
- var cn;
- if (!_isNaN(n)) {
- if (n > 0) {
- n = log(n) / LN10;
- cn = ceil(n);
- return cn - n < DECIMAL_ORDER_THRESHOLD ? cn : floor(n)
- }
- return 0
- }
- return _NaN
- };
- var getAppropriateFormat = function(start, end, count) {
- var order = max(getDecimalOrder(start), getDecimalOrder(end));
- var precision = -getDecimalOrder(abs(end - start) / count);
- var format;
- if (!_isNaN(order) && !_isNaN(precision)) {
- if (abs(order) <= 4) {
- format = "fixedPoint";
- precision < 0 && (precision = 0);
- precision > 4 && (precision = 4)
- } else {
- format = "exponential";
- precision += order - 1;
- precision > 3 && (precision = 3)
- }
- return {
- type: format,
- precision: precision
- }
- }
- return null
- };
- var roundValue = function(value, precision) {
- if (precision > 20) {
- precision = 20
- }
- if (isNumber(value)) {
- if (isExponential(value)) {
- return _Number(value.toExponential(precision))
- } else {
- return _Number(value.toFixed(precision))
- }
- }
- };
- var getPower = function(value) {
- return value.toExponential().split("e")[1]
- };
- function map(array, callback) {
- var i = 0;
- var len = array.length;
- var result = [];
- while (i < len) {
- var value = callback(array[i], i);
- if (null !== value) {
- result.push(value)
- }
- i++
- }
- return result
- }
- function selectByKeys(object, keys) {
- return map(keys, function(key) {
- return object[key] ? object[key] : null
- })
- }
- function decreaseFields(object, keys, eachDecrease, decrease) {
- var dec = decrease;
- each(keys, function(_, key) {
- if (object[key]) {
- object[key] -= eachDecrease;
- dec -= eachDecrease
- }
- });
- return dec
- }
- function normalizeEnum(value) {
- return String(value).toLowerCase()
- }
- function setCanvasValues(canvas) {
- if (canvas) {
- canvas.originalTop = canvas.top;
- canvas.originalBottom = canvas.bottom;
- canvas.originalLeft = canvas.left;
- canvas.originalRight = canvas.right
- }
- return canvas
- }
- function normalizeBBoxField(value) {
- return -MAX_PIXEL_COUNT < value && value < +MAX_PIXEL_COUNT ? value : 0
- }
- function normalizeBBox(bBox) {
- var xl = normalizeBBoxField(floor(bBox.x));
- var yt = normalizeBBoxField(floor(bBox.y));
- var xr = normalizeBBoxField(ceil(bBox.width + bBox.x));
- var yb = normalizeBBoxField(ceil(bBox.height + bBox.y));
- var result = {
- x: xl,
- y: yt,
- width: xr - xl,
- height: yb - yt
- };
- result.isEmpty = !result.x && !result.y && !result.width && !result.height;
- return result
- }
- function rotateBBox(bBox, center, angle) {
- var cos = _Number(cosFunc(angle * PI_DIV_180).toFixed(3));
- var sin = _Number(sinFunc(angle * PI_DIV_180).toFixed(3));
- var w2 = bBox.width / 2;
- var h2 = bBox.height / 2;
- var centerX = bBox.x + w2;
- var centerY = bBox.y + h2;
- var w2_ = abs(w2 * cos) + abs(h2 * sin);
- var h2_ = abs(w2 * sin) + abs(h2 * cos);
- var centerX_ = center[0] + (centerX - center[0]) * cos + (centerY - center[1]) * sin;
- var centerY_ = center[1] - (centerX - center[0]) * sin + (centerY - center[1]) * cos;
- return normalizeBBox({
- x: centerX_ - w2_,
- y: centerY_ - h2_,
- width: 2 * w2_,
- height: 2 * h2_
- })
- }
- extend(exports, {
- decreaseGaps: function(object, keys, decrease) {
- var arrayGaps;
- do {
- arrayGaps = selectByKeys(object, keys);
- arrayGaps.push(_math.ceil(decrease / arrayGaps.length));
- decrease = decreaseFields(object, keys, _math.min.apply(null, arrayGaps), decrease)
- } while (decrease > 0 && arrayGaps.length > 1);
- return decrease
- },
- normalizeEnum: normalizeEnum,
- parseScalar: function(value, defaultValue) {
- return void 0 !== value ? value : defaultValue
- },
- enumParser: function(values) {
- var stored = {};
- var i;
- var ii;
- for (i = 0, ii = values.length; i < ii; ++i) {
- stored[normalizeEnum(values[i])] = 1
- }
- return function(value, defaultValue) {
- var _value = normalizeEnum(value);
- return stored[_value] ? _value : defaultValue
- }
- },
- patchFontOptions: function(options) {
- var fontOptions = {};
- each(options || {}, function(key, value) {
- if (/^(cursor|opacity)$/i.test(key)) {} else {
- if ("color" === key) {
- key = "fill"
- } else {
- key = "font-" + key
- }
- }
- fontOptions[key] = value
- });
- return fontOptions
- },
- convertPolarToXY: function(centerCoords, startAngle, angle, radius) {
- var shiftAngle = 90;
- angle = isDefined(angle) ? angle + startAngle - shiftAngle : 0;
- var cosSin = getCosAndSin(angle);
- return {
- x: _round(centerCoords.x + radius * cosSin.cos),
- y: _round(centerCoords.y + radius * cosSin.sin)
- }
- },
- convertXYToPolar: function(centerCoords, x, y) {
- var radius = getDistance(centerCoords.x, centerCoords.y, x, y);
- var angle = _math.atan2(y - centerCoords.y, x - centerCoords.x);
- return {
- phi: _round(normalizeAngle(180 * angle / _math.PI)),
- r: _round(radius)
- }
- },
- processSeriesTemplate: function(seriesTemplate, items) {
- var customizeSeries = typeUtils.isFunction(seriesTemplate.customizeSeries) ? seriesTemplate.customizeSeries : noop;
- var nameField = seriesTemplate.nameField;
- var generatedSeries = {};
- var seriesOrder = [];
- var series;
- var i = 0;
- items = items || [];
- for (var length = items.length; i < length; i++) {
- var data = items[i];
- if (nameField in data) {
- series = generatedSeries[data[nameField]];
- if (!series) {
- series = generatedSeries[data[nameField]] = {
- name: data[nameField],
- nameFieldValue: data[nameField]
- };
- seriesOrder.push(series.name)
- }
- }
- }
- return map(seriesOrder, function(orderedName) {
- var group = generatedSeries[orderedName];
- return extend(group, customizeSeries.call(null, group.name))
- })
- },
- getCategoriesInfo: function(categories, startValue, endValue) {
- if (0 === categories.length) {
- return {
- categories: []
- }
- }
- startValue = isDefined(startValue) ? startValue : categories[0];
- endValue = isDefined(endValue) ? endValue : categories[categories.length - 1];
- var categoriesValue = map(categories, function(category) {
- return isDefined(category) ? category.valueOf() : null
- });
- var indexStartValue = categoriesValue.indexOf(startValue.valueOf());
- var indexEndValue = categoriesValue.indexOf(endValue.valueOf());
- var inverted = false;
- indexStartValue < 0 && (indexStartValue = 0);
- indexEndValue < 0 && (indexEndValue = categories.length - 1);
- if (indexEndValue < indexStartValue) {
- var swapBuf = indexEndValue;
- indexEndValue = indexStartValue;
- indexStartValue = swapBuf;
- inverted = true
- }
- var visibleCategories = categories.slice(indexStartValue, indexEndValue + 1);
- var lastIdx = visibleCategories.length - 1;
- return {
- categories: visibleCategories,
- start: visibleCategories[inverted ? lastIdx : 0],
- end: visibleCategories[inverted ? 0 : lastIdx],
- inverted: inverted
- }
- },
- setCanvasValues: setCanvasValues,
- updatePanesCanvases: function(panes, canvas, rotated) {
- var weightSum = 0;
- each(panes, function(_, pane) {
- pane.weight = pane.weight || 1;
- weightSum += pane.weight
- });
- var distributedSpace = 0;
- var padding = panes.padding || 10;
- var paneSpace = rotated ? canvas.width - canvas.left - canvas.right : canvas.height - canvas.top - canvas.bottom;
- var oneWeight = (paneSpace - padding * (panes.length - 1)) / weightSum;
- var startName = rotated ? "left" : "top";
- var endName = rotated ? "right" : "bottom";
- each(panes, function(_, pane) {
- var calcLength = _round(pane.weight * oneWeight);
- pane.canvas = pane.canvas || {};
- extend(pane.canvas, canvas);
- pane.canvas[startName] = canvas[startName] + distributedSpace;
- pane.canvas[endName] = canvas[endName] + (paneSpace - calcLength - distributedSpace);
- distributedSpace = distributedSpace + calcLength + padding;
- setCanvasValues(pane.canvas)
- })
- },
- unique: function(array) {
- var values = {};
- return map(array, function(item) {
- var result = !values[item] ? item : null;
- values[item] = true;
- return result
- })
- },
- map: map,
- getVerticallyShiftedAngularCoords: function(bBox, dy, center) {
- var isPositive = bBox.x + bBox.width / 2 >= center.x;
- var horizontalOffset1 = (isPositive ? bBox.x : bBox.x + bBox.width) - center.x;
- var verticalOffset1 = bBox.y - center.y;
- var verticalOffset2 = verticalOffset1 + dy;
- var horizontalOffset2 = _round(_sqrt(horizontalOffset1 * horizontalOffset1 + verticalOffset1 * verticalOffset1 - verticalOffset2 * verticalOffset2));
- var dx = (isPositive ? +horizontalOffset2 : -horizontalOffset2) || horizontalOffset1;
- return {
- x: center.x + (isPositive ? dx : dx - bBox.width),
- y: bBox.y + dy
- }
- },
- mergeMarginOptions: function(opt1, opt2) {
- return {
- checkInterval: opt1.checkInterval || opt2.checkInterval,
- size: Math.max(opt1.size || 0, opt2.size || 0),
- percentStick: opt1.percentStick || opt2.percentStick,
- sizePointNormalState: Math.max(opt1.sizePointNormalState || 0, opt2.sizePointNormalState || 0)
- }
- }
- });
- function getVizRangeObject(value) {
- if (Array.isArray(value)) {
- return {
- startValue: value[0],
- endValue: value[1]
- }
- } else {
- return value || {}
- }
- }
- function convertVisualRangeObject(visualRange, convertToVisualRange) {
- if (convertToVisualRange) {
- return visualRange
- }
- return [visualRange.startValue, visualRange.endValue]
- }
- function getAddFunction(range, correctZeroLevel) {
- if ("datetime" === range.dataType) {
- return function(rangeValue, marginValue) {
- var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;
- return new Date(rangeValue.getTime() + sign * marginValue)
- }
- }
- if ("logarithmic" === range.axisType) {
- return function(rangeValue, marginValue) {
- var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;
- var log = getLog(rangeValue, range.base) + sign * marginValue;
- return raiseTo(log, range.base)
- }
- }
- return function(rangeValue, marginValue) {
- var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;
- var newValue = rangeValue + sign * marginValue;
- return correctZeroLevel && newValue * rangeValue <= 0 ? 0 : newValue
- }
- }
- function adjustVisualRange(options, visualRange, wholeRange, dataRange) {
- var minDefined = typeUtils.isDefined(visualRange.startValue);
- var maxDefined = typeUtils.isDefined(visualRange.endValue);
- var nonDiscrete = "discrete" !== options.axisType;
- dataRange = dataRange || wholeRange;
- var add = getAddFunction(options, false);
- var min = minDefined ? visualRange.startValue : dataRange.min;
- var max = maxDefined ? visualRange.endValue : dataRange.max;
- var rangeLength = visualRange.length;
- var categories = dataRange.categories;
- if (nonDiscrete && !typeUtils.isDefined(min) && !typeUtils.isDefined(max)) {
- return {
- startValue: min,
- endValue: max
- }
- }
- if (isDefined(rangeLength)) {
- if (nonDiscrete) {
- if ("datetime" === options.dataType && !isNumber(rangeLength)) {
- rangeLength = dateToMilliseconds(rangeLength)
- }
- if (maxDefined && !minDefined || !maxDefined && !minDefined) {
- isDefined(wholeRange.max) && (max = max > wholeRange.max ? wholeRange.max : max);
- min = add(max, rangeLength, -1)
- } else {
- if (minDefined && !maxDefined) {
- isDefined(wholeRange.min) && (min = min < wholeRange.min ? wholeRange.min : min);
- max = add(min, rangeLength)
- }
- }
- } else {
- rangeLength = parseInt(rangeLength);
- if (!isNaN(rangeLength) && isFinite(rangeLength)) {
- rangeLength--;
- if (!maxDefined && !minDefined) {
- max = categories[categories.length - 1];
- min = categories[categories.length - 1 - rangeLength]
- } else {
- if (minDefined && !maxDefined) {
- var categoriesInfo = exports.getCategoriesInfo(categories, min, void 0);
- max = categoriesInfo.categories[rangeLength]
- } else {
- if (!minDefined && maxDefined) {
- var _categoriesInfo = exports.getCategoriesInfo(categories, void 0, max);
- min = _categoriesInfo.categories[_categoriesInfo.categories.length - 1 - rangeLength]
- }
- }
- }
- }
- }
- }
- if (nonDiscrete) {
- if (isDefined(wholeRange.max) && max > wholeRange.max) {
- max = wholeRange.max
- }
- if (isDefined(wholeRange.min) && min < wholeRange.min) {
- min = wholeRange.min
- }
- }
- return {
- startValue: min,
- endValue: max
- }
- }
- exports.getVizRangeObject = getVizRangeObject;
- exports.convertVisualRangeObject = convertVisualRangeObject;
- exports.adjustVisualRange = adjustVisualRange;
- exports.getAddFunction = getAddFunction;
- exports.getLog = getLog;
- exports.getAdjustedLog10 = getAdjustedLog10;
- exports.raiseTo = raiseTo;
- exports.normalizeAngle = normalizeAngle;
- exports.convertAngleToRendererSpace = convertAngleToRendererSpace;
- exports.degreesToRadians = degreesToRadians;
- exports.getCosAndSin = getCosAndSin;
- exports.getDecimalOrder = getDecimalOrder;
- exports.getAppropriateFormat = getAppropriateFormat;
- exports.getDistance = getDistance;
- exports.roundValue = roundValue;
- exports.getPower = getPower;
- exports.rotateBBox = rotateBBox;
- exports.normalizeBBox = normalizeBBox
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/core/dom_adapter.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _dependency_injector = __webpack_require__( /*! ./utils/dependency_injector */ 54);
- var _dependency_injector2 = _interopRequireDefault(_dependency_injector);
- var _common = __webpack_require__( /*! ./utils/common */ 4);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var ELEMENT_NODE = 1;
- var TEXT_NODE = 3;
- var DOCUMENT_NODE = 9;
- var nativeDOMAdapterStrategy = {
- querySelectorAll: function(element, selector) {
- return element.querySelectorAll(selector)
- },
- elementMatches: function(element, selector) {
- var _this = this;
- var matches = element.matches || element.matchesSelector || element.mozMatchesSelector || element.msMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector || function(selector) {
- var doc = element.document || element.ownerDocument;
- if (!doc) {
- return false
- }
- var items = _this.querySelectorAll(doc, selector);
- for (var i = 0; i < items.length; i++) {
- if (items[i] === element) {
- return true
- }
- }
- };
- return matches.call(element, selector)
- },
- createElement: function(tagName, context) {
- context = context || this._document;
- return context.createElement(tagName)
- },
- createElementNS: function(ns, tagName, context) {
- context = context || this._document;
- return context.createElementNS(ns, tagName)
- },
- createTextNode: function(text, context) {
- context = context || this._document;
- return context.createTextNode(text)
- },
- isNode: function(element) {
- return "object" === _typeof(element) && "nodeType" in element
- },
- isElementNode: function(element) {
- return element && element.nodeType === ELEMENT_NODE
- },
- isTextNode: function(element) {
- return element && element.nodeType === TEXT_NODE
- },
- isDocument: function(element) {
- return element && element.nodeType === DOCUMENT_NODE
- },
- removeElement: function(element) {
- var parentNode = element && element.parentNode;
- if (parentNode) {
- parentNode.removeChild(element)
- }
- },
- insertElement: function(parentElement, newElement, nextSiblingElement) {
- if (parentElement && newElement && parentElement !== newElement) {
- if (nextSiblingElement) {
- parentElement.insertBefore(newElement, nextSiblingElement)
- } else {
- parentElement.appendChild(newElement)
- }
- }
- },
- getAttribute: function(element, name) {
- return element.getAttribute(name)
- },
- setAttribute: function(element, name, value) {
- element.setAttribute(name, value)
- },
- removeAttribute: function(element, name) {
- element.removeAttribute(name)
- },
- setProperty: function(element, name, value) {
- element[name] = value
- },
- setText: function(element, text) {
- if (element) {
- element.textContent = text
- }
- },
- setClass: function(element, className, isAdd) {
- if (1 === element.nodeType && className) {
- if (element.classList) {
- if (isAdd) {
- element.classList.add(className)
- } else {
- element.classList.remove(className)
- }
- } else {
- var classNameSupported = "string" === typeof element.className;
- var elementClass = classNameSupported ? element.className : this.getAttribute(element, "class") || "";
- var classNames = elementClass.split(" ");
- var classIndex = classNames.indexOf(className);
- var resultClassName;
- if (isAdd && classIndex < 0) {
- resultClassName = elementClass ? elementClass + " " + className : className
- }
- if (!isAdd && classIndex >= 0) {
- classNames.splice(classIndex, 1);
- resultClassName = classNames.join(" ")
- }
- if (void 0 !== resultClassName) {
- if (classNameSupported) {
- element.className = resultClassName
- } else {
- this.setAttribute(element, "class", resultClassName)
- }
- }
- }
- }
- },
- setStyle: function(element, name, value) {
- element.style[name] = value || ""
- },
- _document: "undefined" === typeof document ? void 0 : document,
- getDocument: function() {
- return this._document
- },
- getActiveElement: function() {
- return this._document.activeElement
- },
- getBody: function() {
- return this._document.body
- },
- createDocumentFragment: function() {
- return this._document.createDocumentFragment()
- },
- getDocumentElement: function() {
- return this._document.documentElement
- },
- getLocation: function() {
- return this._document.location
- },
- getSelection: function() {
- return this._document.selection
- },
- getReadyState: function() {
- return this._document.readyState
- },
- getHead: function() {
- return this._document.head
- },
- hasDocumentProperty: function(property) {
- return property in this._document
- },
- listen: function(element, event, callback, options) {
- if (!element || !("addEventListener" in element)) {
- return _common.noop
- }
- element.addEventListener(event, callback, options);
- return function() {
- element.removeEventListener(event, callback)
- }
- }
- };
- module.exports = (0, _dependency_injector2.default)(nativeDOMAdapterStrategy)
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/core/utils/dom.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var config = __webpack_require__( /*! ../../core/config */ 31);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var windowUtils = __webpack_require__( /*! ./window */ 7);
- var window = windowUtils.getWindow();
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var inArray = __webpack_require__( /*! ./array */ 14).inArray;
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var isDefined = typeUtils.isDefined;
- var isRenderer = typeUtils.isRenderer;
- var htmlParser = __webpack_require__( /*! ../../core/utils/html_parser */ 255);
- var elementStrategy;
- var resetActiveElement = function() {
- var activeElement = domAdapter.getActiveElement();
- var body = domAdapter.getBody();
- if (activeElement && activeElement !== body && activeElement.blur) {
- try {
- activeElement.blur()
- } catch (e) {
- body.blur()
- }
- }
- };
- var clearSelection = function() {
- var selection = window.getSelection();
- if (!selection) {
- return
- }
- if ("Caret" === selection.type) {
- return
- }
- if (selection.empty) {
- selection.empty()
- } else {
- if (selection.removeAllRanges) {
- try {
- selection.removeAllRanges()
- } catch (e) {}
- }
- }
- };
- var closestCommonParent = function(startTarget, endTarget) {
- var $startTarget = $(startTarget);
- var $endTarget = $(endTarget);
- if ($startTarget[0] === $endTarget[0]) {
- return $startTarget[0]
- }
- var $startParents = $startTarget.parents();
- var $endParents = $endTarget.parents();
- var startingParent = Math.min($startParents.length, $endParents.length);
- for (var i = -startingParent; i < 0; i++) {
- if ($startParents.get(i) === $endParents.get(i)) {
- return $startParents.get(i)
- }
- }
- };
- var triggerVisibilityChangeEvent = function(eventName) {
- var VISIBILITY_CHANGE_SELECTOR = ".dx-visibility-change-handler";
- return function(element) {
- var $element = $(element || "body");
- var changeHandlers = $element.filter(VISIBILITY_CHANGE_SELECTOR).add($element.find(VISIBILITY_CHANGE_SELECTOR));
- for (var i = 0; i < changeHandlers.length; i++) {
- eventsEngine.triggerHandler(changeHandlers[i], eventName)
- }
- }
- };
- var uniqueId = function() {
- var counter = 0;
- return function(prefix) {
- return (prefix || "") + counter++
- }
- }();
- var dataOptionsAttributeName = "data-options";
- var getElementOptions = function(element) {
- var optionsString = $(element).attr(dataOptionsAttributeName) || "";
- return config().optionsParser(optionsString)
- };
- var createComponents = function(elements, componentTypes) {
- var result = [];
- var selector = "[" + dataOptionsAttributeName + "]";
- var $items = elements.find(selector).add(elements.filter(selector));
- $items.each(function(index, element) {
- var $element = $(element);
- var options = getElementOptions(element);
- for (var componentName in options) {
- if (!componentTypes || inArray(componentName, componentTypes) > -1) {
- if ($element[componentName]) {
- $element[componentName](options[componentName]);
- result.push($element[componentName]("instance"))
- }
- }
- }
- });
- return result
- };
- var createMarkupFromString = function(str) {
- if (!window.WinJS) {
- return $(htmlParser.parseHTML(str))
- }
- var tempElement = $("<div>");
- window.WinJS.Utilities.setInnerHTMLUnsafe(tempElement.get(0), str);
- return tempElement.contents()
- };
- var extractTemplateMarkup = function(element) {
- element = $(element);
- var templateTag = element.length && element.filter(function() {
- var $node = $(this);
- return $node.is("script[type]") && $node.attr("type").indexOf("script") < 0
- });
- if (templateTag.length) {
- return templateTag.eq(0).html()
- } else {
- element = $("<div>").append(element);
- return element.html()
- }
- };
- var normalizeTemplateElement = function normalizeTemplateElement(element) {
- var $element = isDefined(element) && (element.nodeType || isRenderer(element)) ? $(element) : $("<div>").html(element).contents();
- if (1 === $element.length) {
- if ($element.is("script")) {
- $element = normalizeTemplateElement($element.html().trim())
- } else {
- if ($element.is("table")) {
- $element = $element.children("tbody").contents()
- }
- }
- }
- return $element
- };
- var clipboardText = function(event, text) {
- var clipboard = event.originalEvent && event.originalEvent.clipboardData || window.clipboardData;
- if (1 === arguments.length) {
- return clipboard && clipboard.getData("Text")
- }
- clipboard && clipboard.setData("Text", text)
- };
- var contains = function(container, element) {
- if (!element) {
- return false
- }
- element = domAdapter.isTextNode(element) ? element.parentNode : element;
- return domAdapter.isDocument(container) ? container.documentElement.contains(element) : container.contains(element)
- };
- var getPublicElement = function($element) {
- return elementStrategy($element)
- };
- var setPublicElementWrapper = function(value) {
- elementStrategy = value
- };
- setPublicElementWrapper(function(element) {
- return element && element.get(0)
- });
- var createTextElementHiddenCopy = function(element, text, options) {
- var elementStyles = window.getComputedStyle($(element).get(0));
- var includePaddings = options && options.includePaddings;
- return $("<div>").text(text).css({
- fontStyle: elementStyles.fontStyle,
- fontVariant: elementStyles.fontVariant,
- fontWeight: elementStyles.fontWeight,
- fontSize: elementStyles.fontSize,
- fontFamily: elementStyles.fontFamily,
- letterSpacing: elementStyles.letterSpacing,
- border: elementStyles.border,
- paddingTop: includePaddings ? elementStyles.paddingTop : "",
- paddingRight: includePaddings ? elementStyles.paddingRight : "",
- paddingBottom: includePaddings ? elementStyles.paddingBottom : "",
- paddingLeft: includePaddings ? elementStyles.paddingLeft : "",
- visibility: "hidden",
- whiteSpace: "nowrap",
- position: "absolute",
- "float": "left"
- })
- };
- exports.setPublicElementWrapper = setPublicElementWrapper;
- exports.resetActiveElement = resetActiveElement;
- exports.createMarkupFromString = createMarkupFromString;
- exports.triggerShownEvent = triggerVisibilityChangeEvent("dxshown");
- exports.triggerHidingEvent = triggerVisibilityChangeEvent("dxhiding");
- exports.triggerResizeEvent = triggerVisibilityChangeEvent("dxresize");
- exports.getElementOptions = getElementOptions;
- exports.createComponents = createComponents;
- exports.extractTemplateMarkup = extractTemplateMarkup;
- exports.normalizeTemplateElement = normalizeTemplateElement;
- exports.clearSelection = clearSelection;
- exports.uniqueId = uniqueId;
- exports.closestCommonParent = closestCommonParent;
- exports.clipboardText = clipboardText;
- exports.contains = contains;
- exports.getPublicElement = getPublicElement;
- exports.createTextElementHiddenCopy = createTextElementHiddenCopy
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/localization/message.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var stringFormat = __webpack_require__( /*! ../core/utils/string */ 44).format;
- var humanize = __webpack_require__( /*! ../core/utils/inflector */ 33).humanize;
- var coreLocalization = __webpack_require__( /*! ./core */ 87);
- __webpack_require__( /*! ./core */ 87);
- var PARENT_LOCALE_SEPARATOR = "-";
- var baseDictionary = extend(true, {}, __webpack_require__( /*! ./default_messages */ 443));
- var parentLocales = __webpack_require__( /*! ./cldr-data/parentLocales */ 444);
- var getParentLocale = function(locale) {
- var parentLocale = parentLocales[locale];
- if (parentLocale) {
- return "root" !== parentLocale && parentLocale
- }
- return locale.substr(0, locale.lastIndexOf(PARENT_LOCALE_SEPARATOR))
- };
- var getDataByLocale = function(localeData, locale) {
- return localeData[locale] || {}
- };
- var getValueByClosestLocale = function(localeData, locale, key) {
- var value = getDataByLocale(localeData, locale)[key];
- var isRootLocale;
- while (!value && !isRootLocale) {
- locale = getParentLocale(locale);
- if (locale) {
- value = getDataByLocale(localeData, locale)[key]
- } else {
- isRootLocale = true
- }
- }
- return value
- };
- var newMessages = {};
- var messageLocalization = dependencyInjector({
- _dictionary: baseDictionary,
- load: function(messages) {
- extend(true, this._dictionary, messages)
- },
- _localizablePrefix: "@",
- setup: function(localizablePrefix) {
- this._localizablePrefix = localizablePrefix
- },
- localizeString: function(text) {
- var that = this;
- var regex = new RegExp("(^|[^a-zA-Z_0-9" + that._localizablePrefix + "-]+)(" + that._localizablePrefix + "{1,2})([a-zA-Z_0-9-]+)", "g");
- var escapeString = that._localizablePrefix + that._localizablePrefix;
- return text.replace(regex, function(str, prefix, escape, localizationKey) {
- var defaultResult = that._localizablePrefix + localizationKey;
- var result;
- if (escape !== escapeString) {
- result = that.format(localizationKey)
- }
- if (!result) {
- newMessages[localizationKey] = humanize(localizationKey)
- }
- return prefix + (result || defaultResult)
- })
- },
- _messageLoaded: function(key, locale) {
- return void 0 !== getValueByClosestLocale(this._dictionary, locale || coreLocalization.locale(), key)
- },
- localizeNode: function(node) {
- var that = this;
- $(node).each(function(index, nodeItem) {
- if (!nodeItem.nodeType) {
- return
- }
- if (3 === nodeItem.nodeType) {
- nodeItem.nodeValue = that.localizeString(nodeItem.nodeValue)
- } else {
- if (!$(nodeItem).is("iframe")) {
- each(nodeItem.attributes || [], function(index, attr) {
- if ("string" === typeof attr.value) {
- var localizedValue = that.localizeString(attr.value);
- if (attr.value !== localizedValue) {
- attr.value = localizedValue
- }
- }
- });
- $(nodeItem).contents().each(function(index, node) {
- that.localizeNode(node)
- })
- }
- }
- })
- },
- getMessagesByLocales: function() {
- return this._dictionary
- },
- getDictionary: function(onlyNew) {
- if (onlyNew) {
- return newMessages
- }
- return extend({}, newMessages, this.getMessagesByLocales()[coreLocalization.locale()])
- },
- getFormatter: function(key) {
- return this._getFormatterBase(key) || this._getFormatterBase(key, "en")
- },
- _getFormatterBase: function(key, locale) {
- var message = getValueByClosestLocale(this._dictionary, locale || coreLocalization.locale(), key);
- if (message) {
- return function() {
- var args = 1 === arguments.length && Array.isArray(arguments[0]) ? arguments[0].slice(0) : Array.prototype.slice.call(arguments, 0);
- args.unshift(message);
- return stringFormat.apply(this, args)
- }
- }
- },
- format: function(key) {
- var formatter = this.getFormatter(key);
- var values = Array.prototype.slice.call(arguments, 1);
- return formatter && formatter.apply(this, values) || ""
- }
- });
- module.exports = messageLocalization
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/core/utils/array.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isDefined = __webpack_require__( /*! ./type */ 1).isDefined;
- var each = __webpack_require__( /*! ./iterator */ 3).each;
- var objectUtils = __webpack_require__( /*! ./object */ 47);
- var config = __webpack_require__( /*! ../config */ 31);
- var isEmpty = function(entity) {
- return Array.isArray(entity) && !entity.length
- };
- var wrapToArray = function(entity) {
- return Array.isArray(entity) ? entity : [entity]
- };
- var intersection = function(a, b) {
- if (!Array.isArray(a) || 0 === a.length || !Array.isArray(b) || 0 === b.length) {
- return []
- }
- var result = [];
- each(a, function(_, value) {
- var index = inArray(value, b);
- if (index !== -1) {
- result.push(value)
- }
- });
- return result
- };
- var removeDuplicates = function(from, what) {
- if (!Array.isArray(from) || 0 === from.length) {
- return []
- }
- if (!Array.isArray(what) || 0 === what.length) {
- return from.slice()
- }
- var result = [];
- each(from, function(_, value) {
- var index = inArray(value, what);
- if (index === -1) {
- result.push(value)
- }
- });
- return result
- };
- var normalizeIndexes = function(items, indexParameterName, currentItem, needIndexCallback) {
- var indexedItems = {};
- var parameterIndex = 0;
- var useLegacyVisibleIndex = config().useLegacyVisibleIndex;
- each(items, function(index, item) {
- index = item[indexParameterName];
- if (index >= 0) {
- indexedItems[index] = indexedItems[index] || [];
- if (item === currentItem) {
- indexedItems[index].unshift(item)
- } else {
- indexedItems[index].push(item)
- }
- } else {
- item[indexParameterName] = void 0
- }
- });
- if (!useLegacyVisibleIndex) {
- each(items, function() {
- if (!isDefined(this[indexParameterName]) && (!needIndexCallback || needIndexCallback(this))) {
- while (indexedItems[parameterIndex]) {
- parameterIndex++
- }
- indexedItems[parameterIndex] = [this];
- parameterIndex++
- }
- })
- }
- parameterIndex = 0;
- objectUtils.orderEach(indexedItems, function(index, items) {
- each(items, function() {
- if (index >= 0) {
- this[indexParameterName] = parameterIndex++
- }
- })
- });
- if (useLegacyVisibleIndex) {
- each(items, function() {
- if (!isDefined(this[indexParameterName]) && (!needIndexCallback || needIndexCallback(this))) {
- this[indexParameterName] = parameterIndex++
- }
- })
- }
- return parameterIndex
- };
- var inArray = function(value, object) {
- if (!object) {
- return -1
- }
- var array = Array.isArray(object) ? object : object.toArray();
- return array.indexOf(value)
- };
- var merge = function(array1, array2) {
- for (var i = 0; i < array2.length; i++) {
- array1[array1.length] = array2[i]
- }
- return array1
- };
- var find = function(array, condition) {
- for (var i = 0; i < array.length; i++) {
- if (condition(array[i])) {
- return array[i]
- }
- }
- };
- exports.isEmpty = isEmpty;
- exports.wrapToArray = wrapToArray;
- exports.intersection = intersection;
- exports.removeDuplicates = removeDuplicates;
- exports.normalizeIndexes = normalizeIndexes;
- exports.inArray = inArray;
- exports.merge = merge;
- exports.find = find
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/core/class.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errors = __webpack_require__( /*! ./errors */ 21);
- var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
- var wrapOverridden = function(baseProto, methodName, method) {
- return function() {
- var prevCallBase = this.callBase;
- this.callBase = baseProto[methodName];
- try {
- return method.apply(this, arguments)
- } finally {
- this.callBase = prevCallBase
- }
- }
- };
- var clonePrototype = function(obj) {
- var func = function() {};
- func.prototype = obj.prototype;
- return new func
- };
- var redefine = function(members) {
- var that = this;
- var overridden;
- var memberName;
- var member;
- if (!members) {
- return that
- }
- for (memberName in members) {
- member = members[memberName];
- overridden = "function" === typeof that.prototype[memberName] && "function" === typeof member;
- that.prototype[memberName] = overridden ? wrapOverridden(that.parent.prototype, memberName, member) : member
- }
- return that
- };
- var include = function() {
- var classObj = this;
- var argument;
- var name;
- var i;
- var hasClassObjOwnProperty = Object.prototype.hasOwnProperty.bind(classObj);
- var isES6Class = !hasClassObjOwnProperty("_includedCtors") && !hasClassObjOwnProperty("_includedPostCtors");
- if (isES6Class) {
- classObj._includedCtors = classObj._includedCtors.slice(0);
- classObj._includedPostCtors = classObj._includedPostCtors.slice(0)
- }
- for (i = 0; i < arguments.length; i++) {
- argument = arguments[i];
- if (argument.ctor) {
- classObj._includedCtors.push(argument.ctor)
- }
- if (argument.postCtor) {
- classObj._includedPostCtors.push(argument.postCtor)
- }
- for (name in argument) {
- if ("ctor" === name || "postCtor" === name) {
- continue
- }
- if (name in classObj.prototype) {
- throw errors.Error("E0002", name)
- }
- classObj.prototype[name] = argument[name]
- }
- }
- return classObj
- };
- var subclassOf = function(parentClass) {
- if (this.parent === parentClass) {
- return true
- }
- if (!this.parent || !this.parent.subclassOf) {
- return false
- }
- return this.parent.subclassOf(parentClass)
- };
- var abstract = function() {
- throw errors.Error("E0001")
- };
- var copyStatic = function() {
- var hasOwn = Object.prototype.hasOwnProperty;
- return function(source, destination) {
- for (var key in source) {
- if (!hasOwn.call(source, key)) {
- return
- }
- destination[key] = source[key]
- }
- }
- }();
- var classImpl = function() {};
- classImpl.inherit = function(members) {
- var inheritor = function() {
- if (!this || typeUtils.isWindow(this) || "function" !== typeof this.constructor) {
- throw errors.Error("E0003")
- }
- var instance = this;
- var ctor = instance.ctor;
- var includedCtors = instance.constructor._includedCtors;
- var includedPostCtors = instance.constructor._includedPostCtors;
- var i;
- for (i = 0; i < includedCtors.length; i++) {
- includedCtors[i].call(instance)
- }
- if (ctor) {
- ctor.apply(instance, arguments)
- }
- for (i = 0; i < includedPostCtors.length; i++) {
- includedPostCtors[i].call(instance)
- }
- };
- inheritor.prototype = clonePrototype(this);
- copyStatic(this, inheritor);
- inheritor.inherit = this.inherit;
- inheritor.abstract = abstract;
- inheritor.redefine = redefine;
- inheritor.include = include;
- inheritor.subclassOf = subclassOf;
- inheritor.parent = this;
- inheritor._includedCtors = this._includedCtors ? this._includedCtors.slice(0) : [];
- inheritor._includedPostCtors = this._includedPostCtors ? this._includedPostCtors.slice(0) : [];
- inheritor.prototype.constructor = inheritor;
- inheritor.redefine(members);
- return inheritor
- };
- classImpl.abstract = abstract;
- module.exports = classImpl
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/core/devices.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var windowUtils = __webpack_require__( /*! ./utils/window */ 7);
- var navigator = windowUtils.getNavigator();
- var window = windowUtils.getWindow();
- var extend = __webpack_require__( /*! ./utils/extend */ 0).extend;
- var isPlainObject = __webpack_require__( /*! ./utils/type */ 1).isPlainObject;
- var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
- var Class = __webpack_require__( /*! ./class */ 15);
- var errors = __webpack_require__( /*! ./errors */ 21);
- var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
- var resizeCallbacks = __webpack_require__( /*! ./utils/resize_callbacks */ 130);
- var EventsMixin = __webpack_require__( /*! ./events_mixin */ 82);
- var SessionStorage = __webpack_require__( /*! ./utils/storage */ 280).sessionStorage;
- var viewPort = __webpack_require__( /*! ./utils/view_port */ 78);
- var Config = __webpack_require__( /*! ./config */ 31);
- var KNOWN_UA_TABLE = {
- iPhone: "iPhone",
- iPhone5: "iPhone",
- iPhone6: "iPhone",
- iPhone6plus: "iPhone",
- iPad: "iPad",
- iPadMini: "iPad Mini",
- androidPhone: "Android Mobile",
- androidTablet: "Android",
- win8: "MSAppHost",
- win8Phone: "Windows Phone 8.0",
- msSurface: "Windows ARM Tablet PC",
- desktop: "desktop",
- win10Phone: "Windows Phone 10.0",
- win10: "MSAppHost/3.0"
- };
- var DEFAULT_DEVICE = {
- deviceType: "desktop",
- platform: "generic",
- version: [],
- phone: false,
- tablet: false,
- android: false,
- ios: false,
- win: false,
- generic: true,
- grade: "A",
- mac: false
- };
- var uaParsers = {
- win: function(userAgent) {
- var isPhone = /windows phone/i.test(userAgent) || userAgent.match(/WPDesktop/);
- var isTablet = !isPhone && /Windows(.*)arm(.*)Tablet PC/i.test(userAgent);
- var isDesktop = !isPhone && !isTablet && /msapphost/i.test(userAgent);
- if (!(isPhone || isTablet || isDesktop)) {
- return
- }
- var matches = userAgent.match(/windows phone (\d+).(\d+)/i) || userAgent.match(/windows nt (\d+).(\d+)/i);
- var version = [];
- if (matches) {
- version.push(parseInt(matches[1], 10), parseInt(matches[2], 10))
- } else {
- matches = userAgent.match(/msapphost(\/(\d+).(\d+))?/i);
- matches && version.push(3 === parseInt(matches[2], 10) ? 10 : 8)
- }
- return {
- deviceType: isPhone ? "phone" : isTablet ? "tablet" : "desktop",
- platform: "win",
- version: version,
- grade: "A"
- }
- },
- ios: function(userAgent) {
- if (!/ip(hone|od|ad)/i.test(userAgent)) {
- return
- }
- var isPhone = /ip(hone|od)/i.test(userAgent);
- var matches = userAgent.match(/os (\d+)_(\d+)_?(\d+)?/i);
- var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : [];
- var isIPhone4 = 480 === window.screen.height;
- var grade = isIPhone4 ? "B" : "A";
- return {
- deviceType: isPhone ? "phone" : "tablet",
- platform: "ios",
- version: version,
- grade: grade
- }
- },
- android: function(userAgent) {
- if (!/android|htc_|silk/i.test(userAgent)) {
- return
- }
- var isPhone = /mobile/i.test(userAgent);
- var matches = userAgent.match(/android (\d+)\.?(\d+)?\.?(\d+)?/i);
- var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2] || 0, 10), parseInt(matches[3] || 0, 10)] : [];
- var worseThan4_4 = version.length > 1 && (version[0] < 4 || 4 === version[0] && version[1] < 4);
- var grade = worseThan4_4 ? "B" : "A";
- return {
- deviceType: isPhone ? "phone" : "tablet",
- platform: "android",
- version: version,
- grade: grade
- }
- }
- };
- var Devices = Class.inherit({
- ctor: function(options) {
- this._window = options && options.window || window;
- this._realDevice = this._getDevice();
- this._currentDevice = void 0;
- this._currentOrientation = void 0;
- this.changed = Callbacks();
- if (windowUtils.hasWindow()) {
- this._recalculateOrientation();
- resizeCallbacks.add(this._recalculateOrientation.bind(this))
- }
- },
- current: function(deviceOrName) {
- if (deviceOrName) {
- this._currentDevice = this._getDevice(deviceOrName);
- this._forced = true;
- this.changed.fire();
- return
- }
- if (!this._currentDevice) {
- deviceOrName = void 0;
- try {
- deviceOrName = this._getDeviceOrNameFromWindowScope()
- } catch (e) {
- deviceOrName = this._getDeviceNameFromSessionStorage()
- } finally {
- if (!deviceOrName) {
- deviceOrName = this._getDeviceNameFromSessionStorage()
- }
- if (deviceOrName) {
- this._forced = true
- }
- }
- this._currentDevice = this._getDevice(deviceOrName)
- }
- return this._currentDevice
- },
- real: function() {
- var forceDevice = arguments[0];
- if (isPlainObject(forceDevice)) {
- extend(this._realDevice, forceDevice);
- return
- }
- return extend({}, this._realDevice)
- },
- orientation: function() {
- return this._currentOrientation
- },
- isForced: function() {
- return this._forced
- },
- isRippleEmulator: function() {
- return !!this._window.tinyHippos
- },
- _getCssClasses: function(device) {
- var result = [];
- var realDevice = this._realDevice;
- device = device || this.current();
- if (device.deviceType) {
- result.push("dx-device-" + device.deviceType);
- if ("desktop" !== device.deviceType) {
- result.push("dx-device-mobile")
- }
- }
- result.push("dx-device-" + realDevice.platform);
- if (realDevice.version && realDevice.version.length) {
- result.push("dx-device-" + realDevice.platform + "-" + realDevice.version[0])
- }
- if (devices.isSimulator()) {
- result.push("dx-simulator")
- }
- if (Config().rtlEnabled) {
- result.push("dx-rtl")
- }
- return result
- },
- attachCssClasses: function(element, device) {
- this._deviceClasses = this._getCssClasses(device).join(" ");
- $(element).addClass(this._deviceClasses)
- },
- detachCssClasses: function(element) {
- $(element).removeClass(this._deviceClasses)
- },
- isSimulator: function() {
- try {
- return this._isSimulator || windowUtils.hasWindow() && this._window.top !== this._window.self && this._window.top["dx-force-device"] || this.isRippleEmulator()
- } catch (e) {
- return false
- }
- },
- forceSimulator: function() {
- this._isSimulator = true
- },
- _getDevice: function(deviceName) {
- if ("genericPhone" === deviceName) {
- deviceName = {
- deviceType: "phone",
- platform: "generic",
- generic: true
- }
- }
- if (isPlainObject(deviceName)) {
- return this._fromConfig(deviceName)
- } else {
- var ua;
- if (deviceName) {
- ua = KNOWN_UA_TABLE[deviceName];
- if (!ua) {
- throw errors.Error("E0005")
- }
- } else {
- ua = navigator.userAgent
- }
- return this._fromUA(ua)
- }
- },
- _getDeviceOrNameFromWindowScope: function() {
- var result;
- if (windowUtils.hasWindow() && (this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"])) {
- result = this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"]
- }
- return result
- },
- _getDeviceNameFromSessionStorage: function() {
- var sessionStorage = SessionStorage();
- if (!sessionStorage) {
- return
- }
- var deviceOrName = sessionStorage.getItem("dx-force-device");
- try {
- return JSON.parse(deviceOrName)
- } catch (ex) {
- return deviceOrName
- }
- },
- _fromConfig: function(config) {
- var result = extend({}, DEFAULT_DEVICE, this._currentDevice, config);
- var shortcuts = {
- phone: "phone" === result.deviceType,
- tablet: "tablet" === result.deviceType,
- android: "android" === result.platform,
- ios: "ios" === result.platform,
- win: "win" === result.platform,
- generic: "generic" === result.platform
- };
- return extend(result, shortcuts)
- },
- _fromUA: function(ua) {
- var config;
- each(uaParsers, function(platform, parser) {
- config = parser(ua);
- return !config
- });
- if (config) {
- return this._fromConfig(config)
- }
- var isMac = /(mac os)/.test(ua.toLowerCase());
- var deviceWithOS = DEFAULT_DEVICE;
- deviceWithOS.mac = isMac;
- return deviceWithOS
- },
- _changeOrientation: function() {
- var $window = $(this._window);
- var orientation = $window.height() > $window.width() ? "portrait" : "landscape";
- if (this._currentOrientation === orientation) {
- return
- }
- this._currentOrientation = orientation;
- this.fireEvent("orientationChanged", [{
- orientation: orientation
- }])
- },
- _recalculateOrientation: function() {
- var windowWidth = $(this._window).width();
- if (this._currentWidth === windowWidth) {
- return
- }
- this._currentWidth = windowWidth;
- this._changeOrientation()
- }
- }).include(EventsMixin);
- var devices = new Devices;
- viewPort.changeCallback.add(function(viewPort, prevViewport) {
- devices.detachCssClasses(prevViewport);
- devices.attachCssClasses(viewPort)
- });
- if (!devices.isForced() && "win" === devices.current().platform) {
- devices.current({
- version: [10]
- })
- }
- module.exports = devices
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/ui.errors.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errorUtils = __webpack_require__( /*! ../../core/utils/error */ 129);
- var errors = __webpack_require__( /*! ../../core/errors */ 21);
- module.exports = errorUtils(errors.ERROR_MESSAGES, {
- E1001: "Module '{0}'. Controller '{1}' is already registered",
- E1002: "Module '{0}'. Controller '{1}' does not inherit from DevExpress.ui.dxDataGrid.Controller",
- E1003: "Module '{0}'. View '{1}' is already registered",
- E1004: "Module '{0}'. View '{1}' does not inherit from DevExpress.ui.dxDataGrid.View",
- E1005: "Public method '{0}' is already registered",
- E1006: "Public method '{0}.{1}' does not exist",
- E1007: "State storing cannot be provided due to the restrictions of the browser",
- E1010: "The template does not contain the TextBox widget",
- E1011: 'Items cannot be deleted from the List. Implement the "remove" function in the data store',
- E1012: "Editing type '{0}' with the name '{1}' is unsupported",
- E1016: "Unexpected type of data source is provided for a lookup column",
- E1018: "The 'collapseAll' method cannot be called if you use a remote data source",
- E1019: "Search mode '{0}' is unavailable",
- E1020: "The type cannot be changed after initialization",
- E1021: "{0} '{1}' you are trying to remove does not exist",
- E1022: 'The "markers" option is given an invalid value. Assign an array instead',
- E1023: 'The "routes" option is given an invalid value. Assign an array instead',
- E1025: "This layout is too complex to render",
- E1026: 'The "calculateCustomSummary" function is missing from a field whose "summaryType" option is set to "custom"',
- E1030: "Unknown ScrollView refresh strategy: '{0}'",
- E1031: "Unknown subscription in the Scheduler widget: '{0}'",
- E1032: "Unknown start date in an appointment: '{0}'",
- E1033: "Unknown step in the date navigator: '{0}'",
- E1034: "The browser does not implement an API for saving files",
- E1035: "The editor cannot be created because of an internal error: {0}",
- E1037: "Invalid structure of grouped data",
- E1038: "The browser does not support local storages for local web pages",
- E1039: "A cell's position cannot be calculated",
- E1040: "The '{0}' key value is not unique within the data array",
- E1041: "The '{0}' script is referenced after the DevExtreme scripts or not referenced at all",
- E1042: "{0} requires the key field to be specified",
- E1043: "Changes cannot be processed due to the incorrectly set key",
- E1044: "The key field specified by the keyExpr option does not match the key field specified in the data store",
- E1045: "Editing requires the key field to be specified in the data store",
- E1046: "The '{0}' key field is not found in data objects",
- E1047: 'The "{0}" field is not found in the fields array',
- E1048: 'The "{0}" operation is not found in the filterOperations array',
- E1049: "Column '{0}': filtering is allowed but the 'dataField' or 'name' option is not specified",
- E1050: "The validationRules option does not apply to third-party editors defined in the editCellTemplate",
- E1051: 'HtmlEditor\'s valueType is "{0}", but the {0} converter was not imported.',
- E1052: '{0} should have the "dataSource" option specified',
- E1053: 'The "buttons" option accepts an array that contains only objects or string values',
- E1054: "All text editor buttons must have names",
- E1055: 'One or several text editor buttons have invalid or non-unique "name" values',
- E1056: 'The {0} widget does not support buttons of the "{1}" type',
- W1001: 'The "key" option cannot be modified after initialization',
- W1002: "An item with the key '{0}' does not exist",
- W1003: "A group with the key '{0}' in which you are trying to select items does not exist",
- W1004: "The item '{0}' you are trying to select in the group '{1}' does not exist",
- W1005: "Due to column data types being unspecified, data has been loaded twice in order to apply initial filter settings. To resolve this issue, specify data types for all grid columns.",
- W1006: "The map service returned the following error: '{0}'",
- W1007: "No item with key {0} was found in the data source, but this key was used as the parent key for item {1}",
- W1008: "Cannot scroll to the '{0}' date because it does not exist on the current view",
- W1009: "Searching works only if data is specified using the dataSource option",
- W1010: "The capability to select all items works with source data of plain structure only",
- W1011: 'The "keyExpr" option is not applied when dataSource is not an array',
- W1012: "The '{0}' key field is not found in data objects",
- W1013: 'The "message" field in the dialog component was renamed to "messageHtml". Change your code correspondingly. In addition, if you used HTML code in the message, make sure that it is secure',
- W1014: "The Floating Action Button exceeds the recommended speed dial action count. If you need to display more speed dial actions, increase the maxSpeedDialActionCount option value in the global config."
- })
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/ui.widget.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var errors = __webpack_require__( /*! ./ui.errors */ 17);
- var Action = __webpack_require__( /*! ../../core/action */ 111);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
- var Template = __webpack_require__( /*! ./template */ 462);
- var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
- var FunctionTemplate = __webpack_require__( /*! ./function_template */ 83);
- var EmptyTemplate = __webpack_require__( /*! ./empty_template */ 109);
- var ChildDefaultTemplate = __webpack_require__( /*! ./child_default_template */ 134);
- var KeyboardProcessor = __webpack_require__( /*! ./ui.keyboard_processor */ 167);
- var selectors = __webpack_require__( /*! ./selectors */ 66);
- var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
- var hoverEvents = __webpack_require__( /*! ../../events/hover */ 148);
- var feedbackEvents = __webpack_require__( /*! ../../events/core/emitter.feedback */ 125);
- var clickEvent = __webpack_require__( /*! ../../events/click */ 19);
- var inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
- var UI_FEEDBACK = "UIFeedback";
- var WIDGET_CLASS = "dx-widget";
- var ACTIVE_STATE_CLASS = "dx-state-active";
- var DISABLED_STATE_CLASS = "dx-state-disabled";
- var INVISIBLE_STATE_CLASS = "dx-state-invisible";
- var HOVER_STATE_CLASS = "dx-state-hover";
- var FOCUSED_STATE_CLASS = "dx-state-focused";
- var FEEDBACK_SHOW_TIMEOUT = 30;
- var FEEDBACK_HIDE_TIMEOUT = 400;
- var FOCUS_NAMESPACE = "Focus";
- var ANONYMOUS_TEMPLATE_NAME = "template";
- var TEXT_NODE = 3;
- var TEMPLATE_SELECTOR = "[data-options*='dxTemplate']";
- var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper";
- var DX_POLYMORPH_WIDGET_TEMPLATE = new FunctionTemplate(function(options) {
- var widgetName = options.model.widget;
- if (widgetName) {
- var widgetElement = $("<div>");
- var widgetOptions = options.model.options || {};
- if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) {
- var deprecatedName = widgetName;
- widgetName = inflector.camelize("dx-" + widgetName);
- errors.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead")
- }
- if (options.parent) {
- options.parent._createComponent(widgetElement, widgetName, widgetOptions)
- } else {
- widgetElement[widgetName](widgetOptions)
- }
- return widgetElement
- }
- return $()
- });
- var Widget = DOMComponent.inherit({
- _supportedKeys: function() {
- return {}
- },
- _getDefaultOptions: function() {
- return extend(this.callBase(), {
- disabled: false,
- visible: true,
- hint: void 0,
- activeStateEnabled: false,
- onContentReady: null,
- hoverStateEnabled: false,
- focusStateEnabled: false,
- tabIndex: 0,
- accessKey: null,
- onFocusIn: null,
- onFocusOut: null,
- integrationOptions: {
- watchMethod: function(fn, callback, options) {
- options = options || {};
- if (!options.skipImmediate) {
- callback(fn())
- }
- return commonUtils.noop
- },
- templates: {
- "dx-polymorph-widget": DX_POLYMORPH_WIDGET_TEMPLATE
- },
- createTemplate: function(element) {
- return new Template(element)
- }
- },
- _keyboardProcessor: void 0
- })
- },
- _feedbackShowTimeout: FEEDBACK_SHOW_TIMEOUT,
- _feedbackHideTimeout: FEEDBACK_HIDE_TIMEOUT,
- _init: function() {
- this.callBase();
- this._tempTemplates = [];
- this._defaultTemplates = {};
- this._initTemplates();
- this._initContentReadyAction()
- },
- _initTemplates: function() {
- this._extractTemplates();
- this._extractAnonymousTemplate()
- },
- _clearInnerOptionCache: function(optionContainer) {
- this[optionContainer + "Cache"] = {}
- },
- _cacheInnerOptions: function(optionContainer, optionValue) {
- var cacheName = optionContainer + "Cache";
- this[cacheName] = extend(this[cacheName], optionValue)
- },
- _getOptionsFromContainer: function(_ref) {
- var name = _ref.name,
- fullName = _ref.fullName,
- value = _ref.value;
- var options = {};
- if (name === fullName) {
- options = value
- } else {
- var option = fullName.split(".").pop();
- options[option] = value
- }
- return options
- },
- _innerOptionChanged: function(innerWidget, args) {
- var options = this._getOptionsFromContainer(args);
- innerWidget && innerWidget.option(options);
- this._cacheInnerOptions(args.name, options)
- },
- _getInnerOptionsCache: function(optionContainer) {
- return this[optionContainer + "Cache"]
- },
- _initInnerOptionCache: function(optionContainer) {
- this._clearInnerOptionCache(optionContainer);
- this._cacheInnerOptions(optionContainer, this.option(optionContainer))
- },
- _bindInnerWidgetOptions: function(innerWidget, optionsContainer) {
- this._options[optionsContainer] = extend({}, innerWidget.option());
- innerWidget.on("optionChanged", function(e) {
- this._options[optionsContainer] = extend({}, e.component.option())
- }.bind(this))
- },
- _extractTemplates: function() {
- var templateElements = this.$element().contents().filter(TEMPLATE_SELECTOR);
- var templatesMap = {};
- templateElements.each(function(_, template) {
- var templateOptions = domUtils.getElementOptions(template).dxTemplate;
- if (!templateOptions) {
- return
- }
- if (!templateOptions.name) {
- throw errors.Error("E0023")
- }
- $(template).addClass(TEMPLATE_WRAPPER_CLASS).detach();
- templatesMap[templateOptions.name] = templatesMap[templateOptions.name] || [];
- templatesMap[templateOptions.name].push(template)
- });
- each(templatesMap, function(templateName, value) {
- var deviceTemplate = this._findTemplateByDevice(value);
- if (deviceTemplate) {
- this._saveTemplate(templateName, deviceTemplate)
- }
- }.bind(this))
- },
- _saveTemplate: function(name, template) {
- var templates = this.option("integrationOptions.templates");
- templates[name] = this._createTemplate(template)
- },
- _findTemplateByDevice: function(templates) {
- var suitableTemplate = commonUtils.findBestMatches(devices.current(), templates, function(template) {
- return domUtils.getElementOptions(template).dxTemplate
- })[0];
- each(templates, function(index, template) {
- if (template !== suitableTemplate) {
- $(template).remove()
- }
- });
- return suitableTemplate
- },
- _extractAnonymousTemplate: function() {
- var templates = this.option("integrationOptions.templates");
- var anonymousTemplateName = this._getAnonymousTemplateName();
- var $anonymousTemplate = this.$element().contents().detach();
- var $notJunkTemplateContent = $anonymousTemplate.filter(function(_, element) {
- var isTextNode = element.nodeType === TEXT_NODE;
- var isEmptyText = $(element).text().trim().length < 1;
- return !(isTextNode && isEmptyText)
- });
- var onlyJunkTemplateContent = $notJunkTemplateContent.length < 1;
- if (!templates[anonymousTemplateName] && !onlyJunkTemplateContent) {
- templates[anonymousTemplateName] = this._createTemplate($anonymousTemplate)
- }
- },
- _getAriaTarget: function() {
- return this._focusTarget()
- },
- _getAnonymousTemplateName: function() {
- return ANONYMOUS_TEMPLATE_NAME
- },
- _getTemplateByOption: function(optionName) {
- return this._getTemplate(this.option(optionName))
- },
- _getTemplate: function(templateSource) {
- if (typeUtils.isFunction(templateSource)) {
- return new FunctionTemplate(function(options) {
- var templateSourceResult = templateSource.apply(this, this._getNormalizedTemplateArgs(options));
- if (!typeUtils.isDefined(templateSourceResult)) {
- return new EmptyTemplate
- }
- var dispose = false;
- var template = this._acquireTemplate(templateSourceResult, function(templateSource) {
- if (templateSource.nodeType || typeUtils.isRenderer(templateSource) && !$(templateSource).is("script")) {
- return new FunctionTemplate(function() {
- return templateSource
- })
- }
- dispose = true;
- return this._createTemplate(templateSource)
- }.bind(this));
- var result = template.render(options);
- dispose && template.dispose && template.dispose();
- return result
- }.bind(this))
- }
- return this._acquireTemplate(templateSource, this._createTemplateIfNeeded.bind(this))
- },
- _acquireTemplate: function(templateSource, createTemplate) {
- if (null == templateSource) {
- return new EmptyTemplate
- }
- if (templateSource instanceof ChildDefaultTemplate) {
- return this._defaultTemplates[templateSource.name]
- }
- if (templateSource instanceof TemplateBase) {
- return templateSource
- }
- if (typeUtils.isFunction(templateSource.render) && !typeUtils.isRenderer(templateSource)) {
- return this._addOneRenderedCall(templateSource)
- }
- if (templateSource.nodeType || typeUtils.isRenderer(templateSource)) {
- return createTemplate($(templateSource))
- }
- if ("string" === typeof templateSource) {
- var nonIntegrationTemplates = this.option("integrationOptions.skipTemplates") || [];
- var integrationTemplate = null;
- if (nonIntegrationTemplates.indexOf(templateSource) === -1) {
- integrationTemplate = this._renderIntegrationTemplate(templateSource)
- }
- return integrationTemplate || this._defaultTemplates[templateSource] || createTemplate(templateSource)
- }
- return this._acquireTemplate(templateSource.toString(), createTemplate)
- },
- _addOneRenderedCall: function(template) {
- var _render = template.render.bind(template);
- return extend({}, template, {
- render: function(options) {
- var templateResult = _render(options);
- options && options.onRendered && options.onRendered();
- return templateResult
- }
- })
- },
- _renderIntegrationTemplate: function(templateSource) {
- var integrationTemplate = this.option("integrationOptions.templates")[templateSource];
- if (integrationTemplate && !(integrationTemplate instanceof TemplateBase)) {
- var isAsyncTemplate = this.option("templatesRenderAsynchronously");
- if (!isAsyncTemplate) {
- return this._addOneRenderedCall(integrationTemplate)
- }
- }
- return integrationTemplate
- },
- _createTemplateIfNeeded: function(templateSource) {
- var templateKey = function(templateSource) {
- return typeUtils.isRenderer(templateSource) && templateSource[0] || templateSource
- };
- var cachedTemplate = this._tempTemplates.filter(function(t) {
- templateSource = templateKey(templateSource);
- return t.source === templateSource
- })[0];
- if (cachedTemplate) {
- return cachedTemplate.template
- }
- var template = this._createTemplate(templateSource);
- this._tempTemplates.push({
- template: template,
- source: templateKey(templateSource)
- });
- return template
- },
- _createTemplate: function(templateSource) {
- templateSource = "string" === typeof templateSource ? domUtils.normalizeTemplateElement(templateSource) : templateSource;
- return this.option("integrationOptions.createTemplate")(templateSource)
- },
- _getNormalizedTemplateArgs: function(options) {
- var args = [];
- if ("model" in options) {
- args.push(options.model)
- }
- if ("index" in options) {
- args.push(options.index)
- }
- args.push(options.container);
- return args
- },
- _cleanTemplates: function() {
- this._tempTemplates.forEach(function(t) {
- t.template.dispose && t.template.dispose()
- });
- this._tempTemplates = []
- },
- _initContentReadyAction: function() {
- this._contentReadyAction = this._createActionByOption("onContentReady", {
- excludeValidators: ["disabled", "readOnly"]
- })
- },
- _initMarkup: function() {
- this.$element().addClass(WIDGET_CLASS);
- this._toggleDisabledState(this.option("disabled"));
- this._toggleVisibility(this.option("visible"));
- this._renderHint();
- if (this._isFocusable()) {
- this._renderFocusTarget()
- }
- this.callBase()
- },
- _render: function() {
- this.callBase();
- this._renderContent();
- this._renderFocusState();
- this._attachFeedbackEvents();
- this._attachHoverEvents()
- },
- _renderHint: function() {
- var hint = this.option("hint");
- this.$element().attr("title", hint ? hint : null)
- },
- _renderContent: function() {
- var _this = this;
- commonUtils.deferRender(function() {
- if (_this._disposed) {
- return
- }
- return _this._renderContentImpl()
- }).done(function() {
- if (_this._disposed) {
- return
- }
- _this._fireContentReadyAction()
- })
- },
- _renderContentImpl: commonUtils.noop,
- _fireContentReadyAction: commonUtils.deferRenderer(function() {
- this._contentReadyAction()
- }),
- _dispose: function() {
- this._cleanTemplates();
- this._contentReadyAction = null;
- this.callBase()
- },
- _resetActiveState: function() {
- this._toggleActiveState(this._eventBindingTarget(), false)
- },
- _clean: function() {
- this._cleanFocusState();
- this._resetActiveState();
- this.callBase();
- this.$element().empty()
- },
- _toggleVisibility: function(visible) {
- this.$element().toggleClass(INVISIBLE_STATE_CLASS, !visible);
- this.setAria("hidden", !visible || void 0)
- },
- _renderFocusState: function() {
- this._attachKeyboardEvents();
- if (!this._isFocusable()) {
- return
- }
- this._renderFocusTarget();
- this._attachFocusEvents();
- this._renderAccessKey()
- },
- _renderAccessKey: function() {
- var focusTarget = this._focusTarget();
- focusTarget.attr("accesskey", this.option("accessKey"));
- var clickNamespace = eventUtils.addNamespace(clickEvent.name, UI_FEEDBACK);
- eventsEngine.off(focusTarget, clickNamespace);
- this.option("accessKey") && eventsEngine.on(focusTarget, clickNamespace, function(e) {
- if (eventUtils.isFakeClickEvent(e)) {
- e.stopImmediatePropagation();
- this.focus()
- }
- }.bind(this))
- },
- _isFocusable: function() {
- return this.option("focusStateEnabled") && !this.option("disabled")
- },
- _eventBindingTarget: function() {
- return this.$element()
- },
- _focusTarget: function() {
- return this._getActiveElement()
- },
- _getActiveElement: function() {
- var activeElement = this._eventBindingTarget();
- if (this._activeStateUnit) {
- activeElement = activeElement.find(this._activeStateUnit).not("." + DISABLED_STATE_CLASS)
- }
- return activeElement
- },
- _renderFocusTarget: function() {
- this._focusTarget().attr("tabIndex", this.option("tabIndex"))
- },
- _keyboardEventBindingTarget: function() {
- return this._eventBindingTarget()
- },
- _detachFocusEvents: function() {
- var $element = this._focusEventTarget();
- var namespace = this.NAME + FOCUS_NAMESPACE;
- var focusEvents = eventUtils.addNamespace("focusin", namespace);
- focusEvents = focusEvents + " " + eventUtils.addNamespace("focusout", namespace);
- if (domAdapter.hasDocumentProperty("onbeforeactivate")) {
- focusEvents = focusEvents + " " + eventUtils.addNamespace("beforeactivate", namespace)
- }
- eventsEngine.off($element, focusEvents)
- },
- _attachFocusEvents: function() {
- var namespace = this.NAME + FOCUS_NAMESPACE;
- var focusInEvent = eventUtils.addNamespace("focusin", namespace);
- var focusOutEvent = eventUtils.addNamespace("focusout", namespace);
- var $focusTarget = this._focusEventTarget();
- eventsEngine.on($focusTarget, focusInEvent, this._focusInHandler.bind(this));
- eventsEngine.on($focusTarget, focusOutEvent, this._focusOutHandler.bind(this));
- if (domAdapter.hasDocumentProperty("onbeforeactivate")) {
- var beforeActivateEvent = eventUtils.addNamespace("beforeactivate", namespace);
- eventsEngine.on(this._focusEventTarget(), beforeActivateEvent, function(e) {
- if (!$(e.target).is(selectors.focusable)) {
- e.preventDefault()
- }
- })
- }
- },
- _refreshFocusEvent: function() {
- this._detachFocusEvents();
- this._attachFocusEvents()
- },
- _focusEventTarget: function() {
- return this._focusTarget()
- },
- _focusInHandler: function(e) {
- if (e.isDefaultPrevented()) {
- return
- }
- var that = this;
- that._createActionByOption("onFocusIn", {
- beforeExecute: function() {
- that._updateFocusState(e, true)
- },
- excludeValidators: ["readOnly"]
- })({
- event: e
- })
- },
- _focusOutHandler: function(e) {
- if (e.isDefaultPrevented()) {
- return
- }
- var that = this;
- that._createActionByOption("onFocusOut", {
- beforeExecute: function() {
- that._updateFocusState(e, false)
- },
- excludeValidators: ["readOnly", "disabled"]
- })({
- event: e
- })
- },
- _updateFocusState: function(e, isFocused) {
- var target = e.target;
- if (inArray(target, this._focusTarget()) !== -1) {
- this._toggleFocusClass(isFocused, $(target))
- }
- },
- _toggleFocusClass: function(isFocused, $element) {
- var $focusTarget = $element && $element.length ? $element : this._focusTarget();
- $focusTarget.toggleClass(FOCUSED_STATE_CLASS, isFocused)
- },
- _hasFocusClass: function(element) {
- var $focusTarget = $(element || this._focusTarget());
- return $focusTarget.hasClass(FOCUSED_STATE_CLASS)
- },
- _isFocused: function() {
- return this._hasFocusClass()
- },
- _attachKeyboardEvents: function() {
- var processor = this.option("_keyboardProcessor");
- if (processor) {
- this._keyboardProcessor = processor.reinitialize(this._keyboardHandler, this)
- } else {
- if (this.option("focusStateEnabled")) {
- this._disposeKeyboardProcessor();
- this._keyboardProcessor = new KeyboardProcessor({
- element: this._keyboardEventBindingTarget(),
- handler: this._keyboardHandler,
- focusTarget: this._focusTarget(),
- context: this
- })
- }
- }
- },
- _keyboardHandler: function(options) {
- var e = options.originalEvent;
- var keyName = options.keyName;
- var keyCode = options.which;
- var keys = this._supportedKeys(e);
- var func = keys[keyName] || keys[keyCode];
- if (void 0 !== func) {
- var handler = func.bind(this);
- return handler(e) || false
- } else {
- return true
- }
- },
- _refreshFocusState: function() {
- this._cleanFocusState();
- this._renderFocusState()
- },
- _cleanFocusState: function() {
- var $element = this._focusTarget();
- this._detachFocusEvents();
- this._toggleFocusClass(false);
- $element.removeAttr("tabIndex");
- this._disposeKeyboardProcessor()
- },
- _disposeKeyboardProcessor: function() {
- if (this._keyboardProcessor) {
- this._keyboardProcessor.dispose();
- delete this._keyboardProcessor
- }
- },
- _attachHoverEvents: function() {
- var that = this;
- var hoverableSelector = that._activeStateUnit;
- var nameStart = eventUtils.addNamespace(hoverEvents.start, UI_FEEDBACK);
- var nameEnd = eventUtils.addNamespace(hoverEvents.end, UI_FEEDBACK);
- eventsEngine.off(that._eventBindingTarget(), nameStart, hoverableSelector);
- eventsEngine.off(that._eventBindingTarget(), nameEnd, hoverableSelector);
- if (that.option("hoverStateEnabled")) {
- var startAction = new Action(function(args) {
- that._hoverStartHandler(args.event);
- that._refreshHoveredElement($(args.element))
- }, {
- excludeValidators: ["readOnly"]
- });
- var $eventBindingTarget = that._eventBindingTarget();
- eventsEngine.on($eventBindingTarget, nameStart, hoverableSelector, function(e) {
- startAction.execute({
- element: $(e.target),
- event: e
- })
- });
- eventsEngine.on($eventBindingTarget, nameEnd, hoverableSelector, function(e) {
- that._hoverEndHandler(e);
- that._forgetHoveredElement()
- })
- } else {
- that._toggleHoverClass(false)
- }
- },
- _hoverStartHandler: commonUtils.noop,
- _hoverEndHandler: commonUtils.noop,
- _attachFeedbackEvents: function() {
- var that = this;
- var feedbackSelector = that._activeStateUnit;
- var activeEventName = eventUtils.addNamespace(feedbackEvents.active, UI_FEEDBACK);
- var inactiveEventName = eventUtils.addNamespace(feedbackEvents.inactive, UI_FEEDBACK);
- var feedbackAction;
- var feedbackActionDisabled;
- eventsEngine.off(that._eventBindingTarget(), activeEventName, feedbackSelector);
- eventsEngine.off(that._eventBindingTarget(), inactiveEventName, feedbackSelector);
- if (that.option("activeStateEnabled")) {
- var feedbackActionHandler = function(args) {
- var $element = $(args.element);
- var value = args.value;
- var dxEvent = args.event;
- that._toggleActiveState($element, value, dxEvent)
- };
- eventsEngine.on(that._eventBindingTarget(), activeEventName, feedbackSelector, {
- timeout: that._feedbackShowTimeout
- }, function(e) {
- feedbackAction = feedbackAction || new Action(feedbackActionHandler);
- feedbackAction.execute({
- element: $(e.currentTarget),
- value: true,
- event: e
- })
- });
- eventsEngine.on(that._eventBindingTarget(), inactiveEventName, feedbackSelector, {
- timeout: that._feedbackHideTimeout
- }, function(e) {
- feedbackActionDisabled = feedbackActionDisabled || new Action(feedbackActionHandler, {
- excludeValidators: ["disabled", "readOnly"]
- });
- feedbackActionDisabled.execute({
- element: $(e.currentTarget),
- value: false,
- event: e
- })
- })
- }
- },
- _toggleActiveState: function($element, value) {
- this._toggleHoverClass(!value);
- $element.toggleClass(ACTIVE_STATE_CLASS, value)
- },
- _refreshHoveredElement: function(hoveredElement) {
- var selector = this._activeStateUnit || this._eventBindingTarget();
- this._forgetHoveredElement();
- this._hoveredElement = hoveredElement.closest(selector);
- this._toggleHoverClass(true)
- },
- _forgetHoveredElement: function() {
- this._toggleHoverClass(false);
- delete this._hoveredElement
- },
- _toggleHoverClass: function(value) {
- if (this._hoveredElement) {
- this._hoveredElement.toggleClass(HOVER_STATE_CLASS, value && this.option("hoverStateEnabled"))
- }
- },
- _toggleDisabledState: function(value) {
- this.$element().toggleClass(DISABLED_STATE_CLASS, Boolean(value));
- this._toggleHoverClass(!value);
- this.setAria("disabled", value || void 0)
- },
- _setWidgetOption: function(widgetName, args) {
- if (!this[widgetName]) {
- return
- }
- if (typeUtils.isPlainObject(args[0])) {
- each(args[0], function(option, value) {
- this._setWidgetOption(widgetName, [option, value])
- }.bind(this));
- return
- }
- var optionName = args[0];
- var value = args[1];
- if (1 === args.length) {
- value = this.option(optionName)
- }
- var widgetOptionMap = this[widgetName + "OptionMap"];
- this[widgetName].option(widgetOptionMap ? widgetOptionMap(optionName) : optionName, value)
- },
- _optionChanged: function(args) {
- switch (args.name) {
- case "disabled":
- this._toggleDisabledState(args.value);
- this._refreshFocusState();
- break;
- case "hint":
- this._renderHint();
- break;
- case "activeStateEnabled":
- this._attachFeedbackEvents();
- break;
- case "hoverStateEnabled":
- this._attachHoverEvents();
- break;
- case "tabIndex":
- case "_keyboardProcessor":
- case "focusStateEnabled":
- this._refreshFocusState();
- break;
- case "onFocusIn":
- case "onFocusOut":
- break;
- case "accessKey":
- this._renderAccessKey();
- break;
- case "visible":
- var visible = args.value;
- this._toggleVisibility(visible);
- if (this._isVisibilityChangeSupported()) {
- this._checkVisibilityChanged(args.value ? "shown" : "hiding")
- }
- break;
- case "onContentReady":
- this._initContentReadyAction();
- break;
- default:
- this.callBase(args)
- }
- },
- _isVisible: function() {
- return this.callBase() && this.option("visible")
- },
- beginUpdate: function() {
- this._ready(false);
- this.callBase()
- },
- endUpdate: function() {
- this.callBase();
- if (this._initialized) {
- this._ready(true)
- }
- },
- _ready: function(value) {
- if (0 === arguments.length) {
- return this._isReady
- }
- this._isReady = value
- },
- setAria: function() {
- var setAttribute = function(option) {
- var attrName = "role" === option.name || "id" === option.name ? option.name : "aria-" + option.name;
- var attrValue = option.value;
- if (typeUtils.isDefined(attrValue)) {
- attrValue = attrValue.toString()
- } else {
- attrValue = null
- }
- option.target.attr(attrName, attrValue)
- };
- if (!typeUtils.isPlainObject(arguments[0])) {
- setAttribute({
- name: arguments[0],
- value: arguments[1],
- target: arguments[2] || this._getAriaTarget()
- })
- } else {
- var $target = arguments[1] || this._getAriaTarget();
- each(arguments[0], function(key, value) {
- setAttribute({
- name: key,
- value: value,
- target: $target
- })
- })
- }
- },
- isReady: function() {
- return this._ready()
- },
- repaint: function() {
- this._refresh()
- },
- focus: function() {
- eventsEngine.trigger(this._focusTarget(), "focus")
- },
- registerKeyHandler: function(key, handler) {
- var currentKeys = this._supportedKeys();
- var addingKeys = {};
- addingKeys[key] = handler;
- this._supportedKeys = function() {
- return extend(currentKeys, addingKeys)
- }
- }
- });
- module.exports = Widget
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/events/click.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var devices = __webpack_require__( /*! ../core/devices */ 16);
- var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
- var animationFrame = __webpack_require__( /*! ../animation/frame */ 112);
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var pointerEvents = __webpack_require__( /*! ./pointer */ 23);
- var Emitter = __webpack_require__( /*! ./core/emitter */ 123);
- var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
- var compareVersions = __webpack_require__( /*! ../core/utils/version */ 61).compare;
- var CLICK_EVENT_NAME = "dxclick";
- var TOUCH_BOUNDARY = 10;
- var abs = Math.abs;
- var isInput = function(element) {
- return $(element).is("input, textarea, select, button ,:focus, :focus *")
- };
- var misc = {
- requestAnimationFrame: animationFrame.requestAnimationFrame,
- cancelAnimationFrame: animationFrame.cancelAnimationFrame
- };
- var ClickEmitter = Emitter.inherit({
- ctor: function(element) {
- this.callBase(element);
- this._makeElementClickable($(element))
- },
- _makeElementClickable: function($element) {
- if (!$element.attr("onclick")) {
- $element.attr("onclick", "void(0)")
- }
- },
- start: function(e) {
- this._blurPrevented = e.isDefaultPrevented();
- this._startTarget = e.target;
- this._startEventData = eventUtils.eventData(e)
- },
- end: function(e) {
- if (this._eventOutOfElement(e, this.getElement().get(0)) || e.type === pointerEvents.cancel) {
- this._cancel(e);
- return
- }
- if (!isInput(e.target) && !this._blurPrevented) {
- domUtils.resetActiveElement()
- }
- this._accept(e);
- this._clickAnimationFrame = misc.requestAnimationFrame(function() {
- this._fireClickEvent(e)
- }.bind(this))
- },
- _eventOutOfElement: function(e, element) {
- var target = e.target;
- var targetChanged = !domUtils.contains(element, target) && element !== target;
- var gestureDelta = eventUtils.eventDelta(eventUtils.eventData(e), this._startEventData);
- var boundsExceeded = abs(gestureDelta.x) > TOUCH_BOUNDARY || abs(gestureDelta.y) > TOUCH_BOUNDARY;
- return targetChanged || boundsExceeded
- },
- _fireClickEvent: function(e) {
- this._fireEvent(CLICK_EVENT_NAME, e, {
- target: domUtils.closestCommonParent(this._startTarget, e.target)
- })
- },
- dispose: function() {
- misc.cancelAnimationFrame(this._clickAnimationFrame)
- }
- });
- ! function() {
- var NATIVE_CLICK_CLASS = "dx-native-click";
- var realDevice = devices.real();
- var useNativeClick = realDevice.generic || realDevice.ios && compareVersions(realDevice.version, [9, 3]) >= 0 || realDevice.android && compareVersions(realDevice.version, [5]) >= 0;
- var isNativeClickEvent = function(target) {
- return useNativeClick || $(target).closest("." + NATIVE_CLICK_CLASS).length
- };
- var prevented = null;
- var lastFiredEvent = null;
- var clickHandler = function(e) {
- var originalEvent = e.originalEvent;
- var eventAlreadyFired = lastFiredEvent === originalEvent || originalEvent && originalEvent.DXCLICK_FIRED;
- var leftButton = !e.which || 1 === e.which;
- if (leftButton && !prevented && isNativeClickEvent(e.target) && !eventAlreadyFired) {
- if (originalEvent) {
- originalEvent.DXCLICK_FIRED = true
- }
- lastFiredEvent = originalEvent;
- eventUtils.fireEvent({
- type: CLICK_EVENT_NAME,
- originalEvent: e
- })
- }
- };
- ClickEmitter = ClickEmitter.inherit({
- _makeElementClickable: function($element) {
- if (!isNativeClickEvent($element)) {
- this.callBase($element)
- }
- eventsEngine.on($element, "click", clickHandler)
- },
- configure: function(data) {
- this.callBase(data);
- if (data.useNative) {
- this.getElement().addClass(NATIVE_CLICK_CLASS)
- }
- },
- start: function(e) {
- prevented = null;
- if (!isNativeClickEvent(e.target)) {
- this.callBase(e)
- }
- },
- end: function(e) {
- if (!isNativeClickEvent(e.target)) {
- this.callBase(e)
- }
- },
- cancel: function() {
- prevented = true
- },
- dispose: function() {
- this.callBase();
- eventsEngine.off(this.getElement(), "click", clickHandler)
- }
- });
- exports.useNativeClick = useNativeClick
- }();
- ! function() {
- var desktopDevice = devices.real().generic;
- if (!desktopDevice) {
- var startTarget = null;
- var blurPrevented = false;
- var pointerDownHandler = function(e) {
- startTarget = e.target;
- blurPrevented = e.isDefaultPrevented()
- };
- var clickHandler = function(e) {
- var $target = $(e.target);
- if (!blurPrevented && startTarget && !$target.is(startTarget) && !$(startTarget).is("label") && isInput($target)) {
- domUtils.resetActiveElement()
- }
- startTarget = null;
- blurPrevented = false
- };
- var NATIVE_CLICK_FIXER_NAMESPACE = "NATIVE_CLICK_FIXER";
- var document = domAdapter.getDocument();
- eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.down, NATIVE_CLICK_FIXER_NAMESPACE), pointerDownHandler);
- eventsEngine.subscribeGlobal(document, eventUtils.addNamespace("click", NATIVE_CLICK_FIXER_NAMESPACE), clickHandler)
- }
- }();
- registerEmitter({
- emitter: ClickEmitter,
- bubble: true,
- events: [CLICK_EVENT_NAME]
- });
- exports.name = CLICK_EVENT_NAME;
- exports.misc = misc
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/core/utils/data.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errors = __webpack_require__( /*! ../errors */ 21);
- var Class = __webpack_require__( /*! ../class */ 15);
- var objectUtils = __webpack_require__( /*! ./object */ 47);
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var each = __webpack_require__( /*! ./iterator */ 3).each;
- var variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 86);
- var unwrapVariable = variableWrapper.unwrap;
- var isWrapped = variableWrapper.isWrapped;
- var assign = variableWrapper.assign;
- var bracketsToDots = function(expr) {
- return expr.replace(/\[/g, ".").replace(/\]/g, "")
- };
- var readPropValue = function(obj, propName, options) {
- options = options || {};
- if ("this" === propName) {
- return unwrap(obj, options)
- }
- return unwrap(obj[propName], options)
- };
- var assignPropValue = function(obj, propName, value, options) {
- if ("this" === propName) {
- throw new errors.Error("E4016")
- }
- var propValue = obj[propName];
- if (options.unwrapObservables && isWrapped(propValue)) {
- assign(propValue, value)
- } else {
- obj[propName] = value
- }
- };
- var prepareOptions = function(options) {
- options = options || {};
- options.unwrapObservables = void 0 !== options.unwrapObservables ? options.unwrapObservables : true;
- return options
- };
- var unwrap = function(value, options) {
- return options.unwrapObservables ? unwrapVariable(value) : value
- };
- var compileGetter = function(expr) {
- if (arguments.length > 1) {
- expr = [].slice.call(arguments)
- }
- if (!expr || "this" === expr) {
- return function(obj) {
- return obj
- }
- }
- if ("string" === typeof expr) {
- expr = bracketsToDots(expr);
- var path = expr.split(".");
- return function(obj, options) {
- options = prepareOptions(options);
- var functionAsIs = options.functionsAsIs;
- var hasDefaultValue = "defaultValue" in options;
- var current = unwrap(obj, options);
- for (var i = 0; i < path.length; i++) {
- if (!current) {
- if (null == current && hasDefaultValue) {
- return options.defaultValue
- }
- break
- }
- var pathPart = path[i];
- if (hasDefaultValue && typeUtils.isObject(current) && !(pathPart in current)) {
- return options.defaultValue
- }
- var next = unwrap(current[pathPart], options);
- if (!functionAsIs && typeUtils.isFunction(next)) {
- next = next.call(current)
- }
- current = next
- }
- return current
- }
- }
- if (Array.isArray(expr)) {
- return combineGetters(expr)
- }
- if (typeUtils.isFunction(expr)) {
- return expr
- }
- };
- var combineGetters = function(getters) {
- var compiledGetters = {};
- for (var i = 0, l = getters.length; i < l; i++) {
- var getter = getters[i];
- compiledGetters[getter] = compileGetter(getter)
- }
- return function(obj, options) {
- var result;
- each(compiledGetters, function(name) {
- var value = this(obj, options);
- var current;
- if (void 0 === value) {
- return
- }
- current = result || (result = {});
- var path = name.split(".");
- var last = path.length - 1;
- for (var _i = 0; _i < last; _i++) {
- var pathItem = path[_i];
- if (!(pathItem in current)) {
- current[pathItem] = {}
- }
- current = current[pathItem]
- }
- current[path[last]] = value
- });
- return result
- }
- };
- var ensurePropValueDefined = function(obj, propName, value, options) {
- if (typeUtils.isDefined(value)) {
- return value
- }
- var newValue = {};
- assignPropValue(obj, propName, newValue, options);
- return newValue
- };
- var compileSetter = function(expr) {
- expr = bracketsToDots(expr || "this").split(".");
- var lastLevelIndex = expr.length - 1;
- return function(obj, value, options) {
- options = prepareOptions(options);
- var currentValue = unwrap(obj, options);
- expr.forEach(function(propertyName, levelIndex) {
- var propertyValue = readPropValue(currentValue, propertyName, options);
- var isPropertyFunc = !options.functionsAsIs && typeUtils.isFunction(propertyValue) && !isWrapped(propertyValue);
- if (levelIndex === lastLevelIndex) {
- if (options.merge && typeUtils.isPlainObject(value) && (!typeUtils.isDefined(propertyValue) || typeUtils.isPlainObject(propertyValue))) {
- propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options);
- objectUtils.deepExtendArraySafe(propertyValue, value, false, true)
- } else {
- if (isPropertyFunc) {
- currentValue[propertyName](value)
- } else {
- assignPropValue(currentValue, propertyName, value, options)
- }
- }
- } else {
- propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options);
- if (isPropertyFunc) {
- propertyValue = propertyValue.call(currentValue)
- }
- currentValue = propertyValue
- }
- })
- }
- };
- var toComparable = function(value, caseSensitive) {
- if (value instanceof Date) {
- return value.getTime()
- }
- if (value && value instanceof Class && value.valueOf) {
- return value.valueOf()
- }
- if (!caseSensitive && "string" === typeof value) {
- return value.toLowerCase()
- }
- return value
- };
- exports.compileGetter = compileGetter;
- exports.compileSetter = compileSetter;
- exports.toComparable = toComparable
- },
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/core/errors.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errorUtils = __webpack_require__( /*! ./utils/error */ 129);
- module.exports = errorUtils({
- E0001: "Method is not implemented",
- E0002: "Member name collision: {0}",
- E0003: "A class must be instantiated using the 'new' keyword",
- E0004: "The NAME property of the component is not specified",
- E0005: "Unknown device",
- E0006: "Unknown endpoint key is requested",
- E0007: "'Invalidate' method is called outside the update transaction",
- E0008: "Type of the option name is not appropriate to create an action",
- E0009: "Component '{0}' has not been initialized for an element",
- E0010: "Animation configuration with the '{0}' type requires '{1}' configuration as {2}",
- E0011: "Unknown animation type '{0}'",
- E0012: "jQuery version is too old. Please upgrade jQuery to 1.10.0 or later",
- E0013: "KnockoutJS version is too old. Please upgrade KnockoutJS to 2.3.0 or later",
- E0014: "The 'release' method shouldn't be called for an unlocked Lock object",
- E0015: "Queued task returned an unexpected result",
- E0017: "Event namespace is not defined",
- E0018: "DevExpress.ui.DevExpressPopup widget is required",
- E0020: "Template engine '{0}' is not supported",
- E0021: "Unknown theme is set: {0}",
- E0022: "LINK[rel=DevExpress-theme] tags must go before DevExpress included scripts",
- E0023: "Template name is not specified",
- E0024: "DevExtreme bundle already included",
- E0025: "Unexpected argument type",
- E0100: "Unknown validation type is detected",
- E0101: "Misconfigured range validation rule is detected",
- E0102: "Misconfigured comparison validation rule is detected",
- E0110: "Unknown validation group is detected",
- E0120: "Adapter for a DevExpressValidator component cannot be configured",
- E0121: "The 'customItem' field of the 'onCustomItemCreating' function's parameter should contain a custom item or Promise that is resolved after the item is created.",
- W0000: "'{0}' is deprecated in {1}. {2}",
- W0001: "{0} - '{1}' option is deprecated in {2}. {3}",
- W0002: "{0} - '{1}' method is deprecated in {2}. {3}",
- W0003: "{0} - '{1}' property is deprecated in {2}. {3}",
- W0004: "Timeout for theme loading is over: {0}",
- W0005: "'{0}' event is deprecated in {1}. {2}",
- W0006: "Invalid recurrence rule: '{0}'",
- W0007: "'{0}' Globalize culture is not defined",
- W0008: "Invalid view name: '{0}'",
- W0009: "Invalid time zone name: '{0}'",
- W0010: "{0} is deprecated in {1}. {2}",
- W0011: "Number parsing is invoked while the parser is not defined",
- W0012: "Date parsing is invoked while the parser is not defined",
- W0013: "'{0}' file is deprecated in {1}. {2}",
- W0014: "{0} - '{1}' type is deprecated in {2}. {3}",
- W0015: "Instead of returning a value from the '{0}' function, write it into the '{1}' field of the function's parameter.",
- W0016: 'The "{0}" option does not accept the "{1}" value since v.{2}. {3}.'
- })
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/core/utils/date.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var adjust = __webpack_require__( /*! ./math */ 28).adjust;
- var each = __webpack_require__( /*! ./iterator */ 3).each;
- var camelize = __webpack_require__( /*! ./inflector */ 33).camelize;
- var isObject = typeUtils.isObject;
- var isString = typeUtils.isString;
- var isDate = typeUtils.isDate;
- var isDefined = typeUtils.isDefined;
- var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", "year"];
- var toMilliseconds = function toMilliseconds(value) {
- switch (value) {
- case "millisecond":
- return 1;
- case "second":
- return 1e3 * toMilliseconds("millisecond");
- case "minute":
- return 60 * toMilliseconds("second");
- case "hour":
- return 60 * toMilliseconds("minute");
- case "day":
- return 24 * toMilliseconds("hour");
- case "week":
- return 7 * toMilliseconds("day");
- case "month":
- return 30 * toMilliseconds("day");
- case "quarter":
- return 3 * toMilliseconds("month");
- case "year":
- return 365 * toMilliseconds("day");
- default:
- return 0
- }
- };
- var getDatesInterval = function(startDate, endDate, intervalUnit) {
- var delta = endDate.getTime() - startDate.getTime();
- var millisecondCount = toMilliseconds(intervalUnit) || 1;
- return Math.floor(delta / millisecondCount)
- };
- var getNextDateUnit = function(unit, withWeeks) {
- var interval = getDateUnitInterval(unit);
- switch (interval) {
- case "millisecond":
- return "second";
- case "second":
- return "minute";
- case "minute":
- return "hour";
- case "hour":
- return "day";
- case "day":
- return withWeeks ? "week" : "month";
- case "week":
- return "month";
- case "month":
- return "quarter";
- case "quarter":
- return "year";
- case "year":
- return "year";
- default:
- return 0
- }
- };
- var convertMillisecondsToDateUnits = function(value) {
- var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "month", "year"];
- var result = {};
- for (var i = dateUnitIntervals.length - 1; i >= 0; i--) {
- var dateUnitInterval = dateUnitIntervals[i];
- var dateUnitCount = Math.floor(value / toMilliseconds(dateUnitInterval));
- if (dateUnitCount > 0) {
- result[dateUnitInterval + "s"] = dateUnitCount;
- value -= convertDateUnitToMilliseconds(dateUnitInterval, dateUnitCount)
- }
- }
- return result
- };
- var dateToMilliseconds = function(tickInterval) {
- var milliseconds = 0;
- if (isObject(tickInterval)) {
- each(tickInterval, function(key, value) {
- milliseconds += convertDateUnitToMilliseconds(key.substr(0, key.length - 1), value)
- })
- }
- if (isString(tickInterval)) {
- milliseconds = convertDateUnitToMilliseconds(tickInterval, 1)
- }
- return milliseconds
- };
- var convertDateUnitToMilliseconds = function(dateUnit, count) {
- return toMilliseconds(dateUnit) * count
- };
- var getDateUnitInterval = function(tickInterval) {
- var maxInterval = -1;
- if (isString(tickInterval)) {
- return tickInterval
- }
- if (isObject(tickInterval)) {
- each(tickInterval, function(key, value) {
- for (var i = 0; i < dateUnitIntervals.length; i++) {
- if (value && (key === dateUnitIntervals[i] + "s" || key === dateUnitIntervals[i]) && maxInterval < i) {
- maxInterval = i
- }
- }
- });
- return dateUnitIntervals[maxInterval]
- }
- return ""
- };
- var tickIntervalToFormatMap = {
- millisecond: "millisecond",
- second: "longtime",
- minute: "shorttime",
- hour: "shorttime",
- day: "day",
- week: "day",
- month: "month",
- quarter: "quarter",
- year: "year"
- };
- function getDateFormatByTickInterval(tickInterval) {
- return tickIntervalToFormatMap[getDateUnitInterval(tickInterval)] || ""
- }
- var getQuarter = function(month) {
- return Math.floor(month / 3)
- };
- var getFirstQuarterMonth = function(month) {
- return 3 * getQuarter(month)
- };
- var correctDateWithUnitBeginning = function(date, dateInterval, withCorrection, firstDayOfWeek) {
- date = new Date(date.getTime());
- var oldDate = new Date(date.getTime());
- var dateUnitInterval = getDateUnitInterval(dateInterval);
- switch (dateUnitInterval) {
- case "second":
- date = new Date(1e3 * Math.floor(oldDate.getTime() / 1e3));
- break;
- case "minute":
- date = new Date(6e4 * Math.floor(oldDate.getTime() / 6e4));
- break;
- case "hour":
- date = new Date(36e5 * Math.floor(oldDate.getTime() / 36e5));
- break;
- case "year":
- date.setMonth(0);
- case "month":
- date.setDate(1);
- case "day":
- date.setHours(0, 0, 0, 0);
- break;
- case "week":
- date = getFirstWeekDate(date, firstDayOfWeek || 0);
- date.setHours(0, 0, 0, 0);
- break;
- case "quarter":
- var firstQuarterMonth = getFirstQuarterMonth(date.getMonth());
- var month = date.getMonth();
- date.setDate(1);
- date.setHours(0, 0, 0, 0);
- if (month !== firstQuarterMonth) {
- date.setMonth(firstQuarterMonth)
- }
- }
- if (withCorrection && "hour" !== dateUnitInterval && "minute" !== dateUnitInterval && "second" !== dateUnitInterval) {
- fixTimezoneGap(oldDate, date)
- }
- return date
- };
- var trimTime = function(date) {
- return dateUtils.correctDateWithUnitBeginning(date, "day")
- };
- var setToDayEnd = function(date) {
- var result = dateUtils.trimTime(date);
- result.setDate(result.getDate() + 1);
- return new Date(result.getTime() - 1)
- };
- var getDatesDifferences = function(date1, date2) {
- var counter = 0;
- var differences = {
- year: date1.getFullYear() !== date2.getFullYear(),
- month: date1.getMonth() !== date2.getMonth(),
- day: date1.getDate() !== date2.getDate(),
- hour: date1.getHours() !== date2.getHours(),
- minute: date1.getMinutes() !== date2.getMinutes(),
- second: date1.getSeconds() !== date2.getSeconds(),
- millisecond: date1.getMilliseconds() !== date2.getMilliseconds()
- };
- each(differences, function(key, value) {
- if (value) {
- counter++
- }
- });
- if (0 === counter && 0 !== getTimezonesDifference(date1, date2)) {
- differences.hour = true;
- counter++
- }
- differences.count = counter;
- return differences
- };
- function addDateInterval(value, interval, dir) {
- var result = new Date(value.getTime());
- var intervalObject = isString(interval) ? getDateIntervalByString(interval.toLowerCase()) : typeUtils.isNumeric(interval) ? convertMillisecondsToDateUnits(interval) : interval;
- if (intervalObject.years) {
- result.setFullYear(result.getFullYear() + intervalObject.years * dir)
- }
- if (intervalObject.quarters) {
- result.setMonth(result.getMonth() + 3 * intervalObject.quarters * dir)
- }
- if (intervalObject.months) {
- result.setMonth(result.getMonth() + intervalObject.months * dir)
- }
- if (intervalObject.weeks) {
- result.setDate(result.getDate() + 7 * intervalObject.weeks * dir)
- }
- if (intervalObject.days) {
- result.setDate(result.getDate() + intervalObject.days * dir)
- }
- if (intervalObject.hours) {
- result.setTime(result.getTime() + 36e5 * intervalObject.hours * dir)
- }
- if (intervalObject.minutes) {
- result.setTime(result.getTime() + 6e4 * intervalObject.minutes * dir)
- }
- if (intervalObject.seconds) {
- result.setTime(result.getTime() + 1e3 * intervalObject.seconds * dir)
- }
- if (intervalObject.milliseconds) {
- result.setTime(result.getTime() + intervalObject.milliseconds * dir)
- }
- return result
- }
- var addInterval = function(value, interval, isNegative) {
- var dir = isNegative ? -1 : 1;
- return isDate(value) ? addDateInterval(value, interval, dir) : adjust(value + interval * dir, interval)
- };
- var getSequenceByInterval = function(min, max, interval) {
- var intervals = [];
- var cur;
- intervals.push(isDate(min) ? new Date(min.getTime()) : min);
- cur = min;
- while (cur < max) {
- cur = addInterval(cur, interval);
- intervals.push(cur)
- }
- return intervals
- };
- var getViewFirstCellDate = function(viewType, date) {
- if ("month" === viewType) {
- return new Date(date.getFullYear(), date.getMonth(), 1)
- }
- if ("year" === viewType) {
- return new Date(date.getFullYear(), 0, date.getDate())
- }
- if ("decade" === viewType) {
- return new Date(getFirstYearInDecade(date), date.getMonth(), date.getDate())
- }
- if ("century" === viewType) {
- return new Date(getFirstDecadeInCentury(date), date.getMonth(), date.getDate())
- }
- };
- var getViewLastCellDate = function(viewType, date) {
- if ("month" === viewType) {
- return new Date(date.getFullYear(), date.getMonth(), getLastMonthDay(date))
- }
- if ("year" === viewType) {
- return new Date(date.getFullYear(), 11, date.getDate())
- }
- if ("decade" === viewType) {
- return new Date(getFirstYearInDecade(date) + 9, date.getMonth(), date.getDate())
- }
- if ("century" === viewType) {
- return new Date(getFirstDecadeInCentury(date) + 90, date.getMonth(), date.getDate())
- }
- };
- var getViewMinBoundaryDate = function(viewType, date) {
- var resultDate = new Date(date.getFullYear(), date.getMonth(), 1);
- if ("month" === viewType) {
- return resultDate
- }
- resultDate.setMonth(0);
- if ("year" === viewType) {
- return resultDate
- }
- if ("decade" === viewType) {
- resultDate.setFullYear(getFirstYearInDecade(date))
- }
- if ("century" === viewType) {
- resultDate.setFullYear(getFirstDecadeInCentury(date))
- }
- return resultDate
- };
- var getViewMaxBoundaryDate = function(viewType, date) {
- var resultDate = new Date(date);
- resultDate.setDate(getLastMonthDay(date));
- if ("month" === viewType) {
- return resultDate
- }
- resultDate.setMonth(11);
- resultDate.setDate(getLastMonthDay(resultDate));
- if ("year" === viewType) {
- return resultDate
- }
- if ("decade" === viewType) {
- resultDate.setFullYear(getFirstYearInDecade(date) + 9)
- }
- if ("century" === viewType) {
- resultDate.setFullYear(getFirstDecadeInCentury(date) + 99)
- }
- return resultDate
- };
- var getLastMonthDay = function(date) {
- var resultDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
- return resultDate.getDate()
- };
- var sameView = function(view, date1, date2) {
- return dateUtils[camelize("same " + view)](date1, date2)
- };
- var getViewUp = function(typeView) {
- switch (typeView) {
- case "month":
- return "year";
- case "year":
- return "decade";
- case "decade":
- return "century"
- }
- };
- var getViewDown = function(typeView) {
- switch (typeView) {
- case "century":
- return "decade";
- case "decade":
- return "year";
- case "year":
- return "month"
- }
- };
- var getDifferenceInMonth = function(typeView) {
- var difference = 1;
- if ("year" === typeView) {
- difference = 12
- }
- if ("decade" === typeView) {
- difference = 120
- }
- if ("century" === typeView) {
- difference = 1200
- }
- return difference
- };
- var getDifferenceInMonthForCells = function(typeView) {
- var difference = 1;
- if ("decade" === typeView) {
- difference = 12
- }
- if ("century" === typeView) {
- difference = 120
- }
- return difference
- };
- var getDateIntervalByString = function(intervalString) {
- var result = {};
- switch (intervalString) {
- case "year":
- result.years = 1;
- break;
- case "month":
- result.months = 1;
- break;
- case "quarter":
- result.months = 3;
- break;
- case "week":
- result.weeks = 1;
- break;
- case "day":
- result.days = 1;
- break;
- case "hour":
- result.hours = 1;
- break;
- case "minute":
- result.minutes = 1;
- break;
- case "second":
- result.seconds = 1;
- break;
- case "millisecond":
- result.milliseconds = 1
- }
- return result
- };
- var sameDate = function(date1, date2) {
- return sameMonthAndYear(date1, date2) && date1.getDate() === date2.getDate()
- };
- var sameMonthAndYear = function(date1, date2) {
- return sameYear(date1, date2) && date1.getMonth() === date2.getMonth()
- };
- var sameYear = function(date1, date2) {
- return date1 && date2 && date1.getFullYear() === date2.getFullYear()
- };
- var sameDecade = function(date1, date2) {
- if (!isDefined(date1) || !isDefined(date2)) {
- return
- }
- var startDecadeDate1 = date1.getFullYear() - date1.getFullYear() % 10;
- var startDecadeDate2 = date2.getFullYear() - date2.getFullYear() % 10;
- return date1 && date2 && startDecadeDate1 === startDecadeDate2
- };
- var sameCentury = function(date1, date2) {
- if (!isDefined(date1) || !isDefined(date2)) {
- return
- }
- var startCenturyDate1 = date1.getFullYear() - date1.getFullYear() % 100;
- var startCenturyDate2 = date2.getFullYear() - date2.getFullYear() % 100;
- return date1 && date2 && startCenturyDate1 === startCenturyDate2
- };
- var getFirstDecadeInCentury = function(date) {
- return date && date.getFullYear() - date.getFullYear() % 100
- };
- var getFirstYearInDecade = function(date) {
- return date && date.getFullYear() - date.getFullYear() % 10
- };
- var getShortDateFormat = function() {
- return "yyyy/MM/dd"
- };
- var getFirstMonthDate = function(date) {
- if (!isDefined(date)) {
- return
- }
- var newDate = new Date(date.getFullYear(), date.getMonth(), 1);
- return newDate
- };
- var getLastMonthDate = function(date) {
- if (!isDefined(date)) {
- return
- }
- var newDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
- return newDate
- };
- var getFirstWeekDate = function(date, firstDayOfWeek) {
- var delta = (date.getDay() - firstDayOfWeek + 7) % 7;
- var result = new Date(date);
- result.setDate(date.getDate() - delta);
- return result
- };
- var normalizeDateByWeek = function(date, currentDate) {
- var differenceInDays = dateUtils.getDatesInterval(date, currentDate, "day");
- var resultDate = new Date(date);
- if (differenceInDays >= 6) {
- resultDate = new Date(resultDate.setDate(resultDate.getDate() + 7))
- }
- return resultDate
- };
- var dateInRange = function(date, min, max, format) {
- if ("date" === format) {
- min = min && dateUtils.correctDateWithUnitBeginning(min, "day");
- max = max && dateUtils.correctDateWithUnitBeginning(max, "day");
- date = date && dateUtils.correctDateWithUnitBeginning(date, "day")
- }
- return normalizeDate(date, min, max) === date
- };
- var dateTimeFromDecimal = function(number) {
- var hours = Math.floor(number);
- var minutes = number % 1 * 60;
- return {
- hours: hours,
- minutes: minutes
- }
- };
- var roundDateByStartDayHour = function(date, startDayHour) {
- var startTime = this.dateTimeFromDecimal(startDayHour);
- var result = new Date(date);
- if (date.getHours() === startTime.hours && date.getMinutes() < startTime.minutes || date.getHours() < startTime.hours) {
- result.setHours(startTime.hours, startTime.minutes, 0, 0)
- }
- return result
- };
- var normalizeDate = function(date, min, max) {
- var normalizedDate = date;
- if (!isDefined(date)) {
- return date
- }
- if (isDefined(min) && date < min) {
- normalizedDate = min
- }
- if (isDefined(max) && date > max) {
- normalizedDate = max
- }
- return normalizedDate
- };
- var fixTimezoneGap = function(oldDate, newDate) {
- if (!isDefined(oldDate)) {
- return
- }
- var diff = newDate.getHours() - oldDate.getHours();
- if (0 === diff) {
- return
- }
- var sign = 1 === diff || diff === -23 ? -1 : 1;
- var trial = new Date(newDate.getTime() + 36e5 * sign);
- if (sign > 0 || trial.getDate() === newDate.getDate()) {
- newDate.setTime(trial.getTime())
- }
- };
- var roundToHour = function(date) {
- date.setHours(date.getHours() + 1);
- date.setMinutes(0);
- return date
- };
- var getTimezonesDifference = function(min, max) {
- return 60 * (max.getTimezoneOffset() - min.getTimezoneOffset()) * 1e3
- };
- var makeDate = function(date) {
- return new Date(date)
- };
- var getDatesOfInterval = function(startDate, endDate, step) {
- var result = [];
- var currentDate = new Date(startDate.getTime());
- if (startDate.getTime() === endDate.getTime()) {
- result.push(new Date(startDate.getTime()))
- }
- while (currentDate < endDate) {
- result.push(new Date(currentDate.getTime()));
- currentDate = this.addInterval(currentDate, step)
- }
- return result
- };
- var dateUtils = {
- dateUnitIntervals: dateUnitIntervals,
- convertMillisecondsToDateUnits: convertMillisecondsToDateUnits,
- dateToMilliseconds: dateToMilliseconds,
- getNextDateUnit: getNextDateUnit,
- convertDateUnitToMilliseconds: convertDateUnitToMilliseconds,
- getDateUnitInterval: getDateUnitInterval,
- getDateFormatByTickInterval: getDateFormatByTickInterval,
- getDatesDifferences: getDatesDifferences,
- correctDateWithUnitBeginning: correctDateWithUnitBeginning,
- trimTime: trimTime,
- setToDayEnd: setToDayEnd,
- roundDateByStartDayHour: roundDateByStartDayHour,
- dateTimeFromDecimal: dateTimeFromDecimal,
- addDateInterval: addDateInterval,
- addInterval: addInterval,
- getSequenceByInterval: getSequenceByInterval,
- getDateIntervalByString: getDateIntervalByString,
- sameDate: sameDate,
- sameMonthAndYear: sameMonthAndYear,
- sameMonth: sameMonthAndYear,
- sameYear: sameYear,
- sameDecade: sameDecade,
- sameCentury: sameCentury,
- sameView: sameView,
- getDifferenceInMonth: getDifferenceInMonth,
- getDifferenceInMonthForCells: getDifferenceInMonthForCells,
- getFirstYearInDecade: getFirstYearInDecade,
- getFirstDecadeInCentury: getFirstDecadeInCentury,
- getShortDateFormat: getShortDateFormat,
- getViewFirstCellDate: getViewFirstCellDate,
- getViewLastCellDate: getViewLastCellDate,
- getViewDown: getViewDown,
- getViewUp: getViewUp,
- getLastMonthDay: getLastMonthDay,
- getLastMonthDate: getLastMonthDate,
- getFirstMonthDate: getFirstMonthDate,
- getFirstWeekDate: getFirstWeekDate,
- normalizeDateByWeek: normalizeDateByWeek,
- getQuarter: getQuarter,
- getFirstQuarterMonth: getFirstQuarterMonth,
- dateInRange: dateInRange,
- roundToHour: roundToHour,
- normalizeDate: normalizeDate,
- getViewMinBoundaryDate: getViewMinBoundaryDate,
- getViewMaxBoundaryDate: getViewMaxBoundaryDate,
- fixTimezoneGap: fixTimezoneGap,
- getTimezonesDifference: getTimezonesDifference,
- makeDate: makeDate,
- getDatesInterval: getDatesInterval,
- getDatesOfInterval: getDatesOfInterval
- };
- module.exports = dateUtils
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/events/pointer.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _support = __webpack_require__( /*! ../core/utils/support */ 43);
- var _support2 = _interopRequireDefault(_support);
- var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var _browser = __webpack_require__( /*! ../core/utils/browser */ 25);
- var _browser2 = _interopRequireDefault(_browser);
- var _devices = __webpack_require__( /*! ../core/devices */ 16);
- var _devices2 = _interopRequireDefault(_devices);
- var _event_registrator = __webpack_require__( /*! ./core/event_registrator */ 71);
- var _event_registrator2 = _interopRequireDefault(_event_registrator);
- var _touch = __webpack_require__( /*! ./pointer/touch */ 265);
- var _touch2 = _interopRequireDefault(_touch);
- var _mspointer = __webpack_require__( /*! ./pointer/mspointer */ 447);
- var _mspointer2 = _interopRequireDefault(_mspointer);
- var _mouse = __webpack_require__( /*! ./pointer/mouse */ 267);
- var _mouse2 = _interopRequireDefault(_mouse);
- var _mouse_and_touch = __webpack_require__( /*! ./pointer/mouse_and_touch */ 448);
- var _mouse_and_touch2 = _interopRequireDefault(_mouse_and_touch);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var getStrategy = function(support, device, browser) {
- if (support.pointerEvents && browser.msie) {
- return _mspointer2.default
- }
- var tablet = device.tablet,
- phone = device.phone;
- if (support.touch && !(tablet || phone)) {
- return _mouse_and_touch2.default
- }
- if (support.touch) {
- return _touch2.default
- }
- return _mouse2.default
- };
- var EventStrategy = getStrategy(_support2.default, _devices2.default.real(), _browser2.default);
- (0, _iterator.each)(EventStrategy.map, function(pointerEvent, originalEvents) {
- (0, _event_registrator2.default)(pointerEvent, new EventStrategy(pointerEvent, originalEvents))
- });
- var pointer = {
- down: "dxpointerdown",
- up: "dxpointerup",
- move: "dxpointermove",
- cancel: "dxpointercancel",
- enter: "dxpointerenter",
- leave: "dxpointerleave",
- over: "dxpointerover",
- out: "dxpointerout"
- };
- pointer.getStrategy = getStrategy;
- module.exports = pointer
- }, ,
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/browser.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ./extend */ 0).extend;
- var windowUtils = __webpack_require__( /*! ./window */ 7);
- var navigator = windowUtils.getNavigator();
- var webkitRegExp = /(webkit)[ \/]([\w.]+)/;
- var ieRegExp = /(msie) (\d{1,2}\.\d)/;
- var ie11RegExp = /(trident).*rv:(\d{1,2}\.\d)/;
- var msEdge = /(edge)\/((\d+)?[\w.]+)/;
- var mozillaRegExp = /(mozilla)(?:.*? rv:([\w.]+))/;
- var browserFromUA = function(ua) {
- ua = ua.toLowerCase();
- var result = {};
- var matches = ieRegExp.exec(ua) || ie11RegExp.exec(ua) || msEdge.exec(ua) || ua.indexOf("compatible") < 0 && mozillaRegExp.exec(ua) || webkitRegExp.exec(ua) || [];
- var browserName = matches[1];
- var browserVersion = matches[2];
- if ("webkit" === browserName) {
- result.webkit = true;
- if (ua.indexOf("chrome") >= 0 || ua.indexOf("crios") >= 0) {
- browserName = "chrome";
- browserVersion = /(?:chrome|crios)\/(\d+\.\d+)/.exec(ua);
- browserVersion = browserVersion && browserVersion[1]
- } else {
- if (ua.indexOf("fxios") >= 0) {
- browserName = "mozilla";
- browserVersion = /fxios\/(\d+\.\d+)/.exec(ua);
- browserVersion = browserVersion && browserVersion[1]
- } else {
- if (ua.indexOf("safari") >= 0 && /version|phantomjs/.test(ua)) {
- browserName = "safari";
- browserVersion = /(?:version|phantomjs)\/([0-9.]+)/.exec(ua);
- browserVersion = browserVersion && browserVersion[1]
- } else {
- browserName = "unknown";
- browserVersion = /applewebkit\/([0-9.]+)/.exec(ua);
- browserVersion = browserVersion && browserVersion[1]
- }
- }
- }
- }
- if ("trident" === browserName || "edge" === browserName) {
- browserName = "msie"
- }
- if (browserName) {
- result[browserName] = true;
- result.version = browserVersion
- }
- return result
- };
- module.exports = extend({
- _fromUA: browserFromUA
- }, browserFromUA(navigator.userAgent))
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/core/utils/callbacks.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Callback = function(options) {
- this._options = options || {};
- this._list = [];
- this._queue = [];
- this._firing = false;
- this._fired = false;
- this._firingIndexes = []
- };
- Callback.prototype._fireCore = function(context, args) {
- var firingIndexes = this._firingIndexes;
- var list = this._list;
- var stopOnFalse = this._options.stopOnFalse;
- var step = firingIndexes.length;
- for (firingIndexes[step] = 0; firingIndexes[step] < list.length; firingIndexes[step]++) {
- var result = list[firingIndexes[step]].apply(context, args);
- if (false === result && stopOnFalse) {
- break
- }
- }
- firingIndexes.pop()
- };
- Callback.prototype.add = function(fn) {
- if ("function" === typeof fn && (!this._options.unique || !this.has(fn))) {
- this._list.push(fn)
- }
- return this
- };
- Callback.prototype.remove = function(fn) {
- var list = this._list;
- var firingIndexes = this._firingIndexes;
- var index = list.indexOf(fn);
- if (index > -1) {
- list.splice(index, 1);
- if (this._firing && firingIndexes.length) {
- for (var step = 0; step < firingIndexes.length; step++) {
- if (index <= firingIndexes[step]) {
- firingIndexes[step]--
- }
- }
- }
- }
- return this
- };
- Callback.prototype.has = function(fn) {
- var list = this._list;
- return fn ? list.indexOf(fn) > -1 : !!list.length
- };
- Callback.prototype.empty = function(fn) {
- this._list = [];
- return this
- };
- Callback.prototype.fireWith = function(context, args) {
- var queue = this._queue;
- args = args || [];
- args = args.slice ? args.slice() : args;
- if (this._options.syncStrategy) {
- this._firing = true;
- this._fireCore(context, args)
- } else {
- queue.push([context, args]);
- if (this._firing) {
- return
- }
- this._firing = true;
- while (queue.length) {
- var memory = queue.shift();
- this._fireCore(memory[0], memory[1])
- }
- }
- this._firing = false;
- this._fired = true;
- return this
- };
- Callback.prototype.fire = function() {
- this.fireWith(this, arguments)
- };
- Callback.prototype.fired = function() {
- return this._fired
- };
- var Callbacks = function(options) {
- return new Callback(options)
- };
- module.exports = Callbacks
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/animation/translator.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
- var type = __webpack_require__( /*! ../core/utils/type */ 1).type;
- var TRANSLATOR_DATA_KEY = "dxTranslator";
- var TRANSFORM_MATRIX_REGEX = /matrix(3d)?\((.+?)\)/;
- var TRANSLATE_REGEX = /translate(?:3d)?\((.+?)\)/;
- var locate = function($element) {
- var translate = getTranslate($element);
- return {
- left: translate.x,
- top: translate.y
- }
- };
- var move = function($element, position) {
- var left = position.left;
- var top = position.top;
- var translate;
- if (void 0 === left) {
- translate = getTranslate($element);
- translate.y = top || 0
- } else {
- if (void 0 === top) {
- translate = getTranslate($element);
- translate.x = left || 0
- } else {
- translate = {
- x: left || 0,
- y: top || 0,
- z: 0
- };
- cacheTranslate($element, translate)
- }
- }
- $element.css({
- transform: getTranslateCss(translate)
- });
- if (isPercentValue(left) || isPercentValue(top)) {
- clearCache($element)
- }
- };
- var isPercentValue = function(value) {
- return "string" === type(value) && "%" === value[value.length - 1]
- };
- var getTranslate = function($element) {
- var result = $element.length ? dataUtils.data($element.get(0), TRANSLATOR_DATA_KEY) : null;
- if (!result) {
- var transformValue = $element.css("transform") || getTranslateCss({
- x: 0,
- y: 0
- });
- var matrix = transformValue.match(TRANSFORM_MATRIX_REGEX);
- var is3D = matrix && matrix[1];
- if (matrix) {
- matrix = matrix[2].split(",");
- if ("3d" === is3D) {
- matrix = matrix.slice(12, 15)
- } else {
- matrix.push(0);
- matrix = matrix.slice(4, 7)
- }
- } else {
- matrix = [0, 0, 0]
- }
- result = {
- x: parseFloat(matrix[0]),
- y: parseFloat(matrix[1]),
- z: parseFloat(matrix[2])
- };
- cacheTranslate($element, result)
- }
- return result
- };
- var cacheTranslate = function($element, translate) {
- if ($element.length) {
- dataUtils.data($element.get(0), TRANSLATOR_DATA_KEY, translate)
- }
- };
- var clearCache = function($element) {
- if ($element.length) {
- dataUtils.removeData($element.get(0), TRANSLATOR_DATA_KEY)
- }
- };
- var resetPosition = function($element, finishTransition) {
- var originalTransition;
- var stylesConfig = {
- left: 0,
- top: 0,
- transform: "none"
- };
- if (finishTransition) {
- originalTransition = $element.css("transition");
- stylesConfig.transition = "none"
- }
- $element.css(stylesConfig);
- clearCache($element);
- if (finishTransition) {
- $element.get(0).offsetHeight;
- $element.css("transition", originalTransition)
- }
- };
- var parseTranslate = function(translateString) {
- var result = translateString.match(TRANSLATE_REGEX);
- if (!result || !result[1]) {
- return
- }
- result = result[1].split(",");
- result = {
- x: parseFloat(result[0]),
- y: parseFloat(result[1]),
- z: parseFloat(result[2])
- };
- return result
- };
- var getTranslateCss = function(translate) {
- translate.x = translate.x || 0;
- translate.y = translate.y || 0;
- var xValueString = isPercentValue(translate.x) ? translate.x : translate.x + "px";
- var yValueString = isPercentValue(translate.y) ? translate.y : translate.y + "px";
- return "translate(" + xValueString + ", " + yValueString + ")"
- };
- exports.move = move;
- exports.locate = locate;
- exports.clearCache = clearCache;
- exports.parseTranslate = parseTranslate;
- exports.getTranslate = getTranslate;
- exports.getTranslateCss = getTranslateCss;
- exports.resetPosition = resetPosition
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/core/utils/math.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isExponential = __webpack_require__( /*! ./type */ 1).isExponential;
- var sign = function(value) {
- if (0 === value) {
- return 0
- }
- return value / Math.abs(value)
- };
- var fitIntoRange = function(value, minValue, maxValue) {
- var isMinValueUndefined = !minValue && 0 !== minValue;
- var isMaxValueUndefined = !maxValue && 0 !== maxValue;
- isMinValueUndefined && (minValue = !isMaxValueUndefined ? Math.min(value, maxValue) : value);
- isMaxValueUndefined && (maxValue = !isMinValueUndefined ? Math.max(value, minValue) : value);
- return Math.min(Math.max(value, minValue), maxValue)
- };
- var inRange = function(value, minValue, maxValue) {
- return value >= minValue && value <= maxValue
- };
- function getExponent(value) {
- return Math.abs(parseInt(value.toExponential().split("e")[1]))
- }
- function _isEdgeBug() {
- var value = 3e-4;
- var correctValue = "0.000300";
- var precisionValue = 3;
- return correctValue !== value.toPrecision(precisionValue)
- }
- function adjust(value, interval) {
- var precision = getPrecision(interval || 0) + 2;
- var separatedValue = value.toString().split(".");
- var sourceValue = value;
- var absValue = Math.abs(value);
- var isExponentValue = isExponential(value);
- var integerPart = absValue > 1 ? 10 : 0;
- if (1 === separatedValue.length) {
- return value
- }
- if (!isExponentValue) {
- if (isExponential(interval)) {
- precision = separatedValue[0].length + getExponent(interval)
- }
- value = absValue;
- value = value - Math.floor(value) + integerPart
- }
- precision = _isEdgeBug() && getExponent(value) > 6 || precision > 7 ? 15 : 7;
- if (!isExponentValue) {
- var separatedAdjustedValue = parseFloat(value.toPrecision(precision)).toString().split(".");
- if (separatedAdjustedValue[0] === integerPart.toString()) {
- return parseFloat(separatedValue[0] + "." + separatedAdjustedValue[1])
- }
- }
- return parseFloat(sourceValue.toPrecision(precision))
- }
- function getPrecision(value) {
- var str = value.toString();
- if (str.indexOf(".") < 0) {
- return 0
- }
- var mantissa = str.split(".");
- var positionOfDelimiter = mantissa[1].indexOf("e");
- return positionOfDelimiter >= 0 ? positionOfDelimiter : mantissa[1].length
- }
- function getRoot(x, n) {
- if (x < 0 && n % 2 !== 1) {
- return NaN
- }
- var y = Math.pow(Math.abs(x), 1 / n);
- return n % 2 === 1 && x < 0 ? -y : y
- }
- function solveCubicEquation(a, b, c, d) {
- var min = 1e-8;
- if (Math.abs(a) < min) {
- a = b;
- b = c;
- c = d;
- if (Math.abs(a) < min) {
- a = b;
- b = c;
- if (Math.abs(a) < min) {
- return []
- }
- return [-b / a]
- }
- var D2 = b * b - 4 * a * c;
- if (Math.abs(D2) < min) {
- return [-b / (2 * a)]
- } else {
- if (D2 > 0) {
- return [(-b + Math.sqrt(D2)) / (2 * a), (-b - Math.sqrt(D2)) / (2 * a)]
- }
- }
- return []
- }
- var p = (3 * a * c - b * b) / (3 * a * a);
- var q = (2 * b * b * b - 9 * a * b * c + 27 * a * a * d) / (27 * a * a * a);
- var roots;
- var u;
- if (Math.abs(p) < min) {
- roots = [getRoot(-q, 3)]
- } else {
- if (Math.abs(q) < min) {
- roots = [0].concat(p < 0 ? [Math.sqrt(-p), -Math.sqrt(-p)] : [])
- } else {
- var D3 = q * q / 4 + p * p * p / 27;
- if (Math.abs(D3) < min) {
- roots = [-1.5 * q / p, 3 * q / p]
- } else {
- if (D3 > 0) {
- u = getRoot(-q / 2 - Math.sqrt(D3), 3);
- roots = [u - p / (3 * u)]
- } else {
- u = 2 * Math.sqrt(-p / 3);
- var t = Math.acos(3 * q / p / u) / 3;
- var k = 2 * Math.PI / 3;
- roots = [u * Math.cos(t), u * Math.cos(t - k), u * Math.cos(t - 2 * k)]
- }
- }
- }
- }
- for (var i = 0; i < roots.length; i++) {
- roots[i] -= b / (3 * a)
- }
- return roots
- }
- exports.sign = sign;
- exports.fitIntoRange = fitIntoRange;
- exports.inRange = inRange;
- exports.adjust = adjust;
- exports.getPrecision = getPrecision;
- exports.getExponent = getExponent;
- exports.getRoot = getRoot;
- exports.solveCubicEquation = solveCubicEquation
- }, ,
- /*!*******************************************!*\
- !*** ./artifacts/transpiled/ui/themes.js ***!
- \*******************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
- var errors = __webpack_require__( /*! ./widget/ui.errors */ 17);
- var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
- var readyCallbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 48);
- var ready = readyCallbacks.add;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var devices = __webpack_require__( /*! ../core/devices */ 16);
- var viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 78);
- var themeReadyCallback = __webpack_require__( /*! ./themes_callback */ 269);
- var viewPort = viewPortUtils.value;
- var Promise = __webpack_require__( /*! ../core/polyfills/promise */ 76);
- var viewPortChanged = viewPortUtils.changeCallback;
- var DX_LINK_SELECTOR = "link[rel=dx-theme]";
- var THEME_ATTR = "data-theme";
- var ACTIVE_ATTR = "data-active";
- var DX_HAIRLINES_CLASS = "dx-hairlines";
- var context;
- var $activeThemeLink;
- var knownThemes;
- var currentThemeName;
- var pendingThemeName;
- var timerId;
- var THEME_MARKER_PREFIX = "dx.";
- function readThemeMarker() {
- if (!windowUtils.hasWindow()) {
- return null
- }
- var element = $("<div>", context).addClass("dx-theme-marker").appendTo(context.documentElement);
- var result;
- try {
- result = element.css("fontFamily");
- if (!result) {
- return null
- }
- result = result.replace(/["']/g, "");
- if (result.substr(0, THEME_MARKER_PREFIX.length) !== THEME_MARKER_PREFIX) {
- return null
- }
- return result.substr(THEME_MARKER_PREFIX.length)
- } finally {
- element.remove()
- }
- }
- function waitForThemeLoad(themeName) {
- var waitStartTime;
- pendingThemeName = themeName;
- function handleLoaded() {
- pendingThemeName = null;
- themeReadyCallback.fire();
- themeReadyCallback.empty()
- }
- if (isPendingThemeLoaded()) {
- handleLoaded()
- } else {
- waitStartTime = Date.now();
- timerId = setInterval(function() {
- var isLoaded = isPendingThemeLoaded();
- var isTimeout = !isLoaded && Date.now() - waitStartTime > 15e3;
- if (isTimeout) {
- errors.log("W0004", pendingThemeName)
- }
- if (isLoaded || isTimeout) {
- clearInterval(timerId);
- timerId = void 0;
- handleLoaded()
- }
- }, 10)
- }
- }
- function isPendingThemeLoaded() {
- return !pendingThemeName || readThemeMarker() === pendingThemeName
- }
- function processMarkup() {
- var $allThemeLinks = $(DX_LINK_SELECTOR, context);
- if (!$allThemeLinks.length) {
- return
- }
- knownThemes = {};
- $activeThemeLink = $(domUtils.createMarkupFromString("<link rel=stylesheet>"), context);
- $allThemeLinks.each(function() {
- var link = $(this, context);
- var fullThemeName = link.attr(THEME_ATTR);
- var url = link.attr("href");
- var isActive = "true" === link.attr(ACTIVE_ATTR);
- knownThemes[fullThemeName] = {
- url: url,
- isActive: isActive
- }
- });
- $allThemeLinks.last().after($activeThemeLink);
- $allThemeLinks.remove()
- }
- function resolveFullThemeName(desiredThemeName) {
- var desiredThemeParts = desiredThemeName.split(".");
- var result = null;
- if (knownThemes) {
- if (desiredThemeName in knownThemes) {
- return desiredThemeName
- }
- each(knownThemes, function(knownThemeName, themeData) {
- var knownThemeParts = knownThemeName.split(".");
- if (knownThemeParts[0] !== desiredThemeParts[0]) {
- return
- }
- if (desiredThemeParts[1] && desiredThemeParts[1] !== knownThemeParts[1]) {
- return
- }
- if (desiredThemeParts[2] && desiredThemeParts[2] !== knownThemeParts[2]) {
- return
- }
- if (!result || themeData.isActive) {
- result = knownThemeName
- }
- if (themeData.isActive) {
- return false
- }
- })
- }
- return result
- }
- function initContext(newContext) {
- try {
- if (newContext !== context) {
- knownThemes = null
- }
- } catch (x) {
- knownThemes = null
- }
- context = newContext
- }
- function init(options) {
- options = options || {};
- initContext(options.context || domAdapter.getDocument());
- if (!context) {
- return
- }
- processMarkup();
- currentThemeName = void 0;
- current(options)
- }
- function current(options) {
- if (!arguments.length) {
- currentThemeName = currentThemeName || readThemeMarker();
- return currentThemeName
- }
- detachCssClasses(viewPort());
- options = options || {};
- if ("string" === typeof options) {
- options = {
- theme: options
- }
- }
- var isAutoInit = options._autoInit;
- var loadCallback = options.loadCallback;
- var currentThemeData;
- currentThemeName = options.theme || currentThemeName;
- if (isAutoInit && !currentThemeName) {
- currentThemeName = themeNameFromDevice(devices.current())
- }
- currentThemeName = resolveFullThemeName(currentThemeName);
- if (currentThemeName) {
- currentThemeData = knownThemes[currentThemeName]
- }
- if (loadCallback) {
- themeReadyCallback.add(loadCallback)
- }
- if (currentThemeData) {
- $activeThemeLink.attr("href", knownThemes[currentThemeName].url);
- if ((themeReadyCallback.has() || options._forceTimeout) && !timerId) {
- waitForThemeLoad(currentThemeName)
- } else {
- if (pendingThemeName) {
- pendingThemeName = currentThemeName
- }
- }
- } else {
- if (isAutoInit) {
- themeReadyCallback.fire();
- themeReadyCallback.empty()
- } else {
- throw errors.Error("E0021", currentThemeName)
- }
- }
- checkThemeDeprecation();
- attachCssClasses(viewPortUtils.originalViewPort(), currentThemeName)
- }
- function themeNameFromDevice(device) {
- var themeName = device.platform;
- switch (themeName) {
- case "ios":
- return "ios7";
- case "android":
- case "win":
- return "generic"
- }
- return themeName
- }
- function getCssClasses(themeName) {
- themeName = themeName || current();
- var result = [];
- var themeNameParts = themeName && themeName.split(".");
- if (themeNameParts) {
- result.push("dx-theme-" + themeNameParts[0], "dx-theme-" + themeNameParts[0] + "-typography");
- if (themeNameParts.length > 1) {
- result.push("dx-color-scheme-" + themeNameParts[1] + (isMaterial(themeName) ? "-" + themeNameParts[2] : ""))
- }
- }
- return result
- }
- var themeClasses;
- function attachCssClasses(element, themeName) {
- themeClasses = getCssClasses(themeName).join(" ");
- $(element).addClass(themeClasses);
- var activateHairlines = function() {
- var pixelRatio = windowUtils.hasWindow() && window.devicePixelRatio;
- if (!pixelRatio || pixelRatio < 2) {
- return
- }
- var $tester = $("<div>");
- $tester.css("border", ".5px solid transparent");
- $("body").append($tester);
- if (1 === $tester.outerHeight()) {
- $(element).addClass(DX_HAIRLINES_CLASS);
- themeClasses += " " + DX_HAIRLINES_CLASS
- }
- $tester.remove()
- };
- activateHairlines()
- }
- function detachCssClasses(element) {
- $(element).removeClass(themeClasses)
- }
- function themeReady(callback) {
- themeReadyCallback.add(callback)
- }
- function isTheme(themeRegExp, themeName) {
- if (!themeName) {
- themeName = currentThemeName || readThemeMarker()
- }
- return new RegExp(themeRegExp).test(themeName)
- }
- function isMaterial(themeName) {
- return isTheme("material", themeName)
- }
- function isIos7(themeName) {
- return isTheme("ios7", themeName)
- }
- function isGeneric(themeName) {
- return isTheme("generic", themeName)
- }
- function checkThemeDeprecation() {
- if (isIos7()) {
- errors.log("W0010", "The 'ios7' theme", "19.1", "Use the 'generic' theme instead.")
- }
- }
- function isWebFontLoaded(text, fontWeight) {
- var testedFont = "Roboto, RobotoFallback, Arial";
- var etalonFont = "Arial";
- var document = domAdapter.getDocument();
- var testElement = document.createElement("span");
- testElement.style.position = "absolute";
- testElement.style.top = "-9999px";
- testElement.style.left = "-9999px";
- testElement.style.visibility = "hidden";
- testElement.style.fontFamily = etalonFont;
- testElement.style.fontSize = "250px";
- testElement.style.fontWeight = fontWeight;
- testElement.innerHTML = text;
- document.body.appendChild(testElement);
- var etalonFontWidth = testElement.offsetWidth;
- testElement.style.fontFamily = testedFont;
- var testedFontWidth = testElement.offsetWidth;
- testElement.parentNode.removeChild(testElement);
- return etalonFontWidth !== testedFontWidth
- }
- function waitWebFont(text, fontWeight) {
- var interval = 15;
- var timeout = 2e3;
- return new Promise(function(resolve) {
- var check = function() {
- if (isWebFontLoaded(text, fontWeight)) {
- clear()
- }
- };
- var clear = function() {
- clearInterval(intervalId);
- clearTimeout(timeoutId);
- resolve()
- };
- var intervalId = setInterval(check, interval);
- var timeoutId = setTimeout(clear, timeout)
- })
- }
- var initDeferred = new Deferred;
- function autoInit() {
- init({
- _autoInit: true,
- _forceTimeout: true
- });
- if ($(DX_LINK_SELECTOR, context).length) {
- throw errors.Error("E0022")
- }
- initDeferred.resolve()
- }
- if (windowUtils.hasWindow()) {
- autoInit()
- } else {
- ready(autoInit)
- }
- viewPortChanged.add(function(viewPort, prevViewPort) {
- initDeferred.done(function() {
- detachCssClasses(prevViewPort);
- attachCssClasses(viewPort)
- })
- });
- devices.changed.add(function() {
- init({
- _autoInit: true
- })
- });
- exports.current = current;
- exports.ready = themeReady;
- exports.init = init;
- exports.attachCssClasses = attachCssClasses;
- exports.detachCssClasses = detachCssClasses;
- exports.themeNameFromDevice = themeNameFromDevice;
- exports.waitForThemeLoad = waitForThemeLoad;
- exports.isMaterial = isMaterial;
- exports.isIos7 = isIos7;
- exports.isGeneric = isGeneric;
- exports.isWebFontLoaded = isWebFontLoaded;
- exports.waitWebFont = waitWebFont;
- exports.resetTheme = function() {
- $activeThemeLink && $activeThemeLink.attr("href", "about:blank");
- currentThemeName = null;
- pendingThemeName = null
- }
- },
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/core/config.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _extend = __webpack_require__( /*! ./utils/extend */ 0);
- var _extend2 = _interopRequireDefault(_extend);
- var _errors = __webpack_require__( /*! ./errors */ 21);
- var _errors2 = _interopRequireDefault(_errors);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var config = {
- rtlEnabled: false,
- defaultCurrency: "USD",
- oDataFilterToLower: true,
- serverDecimalSeparator: ".",
- decimalSeparator: ".",
- thousandsSeparator: ",",
- forceIsoDateParsing: true,
- wrapActionsBeforeExecute: true,
- useLegacyStoreResult: false,
- useJQuery: void 0,
- editorStylingMode: void 0,
- useLegacyVisibleIndex: false,
- floatingActionButtonConfig: {
- icon: "add",
- closeIcon: "close",
- position: {
- at: "right bottom",
- my: "right bottom",
- offset: {
- x: -16,
- y: -16
- }
- },
- maxSpeedDialActionCount: 5
- },
- optionsParser: function(optionsString) {
- if ("{" !== optionsString.trim().charAt(0)) {
- optionsString = "{" + optionsString + "}"
- }
- try {
- return new Function("return " + optionsString)()
- } catch (ex) {
- throw _errors2.default.Error("E3018", ex, optionsString)
- }
- }
- };
- var configMethod = function() {
- if (!arguments.length) {
- return config
- }
- _extend2.default.extend(config, arguments.length <= 0 ? void 0 : arguments[0])
- };
- if ("undefined" !== typeof DevExpress && DevExpress.config) {
- configMethod(DevExpress.config)
- }
- module.exports = configMethod
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/localization/date.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
- var isString = __webpack_require__( /*! ../core/utils/type */ 1).isString;
- var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
- var getLDMLDateFormatter = __webpack_require__( /*! ./ldml/date.formatter */ 257).getFormatter;
- var getLDMLDateFormat = __webpack_require__( /*! ./ldml/date.format */ 208).getFormat;
- var getLDMLDateParser = __webpack_require__( /*! ./ldml/date.parser */ 211).getParser;
- var defaultDateNames = __webpack_require__( /*! ./default_date_names */ 258);
- var numberLocalization = __webpack_require__( /*! ./number */ 51);
- var errors = __webpack_require__( /*! ../core/errors */ 21);
- __webpack_require__( /*! ./core */ 87);
- var FORMATS_TO_PATTERN_MAP = {
- shortdate: "M/d/y",
- shorttime: "h:mm a",
- longdate: "EEEE, MMMM d, y",
- longtime: "h:mm:ss a",
- monthandday: "MMMM d",
- monthandyear: "MMMM y",
- quarterandyear: "QQQ y",
- day: "d",
- year: "y",
- shortdateshorttime: "M/d/y, h:mm a",
- mediumdatemediumtime: "MMMM d, h:mm a",
- longdatelongtime: "EEEE, MMMM d, y, h:mm:ss a",
- month: "LLLL",
- shortyear: "yy",
- dayofweek: "EEEE",
- quarter: "QQQ",
- hour: "HH",
- minute: "mm",
- second: "ss",
- millisecond: "SSS",
- "datetime-local": "yyyy-MM-ddTHH':'mm':'ss"
- };
- var possiblePartPatterns = {
- year: ["y", "yy", "yyyy"],
- day: ["d", "dd"],
- month: ["M", "MM", "MMM", "MMMM"],
- hours: ["H", "HH", "h", "hh", "ah"],
- minutes: ["m", "mm"],
- seconds: ["s", "ss"],
- milliseconds: ["S", "SS", "SSS"]
- };
- var dateLocalization = dependencyInjector({
- _getPatternByFormat: function(format) {
- return FORMATS_TO_PATTERN_MAP[format.toLowerCase()]
- },
- _expandPattern: function(pattern) {
- return this._getPatternByFormat(pattern) || pattern
- },
- formatUsesMonthName: function(format) {
- return this._expandPattern(format).indexOf("MMMM") !== -1
- },
- formatUsesDayName: function(format) {
- return this._expandPattern(format).indexOf("EEEE") !== -1
- },
- getFormatParts: function(format) {
- var pattern = this._getPatternByFormat(format) || format;
- var result = [];
- iteratorUtils.each(pattern.split(/\W+/), function(_, formatPart) {
- iteratorUtils.each(possiblePartPatterns, function(partName, possiblePatterns) {
- if (inArray(formatPart, possiblePatterns) > -1) {
- result.push(partName)
- }
- })
- });
- return result
- },
- getMonthNames: function(format) {
- return defaultDateNames.getMonthNames(format)
- },
- getDayNames: function(format) {
- return defaultDateNames.getDayNames(format)
- },
- getQuarterNames: function(format) {
- return defaultDateNames.getQuarterNames(format)
- },
- getPeriodNames: function(format) {
- return defaultDateNames.getPeriodNames(format)
- },
- getTimeSeparator: function() {
- return ":"
- },
- is24HourFormat: function(format) {
- var amTime = new Date(2017, 0, 20, 11, 0, 0, 0);
- var pmTime = new Date(2017, 0, 20, 23, 0, 0, 0);
- var amTimeFormatted = this.format(amTime, format);
- var pmTimeFormatted = this.format(pmTime, format);
- for (var i = 0; i < amTimeFormatted.length; i++) {
- if (amTimeFormatted[i] !== pmTimeFormatted[i]) {
- return !isNaN(parseInt(amTimeFormatted[i]))
- }
- }
- },
- format: function(date, _format) {
- if (!date) {
- return
- }
- if (!_format) {
- return date
- }
- var formatter;
- if ("function" === typeof _format) {
- formatter = _format
- } else {
- if (_format.formatter) {
- formatter = _format.formatter
- } else {
- _format = _format.type || _format;
- if (isString(_format)) {
- _format = FORMATS_TO_PATTERN_MAP[_format.toLowerCase()] || _format;
- return numberLocalization.convertDigits(getLDMLDateFormatter(_format, this)(date))
- }
- }
- }
- if (!formatter) {
- return
- }
- return formatter(date)
- },
- parse: function(text, format) {
- var that = this;
- var ldmlFormat;
- if (!text) {
- return
- }
- if (!format) {
- return this.parse(text, "shortdate")
- }
- if (format.parser) {
- return format.parser(text)
- }
- if ("string" === typeof format && !FORMATS_TO_PATTERN_MAP[format.toLowerCase()]) {
- ldmlFormat = format
- } else {
- var formatter = function(value) {
- var text = that.format(value, format);
- return numberLocalization.convertDigits(text, true)
- };
- try {
- ldmlFormat = getLDMLDateFormat(formatter)
- } catch (e) {}
- }
- if (ldmlFormat) {
- text = numberLocalization.convertDigits(text, true);
- return getLDMLDateParser(ldmlFormat, this)(text)
- }
- errors.log("W0012");
- var result = new Date(text);
- if (!result || isNaN(result.getTime())) {
- return
- }
- return result
- },
- firstDayOfWeekIndex: function() {
- return 0
- }
- });
- module.exports = dateLocalization
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/core/utils/inflector.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var map = __webpack_require__( /*! ./iterator */ 3).map;
- var _normalize = function(text) {
- if (void 0 === text || null === text) {
- return ""
- }
- return String(text)
- };
- var _upperCaseFirst = function(text) {
- return _normalize(text).charAt(0).toUpperCase() + text.substr(1)
- };
- var _chop = function(text) {
- return _normalize(text).replace(/([a-z\d])([A-Z])/g, "$1 $2").split(/[\s_-]+/)
- };
- var dasherize = function(text) {
- return map(_chop(text), function(p) {
- return p.toLowerCase()
- }).join("-")
- };
- var underscore = function(text) {
- return dasherize(text).replace(/-/g, "_")
- };
- var camelize = function(text, upperFirst) {
- return map(_chop(text), function(p, i) {
- p = p.toLowerCase();
- if (upperFirst || i > 0) {
- p = _upperCaseFirst(p)
- }
- return p
- }).join("")
- };
- var humanize = function(text) {
- return _upperCaseFirst(dasherize(text).replace(/-/g, " "))
- };
- var titleize = function(text) {
- return map(_chop(text), function(p) {
- return _upperCaseFirst(p.toLowerCase())
- }).join(" ")
- };
- var DIGIT_CHARS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
- var captionize = function(name) {
- var captionList = [];
- var i;
- var char;
- var isPrevCharNewWord = false;
- var isNewWord = false;
- for (i = 0; i < name.length; i++) {
- char = name.charAt(i);
- isNewWord = char === char.toUpperCase() && "-" !== char && ")" !== char && "/" !== char || char in DIGIT_CHARS;
- if ("_" === char || "." === char) {
- char = " ";
- isNewWord = true
- } else {
- if (0 === i) {
- char = char.toUpperCase();
- isNewWord = true
- } else {
- if (!isPrevCharNewWord && isNewWord) {
- if (captionList.length > 0) {
- captionList.push(" ")
- }
- }
- }
- }
- captionList.push(char);
- isPrevCharNewWord = isNewWord
- }
- return captionList.join("")
- };
- exports.dasherize = dasherize;
- exports.camelize = camelize;
- exports.humanize = humanize;
- exports.titleize = titleize;
- exports.underscore = underscore;
- exports.captionize = captionize
- }, , ,
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/data/errors.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errorUtils = __webpack_require__( /*! ../core/utils/error */ 129);
- var coreErrors = __webpack_require__( /*! ../core/errors */ 21);
- var handlers = {};
- var errors = errorUtils(coreErrors.ERROR_MESSAGES, {
- E4000: "[DevExpress.data]: {0}",
- E4001: "Unknown aggregating function is detected: '{0}'",
- E4002: "Unsupported OData protocol version is used",
- E4003: "Unknown filter operation is used: {0}",
- E4004: "The thenby() method is called before the sortby() method",
- E4005: "Store requires a key expression for this operation",
- E4006: "ArrayStore 'data' option must be an array",
- E4007: "Compound keys cannot be auto-generated",
- E4008: "Attempt to insert an item with the a duplicated key",
- E4009: "Data item cannot be found",
- E4010: "CustomStore does not support creating queries",
- E4011: "Custom Store method is not implemented or is not a function: {0}",
- E4012: "Custom Store method returns an invalid value: {0}",
- E4013: "Local Store requires the 'name' configuration option is specified",
- E4014: "Unknown data type is specified for ODataStore: {0}",
- E4015: "Unknown entity name or alias is used: {0}",
- E4016: "The compileSetter(expr) method is called with 'self' passed as a parameter",
- E4017: "Keys cannot be modified",
- E4018: "The server has returned a non-numeric value in a response to an item count request",
- E4019: "Mixing of group operators inside a single group of filter expression is not allowed",
- E4020: "Unknown store type is detected: {0}",
- E4021: "The server response does not provide the totalCount value",
- E4022: "The server response does not provide the groupCount value",
- E4023: "Could not parse the following XML: {0}",
- W4000: "Data returned from the server has an incorrect structure",
- W4001: 'The {0} field is listed in both "keyType" and "fieldTypes". The value of "fieldTypes" is used.',
- W4002: "Data loading has failed for some cells due to the following error: {0}"
- });
- function handleError(error) {
- var id = "E4000";
- if (error && "__id" in error) {
- id = error.__id
- }
- errors.log(id, error)
- }
- var errorHandler = null;
- var _errorHandler = function(error) {
- handleError(error);
- if (handlers.errorHandler) {
- handlers.errorHandler(error)
- }
- };
- handlers = {
- errors: errors,
- errorHandler: errorHandler,
- _errorHandler: _errorHandler
- };
- module.exports = handlers
- }, ,
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/animation/fx.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var errors = __webpack_require__( /*! ../core/errors */ 21);
- var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement;
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
- var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var translator = __webpack_require__( /*! ./translator */ 27);
- var easing = __webpack_require__( /*! ./easing */ 264);
- var animationFrame = __webpack_require__( /*! ./frame */ 112);
- var support = __webpack_require__( /*! ../core/utils/support */ 43);
- var positionUtils = __webpack_require__( /*! ./position */ 77);
- var removeEvent = __webpack_require__( /*! ../core/remove_event */ 132);
- var eventUtils = __webpack_require__( /*! ../events/utils */ 8);
- var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- var removeEventName = eventUtils.addNamespace(removeEvent, "dxFX");
- var isFunction = typeUtils.isFunction;
- var isPlainObject = typeUtils.isPlainObject;
- var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
- var RELATIVE_VALUE_REGEX = /^([+-])=(.*)/i;
- var ANIM_DATA_KEY = "dxAnimData";
- var ANIM_QUEUE_KEY = "dxAnimQueue";
- var TRANSFORM_PROP = "transform";
- var TransitionAnimationStrategy = {
- initAnimation: function($element, config) {
- $element.css({
- transitionProperty: "none"
- });
- if ("string" === typeof config.from) {
- $element.addClass(config.from)
- } else {
- setProps($element, config.from)
- }
- var that = this;
- var deferred = new Deferred;
- var cleanupWhen = config.cleanupWhen;
- config.transitionAnimation = {
- deferred: deferred,
- finish: function() {
- that._finishTransition($element);
- if (cleanupWhen) {
- when(deferred, cleanupWhen).always(function() {
- that._cleanup($element, config)
- })
- } else {
- that._cleanup($element, config)
- }
- deferred.resolveWith($element, [config, $element])
- }
- };
- this._completeAnimationCallback($element, config).done(function() {
- config.transitionAnimation.finish()
- }).fail(function() {
- deferred.rejectWith($element, [config, $element])
- });
- if (!config.duration) {
- config.transitionAnimation.finish()
- }
- $element.css("transform")
- },
- animate: function($element, config) {
- this._startAnimation($element, config);
- return config.transitionAnimation.deferred.promise()
- },
- _completeAnimationCallback: function($element, config) {
- var that = this;
- var startTime = Date.now() + config.delay;
- var deferred = new Deferred;
- var transitionEndFired = new Deferred;
- var simulatedTransitionEndFired = new Deferred;
- var simulatedEndEventTimer;
- var transitionEndEventName = support.transitionEndEventName() + ".dxFX";
- config.transitionAnimation.cleanup = function() {
- clearTimeout(simulatedEndEventTimer);
- clearTimeout(waitForJSCompleteTimer);
- eventsEngine.off($element, transitionEndEventName);
- eventsEngine.off($element, removeEventName)
- };
- eventsEngine.one($element, transitionEndEventName, function() {
- if (Date.now() - startTime >= config.duration) {
- transitionEndFired.reject()
- }
- });
- eventsEngine.off($element, removeEventName);
- eventsEngine.on($element, removeEventName, function() {
- that.stop($element, config);
- deferred.reject()
- });
- var waitForJSCompleteTimer = setTimeout(function() {
- simulatedEndEventTimer = setTimeout(function() {
- simulatedTransitionEndFired.reject()
- }, config.duration + config.delay + fx._simulatedTransitionEndDelay);
- when(transitionEndFired, simulatedTransitionEndFired).fail(function() {
- deferred.resolve()
- }.bind(this))
- });
- return deferred.promise()
- },
- _startAnimation: function($element, config) {
- $element.css({
- transitionProperty: "all",
- transitionDelay: config.delay + "ms",
- transitionDuration: config.duration + "ms",
- transitionTimingFunction: config.easing
- });
- if ("string" === typeof config.to) {
- $element[0].className += " " + config.to
- } else {
- if (config.to) {
- setProps($element, config.to)
- }
- }
- },
- _finishTransition: function($element) {
- $element.css("transition", "none")
- },
- _cleanup: function($element, config) {
- config.transitionAnimation.cleanup();
- if ("string" === typeof config.from) {
- $element.removeClass(config.from);
- $element.removeClass(config.to)
- }
- },
- stop: function($element, config, jumpToEnd) {
- if (!config) {
- return
- }
- if (jumpToEnd) {
- config.transitionAnimation.finish()
- } else {
- if (isPlainObject(config.to)) {
- iteratorUtils.each(config.to, function(key) {
- $element.css(key, $element.css(key))
- })
- }
- this._finishTransition($element);
- this._cleanup($element, config)
- }
- }
- };
- var FrameAnimationStrategy = {
- initAnimation: function($element, config) {
- setProps($element, config.from)
- },
- animate: function($element, config) {
- var deferred = new Deferred;
- var that = this;
- if (!config) {
- return deferred.reject().promise()
- }
- iteratorUtils.each(config.to, function(prop) {
- if (void 0 === config.from[prop]) {
- config.from[prop] = that._normalizeValue($element.css(prop))
- }
- });
- if (config.to[TRANSFORM_PROP]) {
- config.from[TRANSFORM_PROP] = that._parseTransform(config.from[TRANSFORM_PROP]);
- config.to[TRANSFORM_PROP] = that._parseTransform(config.to[TRANSFORM_PROP])
- }
- config.frameAnimation = {
- to: config.to,
- from: config.from,
- currentValue: config.from,
- easing: easing.convertTransitionTimingFuncToEasing(config.easing),
- duration: config.duration,
- startTime: (new Date).valueOf(),
- finish: function() {
- this.currentValue = this.to;
- this.draw();
- animationFrame.cancelAnimationFrame(config.frameAnimation.animationFrameId);
- deferred.resolve()
- },
- draw: function() {
- if (config.draw) {
- config.draw(this.currentValue);
- return
- }
- var currentValue = extend({}, this.currentValue);
- if (currentValue[TRANSFORM_PROP]) {
- currentValue[TRANSFORM_PROP] = iteratorUtils.map(currentValue[TRANSFORM_PROP], function(value, prop) {
- if ("translate" === prop) {
- return translator.getTranslateCss(value)
- } else {
- if ("scale" === prop) {
- return "scale(" + value + ")"
- } else {
- if ("rotate" === prop.substr(0, prop.length - 1)) {
- return prop + "(" + value + "deg)"
- }
- }
- }
- }).join(" ")
- }
- $element.css(currentValue)
- }
- };
- if (config.delay) {
- config.frameAnimation.startTime += config.delay;
- config.frameAnimation.delayTimeout = setTimeout(function() {
- that._startAnimation($element, config)
- }, config.delay)
- } else {
- that._startAnimation($element, config)
- }
- return deferred.promise()
- },
- _startAnimation: function($element, config) {
- eventsEngine.off($element, removeEventName);
- eventsEngine.on($element, removeEventName, function() {
- if (config.frameAnimation) {
- animationFrame.cancelAnimationFrame(config.frameAnimation.animationFrameId)
- }
- });
- this._animationStep($element, config)
- },
- _parseTransform: function(transformString) {
- var result = {};
- iteratorUtils.each(transformString.match(/\w+\d*\w*\([^)]*\)\s*/g), function(i, part) {
- var translateData = translator.parseTranslate(part);
- var scaleData = part.match(/scale\((.+?)\)/);
- var rotateData = part.match(/(rotate.)\((.+)deg\)/);
- if (translateData) {
- result.translate = translateData
- }
- if (scaleData && scaleData[1]) {
- result.scale = parseFloat(scaleData[1])
- }
- if (rotateData && rotateData[1]) {
- result[rotateData[1]] = parseFloat(rotateData[2])
- }
- });
- return result
- },
- stop: function($element, config, jumpToEnd) {
- var frameAnimation = config && config.frameAnimation;
- if (!frameAnimation) {
- return
- }
- animationFrame.cancelAnimationFrame(frameAnimation.animationFrameId);
- clearTimeout(frameAnimation.delayTimeout);
- if (jumpToEnd) {
- frameAnimation.finish()
- }
- delete config.frameAnimation
- },
- _animationStep: function($element, config) {
- var frameAnimation = config && config.frameAnimation;
- if (!frameAnimation) {
- return
- }
- var now = (new Date).valueOf();
- if (now >= frameAnimation.startTime + frameAnimation.duration) {
- frameAnimation.finish();
- return
- }
- frameAnimation.currentValue = this._calcStepValue(frameAnimation, now - frameAnimation.startTime);
- frameAnimation.draw();
- var that = this;
- frameAnimation.animationFrameId = animationFrame.requestAnimationFrame(function() {
- that._animationStep($element, config)
- })
- },
- _calcStepValue: function(frameAnimation, currentDuration) {
- var calcValueRecursively = function calcValueRecursively(from, to) {
- var result = Array.isArray(to) ? [] : {};
- var calcEasedValue = function(propName) {
- var x = currentDuration / frameAnimation.duration;
- var t = currentDuration;
- var b = 1 * from[propName];
- var c = to[propName] - from[propName];
- var d = frameAnimation.duration;
- return easing.getEasing(frameAnimation.easing)(x, t, b, c, d)
- };
- iteratorUtils.each(to, function(propName, endPropValue) {
- if ("string" === typeof endPropValue && false === parseFloat(endPropValue, 10)) {
- return true
- }
- result[propName] = "object" === _typeof(endPropValue) ? calcValueRecursively(from[propName], endPropValue) : calcEasedValue(propName)
- });
- return result
- };
- return calcValueRecursively(frameAnimation.from, frameAnimation.to)
- },
- _normalizeValue: function(value) {
- var numericValue = parseFloat(value, 10);
- if (false === numericValue) {
- return value
- }
- return numericValue
- }
- };
- var FallbackToNoAnimationStrategy = {
- initAnimation: function() {},
- animate: function() {
- return (new Deferred).resolve().promise()
- },
- stop: noop,
- isSynchronous: true
- };
- var getAnimationStrategy = function(config) {
- config = config || {};
- var animationStrategies = {
- transition: support.transition() ? TransitionAnimationStrategy : FrameAnimationStrategy,
- frame: FrameAnimationStrategy,
- noAnimation: FallbackToNoAnimationStrategy
- };
- var strategy = config.strategy || "transition";
- if ("css" === config.type && !support.transition()) {
- strategy = "noAnimation"
- }
- return animationStrategies[strategy]
- };
- var baseConfigValidator = function(config, animationType, validate, typeMessage) {
- iteratorUtils.each(["from", "to"], function() {
- if (!validate(config[this])) {
- throw errors.Error("E0010", animationType, this, typeMessage)
- }
- })
- };
- var isObjectConfigValidator = function(config, animationType) {
- return baseConfigValidator(config, animationType, function(target) {
- return isPlainObject(target)
- }, "a plain object")
- };
- var isStringConfigValidator = function(config, animationType) {
- return baseConfigValidator(config, animationType, function(target) {
- return "string" === typeof target
- }, "a string")
- };
- var CustomAnimationConfigurator = {
- setup: function() {}
- };
- var CssAnimationConfigurator = {
- validateConfig: function(config) {
- isStringConfigValidator(config, "css")
- },
- setup: function() {}
- };
- var positionAliases = {
- top: {
- my: "bottom center",
- at: "top center"
- },
- bottom: {
- my: "top center",
- at: "bottom center"
- },
- right: {
- my: "left center",
- at: "right center"
- },
- left: {
- my: "right center",
- at: "left center"
- }
- };
- var SlideAnimationConfigurator = {
- validateConfig: function(config) {
- isObjectConfigValidator(config, "slide")
- },
- setup: function($element, config) {
- var location = translator.locate($element);
- if ("slide" !== config.type) {
- var positioningConfig = "slideIn" === config.type ? config.from : config.to;
- positioningConfig.position = extend({
- of: window
- }, positionAliases[config.direction]);
- setupPosition($element, positioningConfig)
- }
- this._setUpConfig(location, config.from);
- this._setUpConfig(location, config.to);
- translator.clearCache($element)
- },
- _setUpConfig: function(location, config) {
- config.left = "left" in config ? config.left : "+=0";
- config.top = "top" in config ? config.top : "+=0";
- this._initNewPosition(location, config)
- },
- _initNewPosition: function(location, config) {
- var position = {
- left: config.left,
- top: config.top
- };
- delete config.left;
- delete config.top;
- var relativeValue = this._getRelativeValue(position.left);
- if (void 0 !== relativeValue) {
- position.left = relativeValue + location.left
- } else {
- config.left = 0
- }
- relativeValue = this._getRelativeValue(position.top);
- if (void 0 !== relativeValue) {
- position.top = relativeValue + location.top
- } else {
- config.top = 0
- }
- config[TRANSFORM_PROP] = translator.getTranslateCss({
- x: position.left,
- y: position.top
- })
- },
- _getRelativeValue: function(value) {
- var relativeValue;
- if ("string" === typeof value && (relativeValue = RELATIVE_VALUE_REGEX.exec(value))) {
- return parseInt(relativeValue[1] + "1") * relativeValue[2]
- }
- }
- };
- var FadeAnimationConfigurator = {
- setup: function($element, config) {
- var from = config.from;
- var fromOpacity = isPlainObject(from) ? config.skipElementInitialStyles ? 0 : $element.css("opacity") : String(from);
- var toOpacity;
- switch (config.type) {
- case "fadeIn":
- toOpacity = 1;
- break;
- case "fadeOut":
- toOpacity = 0;
- break;
- default:
- toOpacity = String(config.to)
- }
- config.from = {
- visibility: "visible",
- opacity: fromOpacity
- };
- config.to = {
- opacity: toOpacity
- }
- }
- };
- var PopAnimationConfigurator = {
- validateConfig: function(config) {
- isObjectConfigValidator(config, "pop")
- },
- setup: function($element, config) {
- var from = config.from;
- var to = config.to;
- var fromOpacity = "opacity" in from ? from.opacity : $element.css("opacity");
- var toOpacity = "opacity" in to ? to.opacity : 1;
- var fromScale = "scale" in from ? from.scale : 0;
- var toScale = "scale" in to ? to.scale : 1;
- config.from = {
- opacity: fromOpacity
- };
- var translate = translator.getTranslate($element);
- config.from[TRANSFORM_PROP] = this._getCssTransform(translate, fromScale);
- config.to = {
- opacity: toOpacity
- };
- config.to[TRANSFORM_PROP] = this._getCssTransform(translate, toScale)
- },
- _getCssTransform: function(translate, scale) {
- return translator.getTranslateCss(translate) + "scale(" + scale + ")"
- }
- };
- var animationConfigurators = {
- custom: CustomAnimationConfigurator,
- slide: SlideAnimationConfigurator,
- slideIn: SlideAnimationConfigurator,
- slideOut: SlideAnimationConfigurator,
- fade: FadeAnimationConfigurator,
- fadeIn: FadeAnimationConfigurator,
- fadeOut: FadeAnimationConfigurator,
- pop: PopAnimationConfigurator,
- css: CssAnimationConfigurator
- };
- var getAnimationConfigurator = function(config) {
- var result = animationConfigurators[config.type];
- if (!result) {
- throw errors.Error("E0011", config.type)
- }
- return result
- };
- var defaultJSConfig = {
- type: "custom",
- from: {},
- to: {},
- duration: 400,
- start: noop,
- complete: noop,
- easing: "ease",
- delay: 0
- };
- var defaultCssConfig = {
- duration: 400,
- easing: "ease",
- delay: 0
- };
- var setupAnimationOnElement = function() {
- var animation = this;
- var $element = animation.element;
- var config = animation.config;
- setupPosition($element, config.from);
- setupPosition($element, config.to);
- animation.configurator.setup($element, config);
- $element.data(ANIM_DATA_KEY, animation);
- if (fx.off) {
- config.duration = 0;
- config.delay = 0
- }
- animation.strategy.initAnimation($element, config);
- if (config.start) {
- var element = getPublicElement($element);
- config.start.apply(this, [element, config])
- }
- };
- var onElementAnimationComplete = function(animation) {
- var $element = animation.element;
- var config = animation.config;
- $element.removeData(ANIM_DATA_KEY);
- if (config.complete) {
- var element = getPublicElement($element);
- config.complete.apply(this, [element, config])
- }
- animation.deferred.resolveWith(this, [$element, config])
- };
- var startAnimationOnElement = function() {
- var animation = this;
- var $element = animation.element;
- var config = animation.config;
- animation.isStarted = true;
- return animation.strategy.animate($element, config).done(function() {
- onElementAnimationComplete(animation)
- }).fail(function() {
- animation.deferred.rejectWith(this, [$element, config])
- })
- };
- var stopAnimationOnElement = function(jumpToEnd) {
- var animation = this;
- var $element = animation.element;
- var config = animation.config;
- clearTimeout(animation.startTimeout);
- if (!animation.isStarted) {
- animation.start()
- }
- animation.strategy.stop($element, config, jumpToEnd)
- };
- var scopedRemoveEvent = eventUtils.addNamespace(removeEvent, "dxFXStartAnimation");
- var subscribeToRemoveEvent = function(animation) {
- eventsEngine.off(animation.element, scopedRemoveEvent);
- eventsEngine.on(animation.element, scopedRemoveEvent, function() {
- fx.stop(animation.element)
- });
- animation.deferred.always(function() {
- eventsEngine.off(animation.element, scopedRemoveEvent)
- })
- };
- var createAnimation = function(element, initialConfig) {
- var defaultConfig = "css" === initialConfig.type ? defaultCssConfig : defaultJSConfig;
- var config = extend(true, {}, defaultConfig, initialConfig);
- var configurator = getAnimationConfigurator(config);
- var strategy = getAnimationStrategy(config);
- var animation = {
- element: $(element),
- config: config,
- configurator: configurator,
- strategy: strategy,
- isSynchronous: strategy.isSynchronous,
- setup: setupAnimationOnElement,
- start: startAnimationOnElement,
- stop: stopAnimationOnElement,
- deferred: new Deferred
- };
- if (isFunction(configurator.validateConfig)) {
- configurator.validateConfig(config)
- }
- subscribeToRemoveEvent(animation);
- return animation
- };
- var animate = function(element, config) {
- var $element = $(element);
- if (!$element.length) {
- return (new Deferred).resolve().promise()
- }
- var animation = createAnimation($element, config);
- pushInAnimationQueue($element, animation);
- return animation.deferred.promise()
- };
- var pushInAnimationQueue = function($element, animation) {
- var queueData = getAnimQueueData($element);
- writeAnimQueueData($element, queueData);
- queueData.push(animation);
- if (!isAnimating($element)) {
- shiftFromAnimationQueue($element, queueData)
- }
- };
- var getAnimQueueData = function($element) {
- return $element.data(ANIM_QUEUE_KEY) || []
- };
- var writeAnimQueueData = function($element, queueData) {
- $element.data(ANIM_QUEUE_KEY, queueData)
- };
- var destroyAnimQueueData = function($element) {
- $element.removeData(ANIM_QUEUE_KEY)
- };
- var isAnimating = function($element) {
- return !!$element.data(ANIM_DATA_KEY)
- };
- var shiftFromAnimationQueue = function shiftFromAnimationQueue($element, queueData) {
- queueData = getAnimQueueData($element);
- if (!queueData.length) {
- return
- }
- var animation = queueData.shift();
- if (0 === queueData.length) {
- destroyAnimQueueData($element)
- }
- executeAnimation(animation).done(function() {
- if (!isAnimating($element)) {
- shiftFromAnimationQueue($element)
- }
- })
- };
- var executeAnimation = function(animation) {
- animation.setup();
- if (fx.off || animation.isSynchronous) {
- animation.start()
- } else {
- animation.startTimeout = setTimeout(function() {
- animation.start()
- })
- }
- return animation.deferred.promise()
- };
- var setupPosition = function($element, config) {
- if (!config || !config.position) {
- return
- }
- var win = $(window);
- var left = 0;
- var top = 0;
- var position = positionUtils.calculate($element, config.position);
- var offset = $element.offset();
- var currentPosition = $element.position();
- if (currentPosition.top > offset.top) {
- top = win.scrollTop()
- }
- if (currentPosition.left > offset.left) {
- left = win.scrollLeft()
- }
- extend(config, {
- left: position.h.location - offset.left + currentPosition.left - left,
- top: position.v.location - offset.top + currentPosition.top - top
- });
- delete config.position
- };
- var setProps = function($element, props) {
- iteratorUtils.each(props, function(key, value) {
- try {
- $element.css(key, typeUtils.isFunction(value) ? value() : value)
- } catch (e) {}
- })
- };
- var stop = function(element, jumpToEnd) {
- var $element = $(element);
- var queueData = getAnimQueueData($element);
- iteratorUtils.each(queueData, function(_, animation) {
- animation.config.delay = 0;
- animation.config.duration = 0;
- animation.isSynchronous = true
- });
- if (!isAnimating($element)) {
- shiftFromAnimationQueue($element, queueData)
- }
- var animation = $element.data(ANIM_DATA_KEY);
- if (animation) {
- animation.stop(jumpToEnd)
- }
- $element.removeData(ANIM_DATA_KEY);
- destroyAnimQueueData($element)
- };
- var fx = {
- off: false,
- animationTypes: animationConfigurators,
- animate: animate,
- createAnimation: createAnimation,
- isAnimating: isAnimating,
- stop: stop,
- _simulatedTransitionEndDelay: 100
- };
- module.exports = fx
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/element_data.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var WeakMap = __webpack_require__( /*! ./polyfills/weak_map */ 176);
- var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11);
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 177);
- var dataMap = new WeakMap;
- var strategy;
- var strategyChanging = new MemorizedCallbacks;
- var beforeCleanData = function() {};
- var afterCleanData = function() {};
- var setDataStrategy = exports.setDataStrategy = function(value) {
- strategyChanging.fire(value);
- strategy = value;
- var cleanData = strategy.cleanData;
- strategy.cleanData = function(nodes) {
- beforeCleanData(nodes);
- var result = cleanData.call(this, nodes);
- afterCleanData(nodes);
- return result
- }
- };
- setDataStrategy({
- data: function() {
- var element = arguments[0];
- var key = arguments[1];
- var value = arguments[2];
- if (!element) {
- return
- }
- var elementData = dataMap.get(element);
- if (!elementData) {
- elementData = {};
- dataMap.set(element, elementData)
- }
- if (void 0 === key) {
- return elementData
- }
- if (2 === arguments.length) {
- return elementData[key]
- }
- elementData[key] = value;
- return value
- },
- removeData: function(element, key) {
- if (!element) {
- return
- }
- if (void 0 === key) {
- dataMap.delete(element)
- } else {
- var elementData = dataMap.get(element);
- if (elementData) {
- delete elementData[key]
- }
- }
- },
- cleanData: function(elements) {
- for (var i = 0; i < elements.length; i++) {
- eventsEngine.off(elements[i]);
- dataMap.delete(elements[i])
- }
- }
- });
- exports.setDataStrategy = setDataStrategy;
- exports.getDataStrategy = function() {
- return strategy
- };
- exports.data = function() {
- return strategy.data.apply(this, arguments)
- };
- exports.strategyChanging = strategyChanging;
- exports.beforeCleanData = function(callback) {
- beforeCleanData = callback
- };
- exports.afterCleanData = function(callback) {
- afterCleanData = callback
- };
- exports.cleanData = function(nodes) {
- return strategy.cleanData.call(this, nodes)
- };
- exports.removeData = function(element, key) {
- return strategy.removeData.call(this, element, key)
- };
- exports.cleanDataRecursive = function(element, cleanSelf) {
- if (!domAdapter.isElementNode(element)) {
- return
- }
- var childElements = element.getElementsByTagName("*");
- strategy.cleanData(childElements);
- if (cleanSelf) {
- strategy.cleanData([element])
- }
- }
- },
- /*!*******************************************!*\
- !*** ./artifacts/transpiled/core/guid.js ***!
- \*******************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ./class */ 15);
- var Guid = Class.inherit({
- ctor: function(value) {
- if (value) {
- value = String(value)
- }
- this._value = this._normalize(value || this._generate())
- },
- _normalize: function(value) {
- value = value.replace(/[^a-f0-9]/gi, "").toLowerCase();
- while (value.length < 32) {
- value += "0"
- }
- return [value.substr(0, 8), value.substr(8, 4), value.substr(12, 4), value.substr(16, 4), value.substr(20, 12)].join("-")
- },
- _generate: function() {
- var value = "";
- for (var i = 0; i < 32; i++) {
- value += Math.round(15 * Math.random()).toString(16)
- }
- return value
- },
- toString: function() {
- return this._value
- },
- valueOf: function() {
- return this._value
- },
- toJSON: function() {
- return this._value
- }
- });
- module.exports = Guid
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/data/utils.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _type2 = _interopRequireDefault(_type);
- var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _ready_callbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 48);
- var _window = __webpack_require__( /*! ../core/utils/window */ 7);
- var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var _data = __webpack_require__( /*! ../core/utils/data */ 20);
- var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
- }
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return
- }
- if ("string" === typeof o) {
- return _arrayLikeToArray(o, minLen)
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if ("Object" === n && o.constructor) {
- n = o.constructor.name
- }
- if ("Map" === n || "Set" === n) {
- return Array.from(o)
- }
- if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen)
- }
- }
- function _iterableToArray(iter) {
- if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
- return Array.from(iter)
- }
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- return _arrayLikeToArray(arr)
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (null == len || len > arr.length) {
- len = arr.length
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- var XHR_ERROR_UNLOAD = "DEVEXTREME_XHR_ERROR_UNLOAD";
- var normalizeBinaryCriterion = function(crit) {
- return [crit[0], crit.length < 3 ? "=" : String(crit[1]).toLowerCase(), crit.length < 2 ? true : crit[crit.length - 1]]
- };
- var normalizeSortingInfo = function(info) {
- if (!Array.isArray(info)) {
- info = [info]
- }
- return (0, _iterator.map)(info, function(i) {
- var result = {
- selector: (0, _type.isFunction)(i) || "string" === typeof i ? i : i.getter || i.field || i.selector,
- desc: !!(i.desc || "d" === String(i.dir).charAt(0).toLowerCase())
- };
- if (i.compare) {
- result.compare = i.compare
- }
- return result
- })
- };
- var errorMessageFromXhr = function() {
- var textStatusMessages = {
- timeout: "Network connection timeout",
- error: "Unspecified network error",
- parsererror: "Unexpected server response"
- };
- var textStatusDetails = {
- timeout: "possible causes: the remote host is not accessible, overloaded or is not included into the domain white-list when being run in the native container",
- error: "if the remote host is located on another domain, make sure it properly supports cross-origin resource sharing (CORS), or use the JSONP approach instead",
- parsererror: "the remote host did not respond with valid JSON data"
- };
- var explainTextStatus = function(textStatus) {
- var result = textStatusMessages[textStatus];
- if (!result) {
- return textStatus
- }
- result += " (" + textStatusDetails[textStatus] + ")";
- return result
- };
- var unloading;
- (0, _ready_callbacks.add)(function() {
- var window = (0, _window.getWindow)();
- _dom_adapter2.default.listen(window, "beforeunload", function() {
- unloading = true
- })
- });
- return function(xhr, textStatus) {
- if (unloading) {
- return XHR_ERROR_UNLOAD
- }
- if (xhr.status < 400) {
- return explainTextStatus(textStatus)
- }
- return xhr.statusText
- }
- }();
- var aggregators = {
- count: {
- seed: 0,
- step: function(count) {
- return 1 + count
- }
- },
- sum: {
- seed: 0,
- step: function(sum, item) {
- return sum + item
- }
- },
- min: {
- step: function(min, item) {
- return item < min ? item : min
- }
- },
- max: {
- step: function(max, item) {
- return item > max ? item : max
- }
- },
- avg: {
- seed: [0, 0],
- step: function(pair, value) {
- return [pair[0] + value, pair[1] + 1]
- },
- finalize: function(pair) {
- return pair[1] ? pair[0] / pair[1] : NaN
- }
- }
- };
- var processRequestResultLock = function() {
- var lockCount = 0;
- var lockDeferred;
- var obtain = function() {
- if (0 === lockCount) {
- lockDeferred = new _deferred.Deferred
- }
- lockCount++
- };
- var release = function() {
- lockCount--;
- if (lockCount < 1) {
- lockDeferred.resolve()
- }
- };
- var promise = function() {
- var deferred = 0 === lockCount ? (new _deferred.Deferred).resolve() : lockDeferred;
- return deferred.promise()
- };
- var reset = function() {
- lockCount = 0;
- if (lockDeferred) {
- lockDeferred.resolve()
- }
- };
- return {
- obtain: obtain,
- release: release,
- promise: promise,
- reset: reset
- }
- }();
- function isDisjunctiveOperator(condition) {
- return /^(or|\|\||\|)$/i.test(condition)
- }
- function isConjunctiveOperator(condition) {
- return /^(and|&&|&)$/i.test(condition)
- }
- var keysEqual = function(keyExpr, key1, key2) {
- if (Array.isArray(keyExpr)) {
- var names = (0, _iterator.map)(key1, function(v, k) {
- return k
- });
- var name;
- for (var i = 0; i < names.length; i++) {
- name = names[i];
- if ((0, _data.toComparable)(key1[name], true) != (0, _data.toComparable)(key2[name], true)) {
- return false
- }
- }
- return true
- }
- return (0, _data.toComparable)(key1, true) == (0, _data.toComparable)(key2, true)
- };
- var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- var base64_encode = function(input) {
- if (!Array.isArray(input)) {
- input = stringToByteArray(String(input))
- }
- var result = "";
- function getBase64Char(index) {
- return BASE64_CHARS.charAt(index)
- }
- for (var i = 0; i < input.length; i += 3) {
- var octet1 = input[i];
- var octet2 = input[i + 1];
- var octet3 = input[i + 2];
- result += (0, _iterator.map)([octet1 >> 2, (3 & octet1) << 4 | octet2 >> 4, isNaN(octet2) ? 64 : (15 & octet2) << 2 | octet3 >> 6, isNaN(octet3) ? 64 : 63 & octet3], getBase64Char).join("")
- }
- return result
- };
- var stringToByteArray = function(str) {
- var bytes = [];
- var code;
- var i;
- for (i = 0; i < str.length; i++) {
- code = str.charCodeAt(i);
- if (code < 128) {
- bytes.push(code)
- } else {
- if (code < 2048) {
- bytes.push(192 + (code >> 6), 128 + (63 & code))
- } else {
- if (code < 65536) {
- bytes.push(224 + (code >> 12), 128 + (code >> 6 & 63), 128 + (63 & code))
- } else {
- if (code < 2097152) {
- bytes.push(240 + (code >> 18), 128 + (code >> 12 & 63), 128 + (code >> 6 & 63), 128 + (63 & code))
- }
- }
- }
- }
- }
- return bytes
- };
- var isUnaryOperation = function(crit) {
- return "!" === crit[0] && Array.isArray(crit[1])
- };
- var isGroupOperator = function(value) {
- return "and" === value || "or" === value
- };
- var isGroupCriterion = function(crit) {
- var first = crit[0];
- var second = crit[1];
- if (Array.isArray(first)) {
- return true
- }
- if (_type2.default.isFunction(first)) {
- if (Array.isArray(second) || _type2.default.isFunction(second) || isGroupOperator(second)) {
- return true
- }
- }
- return false
- };
- var trivialPromise = function() {
- var d = new _deferred.Deferred;
- return d.resolve.apply(d, arguments).promise()
- };
- var rejectedPromise = function() {
- var d = new _deferred.Deferred;
- return d.reject.apply(d, arguments).promise()
- };
- function throttle(func, timeout) {
- var timeoutId;
- var lastArgs;
- return function() {
- var _this = this;
- lastArgs = arguments;
- if (!timeoutId) {
- timeoutId = setTimeout(function() {
- timeoutId = void 0;
- if (lastArgs) {
- func.call(_this, lastArgs)
- }
- }, (0, _type.isFunction)(timeout) ? timeout() : timeout)
- }
- return timeoutId
- }
- }
- function throttleChanges(func, timeout) {
- var cache = [];
- var throttled = throttle(function() {
- func.call(this, cache);
- cache = []
- }, timeout);
- return function(changes) {
- if (Array.isArray(changes)) {
- var _cache;
- (_cache = cache).push.apply(_cache, _toConsumableArray(changes))
- }
- return throttled.call(this, cache)
- }
- }
- var utils = {
- XHR_ERROR_UNLOAD: XHR_ERROR_UNLOAD,
- normalizeBinaryCriterion: normalizeBinaryCriterion,
- normalizeSortingInfo: normalizeSortingInfo,
- errorMessageFromXhr: errorMessageFromXhr,
- aggregators: aggregators,
- keysEqual: keysEqual,
- throttleChanges: throttleChanges,
- trivialPromise: trivialPromise,
- rejectedPromise: rejectedPromise,
- isDisjunctiveOperator: isDisjunctiveOperator,
- isConjunctiveOperator: isConjunctiveOperator,
- processRequestResultLock: processRequestResultLock,
- isUnaryOperation: isUnaryOperation,
- isGroupCriterion: isGroupCriterion,
- base64_encode: base64_encode
- };
- module.exports = utils
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/data/query.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var arrayQueryImpl = __webpack_require__( /*! ./array_query */ 155);
- var remoteQueryImpl = __webpack_require__( /*! ./remote_query */ 468);
- var queryImpl = {
- array: arrayQueryImpl,
- remote: remoteQueryImpl
- };
- var query = function() {
- var impl = Array.isArray(arguments[0]) ? "array" : "remote";
- return queryImpl[impl].apply(this, arguments)
- };
- module.exports = query;
- module.exports.queryImpl = queryImpl
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/support.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _array = __webpack_require__( /*! ./array */ 14);
- var _dom_adapter = __webpack_require__( /*! ../dom_adapter */ 11);
- var _common = __webpack_require__( /*! ./common */ 4);
- var _call_once = __webpack_require__( /*! ./call_once */ 63);
- var _call_once2 = _interopRequireDefault(_call_once);
- var _window = __webpack_require__( /*! ./window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _devices = __webpack_require__( /*! ../devices */ 16);
- var _devices2 = _interopRequireDefault(_devices);
- var _style = __webpack_require__( /*! ./style */ 85);
- var _style2 = _interopRequireDefault(_style);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var _windowUtils$getNavig = _window2.default.getNavigator(),
- maxTouchPoints = _windowUtils$getNavig.maxTouchPoints,
- msMaxTouchPoints = _windowUtils$getNavig.msMaxTouchPoints,
- pointerEnabled = _windowUtils$getNavig.pointerEnabled;
- var hasProperty = _window2.default.hasProperty.bind(_window2.default);
- var transitionEndEventNames = {
- webkitTransition: "webkitTransitionEnd",
- MozTransition: "transitionend",
- OTransition: "oTransitionEnd",
- msTransition: "MsTransitionEnd",
- transition: "transitionend"
- };
- var supportProp = function(prop) {
- return !!_style2.default.styleProp(prop)
- };
- var isNativeScrollingSupported = function() {
- var _devices$real = _devices2.default.real(),
- platform = _devices$real.platform,
- version = _devices$real.version,
- isMac = _devices$real.mac;
- var isObsoleteAndroid = version && version[0] < 4 && "android" === platform;
- var isNativeScrollDevice = !isObsoleteAndroid && (0, _array.inArray)(platform, ["ios", "android", "win"]) > -1 || isMac;
- return isNativeScrollDevice
- };
- var inputType = function(type) {
- if ("text" === type) {
- return true
- }
- var input = (0, _dom_adapter.createElement)("input");
- try {
- input.setAttribute("type", type);
- input.value = "wrongValue";
- return !input.value
- } catch (e) {
- return false
- }
- };
- var detectTouchEvents = function(hasWindowProperty, maxTouchPoints) {
- return (hasWindowProperty("ontouchstart") || !!maxTouchPoints) && !hasWindowProperty("callPhantom")
- };
- var detectPointerEvent = function(hasWindowProperty, pointerEnabled) {
- var isPointerEnabled = (0, _common.ensureDefined)(pointerEnabled, true);
- var canUsePointerEvent = (0, _common.ensureDefined)(pointerEnabled, false);
- return hasWindowProperty("PointerEvent") && isPointerEnabled || canUsePointerEvent
- };
- var touchEvents = detectTouchEvents(hasProperty, maxTouchPoints);
- var pointerEvents = detectPointerEvent(hasProperty, pointerEnabled);
- var touchPointersPresent = !!maxTouchPoints || !!msMaxTouchPoints;
- exports.detectTouchEvents = detectTouchEvents;
- exports.detectPointerEvent = detectPointerEvent;
- exports.touchEvents = touchEvents;
- exports.pointerEvents = pointerEvents;
- exports.touch = touchEvents || pointerEvents && touchPointersPresent;
- exports.transition = (0, _call_once2.default)(function() {
- return supportProp("transition")
- });
- exports.transitionEndEventName = (0, _call_once2.default)(function() {
- return transitionEndEventNames[_style2.default.styleProp("transition")]
- });
- exports.animation = (0, _call_once2.default)(function() {
- return supportProp("animation")
- });
- exports.nativeScrolling = isNativeScrollingSupported();
- exports.styleProp = _style2.default.styleProp;
- exports.stylePropPrefix = _style2.default.stylePropPrefix;
- exports.supportProp = supportProp;
- exports.inputType = inputType
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/utils/string.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var encodeHtml = function() {
- var encodeRegExp = [new RegExp("&", "g"), new RegExp('"', "g"), new RegExp("'", "g"), new RegExp("<", "g"), new RegExp(">", "g")];
- return function(str) {
- return String(str).replace(encodeRegExp[0], "&").replace(encodeRegExp[1], """).replace(encodeRegExp[2], "'").replace(encodeRegExp[3], "<").replace(encodeRegExp[4], ">")
- }
- }();
- var splitQuad = function(raw) {
- switch (_typeof(raw)) {
- case "string":
- return raw.split(/\s+/, 4);
- case "object":
- return [raw.x || raw.h || raw.left, raw.y || raw.v || raw.top, raw.x || raw.h || raw.right, raw.y || raw.v || raw.bottom];
- case "number":
- return [raw];
- default:
- return raw
- }
- };
- var quadToObject = function(raw) {
- var quad = splitQuad(raw);
- var left = parseInt(quad && quad[0], 10);
- var top = parseInt(quad && quad[1], 10);
- var right = parseInt(quad && quad[2], 10);
- var bottom = parseInt(quad && quad[3], 10);
- if (!isFinite(left)) {
- left = 0
- }
- if (!isFinite(top)) {
- top = left
- }
- if (!isFinite(right)) {
- right = left
- }
- if (!isFinite(bottom)) {
- bottom = top
- }
- return {
- top: top,
- right: right,
- bottom: bottom,
- left: left
- }
- };
- var stringFormat = function() {
- var s = arguments[0];
- var values = [].slice.call(arguments).slice(1);
- var replaceDollarCount;
- var reg;
- var value;
- if (typeUtils.isFunction(s)) {
- return s.apply(this, values)
- }
- for (var i = 0; i < values.length; i++) {
- reg = new RegExp("\\{" + i + "\\}", "gm");
- value = values[i];
- if ("string" === typeUtils.type(value) && value.indexOf("$") >= 0) {
- replaceDollarCount = "$".replace("$", "$$").length;
- value = value.replace("$", 1 === replaceDollarCount ? "$$$$" : "$$")
- }
- s = s.replace(reg, value)
- }
- return s
- };
- var replaceAll = function() {
- var quote = function(str) {
- return (str + "").replace(/([+*?.[^\]$(){}><|=!:])/g, "\\$1")
- };
- return function(text, searchToken, replacementToken) {
- return text.replace(new RegExp("(" + quote(searchToken) + ")", "gi"), replacementToken)
- }
- }();
- var isEmpty = function() {
- var SPACE_REGEXP = /\s/g;
- return function(text) {
- return !text || !text.replace(SPACE_REGEXP, "")
- }
- }();
- exports.encodeHtml = encodeHtml;
- exports.quadToObject = quadToObject;
- exports.format = stringFormat;
- exports.replaceAll = replaceAll;
- exports.isEmpty = isEmpty
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/data/data_source/data_source.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var dataUtils = __webpack_require__( /*! ../utils */ 41);
- var arrayUtils = __webpack_require__( /*! ../array_utils */ 135);
- var Store = __webpack_require__( /*! ../abstract_store */ 98);
- var ArrayStore = __webpack_require__( /*! ../array_store */ 68);
- var CustomStore = __webpack_require__( /*! ../custom_store */ 149);
- var EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
- var errors = __webpack_require__( /*! ../errors */ 36).errors;
- var array = __webpack_require__( /*! ../../core/utils/array */ 14);
- var queue = __webpack_require__( /*! ../../core/utils/queue */ 263);
- var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- var __isString = typeUtils.isString;
- var __isNumber = typeUtils.isNumeric;
- var __isBoolean = typeUtils.isBoolean;
- var __isDefined = typeUtils.isDefined;
- var CANCELED_TOKEN = "canceled";
- function OperationManager() {
- this._counter = -1;
- this._deferreds = {}
- }
- OperationManager.prototype.constructor = OperationManager;
- OperationManager.prototype.add = function(deferred) {
- this._counter += 1;
- this._deferreds[this._counter] = deferred;
- return this._counter
- };
- OperationManager.prototype.remove = function(operationId) {
- return delete this._deferreds[operationId]
- };
- OperationManager.prototype.cancel = function(operationId) {
- if (operationId in this._deferreds) {
- this._deferreds[operationId].reject(CANCELED_TOKEN);
- return true
- }
- return false
- };
- OperationManager.prototype.cancelAll = function() {
- while (this._counter > -1) {
- this.cancel(this._counter);
- this._counter--
- }
- };
- function isPending(deferred) {
- return "pending" === deferred.state()
- }
- function normalizeDataSourceOptions(options, normalizationOptions) {
- var store;
- function createCustomStoreFromLoadFunc() {
- var storeConfig = {};
- iteratorUtils.each(["useDefaultSearch", "key", "load", "loadMode", "cacheRawData", "byKey", "lookup", "totalCount", "insert", "update", "remove"], function() {
- storeConfig[this] = options[this];
- delete options[this]
- });
- return new CustomStore(storeConfig)
- }
- function createStoreFromConfig(storeConfig) {
- var alias = storeConfig.type;
- delete storeConfig.type;
- return Store.create(alias, storeConfig)
- }
- function createCustomStoreFromUrl(url) {
- return new CustomStore({
- load: function() {
- return ajax.sendRequest({
- url: url,
- dataType: "json"
- })
- },
- loadMode: normalizationOptions && normalizationOptions.fromUrlLoadMode
- })
- }
- if ("string" === typeof options) {
- options = {
- paginate: false,
- store: createCustomStoreFromUrl(options)
- }
- }
- if (void 0 === options) {
- options = []
- }
- if (Array.isArray(options) || options instanceof Store) {
- options = {
- store: options
- }
- } else {
- options = extend({}, options)
- }
- if (void 0 === options.store) {
- options.store = []
- }
- store = options.store;
- if ("load" in options) {
- store = createCustomStoreFromLoadFunc()
- } else {
- if (Array.isArray(store)) {
- store = new ArrayStore(store)
- } else {
- if (typeUtils.isPlainObject(store)) {
- store = createStoreFromConfig(extend({}, store))
- }
- }
- }
- options.store = store;
- return options
- }
- function normalizeStoreLoadOptionAccessorArguments(originalArguments) {
- switch (originalArguments.length) {
- case 0:
- return;
- case 1:
- return originalArguments[0]
- }
- return [].slice.call(originalArguments)
- }
- function generateStoreLoadOptionAccessor(optionName) {
- return function() {
- var args = normalizeStoreLoadOptionAccessorArguments(arguments);
- if (void 0 === args) {
- return this._storeLoadOptions[optionName]
- }
- this._storeLoadOptions[optionName] = args
- }
- }
- function mapDataRespectingGrouping(items, mapper, groupInfo) {
- function mapRecursive(items, level) {
- if (!Array.isArray(items)) {
- return items
- }
- return level ? mapGroup(items, level) : iteratorUtils.map(items, mapper)
- }
- function mapGroup(group, level) {
- return iteratorUtils.map(group, function(item) {
- var result = {
- key: item.key,
- items: mapRecursive(item.items, level - 1)
- };
- if ("aggregates" in item) {
- result.aggregates = item.aggregates
- }
- return result
- })
- }
- return mapRecursive(items, groupInfo ? dataUtils.normalizeSortingInfo(groupInfo).length : 0)
- }
- function normalizeLoadResult(data, extra) {
- if (data && !Array.isArray(data) && data.data) {
- extra = data;
- data = data.data
- }
- if (!Array.isArray(data)) {
- data = [data]
- }
- return {
- data: data,
- extra: extra
- }
- }
- var DataSource = Class.inherit({
- ctor: function(options) {
- var _this = this;
- var that = this;
- options = normalizeDataSourceOptions(options);
- var onPushHandler = 0 !== options.pushAggregationTimeout ? dataUtils.throttleChanges(this._onPush, function() {
- if (void 0 === options.pushAggregationTimeout) {
- return 5 * that._changedTime
- }
- return options.pushAggregationTimeout
- }) : this._onPush;
- this._changedTime = 0;
- this._onPushHandler = function(changes) {
- _this._aggregationTimeoutId = onPushHandler.call(_this, changes)
- };
- this._store = options.store;
- this._store.on("push", this._onPushHandler);
- this._storeLoadOptions = this._extractLoadOptions(options);
- this._mapFunc = options.map;
- this._postProcessFunc = options.postProcess;
- this._pageIndex = void 0 !== options.pageIndex ? options.pageIndex : 0;
- this._pageSize = void 0 !== options.pageSize ? options.pageSize : 20;
- this._loadingCount = 0;
- this._loadQueue = this._createLoadQueue();
- this._searchValue = "searchValue" in options ? options.searchValue : null;
- this._searchOperation = options.searchOperation || "contains";
- this._searchExpr = options.searchExpr;
- this._paginate = options.paginate;
- this._reshapeOnPush = __isDefined(options.reshapeOnPush) ? options.reshapeOnPush : false;
- iteratorUtils.each(["onChanged", "onLoadError", "onLoadingChanged", "onCustomizeLoadResult", "onCustomizeStoreLoadOptions"], function(_, optionName) {
- if (optionName in options) {
- that.on(optionName.substr(2, 1).toLowerCase() + optionName.substr(3), options[optionName])
- }
- });
- this._operationManager = new OperationManager;
- this._init()
- },
- _init: function() {
- this._items = [];
- this._userData = {};
- this._totalCount = -1;
- this._isLoaded = false;
- if (!__isDefined(this._paginate)) {
- this._paginate = !this.group()
- }
- this._isLastPage = !this._paginate
- },
- dispose: function() {
- this._store.off("push", this._onPushHandler);
- this._disposeEvents();
- clearTimeout(this._aggregationTimeoutId);
- delete this._store;
- if (this._delayedLoadTask) {
- this._delayedLoadTask.abort()
- }
- this._operationManager.cancelAll();
- this._disposed = true
- },
- _extractLoadOptions: function(options) {
- var result = {};
- var names = ["sort", "filter", "select", "group", "requireTotalCount"];
- var customNames = this._store._customLoadOptions();
- if (customNames) {
- names = names.concat(customNames)
- }
- iteratorUtils.each(names, function() {
- result[this] = options[this]
- });
- return result
- },
- loadOptions: function() {
- return this._storeLoadOptions
- },
- items: function() {
- return this._items
- },
- pageIndex: function(newIndex) {
- if (!__isNumber(newIndex)) {
- return this._pageIndex
- }
- this._pageIndex = newIndex;
- this._isLastPage = !this._paginate
- },
- paginate: function(value) {
- if (!__isBoolean(value)) {
- return this._paginate
- }
- if (this._paginate !== value) {
- this._paginate = value;
- this.pageIndex(0)
- }
- },
- pageSize: function(value) {
- if (!__isNumber(value)) {
- return this._pageSize
- }
- this._pageSize = value
- },
- isLastPage: function() {
- return this._isLastPage
- },
- sort: generateStoreLoadOptionAccessor("sort"),
- filter: function() {
- var newFilter = normalizeStoreLoadOptionAccessorArguments(arguments);
- if (void 0 === newFilter) {
- return this._storeLoadOptions.filter
- }
- this._storeLoadOptions.filter = newFilter;
- this.pageIndex(0)
- },
- group: generateStoreLoadOptionAccessor("group"),
- select: generateStoreLoadOptionAccessor("select"),
- requireTotalCount: function(value) {
- if (!__isBoolean(value)) {
- return this._storeLoadOptions.requireTotalCount
- }
- this._storeLoadOptions.requireTotalCount = value
- },
- searchValue: function(value) {
- if (arguments.length < 1) {
- return this._searchValue
- }
- this._searchValue = value;
- this.pageIndex(0)
- },
- searchOperation: function(op) {
- if (!__isString(op)) {
- return this._searchOperation
- }
- this._searchOperation = op;
- this.pageIndex(0)
- },
- searchExpr: function(expr) {
- var argc = arguments.length;
- if (0 === argc) {
- return this._searchExpr
- }
- if (argc > 1) {
- expr = [].slice.call(arguments)
- }
- this._searchExpr = expr;
- this.pageIndex(0)
- },
- store: function() {
- return this._store
- },
- key: function() {
- return this._store && this._store.key()
- },
- totalCount: function() {
- return this._totalCount
- },
- isLoaded: function() {
- return this._isLoaded
- },
- isLoading: function() {
- return this._loadingCount > 0
- },
- beginLoading: function() {
- this._changeLoadingCount(1)
- },
- endLoading: function() {
- this._changeLoadingCount(-1)
- },
- _createLoadQueue: function() {
- return queue.create()
- },
- _changeLoadingCount: function(increment) {
- var oldLoading = this.isLoading();
- this._loadingCount += increment;
- var newLoading = this.isLoading();
- if (oldLoading ^ newLoading) {
- this.fireEvent("loadingChanged", [newLoading])
- }
- },
- _scheduleLoadCallbacks: function(deferred) {
- var that = this;
- that.beginLoading();
- deferred.always(function() {
- that.endLoading()
- })
- },
- _scheduleFailCallbacks: function(deferred) {
- var that = this;
- deferred.fail(function() {
- if (arguments[0] === CANCELED_TOKEN) {
- return
- }
- that.fireEvent("loadError", arguments)
- })
- },
- _fireChanged: function(args) {
- var date = new Date;
- this.fireEvent("changed", args);
- this._changedTime = new Date - date
- },
- _scheduleChangedCallbacks: function(deferred) {
- var _this2 = this;
- deferred.done(function() {
- _this2._fireChanged()
- })
- },
- loadSingle: function(propName, propValue) {
- var that = this;
- var d = new Deferred;
- var key = this.key();
- var store = this._store;
- var options = this._createStoreLoadOptions();
- var handleDone = function(data) {
- if (!__isDefined(data) || array.isEmpty(data)) {
- d.reject(new errors.Error("E4009"))
- } else {
- if (!Array.isArray(data)) {
- data = [data]
- }
- d.resolve(that._applyMapFunction(data)[0])
- }
- };
- this._scheduleFailCallbacks(d);
- if (arguments.length < 2) {
- propValue = propName;
- propName = key
- }
- delete options.skip;
- delete options.group;
- delete options.refresh;
- delete options.pageIndex;
- delete options.searchString;
- function shouldForceByKey() {
- return store instanceof CustomStore && !store._byKeyViaLoad()
- }(function() {
- if (propName === key || shouldForceByKey()) {
- return store.byKey(propValue, options)
- }
- options.take = 1;
- options.filter = options.filter ? [options.filter, [propName, propValue]] : [propName, propValue];
- return store.load(options)
- })().fail(d.reject).done(handleDone);
- return d.promise()
- },
- load: function() {
- var that = this;
- var d = new Deferred;
- function loadTask() {
- if (that._disposed) {
- return
- }
- if (!isPending(d)) {
- return
- }
- return that._loadFromStore(loadOperation, d)
- }
- this._scheduleLoadCallbacks(d);
- this._scheduleFailCallbacks(d);
- this._scheduleChangedCallbacks(d);
- var loadOperation = this._createLoadOperation(d);
- this.fireEvent("customizeStoreLoadOptions", [loadOperation]);
- this._loadQueue.add(function() {
- if ("number" === typeof loadOperation.delay) {
- that._delayedLoadTask = commonUtils.executeAsync(loadTask, loadOperation.delay)
- } else {
- loadTask()
- }
- return d.promise()
- });
- return d.promise({
- operationId: loadOperation.operationId
- })
- },
- _onPush: function(changes) {
- var _this3 = this;
- if (this._reshapeOnPush) {
- this.load()
- } else {
- this.fireEvent("changing", [{
- changes: changes
- }]);
- var group = this.group();
- var items = this.items();
- var groupLevel = 0;
- var dataSourceChanges = this.paginate() || group ? changes.filter(function(item) {
- return "update" === item.type
- }) : changes;
- if (group) {
- groupLevel = Array.isArray(group) ? group.length : 1
- }
- if (this._mapFunc) {
- dataSourceChanges.forEach(function(item) {
- if ("insert" === item.type) {
- item.data = _this3._mapFunc(item.data)
- }
- })
- }
- arrayUtils.applyBatch(this.store(), items, dataSourceChanges, groupLevel, true);
- this._fireChanged([{
- changes: changes
- }])
- }
- },
- _createLoadOperation: function(deferred) {
- var id = this._operationManager.add(deferred);
- var options = this._createStoreLoadOptions();
- deferred.always(function() {
- this._operationManager.remove(id)
- }.bind(this));
- return {
- operationId: id,
- storeLoadOptions: options
- }
- },
- reload: function() {
- var store = this.store();
- if (store instanceof CustomStore) {
- store.clearRawDataCache()
- }
- this._init();
- return this.load()
- },
- cancel: function(operationId) {
- return this._operationManager.cancel(operationId)
- },
- cancelAll: function() {
- return this._operationManager.cancelAll()
- },
- _addSearchOptions: function(storeLoadOptions) {
- if (this._disposed) {
- return
- }
- if (this.store()._useDefaultSearch) {
- this._addSearchFilter(storeLoadOptions)
- } else {
- storeLoadOptions.searchOperation = this._searchOperation;
- storeLoadOptions.searchValue = this._searchValue;
- storeLoadOptions.searchExpr = this._searchExpr
- }
- },
- _createStoreLoadOptions: function() {
- var result = extend({}, this._storeLoadOptions);
- this._addSearchOptions(result);
- if (this._paginate) {
- if (this._pageSize) {
- result.skip = this._pageIndex * this._pageSize;
- result.take = this._pageSize
- }
- }
- result.userData = this._userData;
- return result
- },
- _addSearchFilter: function(storeLoadOptions) {
- var value = this._searchValue;
- var op = this._searchOperation;
- var selector = this._searchExpr;
- var searchFilter = [];
- if (!value) {
- return
- }
- if (!selector) {
- selector = "this"
- }
- if (!Array.isArray(selector)) {
- selector = [selector]
- }
- iteratorUtils.each(selector, function(i, item) {
- if (searchFilter.length) {
- searchFilter.push("or")
- }
- searchFilter.push([item, op, value])
- });
- if (storeLoadOptions.filter) {
- storeLoadOptions.filter = [searchFilter, storeLoadOptions.filter]
- } else {
- storeLoadOptions.filter = searchFilter
- }
- },
- _loadFromStore: function(loadOptions, pendingDeferred) {
- var that = this;
- function handleSuccess(data, extra) {
- function processResult() {
- var loadResult = extend(normalizeLoadResult(data, extra), loadOptions);
- that.fireEvent("customizeLoadResult", [loadResult]);
- when(loadResult.data).done(function(data) {
- loadResult.data = data;
- that._processStoreLoadResult(loadResult, pendingDeferred)
- }).fail(pendingDeferred.reject)
- }
- if (that._disposed) {
- return
- }
- if (!isPending(pendingDeferred)) {
- return
- }
- processResult()
- }
- if (loadOptions.data) {
- return (new Deferred).resolve(loadOptions.data).done(handleSuccess)
- }
- return this.store().load(loadOptions.storeLoadOptions).done(handleSuccess).fail(pendingDeferred.reject)
- },
- _processStoreLoadResult: function(loadResult, pendingDeferred) {
- var that = this;
- var data = loadResult.data;
- var extra = loadResult.extra;
- var storeLoadOptions = loadResult.storeLoadOptions;
- function resolvePendingDeferred() {
- that._isLoaded = true;
- that._totalCount = isFinite(extra.totalCount) ? extra.totalCount : -1;
- return pendingDeferred.resolve(data, extra)
- }
- function proceedLoadingTotalCount() {
- that.store().totalCount(storeLoadOptions).done(function(count) {
- extra.totalCount = count;
- resolvePendingDeferred()
- }).fail(pendingDeferred.reject)
- }
- if (that._disposed) {
- return
- }
- data = that._applyPostProcessFunction(that._applyMapFunction(data));
- if (!typeUtils.isPlainObject(extra)) {
- extra = {}
- }
- that._items = data;
- if (!data.length || !that._paginate || that._pageSize && data.length < that._pageSize) {
- that._isLastPage = true
- }
- if (storeLoadOptions.requireTotalCount && !isFinite(extra.totalCount)) {
- proceedLoadingTotalCount()
- } else {
- resolvePendingDeferred()
- }
- },
- _applyMapFunction: function(data) {
- if (this._mapFunc) {
- return mapDataRespectingGrouping(data, this._mapFunc, this.group())
- }
- return data
- },
- _applyPostProcessFunction: function(data) {
- if (this._postProcessFunc) {
- return this._postProcessFunc(data)
- }
- return data
- }
- }).include(EventsMixin);
- exports.DataSource = DataSource;
- exports.normalizeDataSourceOptions = normalizeDataSourceOptions;
- exports.normalizeLoadResult = normalizeLoadResult
- }, ,
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/utils/object.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 86);
- var clone = function() {
- function Clone() {}
- return function(obj) {
- Clone.prototype = obj;
- return new Clone
- }
- }();
- var orderEach = function(map, func) {
- var keys = [];
- var key;
- var i;
- for (key in map) {
- if (Object.prototype.hasOwnProperty.call(map, key)) {
- keys.push(key)
- }
- }
- keys.sort(function(x, y) {
- var isNumberX = typeUtils.isNumeric(x);
- var isNumberY = typeUtils.isNumeric(y);
- if (isNumberX && isNumberY) {
- return x - y
- }
- if (isNumberX && !isNumberY) {
- return -1
- }
- if (!isNumberX && isNumberY) {
- return 1
- }
- if (x < y) {
- return -1
- }
- if (x > y) {
- return 1
- }
- return 0
- });
- for (i = 0; i < keys.length; i++) {
- key = keys[i];
- func(key, map[key])
- }
- };
- var assignValueToProperty = function(target, property, value, assignByReference) {
- if (!assignByReference && variableWrapper.isWrapped(target[property])) {
- variableWrapper.assign(target[property], value)
- } else {
- target[property] = value
- }
- };
- var deepExtendArraySafe = function deepExtendArraySafe(target, changes, extendComplexObject, assignByReference) {
- var prevValue;
- var newValue;
- for (var name in changes) {
- prevValue = target[name];
- newValue = changes[name];
- if ("__proto__" === name || target === newValue) {
- continue
- }
- if (typeUtils.isPlainObject(newValue)) {
- var goDeeper = extendComplexObject ? typeUtils.isObject(prevValue) : typeUtils.isPlainObject(prevValue);
- newValue = deepExtendArraySafe(goDeeper ? prevValue : {}, newValue, extendComplexObject, assignByReference)
- }
- if (void 0 !== newValue && prevValue !== newValue) {
- assignValueToProperty(target, name, newValue, assignByReference)
- }
- }
- return target
- };
- exports.clone = clone;
- exports.orderEach = orderEach;
- exports.deepExtendArraySafe = deepExtendArraySafe
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/core/utils/ready_callbacks.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
- var injector = __webpack_require__( /*! ./dependency_injector */ 54);
- var windowUtils = __webpack_require__( /*! ./window */ 7);
- var callOnce = __webpack_require__( /*! ./call_once */ 63);
- var callbacks = [];
- var isReady = function() {
- return "complete" === domAdapter.getReadyState() || "loading" !== domAdapter.getReadyState() && !domAdapter.getDocumentElement().doScroll
- };
- var subscribeReady = callOnce(function() {
- var removeListener = domAdapter.listen(domAdapter.getDocument(), "DOMContentLoaded", function() {
- readyCallbacks.fire();
- removeListener()
- })
- });
- var readyCallbacks = {
- add: function(callback) {
- var hasWindow = windowUtils.hasWindow();
- if (hasWindow && isReady()) {
- callback()
- } else {
- callbacks.push(callback);
- hasWindow && subscribeReady()
- }
- },
- fire: function() {
- callbacks.forEach(function(callback) {
- return callback()
- });
- callbacks = []
- }
- };
- module.exports = injector(readyCallbacks)
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/ui/editor/editor.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _string = __webpack_require__( /*! ../../core/utils/string */ 44);
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var Guid = __webpack_require__( /*! ../../core/guid */ 40);
- var getDefaultAlignment = __webpack_require__( /*! ../../core/utils/position */ 97).getDefaultAlignment;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var Widget = __webpack_require__( /*! ../widget/ui.widget */ 18);
- var ValidationMixin = __webpack_require__( /*! ../validation/validation_mixin */ 172);
- var Overlay = __webpack_require__( /*! ../overlay */ 59);
- var EventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
- var READONLY_STATE_CLASS = "dx-state-readonly";
- var INVALID_CLASS = "dx-invalid";
- var INVALID_MESSAGE = "dx-invalid-message";
- var INVALID_MESSAGE_CONTENT = "dx-invalid-message-content";
- var INVALID_MESSAGE_AUTO = "dx-invalid-message-auto";
- var INVALID_MESSAGE_ALWAYS = "dx-invalid-message-always";
- var VALIDATION_TARGET = "dx-validation-target";
- var VALIDATION_MESSAGE_MIN_WIDTH = 100;
- var READONLY_NAMESPACE = "editorReadOnly";
- var Editor = Widget.inherit({
- ctor: function() {
- this.showValidationMessageTimeout = null;
- this.validationRequest = Callbacks();
- this.callBase.apply(this, arguments);
- var $element = this.$element();
- if ($element) {
- dataUtils.data($element[0], VALIDATION_TARGET, this)
- }
- },
- _init: function() {
- this.callBase();
- this._initInnerOptionCache("validationTooltipOptions")
- },
- _getDefaultOptions: function() {
- return extend(this.callBase(), {
- value: null,
- name: "",
- onValueChanged: null,
- readOnly: false,
- isValid: true,
- validationError: null,
- validationMessageMode: "auto",
- validationBoundary: void 0,
- validationMessageOffset: {
- h: 0,
- v: 0
- },
- validationTooltipOptions: {}
- })
- },
- _attachKeyboardEvents: function() {
- if (this.option("readOnly")) {
- return
- }
- this.callBase();
- if (this._keyboardProcessor) {
- this._attachChildKeyboardEvents()
- }
- },
- _attachChildKeyboardEvents: commonUtils.noop,
- _setOptionsByReference: function() {
- this.callBase();
- extend(this._optionsByReference, {
- validationError: true
- })
- },
- _createValueChangeAction: function() {
- this._valueChangeAction = this._createActionByOption("onValueChanged", {
- excludeValidators: ["disabled", "readOnly"]
- })
- },
- _suppressValueChangeAction: function() {
- this._valueChangeActionSuppressed = true
- },
- _resumeValueChangeAction: function() {
- this._valueChangeActionSuppressed = false
- },
- _initMarkup: function() {
- this._toggleReadOnlyState();
- this._setSubmitElementName(this.option("name"));
- this.callBase();
- this._renderValidationState()
- },
- _raiseValueChangeAction: function(value, previousValue) {
- if (!this._valueChangeAction) {
- this._createValueChangeAction()
- }
- this._valueChangeAction(this._valueChangeArgs(value, previousValue))
- },
- _valueChangeArgs: function(value, previousValue) {
- return {
- value: value,
- previousValue: previousValue,
- event: this._valueChangeEventInstance
- }
- },
- _saveValueChangeEvent: function(e) {
- this._valueChangeEventInstance = e
- },
- _focusInHandler: function(e) {
- var _this = this;
- var isValidationMessageShownOnFocus = "auto" === this.option("validationMessageMode");
- if (this._canValueBeChangedByClick() && isValidationMessageShownOnFocus) {
- this._$validationMessage && this._$validationMessage.removeClass(INVALID_MESSAGE_AUTO);
- clearTimeout(this.showValidationMessageTimeout);
- this.showValidationMessageTimeout = setTimeout(function() {
- return _this._$validationMessage && _this._$validationMessage.addClass(INVALID_MESSAGE_AUTO)
- }, 150)
- }
- return this.callBase(e)
- },
- _canValueBeChangedByClick: function() {
- return false
- },
- _renderValidationState: function() {
- var isValid = this.option("isValid");
- var validationError = this.option("validationError");
- var validationMessageMode = this.option("validationMessageMode");
- var $element = this.$element();
- $element.toggleClass(INVALID_CLASS, !isValid);
- this.setAria("invalid", !isValid || void 0);
- if (!windowUtils.hasWindow()) {
- return
- }
- if (this._$validationMessage) {
- this._$validationMessage.remove();
- this.setAria("describedby", null);
- this._$validationMessage = null
- }
- if (!isValid && validationError && validationError.message) {
- this._$validationMessage = $("<div>").addClass(INVALID_MESSAGE).html((0, _string.encodeHtml)(validationError.message)).appendTo($element);
- var validationTarget = this._getValidationMessageTarget();
- this._validationMessage = this._createComponent(this._$validationMessage, Overlay, extend({
- integrationOptions: {},
- templatesRenderAsynchronously: false,
- target: validationTarget,
- shading: false,
- width: "auto",
- height: "auto",
- container: $element,
- position: this._getValidationMessagePosition("below"),
- closeOnOutsideClick: false,
- closeOnTargetScroll: false,
- animation: null,
- visible: true,
- propagateOutsideClick: true,
- _checkParentVisibility: false
- }, this._getInnerOptionsCache("validationTooltipOptions")));
- this._$validationMessage.toggleClass(INVALID_MESSAGE_AUTO, "auto" === validationMessageMode).toggleClass(INVALID_MESSAGE_ALWAYS, "always" === validationMessageMode);
- var messageId = "dx-" + new Guid;
- this._validationMessage.$content().addClass(INVALID_MESSAGE_CONTENT).attr("id", messageId);
- this.setAria("describedby", messageId);
- this._setValidationMessageMaxWidth();
- this._bindInnerWidgetOptions(this._validationMessage, "validationTooltipOptions")
- }
- },
- _setValidationMessageMaxWidth: function() {
- if (!this._validationMessage) {
- return
- }
- if (0 === this._getValidationMessageTarget().outerWidth()) {
- this._validationMessage.option("maxWidth", "100%");
- return
- }
- var validationMessageMaxWidth = Math.max(VALIDATION_MESSAGE_MIN_WIDTH, this._getValidationMessageTarget().outerWidth());
- this._validationMessage.option("maxWidth", validationMessageMaxWidth)
- },
- _getValidationMessageTarget: function() {
- return this.$element()
- },
- _getValidationMessagePosition: function(positionRequest) {
- var rtlEnabled = this.option("rtlEnabled");
- var messagePositionSide = getDefaultAlignment(rtlEnabled);
- var messageOriginalOffset = this.option("validationMessageOffset");
- var messageOffset = {
- h: messageOriginalOffset.h,
- v: messageOriginalOffset.v
- };
- var verticalPositions = "below" === positionRequest ? [" top", " bottom"] : [" bottom", " top"];
- if (rtlEnabled) {
- messageOffset.h = -messageOffset.h
- }
- if ("below" !== positionRequest) {
- messageOffset.v = -messageOffset.v
- }
- return {
- offset: messageOffset,
- boundary: this.option("validationBoundary"),
- my: messagePositionSide + verticalPositions[0],
- at: messagePositionSide + verticalPositions[1],
- collision: "none flip"
- }
- },
- _toggleReadOnlyState: function() {
- var readOnly = this.option("readOnly");
- this._toggleBackspaceHandler(readOnly);
- this.$element().toggleClass(READONLY_STATE_CLASS, !!readOnly);
- this.setAria("readonly", readOnly || void 0)
- },
- _toggleBackspaceHandler: function(isReadOnly) {
- var $eventTarget = this._keyboardEventBindingTarget();
- var eventName = eventUtils.addNamespace("keydown", READONLY_NAMESPACE);
- EventsEngine.off($eventTarget, eventName);
- if (isReadOnly) {
- EventsEngine.on($eventTarget, eventName, function(e) {
- if ("backspace" === eventUtils.normalizeKeyName(e)) {
- e.preventDefault()
- }
- })
- }
- },
- _dispose: function() {
- var element = this.$element()[0];
- dataUtils.data(element, VALIDATION_TARGET, null);
- clearTimeout(this.showValidationMessageTimeout);
- this.callBase()
- },
- _setSubmitElementName: function(name) {
- var $submitElement = this._getSubmitElement();
- if (!$submitElement) {
- return
- }
- if (name.length > 0) {
- $submitElement.attr("name", name)
- } else {
- $submitElement.removeAttr("name")
- }
- },
- _getSubmitElement: function() {
- return null
- },
- _optionChanged: function(args) {
- switch (args.name) {
- case "onValueChanged":
- this._createValueChangeAction();
- break;
- case "isValid":
- case "validationError":
- case "validationBoundary":
- case "validationMessageMode":
- this._renderValidationState();
- break;
- case "validationTooltipOptions":
- this._innerOptionChanged(this._validationMessage, args);
- break;
- case "readOnly":
- this._toggleReadOnlyState();
- this._refreshFocusState();
- break;
- case "value":
- if (args.value != args.previousValue) {
- this.validationRequest.fire({
- value: args.value,
- editor: this
- })
- }
- if (!this._valueChangeActionSuppressed) {
- this._raiseValueChangeAction(args.value, args.previousValue);
- this._saveValueChangeEvent(void 0)
- }
- break;
- case "width":
- this.callBase(args);
- this._setValidationMessageMaxWidth();
- break;
- case "name":
- this._setSubmitElementName(args.value);
- break;
- default:
- this.callBase(args)
- }
- },
- reset: function() {
- var defaultOptions = this._getDefaultOptions();
- this.option("value", defaultOptions.value)
- }
- }).include(ValidationMixin);
- module.exports = Editor
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/viz/themes.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var vizUtils = __webpack_require__( /*! ./core/utils */ 10);
- var uiThemes = __webpack_require__( /*! ../ui/themes */ 30);
- var themes = {};
- var themesMapping = {};
- var themesSchemeMapping = {};
- var _extend = extend;
- var _each = each;
- var _normalizeEnum = vizUtils.normalizeEnum;
- var currentThemeName = null;
- var defaultTheme;
- var nextCacheUid = 0;
- var widgetsCache = {};
- function getTheme(themeName) {
- var name = _normalizeEnum(themeName);
- return themes[name] || themes[themesMapping[name] || currentTheme()]
- }
- function findThemeNameByName(name, scheme) {
- return themesMapping[name + "." + scheme] || themesSchemeMapping[name + "." + scheme] || themesMapping[name]
- }
- function findThemeNameByPlatform(platform, version, scheme) {
- return findThemeNameByName(platform + version, scheme) || findThemeNameByName(platform, scheme)
- }
- function currentTheme(themeName, colorScheme) {
- if (!arguments.length) {
- return currentThemeName || findThemeNameByName(uiThemes.current()) || defaultTheme
- }
- var scheme = _normalizeEnum(colorScheme);
- currentThemeName = (themeName && themeName.platform ? findThemeNameByPlatform(_normalizeEnum(themeName.platform), themeName.version, scheme) : findThemeNameByName(_normalizeEnum(themeName), scheme)) || currentThemeName;
- return this
- }
- function getThemeInfo(themeName, splitter) {
- var k = themeName.indexOf(splitter);
- return k > 0 ? {
- name: themeName.substring(0, k),
- scheme: themeName.substring(k + 1)
- } : null
- }
- function registerThemeName(themeName, targetThemeName) {
- var themeInfo = getThemeInfo(themeName, ".") || {
- name: themeName
- };
- var name = themeInfo.name;
- var scheme = themeInfo.scheme;
- if (scheme) {
- themesMapping[name] = themesMapping[name] || targetThemeName;
- themesMapping[name + "." + scheme] = targetThemeName
- } else {
- themesMapping[name] = targetThemeName
- }
- }
- function registerTheme(theme, baseThemeName) {
- var themeName = _normalizeEnum(theme && theme.name);
- if (themeName) {
- theme.isDefault && (defaultTheme = themeName);
- registerThemeName(themeName, themeName);
- themes[themeName] = _extend(true, {}, getTheme(baseThemeName), patchTheme(theme))
- }
- }
- function registerThemeAlias(alias, theme) {
- registerThemeName(_normalizeEnum(alias), _normalizeEnum(theme))
- }
- function registerThemeSchemeAlias(from, to) {
- themesSchemeMapping[from] = to
- }
- function mergeScalar(target, field, source, sourceValue) {
- var _value = source ? source[field] : sourceValue;
- if (void 0 !== _value && void 0 === target[field]) {
- target[field] = _value
- }
- }
- function mergeObject(target, field, source, sourceValue) {
- var _value = source ? source[field] : sourceValue;
- if (void 0 !== _value) {
- target[field] = _extend(true, {}, _value, target[field])
- }
- }
- function patchTheme(theme) {
- theme = _extend(true, {
- loadingIndicator: {
- font: {}
- },
- "export": {
- font: {}
- },
- legend: {
- font: {},
- border: {}
- },
- title: {
- font: {}
- },
- tooltip: {
- font: {}
- },
- "chart:common": {},
- "chart:common:axis": {
- grid: {},
- minorGrid: {},
- tick: {},
- minorTick: {},
- title: {
- font: {}
- },
- label: {
- font: {}
- }
- },
- chart: {
- commonSeriesSettings: {
- candlestick: {}
- }
- },
- pie: {},
- polar: {},
- gauge: {
- scale: {
- tick: {},
- minorTick: {},
- label: {
- font: {}
- }
- }
- },
- barGauge: {},
- funnel: {},
- sankey: {},
- map: {
- background: {}
- },
- treeMap: {
- tile: {
- selectionStyle: {
- border: {}
- }
- },
- group: {
- border: {},
- selectionStyle: {
- border: {}
- },
- label: {
- font: {}
- }
- }
- },
- rangeSelector: {
- scale: {
- tick: {},
- minorTick: {},
- label: {
- font: {}
- }
- },
- chart: {}
- },
- sparkline: {},
- bullet: {}
- }, theme);
- mergeScalar(theme.loadingIndicator, "backgroundColor", theme);
- mergeScalar(theme.chart.commonSeriesSettings.candlestick, "innerColor", null, theme.backgroundColor);
- mergeScalar(theme.map.background, "color", null, theme.backgroundColor);
- mergeScalar(theme.title.font, "color", null, theme.primaryTitleColor);
- mergeObject(theme.title, "subtitle", null, theme.title);
- mergeScalar(theme.legend.font, "color", null, theme.secondaryTitleColor);
- mergeScalar(theme.legend.border, "color", null, theme.gridColor);
- patchAxes(theme);
- _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "funnel", "rangeSelector", "sparkline", "bullet", "sankey"], function(_, section) {
- mergeScalar(theme[section], "redrawOnResize", theme);
- mergeScalar(theme[section], "containerBackgroundColor", null, theme.backgroundColor);
- mergeObject(theme[section], "tooltip", theme);
- mergeObject(theme[section], "export", theme)
- });
- _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "funnel", "rangeSelector", "sankey"], function(_, section) {
- mergeObject(theme[section], "loadingIndicator", theme);
- mergeObject(theme[section], "legend", theme);
- mergeObject(theme[section], "title", theme)
- });
- _each(["chart", "pie", "polar"], function(_, section) {
- mergeObject(theme, section, null, theme["chart:common"])
- });
- _each(["chart", "polar"], function(_, section) {
- theme[section] = theme[section] || {};
- mergeObject(theme[section], "commonAxisSettings", null, theme["chart:common:axis"])
- });
- mergeObject(theme.rangeSelector.chart, "commonSeriesSettings", theme.chart);
- mergeObject(theme.rangeSelector.chart, "dataPrepareSettings", theme.chart);
- mergeScalar(theme.treeMap.group.border, "color", null, theme.gridColor);
- mergeScalar(theme.treeMap.tile.selectionStyle.border, "color", null, theme.primaryTitleColor);
- mergeScalar(theme.treeMap.group.selectionStyle.border, "color", null, theme.primaryTitleColor);
- mergeScalar(theme.map.legend, "backgroundColor", theme);
- patchMapLayers(theme);
- return theme
- }
- function patchAxes(theme) {
- var commonAxisSettings = theme["chart:common:axis"];
- var colorFieldName = "color";
- _each([commonAxisSettings.grid, commonAxisSettings.minorGrid], function(_, obj) {
- mergeScalar(obj, colorFieldName, null, theme.gridColor)
- });
- _each([commonAxisSettings, commonAxisSettings.tick, commonAxisSettings.minorTick, commonAxisSettings.label.font], function(_, obj) {
- mergeScalar(obj, colorFieldName, null, theme.axisColor)
- });
- mergeScalar(commonAxisSettings.title.font, colorFieldName, null, theme.secondaryTitleColor);
- mergeScalar(theme.gauge.scale.label.font, colorFieldName, null, theme.axisColor);
- mergeScalar(theme.gauge.scale.tick, colorFieldName, null, theme.backgroundColor);
- mergeScalar(theme.gauge.scale.minorTick, colorFieldName, null, theme.backgroundColor);
- mergeScalar(theme.rangeSelector.scale.label.font, colorFieldName, null, theme.axisColor)
- }
- function patchMapLayers(theme) {
- var map = theme.map;
- _each(["area", "line", "marker"], function(_, section) {
- mergeObject(map, "layer:" + section, null, map.layer)
- });
- _each(["dot", "bubble", "pie", "image"], function(_, section) {
- mergeObject(map, "layer:marker:" + section, null, map["layer:marker"])
- })
- }
- function addCacheItem(target) {
- var cacheUid = ++nextCacheUid;
- target._cache = cacheUid;
- widgetsCache[cacheUid] = target
- }
- function removeCacheItem(target) {
- delete widgetsCache[target._cache]
- }
- function refreshTheme() {
- _each(widgetsCache, function() {
- this.refresh()
- });
- return this
- }
- _extend(exports, {
- currentTheme: currentTheme,
- registerTheme: registerTheme,
- getTheme: getTheme,
- registerThemeAlias: registerThemeAlias,
- registerThemeSchemeAlias: registerThemeSchemeAlias,
- refreshTheme: refreshTheme,
- addCacheItem: addCacheItem,
- removeCacheItem: removeCacheItem
- });
- _extend(exports, {
- themes: themes,
- themesMapping: themesMapping,
- themesSchemeMapping: themesSchemeMapping,
- widgetsCache: widgetsCache,
- resetCurrentTheme: function() {
- currentThemeName = null
- }
- })
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/localization/number.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return
- }
- if ("string" === typeof o) {
- return _arrayLikeToArray(o, minLen)
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if ("Object" === n && o.constructor) {
- n = o.constructor.name
- }
- if ("Map" === n || "Set" === n) {
- return Array.from(o)
- }
- if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen)
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (null == len || len > arr.length) {
- len = arr.length
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- function _iterableToArrayLimit(arr, i) {
- var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
- if (null == _i) {
- return
- }
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s, _e;
- try {
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) {
- break
- }
- }
- } catch (err) {
- _d = true;
- _e = err
- } finally {
- try {
- if (!_n && null != _i.return) {
- _i.return()
- }
- } finally {
- if (_d) {
- throw _e
- }
- }
- }
- return _arr
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) {
- return arr
- }
- }
- var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
- var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
- var escapeRegExp = __webpack_require__( /*! ../core/utils/common */ 4).escapeRegExp;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var isPlainObject = __webpack_require__( /*! ../core/utils/type */ 1).isPlainObject;
- var ldmlNumber = __webpack_require__( /*! ./ldml/number */ 278);
- var config = __webpack_require__( /*! ../core/config */ 31);
- var errors = __webpack_require__( /*! ../core/errors */ 21);
- var toFixed = __webpack_require__( /*! ./utils */ 256).toFixed;
- var MAX_LARGE_NUMBER_POWER = 4;
- var DECIMAL_BASE = 10;
- var NUMERIC_FORMATS = ["currency", "fixedpoint", "exponential", "percent", "decimal"];
- var LargeNumberFormatPostfixes = {
- 1: "K",
- 2: "M",
- 3: "B",
- 4: "T"
- };
- var LargeNumberFormatPowers = {
- largenumber: "auto",
- thousands: 1,
- millions: 2,
- billions: 3,
- trillions: 4
- };
- var numberLocalization = dependencyInjector({
- numericFormats: NUMERIC_FORMATS,
- defaultLargeNumberFormatPostfixes: LargeNumberFormatPostfixes,
- _parseNumberFormatString: function(formatType) {
- var formatObject = {};
- if (!formatType || "string" !== typeof formatType) {
- return
- }
- var formatList = formatType.toLowerCase().split(" ");
- each(formatList, function(index, value) {
- if (inArray(value, NUMERIC_FORMATS) > -1) {
- formatObject.formatType = value
- } else {
- if (value in LargeNumberFormatPowers) {
- formatObject.power = LargeNumberFormatPowers[value]
- }
- }
- });
- if (formatObject.power && !formatObject.formatType) {
- formatObject.formatType = "fixedpoint"
- }
- if (formatObject.formatType) {
- return formatObject
- }
- },
- _calculateNumberPower: function(value, base, minPower, maxPower) {
- var number = Math.abs(value);
- var power = 0;
- if (number > 1) {
- while (number && number >= base && (void 0 === maxPower || power < maxPower)) {
- power++;
- number /= base
- }
- } else {
- if (number > 0 && number < 1) {
- while (number < 1 && (void 0 === minPower || power > minPower)) {
- power--;
- number *= base
- }
- }
- }
- return power
- },
- _getNumberByPower: function(number, power, base) {
- var result = number;
- while (power > 0) {
- result /= base;
- power--
- }
- while (power < 0) {
- result *= base;
- power++
- }
- return result
- },
- _formatNumber: function(value, formatObject, formatConfig) {
- var result;
- if ("auto" === formatObject.power) {
- formatObject.power = this._calculateNumberPower(value, 1e3, 0, MAX_LARGE_NUMBER_POWER)
- }
- if (formatObject.power) {
- value = this._getNumberByPower(value, formatObject.power, 1e3)
- }
- var powerPostfix = this.defaultLargeNumberFormatPostfixes[formatObject.power] || "";
- result = this._formatNumberCore(value, formatObject.formatType, formatConfig);
- result = result.replace(/(\d|.$)(\D*)$/, "$1" + powerPostfix + "$2");
- return result
- },
- _formatNumberExponential: function(value, formatConfig) {
- var power = this._calculateNumberPower(value, DECIMAL_BASE);
- var number = this._getNumberByPower(value, power, DECIMAL_BASE);
- if (void 0 === formatConfig.precision) {
- formatConfig.precision = 1
- }
- if (number.toFixed(formatConfig.precision || 0) >= DECIMAL_BASE) {
- power++;
- number /= DECIMAL_BASE
- }
- var powString = (power >= 0 ? "+" : "") + power.toString();
- return this._formatNumberCore(number, "fixedpoint", formatConfig) + "E" + powString
- },
- _addZeroes: function(value, precision) {
- var multiplier = Math.pow(10, precision);
- var sign = value < 0 ? "-" : "";
- value = (Math.abs(value) * multiplier >>> 0) / multiplier;
- var result = value.toString();
- while (result.length < precision) {
- result = "0" + result
- }
- return sign + result
- },
- _addGroupSeparators: function(value) {
- var parts = value.toString().split(".");
- return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, config().thousandsSeparator) + (parts[1] ? config().decimalSeparator + parts[1] : "")
- },
- _formatNumberCore: function(value, format, formatConfig) {
- if ("exponential" === format) {
- return this._formatNumberExponential(value, formatConfig)
- }
- if ("decimal" !== format && null !== formatConfig.precision) {
- formatConfig.precision = formatConfig.precision || 0
- }
- if ("percent" === format) {
- value = 100 * value
- }
- if (void 0 !== formatConfig.precision) {
- if ("decimal" === format) {
- value = this._addZeroes(value, formatConfig.precision)
- } else {
- value = null === formatConfig.precision ? value.toPrecision() : toFixed(value, formatConfig.precision)
- }
- }
- if ("decimal" !== format) {
- value = this._addGroupSeparators(value)
- } else {
- value = value.toString().replace(".", config().decimalSeparator)
- }
- if ("percent" === format) {
- value += "%"
- }
- return value
- },
- _normalizeFormat: function(format) {
- if (!format) {
- return {}
- }
- if ("function" === typeof format) {
- return format
- }
- if (!isPlainObject(format)) {
- format = {
- type: format
- }
- }
- return format
- },
- _getSeparators: function() {
- return {
- decimalSeparator: this.getDecimalSeparator(),
- thousandsSeparator: this.getThousandsSeparator()
- }
- },
- getThousandsSeparator: function() {
- return this.format(1e4, "fixedPoint")[2]
- },
- getDecimalSeparator: function() {
- return this.format(1.2, {
- type: "fixedPoint",
- precision: 1
- })[1]
- },
- convertDigits: function(value, toStandard) {
- var digits = this.format(90, "decimal");
- if ("string" !== typeof value || "0" === digits[1]) {
- return value
- }
- var fromFirstDigit = toStandard ? digits[1] : "0";
- var toFirstDigit = toStandard ? "0" : digits[1];
- var fromLastDigit = toStandard ? digits[0] : "9";
- var regExp = new RegExp("[" + fromFirstDigit + "-" + fromLastDigit + "]", "g");
- return value.replace(regExp, function(char) {
- return String.fromCharCode(char.charCodeAt(0) + (toFirstDigit.charCodeAt(0) - fromFirstDigit.charCodeAt(0)))
- })
- },
- getSign: function(text, format) {
- if ("-" === text.replace(/[^0-9-]/g, "").charAt(0)) {
- return -1
- }
- if (!format) {
- return 1
- }
- var separators = this._getSeparators();
- var regExp = new RegExp("[0-9" + escapeRegExp(separators.decimalSeparator + separators.thousandsSeparator) + "]+", "g");
- var negativeEtalon = this.format(-1, format).replace(regExp, "1");
- var cleanedText = text.replace(regExp, "1");
- return cleanedText === negativeEtalon ? -1 : 1
- },
- format: function(value, _format) {
- if ("number" !== typeof value) {
- return value
- }
- if ("number" === typeof _format) {
- return value
- }
- _format = _format && _format.formatter || _format;
- if ("function" === typeof _format) {
- return _format(value)
- }
- _format = this._normalizeFormat(_format);
- if (!_format.type) {
- _format.type = "decimal"
- }
- var numberConfig = this._parseNumberFormatString(_format.type);
- if (!numberConfig) {
- return this.convertDigits(ldmlNumber.getFormatter(_format.type, this._getSeparators())(value))
- }
- return this._formatNumber(value, numberConfig, _format)
- },
- parse: function(text, format) {
- if (!text) {
- return
- }
- if (format && format.parser) {
- return format.parser(text)
- }
- text = this.convertDigits(text, true);
- if (format && "string" !== typeof format) {
- errors.log("W0011")
- }
- var decimalSeparator = this.getDecimalSeparator();
- var regExp = new RegExp("[^0-9" + escapeRegExp(decimalSeparator) + "]", "g");
- var cleanedText = text.replace(regExp, "").replace(decimalSeparator, ".").replace(/\.$/g, "");
- if ("." === cleanedText || "" === cleanedText) {
- return null
- }
- if (this._calcSignificantDigits(cleanedText) > 15) {
- return NaN
- }
- var parsed = +cleanedText;
- return parsed * this.getSign(text, format)
- },
- _calcSignificantDigits: function(text) {
- var _text$split = text.split("."),
- _text$split2 = _slicedToArray(_text$split, 2),
- integer = _text$split2[0],
- fractional = _text$split2[1];
- var calcDigitsAfterLeadingZeros = function(digits) {
- var index = -1;
- for (var i = 0; i < digits.length; i++) {
- if ("0" !== digits[i]) {
- index = i;
- break
- }
- }
- return index > -1 ? digits.length - index : 0
- };
- var result = 0;
- if (integer) {
- result += calcDigitsAfterLeadingZeros(integer.split(""))
- }
- if (fractional) {
- result += calcDigitsAfterLeadingZeros(fractional.split("").reverse())
- }
- return result
- }
- });
- module.exports = numberLocalization
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/core/utils/date_serialization.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var config = __webpack_require__( /*! ../config */ 31);
- var getLDMLFormatter = __webpack_require__( /*! ../../localization/ldml/date.formatter */ 257).getFormatter;
- var defaultDateNames = __webpack_require__( /*! ../../localization/default_date_names */ 258);
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var isString = typeUtils.isString;
- var isDate = typeUtils.isDate;
- var isNumber = typeUtils.isNumeric;
- var NUMBER_SERIALIZATION_FORMAT = "number";
- var DATE_SERIALIZATION_FORMAT = "yyyy/MM/dd";
- var DATETIME_SERIALIZATION_FORMAT = "yyyy/MM/dd HH:mm:ss";
- var ISO8601_PATTERN = /^(\d{4,})(-)?(\d{2})(-)?(\d{2})(?:T(\d{2})(:)?(\d{2})?(:)?(\d{2}(?:\.(\d{1,3})\d*)?)?)?(Z|([+-])(\d{2})(:)?(\d{2})?)?$/;
- var ISO8601_TIME_PATTERN = /^(\d{2}):(\d{2})(:(\d{2}))?$/;
- var ISO8601_PATTERN_PARTS = ["", "yyyy", "", "MM", "", "dd", "THH", "", "mm", "", "ss", ".SSS"];
- var MILLISECOND_LENGHT = 3;
- var dateParser = function(text, skipISO8601Parsing) {
- var result;
- var parsedValue;
- if (isString(text) && !skipISO8601Parsing) {
- result = parseISO8601String(text)
- }
- if (!result) {
- parsedValue = !isDate(text) && Date.parse(text);
- result = isNumber(parsedValue) ? new Date(parsedValue) : text
- }
- return result
- };
- var parseISO8601String = function(text) {
- var parts = text.match(ISO8601_PATTERN);
- var timePart = function(part) {
- return +part || 0
- };
- if (!parts) {
- parts = text.match(ISO8601_TIME_PATTERN);
- if (parts) {
- return new Date(0, 0, 0, timePart(parts[1]), timePart(parts[2]), timePart(parts[4]))
- }
- return
- }
- var year = parts[1];
- var month = --parts[3];
- var day = parts[5];
- var timeZoneHour = 0;
- var timeZoneMinute = 0;
- timeZoneHour = timePart(parts[14]);
- timeZoneMinute = timePart(parts[16]);
- if ("-" === parts[13]) {
- timeZoneHour = -timeZoneHour;
- timeZoneMinute = -timeZoneMinute
- }
- var hour = timePart(parts[6]) - timeZoneHour;
- var minute = timePart(parts[8]) - timeZoneMinute;
- var second = timePart(parts[10]);
- var parseMilliseconds = function(part) {
- part = part || "";
- return timePart(part) * Math.pow(10, MILLISECOND_LENGHT - part.length)
- };
- var millisecond = parseMilliseconds(parts[11]);
- if (parts[12]) {
- return new Date(Date.UTC(year, month, day, hour, minute, second, millisecond))
- }
- return new Date(year, month, day, hour, minute, second, millisecond)
- };
- var getIso8601Format = function(text, useUtc) {
- var parts = text.match(ISO8601_PATTERN);
- var result = "";
- if (!parts) {
- parts = text.match(ISO8601_TIME_PATTERN);
- if (parts) {
- return parts[3] ? "HH:mm:ss" : "HH:mm"
- }
- return
- }
- for (var i = 1; i < ISO8601_PATTERN_PARTS.length; i++) {
- if (parts[i]) {
- result += ISO8601_PATTERN_PARTS[i] || parts[i]
- }
- }
- if ("Z" === parts[12]) {
- result += "'Z'"
- }
- if (parts[14]) {
- if (parts[15]) {
- result += "xxx"
- } else {
- if (parts[16]) {
- result += "xx"
- } else {
- result += "x"
- }
- }
- }
- return result
- };
- var deserializeDate = function(value) {
- if ("number" === typeof value) {
- return new Date(value)
- }
- return dateParser(value, !config().forceIsoDateParsing)
- };
- var serializeDate = function(value, serializationFormat) {
- if (!serializationFormat) {
- return value
- }
- if (!isDate(value)) {
- return null
- }
- if (serializationFormat === NUMBER_SERIALIZATION_FORMAT) {
- return value && value.valueOf ? value.valueOf() : null
- }
- return getLDMLFormatter(serializationFormat, defaultDateNames)(value)
- };
- var getDateSerializationFormat = function(value) {
- if ("number" === typeof value) {
- return NUMBER_SERIALIZATION_FORMAT
- } else {
- if (isString(value)) {
- var format;
- if (config().forceIsoDateParsing) {
- format = getIso8601Format(value)
- }
- if (format) {
- return format
- } else {
- if (value.indexOf(":") >= 0) {
- return DATETIME_SERIALIZATION_FORMAT
- } else {
- return DATE_SERIALIZATION_FORMAT
- }
- }
- } else {
- if (value) {
- return null
- }
- }
- }
- };
- module.exports = {
- dateParser: dateParser,
- deserializeDate: deserializeDate,
- serializeDate: serializeDate,
- getDateSerializationFormat: getDateSerializationFormat
- }
- },
- /*!*************************************************************************!*\
- !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.js ***!
- \*************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _uiCollection_widget = __webpack_require__( /*! ./ui.collection_widget.base */ 467);
- var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget);
- var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17);
- var _ui2 = _interopRequireDefault(_ui);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _uiCollection_widgetEditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy.plain */ 182);
- var _uiCollection_widgetEditStrategy2 = _interopRequireDefault(_uiCollection_widgetEditStrategy);
- var _data = __webpack_require__( /*! ../../core/utils/data */ 20);
- var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45);
- var _selection = __webpack_require__( /*! ../selection/selection */ 283);
- var _selection2 = _interopRequireDefault(_selection);
- var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
- }
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return
- }
- if ("string" === typeof o) {
- return _arrayLikeToArray(o, minLen)
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if ("Object" === n && o.constructor) {
- n = o.constructor.name
- }
- if ("Map" === n || "Set" === n) {
- return Array.from(o)
- }
- if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen)
- }
- }
- function _iterableToArray(iter) {
- if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
- return Array.from(iter)
- }
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- return _arrayLikeToArray(arr)
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (null == len || len > arr.length) {
- len = arr.length
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- var ITEM_DELETING_DATA_KEY = "dxItemDeleting";
- var NOT_EXISTING_INDEX = -1;
- var indexExists = function(index) {
- return index !== NOT_EXISTING_INDEX
- };
- var CollectionWidget = _uiCollection_widget2.default.inherit({
- _setOptionsByReference: function() {
- this.callBase();
- (0, _extend.extend)(this._optionsByReference, {
- selectedItem: true
- })
- },
- _getDefaultOptions: function() {
- return (0, _extend.extend)(this.callBase(), {
- selectionMode: "none",
- selectionRequired: false,
- selectionByClick: true,
- selectedItems: [],
- selectedItemKeys: [],
- maxFilterLengthInRequest: 1500,
- keyExpr: null,
- selectedIndex: NOT_EXISTING_INDEX,
- selectedItem: null,
- onSelectionChanged: null,
- onItemReordered: null,
- onItemDeleting: null,
- onItemDeleted: null
- })
- },
- ctor: function(element, options) {
- this._userOptions = options || {};
- this.callBase(element, options)
- },
- _init: function() {
- this._initEditStrategy();
- this.callBase();
- this._initKeyGetter();
- this._initSelectionModule();
- if ("multi" === this.option("selectionMode")) {
- this._showDeprecatedSelectionMode()
- }
- },
- _initKeyGetter: function() {
- this._keyGetter = (0, _data.compileGetter)(this.option("keyExpr"))
- },
- _getKeysByItems: function(selectedItems) {
- return this._editStrategy.getKeysByItems(selectedItems)
- },
- _getItemsByKeys: function(selectedItemKeys, selectedItems) {
- return this._editStrategy.getItemsByKeys(selectedItemKeys, selectedItems)
- },
- _getKeyByIndex: function(index) {
- return this._editStrategy.getKeyByIndex(index)
- },
- _getIndexByKey: function(key) {
- return this._editStrategy.getIndexByKey(key)
- },
- _getIndexByItemData: function(itemData) {
- return this._editStrategy.getIndexByItemData(itemData)
- },
- _isKeySpecified: function() {
- return !!(this._dataSource && this._dataSource.key())
- },
- _getCombinedFilter: function() {
- return this._dataSource && this._dataSource.filter()
- },
- key: function() {
- if (this.option("keyExpr")) {
- return this.option("keyExpr")
- }
- return this._dataSource && this._dataSource.key()
- },
- keyOf: function(item) {
- var key = item;
- var store = this._dataSource && this._dataSource.store();
- if (this.option("keyExpr")) {
- key = this._keyGetter(item)
- } else {
- if (store) {
- key = store.keyOf(item)
- }
- }
- return key
- },
- _nullValueSelectionSupported: function() {
- return false
- },
- _initSelectionModule: function() {
- var that = this;
- var itemsGetter = that._editStrategy.itemsGetter;
- this._selection = new _selection2.default({
- allowNullValue: this._nullValueSelectionSupported(),
- mode: this.option("selectionMode"),
- maxFilterLengthInRequest: this.option("maxFilterLengthInRequest"),
- equalByReference: !this._isKeySpecified(),
- onSelectionChanged: function(args) {
- if (args.addedItemKeys.length || args.removedItemKeys.length) {
- that.option("selectedItems", that._getItemsByKeys(args.selectedItemKeys, args.selectedItems));
- that._updateSelectedItems(args)
- }
- },
- filter: that._getCombinedFilter.bind(that),
- totalCount: function() {
- var items = that.option("items");
- var dataSource = that._dataSource;
- return dataSource && dataSource.totalCount() >= 0 ? dataSource.totalCount() : items.length
- },
- key: that.key.bind(that),
- keyOf: that.keyOf.bind(that),
- load: function(options) {
- if (that._dataSource) {
- var loadOptions = that._dataSource.loadOptions();
- options.customQueryParams = loadOptions.customQueryParams;
- options.userData = that._dataSource._userData
- }
- var store = that._dataSource && that._dataSource.store();
- if (store) {
- return store.load(options).done(function(loadResult) {
- if (that._disposed) {
- return
- }
- var items = (0, _data_source.normalizeLoadResult)(loadResult).data;
- that._dataSource._applyMapFunction(items)
- })
- } else {
- return (new _deferred.Deferred).resolve(this.plainItems())
- }
- },
- dataFields: function() {
- return that._dataSource && that._dataSource.select()
- },
- plainItems: itemsGetter.bind(that._editStrategy)
- })
- },
- _initEditStrategy: function() {
- var Strategy = _uiCollection_widgetEditStrategy2.default;
- this._editStrategy = new Strategy(this)
- },
- _getSelectedItemIndices: function(keys) {
- var that = this;
- var indices = [];
- keys = keys || this._selection.getSelectedItemKeys();
- that._editStrategy.beginCache();
- (0, _iterator.each)(keys, function(_, key) {
- var selectedIndex = that._getIndexByKey(key);
- if (indexExists(selectedIndex)) {
- indices.push(selectedIndex)
- }
- });
- that._editStrategy.endCache();
- return indices
- },
- _initMarkup: function() {
- var _this = this;
- this._rendering = true;
- if (!this._dataSource || !this._dataSource.isLoading()) {
- this._syncSelectionOptions().done(function() {
- return _this._normalizeSelectedItems()
- })
- }
- this.callBase()
- },
- _render: function() {
- this.callBase();
- this._rendering = false
- },
- _fireContentReadyAction: function() {
- this._rendering = false;
- this._rendered = true;
- this.callBase.apply(this, arguments)
- },
- _syncSelectionOptions: function(byOption) {
- byOption = byOption || this._chooseSelectOption();
- var selectedItem;
- var selectedIndex;
- var selectedItemKeys;
- var selectedItems;
- switch (byOption) {
- case "selectedIndex":
- selectedItem = this._editStrategy.getItemDataByIndex(this.option("selectedIndex"));
- if ((0, _type.isDefined)(selectedItem)) {
- this._setOptionSilent("selectedItems", [selectedItem]);
- this._setOptionSilent("selectedItem", selectedItem);
- this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem]))
- } else {
- this._setOptionSilent("selectedItems", []);
- this._setOptionSilent("selectedItemKeys", []);
- this._setOptionSilent("selectedItem", null)
- }
- break;
- case "selectedItems":
- selectedItems = this.option("selectedItems") || [];
- selectedIndex = this._editStrategy.getIndexByItemData(selectedItems[0]);
- if (this.option("selectionRequired") && !indexExists(selectedIndex)) {
- return this._syncSelectionOptions("selectedIndex")
- }
- this._setOptionSilent("selectedItem", selectedItems[0]);
- this._setOptionSilent("selectedIndex", selectedIndex);
- this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems(selectedItems));
- break;
- case "selectedItem":
- selectedItem = this.option("selectedItem");
- selectedIndex = this._editStrategy.getIndexByItemData(selectedItem);
- if (this.option("selectionRequired") && !indexExists(selectedIndex)) {
- return this._syncSelectionOptions("selectedIndex")
- }
- if ((0, _type.isDefined)(selectedItem)) {
- this._setOptionSilent("selectedItems", [selectedItem]);
- this._setOptionSilent("selectedIndex", selectedIndex);
- this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem]))
- } else {
- this._setOptionSilent("selectedItems", []);
- this._setOptionSilent("selectedItemKeys", []);
- this._setOptionSilent("selectedIndex", NOT_EXISTING_INDEX)
- }
- break;
- case "selectedItemKeys":
- selectedItemKeys = this.option("selectedItemKeys");
- if (this.option("selectionRequired")) {
- var selectedItemIndex = this._getIndexByKey(selectedItemKeys[0]);
- if (!indexExists(selectedItemIndex)) {
- return this._syncSelectionOptions("selectedIndex")
- }
- }
- return this._selection.setSelection(selectedItemKeys)
- }
- return (new _deferred.Deferred).resolve().promise()
- },
- _chooseSelectOption: function() {
- var optionName = "selectedIndex";
- var isOptionDefined = function(optionName) {
- var optionValue = this.option(optionName);
- var length = (0, _type.isDefined)(optionValue) && optionValue.length;
- return length || optionName in this._userOptions
- }.bind(this);
- if (isOptionDefined("selectedItems")) {
- optionName = "selectedItems"
- } else {
- if (isOptionDefined("selectedItem")) {
- optionName = "selectedItem"
- } else {
- if (isOptionDefined("selectedItemKeys")) {
- optionName = "selectedItemKeys"
- }
- }
- }
- return optionName
- },
- _compareKeys: function(oldKeys, newKeys) {
- if (oldKeys.length !== newKeys.length) {
- return false
- }
- for (var i = 0; i < newKeys.length; i++) {
- if (oldKeys[i] !== newKeys[i]) {
- return false
- }
- }
- return true
- },
- _normalizeSelectedItems: function() {
- if ("none" === this.option("selectionMode")) {
- this._setOptionSilent("selectedItems", []);
- this._syncSelectionOptions("selectedItems")
- } else {
- if ("single" === this.option("selectionMode")) {
- var newSelection = this.option("selectedItems");
- if (newSelection.length > 1 || !newSelection.length && this.option("selectionRequired") && this.option("items") && this.option("items").length) {
- var currentSelection = this._selection.getSelectedItems();
- var normalizedSelection = void 0 === newSelection[0] ? currentSelection[0] : newSelection[0];
- if (void 0 === normalizedSelection) {
- normalizedSelection = this._editStrategy.itemsGetter()[0]
- }
- if (this.option("grouped") && normalizedSelection && normalizedSelection.items) {
- normalizedSelection.items = [normalizedSelection.items[0]]
- }
- this._selection.setSelection(this._getKeysByItems([normalizedSelection]));
- this._setOptionSilent("selectedItems", [normalizedSelection]);
- return this._syncSelectionOptions("selectedItems")
- } else {
- this._selection.setSelection(this._getKeysByItems(newSelection))
- }
- } else {
- var newKeys = this._getKeysByItems(this.option("selectedItems"));
- var oldKeys = this._selection.getSelectedItemKeys();
- if (!this._compareKeys(oldKeys, newKeys)) {
- this._selection.setSelection(newKeys)
- }
- }
- }
- return (new _deferred.Deferred).resolve().promise()
- },
- _itemClickHandler: function(e) {
- this._createAction(function(e) {
- this._itemSelectHandler(e.event)
- }.bind(this), {
- validatingTargetName: "itemElement"
- })({
- itemElement: (0, _renderer2.default)(e.currentTarget),
- event: e
- });
- this.callBase.apply(this, arguments)
- },
- _itemSelectHandler: function(e) {
- if (!this.option("selectionByClick")) {
- return
- }
- var $itemElement = e.currentTarget;
- if (this.isItemSelected($itemElement)) {
- this.unselectItem(e.currentTarget)
- } else {
- this.selectItem(e.currentTarget)
- }
- },
- _selectedItemElement: function(index) {
- return this._itemElements().eq(index)
- },
- _postprocessRenderItem: function(args) {
- if ("none" !== this.option("selectionMode")) {
- var $itemElement = (0, _renderer2.default)(args.itemElement);
- var normalizedItemIndex = this._editStrategy.getNormalizedIndex($itemElement);
- var isItemSelected = this._isItemSelected(normalizedItemIndex);
- this._processSelectableItem($itemElement, isItemSelected)
- }
- },
- _processSelectableItem: function($itemElement, isSelected) {
- $itemElement.toggleClass(this._selectedItemClass(), isSelected);
- this._setAriaSelected($itemElement, String(isSelected))
- },
- _updateSelectedItems: function(args) {
- var that = this;
- var addedItemKeys = args.addedItemKeys;
- var removedItemKeys = args.removedItemKeys;
- if (that._rendered && (addedItemKeys.length || removedItemKeys.length)) {
- var selectionChangePromise = that._selectionChangePromise;
- if (!that._rendering) {
- var addedSelection = [];
- var normalizedIndex;
- var removedSelection = [];
- that._editStrategy.beginCache();
- for (var i = 0; i < addedItemKeys.length; i++) {
- normalizedIndex = that._getIndexByKey(addedItemKeys[i]);
- addedSelection.push(normalizedIndex);
- that._addSelection(normalizedIndex)
- }
- for (var _i = 0; _i < removedItemKeys.length; _i++) {
- normalizedIndex = that._getIndexByKey(removedItemKeys[_i]);
- removedSelection.push(normalizedIndex);
- that._removeSelection(normalizedIndex)
- }
- that._editStrategy.endCache();
- that._updateSelection(addedSelection, removedSelection)
- }(0, _deferred.when)(selectionChangePromise).done(function() {
- that._fireSelectionChangeEvent(args.addedItems, args.removedItems)
- })
- }
- },
- _fireSelectionChangeEvent: function(addedItems, removedItems) {
- this._createActionByOption("onSelectionChanged", {
- excludeValidators: ["disabled", "readOnly"]
- })({
- addedItems: addedItems,
- removedItems: removedItems
- })
- },
- _updateSelection: _common.noop,
- _setAriaSelected: function($target, value) {
- this.setAria("selected", value, $target)
- },
- _removeSelection: function(normalizedIndex) {
- var $itemElement = this._editStrategy.getItemElement(normalizedIndex);
- if (indexExists(normalizedIndex)) {
- this._processSelectableItem($itemElement, false);
- _events_engine2.default.triggerHandler($itemElement, "stateChanged", false)
- }
- },
- _showDeprecatedSelectionMode: function() {
- _ui2.default.log("W0001", this.NAME, "selectionMode: 'multi'", "16.1", "Use selectionMode: 'multiple' instead");
- this.option("selectionMode", "multiple")
- },
- _addSelection: function(normalizedIndex) {
- var $itemElement = this._editStrategy.getItemElement(normalizedIndex);
- if (indexExists(normalizedIndex)) {
- this._processSelectableItem($itemElement, true);
- _events_engine2.default.triggerHandler($itemElement, "stateChanged", true)
- }
- },
- _isItemSelected: function(index) {
- var key = this._getKeyByIndex(index);
- return this._selection.isItemSelected(key)
- },
- _optionChanged: function(args) {
- var _this2 = this;
- switch (args.name) {
- case "selectionMode":
- if ("multi" === args.value) {
- this._showDeprecatedSelectionMode()
- } else {
- this._invalidate()
- }
- break;
- case "dataSource":
- if (!args.value || Array.isArray(args.value) && !args.value.length) {
- this.option("selectedItemKeys", [])
- }
- this.callBase(args);
- break;
- case "selectedIndex":
- case "selectedItem":
- case "selectedItems":
- case "selectedItemKeys":
- this._syncSelectionOptions(args.name).done(function() {
- return _this2._normalizeSelectedItems()
- });
- break;
- case "keyExpr":
- this._initKeyGetter();
- break;
- case "selectionRequired":
- this._normalizeSelectedItems();
- break;
- case "selectionByClick":
- case "onSelectionChanged":
- case "onItemDeleting":
- case "onItemDeleted":
- case "onItemReordered":
- case "maxFilterLengthInRequest":
- break;
- default:
- this.callBase(args)
- }
- },
- _clearSelectedItems: function() {
- this._setOptionSilent("selectedItems", []);
- this._syncSelectionOptions("selectedItems")
- },
- _waitDeletingPrepare: function($itemElement) {
- if ($itemElement.data(ITEM_DELETING_DATA_KEY)) {
- return (new _deferred.Deferred).resolve().promise()
- }
- $itemElement.data(ITEM_DELETING_DATA_KEY, true);
- var deferred = new _deferred.Deferred;
- var deletingActionArgs = {
- cancel: false
- };
- var deletePromise = this._itemEventHandler($itemElement, "onItemDeleting", deletingActionArgs, {
- excludeValidators: ["disabled", "readOnly"]
- });
- (0, _deferred.when)(deletePromise).always(function(value) {
- var deletePromiseExists = !deletePromise;
- var deletePromiseResolved = !deletePromiseExists && "resolved" === deletePromise.state();
- var argumentsSpecified = !!arguments.length;
- var shouldDelete = deletePromiseExists || deletePromiseResolved && !argumentsSpecified || deletePromiseResolved && value;
- (0, _deferred.when)((0, _deferred.fromPromise)(deletingActionArgs.cancel)).always(function() {
- $itemElement.data(ITEM_DELETING_DATA_KEY, false)
- }).done(function(cancel) {
- shouldDelete && !cancel ? deferred.resolve() : deferred.reject()
- }).fail(deferred.reject)
- }.bind(this));
- return deferred.promise()
- },
- _deleteItemFromDS: function($item) {
- if (!this._dataSource) {
- return (new _deferred.Deferred).resolve().promise()
- }
- var deferred = new _deferred.Deferred;
- var disabledState = this.option("disabled");
- var dataStore = this._dataSource.store();
- this.option("disabled", true);
- if (!dataStore.remove) {
- throw _ui2.default.Error("E1011")
- }
- dataStore.remove(dataStore.keyOf(this._getItemData($item))).done(function(key) {
- if (void 0 !== key) {
- deferred.resolve()
- } else {
- deferred.reject()
- }
- }).fail(function() {
- deferred.reject()
- });
- deferred.always(function() {
- this.option("disabled", disabledState)
- }.bind(this));
- return deferred
- },
- _tryRefreshLastPage: function() {
- var deferred = new _deferred.Deferred;
- if (this._isLastPage() || this.option("grouped")) {
- deferred.resolve()
- } else {
- this._refreshLastPage().done(function() {
- deferred.resolve()
- })
- }
- return deferred.promise()
- },
- _refreshLastPage: function() {
- this._expectLastItemLoading();
- return this._dataSource.load()
- },
- _updateSelectionAfterDelete: function(index) {
- var key = this._getKeyByIndex(index);
- this._selection.deselect([key])
- },
- _updateIndicesAfterIndex: function(index) {
- var itemElements = this._itemElements();
- for (var i = index + 1; i < itemElements.length; i++) {
- (0, _renderer2.default)(itemElements[i]).data(this._itemIndexKey(), i - 1)
- }
- },
- _simulateOptionChange: function(optionName) {
- var optionValue = this.option(optionName);
- if (optionValue instanceof _data_source.DataSource) {
- return
- }
- this._optionChangedAction({
- name: optionName,
- fullName: optionName,
- value: optionValue
- })
- },
- isItemSelected: function(itemElement) {
- return this._isItemSelected(this._editStrategy.getNormalizedIndex(itemElement))
- },
- selectItem: function(itemElement) {
- if ("none" === this.option("selectionMode")) {
- return
- }
- var itemIndex = this._editStrategy.getNormalizedIndex(itemElement);
- if (!indexExists(itemIndex)) {
- return
- }
- var key = this._getKeyByIndex(itemIndex);
- if (this._selection.isItemSelected(key)) {
- return
- }
- if ("single" === this.option("selectionMode")) {
- this._selection.setSelection([key])
- } else {
- var selectedItemKeys = this.option("selectedItemKeys") || [];
- this._selection.setSelection([].concat(_toConsumableArray(selectedItemKeys), [key]))
- }
- },
- unselectItem: function(itemElement) {
- var itemIndex = this._editStrategy.getNormalizedIndex(itemElement);
- if (!indexExists(itemIndex)) {
- return
- }
- var selectedItemKeys = this._selection.getSelectedItemKeys();
- if (this.option("selectionRequired") && selectedItemKeys.length <= 1) {
- return
- }
- var key = this._getKeyByIndex(itemIndex);
- if (!this._selection.isItemSelected(key)) {
- return
- }
- this._selection.deselect([key])
- },
- _deleteItemElementByIndex: function(index) {
- this._updateSelectionAfterDelete(index);
- this._updateIndicesAfterIndex(index);
- this._editStrategy.deleteItemAtIndex(index)
- },
- _afterItemElementDeleted: function($item, deletedActionArgs) {
- var changingOption = this._dataSource ? "dataSource" : "items";
- this._simulateOptionChange(changingOption);
- this._itemEventHandler($item, "onItemDeleted", deletedActionArgs, {
- beforeExecute: function() {
- $item.remove()
- },
- excludeValidators: ["disabled", "readOnly"]
- });
- this._renderEmptyMessage()
- },
- deleteItem: function(itemElement) {
- var that = this;
- var deferred = new _deferred.Deferred;
- var $item = this._editStrategy.getItemElement(itemElement);
- var index = this._editStrategy.getNormalizedIndex(itemElement);
- var itemResponseWaitClass = this._itemResponseWaitClass();
- if (indexExists(index)) {
- this._waitDeletingPrepare($item).done(function() {
- $item.addClass(itemResponseWaitClass);
- var deletedActionArgs = that._extendActionArgs($item);
- that._deleteItemFromDS($item).done(function() {
- that._deleteItemElementByIndex(index);
- that._afterItemElementDeleted($item, deletedActionArgs);
- that._tryRefreshLastPage().done(function() {
- deferred.resolveWith(that)
- })
- }).fail(function() {
- $item.removeClass(itemResponseWaitClass);
- deferred.rejectWith(that)
- })
- }).fail(function() {
- deferred.rejectWith(that)
- })
- } else {
- deferred.rejectWith(that)
- }
- return deferred.promise()
- },
- reorderItem: function(itemElement, toItemElement) {
- var deferred = new _deferred.Deferred;
- var that = this;
- var strategy = this._editStrategy;
- var $movingItem = strategy.getItemElement(itemElement);
- var $destinationItem = strategy.getItemElement(toItemElement);
- var movingIndex = strategy.getNormalizedIndex(itemElement);
- var destinationIndex = strategy.getNormalizedIndex(toItemElement);
- var changingOption = this._dataSource ? "dataSource" : "items";
- var canMoveItems = indexExists(movingIndex) && indexExists(destinationIndex) && movingIndex !== destinationIndex;
- if (canMoveItems) {
- deferred.resolveWith(this)
- } else {
- deferred.rejectWith(this)
- }
- return deferred.promise().done(function() {
- $destinationItem[strategy.itemPlacementFunc(movingIndex, destinationIndex)]($movingItem);
- strategy.moveItemAtIndexToIndex(movingIndex, destinationIndex);
- this._updateIndicesAfterIndex(movingIndex);
- that.option("selectedItems", that._getItemsByKeys(that._selection.getSelectedItemKeys(), that._selection.getSelectedItems()));
- if ("items" === changingOption) {
- that._simulateOptionChange(changingOption)
- }
- that._itemEventHandler($movingItem, "onItemReordered", {
- fromIndex: strategy.getIndex(movingIndex),
- toIndex: strategy.getIndex(destinationIndex)
- }, {
- excludeValidators: ["disabled", "readOnly"]
- })
- })
- }
- });
- module.exports = CollectionWidget
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/core/utils/dependency_injector.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = function(object) {
- var extend = __webpack_require__( /*! ./extend */ 0).extend;
- var isFunction = __webpack_require__( /*! ./type */ 1).isFunction;
- var each = __webpack_require__( /*! ./iterator */ 3).each;
- var Class = __webpack_require__( /*! ../class */ 15);
- var BaseClass = Class.inherit(object);
- var InjectedClass = BaseClass;
- var instance = new InjectedClass(object);
- var initialFields = {};
- var injectFields = function(injectionObject, initial) {
- each(injectionObject, function(key) {
- if (isFunction(instance[key])) {
- if (initial || !object[key]) {
- object[key] = function() {
- return instance[key].apply(object, arguments)
- }
- }
- } else {
- if (initial) {
- initialFields[key] = object[key]
- }
- object[key] = instance[key]
- }
- })
- };
- injectFields(object, true);
- object.inject = function(injectionObject) {
- InjectedClass = InjectedClass.inherit(injectionObject);
- instance = new InjectedClass;
- injectFields(injectionObject)
- };
- object.resetInjection = function() {
- extend(object, initialFields);
- InjectedClass = BaseClass;
- instance = new BaseClass
- };
- return object
- }
- },
- /*!********************************!*\
- !*** external "window.jQuery" ***!
- \********************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports) {
- module.exports = window.jQuery
- },
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/events/drag.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
- var wrapToArray = __webpack_require__( /*! ../core/utils/array */ 14).wrapToArray;
- var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
- var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var contains = __webpack_require__( /*! ../core/utils/dom */ 12).contains;
- var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 158);
- var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
- var DRAG_START_EVENT = "dxdragstart";
- var DRAG_EVENT = "dxdrag";
- var DRAG_END_EVENT = "dxdragend";
- var DRAG_ENTER_EVENT = "dxdragenter";
- var DRAG_LEAVE_EVENT = "dxdragleave";
- var DROP_EVENT = "dxdrop";
- var DX_DRAG_EVENTS_COUNT_KEY = "dxDragEventsCount";
- var knownDropTargets = [];
- var knownDropTargetSelectors = [];
- var knownDropTargetConfigs = [];
- var dropTargetRegistration = {
- setup: function(element, data) {
- var knownDropTarget = inArray(element, knownDropTargets) !== -1;
- if (!knownDropTarget) {
- knownDropTargets.push(element);
- knownDropTargetSelectors.push([]);
- knownDropTargetConfigs.push(data || {})
- }
- },
- add: function(element, handleObj) {
- var index = inArray(element, knownDropTargets);
- this.updateEventsCounter(element, handleObj.type, 1);
- var selector = handleObj.selector;
- if (inArray(selector, knownDropTargetSelectors[index]) === -1) {
- knownDropTargetSelectors[index].push(selector)
- }
- },
- updateEventsCounter: function(element, event, value) {
- if ([DRAG_ENTER_EVENT, DRAG_LEAVE_EVENT, DROP_EVENT].indexOf(event) > -1) {
- var eventsCount = dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY) || 0;
- dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY, Math.max(0, eventsCount + value))
- }
- },
- remove: function(element, handleObj) {
- this.updateEventsCounter(element, handleObj.type, -1)
- },
- teardown: function(element) {
- var handlersCount = dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY);
- if (!handlersCount) {
- var index = inArray(element, knownDropTargets);
- knownDropTargets.splice(index, 1);
- knownDropTargetSelectors.splice(index, 1);
- knownDropTargetConfigs.splice(index, 1);
- dataUtils.removeData(element, DX_DRAG_EVENTS_COUNT_KEY)
- }
- }
- };
- registerEvent(DRAG_ENTER_EVENT, dropTargetRegistration);
- registerEvent(DRAG_LEAVE_EVENT, dropTargetRegistration);
- registerEvent(DROP_EVENT, dropTargetRegistration);
- var getItemDelegatedTargets = function($element) {
- var dropTargetIndex = inArray($element.get(0), knownDropTargets);
- var dropTargetSelectors = knownDropTargetSelectors[dropTargetIndex];
- var $delegatedTargets = $element.find(dropTargetSelectors.join(", "));
- if (inArray(void 0, dropTargetSelectors) !== -1) {
- $delegatedTargets = $delegatedTargets.add($element)
- }
- return $delegatedTargets
- };
- var getItemConfig = function($element) {
- var dropTargetIndex = inArray($element.get(0), knownDropTargets);
- return knownDropTargetConfigs[dropTargetIndex]
- };
- var getItemPosition = function(dropTargetConfig, $element) {
- if (dropTargetConfig.itemPositionFunc) {
- return dropTargetConfig.itemPositionFunc($element)
- } else {
- return $element.offset()
- }
- };
- var getItemSize = function(dropTargetConfig, $element) {
- if (dropTargetConfig.itemSizeFunc) {
- return dropTargetConfig.itemSizeFunc($element)
- }
- return {
- width: $element.get(0).getBoundingClientRect().width,
- height: $element.get(0).getBoundingClientRect().height
- }
- };
- var DragEmitter = GestureEmitter.inherit({
- ctor: function(element) {
- this.callBase(element);
- this.direction = "both"
- },
- _init: function(e) {
- this._initEvent = e
- },
- _start: function(e) {
- e = this._fireEvent(DRAG_START_EVENT, this._initEvent);
- this._maxLeftOffset = e.maxLeftOffset;
- this._maxRightOffset = e.maxRightOffset;
- this._maxTopOffset = e.maxTopOffset;
- this._maxBottomOffset = e.maxBottomOffset;
- var dropTargets = wrapToArray(e.targetElements || (null === e.targetElements ? [] : knownDropTargets));
- this._dropTargets = iteratorUtils.map(dropTargets, function(element) {
- return $(element).get(0)
- })
- },
- _move: function(e) {
- var eventData = eventUtils.eventData(e);
- var dragOffset = this._calculateOffset(eventData);
- e = this._fireEvent(DRAG_EVENT, e, {
- offset: dragOffset
- });
- this._processDropTargets(e);
- if (!e._cancelPreventDefault) {
- e.preventDefault()
- }
- },
- _calculateOffset: function(eventData) {
- return {
- x: this._calculateXOffset(eventData),
- y: this._calculateYOffset(eventData)
- }
- },
- _calculateXOffset: function(eventData) {
- if ("vertical" !== this.direction) {
- var offset = eventData.x - this._startEventData.x;
- return this._fitOffset(offset, this._maxLeftOffset, this._maxRightOffset)
- }
- return 0
- },
- _calculateYOffset: function(eventData) {
- if ("horizontal" !== this.direction) {
- var offset = eventData.y - this._startEventData.y;
- return this._fitOffset(offset, this._maxTopOffset, this._maxBottomOffset)
- }
- return 0
- },
- _fitOffset: function(offset, minOffset, maxOffset) {
- if (null != minOffset) {
- offset = Math.max(offset, -minOffset)
- }
- if (null != maxOffset) {
- offset = Math.min(offset, maxOffset)
- }
- return offset
- },
- _processDropTargets: function(e) {
- var target = this._findDropTarget(e);
- var sameTarget = target === this._currentDropTarget;
- if (!sameTarget) {
- this._fireDropTargetEvent(e, DRAG_LEAVE_EVENT);
- this._currentDropTarget = target;
- this._fireDropTargetEvent(e, DRAG_ENTER_EVENT)
- }
- },
- _fireDropTargetEvent: function(event, eventName) {
- if (!this._currentDropTarget) {
- return
- }
- var eventData = {
- type: eventName,
- originalEvent: event,
- draggingElement: this._$element.get(0),
- target: this._currentDropTarget
- };
- eventUtils.fireEvent(eventData)
- },
- _findDropTarget: function(e) {
- var that = this;
- var result;
- iteratorUtils.each(knownDropTargets, function(_, target) {
- if (!that._checkDropTargetActive(target)) {
- return
- }
- var $target = $(target);
- iteratorUtils.each(getItemDelegatedTargets($target), function(_, delegatedTarget) {
- var $delegatedTarget = $(delegatedTarget);
- if (that._checkDropTarget(getItemConfig($target), $delegatedTarget, e)) {
- result = delegatedTarget
- }
- })
- });
- return result
- },
- _checkDropTargetActive: function(target) {
- var active = false;
- iteratorUtils.each(this._dropTargets, function(_, activeTarget) {
- active = active || activeTarget === target || contains(activeTarget, target);
- return !active
- });
- return active
- },
- _checkDropTarget: function(config, $target, e) {
- var isDraggingElement = $target.get(0) === this._$element.get(0);
- if (isDraggingElement) {
- return false
- }
- var targetPosition = getItemPosition(config, $target);
- if (e.pageX < targetPosition.left) {
- return false
- }
- if (e.pageY < targetPosition.top) {
- return false
- }
- var targetSize = getItemSize(config, $target);
- if (e.pageX > targetPosition.left + targetSize.width) {
- return false
- }
- if (e.pageY > targetPosition.top + targetSize.height) {
- return false
- }
- return $target
- },
- _end: function(e) {
- var eventData = eventUtils.eventData(e);
- this._fireEvent(DRAG_END_EVENT, e, {
- offset: this._calculateOffset(eventData)
- });
- this._fireDropTargetEvent(e, DROP_EVENT);
- delete this._currentDropTarget
- }
- });
- registerEmitter({
- emitter: DragEmitter,
- events: [DRAG_START_EVENT, DRAG_EVENT, DRAG_END_EVENT]
- });
- exports.dropTargets = knownDropTargets;
- exports.move = DRAG_EVENT;
- exports.start = DRAG_START_EVENT;
- exports.end = DRAG_END_EVENT;
- exports.enter = DRAG_ENTER_EVENT;
- exports.leave = DRAG_LEAVE_EVENT;
- exports.drop = DROP_EVENT
- }, ,
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/core/utils/ajax.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Deferred = __webpack_require__( /*! ./deferred */ 6).Deferred;
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var httpRequest = __webpack_require__( /*! ../../core/http_request */ 439);
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var extendFromObject = __webpack_require__( /*! ./extend */ 0).extendFromObject;
- var isDefined = __webpack_require__( /*! ./type */ 1).isDefined;
- var Promise = __webpack_require__( /*! ../polyfills/promise */ 76);
- var injector = __webpack_require__( /*! ./dependency_injector */ 54);
- var SUCCESS = "success";
- var ERROR = "error";
- var TIMEOUT = "timeout";
- var NO_CONTENT = "nocontent";
- var PARSER_ERROR = "parsererror";
- var isStatusSuccess = function(status) {
- return 200 <= status && status < 300
- };
- var hasContent = function(status) {
- return 204 !== status
- };
- var paramsConvert = function(params) {
- var result = [];
- for (var name in params) {
- var value = params[name];
- if (void 0 === value) {
- continue
- }
- if (null === value) {
- value = ""
- }
- result.push(encodeURIComponent(name) + "=" + encodeURIComponent(value))
- }
- return result.join("&")
- };
- var createScript = function(options) {
- var script = domAdapter.createElement("script");
- for (var name in options) {
- script[name] = options[name]
- }
- return script
- };
- var removeScript = function(scriptNode) {
- scriptNode.parentNode.removeChild(scriptNode)
- };
- var appendToHead = function(element) {
- return domAdapter.getHead().appendChild(element)
- };
- var evalScript = function(code) {
- var script = createScript({
- text: code
- });
- appendToHead(script);
- removeScript(script)
- };
- var evalCrossDomainScript = function(url) {
- var script = createScript({
- src: url
- });
- return new Promise(function(resolve, reject) {
- var events = {
- load: resolve,
- error: reject
- };
- var loadHandler = function(e) {
- events[e.type]();
- removeScript(script)
- };
- for (var event in events) {
- domAdapter.listen(script, event, loadHandler)
- }
- appendToHead(script)
- })
- };
- var getAcceptHeader = function(options) {
- var dataType = options.dataType || "*";
- var scriptAccept = "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript";
- var accepts = {
- "*": "*/*",
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript",
- jsonp: scriptAccept,
- script: scriptAccept
- };
- extendFromObject(accepts, options.accepts, true);
- return accepts[dataType] ? accepts[dataType] + ("*" !== dataType ? ", */*; q=0.01" : "") : accepts["*"]
- };
- var getContentTypeHeader = function(options) {
- var defaultContentType;
- if (options.data && !options.upload && "GET" !== getMethod(options)) {
- defaultContentType = "application/x-www-form-urlencoded;charset=utf-8"
- }
- return options.contentType || defaultContentType
- };
- var getDataFromResponse = function(xhr) {
- return xhr.responseType && "text" !== xhr.responseType || "string" !== typeof xhr.responseText ? xhr.response : xhr.responseText
- };
- var postProcess = function(deferred, xhr, dataType) {
- var data = getDataFromResponse(xhr);
- switch (dataType) {
- case "jsonp":
- evalScript(data);
- break;
- case "script":
- evalScript(data);
- deferred.resolve(data, SUCCESS, xhr);
- break;
- case "json":
- try {
- deferred.resolve(JSON.parse(data), SUCCESS, xhr)
- } catch (e) {
- deferred.reject(xhr, PARSER_ERROR, e)
- }
- break;
- default:
- deferred.resolve(data, SUCCESS, xhr)
- }
- };
- var isCrossDomain = function(url) {
- if (!windowUtils.hasWindow()) {
- return true
- }
- var crossDomain = false;
- var originAnchor = domAdapter.createElement("a");
- var urlAnchor = domAdapter.createElement("a");
- originAnchor.href = window.location.href;
- try {
- urlAnchor.href = url;
- urlAnchor.href = urlAnchor.href;
- crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host
- } catch (e) {
- crossDomain = true
- }
- return crossDomain
- };
- var setHttpTimeout = function(timeout, xhr) {
- return timeout && setTimeout(function() {
- xhr.customStatus = TIMEOUT;
- xhr.abort()
- }, timeout)
- };
- var getJsonpOptions = function(options) {
- if ("jsonp" === options.dataType) {
- var random = Math.random().toString().replace(/\D/g, "");
- var callbackName = options.jsonpCallback || "dxCallback" + Date.now() + "_" + random;
- var callbackParameter = options.jsonp || "callback";
- options.data = options.data || {};
- options.data[callbackParameter] = callbackName;
- return callbackName
- }
- };
- var getRequestOptions = function(options, headers) {
- var params = options.data;
- var paramsAlreadyString = "string" === typeof params;
- var url = options.url || window.location.href;
- if (!paramsAlreadyString && !options.cache) {
- params = params || {};
- params._ = Date.now()
- }
- if (params && !options.upload) {
- if (!paramsAlreadyString) {
- params = paramsConvert(params)
- }
- if ("GET" === getMethod(options)) {
- if ("" !== params) {
- url += (url.indexOf("?") > -1 ? "&" : "?") + params
- }
- params = null
- } else {
- if (headers["Content-Type"] && headers["Content-Type"].indexOf("application/x-www-form-urlencoded") > -1) {
- params = params.replace(/%20/g, "+")
- }
- }
- }
- return {
- url: url,
- parameters: params
- }
- };
- var getMethod = function(options) {
- return (options.method || "GET").toUpperCase()
- };
- var getRequestHeaders = function(options) {
- var headers = options.headers || {};
- headers["Content-Type"] = headers["Content-Type"] || getContentTypeHeader(options);
- headers.Accept = headers.Accept || getAcceptHeader(options);
- if (!options.crossDomain && !headers["X-Requested-With"]) {
- headers["X-Requested-With"] = "XMLHttpRequest"
- }
- return headers
- };
- var sendRequest = function(options) {
- var xhr = httpRequest.getXhr();
- var d = new Deferred;
- var result = d.promise();
- var async = isDefined(options.async) ? options.async : true;
- var dataType = options.dataType;
- var timeout = options.timeout || 0;
- var timeoutId;
- options.crossDomain = isCrossDomain(options.url);
- var needScriptEvaluation = "jsonp" === dataType || "script" === dataType;
- if (void 0 === options.cache) {
- options.cache = !needScriptEvaluation
- }
- var callbackName = getJsonpOptions(options);
- var headers = getRequestHeaders(options);
- var requestOptions = getRequestOptions(options, headers);
- var url = requestOptions.url;
- var parameters = requestOptions.parameters;
- if (callbackName) {
- window[callbackName] = function(data) {
- d.resolve(data, SUCCESS, xhr)
- }
- }
- if (options.crossDomain && needScriptEvaluation) {
- var reject = function() {
- d.reject(xhr, ERROR)
- };
- var resolve = function() {
- if ("jsonp" === dataType) {
- return
- }
- d.resolve(null, SUCCESS, xhr)
- };
- evalCrossDomainScript(url).then(resolve, reject);
- return result
- }
- if (options.crossDomain && !("withCredentials" in xhr)) {
- d.reject(xhr, ERROR);
- return result
- }
- xhr.open(getMethod(options), url, async, options.username, options.password);
- if (async) {
- xhr.timeout = timeout;
- timeoutId = setHttpTimeout(timeout, xhr, d)
- }
- xhr.onreadystatechange = function(e) {
- if (4 === xhr.readyState) {
- clearTimeout(timeoutId);
- if (isStatusSuccess(xhr.status)) {
- if (hasContent(xhr.status)) {
- postProcess(d, xhr, dataType)
- } else {
- d.resolve(null, NO_CONTENT, xhr)
- }
- } else {
- d.reject(xhr, xhr.customStatus || ERROR)
- }
- }
- };
- if (options.upload) {
- xhr.upload.onprogress = options.upload.onprogress;
- xhr.upload.onloadstart = options.upload.onloadstart;
- xhr.upload.onabort = options.upload.onabort
- }
- if (options.xhrFields) {
- for (var field in options.xhrFields) {
- xhr[field] = options.xhrFields[field]
- }
- }
- if ("arraybuffer" === options.responseType) {
- xhr.responseType = options.responseType
- }
- for (var name in headers) {
- if (Object.prototype.hasOwnProperty.call(headers, name) && isDefined(headers[name])) {
- xhr.setRequestHeader(name, headers[name])
- }
- }
- if (options.beforeSend) {
- options.beforeSend(xhr)
- }
- xhr.send(parameters);
- result.abort = function() {
- xhr.abort()
- };
- return result
- };
- module.exports = injector({
- sendRequest: sendRequest
- })
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/ui/overlay.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./overlay/ui.overlay */ 464)
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/core/utils/icon.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var ICON_CLASS = "dx-icon";
- var SVG_ICON_CLASS = "dx-svg-icon";
- var getImageSourceType = function(source) {
- if (!source || "string" !== typeof source) {
- return false
- }
- if (/^\s*<svg[^>]*>(.|\r?\n)*?<\/svg>\s*$/i.test(source)) {
- return "svg"
- }
- if (/data:.*base64|\.|[^<\s]\//.test(source)) {
- return "image"
- }
- if (/^[\w-_]+$/.test(source)) {
- return "dxIcon"
- }
- if (/^\s?([\w-_]\s?)+$/.test(source)) {
- return "fontIcon"
- }
- return false
- };
- var getImageContainer = function(source) {
- switch (getImageSourceType(source)) {
- case "image":
- return (0, _renderer2.default)("<img>").attr("src", source).addClass(ICON_CLASS);
- case "fontIcon":
- return (0, _renderer2.default)("<i>").addClass("".concat(ICON_CLASS, " ").concat(source));
- case "dxIcon":
- return (0, _renderer2.default)("<i>").addClass("".concat(ICON_CLASS, " ").concat(ICON_CLASS, "-").concat(source));
- case "svg":
- return (0, _renderer2.default)("<i>").addClass("".concat(ICON_CLASS, " ").concat(SVG_ICON_CLASS)).append(source);
- default:
- return null
- }
- };
- exports.getImageSourceType = getImageSourceType;
- exports.getImageContainer = getImageContainer
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/version.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- exports.compare = function(x, y, maxLevel) {
- function normalizeArg(value) {
- if ("string" === typeof value) {
- return value.split(".")
- }
- if ("number" === typeof value) {
- return [value]
- }
- return value
- }
- x = normalizeArg(x);
- y = normalizeArg(y);
- var length = Math.max(x.length, y.length);
- if (isFinite(maxLevel)) {
- length = Math.min(length, maxLevel)
- }
- for (var i = 0; i < length; i++) {
- var xItem = parseInt(x[i] || 0, 10);
- var yItem = parseInt(y[i] || 0, 10);
- if (xItem < yItem) {
- return -1
- }
- if (xItem > yItem) {
- return 1
- }
- }
- return 0
- }
- },
- /*!****************************!*\
- !*** external "window.ko" ***!
- \****************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports) {
- module.exports = window.ko
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/core/utils/call_once.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var callOnce = function(handler) {
- var result;
- var _wrappedHandler = function() {
- result = handler.apply(this, arguments);
- _wrappedHandler = function() {
- return result
- };
- return result
- };
- return function() {
- return _wrappedHandler.apply(this, arguments)
- }
- };
- module.exports = callOnce
- },
- /*!***********************************************!*\
- !*** ./artifacts/transpiled/format_helper.js ***!
- \***********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ./core/utils/type */ 1);
- var dateUtils = __webpack_require__( /*! ./core/utils/date */ 22);
- var numberLocalization = __webpack_require__( /*! ./localization/number */ 51);
- var dateLocalization = __webpack_require__( /*! ./localization/date */ 32);
- var dependencyInjector = __webpack_require__( /*! ./core/utils/dependency_injector */ 54);
- __webpack_require__( /*! ./localization/currency */ 152);
- module.exports = dependencyInjector({
- format: function(value, _format) {
- var formatIsValid = typeUtils.isString(_format) && "" !== _format || typeUtils.isPlainObject(_format) || typeUtils.isFunction(_format);
- var valueIsValid = typeUtils.isNumeric(value) || typeUtils.isDate(value);
- if (!formatIsValid || !valueIsValid) {
- return typeUtils.isDefined(value) ? value.toString() : ""
- }
- if (typeUtils.isFunction(_format)) {
- return _format(value)
- }
- if (typeUtils.isString(_format)) {
- _format = {
- type: _format
- }
- }
- if (typeUtils.isNumeric(value)) {
- return numberLocalization.format(value, _format)
- }
- if (typeUtils.isDate(value)) {
- return dateLocalization.format(value, _format)
- }
- },
- getTimeFormat: function(showSecond) {
- return showSecond ? "longtime" : "shorttime"
- },
- _normalizeFormat: function(format) {
- if (!Array.isArray(format)) {
- return format
- }
- if (1 === format.length) {
- return format[0]
- }
- return function(date) {
- return format.map(function(formatPart) {
- return dateLocalization.format(date, formatPart)
- }).join(" ")
- }
- },
- getDateFormatByDifferences: function(dateDifferences, intervalFormat) {
- var resultFormat = [];
- var needSpecialSecondFormatter = intervalFormat && dateDifferences.millisecond && !(dateDifferences.year || dateDifferences.month || dateDifferences.day);
- if (needSpecialSecondFormatter) {
- var secondFormatter = function(date) {
- return date.getSeconds() + date.getMilliseconds() / 1e3 + "s"
- };
- resultFormat.push(secondFormatter)
- } else {
- if (dateDifferences.millisecond) {
- resultFormat.push("millisecond")
- }
- }
- if (dateDifferences.hour || dateDifferences.minute || !needSpecialSecondFormatter && dateDifferences.second) {
- resultFormat.unshift(this.getTimeFormat(dateDifferences.second))
- }
- if (dateDifferences.year && dateDifferences.month && dateDifferences.day) {
- if (intervalFormat && "month" === intervalFormat) {
- return "monthandyear"
- } else {
- resultFormat.unshift("shortdate");
- return this._normalizeFormat(resultFormat)
- }
- }
- if (dateDifferences.year && dateDifferences.month) {
- return "monthandyear"
- }
- if (dateDifferences.year && dateDifferences.quarter) {
- return "quarterandyear"
- }
- if (dateDifferences.year) {
- return "year"
- }
- if (dateDifferences.quarter) {
- return "quarter"
- }
- if (dateDifferences.month && dateDifferences.day) {
- if (intervalFormat) {
- var monthDayFormatter = function(date) {
- return dateLocalization.getMonthNames("abbreviated")[date.getMonth()] + " " + dateLocalization.format(date, "day")
- };
- resultFormat.unshift(monthDayFormatter)
- } else {
- resultFormat.unshift("monthandday")
- }
- return this._normalizeFormat(resultFormat)
- }
- if (dateDifferences.month) {
- return "month"
- }
- if (dateDifferences.day) {
- if (intervalFormat) {
- resultFormat.unshift("day")
- } else {
- var dayFormatter = function(date) {
- return dateLocalization.format(date, "dayofweek") + ", " + dateLocalization.format(date, "day")
- };
- resultFormat.unshift(dayFormatter)
- }
- return this._normalizeFormat(resultFormat)
- }
- return this._normalizeFormat(resultFormat)
- },
- getDateFormatByTicks: function(ticks) {
- var maxDiff;
- if (ticks.length > 1) {
- maxDiff = dateUtils.getDatesDifferences(ticks[0], ticks[1]);
- for (var i = 1; i < ticks.length - 1; i++) {
- var currentDiff = dateUtils.getDatesDifferences(ticks[i], ticks[i + 1]);
- if (maxDiff.count < currentDiff.count) {
- maxDiff = currentDiff
- }
- }
- } else {
- maxDiff = {
- year: true,
- month: true,
- day: true,
- hour: ticks[0].getHours() > 0,
- minute: ticks[0].getMinutes() > 0,
- second: ticks[0].getSeconds() > 0,
- millisecond: ticks[0].getMilliseconds() > 0
- }
- }
- var resultFormat = this.getDateFormatByDifferences(maxDiff);
- return resultFormat
- },
- getDateFormatByTickInterval: function(startValue, endValue, tickInterval) {
- var dateUnitInterval;
- var dateDifferencesConverter = {
- week: "day"
- };
- var correctDateDifferences = function(dateDifferences, tickInterval, value) {
- switch (tickInterval) {
- case "year":
- case "quarter":
- dateDifferences.month = value;
- case "month":
- dateDifferences.day = value;
- case "week":
- case "day":
- dateDifferences.hour = value;
- case "hour":
- dateDifferences.minute = value;
- case "minute":
- dateDifferences.second = value;
- case "second":
- dateDifferences.millisecond = value
- }
- };
- var correctDifferencesByMaxDate = function(differences, minDate, maxDate) {
- if (!maxDate.getMilliseconds() && maxDate.getSeconds()) {
- if (maxDate.getSeconds() - minDate.getSeconds() === 1) {
- differences.millisecond = true;
- differences.second = false
- }
- } else {
- if (!maxDate.getSeconds() && maxDate.getMinutes()) {
- if (maxDate.getMinutes() - minDate.getMinutes() === 1) {
- differences.second = true;
- differences.minute = false
- }
- } else {
- if (!maxDate.getMinutes() && maxDate.getHours()) {
- if (maxDate.getHours() - minDate.getHours() === 1) {
- differences.minute = true;
- differences.hour = false
- }
- } else {
- if (!maxDate.getHours() && maxDate.getDate() > 1) {
- if (maxDate.getDate() - minDate.getDate() === 1) {
- differences.hour = true;
- differences.day = false
- }
- } else {
- if (1 === maxDate.getDate() && maxDate.getMonth()) {
- if (maxDate.getMonth() - minDate.getMonth() === 1) {
- differences.day = true;
- differences.month = false
- }
- } else {
- if (!maxDate.getMonth() && maxDate.getFullYear()) {
- if (maxDate.getFullYear() - minDate.getFullYear() === 1) {
- differences.month = true;
- differences.year = false
- }
- }
- }
- }
- }
- }
- }
- };
- tickInterval = typeUtils.isString(tickInterval) ? tickInterval.toLowerCase() : tickInterval;
- var dateDifferences = dateUtils.getDatesDifferences(startValue, endValue);
- if (startValue !== endValue) {
- correctDifferencesByMaxDate(dateDifferences, startValue > endValue ? endValue : startValue, startValue > endValue ? startValue : endValue)
- }
- dateUnitInterval = dateUtils.getDateUnitInterval(dateDifferences);
- correctDateDifferences(dateDifferences, dateUnitInterval, true);
- dateUnitInterval = dateUtils.getDateUnitInterval(tickInterval || "second");
- correctDateDifferences(dateDifferences, dateUnitInterval, false);
- dateDifferences[dateDifferencesConverter[dateUnitInterval] || dateUnitInterval] = true;
- var resultFormat = this.getDateFormatByDifferences(dateDifferences);
- return resultFormat
- }
- })
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/bindable_template.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var removeEvent = __webpack_require__( /*! ../../core/remove_event */ 132);
- var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var isPrimitive = __webpack_require__( /*! ../../core/utils/type */ 1).isPrimitive;
- var watchChanges = function() {
- var start = function(rawData, watchMethod, fields, fieldsMap, callback) {
- var fieldsDispose;
- var globalDispose = globalWatch(rawData, watchMethod, function(dataWithRawFields) {
- fieldsDispose && fieldsDispose();
- if (isPrimitive(dataWithRawFields)) {
- callback(dataWithRawFields);
- return
- }
- fieldsDispose = fieldsWatch(dataWithRawFields, watchMethod, fields, fieldsMap, function(data) {
- callback(data)
- })
- });
- return function() {
- fieldsDispose && fieldsDispose();
- globalDispose && globalDispose()
- }
- };
- var globalWatch = function(data, watchMethod, callback) {
- return watchMethod(function() {
- return data
- }, callback)
- };
- var fieldsWatch = function(data, watchMethod, fields, fieldsMap, callback) {
- var resolvedData = {};
- var missedFields = fields.slice();
- var watchHandlers = iteratorUtils.map(fields, function(name) {
- var fieldGetter = fieldsMap[name];
- return watchMethod(fieldGetter ? function() {
- return fieldGetter(data)
- } : function() {
- return data[name]
- }, function(value) {
- resolvedData[name] = value;
- if (missedFields.length) {
- var index = missedFields.indexOf(name);
- if (index >= 0) {
- missedFields.splice(index, 1)
- }
- }
- if (!missedFields.length) {
- callback(resolvedData)
- }
- })
- });
- return function() {
- iteratorUtils.each(watchHandlers, function(_, dispose) {
- dispose()
- })
- }
- };
- return start
- }();
- module.exports = TemplateBase.inherit({
- ctor: function(render, fields, watchMethod, fieldsMap) {
- this._render = render;
- this._fields = fields;
- this._fieldsMap = fieldsMap || {};
- this._watchMethod = watchMethod
- },
- _renderCore: function(options) {
- var $container = $(options.container);
- var dispose = watchChanges(options.model, this._watchMethod, this._fields, this._fieldsMap, function(data) {
- $container.empty();
- this._render($container, data, options.model)
- }.bind(this));
- eventsEngine.on($container, removeEvent, dispose);
- return $container.contents()
- }
- })
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/selectors.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var _focusable = function(element, tabIndex) {
- if (!visible(element)) {
- return false
- }
- var nodeName = element.nodeName.toLowerCase();
- var isTabIndexNotNaN = !isNaN(tabIndex);
- var isDisabled = element.disabled;
- var isDefaultFocus = /^(input|select|textarea|button|object|iframe)$/.test(nodeName);
- var isHyperlink = "a" === nodeName;
- var isFocusable = true;
- var isContentEditable = element.isContentEditable;
- if (isDefaultFocus || isContentEditable) {
- isFocusable = !isDisabled
- } else {
- if (isHyperlink) {
- isFocusable = element.href || isTabIndexNotNaN
- } else {
- isFocusable = isTabIndexNotNaN
- }
- }
- return isFocusable
- };
- var visible = function(element) {
- var $element = $(element);
- return $element.is(":visible") && "hidden" !== $element.css("visibility") && "hidden" !== $element.parents().css("visibility")
- };
- module.exports = {
- focusable: function(index, element) {
- return _focusable(element, $(element).attr("tabIndex"))
- },
- tabbable: function(index, element) {
- var tabIndex = $(element).attr("tabIndex");
- return (isNaN(tabIndex) || tabIndex >= 0) && _focusable(element, tabIndex)
- },
- focused: function($element) {
- var element = $($element).get(0);
- return domAdapter.getActiveElement() === element
- }
- }
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/core/dom_component.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _window = __webpack_require__( /*! ../core/utils/window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _extend = __webpack_require__( /*! ./utils/extend */ 0);
- var _config = __webpack_require__( /*! ./config */ 31);
- var _config2 = _interopRequireDefault(_config);
- var _errors = __webpack_require__( /*! ./errors */ 21);
- var _errors2 = _interopRequireDefault(_errors);
- var _dom = __webpack_require__( /*! ../core/utils/dom */ 12);
- var _resize_callbacks = __webpack_require__( /*! ../core/utils/resize_callbacks */ 130);
- var _resize_callbacks2 = _interopRequireDefault(_resize_callbacks);
- var _common = __webpack_require__( /*! ./utils/common */ 4);
- var _common2 = _interopRequireDefault(_common);
- var _iterator = __webpack_require__( /*! ./utils/iterator */ 3);
- var _type = __webpack_require__( /*! ./utils/type */ 1);
- var _array = __webpack_require__( /*! ./utils/array */ 14);
- var _public_component = __webpack_require__( /*! ./utils/public_component */ 131);
- var _public_component2 = _interopRequireDefault(_public_component);
- var _element_data = __webpack_require__( /*! ./element_data */ 39);
- var _element_data2 = _interopRequireDefault(_element_data);
- var _component = __webpack_require__( /*! ./component */ 133);
- var _component2 = _interopRequireDefault(_component);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var abstract = _component2.default.abstract;
- var RTL_DIRECTION_CLASS = "dx-rtl";
- var VISIBILITY_CHANGE_CLASS = "dx-visibility-change-handler";
- var VISIBILITY_CHANGE_EVENTNAMESPACE = "VisibilityChange";
- var DOMComponent = _component2.default.inherit({
- _getDefaultOptions: function() {
- return (0, _extend.extend)(this.callBase(), {
- width: void 0,
- height: void 0,
- rtlEnabled: (0, _config2.default)().rtlEnabled,
- elementAttr: {},
- disabled: false,
- integrationOptions: {}
- })
- },
- ctor: function(element, options) {
- this._$element = (0, _renderer2.default)(element);
- _public_component2.default.attachInstanceToElement(this._$element, this, this._dispose);
- this.callBase(options)
- },
- _getSynchronizableOptionsForCreateComponent: function() {
- return ["rtlEnabled", "disabled", "templatesRenderAsynchronously"]
- },
- _visibilityChanged: abstract,
- _dimensionChanged: abstract,
- _init: function() {
- this.callBase();
- this._attachWindowResizeCallback()
- },
- _setOptionsByDevice: function(instanceCustomRules) {
- this.callBase([].concat(this.constructor._classCustomRules || [], instanceCustomRules || []))
- },
- _isInitialOptionValue: function(name) {
- var isCustomOption = this.constructor._classCustomRules && Object.prototype.hasOwnProperty.call(this._convertRulesToOptions(this.constructor._classCustomRules), name);
- return !isCustomOption && this.callBase(name)
- },
- _attachWindowResizeCallback: function() {
- if (this._isDimensionChangeSupported()) {
- var windowResizeCallBack = this._windowResizeCallBack = this._dimensionChanged.bind(this);
- _resize_callbacks2.default.add(windowResizeCallBack)
- }
- },
- _isDimensionChangeSupported: function() {
- return this._dimensionChanged !== abstract
- },
- _renderComponent: function() {
- this._initMarkup();
- if (_window2.default.hasWindow()) {
- this._render()
- }
- },
- _initMarkup: function() {
- this._renderElementAttributes();
- this._toggleRTLDirection(this.option("rtlEnabled"));
- this._renderVisibilityChange();
- this._renderDimensions()
- },
- _render: function() {
- this._attachVisibilityChangeHandlers()
- },
- _renderElementAttributes: function() {
- var attributes = (0, _extend.extend)({}, this.option("elementAttr"));
- var classNames = attributes.class;
- delete attributes.class;
- this.$element().attr(attributes).addClass(classNames)
- },
- _renderVisibilityChange: function() {
- if (this._isDimensionChangeSupported()) {
- this._attachDimensionChangeHandlers()
- }
- if (!this._isVisibilityChangeSupported()) {
- return
- }
- this.$element().addClass(VISIBILITY_CHANGE_CLASS)
- },
- _renderDimensions: function() {
- var $element = this.$element();
- var element = $element.get(0);
- var width = this._getOptionValue("width", element);
- var height = this._getOptionValue("height", element);
- if (this._isCssUpdateRequired(element, height, width)) {
- $element.css({
- width: null === width ? "" : width,
- height: null === height ? "" : height
- })
- }
- },
- _isCssUpdateRequired: function(element, height, width) {
- return !!((0, _type.isDefined)(width) || (0, _type.isDefined)(height) || element.style.width || element.style.height)
- },
- _attachDimensionChangeHandlers: function() {
- var that = this;
- var resizeEventName = "dxresize." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE;
- _events_engine2.default.off(that.$element(), resizeEventName);
- _events_engine2.default.on(that.$element(), resizeEventName, function() {
- that._dimensionChanged()
- })
- },
- _attachVisibilityChangeHandlers: function() {
- if (!this._isVisibilityChangeSupported()) {
- return
- }
- var that = this;
- var hidingEventName = "dxhiding." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE;
- var shownEventName = "dxshown." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE;
- that._isHidden = !that._isVisible();
- _events_engine2.default.off(that.$element(), hidingEventName);
- _events_engine2.default.on(that.$element(), hidingEventName, function() {
- that._checkVisibilityChanged("hiding")
- });
- _events_engine2.default.off(that.$element(), shownEventName);
- _events_engine2.default.on(that.$element(), shownEventName, function() {
- that._checkVisibilityChanged("shown")
- })
- },
- _isVisible: function() {
- return this.$element().is(":visible")
- },
- _checkVisibilityChanged: function(event) {
- if ("hiding" === event && this._isVisible() && !this._isHidden) {
- this._visibilityChanged(false);
- this._isHidden = true
- } else {
- if ("shown" === event && this._isVisible() && this._isHidden) {
- this._isHidden = false;
- this._visibilityChanged(true)
- }
- }
- },
- _isVisibilityChangeSupported: function() {
- return this._visibilityChanged !== abstract && _window2.default.hasWindow()
- },
- _clean: _common2.default.noop,
- _modelByElement: function() {
- var modelByElement = this.option("modelByElement") || _common2.default.noop;
- return modelByElement(this.$element())
- },
- _invalidate: function() {
- if (!this._updateLockCount) {
- throw _errors2.default.Error("E0007")
- }
- this._requireRefresh = true
- },
- _refresh: function() {
- this._clean();
- this._renderComponent()
- },
- _dispose: function() {
- this.callBase();
- this._clean();
- this._detachWindowResizeCallback()
- },
- _detachWindowResizeCallback: function() {
- if (this._isDimensionChangeSupported()) {
- _resize_callbacks2.default.remove(this._windowResizeCallBack)
- }
- },
- _toggleRTLDirection: function(rtl) {
- this.$element().toggleClass(RTL_DIRECTION_CLASS, rtl)
- },
- _createComponent: function(element, component, config) {
- var _this = this;
- var that = this;
- config = config || {};
- var synchronizableOptions = _common2.default.grep(this._getSynchronizableOptionsForCreateComponent(), function(value) {
- return !(value in config)
- });
- var nestedComponentOptions = that.option("nestedComponentOptions") || _common2.default.noop;
- var nestedComponentConfig = (0, _extend.extend)({
- integrationOptions: this.option("integrationOptions")
- }, nestedComponentOptions(this));
- synchronizableOptions.forEach(function(optionName) {
- nestedComponentConfig[optionName] = _this.option(optionName)
- });
- that._extendConfig(config, nestedComponentConfig);
- var instance;
- if ((0, _type.isString)(component)) {
- var $element = (0, _renderer2.default)(element)[component](config);
- instance = $element[component]("instance")
- } else {
- if (element) {
- instance = component.getInstance(element);
- if (instance) {
- instance.option(config)
- } else {
- instance = new component(element, config)
- }
- }
- }
- if (instance) {
- var optionChangedHandler = function(args) {
- if ((0, _array.inArray)(args.name, synchronizableOptions) >= 0) {
- instance.option(args.name, args.value)
- }
- };
- that.on("optionChanged", optionChangedHandler);
- instance.on("disposing", function() {
- that.off("optionChanged", optionChangedHandler)
- })
- }
- return instance
- },
- _extendConfig: function(config, extendConfig) {
- (0, _iterator.each)(extendConfig, function(key, value) {
- config[key] = Object.prototype.hasOwnProperty.call(config, key) ? config[key] : value
- })
- },
- _defaultActionConfig: function() {
- return (0, _extend.extend)(this.callBase(), {
- context: this._modelByElement(this.$element())
- })
- },
- _defaultActionArgs: function() {
- var model = this._modelByElement(this.$element());
- return (0, _extend.extend)(this.callBase(), {
- element: this.element(),
- model: model
- })
- },
- _optionChanged: function(args) {
- switch (args.name) {
- case "width":
- case "height":
- this._renderDimensions();
- break;
- case "rtlEnabled":
- this._invalidate();
- break;
- case "elementAttr":
- this._renderElementAttributes();
- break;
- case "disabled":
- case "integrationOptions":
- break;
- default:
- this.callBase(args)
- }
- },
- _removeAttributes: function(element) {
- var i = element.attributes.length - 1;
- for (; i >= 0; i--) {
- var attribute = element.attributes[i];
- if (!attribute) {
- return
- }
- var attributeName = attribute.name;
- if (0 === attributeName.indexOf("aria-") || attributeName.indexOf("dx-") !== -1 || "role" === attributeName || "style" === attributeName || "tabindex" === attributeName) {
- element.removeAttribute(attributeName)
- }
- }
- },
- _removeClasses: function(element) {
- var classes = element.className.split(" ").filter(function(cssClass) {
- return 0 !== cssClass.lastIndexOf("dx-", 0)
- });
- element.className = classes.join(" ")
- },
- endUpdate: function() {
- var requireRender = !this._initializing && !this._initialized;
- this.callBase.apply(this, arguments);
- if (!this._updateLockCount) {
- if (requireRender) {
- this._renderComponent()
- } else {
- if (this._requireRefresh) {
- this._requireRefresh = false;
- this._refresh()
- }
- }
- }
- },
- $element: function() {
- return this._$element
- },
- element: function() {
- return (0, _dom.getPublicElement)(this.$element())
- },
- dispose: function() {
- var element = this.$element().get(0);
- _element_data2.default.cleanDataRecursive(element, true);
- element.textContent = "";
- this._removeAttributes(element);
- this._removeClasses(element)
- }
- });
- DOMComponent.getInstance = function(element) {
- return _public_component2.default.getInstanceByElement((0, _renderer2.default)(element), this)
- };
- DOMComponent.defaultOptions = function(rule) {
- this._classCustomRules = this._classCustomRules || [];
- this._classCustomRules.push(rule)
- };
- module.exports = DOMComponent
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/data/array_store.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _utils = __webpack_require__( /*! ./utils */ 41);
- var _query = __webpack_require__( /*! ./query */ 42);
- var _query2 = _interopRequireDefault(_query);
- var _errors = __webpack_require__( /*! ./errors */ 36);
- var _abstract_store = __webpack_require__( /*! ./abstract_store */ 98);
- var _abstract_store2 = _interopRequireDefault(_abstract_store);
- var _array_utils = __webpack_require__( /*! ./array_utils */ 135);
- var _array_utils2 = _interopRequireDefault(_array_utils);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var ArrayStore = _abstract_store2.default.inherit({
- ctor: function(options) {
- if (Array.isArray(options)) {
- options = {
- data: options
- }
- } else {
- options = options || {}
- }
- this.callBase(options);
- var initialArray = options.data;
- if (initialArray && !Array.isArray(initialArray)) {
- throw _errors.errors.Error("E4006")
- }
- this._array = initialArray || []
- },
- createQuery: function() {
- return (0, _query2.default)(this._array, {
- errorHandler: this._errorHandler
- })
- },
- _byKeyImpl: function(key) {
- var index = _array_utils2.default.indexByKey(this, this._array, key);
- if (index === -1) {
- return (0, _utils.rejectedPromise)(_errors.errors.Error("E4009"))
- }
- return (0, _utils.trivialPromise)(this._array[index])
- },
- _insertImpl: function(values) {
- return _array_utils2.default.insert(this, this._array, values)
- },
- _pushImpl: function(changes) {
- _array_utils2.default.applyBatch(this, this._array, changes)
- },
- _updateImpl: function(key, values) {
- return _array_utils2.default.update(this, this._array, key, values)
- },
- _removeImpl: function(key) {
- return _array_utils2.default.remove(this, this._array, key)
- },
- clear: function() {
- this.fireEvent("modifying");
- this._array = [];
- this.fireEvent("modified")
- }
- }, "array");
- module.exports = ArrayStore
- }, ,
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tree_map.base.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _common = __webpack_require__( /*! ./common */ 251);
- var _node = __webpack_require__( /*! ./node */ 166);
- var _node2 = _interopRequireDefault(_node);
- var _tiling = __webpack_require__( /*! ./tiling */ 120);
- var _colorizing = __webpack_require__( /*! ./colorizing */ 121);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _common2 = __webpack_require__( /*! ../../core/utils/common */ 4);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _extend2 = __webpack_require__( /*! ../../core/utils/extend */ 0);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var _max = Math.max;
- var directions = {
- lefttoprightbottom: [1, 1],
- leftbottomrighttop: [1, -1],
- righttopleftbottom: [-1, 1],
- rightbottomlefttop: [-1, -1]
- };
- __webpack_require__( /*! ./tiling.squarified */ 419);
- __webpack_require__( /*! ./tiling */ 120).setDefaultAlgorithm("squarified");
- __webpack_require__( /*! ./colorizing.discrete */ 421);
- __webpack_require__( /*! ./colorizing */ 121).setDefaultColorizer("discrete");
- function pickPositiveInteger(val) {
- return val > 0 ? Math.round(val) : 0
- }
- var dxTreeMap = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
- _handlers: {
- beginBuildNodes: _common2.noop,
- buildNode: _common2.noop,
- endBuildNodes: _common2.noop,
- setTrackerData: _common2.noop,
- calculateState: function(options) {
- return (0, _common.buildRectAppearance)(options)
- }
- },
- _rootClass: "dxtm-tree-map",
- _rootClassPrefix: "dxtm",
- _getDefaultSize: function() {
- return {
- width: 400,
- height: 400
- }
- },
- _setDeprecatedOptions: function() {
- this.callBase.apply(this, arguments);
- (0, _extend2.extend)(this._deprecatedOptions, {
- resolveLabelOverflow: {
- since: "19.1",
- message: "Use the 'tile.label.overflow' and 'group.label.textOverflow' option instead"
- }
- })
- },
- _themeSection: "treeMap",
- _fontFields: ["tile.label.font", "group.label.font"],
- _init: function() {
- var that = this;
- that._rectOffsets = {};
- that._handlers = Object.create(that._handlers);
- that._context = {
- suspend: function() {
- if (!that._applyingChanges) {
- that._suspendChanges()
- }
- },
- resume: function() {
- if (!that._applyingChanges) {
- that._resumeChanges()
- }
- },
- change: function(codes) {
- that._change(codes)
- },
- settings: [{}, {}],
- calculateState: that._handlers.calculateState,
- calculateLabelState: _common.buildTextAppearance
- };
- that._root = that._topNode = {
- nodes: []
- };
- that.callBase.apply(that, arguments)
- },
- _initialChanges: ["DATA_SOURCE"],
- _initCore: function() {
- var that = this;
- var renderer = that._renderer;
- that._createProxyType();
- that._tilesGroup = renderer.g().linkOn(renderer.root, "tiles").linkAppend();
- that._labelsGroup = renderer.g().linkOn(renderer.root, "labels").linkAppend()
- },
- _createProxyType: _common2.noop,
- _disposeCore: function() {
- var that = this;
- that._filter && that._filter.dispose();
- that._labelsGroup.linkOff();
- that._tilesGroup.linkOff()
- },
- _applySize: function(rect) {
- this._tilingRect = rect.slice();
- this._change(["TILING"])
- },
- _optionChangesMap: {
- dataSource: "DATA_SOURCE",
- valueField: "NODES_CREATE",
- childrenField: "NODES_CREATE",
- colorField: "TILES",
- colorizer: "TILES",
- labelField: "LABELS",
- tile: "TILE_SETTINGS",
- group: "GROUP_SETTINGS",
- maxDepth: "MAX_DEPTH",
- layoutAlgorithm: "TILING",
- layoutDirection: "TILING",
- resolveLabelOverflow: "LABEL_OVERFLOW"
- },
- _themeDependentChanges: ["TILE_SETTINGS", "GROUP_SETTINGS", "MAX_DEPTH"],
- _changeDataSource: function() {
- var that = this;
- that._isDataExpected = that._isSyncData = true;
- that._updateDataSource();
- that._isSyncData = false;
- if (that._isDataExpected) {
- that._suspendChanges()
- }
- },
- _dataSourceChangedHandler: function() {
- var that = this;
- if (that._isDataExpected) {
- that._isDataExpected = false;
- that._change(["NODES_CREATE"]);
- if (!that._isSyncData) {
- that._resumeChanges()
- }
- } else {
- that._requestChange(["NODES_CREATE"])
- }
- },
- _optionChangesOrder: ["DATA_SOURCE", "TILE_SETTINGS", "GROUP_SETTINGS", "MAX_DEPTH", "LABEL_OVERFLOW"],
- _change_DATA_SOURCE: function() {
- this._changeDataSource()
- },
- _change_TILE_SETTINGS: function() {
- this._changeTileSettings()
- },
- _change_GROUP_SETTINGS: function() {
- this._changeGroupSettings()
- },
- _change_LABEL_OVERFLOW: function() {
- this._changeTileSettings();
- this._changeGroupSettings()
- },
- _change_MAX_DEPTH: function() {
- this._changeMaxDepth()
- },
- _customChangesOrder: ["NODES_CREATE", "NODES_RESET", "TILES", "LABELS", "TILING", "LABELS_LAYOUT"],
- _change_NODES_CREATE: function() {
- this._buildNodes()
- },
- _change_NODES_RESET: function() {
- this._resetNodes()
- },
- _change_TILES: function() {
- this._applyTilesAppearance()
- },
- _change_LABELS: function() {
- this._applyLabelsAppearance()
- },
- _change_TILING: function() {
- this._performTiling()
- },
- _change_LABELS_LAYOUT: function() {
- this._performLabelsLayout()
- },
- _applyChanges: function() {
- var that = this;
- that.callBase.apply(that, arguments);
- if (!that._isDataExpected) {
- that._drawn()
- }
- that._context.forceReset = false
- },
- _buildNodes: function() {
- var that = this;
- var root = that._root = that._topNode = new _node2.default;
- root._id = 0;
- root.parent = {};
- root.data = {};
- root.level = root.index = -1;
- root.ctx = that._context;
- root.label = null;
- that._nodes = [root];
- that._handlers.beginBuildNodes();
- var processedData = that._processDataSourceItems(that._dataSourceItems() || []);
- traverseDataItems(root, processedData.items, 0, {
- itemsField: !processedData.isPlain && that._getOption("childrenField", true) || "items",
- valueField: that._getOption("valueField", true) || "value",
- buildNode: that._handlers.buildNode,
- ctx: that._context,
- nodes: that._nodes
- });
- that._onNodesCreated();
- that._handlers.endBuildNodes();
- that._change(["NODES_RESET"])
- },
- _onNodesCreated: _common2.noop,
- _processDataSourceItems: function(items) {
- return {
- items: items,
- isPlain: false
- }
- },
- _changeTileSettings: function() {
- var that = this;
- var options = that._getOption("tile");
- var offsets = that._rectOffsets;
- var borderWidth = pickPositiveInteger(options.border.width);
- var edgeOffset = borderWidth / 2;
- var innerOffset = 1 & borderWidth ? .5 : 0;
- var labelOptions = options.label;
- var settings = that._context.settings[0];
- that._change(["TILES", "LABELS"]);
- settings.state = that._handlers.calculateState(options);
- that._filter = that._filter || that._renderer.shadowFilter("-50%", "-50%", "200%", "200%");
- that._filter.attr(labelOptions.shadow);
- that._calculateLabelSettings(settings, labelOptions, that._filter.id);
- if (offsets.tileEdge !== edgeOffset || offsets.tileInner !== innerOffset) {
- offsets.tileEdge = edgeOffset;
- offsets.tileInner = innerOffset;
- that._change(["TILING"])
- }
- },
- _changeGroupSettings: function() {
- var that = this;
- var options = that._getOption("group");
- var labelOptions = options.label;
- var offsets = that._rectOffsets;
- var borderWidth = pickPositiveInteger(options.border.width);
- var edgeOffset = borderWidth / 2;
- var innerOffset = 1 & borderWidth ? .5 : 0;
- var headerHeight = 0;
- var groupPadding = pickPositiveInteger(options.padding);
- var settings = that._context.settings[1];
- that._change(["TILES", "LABELS"]);
- settings.state = that._handlers.calculateState(options);
- that._calculateLabelSettings(settings, labelOptions);
- if (options.headerHeight >= 0) {
- headerHeight = pickPositiveInteger(options.headerHeight)
- } else {
- headerHeight = settings.labelParams.height + 2 * pickPositiveInteger(labelOptions.paddingTopBottom)
- }
- if (that._headerHeight !== headerHeight) {
- that._headerHeight = headerHeight;
- that._change(["TILING"])
- }
- if (that._groupPadding !== groupPadding) {
- that._groupPadding = groupPadding;
- that._change(["TILING"])
- }
- if (offsets.headerEdge !== edgeOffset || offsets.headerInner !== innerOffset) {
- offsets.headerEdge = edgeOffset;
- offsets.headerInner = innerOffset;
- that._change(["TILING"])
- }
- },
- _calculateLabelSettings: function(settings, options, filter) {
- var bBox = this._getTextBBox(options.font);
- var paddingLeftRight = pickPositiveInteger(options.paddingLeftRight);
- var paddingTopBottom = pickPositiveInteger(options.paddingTopBottom);
- var tileLabelOptions = this._getOption("tile.label");
- var groupLabelOptions = this._getOption("group.label");
- settings.labelState = (0, _common.buildTextAppearance)(options, filter);
- settings.labelState.visible = !("visible" in options) || !!options.visible;
- this._suppressDeprecatedWarnings();
- settings.labelParams = {
- height: bBox.height,
- rtlEnabled: this._getOption("rtlEnabled", true),
- paddingTopBottom: paddingTopBottom,
- paddingLeftRight: paddingLeftRight,
- resolveLabelOverflow: this._getOption("resolveLabelOverflow", true),
- tileLabelWordWrap: tileLabelOptions.wordWrap,
- tileLabelOverflow: tileLabelOptions.textOverflow,
- groupLabelOverflow: groupLabelOptions.textOverflow
- };
- this._resumeDeprecatedWarnings()
- },
- _changeMaxDepth: function() {
- var maxDepth = this._getOption("maxDepth", true);
- maxDepth = maxDepth >= 1 ? Math.round(maxDepth) : 1 / 0;
- if (this._maxDepth !== maxDepth) {
- this._maxDepth = maxDepth;
- this._change(["NODES_RESET"])
- }
- },
- _resetNodes: function() {
- var that = this;
- that._tilesGroup.clear();
- that._renderer.initHatching();
- that._context.forceReset = true;
- that._context.minLevel = that._topNode.level + 1;
- that._context.maxLevel = that._context.minLevel + that._maxDepth - 1;
- that._change(["TILES", "LABELS", "TILING"])
- },
- _processNodes: function(context, process) {
- processNodes(context, this._topNode, process)
- },
- _applyTilesAppearance: function() {
- var that = this;
- var colorizer = (0, _colorizing.getColorizer)(that._getOption("colorizer"), that._themeManager, that._topNode);
- that._processNodes({
- renderer: that._renderer,
- group: that._tilesGroup,
- setTrackerData: that._handlers.setTrackerData,
- colorField: that._getOption("colorField", true) || "color",
- getColor: colorizer
- }, processTileAppearance)
- },
- _applyLabelsAppearance: function() {
- var that = this;
- that._labelsGroup.clear();
- that._processNodes({
- renderer: that._renderer,
- group: that._labelsGroup,
- setTrackerData: that._handlers.setTrackerData,
- labelField: that._getOption("labelField", true) || "name"
- }, processLabelAppearance);
- that._change(["LABELS_LAYOUT"])
- },
- _performTiling: function() {
- var that = this;
- var context = {
- algorithm: (0, _tiling.getAlgorithm)(that._getOption("layoutAlgorithm", true)),
- directions: directions[String(that._getOption("layoutDirection", true)).toLowerCase()] || directions.lefttoprightbottom,
- headerHeight: that._headerHeight,
- groupPadding: that._groupPadding,
- rectOffsets: that._rectOffsets
- };
- that._topNode.innerRect = that._tilingRect;
- calculateRects(context, that._topNode);
- that._processNodes(context, processTiling);
- that._change(["LABELS_LAYOUT"]);
- that._onTilingPerformed()
- },
- _onTilingPerformed: _common2.noop,
- _performLabelsLayout: function() {
- this._processNodes(null, processLabelsLayout)
- },
- _getTextBBox: function(fontOptions) {
- var renderer = this._renderer;
- var text = this._textForCalculations || renderer.text("0", 0, 0);
- this._textForCalculations = text;
- text.css((0, _utils.patchFontOptions)(fontOptions)).append(renderer.root);
- var bBox = text.getBBox();
- text.remove();
- return bBox
- }
- });
- function traverseDataItems(root, dataItems, level, params) {
- var nodes = [];
- var allNodes = params.nodes;
- var i;
- var ii = dataItems.length;
- var totalValue = 0;
- for (i = 0; i < ii; ++i) {
- var dataItem = dataItems[i];
- var node = new _node2.default;
- node._id = allNodes.length;
- node.ctx = params.ctx;
- node.parent = root;
- node.level = level;
- node.index = nodes.length;
- node.data = dataItem;
- params.buildNode(node);
- allNodes.push(node);
- nodes.push(node);
- var items = dataItem[params.itemsField];
- if (items && items.length) {
- traverseDataItems(node, items, level + 1, params)
- }
- if (dataItem[params.valueField] > 0) {
- node.value = Number(dataItem[params.valueField])
- }
- totalValue += node.value
- }
- root.nodes = nodes;
- root.value = totalValue
- }
- function processNodes(context, root, process) {
- var nodes = root.nodes;
- var i;
- var ii = nodes.length;
- for (i = 0; i < ii; ++i) {
- var node = nodes[i];
- process(context, node);
- if (node.isNode()) {
- processNodes(context, node, process)
- }
- }
- }
- function processTileAppearance(context, node) {
- node.color = node.data[context.colorField] || context.getColor(node) || node.parent.color;
- node.updateStyles();
- node.tile = !node.ctx.forceReset && node.tile || createTile[Number(node.isNode())](context, node);
- node.applyState()
- }
- var createTile = [createLeaf, createGroup];
- function createLeaf(context, node) {
- var tile = context.renderer.simpleRect().append(context.group);
- context.setTrackerData(node, tile);
- return tile
- }
- function createGroup(context, node) {
- var outer = context.renderer.simpleRect().append(context.group);
- var inner = context.renderer.simpleRect().append(context.group);
- context.setTrackerData(node, inner);
- return {
- outer: outer,
- inner: inner
- }
- }
- function processLabelAppearance(context, node) {
- node.updateLabelStyle();
- if (node.labelState.visible) {
- createLabel(context, node, node.labelState, node.labelParams)
- }
- }
- function createLabel(context, currentNode, settings, params) {
- var textData = currentNode.data[context.labelField];
- currentNode.label = textData ? String(textData) : null;
- textData = currentNode.customLabel || currentNode.label;
- if (textData) {
- currentNode.text = context.renderer.text(textData).attr(settings.attr).css(settings.css).append(context.group);
- context.setTrackerData(currentNode, currentNode.text)
- }
- }
- var emptyRect = [0, 0, 0, 0];
- function calculateRects(context, root) {
- var nodes = root.nodes;
- var items = [];
- var rects = [];
- var sum = 0;
- var i;
- var ii = items.length = rects.length = nodes.length;
- for (i = 0; i < ii; ++i) {
- sum += nodes[i].value;
- items[i] = {
- value: nodes[i].value,
- i: i
- }
- }
- if (sum > 0) {
- context.algorithm({
- items: items.slice(),
- sum: sum,
- rect: root.innerRect.slice(),
- isRotated: 1 & nodes[0].level,
- directions: context.directions
- })
- }
- for (i = 0; i < ii; ++i) {
- rects[i] = items[i].rect || emptyRect
- }
- root.rects = rects
- }
- function processTiling(context, node) {
- var rect = node.parent.rects[node.index];
- var rectOffsets = context.rectOffsets;
- if (node.isNode()) {
- setRectAttrs(node.tile.outer, buildTileRect(rect, node.parent.innerRect, rectOffsets.headerEdge, rectOffsets.headerInner));
- rect = marginateRect(rect, context.groupPadding);
- var headerHeight = Math.min(context.headerHeight, rect[3] - rect[1]);
- node.rect = [rect[0], rect[1], rect[2], rect[1] + headerHeight];
- setRectAttrs(node.tile.inner, marginateRect(node.rect, rectOffsets.headerEdge));
- rect[1] += headerHeight;
- node.innerRect = rect;
- calculateRects(context, node)
- } else {
- node.rect = rect;
- setRectAttrs(node.tile, buildTileRect(rect, node.parent.innerRect, rectOffsets.tileEdge, rectOffsets.tileInner))
- }
- }
- function marginateRect(rect, margin) {
- return [rect[0] + margin, rect[1] + margin, rect[2] - margin, rect[3] - margin]
- }
- function buildTileRect(rect, outer, edgeOffset, innerOffset) {
- return [rect[0] + (rect[0] === outer[0] ? edgeOffset : +innerOffset), rect[1] + (rect[1] === outer[1] ? edgeOffset : +innerOffset), rect[2] - (rect[2] === outer[2] ? edgeOffset : -innerOffset), rect[3] - (rect[3] === outer[3] ? edgeOffset : -innerOffset)]
- }
- function setRectAttrs(element, rect) {
- element.attr({
- x: rect[0],
- y: rect[1],
- width: _max(rect[2] - rect[0], 0),
- height: _max(rect[3] - rect[1], 0)
- })
- }
- function processLabelsLayout(context, node) {
- if (node.text && node.labelState.visible) {
- layoutTextNode(node, node.labelParams)
- }
- }
- function layoutTextNode(node, params) {
- var rect = node.rect;
- var text = node.text;
- var bBox = text.getBBox();
- var paddingLeftRight = params.paddingLeftRight;
- var paddingTopBottom = params.paddingTopBottom;
- var effectiveWidth = rect[2] - rect[0] - 2 * paddingLeftRight;
- var fitByHeight = bBox.height + paddingTopBottom <= rect[3] - rect[1];
- var fitByWidth = bBox.width <= effectiveWidth;
- var resolveLabelOverflow = params.resolveLabelOverflow;
- var groupLabelOverflow = params.groupLabelOverflow;
- var tileLabelOverflow = params.tileLabelOverflow;
- var tileLabelWordWrap = params.tileLabelWordWrap;
- if ((0, _type.isDefined)(resolveLabelOverflow)) {
- if ("ellipsis" === resolveLabelOverflow && fitByHeight) {
- text.setMaxSize(effectiveWidth, void 0, {
- wordWrap: "none",
- textOverflow: "ellipsis"
- });
- if (!fitByWidth) {
- bBox = text.getBBox();
- fitByWidth = bBox.width <= effectiveWidth
- }
- }
- } else {
- fitByWidth = true;
- fitByHeight = true;
- text.setMaxSize(effectiveWidth, rect[3] - rect[1] - paddingTopBottom, node.isNode() ? {
- textOverflow: groupLabelOverflow,
- wordWrap: "none"
- } : {
- textOverflow: tileLabelOverflow,
- wordWrap: tileLabelWordWrap,
- hideOverflowEllipsis: true
- })
- }
- text.attr({
- visibility: fitByHeight && fitByWidth ? "visible" : "hidden"
- });
- if (fitByHeight && fitByWidth) {
- text.move(params.rtlEnabled ? rect[2] - paddingLeftRight - bBox.x - bBox.width : rect[0] + paddingLeftRight - bBox.x, rect[1] + paddingTopBottom - bBox.y)
- }
- }
- __webpack_require__( /*! ../../core/component_registrator */ 9)("dxTreeMap", dxTreeMap);
- module.exports = dxTreeMap;
- dxTreeMap.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/events/core/event_registrator.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var callbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 122);
- var registerEvent = function(name, eventObject) {
- var strategy = {};
- if ("noBubble" in eventObject) {
- strategy.noBubble = eventObject.noBubble
- }
- if ("bindType" in eventObject) {
- strategy.bindType = eventObject.bindType
- }
- if ("delegateType" in eventObject) {
- strategy.delegateType = eventObject.delegateType
- }
- each(["setup", "teardown", "add", "remove", "trigger", "handle", "_default", "dispose"], function(_, methodName) {
- if (!eventObject[methodName]) {
- return
- }
- strategy[methodName] = function() {
- var args = [].slice.call(arguments);
- args.unshift(this);
- return eventObject[methodName].apply(eventObject, args)
- }
- });
- callbacks.fire(name, strategy)
- };
- registerEvent.callbacks = callbacks;
- module.exports = registerEvent
- },
- /*!***********************************!*\
- !*** external "window.Globalize" ***!
- \***********************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports) {
- module.exports = window.Globalize
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/console.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isFunction = __webpack_require__( /*! ./type */ 1).isFunction;
- var noop = function() {};
- var getConsoleMethod = function(method) {
- if ("undefined" === typeof console || !isFunction(console[method])) {
- return noop
- }
- return console[method].bind(console)
- };
- var logger = {
- info: getConsoleMethod("info"),
- warn: getConsoleMethod("warn"),
- error: getConsoleMethod("error")
- };
- var debug = function() {
- function assert(condition, message) {
- if (!condition) {
- throw new Error(message)
- }
- }
- function assertParam(parameter, message) {
- assert(null !== parameter && void 0 !== parameter, message)
- }
- return {
- assert: assert,
- assertParam: assertParam
- }
- }();
- exports.logger = logger;
- exports.debug = debug
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/ui.template_base.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var abstract = Class.abstract;
- var renderedCallbacks = Callbacks({
- syncStrategy: true
- });
- var TemplateBase = Class.inherit({
- render: function(options) {
- options = options || {};
- var onRendered = options.onRendered;
- delete options.onRendered;
- var $result = this._renderCore(options);
- this._ensureResultInContainer($result, options.container);
- renderedCallbacks.fire($result, options.container);
- onRendered && onRendered();
- return $result
- },
- _ensureResultInContainer: function($result, container) {
- if (!container) {
- return
- }
- var $container = $(container);
- var resultInContainer = domUtils.contains($container.get(0), $result.get(0));
- $container.append($result);
- if (resultInContainer) {
- return
- }
- var resultInBody = domAdapter.getBody().contains($container.get(0));
- if (!resultInBody) {
- return
- }
- domUtils.triggerShownEvent($result)
- },
- _renderCore: abstract
- });
- module.exports = TemplateBase;
- module.exports.renderedCallbacks = renderedCallbacks
- }, ,
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/core/polyfills/promise.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var Deferred = deferredUtils.Deferred;
- var when = deferredUtils.when;
- var promise = windowUtils.hasWindow() ? windowUtils.getWindow().Promise : Promise;
- if (!promise) {
- promise = function(resolver) {
- var d = new Deferred;
- resolver(d.resolve.bind(this), d.reject.bind(this));
- return d.promise()
- };
- promise.resolve = function(val) {
- return (new Deferred).resolve(val).promise()
- };
- promise.reject = function(val) {
- return (new Deferred).reject(val).promise()
- };
- promise.all = function(promises) {
- return when.apply(this, promises).then(function() {
- return [].slice.call(arguments)
- })
- }
- }
- module.exports = promise
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/animation/position.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var isWindow = __webpack_require__( /*! ../core/utils/type */ 1).isWindow;
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var browser = __webpack_require__( /*! ../core/utils/browser */ 25);
- var translator = __webpack_require__( /*! ./translator */ 27);
- var support = __webpack_require__( /*! ../core/utils/support */ 43);
- var horzRe = /left|right/;
- var vertRe = /top|bottom/;
- var collisionRe = /fit|flip|none/;
- var IS_SAFARI = browser.safari;
- var normalizeAlign = function(raw) {
- var result = {
- h: "center",
- v: "center"
- };
- var pair = commonUtils.splitPair(raw);
- if (pair) {
- each(pair, function() {
- var w = String(this).toLowerCase();
- if (horzRe.test(w)) {
- result.h = w
- } else {
- if (vertRe.test(w)) {
- result.v = w
- }
- }
- })
- }
- return result
- };
- var normalizeOffset = function(raw) {
- return commonUtils.pairToObject(raw)
- };
- var normalizeCollision = function(raw) {
- var pair = commonUtils.splitPair(raw);
- var h = String(pair && pair[0]).toLowerCase();
- var v = String(pair && pair[1]).toLowerCase();
- if (!collisionRe.test(h)) {
- h = "none"
- }
- if (!collisionRe.test(v)) {
- v = h
- }
- return {
- h: h,
- v: v
- }
- };
- var getAlignFactor = function(align) {
- switch (align) {
- case "center":
- return .5;
- case "right":
- case "bottom":
- return 1;
- default:
- return 0
- }
- };
- var inverseAlign = function(align) {
- switch (align) {
- case "left":
- return "right";
- case "right":
- return "left";
- case "top":
- return "bottom";
- case "bottom":
- return "top";
- default:
- return align
- }
- };
- var calculateOversize = function(data, bounds) {
- var oversize = 0;
- if (data.myLocation < bounds.min) {
- oversize += bounds.min - data.myLocation
- }
- if (data.myLocation > bounds.max) {
- oversize += data.myLocation - bounds.max
- }
- return oversize
- };
- var collisionSide = function(direction, data, bounds) {
- if (data.myLocation < bounds.min) {
- return "h" === direction ? "left" : "top"
- }
- if (data.myLocation > bounds.max) {
- return "h" === direction ? "right" : "bottom"
- }
- return "none"
- };
- var initMyLocation = function(data) {
- data.myLocation = data.atLocation + getAlignFactor(data.atAlign) * data.atSize - getAlignFactor(data.myAlign) * data.mySize + data.offset
- };
- var collisionResolvers = {
- fit: function(data, bounds) {
- var result = false;
- if (data.myLocation > bounds.max) {
- data.myLocation = bounds.max;
- result = true
- }
- if (data.myLocation < bounds.min) {
- data.myLocation = bounds.min;
- result = true
- }
- data.fit = result
- },
- flip: function(data, bounds) {
- data.flip = false;
- if ("center" === data.myAlign && "center" === data.atAlign) {
- return
- }
- if (data.myLocation < bounds.min || data.myLocation > bounds.max) {
- var inverseData = extend({}, data, {
- myAlign: inverseAlign(data.myAlign),
- atAlign: inverseAlign(data.atAlign),
- offset: -data.offset
- });
- initMyLocation(inverseData);
- inverseData.oversize = calculateOversize(inverseData, bounds);
- if (inverseData.myLocation >= bounds.min && inverseData.myLocation <= bounds.max || data.oversize > inverseData.oversize) {
- data.myLocation = inverseData.myLocation;
- data.oversize = inverseData.oversize;
- data.flip = true
- }
- }
- },
- flipfit: function(data, bounds) {
- this.flip(data, bounds);
- this.fit(data, bounds)
- },
- none: function(data) {
- data.oversize = 0
- }
- };
- var scrollbarWidth;
- var calculateScrollbarWidth = function() {
- var $scrollDiv = $("<div>").css({
- width: 100,
- height: 100,
- overflow: "scroll",
- position: "absolute",
- top: -9999
- }).appendTo($("body"));
- var result = $scrollDiv.get(0).offsetWidth - $scrollDiv.get(0).clientWidth;
- $scrollDiv.remove();
- scrollbarWidth = result
- };
- var defaultPositionResult = {
- h: {
- location: 0,
- flip: false,
- fit: false,
- oversize: 0
- },
- v: {
- location: 0,
- flip: false,
- fit: false,
- oversize: 0
- }
- };
- var calculatePosition = function(what, options) {
- var $what = $(what);
- var currentOffset = $what.offset();
- var result = extend(true, {}, defaultPositionResult, {
- h: {
- location: currentOffset.left
- },
- v: {
- location: currentOffset.top
- }
- });
- if (!options) {
- return result
- }
- var my = normalizeAlign(options.my);
- var at = normalizeAlign(options.at);
- var of = $(options.of).length && options.of || window;
- var offset = normalizeOffset(options.offset);
- var collision = normalizeCollision(options.collision);
- var boundary = options.boundary;
- var boundaryOffset = normalizeOffset(options.boundaryOffset);
- var h = {
- mySize: $what.outerWidth(),
- myAlign: my.h,
- atAlign: at.h,
- offset: offset.h,
- collision: collision.h,
- boundaryOffset: boundaryOffset.h
- };
- var v = {
- mySize: $what.outerHeight(),
- myAlign: my.v,
- atAlign: at.v,
- offset: offset.v,
- collision: collision.v,
- boundaryOffset: boundaryOffset.v
- };
- if (of.preventDefault) {
- h.atLocation = of.pageX;
- v.atLocation = of.pageY;
- h.atSize = 0;
- v.atSize = 0
- } else {
- of = $(of);
- if (isWindow(of [0])) {
- h.atLocation = of.scrollLeft();
- v.atLocation = of.scrollTop();
- h.atSize = of [0].innerWidth >= of [0].outerWidth ? of [0].innerWidth : of.width();
- v.atSize = of [0].innerHeight >= of [0].outerHeight || IS_SAFARI ? of [0].innerHeight : of.height()
- } else {
- if (9 === of [0].nodeType) {
- h.atLocation = 0;
- v.atLocation = 0;
- h.atSize = of.width();
- v.atSize = of.height()
- } else {
- var o = of.offset();
- h.atLocation = o.left;
- v.atLocation = o.top;
- h.atSize = of.outerWidth();
- v.atSize = of.outerHeight()
- }
- }
- }
- initMyLocation(h);
- initMyLocation(v);
- var bounds = function() {
- var win = $(window);
- var windowWidth = win.width();
- var windowHeight = win.height();
- var left = win.scrollLeft();
- var top = win.scrollTop();
- var documentElement = domAdapter.getDocumentElement();
- var hZoomLevel = support.touch ? documentElement.clientWidth / windowWidth : 1;
- var vZoomLevel = support.touch ? documentElement.clientHeight / windowHeight : 1;
- if (void 0 === scrollbarWidth) {
- calculateScrollbarWidth()
- }
- var boundaryWidth = windowWidth;
- var boundaryHeight = windowHeight;
- if (boundary) {
- var $boundary = $(boundary);
- var boundaryPosition = $boundary.offset();
- left = boundaryPosition.left;
- top = boundaryPosition.top;
- boundaryWidth = $boundary.width();
- boundaryHeight = $boundary.height()
- }
- return {
- h: {
- min: left + h.boundaryOffset,
- max: left + boundaryWidth / hZoomLevel - h.mySize - h.boundaryOffset
- },
- v: {
- min: top + v.boundaryOffset,
- max: top + boundaryHeight / vZoomLevel - v.mySize - v.boundaryOffset
- }
- }
- }();
- h.oversize = calculateOversize(h, bounds.h);
- v.oversize = calculateOversize(v, bounds.v);
- h.collisionSide = collisionSide("h", h, bounds.h);
- v.collisionSide = collisionSide("v", v, bounds.v);
- if (collisionResolvers[h.collision]) {
- collisionResolvers[h.collision](h, bounds.h)
- }
- if (collisionResolvers[v.collision]) {
- collisionResolvers[v.collision](v, bounds.v)
- }
- var preciser = function(number) {
- return options.precise ? number : Math.round(number)
- };
- extend(true, result, {
- h: {
- location: preciser(h.myLocation),
- oversize: preciser(h.oversize),
- fit: h.fit,
- flip: h.flip,
- collisionSide: h.collisionSide
- },
- v: {
- location: preciser(v.myLocation),
- oversize: preciser(v.oversize),
- fit: v.fit,
- flip: v.flip,
- collisionSide: v.collisionSide
- },
- precise: options.precise
- });
- return result
- };
- var position = function(what, options) {
- var $what = $(what);
- if (!options) {
- return $what.offset()
- }
- translator.resetPosition($what, true);
- var offset = $what.offset();
- var targetPosition = options.h && options.v ? options : calculatePosition($what, options);
- var preciser = function(number) {
- return options.precise ? number : Math.round(number)
- };
- translator.move($what, {
- left: targetPosition.h.location - preciser(offset.left),
- top: targetPosition.v.location - preciser(offset.top)
- });
- return targetPosition
- };
- var offset = function(element) {
- element = $(element).get(0);
- if (isWindow(element)) {
- return null
- } else {
- if (element && "pageY" in element && "pageX" in element) {
- return {
- top: element.pageY,
- left: element.pageX
- }
- }
- }
- return $(element).offset()
- };
- if (!position.inverseAlign) {
- position.inverseAlign = inverseAlign
- }
- if (!position.normalizeAlign) {
- position.normalizeAlign = normalizeAlign
- }
- module.exports = {
- calculateScrollbarWidth: calculateScrollbarWidth,
- calculate: calculatePosition,
- setup: position,
- offset: offset
- }
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/core/utils/view_port.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../renderer */ 2);
- var readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 48);
- var ready = readyCallbacks.add;
- var changeCallback = __webpack_require__( /*! ./callbacks */ 26)();
- var $originalViewPort = $();
- var value = function() {
- var $current;
- return function(element) {
- if (!arguments.length) {
- return $current
- }
- var $element = $(element);
- $originalViewPort = $element;
- var isNewViewportFound = !!$element.length;
- var prevViewPort = value();
- $current = isNewViewportFound ? $element : $("body");
- changeCallback.fire(isNewViewportFound ? value() : $(), prevViewPort)
- }
- }();
- ready(function() {
- value(".dx-viewport")
- });
- exports.value = value;
- exports.changeCallback = changeCallback;
- exports.originalViewPort = function() {
- return $originalViewPort
- }
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.tag_helper.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var tagHelper = {
- toXml: function(tagName, attributes, content) {
- var result = ["<", tagName];
- for (var attributeName in attributes) {
- var attributeValue = attributes[attributeName];
- if ((0, _type.isDefined)(attributeValue)) {
- result.push(" ", attributeName, '="', attributeValue, '"')
- }
- }
- if ((0, _type.isDefined)(content) && "" !== content) {
- result.push(">", content, "</", tagName, ">")
- } else {
- result.push(" />")
- }
- return result.join("")
- }
- };
- exports.default = tagHelper
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/use_jquery.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var config = __webpack_require__( /*! ../../core/config */ 31);
- var useJQuery = config().useJQuery;
- if (jQuery && false !== useJQuery) {
- config({
- useJQuery: true
- })
- }
- module.exports = function() {
- return jQuery && config().useJQuery
- }
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/data/store_helper.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var grep = __webpack_require__( /*! ../core/utils/common */ 4).grep;
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var arrayQuery = __webpack_require__( /*! ./array_query */ 155);
- var normalizeSortingInfo = __webpack_require__( /*! ./utils */ 41).normalizeSortingInfo;
- function multiLevelGroup(query, groupInfo) {
- query = query.groupBy(groupInfo[0].selector);
- if (groupInfo.length > 1) {
- query = query.select(function(g) {
- return extend({}, g, {
- items: multiLevelGroup(arrayQuery(g.items), groupInfo.slice(1)).toArray()
- })
- })
- }
- return query
- }
- function arrangeSortingInfo(groupInfo, sortInfo) {
- var filteredGroup = [];
- each(groupInfo, function(_, group) {
- var collision = grep(sortInfo, function(sort) {
- return group.selector === sort.selector
- });
- if (collision.length < 1) {
- filteredGroup.push(group)
- }
- });
- return filteredGroup.concat(sortInfo)
- }
- function queryByOptions(query, options, isCountQuery) {
- options = options || {};
- var filter = options.filter;
- if (filter) {
- query = query.filter(filter)
- }
- if (isCountQuery) {
- return query
- }
- var sort = options.sort;
- var select = options.select;
- var group = options.group;
- var skip = options.skip;
- var take = options.take;
- if (group) {
- group = normalizeSortingInfo(group);
- group.keepInitialKeyOrder = !!options.group.keepInitialKeyOrder
- }
- if (sort || group) {
- sort = normalizeSortingInfo(sort || []);
- if (group && !group.keepInitialKeyOrder) {
- sort = arrangeSortingInfo(group, sort)
- }
- each(sort, function(index) {
- query = query[index ? "thenBy" : "sortBy"](this.selector, this.desc, this.compare)
- })
- }
- if (select) {
- query = query.select(select)
- }
- if (group) {
- query = multiLevelGroup(query, group)
- }
- if (take || skip) {
- query = query.slice(skip || 0, take)
- }
- return query
- }
- module.exports = {
- multiLevelGroup: multiLevelGroup,
- arrangeSortingInfo: arrangeSortingInfo,
- queryByOptions: queryByOptions
- }
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/events_mixin.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var DefaultEventsStrategy = __webpack_require__( /*! ./events_strategy */ 445);
- var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
- var isPlainObject = __webpack_require__( /*! ./utils/type */ 1).isPlainObject;
- module.exports = {
- ctor: function() {
- this._events = {};
- this.setEventsStrategy(new DefaultEventsStrategy(this))
- },
- setEventsStrategy: function(strategy) {
- if ("function" === typeof strategy) {
- strategy = strategy(this)
- }
- this._eventsStrategy = strategy
- },
- hasEvent: function(eventName) {
- return this._eventsStrategy.hasEvent(eventName)
- },
- fireEvent: function(eventName, eventArgs) {
- this._eventsStrategy.fireEvent(eventName, eventArgs);
- return this
- },
- on: function(eventName, eventHandler) {
- if (isPlainObject(eventName)) {
- each(eventName, function(e, h) {
- this.on(e, h)
- }.bind(this))
- } else {
- this._eventsStrategy.on(eventName, eventHandler)
- }
- return this
- },
- off: function(eventName, eventHandler) {
- this._eventsStrategy.off(eventName, eventHandler);
- return this
- },
- _disposeEvents: function() {
- this._eventsStrategy.dispose()
- }
- }
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/function_template.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
- var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var FunctionTemplate = TemplateBase.inherit({
- ctor: function(render) {
- this._render = render
- },
- _renderCore: function(options) {
- return domUtils.normalizeTemplateElement(this._render(options))
- }
- });
- module.exports = FunctionTemplate
- },
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/data_helper.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var DataSource = __webpack_require__( /*! ./data/data_source/data_source */ 45).DataSource;
- var extend = __webpack_require__( /*! ./core/utils/extend */ 0).extend;
- var normalizeDataSourceOptions = __webpack_require__( /*! ./data/data_source/data_source */ 45).normalizeDataSourceOptions;
- var DATA_SOURCE_OPTIONS_METHOD = "_dataSourceOptions";
- var DATA_SOURCE_CHANGED_METHOD = "_dataSourceChangedHandler";
- var DATA_SOURCE_LOAD_ERROR_METHOD = "_dataSourceLoadErrorHandler";
- var DATA_SOURCE_LOADING_CHANGED_METHOD = "_dataSourceLoadingChangedHandler";
- var DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD = "_dataSourceFromUrlLoadMode";
- var SPECIFIC_DATA_SOURCE_OPTION = "_getSpecificDataSourceOption";
- var DataHelperMixin = {
- postCtor: function() {
- this.on("disposing", function() {
- this._disposeDataSource()
- }.bind(this))
- },
- _refreshDataSource: function() {
- this._initDataSource();
- this._loadDataSource()
- },
- _initDataSource: function() {
- var dataSourceOptions = SPECIFIC_DATA_SOURCE_OPTION in this ? this[SPECIFIC_DATA_SOURCE_OPTION]() : this.option("dataSource");
- var widgetDataSourceOptions;
- var dataSourceType;
- this._disposeDataSource();
- if (dataSourceOptions) {
- if (dataSourceOptions instanceof DataSource) {
- this._isSharedDataSource = true;
- this._dataSource = dataSourceOptions
- } else {
- widgetDataSourceOptions = DATA_SOURCE_OPTIONS_METHOD in this ? this[DATA_SOURCE_OPTIONS_METHOD]() : {};
- dataSourceType = this._dataSourceType ? this._dataSourceType() : DataSource;
- dataSourceOptions = normalizeDataSourceOptions(dataSourceOptions, {
- fromUrlLoadMode: DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD in this && this[DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD]()
- });
- this._dataSource = new dataSourceType(extend(true, {}, widgetDataSourceOptions, dataSourceOptions))
- }
- this._addDataSourceHandlers()
- }
- },
- _addDataSourceHandlers: function() {
- if (DATA_SOURCE_CHANGED_METHOD in this) {
- this._addDataSourceChangeHandler()
- }
- if (DATA_SOURCE_LOAD_ERROR_METHOD in this) {
- this._addDataSourceLoadErrorHandler()
- }
- if (DATA_SOURCE_LOADING_CHANGED_METHOD in this) {
- this._addDataSourceLoadingChangedHandler()
- }
- this._addReadyWatcher()
- },
- _addReadyWatcher: function() {
- this._dataSource.on("loadingChanged", function(isLoading) {
- this._ready && this._ready(!isLoading)
- }.bind(this))
- },
- _addDataSourceChangeHandler: function() {
- var dataSource = this._dataSource;
- this._proxiedDataSourceChangedHandler = function(e) {
- this[DATA_SOURCE_CHANGED_METHOD](dataSource.items(), e)
- }.bind(this);
- dataSource.on("changed", this._proxiedDataSourceChangedHandler)
- },
- _addDataSourceLoadErrorHandler: function() {
- this._proxiedDataSourceLoadErrorHandler = this[DATA_SOURCE_LOAD_ERROR_METHOD].bind(this);
- this._dataSource.on("loadError", this._proxiedDataSourceLoadErrorHandler)
- },
- _addDataSourceLoadingChangedHandler: function() {
- this._proxiedDataSourceLoadingChangedHandler = this[DATA_SOURCE_LOADING_CHANGED_METHOD].bind(this);
- this._dataSource.on("loadingChanged", this._proxiedDataSourceLoadingChangedHandler)
- },
- _loadDataSource: function() {
- if (this._dataSource) {
- var dataSource = this._dataSource;
- if (dataSource.isLoaded()) {
- this._proxiedDataSourceChangedHandler && this._proxiedDataSourceChangedHandler()
- } else {
- dataSource.load()
- }
- }
- },
- _loadSingle: function(key, value) {
- key = "this" === key ? this._dataSource.key() || "this" : key;
- return this._dataSource.loadSingle(key, value)
- },
- _isLastPage: function() {
- return !this._dataSource || this._dataSource.isLastPage() || !this._dataSource._pageSize
- },
- _isDataSourceLoading: function() {
- return this._dataSource && this._dataSource.isLoading()
- },
- _disposeDataSource: function() {
- if (this._dataSource) {
- if (this._isSharedDataSource) {
- delete this._isSharedDataSource;
- this._proxiedDataSourceChangedHandler && this._dataSource.off("changed", this._proxiedDataSourceChangedHandler);
- this._proxiedDataSourceLoadErrorHandler && this._dataSource.off("loadError", this._proxiedDataSourceLoadErrorHandler);
- this._proxiedDataSourceLoadingChangedHandler && this._dataSource.off("loadingChanged", this._proxiedDataSourceLoadingChangedHandler)
- } else {
- this._dataSource.dispose()
- }
- delete this._dataSource;
- delete this._proxiedDataSourceChangedHandler;
- delete this._proxiedDataSourceLoadErrorHandler;
- delete this._proxiedDataSourceLoadingChangedHandler
- }
- },
- getDataSource: function() {
- return this._dataSource || null
- }
- };
- module.exports = DataHelperMixin
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/core/utils/style.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var camelize = __webpack_require__( /*! ./inflector */ 33).camelize;
- var callOnce = __webpack_require__( /*! ./call_once */ 63);
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
- var jsPrefixes = ["", "Webkit", "Moz", "O", "Ms"];
- var cssPrefixes = {
- "": "",
- Webkit: "-webkit-",
- Moz: "-moz-",
- O: "-o-",
- ms: "-ms-"
- };
- var getStyles = callOnce(function() {
- return domAdapter.createElement("dx").style
- });
- var forEachPrefixes = function(prop, callBack) {
- prop = camelize(prop, true);
- var result;
- for (var i = 0, cssPrefixesCount = jsPrefixes.length; i < cssPrefixesCount; i++) {
- var jsPrefix = jsPrefixes[i];
- var prefixedProp = jsPrefix + prop;
- var lowerPrefixedProp = camelize(prefixedProp);
- result = callBack(lowerPrefixedProp, jsPrefix);
- if (void 0 === result) {
- result = callBack(prefixedProp, jsPrefix)
- }
- if (void 0 !== result) {
- break
- }
- }
- return result || ""
- };
- var styleProp = function(name) {
- if (name in getStyles()) {
- return name
- }
- var originalName = name;
- name = name.charAt(0).toUpperCase() + name.substr(1);
- for (var i = 1; i < jsPrefixes.length; i++) {
- var prefixedProp = jsPrefixes[i].toLowerCase() + name;
- if (prefixedProp in getStyles()) {
- return prefixedProp
- }
- }
- return originalName
- };
- var stylePropPrefix = function(prop) {
- return forEachPrefixes(prop, function(specific, jsPrefix) {
- if (specific in getStyles()) {
- return cssPrefixes[jsPrefix]
- }
- })
- };
- var pxExceptions = ["fillOpacity", "columnCount", "flexGrow", "flexShrink", "fontWeight", "lineHeight", "opacity", "zIndex", "zoom"];
- var normalizeStyleProp = function(prop, value) {
- if (typeUtils.isNumeric(value) && pxExceptions.indexOf(prop) === -1) {
- value += "px"
- }
- return value
- };
- var setDimensionProperty = function(elements, propertyName, value) {
- if (elements) {
- value = typeUtils.isNumeric(value) ? value += "px" : value;
- for (var i = 0; i < elements.length; ++i) {
- elements[i].style[propertyName] = value
- }
- }
- };
- var setWidth = function(elements, value) {
- setDimensionProperty(elements, "width", value)
- };
- var setHeight = function(elements, value) {
- setDimensionProperty(elements, "height", value)
- };
- exports.styleProp = styleProp;
- exports.stylePropPrefix = stylePropPrefix;
- exports.normalizeStyleProp = normalizeStyleProp;
- exports.setWidth = setWidth;
- exports.setHeight = setHeight
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/core/utils/variable_wrapper.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var logger = __webpack_require__( /*! ./console */ 73).logger;
- var dependencyInjector = __webpack_require__( /*! ./dependency_injector */ 54);
- module.exports = dependencyInjector({
- isWrapped: function() {
- return false
- },
- isWritableWrapped: function() {
- return false
- },
- wrap: function(value) {
- return value
- },
- unwrap: function(value) {
- return value
- },
- assign: function() {
- logger.error("Method 'assign' should not be used for not wrapped variables. Use 'isWrapped' method for ensuring.")
- }
- })
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/localization/core.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
- module.exports = dependencyInjector({
- locale: function() {
- var currentLocale = "en";
- return function(locale) {
- if (!locale) {
- return currentLocale
- }
- currentLocale = locale
- }
- }()
- })
- },
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/events/hold.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var Emitter = __webpack_require__( /*! ./core/emitter */ 123);
- var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
- var abs = Math.abs;
- var HOLD_EVENT_NAME = "dxhold";
- var HOLD_TIMEOUT = 750;
- var TOUCH_BOUNDARY = 5;
- var HoldEmitter = Emitter.inherit({
- start: function(e) {
- this._startEventData = eventUtils.eventData(e);
- this._startTimer(e)
- },
- _startTimer: function(e) {
- var holdTimeout = "timeout" in this ? this.timeout : HOLD_TIMEOUT;
- this._holdTimer = setTimeout(function() {
- this._requestAccept(e);
- this._fireEvent(HOLD_EVENT_NAME, e, {
- target: e.target
- });
- this._forgetAccept()
- }.bind(this), holdTimeout)
- },
- move: function(e) {
- if (this._touchWasMoved(e)) {
- this._cancel(e)
- }
- },
- _touchWasMoved: function(e) {
- var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
- return abs(delta.x) > TOUCH_BOUNDARY || abs(delta.y) > TOUCH_BOUNDARY
- },
- end: function() {
- this._stopTimer()
- },
- _stopTimer: function() {
- clearTimeout(this._holdTimer)
- },
- cancel: function() {
- this._stopTimer()
- },
- dispose: function() {
- this._stopTimer()
- }
- });
- registerEmitter({
- emitter: HoldEmitter,
- bubble: true,
- events: [HOLD_EVENT_NAME]
- });
- module.exports = {
- name: HOLD_EVENT_NAME
- }
- }, , , , ,
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/viz/core/export.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.plugin = exports.ExportMenu = exports.combineMarkups = exports.exportWidgets = exports.getMarkup = exports.exportFromMarkup = void 0;
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
- var _utils = __webpack_require__( /*! ./utils */ 10);
- var _exporter = __webpack_require__( /*! ../../exporter */ 170);
- var _exporter2 = _interopRequireDefault(_exporter);
- var _message = __webpack_require__( /*! ../../localization/message */ 13);
- var _message2 = _interopRequireDefault(_message);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _themes = __webpack_require__( /*! ../themes */ 50);
- var _themes2 = _interopRequireDefault(_themes);
- var _hover = __webpack_require__( /*! ../../events/hover */ 148);
- var _hover2 = _interopRequireDefault(_hover);
- var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
- var _pointer2 = _interopRequireDefault(_pointer);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var imageExporter = _exporter2.default.image;
- var svgExporter = _exporter2.default.svg;
- var pdfExporter = _exporter2.default.pdf;
- var pointerActions = [_pointer2.default.down, _pointer2.default.move].join(" ");
- var BUTTON_SIZE = 35;
- var ICON_COORDS = [
- [9, 12, 26, 12, 26, 14, 9, 14],
- [9, 17, 26, 17, 26, 19, 9, 19],
- [9, 22, 26, 22, 26, 24, 9, 24]
- ];
- var LIST_PADDING_TOP = 4;
- var LIST_WIDTH = 120;
- var VERTICAL_TEXT_MARGIN = 8;
- var HORIZONTAL_TEXT_MARGIN = 15;
- var MENU_ITEM_HEIGHT = 30;
- var LIST_STROKE_WIDTH = 1;
- var MARGIN = 10;
- var SHADOW_OFFSET = 2;
- var SHADOW_BLUR = 3;
- var DEFAULT_EXPORT_FORMAT = "PNG";
- var ALLOWED_IMAGE_FORMATS = [DEFAULT_EXPORT_FORMAT, "JPEG", "GIF"];
- var ALLOWED_EXTRA_FORMATS = ["PDF", "SVG"];
- var EXPORT_CSS_CLASS = "dx-export-menu";
- var EXPORT_DATA_KEY = "export-element-type";
- var FORMAT_DATA_KEY = "export-element-format";
- var GET_COLOR_REGEX = /data-backgroundcolor="([^"]*)"/;
- function getValidFormats() {
- var imageFormats = imageExporter.testFormats(ALLOWED_IMAGE_FORMATS);
- return {
- unsupported: imageFormats.unsupported,
- supported: imageFormats.supported.concat(ALLOWED_EXTRA_FORMATS)
- }
- }
- function validateFormat(format, incidentOccurred, validFormats) {
- validFormats = validFormats || getValidFormats();
- format = String(format).toUpperCase();
- if (validFormats.supported.indexOf(format) !== -1) {
- return format
- }
- if (validFormats.unsupported.indexOf(format) !== -1) {
- incidentOccurred && incidentOccurred("W2108", [format])
- }
- }
- function getCreatorFunc(format) {
- if ("SVG" === format) {
- return svgExporter.getData
- } else {
- if ("PDF" === format) {
- return pdfExporter.getData
- } else {
- return imageExporter.getData
- }
- }
- }
- function _print(imageSrc, options) {
- var document = (0, _window.getWindow)().document;
- var iFrame = document.createElement("iframe");
- iFrame.onload = setPrint(imageSrc, options);
- iFrame.style.visibility = "hidden";
- iFrame.style.position = "fixed";
- iFrame.style.right = "0";
- iFrame.style.bottom = "0";
- document.body.appendChild(iFrame)
- }
- function setPrint(imageSrc, options) {
- return function() {
- var _this = this;
- var window = this.contentWindow;
- var img = window.document.createElement("img");
- window.document.body.appendChild(img);
- var origImageSrc = imageSrc;
- if (options.__test) {
- imageSrc = options.__test.imageSrc;
- window = options.__test.mockWindow
- }
- var removeFrame = function() {
- options.__test && options.__test.checkAssertions();
- _this.parentElement.removeChild(_this);
- options.__test && options.__test.deferred.resolve(origImageSrc)
- };
- img.addEventListener("load", function() {
- window.focus();
- window.print();
- removeFrame()
- });
- img.addEventListener("error", removeFrame);
- img.src = imageSrc
- }
- }
- function getItemAttributes(options, type, itemIndex) {
- var x = BUTTON_SIZE - LIST_WIDTH;
- var y = BUTTON_SIZE + LIST_PADDING_TOP + LIST_STROKE_WIDTH + itemIndex * MENU_ITEM_HEIGHT;
- var attr = {
- rect: {
- width: LIST_WIDTH - 2 * LIST_STROKE_WIDTH,
- height: MENU_ITEM_HEIGHT,
- x: x + LIST_STROKE_WIDTH,
- y: y
- },
- text: {
- x: x + (options.rtl ? LIST_WIDTH - HORIZONTAL_TEXT_MARGIN : HORIZONTAL_TEXT_MARGIN),
- y: y + MENU_ITEM_HEIGHT - VERTICAL_TEXT_MARGIN
- }
- };
- if ("printing" === type) {
- attr.separator = {
- stroke: options.button.default.borderColor,
- "stroke-width": LIST_STROKE_WIDTH,
- cursor: "pointer",
- sharp: "v",
- d: "M " + x + " " + (y + MENU_ITEM_HEIGHT - LIST_STROKE_WIDTH) + " L " + (x + LIST_WIDTH) + " " + (y + MENU_ITEM_HEIGHT - LIST_STROKE_WIDTH)
- }
- }
- return attr
- }
- function createMenuItem(renderer, options, settings) {
- var itemData = {};
- var type = settings.type;
- var format = settings.format;
- var attr = getItemAttributes(options, type, settings.itemIndex);
- var fontStyle = (0, _utils.patchFontOptions)(options.font);
- fontStyle["pointer-events"] = "none";
- var menuItem = renderer.g().attr({
- "class": EXPORT_CSS_CLASS + "-list-item"
- });
- itemData[EXPORT_DATA_KEY] = type;
- if (format) {
- itemData[FORMAT_DATA_KEY] = format
- }
- var rect = renderer.rect();
- rect.attr(attr.rect).css({
- cursor: "pointer",
- "pointer-events": "all"
- }).data(itemData);
- rect.on(_hover2.default.start + ".export", function() {
- return rect.attr({
- fill: options.button.hover.backgroundColor
- })
- }).on(_hover2.default.end + ".export", function() {
- return rect.attr({
- fill: null
- })
- });
- rect.append(menuItem);
- var text = renderer.text(settings.text).css(fontStyle).attr(attr.text).append(menuItem);
- if ("printing" === type) {
- renderer.path(null, "line").attr(attr.separator).append(menuItem)
- }
- return {
- g: menuItem,
- rect: rect,
- resetState: function() {
- return rect.attr({
- fill: null
- })
- },
- fixPosition: function() {
- var textBBox = text.getBBox();
- text.move(attr.text.x - textBBox.x - (options.rtl ? textBBox.width : 0))
- }
- }
- }
- function createMenuItems(renderer, options) {
- var items = [];
- if (options.printingEnabled) {
- items.push(createMenuItem(renderer, options, {
- type: "printing",
- text: _message2.default.format("vizExport-printingButtonText"),
- itemIndex: items.length
- }))
- }
- items = options.formats.reduce(function(r, format) {
- r.push(createMenuItem(renderer, options, {
- type: "exporting",
- text: _message2.default.getFormatter("vizExport-exportButtonText")(format),
- format: format,
- itemIndex: r.length
- }));
- return r
- }, items);
- return items
- }
- function getBackgroundColorFromMarkup(markup) {
- var parsedMarkup = GET_COLOR_REGEX.exec(markup);
- return parsedMarkup ? parsedMarkup[1] : void 0
- }
- var exportFromMarkup = exports.exportFromMarkup = function(markup, options) {
- options.format = validateFormat(options.format) || DEFAULT_EXPORT_FORMAT;
- options.fileName = options.fileName || "file";
- options.exportingAction = options.onExporting;
- options.exportedAction = options.onExported;
- options.fileSavingAction = options.onFileSaving;
- options.margin = (0, _type.isDefined)(options.margin) ? options.margin : MARGIN;
- options.backgroundColor = (0, _type.isDefined)(options.backgroundColor) ? options.backgroundColor : getBackgroundColorFromMarkup(markup);
- _exporter2.default.export(markup, options, getCreatorFunc(options.format))
- };
- exports.getMarkup = function(widgets) {
- return combineMarkups(widgets).markup
- };
- exports.exportWidgets = function(widgets, options) {
- options = options || {};
- var markupInfo = exports.combineMarkups(widgets, {
- gridLayout: options.gridLayout,
- verticalAlignment: options.verticalAlignment,
- horizontalAlignment: options.horizontalAlignment
- });
- options.width = markupInfo.width;
- options.height = markupInfo.height;
- exportFromMarkup(markupInfo.markup, options)
- };
- var combineMarkups = exports.combineMarkups = function(widgets) {
- var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
- if (!Array.isArray(widgets)) {
- widgets = [
- [widgets]
- ]
- } else {
- if (!Array.isArray(widgets[0])) {
- widgets = widgets.map(function(item) {
- return [item]
- })
- }
- }
- var compactView = !options.gridLayout;
- var exportItems = widgets.reduce(function(r, row, rowIndex) {
- var rowInfo = row.reduce(function(r, item, colIndex) {
- var size = item.getSize();
- var backgroundColor = item.option("backgroundColor") || _themes2.default.getTheme(item.option("theme")).backgroundColor;
- backgroundColor && r.backgroundColors.indexOf(backgroundColor) === -1 && r.backgroundColors.push(backgroundColor);
- r.hOffset = r.width;
- r.width += size.width;
- r.height = Math.max(r.height, size.height);
- r.itemWidth = Math.max(r.itemWidth, size.width);
- r.items.push({
- markup: item.svg(),
- width: size.width,
- height: size.height,
- c: colIndex,
- r: rowIndex,
- hOffset: r.hOffset
- });
- return r
- }, {
- items: [],
- height: 0,
- itemWidth: 0,
- hOffset: 0,
- width: 0,
- backgroundColors: r.backgroundColors
- });
- r.rowOffsets.push(r.totalHeight);
- r.rowHeights.push(rowInfo.height);
- r.totalHeight += rowInfo.height;
- r.items = r.items.concat(rowInfo.items);
- r.itemWidth = Math.max(r.itemWidth, rowInfo.itemWidth);
- r.maxItemLen = Math.max(r.maxItemLen, rowInfo.items.length);
- r.totalWidth = compactView ? Math.max(r.totalWidth, rowInfo.width) : r.maxItemLen * r.itemWidth;
- return r
- }, {
- items: [],
- rowOffsets: [],
- rowHeights: [],
- itemWidth: 0,
- totalHeight: 0,
- maxItemLen: 0,
- totalWidth: 0,
- backgroundColors: []
- });
- var backgroundColor = 'data-backgroundcolor="'.concat(1 === exportItems.backgroundColors.length ? exportItems.backgroundColors[0] : "", '" ');
- var getVOffset = function(item) {
- var align = options.verticalAlignment;
- var dy = exportItems.rowHeights[item.r] - item.height;
- return exportItems.rowOffsets[item.r] + ("bottom" === align ? dy : "center" === align ? dy / 2 : 0)
- };
- var getHOffset = function(item) {
- if (compactView) {
- return item.hOffset
- }
- var align = options.horizontalAlignment;
- var colWidth = exportItems.itemWidth;
- var dx = colWidth - item.width;
- return item.c * colWidth + ("right" === align ? dx : "center" === align ? dx / 2 : 0)
- };
- var totalHeight = exportItems.totalHeight;
- var totalWidth = exportItems.totalWidth;
- return {
- markup: "<svg " + backgroundColor + 'height="' + totalHeight + '" width="' + totalWidth + '" version="1.1" xmlns="http://www.w3.org/2000/svg">' + exportItems.items.map(function(item) {
- return '<g transform="translate('.concat(getHOffset(item), ",").concat(getVOffset(item), ')">').concat(item.markup, "</g>")
- }).join("") + "</svg>",
- width: totalWidth,
- height: totalHeight
- }
- };
- var ExportMenu = exports.ExportMenu = function(params) {
- var renderer = this._renderer = params.renderer;
- this._incidentOccurred = params.incidentOccurred;
- this._exportTo = params.exportTo;
- this._print = params.print;
- this._shadow = renderer.shadowFilter("-50%", "-50%", "200%", "200%", SHADOW_OFFSET, 6, SHADOW_BLUR);
- this._shadow.attr({
- opacity: .8
- });
- this._group = renderer.g().attr({
- "class": EXPORT_CSS_CLASS,
- "hidden-for-export": true
- }).linkOn(renderer.root, {
- name: "export-menu",
- after: "peripheral"
- });
- this._buttonGroup = renderer.g().attr({
- "class": EXPORT_CSS_CLASS + "-button"
- }).append(this._group);
- this._listGroup = renderer.g().attr({
- "class": EXPORT_CSS_CLASS + "-list"
- }).append(this._group);
- this._overlay = renderer.rect(-LIST_WIDTH + BUTTON_SIZE, BUTTON_SIZE + LIST_PADDING_TOP, LIST_WIDTH, 0);
- this._overlay.attr({
- "stroke-width": LIST_STROKE_WIDTH,
- cursor: "pointer",
- rx: 4,
- ry: 4,
- filter: this._shadow.id
- });
- this._overlay.data({
- "export-element-type": "list"
- });
- this.validFormats = getValidFormats();
- this._subscribeEvents()
- };
- (0, _extend.extend)(ExportMenu.prototype, {
- getLayoutOptions: function() {
- if (this._hiddenDueToLayout) {
- return {
- width: 0,
- height: 0,
- cutSide: "vertical",
- cutLayoutSide: "top"
- }
- }
- var bBox = this._buttonGroup.getBBox();
- bBox.cutSide = "vertical";
- bBox.cutLayoutSide = "top";
- bBox.height += MARGIN;
- bBox.position = {
- vertical: "top",
- horizontal: "right"
- };
- bBox.verticalAlignment = "top";
- bBox.horizontalAlignment = "right";
- return bBox
- },
- probeDraw: function() {
- this._fillSpace();
- this.show()
- },
- shift: function(_, y) {
- this._group.attr({
- translateY: this._group.attr("translateY") + y
- })
- },
- draw: function(width, height, canvas) {
- this._group.move(width - BUTTON_SIZE - SHADOW_OFFSET - SHADOW_BLUR + canvas.left, Math.floor(height / 2 - BUTTON_SIZE / 2));
- var layoutOptions = this.getLayoutOptions();
- if (layoutOptions.width > width || layoutOptions.height > height) {
- this.freeSpace()
- }
- return this
- },
- show: function() {
- this._group.linkAppend()
- },
- hide: function() {
- this._group.linkRemove()
- },
- setOptions: function(options) {
- var _this2 = this;
- this._options = options;
- if (options.formats) {
- options.formats = options.formats.reduce(function(r, format) {
- format = validateFormat(format, _this2._incidentOccurred, _this2.validFormats);
- format && r.push(format);
- return r
- }, [])
- } else {
- options.formats = this.validFormats.supported.slice()
- }
- options.printingEnabled = void 0 === options.printingEnabled ? true : options.printingEnabled;
- if (options.enabled && (options.formats.length || options.printingEnabled)) {
- this.show();
- this._updateButton();
- this._updateList();
- this._hideList()
- } else {
- this.hide()
- }
- },
- dispose: function() {
- this._unsubscribeEvents();
- this._group.linkRemove().linkOff();
- this._group.dispose();
- this._shadow.dispose()
- },
- layoutOptions: function() {
- return this._options.enabled && {
- horizontalAlignment: "right",
- verticalAlignment: "top",
- weak: true
- }
- },
- measure: function() {
- this._fillSpace();
- var margin = this._options.button.margin;
- return [BUTTON_SIZE + margin.left + margin.right, BUTTON_SIZE + margin.top + margin.bottom]
- },
- move: function(rect) {
- var margin = this._options.button.margin;
- this._group.attr({
- translateX: Math.round(rect[0]) + margin.left,
- translateY: Math.round(rect[1]) + margin.top
- })
- },
- _fillSpace: function() {
- this._hiddenDueToLayout = false;
- this.show()
- },
- freeSpace: function() {
- this._incidentOccurred("W2107");
- this._hiddenDueToLayout = true;
- this.hide()
- },
- _hideList: function() {
- this._listGroup.remove();
- this._listShown = false;
- this._setButtonState("default");
- this._menuItems.forEach(function(item) {
- return item.resetState()
- })
- },
- _showList: function() {
- this._listGroup.append(this._group);
- this._listShown = true;
- this._menuItems.forEach(function(item) {
- return item.fixPosition()
- })
- },
- _setButtonState: function(state) {
- var style = this._options.button[state];
- this._button.attr({
- stroke: style.borderColor,
- fill: style.backgroundColor
- });
- this._icon.attr({
- fill: style.color
- })
- },
- _subscribeEvents: function() {
- var _this3 = this;
- this._renderer.root.on(_pointer2.default.up + ".export", function(e) {
- var elementType = e.target[EXPORT_DATA_KEY];
- if (!elementType) {
- if (_this3._button) {
- _this3._hideList()
- }
- return
- }
- if ("button" === elementType) {
- if (_this3._listShown) {
- _this3._setButtonState("default");
- _this3._hideList()
- } else {
- _this3._setButtonState("focus");
- _this3._showList()
- }
- } else {
- if ("printing" === elementType) {
- _this3._print();
- _this3._hideList()
- } else {
- if ("exporting" === elementType) {
- _this3._exportTo(e.target[FORMAT_DATA_KEY]);
- _this3._hideList()
- }
- }
- }
- });
- this._listGroup.on(pointerActions, function(e) {
- return e.stopPropagation()
- });
- this._buttonGroup.on(_pointer2.default.enter, function() {
- return _this3._setButtonState("hover")
- });
- this._buttonGroup.on(_pointer2.default.leave, function() {
- return _this3._setButtonState(_this3._listShown ? "focus" : "default")
- });
- this._buttonGroup.on(_pointer2.default.down + ".export", function() {
- return _this3._setButtonState("active")
- })
- },
- _unsubscribeEvents: function() {
- this._renderer.root.off(".export");
- this._listGroup.off();
- this._buttonGroup.off()
- },
- _updateButton: function() {
- var renderer = this._renderer;
- var options = this._options;
- var exportData = {
- "export-element-type": "button"
- };
- if (!this._button) {
- this._button = renderer.rect(0, 0, BUTTON_SIZE, BUTTON_SIZE).append(this._buttonGroup);
- this._button.attr({
- rx: 4,
- ry: 4,
- fill: options.button.default.backgroundColor,
- stroke: options.button.default.borderColor,
- "stroke-width": 1,
- cursor: "pointer"
- });
- this._button.data(exportData);
- this._icon = renderer.path(ICON_COORDS).append(this._buttonGroup);
- this._icon.attr({
- fill: options.button.default.color,
- cursor: "pointer"
- });
- this._icon.data(exportData);
- this._buttonGroup.setTitle(_message2.default.format("vizExport-titleMenuText"))
- }
- },
- _updateList: function() {
- var options = this._options;
- var buttonDefault = options.button.default;
- var listGroup = this._listGroup;
- var items = createMenuItems(this._renderer, options);
- this._shadow.attr({
- color: options.shadowColor
- });
- this._overlay.attr({
- height: items.length * MENU_ITEM_HEIGHT + 2 * LIST_STROKE_WIDTH,
- fill: buttonDefault.backgroundColor,
- stroke: buttonDefault.borderColor
- });
- listGroup.clear();
- this._overlay.append(listGroup);
- items.forEach(function(item) {
- return item.g.append(listGroup)
- });
- this._menuItems = items
- }
- });
- function getExportOptions(widget, exportOptions, fileName, format) {
- if (format || exportOptions.format) {
- format = validateFormat(format || exportOptions.format, widget._incidentOccurred)
- }
- return {
- format: format || DEFAULT_EXPORT_FORMAT,
- fileName: fileName || exportOptions.fileName || "file",
- proxyUrl: exportOptions.proxyUrl,
- backgroundColor: exportOptions.backgroundColor,
- width: widget._canvas.width,
- height: widget._canvas.height,
- margin: exportOptions.margin,
- forceProxy: exportOptions.forceProxy,
- exportingAction: widget._createActionByOption("onExporting"),
- exportedAction: widget._createActionByOption("onExported"),
- fileSavingAction: widget._createActionByOption("onFileSaving")
- }
- }
- exports.plugin = {
- name: "export",
- init: function() {
- var _this4 = this;
- this._exportMenu = new exports.ExportMenu({
- renderer: this._renderer,
- incidentOccurred: this._incidentOccurred,
- print: function() {
- return _this4.print()
- },
- exportTo: function(format) {
- return _this4.exportTo(void 0, format)
- }
- });
- this._layout.add(this._exportMenu)
- },
- dispose: function() {
- this._exportMenu.dispose()
- },
- members: {
- _getExportMenuOptions: function() {
- return (0, _extend.extend)({}, this._getOption("export"), {
- rtl: this._getOption("rtlEnabled", true)
- })
- },
- _disablePointerEvents: function() {
- var pointerEventsValue = this._renderer.root.attr("pointer-events");
- this._renderer.root.attr({
- "pointer-events": "none"
- });
- return pointerEventsValue
- },
- exportTo: function(fileName, format) {
- var _this5 = this;
- var menu = this._exportMenu;
- var options = getExportOptions(this, this._getOption("export") || {}, fileName, format);
- menu && menu.hide();
- var pointerEventsValue = this._disablePointerEvents();
- _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).done(function() {
- _this5._renderer.root.attr({
- "pointer-events": pointerEventsValue
- })
- });
- menu && menu.show()
- },
- print: function() {
- var _this6 = this;
- var menu = this._exportMenu;
- var options = getExportOptions(this, this._getOption("export") || {});
- options.__test = this._getOption("export").__test;
- options.exportingAction = null;
- options.exportedAction = null;
- options.margin = 0;
- options.format = "PNG";
- options.forceProxy = true;
- options.fileSavingAction = function(eventArgs) {
- _print("data:image/png;base64,".concat(eventArgs.data), {
- __test: options.__test
- });
- eventArgs.cancel = true
- };
- var pointerEventsValue = this._disablePointerEvents();
- menu && menu.hide();
- _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).done(function() {
- _this6._renderer.root.attr({
- "pointer-events": pointerEventsValue
- })
- });
- menu && menu.show()
- }
- },
- customize: function(constructor) {
- var proto = constructor.prototype;
- constructor.addChange({
- code: "EXPORT",
- handler: function() {
- this._exportMenu.setOptions(this._getExportMenuOptions());
- this._change(["LAYOUT"])
- },
- isThemeDependent: true,
- isOptionChange: true,
- option: "export"
- });
- proto._optionChangesMap.onExporting = "EXPORT";
- proto._optionChangesMap.onExported = "EXPORT";
- proto._optionChangesMap.onFileSaving = "EXPORT"
- },
- fontFields: ["export.font"]
- }
- },
- /*!***************************************!*\
- !*** ./artifacts/transpiled/color.js ***!
- \***************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var standardColorNames = {
- aliceblue: "f0f8ff",
- antiquewhite: "faebd7",
- aqua: "00ffff",
- aquamarine: "7fffd4",
- azure: "f0ffff",
- beige: "f5f5dc",
- bisque: "ffe4c4",
- black: "000000",
- blanchedalmond: "ffebcd",
- blue: "0000ff",
- blueviolet: "8a2be2",
- brown: "a52a2a",
- burlywood: "deb887",
- cadetblue: "5f9ea0",
- chartreuse: "7fff00",
- chocolate: "d2691e",
- coral: "ff7f50",
- cornflowerblue: "6495ed",
- cornsilk: "fff8dc",
- crimson: "dc143c",
- cyan: "00ffff",
- darkblue: "00008b",
- darkcyan: "008b8b",
- darkgoldenrod: "b8860b",
- darkgray: "a9a9a9",
- darkgreen: "006400",
- darkkhaki: "bdb76b",
- darkmagenta: "8b008b",
- darkolivegreen: "556b2f",
- darkorange: "ff8c00",
- darkorchid: "9932cc",
- darkred: "8b0000",
- darksalmon: "e9967a",
- darkseagreen: "8fbc8f",
- darkslateblue: "483d8b",
- darkslategray: "2f4f4f",
- darkturquoise: "00ced1",
- darkviolet: "9400d3",
- deeppink: "ff1493",
- deepskyblue: "00bfff",
- dimgray: "696969",
- dodgerblue: "1e90ff",
- feldspar: "d19275",
- firebrick: "b22222",
- floralwhite: "fffaf0",
- forestgreen: "228b22",
- fuchsia: "ff00ff",
- gainsboro: "dcdcdc",
- ghostwhite: "f8f8ff",
- gold: "ffd700",
- goldenrod: "daa520",
- gray: "808080",
- green: "008000",
- greenyellow: "adff2f",
- honeydew: "f0fff0",
- hotpink: "ff69b4",
- indianred: "cd5c5c",
- indigo: "4b0082",
- ivory: "fffff0",
- khaki: "f0e68c",
- lavender: "e6e6fa",
- lavenderblush: "fff0f5",
- lawngreen: "7cfc00",
- lemonchiffon: "fffacd",
- lightblue: "add8e6",
- lightcoral: "f08080",
- lightcyan: "e0ffff",
- lightgoldenrodyellow: "fafad2",
- lightgrey: "d3d3d3",
- lightgreen: "90ee90",
- lightpink: "ffb6c1",
- lightsalmon: "ffa07a",
- lightseagreen: "20b2aa",
- lightskyblue: "87cefa",
- lightslateblue: "8470ff",
- lightslategray: "778899",
- lightsteelblue: "b0c4de",
- lightyellow: "ffffe0",
- lime: "00ff00",
- limegreen: "32cd32",
- linen: "faf0e6",
- magenta: "ff00ff",
- maroon: "800000",
- mediumaquamarine: "66cdaa",
- mediumblue: "0000cd",
- mediumorchid: "ba55d3",
- mediumpurple: "9370d8",
- mediumseagreen: "3cb371",
- mediumslateblue: "7b68ee",
- mediumspringgreen: "00fa9a",
- mediumturquoise: "48d1cc",
- mediumvioletred: "c71585",
- midnightblue: "191970",
- mintcream: "f5fffa",
- mistyrose: "ffe4e1",
- moccasin: "ffe4b5",
- navajowhite: "ffdead",
- navy: "000080",
- oldlace: "fdf5e6",
- olive: "808000",
- olivedrab: "6b8e23",
- orange: "ffa500",
- orangered: "ff4500",
- orchid: "da70d6",
- palegoldenrod: "eee8aa",
- palegreen: "98fb98",
- paleturquoise: "afeeee",
- palevioletred: "d87093",
- papayawhip: "ffefd5",
- peachpuff: "ffdab9",
- peru: "cd853f",
- pink: "ffc0cb",
- plum: "dda0dd",
- powderblue: "b0e0e6",
- purple: "800080",
- rebeccapurple: "663399",
- red: "ff0000",
- rosybrown: "bc8f8f",
- royalblue: "4169e1",
- saddlebrown: "8b4513",
- salmon: "fa8072",
- sandybrown: "f4a460",
- seagreen: "2e8b57",
- seashell: "fff5ee",
- sienna: "a0522d",
- silver: "c0c0c0",
- skyblue: "87ceeb",
- slateblue: "6a5acd",
- slategray: "708090",
- snow: "fffafa",
- springgreen: "00ff7f",
- steelblue: "4682b4",
- tan: "d2b48c",
- teal: "008080",
- thistle: "d8bfd8",
- tomato: "ff6347",
- turquoise: "40e0d0",
- violet: "ee82ee",
- violetred: "d02090",
- wheat: "f5deb3",
- white: "ffffff",
- whitesmoke: "f5f5f5",
- yellow: "ffff00",
- yellowgreen: "9acd32"
- };
- var standardColorTypes = [{
- re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
- process: function(colorString) {
- return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10)]
- }
- }, {
- re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*\.*\d+)\)$/,
- process: function(colorString) {
- return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10), parseFloat(colorString[4])]
- }
- }, {
- re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/,
- process: function(colorString) {
- return [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16)]
- }
- }, {
- re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/,
- process: function(colorString) {
- return [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16)]
- }
- }, {
- re: /^hsv\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
- process: function(colorString) {
- var h = parseInt(colorString[1], 10);
- var s = parseInt(colorString[2], 10);
- var v = parseInt(colorString[3], 10);
- var rgb = hsvToRgb(h, s, v);
- return [rgb[0], rgb[1], rgb[2], 1, [h, s, v]]
- }
- }, {
- re: /^hsl\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
- process: function(colorString) {
- var h = parseInt(colorString[1], 10);
- var s = parseInt(colorString[2], 10);
- var l = parseInt(colorString[3], 10);
- var rgb = hslToRgb(h, s, l);
- return [rgb[0], rgb[1], rgb[2], 1, null, [h, s, l]]
- }
- }];
- function Color(value) {
- this.baseColor = value;
- var color;
- if (value) {
- color = String(value).toLowerCase().replace(/ /g, "");
- color = standardColorNames[color] ? "#" + standardColorNames[color] : color;
- color = parseColor(color)
- }
- if (!color) {
- this.colorIsInvalid = true
- }
- color = color || {};
- this.r = normalize(color[0]);
- this.g = normalize(color[1]);
- this.b = normalize(color[2]);
- this.a = normalize(color[3], 1, 1);
- if (color[4]) {
- this.hsv = {
- h: color[4][0],
- s: color[4][1],
- v: color[4][2]
- }
- } else {
- this.hsv = toHsvFromRgb(this.r, this.g, this.b)
- }
- if (color[5]) {
- this.hsl = {
- h: color[5][0],
- s: color[5][1],
- l: color[5][2]
- }
- } else {
- this.hsl = toHslFromRgb(this.r, this.g, this.b)
- }
- }
- function parseColor(color) {
- if ("transparent" === color) {
- return [0, 0, 0, 0]
- }
- var i = 0;
- var ii = standardColorTypes.length;
- var str;
- for (; i < ii; ++i) {
- str = standardColorTypes[i].re.exec(color);
- if (str) {
- return standardColorTypes[i].process(str)
- }
- }
- return null
- }
- function normalize(colorComponent, def, max) {
- def = def || 0;
- max = max || 255;
- return colorComponent < 0 || isNaN(colorComponent) ? def : colorComponent > max ? max : colorComponent
- }
- function toHexFromRgb(r, g, b) {
- return "#" + (16777216 | r << 16 | g << 8 | b).toString(16).slice(1)
- }
- function toHsvFromRgb(r, g, b) {
- var max = Math.max(r, g, b);
- var min = Math.min(r, g, b);
- var delta = max - min;
- var H;
- var S;
- var V;
- V = max;
- S = 0 === max ? 0 : 1 - min / max;
- if (max === min) {
- H = 0
- } else {
- switch (max) {
- case r:
- H = 60 * ((g - b) / delta);
- if (g < b) {
- H += 360
- }
- break;
- case g:
- H = 60 * ((b - r) / delta) + 120;
- break;
- case b:
- H = 60 * ((r - g) / delta) + 240
- }
- }
- S *= 100;
- V *= 100 / 255;
- return {
- h: Math.round(H),
- s: Math.round(S),
- v: Math.round(V)
- }
- }
- function hsvToRgb(h, s, v) {
- var r;
- var g;
- var b;
- var index = Math.floor(h % 360 / 60);
- var vMin = (100 - s) * v / 100;
- var a = (v - vMin) * (h % 60 / 60);
- var vInc = vMin + a;
- var vDec = v - a;
- switch (index) {
- case 0:
- r = v;
- g = vInc;
- b = vMin;
- break;
- case 1:
- r = vDec;
- g = v;
- b = vMin;
- break;
- case 2:
- r = vMin;
- g = v;
- b = vInc;
- break;
- case 3:
- r = vMin;
- g = vDec;
- b = v;
- break;
- case 4:
- r = vInc;
- g = vMin;
- b = v;
- break;
- case 5:
- r = v;
- g = vMin;
- b = vDec
- }
- return [Math.round(2.55 * r), Math.round(2.55 * g), Math.round(2.55 * b)]
- }
- function calculateHue(r, g, b, delta) {
- var max = Math.max(r, g, b);
- switch (max) {
- case r:
- return (g - b) / delta + (g < b ? 6 : 0);
- case g:
- return (b - r) / delta + 2;
- case b:
- return (r - g) / delta + 4
- }
- }
- function toHslFromRgb(r, g, b) {
- r = convertTo01Bounds(r, 255);
- g = convertTo01Bounds(g, 255);
- b = convertTo01Bounds(b, 255);
- var max = Math.max(r, g, b);
- var min = Math.min(r, g, b);
- var maxMinSum = max + min;
- var h;
- var s;
- var l = maxMinSum / 2;
- if (max === min) {
- h = s = 0
- } else {
- var delta = max - min;
- if (l > .5) {
- s = delta / (2 - maxMinSum)
- } else {
- s = delta / maxMinSum
- }
- h = calculateHue(r, g, b, delta);
- h /= 6
- }
- return {
- h: _round(360 * h),
- s: _round(100 * s),
- l: _round(100 * l)
- }
- }
- function makeColorTint(colorPart, h) {
- var colorTint = h;
- if ("r" === colorPart) {
- colorTint = h + 1 / 3
- }
- if ("b" === colorPart) {
- colorTint = h - 1 / 3
- }
- return colorTint
- }
- function modifyColorTint(colorTint) {
- if (colorTint < 0) {
- colorTint += 1
- }
- if (colorTint > 1) {
- colorTint -= 1
- }
- return colorTint
- }
- function hueToRgb(p, q, colorTint) {
- colorTint = modifyColorTint(colorTint);
- if (colorTint < 1 / 6) {
- return p + 6 * (q - p) * colorTint
- }
- if (colorTint < .5) {
- return q
- }
- if (colorTint < 2 / 3) {
- return p + (q - p) * (2 / 3 - colorTint) * 6
- }
- return p
- }
- function hslToRgb(h, s, l) {
- var r;
- var g;
- var b;
- h = convertTo01Bounds(h, 360);
- s = convertTo01Bounds(s, 100);
- l = convertTo01Bounds(l, 100);
- if (0 === s) {
- r = g = b = l
- } else {
- var q = l < .5 ? l * (1 + s) : l + s - l * s;
- var p = 2 * l - q;
- r = hueToRgb(p, q, makeColorTint("r", h));
- g = hueToRgb(p, q, makeColorTint("g", h));
- b = hueToRgb(p, q, makeColorTint("b", h))
- }
- return [_round(255 * r), _round(255 * g), _round(255 * b)]
- }
- function convertTo01Bounds(n, max) {
- n = Math.min(max, Math.max(0, parseFloat(n)));
- if (Math.abs(n - max) < 1e-6) {
- return 1
- }
- return n % max / parseFloat(max)
- }
- function isIntegerBetweenMinAndMax(number, min, max) {
- min = min || 0;
- max = max || 255;
- if (number % 1 !== 0 || number < min || number > max || "number" !== typeof number || isNaN(number)) {
- return false
- }
- return true
- }
- var _round = Math.round;
- Color.prototype = {
- constructor: Color,
- highlight: function(step) {
- step = step || 10;
- return this.alter(step).toHex()
- },
- darken: function(step) {
- step = step || 10;
- return this.alter(-step).toHex()
- },
- alter: function(step) {
- var result = new Color;
- result.r = normalize(this.r + step);
- result.g = normalize(this.g + step);
- result.b = normalize(this.b + step);
- return result
- },
- blend: function(blendColor, opacity) {
- var other = blendColor instanceof Color ? blendColor : new Color(blendColor);
- var result = new Color;
- result.r = normalize(_round(this.r * (1 - opacity) + other.r * opacity));
- result.g = normalize(_round(this.g * (1 - opacity) + other.g * opacity));
- result.b = normalize(_round(this.b * (1 - opacity) + other.b * opacity));
- return result
- },
- toHex: function() {
- return toHexFromRgb(this.r, this.g, this.b)
- },
- getPureColor: function() {
- var rgb = hsvToRgb(this.hsv.h, 100, 100);
- return new Color("rgb(" + rgb.join(",") + ")")
- },
- isValidHex: function(hex) {
- return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex)
- },
- isValidRGB: function(r, g, b) {
- if (!isIntegerBetweenMinAndMax(r) || !isIntegerBetweenMinAndMax(g) || !isIntegerBetweenMinAndMax(b)) {
- return false
- }
- return true
- },
- isValidAlpha: function(a) {
- if (isNaN(a) || a < 0 || a > 1 || "number" !== typeof a) {
- return false
- }
- return true
- },
- colorIsInvalid: false,
- fromHSL: function(hsl) {
- var color = new Color;
- var rgb = hslToRgb(hsl.h, hsl.s, hsl.l);
- color.r = rgb[0];
- color.g = rgb[1];
- color.b = rgb[2];
- return color
- }
- };
- module.exports = Color
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/events/core/emitter_registrator.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var registerEvent = __webpack_require__( /*! ./event_registrator */ 71);
- var eventUtils = __webpack_require__( /*! ../utils */ 8);
- var pointerEvents = __webpack_require__( /*! ../pointer */ 23);
- var wheelEvent = __webpack_require__( /*! ./wheel */ 124);
- var MANAGER_EVENT = "dxEventManager";
- var EMITTER_DATA = "dxEmitter";
- var EventManager = Class.inherit({
- ctor: function() {
- this._attachHandlers();
- this.reset();
- this._proxiedCancelHandler = this._cancelHandler.bind(this);
- this._proxiedAcceptHandler = this._acceptHandler.bind(this)
- },
- _attachHandlers: function() {
- readyCallbacks.add(function() {
- var document = domAdapter.getDocument();
- eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.down, MANAGER_EVENT), this._pointerDownHandler.bind(this));
- eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.move, MANAGER_EVENT), this._pointerMoveHandler.bind(this));
- eventsEngine.subscribeGlobal(document, eventUtils.addNamespace([pointerEvents.up, pointerEvents.cancel].join(" "), MANAGER_EVENT), this._pointerUpHandler.bind(this));
- eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(wheelEvent.name, MANAGER_EVENT), this._mouseWheelHandler.bind(this))
- }.bind(this))
- },
- _eachEmitter: function(callback) {
- var activeEmitters = this._activeEmitters || [];
- var i = 0;
- while (activeEmitters.length > i) {
- var emitter = activeEmitters[i];
- if (false === callback(emitter)) {
- break
- }
- if (activeEmitters[i] === emitter) {
- i++
- }
- }
- },
- _applyToEmitters: function(method, arg) {
- this._eachEmitter(function(emitter) {
- emitter[method].call(emitter, arg)
- })
- },
- reset: function() {
- this._eachEmitter(this._proxiedCancelHandler);
- this._activeEmitters = []
- },
- resetEmitter: function(emitter) {
- this._proxiedCancelHandler(emitter)
- },
- _pointerDownHandler: function(e) {
- if (eventUtils.isMouseEvent(e) && e.which > 1) {
- return
- }
- this._updateEmitters(e)
- },
- _updateEmitters: function(e) {
- if (!this._isSetChanged(e)) {
- return
- }
- this._cleanEmitters(e);
- this._fetchEmitters(e)
- },
- _isSetChanged: function(e) {
- var currentSet = this._closestEmitter(e);
- var previousSet = this._emittersSet || [];
- var setChanged = currentSet.length !== previousSet.length;
- each(currentSet, function(index, emitter) {
- setChanged = setChanged || previousSet[index] !== emitter;
- return !setChanged
- });
- this._emittersSet = currentSet;
- return setChanged
- },
- _closestEmitter: function(e) {
- var that = this;
- var result = [];
- var $element = $(e.target);
- function handleEmitter(_, emitter) {
- if (!!emitter && emitter.validatePointers(e) && emitter.validate(e)) {
- emitter.addCancelCallback(that._proxiedCancelHandler);
- emitter.addAcceptCallback(that._proxiedAcceptHandler);
- result.push(emitter)
- }
- }
- while ($element.length) {
- var emitters = dataUtils.data($element.get(0), EMITTER_DATA) || [];
- each(emitters, handleEmitter);
- $element = $element.parent()
- }
- return result
- },
- _acceptHandler: function(acceptedEmitter, e) {
- var that = this;
- this._eachEmitter(function(emitter) {
- if (emitter !== acceptedEmitter) {
- that._cancelEmitter(emitter, e)
- }
- })
- },
- _cancelHandler: function(canceledEmitter, e) {
- this._cancelEmitter(canceledEmitter, e)
- },
- _cancelEmitter: function(emitter, e) {
- var activeEmitters = this._activeEmitters;
- if (e) {
- emitter.cancel(e)
- } else {
- emitter.reset()
- }
- emitter.removeCancelCallback();
- emitter.removeAcceptCallback();
- var emitterIndex = inArray(emitter, activeEmitters);
- if (emitterIndex > -1) {
- activeEmitters.splice(emitterIndex, 1)
- }
- },
- _cleanEmitters: function(e) {
- this._applyToEmitters("end", e);
- this.reset(e)
- },
- _fetchEmitters: function(e) {
- this._activeEmitters = this._emittersSet.slice();
- this._applyToEmitters("start", e)
- },
- _pointerMoveHandler: function(e) {
- this._applyToEmitters("move", e)
- },
- _pointerUpHandler: function(e) {
- this._updateEmitters(e)
- },
- _mouseWheelHandler: function(e) {
- if (!this._allowInterruptionByMouseWheel()) {
- return
- }
- e.pointers = [null];
- this._pointerDownHandler(e);
- this._adjustWheelEvent(e);
- this._pointerMoveHandler(e);
- e.pointers = [];
- this._pointerUpHandler(e)
- },
- _allowInterruptionByMouseWheel: function() {
- var allowInterruption = true;
- this._eachEmitter(function(emitter) {
- allowInterruption = emitter.allowInterruptionByMouseWheel() && allowInterruption;
- return allowInterruption
- });
- return allowInterruption
- },
- _adjustWheelEvent: function(e) {
- var closestGestureEmitter = null;
- this._eachEmitter(function(emitter) {
- if (!emitter.gesture) {
- return
- }
- var direction = emitter.getDirection(e);
- if ("horizontal" !== direction && !e.shiftKey || "vertical" !== direction && e.shiftKey) {
- closestGestureEmitter = emitter;
- return false
- }
- });
- if (!closestGestureEmitter) {
- return
- }
- var direction = closestGestureEmitter.getDirection(e);
- var verticalGestureDirection = "both" === direction && !e.shiftKey || "vertical" === direction;
- var prop = verticalGestureDirection ? "pageY" : "pageX";
- e[prop] += e.delta
- },
- isActive: function(element) {
- var result = false;
- this._eachEmitter(function(emitter) {
- result = result || emitter.getElement().is(element)
- });
- return result
- }
- });
- var eventManager = new EventManager;
- var EMITTER_SUBSCRIPTION_DATA = "dxEmitterSubscription";
- var registerEmitter = function(emitterConfig) {
- var emitterClass = emitterConfig.emitter;
- var emitterName = emitterConfig.events[0];
- var emitterEvents = emitterConfig.events;
- each(emitterEvents, function(_, eventName) {
- registerEvent(eventName, {
- noBubble: !emitterConfig.bubble,
- setup: function(element) {
- var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA) || {};
- var emitters = dataUtils.data(element, EMITTER_DATA) || {};
- var emitter = emitters[emitterName] || new emitterClass(element);
- subscriptions[eventName] = true;
- emitters[emitterName] = emitter;
- dataUtils.data(element, EMITTER_DATA, emitters);
- dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA, subscriptions)
- },
- add: function(element, handleObj) {
- var emitters = dataUtils.data(element, EMITTER_DATA);
- var emitter = emitters[emitterName];
- emitter.configure(extend({
- delegateSelector: handleObj.selector
- }, handleObj.data), handleObj.type)
- },
- teardown: function(element) {
- var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA);
- var emitters = dataUtils.data(element, EMITTER_DATA);
- var emitter = emitters[emitterName];
- delete subscriptions[eventName];
- var disposeEmitter = true;
- each(emitterEvents, function(_, eventName) {
- disposeEmitter = disposeEmitter && !subscriptions[eventName];
- return disposeEmitter
- });
- if (disposeEmitter) {
- if (eventManager.isActive(element)) {
- eventManager.resetEmitter(emitter)
- }
- emitter && emitter.dispose();
- delete emitters[emitterName]
- }
- }
- })
- })
- };
- module.exports = registerEmitter
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/core/base_widget.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var version = __webpack_require__( /*! ../../core/version */ 157);
- var _windowResizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130);
- var _stringFormat = __webpack_require__( /*! ../../core/utils/string */ 44).format;
- var _isObject = __webpack_require__( /*! ../../core/utils/type */ 1).isObject;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var themeManagerModule = __webpack_require__( /*! ../core/base_theme_manager */ 241);
- var _floor = Math.floor;
- var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
- var helpers = __webpack_require__( /*! ./helpers */ 142);
- var _parseScalar = __webpack_require__( /*! ./utils */ 10).parseScalar;
- var errors = __webpack_require__( /*! ./errors_warnings */ 764);
- var _log = errors.log;
- var rendererModule = __webpack_require__( /*! ./renderers/renderer */ 175);
- var _Layout = __webpack_require__( /*! ./layout */ 766);
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var OPTION_RTL_ENABLED = "rtlEnabled";
- var SIZED_ELEMENT_CLASS = "dx-sized-element";
- var _option = DOMComponent.prototype.option;
- function getTrue() {
- return true
- }
- function getFalse() {
- return false
- }
- function areCanvasesDifferent(canvas1, canvas2) {
- return !(canvas1.width === canvas2.width && canvas1.height === canvas2.height && canvas1.left === canvas2.left && canvas1.top === canvas2.top && canvas1.right === canvas2.right && canvas1.bottom === canvas2.bottom)
- }
- function createResizeHandler(callback) {
- var timeout;
- var handler = function() {
- clearTimeout(timeout);
- timeout = setTimeout(callback, 100)
- };
- handler.dispose = function() {
- clearTimeout(timeout);
- return this
- };
- return handler
- }
- function defaultOnIncidentOccurred(e) {
- if (!e.component.hasEvent("incidentOccurred")) {
- _log.apply(null, [e.target.id].concat(e.target.args || []))
- }
- }
- var createIncidentOccurred = function(widgetName, eventTrigger) {
- return function(id, args) {
- eventTrigger("incidentOccurred", {
- target: {
- id: id,
- type: "E" === id[0] ? "error" : "warning",
- args: args,
- text: _stringFormat.apply(null, [errors.ERROR_MESSAGES[id]].concat(args || [])),
- widget: widgetName,
- version: version
- }
- })
- }
- };
- function pickPositiveValue(values) {
- return values.reduce(function(result, value) {
- return value > 0 && !result ? value : result
- }, 0)
- }
- var getEmptyComponent = function() {
- var emptyComponentConfig = {};
- emptyComponentConfig.ctor = function(element, options) {
- this.callBase(element, options);
- var sizedElement = domAdapter.createElement("div");
- var width = options && typeUtils.isNumeric(options.width) ? options.width + "px" : "100%";
- var height = options && typeUtils.isNumeric(options.height) ? options.height + "px" : this._getDefaultSize().height + "px";
- domAdapter.setStyle(sizedElement, "width", width);
- domAdapter.setStyle(sizedElement, "height", height);
- domAdapter.setClass(sizedElement, SIZED_ELEMENT_CLASS);
- domAdapter.insertElement(element, sizedElement)
- };
- var EmptyComponent = DOMComponent.inherit(emptyComponentConfig);
- var originalInherit = EmptyComponent.inherit;
- EmptyComponent.inherit = function(config) {
- for (var field in config) {
- if (typeUtils.isFunction(config[field]) && "_" !== field.substr(0, 1) || "_dispose" === field || "_optionChanged" === field) {
- config[field] = noop
- }
- }
- return originalInherit.call(this, config)
- };
- return EmptyComponent
- };
- var isServerSide = !windowUtils.hasWindow();
- function sizeIsValid(value) {
- return typeUtils.isDefined(value) && value > 0
- }
- module.exports = isServerSide ? getEmptyComponent() : DOMComponent.inherit({
- _eventsMap: {
- onIncidentOccurred: {
- name: "incidentOccurred"
- },
- onDrawn: {
- name: "drawn"
- }
- },
- _getDefaultOptions: function() {
- return extend(this.callBase(), {
- onIncidentOccurred: defaultOnIncidentOccurred
- })
- },
- _useLinks: true,
- _init: function() {
- var that = this;
- that._$element.children("." + SIZED_ELEMENT_CLASS).remove();
- that.callBase.apply(that, arguments);
- that._changesLocker = 0;
- that._optionChangedLocker = 0;
- that._changes = helpers.changes();
- that._suspendChanges();
- that._themeManager = that._createThemeManager();
- that._themeManager.setCallback(function() {
- that._requestChange(that._themeDependentChanges)
- });
- that._renderElementAttributes();
- that._initRenderer();
- var linkTarget = that._useLinks && that._renderer.root;
- linkTarget && linkTarget.enableLinks().virtualLink("core").virtualLink("peripheral");
- that._renderVisibilityChange();
- that._attachVisibilityChangeHandlers();
- that._toggleParentsScrollSubscription(this._isVisible());
- that._initEventTrigger();
- that._incidentOccurred = createIncidentOccurred(that.NAME, that._eventTrigger);
- that._layout = new _Layout;
- linkTarget && linkTarget.linkAfter("core");
- that._initPlugins();
- that._initCore();
- linkTarget && linkTarget.linkAfter();
- that._change(that._initialChanges)
- },
- _createThemeManager: function() {
- return new themeManagerModule.BaseThemeManager(this._getThemeManagerOptions())
- },
- _getThemeManagerOptions: function() {
- return {
- themeSection: this._themeSection,
- fontFields: this._fontFields
- }
- },
- _initialChanges: ["LAYOUT", "RESIZE_HANDLER", "THEME", "DISABLED"],
- _initPlugins: function() {
- var that = this;
- each(that._plugins, function(_, plugin) {
- plugin.init.call(that)
- })
- },
- _disposePlugins: function() {
- var that = this;
- each(that._plugins.slice().reverse(), function(_, plugin) {
- plugin.dispose.call(that)
- })
- },
- _change: function(codes) {
- this._changes.add(codes)
- },
- _suspendChanges: function() {
- ++this._changesLocker
- },
- _resumeChanges: function() {
- var that = this;
- if (0 === --that._changesLocker && that._changes.count() > 0 && !that._applyingChanges) {
- that._renderer.lock();
- that._applyingChanges = true;
- that._applyChanges();
- that._changes.reset();
- that._applyingChanges = false;
- that._renderer.unlock();
- if (that._optionsQueue) {
- that._applyQueuedOptions()
- }
- that._optionChangedLocker++;
- that._notify();
- that._optionChangedLocker--
- }
- },
- _applyQueuedOptions: function() {
- var that = this;
- var queue = that._optionsQueue;
- that._optionsQueue = null;
- that.beginUpdate();
- each(queue, function(_, action) {
- action()
- });
- that.endUpdate()
- },
- _requestChange: function(codes) {
- this._suspendChanges();
- this._change(codes);
- this._resumeChanges()
- },
- _applyChanges: function() {
- var that = this;
- var changes = that._changes;
- var order = that._totalChangesOrder;
- var i;
- var ii = order.length;
- for (i = 0; i < ii; ++i) {
- if (changes.has(order[i])) {
- that["_change_" + order[i]]()
- }
- }
- },
- _optionChangesOrder: ["EVENTS", "THEME", "RENDERER", "RESIZE_HANDLER"],
- _layoutChangesOrder: ["ELEMENT_ATTR", "CONTAINER_SIZE", "LAYOUT"],
- _customChangesOrder: ["DISABLED"],
- _change_EVENTS: function() {
- this._eventTrigger.applyChanges()
- },
- _change_THEME: function() {
- this._setThemeAndRtl()
- },
- _change_RENDERER: function() {
- this._setRendererOptions()
- },
- _change_RESIZE_HANDLER: function() {
- this._setupResizeHandler()
- },
- _change_ELEMENT_ATTR: function() {
- this._renderElementAttributes();
- this._change(["CONTAINER_SIZE"])
- },
- _change_CONTAINER_SIZE: function() {
- this._updateSize()
- },
- _change_LAYOUT: function() {
- this._setContentSize()
- },
- _change_DISABLED: function() {
- var renderer = this._renderer;
- var root = renderer.root;
- if (this.option("disabled")) {
- this._initDisabledState = root.attr("pointer-events");
- root.attr({
- "pointer-events": "none",
- filter: renderer.getGrayScaleFilter().id
- })
- } else {
- if ("none" === root.attr("pointer-events")) {
- root.attr({
- "pointer-events": typeUtils.isDefined(this._initDisabledState) ? this._initDisabledState : null,
- filter: null
- })
- }
- }
- },
- _themeDependentChanges: ["RENDERER"],
- _initRenderer: function() {
- var that = this;
- that._canvas = that._calculateCanvas();
- that._renderer = new rendererModule.Renderer({
- cssClass: that._rootClassPrefix + " " + that._rootClass,
- pathModified: that.option("pathModified"),
- container: that._$element[0]
- });
- that._renderer.resize(that._canvas.width, that._canvas.height)
- },
- _disposeRenderer: function() {
- this._useLinks && this._renderer.root.checkLinks();
- this._renderer.dispose()
- },
- _getAnimationOptions: noop,
- render: function() {
- this._requestChange(["CONTAINER_SIZE"]);
- var visible = this._isVisible();
- this._toggleParentsScrollSubscription(visible);
- !visible && this._stopCurrentHandling()
- },
- _toggleParentsScrollSubscription: function(subscribe) {
- var $parents = $(this._renderer.root.element).parents();
- var scrollEvents = "scroll.viz_widgets";
- if ("generic" === devices.real().platform) {
- $parents = $parents.add(windowUtils.getWindow())
- }
- this._proxiedTargetParentsScrollHandler = this._proxiedTargetParentsScrollHandler || function() {
- this._stopCurrentHandling()
- }.bind(this);
- eventsEngine.off($().add(this._$prevRootParents), scrollEvents, this._proxiedTargetParentsScrollHandler);
- if (subscribe) {
- eventsEngine.on($parents, scrollEvents, this._proxiedTargetParentsScrollHandler);
- this._$prevRootParents = $parents
- }
- },
- _stopCurrentHandling: noop,
- _dispose: function() {
- var that = this;
- that.callBase.apply(that, arguments);
- that._toggleParentsScrollSubscription(false);
- that._removeResizeHandler();
- that._layout.dispose();
- that._eventTrigger.dispose();
- that._disposeCore();
- that._disposePlugins();
- that._disposeRenderer();
- that._themeManager.dispose();
- that._themeManager = that._renderer = that._eventTrigger = null
- },
- _initEventTrigger: function() {
- var that = this;
- that._eventTrigger = createEventTrigger(that._eventsMap, function(name) {
- return that._createActionByOption(name)
- })
- },
- _calculateCanvas: function() {
- var that = this;
- var size = that.option("size") || {};
- var margin = that.option("margin") || {};
- var defaultCanvas = that._getDefaultSize() || {};
- var elementWidth = !sizeIsValid(size.width) && windowUtils.hasWindow() ? that._$element.width() : 0;
- var elementHeight = !sizeIsValid(size.height) && windowUtils.hasWindow() ? that._$element.height() : 0;
- var canvas = {
- width: size.width <= 0 ? 0 : _floor(pickPositiveValue([size.width, elementWidth, defaultCanvas.width])),
- height: size.height <= 0 ? 0 : _floor(pickPositiveValue([size.height, elementHeight, defaultCanvas.height])),
- left: pickPositiveValue([margin.left, defaultCanvas.left]),
- top: pickPositiveValue([margin.top, defaultCanvas.top]),
- right: pickPositiveValue([margin.right, defaultCanvas.right]),
- bottom: pickPositiveValue([margin.bottom, defaultCanvas.bottom])
- };
- if (canvas.width - canvas.left - canvas.right <= 0 || canvas.height - canvas.top - canvas.bottom <= 0) {
- canvas = {
- width: 0,
- height: 0
- }
- }
- return canvas
- },
- _updateSize: function() {
- var that = this;
- var canvas = that._calculateCanvas();
- that._renderer.fixPlacement();
- if (areCanvasesDifferent(that._canvas, canvas) || that.__forceRender) {
- that._canvas = canvas;
- that._recreateSizeDependentObjects(true);
- that._renderer.resize(canvas.width, canvas.height);
- that._change(["LAYOUT"])
- }
- },
- _recreateSizeDependentObjects: noop,
- _getMinSize: function() {
- return [0, 0]
- },
- _getAlignmentRect: noop,
- _setContentSize: function() {
- var canvas = this._canvas;
- var layout = this._layout;
- var rect = canvas.width > 0 && canvas.height > 0 ? [canvas.left, canvas.top, canvas.width - canvas.right, canvas.height - canvas.bottom] : [0, 0, 0, 0];
- rect = layout.forward(rect, this._getMinSize());
- var nextRect = this._applySize(rect) || rect;
- layout.backward(nextRect, this._getAlignmentRect() || nextRect)
- },
- DEBUG_getCanvas: function() {
- return this._canvas
- },
- DEBUG_getEventTrigger: function() {
- return this._eventTrigger
- },
- _getOption: function(name, isScalar) {
- var theme = this._themeManager.theme(name);
- var option = this.option(name);
- return isScalar ? void 0 !== option ? option : theme : extend(true, {}, theme, option)
- },
- _setupResizeHandler: function() {
- var that = this;
- var redrawOnResize = _parseScalar(this._getOption("redrawOnResize", true), true);
- if (that._resizeHandler) {
- that._removeResizeHandler()
- }
- that._resizeHandler = createResizeHandler(function() {
- if (redrawOnResize) {
- that._requestChange(["CONTAINER_SIZE"])
- } else {
- that._renderer.fixPlacement()
- }
- });
- _windowResizeCallbacks.add(that._resizeHandler)
- },
- _removeResizeHandler: function() {
- if (this._resizeHandler) {
- _windowResizeCallbacks.remove(this._resizeHandler);
- this._resizeHandler.dispose();
- this._resizeHandler = null
- }
- },
- _onBeginUpdate: noop,
- beginUpdate: function() {
- var that = this;
- if (that._initialized && 0 === that._updateLockCount) {
- that._onBeginUpdate();
- that._suspendChanges()
- }
- that.callBase.apply(that, arguments);
- return that
- },
- endUpdate: function() {
- var that = this;
- that.callBase.apply(that, arguments);
- if (0 === that._updateLockCount) {
- that._resumeChanges()
- }
- return that
- },
- option: function(name) {
- var that = this;
- if (that._initialized && that._applyingChanges && (arguments.length > 1 || _isObject(name))) {
- that._optionsQueue = that._optionsQueue || [];
- that._optionsQueue.push(that._getActionForUpdating(arguments))
- } else {
- return _option.apply(that, arguments)
- }
- },
- _getActionForUpdating: function(args) {
- var that = this;
- return that._deprecatedOptionsSuppressed ? function() {
- that._suppressDeprecatedWarnings();
- _option.apply(that, args);
- that._resumeDeprecatedWarnings()
- } : function() {
- _option.apply(that, args)
- }
- },
- _clean: noop,
- _render: noop,
- _optionChanged: function(arg) {
- var that = this;
- if (that._optionChangedLocker) {
- return
- }
- var partialChanges = that.getPartialChangeOptionsName(arg);
- var changes = [];
- if (partialChanges.length > 0) {
- partialChanges.forEach(function(pc) {
- return changes.push(that._partialOptionChangesMap[pc])
- })
- } else {
- changes.push(that._optionChangesMap[arg.name])
- }
- changes = changes.filter(function(c) {
- return !!c
- });
- if (that._eventTrigger.change(arg.name)) {
- that._change(["EVENTS"])
- } else {
- if (changes.length > 0) {
- that._change(changes)
- } else {
- that.callBase.apply(that, arguments)
- }
- }
- },
- _notify: noop,
- _optionChangesMap: {
- size: "CONTAINER_SIZE",
- margin: "CONTAINER_SIZE",
- redrawOnResize: "RESIZE_HANDLER",
- theme: "THEME",
- rtlEnabled: "THEME",
- encodeHtml: "THEME",
- elementAttr: "ELEMENT_ATTR",
- disabled: "DISABLED"
- },
- _partialOptionChangesMap: {},
- _partialOptionChangesPath: {},
- getPartialChangeOptionsName: function(changedOption) {
- var that = this;
- var fullName = changedOption.fullName;
- var sections = fullName.split(/[.]/);
- var name = changedOption.name;
- var value = changedOption.value;
- var options = this._partialOptionChangesPath[name];
- var partialChangeOptionsName = [];
- if (options) {
- if (true === options) {
- partialChangeOptionsName.push(name)
- } else {
- options.forEach(function(op) {
- fullName.indexOf(op) >= 0 && partialChangeOptionsName.push(op)
- });
- if (1 === sections.length) {
- if ("object" === typeUtils.type(value)) {
- that._addOptionsNameForPartialUpdate(value, options, partialChangeOptionsName)
- } else {
- if ("array" === typeUtils.type(value)) {
- if (value.length > 0 && value.every(function(item) {
- return that._checkOptionsForPartialUpdate(item, options)
- })) {
- value.forEach(function(item) {
- return that._addOptionsNameForPartialUpdate(item, options, partialChangeOptionsName)
- })
- }
- }
- }
- }
- }
- }
- return partialChangeOptionsName.filter(function(value, index, self) {
- return self.indexOf(value) === index
- })
- },
- _checkOptionsForPartialUpdate: function(optionObject, options) {
- return !Object.keys(optionObject).some(function(key) {
- return options.indexOf(key) === -1
- })
- },
- _addOptionsNameForPartialUpdate: function(optionObject, options, partialChangeOptionsName) {
- var optionKeys = Object.keys(optionObject);
- if (this._checkOptionsForPartialUpdate(optionObject, options)) {
- optionKeys.forEach(function(key) {
- return options.indexOf(key) > -1 && partialChangeOptionsName.push(key)
- })
- }
- },
- _visibilityChanged: function() {
- this.render()
- },
- _setThemeAndRtl: function() {
- this._themeManager.setTheme(this.option("theme"), this.option(OPTION_RTL_ENABLED))
- },
- _getRendererOptions: function() {
- return {
- rtl: this.option(OPTION_RTL_ENABLED),
- encodeHtml: this.option("encodeHtml"),
- animation: this._getAnimationOptions()
- }
- },
- _setRendererOptions: function() {
- this._renderer.setOptions(this._getRendererOptions())
- },
- svg: function() {
- return this._renderer.svg()
- },
- getSize: function() {
- var canvas = this._canvas || {};
- return {
- width: canvas.width,
- height: canvas.height
- }
- },
- isReady: getFalse,
- _dataIsReady: getTrue,
- _resetIsReady: function() {
- this.isReady = getFalse
- },
- _drawn: function() {
- var that = this;
- that.isReady = getFalse;
- if (that._dataIsReady()) {
- that._renderer.onEndAnimation(function() {
- that.isReady = getTrue
- })
- }
- that._eventTrigger("drawn", {})
- }
- });
- helpers.replaceInherit(module.exports);
- function createEventTrigger(eventsMap, callbackGetter) {
- var triggers = {};
- each(eventsMap, function(name, info) {
- if (info.name) {
- createEvent(name)
- }
- });
- var changes;
- triggerEvent.change = function(name) {
- var eventInfo = eventsMap[name];
- if (eventInfo) {
- (changes = changes || {})[name] = eventInfo
- }
- return !!eventInfo
- };
- triggerEvent.applyChanges = function() {
- if (changes) {
- each(changes, function(name, eventInfo) {
- createEvent(eventInfo.newName || name)
- });
- changes = null
- }
- };
- triggerEvent.dispose = function() {
- eventsMap = callbackGetter = triggers = null
- };
- return triggerEvent;
- function createEvent(name) {
- var eventInfo = eventsMap[name];
- triggers[eventInfo.name] = callbackGetter(name)
- }
- function triggerEvent(name, arg, complete) {
- triggers[name](arg);
- complete && complete()
- }
- }
- module.exports.DEBUG_createEventTrigger = createEventTrigger;
- module.exports.DEBUG_createIncidentOccurred = createIncidentOccurred;
- module.exports.DEBUG_stub_createIncidentOccurred = function(stub) {
- createIncidentOccurred = stub
- };
- module.exports.DEBUG_restore_createIncidentOccurred = function() {
- createIncidentOccurred = module.exports.DEBUG_createIncidentOccurred
- };
- module.exports.DEBUG_createResizeHandler = createResizeHandler
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/position.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _config = __webpack_require__( /*! ../config */ 31);
- var _config2 = _interopRequireDefault(_config);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var getDefaultAlignment = function(isRtlEnabled) {
- var rtlEnabled = null !== isRtlEnabled && void 0 !== isRtlEnabled ? isRtlEnabled : (0, _config2.default)().rtlEnabled;
- return rtlEnabled ? "right" : "left"
- };
- exports.getDefaultAlignment = getDefaultAlignment
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/data/abstract_store.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../core/class */ 15);
- var abstract = Class.abstract;
- var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82);
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var errorsModule = __webpack_require__( /*! ./errors */ 36);
- var dataUtils = __webpack_require__( /*! ./utils */ 41);
- var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter;
- var storeHelper = __webpack_require__( /*! ./store_helper */ 81);
- var queryByOptions = storeHelper.queryByOptions;
- var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
- var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
- var storeImpl = {};
- var Store = Class.inherit({
- ctor: function(options) {
- var that = this;
- options = options || {};
- each(["onLoaded", "onLoading", "onInserted", "onInserting", "onUpdated", "onUpdating", "onPush", "onRemoved", "onRemoving", "onModified", "onModifying"], function(_, optionName) {
- if (optionName in options) {
- that.on(optionName.slice(2).toLowerCase(), options[optionName])
- }
- });
- this._key = options.key;
- this._errorHandler = options.errorHandler;
- this._useDefaultSearch = true
- },
- _customLoadOptions: function() {
- return null
- },
- key: function() {
- return this._key
- },
- keyOf: function(obj) {
- if (!this._keyGetter) {
- this._keyGetter = compileGetter(this.key())
- }
- return this._keyGetter(obj)
- },
- _requireKey: function() {
- if (!this.key()) {
- throw errorsModule.errors.Error("E4005")
- }
- },
- load: function(options) {
- var that = this;
- options = options || {};
- this.fireEvent("loading", [options]);
- return this._withLock(this._loadImpl(options)).done(function(result) {
- that.fireEvent("loaded", [result, options])
- })
- },
- _loadImpl: function(options) {
- return queryByOptions(this.createQuery(options), options).enumerate()
- },
- _withLock: function(task) {
- var result = new Deferred;
- task.done(function() {
- var that = this;
- var args = arguments;
- dataUtils.processRequestResultLock.promise().done(function() {
- result.resolveWith(that, args)
- })
- }).fail(function() {
- result.rejectWith(this, arguments)
- });
- return result
- },
- createQuery: abstract,
- totalCount: function(options) {
- return this._totalCountImpl(options)
- },
- _totalCountImpl: function(options) {
- return queryByOptions(this.createQuery(options), options, true).count()
- },
- byKey: function(key, extraOptions) {
- return this._addFailHandlers(this._withLock(this._byKeyImpl(key, extraOptions)))
- },
- _byKeyImpl: abstract,
- insert: function(values) {
- var that = this;
- that.fireEvent("modifying");
- that.fireEvent("inserting", [values]);
- return that._addFailHandlers(that._insertImpl(values).done(function(callbackValues, callbackKey) {
- that.fireEvent("inserted", [callbackValues, callbackKey]);
- that.fireEvent("modified")
- }))
- },
- _insertImpl: abstract,
- update: function(key, values) {
- var that = this;
- that.fireEvent("modifying");
- that.fireEvent("updating", [key, values]);
- return that._addFailHandlers(that._updateImpl(key, values).done(function() {
- that.fireEvent("updated", [key, values]);
- that.fireEvent("modified")
- }))
- },
- _updateImpl: abstract,
- push: function(changes) {
- this._pushImpl(changes);
- this.fireEvent("push", [changes])
- },
- _pushImpl: noop,
- remove: function(key) {
- var that = this;
- that.fireEvent("modifying");
- that.fireEvent("removing", [key]);
- return that._addFailHandlers(that._removeImpl(key).done(function(callbackKey) {
- that.fireEvent("removed", [callbackKey]);
- that.fireEvent("modified")
- }))
- },
- _removeImpl: abstract,
- _addFailHandlers: function(deferred) {
- return deferred.fail(this._errorHandler).fail(errorsModule._errorHandler)
- }
- }).include(EventsMixin);
- Store.create = function(alias, options) {
- if (!(alias in storeImpl)) {
- throw errorsModule.errors.Error("E4020", alias)
- }
- return new storeImpl[alias](options)
- };
- Store.registerClass = function(type, alias) {
- if (alias) {
- storeImpl[alias] = type
- }
- return type
- };
- Store.inherit = function(inheritor) {
- return function(members, alias) {
- var type = inheritor.apply(this, [members]);
- Store.registerClass(type, alias);
- return type
- }
- }(Store.inherit);
- module.exports = Store
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/ui/validation_engine.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../core/class */ 15);
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82);
- var errors = __webpack_require__( /*! ../core/errors */ 21);
- var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
- var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
- var numberLocalization = __webpack_require__( /*! ../localization/number */ 51);
- var messageLocalization = __webpack_require__( /*! ../localization/message */ 13);
- var BaseRuleValidator = Class.inherit({
- NAME: "base",
- defaultMessage: function(value) {
- return messageLocalization.getFormatter("validation-" + this.NAME)(value)
- },
- defaultFormattedMessage: function(value) {
- return messageLocalization.getFormatter("validation-" + this.NAME + "-formatted")(value)
- },
- _isValueEmpty: function(value) {
- return !rulesValidators.required.validate(value, {})
- },
- validate: function(value, rule) {
- var valueArray = Array.isArray(value) ? value : [value];
- var result = true;
- if (valueArray.length) {
- valueArray.every(function(itemValue) {
- result = this._validate(itemValue, rule);
- return result
- }, this)
- } else {
- result = this._validate(null, rule)
- }
- return result
- }
- });
- var RequiredRuleValidator = BaseRuleValidator.inherit({
- NAME: "required",
- _validate: function(value, rule) {
- if (!typeUtils.isDefined(value)) {
- return false
- }
- if (false === value) {
- return false
- }
- value = String(value);
- if (rule.trim || !typeUtils.isDefined(rule.trim)) {
- value = value.trim()
- }
- return "" !== value
- }
- });
- var NumericRuleValidator = BaseRuleValidator.inherit({
- NAME: "numeric",
- _validate: function(value, rule) {
- if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
- return true
- }
- if (rule.useCultureSettings && typeUtils.isString(value)) {
- return !isNaN(numberLocalization.parse(value))
- } else {
- return typeUtils.isNumeric(value)
- }
- }
- });
- var RangeRuleValidator = BaseRuleValidator.inherit({
- NAME: "range",
- _validate: function(value, rule) {
- if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
- return true
- }
- var validNumber = rulesValidators.numeric.validate(value, rule);
- var validValue = typeUtils.isDefined(value) && "" !== value;
- var number = validNumber ? parseFloat(value) : validValue && value.valueOf();
- var min = rule.min;
- var max = rule.max;
- if (!(validNumber || typeUtils.isDate(value)) && !validValue) {
- return false
- }
- if (typeUtils.isDefined(min)) {
- if (typeUtils.isDefined(max)) {
- return number >= min && number <= max
- }
- return number >= min
- } else {
- if (typeUtils.isDefined(max)) {
- return number <= max
- } else {
- throw errors.Error("E0101")
- }
- }
- }
- });
- var StringLengthRuleValidator = BaseRuleValidator.inherit({
- NAME: "stringLength",
- _validate: function(value, rule) {
- value = typeUtils.isDefined(value) ? String(value) : "";
- if (rule.trim || !typeUtils.isDefined(rule.trim)) {
- value = value.trim()
- }
- if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
- return true
- }
- return rulesValidators.range.validate(value.length, extend({}, rule))
- }
- });
- var CustomRuleValidator = BaseRuleValidator.inherit({
- NAME: "custom",
- validate: function(value, rule) {
- if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
- return true
- }
- var validator = rule.validator;
- var dataGetter = validator && typeUtils.isFunction(validator.option) && validator.option("dataGetter");
- var data = typeUtils.isFunction(dataGetter) && dataGetter();
- var params = {
- value: value,
- validator: validator,
- rule: rule
- };
- if (data) {
- params.data = data
- }
- return rule.validationCallback(params)
- }
- });
- var CompareRuleValidator = BaseRuleValidator.inherit({
- NAME: "compare",
- _validate: function(value, rule) {
- if (!rule.comparisonTarget) {
- throw errors.Error("E0102")
- }
- if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
- return true
- }
- extend(rule, {
- reevaluate: true
- });
- var otherValue = rule.comparisonTarget();
- var type = rule.comparisonType || "==";
- switch (type) {
- case "==":
- return value == otherValue;
- case "!=":
- return value != otherValue;
- case "===":
- return value === otherValue;
- case "!==":
- return value !== otherValue;
- case ">":
- return value > otherValue;
- case ">=":
- return value >= otherValue;
- case "<":
- return value < otherValue;
- case "<=":
- return value <= otherValue
- }
- }
- });
- var PatternRuleValidator = BaseRuleValidator.inherit({
- NAME: "pattern",
- _validate: function(value, rule) {
- if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
- return true
- }
- var pattern = rule.pattern;
- if (typeUtils.isString(pattern)) {
- pattern = new RegExp(pattern)
- }
- return pattern.test(value)
- }
- });
- var EmailRuleValidator = BaseRuleValidator.inherit({
- NAME: "email",
- _validate: function(value, rule) {
- if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
- return true
- }
- return rulesValidators.pattern.validate(value, extend({}, rule, {
- pattern: /^[\d\w._-]+@[\d\w._-]+\.[\w]+$/i
- }))
- }
- });
- var rulesValidators = {
- required: new RequiredRuleValidator,
- numeric: new NumericRuleValidator,
- range: new RangeRuleValidator,
- stringLength: new StringLengthRuleValidator,
- custom: new CustomRuleValidator,
- compare: new CompareRuleValidator,
- pattern: new PatternRuleValidator,
- email: new EmailRuleValidator
- };
- var GroupConfig = Class.inherit({
- ctor: function(group) {
- this.group = group;
- this.validators = []
- },
- validate: function() {
- var result = {
- isValid: true,
- brokenRules: [],
- validators: []
- };
- each(this.validators, function(_, validator) {
- var validatorResult = validator.validate();
- result.isValid = result.isValid && validatorResult.isValid;
- if (validatorResult.brokenRule) {
- result.brokenRules.push(validatorResult.brokenRule)
- }
- result.validators.push(validator)
- });
- this.fireEvent("validated", [{
- validators: result.validators,
- brokenRules: result.brokenRules,
- isValid: result.isValid
- }]);
- return result
- },
- reset: function() {
- each(this.validators, function(_, validator) {
- validator.reset()
- })
- }
- }).include(EventsMixin);
- var ValidationEngine = {
- groups: [],
- getGroupConfig: function(group) {
- var result = commonUtils.grep(this.groups, function(config) {
- return config.group === group
- });
- if (result.length) {
- return result[0]
- }
- },
- initGroups: function() {
- this.groups = [];
- this.addGroup()
- },
- addGroup: function(group) {
- var config = this.getGroupConfig(group);
- if (!config) {
- config = new GroupConfig(group);
- this.groups.push(config)
- }
- return config
- },
- removeGroup: function(group) {
- var config = this.getGroupConfig(group);
- var index = inArray(config, this.groups);
- if (index > -1) {
- this.groups.splice(index, 1)
- }
- return config
- },
- _setDefaultMessage: function(rule, validator, name) {
- if (!typeUtils.isDefined(rule.message)) {
- if (validator.defaultFormattedMessage && typeUtils.isDefined(name)) {
- rule.message = validator.defaultFormattedMessage(name)
- } else {
- rule.message = validator.defaultMessage()
- }
- }
- },
- validate: function(value, rules, name) {
- var result = {
- name: name,
- value: value,
- brokenRule: null,
- isValid: true,
- validationRules: rules
- };
- var that = this;
- each(rules || [], function(_, rule) {
- var ruleValidator = rulesValidators[rule.type];
- var ruleValidationResult;
- if (ruleValidator) {
- if (typeUtils.isDefined(rule.isValid) && rule.value === value && !rule.reevaluate) {
- if (!rule.isValid) {
- result.isValid = false;
- result.brokenRule = rule;
- return false
- }
- return true
- }
- rule.value = value;
- ruleValidationResult = ruleValidator.validate(value, rule);
- rule.isValid = ruleValidationResult;
- if (!ruleValidationResult) {
- result.isValid = false;
- that._setDefaultMessage(rule, ruleValidator, name);
- result.brokenRule = rule
- }
- if (!rule.isValid) {
- return false
- }
- } else {
- throw errors.Error("E0100")
- }
- });
- return result
- },
- registerValidatorInGroup: function(group, validator) {
- var groupConfig = ValidationEngine.addGroup(group);
- if (inArray(validator, groupConfig.validators) < 0) {
- groupConfig.validators.push(validator)
- }
- },
- _shouldRemoveGroup: function(group, validatorsInGroup) {
- var isDefaultGroup = void 0 === group;
- var isValidationGroupInstance = group && "dxValidationGroup" === group.NAME;
- return !isDefaultGroup && !isValidationGroupInstance && !validatorsInGroup.length
- },
- removeRegisteredValidator: function(group, validator) {
- var config = ValidationEngine.getGroupConfig(group);
- var validatorsInGroup = config && config.validators;
- var index = inArray(validator, validatorsInGroup);
- if (index > -1) {
- validatorsInGroup.splice(index, 1);
- if (this._shouldRemoveGroup(group, validatorsInGroup)) {
- this.removeGroup(group)
- }
- }
- },
- validateGroup: function(group) {
- var groupConfig = ValidationEngine.getGroupConfig(group);
- if (!groupConfig) {
- throw errors.Error("E0110")
- }
- return groupConfig.validate()
- },
- resetGroup: function(group) {
- var groupConfig = ValidationEngine.getGroupConfig(group);
- if (!groupConfig) {
- throw errors.Error("E0110")
- }
- return groupConfig.reset()
- }
- };
- ValidationEngine.initGroups();
- module.exports = ValidationEngine
- }, , , , , ,
- /*!************************************************!*\
- !*** ./artifacts/transpiled/viz/core/title.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _Number = Number;
- var _isString = __webpack_require__( /*! ../../core/utils/type */ 1).isString;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _patchFontOptions = __webpack_require__( /*! ./utils */ 10).patchFontOptions;
- var parseHorizontalAlignment = __webpack_require__( /*! ./utils */ 10).enumParser(["left", "center", "right"]);
- var parseVerticalAlignment = __webpack_require__( /*! ./utils */ 10).enumParser(["top", "bottom"]);
- var DEFAULT_MARGIN = 10;
- function hasText(text) {
- return !!(text && String(text).length > 0)
- }
- function processTitleLength(elem, text, width, options, placeholderSize) {
- if (elem.attr({
- text: text
- }).setMaxSize(width, placeholderSize, options).textChanged) {
- elem.setTitle(text)
- }
- }
- function pickMarginValue(value) {
- return value >= 0 ? _Number(value) : DEFAULT_MARGIN
- }
- function validateMargin(margin) {
- var result;
- if (margin >= 0) {
- result = {
- left: _Number(margin),
- top: _Number(margin),
- right: _Number(margin),
- bottom: _Number(margin)
- }
- } else {
- margin = margin || {};
- result = {
- left: pickMarginValue(margin.left),
- top: pickMarginValue(margin.top),
- right: pickMarginValue(margin.right),
- bottom: pickMarginValue(margin.bottom)
- }
- }
- return result
- }
- function checkRect(rect, boundingRect) {
- return rect[2] - rect[0] < boundingRect.width || rect[3] - rect[1] < boundingRect.height
- }
- function Title(params) {
- this._params = params;
- this._group = params.renderer.g().attr({
- "class": params.cssClass
- }).linkOn(params.root || params.renderer.root, "title");
- this._hasText = false
- }
- extend(Title.prototype, __webpack_require__( /*! ./layout_element */ 242).LayoutElement.prototype, {
- dispose: function() {
- var that = this;
- that._group.linkRemove();
- that._group.linkOff();
- if (that._titleElement) {
- that._clipRect.dispose();
- that._titleElement = that._subtitleElement = that._clipRect = null
- }
- that._params = that._group = that._options = null
- },
- _updateOptions: function(options) {
- this._options = options;
- this._options.horizontalAlignment = parseHorizontalAlignment(options.horizontalAlignment, "center");
- this._options.verticalAlignment = parseVerticalAlignment(options.verticalAlignment, "top");
- this._options.margin = validateMargin(options.margin)
- },
- _updateStructure: function() {
- var that = this;
- var renderer = that._params.renderer;
- var group = that._group;
- var options = that._options;
- var align = options.horizontalAlignment;
- if (!that._titleElement) {
- that._titleElement = renderer.text().append(group);
- that._subtitleElement = renderer.text();
- that._clipRect = renderer.clipRect();
- group.attr({
- "clip-path": that._clipRect.id
- })
- }
- that._titleElement.attr({
- align: align,
- "class": options.cssClass
- });
- that._subtitleElement.attr({
- align: align,
- "class": options.subtitle.cssClass
- });
- group.linkAppend();
- hasText(options.subtitle.text) ? that._subtitleElement.append(group) : that._subtitleElement.remove()
- },
- _updateTexts: function() {
- var that = this;
- var options = that._options;
- var subtitleOptions = options.subtitle;
- var titleElement = that._titleElement;
- var subtitleElement = that._subtitleElement;
- var testText = "A";
- var titleBox;
- titleElement.attr({
- text: testText,
- y: 0
- }).css(_patchFontOptions(options.font));
- titleBox = titleElement.getBBox();
- that._baseLineCorrection = titleBox.height + titleBox.y;
- titleElement.attr({
- text: options.text
- });
- titleBox = titleElement.getBBox();
- var y = -titleBox.y;
- titleElement.attr({
- y: y
- });
- if (hasText(subtitleOptions.text)) {
- subtitleElement.attr({
- text: subtitleOptions.text,
- y: 0
- }).css(_patchFontOptions(subtitleOptions.font))
- }
- },
- _shiftSubtitle: function() {
- var that = this;
- var titleBox = that._titleElement.getBBox();
- var element = that._subtitleElement;
- var offset = that._options.subtitle.offset;
- element.move(0, titleBox.y + titleBox.height - element.getBBox().y - offset)
- },
- _updateBoundingRectAlignment: function() {
- var boundingRect = this._boundingRect;
- var options = this._options;
- boundingRect.verticalAlignment = options.verticalAlignment;
- boundingRect.horizontalAlignment = options.horizontalAlignment;
- boundingRect.cutLayoutSide = options.verticalAlignment;
- boundingRect.cutSide = "vertical";
- boundingRect.position = {
- horizontal: options.horizontalAlignment,
- vertical: options.verticalAlignment
- }
- },
- hasText: function() {
- return this._hasText
- },
- update: function(themeOptions, userOptions) {
- var that = this;
- var options = extend(true, {}, themeOptions, processTitleOptions(userOptions));
- var _hasText = hasText(options.text);
- var isLayoutChanged = _hasText || _hasText !== that._hasText;
- that._baseLineCorrection = 0;
- that._updateOptions(options);
- that._boundingRect = {};
- if (_hasText) {
- that._updateStructure();
- that._updateTexts()
- } else {
- that._group.linkRemove()
- }
- that._updateBoundingRect();
- that._updateBoundingRectAlignment();
- that._hasText = _hasText;
- return isLayoutChanged
- },
- draw: function(width, height) {
- var that = this;
- if (that._hasText) {
- that._group.linkAppend();
- that._correctTitleLength(width);
- if (that._group.getBBox().height > height) {
- this.freeSpace()
- }
- }
- return that
- },
- probeDraw: function(width, height) {
- this.draw(width, height);
- return this
- },
- _correctTitleLength: function(width) {
- var that = this;
- var options = that._options;
- var margin = options.margin;
- var maxWidth = width - margin.left - margin.right;
- var placeholderSize = options.placeholderSize;
- processTitleLength(that._titleElement, options.text, maxWidth, options, placeholderSize);
- if (that._subtitleElement) {
- if (_Number(placeholderSize) > 0) {
- placeholderSize -= that._titleElement.getBBox().height
- }
- processTitleLength(that._subtitleElement, options.subtitle.text, maxWidth, options.subtitle, placeholderSize);
- that._shiftSubtitle()
- }
- that._updateBoundingRect();
- var _this$getCorrectedLay = this.getCorrectedLayoutOptions(),
- x = _this$getCorrectedLay.x,
- y = _this$getCorrectedLay.y,
- height = _this$getCorrectedLay.height;
- this._clipRect.attr({
- x: x,
- y: y,
- width: width,
- height: height
- })
- },
- getLayoutOptions: function() {
- return this._boundingRect || null
- },
- shift: function(x, y) {
- var that = this;
- var box = that.getLayoutOptions();
- that._group.move(x - box.x, y - box.y);
- return that
- },
- _updateBoundingRect: function() {
- var that = this;
- var options = that._options;
- var margin = options.margin;
- var boundingRect = that._boundingRect;
- var box = that._hasText ? that._group.getBBox() : {
- width: 0,
- height: 0,
- x: 0,
- y: 0,
- isEmpty: true
- };
- if (!box.isEmpty) {
- box.height += margin.top + margin.bottom - that._baseLineCorrection;
- box.width += margin.left + margin.right;
- box.x -= margin.left;
- box.y += that._baseLineCorrection - margin.top
- }
- if (options.placeholderSize > 0) {
- box.height = options.placeholderSize
- }
- boundingRect.height = box.height;
- boundingRect.width = box.width;
- boundingRect.x = box.x;
- boundingRect.y = box.y
- },
- getCorrectedLayoutOptions: function() {
- var srcBox = this.getLayoutOptions();
- var correction = this._baseLineCorrection;
- return extend({}, srcBox, {
- y: srcBox.y - correction,
- height: srcBox.height + correction
- })
- },
- layoutOptions: function() {
- if (!this._hasText) {
- return null
- }
- return {
- horizontalAlignment: this._boundingRect.horizontalAlignment,
- verticalAlignment: this._boundingRect.verticalAlignment,
- priority: 0
- }
- },
- measure: function(size) {
- this.draw(size[0], size[1]);
- return [this._boundingRect.width, this._boundingRect.height]
- },
- move: function(rect, fitRect) {
- var boundingRect = this._boundingRect;
- if (checkRect(rect, boundingRect)) {
- this.shift(fitRect[0], fitRect[1])
- } else {
- this.shift(Math.round(rect[0]), Math.round(rect[1]))
- }
- },
- freeSpace: function() {
- var that = this;
- that._params.incidentOccurred("W2103");
- that._group.linkRemove();
- that._boundingRect.width = that._boundingRect.height = 0
- },
- getOptions: function() {
- return this._options
- },
- changeLink: function(root) {
- this._group.linkRemove();
- this._group.linkOn(root, "title")
- }
- });
- exports.Title = Title;
- Title.prototype.DEBUG_getOptions = function() {
- return this._options
- };
- function processTitleOptions(options) {
- var newOptions = _isString(options) ? {
- text: options
- } : options || {};
- newOptions.subtitle = _isString(newOptions.subtitle) ? {
- text: newOptions.subtitle
- } : newOptions.subtitle || {};
- return newOptions
- }
- exports.plugin = {
- name: "title",
- init: function() {
- var that = this;
- that._title = new exports.Title({
- renderer: that._renderer,
- cssClass: that._rootClassPrefix + "-title",
- incidentOccurred: that._incidentOccurred
- });
- that._layout.add(that._title)
- },
- dispose: function() {
- this._title.dispose();
- this._title = null
- },
- customize: function(constructor) {
- constructor.addChange({
- code: "TITLE",
- handler: function() {
- if (this._title.update(this._themeManager.theme("title"), this.option("title"))) {
- this._change(["LAYOUT"])
- }
- },
- isThemeDependent: true,
- option: "title",
- isOptionChange: true
- })
- },
- fontFields: ["title.font", "title.subtitle.font"]
- }
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/scatter_series.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 247);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var _isDefined = typeUtils.isDefined;
- var _isString = typeUtils.isString;
- var _map = vizUtils.map;
- var _normalizeEnum = vizUtils.normalizeEnum;
- var math = Math;
- var _abs = math.abs;
- var _sqrt = math.sqrt;
- var _max = math.max;
- var DEFAULT_TRACKER_WIDTH = 12;
- var DEFAULT_DURATION = 400;
- var HIGH_ERROR = "highError";
- var LOW_ERROR = "lowError";
- var VARIANCE = "variance";
- var STANDARD_DEVIATION = "stddeviation";
- var STANDARD_ERROR = "stderror";
- var PERCENT = "percent";
- var FIXED = "fixed";
- var UNDEFINED = "undefined";
- var DISCRETE = "discrete";
- var LOGARITHMIC = "logarithmic";
- var DATETIME = "datetime";
- exports.chart = {};
- exports.polar = {};
- function sum(array) {
- var result = 0;
- _each(array, function(_, value) {
- result += value
- });
- return result
- }
- function isErrorBarTypeCorrect(type) {
- return inArray(type, [FIXED, PERCENT, VARIANCE, STANDARD_DEVIATION, STANDARD_ERROR]) !== -1
- }
- function variance(array, expectedValue) {
- return sum(_map(array, function(value) {
- return (value - expectedValue) * (value - expectedValue)
- })) / array.length
- }
- function calculateAvgErrorBars(result, data, series) {
- var errorBarsOptions = series.getOptions().valueErrorBar;
- var valueField = series.getValueFields()[0];
- var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR;
- var highValueField = errorBarsOptions.highValueField || HIGH_ERROR;
- if (series.areErrorBarsVisible() && void 0 === errorBarsOptions.type) {
- var fusionData = data.reduce(function(result, item) {
- if (_isDefined(item[lowValueField])) {
- result[0] += item[valueField] - item[lowValueField];
- result[1]++
- }
- if (_isDefined(item[highValueField])) {
- result[2] += item[highValueField] - item[valueField];
- result[3]++
- }
- return result
- }, [0, 0, 0, 0]);
- if (fusionData[1]) {
- result[lowValueField] = result[valueField] - fusionData[0] / fusionData[1]
- }
- if (fusionData[2]) {
- result[highValueField] = result[valueField] + fusionData[2] / fusionData[3]
- }
- }
- return result
- }
- function calculateSumErrorBars(result, data, series) {
- var errorBarsOptions = series.getOptions().valueErrorBar;
- var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR;
- var highValueField = errorBarsOptions.highValueField || HIGH_ERROR;
- if (series.areErrorBarsVisible() && void 0 === errorBarsOptions.type) {
- result[lowValueField] = 0;
- result[highValueField] = 0;
- result = data.reduce(function(result, item) {
- result[lowValueField] += item[lowValueField];
- result[highValueField] += item[highValueField];
- return result
- }, result)
- }
- return result
- }
- function getMinMaxAggregator(compare) {
- return function(_ref, series) {
- var intervalStart = _ref.intervalStart,
- data = _ref.data;
- var valueField = series.getValueFields()[0];
- var targetData = data[0];
- targetData = data.reduce(function(result, item) {
- var value = item[valueField];
- if (null === result[valueField]) {
- result = item
- }
- if (null !== value && compare(value, result[valueField])) {
- return item
- }
- return result
- }, targetData);
- return _extend({}, targetData, _defineProperty({}, series.getArgumentField(), intervalStart))
- }
- }
- function checkFields(data, fieldsToCheck, skippedFields) {
- var allFieldsIsValid = true;
- for (var field in fieldsToCheck) {
- var isArgument = "argument" === field;
- if (isArgument || "size" === field ? !_isDefined(data[field]) : void 0 === data[field]) {
- var selector = fieldsToCheck[field];
- if (!isArgument) {
- skippedFields[selector] = (skippedFields[selector] || 0) + 1
- }
- allFieldsIsValid = false
- }
- }
- return allFieldsIsValid
- }
- var baseScatterMethods = {
- _defaultDuration: DEFAULT_DURATION,
- _defaultTrackerWidth: DEFAULT_TRACKER_WIDTH,
- _applyStyle: _noop,
- _updateOptions: _noop,
- _parseStyle: _noop,
- _prepareSegment: _noop,
- _drawSegment: _noop,
- _appendInGroup: function() {
- this._group.append(this._extGroups.seriesGroup)
- },
- _createLegendState: function(styleOptions, defaultColor) {
- return {
- fill: styleOptions.color || defaultColor,
- hatching: styleOptions.hatching ? _extend({}, styleOptions.hatching, {
- direction: "right"
- }) : void 0
- }
- },
- _applyElementsClipRect: function(settings) {
- settings["clip-path"] = this._paneClipRectID
- },
- _applyMarkerClipRect: function(settings) {
- settings["clip-path"] = this._forceClipping ? this._paneClipRectID : null
- },
- _createGroup: function(groupName, parent, target, settings) {
- var group = parent[groupName] = parent[groupName] || this._renderer.g();
- target && group.append(target);
- settings && group.attr(settings)
- },
- _applyClearingSettings: function(settings) {
- settings.opacity = null;
- settings.scale = null;
- if (this._options.rotated) {
- settings.translateX = null
- } else {
- settings.translateY = null
- }
- },
- _createGroups: function() {
- var that = this;
- that._createGroup("_markersGroup", that, that._group);
- that._createGroup("_labelsGroup", that)
- },
- _setMarkerGroupSettings: function() {
- var that = this;
- var settings = that._createPointStyles(that._getMarkerGroupOptions()).normal;
- settings.class = "dxc-markers";
- settings.opacity = 1;
- that._applyMarkerClipRect(settings);
- that._markersGroup.attr(settings)
- },
- getVisibleArea: function() {
- return this._visibleArea
- },
- areErrorBarsVisible: function() {
- var errorBarOptions = this._options.valueErrorBar;
- return errorBarOptions && this._errorBarsEnabled() && "none" !== errorBarOptions.displayMode && (isErrorBarTypeCorrect(_normalizeEnum(errorBarOptions.type)) || _isDefined(errorBarOptions.lowValueField) || _isDefined(errorBarOptions.highValueField))
- },
- groupPointsByCoords: function(rotated) {
- var cat = [];
- _each(this.getVisiblePoints(), function(_, p) {
- var pointCoord = parseInt(rotated ? p.vy : p.vx);
- if (!cat[pointCoord]) {
- cat[pointCoord] = p
- } else {
- Array.isArray(cat[pointCoord]) ? cat[pointCoord].push(p) : cat[pointCoord] = [cat[pointCoord], p]
- }
- });
- return cat
- },
- _createErrorBarGroup: function(animationEnabled) {
- var that = this;
- var errorBarOptions = that._options.valueErrorBar;
- var settings;
- if (that.areErrorBarsVisible()) {
- settings = {
- "class": "dxc-error-bars",
- stroke: errorBarOptions.color,
- "stroke-width": errorBarOptions.lineWidth,
- opacity: animationEnabled ? .001 : errorBarOptions.opacity || 1,
- "stroke-linecap": "square",
- sharp: true,
- "clip-path": that._forceClipping ? that._paneClipRectID : that._widePaneClipRectID
- };
- that._createGroup("_errorBarGroup", that, that._group, settings)
- }
- },
- _setGroupsSettings: function(animationEnabled) {
- var that = this;
- that._setMarkerGroupSettings();
- that._setLabelGroupSettings(animationEnabled);
- that._createErrorBarGroup(animationEnabled)
- },
- _getCreatingPointOptions: function() {
- var that = this;
- var defaultPointOptions;
- var creatingPointOptions = that._predefinedPointOptions;
- var normalStyle;
- if (!creatingPointOptions) {
- defaultPointOptions = that._getPointOptions();
- that._predefinedPointOptions = creatingPointOptions = _extend(true, {
- styles: {}
- }, defaultPointOptions);
- normalStyle = defaultPointOptions.styles && defaultPointOptions.styles.normal || {};
- creatingPointOptions.styles = creatingPointOptions.styles || {};
- creatingPointOptions.styles.normal = {
- "stroke-width": normalStyle["stroke-width"],
- r: normalStyle.r,
- opacity: normalStyle.opacity
- }
- }
- return creatingPointOptions
- },
- _getPointOptions: function() {
- return this._parsePointOptions(this._preparePointOptions(), this._options.label)
- },
- _getOptionsForPoint: function() {
- return this._options.point
- },
- _parsePointStyle: function(style, defaultColor, defaultBorderColor, defaultSize) {
- var border = style.border || {};
- var sizeValue = void 0 !== style.size ? style.size : defaultSize;
- return {
- fill: style.color || defaultColor,
- stroke: border.color || defaultBorderColor,
- "stroke-width": border.visible ? border.width : 0,
- r: sizeValue / 2 + (border.visible && 0 !== sizeValue ? ~~(border.width / 2) || 0 : 0)
- }
- },
- _createPointStyles: function(pointOptions) {
- var that = this;
- var mainPointColor = pointOptions.color || that._options.mainSeriesColor;
- var containerColor = that._options.containerBackgroundColor;
- var normalStyle = that._parsePointStyle(pointOptions, mainPointColor, mainPointColor);
- normalStyle.visibility = pointOptions.visible ? "visible" : "hidden";
- return {
- normal: normalStyle,
- hover: that._parsePointStyle(pointOptions.hoverStyle, containerColor, mainPointColor, pointOptions.size),
- selection: that._parsePointStyle(pointOptions.selectionStyle, containerColor, mainPointColor, pointOptions.size)
- }
- },
- _checkData: function(data, skippedFields, fieldsToCheck) {
- fieldsToCheck = fieldsToCheck || {
- value: this.getValueFields()[0]
- };
- fieldsToCheck.argument = this.getArgumentField();
- return checkFields(data, fieldsToCheck, skippedFields || {}) && data.value === data.value
- },
- getValueRangeInitialValue: function() {
- return
- },
- _getRangeData: function() {
- return rangeCalculator.getRangeData(this)
- },
- _getPointDataSelector: function() {
- var _this = this;
- var valueField = this.getValueFields()[0];
- var argumentField = this.getArgumentField();
- var tagField = this.getTagField();
- var areErrorBarsVisible = this.areErrorBarsVisible();
- var lowValueField;
- var highValueField;
- if (areErrorBarsVisible) {
- var errorBarOptions = this._options.valueErrorBar;
- lowValueField = errorBarOptions.lowValueField || LOW_ERROR;
- highValueField = errorBarOptions.highValueField || HIGH_ERROR
- }
- return function(data) {
- var pointData = {
- value: _this._processEmptyValue(data[valueField]),
- argument: data[argumentField],
- tag: data[tagField],
- data: data
- };
- if (areErrorBarsVisible) {
- pointData.lowError = data[lowValueField];
- pointData.highError = data[highValueField]
- }
- return pointData
- }
- },
- _errorBarsEnabled: function() {
- return this.valueAxisType !== DISCRETE && this.valueAxisType !== LOGARITHMIC && this.valueType !== DATETIME
- },
- _drawPoint: function(options) {
- var point = options.point;
- if (point.isInVisibleArea()) {
- point.clearVisibility();
- point.draw(this._renderer, options.groups, options.hasAnimation, options.firstDrawing);
- this._drawnPoints.push(point)
- } else {
- point.setInvisibility()
- }
- },
- _animateComplete: function() {
- var that = this;
- var animationSettings = {
- duration: that._defaultDuration
- };
- that._labelsGroup && that._labelsGroup.animate({
- opacity: 1
- }, animationSettings);
- that._errorBarGroup && that._errorBarGroup.animate({
- opacity: that._options.valueErrorBar.opacity || 1
- }, animationSettings)
- },
- _animate: function() {
- var that = this;
- var lastPointIndex = that._drawnPoints.length - 1;
- _each(that._drawnPoints || [], function(i, p) {
- p.animate(i === lastPointIndex ? function() {
- that._animateComplete()
- } : void 0, {
- translateX: p.x,
- translateY: p.y
- })
- })
- },
- _defaultAggregator: "avg",
- _aggregators: {
- avg: function(_ref2, series) {
- var _calculateAvgErrorBar;
- var data = _ref2.data,
- intervalStart = _ref2.intervalStart;
- if (!data.length) {
- return
- }
- var valueField = series.getValueFields()[0];
- var aggregationResult = data.reduce(function(result, item) {
- var value = item[valueField];
- if (_isDefined(value)) {
- result[0] += value;
- result[1]++
- } else {
- if (null === value) {
- result[2]++
- }
- }
- return result
- }, [0, 0, 0]);
- return calculateAvgErrorBars((_calculateAvgErrorBar = {}, _defineProperty(_calculateAvgErrorBar, valueField, aggregationResult[2] === data.length ? null : aggregationResult[0] / aggregationResult[1]), _defineProperty(_calculateAvgErrorBar, series.getArgumentField(), intervalStart), _calculateAvgErrorBar), data, series)
- },
- sum: function(_ref3, series) {
- var _calculateSumErrorBar;
- var intervalStart = _ref3.intervalStart,
- data = _ref3.data;
- if (!data.length) {
- return
- }
- var valueField = series.getValueFields()[0];
- var aggregationResult = data.reduce(function(result, item) {
- var value = item[valueField];
- if (void 0 !== value) {
- result[0] += value
- }
- if (null === value) {
- result[1]++
- } else {
- if (void 0 === value) {
- result[2]++
- }
- }
- return result
- }, [0, 0, 0]);
- var value = aggregationResult[0];
- if (aggregationResult[1] === data.length) {
- value = null
- }
- if (aggregationResult[2] === data.length) {
- return
- }
- return calculateSumErrorBars((_calculateSumErrorBar = {}, _defineProperty(_calculateSumErrorBar, valueField, value), _defineProperty(_calculateSumErrorBar, series.getArgumentField(), intervalStart), _calculateSumErrorBar), data, series)
- },
- count: function(_ref4, series) {
- var _ref5;
- var data = _ref4.data,
- intervalStart = _ref4.intervalStart;
- var valueField = series.getValueFields()[0];
- return _ref5 = {}, _defineProperty(_ref5, series.getArgumentField(), intervalStart), _defineProperty(_ref5, valueField, data.filter(function(i) {
- return void 0 !== i[valueField]
- }).length), _ref5
- },
- min: getMinMaxAggregator(function(a, b) {
- return a < b
- }),
- max: getMinMaxAggregator(function(a, b) {
- return a > b
- })
- },
- _endUpdateData: function() {
- delete this._predefinedPointOptions
- },
- getArgumentField: function() {
- return this._options.argumentField || "arg"
- },
- getValueFields: function() {
- var options = this._options;
- var errorBarsOptions = options.valueErrorBar;
- var valueFields = [options.valueField || "val"];
- var lowValueField;
- var highValueField;
- if (errorBarsOptions) {
- lowValueField = errorBarsOptions.lowValueField;
- highValueField = errorBarsOptions.highValueField;
- _isString(lowValueField) && valueFields.push(lowValueField);
- _isString(highValueField) && valueFields.push(highValueField)
- }
- return valueFields
- },
- _calculateErrorBars: function(data) {
- if (!this.areErrorBarsVisible()) {
- return
- }
- var that = this;
- var options = that._options;
- var errorBarsOptions = options.valueErrorBar;
- var errorBarType = _normalizeEnum(errorBarsOptions.type);
- var floatErrorValue = parseFloat(errorBarsOptions.value);
- var valueField = that.getValueFields()[0];
- var value;
- var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR;
- var highValueField = errorBarsOptions.highValueField || HIGH_ERROR;
- var valueArray;
- var valueArrayLength;
- var meanValue;
- var processDataItem;
- var addSubError = function(_i, item) {
- value = item.value;
- item.lowError = value - floatErrorValue;
- item.highError = value + floatErrorValue
- };
- switch (errorBarType) {
- case FIXED:
- processDataItem = addSubError;
- break;
- case PERCENT:
- processDataItem = function(_, item) {
- value = item.value;
- var error = value * floatErrorValue / 100;
- item.lowError = value - error;
- item.highError = value + error
- };
- break;
- case UNDEFINED:
- processDataItem = function(_, item) {
- item.lowError = item.data[lowValueField];
- item.highError = item.data[highValueField]
- };
- break;
- default:
- valueArray = _map(data, function(item) {
- return _isDefined(item.data[valueField]) ? item.data[valueField] : null
- });
- valueArrayLength = valueArray.length;
- floatErrorValue = floatErrorValue || 1;
- switch (errorBarType) {
- case VARIANCE:
- floatErrorValue = variance(valueArray, sum(valueArray) / valueArrayLength) * floatErrorValue;
- processDataItem = addSubError;
- break;
- case STANDARD_DEVIATION:
- meanValue = sum(valueArray) / valueArrayLength;
- floatErrorValue = _sqrt(variance(valueArray, meanValue)) * floatErrorValue;
- processDataItem = function(_, item) {
- item.lowError = meanValue - floatErrorValue;
- item.highError = meanValue + floatErrorValue
- };
- break;
- case STANDARD_ERROR:
- floatErrorValue = _sqrt(variance(valueArray, sum(valueArray) / valueArrayLength) / valueArrayLength) * floatErrorValue;
- processDataItem = addSubError
- }
- }
- processDataItem && _each(data, processDataItem)
- },
- _patchMarginOptions: function(options) {
- var pointOptions = this._getCreatingPointOptions();
- var styles = pointOptions.styles;
- var maxSize = [styles.normal, styles.hover, styles.selection].reduce(function(max, style) {
- return _max(max, 2 * style.r + style["stroke-width"])
- }, 0);
- options.size = pointOptions.visible ? maxSize : 0;
- options.sizePointNormalState = pointOptions.visible ? 2 * styles.normal.r + styles.normal["stroke-width"] : 2;
- return options
- },
- usePointsToDefineAutoHiding: function() {
- return true
- }
- };
- exports.chart = _extend({}, baseScatterMethods, {
- drawTrackers: function() {
- var that = this;
- var trackers;
- var trackersGroup;
- var segments = that._segments || [];
- var rotated = that._options.rotated;
- if (!that.isVisible()) {
- return
- }
- if (segments.length) {
- trackers = that._trackers = that._trackers || [];
- trackersGroup = that._trackersGroup = (that._trackersGroup || that._renderer.g().attr({
- fill: "gray",
- opacity: .001,
- stroke: "gray",
- "class": "dxc-trackers"
- })).attr({
- "clip-path": this._paneClipRectID || null
- }).append(that._group);
- _each(segments, function(i, segment) {
- if (!trackers[i]) {
- trackers[i] = that._drawTrackerElement(segment).data({
- "chart-data-series": that
- }).append(trackersGroup)
- } else {
- that._updateTrackerElement(segment, trackers[i])
- }
- })
- }
- that._trackersTranslator = that.groupPointsByCoords(rotated)
- },
- checkAxisVisibleAreaCoord: function(isArgument, coord) {
- var axis = isArgument ? this.getArgumentAxis() : this.getValueAxis();
- var visibleArea = axis.getVisibleArea();
- return _isDefined(coord) && visibleArea[0] <= coord && visibleArea[1] >= coord
- },
- checkSeriesViewportCoord: function(axis, coord) {
- return true
- },
- getSeriesPairCoord: function(coord, isArgument) {
- var oppositeCoord = null;
- var isOpposite = !isArgument && !this._options.rotated || isArgument && this._options.rotated;
- var coordName = !isOpposite ? "vx" : "vy";
- var oppositeCoordName = !isOpposite ? "vy" : "vx";
- var points = this.getVisiblePoints();
- for (var i = 0; i < points.length; i++) {
- var p = points[i];
- var tmpCoord = p[coordName] === coord ? p[oppositeCoordName] : void 0;
- if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
- oppositeCoord = tmpCoord;
- break
- }
- }
- return oppositeCoord
- },
- getNearestPointsByCoord: function(coord, isArgument) {
- var that = this;
- var rotated = that.getOptions().rotated;
- var isOpposite = !isArgument && !rotated || isArgument && rotated;
- var coordName = isOpposite ? "vy" : "vx";
- var points = that.getVisiblePoints();
- var allPoints = that.getPoints();
- var nearestPoints = [];
- if (that.isVisible() && allPoints.length > 0) {
- if (allPoints.length > 1) {
- that.findNeighborPointsByCoord(coord, coordName, points.slice(0), allPoints, function(point, nextPoint) {
- nearestPoints.push([point, nextPoint])
- })
- } else {
- if (allPoints[0][coordName] === coord) {
- nearestPoints.push([allPoints[0], allPoints[0]])
- }
- }
- }
- return nearestPoints
- },
- findNeighborPointsByCoord: function(coord, coordName, points, allPoints, pushNeighborPoints) {
- var searchPoints = allPoints;
- if (points.length > 0) {
- points.splice(0, 0, allPoints[allPoints.indexOf(points[0]) - 1]);
- points.splice(points.length, 0, allPoints[allPoints.indexOf(points[points.length - 1]) + 1]);
- searchPoints = points
- }
- searchPoints.forEach(function(p, i) {
- var np = searchPoints[i + 1];
- if (p && np && (p[coordName] <= coord && np[coordName] >= coord || p[coordName] >= coord && np[coordName] <= coord)) {
- pushNeighborPoints(p, np)
- }
- })
- },
- getNeighborPoint: function(x, y) {
- var pCoord = this._options.rotated ? y : x;
- var nCoord = pCoord;
- var cat = this._trackersTranslator;
- var point = null;
- var minDistance;
- var oppositeCoord = this._options.rotated ? x : y;
- var oppositeCoordName = this._options.rotated ? "vx" : "vy";
- if (this.isVisible() && cat) {
- point = cat[pCoord];
- do {
- point = cat[nCoord] || cat[pCoord];
- pCoord--;
- nCoord++
- } while ((pCoord >= 0 || nCoord < cat.length) && !point);
- if (Array.isArray(point)) {
- minDistance = _abs(point[0][oppositeCoordName] - oppositeCoord);
- _each(point, function(i, p) {
- var distance = _abs(p[oppositeCoordName] - oppositeCoord);
- if (minDistance >= distance) {
- minDistance = distance;
- point = p
- }
- })
- }
- }
- return point
- },
- _applyVisibleArea: function() {
- var that = this;
- var rotated = that._options.rotated;
- var visibleX = (rotated ? that.getValueAxis() : that.getArgumentAxis()).getVisibleArea();
- var visibleY = (rotated ? that.getArgumentAxis() : that.getValueAxis()).getVisibleArea();
- that._visibleArea = {
- minX: visibleX[0],
- maxX: visibleX[1],
- minY: visibleY[0],
- maxY: visibleY[1]
- }
- },
- getPointCenterByArg: function(arg) {
- var point = this.getPointsByArg(arg)[0];
- return point ? point.getCenterCoord() : void 0
- }
- });
- exports.polar = _extend({}, baseScatterMethods, {
- drawTrackers: function() {
- exports.chart.drawTrackers.call(this);
- var cat = this._trackersTranslator;
- var index;
- if (!this.isVisible()) {
- return
- }
- _each(cat, function(i, category) {
- if (category) {
- index = i;
- return false
- }
- });
- cat[index + 360] = cat[index]
- },
- getNeighborPoint: function(x, y) {
- var pos = vizUtils.convertXYToPolar(this.getValueAxis().getCenter(), x, y);
- return exports.chart.getNeighborPoint.call(this, pos.phi, pos.r)
- },
- _applyVisibleArea: function() {
- var that = this;
- var canvas = that.getValueAxis().getCanvas();
- that._visibleArea = {
- minX: canvas.left,
- maxX: canvas.width - canvas.right,
- minY: canvas.top,
- maxY: canvas.height - canvas.bottom
- }
- }
- })
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/viz/core/tooltip.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
- var _inflector2 = _interopRequireDefault(_inflector);
- var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _renderer3 = __webpack_require__( /*! ./renderers/renderer */ 175);
- var _renderer4 = _interopRequireDefault(_renderer3);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _type2 = _interopRequireDefault(_type);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _utils = __webpack_require__( /*! ./utils */ 10);
- var _utils2 = _interopRequireDefault(_utils);
- var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
- var _plaque = __webpack_require__( /*! ./plaque */ 403);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var mathCeil = Math.ceil;
- var mathMax = Math.max;
- var mathMin = Math.min;
- var window = _window2.default.getWindow();
- function hideElement($element) {
- $element.css({
- left: "-9999px"
- }).detach()
- }
- function getSpecialFormatOptions(options, specialFormat) {
- var result = options;
- switch (specialFormat) {
- case "argument":
- result = {
- format: options.argumentFormat
- };
- break;
- case "percent":
- result = {
- format: {
- type: "percent",
- precision: options.format && options.format.percentPrecision
- }
- }
- }
- return result
- }
- function Tooltip(params) {
- var that = this;
- var renderer;
- that._eventTrigger = params.eventTrigger;
- that._widgetRoot = params.widgetRoot;
- that._wrapper = (0, _renderer2.default)("<div>").css({
- position: "absolute",
- overflow: "hidden",
- pointerEvents: "none"
- }).addClass(params.cssClass);
- that._renderer = renderer = new _renderer4.default.Renderer({
- pathModified: params.pathModified,
- container: that._wrapper[0]
- });
- var root = renderer.root;
- root.attr({
- "pointer-events": "none"
- });
- that._text = renderer.text(void 0, 0, 0);
- that._textGroupHtml = (0, _renderer2.default)("<div>").css({
- position: "absolute",
- padding: 0,
- margin: 0,
- border: "0px solid transparent"
- }).appendTo(that._wrapper);
- that._textHtml = (0, _renderer2.default)("<div>").css({
- position: "relative",
- display: "inline-block",
- padding: 0,
- margin: 0,
- border: "0px solid transparent"
- }).appendTo(that._textGroupHtml)
- }
- Tooltip.prototype = {
- constructor: Tooltip,
- dispose: function() {
- this._wrapper.remove();
- this._renderer.dispose();
- this._options = this._widgetRoot = null
- },
- _getContainer: function() {
- var options = this._options;
- var container = (0, _renderer2.default)(this._widgetRoot).closest(options.container);
- if (0 === container.length) {
- container = (0, _renderer2.default)(options.container)
- }
- return (container.length ? container : (0, _renderer2.default)("body")).get(0)
- },
- setOptions: function(options) {
- var _this = this;
- options = options || {};
- var that = this;
- that._options = options;
- that._textFontStyles = _utils2.default.patchFontOptions(options.font);
- that._textFontStyles.color = options.font.color;
- that._wrapper.css({
- zIndex: options.zIndex
- });
- that._customizeTooltip = options.customizeTooltip;
- var textGroupHtml = that._textGroupHtml;
- var textHtml = that._textHtml;
- if (this.plaque) {
- this.plaque.clear()
- }
- this.plaque = new _plaque.Plaque({
- opacity: that._options.opacity,
- color: that._options.color,
- border: that._options.border,
- paddingLeftRight: that._options.paddingLeftRight,
- paddingTopBottom: that._options.paddingTopBottom,
- arrowLength: that._options.arrowLength,
- arrowWidth: 20,
- shadow: that._options.shadow,
- cornerRadius: that._options.cornerRadius
- }, that, that._renderer.root, function(tooltip, group) {
- var state = tooltip._state;
- if (state.html) {
- if (!state.isRendered) {
- that._text.attr({
- text: ""
- });
- textGroupHtml.css({
- color: state.textColor,
- width: null
- });
- textHtml.html(state.html);
- state.isRendered = true
- }
- } else {
- that._text.css({
- fill: state.textColor
- }).attr({
- text: state.text,
- "class": options.cssClass
- }).append(group.attr({
- align: options.textAlignment
- }))
- }
- _this.plaque.customizeCloud({
- fill: state.color,
- stroke: state.borderColor
- })
- }, true, function(tooltip, g) {
- var state = tooltip._state;
- if (state.html) {
- var bBox;
- var getComputedStyle = window.getComputedStyle;
- if (getComputedStyle) {
- bBox = getComputedStyle(textHtml.get(0));
- bBox = {
- x: 0,
- y: 0,
- width: mathCeil(parseFloat(bBox.width)),
- height: mathCeil(parseFloat(bBox.height))
- }
- } else {
- bBox = textHtml.get(0).getBoundingClientRect();
- bBox = {
- x: 0,
- y: 0,
- width: mathCeil(bBox.width ? bBox.width : bBox.right - bBox.left),
- height: mathCeil(bBox.height ? bBox.height : bBox.bottom - bBox.top)
- }
- }
- return bBox
- }
- return g.getBBox()
- }, function(tooltip, g, x, y) {
- var state = tooltip._state;
- if (state.html) {
- that._textGroupHtml.css({
- left: x,
- top: y
- })
- } else {
- g.move(x, y)
- }
- });
- return that
- },
- setRendererOptions: function(options) {
- this._renderer.setOptions(options);
- this._textGroupHtml.css({
- direction: options.rtl ? "rtl" : "ltr"
- });
- return this
- },
- render: function() {
- var that = this;
- hideElement(that._wrapper);
- var normalizedCSS = {};
- for (var name in that._textFontStyles) {
- normalizedCSS[_inflector2.default.camelize(name)] = that._textFontStyles[name]
- }
- that._textGroupHtml.css(normalizedCSS);
- that._text.css(that._textFontStyles);
- that._eventData = null;
- return that
- },
- update: function(options) {
- return this.setOptions(options).render()
- },
- _prepare: function(formatObject, state) {
- var customizeTooltip = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this._customizeTooltip;
- var options = this._options;
- var customize = {};
- if (_type2.default.isFunction(customizeTooltip)) {
- customize = customizeTooltip.call(formatObject, formatObject);
- customize = _type2.default.isPlainObject(customize) ? customize : {};
- if ("text" in customize) {
- state.text = _type2.default.isDefined(customize.text) ? String(customize.text) : ""
- }
- if ("html" in customize) {
- state.html = _type2.default.isDefined(customize.html) ? String(customize.html) : ""
- }
- }
- if (!("text" in state) && !("html" in state)) {
- state.text = formatObject.valueText || formatObject.description || ""
- }
- state.color = customize.color || options.color;
- state.borderColor = customize.borderColor || (options.border || {}).color;
- state.textColor = customize.fontColor || (options.font || {}).color;
- return !!state.text || !!state.html
- },
- show: function(formatObject, params, eventData, customizeTooltip) {
- var that = this;
- var state = {};
- if (!that._prepare(formatObject, state, customizeTooltip)) {
- return false
- }
- that._state = state;
- that._wrapper.appendTo(that._getContainer());
- that._textHtml.html("");
- this.plaque.clear().draw((0, _extend.extend)({}, that._options, {
- canvas: that._getCanvas()
- }, state, {
- x: params.x,
- y: params.y,
- offset: params.offset
- }));
- that.moveWrapper();
- that._eventData && that._eventTrigger("tooltipHidden", that._eventData);
- that._eventData = eventData;
- that._eventTrigger("tooltipShown", that._eventData);
- return true
- },
- hide: function() {
- var that = this;
- hideElement(that._wrapper);
- that._eventData && that._eventTrigger("tooltipHidden", that._eventData);
- that._eventData = null
- },
- move: function(x, y, offset) {
- this.plaque.draw({
- x: x,
- y: y,
- offset: offset,
- canvas: this._getCanvas()
- });
- this.moveWrapper()
- },
- moveWrapper: function() {
- var that = this;
- var plaqueBBox = this.plaque.getBBox();
- that._renderer.resize(plaqueBBox.width, plaqueBBox.height);
- var offset = that._wrapper.css({
- left: 0,
- top: 0
- }).offset();
- var left = plaqueBBox.x;
- var top = plaqueBBox.y;
- that._wrapper.css({
- left: left - offset.left,
- top: top - offset.top
- });
- this.plaque.moveRoot(-left, -top);
- if (this._state.html) {
- that._textHtml.css({
- left: -left,
- top: -top
- });
- that._textGroupHtml.css({
- width: plaqueBBox.width
- })
- }
- },
- formatValue: function(value, _specialFormat) {
- var options = _specialFormat ? getSpecialFormatOptions(this._options, _specialFormat) : this._options;
- return (0, _format_helper.format)(value, options.format)
- },
- getLocation: function() {
- return _utils2.default.normalizeEnum(this._options.location)
- },
- isEnabled: function() {
- return !!this._options.enabled
- },
- isShared: function() {
- return !!this._options.shared
- },
- _getCanvas: function() {
- var container = this._getContainer();
- var containerBox = container.getBoundingClientRect();
- var html = _dom_adapter2.default.getDocumentElement();
- var document = _dom_adapter2.default.getDocument();
- var left = window.pageXOffset || html.scrollLeft || 0;
- var top = window.pageYOffset || html.scrollTop || 0;
- var box = {
- left: left,
- top: top,
- width: html.clientWidth + left || 0,
- height: mathMax(document.body.scrollHeight, html.scrollHeight, document.body.offsetHeight, html.offsetHeight, document.body.clientHeight, html.clientHeight) || 0,
- right: 0,
- bottom: 0
- };
- if (container !== _dom_adapter2.default.getBody()) {
- left = mathMax(box.left, box.left + containerBox.left);
- top = mathMax(box.top, box.top + containerBox.top);
- box.width = mathMin(containerBox.width, box.width) + left + box.left;
- box.height = mathMin(containerBox.height, box.height) + top + box.top;
- box.left = left;
- box.top = top
- }
- return box
- }
- };
- exports.Tooltip = Tooltip;
- exports.plugin = {
- name: "tooltip",
- init: function() {
- this._initTooltip()
- },
- dispose: function() {
- this._disposeTooltip()
- },
- members: {
- _initTooltip: function() {
- this._tooltip = new exports.Tooltip({
- cssClass: this._rootClassPrefix + "-tooltip",
- eventTrigger: this._eventTrigger,
- pathModified: this.option("pathModified"),
- widgetRoot: this.element()
- })
- },
- _disposeTooltip: function() {
- this._tooltip.dispose();
- this._tooltip = null
- },
- _setTooltipRendererOptions: function() {
- this._tooltip.setRendererOptions(this._getRendererOptions())
- },
- _setTooltipOptions: function() {
- this._tooltip.update(this._getOption("tooltip"))
- }
- },
- extenders: {
- _stopCurrentHandling: function() {
- this._tooltip && this._tooltip.hide()
- }
- },
- customize: function(constructor) {
- var proto = constructor.prototype;
- proto._eventsMap.onTooltipShown = {
- name: "tooltipShown"
- };
- proto._eventsMap.onTooltipHidden = {
- name: "tooltipHidden"
- };
- constructor.addChange({
- code: "TOOLTIP_RENDERER",
- handler: function() {
- this._setTooltipRendererOptions()
- },
- isThemeDependent: true,
- isOptionChange: true
- });
- constructor.addChange({
- code: "TOOLTIP",
- handler: function() {
- this._setTooltipOptions()
- },
- isThemeDependent: true,
- isOptionChange: true,
- option: "tooltip"
- })
- },
- fontFields: ["tooltip.font"]
- }
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/translators/range.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _isDefined = typeUtils.isDefined;
- var _isDate = typeUtils.isDate;
- var _isFunction = typeUtils.isFunction;
- var unique = __webpack_require__( /*! ../core/utils */ 10).unique;
- var minSelector = "min";
- var maxSelector = "max";
- var minVisibleSelector = "minVisible";
- var maxVisibleSelector = "maxVisible";
- var baseSelector = "base";
- var axisTypeSelector = "axisType";
- function otherLessThan(thisValue, otherValue) {
- return otherValue < thisValue
- }
- function otherGreaterThan(thisValue, otherValue) {
- return otherValue > thisValue
- }
- function compareAndReplace(thisValue, otherValue, setValue, compare) {
- var otherValueDefined = _isDefined(otherValue);
- if (_isDefined(thisValue)) {
- if (otherValueDefined && compare(thisValue, otherValue)) {
- setValue(otherValue)
- }
- } else {
- if (otherValueDefined) {
- setValue(otherValue)
- }
- }
- }
- var _Range = exports.Range = function(range) {
- range && extend(this, range)
- };
- _Range.prototype = {
- constructor: _Range,
- addRange: function(otherRange) {
- var that = this;
- var categories = that.categories;
- var otherCategories = otherRange.categories;
- var compareAndReplaceByField = function(field, compare) {
- compareAndReplace(that[field], otherRange[field], function(value) {
- that[field] = value
- }, compare)
- };
- var controlValuesByVisibleBounds = function(valueField, visibleValueField, compare) {
- compareAndReplace(that[valueField], that[visibleValueField], function(value) {
- _isDefined(that[valueField]) && (that[valueField] = value)
- }, compare)
- };
- var checkField = function(field) {
- that[field] = that[field] || otherRange[field]
- };
- checkField("invert");
- checkField(axisTypeSelector);
- checkField("dataType");
- checkField("isSpacedMargin"), checkField("checkMinDataVisibility");
- checkField("checkMaxDataVisibility");
- if ("logarithmic" === that[axisTypeSelector]) {
- checkField(baseSelector)
- } else {
- that[baseSelector] = void 0
- }
- compareAndReplaceByField(minSelector, otherLessThan);
- compareAndReplaceByField(maxSelector, otherGreaterThan);
- if ("discrete" === that[axisTypeSelector]) {
- checkField(minVisibleSelector);
- checkField(maxVisibleSelector)
- } else {
- compareAndReplaceByField(minVisibleSelector, otherLessThan);
- compareAndReplaceByField(maxVisibleSelector, otherGreaterThan)
- }
- compareAndReplaceByField("interval", otherLessThan);
- controlValuesByVisibleBounds(minSelector, minVisibleSelector, otherLessThan);
- controlValuesByVisibleBounds(minSelector, maxVisibleSelector, otherLessThan);
- controlValuesByVisibleBounds(maxSelector, maxVisibleSelector, otherGreaterThan);
- controlValuesByVisibleBounds(maxSelector, minVisibleSelector, otherGreaterThan);
- if (void 0 === categories) {
- that.categories = otherCategories
- } else {
- that.categories = otherCategories ? unique(categories.concat(otherCategories)) : categories
- }
- return that
- },
- isEmpty: function() {
- return (!_isDefined(this[minSelector]) || !_isDefined(this[maxSelector])) && (!this.categories || 0 === this.categories.length)
- },
- correctValueZeroLevel: function() {
- var that = this;
- if ("logarithmic" === that[axisTypeSelector] || _isDate(that[maxSelector]) || _isDate(that[minSelector])) {
- return that
- }
- function setZeroLevel(min, max) {
- that[min] < 0 && that[max] < 0 && (that[max] = 0);
- that[min] > 0 && that[max] > 0 && (that[min] = 0)
- }
- setZeroLevel(minSelector, maxSelector);
- setZeroLevel(minVisibleSelector, maxVisibleSelector);
- return that
- },
- sortCategories: function(sort) {
- if (false === sort || !this.categories) {
- return
- }
- if (Array.isArray(sort)) {
- var sortValues = sort.map(function(item) {
- return item.valueOf()
- });
- var filteredSeriesCategories = this.categories.filter(function(item) {
- return sortValues.indexOf(item.valueOf()) === -1
- });
- this.categories = sort.concat(filteredSeriesCategories)
- } else {
- var notAFunction = !_isFunction(sort);
- if (notAFunction && "string" !== this.dataType) {
- sort = function(a, b) {
- return a.valueOf() - b.valueOf()
- }
- } else {
- if (notAFunction) {
- sort = false
- }
- }
- sort && this.categories.sort(sort)
- }
- }
- }
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/empty_template.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
- var EmptyTemplate = TemplateBase.inherit({
- _renderCore: function() {
- return $()
- }
- });
- module.exports = EmptyTemplate
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/data/odata/utils.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
- var _Guid = __webpack_require__( /*! ../../core/guid */ 40);
- var isDefined = typeUtils.isDefined;
- var isPlainObject = typeUtils.isPlainObject;
- var grep = __webpack_require__( /*! ../../core/utils/common */ 4).grep;
- var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
- var errors = __webpack_require__( /*! ../errors */ 36).errors;
- var dataUtils = __webpack_require__( /*! ../utils */ 41);
- var GUID_REGEX = /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/;
- var VERBOSE_DATE_REGEX = /^\/Date\((-?\d+)((\+|-)?(\d+)?)\)\/$/;
- var ISO8601_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[-+]{1}\d{2}(:?)(\d{2})?)?$/;
- var JSON_VERBOSE_MIME_TYPE = "application/json;odata=verbose";
- var makeArray = function(value) {
- return "string" === typeUtils.type(value) ? value.split() : value
- };
- var hasDot = function(x) {
- return /\./.test(x)
- };
- var pad = function(text, length, right) {
- text = String(text);
- while (text.length < length) {
- text = right ? text + "0" : "0" + text
- }
- return text
- };
- function formatISO8601(date, skipZeroTime, skipTimezone) {
- var bag = [];
- var isZeroTime = function() {
- return date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() < 1
- };
- var padLeft2 = function(text) {
- return pad(text, 2)
- };
- bag.push(date.getFullYear());
- bag.push("-");
- bag.push(padLeft2(date.getMonth() + 1));
- bag.push("-");
- bag.push(padLeft2(date.getDate()));
- if (!(skipZeroTime && isZeroTime())) {
- bag.push("T");
- bag.push(padLeft2(date.getHours()));
- bag.push(":");
- bag.push(padLeft2(date.getMinutes()));
- bag.push(":");
- bag.push(padLeft2(date.getSeconds()));
- if (date.getMilliseconds()) {
- bag.push(".");
- bag.push(pad(date.getMilliseconds(), 3))
- }
- if (!skipTimezone) {
- bag.push("Z")
- }
- }
- return bag.join("")
- }
- function parseISO8601(isoString) {
- var result = new Date(60 * new Date(0).getTimezoneOffset() * 1e3);
- var chunks = isoString.replace("Z", "").split("T");
- var date = /(\d{4})-(\d{2})-(\d{2})/.exec(chunks[0]);
- var time = /(\d{2}):(\d{2}):(\d{2})\.?(\d{0,7})?/.exec(chunks[1]);
- result.setFullYear(Number(date[1]));
- result.setMonth(Number(date[2]) - 1);
- result.setDate(Number(date[3]));
- if (Array.isArray(time) && time.length) {
- result.setHours(Number(time[1]));
- result.setMinutes(Number(time[2]));
- result.setSeconds(Number(time[3]));
- var fractional = (time[4] || "").slice(0, 3);
- fractional = pad(fractional, 3, true);
- result.setMilliseconds(Number(fractional))
- }
- return result
- }
- function isAbsoluteUrl(url) {
- return /^(?:[a-z]+:)?\/\//i.test(url)
- }
- function toAbsoluteUrl(basePath, relativePath) {
- var part;
- var baseParts = stripParams(basePath).split("/");
- var relativeParts = relativePath.split("/");
- function stripParams(url) {
- var index = url.indexOf("?");
- if (index > -1) {
- return url.substr(0, index)
- }
- return url
- }
- baseParts.pop();
- while (relativeParts.length) {
- part = relativeParts.shift();
- if (".." === part) {
- baseParts.pop()
- } else {
- baseParts.push(part)
- }
- }
- return baseParts.join("/")
- }
- var param = function(params) {
- var result = [];
- for (var name in params) {
- result.push(name + "=" + params[name])
- }
- return result.join("&")
- };
- var ajaxOptionsForRequest = function(protocolVersion, request, options) {
- request = extend({
- async: true,
- method: "get",
- url: "",
- params: {},
- payload: null,
- headers: {},
- timeout: 3e4
- }, request);
- options = options || {};
- var beforeSend = options.beforeSend;
- if (beforeSend) {
- beforeSend(request)
- }
- var method = (request.method || "get").toLowerCase();
- var isGet = "get" === method;
- var useJsonp = isGet && options.jsonp;
- var params = extend({}, request.params);
- var ajaxData = isGet ? params : formatPayload(request.payload);
- var qs = !isGet && param(params);
- var url = request.url;
- var contentType = !isGet && JSON_VERBOSE_MIME_TYPE;
- if (qs) {
- url += (url.indexOf("?") > -1 ? "&" : "?") + qs
- }
- if (useJsonp) {
- ajaxData.$format = "json"
- }
- return {
- url: url,
- data: ajaxData,
- dataType: useJsonp ? "jsonp" : "json",
- jsonp: useJsonp && "$callback",
- method: method,
- async: request.async,
- timeout: request.timeout,
- headers: request.headers,
- contentType: contentType,
- accepts: {
- json: [JSON_VERBOSE_MIME_TYPE, "text/plain"].join()
- },
- xhrFields: {
- withCredentials: options.withCredentials
- }
- };
- function formatPayload(payload) {
- return JSON.stringify(payload, function(key, value) {
- if (!(this[key] instanceof Date)) {
- return value
- }
- value = formatISO8601(this[key]);
- switch (protocolVersion) {
- case 2:
- return value.substr(0, value.length - 1);
- case 3:
- case 4:
- return value;
- default:
- throw errors.Error("E4002")
- }
- })
- }
- };
- var sendRequest = function sendRequest(protocolVersion, request, options) {
- var d = new Deferred;
- var ajaxOptions = ajaxOptionsForRequest(protocolVersion, request, options);
- ajax.sendRequest(ajaxOptions).always(function(obj, textStatus) {
- var transformOptions = {
- deserializeDates: options.deserializeDates,
- fieldTypes: options.fieldTypes
- };
- var tuple = interpretJsonFormat(obj, textStatus, transformOptions, ajaxOptions);
- var error = tuple.error;
- var data = tuple.data;
- var nextUrl = tuple.nextUrl;
- var extra;
- if (error) {
- if (error.message !== dataUtils.XHR_ERROR_UNLOAD) {
- d.reject(error)
- }
- } else {
- if (options.countOnly) {
- if (isFinite(tuple.count)) {
- d.resolve(tuple.count)
- } else {
- d.reject(new errors.Error("E4018"))
- }
- } else {
- if (nextUrl && !options.isPaged) {
- if (!isAbsoluteUrl(nextUrl)) {
- nextUrl = toAbsoluteUrl(ajaxOptions.url, nextUrl)
- }
- sendRequest(protocolVersion, {
- url: nextUrl
- }, options).fail(d.reject).done(function(nextData) {
- d.resolve(data.concat(nextData))
- })
- } else {
- if (isFinite(tuple.count)) {
- extra = {
- totalCount: tuple.count
- }
- }
- d.resolve(data, extra)
- }
- }
- }
- });
- return d.promise()
- };
- var formatDotNetError = function(errorObj) {
- var message;
- var currentError = errorObj;
- if ("message" in errorObj) {
- if (errorObj.message.value) {
- message = errorObj.message.value
- } else {
- message = errorObj.message
- }
- }
- while (currentError = currentError.innererror || currentError.internalexception) {
- message = currentError.message;
- if (currentError.internalexception && message.indexOf("inner exception") === -1) {
- break
- }
- }
- return message
- };
- var errorFromResponse = function(obj, textStatus, ajaxOptions) {
- if ("nocontent" === textStatus) {
- return null
- }
- var message = "Unknown error";
- var response = obj;
- var httpStatus = 200;
- var errorData = {
- requestOptions: ajaxOptions
- };
- if ("success" !== textStatus) {
- httpStatus = obj.status;
- message = dataUtils.errorMessageFromXhr(obj, textStatus);
- try {
- response = JSON.parse(obj.responseText)
- } catch (x) {}
- }
- var errorObj = response && (response.then && response || response.error || response["odata.error"] || response["@odata.error"]);
- if (errorObj) {
- message = formatDotNetError(errorObj) || message;
- errorData.errorDetails = errorObj;
- if (200 === httpStatus) {
- httpStatus = 500
- }
- var customCode = Number(errorObj.code);
- if (isFinite(customCode) && customCode >= 400) {
- httpStatus = customCode
- }
- }
- if (httpStatus >= 400 || 0 === httpStatus) {
- errorData.httpStatus = httpStatus;
- return extend(Error(message), errorData)
- }
- return null
- };
- var interpretJsonFormat = function(obj, textStatus, transformOptions, ajaxOptions) {
- var error = errorFromResponse(obj, textStatus, ajaxOptions);
- var value;
- if (error) {
- return {
- error: error
- }
- }
- if (!isPlainObject(obj)) {
- return {
- data: obj
- }
- }
- if ("d" in obj && (Array.isArray(obj.d) || typeUtils.isObject(obj.d))) {
- value = interpretVerboseJsonFormat(obj, textStatus)
- } else {
- value = interpretLightJsonFormat(obj, textStatus)
- }
- transformTypes(value, transformOptions);
- return value
- };
- var interpretVerboseJsonFormat = function(obj) {
- var data = obj.d;
- if (!isDefined(data)) {
- return {
- error: Error("Malformed or unsupported JSON response received")
- }
- }
- if (isDefined(data.results)) {
- data = data.results
- }
- return {
- data: data,
- nextUrl: obj.d.__next,
- count: parseInt(obj.d.__count, 10)
- }
- };
- var interpretLightJsonFormat = function(obj) {
- var data = obj;
- if (isDefined(data.value)) {
- data = data.value
- }
- return {
- data: data,
- nextUrl: obj["@odata.nextLink"],
- count: parseInt(obj["@odata.count"], 10)
- }
- };
- var EdmLiteral = Class.inherit({
- ctor: function(value) {
- this._value = value
- },
- valueOf: function() {
- return this._value
- }
- });
- var transformTypes = function transformTypes(obj, options) {
- options = options || {};
- each(obj, function(key, value) {
- if (null !== value && "object" === _typeof(value)) {
- if ("results" in value) {
- obj[key] = value.results
- }
- transformTypes(obj[key], options)
- } else {
- if ("string" === typeof value) {
- var fieldTypes = options.fieldTypes;
- var canBeGuid = !fieldTypes || "String" !== fieldTypes[key];
- if (canBeGuid && GUID_REGEX.test(value)) {
- obj[key] = new _Guid(value)
- }
- if (false !== options.deserializeDates) {
- if (value.match(VERBOSE_DATE_REGEX)) {
- var date = new Date(Number(RegExp.$1) + 60 * RegExp.$2 * 1e3);
- obj[key] = new Date(date.valueOf() + 60 * date.getTimezoneOffset() * 1e3)
- } else {
- if (ISO8601_DATE_REGEX.test(value)) {
- obj[key] = new Date(parseISO8601(obj[key]).valueOf())
- }
- }
- }
- }
- }
- })
- };
- var serializeDate = function(date) {
- return "datetime'" + formatISO8601(date, true, true) + "'"
- };
- var serializeString = function(value) {
- return "'" + value.replace(/'/g, "''") + "'"
- };
- var serializePropName = function(propName) {
- if (propName instanceof EdmLiteral) {
- return propName.valueOf()
- }
- return propName.replace(/\./g, "/")
- };
- var serializeValueV4 = function serializeValueV4(value) {
- if (value instanceof Date) {
- return formatISO8601(value, false, false)
- }
- if (value instanceof _Guid) {
- return value.valueOf()
- }
- if (Array.isArray(value)) {
- return "[" + value.map(function(item) {
- return serializeValueV4(item)
- }).join(",") + "]"
- }
- return serializeValueV2(value)
- };
- var serializeValueV2 = function(value) {
- if (value instanceof Date) {
- return serializeDate(value)
- }
- if (value instanceof _Guid) {
- return "guid'" + value + "'"
- }
- if (value instanceof EdmLiteral) {
- return value.valueOf()
- }
- if ("string" === typeof value) {
- return serializeString(value)
- }
- return String(value)
- };
- var serializeValue = function(value, protocolVersion) {
- switch (protocolVersion) {
- case 2:
- case 3:
- return serializeValueV2(value);
- case 4:
- return serializeValueV4(value);
- default:
- throw errors.Error("E4002")
- }
- };
- var serializeKey = function(key, protocolVersion) {
- if (isPlainObject(key)) {
- var parts = [];
- each(key, function(k, v) {
- parts.push(serializePropName(k) + "=" + serializeValue(v, protocolVersion))
- });
- return parts.join()
- }
- return serializeValue(key, protocolVersion)
- };
- var keyConverters = {
- String: function(value) {
- return value + ""
- },
- Int32: function(value) {
- return Math.floor(value)
- },
- Int64: function(value) {
- if (value instanceof EdmLiteral) {
- return value
- }
- return new EdmLiteral(value + "L")
- },
- Guid: function(value) {
- if (value instanceof _Guid) {
- return value
- }
- return new _Guid(value)
- },
- Boolean: function(value) {
- return !!value
- },
- Single: function(value) {
- if (value instanceof EdmLiteral) {
- return value
- }
- return new EdmLiteral(value + "f")
- },
- Decimal: function(value) {
- if (value instanceof EdmLiteral) {
- return value
- }
- return new EdmLiteral(value + "m")
- }
- };
- var convertPrimitiveValue = function(type, value) {
- if (null === value) {
- return null
- }
- var converter = keyConverters[type];
- if (!converter) {
- throw errors.Error("E4014", type)
- }
- return converter(value)
- };
- var generateSelect = function(oDataVersion, select) {
- if (!select) {
- return
- }
- if (oDataVersion < 4) {
- return serializePropName(select.join())
- }
- return grep(select, hasDot, true).join()
- };
- var generateExpand = function(oDataVersion, expand, select) {
- var generatorV2 = function() {
- var hash = {};
- if (expand) {
- iteratorUtils.each(makeArray(expand), function() {
- hash[serializePropName(this)] = 1
- })
- }
- if (select) {
- iteratorUtils.each(makeArray(select), function() {
- var path = this.split(".");
- if (path.length < 2) {
- return
- }
- path.pop();
- hash[serializePropName(path.join("."))] = 1
- })
- }
- return iteratorUtils.map(hash, function(k, v) {
- return v
- }).join()
- };
- var generatorV4 = function() {
- var format = function(hash) {
- var formatCore = function formatCore(hash) {
- var result = "";
- var selectValue = [];
- var expandValue = [];
- iteratorUtils.each(hash, function(key, value) {
- if (Array.isArray(value)) {
- [].push.apply(selectValue, value)
- }
- if (isPlainObject(value)) {
- expandValue.push(key + formatCore(value))
- }
- });
- if (selectValue.length || expandValue.length) {
- result += "(";
- if (selectValue.length) {
- result += "$select=" + iteratorUtils.map(selectValue, serializePropName).join()
- }
- if (expandValue.length) {
- if (selectValue.length) {
- result += ";"
- }
- result += "$expand=" + iteratorUtils.map(expandValue, serializePropName).join()
- }
- result += ")"
- }
- return result
- };
- var result = [];
- iteratorUtils.each(hash, function(key, value) {
- result.push(key + formatCore(value))
- });
- return result.join()
- };
- var parseTree = function(exprs, root, stepper) {
- var parseCore = function parseCore(exprParts, root, stepper) {
- var result = stepper(root, exprParts.shift(), exprParts);
- if (false === result) {
- return
- }
- parseCore(exprParts, result, stepper)
- };
- iteratorUtils.each(exprs, function(_, x) {
- parseCore(x.split("."), root, stepper)
- })
- };
- var hash = {};
- if (expand || select) {
- if (expand) {
- parseTree(makeArray(expand), hash, function(node, key, path) {
- node[key] = node[key] || {};
- if (!path.length) {
- return false
- }
- return node[key]
- })
- }
- if (select) {
- parseTree(grep(makeArray(select), hasDot), hash, function(node, key, path) {
- if (!path.length) {
- node[key] = node[key] || [];
- node[key].push(key);
- return false
- }
- return node[key] = node[key] || {}
- })
- }
- return format(hash)
- }
- };
- if (oDataVersion < 4) {
- return generatorV2()
- }
- return generatorV4()
- };
- exports.sendRequest = sendRequest;
- exports.serializePropName = serializePropName;
- exports.serializeValue = serializeValue;
- exports.serializeKey = serializeKey;
- exports.keyConverters = keyConverters;
- exports.convertPrimitiveValue = convertPrimitiveValue;
- exports.generateExpand = generateExpand;
- exports.generateSelect = generateSelect;
- exports.EdmLiteral = EdmLiteral;
- exports.OData__internals = {
- interpretJsonFormat: interpretJsonFormat
- }
- },
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/core/action.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ./renderer */ 2);
- var config = __webpack_require__( /*! ./config */ 31);
- var window = __webpack_require__( /*! ./utils/window */ 7).getWindow();
- var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
- var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
- var Class = __webpack_require__( /*! ./class */ 15);
- var errors = __webpack_require__( /*! ./errors */ 21);
- var Action = Class.inherit({
- ctor: function(action, config) {
- config = config || {};
- this._action = action;
- this._context = config.context || window;
- this._beforeExecute = config.beforeExecute;
- this._afterExecute = config.afterExecute;
- this._component = config.component;
- this._validatingTargetName = config.validatingTargetName;
- var excludeValidators = this._excludeValidators = {};
- if (config.excludeValidators) {
- for (var i = 0; i < config.excludeValidators.length; i++) {
- excludeValidators[config.excludeValidators[i]] = true
- }
- }
- },
- execute: function() {
- var e = {
- action: this._action,
- args: Array.prototype.slice.call(arguments),
- context: this._context,
- component: this._component,
- validatingTargetName: this._validatingTargetName,
- cancel: false,
- handled: false
- };
- var beforeExecute = this._beforeExecute;
- var afterExecute = this._afterExecute;
- var argsBag = e.args[0] || {};
- if ("jQueryEvent" in argsBag && !argsBag.event) {
- throw "The jQueryEvent field is deprecated. Please, use the `event` field instead"
- }
- if (!("jQueryEvent" in argsBag) && argsBag.event && config().useJQuery) {
- Object.defineProperty(argsBag, "jQueryEvent", {
- get: function() {
- errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead");
- return argsBag.event
- },
- set: function(value) {
- errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead");
- argsBag.event = value
- }
- })
- }
- if (!this._validateAction(e)) {
- return
- }
- beforeExecute && beforeExecute.call(this._context, e);
- if (e.cancel) {
- return
- }
- var result = this._executeAction(e);
- if (argsBag.cancel) {
- return
- }
- afterExecute && afterExecute.call(this._context, e);
- return result
- },
- _validateAction: function(e) {
- var excludeValidators = this._excludeValidators;
- var executors = Action.executors;
- for (var name in executors) {
- if (!excludeValidators[name]) {
- var executor = executors[name];
- if (executor.validate) {
- executor.validate(e)
- }
- if (e.cancel) {
- return false
- }
- }
- }
- return true
- },
- _executeAction: function(e) {
- var result;
- var executors = Action.executors;
- for (var name in executors) {
- var executor = executors[name];
- if (executor.execute) {
- executor.execute(e)
- }
- if (e.handled) {
- result = e.result;
- break
- }
- }
- return result
- }
- });
- Action.executors = {};
- Action.registerExecutor = function(name, executor) {
- if (typeUtils.isPlainObject(name)) {
- each(name, Action.registerExecutor);
- return
- }
- Action.executors[name] = executor
- };
- Action.unregisterExecutor = function() {
- var args = [].slice.call(arguments);
- each(args, function() {
- delete Action.executors[this]
- })
- };
- Action.registerExecutor({
- undefined: {
- execute: function(e) {
- if (!e.action) {
- e.result = void 0;
- e.handled = true
- }
- }
- },
- func: {
- execute: function(e) {
- if (typeUtils.isFunction(e.action)) {
- e.result = e.action.call(e.context, e.args[0]);
- e.handled = true
- }
- }
- }
- });
- var createValidatorByTargetElement = function(condition) {
- return function(e) {
- if (!e.args.length) {
- return
- }
- var args = e.args[0];
- var element = args[e.validatingTargetName] || args.element;
- if (element && condition($(element))) {
- e.cancel = true
- }
- }
- };
- Action.registerExecutor({
- disabled: {
- validate: createValidatorByTargetElement(function($target) {
- return $target.is(".dx-state-disabled, .dx-state-disabled *")
- })
- },
- readOnly: {
- validate: createValidatorByTargetElement(function($target) {
- return $target.is(".dx-state-readonly, .dx-state-readonly *")
- })
- }
- });
- module.exports = Action
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/animation/frame.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
- var window = windowUtils.hasWindow() ? windowUtils.getWindow() : {};
- var callOnce = __webpack_require__( /*! ../core/utils/call_once */ 63);
- var FRAME_ANIMATION_STEP_TIME = 1e3 / 60;
- var request = function(callback) {
- return setTimeout(callback, FRAME_ANIMATION_STEP_TIME)
- };
- var cancel = function(requestID) {
- clearTimeout(requestID)
- };
- var setAnimationFrameMethods = callOnce(function() {
- var nativeRequest = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
- var nativeCancel = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame;
- if (nativeRequest && nativeCancel) {
- request = nativeRequest;
- cancel = nativeCancel
- }
- if (nativeRequest && !nativeCancel) {
- var canceledRequests = {};
- request = function(callback) {
- var requestId = nativeRequest.call(window, function() {
- try {
- if (requestId in canceledRequests) {
- return
- }
- callback.apply(this, arguments)
- } finally {
- delete canceledRequests[requestId]
- }
- });
- return requestId
- };
- cancel = function(requestId) {
- canceledRequests[requestId] = true
- }
- }
- });
- exports.requestAnimationFrame = function() {
- setAnimationFrameMethods();
- return request.apply(window, arguments)
- };
- exports.cancelAnimationFrame = function() {
- setAnimationFrameMethods();
- cancel.apply(window, arguments)
- }
- }, , , , ,
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/components/consts.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = {
- events: {
- mouseover: "mouseover",
- mouseout: "mouseout",
- mousemove: "mousemove",
- touchstart: "touchstart",
- touchmove: "touchmove",
- touchend: "touchend",
- mousedown: "mousedown",
- mouseup: "mouseup",
- click: "click",
- selectSeries: "selectseries",
- deselectSeries: "deselectseries",
- selectPoint: "selectpoint",
- deselectPoint: "deselectpoint",
- showPointTooltip: "showpointtooltip",
- hidePointTooltip: "hidepointtooltip"
- },
- states: {
- hover: "hover",
- normal: "normal",
- selection: "selection",
- normalMark: 0,
- hoverMark: 1,
- selectedMark: 2,
- applyHover: "applyHover",
- applySelected: "applySelected",
- resetItem: "resetItem"
- },
- radialLabelIndent: 30,
- pieLabelSpacing: 10,
- pieSeriesSpacing: 4
- }
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/symbol_point.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each;
- var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
- var windowUtils = __webpack_require__( /*! ../../../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var labelModule = __webpack_require__( /*! ./label */ 246);
- var _extend = extend;
- var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
- var _normalizeEnum = __webpack_require__( /*! ../../core/utils */ 10).normalizeEnum;
- var _math = Math;
- var _round = _math.round;
- var _floor = _math.floor;
- var _ceil = _math.ceil;
- var DEFAULT_IMAGE_WIDTH = 20;
- var DEFAULT_IMAGE_HEIGHT = 20;
- var LABEL_OFFSET = 10;
- var CANVAS_POSITION_DEFAULT = "canvas_position_default";
- function getSquareMarkerCoords(radius) {
- return [-radius, -radius, radius, -radius, radius, radius, -radius, radius, -radius, -radius]
- }
- function getPolygonMarkerCoords(radius) {
- var r = _ceil(radius);
- return [-r, 0, 0, -r, r, 0, 0, r, -r, 0]
- }
- function getCrossMarkerCoords(radius) {
- var r = _ceil(radius);
- var floorHalfRadius = _floor(r / 2);
- var ceilHalfRadius = _ceil(r / 2);
- return [-r, -floorHalfRadius, -floorHalfRadius, -r, 0, -ceilHalfRadius, floorHalfRadius, -r, r, -floorHalfRadius, ceilHalfRadius, 0, r, floorHalfRadius, floorHalfRadius, r, 0, ceilHalfRadius, -floorHalfRadius, r, -r, floorHalfRadius, -ceilHalfRadius, 0]
- }
- function getTriangleDownMarkerCoords(radius) {
- return [-radius, -radius, radius, -radius, 0, radius, -radius, -radius]
- }
- function getTriangleUpMarkerCoords(radius) {
- return [-radius, radius, radius, radius, 0, -radius, -radius, radius]
- }
- module.exports = {
- deleteLabel: function() {
- this._label.dispose();
- this._label = null
- },
- _hasGraphic: function() {
- return this.graphic
- },
- clearVisibility: function() {
- var that = this;
- var graphic = that.graphic;
- if (graphic && graphic.attr("visibility")) {
- graphic.attr({
- visibility: null
- })
- }
- },
- isVisible: function() {
- return this.inVisibleArea && this.series.isVisible()
- },
- setInvisibility: function() {
- var that = this;
- var graphic = that.graphic;
- if (graphic && "hidden" !== graphic.attr("visibility")) {
- graphic.attr({
- visibility: "hidden"
- })
- }
- that._errorBar && that._errorBar.attr({
- visibility: "hidden"
- });
- that._label.draw(false)
- },
- clearMarker: function() {
- var graphic = this.graphic;
- graphic && graphic.attr(this._emptySettings)
- },
- _createLabel: function() {
- this._label = new labelModule.Label({
- renderer: this.series._renderer,
- labelsGroup: this.series._labelsGroup,
- point: this
- })
- },
- _updateLabelData: function() {
- this._label.setData(this._getLabelFormatObject())
- },
- _updateLabelOptions: function() {
- !this._label && this._createLabel();
- this._label.setOptions(this._options.label)
- },
- _checkImage: function(image) {
- return _isDefined(image) && ("string" === typeof image || _isDefined(image.url))
- },
- _fillStyle: function() {
- this._styles = this._options.styles
- },
- _checkSymbol: function(oldOptions, newOptions) {
- var oldSymbol = oldOptions.symbol;
- var newSymbol = newOptions.symbol;
- var symbolChanged = "circle" === oldSymbol && "circle" !== newSymbol || "circle" !== oldSymbol && "circle" === newSymbol;
- var imageChanged = this._checkImage(oldOptions.image) !== this._checkImage(newOptions.image);
- return !!(symbolChanged || imageChanged)
- },
- _populatePointShape: function(symbol, radius) {
- switch (symbol) {
- case "square":
- return getSquareMarkerCoords(radius);
- case "polygon":
- return getPolygonMarkerCoords(radius);
- case "triangle":
- case "triangleDown":
- return getTriangleDownMarkerCoords(radius);
- case "triangleUp":
- return getTriangleUpMarkerCoords(radius);
- case "cross":
- return getCrossMarkerCoords(radius)
- }
- },
- hasCoords: function() {
- return null !== this.x && null !== this.y
- },
- correctValue: function(correction) {
- var that = this;
- var axis = that.series.getValueAxis();
- if (that.hasValue()) {
- that.value = that.properValue = axis.validateUnit(that.initialValue.valueOf() + correction.valueOf());
- that.minValue = axis.validateUnit(correction)
- }
- },
- resetCorrection: function() {
- this.value = this.properValue = this.initialValue;
- this.minValue = CANVAS_POSITION_DEFAULT
- },
- resetValue: function() {
- var that = this;
- if (that.hasValue()) {
- that.value = that.properValue = that.initialValue = 0;
- that.minValue = 0;
- that._label.setDataField("value", that.value)
- }
- },
- _getTranslates: function(animationEnabled) {
- var translateX = this.x;
- var translateY = this.y;
- if (animationEnabled) {
- if (this._options.rotated) {
- translateX = this.defaultX
- } else {
- translateY = this.defaultY
- }
- }
- return {
- x: translateX,
- y: translateY
- }
- },
- _createImageMarker: function(renderer, settings, options) {
- var width = options.width || DEFAULT_IMAGE_WIDTH;
- var height = options.height || DEFAULT_IMAGE_HEIGHT;
- return renderer.image(-_round(.5 * width), -_round(.5 * height), width, height, options.url ? options.url.toString() : options.toString(), "center").attr({
- translateX: settings.translateX,
- translateY: settings.translateY,
- visibility: settings.visibility
- })
- },
- _createSymbolMarker: function(renderer, pointSettings) {
- var marker;
- var symbol = this._options.symbol;
- if ("circle" === symbol) {
- delete pointSettings.points;
- marker = renderer.circle().attr(pointSettings)
- } else {
- if ("square" === symbol || "polygon" === symbol || "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol || "cross" === symbol) {
- marker = renderer.path([], "area").attr(pointSettings).sharp()
- }
- }
- return marker
- },
- _createMarker: function(renderer, group, image, settings) {
- var that = this;
- var marker = that._checkImage(image) ? that._createImageMarker(renderer, settings, image) : that._createSymbolMarker(renderer, settings);
- if (marker) {
- marker.data({
- "chart-data-point": that
- }).append(group)
- }
- return marker
- },
- _getSymbolBBox: function(x, y, r) {
- return {
- x: x - r,
- y: y - r,
- width: 2 * r,
- height: 2 * r
- }
- },
- _getImageBBox: function(x, y) {
- var image = this._options.image;
- var width = image.width || DEFAULT_IMAGE_WIDTH;
- var height = image.height || DEFAULT_IMAGE_HEIGHT;
- return {
- x: x - _round(width / 2),
- y: y - _round(height / 2),
- width: width,
- height: height
- }
- },
- _getGraphicBBox: function() {
- var that = this;
- var options = that._options;
- var x = that.x;
- var y = that.y;
- var bBox;
- if (options.visible) {
- bBox = that._checkImage(options.image) ? that._getImageBBox(x, y) : that._getSymbolBBox(x, y, options.styles.normal.r)
- } else {
- bBox = {
- x: x,
- y: y,
- width: 0,
- height: 0
- }
- }
- return bBox
- },
- hideInsideLabel: noop,
- _getShiftLabelCoords: function(label) {
- var coord = this._addLabelAlignmentAndOffset(label, this._getLabelCoords(label));
- return this._checkLabelPosition(label, coord)
- },
- _drawLabel: function() {
- var that = this;
- var customVisibility = that._getCustomLabelVisibility();
- var label = that._label;
- var isVisible = that._showForZeroValues() && that.hasValue() && false !== customVisibility && (that.series.getLabelVisibility() || customVisibility);
- label.draw(!!isVisible)
- },
- correctLabelPosition: function(label) {
- var that = this;
- var coord = that._getShiftLabelCoords(label);
- if (!that.hideInsideLabel(label, coord)) {
- label.setFigureToDrawConnector(that._getLabelConnector(label.pointPosition));
- label.shift(_round(coord.x), _round(coord.y))
- }
- },
- _showForZeroValues: function() {
- return true
- },
- _getLabelConnector: function(pointPosition) {
- var bBox = this._getGraphicBBox(pointPosition);
- var w2 = bBox.width / 2;
- var h2 = bBox.height / 2;
- return {
- x: bBox.x + w2,
- y: bBox.y + h2,
- r: this._options.visible ? Math.max(w2, h2) : 0
- }
- },
- _getPositionFromLocation: function() {
- return {
- x: this.x,
- y: this.y
- }
- },
- _isPointInVisibleArea: function(visibleArea, graphicBBox) {
- return visibleArea.minX <= graphicBBox.x + graphicBBox.width && visibleArea.maxX >= graphicBBox.x && visibleArea.minY <= graphicBBox.y + graphicBBox.height && visibleArea.maxY >= graphicBBox.y
- },
- _checkLabelPosition: function(label, coord) {
- var that = this;
- var visibleArea = that._getVisibleArea();
- var labelBBox = label.getBoundingRect();
- var graphicBBox = that._getGraphicBBox(label.pointPosition);
- var offset = LABEL_OFFSET;
- if (that._isPointInVisibleArea(visibleArea, graphicBBox)) {
- if (!that._options.rotated) {
- if (visibleArea.minX > coord.x) {
- coord.x = visibleArea.minX
- }
- if (visibleArea.maxX < coord.x + labelBBox.width) {
- coord.x = visibleArea.maxX - labelBBox.width
- }
- if (visibleArea.minY > coord.y) {
- coord.y = graphicBBox.y + graphicBBox.height + offset
- }
- if (visibleArea.maxY < coord.y + labelBBox.height) {
- coord.y = graphicBBox.y - labelBBox.height - offset
- }
- } else {
- if (visibleArea.minX > coord.x) {
- coord.x = graphicBBox.x + graphicBBox.width + offset
- }
- if (visibleArea.maxX < coord.x + labelBBox.width) {
- coord.x = graphicBBox.x - offset - labelBBox.width
- }
- if (visibleArea.minY > coord.y) {
- coord.y = visibleArea.minY
- }
- if (visibleArea.maxY < coord.y + labelBBox.height) {
- coord.y = visibleArea.maxY - labelBBox.height
- }
- }
- }
- return coord
- },
- _addLabelAlignmentAndOffset: function(label, coord) {
- var labelBBox = label.getBoundingRect();
- var labelOptions = label.getLayoutOptions();
- if (!this._options.rotated) {
- if ("left" === labelOptions.alignment) {
- coord.x += labelBBox.width / 2
- } else {
- if ("right" === labelOptions.alignment) {
- coord.x -= labelBBox.width / 2
- }
- }
- }
- coord.x += labelOptions.horizontalOffset;
- coord.y += labelOptions.verticalOffset;
- return coord
- },
- _getLabelCoords: function(label) {
- return this._getLabelCoordOfPosition(label, this._getLabelPosition(label.pointPosition))
- },
- _getLabelCoordOfPosition: function(label, position) {
- var that = this;
- var labelBBox = label.getBoundingRect();
- var graphicBBox = that._getGraphicBBox(label.pointPosition);
- var offset = LABEL_OFFSET;
- var centerY = graphicBBox.height / 2 - labelBBox.height / 2;
- var centerX = graphicBBox.width / 2 - labelBBox.width / 2;
- var x = graphicBBox.x;
- var y = graphicBBox.y;
- switch (position) {
- case "left":
- x -= labelBBox.width + offset;
- y += centerY;
- break;
- case "right":
- x += graphicBBox.width + offset;
- y += centerY;
- break;
- case "top":
- x += centerX;
- y -= labelBBox.height + offset;
- break;
- case "bottom":
- x += centerX;
- y += graphicBBox.height + offset;
- break;
- case "inside":
- x += centerX;
- y += centerY
- }
- return {
- x: x,
- y: y
- }
- },
- _drawMarker: function(renderer, group, animationEnabled) {
- var that = this;
- var options = that._options;
- var translates = that._getTranslates(animationEnabled);
- var style = that._getStyle();
- that.graphic = that._createMarker(renderer, group, options.image, _extend({
- translateX: translates.x,
- translateY: translates.y,
- points: that._populatePointShape(options.symbol, style.r)
- }, style))
- },
- _getErrorBarSettings: function() {
- return {
- visibility: "visible"
- }
- },
- _getErrorBarBaseEdgeLength: function() {
- return 2 * this.getPointRadius()
- },
- _drawErrorBar: function(renderer, group) {
- if (!this._options.errorBars) {
- return
- }
- var that = this;
- var options = that._options;
- var errorBarOptions = options.errorBars;
- var points = [];
- var settings;
- var pos = that._errorBarPos;
- var high = that._highErrorCoord;
- var low = that._lowErrorCoord;
- var displayMode = _normalizeEnum(errorBarOptions.displayMode);
- var isHighDisplayMode = "high" === displayMode;
- var isLowDisplayMode = "low" === displayMode;
- var highErrorOnly = (isHighDisplayMode || !_isDefined(low)) && _isDefined(high) && !isLowDisplayMode;
- var lowErrorOnly = (isLowDisplayMode || !_isDefined(high)) && _isDefined(low) && !isHighDisplayMode;
- var edgeLength = errorBarOptions.edgeLength;
- if (edgeLength <= 1 && edgeLength > 0) {
- edgeLength = this._getErrorBarBaseEdgeLength() * errorBarOptions.edgeLength
- }
- edgeLength = _floor(parseInt(edgeLength) / 2);
- highErrorOnly && (low = that._baseErrorBarPos);
- lowErrorOnly && (high = that._baseErrorBarPos);
- if ("none" !== displayMode && _isDefined(high) && _isDefined(low) && _isDefined(pos)) {
- !lowErrorOnly && points.push([pos - edgeLength, high, pos + edgeLength, high]);
- points.push([pos, high, pos, low]);
- !highErrorOnly && points.push([pos + edgeLength, low, pos - edgeLength, low]);
- options.rotated && each(points, function(_, p) {
- p.reverse()
- });
- settings = that._getErrorBarSettings(errorBarOptions);
- if (!that._errorBar) {
- that._errorBar = renderer.path(points, "line").attr(settings).append(group)
- } else {
- settings.points = points;
- that._errorBar.attr(settings)
- }
- } else {
- that._errorBar && that._errorBar.attr({
- visibility: "hidden"
- })
- }
- },
- getTooltipParams: function() {
- var that = this;
- var graphic = that.graphic;
- return {
- x: that.x,
- y: that.y,
- offset: graphic ? graphic.getBBox().height / 2 : 0
- }
- },
- setPercentValue: function(absTotal, total, leftHoleTotal, rightHoleTotal) {
- var that = this;
- var valuePercent = that.value / absTotal || 0;
- var minValuePercent = that.minValue / absTotal || 0;
- var percent = valuePercent - minValuePercent;
- that._label.setDataField("percent", percent);
- that._label.setDataField("total", total);
- if (that.series.isFullStackedSeries() && that.hasValue()) {
- if (that.leftHole) {
- that.leftHole /= absTotal - leftHoleTotal;
- that.minLeftHole /= absTotal - leftHoleTotal
- }
- if (that.rightHole) {
- that.rightHole /= absTotal - rightHoleTotal;
- that.minRightHole /= absTotal - rightHoleTotal
- }
- that.value = that.properValue = valuePercent;
- that.minValue = !minValuePercent ? that.minValue : minValuePercent
- }
- },
- _storeTrackerR: function() {
- var that = this;
- var navigator = window.navigator;
- var r = that._options.styles.normal.r;
- navigator = that.__debug_navigator || navigator;
- that.__debug_browserNavigator = navigator;
- var minTrackerSize = windowUtils.hasProperty("ontouchstart") || navigator.msPointerEnabled && navigator.msMaxTouchPoints || navigator.pointerEnabled && navigator.maxTouchPoints ? 20 : 6;
- that._options.trackerR = r < minTrackerSize ? minTrackerSize : r;
- return that._options.trackerR
- },
- _translateErrorBars: function() {
- var that = this;
- var options = that._options;
- var rotated = options.rotated;
- var errorBars = options.errorBars;
- var translator = that._getValTranslator();
- if (!errorBars) {
- return
- }
- _isDefined(that.lowError) && (that._lowErrorCoord = translator.translate(that.lowError));
- _isDefined(that.highError) && (that._highErrorCoord = translator.translate(that.highError));
- that._errorBarPos = _floor(rotated ? that.vy : that.vx);
- that._baseErrorBarPos = "stdDeviation" === errorBars.type ? that._lowErrorCoord + (that._highErrorCoord - that._lowErrorCoord) / 2 : rotated ? that.vx : that.vy
- },
- _translate: function() {
- var that = this;
- var valTranslator = that._getValTranslator();
- var argTranslator = that._getArgTranslator();
- if (that._options.rotated) {
- that.vx = that.x = valTranslator.translate(that.value);
- that.vy = that.y = argTranslator.translate(that.argument);
- that.minX = valTranslator.translate(that.minValue);
- that.defaultX = valTranslator.translate(CANVAS_POSITION_DEFAULT)
- } else {
- that.vy = that.y = valTranslator.translate(that.value);
- that.vx = that.x = argTranslator.translate(that.argument);
- that.minY = valTranslator.translate(that.minValue);
- that.defaultY = valTranslator.translate(CANVAS_POSITION_DEFAULT)
- }
- that._translateErrorBars();
- that._calculateVisibility(that.x, that.y)
- },
- _updateData: function(data) {
- var that = this;
- that.value = that.properValue = that.initialValue = that.originalValue = data.value;
- that.minValue = that.initialMinValue = that.originalMinValue = _isDefined(data.minValue) ? data.minValue : CANVAS_POSITION_DEFAULT
- },
- _getImageSettings: function(image) {
- return {
- href: image.url || image.toString(),
- width: image.width || DEFAULT_IMAGE_WIDTH,
- height: image.height || DEFAULT_IMAGE_HEIGHT
- }
- },
- getCrosshairData: function() {
- var that = this;
- var r = that._options.rotated;
- var value = that.properValue;
- var argument = that.argument;
- return {
- x: that.vx,
- y: that.vy,
- xValue: r ? value : argument,
- yValue: r ? argument : value,
- axis: that.series.axis
- }
- },
- getPointRadius: function() {
- var style = this._getStyle();
- var options = this._options;
- var r = style.r;
- var extraSpace;
- var symbol = options.symbol;
- var isSquare = "square" === symbol;
- var isTriangle = "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol;
- if (options.visible && !options.image && r) {
- extraSpace = style["stroke-width"] / 2;
- return (isSquare || isTriangle ? 1.4 * r : r) + extraSpace
- }
- return 0
- },
- _updateMarker: function(animationEnabled, style) {
- var that = this;
- var options = that._options;
- var settings;
- var image = options.image;
- var visibility = !that.isVisible() ? {
- visibility: "hidden"
- } : {};
- if (that._checkImage(image)) {
- settings = _extend({}, {
- visibility: style.visibility
- }, visibility, that._getImageSettings(image))
- } else {
- settings = _extend({}, style, visibility, {
- points: that._populatePointShape(options.symbol, style.r)
- })
- }
- if (!animationEnabled) {
- settings.translateX = that.x;
- settings.translateY = that.y
- }
- that.graphic.attr(settings).sharp()
- },
- _getLabelFormatObject: function() {
- var that = this;
- return {
- argument: that.initialArgument,
- value: that.initialValue,
- originalArgument: that.originalArgument,
- originalValue: that.originalValue,
- seriesName: that.series.name,
- lowErrorValue: that.lowError,
- highErrorValue: that.highError,
- point: that
- }
- },
- _getLabelPosition: function() {
- var rotated = this._options.rotated;
- if (this.initialValue > 0) {
- return rotated ? "right" : "top"
- } else {
- return rotated ? "left" : "bottom"
- }
- },
- _getFormatObject: function(tooltip) {
- var that = this;
- var labelFormatObject = that._label.getData();
- return _extend({}, labelFormatObject, {
- argumentText: tooltip.formatValue(that.initialArgument, "argument"),
- valueText: tooltip.formatValue(that.initialValue)
- }, _isDefined(labelFormatObject.percent) ? {
- percentText: tooltip.formatValue(labelFormatObject.percent, "percent")
- } : {}, _isDefined(labelFormatObject.total) ? {
- totalText: tooltip.formatValue(labelFormatObject.total)
- } : {})
- },
- getMarkerVisibility: function() {
- return this._options.visible
- },
- coordsIn: function(x, y) {
- var trackerRadius = this._storeTrackerR();
- return x >= this.x - trackerRadius && x <= this.x + trackerRadius && y >= this.y - trackerRadius && y <= this.y + trackerRadius
- },
- getMinValue: function(noErrorBar) {
- var errorBarOptions = this._options.errorBars;
- if (errorBarOptions && !noErrorBar) {
- var displayMode = errorBarOptions.displayMode;
- var lowValue = "high" !== displayMode && _isDefined(this.lowError) ? this.lowError : this.value;
- var highValue = "low" !== displayMode && _isDefined(this.highError) ? this.highError : this.value;
- return lowValue < highValue ? lowValue : highValue
- } else {
- return this.value
- }
- },
- getMaxValue: function(noErrorBar) {
- var errorBarOptions = this._options.errorBars;
- if (errorBarOptions && !noErrorBar) {
- var displayMode = errorBarOptions.displayMode;
- var lowValue = "high" !== displayMode && _isDefined(this.lowError) ? this.lowError : this.value;
- var highValue = "low" !== displayMode && _isDefined(this.highError) ? this.highError : this.value;
- return lowValue > highValue ? lowValue : highValue
- } else {
- return this.value
- }
- }
- }
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/loading_indicator.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _patchFontOptions = __webpack_require__( /*! ./utils */ 10).patchFontOptions;
- var STATE_HIDDEN = 0;
- var STATE_SHOWN = 1;
- var ANIMATION_EASING = "linear";
- var ANIMATION_DURATION = 400;
- var LOADING_INDICATOR_READY = "loadingIndicatorReady";
- function LoadingIndicator(parameters) {
- var that = this;
- var renderer = parameters.renderer;
- that._group = renderer.g().attr({
- "class": "dx-loading-indicator"
- }).linkOn(renderer.root, {
- name: "loading-indicator",
- after: "peripheral"
- });
- that._rect = renderer.rect().attr({
- opacity: 0
- }).append(that._group);
- that._text = renderer.text().attr({
- align: "center"
- }).append(that._group);
- that._createStates(parameters.eventTrigger, that._group, renderer.root, parameters.notify)
- }
- LoadingIndicator.prototype = {
- constructor: LoadingIndicator,
- _createStates: function(eventTrigger, group, root, notify) {
- var that = this;
- that._states = [{
- opacity: 0,
- start: function() {
- notify(false)
- },
- complete: function() {
- group.linkRemove();
- root.css({
- "pointer-events": ""
- });
- eventTrigger(LOADING_INDICATOR_READY)
- }
- }, {
- opacity: .85,
- start: function() {
- group.linkAppend();
- root.css({
- "pointer-events": "none"
- });
- notify(true)
- },
- complete: function() {
- eventTrigger(LOADING_INDICATOR_READY)
- }
- }];
- that._state = STATE_HIDDEN
- },
- setSize: function(size) {
- var width = size.width;
- var height = size.height;
- this._rect.attr({
- width: width,
- height: height
- });
- this._text.attr({
- x: width / 2,
- y: height / 2
- })
- },
- setOptions: function(options) {
- this._rect.attr({
- fill: options.backgroundColor
- });
- this._text.css(_patchFontOptions(options.font)).attr({
- text: options.text,
- "class": options.cssClass
- });
- this[options.show ? "show" : "hide"]()
- },
- dispose: function() {
- var that = this;
- that._group.linkRemove().linkOff();
- that._group = that._rect = that._text = that._states = null
- },
- _transit: function(stateId) {
- var that = this;
- var state;
- if (that._state !== stateId) {
- that._state = stateId;
- that._isHiding = false;
- state = that._states[stateId];
- that._rect.stopAnimation().animate({
- opacity: state.opacity
- }, {
- complete: state.complete,
- easing: ANIMATION_EASING,
- duration: ANIMATION_DURATION,
- unstoppable: true
- });
- that._noHiding = true;
- state.start();
- that._noHiding = false
- }
- },
- show: function() {
- this._transit(STATE_SHOWN)
- },
- hide: function() {
- this._transit(STATE_HIDDEN)
- },
- scheduleHiding: function() {
- if (!this._noHiding) {
- this._isHiding = true
- }
- },
- fulfillHiding: function() {
- if (this._isHiding) {
- this.hide()
- }
- }
- };
- exports.LoadingIndicator = LoadingIndicator;
- exports.plugin = {
- name: "loading_indicator",
- init: function() {
- var that = this;
- that._loadingIndicator = new exports.LoadingIndicator({
- eventTrigger: that._eventTrigger,
- renderer: that._renderer,
- notify: notify
- });
- that._scheduleLoadingIndicatorHiding();
- function notify(state) {
- that._skipLoadingIndicatorOptions = true;
- that.option("loadingIndicator", {
- show: state
- });
- that._skipLoadingIndicatorOptions = false;
- if (state) {
- that._stopCurrentHandling()
- }
- }
- },
- dispose: function() {
- this._loadingIndicator.dispose();
- this._loadingIndicator = null
- },
- members: {
- _scheduleLoadingIndicatorHiding: function() {
- this._loadingIndicator.scheduleHiding()
- },
- _fulfillLoadingIndicatorHiding: function() {
- this._loadingIndicator.fulfillHiding()
- },
- showLoadingIndicator: function() {
- this._loadingIndicator.show()
- },
- hideLoadingIndicator: function() {
- this._loadingIndicator.hide()
- },
- _onBeginUpdate: function() {
- if (!this._optionChangedLocker) {
- this._scheduleLoadingIndicatorHiding()
- }
- }
- },
- extenders: {
- _dataSourceLoadingChangedHandler: function(isLoading) {
- if (isLoading && (this._options.loadingIndicator || {}).enabled) {
- this._loadingIndicator.show()
- }
- },
- _setContentSize: function() {
- this._loadingIndicator.setSize(this._canvas)
- },
- endUpdate: function() {
- if (this._initialized && this._dataIsReady()) {
- this._fulfillLoadingIndicatorHiding()
- }
- }
- },
- customize: function(constructor) {
- var proto = constructor.prototype;
- if (proto._dataSourceChangedHandler) {
- var _dataSourceChangedHandler = proto._dataSourceChangedHandler;
- proto._dataSourceChangedHandler = function() {
- this._scheduleLoadingIndicatorHiding();
- _dataSourceChangedHandler.apply(this, arguments)
- }
- }
- constructor.addChange({
- code: "LOADING_INDICATOR",
- handler: function() {
- if (!this._skipLoadingIndicatorOptions) {
- this._loadingIndicator.setOptions(this._getOption("loadingIndicator"))
- }
- this._scheduleLoadingIndicatorHiding()
- },
- isThemeDependent: true,
- option: "loadingIndicator",
- isOptionChange: true
- });
- proto._eventsMap.onLoadingIndicatorReady = {
- name: "loadingIndicatorReady"
- };
- var _drawn = proto._drawn;
- proto._drawn = function() {
- _drawn.apply(this, arguments);
- if (this._dataIsReady()) {
- this._fulfillLoadingIndicatorHiding()
- }
- }
- },
- fontFields: ["loadingIndicator.font"]
- }
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tiling.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var _round = Math.round;
- var algorithms = {};
- var defaultAlgorithm;
- exports.getAlgorithm = function(value) {
- return algorithms[_normalizeEnum(value)] || _isFunction(value) && value || defaultAlgorithm
- };
- exports.addAlgorithm = function(name, callback) {
- algorithms[name] = callback
- };
- exports.setDefaultAlgorithm = function(name) {
- defaultAlgorithm = algorithms[name]
- };
- var directionToIndexOffsets = {};
- directionToIndexOffsets[-1] = [2, 0];
- directionToIndexOffsets[1] = [0, 2];
- var getStaticSideIndex = function(rect) {
- return rect[2] - rect[0] < rect[3] - rect[1] ? 0 : 1
- };
- exports.getStaticSideIndex = getStaticSideIndex;
- exports.buildSidesData = function(rect, directions, _staticSideIndex) {
- var staticSideIndex = void 0 !== _staticSideIndex ? _staticSideIndex : getStaticSideIndex(rect);
- var variedSideIndex = 1 - staticSideIndex;
- var staticSideDirection = directions[staticSideIndex];
- var variedSideDirection = directions[variedSideIndex];
- var staticSideIndexOffsets = directionToIndexOffsets[staticSideDirection];
- var variedSideIndexOffsets = directionToIndexOffsets[variedSideDirection];
- return {
- staticSide: rect[2 + staticSideIndex] - rect[staticSideIndex],
- variedSide: rect[2 + variedSideIndex] - rect[variedSideIndex],
- static1: staticSideIndex + staticSideIndexOffsets[0],
- static2: staticSideIndex + staticSideIndexOffsets[1],
- varied1: variedSideIndex + variedSideIndexOffsets[0],
- varied2: variedSideIndex + variedSideIndexOffsets[1],
- staticDir: staticSideDirection,
- variedDir: variedSideDirection
- }
- };
- exports.calculateRectangles = function(nodes, head, totalRect, sidesData, rowData) {
- var i;
- var ii;
- var variedSidePart = [0, 0, 0, 0];
- var static1 = sidesData.static1;
- var static2 = sidesData.static2;
- var position = totalRect[static1];
- var dir = sidesData.staticDir;
- var side = sidesData.staticSide;
- var sum = rowData.sum;
- var rect;
- var delta;
- variedSidePart[sidesData.varied1] = totalRect[sidesData.varied1];
- variedSidePart[sidesData.varied2] = totalRect[sidesData.varied1] + sidesData.variedDir * rowData.side;
- for (i = head, ii = head + rowData.count; i < ii; ++i) {
- rect = variedSidePart.slice();
- rect[static1] = position;
- delta = _round(side * nodes[i].value / sum) || 0;
- sum -= nodes[i].value;
- side -= delta;
- position += dir * delta;
- rect[static2] = position;
- nodes[i].rect = rect
- }
- totalRect[sidesData.varied1] = variedSidePart[sidesData.varied2]
- }
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/colorizing.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var colorizers = {};
- var defaultColorizerName;
- function wrapLeafColorGetter(getter) {
- return function(node) {
- return !node.isNode() ? getter(node) : void 0
- }
- }
- function wrapGroupColorGetter(getter) {
- return function(node) {
- var parent = !node.isNode() && node.parent;
- return parent ? parent._groupColor = parent._groupColor || getter(parent) : void 0
- }
- }
- exports.getColorizer = function(options, themeManager, root) {
- var type = _normalizeEnum(options.type || defaultColorizerName);
- var colorizer = colorizers[type] && colorizers[type](options, themeManager, root);
- return colorizer ? (options.colorizeGroups ? wrapGroupColorGetter : wrapLeafColorGetter)(colorizer) : _noop
- };
- exports.addColorizer = function(name, colorizer) {
- colorizers[name] = colorizer
- };
- exports.setDefaultColorizer = function(name) {
- defaultColorizerName = name
- };
- function getValueAsColorCode(node) {
- return node.value
- }
- function createColorCodeGetter(colorCodeField) {
- return function(node) {
- return Number(node.data[colorCodeField])
- }
- }
- exports.createColorCodeGetter = function(options) {
- return options.colorCodeField ? createColorCodeGetter(options.colorCodeField) : getValueAsColorCode
- }
- },
- /*!*************************************************************************!*\
- !*** ./artifacts/transpiled/events/core/event_registrator_callbacks.js ***!
- \*************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var MemorizedCallbacks = __webpack_require__( /*! ../../core/memorized_callbacks */ 177);
- module.exports = new MemorizedCallbacks
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/events/core/emitter.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var eventUtils = __webpack_require__( /*! ../utils */ 8);
- var Emitter = Class.inherit({
- ctor: function(element) {
- this._$element = $(element);
- this._cancelCallback = Callbacks();
- this._acceptCallback = Callbacks()
- },
- getElement: function() {
- return this._$element
- },
- validate: function(e) {
- return !eventUtils.isDxMouseWheelEvent(e)
- },
- validatePointers: function(e) {
- return 1 === eventUtils.hasTouches(e)
- },
- allowInterruptionByMouseWheel: function() {
- return true
- },
- configure: function(data) {
- extend(this, data)
- },
- addCancelCallback: function(callback) {
- this._cancelCallback.add(callback)
- },
- removeCancelCallback: function() {
- this._cancelCallback.empty()
- },
- _cancel: function(e) {
- this._cancelCallback.fire(this, e)
- },
- addAcceptCallback: function(callback) {
- this._acceptCallback.add(callback)
- },
- removeAcceptCallback: function() {
- this._acceptCallback.empty()
- },
- _accept: function(e) {
- this._acceptCallback.fire(this, e)
- },
- _requestAccept: function(e) {
- this._acceptRequestEvent = e
- },
- _forgetAccept: function() {
- this._accept(this._acceptRequestEvent);
- this._acceptRequestEvent = null
- },
- start: noop,
- move: noop,
- end: noop,
- cancel: noop,
- reset: function() {
- if (this._acceptRequestEvent) {
- this._accept(this._acceptRequestEvent)
- }
- },
- _fireEvent: function(eventName, e, params) {
- var eventData = extend({
- type: eventName,
- originalEvent: e,
- target: this._getEmitterTarget(e),
- delegateTarget: this.getElement().get(0)
- }, params);
- e = eventUtils.fireEvent(eventData);
- if (e.cancel) {
- this._cancel(e)
- }
- return e
- },
- _getEmitterTarget: function(e) {
- return (this.delegateSelector ? $(e.target).closest(this.delegateSelector) : this.getElement()).get(0)
- },
- dispose: noop
- });
- module.exports = Emitter
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/events/core/wheel.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
- var registerEvent = __webpack_require__( /*! ./event_registrator */ 71);
- var eventUtils = __webpack_require__( /*! ../utils */ 8);
- var EVENT_NAME = "dxmousewheel";
- var EVENT_NAMESPACE = "dxWheel";
- var getWheelEventName = callOnce(function() {
- return domAdapter.hasDocumentProperty("onwheel") ? "wheel" : "mousewheel"
- });
- var wheel = {
- setup: function(element) {
- var $element = $(element);
- eventsEngine.on($element, eventUtils.addNamespace(getWheelEventName(), EVENT_NAMESPACE), wheel._wheelHandler.bind(wheel))
- },
- teardown: function(element) {
- eventsEngine.off(element, "." + EVENT_NAMESPACE)
- },
- _wheelHandler: function(e) {
- var delta = this._getWheelDelta(e.originalEvent);
- eventUtils.fireEvent({
- type: EVENT_NAME,
- originalEvent: e,
- delta: delta,
- pointerType: "mouse"
- });
- e.stopPropagation()
- },
- _getWheelDelta: function(event) {
- return event.wheelDelta ? event.wheelDelta : 30 * -event.deltaY
- }
- };
- registerEvent(EVENT_NAME, wheel);
- exports.name = EVENT_NAME
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/events/core/emitter.feedback.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var contains = __webpack_require__( /*! ../../core/utils/dom */ 12).contains;
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var eventUtils = __webpack_require__( /*! ../utils */ 8);
- var pointerEvents = __webpack_require__( /*! ../pointer */ 23);
- var Emitter = __webpack_require__( /*! ./emitter */ 123);
- var registerEmitter = __webpack_require__( /*! ./emitter_registrator */ 95);
- var ACTIVE_EVENT_NAME = "dxactive";
- var INACTIVE_EVENT_NAME = "dxinactive";
- var ACTIVE_TIMEOUT = 30;
- var INACTIVE_TIMEOUT = 400;
- var FeedbackEvent = Class.inherit({
- ctor: function(timeout, fire) {
- this._timeout = timeout;
- this._fire = fire
- },
- start: function() {
- var that = this;
- this._schedule(function() {
- that.force()
- })
- },
- _schedule: function(fn) {
- this.stop();
- this._timer = setTimeout(fn, this._timeout)
- },
- stop: function() {
- clearTimeout(this._timer)
- },
- force: function() {
- if (this._fired) {
- return
- }
- this.stop();
- this._fire();
- this._fired = true
- },
- fired: function() {
- return this._fired
- }
- });
- var activeFeedback;
- var FeedbackEmitter = Emitter.inherit({
- ctor: function() {
- this.callBase.apply(this, arguments);
- this._active = new FeedbackEvent(0, commonUtils.noop);
- this._inactive = new FeedbackEvent(0, commonUtils.noop)
- },
- configure: function(data, eventName) {
- switch (eventName) {
- case ACTIVE_EVENT_NAME:
- data.activeTimeout = data.timeout;
- break;
- case INACTIVE_EVENT_NAME:
- data.inactiveTimeout = data.timeout
- }
- this.callBase(data)
- },
- start: function(e) {
- if (activeFeedback) {
- var activeChildExists = contains(this.getElement().get(0), activeFeedback.getElement().get(0));
- var childJustActivated = !activeFeedback._active.fired();
- if (activeChildExists && childJustActivated) {
- this._cancel();
- return
- }
- activeFeedback._inactive.force()
- }
- activeFeedback = this;
- this._initEvents(e);
- this._active.start()
- },
- _initEvents: function(e) {
- var that = this;
- var eventTarget = this._getEmitterTarget(e);
- var mouseEvent = eventUtils.isMouseEvent(e);
- var isSimulator = devices.isSimulator();
- var deferFeedback = isSimulator || !mouseEvent;
- var activeTimeout = commonUtils.ensureDefined(this.activeTimeout, ACTIVE_TIMEOUT);
- var inactiveTimeout = commonUtils.ensureDefined(this.inactiveTimeout, INACTIVE_TIMEOUT);
- this._active = new FeedbackEvent(deferFeedback ? activeTimeout : 0, function() {
- that._fireEvent(ACTIVE_EVENT_NAME, e, {
- target: eventTarget
- })
- });
- this._inactive = new FeedbackEvent(deferFeedback ? inactiveTimeout : 0, function() {
- that._fireEvent(INACTIVE_EVENT_NAME, e, {
- target: eventTarget
- });
- activeFeedback = null
- })
- },
- cancel: function(e) {
- this.end(e)
- },
- end: function(e) {
- var skipTimers = e.type !== pointerEvents.up;
- if (skipTimers) {
- this._active.stop()
- } else {
- this._active.force()
- }
- this._inactive.start();
- if (skipTimers) {
- this._inactive.force()
- }
- },
- dispose: function() {
- this._active.stop();
- this._inactive.stop();
- this.callBase()
- },
- lockInactive: function() {
- this._active.force();
- this._inactive.stop();
- activeFeedback = null;
- this._cancel();
- return this._inactive.force.bind(this._inactive)
- }
- });
- FeedbackEmitter.lock = function(deferred) {
- var lockInactive = activeFeedback ? activeFeedback.lockInactive() : commonUtils.noop;
- deferred.done(lockInactive)
- };
- registerEmitter({
- emitter: FeedbackEmitter,
- events: [ACTIVE_EVENT_NAME, INACTIVE_EVENT_NAME]
- });
- exports.lock = FeedbackEmitter.lock;
- exports.active = ACTIVE_EVENT_NAME;
- exports.inactive = INACTIVE_EVENT_NAME
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/ui/collection/item.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 131);
- var INVISIBLE_STATE_CLASS = "dx-state-invisible";
- var DISABLED_STATE_CLASS = "dx-state-disabled";
- var ITEM_CONTENT_PLACEHOLDER_CLASS = "dx-item-content-placeholder";
- var forcibleWatcher = function(watchMethod, fn, callback) {
- var filteredCallback = function() {
- var oldValue;
- return function(value) {
- if (oldValue !== value) {
- callback(value, oldValue);
- oldValue = value
- }
- }
- }();
- return {
- dispose: watchMethod(fn, filteredCallback),
- force: function() {
- filteredCallback(fn())
- }
- }
- };
- var CollectionItem = Class.inherit({
- ctor: function($element, options, rawData) {
- this._$element = $element;
- this._options = options;
- this._rawData = rawData;
- publicComponentUtils.attachInstanceToElement($element, this, this._dispose);
- this._render()
- },
- _render: function() {
- var $placeholder = $("<div>").addClass(ITEM_CONTENT_PLACEHOLDER_CLASS);
- this._$element.append($placeholder);
- this._watchers = [];
- this._renderWatchers()
- },
- _renderWatchers: function() {
- this._startWatcher("disabled", this._renderDisabled.bind(this));
- this._startWatcher("visible", this._renderVisible.bind(this))
- },
- _startWatcher: function(field, render) {
- var rawData = this._rawData;
- var exprGetter = this._options.fieldGetter(field);
- var watcher = forcibleWatcher(this._options.watchMethod(), function() {
- return exprGetter(rawData)
- }, function(value, oldValue) {
- this._dirty = true;
- render(value, oldValue)
- }.bind(this));
- this._watchers.push(watcher)
- },
- setDataField: function() {
- this._dirty = false;
- each(this._watchers, function(_, watcher) {
- watcher.force()
- });
- if (this._dirty) {
- return true
- }
- },
- _renderDisabled: function(value, oldValue) {
- this._$element.toggleClass(DISABLED_STATE_CLASS, !!value);
- this._updateOwnerFocus(value)
- },
- _updateOwnerFocus: function(isDisabled) {
- var ownerComponent = this._options.owner;
- if (ownerComponent && isDisabled) {
- ownerComponent._resetItemFocus(this._$element)
- }
- },
- _renderVisible: function(value, oldValue) {
- this._$element.toggleClass(INVISIBLE_STATE_CLASS, void 0 !== value && !value)
- },
- _dispose: function() {
- each(this._watchers, function(_, watcher) {
- watcher.dispose()
- })
- }
- });
- CollectionItem.getInstance = function($element) {
- return publicComponentUtils.getInstanceByElement($element, this)
- };
- module.exports = CollectionItem
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/localization/globalize/core.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Globalize = __webpack_require__( /*! globalize */ 72);
- var coreLocalization = __webpack_require__( /*! ../core */ 87);
- if (Globalize && Globalize.load) {
- var likelySubtags = {
- supplemental: {
- version: {
- _cldrVersion: "28",
- _unicodeVersion: "8.0.0",
- _number: "$Revision: 11965 $"
- },
- likelySubtags: {
- en: "en-Latn-US",
- de: "de-Latn-DE",
- ru: "ru-Cyrl-RU",
- ja: "ja-Jpan-JP"
- }
- }
- };
- if (!Globalize.locale()) {
- Globalize.load(likelySubtags);
- Globalize.locale("en")
- }
- coreLocalization.inject({
- locale: function(_locale) {
- if (!_locale) {
- return Globalize.locale().locale
- }
- Globalize.locale(_locale)
- }
- })
- }
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/events/double_click.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
- var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var Class = __webpack_require__( /*! ../core/class */ 15);
- var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
- var clickEvent = __webpack_require__( /*! ./click */ 19);
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var DBLCLICK_EVENT_NAME = "dxdblclick";
- var DBLCLICK_NAMESPACE = "dxDblClick";
- var NAMESPACED_CLICK_EVENT = eventUtils.addNamespace(clickEvent.name, DBLCLICK_NAMESPACE);
- var DBLCLICK_TIMEOUT = 300;
- var DblClick = Class.inherit({
- ctor: function() {
- this._handlerCount = 0;
- this._forgetLastClick()
- },
- _forgetLastClick: function() {
- this._firstClickTarget = null;
- this._lastClickTimeStamp = -DBLCLICK_TIMEOUT
- },
- add: function() {
- if (this._handlerCount <= 0) {
- eventsEngine.on(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT, this._clickHandler.bind(this))
- }
- this._handlerCount++
- },
- _clickHandler: function(e) {
- var timeStamp = e.timeStamp || Date.now();
- if (timeStamp - this._lastClickTimeStamp < DBLCLICK_TIMEOUT) {
- eventUtils.fireEvent({
- type: DBLCLICK_EVENT_NAME,
- target: domUtils.closestCommonParent(this._firstClickTarget, e.target),
- originalEvent: e
- });
- this._forgetLastClick()
- } else {
- this._firstClickTarget = e.target;
- this._lastClickTimeStamp = timeStamp
- }
- },
- remove: function() {
- this._handlerCount--;
- if (this._handlerCount <= 0) {
- this._forgetLastClick();
- eventsEngine.off(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT)
- }
- }
- });
- registerEvent(DBLCLICK_EVENT_NAME, new DblClick);
- exports.name = DBLCLICK_EVENT_NAME
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/core/utils/error.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ./extend */ 0).extend;
- var consoleUtils = __webpack_require__( /*! ./console */ 73);
- var stringUtils = __webpack_require__( /*! ./string */ 44);
- var version = __webpack_require__( /*! ../version */ 157);
- var ERROR_URL = "http://js.devexpress.com/error/" + version.split(".").slice(0, 2).join("_") + "/";
- module.exports = function(baseErrors, errors) {
- var exports = {
- ERROR_MESSAGES: extend(errors, baseErrors),
- Error: function() {
- return makeError([].slice.call(arguments))
- },
- log: function(id) {
- var method = "log";
- if (/^E\d+$/.test(id)) {
- method = "error"
- } else {
- if (/^W\d+$/.test(id)) {
- method = "warn"
- }
- }
- consoleUtils.logger[method]("log" === method ? id : combineMessage([].slice.call(arguments)))
- }
- };
- var combineMessage = function(args) {
- var id = args[0];
- args = args.slice(1);
- return formatMessage(id, formatDetails(id, args))
- };
- var formatDetails = function(id, args) {
- args = [exports.ERROR_MESSAGES[id]].concat(args);
- return stringUtils.format.apply(this, args).replace(/\.*\s*?$/, "")
- };
- var formatMessage = function(id, details) {
- return stringUtils.format.apply(this, ["{0} - {1}. See:\n{2}", id, details, getErrorUrl(id)])
- };
- var makeError = function(args) {
- var id = args[0];
- args = args.slice(1);
- var details = formatDetails(id, args);
- var url = getErrorUrl(id);
- var message = formatMessage(id, details);
- return extend(new Error(message), {
- __id: id,
- __details: details,
- url: url
- })
- };
- var getErrorUrl = function(id) {
- return ERROR_URL + id
- };
- return exports
- }
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/core/utils/resize_callbacks.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var windowUtils = __webpack_require__( /*! ./window */ 7);
- var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
- var Callbacks = __webpack_require__( /*! ./callbacks */ 26);
- var readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 48);
- var callOnce = __webpack_require__( /*! ./call_once */ 63);
- var resizeCallbacks = function() {
- var prevSize;
- var callbacks = Callbacks();
- var originalCallbacksAdd = callbacks.add;
- var originalCallbacksRemove = callbacks.remove;
- if (!windowUtils.hasWindow()) {
- return callbacks
- }
- var formatSize = function() {
- var window = windowUtils.getWindow();
- return {
- width: window.innerWidth,
- height: window.innerHeight
- }
- };
- var handleResize = function() {
- var now = formatSize();
- if (now.width === prevSize.width && now.height === prevSize.height) {
- return
- }
- var changedDimension;
- if (now.width === prevSize.width) {
- changedDimension = "height"
- }
- if (now.height === prevSize.height) {
- changedDimension = "width"
- }
- prevSize = now;
- callbacks.fire(changedDimension)
- };
- var setPrevSize = callOnce(function() {
- prevSize = formatSize()
- });
- var removeListener;
- callbacks.add = function() {
- var result = originalCallbacksAdd.apply(callbacks, arguments);
- setPrevSize();
- readyCallbacks.add(function() {
- if (!removeListener && callbacks.has()) {
- removeListener = domAdapter.listen(windowUtils.getWindow(), "resize", handleResize)
- }
- });
- return result
- };
- callbacks.remove = function() {
- var result = originalCallbacksRemove.apply(callbacks, arguments);
- if (!callbacks.has() && removeListener) {
- removeListener();
- removeListener = void 0
- }
- return result
- };
- return callbacks
- }();
- module.exports = resizeCallbacks
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/core/utils/public_component.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var WeakMap = __webpack_require__( /*! ../polyfills/weak_map */ 176);
- var isDefined = __webpack_require__( /*! ./type */ 1).isDefined;
- var removeEvent = __webpack_require__( /*! ../remove_event */ 132);
- var COMPONENT_NAMES_DATA_KEY = "dxComponents";
- var ANONYMOUS_COMPONENT_DATA_KEY = "dxPrivateComponent";
- var componentNames = new WeakMap;
- var nextAnonymousComponent = 0;
- var getName = exports.name = function(componentClass, newName) {
- if (isDefined(newName)) {
- componentNames.set(componentClass, newName);
- return
- }
- if (!componentNames.has(componentClass)) {
- var generatedName = ANONYMOUS_COMPONENT_DATA_KEY + nextAnonymousComponent++;
- componentNames.set(componentClass, generatedName);
- return generatedName
- }
- return componentNames.get(componentClass)
- };
- exports.attachInstanceToElement = function($element, componentInstance, disposeFn) {
- var data = dataUtils.data($element.get(0));
- var name = getName(componentInstance.constructor);
- data[name] = componentInstance;
- if (disposeFn) {
- eventsEngine.one($element, removeEvent, function() {
- disposeFn.call(componentInstance)
- })
- }
- if (!data[COMPONENT_NAMES_DATA_KEY]) {
- data[COMPONENT_NAMES_DATA_KEY] = []
- }
- data[COMPONENT_NAMES_DATA_KEY].push(name)
- };
- exports.getInstanceByElement = function($element, componentClass) {
- var name = getName(componentClass);
- return dataUtils.data($element.get(0), name)
- }
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/remove_event.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ./renderer */ 2);
- var beforeCleanData = __webpack_require__( /*! ./element_data */ 39).beforeCleanData;
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var registerEvent = __webpack_require__( /*! ../events/core/event_registrator */ 71);
- var eventName = "dxremove";
- var eventPropName = "dxRemoveEvent";
- beforeCleanData(function(elements) {
- elements = [].slice.call(elements);
- for (var i = 0; i < elements.length; i++) {
- var $element = $(elements[i]);
- if ($element.prop(eventPropName)) {
- $element[0][eventPropName] = null;
- eventsEngine.triggerHandler($element, eventName)
- }
- }
- });
- registerEvent(eventName, {
- noBubble: true,
- setup: function(element) {
- $(element).prop(eventPropName, true)
- }
- });
- module.exports = eventName
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/core/component.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
- }
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return
- }
- if ("string" === typeof o) {
- return _arrayLikeToArray(o, minLen)
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if ("Object" === n && o.constructor) {
- n = o.constructor.name
- }
- if ("Map" === n || "Set" === n) {
- return Array.from(o)
- }
- if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen)
- }
- }
- function _iterableToArray(iter) {
- if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
- return Array.from(iter)
- }
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- return _arrayLikeToArray(arr)
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (null == len || len > arr.length) {
- len = arr.length
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function")
- }
- }
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) {
- descriptor.writable = true
- }
- Object.defineProperty(target, descriptor.key, descriptor)
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) {
- _defineProperties(Constructor.prototype, protoProps)
- }
- if (staticProps) {
- _defineProperties(Constructor, staticProps)
- }
- Object.defineProperty(Constructor, "prototype", {
- writable: false
- });
- return Constructor
- }
- var Config = __webpack_require__( /*! ./config */ 31);
- var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11);
- var extend = __webpack_require__( /*! ./utils/extend */ 0).extend;
- var Class = __webpack_require__( /*! ./class */ 15);
- var Action = __webpack_require__( /*! ./action */ 111);
- var errors = __webpack_require__( /*! ./errors */ 21);
- var coreDataUtils = __webpack_require__( /*! ./utils/data */ 20);
- var commonUtils = __webpack_require__( /*! ./utils/common */ 4);
- var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
- var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
- var Deferred = deferredUtils.Deferred;
- var when = deferredUtils.when;
- var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
- var EventsMixin = __webpack_require__( /*! ./events_mixin */ 82);
- var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 131);
- var devices = __webpack_require__( /*! ./devices */ 16);
- var isFunction = typeUtils.isFunction;
- var noop = commonUtils.noop;
- var cachedGetters = {};
- var cachedSetters = {};
- var PostponedOperations = function() {
- function PostponedOperations() {
- _classCallCheck(this, PostponedOperations);
- this._postponedOperations = {}
- }
- _createClass(PostponedOperations, [{
- key: "add",
- value: function(key, fn, postponedPromise) {
- if (key in this._postponedOperations) {
- postponedPromise && this._postponedOperations[key].promises.push(postponedPromise)
- } else {
- var completePromise = new Deferred;
- this._postponedOperations[key] = {
- fn: fn,
- completePromise: completePromise,
- promises: postponedPromise ? [postponedPromise] : []
- }
- }
- return this._postponedOperations[key].completePromise.promise()
- }
- }, {
- key: "callPostponedOperations",
- value: function() {
- for (var key in this._postponedOperations) {
- var operation = this._postponedOperations[key];
- if (typeUtils.isDefined(operation)) {
- if (operation.promises && operation.promises.length) {
- when.apply(void 0, _toConsumableArray(operation.promises)).done(operation.fn).then(operation.completePromise.resolve)
- } else {
- operation.fn().done(operation.completePromise.resolve)
- }
- }
- }
- this._postponedOperations = {}
- }
- }]);
- return PostponedOperations
- }();
- var Component = Class.inherit({
- _setDeprecatedOptions: function() {
- this._deprecatedOptions = {}
- },
- _getDeprecatedOptions: function() {
- return this._deprecatedOptions
- },
- _getOptionAliasesByName: function(optionName) {
- var _this = this;
- return Object.keys(this._deprecatedOptions).filter(function(aliasName) {
- return optionName === _this._deprecatedOptions[aliasName].alias
- })
- },
- _getDefaultOptions: function() {
- return {
- onInitialized: null,
- onOptionChanged: null,
- onDisposing: null,
- defaultOptionsRules: null
- }
- },
- _setDefaultOptions: function() {
- this._options = this._getDefaultOptions()
- },
- _defaultOptionsRules: function() {
- return []
- },
- _setOptionsByDevice: function(customRules) {
- var rules = this._defaultOptionsRules();
- if (Array.isArray(customRules)) {
- rules = rules.concat(customRules)
- }
- var rulesOptions = this._convertRulesToOptions(rules);
- extend(true, this._options, rulesOptions);
- for (var fieldName in this._optionsByReference) {
- if (Object.prototype.hasOwnProperty.call(rulesOptions, fieldName)) {
- this._options[fieldName] = rulesOptions[fieldName]
- }
- }
- },
- _convertRulesToOptions: function(rules) {
- var options = {};
- var currentDevice = devices.current();
- var deviceMatch = function(device, filter) {
- var filterArray = [];
- Array.prototype.push.call(filterArray, filter);
- return 1 === filterArray.length && typeUtils.isEmptyObject(filterArray[0]) || commonUtils.findBestMatches(device, filterArray).length > 0
- };
- for (var i = 0; i < rules.length; i++) {
- var rule = rules[i];
- var deviceFilter = rule.device || {};
- var match;
- if (isFunction(deviceFilter)) {
- match = deviceFilter(currentDevice)
- } else {
- match = deviceMatch(currentDevice, deviceFilter)
- }
- if (match) {
- extend(options, rule.options)
- }
- }
- return options
- },
- _isInitialOptionValue: function(name) {
- var optionValue = this.option(name);
- var initialOptionValue = this.initialOption(name);
- var isInitialOption = isFunction(optionValue) && isFunction(initialOptionValue) ? optionValue.toString() === initialOptionValue.toString() : commonUtils.equalByValue(optionValue, initialOptionValue);
- return isInitialOption
- },
- _setOptionsByReference: function() {
- this._optionsByReference = {}
- },
- _getOptionsByReference: function() {
- return this._optionsByReference
- },
- ctor: function(options) {
- this.NAME = publicComponentUtils.name(this.constructor);
- options = options || {};
- if (options.eventsStrategy) {
- this.setEventsStrategy(options.eventsStrategy)
- }
- this._options = {};
- this._updateLockCount = 0;
- this._optionChangedCallbacks = options._optionChangedCallbacks || Callbacks();
- this._disposingCallbacks = options._disposingCallbacks || Callbacks();
- this.postponedOperations = new PostponedOperations;
- this.beginUpdate();
- try {
- this._suppressDeprecatedWarnings();
- this._setOptionsByReference();
- this._setDeprecatedOptions();
- this._setDefaultOptions();
- if (options && options.onInitializing) {
- options.onInitializing.apply(this, [options])
- }
- this._setOptionsByDevice(options.defaultOptionsRules);
- this._resumeDeprecatedWarnings();
- this._initOptions(options)
- } finally {
- this.endUpdate()
- }
- },
- _initOptions: function(options) {
- this.option(options)
- },
- _optionValuesEqual: function(name, oldValue, newValue) {
- oldValue = coreDataUtils.toComparable(oldValue, true);
- newValue = coreDataUtils.toComparable(newValue, true);
- if (oldValue && newValue && typeUtils.isRenderer(oldValue) && typeUtils.isRenderer(newValue)) {
- return newValue.is(oldValue)
- }
- var oldValueIsNaN = oldValue !== oldValue;
- var newValueIsNaN = newValue !== newValue;
- if (oldValueIsNaN && newValueIsNaN) {
- return true
- }
- if (null === oldValue || "object" !== _typeof(oldValue) || domAdapter.isElementNode(oldValue)) {
- return oldValue === newValue
- }
- return false
- },
- _init: function() {
- this._createOptionChangedAction();
- this.on("disposing", function(args) {
- this._disposingCallbacks.fireWith(this, [args])
- }.bind(this))
- },
- _createOptionChangedAction: function() {
- this._optionChangedAction = this._createActionByOption("onOptionChanged", {
- excludeValidators: ["disabled", "readOnly"]
- })
- },
- _createDisposingAction: function() {
- this._disposingAction = this._createActionByOption("onDisposing", {
- excludeValidators: ["disabled", "readOnly"]
- })
- },
- _optionChanged: function(args) {
- switch (args.name) {
- case "onDisposing":
- case "onInitialized":
- break;
- case "onOptionChanged":
- this._createOptionChangedAction();
- break;
- case "defaultOptionsRules":
- }
- },
- _dispose: function() {
- this._optionChangedCallbacks.empty();
- this._createDisposingAction();
- this._disposingAction();
- this._disposeEvents();
- this._disposed = true
- },
- instance: function() {
- return this
- },
- beginUpdate: function() {
- this._updateLockCount++
- },
- endUpdate: function() {
- this._updateLockCount = Math.max(this._updateLockCount - 1, 0);
- if (!this._updateLockCount) {
- this.postponedOperations.callPostponedOperations();
- if (!this._initializing && !this._initialized) {
- this._initializing = true;
- try {
- this._init()
- } finally {
- this._initializing = false;
- this._updateLockCount++;
- this._createActionByOption("onInitialized", {
- excludeValidators: ["disabled", "readOnly"]
- })();
- this._updateLockCount--;
- this._initialized = true
- }
- }
- }
- },
- _logWarningIfDeprecated: function(option) {
- var info = this._deprecatedOptions[option];
- if (info && !this._deprecatedOptionsSuppressed) {
- this._logDeprecatedWarning(option, info)
- }
- },
- _logDeprecatedWarningCount: 0,
- _logDeprecatedWarning: function(option, info) {
- var message = info.message || "Use the '" + info.alias + "' option instead";
- errors.log("W0001", this.NAME, option, info.since, message);
- ++this._logDeprecatedWarningCount
- },
- _suppressDeprecatedWarnings: function() {
- this._deprecatedOptionsSuppressed = true
- },
- _resumeDeprecatedWarnings: function() {
- this._deprecatedOptionsSuppressed = false
- },
- _optionChanging: noop,
- _notifyOptionChanged: function(option, value, previousValue) {
- var that = this;
- if (this._initialized) {
- var optionNames = [option].concat(that._getOptionAliasesByName(option));
- for (var i = 0; i < optionNames.length; i++) {
- var name = optionNames[i];
- var args = {
- name: name.split(/[.[]/)[0],
- fullName: name,
- value: value,
- previousValue: previousValue
- };
- that._optionChangedCallbacks.fireWith(that, [extend(that._defaultActionArgs(), args)]);
- that._optionChangedAction(extend({}, args));
- if (!that._disposed && this._cancelOptionChange !== args.name) {
- that._optionChanged(args)
- }
- }
- }
- },
- initialOption: function(optionName) {
- var currentOptions;
- var currentInitialized = this._initialized;
- if (!this._initialOptions) {
- currentOptions = this._options;
- this._options = {};
- this._initialized = false;
- this._setDefaultOptions();
- this._setOptionsByDevice(currentOptions.defaultOptionsRules);
- this._initialOptions = this._options;
- this._options = currentOptions;
- this._initialized = currentInitialized
- }
- return this._initialOptions[optionName]
- },
- _defaultActionConfig: function() {
- return {
- context: this,
- component: this
- }
- },
- _defaultActionArgs: function() {
- return {
- component: this
- }
- },
- _createAction: function(actionSource, config) {
- var that = this;
- var action;
- return function(e) {
- if (!arguments.length) {
- e = {}
- }
- if (!typeUtils.isPlainObject(e)) {
- e = {
- actionValue: e
- }
- }
- action = action || new Action(actionSource, extend(config, that._defaultActionConfig()));
- return action.execute.call(action, extend(e, that._defaultActionArgs()))
- }
- },
- _createActionByOption: function(optionName, config) {
- var that = this;
- var action;
- var eventName;
- var actionFunc;
- var result = function() {
- if (!eventName) {
- config = config || {};
- if ("string" !== typeof optionName) {
- throw errors.Error("E0008")
- }
- if (0 === optionName.indexOf("on")) {
- eventName = that._getEventName(optionName)
- }
- if (0 !== optionName.indexOf("on")) {
- throw Error("The '" + optionName + "' option name should start with 'on' prefix")
- }
- actionFunc = that.option(optionName)
- }
- if (!action && !actionFunc && !config.beforeExecute && !config.afterExecute && !that.hasEvent(eventName)) {
- return
- }
- if (!action) {
- var beforeExecute = config.beforeExecute;
- config.beforeExecute = function(args) {
- beforeExecute && beforeExecute.apply(that, arguments);
- that.fireEvent(eventName, args.args)
- };
- that._suppressDeprecatedWarnings();
- action = that._createAction(actionFunc, config);
- that._resumeDeprecatedWarnings()
- }
- if (Config().wrapActionsBeforeExecute) {
- var beforeActionExecute = that.option("beforeActionExecute") || noop;
- var wrappedAction = beforeActionExecute(that, action, config) || action;
- return wrappedAction.apply(that, arguments)
- }
- return action.apply(that, arguments)
- };
- if (!Config().wrapActionsBeforeExecute) {
- var onActionCreated = that.option("onActionCreated") || noop;
- result = onActionCreated(that, result, config) || result
- }
- return result
- },
- _getEventName: function(actionName) {
- return actionName.charAt(2).toLowerCase() + actionName.substr(3)
- },
- hasActionSubscription: function(actionName) {
- return !!this.option(actionName) || this.hasEvent(this._getEventName(actionName))
- },
- isOptionDeprecated: function(name) {
- var deprecatedOptions = this._getDeprecatedOptions();
- return Object.prototype.hasOwnProperty.call(deprecatedOptions, name)
- },
- _setOptionSilent: function(name, value) {
- this._cancelOptionChange = name;
- this.option(name, value);
- this._cancelOptionChange = false
- },
- option: function() {
- var normalizeOptionName = function(that, name) {
- var deprecate;
- if (name) {
- if (!that._cachedDeprecateNames) {
- that._cachedDeprecateNames = [];
- for (var optionName in that._deprecatedOptions) {
- that._cachedDeprecateNames.push(optionName)
- }
- }
- for (var i = 0; i < that._cachedDeprecateNames.length; i++) {
- if (that._cachedDeprecateNames[i] === name) {
- deprecate = that._deprecatedOptions[name];
- break
- }
- }
- if (deprecate) {
- that._logWarningIfDeprecated(name);
- var alias = deprecate.alias;
- if (alias) {
- name = alias
- }
- }
- }
- return name
- };
- var getPreviousName = function(fullName) {
- var splitNames = fullName.split(".");
- splitNames.pop();
- return splitNames.join(".")
- };
- var getFieldName = function(fullName) {
- var splitNames = fullName.split(".");
- return splitNames[splitNames.length - 1]
- };
- var getOptionValue = function(options, name, unwrapObservables) {
- var getter = cachedGetters[name];
- if (!getter) {
- getter = cachedGetters[name] = coreDataUtils.compileGetter(name)
- }
- return getter(options, {
- functionsAsIs: true,
- unwrapObservables: unwrapObservables
- })
- };
- var clearOptionsField = function(options, name) {
- delete options[name];
- var previousFieldName = getPreviousName(name);
- var fieldName = getFieldName(name);
- var fieldObject = previousFieldName ? getOptionValue(options, previousFieldName, false) : options;
- if (fieldObject) {
- delete fieldObject[fieldName]
- }
- };
- var setOptionsField = function(options, fullName, value) {
- var fieldName = "";
- var fieldObject;
- do {
- if (fieldName) {
- fieldName = "." + fieldName
- }
- fieldName = getFieldName(fullName) + fieldName;
- fullName = getPreviousName(fullName);
- fieldObject = fullName ? getOptionValue(options, fullName, false) : options
- } while (!fieldObject);
- fieldObject[fieldName] = value
- };
- var normalizeOptionValue = function(that, options, name, value) {
- if (name) {
- var alias = normalizeOptionName(that, name);
- if (alias && alias !== name) {
- setOptionsField(options, alias, value);
- clearOptionsField(options, name)
- }
- }
- };
- var prepareOption = function prepareOption(that, options, name, value) {
- if (typeUtils.isPlainObject(value)) {
- for (var valueName in value) {
- prepareOption(that, options, name + "." + valueName, value[valueName])
- }
- }
- normalizeOptionValue(that, options, name, value)
- };
- var setOptionValue = function(that, name, value) {
- if (!cachedSetters[name]) {
- cachedSetters[name] = coreDataUtils.compileSetter(name)
- }
- var path = name.split(/[.[]/);
- cachedSetters[name](that._options, value, {
- functionsAsIs: true,
- merge: !that._getOptionsByReference()[name],
- unwrapObservables: path.length > 1 && !!that._getOptionsByReference()[path[0]]
- })
- };
- var setOption = function(that, name, value) {
- var previousValue = getOptionValue(that._options, name, false);
- if (that._optionValuesEqual(name, previousValue, value)) {
- return
- }
- if (that._initialized) {
- that._optionChanging(name, previousValue, value)
- }
- setOptionValue(that, name, value);
- that._notifyOptionChanged(name, value, previousValue)
- };
- return function(options, value) {
- var that = this;
- var name = options;
- if (arguments.length < 2 && "object" !== typeUtils.type(name)) {
- name = normalizeOptionName(that, name);
- return getOptionValue(that._options, name)
- }
- if ("string" === typeof name) {
- options = {};
- options[name] = value
- }
- that.beginUpdate();
- try {
- var optionName;
- for (optionName in options) {
- prepareOption(that, options, optionName, options[optionName])
- }
- for (optionName in options) {
- setOption(that, optionName, options[optionName])
- }
- } finally {
- that.endUpdate()
- }
- }
- }(),
- _getOptionValue: function(name, context) {
- var value = this.option(name);
- if (isFunction(value)) {
- return value.bind(context)()
- }
- return value
- }
- }).include(EventsMixin);
- module.exports = Component;
- module.exports.PostponedOperations = PostponedOperations
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/child_default_template.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
- module.exports = TemplateBase.inherit({
- ctor: function(name) {
- this.name = name
- }
- })
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/data/array_utils.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _config = __webpack_require__( /*! ../core/config */ 31);
- var _config2 = _interopRequireDefault(_config);
- var _guid = __webpack_require__( /*! ../core/guid */ 40);
- var _guid2 = _interopRequireDefault(_guid);
- var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
- var _errors = __webpack_require__( /*! ./errors */ 36);
- var _object = __webpack_require__( /*! ../core/utils/object */ 47);
- var _object2 = _interopRequireDefault(_object);
- var _utils = __webpack_require__( /*! ./utils */ 41);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- function hasKey(target, keyOrKeys) {
- var keys = "string" === typeof keyOrKeys ? keyOrKeys.split() : keyOrKeys.slice();
- while (keys.length) {
- var key = keys.shift();
- if (key in target) {
- return true
- }
- }
- return false
- }
- function findItems(keyInfo, items, key, groupCount) {
- if (groupCount) {
- for (var i = 0; i < items.length; i++) {
- var childItems = items[i].items || items[i].collapsedItems || [];
- var result = findItems(keyInfo, childItems || [], key, groupCount - 1);
- if (result) {
- return result
- }
- }
- } else {
- if (indexByKey(keyInfo, items, key) >= 0) {
- return items
- }
- }
- }
- function getItems(keyInfo, items, key, groupCount) {
- if (groupCount) {
- return findItems(keyInfo, items, key, groupCount) || []
- }
- return items
- }
- function generateDataByKeyMap(keyInfo, array) {
- if (keyInfo.key() && !array._dataByKeyMap) {
- var dataByKeyMap = {};
- for (var i = 0, arrayLength = array.length; i < arrayLength; i++) {
- dataByKeyMap[JSON.stringify(keyInfo.keyOf(array[i]))] = array[i]
- }
- array._dataByKeyMap = dataByKeyMap
- }
- }
- function getCacheValue(array, key) {
- if (array._dataByKeyMap) {
- return array._dataByKeyMap[JSON.stringify(key)]
- }
- }
- function getHasKeyCacheValue(array, key) {
- if (array._dataByKeyMap) {
- return array._dataByKeyMap[JSON.stringify(key)]
- }
- return true
- }
- function setDataByKeyMapValue(array, key, data) {
- if (array._dataByKeyMap) {
- array._dataByKeyMap[JSON.stringify(key)] = data
- }
- }
- function applyBatch(keyInfo, array, batchData, groupCount, useInsertIndex) {
- batchData.forEach(function(item) {
- var items = "insert" === item.type ? array : getItems(keyInfo, array, item.key, groupCount);
- generateDataByKeyMap(keyInfo, items);
- switch (item.type) {
- case "update":
- update(keyInfo, items, item.key, item.data, true);
- break;
- case "insert":
- insert(keyInfo, items, item.data, useInsertIndex && (0, _type.isDefined)(item.index) ? item.index : -1, true);
- break;
- case "remove":
- remove(keyInfo, items, item.key, true)
- }
- })
- }
- function update(keyInfo, array, key, data, isBatch) {
- var target;
- var extendComplexObject = true;
- var keyExpr = keyInfo.key();
- if (keyExpr) {
- if (hasKey(data, keyExpr) && !(0, _utils.keysEqual)(keyExpr, key, keyInfo.keyOf(data))) {
- return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4017"))
- }
- target = getCacheValue(array, key);
- if (!target) {
- var index = indexByKey(keyInfo, array, key);
- if (index < 0) {
- return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4009"))
- }
- target = array[index]
- }
- } else {
- target = key
- }
- _object2.default.deepExtendArraySafe(target, data, extendComplexObject);
- if (!isBatch) {
- if ((0, _config2.default)().useLegacyStoreResult) {
- return (0, _utils.trivialPromise)(key, data)
- } else {
- return (0, _utils.trivialPromise)(target, key)
- }
- }
- }
- function insert(keyInfo, array, data, index, isBatch) {
- var keyValue;
- var keyExpr = keyInfo.key();
- var obj = (0, _type.isPlainObject)(data) ? (0, _extend.extend)({}, data) : data;
- if (keyExpr) {
- keyValue = keyInfo.keyOf(obj);
- if (void 0 === keyValue || "object" === _typeof(keyValue) && (0, _type.isEmptyObject)(keyValue)) {
- if (Array.isArray(keyExpr)) {
- throw _errors.errors.Error("E4007")
- }
- keyValue = obj[keyExpr] = String(new _guid2.default)
- } else {
- if (void 0 !== array[indexByKey(keyInfo, array, keyValue)]) {
- return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4008"))
- }
- }
- } else {
- keyValue = obj
- }
- if (index >= 0) {
- array.splice(index, 0, obj)
- } else {
- array.push(obj)
- }
- setDataByKeyMapValue(array, keyValue, obj);
- if (!isBatch) {
- return (0, _utils.trivialPromise)((0, _config2.default)().useLegacyStoreResult ? data : obj, keyValue)
- }
- }
- function remove(keyInfo, array, key, isBatch) {
- var index = indexByKey(keyInfo, array, key);
- if (index > -1) {
- array.splice(index, 1)
- }
- if (!isBatch) {
- return (0, _utils.trivialPromise)(key)
- }
- }
- function indexByKey(keyInfo, array, key) {
- var keyExpr = keyInfo.key();
- if (!getHasKeyCacheValue(array, key)) {
- return -1
- }
- for (var i = 0, arrayLength = array.length; i < arrayLength; i++) {
- if ((0, _utils.keysEqual)(keyExpr, keyInfo.keyOf(array[i]), key)) {
- return i
- }
- }
- return -1
- }
- module.exports.applyBatch = applyBatch;
- module.exports.update = update;
- module.exports.insert = insert;
- module.exports.remove = remove;
- module.exports.indexByKey = indexByKey
- }, , , , , , ,
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/viz/core/helpers.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var isServerSide = !windowUtils.hasWindow();
- function Flags() {
- this.reset()
- }
- Flags.prototype = {
- constructor: Flags,
- add: function(codes) {
- var i;
- var ii = codes.length;
- var flags = this._flags;
- for (i = 0; i < ii; ++i) {
- flags[codes[i]] = 1
- }
- this._k += ii
- },
- has: function(code) {
- return this._flags[code] > 0
- },
- count: function() {
- return this._k
- },
- reset: function() {
- this._flags = {};
- this._k = 0
- }
- };
- function combineMaps(baseMap, thisMap) {
- return baseMap !== thisMap ? _extend({}, baseMap, thisMap) : _extend({}, baseMap)
- }
- function combineLists(baseList, thisList) {
- return baseList !== thisList ? baseList.concat(thisList) : baseList.slice()
- }
- function buildTotalChanges(proto) {
- proto._totalChangesOrder = proto._optionChangesOrder.concat(proto._layoutChangesOrder, proto._customChangesOrder)
- }
- function addChange(settings) {
- var proto = this.prototype;
- var code = settings.code;
- proto["_change_" + code] = settings.handler;
- if (settings.isThemeDependent) {
- proto._themeDependentChanges.push(code)
- }
- if (settings.option) {
- proto._optionChangesMap[settings.option] = code
- }(settings.isOptionChange ? proto._optionChangesOrder : proto._customChangesOrder).push(code);
- buildTotalChanges(proto)
- }
- function createChainExecutor() {
- var executeChain = function executeChain() {
- var i;
- var ii = executeChain._chain.length;
- var result;
- for (i = 0; i < ii; ++i) {
- result = executeChain._chain[i].apply(this, arguments)
- }
- return result
- };
- executeChain._chain = [];
- executeChain.add = function(item) {
- executeChain._chain.push(item)
- };
- executeChain.copy = function(executor) {
- executeChain._chain = executor._chain.slice()
- };
- return executeChain
- }
- function expand(target, name, expander) {
- var current = target[name];
- if (!current) {
- current = expander
- } else {
- if (!current.add) {
- current = createChainExecutor();
- current.add(target[name]);
- current.add(expander)
- } else {
- if (false === Object.prototype.hasOwnProperty.call(target, name)) {
- current = createChainExecutor();
- current.copy(target[name])
- }
- current.add(expander)
- }
- }
- target[name] = current
- }
- function addPlugin(plugin) {
- var proto = this.prototype;
- proto._plugins.push(plugin);
- plugin.fontFields && proto._fontFields.push.apply(proto._fontFields, plugin.fontFields);
- if (plugin.members) {
- _extend(this.prototype, plugin.members)
- }
- if (plugin.customize) {
- plugin.customize(this)
- }
- if (plugin.extenders) {
- Object.keys(plugin.extenders).forEach(function(key) {
- var func = plugin.extenders[key];
- expand(proto, key, func)
- }, this)
- }
- }
- exports.replaceInherit = isServerSide ? function(widget) {
- var _inherit = widget.inherit;
- widget.inherit = function() {
- var result = _inherit.apply(this, arguments);
- var proto = result.prototype;
- ["_plugins", "_eventsMap", "_initialChanges", "_themeDependentChanges", "_optionChangesMap", "_optionChangesOrder", "_layoutChangesOrder", "_customChangesOrder", "_totalChangesOrder"].forEach(function(key) {
- proto[key] = {}
- });
- result.addPlugin = noop;
- return result
- };
- widget.addChange = noop;
- widget.addPlugin = noop
- } : function(widget) {
- var _inherit = widget.inherit;
- widget.inherit = function() {
- var proto = this.prototype;
- var plugins = proto._plugins;
- var fontFields = proto._fontFields;
- var eventsMap = proto._eventsMap;
- var initialChanges = proto._initialChanges;
- var themeDependentChanges = proto._themeDependentChanges;
- var optionChangesMap = proto._optionChangesMap;
- var partialOptionChangesMap = proto._partialOptionChangesMap;
- var partialOptionChangesPath = proto._partialOptionChangesPath;
- var optionChangesOrder = proto._optionChangesOrder;
- var layoutChangesOrder = proto._layoutChangesOrder;
- var customChangesOrder = proto._customChangesOrder;
- var result = _inherit.apply(this, arguments);
- proto = result.prototype;
- proto._plugins = combineLists(plugins, proto._plugins);
- proto._fontFields = combineLists(fontFields, proto._fontFields);
- proto._eventsMap = combineMaps(eventsMap, proto._eventsMap);
- proto._initialChanges = combineLists(initialChanges, proto._initialChanges);
- proto._themeDependentChanges = combineLists(themeDependentChanges, proto._themeDependentChanges);
- proto._optionChangesMap = combineMaps(optionChangesMap, proto._optionChangesMap);
- proto._partialOptionChangesMap = combineMaps(partialOptionChangesMap, proto._partialOptionChangesMap);
- proto._partialOptionChangesPath = combineMaps(partialOptionChangesPath, proto._partialOptionChangesPath);
- proto._optionChangesOrder = combineLists(optionChangesOrder, proto._optionChangesOrder);
- proto._layoutChangesOrder = combineLists(layoutChangesOrder, proto._layoutChangesOrder);
- proto._customChangesOrder = combineLists(customChangesOrder, proto._customChangesOrder);
- buildTotalChanges(proto);
- result.addPlugin = addPlugin;
- return result
- };
- widget.prototype._plugins = [];
- widget.prototype._fontFields = [];
- widget.addChange = addChange;
- widget.addPlugin = addPlugin
- };
- exports.changes = function() {
- return new Flags
- };
- exports.expand = expand
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/series/bar_series.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106);
- var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart.area;
- var chartSeries = scatterSeries.chart;
- var polarSeries = scatterSeries.polar;
- var _extend = extend;
- var _each = each;
- exports.chart = {};
- exports.polar = {};
- var baseBarSeriesMethods = {
- _createLegendState: function(styleOptions, defaultColor) {
- return {
- fill: styleOptions.color || defaultColor,
- hatching: styleOptions.hatching
- }
- },
- _parsePointStyle: function(style, defaultColor, defaultBorderColor) {
- var color = style.color || defaultColor;
- var base = chartSeries._parsePointStyle.call(this, style, color, defaultBorderColor);
- base.fill = color;
- base.hatching = style.hatching;
- base.dashStyle = style.border && style.border.dashStyle || "solid";
- delete base.r;
- return base
- },
- _applyMarkerClipRect: function(settings) {
- settings["clip-path"] = null
- },
- _setGroupsSettings: function(animationEnabled, firstDrawing) {
- var that = this;
- var settings = {};
- chartSeries._setGroupsSettings.apply(that, arguments);
- if (animationEnabled && firstDrawing) {
- settings = this._getAffineCoordOptions()
- } else {
- if (!animationEnabled) {
- settings = {
- scaleX: 1,
- scaleY: 1,
- translateX: 0,
- translateY: 0
- }
- }
- }
- that._markersGroup.attr(settings)
- },
- _drawPoint: function(options) {
- options.hasAnimation = options.hasAnimation && !options.firstDrawing;
- options.firstDrawing = false;
- chartSeries._drawPoint.call(this, options)
- },
- _getMainColor: function() {
- return this._options.mainSeriesColor
- },
- _createPointStyles: function(pointOptions) {
- var that = this;
- var mainColor = pointOptions.color || that._getMainColor();
- return {
- normal: that._parsePointStyle(pointOptions, mainColor, mainColor),
- hover: that._parsePointStyle(pointOptions.hoverStyle || {}, mainColor, mainColor),
- selection: that._parsePointStyle(pointOptions.selectionStyle || {}, mainColor, mainColor)
- }
- },
- _updatePointsVisibility: function() {
- var visibility = this._options.visible;
- each(this._points, function(_, point) {
- point._options.visible = visibility
- })
- },
- _getOptionsForPoint: function() {
- return this._options
- },
- _animate: function(firstDrawing) {
- var that = this;
- var complete = function() {
- that._animateComplete()
- };
- var animateFunc = function(drawnPoints, complete) {
- var lastPointIndex = drawnPoints.length - 1;
- _each(drawnPoints || [], function(i, point) {
- point.animate(i === lastPointIndex ? complete : void 0, point.getMarkerCoords())
- })
- };
- that._animatePoints(firstDrawing, complete, animateFunc)
- },
- getValueRangeInitialValue: areaSeries.getValueRangeInitialValue,
- _patchMarginOptions: function(options) {
- options.checkInterval = true;
- return options
- },
- _defaultAggregator: "sum",
- _defineDrawingState: function() {},
- usePointsToDefineAutoHiding: function() {
- return false
- }
- };
- exports.chart.bar = _extend({}, chartSeries, baseBarSeriesMethods, {
- _getAffineCoordOptions: function() {
- var rotated = this._options.rotated;
- var direction = rotated ? "X" : "Y";
- var settings = {
- scaleX: rotated ? .001 : 1,
- scaleY: rotated ? 1 : .001
- };
- settings["translate" + direction] = this.getValueAxis().getTranslator().translate("canvas_position_default");
- return settings
- },
- _animatePoints: function(firstDrawing, complete, animateFunc) {
- var that = this;
- that._markersGroup.animate({
- scaleX: 1,
- scaleY: 1,
- translateY: 0,
- translateX: 0
- }, void 0, complete);
- if (!firstDrawing) {
- animateFunc(that._drawnPoints, complete)
- }
- },
- checkSeriesViewportCoord: function(axis, coord) {
- if (0 === this._points.length) {
- return false
- }
- if (axis.isArgumentAxis) {
- return true
- }
- var translator = axis.getTranslator();
- var range = this.getViewport();
- var min = translator.translate(range.categories ? range.categories[0] : range.min);
- var max = translator.translate(range.categories ? range.categories[range.categories.length - 1] : range.max);
- var rotated = this.getOptions().rotated;
- var inverted = axis.getOptions().inverted;
- return rotated && !inverted || !rotated && inverted ? coord >= min && coord <= max : coord >= max && coord <= min
- },
- getSeriesPairCoord: function(coord, isArgument) {
- var oppositeCoord = null;
- var rotated = this._options.rotated;
- var isOpposite = !isArgument && !rotated || isArgument && rotated;
- var coordName = isOpposite ? "vy" : "vx";
- var oppositeCoordName = isOpposite ? "vx" : "vy";
- var points = this.getPoints();
- for (var i = 0; i < points.length; i++) {
- var p = points[i];
- var tmpCoord = void 0;
- if (isArgument) {
- tmpCoord = p.getCenterCoord()[coordName[1]] === coord ? p[oppositeCoordName] : void 0
- } else {
- tmpCoord = p[coordName] === coord ? p[oppositeCoordName] : void 0
- }
- if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
- oppositeCoord = tmpCoord;
- break
- }
- }
- return oppositeCoord
- }
- });
- exports.polar.bar = _extend({}, polarSeries, baseBarSeriesMethods, {
- _animatePoints: function(firstDrawing, complete, animateFunc) {
- animateFunc(this._drawnPoints, complete)
- },
- _setGroupsSettings: chartSeries._setGroupsSettings,
- _drawPoint: function(point, groups, animationEnabled) {
- chartSeries._drawPoint.call(this, point, groups, animationEnabled)
- },
- _parsePointStyle: function(style) {
- var base = baseBarSeriesMethods._parsePointStyle.apply(this, arguments);
- base.opacity = style.opacity;
- return base
- },
- _createGroups: chartSeries._createGroups,
- _setMarkerGroupSettings: function() {
- var that = this;
- var markersSettings = that._createPointStyles(that._getMarkerGroupOptions()).normal;
- markersSettings.class = "dxc-markers";
- that._applyMarkerClipRect(markersSettings);
- var groupSettings = _extend({}, markersSettings);
- delete groupSettings.opacity;
- that._markersGroup.attr(groupSettings)
- },
- _createLegendState: areaSeries._createLegendState
- })
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/core/data_source.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 84);
- var postCtor = DataHelperMixin.postCtor;
- var name;
- var members = {
- _dataSourceLoadErrorHandler: function() {
- this._dataSourceChangedHandler()
- },
- _dataSourceOptions: function() {
- return {
- paginate: false
- }
- },
- _updateDataSource: function() {
- this._refreshDataSource();
- if (!this.option("dataSource")) {
- this._dataSourceChangedHandler()
- }
- },
- _dataIsLoaded: function() {
- return !this._dataSource || this._dataSource.isLoaded()
- },
- _dataSourceItems: function() {
- return this._dataSource && this._dataSource.items()
- }
- };
- for (name in DataHelperMixin) {
- if ("postCtor" === name) {
- continue
- }
- members[name] = DataHelperMixin[name]
- }
- exports.plugin = {
- name: "data_source",
- init: function() {
- postCtor.call(this)
- },
- dispose: noop,
- members: members
- }
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/base_gauge.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _Number = Number;
- var _getAppropriateFormat = __webpack_require__( /*! ../core/utils */ 10).getAppropriateFormat;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var translator1DModule = __webpack_require__( /*! ../translators/translator1d */ 412);
- var _extend = extend;
- var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96);
- var themeManagerModule = __webpack_require__( /*! ./theme_manager */ 794);
- var Tracker = __webpack_require__( /*! ./tracker */ 795);
- var dxBaseGauge = BaseWidget.inherit({
- _rootClassPrefix: "dxg",
- _themeSection: "gauge",
- _createThemeManager: function() {
- return new themeManagerModule.ThemeManager(this._getThemeManagerOptions())
- },
- _initCore: function() {
- var that = this;
- var root = that._renderer.root;
- that._valueChangingLocker = 0;
- that._translator = that._factory.createTranslator();
- that._tracker = that._factory.createTracker({
- renderer: that._renderer,
- container: root
- });
- that._setTrackerCallbacks()
- },
- _beginValueChanging: function() {
- this._resetIsReady();
- this._onBeginUpdate();
- ++this._valueChangingLocker
- },
- _endValueChanging: function() {
- if (0 === --this._valueChangingLocker) {
- this._drawn()
- }
- },
- _setTrackerCallbacks: function() {
- var that = this;
- var renderer = that._renderer;
- var tooltip = that._tooltip;
- that._tracker.setCallbacks({
- "tooltip-show": function(target, info) {
- var tooltipParameters = target.getTooltipParameters();
- var offset = renderer.getRootOffset();
- var formatObject = _extend({
- value: tooltipParameters.value,
- valueText: tooltip.formatValue(tooltipParameters.value),
- color: tooltipParameters.color
- }, info);
- return tooltip.show(formatObject, {
- x: tooltipParameters.x + offset.left,
- y: tooltipParameters.y + offset.top,
- offset: tooltipParameters.offset
- }, {
- target: info
- })
- },
- "tooltip-hide": function() {
- return tooltip.hide()
- }
- })
- },
- _dispose: function() {
- this._cleanCore();
- this.callBase.apply(this, arguments)
- },
- _disposeCore: function() {
- var that = this;
- that._themeManager.dispose();
- that._tracker.dispose();
- that._translator = that._tracker = null
- },
- _cleanCore: function() {
- var that = this;
- that._tracker.deactivate();
- that._cleanContent()
- },
- _renderCore: function() {
- var that = this;
- if (!that._isValidDomain) {
- return
- }
- that._renderContent();
- that._tracker.setTooltipState(that._tooltip.isEnabled());
- that._tracker.activate();
- that._noAnimation = false;
- that._debug_rendered && that._debug_rendered()
- },
- _applyChanges: function() {
- this.callBase.apply(this, arguments);
- this._resizing = this._noAnimation = false
- },
- _setContentSize: function() {
- var that = this;
- that._resizing = that._noAnimation = 2 === that._changes.count();
- that.callBase.apply(that, arguments)
- },
- _applySize: function(rect) {
- var that = this;
- that._DEBUG_rootRect = rect;
- that._innerRect = {
- left: rect[0],
- top: rect[1],
- right: rect[2],
- bottom: rect[3]
- };
- var layoutCache = that._layout._cache;
- that._cleanCore();
- that._renderCore();
- that._layout._cache = that._layout._cache || layoutCache;
- return [rect[0], that._innerRect.top, rect[2], that._innerRect.bottom]
- },
- _initialChanges: ["DOMAIN"],
- _themeDependentChanges: ["DOMAIN"],
- _optionChangesMap: {
- subtitle: "MOSTLY_TOTAL",
- indicator: "MOSTLY_TOTAL",
- geometry: "MOSTLY_TOTAL",
- animation: "MOSTLY_TOTAL",
- startValue: "DOMAIN",
- endValue: "DOMAIN"
- },
- _optionChangesOrder: ["DOMAIN", "MOSTLY_TOTAL"],
- _change_DOMAIN: function() {
- this._setupDomain()
- },
- _change_MOSTLY_TOTAL: function() {
- this._applyMostlyTotalChange()
- },
- _setupDomain: function() {
- var that = this;
- that._setupDomainCore();
- that._isValidDomain = isFinite(1 / (that._translator.getDomain()[1] - that._translator.getDomain()[0]));
- if (!that._isValidDomain) {
- that._incidentOccurred("W2301")
- }
- that._change(["MOSTLY_TOTAL"])
- },
- _applyMostlyTotalChange: function() {
- var that = this;
- that._setupCodomain();
- that._setupAnimationSettings();
- that._setupDefaultFormat();
- that._change(["LAYOUT"])
- },
- _setupAnimationSettings: function() {
- var that = this;
- var option = that.option("animation");
- that._animationSettings = null;
- if (void 0 === option || option) {
- option = _extend({
- enabled: true,
- duration: 1e3,
- easing: "easeOutCubic"
- }, option);
- if (option.enabled && option.duration > 0) {
- that._animationSettings = {
- duration: _Number(option.duration),
- easing: option.easing
- }
- }
- }
- that._containerBackgroundColor = that.option("containerBackgroundColor") || that._themeManager.theme().containerBackgroundColor
- },
- _setupDefaultFormat: function() {
- var domain = this._translator.getDomain();
- this._defaultFormatOptions = _getAppropriateFormat(domain[0], domain[1], this._getApproximateScreenRange())
- },
- _setupDomainCore: null,
- _calculateSize: null,
- _cleanContent: null,
- _renderContent: null,
- _setupCodomain: null,
- _getApproximateScreenRange: null,
- _factory: {
- createTranslator: function() {
- return new translator1DModule.Translator1D
- },
- createTracker: function(parameters) {
- return new Tracker(parameters)
- }
- }
- });
- exports.dxBaseGauge = dxBaseGauge;
- var _format = __webpack_require__( /*! ../../format_helper */ 64).format;
- var formatValue = function(value, options, extra) {
- options = options || {};
- var text = _format(value, options.format);
- var formatObject;
- if ("function" === typeof options.customizeText) {
- formatObject = _extend({
- value: value,
- valueText: text
- }, extra);
- return String(options.customizeText.call(formatObject, formatObject))
- }
- return text
- };
- var getSampleText = function(translator, options) {
- var text1 = formatValue(translator.getDomainStart(), options);
- var text2 = formatValue(translator.getDomainEnd(), options);
- return text1.length >= text2.length ? text1 : text2
- };
- exports.formatValue = formatValue;
- exports.getSampleText = getSampleText;
- exports.compareArrays = function(array1, array2) {
- return array1 && array2 && array1.length === array2.length && compareArraysElements(array1, array2)
- };
- function compareArraysElements(array1, array2) {
- var i;
- var ii = array1.length;
- var array1ValueIsNaN;
- var array2ValueIsNaN;
- for (i = 0; i < ii; ++i) {
- array1ValueIsNaN = array1[i] !== array1[i];
- array2ValueIsNaN = array2[i] !== array2[i];
- if (array1ValueIsNaN && array2ValueIsNaN) {
- continue
- }
- if (array1[i] !== array2[i]) {
- return false
- }
- }
- return true
- }
- dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
- dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
- dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
- dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin);
- var _setTooltipOptions = dxBaseGauge.prototype._setTooltipOptions;
- dxBaseGauge.prototype._setTooltipOptions = function() {
- _setTooltipOptions.apply(this, arguments);
- this._tracker && this._tracker.setTooltipState(this._tooltip.isEnabled())
- }
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/api.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- proto._eventsMap.onNodesInitialized = {
- name: "nodesInitialized"
- };
- proto._eventsMap.onNodesRendering = {
- name: "nodesRendering"
- };
- proto._createProxyType = function() {
- var that = this;
- var nodes;
- Proxy.prototype = {
- constructor: Proxy,
- getParent: function() {
- return nodes[this._id].parent.proxy || null
- },
- getChild: function(index) {
- var _nodes = nodes[this._id].nodes;
- return _nodes ? _nodes[index].proxy : null
- },
- getChildrenCount: function() {
- var _nodes = nodes[this._id].nodes;
- return _nodes ? _nodes.length : 0
- },
- getAllChildren: function() {
- var _nodes = nodes[this._id].nodes;
- var i;
- var ii = _nodes && _nodes.length;
- var list = [];
- for (i = 0; i < ii; ++i) {
- list.push(_nodes[i].proxy)
- }
- return list
- },
- getAllNodes: function() {
- var list = [];
- collectNodes(nodes[this._id], list);
- return list
- },
- isLeaf: function() {
- return !nodes[this._id].isNode()
- },
- isActive: function() {
- return nodes[this._id].isActive()
- },
- value: function(arg) {
- var node = nodes[this._id];
- var result;
- if (void 0 !== arg) {
- updateValue(node, arg > 0 ? Number(arg) : 0);
- change(node, ["TILING"]);
- result = this
- } else {
- result = node.value
- }
- return result
- },
- label: function(arg) {
- var node = nodes[this._id];
- var result;
- if (void 0 !== arg) {
- node.customLabel = arg ? String(arg) : null;
- change(node, ["LABELS"]);
- result = this
- } else {
- result = node.customLabel || node.label
- }
- return result
- },
- customize: function(settings) {
- var node = nodes[this._id];
- if (settings) {
- node._custom = node._custom || {};
- _extend(true, node._custom, settings);
- node._partialState = node._partialLabelState = null
- }
- change(node, ["TILES", "LABELS"]);
- return this
- },
- resetCustomization: function() {
- var node = nodes[this._id];
- node._custom = node._partialState = node._partialLabelState = null;
- change(node, ["TILES", "LABELS"]);
- return this
- }
- };
- that._extendProxyType(Proxy.prototype);
- function Proxy(node) {
- var that = this;
- node.proxy = that;
- that._id = node._id;
- that.level = node.level;
- that.index = node.index;
- that.data = node.data
- }
- that._handlers.beginBuildNodes = function() {
- nodes = that._nodes;
- new Proxy(that._root)
- };
- that._handlers.buildNode = function(node) {
- new Proxy(node)
- };
- that._handlers.endBuildNodes = function() {
- that._eventTrigger("nodesInitialized", {
- root: that._root.proxy
- })
- }
- };
- function change(node, codes) {
- var ctx = node.ctx;
- ctx.suspend();
- ctx.change(codes);
- ctx.resume()
- }
- function collectNodes(node, list) {
- var nodes = node.nodes;
- var i;
- var ii = nodes && nodes.length;
- for (i = 0; i < ii; ++i) {
- list.push(nodes[i].proxy);
- collectNodes(nodes[i], list)
- }
- }
- function updateValue(node, value) {
- var delta = value - node.value;
- while (node) {
- node.value += delta;
- node = node.parent
- }
- }
- proto._extendProxyType = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var _resetNodes = proto._resetNodes;
- proto._resetNodes = function() {
- _resetNodes.call(this);
- this._eventTrigger("nodesRendering", {
- node: this._topNode.proxy
- })
- };
- var _updateStyles = nodeProto.updateStyles;
- nodeProto.updateStyles = function() {
- var that = this;
- _updateStyles.call(that);
- if (that._custom) {
- that._partialState = !that.ctx.forceReset && that._partialState || that.ctx.calculateState(that._custom);
- _extend(true, that.state, that._partialState)
- }
- };
- var _updateLabelStyle = nodeProto.updateLabelStyle;
- nodeProto.updateLabelStyle = function() {
- var that = this;
- var custom = that._custom;
- _updateLabelStyle.call(that);
- if (custom && custom.label) {
- that._partialLabelState = !that.ctx.forceReset && that._partialLabelState || calculatePartialLabelState(that, custom.label);
- that.labelState = _extend(true, {}, that.labelState, that._partialLabelState)
- }
- };
- function calculatePartialLabelState(node, settings) {
- var state = node.ctx.calculateLabelState(settings);
- if ("visible" in settings) {
- state.visible = !!settings.visible
- }
- return state
- }
- proto.getRootNode = function() {
- return this._root.proxy
- };
- proto.resetNodes = function() {
- var context = this._context;
- context.suspend();
- context.change(["NODES_CREATE"]);
- context.resume();
- return this
- }
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/bundles/modules/core.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var DevExpress = window.DevExpress = window.DevExpress || {};
- var errors = DevExpress.errors = __webpack_require__( /*! ../../core/errors */ 21);
- if (DevExpress._DEVEXTREME_BUNDLE_INITIALIZED) {
- throw errors.Error("E0024")
- }
- DevExpress._DEVEXTREME_BUNDLE_INITIALIZED = true;
- DevExpress.clientExporter = __webpack_require__( /*! ../../exporter */ 170);
- DevExpress.excelExporter = __webpack_require__( /*! ../../exporter/exceljs/excelExporter */ 441);
- DevExpress.VERSION = __webpack_require__( /*! ../../core/version */ 157);
- DevExpress.Class = __webpack_require__( /*! ../../core/class */ 15);
- DevExpress.DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
- DevExpress.Component = __webpack_require__( /*! ../../core/component */ 133);
- DevExpress.registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
- DevExpress.devices = __webpack_require__( /*! ../../core/devices */ 16);
- DevExpress.Color = __webpack_require__( /*! ../../color */ 94);
- var animationFrame = __webpack_require__( /*! ../../animation/frame */ 112);
- DevExpress.EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
- DevExpress.utils = {};
- DevExpress.utils.requestAnimationFrame = animationFrame.requestAnimationFrame;
- DevExpress.utils.cancelAnimationFrame = animationFrame.cancelAnimationFrame;
- DevExpress.utils.initMobileViewport = __webpack_require__( /*! ../../mobile/init_mobile_viewport/init_mobile_viewport */ 446).initMobileViewport;
- DevExpress.utils.extendFromObject = __webpack_require__( /*! ../../core/utils/extend */ 0).extendFromObject;
- DevExpress.utils.createComponents = __webpack_require__( /*! ../../core/utils/dom */ 12).createComponents;
- DevExpress.utils.triggerShownEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerShownEvent;
- DevExpress.utils.triggerHidingEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerHidingEvent;
- DevExpress.utils.resetActiveElement = __webpack_require__( /*! ../../core/utils/dom */ 12).resetActiveElement;
- DevExpress.utils.findBestMatches = __webpack_require__( /*! ../../core/utils/common */ 4).findBestMatches;
- DevExpress.createQueue = __webpack_require__( /*! ../../core/utils/queue */ 263).create;
- DevExpress.utils.dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
- DevExpress.utils.common = __webpack_require__( /*! ../../core/utils/common */ 4);
- DevExpress.utils.date = __webpack_require__( /*! ../../core/utils/date */ 22);
- DevExpress.utils.browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
- DevExpress.utils.inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
- DevExpress.utils.iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- DevExpress.utils.readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
- DevExpress.utils.resizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130);
- DevExpress.utils.console = __webpack_require__( /*! ../../core/utils/console */ 73);
- DevExpress.utils.string = __webpack_require__( /*! ../../core/utils/string */ 44);
- DevExpress.utils.support = __webpack_require__( /*! ../../core/utils/support */ 43);
- DevExpress.utils.ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
- DevExpress.viewPort = __webpack_require__( /*! ../../core/utils/view_port */ 78).value;
- DevExpress.hideTopOverlay = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 213);
- DevExpress.formatHelper = __webpack_require__( /*! ../../format_helper */ 64);
- DevExpress.config = __webpack_require__( /*! ../../core/config */ 31);
- DevExpress.animationPresets = __webpack_require__( /*! ../../animation/presets/presets */ 179).presets;
- DevExpress.fx = __webpack_require__( /*! ../../animation/fx */ 38);
- DevExpress.TransitionExecutor = __webpack_require__( /*! ../../animation/transition_executor/transition_executor */ 281).TransitionExecutor;
- DevExpress.AnimationPresetCollection = __webpack_require__( /*! ../../animation/presets/presets */ 179).PresetCollection;
- DevExpress.events = __webpack_require__( /*! ../../events */ 282);
- DevExpress.events.click = __webpack_require__( /*! ../../events/click */ 19);
- DevExpress.events.utils = __webpack_require__( /*! ../../events/utils */ 8);
- DevExpress.events.GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 158);
- DevExpress.localization = __webpack_require__( /*! ../../localization */ 449);
- module.exports = DevExpress
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/events/hover.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
- var Class = __webpack_require__( /*! ../core/class */ 15);
- var devices = __webpack_require__( /*! ../core/devices */ 16);
- var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var pointerEvents = __webpack_require__( /*! ./pointer */ 23);
- var HOVERSTART_NAMESPACE = "dxHoverStart";
- var HOVERSTART = "dxhoverstart";
- var POINTERENTER_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.enter, HOVERSTART_NAMESPACE);
- var HOVEREND_NAMESPACE = "dxHoverEnd";
- var HOVEREND = "dxhoverend";
- var POINTERLEAVE_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.leave, HOVEREND_NAMESPACE);
- var Hover = Class.inherit({
- noBubble: true,
- ctor: function() {
- this._handlerArrayKeyPath = this._eventNamespace + "_HandlerStore"
- },
- setup: function(element) {
- dataUtils.data(element, this._handlerArrayKeyPath, {})
- },
- add: function(element, handleObj) {
- var that = this;
- var handler = function(e) {
- that._handler(e)
- };
- eventsEngine.on(element, this._originalEventName, handleObj.selector, handler);
- dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid] = handler
- },
- _handler: function(e) {
- if (eventUtils.isTouchEvent(e) || devices.isSimulator()) {
- return
- }
- eventUtils.fireEvent({
- type: this._eventName,
- originalEvent: e,
- delegateTarget: e.delegateTarget
- })
- },
- remove: function(element, handleObj) {
- var handler = dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid];
- eventsEngine.off(element, this._originalEventName, handleObj.selector, handler)
- },
- teardown: function(element) {
- dataUtils.removeData(element, this._handlerArrayKeyPath)
- }
- });
- var HoverStart = Hover.inherit({
- ctor: function() {
- this._eventNamespace = HOVERSTART_NAMESPACE;
- this._eventName = HOVERSTART;
- this._originalEventName = POINTERENTER_NAMESPACED_EVENT_NAME;
- this.callBase()
- },
- _handler: function(e) {
- var pointers = e.pointers || [];
- if (!pointers.length) {
- this.callBase(e)
- }
- }
- });
- var HoverEnd = Hover.inherit({
- ctor: function() {
- this._eventNamespace = HOVEREND_NAMESPACE;
- this._eventName = HOVEREND;
- this._originalEventName = POINTERLEAVE_NAMESPACED_EVENT_NAME;
- this.callBase()
- }
- });
- registerEvent(HOVERSTART, new HoverStart);
- registerEvent(HOVEREND, new HoverEnd);
- exports.start = HOVERSTART;
- exports.end = HOVEREND
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/data/custom_store.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var dataUtils = __webpack_require__( /*! ./utils */ 41);
- var arrayUtils = __webpack_require__( /*! ./array_utils */ 135);
- var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
- var config = __webpack_require__( /*! ../core/config */ 31);
- var errors = __webpack_require__( /*! ./errors */ 36).errors;
- var Store = __webpack_require__( /*! ./abstract_store */ 98);
- var arrayQuery = __webpack_require__( /*! ./array_query */ 155);
- var queryByOptions = __webpack_require__( /*! ./store_helper */ 81).queryByOptions;
- var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
- var Deferred = deferredUtils.Deferred;
- var when = deferredUtils.when;
- var fromPromise = deferredUtils.fromPromise;
- var TOTAL_COUNT = "totalCount";
- var LOAD = "load";
- var BY_KEY = "byKey";
- var INSERT = "insert";
- var UPDATE = "update";
- var REMOVE = "remove";
- function isPromise(obj) {
- return obj && isFunction(obj.then)
- }
- function trivialPromise(value) {
- return (new Deferred).resolve(value).promise()
- }
- function ensureRequiredFuncOption(name, obj) {
- if (!isFunction(obj)) {
- throw errors.Error("E4011", name)
- }
- }
- function throwInvalidUserFuncResult(name) {
- throw errors.Error("E4012", name)
- }
- function createUserFuncFailureHandler(pendingDeferred) {
- function errorMessageFromXhr(promiseArguments) {
- var xhr = promiseArguments[0];
- var textStatus = promiseArguments[1];
- if (!xhr || !xhr.getResponseHeader) {
- return null
- }
- return dataUtils.errorMessageFromXhr(xhr, textStatus)
- }
- return function(arg) {
- var error;
- if (arg instanceof Error) {
- error = arg
- } else {
- error = new Error(errorMessageFromXhr(arguments) || arg && String(arg) || "Unknown error")
- }
- if (error.message !== dataUtils.XHR_ERROR_UNLOAD) {
- pendingDeferred.reject(error)
- }
- }
- }
- function invokeUserLoad(store, options) {
- var userFunc = store._loadFunc;
- var userResult;
- ensureRequiredFuncOption(LOAD, userFunc);
- userResult = userFunc.apply(store, [options]);
- if (Array.isArray(userResult)) {
- userResult = trivialPromise(userResult)
- } else {
- if (null === userResult || void 0 === userResult) {
- userResult = trivialPromise([])
- } else {
- if (!isPromise(userResult)) {
- throwInvalidUserFuncResult(LOAD)
- }
- }
- }
- return fromPromise(userResult)
- }
- function invokeUserTotalCountFunc(store, options) {
- var userFunc = store._totalCountFunc;
- var userResult;
- if (!isFunction(userFunc)) {
- throw errors.Error("E4021")
- }
- userResult = userFunc.apply(store, [options]);
- if (!isPromise(userResult)) {
- userResult = Number(userResult);
- if (!isFinite(userResult)) {
- throwInvalidUserFuncResult(TOTAL_COUNT)
- }
- userResult = trivialPromise(userResult)
- }
- return fromPromise(userResult)
- }
- function invokeUserByKeyFunc(store, key, extraOptions) {
- var userFunc = store._byKeyFunc;
- var userResult;
- ensureRequiredFuncOption(BY_KEY, userFunc);
- userResult = userFunc.apply(store, [key, extraOptions]);
- if (!isPromise(userResult)) {
- userResult = trivialPromise(userResult)
- }
- return fromPromise(userResult)
- }
- function runRawLoad(pendingDeferred, store, userFuncOptions, continuation) {
- if (store.__rawData) {
- continuation(store.__rawData)
- } else {
- var loadPromise = store.__rawDataPromise || invokeUserLoad(store, userFuncOptions);
- if (store._cacheRawData) {
- store.__rawDataPromise = loadPromise
- }
- loadPromise.always(function() {
- delete store.__rawDataPromise
- }).done(function(rawData) {
- if (store._cacheRawData) {
- store.__rawData = rawData
- }
- continuation(rawData)
- }).fail(createUserFuncFailureHandler(pendingDeferred))
- }
- }
- function runRawLoadWithQuery(pendingDeferred, store, options, countOnly) {
- options = options || {};
- var userFuncOptions = {};
- if ("userData" in options) {
- userFuncOptions.userData = options.userData
- }
- runRawLoad(pendingDeferred, store, userFuncOptions, function(rawData) {
- var rawDataQuery = arrayQuery(rawData, {
- errorHandler: store._errorHandler
- });
- var itemsQuery;
- var totalCountQuery;
- var waitList = [];
- var items;
- var totalCount;
- if (!countOnly) {
- itemsQuery = queryByOptions(rawDataQuery, options);
- if (itemsQuery === rawDataQuery) {
- items = rawData.slice(0)
- } else {
- waitList.push(itemsQuery.enumerate().done(function(asyncResult) {
- items = asyncResult
- }))
- }
- }
- if (options.requireTotalCount || countOnly) {
- totalCountQuery = queryByOptions(rawDataQuery, options, true);
- if (totalCountQuery === rawDataQuery) {
- totalCount = rawData.length
- } else {
- waitList.push(totalCountQuery.count().done(function(asyncResult) {
- totalCount = asyncResult
- }))
- }
- }
- when.apply($, waitList).done(function() {
- if (countOnly) {
- pendingDeferred.resolve(totalCount)
- } else {
- if (options.requireTotalCount) {
- pendingDeferred.resolve(items, {
- totalCount: totalCount
- })
- } else {
- pendingDeferred.resolve(items)
- }
- }
- }).fail(function(x) {
- pendingDeferred.reject(x)
- })
- })
- }
- function runRawLoadWithKey(pendingDeferred, store, key) {
- runRawLoad(pendingDeferred, store, {}, function(rawData) {
- var keyExpr = store.key();
- var item;
- for (var i = 0, len = rawData.length; i < len; i++) {
- item = rawData[i];
- if (dataUtils.keysEqual(keyExpr, store.keyOf(rawData[i]), key)) {
- pendingDeferred.resolve(item);
- return
- }
- }
- pendingDeferred.reject(errors.Error("E4009"))
- })
- }
- var CustomStore = Store.inherit({
- ctor: function(options) {
- options = options || {};
- this.callBase(options);
- this._useDefaultSearch = !!options.useDefaultSearch || "raw" === options.loadMode;
- this._loadMode = options.loadMode;
- this._cacheRawData = false !== options.cacheRawData;
- this._loadFunc = options[LOAD];
- this._totalCountFunc = options[TOTAL_COUNT];
- this._byKeyFunc = options[BY_KEY];
- this._insertFunc = options[INSERT];
- this._updateFunc = options[UPDATE];
- this._removeFunc = options[REMOVE]
- },
- createQuery: function() {
- throw errors.Error("E4010")
- },
- clearRawDataCache: function() {
- delete this.__rawData
- },
- _totalCountImpl: function(options) {
- var d = new Deferred;
- if ("raw" === this._loadMode && !this._totalCountFunc) {
- runRawLoadWithQuery(d, this, options, true)
- } else {
- invokeUserTotalCountFunc(this, options).done(function(count) {
- d.resolve(Number(count))
- }).fail(createUserFuncFailureHandler(d));
- d = this._addFailHandlers(d)
- }
- return d.promise()
- },
- _pushImpl: function(changes) {
- if (this.__rawData) {
- arrayUtils.applyBatch(this, this.__rawData, changes)
- }
- },
- _loadImpl: function(options) {
- var d = new Deferred;
- if ("raw" === this._loadMode) {
- runRawLoadWithQuery(d, this, options, false)
- } else {
- invokeUserLoad(this, options).done(function(data, extra) {
- d.resolve(data, extra)
- }).fail(createUserFuncFailureHandler(d));
- d = this._addFailHandlers(d)
- }
- return d.promise()
- },
- _byKeyImpl: function(key, extraOptions) {
- var d = new Deferred;
- if (this._byKeyViaLoad()) {
- this._requireKey();
- runRawLoadWithKey(d, this, key)
- } else {
- invokeUserByKeyFunc(this, key, extraOptions).done(function(obj) {
- d.resolve(obj)
- }).fail(createUserFuncFailureHandler(d))
- }
- return d.promise()
- },
- _byKeyViaLoad: function() {
- return "raw" === this._loadMode && !this._byKeyFunc
- },
- _insertImpl: function(values) {
- var that = this;
- var userFunc = that._insertFunc;
- var userResult;
- var d = new Deferred;
- ensureRequiredFuncOption(INSERT, userFunc);
- userResult = userFunc.apply(that, [values]);
- if (!isPromise(userResult)) {
- userResult = trivialPromise(userResult)
- }
- fromPromise(userResult).done(function(serverResponse) {
- if (config().useLegacyStoreResult) {
- d.resolve(values, serverResponse)
- } else {
- d.resolve(serverResponse || values, that.keyOf(serverResponse))
- }
- }).fail(createUserFuncFailureHandler(d));
- return d.promise()
- },
- _updateImpl: function(key, values) {
- var userFunc = this._updateFunc;
- var userResult;
- var d = new Deferred;
- ensureRequiredFuncOption(UPDATE, userFunc);
- userResult = userFunc.apply(this, [key, values]);
- if (!isPromise(userResult)) {
- userResult = trivialPromise(userResult)
- }
- fromPromise(userResult).done(function(serverResponse) {
- if (config().useLegacyStoreResult) {
- d.resolve(key, values)
- } else {
- d.resolve(serverResponse || values, key)
- }
- }).fail(createUserFuncFailureHandler(d));
- return d.promise()
- },
- _removeImpl: function(key) {
- var userFunc = this._removeFunc;
- var userResult;
- var d = new Deferred;
- ensureRequiredFuncOption(REMOVE, userFunc);
- userResult = userFunc.apply(this, [key]);
- if (!isPromise(userResult)) {
- userResult = trivialPromise()
- }
- fromPromise(userResult).done(function() {
- d.resolve(key)
- }).fail(createUserFuncFailureHandler(d));
- return d.promise()
- }
- });
- module.exports = CustomStore
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/swatch_container.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 78);
- var SWATCH_CONTAINER_CLASS_PREFIX = "dx-swatch-";
- var getSwatchContainer = function(element) {
- var $element = $(element);
- var swatchContainer = $element.closest('[class^="'.concat(SWATCH_CONTAINER_CLASS_PREFIX, '"], [class*=" ').concat(SWATCH_CONTAINER_CLASS_PREFIX, '"]'));
- var viewport = viewPortUtils.value();
- if (!swatchContainer.length) {
- return viewport
- }
- var swatchClassRegex = new RegExp("(\\s|^)(".concat(SWATCH_CONTAINER_CLASS_PREFIX, ".*?)(\\s|$)"));
- var swatchClass = swatchContainer[0].className.match(swatchClassRegex)[2];
- var viewportSwatchContainer = viewport.children("." + swatchClass);
- if (!viewportSwatchContainer.length) {
- viewportSwatchContainer = $("<div>").addClass(swatchClass).appendTo(viewport)
- }
- return viewportSwatchContainer
- };
- module.exports = {
- getSwatchContainer: getSwatchContainer
- }
- }, ,
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/localization/currency.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var numberLocalization = __webpack_require__( /*! ./number */ 51);
- numberLocalization.inject({
- _formatNumberCore: function(value, format, formatConfig) {
- if ("currency" === format) {
- formatConfig.precision = formatConfig.precision || 0;
- var result = this.format(value, extend({}, formatConfig, {
- type: "fixedpoint"
- }));
- var currencyPart = this.getCurrencySymbol().symbol.replace("$", "$$$$");
- result = result.replace(/^(\D*)(\d.*)/, "$1" + currencyPart + "$2");
- return result
- }
- return this.callBase.apply(this, arguments)
- },
- getCurrencySymbol: function() {
- return {
- symbol: "$"
- }
- },
- getOpenXmlCurrencyFormat: function() {
- return "$#,##0{0}_);\\($#,##0{0}\\)"
- }
- })
- },
- /*!**********************************************************************!*\
- !*** ./artifacts/transpiled/core/component_registrator_callbacks.js ***!
- \**********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 177);
- module.exports = new MemorizedCallbacks
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/events/pointer/base.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var eventUtils = __webpack_require__( /*! ../utils */ 8);
- var POINTER_EVENTS_NAMESPACE = "dxPointerEvents";
- var BaseStrategy = Class.inherit({
- ctor: function(eventName, originalEvents) {
- this._eventName = eventName;
- this._originalEvents = eventUtils.addNamespace(originalEvents, POINTER_EVENTS_NAMESPACE);
- this._handlerCount = 0;
- this.noBubble = this._isNoBubble()
- },
- _isNoBubble: function() {
- var eventName = this._eventName;
- return "dxpointerenter" === eventName || "dxpointerleave" === eventName
- },
- _handler: function(e) {
- var delegateTarget = this._getDelegateTarget(e);
- return this._fireEvent({
- type: this._eventName,
- pointerType: e.pointerType || eventUtils.eventSource(e),
- originalEvent: e,
- delegateTarget: delegateTarget,
- timeStamp: browser.mozilla ? (new Date).getTime() : e.timeStamp
- })
- },
- _getDelegateTarget: function(e) {
- var delegateTarget;
- if (this.noBubble) {
- delegateTarget = e.delegateTarget
- }
- return delegateTarget
- },
- _fireEvent: function(args) {
- return eventUtils.fireEvent(args)
- },
- _setSelector: function(handleObj) {
- this._selector = this.noBubble && handleObj ? handleObj.selector : null
- },
- _getSelector: function() {
- return this._selector
- },
- setup: function() {
- return true
- },
- add: function(element, handleObj) {
- if (this._handlerCount <= 0 || this.noBubble) {
- element = this.noBubble ? element : domAdapter.getDocument();
- this._setSelector(handleObj);
- var that = this;
- eventsEngine.on(element, this._originalEvents, this._getSelector(), function(e) {
- that._handler(e)
- })
- }
- if (!this.noBubble) {
- this._handlerCount++
- }
- },
- remove: function(handleObj) {
- this._setSelector(handleObj);
- if (!this.noBubble) {
- this._handlerCount--
- }
- },
- teardown: function(element) {
- if (this._handlerCount && !this.noBubble) {
- return
- }
- element = this.noBubble ? element : domAdapter.getDocument();
- if (this._originalEvents !== "." + POINTER_EVENTS_NAMESPACE) {
- eventsEngine.off(element, this._originalEvents, this._getSelector())
- }
- },
- dispose: function(element) {
- element = this.noBubble ? element : domAdapter.getDocument();
- eventsEngine.off(element, this._originalEvents)
- }
- });
- module.exports = BaseStrategy
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/data/array_query.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../core/class */ 15);
- var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
- var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter;
- var toComparable = __webpack_require__( /*! ../core/utils/data */ 20).toComparable;
- var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
- var errorsModule = __webpack_require__( /*! ./errors */ 36);
- var dataUtils = __webpack_require__( /*! ./utils */ 41);
- var Iterator = Class.inherit({
- toArray: function() {
- var result = [];
- this.reset();
- while (this.next()) {
- result.push(this.current())
- }
- return result
- },
- countable: function() {
- return false
- }
- });
- var ArrayIterator = Iterator.inherit({
- ctor: function(array) {
- this.array = array;
- this.index = -1
- },
- next: function() {
- if (this.index + 1 < this.array.length) {
- this.index++;
- return true
- }
- return false
- },
- current: function() {
- return this.array[this.index]
- },
- reset: function() {
- this.index = -1
- },
- toArray: function() {
- return this.array.slice(0)
- },
- countable: function() {
- return true
- },
- count: function() {
- return this.array.length
- }
- });
- var WrappedIterator = Iterator.inherit({
- ctor: function(iter) {
- this.iter = iter
- },
- next: function() {
- return this.iter.next()
- },
- current: function() {
- return this.iter.current()
- },
- reset: function() {
- return this.iter.reset()
- }
- });
- var MapIterator = WrappedIterator.inherit({
- ctor: function(iter, mapper) {
- this.callBase(iter);
- this.index = -1;
- this.mapper = mapper
- },
- current: function() {
- return this.mapper(this.callBase(), this.index)
- },
- next: function() {
- var hasNext = this.callBase();
- if (hasNext) {
- this.index++
- }
- return hasNext
- }
- });
- var defaultCompare = function(xValue, yValue) {
- xValue = toComparable(xValue);
- yValue = toComparable(yValue);
- if (null === xValue && null !== yValue) {
- return -1
- }
- if (null !== xValue && null === yValue) {
- return 1
- }
- if (void 0 === xValue && void 0 !== yValue) {
- return 1
- }
- if (void 0 !== xValue && void 0 === yValue) {
- return -1
- }
- if (xValue < yValue) {
- return -1
- }
- if (xValue > yValue) {
- return 1
- }
- return 0
- };
- var SortIterator = Iterator.inherit({
- ctor: function(iter, getter, desc, compare) {
- if (!(iter instanceof MapIterator)) {
- iter = new MapIterator(iter, this._wrap)
- }
- this.iter = iter;
- this.rules = [{
- getter: getter,
- desc: desc,
- compare: compare
- }]
- },
- thenBy: function(getter, desc, compare) {
- var result = new SortIterator(this.sortedIter || this.iter, getter, desc, compare);
- if (!this.sortedIter) {
- result.rules = this.rules.concat(result.rules)
- }
- return result
- },
- next: function() {
- this._ensureSorted();
- return this.sortedIter.next()
- },
- current: function() {
- this._ensureSorted();
- return this.sortedIter.current()
- },
- reset: function() {
- delete this.sortedIter
- },
- countable: function() {
- return this.sortedIter || this.iter.countable()
- },
- count: function() {
- if (this.sortedIter) {
- return this.sortedIter.count()
- }
- return this.iter.count()
- },
- _ensureSorted: function() {
- var that = this;
- if (that.sortedIter) {
- return
- }
- iteratorUtils.each(that.rules, function() {
- this.getter = compileGetter(this.getter)
- });
- that.sortedIter = new MapIterator(new ArrayIterator(this.iter.toArray().sort(function(x, y) {
- return that._compare(x, y)
- })), that._unwrap)
- },
- _wrap: function(record, index) {
- return {
- index: index,
- value: record
- }
- },
- _unwrap: function(wrappedItem) {
- return wrappedItem.value
- },
- _compare: function(x, y) {
- var xIndex = x.index;
- var yIndex = y.index;
- x = x.value;
- y = y.value;
- if (x === y) {
- return xIndex - yIndex
- }
- for (var i = 0, rulesCount = this.rules.length; i < rulesCount; i++) {
- var rule = this.rules[i];
- var xValue = rule.getter(x);
- var yValue = rule.getter(y);
- var compare = rule.compare || defaultCompare;
- var compareResult = compare(xValue, yValue);
- if (compareResult) {
- return rule.desc ? -compareResult : compareResult
- }
- }
- return xIndex - yIndex
- }
- });
- var compileCriteria = function() {
- var compileGroup = function(crit) {
- var ops = [];
- var isConjunctiveOperator = false;
- var isConjunctiveNextOperator = false;
- iteratorUtils.each(crit, function() {
- if (Array.isArray(this) || typeUtils.isFunction(this)) {
- if (ops.length > 1 && isConjunctiveOperator !== isConjunctiveNextOperator) {
- throw new errorsModule.errors.Error("E4019")
- }
- ops.push(compileCriteria(this));
- isConjunctiveOperator = isConjunctiveNextOperator;
- isConjunctiveNextOperator = true
- } else {
- isConjunctiveNextOperator = dataUtils.isConjunctiveOperator(this)
- }
- });
- return function(d) {
- var result = isConjunctiveOperator;
- for (var i = 0; i < ops.length; i++) {
- if (ops[i](d) !== isConjunctiveOperator) {
- result = !isConjunctiveOperator;
- break
- }
- }
- return result
- }
- };
- var toString = function(value) {
- return typeUtils.isDefined(value) ? value.toString() : ""
- };
- var compileBinary = function(crit) {
- crit = dataUtils.normalizeBinaryCriterion(crit);
- var getter = compileGetter(crit[0]);
- var op = crit[1];
- var value = crit[2];
- value = toComparable(value);
- switch (op.toLowerCase()) {
- case "=":
- return compileEquals(getter, value);
- case "<>":
- return compileEquals(getter, value, true);
- case ">":
- return function(obj) {
- return toComparable(getter(obj)) > value
- };
- case "<":
- return function(obj) {
- return toComparable(getter(obj)) < value
- };
- case ">=":
- return function(obj) {
- return toComparable(getter(obj)) >= value
- };
- case "<=":
- return function(obj) {
- return toComparable(getter(obj)) <= value
- };
- case "startswith":
- return function(obj) {
- return 0 === toComparable(toString(getter(obj))).indexOf(value)
- };
- case "endswith":
- return function(obj) {
- var getterValue = toComparable(toString(getter(obj)));
- var searchValue = toString(value);
- if (getterValue.length < searchValue.length) {
- return false
- }
- var index = getterValue.lastIndexOf(value);
- return index !== -1 && index === getterValue.length - value.length
- };
- case "contains":
- return function(obj) {
- return toComparable(toString(getter(obj))).indexOf(value) > -1
- };
- case "notcontains":
- return function(obj) {
- return toComparable(toString(getter(obj))).indexOf(value) === -1
- }
- }
- throw errorsModule.errors.Error("E4003", op)
- };
- function compileEquals(getter, value, negate) {
- return function(obj) {
- obj = toComparable(getter(obj));
- var result = useStrictComparison(value) ? obj === value : obj == value;
- if (negate) {
- result = !result
- }
- return result
- }
- }
- function useStrictComparison(value) {
- return "" === value || 0 === value || false === value
- }
- function compileUnary(crit) {
- var op = crit[0];
- var criteria = compileCriteria(crit[1]);
- if ("!" === op) {
- return function(obj) {
- return !criteria(obj)
- }
- }
- throw errorsModule.errors.Error("E4003", op)
- }
- return function(crit) {
- if (typeUtils.isFunction(crit)) {
- return crit
- }
- if (dataUtils.isGroupCriterion(crit)) {
- return compileGroup(crit)
- }
- if (dataUtils.isUnaryOperation(crit)) {
- return compileUnary(crit)
- }
- return compileBinary(crit)
- }
- }();
- var FilterIterator = WrappedIterator.inherit({
- ctor: function(iter, criteria) {
- this.callBase(iter);
- this.criteria = compileCriteria(criteria)
- },
- next: function() {
- while (this.iter.next()) {
- if (this.criteria(this.current())) {
- return true
- }
- }
- return false
- }
- });
- var GroupIterator = Iterator.inherit({
- ctor: function(iter, getter) {
- this.iter = iter;
- this.getter = getter
- },
- next: function() {
- this._ensureGrouped();
- return this.groupedIter.next()
- },
- current: function() {
- this._ensureGrouped();
- return this.groupedIter.current()
- },
- reset: function() {
- delete this.groupedIter
- },
- countable: function() {
- return !!this.groupedIter
- },
- count: function() {
- return this.groupedIter.count()
- },
- _ensureGrouped: function() {
- if (this.groupedIter) {
- return
- }
- var hash = {};
- var keys = [];
- var iter = this.iter;
- var getter = compileGetter(this.getter);
- iter.reset();
- while (iter.next()) {
- var current = iter.current();
- var key = getter(current);
- if (key in hash) {
- hash[key].push(current)
- } else {
- hash[key] = [current];
- keys.push(key)
- }
- }
- this.groupedIter = new ArrayIterator(iteratorUtils.map(keys, function(key) {
- return {
- key: key,
- items: hash[key]
- }
- }))
- }
- });
- var SelectIterator = WrappedIterator.inherit({
- ctor: function(iter, getter) {
- this.callBase(iter);
- this.getter = compileGetter(getter)
- },
- current: function() {
- return this.getter(this.callBase())
- },
- countable: function() {
- return this.iter.countable()
- },
- count: function() {
- return this.iter.count()
- }
- });
- var SliceIterator = WrappedIterator.inherit({
- ctor: function(iter, skip, take) {
- this.callBase(iter);
- this.skip = Math.max(0, skip);
- this.take = Math.max(0, take);
- this.pos = 0
- },
- next: function() {
- if (this.pos >= this.skip + this.take) {
- return false
- }
- while (this.pos < this.skip && this.iter.next()) {
- this.pos++
- }
- this.pos++;
- return this.iter.next()
- },
- reset: function() {
- this.callBase();
- this.pos = 0
- },
- countable: function() {
- return this.iter.countable()
- },
- count: function() {
- return Math.min(this.iter.count() - this.skip, this.take)
- }
- });
- var arrayQueryImpl = function arrayQueryImpl(iter, queryOptions) {
- queryOptions = queryOptions || {};
- if (!(iter instanceof Iterator)) {
- iter = new ArrayIterator(iter)
- }
- var handleError = function(error) {
- var handler = queryOptions.errorHandler;
- if (handler) {
- handler(error)
- }
- errorsModule._errorHandler(error)
- };
- var aggregateCore = function(aggregator) {
- var d = (new Deferred).fail(handleError);
- var seed;
- var step = aggregator.step;
- var finalize = aggregator.finalize;
- try {
- iter.reset();
- if ("seed" in aggregator) {
- seed = aggregator.seed
- } else {
- seed = iter.next() ? iter.current() : NaN
- }
- var accumulator = seed;
- while (iter.next()) {
- accumulator = step(accumulator, iter.current())
- }
- d.resolve(finalize ? finalize(accumulator) : accumulator)
- } catch (x) {
- d.reject(x)
- }
- return d.promise()
- };
- var aggregate = function(seed, step, finalize) {
- if (arguments.length < 2) {
- return aggregateCore({
- step: arguments[0]
- })
- }
- return aggregateCore({
- seed: seed,
- step: step,
- finalize: finalize
- })
- };
- var standardAggregate = function(name) {
- return aggregateCore(dataUtils.aggregators[name])
- };
- var select = function(getter) {
- if (!typeUtils.isFunction(getter) && !Array.isArray(getter)) {
- getter = [].slice.call(arguments)
- }
- return chainQuery(new SelectIterator(iter, getter))
- };
- var selectProp = function(name) {
- return select(compileGetter(name))
- };
- var chainQuery = function(iter) {
- return arrayQueryImpl(iter, queryOptions)
- };
- return {
- toArray: function() {
- return iter.toArray()
- },
- enumerate: function() {
- var d = (new Deferred).fail(handleError);
- try {
- d.resolve(iter.toArray())
- } catch (x) {
- d.reject(x)
- }
- return d.promise()
- },
- sortBy: function(getter, desc, compare) {
- return chainQuery(new SortIterator(iter, getter, desc, compare))
- },
- thenBy: function(getter, desc, compare) {
- if (iter instanceof SortIterator) {
- return chainQuery(iter.thenBy(getter, desc, compare))
- }
- throw errorsModule.errors.Error("E4004")
- },
- filter: function(criteria) {
- if (!Array.isArray(criteria)) {
- criteria = [].slice.call(arguments)
- }
- return chainQuery(new FilterIterator(iter, criteria))
- },
- slice: function(skip, take) {
- if (void 0 === take) {
- take = Number.MAX_VALUE
- }
- return chainQuery(new SliceIterator(iter, skip, take))
- },
- select: select,
- groupBy: function(getter) {
- return chainQuery(new GroupIterator(iter, getter))
- },
- aggregate: aggregate,
- count: function() {
- if (iter.countable()) {
- var d = (new Deferred).fail(handleError);
- try {
- d.resolve(iter.count())
- } catch (x) {
- d.reject(x)
- }
- return d.promise()
- }
- return standardAggregate("count")
- },
- sum: function(getter) {
- if (getter) {
- return selectProp(getter).sum()
- }
- return standardAggregate("sum")
- },
- min: function(getter) {
- if (getter) {
- return selectProp(getter).min()
- }
- return standardAggregate("min")
- },
- max: function(getter) {
- if (getter) {
- return selectProp(getter).max()
- }
- return standardAggregate("max")
- },
- avg: function(getter) {
- if (getter) {
- return selectProp(getter).avg()
- }
- return standardAggregate("avg")
- }
- }
- };
- module.exports = arrayQueryImpl
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/data/odata/query_adapter.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var config = __webpack_require__( /*! ../../core/config */ 31);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var queryAdapters = __webpack_require__( /*! ../query_adapters */ 181);
- var odataUtils = __webpack_require__( /*! ./utils */ 110);
- var serializePropName = odataUtils.serializePropName;
- var errors = __webpack_require__( /*! ../errors */ 36).errors;
- var dataUtils = __webpack_require__( /*! ../utils */ 41);
- var isFunction = typeUtils.isFunction;
- var DEFAULT_PROTOCOL_VERSION = 2;
- var compileCriteria = function() {
- var protocolVersion;
- var forceLowerCase;
- var fieldTypes;
- var createBinaryOperationFormatter = function(op) {
- return function(prop, val) {
- return prop + " " + op + " " + val
- }
- };
- var createStringFuncFormatter = function(op, reverse) {
- return function(prop, val) {
- var bag = [op, "("];
- if (forceLowerCase) {
- prop = prop.indexOf("tolower(") === -1 ? "tolower(" + prop + ")" : prop;
- val = val.toLowerCase()
- }
- if (reverse) {
- bag.push(val, ",", prop)
- } else {
- bag.push(prop, ",", val)
- }
- bag.push(")");
- return bag.join("")
- }
- };
- var formatters = {
- "=": createBinaryOperationFormatter("eq"),
- "<>": createBinaryOperationFormatter("ne"),
- ">": createBinaryOperationFormatter("gt"),
- ">=": createBinaryOperationFormatter("ge"),
- "<": createBinaryOperationFormatter("lt"),
- "<=": createBinaryOperationFormatter("le"),
- startswith: createStringFuncFormatter("startswith"),
- endswith: createStringFuncFormatter("endswith")
- };
- var formattersV2 = extend({}, formatters, {
- contains: createStringFuncFormatter("substringof", true),
- notcontains: createStringFuncFormatter("not substringof", true)
- });
- var formattersV4 = extend({}, formatters, {
- contains: createStringFuncFormatter("contains"),
- notcontains: createStringFuncFormatter("not contains")
- });
- var compileBinary = function(criteria) {
- criteria = dataUtils.normalizeBinaryCriterion(criteria);
- var op = criteria[1];
- var formatters = 4 === protocolVersion ? formattersV4 : formattersV2;
- var formatter = formatters[op.toLowerCase()];
- if (!formatter) {
- throw errors.Error("E4003", op)
- }
- var fieldName = criteria[0];
- var value = criteria[2];
- if (fieldTypes && fieldTypes[fieldName]) {
- value = odataUtils.convertPrimitiveValue(fieldTypes[fieldName], value)
- }
- return formatter(serializePropName(fieldName), odataUtils.serializeValue(value, protocolVersion))
- };
- var compileUnary = function(criteria) {
- var op = criteria[0];
- var crit = compileCore(criteria[1]);
- if ("!" === op) {
- return "not (" + crit + ")"
- }
- throw errors.Error("E4003", op)
- };
- var compileGroup = function(criteria) {
- var bag = [];
- var groupOperator;
- var nextGroupOperator;
- iteratorUtils.each(criteria, function(index, criterion) {
- if (Array.isArray(criterion)) {
- if (bag.length > 1 && groupOperator !== nextGroupOperator) {
- throw new errors.Error("E4019")
- }
- bag.push("(" + compileCore(criterion) + ")");
- groupOperator = nextGroupOperator;
- nextGroupOperator = "and"
- } else {
- nextGroupOperator = dataUtils.isConjunctiveOperator(this) ? "and" : "or"
- }
- });
- return bag.join(" " + groupOperator + " ")
- };
- var compileCore = function(criteria) {
- if (Array.isArray(criteria[0])) {
- return compileGroup(criteria)
- }
- if (dataUtils.isUnaryOperation(criteria)) {
- return compileUnary(criteria)
- }
- return compileBinary(criteria)
- };
- return function(criteria, version, types, filterToLower) {
- fieldTypes = types;
- forceLowerCase = typeUtils.isDefined(filterToLower) ? filterToLower : config().oDataFilterToLower;
- protocolVersion = version;
- return compileCore(criteria)
- }
- }();
- var createODataQueryAdapter = function(queryOptions) {
- var _sorting = [];
- var _criteria = [];
- var _expand = queryOptions.expand;
- var _select;
- var _skip;
- var _take;
- var _countQuery;
- var _oDataVersion = queryOptions.version || DEFAULT_PROTOCOL_VERSION;
- var hasSlice = function() {
- return _skip || void 0 !== _take
- };
- var hasFunction = function hasFunction(criterion) {
- for (var i = 0; i < criterion.length; i++) {
- if (isFunction(criterion[i])) {
- return true
- }
- if (Array.isArray(criterion[i]) && hasFunction(criterion[i])) {
- return true
- }
- }
- return false
- };
- var requestData = function() {
- var result = {};
- if (!_countQuery) {
- if (_sorting.length) {
- result.$orderby = _sorting.join(",")
- }
- if (_skip) {
- result.$skip = _skip
- }
- if (void 0 !== _take) {
- result.$top = _take
- }
- result.$select = odataUtils.generateSelect(_oDataVersion, _select) || void 0;
- result.$expand = odataUtils.generateExpand(_oDataVersion, _expand, _select) || void 0
- }
- if (_criteria.length) {
- var criteria = _criteria.length < 2 ? _criteria[0] : _criteria;
- var fieldTypes = queryOptions && queryOptions.fieldTypes;
- var filterToLower = queryOptions && queryOptions.filterToLower;
- result.$filter = compileCriteria(criteria, _oDataVersion, fieldTypes, filterToLower)
- }
- if (_countQuery) {
- result.$top = 0
- }
- if (queryOptions.requireTotalCount || _countQuery) {
- if (4 !== _oDataVersion) {
- result.$inlinecount = "allpages"
- } else {
- result.$count = "true"
- }
- }
- return result
- };
- function tryLiftSelect(tasks) {
- var selectIndex = -1;
- for (var i = 0; i < tasks.length; i++) {
- if ("select" === tasks[i].name) {
- selectIndex = i;
- break
- }
- }
- if (selectIndex < 0 || !isFunction(tasks[selectIndex].args[0])) {
- return
- }
- var nextTask = tasks[1 + selectIndex];
- if (!nextTask || "slice" !== nextTask.name) {
- return
- }
- tasks[1 + selectIndex] = tasks[selectIndex];
- tasks[selectIndex] = nextTask
- }
- return {
- optimize: function(tasks) {
- tryLiftSelect(tasks)
- },
- exec: function(url) {
- return odataUtils.sendRequest(_oDataVersion, {
- url: url,
- params: extend(requestData(), queryOptions && queryOptions.params)
- }, {
- beforeSend: queryOptions.beforeSend,
- jsonp: queryOptions.jsonp,
- withCredentials: queryOptions.withCredentials,
- countOnly: _countQuery,
- deserializeDates: queryOptions.deserializeDates,
- fieldTypes: queryOptions.fieldTypes,
- isPaged: isFinite(_take)
- })
- },
- multiSort: function(args) {
- var rules;
- if (hasSlice()) {
- return false
- }
- for (var i = 0; i < args.length; i++) {
- var getter = args[i][0];
- var desc = !!args[i][1];
- var rule;
- if ("string" !== typeof getter) {
- return false
- }
- rule = serializePropName(getter);
- if (desc) {
- rule += " desc"
- }
- rules = rules || [];
- rules.push(rule)
- }
- _sorting = rules
- },
- slice: function(skipCount, takeCount) {
- if (hasSlice()) {
- return false
- }
- _skip = skipCount;
- _take = takeCount
- },
- filter: function(criterion) {
- if (hasSlice()) {
- return false
- }
- if (!Array.isArray(criterion)) {
- criterion = [].slice.call(arguments)
- }
- if (hasFunction(criterion)) {
- return false
- }
- if (_criteria.length) {
- _criteria.push("and")
- }
- _criteria.push(criterion)
- },
- select: function(expr) {
- if (_select || isFunction(expr)) {
- return false
- }
- if (!Array.isArray(expr)) {
- expr = [].slice.call(arguments)
- }
- _select = expr
- },
- count: function() {
- _countQuery = true
- }
- }
- };
- queryAdapters.odata = createODataQueryAdapter;
- exports.odata = createODataQueryAdapter
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/core/version.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = "19.1.16"
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/events/gesture/emitter.gesture.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var styleUtils = __webpack_require__( /*! ../../core/utils/style */ 85);
- var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
- var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
- var ready = readyCallbacks.add;
- var mathUtils = __webpack_require__( /*! ../../core/utils/math */ 28);
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var eventUtils = __webpack_require__( /*! ../utils */ 8);
- var Emitter = __webpack_require__( /*! ../core/emitter */ 123);
- var sign = mathUtils.sign;
- var abs = Math.abs;
- var SLEEP = 0;
- var INITED = 1;
- var STARTED = 2;
- var TOUCH_BOUNDARY = 10;
- var IMMEDIATE_TOUCH_BOUNDARY = 0;
- var IMMEDIATE_TIMEOUT = 180;
- var supportPointerEvents = function() {
- return styleUtils.styleProp("pointer-events")
- };
- var setGestureCover = callOnce(function() {
- var GESTURE_COVER_CLASS = "dx-gesture-cover";
- var isDesktop = "generic" === devices.real().platform;
- if (!supportPointerEvents() || !isDesktop) {
- return noop
- }
- var $cover = $("<div>").addClass(GESTURE_COVER_CLASS).css("pointerEvents", "none");
- eventsEngine.subscribeGlobal($cover, "dxmousewheel", function(e) {
- e.preventDefault()
- });
- ready(function() {
- $cover.appendTo("body")
- });
- return function(toggle, cursor) {
- $cover.css("pointerEvents", toggle ? "all" : "none");
- toggle && $cover.css("cursor", cursor)
- }
- });
- var gestureCover = function(toggle, cursor) {
- var gestureCoverStrategy = setGestureCover();
- gestureCoverStrategy(toggle, cursor)
- };
- var GestureEmitter = Emitter.inherit({
- gesture: true,
- configure: function(data) {
- this.getElement().css("msTouchAction", data.immediate ? "pinch-zoom" : "");
- this.callBase(data)
- },
- allowInterruptionByMouseWheel: function() {
- return this._stage !== STARTED
- },
- getDirection: function() {
- return this.direction
- },
- _cancel: function() {
- this.callBase.apply(this, arguments);
- this._toggleGestureCover(false);
- this._stage = SLEEP
- },
- start: function(e) {
- if (e._needSkipEvent || eventUtils.needSkipEvent(e)) {
- this._cancel(e);
- return
- }
- this._startEvent = eventUtils.createEvent(e);
- this._startEventData = eventUtils.eventData(e);
- this._stage = INITED;
- this._init(e);
- this._setupImmediateTimer()
- },
- _setupImmediateTimer: function() {
- clearTimeout(this._immediateTimer);
- this._immediateAccepted = false;
- if (!this.immediate) {
- return
- }
- this._immediateTimer = setTimeout(function() {
- this._immediateAccepted = true
- }.bind(this), IMMEDIATE_TIMEOUT)
- },
- move: function(e) {
- if (this._stage === INITED && this._directionConfirmed(e)) {
- this._stage = STARTED;
- this._resetActiveElement();
- this._toggleGestureCover(true);
- this._clearSelection(e);
- this._adjustStartEvent(e);
- this._start(this._startEvent);
- if (this._stage === SLEEP) {
- return
- }
- this._requestAccept(e);
- this._move(e);
- this._forgetAccept()
- } else {
- if (this._stage === STARTED) {
- this._clearSelection(e);
- this._move(e)
- }
- }
- },
- _directionConfirmed: function(e) {
- var touchBoundary = this._getTouchBoundary(e);
- var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
- var deltaX = abs(delta.x);
- var deltaY = abs(delta.y);
- var horizontalMove = this._validateMove(touchBoundary, deltaX, deltaY);
- var verticalMove = this._validateMove(touchBoundary, deltaY, deltaX);
- var direction = this.getDirection(e);
- var bothAccepted = "both" === direction && (horizontalMove || verticalMove);
- var horizontalAccepted = "horizontal" === direction && horizontalMove;
- var verticalAccepted = "vertical" === direction && verticalMove;
- return bothAccepted || horizontalAccepted || verticalAccepted || this._immediateAccepted
- },
- _validateMove: function(touchBoundary, mainAxis, crossAxis) {
- return mainAxis && mainAxis >= touchBoundary && (this.immediate ? mainAxis >= crossAxis : true)
- },
- _getTouchBoundary: function(e) {
- return this.immediate || eventUtils.isDxMouseWheelEvent(e) ? IMMEDIATE_TOUCH_BOUNDARY : TOUCH_BOUNDARY
- },
- _adjustStartEvent: function(e) {
- var touchBoundary = this._getTouchBoundary(e);
- var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
- this._startEvent.pageX += sign(delta.x) * touchBoundary;
- this._startEvent.pageY += sign(delta.y) * touchBoundary
- },
- _resetActiveElement: function() {
- if ("ios" === devices.real().platform && this.getElement().find(":focus").length) {
- domUtils.resetActiveElement()
- }
- },
- _toggleGestureCover: function(toggle) {
- this._toggleGestureCoverImpl(toggle)
- },
- _toggleGestureCoverImpl: function(toggle) {
- var isStarted = this._stage === STARTED;
- if (isStarted) {
- gestureCover(toggle, this.getElement().css("cursor"))
- }
- },
- _clearSelection: function(e) {
- if (eventUtils.isDxMouseWheelEvent(e) || eventUtils.isTouchEvent(e)) {
- return
- }
- domUtils.clearSelection()
- },
- end: function(e) {
- this._toggleGestureCover(false);
- if (this._stage === STARTED) {
- this._end(e)
- } else {
- if (this._stage === INITED) {
- this._stop(e)
- }
- }
- this._stage = SLEEP
- },
- dispose: function() {
- clearTimeout(this._immediateTimer);
- this.callBase.apply(this, arguments);
- this._toggleGestureCover(false)
- },
- _init: noop,
- _start: noop,
- _move: noop,
- _stop: noop,
- _end: noop
- });
- GestureEmitter.initialTouchBoundary = TOUCH_BOUNDARY;
- GestureEmitter.touchBoundary = function(newBoundary) {
- if (isDefined(newBoundary)) {
- TOUCH_BOUNDARY = newBoundary;
- return
- }
- return TOUCH_BOUNDARY
- };
- module.exports = GestureEmitter
- }, , , , , ,
- /*!*********************************************!*\
- !*** ./artifacts/transpiled/viz/palette.js ***!
- \*********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports._DEBUG_palettes = void 0;
- var _palettes;
- exports.currentPalette = currentPalette;
- exports.generateColors = generateColors;
- exports.getPalette = getPalette;
- exports.registerPalette = registerPalette;
- exports.getAccentColor = getAccentColor;
- exports.createPalette = createPalette;
- exports.getDiscretePalette = getDiscretePalette;
- exports.getGradientPalette = getGradientPalette;
- var _utils = __webpack_require__( /*! ./core/utils */ 10);
- var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
- var _errors = __webpack_require__( /*! ../core/errors */ 21);
- var _errors2 = _interopRequireDefault(_errors);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- var _floor = Math.floor;
- var _ceil = Math.ceil;
- var _Color = __webpack_require__( /*! ../color */ 94);
- var _isArray = Array.isArray;
- var _isString = __webpack_require__( /*! ../core/utils/type */ 1).isString;
- var HIGHLIGHTING_STEP = 50;
- var DEFAULT_PALETTE = "material";
- var officePalette = {
- simpleSet: ["#5f8b95", "#ba4d51", "#af8a53", "#955f71", "#859666", "#7e688c"],
- indicatingSet: ["#a3b97c", "#e1b676", "#ec7f83"],
- gradientSet: ["#5f8b95", "#ba4d51"],
- accentColor: "#ba4d51"
- };
- var palettes = (_palettes = {}, _defineProperty(_palettes, DEFAULT_PALETTE, {
- simpleSet: ["#1db2f5", "#f5564a", "#97c95c", "#ffc720", "#eb3573", "#a63db8"],
- indicatingSet: ["#97c95c", "#ffc720", "#f5564a"],
- gradientSet: ["#1db2f5", "#97c95c"],
- accentColor: "#1db2f5"
- }), _defineProperty(_palettes, "default", officePalette), _defineProperty(_palettes, "office", officePalette), _defineProperty(_palettes, "harmony light", {
- simpleSet: ["#fcb65e", "#679ec5", "#ad79ce", "#7abd5c", "#e18e92", "#b6d623", "#b7abea", "#85dbd5"],
- indicatingSet: ["#b6d623", "#fcb65e", "#e18e92"],
- gradientSet: ["#7abd5c", "#fcb65e"],
- accentColor: "#679ec5"
- }), _defineProperty(_palettes, "soft pastel", {
- simpleSet: ["#60a69f", "#78b6d9", "#6682bb", "#a37182", "#eeba69", "#90ba58", "#456c68", "#7565a4"],
- indicatingSet: ["#90ba58", "#eeba69", "#a37182"],
- gradientSet: ["#78b6d9", "#eeba69"],
- accentColor: "#60a69f"
- }), _defineProperty(_palettes, "pastel", {
- simpleSet: ["#bb7862", "#70b3a1", "#bb626a", "#057d85", "#ab394b", "#dac599", "#153459", "#b1d2c6"],
- indicatingSet: ["#70b3a1", "#dac599", "#bb626a"],
- gradientSet: ["#bb7862", "#70b3a1"],
- accentColor: "#bb7862"
- }), _defineProperty(_palettes, "bright", {
- simpleSet: ["#70c92f", "#f8ca00", "#bd1550", "#e97f02", "#9d419c", "#7e4452", "#9ab57e", "#36a3a6"],
- indicatingSet: ["#70c92f", "#f8ca00", "#bd1550"],
- gradientSet: ["#e97f02", "#f8ca00"],
- accentColor: "#e97f02"
- }), _defineProperty(_palettes, "soft", {
- simpleSet: ["#cbc87b", "#9ab57e", "#e55253", "#7e4452", "#e8c267", "#565077", "#6babac", "#ad6082"],
- indicatingSet: ["#9ab57e", "#e8c267", "#e55253"],
- gradientSet: ["#9ab57e", "#e8c267"],
- accentColor: "#565077"
- }), _defineProperty(_palettes, "ocean", {
- simpleSet: ["#75c099", "#acc371", "#378a8a", "#5fa26a", "#064970", "#38c5d2", "#00a7c6", "#6f84bb"],
- indicatingSet: ["#c8e394", "#7bc59d", "#397c8b"],
- gradientSet: ["#acc371", "#38c5d2"],
- accentColor: "#378a8a"
- }), _defineProperty(_palettes, "vintage", {
- simpleSet: ["#dea484", "#efc59c", "#cb715e", "#eb9692", "#a85c4c", "#f2c0b5", "#c96374", "#dd956c"],
- indicatingSet: ["#ffe5c6", "#f4bb9d", "#e57660"],
- gradientSet: ["#efc59c", "#cb715e"],
- accentColor: "#cb715e"
- }), _defineProperty(_palettes, "violet", {
- simpleSet: ["#d1a1d1", "#eeacc5", "#7b5685", "#7e7cad", "#a13d73", "#5b41ab", "#e287e2", "#689cc1"],
- indicatingSet: ["#d8e2f6", "#d0b2da", "#d56a8a"],
- gradientSet: ["#eeacc5", "#7b5685"],
- accentColor: "#7b5685"
- }), _defineProperty(_palettes, "carmine", {
- simpleSet: ["#fb7764", "#73d47f", "#fed85e", "#d47683", "#dde392", "#757ab2"],
- indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"],
- gradientSet: ["#fb7764", "#73d47f"],
- accentColor: "#f05b41"
- }), _defineProperty(_palettes, "dark moon", {
- simpleSet: ["#4ddac1", "#f4c99a", "#80dd9b", "#f998b3", "#4aaaa0", "#a5aef1"],
- indicatingSet: ["#59d8a4", "#f0ad4e", "#f9517e"],
- gradientSet: ["#4ddac1", "#f4c99a"],
- accentColor: "#3debd3"
- }), _defineProperty(_palettes, "soft blue", {
- simpleSet: ["#7ab8eb", "#97da97", "#facb86", "#e78683", "#839bda", "#4db7be"],
- indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"],
- gradientSet: ["#7ab8eb", "#97da97"],
- accentColor: "#7ab8eb"
- }), _defineProperty(_palettes, "dark violet", {
- simpleSet: ["#9c63ff", "#64c064", "#eead51", "#d2504b", "#4b6bbf", "#2da7b0"],
- indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"],
- gradientSet: ["#9c63ff", "#64c064"],
- accentColor: "#9c63ff"
- }), _defineProperty(_palettes, "green mist", {
- simpleSet: ["#3cbab2", "#8ed962", "#5b9d95", "#efcc7c", "#f1929f", "#4d8dab"],
- indicatingSet: ["#72d63c", "#ffc852", "#f74a5e"],
- gradientSet: ["#3cbab2", "#8ed962"],
- accentColor: "#3cbab2"
- }), _palettes);
- var currentPaletteName;
- function currentPalette(name) {
- if (void 0 === name) {
- return currentPaletteName || DEFAULT_PALETTE
- } else {
- name = (0, _utils.normalizeEnum)(name);
- currentPaletteName = name in palettes ? name : void 0
- }
- }
- function generateColors(palette, count) {
- var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {
- keepLastColorInEnd: false
- };
- options.type = options.baseColorSet;
- options.extensionMode = options.paletteExtensionMode;
- return createPalette(palette, options).generateColors(count)
- }
- function getPalette(palette, parameters) {
- parameters = parameters || {};
- palette = selectPaletteOnSeniority(palette, parameters.themeDefault);
- var result;
- var type = parameters.type;
- if (_isArray(palette)) {
- return palette.slice(0)
- } else {
- if (_isString(palette)) {
- result = palettes[(0, _utils.normalizeEnum)(palette)]
- }
- if (!result) {
- result = palettes[currentPalette()]
- }
- }
- return type ? result[type].slice(0) : result
- }
- function registerPalette(name, palette) {
- var item = {};
- var paletteName;
- if (_isArray(palette)) {
- item.simpleSet = palette.slice(0)
- } else {
- if (palette) {
- item.simpleSet = _isArray(palette.simpleSet) ? palette.simpleSet.slice(0) : void 0;
- item.indicatingSet = _isArray(palette.indicatingSet) ? palette.indicatingSet.slice(0) : void 0;
- item.gradientSet = _isArray(palette.gradientSet) ? palette.gradientSet.slice(0) : void 0;
- item.accentColor = palette.accentColor
- }
- }
- if (!item.accentColor) {
- item.accentColor = item.simpleSet && item.simpleSet[0]
- }
- if (item.simpleSet || item.indicatingSet || item.gradientSet) {
- paletteName = (0, _utils.normalizeEnum)(name);
- (0, _extend.extend)(palettes[paletteName] = palettes[paletteName] || {}, item)
- }
- }
- function getAccentColor(palette, themeDefault) {
- palette = getPalette(palette, {
- themeDefault: themeDefault
- });
- return palette.accentColor || palette[0]
- }
- function RingBuf(buf) {
- var ind = 0;
- this.next = function() {
- var res = buf[ind++];
- if (ind === buf.length) {
- this.reset()
- }
- return res
- };
- this.reset = function() {
- ind = 0
- }
- }
- function getAlternateColorsStrategy(palette, parameters) {
- var stepHighlight = parameters.useHighlight ? HIGHLIGHTING_STEP : 0;
- var paletteSteps = new RingBuf([0, stepHighlight, -stepHighlight]);
- var currentPalette = [];
- function _reset() {
- var step = paletteSteps.next();
- currentPalette = step ? getAlteredPalette(palette, step) : palette.slice(0)
- }
- return {
- getColor: function(index) {
- var color = currentPalette[index % palette.length];
- if (index % palette.length === palette.length - 1) {
- _reset()
- }
- return color
- },
- generateColors: function(count) {
- var colors = [];
- count = count || parameters.count;
- for (var i = 0; i < count; i++) {
- colors.push(this.getColor(i))
- }
- return colors
- },
- reset: function() {
- paletteSteps.reset();
- _reset()
- }
- }
- }
- function getExtrapolateColorsStrategy(palette, parameters) {
- function convertColor(color, cycleIndex, cycleCount) {
- var hsl = new _Color(color).hsl;
- var l = hsl.l / 100;
- var diapason = cycleCount - 1 / cycleCount;
- var minL = l - .5 * diapason;
- var maxL = l + .5 * diapason;
- var cycleMiddle = (cycleCount - 1) / 2;
- var cycleDiff = cycleIndex - cycleMiddle;
- if (minL < Math.min(.5, .9 * l)) {
- minL = Math.min(.5, .9 * l)
- }
- if (maxL > Math.max(.8, l + .15 * (1 - l))) {
- maxL = Math.max(.8, l + .15 * (1 - l))
- }
- if (cycleDiff < 0) {
- l -= (minL - l) * cycleDiff / cycleMiddle
- } else {
- l += (maxL - l) * (cycleDiff / cycleMiddle)
- }
- hsl.l = 100 * l;
- return _Color.prototype.fromHSL(hsl).toHex()
- }
- return {
- getColor: function(index, count) {
- var paletteCount = palette.length;
- var cycles = _floor((count - 1) / paletteCount + 1);
- var color = palette[index % paletteCount];
- if (cycles > 1) {
- return convertColor(color, _floor(index / paletteCount), cycles)
- }
- return color
- },
- generateColors: function(count) {
- var colors = [];
- count = count || parameters.count;
- for (var i = 0; i < count; i++) {
- colors.push(this.getColor(i, count))
- }
- return colors
- },
- reset: function() {}
- }
- }
- function getColorMixer(palette, parameters) {
- var paletteCount = palette.length;
- var extendedPalette = [];
- function distributeColors(count, colorsCount, startIndex, distribution) {
- var groupSize = Math.floor(count / colorsCount);
- var extraItems = count - colorsCount * groupSize;
- var i = startIndex;
- var middleIndex;
- var size;
- while (i < startIndex + count) {
- size = groupSize;
- if (extraItems > 0) {
- size += 1;
- extraItems--
- }
- middleIndex = size > 2 ? Math.floor(size / 2) : 0;
- distribution.push(i + middleIndex);
- i += size
- }
- return distribution.sort(function(a, b) {
- return a - b
- })
- }
- function getColorAndDistance(arr, startIndex, count) {
- startIndex = (count + startIndex) % count;
- var distance = 0;
- for (var i = startIndex; i < 2 * count; i += 1) {
- var index = (count + i) % count;
- if (arr[index]) {
- return [arr[index], distance]
- }
- distance++
- }
- }
- function blendColors(paletteWithEmptyColors, paletteLength) {
- for (var i = 0; i < paletteLength; i++) {
- var color = paletteWithEmptyColors[i];
- if (!color) {
- var color1 = paletteWithEmptyColors[i - 1];
- if (!color1) {
- continue
- } else {
- var c2 = getColorAndDistance(paletteWithEmptyColors, i, paletteLength);
- var color2 = new _Color(c2[0]);
- color1 = new _Color(color1);
- for (var j = 0; j < c2[1]; j++, i++) {
- paletteWithEmptyColors[i] = color1.blend(color2, (j + 1) / (c2[1] + 1)).toHex()
- }
- }
- }
- }
- return paletteWithEmptyColors
- }
- function extendPalette(count) {
- if (count <= paletteCount) {
- return palette
- }
- var result = [];
- var colorInGroups = paletteCount - 2;
- var currentColorIndex = 0;
- var cleanColorIndices = [];
- if (parameters.keepLastColorInEnd) {
- cleanColorIndices = distributeColors(count - 2, colorInGroups, 1, [0, count - 1])
- } else {
- cleanColorIndices = distributeColors(count - 1, paletteCount - 1, 1, [0])
- }
- for (var i = 0; i < count; i++) {
- if (cleanColorIndices.indexOf(i) > -1) {
- result[i] = palette[currentColorIndex++]
- }
- }
- result = blendColors(result, count);
- return result
- }
- return {
- getColor: function(index, count) {
- count = count || parameters.count || paletteCount;
- if (extendedPalette.length !== count) {
- extendedPalette = extendPalette(count)
- }
- return extendedPalette[index % count]
- },
- generateColors: function(count, repeat) {
- count = count || parameters.count || paletteCount;
- if (repeat && count > paletteCount) {
- var colors = extendPalette(paletteCount);
- for (var i = 0; i < count - paletteCount; i++) {
- colors.push(colors[i])
- }
- return colors
- } else {
- return paletteCount > 0 ? extendPalette(count).slice(0, count) : []
- }
- },
- reset: function() {}
- }
- }
- function createPalette(palette, parameters, themeDefaultPalette) {
- var paletteObj = {
- dispose: function() {
- this._extensionStrategy = null
- },
- getNextColor: function(count) {
- return this._extensionStrategy.getColor(this._currentColor++, count)
- },
- generateColors: function(count, parameters) {
- return this._extensionStrategy.generateColors(count, (parameters || {}).repeat)
- },
- reset: function() {
- this._currentColor = 0;
- this._extensionStrategy.reset();
- return this
- }
- };
- parameters = parameters || {};
- var extensionMode = (parameters.extensionMode || "").toLowerCase();
- var colors = getPalette(palette, {
- type: parameters.type || "simpleSet",
- themeDefault: themeDefaultPalette
- });
- if ("alternate" === extensionMode) {
- paletteObj._extensionStrategy = getAlternateColorsStrategy(colors, parameters)
- } else {
- if ("extrapolate" === extensionMode) {
- paletteObj._extensionStrategy = getExtrapolateColorsStrategy(colors, parameters)
- } else {
- paletteObj._extensionStrategy = getColorMixer(colors, parameters)
- }
- }
- paletteObj.reset();
- return paletteObj
- }
- function getAlteredPalette(originalPalette, step) {
- var palette = [];
- var i;
- var ii = originalPalette.length;
- for (i = 0; i < ii; ++i) {
- palette.push(getNewColor(originalPalette[i], step))
- }
- return palette
- }
- function getNewColor(currentColor, step) {
- var newColor = new _Color(currentColor).alter(step);
- var lightness = getLightness(newColor);
- if (lightness > 200 || lightness < 55) {
- newColor = new _Color(currentColor).alter(-step / 2)
- }
- return newColor.toHex()
- }
- function getLightness(color) {
- return .3 * color.r + .59 * color.g + .11 * color.b
- }
- function getDiscretePalette(source, size, themeDefaultPalette) {
- var palette = size > 0 ? createDiscreteColors(getPalette(source, {
- type: "gradientSet",
- themeDefault: themeDefaultPalette
- }), size) : [];
- return {
- getColor: function(index) {
- return palette[index] || null
- }
- }
- }
- function createDiscreteColors(source, count) {
- var colorCount = count - 1;
- var sourceCount = source.length - 1;
- var colors = [];
- var gradient = [];
- var i;
- function addColor(pos) {
- var k = sourceCount * pos;
- var kl = _floor(k);
- var kr = _ceil(k);
- gradient.push(colors[kl].blend(colors[kr], k - kl).toHex())
- }
- for (i = 0; i <= sourceCount; ++i) {
- colors.push(new _Color(source[i]))
- }
- if (colorCount > 0) {
- for (i = 0; i <= colorCount; ++i) {
- addColor(i / colorCount)
- }
- } else {
- addColor(.5)
- }
- return gradient
- }
- function getGradientPalette(source, themeDefaultPalette) {
- var palette = getPalette(source, {
- type: "gradientSet",
- themeDefault: themeDefaultPalette
- });
- var color1 = new _Color(palette[0]);
- var color2 = new _Color(palette[1]);
- return {
- getColor: function(ratio) {
- return 0 <= ratio && ratio <= 1 ? color1.blend(color2, ratio).toHex() : null
- }
- }
- }
- function selectPaletteOnSeniority(source, themeDefaultPalette) {
- var result = source || (void 0 === currentPaletteName ? themeDefaultPalette : currentPalette());
- if ("default" === result) {
- _errors2.default.log("W0016", '"palette"', "Default", "18.1", 'Use the "Office" value instead.')
- }
- return result
- }
- exports._DEBUG_palettes = palettes
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/area_series.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
- var lineSeries = __webpack_require__( /*! ./line_series */ 203);
- var chartLineSeries = lineSeries.chart.line;
- var polarLineSeries = lineSeries.polar.line;
- var _map = __webpack_require__( /*! ../core/utils */ 10).map;
- var _extend = extend;
- var calculateBezierPoints = lineSeries.chart.spline._calculateBezierPoints;
- exports.chart = {};
- exports.polar = {};
- var baseAreaMethods = {
- _createBorderElement: chartLineSeries._createMainElement,
- _createLegendState: function(styleOptions, defaultColor) {
- return {
- fill: styleOptions.color || defaultColor,
- opacity: styleOptions.opacity,
- hatching: styleOptions.hatching
- }
- },
- getValueRangeInitialValue: function() {
- if ("logarithmic" !== this.valueAxisType && "datetime" !== this.valueType && false !== this.showZero) {
- return 0
- } else {
- return scatterSeries.getValueRangeInitialValue.call(this)
- }
- },
- _getDefaultSegment: function(segment) {
- var defaultSegment = chartLineSeries._getDefaultSegment(segment);
- defaultSegment.area = defaultSegment.line.concat(defaultSegment.line.slice().reverse());
- return defaultSegment
- },
- _updateElement: function(element, segment, animate, complete) {
- var lineParams = {
- points: segment.line
- };
- var areaParams = {
- points: segment.area
- };
- var borderElement = element.line;
- if (animate) {
- borderElement && borderElement.animate(lineParams);
- element.area.animate(areaParams, {}, complete)
- } else {
- borderElement && borderElement.attr(lineParams);
- element.area.attr(areaParams)
- }
- },
- _removeElement: function(element) {
- element.line && element.line.remove();
- element.area.remove()
- },
- _drawElement: function(segment) {
- return {
- line: this._bordersGroup && this._createBorderElement(segment.line, {
- "stroke-width": this._styles.normal.border["stroke-width"]
- }).append(this._bordersGroup),
- area: this._createMainElement(segment.area).append(this._elementsGroup)
- }
- },
- _applyStyle: function(style) {
- var that = this;
- that._elementsGroup && that._elementsGroup.smartAttr(style.elements);
- that._bordersGroup && that._bordersGroup.attr(style.border);
- (that._graphics || []).forEach(function(graphic) {
- graphic.line && graphic.line.attr({
- "stroke-width": style.border["stroke-width"]
- }).sharp()
- })
- },
- _parseStyle: function(options, defaultColor, defaultBorderColor) {
- var borderOptions = options.border || {};
- var borderStyle = chartLineSeries._parseLineOptions(borderOptions, defaultBorderColor);
- borderStyle.stroke = borderOptions.visible && borderStyle["stroke-width"] ? borderStyle.stroke : "none";
- borderStyle["stroke-width"] = borderStyle["stroke-width"] || 1;
- return {
- border: borderStyle,
- elements: {
- stroke: "none",
- fill: options.color || defaultColor,
- hatching: options.hatching,
- opacity: options.opacity
- }
- }
- },
- _areBordersVisible: function() {
- var options = this._options;
- return options.border.visible || options.hoverStyle.border.visible || options.selectionStyle.border.visible
- },
- _createMainElement: function(points, settings) {
- return this._renderer.path(points, "area").attr(settings)
- },
- _getTrackerSettings: function(segment) {
- return {
- "stroke-width": segment.singlePointSegment ? this._defaultTrackerWidth : 0
- }
- },
- _getMainPointsFromSegment: function(segment) {
- return segment.area
- }
- };
- function createAreaPoints(points) {
- return _map(points, function(pt) {
- return pt.getCoords()
- }).concat(_map(points.slice().reverse(), function(pt) {
- return pt.getCoords(true)
- }))
- }
- var areaSeries = exports.chart.area = _extend({}, chartLineSeries, baseAreaMethods, {
- _prepareSegment: function(points, rotated) {
- var that = this;
- var processedPoints = that._processSinglePointsAreaSegment(points, rotated);
- var areaPoints = createAreaPoints(processedPoints);
- var argAxis = that.getArgumentAxis();
- if (argAxis.getAxisPosition) {
- var argAxisPosition = argAxis.getAxisPosition();
- var axisOptions = argAxis.getOptions();
- var edgeOffset = (!rotated ? -1 : 1) * Math.round(axisOptions.width / 2);
- if (axisOptions.visible) {
- areaPoints.forEach(function(p, i) {
- if (p) {
- var index = 1 === points.length ? 0 : i < points.length ? i : areaPoints.length - 1 - i;
- rotated && p.x === points[index].defaultX && p.x === argAxisPosition - argAxis.getAxisShift() && (p.x += edgeOffset);
- !rotated && p.y === points[index].defaultY && p.y === argAxisPosition - argAxis.getAxisShift() && (p.y += edgeOffset)
- }
- })
- }
- }
- return {
- line: processedPoints,
- area: areaPoints,
- singlePointSegment: processedPoints !== points
- }
- },
- _processSinglePointsAreaSegment: function(points, rotated) {
- if (points && 1 === points.length) {
- var p = points[0];
- var p1 = objectUtils.clone(p);
- p1[rotated ? "y" : "x"] += 1;
- p1.argument = null;
- return [p, p1]
- }
- return points
- }
- });
- exports.polar.area = _extend({}, polarLineSeries, baseAreaMethods, {
- _prepareSegment: function(points, rotated, lastSegment) {
- lastSegment && polarLineSeries._closeSegment.call(this, points);
- return areaSeries._prepareSegment.call(this, points)
- },
- _processSinglePointsAreaSegment: function(points) {
- return lineSeries.polar.line._prepareSegment.call(this, points).line
- }
- });
- exports.chart.steparea = _extend({}, areaSeries, {
- _prepareSegment: function(points, rotated) {
- var stepLineSeries = lineSeries.chart.stepline;
- points = areaSeries._processSinglePointsAreaSegment(points, rotated);
- return areaSeries._prepareSegment.call(this, stepLineSeries._calculateStepLinePoints.call(this, points), rotated)
- },
- getSeriesPairCoord: lineSeries.chart.stepline.getSeriesPairCoord
- });
- exports.chart.splinearea = _extend({}, areaSeries, {
- _areaPointsToSplineAreaPoints: function(areaPoints) {
- var previousMiddlePoint = areaPoints[areaPoints.length / 2 - 1];
- var middlePoint = areaPoints[areaPoints.length / 2];
- areaPoints.splice(areaPoints.length / 2, 0, {
- x: previousMiddlePoint.x,
- y: previousMiddlePoint.y
- }, {
- x: middlePoint.x,
- y: middlePoint.y
- });
- if (previousMiddlePoint.defaultCoords) {
- areaPoints[areaPoints.length / 2].defaultCoords = true
- }
- if (middlePoint.defaultCoords) {
- areaPoints[areaPoints.length / 2 - 1].defaultCoords = true
- }
- },
- _prepareSegment: function(points, rotated) {
- var processedPoints = areaSeries._processSinglePointsAreaSegment(points, rotated);
- var areaSegment = areaSeries._prepareSegment.call(this, calculateBezierPoints(processedPoints, rotated));
- this._areaPointsToSplineAreaPoints(areaSegment.area);
- areaSegment.singlePointSegment = processedPoints !== points;
- return areaSegment
- },
- _getDefaultSegment: function(segment) {
- var areaDefaultSegment = areaSeries._getDefaultSegment(segment);
- this._areaPointsToSplineAreaPoints(areaDefaultSegment.area);
- return areaDefaultSegment
- },
- _createMainElement: function(points, settings) {
- return this._renderer.path(points, "bezierarea").attr(settings)
- },
- _createBorderElement: lineSeries.chart.spline._createMainElement,
- getSeriesPairCoord: lineSeries.chart.spline.getSeriesPairCoord,
- getNearestPointsByCoord: lineSeries.chart.spline.getNearestPointsByCoord,
- obtainCubicBezierTCoef: lineSeries.chart.spline.obtainCubicBezierTCoef
- })
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/node.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- function Node() {}
- _extend(Node.prototype, {
- value: 0,
- isNode: function() {
- return !!(this.nodes && this.level < this.ctx.maxLevel)
- },
- isActive: function() {
- var ctx = this.ctx;
- return this.level >= ctx.minLevel && this.level <= ctx.maxLevel
- },
- updateStyles: function() {
- var that = this;
- var isNode = Number(that.isNode());
- that.state = that._buildState(that.ctx.settings[isNode].state, !isNode && that.color && {
- fill: that.color
- })
- },
- _buildState: function(state, extra) {
- var base = _extend({}, state);
- return extra ? _extend(base, extra) : base
- },
- updateLabelStyle: function() {
- var settings = this.ctx.settings[Number(this.isNode())];
- this.labelState = settings.labelState;
- this.labelParams = settings.labelParams
- },
- _getState: function() {
- return this.state
- },
- applyState: function() {
- updateTile[Number(this.isNode())](this.tile, this._getState())
- }
- });
- var updateTile = [updateLeaf, updateGroup];
- function updateLeaf(content, attrs) {
- content.smartAttr(attrs)
- }
- function updateGroup(content, attrs) {
- content.outer.attr({
- stroke: attrs.stroke,
- "stroke-width": attrs["stroke-width"],
- "stroke-opacity": attrs["stroke-opacity"]
- });
- content.inner.smartAttr({
- fill: attrs.fill,
- opacity: attrs.opacity,
- hatching: attrs.hatching
- })
- }
- module.exports = Node
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/ui.keyboard_processor.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _class = __webpack_require__( /*! ../../core/class */ 15);
- var _class2 = _interopRequireDefault(_class);
- var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
- var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var _utils = __webpack_require__( /*! ../../events/utils */ 8);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var COMPOSITION_START_EVENT = "compositionstart";
- var COMPOSITION_END_EVENT = "compositionend";
- var KEYDOWN_EVENT = "keydown";
- var NAMESPACE = "KeyboardProcessor";
- var KeyboardProcessor = _class2.default.inherit({
- _keydown: (0, _utils.addNamespace)(KEYDOWN_EVENT, NAMESPACE),
- _compositionStart: (0, _utils.addNamespace)(COMPOSITION_START_EVENT, NAMESPACE),
- _compositionEnd: (0, _utils.addNamespace)(COMPOSITION_END_EVENT, NAMESPACE),
- ctor: function(options) {
- var _this = this;
- options = options || {};
- if (options.element) {
- this._element = (0, _renderer2.default)(options.element)
- }
- if (options.focusTarget) {
- this._focusTarget = options.focusTarget
- }
- this._handler = options.handler;
- this._context = options.context;
- this._childProcessors = [];
- if (this._element) {
- this._processFunction = function(e) {
- var isNotFocusTarget = _this._focusTarget && _this._focusTarget !== e.target && (0, _array.inArray)(e.target, _this._focusTarget) < 0;
- var shouldSkipProcessing = _this._isComposingJustFinished && 229 === e.which || _this._isComposing || isNotFocusTarget;
- _this._isComposingJustFinished = false;
- if (!shouldSkipProcessing) {
- _this.process(e)
- }
- };
- this._toggleProcessingWithContext = this.toggleProcessing.bind(this);
- _events_engine2.default.on(this._element, this._keydown, this._processFunction);
- _events_engine2.default.on(this._element, this._compositionStart, this._toggleProcessingWithContext);
- _events_engine2.default.on(this._element, this._compositionEnd, this._toggleProcessingWithContext)
- }
- },
- dispose: function() {
- if (this._element) {
- _events_engine2.default.off(this._element, this._keydown, this._processFunction);
- _events_engine2.default.off(this._element, this._compositionStart, this._toggleProcessingWithContext);
- _events_engine2.default.off(this._element, this._compositionEnd, this._toggleProcessingWithContext)
- }
- this._element = void 0;
- this._handler = void 0;
- this._context = void 0;
- this._childProcessors = void 0
- },
- clearChildren: function() {
- this._childProcessors = []
- },
- push: function(child) {
- if (!this._childProcessors) {
- this.clearChildren()
- }
- this._childProcessors.push(child);
- return child
- },
- attachChildProcessor: function() {
- var childProcessor = new KeyboardProcessor;
- this._childProcessors.push(childProcessor);
- return childProcessor
- },
- reinitialize: function(childHandler, childContext) {
- this._context = childContext;
- this._handler = childHandler;
- return this
- },
- process: function(e) {
- var args = {
- keyName: (0, _utils.normalizeKeyName)(e),
- key: e.key,
- code: e.code,
- ctrl: e.ctrlKey,
- location: e.location,
- metaKey: e.metaKey,
- shift: e.shiftKey,
- alt: e.altKey,
- which: e.which,
- originalEvent: e
- };
- var handlerResult = this._handler && this._handler.call(this._context, args);
- if (handlerResult && this._childProcessors) {
- (0, _iterator.each)(this._childProcessors, function(index, childProcessor) {
- childProcessor.process(e)
- })
- }
- },
- toggleProcessing: function(_ref) {
- var type = _ref.type;
- this._isComposing = type === COMPOSITION_START_EVENT;
- this._isComposingJustFinished = !this._isComposing
- }
- });
- module.exports = KeyboardProcessor
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/events/contextmenu.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var support = __webpack_require__( /*! ../core/utils/support */ 43);
- var devices = __webpack_require__( /*! ../core/devices */ 16);
- var Class = __webpack_require__( /*! ../core/class */ 15);
- var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var holdEvent = __webpack_require__( /*! ./hold */ 88);
- var CONTEXTMENU_NAMESPACE = "dxContexMenu";
- var CONTEXTMENU_NAMESPACED_EVENT_NAME = eventUtils.addNamespace("contextmenu", CONTEXTMENU_NAMESPACE);
- var HOLD_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(holdEvent.name, CONTEXTMENU_NAMESPACE);
- var CONTEXTMENU_EVENT_NAME = "dxcontextmenu";
- var ContextMenu = Class.inherit({
- setup: function(element) {
- var $element = $(element);
- eventsEngine.on($element, CONTEXTMENU_NAMESPACED_EVENT_NAME, this._contextMenuHandler.bind(this));
- if (support.touch || devices.isSimulator()) {
- eventsEngine.on($element, HOLD_NAMESPACED_EVENT_NAME, this._holdHandler.bind(this))
- }
- },
- _holdHandler: function(e) {
- if (eventUtils.isMouseEvent(e) && !devices.isSimulator()) {
- return
- }
- this._fireContextMenu(e)
- },
- _contextMenuHandler: function(e) {
- this._fireContextMenu(e)
- },
- _fireContextMenu: function(e) {
- return eventUtils.fireEvent({
- type: CONTEXTMENU_EVENT_NAME,
- originalEvent: e
- })
- },
- teardown: function(element) {
- eventsEngine.off(element, "." + CONTEXTMENU_NAMESPACE)
- }
- });
- registerEvent(CONTEXTMENU_EVENT_NAME, new ContextMenu);
- exports.name = CONTEXTMENU_EVENT_NAME
- }, ,
- /*!******************************************!*\
- !*** ./artifacts/transpiled/exporter.js ***!
- \******************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var fileSaver = __webpack_require__( /*! ./exporter/file_saver */ 207).fileSaver;
- var excelCreator = __webpack_require__( /*! ./exporter/excel_creator */ 431);
- var imageCreator = __webpack_require__( /*! ./exporter/image_creator */ 262);
- var svgCreator = __webpack_require__( /*! ./exporter/svg_creator */ 438);
- var _isFunction = __webpack_require__( /*! ./core/utils/type */ 1).isFunction;
- var Deferred = __webpack_require__( /*! ./core/utils/deferred */ 6).Deferred;
- exports.export = function(data, options, getData) {
- if (!data) {
- return (new Deferred).resolve()
- }
- var exportingAction = options.exportingAction;
- var exportedAction = options.exportedAction;
- var fileSavingAction = options.fileSavingAction;
- var eventArgs = {
- fileName: options.fileName,
- format: options.format,
- cancel: false
- };
- _isFunction(exportingAction) && exportingAction(eventArgs);
- if (!eventArgs.cancel) {
- return getData(data, options, function(blob) {
- _isFunction(exportedAction) && exportedAction();
- if (_isFunction(fileSavingAction)) {
- eventArgs.data = blob;
- fileSavingAction(eventArgs)
- }
- if (!eventArgs.cancel) {
- fileSaver.saveAs(eventArgs.fileName, options.format, blob, options.proxyUrl, options.forceProxy)
- }
- })
- }
- return (new Deferred).resolve()
- };
- exports.fileSaver = fileSaver;
- exports.excel = {
- creator: excelCreator.ExcelCreator,
- getData: excelCreator.getData,
- formatConverter: __webpack_require__( /*! ./exporter/excel_format_converter */ 178)
- };
- exports.excel.__internals = excelCreator.__internals;
- exports.image = {
- creator: imageCreator.imageCreator,
- getData: imageCreator.getData,
- testFormats: imageCreator.testFormats
- };
- exports.pdf = {
- getData: __webpack_require__( /*! ./exporter/pdf_creator */ 440).getData
- };
- exports.svg = {
- creator: svgCreator.svgCreator,
- getData: svgCreator.getData
- }
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/core/utils/size.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow();
- var typeUtils = __webpack_require__( /*! ../utils/type */ 1);
- var SPECIAL_HEIGHT_VALUES = ["auto", "none", "inherit", "initial"];
- var getSizeByStyles = function(elementStyles, styles) {
- var result = 0;
- styles.forEach(function(style) {
- result += parseFloat(elementStyles[style]) || 0
- });
- return result
- };
- var getElementBoxParams = function(name, elementStyles) {
- var beforeName = "width" === name ? "Left" : "Top";
- var afterName = "width" === name ? "Right" : "Bottom";
- return {
- padding: getSizeByStyles(elementStyles, ["padding" + beforeName, "padding" + afterName]),
- border: getSizeByStyles(elementStyles, ["border" + beforeName + "Width", "border" + afterName + "Width"]),
- margin: getSizeByStyles(elementStyles, ["margin" + beforeName, "margin" + afterName])
- }
- };
- var getBoxSizingOffset = function(name, elementStyles, boxParams) {
- var size = elementStyles[name];
- if ("border-box" === elementStyles.boxSizing && size.length && "%" !== size[size.length - 1]) {
- return boxParams.border + boxParams.padding
- }
- return 0
- };
- var getSize = function(element, name, include) {
- var elementStyles = window.getComputedStyle(element);
- var boxParams = getElementBoxParams(name, elementStyles);
- var clientRect = element.getClientRects().length;
- var boundingClientRect = element.getBoundingClientRect()[name];
- var result = clientRect ? boundingClientRect : 0;
- if (result <= 0) {
- result = parseFloat(elementStyles[name] || element.style[name]) || 0;
- result -= getBoxSizingOffset(name, elementStyles, boxParams)
- } else {
- result -= boxParams.padding + boxParams.border
- }
- if (include.paddings) {
- result += boxParams.padding
- }
- if (include.borders) {
- result += boxParams.border
- }
- if (include.margins) {
- result += boxParams.margin
- }
- return result
- };
- var getContainerHeight = function(container) {
- return typeUtils.isWindow(container) ? container.innerHeight : container.offsetHeight
- };
- var parseHeight = function(value, container) {
- if (value.indexOf("px") > 0) {
- value = parseInt(value.replace("px", ""))
- } else {
- if (value.indexOf("%") > 0) {
- value = parseInt(value.replace("%", "")) * getContainerHeight(container) / 100
- } else {
- if (!isNaN(value)) {
- value = parseInt(value)
- }
- }
- }
- return value
- };
- var getHeightWithOffset = function(value, offset, container) {
- if (!value) {
- return null
- }
- if (SPECIAL_HEIGHT_VALUES.indexOf(value) > -1) {
- return offset ? null : value
- }
- if (typeUtils.isString(value)) {
- value = parseHeight(value, container)
- }
- if (typeUtils.isNumeric(value)) {
- return Math.max(0, value + offset)
- }
- var operationString = offset < 0 ? " - " : " ";
- return "calc(" + value + operationString + Math.abs(offset) + "px)"
- };
- var addOffsetToMaxHeight = function(value, offset, container) {
- var maxHeight = getHeightWithOffset(value, offset, container);
- return null !== maxHeight ? maxHeight : "none"
- };
- var addOffsetToMinHeight = function(value, offset, container) {
- var minHeight = getHeightWithOffset(value, offset, container);
- return null !== minHeight ? minHeight : 0
- };
- var getVerticalOffsets = function(element, withMargins) {
- if (!element) {
- return 0
- }
- var boxParams = getElementBoxParams("height", window.getComputedStyle(element));
- return boxParams.padding + boxParams.border + (withMargins ? boxParams.margin : 0)
- };
- var getVisibleHeight = function(element) {
- if (element) {
- var boundingClientRect = element.getBoundingClientRect();
- if (boundingClientRect.height) {
- return boundingClientRect.height
- }
- }
- return 0
- };
- exports.getSize = getSize;
- exports.getElementBoxParams = getElementBoxParams;
- exports.addOffsetToMaxHeight = addOffsetToMaxHeight;
- exports.addOffsetToMinHeight = addOffsetToMinHeight;
- exports.getVerticalOffsets = getVerticalOffsets;
- exports.getVisibleHeight = getVisibleHeight;
- exports.parseHeight = parseHeight
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/ui/validation/validation_mixin.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var ValidationMixin = {
- _findGroup: function() {
- var group = this.option("validationGroup");
- var $dxGroup;
- if (!group) {
- $dxGroup = this.$element().parents(".dx-validationgroup").first();
- if ($dxGroup.length) {
- group = $dxGroup.dxValidationGroup("instance")
- } else {
- group = this._modelByElement(this.$element())
- }
- }
- return group
- }
- };
- module.exports = ValidationMixin
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/ui/resizable.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
- var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
- var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
- var translator = __webpack_require__( /*! ../animation/translator */ 27);
- var fitIntoRange = __webpack_require__( /*! ../core/utils/math */ 28).fitIntoRange;
- var DOMComponent = __webpack_require__( /*! ../core/dom_component */ 67);
- var eventUtils = __webpack_require__( /*! ../events/utils */ 8);
- var dragEvents = __webpack_require__( /*! ../events/drag */ 56);
- var isPlainObject = typeUtils.isPlainObject;
- var isFunction = typeUtils.isFunction;
- var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
- var RESIZABLE = "dxResizable";
- var RESIZABLE_CLASS = "dx-resizable";
- var RESIZABLE_RESIZING_CLASS = "dx-resizable-resizing";
- var RESIZABLE_HANDLE_CLASS = "dx-resizable-handle";
- var RESIZABLE_HANDLE_TOP_CLASS = "dx-resizable-handle-top";
- var RESIZABLE_HANDLE_BOTTOM_CLASS = "dx-resizable-handle-bottom";
- var RESIZABLE_HANDLE_LEFT_CLASS = "dx-resizable-handle-left";
- var RESIZABLE_HANDLE_RIGHT_CLASS = "dx-resizable-handle-right";
- var RESIZABLE_HANDLE_CORNER_CLASS = "dx-resizable-handle-corner";
- var DRAGSTART_START_EVENT_NAME = eventUtils.addNamespace(dragEvents.start, RESIZABLE);
- var DRAGSTART_EVENT_NAME = eventUtils.addNamespace(dragEvents.move, RESIZABLE);
- var DRAGSTART_END_EVENT_NAME = eventUtils.addNamespace(dragEvents.end, RESIZABLE);
- var SIDE_BORDER_WIDTH_STYLES = {
- left: "borderLeftWidth",
- top: "borderTopWidth",
- right: "borderRightWidth",
- bottom: "borderBottomWidth"
- };
- var Resizable = DOMComponent.inherit({
- _getDefaultOptions: function() {
- return extend(this.callBase(), {
- handles: "all",
- step: "1",
- stepPrecision: "simple",
- area: void 0,
- minWidth: 30,
- maxWidth: 1 / 0,
- minHeight: 30,
- maxHeight: 1 / 0,
- onResizeStart: null,
- onResize: null,
- onResizeEnd: null,
- roundStepValue: true
- })
- },
- _init: function() {
- this.callBase();
- this.$element().addClass(RESIZABLE_CLASS)
- },
- _initMarkup: function() {
- this.callBase();
- this._renderHandles()
- },
- _render: function() {
- this.callBase();
- this._renderActions()
- },
- _renderActions: function() {
- this._resizeStartAction = this._createActionByOption("onResizeStart");
- this._resizeEndAction = this._createActionByOption("onResizeEnd");
- this._resizeAction = this._createActionByOption("onResize")
- },
- _renderHandles: function() {
- var handles = this.option("handles");
- if ("none" === handles) {
- return
- }
- var directions = "all" === handles ? ["top", "bottom", "left", "right"] : handles.split(" ");
- each(directions, function(index, handleName) {
- this._renderHandle(handleName)
- }.bind(this));
- inArray("bottom", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-bottom-right");
- inArray("bottom", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-bottom-left");
- inArray("top", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-top-right");
- inArray("top", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-top-left")
- },
- _renderHandle: function(handleName) {
- var $element = this.$element();
- var $handle = $("<div>");
- $handle.addClass(RESIZABLE_HANDLE_CLASS).addClass(RESIZABLE_HANDLE_CLASS + "-" + handleName).appendTo($element);
- this._attachEventHandlers($handle)
- },
- _attachEventHandlers: function($handle) {
- if (this.option("disabled")) {
- return
- }
- var handlers = {};
- handlers[DRAGSTART_START_EVENT_NAME] = this._dragStartHandler.bind(this);
- handlers[DRAGSTART_EVENT_NAME] = this._dragHandler.bind(this);
- handlers[DRAGSTART_END_EVENT_NAME] = this._dragEndHandler.bind(this);
- eventsEngine.on($handle, handlers, {
- direction: "both",
- immediate: true
- })
- },
- _dragStartHandler: function(e) {
- var $element = this.$element();
- if ($element.is(".dx-state-disabled, .dx-state-disabled *")) {
- e.cancel = true;
- return
- }
- this._toggleResizingClass(true);
- this._movingSides = this._getMovingSides(e);
- this._elementLocation = translator.locate($element);
- var elementRect = $element.get(0).getBoundingClientRect();
- this._elementSize = {
- width: elementRect.width,
- height: elementRect.height
- };
- this._renderDragOffsets(e);
- this._resizeStartAction({
- event: e,
- width: this._elementSize.width,
- height: this._elementSize.height,
- handles: this._movingSides
- });
- e.targetElements = null
- },
- _toggleResizingClass: function(value) {
- this.$element().toggleClass(RESIZABLE_RESIZING_CLASS, value)
- },
- _renderDragOffsets: function(e) {
- var area = this._getArea();
- if (!area) {
- return
- }
- var $handle = $(e.target).closest("." + RESIZABLE_HANDLE_CLASS);
- var handleWidth = $handle.outerWidth();
- var handleHeight = $handle.outerHeight();
- var handleOffset = $handle.offset();
- var areaOffset = area.offset;
- var scrollOffset = this._getAreaScrollOffset();
- e.maxLeftOffset = handleOffset.left - areaOffset.left - scrollOffset.scrollX;
- e.maxRightOffset = areaOffset.left + area.width - handleOffset.left - handleWidth + scrollOffset.scrollX;
- e.maxTopOffset = handleOffset.top - areaOffset.top - scrollOffset.scrollY;
- e.maxBottomOffset = areaOffset.top + area.height - handleOffset.top - handleHeight + scrollOffset.scrollY
- },
- _getBorderWidth: function($element, direction) {
- if (typeUtils.isWindow($element.get(0))) {
- return 0
- }
- var borderWidth = $element.css(SIDE_BORDER_WIDTH_STYLES[direction]);
- return parseInt(borderWidth) || 0
- },
- _dragHandler: function(e) {
- var $element = this.$element();
- var sides = this._movingSides;
- var location = this._elementLocation;
- var size = this._elementSize;
- var offset = this._getOffset(e);
- var width = size.width + offset.x * (sides.left ? -1 : 1);
- var height = size.height + offset.y * (sides.top ? -1 : 1);
- if (offset.x || "strict" === this.option("stepPrecision")) {
- this._renderWidth(width)
- }
- if (offset.y || "strict" === this.option("stepPrecision")) {
- this._renderHeight(height)
- }
- var elementRect = $element.get(0).getBoundingClientRect();
- var offsetTop = offset.y - ((elementRect.height || height) - height);
- var offsetLeft = offset.x - ((elementRect.width || width) - width);
- translator.move($element, {
- top: location.top + (sides.top ? offsetTop : 0),
- left: location.left + (sides.left ? offsetLeft : 0)
- });
- this._resizeAction({
- event: e,
- width: this.option("width") || width,
- height: this.option("height") || height,
- handles: this._movingSides
- });
- domUtils.triggerResizeEvent($element)
- },
- _getOffset: function(e) {
- var offset = e.offset;
- var steps = commonUtils.pairToObject(this.option("step"), !this.option("roundStepValue"));
- var sides = this._getMovingSides(e);
- var strictPrecision = "strict" === this.option("stepPrecision");
- if (!sides.left && !sides.right) {
- offset.x = 0
- }
- if (!sides.top && !sides.bottom) {
- offset.y = 0
- }
- return strictPrecision ? this._getStrictOffset(offset, steps, sides) : this._getSimpleOffset(offset, steps)
- },
- _getSimpleOffset: function(offset, steps) {
- return {
- x: offset.x - offset.x % steps.h,
- y: offset.y - offset.y % steps.v
- }
- },
- _getStrictOffset: function(offset, steps, sides) {
- var location = this._elementLocation;
- var size = this._elementSize;
- var xPos = sides.left ? location.left : location.left + size.width;
- var yPos = sides.top ? location.top : location.top + size.height;
- var newXShift = (xPos + offset.x) % steps.h;
- var newYShift = (yPos + offset.y) % steps.v;
- var sign = Math.sign || function(x) {
- x = +x;
- if (0 === x || isNaN(x)) {
- return x
- }
- return x > 0 ? 1 : -1
- };
- var separatorOffset = function(steps, offset) {
- return (1 + .2 * sign(offset)) % 1 * steps
- };
- var isSmallOffset = function(offset, steps) {
- return Math.abs(offset) < .2 * steps
- };
- var newOffsetX = offset.x - newXShift;
- var newOffsetY = offset.y - newYShift;
- if (newXShift > separatorOffset(steps.h, offset.x)) {
- newOffsetX += steps.h
- }
- if (newYShift > separatorOffset(steps.v, offset.y)) {
- newOffsetY += steps.v
- }
- return {
- x: (sides.left || sides.right) && !isSmallOffset(offset.x, steps.h) ? newOffsetX : 0,
- y: (sides.top || sides.bottom) && !isSmallOffset(offset.y, steps.v) ? newOffsetY : 0
- }
- },
- _getMovingSides: function(e) {
- var $target = $(e.target);
- var hasCornerTopLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-left");
- var hasCornerTopRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-right");
- var hasCornerBottomLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-left");
- var hasCornerBottomRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-right");
- return {
- top: $target.hasClass(RESIZABLE_HANDLE_TOP_CLASS) || hasCornerTopLeftClass || hasCornerTopRightClass,
- left: $target.hasClass(RESIZABLE_HANDLE_LEFT_CLASS) || hasCornerTopLeftClass || hasCornerBottomLeftClass,
- bottom: $target.hasClass(RESIZABLE_HANDLE_BOTTOM_CLASS) || hasCornerBottomLeftClass || hasCornerBottomRightClass,
- right: $target.hasClass(RESIZABLE_HANDLE_RIGHT_CLASS) || hasCornerTopRightClass || hasCornerBottomRightClass
- }
- },
- _getArea: function() {
- var area = this.option("area");
- if (isFunction(area)) {
- area = area.call(this)
- }
- if (isPlainObject(area)) {
- return this._getAreaFromObject(area)
- }
- return this._getAreaFromElement(area)
- },
- _getAreaScrollOffset: function() {
- var area = this.option("area");
- var isElement = !isFunction(area) && !isPlainObject(area);
- var scrollOffset = {
- scrollY: 0,
- scrollX: 0
- };
- if (isElement) {
- var areaElement = $(area)[0];
- if (typeUtils.isWindow(areaElement)) {
- scrollOffset.scrollX = areaElement.pageXOffset;
- scrollOffset.scrollY = areaElement.pageYOffset
- }
- }
- return scrollOffset
- },
- _getAreaFromObject: function(area) {
- var result = {
- width: area.right - area.left,
- height: area.bottom - area.top,
- offset: {
- left: area.left,
- top: area.top
- }
- };
- this._correctAreaGeometry(result);
- return result
- },
- _getAreaFromElement: function(area) {
- var $area = $(area);
- var result;
- if ($area.length) {
- result = {
- width: $area.innerWidth(),
- height: $area.innerHeight(),
- offset: extend({
- top: 0,
- left: 0
- }, typeUtils.isWindow($area[0]) ? {} : $area.offset())
- };
- this._correctAreaGeometry(result, $area)
- }
- return result
- },
- _correctAreaGeometry: function(result, $area) {
- var areaBorderLeft = $area ? this._getBorderWidth($area, "left") : 0;
- var areaBorderTop = $area ? this._getBorderWidth($area, "top") : 0;
- result.offset.left += areaBorderLeft + this._getBorderWidth(this.$element(), "left");
- result.offset.top += areaBorderTop + this._getBorderWidth(this.$element(), "top");
- result.width -= this.$element().outerWidth() - this.$element().innerWidth();
- result.height -= this.$element().outerHeight() - this.$element().innerHeight()
- },
- _dragEndHandler: function(e) {
- var $element = this.$element();
- this._resizeEndAction({
- event: e,
- width: $element.outerWidth(),
- height: $element.outerHeight(),
- handles: this._movingSides
- });
- this._toggleResizingClass(false)
- },
- _renderWidth: function(width) {
- this.option("width", fitIntoRange(width, this.option("minWidth"), this.option("maxWidth")))
- },
- _renderHeight: function(height) {
- this.option("height", fitIntoRange(height, this.option("minHeight"), this.option("maxHeight")))
- },
- _optionChanged: function(args) {
- switch (args.name) {
- case "disabled":
- case "handles":
- this._invalidate();
- break;
- case "minWidth":
- case "maxWidth":
- windowUtils.hasWindow() && this._renderWidth(this.$element().outerWidth());
- break;
- case "minHeight":
- case "maxHeight":
- windowUtils.hasWindow() && this._renderHeight(this.$element().outerHeight());
- break;
- case "onResize":
- case "onResizeStart":
- case "onResizeEnd":
- this._renderActions();
- break;
- case "area":
- case "stepPrecision":
- case "step":
- case "roundStepValue":
- break;
- default:
- this.callBase(args)
- }
- },
- _clean: function() {
- this.$element().find("." + RESIZABLE_HANDLE_CLASS).remove()
- }
- });
- registerComponent(RESIZABLE, Resizable);
- module.exports = Resizable
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/events/swipe.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 158);
- var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
- var SWIPE_START_EVENT = "dxswipestart";
- var SWIPE_EVENT = "dxswipe";
- var SWIPE_END_EVENT = "dxswipeend";
- var HorizontalStrategy = {
- defaultItemSizeFunc: function() {
- return this.getElement().width()
- },
- getBounds: function() {
- return [this._maxLeftOffset, this._maxRightOffset]
- },
- calcOffsetRatio: function(e) {
- var endEventData = eventUtils.eventData(e);
- return (endEventData.x - (this._savedEventData && this._savedEventData.x || 0)) / this._itemSizeFunc().call(this, e)
- },
- isFastSwipe: function(e) {
- var endEventData = eventUtils.eventData(e);
- return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.x - this._tickData.x) >= endEventData.time - this._tickData.time
- }
- };
- var VerticalStrategy = {
- defaultItemSizeFunc: function() {
- return this.getElement().height()
- },
- getBounds: function() {
- return [this._maxTopOffset, this._maxBottomOffset]
- },
- calcOffsetRatio: function(e) {
- var endEventData = eventUtils.eventData(e);
- return (endEventData.y - (this._savedEventData && this._savedEventData.y || 0)) / this._itemSizeFunc().call(this, e)
- },
- isFastSwipe: function(e) {
- var endEventData = eventUtils.eventData(e);
- return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.y - this._tickData.y) >= endEventData.time - this._tickData.time
- }
- };
- var STRATEGIES = {
- horizontal: HorizontalStrategy,
- vertical: VerticalStrategy
- };
- var SwipeEmitter = GestureEmitter.inherit({
- TICK_INTERVAL: 300,
- FAST_SWIPE_SPEED_LIMIT: 10,
- ctor: function(element) {
- this.callBase(element);
- this.direction = "horizontal";
- this.elastic = true
- },
- _getStrategy: function() {
- return STRATEGIES[this.direction]
- },
- _defaultItemSizeFunc: function() {
- return this._getStrategy().defaultItemSizeFunc.call(this)
- },
- _itemSizeFunc: function() {
- return this.itemSizeFunc || this._defaultItemSizeFunc
- },
- _init: function(e) {
- this._tickData = eventUtils.eventData(e)
- },
- _start: function(e) {
- this._savedEventData = eventUtils.eventData(e);
- e = this._fireEvent(SWIPE_START_EVENT, e);
- if (!e.cancel) {
- this._maxLeftOffset = e.maxLeftOffset;
- this._maxRightOffset = e.maxRightOffset;
- this._maxTopOffset = e.maxTopOffset;
- this._maxBottomOffset = e.maxBottomOffset
- }
- },
- _move: function(e) {
- var strategy = this._getStrategy();
- var moveEventData = eventUtils.eventData(e);
- var offset = strategy.calcOffsetRatio.call(this, e);
- offset = this._fitOffset(offset, this.elastic);
- if (moveEventData.time - this._tickData.time > this.TICK_INTERVAL) {
- this._tickData = moveEventData
- }
- this._fireEvent(SWIPE_EVENT, e, {
- offset: offset
- });
- e.preventDefault()
- },
- _end: function(e) {
- var strategy = this._getStrategy();
- var offsetRatio = strategy.calcOffsetRatio.call(this, e);
- var isFast = strategy.isFastSwipe.call(this, e);
- var startOffset = offsetRatio;
- var targetOffset = this._calcTargetOffset(offsetRatio, isFast);
- startOffset = this._fitOffset(startOffset, this.elastic);
- targetOffset = this._fitOffset(targetOffset, false);
- this._fireEvent(SWIPE_END_EVENT, e, {
- offset: startOffset,
- targetOffset: targetOffset
- })
- },
- _fitOffset: function(offset, elastic) {
- var strategy = this._getStrategy();
- var bounds = strategy.getBounds.call(this);
- if (offset < -bounds[0]) {
- return elastic ? (-2 * bounds[0] + offset) / 3 : -bounds[0]
- }
- if (offset > bounds[1]) {
- return elastic ? (2 * bounds[1] + offset) / 3 : bounds[1]
- }
- return offset
- },
- _calcTargetOffset: function(offsetRatio, isFast) {
- var result;
- if (isFast) {
- result = Math.ceil(Math.abs(offsetRatio));
- if (offsetRatio < 0) {
- result = -result
- }
- } else {
- result = Math.round(offsetRatio)
- }
- return result
- }
- });
- registerEmitter({
- emitter: SwipeEmitter,
- events: [SWIPE_START_EVENT, SWIPE_EVENT, SWIPE_END_EVENT]
- });
- exports.swipe = SWIPE_EVENT;
- exports.start = SWIPE_START_EVENT;
- exports.end = SWIPE_END_EVENT
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/renderers/renderer.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _dom_adapter = __webpack_require__( /*! ../../../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _window = __webpack_require__( /*! ../../../core/utils/window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _call_once = __webpack_require__( /*! ../../../core/utils/call_once */ 63);
- var _call_once2 = _interopRequireDefault(_call_once);
- var _events_engine = __webpack_require__( /*! ../../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _browser = __webpack_require__( /*! ../../../core/utils/browser */ 25);
- var _browser2 = _interopRequireDefault(_browser);
- var _svg = __webpack_require__( /*! ../../../core/utils/svg */ 209);
- var _animation = __webpack_require__( /*! ./animation */ 765);
- var _animation2 = _interopRequireDefault(_animation);
- var _utils = __webpack_require__( /*! ../utils */ 10);
- var _type = __webpack_require__( /*! ../../../core/utils/type */ 1);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return
- }
- if ("string" === typeof o) {
- return _arrayLikeToArray(o, minLen)
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if ("Object" === n && o.constructor) {
- n = o.constructor.name
- }
- if ("Map" === n || "Set" === n) {
- return Array.from(o)
- }
- if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen)
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (null == len || len > arr.length) {
- len = arr.length
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- function _iterableToArrayLimit(arr, i) {
- var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
- if (null == _i) {
- return
- }
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s, _e;
- try {
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) {
- break
- }
- }
- } catch (err) {
- _d = true;
- _e = err
- } finally {
- try {
- if (!_n && null != _i.return) {
- _i.return()
- }
- } finally {
- if (_d) {
- throw _e
- }
- }
- }
- return _arr
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) {
- return arr
- }
- }
- var window = _window2.default.getWindow();
- var max = Math.max,
- min = Math.min,
- floor = Math.floor,
- round = Math.round,
- sin = Math.sin,
- cos = Math.cos,
- abs = Math.abs,
- PI = Math.PI;
- var PI_DIV_180 = PI / 180;
- var SHARPING_CORRECTION = .5;
- var ARC_COORD_PREC = 5;
- var pxAddingExceptions = {
- "column-count": true,
- "fill-opacity": true,
- "flex-grow": true,
- "flex-shrink": true,
- "font-weight": true,
- "line-height": true,
- opacity: true,
- order: true,
- orphans: true,
- widows: true,
- "z-index": true,
- zoom: true
- };
- var KEY_TEXT = "text";
- var KEY_STROKE = "stroke";
- var KEY_STROKE_WIDTH = "stroke-width";
- var KEY_STROKE_OPACITY = "stroke-opacity";
- var KEY_FONT_SIZE = "font-size";
- var KEY_FONT_STYLE = "font-style";
- var KEY_FONT_WEIGHT = "font-weight";
- var KEY_TEXT_DECORATION = "text-decoration";
- var NONE = "none";
- var DEFAULT_FONT_SIZE = 12;
- var ELLIPSIS = "...";
- var objectCreate = function() {
- if (!Object.create) {
- return function(proto) {
- var F = function() {};
- F.prototype = proto;
- return new F
- }
- } else {
- return function(proto) {
- return Object.create(proto)
- }
- }
- }();
- var DEFAULTS = {
- scaleX: 1,
- scaleY: 1,
- "pointer-events": null
- };
- var getBackup = (0, _call_once2.default)(function() {
- var backupContainer = _dom_adapter2.default.createElement("div");
- var backupCounter = 0;
- backupContainer.style.left = "-9999px";
- backupContainer.style.position = "absolute";
- return {
- backupContainer: backupContainer,
- backupCounter: backupCounter
- }
- });
- function backupRoot(root) {
- if (0 === getBackup().backupCounter) {
- _dom_adapter2.default.getBody().appendChild(getBackup().backupContainer)
- }++getBackup().backupCounter;
- root.append({
- element: getBackup().backupContainer
- })
- }
- function restoreRoot(root, container) {
- root.append({
- element: container
- });
- --getBackup().backupCounter;
- if (0 === getBackup().backupCounter) {
- _dom_adapter2.default.getBody().removeChild(getBackup().backupContainer)
- }
- }
- var getNextDefsSvgId = function() {
- var numDefsSvgElements = 1;
- return function() {
- return "DevExpress_" + numDefsSvgElements++
- }
- }();
- function isObjectArgument(value) {
- return value && "string" !== typeof value
- }
- function createElement(tagName) {
- return _dom_adapter2.default.createElementNS("http://www.w3.org/2000/svg", tagName)
- }
- function getFuncIri(id, pathModified) {
- return null !== id ? "url(" + (pathModified ? window.location.href.split("#")[0] : "") + "#" + id + ")" : id
- }
- function extend(target, source) {
- var key;
- for (key in source) {
- target[key] = source[key]
- }
- return target
- }
- function roundValue(value, exp) {
- value = value.toString().split("e");
- value = round(+(value[0] + "e" + (value[1] ? +value[1] + exp : exp)));
- value = value.toString().split("e");
- return +(value[0] + "e" + (value[1] ? +value[1] - exp : -exp))
- }
- function getBoundingClientRect(element) {
- var box;
- try {
- box = element.getBoundingClientRect()
- } catch (e) {}
- return box || {
- left: 0,
- top: 0
- }
- }
- var preserveAspectRatioMap = {
- full: NONE,
- lefttop: "xMinYMin",
- leftcenter: "xMinYMid",
- leftbottom: "xMinYMax",
- centertop: "xMidYMin",
- center: "xMidYMid",
- centerbottom: "xMidYMax",
- righttop: "xMaxYMin",
- rightcenter: "xMaxYMid",
- rightbottom: "xMaxYMax"
- };
- function normalizeArcParams(x, y, innerR, outerR, startAngle, endAngle) {
- var isCircle;
- var noArc = true;
- var angleDiff = roundValue(endAngle, 3) - roundValue(startAngle, 3);
- if (angleDiff) {
- if (abs(angleDiff) % 360 === 0) {
- startAngle = 0;
- endAngle = 360;
- isCircle = true;
- endAngle -= .01
- }
- if (startAngle > 360) {
- startAngle %= 360
- }
- if (endAngle > 360) {
- endAngle %= 360
- }
- if (startAngle > endAngle) {
- startAngle -= 360
- }
- noArc = false
- }
- startAngle *= PI_DIV_180;
- endAngle *= PI_DIV_180;
- return [x, y, min(outerR, innerR), max(outerR, innerR), cos(startAngle), sin(startAngle), cos(endAngle), sin(endAngle), isCircle, floor(abs(endAngle - startAngle) / PI) % 2 ? "1" : "0", noArc]
- }
- var buildArcPath = function(x, y, innerR, outerR, startAngleCos, startAngleSin, endAngleCos, endAngleSin, isCircle, longFlag) {
- return ["M", (x + outerR * startAngleCos).toFixed(ARC_COORD_PREC), (y - outerR * startAngleSin).toFixed(ARC_COORD_PREC), "A", outerR.toFixed(ARC_COORD_PREC), outerR.toFixed(ARC_COORD_PREC), 0, longFlag, 0, (x + outerR * endAngleCos).toFixed(ARC_COORD_PREC), (y - outerR * endAngleSin).toFixed(ARC_COORD_PREC), isCircle ? "M" : "L", (x + innerR * endAngleCos).toFixed(5), (y - innerR * endAngleSin).toFixed(ARC_COORD_PREC), "A", innerR.toFixed(ARC_COORD_PREC), innerR.toFixed(ARC_COORD_PREC), 0, longFlag, 1, (x + innerR * startAngleCos).toFixed(ARC_COORD_PREC), (y - innerR * startAngleSin).toFixed(ARC_COORD_PREC), "Z"].join(" ")
- };
- function buildPathSegments(points, type) {
- var list = [
- ["M", 0, 0]
- ];
- switch (type) {
- case "line":
- list = buildLineSegments(points);
- break;
- case "area":
- list = buildLineSegments(points, true);
- break;
- case "bezier":
- list = buildCurveSegments(points);
- break;
- case "bezierarea":
- list = buildCurveSegments(points, true)
- }
- return list
- }
- function buildLineSegments(points, close) {
- return buildSegments(points, buildSimpleLineSegment, close)
- }
- function buildCurveSegments(points, close) {
- return buildSegments(points, buildSimpleCurveSegment, close)
- }
- function buildSegments(points, buildSimpleSegment, close) {
- var i;
- var ii;
- var list = [];
- if (points[0] && points[0].length) {
- for (i = 0, ii = points.length; i < ii; ++i) {
- buildSimpleSegment(points[i], close, list)
- }
- } else {
- buildSimpleSegment(points, close, list)
- }
- return list
- }
- function buildSimpleLineSegment(points, close, list) {
- var i = 0;
- var k0 = list.length;
- var k = k0;
- var ii = (points || []).length;
- if (ii) {
- if (void 0 !== points[0].x) {
- for (; i < ii;) {
- list[k++] = ["L", points[i].x, points[i++].y]
- }
- } else {
- for (; i < ii;) {
- list[k++] = ["L", points[i++], points[i++]]
- }
- }
- list[k0][0] = "M"
- } else {
- list[k] = ["M", 0, 0]
- }
- close && list.push(["Z"]);
- return list
- }
- function buildSimpleCurveSegment(points, close, list) {
- var i;
- var k = list.length;
- var ii = (points || []).length;
- if (ii) {
- if (void 0 !== points[0].x) {
- list[k++] = ["M", points[0].x, points[0].y];
- for (i = 1; i < ii;) {
- list[k++] = ["C", points[i].x, points[i++].y, points[i].x, points[i++].y, points[i].x, points[i++].y]
- }
- } else {
- list[k++] = ["M", points[0], points[1]];
- for (i = 2; i < ii;) {
- list[k++] = ["C", points[i++], points[i++], points[i++], points[i++], points[i++], points[i++]]
- }
- }
- } else {
- list[k] = ["M", 0, 0]
- }
- close && list.push(["Z"]);
- return list
- }
- function combinePathParam(segments) {
- var d = [];
- var k = 0;
- var i;
- var ii = segments.length;
- var segment;
- var j;
- var jj;
- for (i = 0; i < ii; ++i) {
- segment = segments[i];
- for (j = 0, jj = segment.length; j < jj; ++j) {
- d[k++] = segment[j]
- }
- }
- return d.join(" ")
- }
- function compensateSegments(oldSegments, newSegments, type) {
- var oldLength = oldSegments.length;
- var newLength = newSegments.length;
- var i;
- var originalNewSegments;
- var makeEqualSegments = type.indexOf("area") !== -1 ? makeEqualAreaSegments : makeEqualLineSegments;
- if (0 === oldLength) {
- for (i = 0; i < newLength; i++) {
- oldSegments.push(newSegments[i].slice(0))
- }
- } else {
- if (oldLength < newLength) {
- makeEqualSegments(oldSegments, newSegments, type)
- } else {
- if (oldLength > newLength) {
- originalNewSegments = newSegments.slice(0);
- makeEqualSegments(newSegments, oldSegments, type)
- }
- }
- }
- return originalNewSegments
- }
- function prepareConstSegment(constSeg, type) {
- var x = constSeg[constSeg.length - 2];
- var y = constSeg[constSeg.length - 1];
- switch (type) {
- case "line":
- case "area":
- constSeg[0] = "L";
- break;
- case "bezier":
- case "bezierarea":
- constSeg[0] = "C";
- constSeg[1] = constSeg[3] = constSeg[5] = x;
- constSeg[2] = constSeg[4] = constSeg[6] = y
- }
- }
- function makeEqualLineSegments(short, long, type) {
- var constSeg = short[short.length - 1].slice();
- var i = short.length;
- prepareConstSegment(constSeg, type);
- for (; i < long.length; i++) {
- short[i] = constSeg.slice(0)
- }
- }
- function makeEqualAreaSegments(short, long, type) {
- var i;
- var head;
- var shortLength = short.length;
- var longLength = long.length;
- var constsSeg1;
- var constsSeg2;
- if ((shortLength - 1) % 2 === 0 && (longLength - 1) % 2 === 0) {
- i = (shortLength - 1) / 2 - 1;
- head = short.slice(0, i + 1);
- constsSeg1 = head[head.length - 1].slice(0);
- constsSeg2 = short.slice(i + 1)[0].slice(0);
- prepareConstSegment(constsSeg1, type);
- prepareConstSegment(constsSeg2, type);
- for (var j = i; j < (longLength - 1) / 2 - 1; j++) {
- short.splice(j + 1, 0, constsSeg1);
- short.splice(j + 3, 0, constsSeg2)
- }
- }
- }
- function baseCss(that, styles) {
- var elemStyles = that._styles;
- var str = "";
- var key;
- var value;
- styles = styles || {};
- for (key in styles) {
- value = styles[key];
- if ((0, _type.isDefined)(value)) {
- value += "number" === typeof value && !pxAddingExceptions[key] ? "px" : "";
- elemStyles[key] = "" !== value ? value : null
- }
- }
- for (key in elemStyles) {
- value = elemStyles[key];
- if (value) {
- str += key + ":" + value + ";"
- }
- }
- str && that.element.setAttribute("style", str);
- return that
- }
- function fixFuncIri(wrapper, attribute) {
- var element = wrapper.element;
- var id = wrapper.attr(attribute);
- if (id && id.indexOf("DevExpress") !== -1) {
- element.removeAttribute(attribute);
- element.setAttribute(attribute, getFuncIri(id, wrapper.renderer.pathModified))
- }
- }
- function baseAttr(that, attrs) {
- attrs = attrs || {};
- var settings = that._settings;
- var attributes = {};
- var key;
- var value;
- var elem = that.element;
- var renderer = that.renderer;
- var rtl = renderer.rtl;
- var hasTransformations;
- var recalculateDashStyle;
- var sw;
- var i;
- if (!isObjectArgument(attrs)) {
- if (attrs in settings) {
- return settings[attrs]
- }
- if (attrs in DEFAULTS) {
- return DEFAULTS[attrs]
- }
- return 0
- }
- extend(attributes, attrs);
- for (key in attributes) {
- value = attributes[key];
- if (void 0 === value) {
- continue
- }
- settings[key] = value;
- if ("align" === key) {
- key = "text-anchor";
- value = {
- left: rtl ? "end" : "start",
- center: "middle",
- right: rtl ? "start" : "end"
- } [value] || null
- } else {
- if ("dashStyle" === key) {
- recalculateDashStyle = true;
- continue
- } else {
- if (key === KEY_STROKE_WIDTH) {
- recalculateDashStyle = true
- } else {
- if (value && ("fill" === key || "clip-path" === key || "filter" === key) && value.indexOf("DevExpress") !== -1) {
- that._addFixIRICallback();
- value = getFuncIri(value, renderer.pathModified)
- } else {
- if (/^(translate(X|Y)|rotate[XY]?|scale(X|Y)|sharp|sharpDirection)$/i.test(key)) {
- hasTransformations = true;
- continue
- } else {
- if (/^(x|y|d)$/i.test(key)) {
- hasTransformations = true
- }
- }
- }
- }
- }
- }
- if (null === value) {
- elem.removeAttribute(key)
- } else {
- elem.setAttribute(key, value)
- }
- }
- if (recalculateDashStyle && "dashStyle" in settings) {
- value = settings.dashStyle;
- sw = ("_originalSW" in that ? that._originalSW : settings[KEY_STROKE_WIDTH]) || 1;
- key = "stroke-dasharray";
- value = null === value ? "" : (0, _utils.normalizeEnum)(value);
- if ("" === value || "solid" === value || value === NONE) {
- that.element.removeAttribute(key)
- } else {
- value = value.replace(/longdash/g, "8,3,").replace(/dash/g, "4,3,").replace(/dot/g, "1,3,").replace(/,$/, "").split(",");
- i = value.length;
- while (i--) {
- value[i] = parseInt(value[i]) * sw
- }
- that.element.setAttribute(key, value.join(","))
- }
- }
- if (hasTransformations) {
- that._applyTransformation()
- }
- return that
- }
- function pathAttr(attrs) {
- var that = this;
- var segments;
- if (isObjectArgument(attrs)) {
- attrs = extend({}, attrs);
- segments = attrs.segments;
- if ("points" in attrs) {
- segments = buildPathSegments(attrs.points, that.type);
- delete attrs.points
- }
- if (segments) {
- attrs.d = combinePathParam(segments);
- that.segments = segments;
- delete attrs.segments
- }
- }
- return baseAttr(that, attrs)
- }
- function arcAttr(attrs) {
- var settings = this._settings;
- var x;
- var y;
- var innerRadius;
- var outerRadius;
- var startAngle;
- var endAngle;
- if (isObjectArgument(attrs)) {
- attrs = extend({}, attrs);
- if ("x" in attrs || "y" in attrs || "innerRadius" in attrs || "outerRadius" in attrs || "startAngle" in attrs || "endAngle" in attrs) {
- settings.x = x = "x" in attrs ? attrs.x : settings.x;
- delete attrs.x;
- settings.y = y = "y" in attrs ? attrs.y : settings.y;
- delete attrs.y;
- settings.innerRadius = innerRadius = "innerRadius" in attrs ? attrs.innerRadius : settings.innerRadius;
- delete attrs.innerRadius;
- settings.outerRadius = outerRadius = "outerRadius" in attrs ? attrs.outerRadius : settings.outerRadius;
- delete attrs.outerRadius;
- settings.startAngle = startAngle = "startAngle" in attrs ? attrs.startAngle : settings.startAngle;
- delete attrs.startAngle;
- settings.endAngle = endAngle = "endAngle" in attrs ? attrs.endAngle : settings.endAngle;
- delete attrs.endAngle;
- attrs.d = buildArcPath.apply(null, normalizeArcParams(x, y, innerRadius, outerRadius, startAngle, endAngle))
- }
- }
- return baseAttr(this, attrs)
- }
- function rectAttr(attrs) {
- var that = this;
- var x;
- var y;
- var width;
- var height;
- var sw;
- var maxSW;
- var newSW;
- if (isObjectArgument(attrs)) {
- attrs = extend({}, attrs);
- if (void 0 !== attrs.x || void 0 !== attrs.y || void 0 !== attrs.width || void 0 !== attrs.height || void 0 !== attrs[KEY_STROKE_WIDTH]) {
- void 0 !== attrs.x ? x = that._originalX = attrs.x : x = that._originalX || 0;
- void 0 !== attrs.y ? y = that._originalY = attrs.y : y = that._originalY || 0;
- void 0 !== attrs.width ? width = that._originalWidth = attrs.width : width = that._originalWidth || 0;
- void 0 !== attrs.height ? height = that._originalHeight = attrs.height : height = that._originalHeight || 0;
- void 0 !== attrs[KEY_STROKE_WIDTH] ? sw = that._originalSW = attrs[KEY_STROKE_WIDTH] : sw = that._originalSW;
- maxSW = ~~((width < height ? width : height) / 2);
- newSW = (sw || 0) < maxSW ? sw || 0 : maxSW;
- attrs.x = x + newSW / 2;
- attrs.y = y + newSW / 2;
- attrs.width = width - newSW;
- attrs.height = height - newSW;
- ((sw || 0) !== newSW || !(0 === newSW && void 0 === sw)) && (attrs[KEY_STROKE_WIDTH] = newSW)
- }
- if ("sharp" in attrs) {
- delete attrs.sharp
- }
- }
- return baseAttr(that, attrs)
- }
- function textAttr(attrs) {
- var that = this;
- var isResetRequired;
- if (!isObjectArgument(attrs)) {
- return baseAttr(that, attrs)
- }
- attrs = extend({}, attrs);
- var settings = that._settings;
- var wasStroked = (0, _type.isDefined)(settings[KEY_STROKE]) && (0, _type.isDefined)(settings[KEY_STROKE_WIDTH]);
- if (void 0 !== attrs[KEY_TEXT]) {
- settings[KEY_TEXT] = attrs[KEY_TEXT];
- delete attrs[KEY_TEXT];
- isResetRequired = true
- }
- if (void 0 !== attrs[KEY_STROKE]) {
- settings[KEY_STROKE] = attrs[KEY_STROKE];
- delete attrs[KEY_STROKE]
- }
- if (void 0 !== attrs[KEY_STROKE_WIDTH]) {
- settings[KEY_STROKE_WIDTH] = attrs[KEY_STROKE_WIDTH];
- delete attrs[KEY_STROKE_WIDTH]
- }
- if (void 0 !== attrs[KEY_STROKE_OPACITY]) {
- settings[KEY_STROKE_OPACITY] = attrs[KEY_STROKE_OPACITY];
- delete attrs[KEY_STROKE_OPACITY]
- }
- var isStroked = (0, _type.isDefined)(settings[KEY_STROKE]) && (0, _type.isDefined)(settings[KEY_STROKE_WIDTH]);
- baseAttr(that, attrs);
- isResetRequired = isResetRequired || isStroked !== wasStroked && settings[KEY_TEXT];
- if (isResetRequired) {
- createTextNodes(that, settings.text, isStroked);
- that._hasEllipsis = false
- }
- if (isResetRequired || void 0 !== attrs.x || void 0 !== attrs.y) {
- locateTextNodes(that)
- }
- if (isStroked) {
- strokeTextNodes(that)
- }
- return that
- }
- function textCss(styles) {
- styles = styles || {};
- baseCss(this, styles);
- if (KEY_FONT_SIZE in styles) {
- locateTextNodes(this)
- }
- return this
- }
- function orderHtmlTree(list, line, node, parentStyle, parentClassName) {
- var style;
- var realStyle;
- var i;
- var ii;
- var nodes;
- if (void 0 !== node.wholeText) {
- list.push({
- value: node.wholeText,
- style: parentStyle,
- className: parentClassName,
- line: line,
- height: parentStyle[KEY_FONT_SIZE] || 0
- })
- } else {
- if ("BR" === node.tagName) {
- ++line
- } else {
- if (_dom_adapter2.default.isElementNode(node)) {
- extend(style = {}, parentStyle);
- switch (node.tagName) {
- case "B":
- case "STRONG":
- style[KEY_FONT_WEIGHT] = "bold";
- break;
- case "I":
- case "EM":
- style[KEY_FONT_STYLE] = "italic";
- break;
- case "U":
- style[KEY_TEXT_DECORATION] = "underline"
- }
- realStyle = node.style;
- realStyle.color && (style.fill = realStyle.color);
- realStyle.fontSize && (style[KEY_FONT_SIZE] = realStyle.fontSize);
- realStyle.fontStyle && (style[KEY_FONT_STYLE] = realStyle.fontStyle);
- realStyle.fontWeight && (style[KEY_FONT_WEIGHT] = realStyle.fontWeight);
- realStyle.textDecoration && (style[KEY_TEXT_DECORATION] = realStyle.textDecoration);
- for (i = 0, nodes = node.childNodes, ii = nodes.length; i < ii; ++i) {
- line = orderHtmlTree(list, line, nodes[i], style, node.className || parentClassName)
- }
- }
- }
- }
- return line
- }
- function adjustLineHeights(items) {
- var i;
- var ii;
- var currentItem = items[0];
- var item;
- for (i = 1, ii = items.length; i < ii; ++i) {
- item = items[i];
- if (item.line === currentItem.line) {
- currentItem.height = maxLengthFontSize(currentItem.height, item.height);
- currentItem.inherits = currentItem.inherits || 0 === parseFloat(item.height);
- item.height = NaN
- } else {
- currentItem = item
- }
- }
- }
- function removeExtraAttrs(html) {
- var findTagAttrs = /(?:(<[a-z0-9]+\s*))([\s\S]*?)(>|\/>)/gi;
- var findStyleAndClassAttrs = /(style|class)\s*=\s*(["'])(?:(?!\2).)*\2\s?/gi;
- return html.replace(findTagAttrs, function(allTagAttrs, p1, p2, p3) {
- p2 = (p2 && p2.match(findStyleAndClassAttrs) || []).map(function(str) {
- return str
- }).join(" ");
- return p1 + p2 + p3
- })
- }
- function parseHTML(text) {
- var items = [];
- var div = _dom_adapter2.default.createElement("div");
- div.innerHTML = text.replace(/\r/g, "").replace(/\n/g, "<br/>");
- orderHtmlTree(items, 0, div, {}, "");
- adjustLineHeights(items);
- return items
- }
- function parseMultiline(text) {
- var texts = text.replace(/\r/g, "").split(/\n/g);
- var i = 0;
- var items = [];
- for (; i < texts.length; i++) {
- items.push({
- value: texts[i].trim(),
- height: 0,
- line: i
- })
- }
- return items
- }
- function createTspans(items, element, fieldName) {
- var i;
- var ii;
- var item;
- for (i = 0, ii = items.length; i < ii; ++i) {
- item = items[i];
- item[fieldName] = createElement("tspan");
- item[fieldName].appendChild(_dom_adapter2.default.createTextNode(item.value));
- item.style && baseCss({
- element: item[fieldName],
- _styles: {}
- }, item.style);
- item.className && item[fieldName].setAttribute("class", item.className);
- element.appendChild(item[fieldName])
- }
- }
- function restoreText() {
- if (this._hasEllipsis) {
- this.attr({
- text: this._settings.text
- })
- }
- }
- function applyEllipsis(maxWidth) {
- var that = this;
- var lines;
- var hasEllipsis = false;
- var i;
- var ii;
- var lineParts;
- var j;
- var jj;
- var text;
- restoreText.call(that);
- var ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root);
- var ellipsisWidth = ellipsis.getBBox().width;
- if (that._getElementBBox().width > maxWidth) {
- if (maxWidth - ellipsisWidth < 0) {
- maxWidth = 0
- } else {
- maxWidth -= ellipsisWidth
- }
- lines = prepareLines(that.element, that._texts, maxWidth);
- for (i = 0, ii = lines.length; i < ii; ++i) {
- lineParts = lines[i].parts;
- if (1 === lines[i].commonLength) {
- continue
- }
- for (j = 0, jj = lineParts.length; j < jj; ++j) {
- text = lineParts[j];
- if ((0, _type.isDefined)(text.endIndex)) {
- setNewText(text, text.endIndex);
- hasEllipsis = true
- } else {
- if (text.startBox > maxWidth) {
- removeTextSpan(text)
- }
- }
- }
- }
- }
- ellipsis.remove();
- that._hasEllipsis = hasEllipsis;
- return hasEllipsis
- }
- function cloneAndRemoveAttrs(node) {
- var clone;
- if (node) {
- clone = node.cloneNode();
- clone.removeAttribute("y");
- clone.removeAttribute("x")
- }
- return clone || node
- }
- function detachAndStoreTitleElements(element) {
- var titleElements = _dom_adapter2.default.querySelectorAll(element, "title");
- for (var i = 0; i < titleElements.length; i++) {
- element.removeChild(titleElements[i])
- }
- return function() {
- for (var _i = 0; _i < titleElements.length; _i++) {
- element.appendChild(titleElements[_i])
- }
- }
- }
- function setMaxSize(maxWidth, maxHeight) {
- var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
- var that = this;
- var lines = [];
- var textChanged = false;
- var textIsEmpty = false;
- var ellipsisMaxWidth = maxWidth;
- restoreText.call(that);
- var restoreTitleElement = detachAndStoreTitleElements(this.element);
- var ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root);
- var ellipsisWidth = ellipsis.getBBox().width;
- var _that$_getElementBBox = that._getElementBBox(),
- width = _that$_getElementBBox.width,
- height = _that$_getElementBBox.height;
- if ((width || height) && (width > maxWidth || maxHeight && height > maxHeight)) {
- if (maxWidth - ellipsisWidth < 0) {
- ellipsisMaxWidth = 0
- } else {
- ellipsisMaxWidth -= ellipsisWidth
- }
- lines = applyOverflowRules(that.element, that._texts, maxWidth, ellipsisMaxWidth, options, maxHeight);
- lines = setMaxHeight(lines, ellipsisMaxWidth, options, maxHeight, parseFloat(this._getLineHeight()));
- this._texts = lines.reduce(function(texts, line) {
- return texts.concat(line.parts)
- }, []).filter(function(t) {
- return "" !== t.value
- }).map(function(t) {
- t.stroke && t.tspan.parentNode.appendChild(t.stroke);
- return t
- }).map(function(t) {
- t.tspan.parentNode.appendChild(t.tspan);
- return t
- });
- !this._texts.length && (this._texts = null);
- textChanged = true;
- if (this._texts) {
- locateTextNodes(this)
- } else {
- this.element.textContent = "";
- textIsEmpty = true
- }
- }
- ellipsis.remove();
- that._hasEllipsis = textChanged;
- restoreTitleElement();
- return {
- rowCount: lines.length,
- textChanged: textChanged,
- textIsEmpty: textIsEmpty
- }
- }
- function getIndexForEllipsis(text, maxWidth, startBox, endBox) {
- var k;
- var kk;
- if (startBox <= maxWidth && endBox > maxWidth) {
- for (k = 1, kk = text.value.length; k <= kk; ++k) {
- if (startBox + text.tspan.getSubStringLength(0, k) > maxWidth) {
- return k - 1
- }
- }
- }
- }
- function getTextWidth(text) {
- return text.value.length ? text.tspan.getSubStringLength(0, text.value.length) : 0
- }
- function prepareLines(element, texts, maxWidth) {
- var lines = [];
- var i;
- var ii;
- var text;
- var startBox;
- var endBox;
- if (texts) {
- for (i = 0, ii = texts.length; i < ii; ++i) {
- text = texts[i];
- if (!lines[text.line]) {
- text.startBox = startBox = 0;
- lines.push({
- commonLength: text.value.length,
- parts: [text]
- })
- } else {
- text.startBox = startBox;
- lines[text.line].parts.push(text);
- lines[text.line].commonLength += text.value.length
- }
- endBox = startBox + text.tspan.getSubStringLength(0, text.value.length);
- text.endIndex = getIndexForEllipsis(text, maxWidth, startBox, endBox);
- startBox = endBox
- }
- } else {
- text = {
- value: element.textContent,
- tspan: element
- };
- text.startBox = startBox = 0;
- endBox = startBox + getTextWidth(text);
- text.endIndex = getIndexForEllipsis(text, maxWidth, startBox, endBox);
- lines = [{
- commonLength: element.textContent.length,
- parts: [text]
- }]
- }
- return lines
- }
- function getSpaceBreakIndex(text, maxWidth) {
- var initialIndices = text.startBox > 0 ? [0] : [];
- var spaceIndices = text.value.split("").reduce(function(indices, char, index) {
- if (" " === char) {
- indices.push(index)
- }
- return indices
- }, initialIndices);
- var spaceIndex = 0;
- while (void 0 !== spaceIndices[spaceIndex + 1] && text.startBox + text.tspan.getSubStringLength(0, spaceIndices[spaceIndex + 1]) < maxWidth) {
- spaceIndex++
- }
- return spaceIndices[spaceIndex]
- }
- function getWordBreakIndex(text, maxWidth) {
- for (var i = 0; i < text.value.length - 1; i++) {
- if (text.startBox + text.tspan.getSubStringLength(0, i + 1) > maxWidth) {
- return i
- }
- }
- }
- function getEllipsisString(ellipsisMaxWidth, _ref) {
- var hideOverflowEllipsis = _ref.hideOverflowEllipsis;
- return hideOverflowEllipsis && 0 === ellipsisMaxWidth ? "" : ELLIPSIS
- }
- function setEllipsis(text, ellipsisMaxWidth, options) {
- var ellipsis = getEllipsisString(ellipsisMaxWidth, options);
- if (text.value.length && text.tspan.parentNode) {
- for (var i = text.value.length - 1; i >= 1; i--) {
- if (text.startBox + text.tspan.getSubStringLength(0, i) < ellipsisMaxWidth) {
- setNewText(text, i, ellipsis);
- break
- } else {
- if (1 === i) {
- setNewText(text, 0, ellipsis)
- }
- }
- }
- }
- }
- function wordWrap(text, maxWidth, ellipsisMaxWidth, options) {
- var wholeText = text.value;
- var breakIndex;
- if ("none" !== options.wordWrap) {
- breakIndex = "normal" === options.wordWrap ? getSpaceBreakIndex(text, maxWidth) : getWordBreakIndex(text, maxWidth)
- }
- var restLines = [];
- var restText;
- if (isFinite(breakIndex)) {
- setNewText(text, breakIndex, "");
- var newTextOffset = " " === wholeText[breakIndex] ? 1 : 0;
- var restString = wholeText.slice(breakIndex + newTextOffset);
- if (restString.length) {
- var restTspan = cloneAndRemoveAttrs(text.tspan);
- restTspan.textContent = restString;
- text.tspan.parentNode.appendChild(restTspan);
- restText = extend(extend({}, text), {
- value: restString,
- startBox: 0,
- height: 0,
- tspan: restTspan,
- stroke: cloneAndRemoveAttrs(text.stroke),
- endBox: restTspan.getSubStringLength(0, restString.length)
- });
- restText.stroke && (restText.stroke.textContent = restString);
- if (restText.endBox > maxWidth) {
- restLines = wordWrap(restText, maxWidth, ellipsisMaxWidth, options);
- if (!restLines.length) {
- return []
- }
- }
- }
- }
- if (text.value.length) {
- if ("ellipsis" === options.textOverflow && text.tspan.getSubStringLength(0, text.value.length) > maxWidth) {
- setEllipsis(text, ellipsisMaxWidth, options)
- }
- if ("hide" === options.textOverflow && text.tspan.getSubStringLength(0, text.value.length) > maxWidth) {
- return []
- }
- } else {
- text.tspan.parentNode.removeChild(text.tspan)
- }
- var parts = [];
- if (restText) {
- parts.push(restText)
- }
- return [{
- commonLength: wholeText.length,
- parts: parts
- }].concat(restLines)
- }
- function calculateLineHeight(line, lineHeight) {
- return line.parts.reduce(function(height, text) {
- return max(height, getItemLineHeight(text, lineHeight))
- }, 0)
- }
- function setMaxHeight(lines, ellipsisMaxWidth, options, maxHeight, lineHeight) {
- var textOverflow = options.textOverflow;
- if (!isFinite(maxHeight) || 0 === Number(maxHeight) || "none" === textOverflow) {
- return lines
- }
- var result = lines.reduce(function(_ref2, l, index, arr) {
- var _ref3 = _slicedToArray(_ref2, 2),
- lines = _ref3[0],
- commonHeight = _ref3[1];
- var height = calculateLineHeight(l, lineHeight);
- commonHeight += height;
- if (commonHeight < maxHeight) {
- lines.push(l)
- } else {
- l.parts.forEach(function(item) {
- removeTextSpan(item)
- });
- if ("ellipsis" === textOverflow) {
- var prevLine = arr[index - 1];
- if (prevLine) {
- var text = prevLine.parts[prevLine.parts.length - 1];
- if (!text.hasEllipsis) {
- if (0 === ellipsisMaxWidth || text.endBox < ellipsisMaxWidth) {
- setNewText(text, text.value.length, getEllipsisString(ellipsisMaxWidth, options))
- } else {
- setEllipsis(text, ellipsisMaxWidth, options)
- }
- }
- }
- }
- }
- return [lines, commonHeight]
- }, [
- [], 0
- ]);
- if ("hide" === textOverflow && result[1] > maxHeight) {
- result[0].forEach(function(l) {
- l.parts.forEach(function(item) {
- removeTextSpan(item)
- })
- });
- return []
- }
- return result[0]
- }
- function applyOverflowRules(element, texts, maxWidth, ellipsisMaxWidth, options) {
- if (!texts) {
- var textValue = element.textContent;
- var text = {
- value: textValue,
- height: 0,
- line: 0
- };
- element.textContent = "";
- createTspans([text], element, "tspan");
- texts = [text]
- }
- return texts.reduce(function(_ref4, text) {
- var _ref5 = _slicedToArray(_ref4, 5),
- lines = _ref5[0],
- startBox = _ref5[1],
- endBox = _ref5[2],
- stop = _ref5[3],
- lineNumber = _ref5[4];
- var line = lines[lines.length - 1];
- if (stop) {
- return [lines, startBox, endBox, stop]
- }
- if (!line || text.line !== lineNumber) {
- text.startBox = startBox = 0;
- lines.push({
- commonLength: text.value.length,
- parts: [text]
- })
- } else {
- text.startBox = startBox;
- if (startBox > ellipsisMaxWidth && "none" === options.wordWrap && "ellipsis" === options.textOverflow) {
- removeTextSpan(text);
- return [lines, startBox, endBox, stop, lineNumber]
- }
- line.parts.push(text);
- line.commonLength += text.value.length
- }
- text.endBox = endBox = startBox + getTextWidth(text);
- startBox = endBox;
- if ((0, _type.isDefined)(maxWidth) && endBox > maxWidth) {
- var wordWrapLines = wordWrap(text, maxWidth, ellipsisMaxWidth, options);
- if (!wordWrapLines.length) {
- lines = [];
- stop = true
- } else {
- lines = lines.concat(wordWrapLines.filter(function(l) {
- return l.parts.length > 0
- }))
- }
- }
- return [lines, startBox, endBox, stop, text.line]
- }, [
- [], 0, 0, false, 0
- ])[0]
- }
- function setNewText(text, index) {
- var insertString = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ELLIPSIS;
- var newText = text.value.substr(0, index) + insertString;
- text.value = text.tspan.textContent = newText;
- text.stroke && (text.stroke.textContent = newText);
- if (insertString === ELLIPSIS) {
- text.hasEllipsis = true
- }
- }
- function removeTextSpan(text) {
- text.tspan.parentNode && text.tspan.parentNode.removeChild(text.tspan);
- text.stroke && text.stroke.parentNode && text.stroke.parentNode.removeChild(text.stroke)
- }
- function createTextNodes(wrapper, text, isStroked) {
- var items;
- var parsedHtml;
- wrapper._texts = null;
- wrapper.clear();
- if (null === text) {
- return
- }
- text = "" + text;
- if (!wrapper.renderer.encodeHtml && (/<[a-z][\s\S]*>/i.test(text) || text.indexOf("&") !== -1)) {
- parsedHtml = removeExtraAttrs(text);
- items = parseHTML(parsedHtml);
- wrapper.DEBUG_parsedHtml = parsedHtml
- } else {
- if (/\n/g.test(text)) {
- items = parseMultiline(text)
- } else {
- if (isStroked) {
- items = [{
- value: text.trim(),
- height: 0
- }]
- }
- }
- }
- if (items) {
- if (items.length) {
- wrapper._texts = items;
- if (isStroked) {
- createTspans(items, wrapper.element, KEY_STROKE)
- }
- createTspans(items, wrapper.element, "tspan")
- }
- } else {
- wrapper.element.appendChild(_dom_adapter2.default.createTextNode(text))
- }
- }
- function setTextNodeAttribute(item, name, value) {
- item.tspan.setAttribute(name, value);
- item.stroke && item.stroke.setAttribute(name, value)
- }
- function getItemLineHeight(item, defaultValue) {
- return item.inherits ? maxLengthFontSize(item.height, defaultValue) : item.height || defaultValue
- }
- function locateTextNodes(wrapper) {
- if (!wrapper._texts) {
- return
- }
- var items = wrapper._texts;
- var x = wrapper._settings.x;
- var lineHeight = wrapper._getLineHeight();
- var i;
- var ii;
- var item = items[0];
- setTextNodeAttribute(item, "x", x);
- setTextNodeAttribute(item, "y", wrapper._settings.y);
- for (i = 1, ii = items.length; i < ii; ++i) {
- item = items[i];
- if (parseFloat(item.height) >= 0) {
- setTextNodeAttribute(item, "x", x);
- var height = getItemLineHeight(item, lineHeight);
- setTextNodeAttribute(item, "dy", height)
- }
- }
- }
- function maxLengthFontSize(fontSize1, fontSize2) {
- var parsedHeight1 = parseFloat(fontSize1);
- var parsedHeight2 = parseFloat(fontSize2);
- var height1 = parsedHeight1 || DEFAULT_FONT_SIZE;
- var height2 = parsedHeight2 || DEFAULT_FONT_SIZE;
- return height1 > height2 ? !isNaN(parsedHeight1) ? fontSize1 : height1 : !isNaN(parsedHeight2) ? fontSize2 : height2
- }
- function strokeTextNodes(wrapper) {
- if (!wrapper._texts) {
- return
- }
- var items = wrapper._texts;
- var stroke = wrapper._settings[KEY_STROKE];
- var strokeWidth = wrapper._settings[KEY_STROKE_WIDTH];
- var strokeOpacity = wrapper._settings[KEY_STROKE_OPACITY] || 1;
- var tspan;
- var i;
- var ii;
- for (i = 0, ii = items.length; i < ii; ++i) {
- tspan = items[i].stroke;
- tspan.setAttribute(KEY_STROKE, stroke);
- tspan.setAttribute(KEY_STROKE_WIDTH, strokeWidth);
- tspan.setAttribute(KEY_STROKE_OPACITY, strokeOpacity);
- tspan.setAttribute("stroke-linejoin", "round")
- }
- }
- function baseAnimate(that, params, options, complete) {
- options = options || {};
- var key;
- var value;
- var renderer = that.renderer;
- var settings = that._settings;
- var animationParams = {};
- var defaults = {
- translateX: 0,
- translateY: 0,
- scaleX: 1,
- scaleY: 1,
- rotate: 0,
- rotateX: 0,
- rotateY: 0
- };
- if (complete) {
- options.complete = complete
- }
- if (renderer.animationEnabled()) {
- for (key in params) {
- value = params[key];
- if (/^(translate(X|Y)|rotate[XY]?|scale(X|Y))$/i.test(key)) {
- animationParams.transform = animationParams.transform || {
- from: {},
- to: {}
- };
- animationParams.transform.from[key] = key in settings ? Number(settings[key].toFixed(3)) : defaults[key];
- animationParams.transform.to[key] = value
- } else {
- if ("arc" === key || "segments" === key) {
- animationParams[key] = value
- } else {
- animationParams[key] = {
- from: key in settings ? settings[key] : parseFloat(that.element.getAttribute(key) || 0),
- to: value
- }
- }
- }
- }
- renderer.animateElement(that, animationParams, extend(extend({}, renderer._animation), options))
- } else {
- options.step && options.step.call(that, 1, 1);
- options.complete && options.complete.call(that);
- that.attr(params)
- }
- return that
- }
- function pathAnimate(params, options, complete) {
- var that = this;
- var curSegments = that.segments || [];
- var newSegments;
- var endSegments;
- if (that.renderer.animationEnabled() && "points" in params) {
- newSegments = buildPathSegments(params.points, that.type);
- endSegments = compensateSegments(curSegments, newSegments, that.type);
- params.segments = {
- from: curSegments,
- to: newSegments,
- end: endSegments
- };
- delete params.points
- }
- return baseAnimate(that, params, options, complete)
- }
- function arcAnimate(params, options, complete) {
- var that = this;
- var settings = that._settings;
- var arcParams = {
- from: {},
- to: {}
- };
- if (that.renderer.animationEnabled() && ("x" in params || "y" in params || "innerRadius" in params || "outerRadius" in params || "startAngle" in params || "endAngle" in params)) {
- arcParams.from.x = settings.x || 0;
- arcParams.from.y = settings.y || 0;
- arcParams.from.innerRadius = settings.innerRadius || 0;
- arcParams.from.outerRadius = settings.outerRadius || 0;
- arcParams.from.startAngle = settings.startAngle || 0;
- arcParams.from.endAngle = settings.endAngle || 0;
- arcParams.to.x = "x" in params ? params.x : settings.x;
- delete params.x;
- arcParams.to.y = "y" in params ? params.y : settings.y;
- delete params.y;
- arcParams.to.innerRadius = "innerRadius" in params ? params.innerRadius : settings.innerRadius;
- delete params.innerRadius;
- arcParams.to.outerRadius = "outerRadius" in params ? params.outerRadius : settings.outerRadius;
- delete params.outerRadius;
- arcParams.to.startAngle = "startAngle" in params ? params.startAngle : settings.startAngle;
- delete params.startAngle;
- arcParams.to.endAngle = "endAngle" in params ? params.endAngle : settings.endAngle;
- delete params.endAngle;
- params.arc = arcParams
- }
- return baseAnimate(that, params, options, complete)
- }
- exports.DEBUG_set_getNextDefsSvgId = function(newFunction) {
- getNextDefsSvgId = newFunction
- };
- exports.DEBUG_removeBackupContainer = function() {
- if (getBackup().backupCounter) {
- getBackup().backupCounter = 0;
- _dom_adapter2.default.getBody().removeChild(getBackup().backupContainer)
- }
- };
- function buildLink(target, parameters) {
- var obj = {
- is: false,
- name: parameters.name || parameters,
- after: parameters.after
- };
- if (target) {
- obj.to = target
- } else {
- obj.virtual = true
- }
- return obj
- }
- function SvgElement(renderer, tagName, type) {
- var that = this;
- that.renderer = renderer;
- that.element = createElement(tagName);
- that._settings = {};
- that._styles = {};
- if ("path" === tagName) {
- that.type = type || "line"
- }
- }
- function removeFuncIriCallback(callback) {
- fixFuncIriCallbacks.remove(callback)
- }
- exports.SvgElement = SvgElement;
- SvgElement.prototype = {
- constructor: SvgElement,
- _getJQElement: function() {
- return this._$element || (this._$element = (0, _renderer2.default)(this.element))
- },
- _addFixIRICallback: function() {
- var that = this;
- var fn = function() {
- fixFuncIri(that, "fill");
- fixFuncIri(that, "clip-path");
- fixFuncIri(that, "filter")
- };
- that.element._fixFuncIri = fn;
- fn.renderer = that.renderer;
- fixFuncIriCallbacks.add(fn);
- that._addFixIRICallback = function() {}
- },
- _clearChildrenFuncIri: function() {
- var clearChildren = function clearChildren(element) {
- var i;
- for (i = 0; i < element.childNodes.length; i++) {
- removeFuncIriCallback(element.childNodes[i]._fixFuncIri);
- clearChildren(element.childNodes[i])
- }
- };
- clearChildren(this.element)
- },
- dispose: function() {
- removeFuncIriCallback(this.element._fixFuncIri);
- this._clearChildrenFuncIri();
- this._getJQElement().remove();
- return this
- },
- append: function(parent) {
- (parent || this.renderer.root).element.appendChild(this.element);
- return this
- },
- remove: function() {
- var element = this.element;
- element.parentNode && element.parentNode.removeChild(element);
- return this
- },
- enableLinks: function() {
- this._links = [];
- return this
- },
- checkLinks: function() {
- var count = 0;
- var links = this._links;
- var i;
- var ii = links.length;
- for (i = 0; i < ii; ++i) {
- if (!links[i]._link.virtual) {
- ++count
- }
- }
- if (count > 0) {
- throw new Error("There are non disposed links!")
- }
- },
- virtualLink: function(parameters) {
- linkItem({
- _link: buildLink(null, parameters)
- }, this);
- return this
- },
- linkAfter: function(name) {
- this._linkAfter = name;
- return this
- },
- linkOn: function(target, parameters) {
- this._link = buildLink(target, parameters);
- linkItem(this, target);
- return this
- },
- linkOff: function() {
- unlinkItem(this);
- this._link = null;
- return this
- },
- linkAppend: function() {
- var link = this._link;
- var items = link.to._links;
- var i;
- var next;
- for (i = link.i + 1;
- (next = items[i]) && !next._link.is; ++i) {}
- this._insert(link.to, next);
- link.is = true;
- return this
- },
- _insert: function(parent, next) {
- parent.element.insertBefore(this.element, next ? next.element : null)
- },
- linkRemove: function() {
- this.remove();
- this._link.is = false;
- return this
- },
- clear: function() {
- this._clearChildrenFuncIri();
- this._getJQElement().empty();
- return this
- },
- toBackground: function() {
- var elem = this.element;
- var parent = elem.parentNode;
- parent && parent.insertBefore(elem, parent.firstChild);
- return this
- },
- toForeground: function() {
- var elem = this.element;
- var parent = elem.parentNode;
- parent && parent.appendChild(elem);
- return this
- },
- attr: function(attrs) {
- return baseAttr(this, attrs)
- },
- smartAttr: function(attrs) {
- var that = this;
- if (attrs.hatching && "none" !== (0, _utils.normalizeEnum)(attrs.hatching.direction)) {
- attrs = extend({}, attrs);
- attrs.fill = that._hatching = that.renderer.lockHatching(attrs.fill, attrs.hatching, that._hatching);
- delete attrs.hatching
- } else {
- if (that._hatching) {
- that.renderer.releaseHatching(that._hatching);
- that._hatching = null
- }
- }
- return that.attr(attrs)
- },
- css: function(styles) {
- return baseCss(this, styles)
- },
- animate: function(params, options, complete) {
- return baseAnimate(this, params, options, complete)
- },
- sharp: function(pos, sharpDirection) {
- return this.attr({
- sharp: pos || true,
- sharpDirection: sharpDirection
- })
- },
- _applyTransformation: function() {
- var tr = this._settings;
- var rotateX;
- var rotateY;
- var transformations = [];
- var sharpMode = tr.sharp;
- var trDirection = tr.sharpDirection || 1;
- var strokeOdd = tr[KEY_STROKE_WIDTH] % 2;
- var correctionX = strokeOdd && ("h" === sharpMode || true === sharpMode) ? SHARPING_CORRECTION * trDirection : 0;
- var correctionY = strokeOdd && ("v" === sharpMode || true === sharpMode) ? SHARPING_CORRECTION * trDirection : 0;
- transformations.push("translate(" + ((tr.translateX || 0) + correctionX) + "," + ((tr.translateY || 0) + correctionY) + ")");
- if (tr.rotate) {
- if ("rotateX" in tr) {
- rotateX = tr.rotateX
- } else {
- rotateX = tr.x
- }
- if ("rotateY" in tr) {
- rotateY = tr.rotateY
- } else {
- rotateY = tr.y
- }
- transformations.push("rotate(" + tr.rotate + "," + (rotateX || 0) + "," + (rotateY || 0) + ")")
- }
- var scaleXDefined = (0, _type.isDefined)(tr.scaleX);
- var scaleYDefined = (0, _type.isDefined)(tr.scaleY);
- if (scaleXDefined || scaleYDefined) {
- transformations.push("scale(" + (scaleXDefined ? tr.scaleX : 1) + "," + (scaleYDefined ? tr.scaleY : 1) + ")")
- }
- if (transformations.length) {
- this.element.setAttribute("transform", transformations.join(" "))
- }
- },
- move: function(x, y, animate, animOptions) {
- var obj = {};
- (0, _type.isDefined)(x) && (obj.translateX = x);
- (0, _type.isDefined)(y) && (obj.translateY = y);
- if (!animate) {
- this.attr(obj)
- } else {
- this.animate(obj, animOptions)
- }
- return this
- },
- rotate: function(angle, x, y, animate, animOptions) {
- var obj = {
- rotate: angle || 0
- };
- (0, _type.isDefined)(x) && (obj.rotateX = x);
- (0, _type.isDefined)(y) && (obj.rotateY = y);
- if (!animate) {
- this.attr(obj)
- } else {
- this.animate(obj, animOptions)
- }
- return this
- },
- _getElementBBox: function() {
- var elem = this.element;
- var bBox;
- try {
- bBox = elem.getBBox && elem.getBBox()
- } catch (e) {}
- return bBox || {
- x: 0,
- y: 0,
- width: elem.offsetWidth || 0,
- height: elem.offsetHeight || 0
- }
- },
- getBBox: function() {
- var transformation = this._settings;
- var bBox = this._getElementBBox();
- if (transformation.rotate) {
- bBox = (0, _utils.rotateBBox)(bBox, [("rotateX" in transformation ? transformation.rotateX : transformation.x) || 0, ("rotateY" in transformation ? transformation.rotateY : transformation.y) || 0], -transformation.rotate)
- } else {
- bBox = (0, _utils.normalizeBBox)(bBox)
- }
- return bBox
- },
- markup: function() {
- return (0, _svg.getSvgMarkup)(this.element)
- },
- getOffset: function() {
- return this._getJQElement().offset()
- },
- stopAnimation: function(disableComplete) {
- var animation = this.animation;
- animation && animation.stop(disableComplete);
- return this
- },
- setTitle: function(text) {
- var titleElem = createElement("title");
- titleElem.textContent = text || "";
- this.element.appendChild(titleElem)
- },
- data: function(obj, val) {
- var elem = this.element;
- var key;
- if (void 0 !== val) {
- elem[obj] = val
- } else {
- for (key in obj) {
- elem[key] = obj[key]
- }
- }
- return this
- },
- on: function() {
- var args = [this._getJQElement()];
- args.push.apply(args, arguments);
- _events_engine2.default.on.apply(_events_engine2.default, args);
- return this
- },
- off: function() {
- var args = [this._getJQElement()];
- args.push.apply(args, arguments);
- _events_engine2.default.off.apply(_events_engine2.default, args);
- return this
- },
- trigger: function() {
- var args = [this._getJQElement()];
- args.push.apply(args, arguments);
- _events_engine2.default.trigger.apply(_events_engine2.default, args);
- return this
- }
- };
- function PathSvgElement(renderer, type) {
- SvgElement.call(this, renderer, "path", type)
- }
- exports.PathSvgElement = PathSvgElement;
- PathSvgElement.prototype = objectCreate(SvgElement.prototype);
- extend(PathSvgElement.prototype, {
- constructor: PathSvgElement,
- attr: pathAttr,
- animate: pathAnimate
- });
- function ArcSvgElement(renderer) {
- SvgElement.call(this, renderer, "path", "arc")
- }
- exports.ArcSvgElement = ArcSvgElement;
- ArcSvgElement.prototype = objectCreate(SvgElement.prototype);
- extend(ArcSvgElement.prototype, {
- constructor: ArcSvgElement,
- attr: arcAttr,
- animate: arcAnimate
- });
- function RectSvgElement(renderer) {
- SvgElement.call(this, renderer, "rect")
- }
- exports.RectSvgElement = RectSvgElement;
- RectSvgElement.prototype = objectCreate(SvgElement.prototype);
- extend(RectSvgElement.prototype, {
- constructor: RectSvgElement,
- attr: rectAttr
- });
- function TextSvgElement(renderer) {
- SvgElement.call(this, renderer, "text");
- this.css({
- "white-space": "pre"
- })
- }
- exports.TextSvgElement = TextSvgElement;
- TextSvgElement.prototype = objectCreate(SvgElement.prototype);
- extend(TextSvgElement.prototype, {
- constructor: TextSvgElement,
- attr: textAttr,
- css: textCss,
- applyEllipsis: applyEllipsis,
- setMaxSize: setMaxSize,
- restoreText: restoreText,
- _getLineHeight: function() {
- return !isNaN(parseFloat(this._styles[KEY_FONT_SIZE])) ? this._styles[KEY_FONT_SIZE] : DEFAULT_FONT_SIZE
- }
- });
- function updateIndexes(items, k) {
- var i;
- var item;
- for (i = k; item = items[i]; ++i) {
- item._link.i = i
- }
- }
- function linkItem(target, container) {
- var items = container._links;
- var key = target._link.after = target._link.after || container._linkAfter;
- var i;
- var item;
- if (key) {
- for (i = 0;
- (item = items[i]) && item._link.name !== key; ++i) {}
- if (item) {
- for (++i;
- (item = items[i]) && item._link.after === key; ++i) {}
- }
- } else {
- i = items.length
- }
- items.splice(i, 0, target);
- updateIndexes(items, i)
- }
- function unlinkItem(target) {
- var i;
- var items = target._link.to._links;
- for (i = 0; items[i] !== target; ++i) {}
- items.splice(i, 1);
- updateIndexes(items, i)
- }
- function Renderer(options) {
- var that = this;
- that.root = that._createElement("svg", {
- xmlns: "http://www.w3.org/2000/svg",
- version: "1.1",
- fill: NONE,
- stroke: NONE,
- "stroke-width": 0
- }).attr({
- "class": options.cssClass
- }).css({
- "line-height": "normal",
- "-ms-user-select": NONE,
- "-moz-user-select": NONE,
- "-webkit-user-select": NONE,
- "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)",
- display: "block",
- overflow: "hidden"
- });
- that._init();
- that.pathModified = !!options.pathModified;
- that._$container = (0, _renderer2.default)(options.container);
- that.root.append({
- element: options.container
- });
- that.fixPlacement();
- that._locker = 0;
- that._backed = false
- }
- exports.Renderer = Renderer;
- Renderer.prototype = {
- constructor: Renderer,
- _init: function() {
- var that = this;
- that._defs = that._createElement("defs").append(that.root);
- that._animationController = new _animation2.default.AnimationController(that.root.element);
- that._animation = {
- enabled: true,
- duration: 1e3,
- easing: "easeOutCubic"
- }
- },
- fixPlacement: function() {
- if (!_browser2.default.mozilla && !_browser2.default.msie) {
- return
- }
- var box = getBoundingClientRect(this._$container.get(0));
- var dx = roundValue(box.left % 1, 2);
- var dy = roundValue(box.top % 1, 2);
- if (_browser2.default.msie) {
- this.root.css({
- transform: "translate(" + -dx + "px," + -dy + "px)"
- })
- } else {
- if (_browser2.default.mozilla) {
- this.root.move(-dx, -dy)
- }
- }
- },
- removePlacementFix: function() {
- if (!_browser2.default.mozilla && !_browser2.default.msie) {
- return
- }
- if (_browser2.default.msie) {
- this.root.css({
- transform: ""
- })
- } else {
- if (_browser2.default.mozilla) {
- this.root.attr({
- transform: null
- })
- }
- }
- },
- setOptions: function(options) {
- var that = this;
- that.rtl = !!options.rtl;
- that.encodeHtml = !!options.encodeHtml;
- that.updateAnimationOptions(options.animation || {});
- that.root.attr({
- direction: that.rtl ? "rtl" : "ltr"
- });
- return that
- },
- _createElement: function(tagName, attr, type) {
- var elem = new exports.SvgElement(this, tagName, type);
- attr && elem.attr(attr);
- return elem
- },
- lock: function() {
- var that = this;
- if (0 === that._locker) {
- that._backed = !that._$container.is(":visible");
- if (that._backed) {
- backupRoot(that.root)
- }
- }++that._locker;
- return that
- },
- unlock: function() {
- var that = this;
- --that._locker;
- if (0 === that._locker) {
- if (that._backed) {
- restoreRoot(that.root, that._$container[0]);
- that.fixPlacement()
- }
- that._backed = false
- }
- return that
- },
- resize: function(width, height) {
- if (width >= 0 && height >= 0) {
- this.root.attr({
- width: width,
- height: height
- })
- }
- return this
- },
- dispose: function() {
- var that = this;
- var key;
- that.root.dispose();
- that._defs.dispose();
- that._animationController.dispose();
- fixFuncIriCallbacks.removeByRenderer(that);
- for (key in that) {
- that[key] = null
- }
- return that
- },
- animationEnabled: function() {
- return !!this._animation.enabled
- },
- updateAnimationOptions: function(newOptions) {
- extend(this._animation, newOptions);
- return this
- },
- stopAllAnimations: function(lock) {
- this._animationController[lock ? "lock" : "stop"]();
- return this
- },
- animateElement: function(element, params, options) {
- this._animationController.animateElement(element, params, options);
- return this
- },
- svg: function() {
- this.removePlacementFix();
- var markup = this.root.markup();
- this.fixPlacement();
- return markup
- },
- getRootOffset: function() {
- return this.root.getOffset()
- },
- onEndAnimation: function(endAnimation) {
- this._animationController.onEndAnimation(endAnimation)
- },
- rect: function(x, y, width, height) {
- var elem = new exports.RectSvgElement(this);
- return elem.attr({
- x: x || 0,
- y: y || 0,
- width: width || 0,
- height: height || 0
- })
- },
- simpleRect: function() {
- return this._createElement("rect")
- },
- circle: function(x, y, r) {
- return this._createElement("circle", {
- cx: x || 0,
- cy: y || 0,
- r: r || 0
- })
- },
- g: function() {
- return this._createElement("g")
- },
- image: function image(x, y, w, h, href, location) {
- var image = this._createElement("image", {
- x: x || 0,
- y: y || 0,
- width: w || 0,
- height: h || 0,
- preserveAspectRatio: preserveAspectRatioMap[(0, _utils.normalizeEnum)(location)] || NONE
- });
- image.element.setAttributeNS("http://www.w3.org/1999/xlink", "href", href || "");
- return image
- },
- path: function(points, type) {
- var elem = new exports.PathSvgElement(this, type);
- return elem.attr({
- points: points || []
- })
- },
- arc: function(x, y, innerRadius, outerRadius, startAngle, endAngle) {
- var elem = new exports.ArcSvgElement(this);
- return elem.attr({
- x: x || 0,
- y: y || 0,
- innerRadius: innerRadius || 0,
- outerRadius: outerRadius || 0,
- startAngle: startAngle || 0,
- endAngle: endAngle || 0
- })
- },
- text: function(_text, x, y) {
- var elem = new exports.TextSvgElement(this);
- return elem.attr({
- text: _text,
- x: x || 0,
- y: y || 0
- })
- },
- linearGradient: function(stops) {
- var id = getNextDefsSvgId();
- var that = this;
- var gradient = that._createElement("linearGradient", {
- id: id
- }).append(that._defs);
- gradient.id = id;
- stops.forEach(function(stop) {
- that._createElement("stop", {
- offset: stop.offset,
- "stop-color": stop["stop-color"]
- }).append(gradient)
- });
- return gradient
- },
- pattern: function pattern(color, hatching, _id) {
- hatching = hatching || {};
- var that = this;
- var step = hatching.step || 6;
- var stepTo2 = step / 2;
- var stepBy15 = 1.5 * step;
- var id = _id || getNextDefsSvgId();
- var d = "right" === (0, _utils.normalizeEnum)(hatching.direction) ? "M " + stepTo2 + " " + -stepTo2 + " L " + -stepTo2 + " " + stepTo2 + " M 0 " + step + " L " + step + " 0 M " + stepBy15 + " " + stepTo2 + " L " + stepTo2 + " " + stepBy15 : "M 0 0 L " + step + " " + step + " M " + -stepTo2 + " " + stepTo2 + " L " + stepTo2 + " " + stepBy15 + " M " + stepTo2 + " " + -stepTo2 + " L " + stepBy15 + " " + stepTo2;
- var pattern = that._createElement("pattern", {
- id: id,
- width: step,
- height: step,
- patternUnits: "userSpaceOnUse"
- }).append(that._defs);
- pattern.id = id;
- var rect = that.rect(0, 0, step, step).attr({
- fill: color,
- opacity: hatching.opacity
- }).append(pattern);
- var path = new exports.PathSvgElement(this).attr({
- d: d,
- "stroke-width": hatching.width || 1,
- stroke: color
- }).append(pattern);
- pattern.rect = rect;
- pattern.path = path;
- return pattern
- },
- _getPointsWithYOffset: function(points, offset) {
- return points.map(function(point, index) {
- if (index % 2 !== 0) {
- return point + offset
- }
- return point
- })
- },
- clipRect: function(x, y, width, height) {
- var that = this;
- var id = getNextDefsSvgId();
- var clipPath = that._createElement("clipPath", {
- id: id
- }).append(that._defs);
- var rect = that.rect(x, y, width, height).append(clipPath);
- rect.id = id;
- rect.clipPath = clipPath;
- rect.remove = function() {
- throw "Not implemented"
- };
- rect.dispose = function() {
- clipPath.dispose();
- clipPath = null;
- return this
- };
- return rect
- },
- shadowFilter: function(x, y, width, height, offsetX, offsetY, blur, color, opacity) {
- var that = this;
- var id = getNextDefsSvgId();
- var filter = that._createElement("filter", {
- id: id,
- x: x || 0,
- y: y || 0,
- width: width || 0,
- height: height || 0
- }).append(that._defs);
- var gaussianBlur = that._createElement("feGaussianBlur", {
- "in": "SourceGraphic",
- result: "gaussianBlurResult",
- stdDeviation: blur || 0
- }).append(filter);
- var offset = that._createElement("feOffset", {
- "in": "gaussianBlurResult",
- result: "offsetResult",
- dx: offsetX || 0,
- dy: offsetY || 0
- }).append(filter);
- var flood = that._createElement("feFlood", {
- result: "floodResult",
- "flood-color": color || "",
- "flood-opacity": opacity
- }).append(filter);
- var composite = that._createElement("feComposite", {
- "in": "floodResult",
- in2: "offsetResult",
- operator: "in",
- result: "compositeResult"
- }).append(filter);
- var finalComposite = that._createElement("feComposite", {
- "in": "SourceGraphic",
- in2: "compositeResult",
- operator: "over"
- }).append(filter);
- filter.id = id;
- filter.gaussianBlur = gaussianBlur;
- filter.offset = offset;
- filter.flood = flood;
- filter.composite = composite;
- filter.finalComposite = finalComposite;
- filter.attr = function(attrs) {
- var that = this;
- var filterAttrs = {};
- var offsetAttrs = {};
- var floodAttrs = {};
- "x" in attrs && (filterAttrs.x = attrs.x);
- "y" in attrs && (filterAttrs.y = attrs.y);
- "width" in attrs && (filterAttrs.width = attrs.width);
- "height" in attrs && (filterAttrs.height = attrs.height);
- baseAttr(that, filterAttrs);
- "blur" in attrs && that.gaussianBlur.attr({
- stdDeviation: attrs.blur
- });
- "offsetX" in attrs && (offsetAttrs.dx = attrs.offsetX);
- "offsetY" in attrs && (offsetAttrs.dy = attrs.offsetY);
- that.offset.attr(offsetAttrs);
- "color" in attrs && (floodAttrs["flood-color"] = attrs.color);
- "opacity" in attrs && (floodAttrs["flood-opacity"] = attrs.opacity);
- that.flood.attr(floodAttrs);
- return that
- };
- return filter
- },
- brightFilter: function(type, slope) {
- var that = this;
- var id = getNextDefsSvgId();
- var filter = that._createElement("filter", {
- id: id
- }).append(that._defs);
- var componentTransferElement = that._createElement("feComponentTransfer").append(filter);
- var attrs = {
- type: type,
- slope: slope
- };
- filter.id = id;
- that._createElement("feFuncR", attrs).append(componentTransferElement);
- that._createElement("feFuncG", attrs).append(componentTransferElement);
- that._createElement("feFuncB", attrs).append(componentTransferElement);
- return filter
- },
- getGrayScaleFilter: function() {
- if (this._grayScaleFilter) {
- return this._grayScaleFilter
- }
- var that = this;
- var id = getNextDefsSvgId();
- var filter = that._createElement("filter", {
- id: id
- }).append(that._defs);
- that._createElement("feColorMatrix").attr({
- type: "matrix",
- values: "0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 0.6 0"
- }).append(filter);
- filter.id = id;
- that._grayScaleFilter = filter;
- return filter
- },
- initHatching: function() {
- var storage = this._hatchingStorage = this._hatchingStorage || {
- byHash: {},
- baseId: getNextDefsSvgId()
- };
- var byHash = storage.byHash;
- var name;
- for (name in byHash) {
- byHash[name].pattern.dispose()
- }
- storage.byHash = {};
- storage.refToHash = {};
- storage.nextId = 0
- },
- lockHatching: function(color, hatching, ref) {
- var storage = this._hatchingStorage;
- var hash = getHatchingHash(color, hatching);
- var storageItem;
- var pattern;
- if (storage.refToHash[ref] !== hash) {
- if (ref) {
- this.releaseHatching(ref)
- }
- storageItem = storage.byHash[hash];
- if (!storageItem) {
- pattern = this.pattern(color, hatching, storage.baseId + "-hatching-" + storage.nextId++);
- storageItem = storage.byHash[hash] = {
- pattern: pattern,
- count: 0
- };
- storage.refToHash[pattern.id] = hash
- }++storageItem.count;
- ref = storageItem.pattern.id
- }
- return ref
- },
- releaseHatching: function(ref) {
- var storage = this._hatchingStorage;
- var hash = storage.refToHash[ref];
- var storageItem = storage.byHash[hash];
- if (storageItem && 0 === --storageItem.count) {
- storageItem.pattern.dispose();
- delete storage.byHash[hash];
- delete storage.refToHash[ref]
- }
- }
- };
- function getHatchingHash(color, hatching) {
- return "@" + color + "::" + hatching.step + ":" + hatching.width + ":" + hatching.opacity + ":" + hatching.direction
- }
- var fixFuncIriCallbacks = function() {
- var callbacks = [];
- return {
- add: function(fn) {
- callbacks.push(fn)
- },
- remove: function(fn) {
- callbacks = callbacks.filter(function(el) {
- return el !== fn
- })
- },
- removeByRenderer: function(renderer) {
- callbacks = callbacks.filter(function(el) {
- return el.renderer !== renderer
- })
- },
- fire: function() {
- callbacks.forEach(function(fn) {
- fn()
- })
- }
- }
- }();
- exports.refreshPaths = function() {
- fixFuncIriCallbacks.fire()
- }
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/core/polyfills/weak_map.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var weakMap = windowUtils.hasWindow() ? windowUtils.getWindow().WeakMap : WeakMap;
- if (!weakMap) {
- weakMap = function() {
- var keys = [];
- var values = [];
- this.set = function(key, value) {
- var index = inArray(key, keys);
- if (index === -1) {
- keys.push(key);
- values.push(value)
- } else {
- values[index] = value
- }
- };
- this.get = function(key) {
- var index = inArray(key, keys);
- if (index === -1) {
- return
- }
- return values[index]
- };
- this.has = function(key) {
- var index = inArray(key, keys);
- if (index === -1) {
- return false
- }
- return true
- };
- this.delete = function(key) {
- var index = inArray(key, keys);
- if (index === -1) {
- return
- }
- keys.splice(index, 1);
- values.splice(index, 1)
- }
- }
- }
- module.exports = weakMap
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/core/memorized_callbacks.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
- var MemorizedCallbacks = function() {
- var memory = [];
- var callbacks = Callbacks();
- this.add = function(fn) {
- each(memory, function(_, item) {
- fn.apply(fn, item)
- });
- callbacks.add(fn)
- };
- this.remove = function(fn) {
- callbacks.remove(fn)
- };
- this.fire = function() {
- memory.push(arguments);
- callbacks.fire.apply(callbacks, arguments)
- }
- };
- module.exports = MemorizedCallbacks
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel_format_converter.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _string = __webpack_require__( /*! ../core/utils/string */ 44);
- var _string2 = _interopRequireDefault(_string);
- var _number = __webpack_require__( /*! ../localization/number */ 51);
- var _number2 = _interopRequireDefault(_number);
- var _date = __webpack_require__( /*! ../localization/date */ 32);
- var _date2 = _interopRequireDefault(_date);
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _date3 = __webpack_require__( /*! ../localization/ldml/date.format */ 208);
- var _language_codes = __webpack_require__( /*! ../localization/language_codes */ 279);
- __webpack_require__( /*! ../localization/currency */ 152);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var ARABIC_ZERO_CODE = 1632;
- var DEFINED_NUMBER_FORMTATS = {
- thousands: "#,##0{0},"K"",
- millions: "#,##0{0},,"M"",
- billions: "#,##0{0},,,"B"",
- trillions: "#,##0{0},,,,"T"",
- percent: "0{0}%",
- decimal: "#{0}",
- fixedpoint: "#,##0{0}",
- exponential: "0{0}E+00",
- currency: " "
- };
- var PERIOD_REGEXP = /a+/g;
- var DAY_REGEXP = /E/g;
- var DO_REGEXP = /dE+/g;
- var STANDALONE_MONTH_REGEXP = /L/g;
- var HOUR_REGEXP = /h/g;
- var SLASH_REGEXP = /\//g;
- var SQUARE_OPEN_BRACKET_REGEXP = /\[/g;
- var SQUARE_CLOSE_BRACKET_REGEXP = /]/g;
- var ANY_REGEXP = /./g;
- var excelFormatConverter = module.exports = {
- _applyPrecision: function(format, precision) {
- var result;
- var i;
- if (precision > 0) {
- result = "decimal" !== format ? "." : "";
- for (i = 0; i < precision; i++) {
- result += "0"
- }
- return result
- }
- return ""
- },
- _hasArabicDigits: function(text) {
- var code;
- for (var i = 0; i < text.length; i++) {
- code = text.charCodeAt(i);
- if (code >= ARABIC_ZERO_CODE && code < ARABIC_ZERO_CODE + 10) {
- return true
- }
- }
- return false
- },
- _convertDateFormatToOpenXml: function(format) {
- return format.replace(SLASH_REGEXP, "\\/").split("'").map(function(datePart, index) {
- if (index % 2 === 0) {
- return datePart.replace(PERIOD_REGEXP, "AM/PM").replace(DO_REGEXP, "d").replace(DAY_REGEXP, "d").replace(STANDALONE_MONTH_REGEXP, "M").replace(HOUR_REGEXP, "H").replace(SQUARE_OPEN_BRACKET_REGEXP, "\\[").replace(SQUARE_CLOSE_BRACKET_REGEXP, "\\]")
- }
- if (datePart) {
- return datePart.replace(ANY_REGEXP, "\\$&")
- }
- return "'"
- }).join("")
- },
- _convertDateFormat: function(format) {
- var formattedValue = (_date2.default.format(new Date(2009, 8, 8, 6, 5, 4), format) || "").toString();
- var result = (0, _date3.getFormat)(function(value) {
- return _date2.default.format(value, format)
- });
- if (result) {
- result = this._convertDateFormatToOpenXml(result);
- result = this._getLanguageInfo(formattedValue) + result
- }
- return result
- },
- _getLanguageInfo: function(defaultPattern) {
- var languageID = (0, _language_codes.getLanguageId)();
- var languageIDStr = languageID ? languageID.toString(16) : "";
- var languageInfo = "";
- if (this._hasArabicDigits(defaultPattern)) {
- while (languageIDStr.length < 3) {
- languageIDStr = "0" + languageIDStr
- }
- languageInfo = "[$-2010" + languageIDStr + "]"
- } else {
- if (languageIDStr) {
- languageInfo = "[$-" + languageIDStr + "]"
- }
- }
- return languageInfo
- },
- _convertNumberFormat: function(format, precision, currency) {
- var result;
- var excelFormat;
- if ("currency" === format) {
- excelFormat = _number2.default.getOpenXmlCurrencyFormat(currency)
- } else {
- excelFormat = DEFINED_NUMBER_FORMTATS[format.toLowerCase()]
- }
- if (excelFormat) {
- result = _string2.default.format(excelFormat, this._applyPrecision(format, precision))
- }
- return result
- },
- convertFormat: function(format, precision, type, currency) {
- if ((0, _type.isDefined)(format)) {
- if ("date" === type) {
- return excelFormatConverter._convertDateFormat(format)
- } else {
- if ((0, _type.isString)(format) && DEFINED_NUMBER_FORMTATS[format.toLowerCase()]) {
- return excelFormatConverter._convertNumberFormat(format, precision, currency)
- }
- }
- }
- }
- }
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/animation/presets/presets.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Component = __webpack_require__( /*! ../../core/component */ 133);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var fx = __webpack_require__( /*! ../fx */ 38);
- var directionPostfixes = {
- forward: " dx-forward",
- backward: " dx-backward",
- none: " dx-no-direction",
- undefined: " dx-no-direction"
- };
- var optionPrefix = "preset_";
- var AnimationPresetCollection = Component.inherit({
- ctor: function() {
- this.callBase.apply(this, arguments);
- this._registeredPresets = [];
- this.resetToDefaults()
- },
- _getDefaultOptions: function() {
- return extend(this.callBase(), {
- defaultAnimationDuration: 400,
- defaultAnimationDelay: 0,
- defaultStaggerAnimationDuration: 300,
- defaultStaggerAnimationDelay: 40,
- defaultStaggerAnimationStartDelay: 500
- })
- },
- _defaultOptionsRules: function() {
- return this.callBase().concat([{
- device: function(_device) {
- return _device.phone
- },
- options: {
- defaultStaggerAnimationDuration: 350,
- defaultStaggerAnimationDelay: 50,
- defaultStaggerAnimationStartDelay: 0
- }
- }, {
- device: function() {
- return devices.current().android || devices.real.android
- },
- options: {
- defaultAnimationDelay: 100
- }
- }])
- },
- _getPresetOptionName: function(animationName) {
- return optionPrefix + animationName
- },
- _createAndroidSlideAnimationConfig: function(throughOpacity, widthMultiplier) {
- var that = this;
- var createBaseConfig = function(configModifier) {
- return {
- type: "slide",
- delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay,
- duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration
- }
- };
- return {
- enter: function($element, configModifier) {
- var width = $element.parent().width() * widthMultiplier;
- var direction = configModifier.direction;
- var config = createBaseConfig(configModifier);
- config.to = {
- left: 0,
- opacity: 1
- };
- if ("forward" === direction) {
- config.from = {
- left: width,
- opacity: throughOpacity
- }
- } else {
- if ("backward" === direction) {
- config.from = {
- left: -width,
- opacity: throughOpacity
- }
- } else {
- config.from = {
- left: 0,
- opacity: 0
- }
- }
- }
- return fx.createAnimation($element, config)
- },
- leave: function($element, configModifier) {
- var width = $element.parent().width() * widthMultiplier;
- var direction = configModifier.direction;
- var config = createBaseConfig(configModifier);
- config.from = {
- left: 0,
- opacity: 1
- };
- if ("forward" === direction) {
- config.to = {
- left: -width,
- opacity: throughOpacity
- }
- } else {
- if ("backward" === direction) {
- config.to = {
- left: width,
- opacity: throughOpacity
- }
- } else {
- config.to = {
- left: 0,
- opacity: 0
- }
- }
- }
- return fx.createAnimation($element, config)
- }
- }
- },
- _createOpenDoorConfig: function() {
- var that = this;
- var createBaseConfig = function(configModifier) {
- return {
- type: "css",
- extraCssClasses: "dx-opendoor-animation",
- delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay,
- duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration
- }
- };
- return {
- enter: function($element, configModifier) {
- var direction = configModifier.direction;
- var config = createBaseConfig(configModifier);
- config.delay = "none" === direction ? config.delay : config.duration;
- config.from = "dx-enter dx-opendoor-animation" + directionPostfixes[direction];
- config.to = "dx-enter-active";
- return fx.createAnimation($element, config)
- },
- leave: function($element, configModifier) {
- var direction = configModifier.direction;
- var config = createBaseConfig(configModifier);
- config.from = "dx-leave dx-opendoor-animation" + directionPostfixes[direction];
- config.to = "dx-leave-active";
- return fx.createAnimation($element, config)
- }
- }
- },
- _createWinPopConfig: function() {
- var that = this;
- var baseConfig = {
- type: "css",
- extraCssClasses: "dx-win-pop-animation",
- duration: that.option("defaultAnimationDuration")
- };
- return {
- enter: function($element, configModifier) {
- var config = baseConfig;
- var direction = configModifier.direction;
- config.delay = "none" === direction ? that.option("defaultAnimationDelay") : that.option("defaultAnimationDuration") / 2;
- config.from = "dx-enter dx-win-pop-animation" + directionPostfixes[direction];
- config.to = "dx-enter-active";
- return fx.createAnimation($element, config)
- },
- leave: function($element, configModifier) {
- var config = baseConfig;
- var direction = configModifier.direction;
- config.delay = that.option("defaultAnimationDelay");
- config.from = "dx-leave dx-win-pop-animation" + directionPostfixes[direction];
- config.to = "dx-leave-active";
- return fx.createAnimation($element, config)
- }
- }
- },
- resetToDefaults: function() {
- this.clear();
- this.registerDefaultPresets();
- this.applyChanges()
- },
- clear: function(name) {
- var that = this;
- var newRegisteredPresets = [];
- each(this._registeredPresets, function(index, preset) {
- if (!name || name === preset.name) {
- that.option(that._getPresetOptionName(preset.name), void 0)
- } else {
- newRegisteredPresets.push(preset)
- }
- });
- this._registeredPresets = newRegisteredPresets;
- this.applyChanges()
- },
- registerPreset: function(name, config) {
- this._registeredPresets.push({
- name: name,
- config: config
- })
- },
- applyChanges: function() {
- var that = this;
- var customRules = [];
- each(this._registeredPresets, function(index, preset) {
- var rule = {
- device: preset.config.device,
- options: {}
- };
- rule.options[that._getPresetOptionName(preset.name)] = preset.config.animation;
- customRules.push(rule)
- });
- this._setOptionsByDevice(customRules)
- },
- getPreset: function(name) {
- var result = name;
- while ("string" === typeof result) {
- result = this.option(this._getPresetOptionName(result))
- }
- return result
- },
- registerDefaultPresets: function() {
- this.registerPreset("pop", {
- animation: {
- extraCssClasses: "dx-android-pop-animation",
- delay: this.option("defaultAnimationDelay"),
- duration: this.option("defaultAnimationDuration")
- }
- });
- this.registerPreset("openDoor", {
- animation: this._createOpenDoorConfig()
- });
- this.registerPreset("win-pop", {
- animation: this._createWinPopConfig()
- });
- this.registerPreset("fade", {
- animation: {
- extraCssClasses: "dx-fade-animation",
- delay: this.option("defaultAnimationDelay"),
- duration: this.option("defaultAnimationDuration")
- }
- });
- this.registerPreset("slide", {
- device: function() {
- return devices.current().android || devices.real.android
- },
- animation: this._createAndroidSlideAnimationConfig(1, 1)
- });
- this.registerPreset("slide", {
- device: function() {
- return !devices.current().android && !devices.real.android
- },
- animation: {
- extraCssClasses: "dx-slide-animation",
- delay: this.option("defaultAnimationDelay"),
- duration: this.option("defaultAnimationDuration")
- }
- });
- this.registerPreset("ios7-slide", {
- animation: {
- extraCssClasses: "dx-ios7-slide-animation",
- delay: this.option("defaultAnimationDelay"),
- duration: this.option("defaultAnimationDuration")
- }
- });
- this.registerPreset("overflow", {
- animation: {
- extraCssClasses: "dx-overflow-animation",
- delay: this.option("defaultAnimationDelay"),
- duration: this.option("defaultAnimationDuration")
- }
- });
- this.registerPreset("ios7-toolbar", {
- device: function() {
- return !devices.current().android && !devices.real.android
- },
- animation: {
- extraCssClasses: "dx-ios7-toolbar-animation",
- delay: this.option("defaultAnimationDelay"),
- duration: this.option("defaultAnimationDuration")
- }
- });
- this.registerPreset("ios7-toolbar", {
- device: function() {
- return devices.current().android || devices.real.android
- },
- animation: this._createAndroidSlideAnimationConfig(0, .4)
- });
- this.registerPreset("stagger-fade", {
- animation: {
- extraCssClasses: "dx-fade-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- });
- this.registerPreset("stagger-slide", {
- animation: {
- extraCssClasses: "dx-slide-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- });
- this.registerPreset("stagger-fade-slide", {
- animation: {
- extraCssClasses: "dx-fade-slide-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- });
- this.registerPreset("stagger-drop", {
- animation: {
- extraCssClasses: "dx-drop-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- });
- this.registerPreset("stagger-fade-drop", {
- animation: {
- extraCssClasses: "dx-fade-drop-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- });
- this.registerPreset("stagger-fade-rise", {
- animation: {
- extraCssClasses: "dx-fade-rise-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- });
- this.registerPreset("stagger-3d-drop", {
- animation: {
- extraCssClasses: "dx-3d-drop-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- });
- this.registerPreset("stagger-fade-zoom", {
- animation: {
- extraCssClasses: "dx-fade-zoom-animation",
- staggerDelay: this.option("defaultStaggerAnimationDelay"),
- duration: this.option("defaultStaggerAnimationDuration"),
- delay: this.option("defaultStaggerAnimationStartDelay")
- }
- })
- }
- });
- exports.PresetCollection = AnimationPresetCollection;
- var animationPresets = new AnimationPresetCollection;
- exports.presets = animationPresets
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/integration/angular/module.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var angular = __webpack_require__( /*! angular */ 270);
- module.exports = angular.module("dx", [])
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/data/query_adapters.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = {}
- },
- /*!****************************************************************************************!*\
- !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.strategy.plain.js ***!
- \****************************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var EditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy */ 469);
- var PlainEditStrategy = EditStrategy.inherit({
- _getPlainItems: function() {
- return this._collectionWidget.option("items") || []
- },
- getIndexByItemData: function(itemData) {
- var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
- if (keyOf) {
- return this.getIndexByKey(keyOf(itemData))
- } else {
- return inArray(itemData, this._getPlainItems())
- }
- },
- getItemDataByIndex: function(index) {
- return this._getPlainItems()[index]
- },
- deleteItemAtIndex: function(index) {
- this._getPlainItems().splice(index, 1)
- },
- itemsGetter: function() {
- return this._getPlainItems()
- },
- getKeysByItems: function(items) {
- var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
- var result = items;
- if (keyOf) {
- result = [];
- for (var i = 0; i < items.length; i++) {
- result.push(keyOf(items[i]))
- }
- }
- return result
- },
- getIndexByKey: function(key) {
- var cache = this._cache;
- var keys = cache && cache.keys || this.getKeysByItems(this._getPlainItems());
- if (cache && !cache.keys) {
- cache.keys = keys
- }
- if ("object" === _typeof(key)) {
- for (var i = 0, length = keys.length; i < length; i++) {
- if (this._equalKeys(key, keys[i])) {
- return i
- }
- }
- } else {
- return keys.indexOf(key)
- }
- return -1
- },
- getItemsByKeys: function(keys, items) {
- return (items || keys).slice()
- },
- moveItemAtIndexToIndex: function(movingIndex, destinationIndex) {
- var items = this._getPlainItems();
- var movedItemData = items[movingIndex];
- items.splice(movingIndex, 1);
- items.splice(destinationIndex, 0, movedItemData)
- },
- _isItemIndex: function(index) {
- return "number" === typeof index && Math.round(index) === index
- },
- _getNormalizedItemIndex: function(itemElement) {
- return this._collectionWidget._itemElements().index(itemElement)
- },
- _normalizeItemIndex: function(index) {
- return index
- },
- _denormalizeItemIndex: function(index) {
- return index
- },
- _getItemByNormalizedIndex: function(index) {
- return index > -1 ? this._collectionWidget._itemElements().eq(index) : null
- },
- _itemsFromSameParent: function() {
- return true
- }
- });
- module.exports = PlainEditStrategy
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/localization/globalize/number.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- __webpack_require__( /*! ./core */ 127);
- var Globalize = __webpack_require__( /*! globalize */ 72);
- var numberLocalization = __webpack_require__( /*! ../number */ 51);
- var errors = __webpack_require__( /*! ../../core/errors */ 21);
- __webpack_require__( /*! globalize/number */ 72);
- if (Globalize && Globalize.formatNumber) {
- var enNumbers = {
- main: {
- en: {
- identity: {
- version: {
- _cldrVersion: "28",
- _number: "$Revision: 11972 $"
- },
- language: "en"
- },
- numbers: {
- defaultNumberingSystem: "latn",
- otherNumberingSystems: {
- "native": "latn"
- },
- minimumGroupingDigits: "1",
- "symbols-numberSystem-latn": {
- decimal: ".",
- group: ",",
- list: ";",
- percentSign: "%",
- plusSign: "+",
- minusSign: "-",
- exponential: "E",
- superscriptingExponent: "\xd7",
- perMille: "\u2030",
- infinity: "\u221e",
- nan: "NaN",
- timeSeparator: ":"
- },
- "decimalFormats-numberSystem-latn": {
- standard: "#,##0.###",
- "long": {
- decimalFormat: {
- "1000-count-one": "0 thousand",
- "1000-count-other": "0 thousand",
- "10000-count-one": "00 thousand",
- "10000-count-other": "00 thousand",
- "100000-count-one": "000 thousand",
- "100000-count-other": "000 thousand",
- "1000000-count-one": "0 million",
- "1000000-count-other": "0 million",
- "10000000-count-one": "00 million",
- "10000000-count-other": "00 million",
- "100000000-count-one": "000 million",
- "100000000-count-other": "000 million",
- "1000000000-count-one": "0 billion",
- "1000000000-count-other": "0 billion",
- "10000000000-count-one": "00 billion",
- "10000000000-count-other": "00 billion",
- "100000000000-count-one": "000 billion",
- "100000000000-count-other": "000 billion",
- "1000000000000-count-one": "0 trillion",
- "1000000000000-count-other": "0 trillion",
- "10000000000000-count-one": "00 trillion",
- "10000000000000-count-other": "00 trillion",
- "100000000000000-count-one": "000 trillion",
- "100000000000000-count-other": "000 trillion"
- }
- },
- "short": {
- decimalFormat: {
- "1000-count-one": "0K",
- "1000-count-other": "0K",
- "10000-count-one": "00K",
- "10000-count-other": "00K",
- "100000-count-one": "000K",
- "100000-count-other": "000K",
- "1000000-count-one": "0M",
- "1000000-count-other": "0M",
- "10000000-count-one": "00M",
- "10000000-count-other": "00M",
- "100000000-count-one": "000M",
- "100000000-count-other": "000M",
- "1000000000-count-one": "0B",
- "1000000000-count-other": "0B",
- "10000000000-count-one": "00B",
- "10000000000-count-other": "00B",
- "100000000000-count-one": "000B",
- "100000000000-count-other": "000B",
- "1000000000000-count-one": "0T",
- "1000000000000-count-other": "0T",
- "10000000000000-count-one": "00T",
- "10000000000000-count-other": "00T",
- "100000000000000-count-one": "000T",
- "100000000000000-count-other": "000T"
- }
- }
- },
- "scientificFormats-numberSystem-latn": {
- standard: "#E0"
- },
- "percentFormats-numberSystem-latn": {
- standard: "#,##0%"
- },
- "currencyFormats-numberSystem-latn": {
- currencySpacing: {
- beforeCurrency: {
- currencyMatch: "[:^S:]",
- surroundingMatch: "[:digit:]",
- insertBetween: "\xa0"
- },
- afterCurrency: {
- currencyMatch: "[:^S:]",
- surroundingMatch: "[:digit:]",
- insertBetween: "\xa0"
- }
- },
- standard: "\xa4#,##0.00",
- accounting: "\xa4#,##0.00;(\xa4#,##0.00)",
- "short": {
- standard: {
- "1000-count-one": "\xa40K",
- "1000-count-other": "\xa40K",
- "10000-count-one": "\xa400K",
- "10000-count-other": "\xa400K",
- "100000-count-one": "\xa4000K",
- "100000-count-other": "\xa4000K",
- "1000000-count-one": "\xa40M",
- "1000000-count-other": "\xa40M",
- "10000000-count-one": "\xa400M",
- "10000000-count-other": "\xa400M",
- "100000000-count-one": "\xa4000M",
- "100000000-count-other": "\xa4000M",
- "1000000000-count-one": "\xa40B",
- "1000000000-count-other": "\xa40B",
- "10000000000-count-one": "\xa400B",
- "10000000000-count-other": "\xa400B",
- "100000000000-count-one": "\xa4000B",
- "100000000000-count-other": "\xa4000B",
- "1000000000000-count-one": "\xa40T",
- "1000000000000-count-other": "\xa40T",
- "10000000000000-count-one": "\xa400T",
- "10000000000000-count-other": "\xa400T",
- "100000000000000-count-one": "\xa4000T",
- "100000000000000-count-other": "\xa4000T"
- }
- },
- "unitPattern-count-one": "{0} {1}",
- "unitPattern-count-other": "{0} {1}"
- },
- "miscPatterns-numberSystem-latn": {
- atLeast: "{0}+",
- range: "{0}\u2013{1}"
- }
- }
- }
- }
- };
- if ("en" === Globalize.locale().locale) {
- Globalize.load(enNumbers);
- Globalize.locale("en")
- }
- var formattersCache = {};
- var getFormatter = function(format) {
- var formatter;
- var formatCacheKey;
- if ("object" === _typeof(format)) {
- formatCacheKey = Globalize.locale().locale + ":" + JSON.stringify(format)
- } else {
- formatCacheKey = Globalize.locale().locale + ":" + format
- }
- formatter = formattersCache[formatCacheKey];
- if (!formatter) {
- formatter = formattersCache[formatCacheKey] = Globalize.numberFormatter(format)
- }
- return formatter
- };
- var globalizeNumberLocalization = {
- _formatNumberCore: function(value, format, formatConfig) {
- if ("exponential" === format) {
- return this.callBase.apply(this, arguments)
- }
- return getFormatter(this._normalizeFormatConfig(format, formatConfig, value))(value)
- },
- _normalizeFormatConfig: function(format, formatConfig, value) {
- var config;
- if ("decimal" === format) {
- config = {
- minimumIntegerDigits: formatConfig.precision || 1,
- useGrouping: false,
- minimumFractionDigits: 0,
- maximumFractionDigits: 20,
- round: value < 0 ? "ceil" : "floor"
- }
- } else {
- config = this._getPrecisionConfig(formatConfig.precision)
- }
- if ("percent" === format) {
- config.style = "percent"
- }
- return config
- },
- _getPrecisionConfig: function(precision) {
- var config;
- if (null === precision) {
- config = {
- minimumFractionDigits: 0,
- maximumFractionDigits: 20
- }
- } else {
- config = {
- minimumFractionDigits: precision || 0,
- maximumFractionDigits: precision || 0
- }
- }
- return config
- },
- format: function(value, _format) {
- if ("number" !== typeof value) {
- return value
- }
- _format = this._normalizeFormat(_format);
- if (!_format || "function" !== typeof _format && !_format.type && !_format.formatter) {
- return getFormatter(_format)(value)
- }
- return this.callBase.apply(this, arguments)
- },
- parse: function(text, format) {
- if (!text) {
- return
- }
- if (format && (format.parser || "string" === typeof format)) {
- return this.callBase.apply(this, arguments)
- }
- if (format) {
- errors.log("W0011")
- }
- var result = Globalize.parseNumber(text);
- if (isNaN(result)) {
- result = this.callBase.apply(this, arguments)
- }
- return result
- }
- };
- numberLocalization.inject(globalizeNumberLocalization)
- }
- }, , , , , , , , , , , , , , , , , ,
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/components/legend.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _extend2 = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _layout_element = __webpack_require__( /*! ../core/layout_element */ 242);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _title = __webpack_require__( /*! ../core/title */ 105);
- var _title2 = _interopRequireDefault(_title);
- var _object = __webpack_require__( /*! ../../core/utils/object */ 47);
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var _Number = Number;
- var _math = Math;
- var _round = _math.round;
- var _max = _math.max;
- var _min = _math.min;
- var _ceil = _math.ceil;
- var _isDefined = _type.isDefined;
- var _isFunction = _type.isFunction;
- var _enumParser = _utils.enumParser;
- var _normalizeEnum = _utils.normalizeEnum;
- var _extend = _extend2.extend;
- var DEFAULT_MARGIN = 10;
- var DEFAULT_MARKER_HATCHING_WIDTH = 2;
- var DEFAULT_MARKER_HATCHING_STEP = 5;
- var CENTER = "center";
- var RIGHT = "right";
- var LEFT = "left";
- var TOP = "top";
- var BOTTOM = "bottom";
- var HORIZONTAL = "horizontal";
- var VERTICAL = "vertical";
- var INSIDE = "inside";
- var OUTSIDE = "outside";
- var NONE = "none";
- var HEIGHT = "height";
- var WIDTH = "width";
- var parseHorizontalAlignment = _enumParser([LEFT, CENTER, RIGHT]);
- var parseVerticalAlignment = _enumParser([TOP, BOTTOM]);
- var parseOrientation = _enumParser([VERTICAL, HORIZONTAL]);
- var parseItemTextPosition = _enumParser([LEFT, RIGHT, TOP, BOTTOM]);
- var parsePosition = _enumParser([OUTSIDE, INSIDE]);
- var parseItemsAlignment = _enumParser([LEFT, CENTER, RIGHT]);
- function getState(state, color) {
- if (!state) {
- return
- }
- var colorFromAction = state.fill;
- return {
- fill: colorFromAction === NONE ? color : colorFromAction,
- hatching: _extend({}, state.hatching, {
- step: DEFAULT_MARKER_HATCHING_STEP,
- width: DEFAULT_MARKER_HATCHING_WIDTH
- })
- }
- }
- function parseMargins(options) {
- var margin = options.margin;
- if (margin >= 0) {
- margin = _Number(options.margin);
- margin = {
- top: margin,
- bottom: margin,
- left: margin,
- right: margin
- }
- } else {
- margin = {
- top: margin.top >= 0 ? _Number(margin.top) : DEFAULT_MARGIN,
- bottom: margin.bottom >= 0 ? _Number(margin.bottom) : DEFAULT_MARGIN,
- left: margin.left >= 0 ? _Number(margin.left) : DEFAULT_MARGIN,
- right: margin.right >= 0 ? _Number(margin.right) : DEFAULT_MARGIN
- }
- }
- options.margin = margin
- }
- function getSizeItem(options, markerSize, labelBBox) {
- var defaultXMargin = 7;
- var defaultTopMargin = 4;
- var width;
- var height;
- switch (options.itemTextPosition) {
- case LEFT:
- case RIGHT:
- width = markerSize + defaultXMargin + labelBBox.width;
- height = _max(markerSize, labelBBox.height);
- break;
- case TOP:
- case BOTTOM:
- width = _max(markerSize, labelBBox.width);
- height = markerSize + defaultTopMargin + labelBBox.height
- }
- return {
- width: width,
- height: height
- }
- }
- function calculateBBoxLabelAndMarker(markerBBox, labelBBox) {
- var bBox = {};
- bBox.left = _min(markerBBox.x, labelBBox.x);
- bBox.top = _min(markerBBox.y, labelBBox.y);
- bBox.right = _max(markerBBox.x + markerBBox.width, labelBBox.x + labelBBox.width);
- bBox.bottom = _max(markerBBox.y + markerBBox.height, labelBBox.y + labelBBox.height);
- return bBox
- }
- function applyMarkerState(id, idToIndexMap, items, stateName) {
- var item = idToIndexMap && items[idToIndexMap[id]];
- if (item) {
- item.marker.smartAttr(item.states[stateName])
- }
- }
- function parseOptions(options, textField, allowInsidePosition) {
- if (!options) {
- return null
- }
- var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
- debug.assertParam(options.visible, "Visibility was not passed");
- debug.assertParam(options.markerSize, "markerSize was not passed");
- debug.assertParam(options.font.color, "fontColor was not passed");
- debug.assertParam(options.font.family, "fontFamily was not passed");
- debug.assertParam(options.font.size, "fontSize was not passed");
- debug.assertParam(options.paddingLeftRight, "paddingLeftRight was not passed");
- debug.assertParam(options.paddingTopBottom, "paddingTopBottom was not passed");
- debug.assertParam(options.columnItemSpacing, "columnItemSpacing was not passed");
- debug.assertParam(options.rowItemSpacing, "rowItemSpacing was not passed");
- parseMargins(options);
- options.horizontalAlignment = parseHorizontalAlignment(options.horizontalAlignment, RIGHT);
- options.verticalAlignment = parseVerticalAlignment(options.verticalAlignment, options.horizontalAlignment === CENTER ? BOTTOM : TOP);
- options.orientation = parseOrientation(options.orientation, options.horizontalAlignment === CENTER ? HORIZONTAL : VERTICAL);
- options.itemTextPosition = parseItemTextPosition(options.itemTextPosition, options.orientation === HORIZONTAL ? BOTTOM : RIGHT);
- options.position = allowInsidePosition ? parsePosition(options.position, OUTSIDE) : OUTSIDE;
- options.itemsAlignment = parseItemsAlignment(options.itemsAlignment, null);
- options.hoverMode = _normalizeEnum(options.hoverMode);
- options.customizeText = _isFunction(options.customizeText) ? options.customizeText : function() {
- return this[textField]
- };
- options.customizeHint = _isFunction(options.customizeHint) ? options.customizeHint : _common.noop;
- options._incidentOccurred = options._incidentOccurred || _common.noop;
- return options
- }
- function createSquareMarker(renderer, size) {
- return renderer.rect(0, 0, size, size)
- }
- function createCircleMarker(renderer, size) {
- return renderer.circle(size / 2, size / 2, size / 2)
- }
- function isCircle(type) {
- return "circle" === _normalizeEnum(type)
- }
- function inRect(rect, x, y) {
- return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom
- }
- function checkLinesSize(lines, layoutOptions, countItems, margins) {
- var position = {
- x: 0,
- y: 0
- };
- var maxMeasureLength = 0;
- var maxAltMeasureLength = 0;
- var margin = 0;
- if ("y" === layoutOptions.direction) {
- margin = margins.top + margins.bottom
- } else {
- margin = margins.left + margins.right
- }
- lines.forEach(function(line, i) {
- var firstItem = line[0];
- var lineLength = line.length;
- line.forEach(function(item, index) {
- var offset = item.offset || layoutOptions.spacing;
- position[layoutOptions.direction] += item[layoutOptions.measure] + (index !== lineLength - 1 ? offset : 0);
- maxMeasureLength = _max(maxMeasureLength, position[layoutOptions.direction])
- });
- position[layoutOptions.direction] = 0;
- position[layoutOptions.altDirection] += firstItem[layoutOptions.altMeasure] + firstItem.altOffset || layoutOptions.altSpacing;
- maxAltMeasureLength = _max(maxAltMeasureLength, position[layoutOptions.altDirection])
- });
- if (maxMeasureLength + margin > layoutOptions.length) {
- layoutOptions.countItem = decreaseItemCount(layoutOptions, countItems);
- return true
- }
- }
- function decreaseItemCount(layoutOptions, countItems) {
- layoutOptions.altCountItem++;
- return _ceil(countItems / layoutOptions.altCountItem)
- }
- function getLineLength(line, layoutOptions) {
- return line.reduce(function(lineLength, item) {
- var offset = item.offset || layoutOptions.spacing;
- return lineLength + item[layoutOptions.measure] + offset
- }, 0)
- }
- function getMaxLineLength(lines, layoutOptions) {
- return lines.reduce(function(maxLineLength, line) {
- return _max(maxLineLength, getLineLength(line, layoutOptions))
- }, 0)
- }
- function getInitPositionForDirection(line, layoutOptions, maxLineLength) {
- var lineLength = getLineLength(line, layoutOptions);
- var initPosition;
- switch (layoutOptions.itemsAlignment) {
- case RIGHT:
- initPosition = maxLineLength - lineLength;
- break;
- case CENTER:
- initPosition = (maxLineLength - lineLength) / 2;
- break;
- default:
- initPosition = 0
- }
- return initPosition
- }
- function getPos(layoutOptions) {
- switch (layoutOptions.itemTextPosition) {
- case BOTTOM:
- return {
- horizontal: CENTER, vertical: TOP
- };
- case TOP:
- return {
- horizontal: CENTER, vertical: BOTTOM
- };
- case LEFT:
- return {
- horizontal: RIGHT, vertical: CENTER
- };
- case RIGHT:
- return {
- horizontal: LEFT, vertical: CENTER
- }
- }
- }
- function getLines(lines, layoutOptions, itemIndex) {
- var tableLine = {};
- if (itemIndex % layoutOptions.countItem === 0) {
- if (layoutOptions.markerOffset) {
- lines.push([], [])
- } else {
- lines.push([])
- }
- }
- if (layoutOptions.markerOffset) {
- tableLine.firstLine = lines[lines.length - 1];
- tableLine.secondLine = lines[lines.length - 2]
- } else {
- tableLine.firstLine = tableLine.secondLine = lines[lines.length - 1]
- }
- return tableLine
- }
- function setMaxInLine(line, measure) {
- var maxLineSize = line.reduce(function(maxLineSize, item) {
- var itemMeasure = item ? item[measure] : maxLineSize;
- return _max(maxLineSize, itemMeasure)
- }, 0);
- line.forEach(function(item) {
- if (item) {
- item[measure] = maxLineSize
- }
- })
- }
- function transpose(array) {
- var width = array.length;
- var height = array[0].length;
- var i;
- var j;
- var transposeArray = [];
- for (i = 0; i < height; i++) {
- transposeArray[i] = [];
- for (j = 0; j < width; j++) {
- transposeArray[i][j] = array[j][i]
- }
- }
- return transposeArray
- }
- function getAlign(position) {
- switch (position) {
- case TOP:
- case BOTTOM:
- return CENTER;
- case LEFT:
- return RIGHT;
- case RIGHT:
- return LEFT
- }
- }
- var getMarkerCreator = function(type) {
- return isCircle(type) ? createCircleMarker : createSquareMarker
- };
- function getTitleHorizontalAlignment(options) {
- if (options.horizontalAlignment === CENTER) {
- return CENTER
- } else {
- if (options.itemTextPosition === RIGHT) {
- return LEFT
- } else {
- if (options.itemTextPosition === LEFT) {
- return RIGHT
- } else {
- return CENTER
- }
- }
- }
- }
- var _Legend = exports.Legend = function(settings) {
- var that = this;
- that._renderer = settings.renderer;
- that._legendGroup = settings.group;
- that._backgroundClass = settings.backgroundClass;
- that._itemGroupClass = settings.itemGroupClass;
- that._textField = settings.textField;
- that._getCustomizeObject = settings.getFormatObject;
- that._titleGroupClass = settings.titleGroupClass;
- that._allowInsidePosition = settings.allowInsidePosition
- };
- var legendPrototype = _Legend.prototype = (0, _object.clone)(_layout_element.LayoutElement.prototype);
- (0, _extend2.extend)(legendPrototype, {
- constructor: _Legend,
- getOptions: function() {
- return this._options
- },
- update: function(data, options) {
- var themeManagerTitleOptions = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
- var that = this;
- options = that._options = parseOptions(options, that._textField, that._allowInsidePosition) || {};
- that._data = data && options.customizeItems && options.customizeItems(data.slice()) || data;
- that._boundingRect = {
- width: 0,
- height: 0,
- x: 0,
- y: 0
- };
- if (that.isVisible() && !that._title) {
- that._title = new _title2.default.Title({
- renderer: that._renderer,
- cssClass: that._titleGroupClass,
- root: that._legendGroup
- })
- }
- if (that._title) {
- var titleOptions = options.title;
- themeManagerTitleOptions.horizontalAlignment = getTitleHorizontalAlignment(options);
- that._title.update(themeManagerTitleOptions, titleOptions)
- }
- this.erase();
- return that
- },
- isVisible: function() {
- return this._options && this._options.visible
- },
- draw: function(width, height) {
- var that = this;
- var options = that._options;
- var items = that._getItemData();
- that._size = {
- width: width,
- height: height
- };
- that.erase();
- if (!(that.isVisible() && items && items.length)) {
- return that
- }
- that._insideLegendGroup = that._renderer.g().enableLinks().append(that._legendGroup);
- that._title.changeLink(that._insideLegendGroup);
- that._createBackground();
- if (that._title.hasText()) {
- var horizontalPadding = that._background ? 2 * that._options.paddingLeftRight : 0;
- that._title.draw(width - horizontalPadding, height)
- }
- that._markersGroup = that._renderer.g().attr({
- "class": that._itemGroupClass
- }).append(that._insideLegendGroup);
- that._createItems(items);
- that._locateElements(options);
- that._finalUpdate(options);
- var size = that.getLayoutOptions();
- if (size.width > width || size.height > height) {
- that.freeSpace()
- }
- return that
- },
- probeDraw: function(width, height) {
- return this.draw(width, height)
- },
- _createItems: function(items) {
- var that = this;
- var options = that._options;
- var initMarkerSize = options.markerSize;
- var renderer = that._renderer;
- var bBox;
- var maxBBoxHeight = 0;
- var createMarker = getMarkerCreator(options.markerShape);
- that._markersId = {};
- that._items = (items || []).map(function(dataItem, i) {
- var group = that._markersGroup;
- var markerSize = _Number(dataItem.size > 0 ? dataItem.size : initMarkerSize);
- var stateOfDataItem = dataItem.states;
- var normalState = stateOfDataItem.normal;
- var normalStateFill = normalState.fill;
- var marker = createMarker(renderer, markerSize).attr({
- fill: normalStateFill || options.markerColor || options.defaultColor,
- opacity: normalState.opacity
- }).append(group);
- var label = that._createLabel(dataItem, group);
- var states = {
- normal: {
- fill: normalStateFill
- },
- hovered: getState(stateOfDataItem.hover, normalStateFill),
- selected: getState(stateOfDataItem.selection, normalStateFill)
- };
- var labelBBox = label.getBBox();
- if (void 0 !== dataItem.id) {
- that._markersId[dataItem.id] = i
- }
- bBox = getSizeItem(options, markerSize, labelBBox);
- maxBBoxHeight = _max(maxBBoxHeight, bBox.height);
- that._createHint(dataItem, label, marker);
- return {
- label: label,
- labelBBox: labelBBox,
- group: group,
- bBox: bBox,
- marker: marker,
- markerSize: markerSize,
- tracker: {
- id: dataItem.id,
- argument: dataItem.argument,
- argumentIndex: dataItem.argumentIndex
- },
- states: states,
- itemTextPosition: options.itemTextPosition,
- markerOffset: 0,
- bBoxes: []
- }
- });
- if (options.equalRowHeight) {
- that._items.forEach(function(item) {
- return item.bBox.height = maxBBoxHeight
- })
- }
- },
- _getItemData: function() {
- var items = this._data || [];
- var options = this._options || {};
- if (options.inverted) {
- items = items.slice().reverse()
- }
- return items.filter(function(i) {
- return i.visible
- })
- },
- _finalUpdate: function(options) {
- this._adjustBackgroundSettings(options);
- this._setBoundingRect(options.margin)
- },
- erase: function() {
- var that = this;
- var insideLegendGroup = that._insideLegendGroup;
- insideLegendGroup && insideLegendGroup.dispose();
- that._insideLegendGroup = that._markersGroup = that._x1 = that._x2 = that._y2 = that._y2 = null;
- return that
- },
- _locateElements: function(locationOptions) {
- this._moveInInitialValues();
- this._locateRowsColumns(locationOptions)
- },
- _moveInInitialValues: function() {
- var that = this;
- that._title.hasText() && that._title.move([0, 0]);
- that._legendGroup && that._legendGroup.move(0, 0);
- that._background && that._background.attr({
- x: 0,
- y: 0,
- width: 0,
- height: 0
- })
- },
- applySelected: function(id) {
- applyMarkerState(id, this._markersId, this._items, "selected");
- return this
- },
- applyHover: function(id) {
- applyMarkerState(id, this._markersId, this._items, "hovered");
- return this
- },
- resetItem: function(id) {
- applyMarkerState(id, this._markersId, this._items, "normal");
- return this
- },
- _createLabel: function(data, group) {
- var labelFormatObject = this._getCustomizeObject(data);
- var options = this._options;
- var align = getAlign(options.itemTextPosition);
- var text = options.customizeText.call(labelFormatObject, labelFormatObject);
- var fontStyle = _isDefined(data.textOpacity) ? _extend({}, options.font, {
- opacity: data.textOpacity
- }) : options.font;
- return this._renderer.text(text, 0, 0).css((0, _utils.patchFontOptions)(fontStyle)).attr({
- align: align,
- "class": options.cssClass
- }).append(group)
- },
- _createHint: function(data, label, marker) {
- var labelFormatObject = this._getCustomizeObject(data);
- var text = this._options.customizeHint.call(labelFormatObject, labelFormatObject);
- if (_isDefined(text) && "" !== text) {
- label.setTitle(text);
- marker.setTitle(text)
- }
- },
- _createBackground: function() {
- var that = this;
- var isInside = that._options.position === INSIDE;
- var color = that._options.backgroundColor;
- var fill = color || (isInside ? that._options.containerBackgroundColor : NONE);
- if (that._options.border.visible || (isInside || color) && color !== NONE) {
- that._background = that._renderer.rect(0, 0, 0, 0).attr({
- fill: fill,
- "class": that._backgroundClass
- }).append(that._insideLegendGroup)
- }
- },
- _locateRowsColumns: function(options) {
- var that = this;
- var iteration = 0;
- var layoutOptions = that._getItemsLayoutOptions();
- var countItems = that._items.length;
- var lines;
- do {
- lines = [];
- that._createLines(lines, layoutOptions);
- that._alignLines(lines, layoutOptions);
- iteration++
- } while (checkLinesSize(lines, layoutOptions, countItems, options.margin) && iteration < countItems);
- that._applyItemPosition(lines, layoutOptions)
- },
- _createLines: function(lines, layoutOptions) {
- this._items.forEach(function(item, i) {
- var tableLine = getLines(lines, layoutOptions, i);
- var labelBox = {
- width: item.labelBBox.width,
- height: item.labelBBox.height,
- element: item.label,
- bBox: item.labelBBox,
- pos: getPos(layoutOptions),
- itemIndex: i
- };
- var markerBox = {
- width: item.markerSize,
- height: item.markerSize,
- element: item.marker,
- pos: {
- horizontal: CENTER,
- vertical: CENTER
- },
- bBox: {
- width: item.markerSize,
- height: item.markerSize,
- x: 0,
- y: 0
- },
- itemIndex: i
- };
- var firstItem;
- var secondItem;
- var offsetDirection = layoutOptions.markerOffset ? "altOffset" : "offset";
- if (layoutOptions.inverseLabelPosition) {
- firstItem = labelBox;
- secondItem = markerBox
- } else {
- firstItem = markerBox;
- secondItem = labelBox
- }
- firstItem[offsetDirection] = layoutOptions.labelOffset;
- tableLine.secondLine.push(firstItem);
- tableLine.firstLine.push(secondItem)
- })
- },
- _alignLines: function(lines, layoutOptions) {
- var i;
- var measure = layoutOptions.altMeasure;
- lines.forEach(function(line) {
- return setMaxInLine(line, measure)
- });
- measure = layoutOptions.measure;
- if (layoutOptions.itemsAlignment) {
- if (layoutOptions.markerOffset) {
- for (i = 0; i < lines.length;) {
- transpose([lines[i++], lines[i++]]).forEach(processLine)
- }
- }
- } else {
- transpose(lines).forEach(processLine)
- }
- function processLine(line) {
- setMaxInLine(line, measure)
- }
- },
- _applyItemPosition: function(lines, layoutOptions) {
- var that = this;
- var position = {
- x: 0,
- y: 0
- };
- var maxLineLength = getMaxLineLength(lines, layoutOptions);
- lines.forEach(function(line) {
- var firstItem = line[0];
- var altOffset = firstItem.altOffset || layoutOptions.altSpacing;
- position[layoutOptions.direction] = getInitPositionForDirection(line, layoutOptions, maxLineLength);
- line.forEach(function(item) {
- var offset = item.offset || layoutOptions.spacing;
- var wrap = new _layout_element.WrapperLayoutElement(item.element, item.bBox);
- var itemBBoxOptions = {
- x: position.x,
- y: position.y,
- width: item.width,
- height: item.height
- };
- var itemBBox = new _layout_element.WrapperLayoutElement(null, itemBBoxOptions);
- var itemLegend = that._items[item.itemIndex];
- wrap.position({
- of: itemBBox,
- my: item.pos,
- at: item.pos
- });
- itemLegend.bBoxes.push(itemBBox);
- position[layoutOptions.direction] += item[layoutOptions.measure] + offset
- });
- position[layoutOptions.altDirection] += firstItem[layoutOptions.altMeasure] + altOffset
- });
- this._items.forEach(function(item) {
- var itemBBox = calculateBBoxLabelAndMarker(item.bBoxes[0].getLayoutOptions(), item.bBoxes[1].getLayoutOptions());
- var horizontal = that._options.columnItemSpacing / 2;
- var vertical = that._options.rowItemSpacing / 2;
- item.tracker.left = itemBBox.left - horizontal;
- item.tracker.right = itemBBox.right + horizontal;
- item.tracker.top = itemBBox.top - vertical;
- item.tracker.bottom = itemBBox.bottom + vertical
- })
- },
- _getItemsLayoutOptions: function() {
- var that = this;
- var options = that._options;
- var orientation = options.orientation;
- var layoutOptions = {
- itemsAlignment: options.itemsAlignment,
- orientation: options.orientation
- };
- var width = that._size.width - (that._background ? 2 * options.paddingLeftRight : 0);
- var height = that._size.height - (that._background ? 2 * options.paddingTopBottom : 0);
- if (orientation === HORIZONTAL) {
- layoutOptions.length = width;
- layoutOptions.spacing = options.columnItemSpacing;
- layoutOptions.direction = "x";
- layoutOptions.measure = WIDTH;
- layoutOptions.altMeasure = HEIGHT;
- layoutOptions.altDirection = "y";
- layoutOptions.altSpacing = options.rowItemSpacing;
- layoutOptions.countItem = options.columnCount;
- layoutOptions.altCountItem = options.rowCount;
- layoutOptions.marginTextLabel = 4;
- layoutOptions.labelOffset = 7;
- if (options.itemTextPosition === BOTTOM || options.itemTextPosition === TOP) {
- layoutOptions.labelOffset = 4;
- layoutOptions.markerOffset = true
- }
- } else {
- layoutOptions.length = height;
- layoutOptions.spacing = options.rowItemSpacing;
- layoutOptions.direction = "y";
- layoutOptions.measure = HEIGHT;
- layoutOptions.altMeasure = WIDTH;
- layoutOptions.altDirection = "x";
- layoutOptions.altSpacing = options.columnItemSpacing;
- layoutOptions.countItem = options.rowCount;
- layoutOptions.altCountItem = options.columnCount;
- layoutOptions.marginTextLabel = 7;
- layoutOptions.labelOffset = 4;
- if (options.itemTextPosition === RIGHT || options.itemTextPosition === LEFT) {
- layoutOptions.labelOffset = 7;
- layoutOptions.markerOffset = true
- }
- }
- if (!layoutOptions.countItem) {
- if (layoutOptions.altCountItem) {
- layoutOptions.countItem = _ceil(that._items.length / layoutOptions.altCountItem)
- } else {
- layoutOptions.countItem = that._items.length
- }
- }
- if (options.itemTextPosition === TOP || options.itemTextPosition === LEFT) {
- layoutOptions.inverseLabelPosition = true
- }
- layoutOptions.itemTextPosition = options.itemTextPosition;
- layoutOptions.altCountItem = layoutOptions.altCountItem || _ceil(that._items.length / layoutOptions.countItem);
- return layoutOptions
- },
- _adjustBackgroundSettings: function(locationOptions) {
- if (!this._background) {
- return
- }
- var border = locationOptions.border;
- var legendBox = this._calculateTotalBox();
- var backgroundSettings = {
- x: _round(legendBox.x - locationOptions.paddingLeftRight),
- y: _round(legendBox.y - locationOptions.paddingTopBottom),
- width: _round(legendBox.width) + 2 * locationOptions.paddingLeftRight,
- height: _round(legendBox.height),
- opacity: locationOptions.backgroundOpacity
- };
- if (border.visible && border.width && border.color && border.color !== NONE) {
- backgroundSettings["stroke-width"] = border.width;
- backgroundSettings.stroke = border.color;
- backgroundSettings["stroke-opacity"] = border.opacity;
- backgroundSettings.dashStyle = border.dashStyle;
- backgroundSettings.rx = border.cornerRadius || 0;
- backgroundSettings.ry = border.cornerRadius || 0
- }
- this._background.attr(backgroundSettings)
- },
- _setBoundingRect: function(margin) {
- if (!this._insideLegendGroup) {
- return
- }
- var box = this._calculateTotalBox();
- box.height += margin.top + margin.bottom;
- box.widthWithoutMargins = box.width;
- box.width += margin.left + margin.right;
- box.x -= margin.left;
- box.y -= margin.top;
- this._boundingRect = box
- },
- _calculateTotalBox: function() {
- var markerBox = this._markersGroup.getBBox();
- var titleBox = this._title.getCorrectedLayoutOptions();
- var box = this._insideLegendGroup.getBBox();
- var verticalPadding = this._background ? 2 * this._options.paddingTopBottom : 0;
- box.height = markerBox.height + titleBox.height + verticalPadding;
- titleBox.width > box.width && (box.width = titleBox.width);
- return box
- },
- getActionCallback: function(point) {
- var that = this;
- if (that._options.visible) {
- return function(act) {
- that[act](point.index)
- }
- } else {
- return _common.noop
- }
- },
- getLayoutOptions: function() {
- var options = this._options;
- var boundingRect = this._insideLegendGroup ? this._boundingRect : {
- width: 0,
- height: 0,
- x: 0,
- y: 0
- };
- if (options) {
- boundingRect.verticalAlignment = options.verticalAlignment;
- boundingRect.horizontalAlignment = options.horizontalAlignment;
- if (options.orientation === HORIZONTAL) {
- boundingRect.cutLayoutSide = options.verticalAlignment;
- boundingRect.cutSide = "vertical"
- } else {
- if (options.horizontalAlignment === CENTER) {
- boundingRect.cutLayoutSide = options.verticalAlignment;
- boundingRect.cutSide = "vertical"
- } else {
- boundingRect.cutLayoutSide = options.horizontalAlignment;
- boundingRect.cutSide = "horizontal"
- }
- }
- boundingRect.position = {
- horizontal: options.horizontalAlignment,
- vertical: options.verticalAlignment
- };
- return boundingRect
- }
- return null
- },
- shift: function(x, y) {
- var that = this;
- var box = {};
- if (that._insideLegendGroup) {
- that._insideLegendGroup.attr({
- translateX: x - that._boundingRect.x,
- translateY: y - that._boundingRect.y
- })
- }
- that._title && that._shiftTitle(that._boundingRect.widthWithoutMargins);
- that._markersGroup && that._shiftMarkers();
- if (that._insideLegendGroup) {
- box = that._legendGroup.getBBox()
- }
- that._x1 = box.x;
- that._y1 = box.y;
- that._x2 = box.x + box.width;
- that._y2 = box.y + box.height;
- return that
- },
- _shiftTitle: function(boxWidth) {
- var that = this;
- var title = that._title;
- var titleBox = title.getCorrectedLayoutOptions();
- if (!titleBox || !title.hasText()) {
- return
- }
- var width = boxWidth - (that._background ? 2 * that._options.paddingLeftRight : 0);
- var titleOptions = title.getOptions();
- var titleY = titleBox.y + titleOptions.margin.top;
- var titleX = 0;
- if (titleOptions.verticalAlignment === BOTTOM) {
- titleY += that._markersGroup.getBBox().height
- }
- if (titleOptions.horizontalAlignment === RIGHT) {
- titleX = width - titleBox.width
- } else {
- if (titleOptions.horizontalAlignment === CENTER) {
- titleX = (width - titleBox.width) / 2
- }
- }
- title.shift(titleX, titleY)
- },
- _shiftMarkers: function() {
- var titleBox = this._title.getLayoutOptions();
- var markerBox = this._markersGroup.getBBox();
- var titleOptions = this._title.getOptions() || {};
- var center = 0;
- var y = 0;
- if (titleBox.width > markerBox.width && this._options.horizontalAlignment === CENTER) {
- center = titleBox.width / 2 - markerBox.width / 2
- }
- if (titleOptions.verticalAlignment === TOP) {
- y = titleBox.height
- }
- if (0 !== center || 0 !== y) {
- this._markersGroup.attr({
- translateX: center,
- translateY: y
- });
- this._items.forEach(function(item) {
- item.tracker.left += center;
- item.tracker.right += center;
- item.tracker.top += y;
- item.tracker.bottom += y
- })
- }
- },
- getPosition: function() {
- return this._options.position
- },
- coordsIn: function(x, y) {
- return x >= this._x1 && x <= this._x2 && y >= this._y1 && y <= this._y2
- },
- getItemByCoord: function(x, y) {
- var items = this._items;
- var legendGroup = this._insideLegendGroup;
- x -= legendGroup.attr("translateX");
- y -= legendGroup.attr("translateY");
- for (var i = 0; i < items.length; i++) {
- if (inRect(items[i].tracker, x, y)) {
- return items[i].tracker
- }
- }
- return null
- },
- dispose: function() {
- var that = this;
- that._title && that._title.dispose();
- that._legendGroup = that._insideLegendGroup = that._title = that._renderer = that._options = that._data = that._items = null;
- return that
- },
- layoutOptions: function() {
- if (!this.isVisible()) {
- return null
- }
- var pos = this.getLayoutOptions();
- return {
- horizontalAlignment: this._options.horizontalAlignment,
- verticalAlignment: this._options.verticalAlignment,
- side: pos.cutSide,
- priority: 1,
- position: this.getPosition()
- }
- },
- measure: function(size) {
- this.draw(size[0], size[1]);
- var rect = this.getLayoutOptions();
- return [rect.width, rect.height]
- },
- move: function(rect) {
- this.shift(rect[0], rect[1])
- },
- freeSpace: function() {
- this._options._incidentOccurred("W2104");
- this.erase()
- }
- });
- exports.plugin = {
- name: "legend",
- init: function() {
- var that = this;
- var group = this._renderer.g().attr({
- "class": this._rootClassPrefix + "-legend"
- }).enableLinks().append(that._renderer.root);
- that._legend = new exports.Legend({
- renderer: that._renderer,
- group: group,
- itemGroupClass: this._rootClassPrefix + "-item",
- titleGroupClass: this._rootClassPrefix + "-title",
- textField: "text",
- getFormatObject: function(data) {
- return {
- item: data.item,
- text: data.text
- }
- }
- });
- that._layout.add(that._legend)
- },
- extenders: {
- _applyTilesAppearance: function() {
- var that = this;
- this._items.forEach(function(item) {
- that._applyLegendItemStyle(item.id, item.getState())
- })
- },
- _buildNodes: function() {
- this._createLegendItems()
- }
- },
- members: {
- _applyLegendItemStyle: function(id, state) {
- var legend = this._legend;
- switch (state) {
- case "hover":
- legend.applyHover(id);
- break;
- case "selection":
- legend.applySelected(id);
- break;
- default:
- legend.resetItem(id)
- }
- },
- _createLegendItems: function() {
- if (this._legend.update(this._getLegendData(), this._getOption("legend"), this._themeManager.theme("legend").title)) {
- this._requestChange(["LAYOUT"])
- }
- }
- },
- dispose: function() {
- this._legend.dispose()
- },
- customize: function(constructor) {
- constructor.prototype._proxyData.push(function(x, y) {
- if (this._legend.coordsIn(x, y)) {
- var item = this._legend.getItemByCoord(x, y);
- if (item) {
- return {
- id: item.id,
- type: "legend"
- }
- }
- }
- });
- constructor.addChange({
- code: "LEGEND",
- handler: function() {
- this._createLegendItems()
- },
- isThemeDependent: true,
- option: "legend",
- isOptionChange: true
- })
- }
- };
- var __getMarkerCreator = getMarkerCreator;
- exports._DEBUG_stubMarkerCreator = function(callback) {
- getMarkerCreator = function() {
- return callback
- }
- };
- exports._DEBUG_restoreMarkerCreator = function() {
- getMarkerCreator = __getMarkerCreator
- }
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/bar_point.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var _extend = extend;
- var _math = Math;
- var _floor = _math.floor;
- var _abs = _math.abs;
- var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
- var CANVAS_POSITION_DEFAULT = "canvas_position_default";
- var DEFAULT_BAR_TRACKER_SIZE = 9;
- var CORRECTING_BAR_TRACKER_VALUE = 4;
- var RIGHT = "right";
- var LEFT = "left";
- var TOP = "top";
- var BOTTOM = "bottom";
- module.exports = _extend({}, symbolPoint, {
- correctCoordinates: function(correctOptions) {
- var that = this;
- var correction = _floor(correctOptions.offset - correctOptions.width / 2);
- if (that._options.rotated) {
- that.height = correctOptions.width;
- that.yCorrection = correction;
- that.xCorrection = null
- } else {
- that.width = correctOptions.width;
- that.xCorrection = correction;
- that.yCorrection = null
- }
- },
- _getGraphicBBox: function() {
- return {
- x: this.x,
- y: this.y,
- width: this.width,
- height: this.height
- }
- },
- _getLabelConnector: function(location) {
- return this._getGraphicBBox(location)
- },
- _getLabelPosition: function() {
- var that = this;
- var position;
- var initialValue = that.initialValue;
- var invert = that._getValTranslator().getBusinessRange().invert;
- var isDiscreteValue = "discrete" === that.series.valueAxisType;
- var isFullStacked = that.series.isFullStackedSeries();
- var notAxisInverted = !isDiscreteValue && (initialValue >= 0 && !invert || initialValue < 0 && invert) || isDiscreteValue && !invert || isFullStacked;
- if (!that._options.rotated) {
- position = notAxisInverted ? TOP : BOTTOM
- } else {
- position = notAxisInverted ? RIGHT : LEFT
- }
- return position
- },
- _getLabelCoords: function(label) {
- var that = this;
- var coords;
- if (0 === that.initialValue && that.series.isFullStackedSeries()) {
- if (!this._options.rotated) {
- coords = that._getLabelCoordOfPosition(label, TOP)
- } else {
- coords = that._getLabelCoordOfPosition(label, RIGHT)
- }
- } else {
- if ("inside" === label.getLayoutOptions().position) {
- coords = that._getLabelCoordOfPosition(label, "inside")
- } else {
- coords = symbolPoint._getLabelCoords.call(this, label)
- }
- }
- return coords
- },
- _checkLabelPosition: function(label, coord) {
- var that = this;
- var visibleArea = that._getVisibleArea();
- if (that._isPointInVisibleArea(visibleArea, that._getGraphicBBox())) {
- return that._moveLabelOnCanvas(coord, visibleArea, label.getBoundingRect())
- }
- return coord
- },
- hideInsideLabel: function(label, coord) {
- var graphicBBox = this._getGraphicBBox();
- var labelBBox = label.getBoundingRect();
- if (this._options.resolveLabelsOverlapping) {
- if ((coord.y <= graphicBBox.y && coord.y + labelBBox.height >= graphicBBox.y + graphicBBox.height || coord.x <= graphicBBox.x && coord.x + labelBBox.width >= graphicBBox.x + graphicBBox.width) && !(coord.y > graphicBBox.y + graphicBBox.height || coord.y + labelBBox.height < graphicBBox.y || coord.x > graphicBBox.x + graphicBBox.width || coord.x + labelBBox.width < graphicBBox.x)) {
- label.draw(false);
- return true
- }
- }
- return false
- },
- _moveLabelOnCanvas: function(coord, visibleArea, labelBBox) {
- var x = coord.x;
- var y = coord.y;
- if (visibleArea.minX > x) {
- x = visibleArea.minX
- }
- if (visibleArea.maxX < x + labelBBox.width) {
- x = visibleArea.maxX - labelBBox.width
- }
- if (visibleArea.minY > y) {
- y = visibleArea.minY
- }
- if (visibleArea.maxY < y + labelBBox.height) {
- y = visibleArea.maxY - labelBBox.height
- }
- return {
- x: x,
- y: y
- }
- },
- _showForZeroValues: function() {
- return this._options.label.showForZeroValues || this.initialValue
- },
- _drawMarker: function(renderer, group, animationEnabled) {
- var that = this;
- var style = that._getStyle();
- var r = that._options.cornerRadius;
- var rotated = that._options.rotated;
- var _that$getMarkerCoords = that.getMarkerCoords(),
- x = _that$getMarkerCoords.x,
- y = _that$getMarkerCoords.y,
- width = _that$getMarkerCoords.width,
- height = _that$getMarkerCoords.height;
- if (animationEnabled) {
- if (rotated) {
- width = 0;
- x = that.defaultX
- } else {
- height = 0;
- y = that.defaultY
- }
- }
- that.graphic = renderer.rect(x, y, width, height).attr({
- rx: r,
- ry: r
- }).smartAttr(style).data({
- "chart-data-point": that
- }).append(group)
- },
- _getSettingsForTracker: function() {
- var that = this;
- var y = that.y;
- var height = that.height;
- var x = that.x;
- var width = that.width;
- if (that._options.rotated) {
- if (1 === width) {
- width = DEFAULT_BAR_TRACKER_SIZE;
- x -= CORRECTING_BAR_TRACKER_VALUE
- }
- } else {
- if (1 === height) {
- height = DEFAULT_BAR_TRACKER_SIZE;
- y -= CORRECTING_BAR_TRACKER_VALUE
- }
- }
- return {
- x: x,
- y: y,
- width: width,
- height: height
- }
- },
- getGraphicSettings: function() {
- var graphic = this.graphic;
- return {
- x: graphic.attr("x"),
- y: graphic.attr("y"),
- height: graphic.attr("height"),
- width: graphic.attr("width")
- }
- },
- _getEdgeTooltipParams: function() {
- var isPositive = this.value >= 0;
- var xCoord;
- var yCoord;
- var invertedBusinessRange = this._getValTranslator().getBusinessRange().invert;
- var x = this.x,
- y = this.y,
- width = this.width,
- height = this.height;
- if (this._options.rotated) {
- yCoord = y + height / 2;
- if (invertedBusinessRange) {
- xCoord = isPositive ? x : x + width
- } else {
- xCoord = isPositive ? x + width : x
- }
- } else {
- xCoord = x + width / 2;
- if (invertedBusinessRange) {
- yCoord = isPositive ? y + height : y
- } else {
- yCoord = isPositive ? y : y + height
- }
- }
- return {
- x: xCoord,
- y: yCoord,
- offset: 0
- }
- },
- getTooltipParams: function(location) {
- if ("edge" === location) {
- return this._getEdgeTooltipParams()
- }
- var center = this.getCenterCoord();
- center.offset = 0;
- return center
- },
- getCenterCoord: function() {
- var width = this.width,
- height = this.height,
- x = this.x,
- y = this.y;
- return {
- x: x + width / 2,
- y: y + height / 2
- }
- },
- _truncateCoord: function(coord, minBounce, maxBounce) {
- if (null === coord) {
- return coord
- }
- if (coord < minBounce) {
- return minBounce
- }
- if (coord > maxBounce) {
- return maxBounce
- }
- return coord
- },
- _getErrorBarBaseEdgeLength: function() {
- return this._options.rotated ? this.height : this.width
- },
- _translateErrorBars: function(argVisibleArea) {
- symbolPoint._translateErrorBars.call(this);
- if (this._errorBarPos < argVisibleArea[0] || this._errorBarPos > argVisibleArea[1]) {
- this._errorBarPos = void 0
- }
- },
- _translate: function() {
- var that = this;
- var rotated = that._options.rotated;
- var valAxis = rotated ? "x" : "y";
- var argAxis = rotated ? "y" : "x";
- var valIntervalName = rotated ? "width" : "height";
- var argIntervalName = rotated ? "height" : "width";
- var argTranslator = that._getArgTranslator();
- var valTranslator = that._getValTranslator();
- var argVisibleArea = that.series.getArgumentAxis().getVisibleArea();
- var valVisibleArea = that.series.getValueAxis().getVisibleArea();
- var arg;
- var val;
- var minVal;
- arg = argTranslator.translate(that.argument);
- that[argAxis] = arg = null === arg ? arg : arg + (that[argAxis + "Correction"] || 0);
- val = valTranslator.translate(that.value, 1);
- minVal = valTranslator.translate(that.minValue);
- that["v" + valAxis] = val;
- that["v" + argAxis] = arg + that[argIntervalName] / 2;
- val = that._truncateCoord(val, valVisibleArea[0], valVisibleArea[1]);
- minVal = that._truncateCoord(minVal, valVisibleArea[0], valVisibleArea[1]);
- that[valIntervalName] = _abs(val - minVal);
- val = val < minVal ? val : minVal;
- that._calculateVisibility(rotated ? val : arg, rotated ? arg : val, that.width, that.height);
- that[valAxis] = null === val ? val : val + (that[valAxis + "Correction"] || 0);
- that["min" + valAxis.toUpperCase()] = null === minVal ? minVal : minVal + (that[valAxis + "Correction"] || 0);
- that["default" + valAxis.toUpperCase()] = valTranslator.translate(CANVAS_POSITION_DEFAULT);
- that._translateErrorBars(argVisibleArea);
- if (that.inVisibleArea && null !== that[argAxis]) {
- if (that[argAxis] < argVisibleArea[0]) {
- that[argIntervalName] = that[argIntervalName] - (argVisibleArea[0] - that[argAxis]);
- that[argAxis] = argVisibleArea[0]
- }
- if (that[argAxis] + that[argIntervalName] > argVisibleArea[1]) {
- that[argIntervalName] = argVisibleArea[1] - that[argAxis]
- }
- }
- },
- _updateMarker: function(animationEnabled, style) {
- this.graphic.smartAttr(_extend({}, style, !animationEnabled ? this.getMarkerCoords() : {}))
- },
- getMarkerCoords: function() {
- var that = this;
- var x = that.x;
- var y = that.y;
- var width = that.width;
- var height = that.height;
- var argAxis = that.series.getArgumentAxis();
- var rotated = that._options.rotated;
- if (argAxis.getAxisPosition) {
- var axisOptions = argAxis.getOptions();
- var edgeOffset = Math.round(axisOptions.width / 2);
- var argAxisPosition = argAxis.getAxisPosition();
- if (axisOptions.visible) {
- if (!rotated) {
- height -= that.minY === that.defaultY && that.minY === argAxisPosition - argAxis.getAxisShift() ? edgeOffset : 0;
- height < 0 && (height = 0)
- } else {
- var isStartFromAxis = that.minX === that.defaultX && that.minX === argAxisPosition - argAxis.getAxisShift();
- x += isStartFromAxis ? edgeOffset : 0;
- width -= isStartFromAxis ? edgeOffset : 0;
- width < 0 && (width = 0)
- }
- }
- }
- return {
- x: x,
- y: y,
- width: width,
- height: height
- }
- },
- coordsIn: function(x, y) {
- var that = this;
- return x >= that.x && x <= that.x + that.width && y >= that.y && y <= that.y + that.height
- }
- })
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/line_series.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var series = __webpack_require__( /*! ./scatter_series */ 106);
- var chartScatterSeries = series.chart;
- var polarScatterSeries = series.polar;
- var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var mathUtils = __webpack_require__( /*! ../../core/utils/math */ 28);
- var normalizeAngle = vizUtils.normalizeAngle;
- var DISCRETE = "discrete";
- var _map = vizUtils.map;
- var _extend = extend;
- var _each = each;
- exports.chart = {};
- exports.polar = {};
- function clonePoint(point, newX, newY, newAngle) {
- var p = objectUtils.clone(point);
- p.x = newX;
- p.y = newY;
- p.angle = newAngle;
- return p
- }
- function getTangentPoint(point, prevPoint, centerPoint, tan, nextStepAngle) {
- var correctAngle = point.angle + nextStepAngle;
- var cosSin = vizUtils.getCosAndSin(correctAngle);
- var x = centerPoint.x + (point.radius + tan * nextStepAngle) * cosSin.cos;
- var y = centerPoint.y - (point.radius + tan * nextStepAngle) * cosSin.sin;
- return clonePoint(prevPoint, x, y, correctAngle)
- }
- function obtainCubicBezierTCoef(p, p0, p1, p2, p3) {
- var d = p0 - p;
- var c = 3 * p1 - 3 * p0;
- var b = 3 * p2 - 6 * p1 + 3 * p0;
- var a = p3 - 3 * p2 + 3 * p1 - p0;
- return mathUtils.solveCubicEquation(a, b, c, d)
- }
- var lineMethods = {
- autoHidePointMarkersEnabled: function() {
- return true
- },
- _applyGroupSettings: function(style, settings, group) {
- var that = this;
- settings = _extend(settings, style);
- that._applyElementsClipRect(settings);
- group.attr(settings)
- },
- _setGroupsSettings: function(animationEnabled) {
- var that = this;
- var style = that._styles.normal;
- that._applyGroupSettings(style.elements, {
- "class": "dxc-elements"
- }, that._elementsGroup);
- that._bordersGroup && that._applyGroupSettings(style.border, {
- "class": "dxc-borders"
- }, that._bordersGroup);
- chartScatterSeries._setGroupsSettings.call(that, animationEnabled);
- animationEnabled && that._markersGroup && that._markersGroup.attr({
- opacity: .001
- })
- },
- _createGroups: function() {
- var that = this;
- that._createGroup("_elementsGroup", that, that._group);
- that._areBordersVisible() && that._createGroup("_bordersGroup", that, that._group);
- chartScatterSeries._createGroups.call(that)
- },
- _areBordersVisible: function() {
- return false
- },
- _getDefaultSegment: function(segment) {
- return {
- line: _map(segment.line || [], function(pt) {
- return pt.getDefaultCoords()
- })
- }
- },
- _prepareSegment: function(points) {
- return {
- line: points
- }
- },
- _parseLineOptions: function(options, defaultColor) {
- return {
- stroke: options.color || defaultColor,
- "stroke-width": options.width,
- dashStyle: options.dashStyle || "solid"
- }
- },
- _parseStyle: function(options, defaultColor) {
- return {
- elements: this._parseLineOptions(options, defaultColor)
- }
- },
- _applyStyle: function(style) {
- var that = this;
- that._elementsGroup && that._elementsGroup.attr(style.elements);
- _each(that._graphics || [], function(_, graphic) {
- graphic.line && graphic.line.attr({
- "stroke-width": style.elements["stroke-width"]
- }).sharp()
- })
- },
- _drawElement: function(segment, group) {
- return {
- line: this._createMainElement(segment.line, {
- "stroke-width": this._styles.normal.elements["stroke-width"]
- }).append(group)
- }
- },
- _removeElement: function(element) {
- element.line.remove()
- },
- _updateElement: function(element, segment, animate, animationComplete) {
- var params = {
- points: segment.line
- };
- var lineElement = element.line;
- animate ? lineElement.animate(params, {}, animationComplete) : lineElement.attr(params)
- },
- _animateComplete: function() {
- var that = this;
- chartScatterSeries._animateComplete.call(that);
- that._markersGroup && that._markersGroup.animate({
- opacity: 1
- }, {
- duration: that._defaultDuration
- })
- },
- _animate: function() {
- var that = this;
- var lastIndex = that._graphics.length - 1;
- _each(that._graphics || [], function(i, elem) {
- var complete;
- if (i === lastIndex) {
- complete = function() {
- that._animateComplete()
- }
- }
- that._updateElement(elem, that._segments[i], true, complete)
- })
- },
- _drawPoint: function(options) {
- chartScatterSeries._drawPoint.call(this, {
- point: options.point,
- groups: options.groups
- })
- },
- _createMainElement: function(points, settings) {
- return this._renderer.path(points, "line").attr(settings).sharp()
- },
- _sortPoints: function(points, rotated) {
- return rotated ? points.sort(function(p1, p2) {
- return p2.y - p1.y
- }) : points.sort(function(p1, p2) {
- return p1.x - p2.x
- })
- },
- _drawSegment: function(points, animationEnabled, segmentCount, lastSegment) {
- var that = this;
- var rotated = that._options.rotated;
- var forceDefaultSegment = false;
- var segment = that._prepareSegment(points, rotated, lastSegment);
- that._segments.push(segment);
- if (!that._graphics[segmentCount]) {
- that._graphics[segmentCount] = that._drawElement(animationEnabled ? that._getDefaultSegment(segment) : segment, that._elementsGroup)
- } else {
- if (!animationEnabled) {
- that._updateElement(that._graphics[segmentCount], segment)
- } else {
- if (forceDefaultSegment) {
- that._updateElement(that._graphics[segmentCount], that._getDefaultSegment(segment))
- }
- }
- }
- },
- _getTrackerSettings: function() {
- var that = this;
- var defaultTrackerWidth = that._defaultTrackerWidth;
- var strokeWidthFromElements = that._styles.normal.elements["stroke-width"];
- return {
- "stroke-width": strokeWidthFromElements > defaultTrackerWidth ? strokeWidthFromElements : defaultTrackerWidth,
- fill: "none"
- }
- },
- _getMainPointsFromSegment: function(segment) {
- return segment.line
- },
- _drawTrackerElement: function(segment) {
- return this._createMainElement(this._getMainPointsFromSegment(segment), this._getTrackerSettings(segment))
- },
- _updateTrackerElement: function(segment, element) {
- var settings = this._getTrackerSettings(segment);
- settings.points = this._getMainPointsFromSegment(segment);
- element.attr(settings)
- },
- checkSeriesViewportCoord: function(axis, coord) {
- if (0 === this._points.length) {
- return false
- }
- var range = axis.isArgumentAxis ? this.getArgumentRange() : this.getViewport();
- var min = axis.getTranslator().translate(range.categories ? range.categories[0] : range.min);
- var max = axis.getTranslator().translate(range.categories ? range.categories[range.categories.length - 1] : range.max);
- var rotated = this.getOptions().rotated;
- var inverted = axis.getOptions().inverted;
- return axis.isArgumentAxis && (!rotated && !inverted || rotated && inverted) || !axis.isArgumentAxis && (rotated && !inverted || !rotated && inverted) ? coord >= min && coord <= max : coord >= max && coord <= min
- },
- getSeriesPairCoord: function(coord, isArgument) {
- var that = this;
- var oppositeCoord = null;
- var nearestPoints = this.getNearestPointsByCoord(coord, isArgument);
- var needValueCoord = isArgument && !that._options.rotated || !isArgument && that._options.rotated;
- for (var i = 0; i < nearestPoints.length; i++) {
- var p = nearestPoints[i];
- var k = (p[1].vy - p[0].vy) / (p[1].vx - p[0].vx);
- var b = p[0].vy - p[0].vx * k;
- var tmpCoord = void 0;
- if (p[1].vx - p[0].vx === 0) {
- tmpCoord = needValueCoord ? p[0].vy : p[0].vx
- } else {
- tmpCoord = needValueCoord ? k * coord + b : (coord - b) / k
- }
- if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
- oppositeCoord = tmpCoord;
- break
- }
- }
- return oppositeCoord
- }
- };
- var lineSeries = exports.chart.line = _extend({}, chartScatterSeries, lineMethods, {
- getPointCenterByArg: function(arg) {
- var value = this.getArgumentAxis().getTranslator().translate(arg);
- return {
- x: value,
- y: value
- }
- }
- });
- exports.chart.stepline = _extend({}, lineSeries, {
- _calculateStepLinePoints: function(points) {
- var segment = [];
- var coordName = this._options.rotated ? "x" : "y";
- _each(points, function(i, pt) {
- var point;
- if (!i) {
- segment.push(pt);
- return
- }
- var step = segment[segment.length - 1][coordName];
- if (step !== pt[coordName]) {
- point = objectUtils.clone(pt);
- point[coordName] = step;
- segment.push(point)
- }
- segment.push(pt)
- });
- return segment
- },
- _prepareSegment: function(points) {
- return lineSeries._prepareSegment(this._calculateStepLinePoints(points))
- },
- getSeriesPairCoord: function(coord, isArgument) {
- var oppositeCoord;
- var rotated = this._options.rotated;
- var isOpposite = !isArgument && !rotated || isArgument && rotated;
- var coordName = !isOpposite ? "vx" : "vy";
- var oppositeCoordName = !isOpposite ? "vy" : "vx";
- var nearestPoints = this.getNearestPointsByCoord(coord, isArgument);
- for (var i = 0; i < nearestPoints.length; i++) {
- var p = nearestPoints[i];
- var tmpCoord = void 0;
- if (isArgument) {
- tmpCoord = coord !== p[1][coordName] ? p[0][oppositeCoordName] : p[1][oppositeCoordName]
- } else {
- tmpCoord = coord === p[0][coordName] ? p[0][oppositeCoordName] : p[1][oppositeCoordName]
- }
- if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
- oppositeCoord = tmpCoord;
- break
- }
- }
- return oppositeCoord
- }
- });
- exports.chart.spline = _extend({}, lineSeries, {
- _calculateBezierPoints: function(src, rotated) {
- var bezierPoints = [];
- var pointsCopy = src;
- var checkExtremum = function(otherPointCoord, pointCoord, controlCoord) {
- return otherPointCoord > pointCoord && controlCoord > otherPointCoord || otherPointCoord < pointCoord && controlCoord < otherPointCoord ? otherPointCoord : controlCoord
- };
- if (1 !== pointsCopy.length) {
- pointsCopy.forEach(function(curPoint, i) {
- var leftControlX;
- var leftControlY;
- var rightControlX;
- var rightControlY;
- var prevPoint = pointsCopy[i - 1];
- var nextPoint = pointsCopy[i + 1];
- var x1;
- var x2;
- var y1;
- var y2;
- var lambda = .5;
- var a;
- var b;
- var c;
- var xc;
- var yc;
- var shift;
- if (!i || i === pointsCopy.length - 1) {
- bezierPoints.push(curPoint, curPoint);
- return
- }
- var xCur = curPoint.x;
- var yCur = curPoint.y;
- x1 = prevPoint.x;
- x2 = nextPoint.x;
- y1 = prevPoint.y;
- y2 = nextPoint.y;
- var curIsExtremum = !!(!rotated && (yCur <= prevPoint.y && yCur <= nextPoint.y || yCur >= prevPoint.y && yCur >= nextPoint.y) || rotated && (xCur <= prevPoint.x && xCur <= nextPoint.x || xCur >= prevPoint.x && xCur >= nextPoint.x));
- if (curIsExtremum) {
- if (!rotated) {
- rightControlY = leftControlY = yCur;
- rightControlX = (xCur + nextPoint.x) / 2;
- leftControlX = (xCur + prevPoint.x) / 2
- } else {
- rightControlX = leftControlX = xCur;
- rightControlY = (yCur + nextPoint.y) / 2;
- leftControlY = (yCur + prevPoint.y) / 2
- }
- } else {
- a = y2 - y1;
- b = x1 - x2;
- c = y1 * x2 - x1 * y2;
- if (!rotated) {
- if (!b) {
- bezierPoints.push(curPoint, curPoint, curPoint);
- return
- }
- xc = xCur;
- yc = -1 * (a * xc + c) / b;
- shift = yc - yCur;
- y1 -= shift;
- y2 -= shift
- } else {
- if (!a) {
- bezierPoints.push(curPoint, curPoint, curPoint);
- return
- }
- yc = yCur;
- xc = -1 * (b * yc + c) / a;
- shift = xc - xCur;
- x1 -= shift;
- x2 -= shift
- }
- rightControlX = (xCur + lambda * x2) / (1 + lambda);
- rightControlY = (yCur + lambda * y2) / (1 + lambda);
- leftControlX = (xCur + lambda * x1) / (1 + lambda);
- leftControlY = (yCur + lambda * y1) / (1 + lambda)
- }
- if (!rotated) {
- leftControlY = checkExtremum(prevPoint.y, yCur, leftControlY);
- rightControlY = checkExtremum(nextPoint.y, yCur, rightControlY)
- } else {
- leftControlX = checkExtremum(prevPoint.x, xCur, leftControlX);
- rightControlX = checkExtremum(nextPoint.x, xCur, rightControlX)
- }
- var leftPoint = clonePoint(curPoint, leftControlX, leftControlY);
- var rightPoint = clonePoint(curPoint, rightControlX, rightControlY);
- bezierPoints.push(leftPoint, curPoint, rightPoint)
- })
- } else {
- bezierPoints.push(pointsCopy[0])
- }
- return bezierPoints
- },
- _prepareSegment: function(points, rotated) {
- return lineSeries._prepareSegment(this._calculateBezierPoints(points, rotated))
- },
- _createMainElement: function(points, settings) {
- return this._renderer.path(points, "bezier").attr(settings).sharp()
- },
- getSeriesPairCoord: function(coord, isArgument) {
- var that = this;
- var oppositeCoord = null;
- var isOpposite = !isArgument && !this._options.rotated || isArgument && this._options.rotated;
- var coordName = !isOpposite ? "vx" : "vy";
- var bezierCoordName = !isOpposite ? "x" : "y";
- var oppositeCoordName = !isOpposite ? "vy" : "vx";
- var bezierOppositeCoordName = !isOpposite ? "y" : "x";
- var axis = !isArgument ? that.getArgumentAxis() : that.getValueAxis();
- var visibleArea = axis.getVisibleArea();
- var nearestPoints = this.getNearestPointsByCoord(coord, isArgument);
- var _loop = function(i) {
- var p = nearestPoints[i];
- if (1 === p.length) {
- visibleArea[0] <= p[0][oppositeCoordName] && visibleArea[1] >= p[0][oppositeCoordName] && (oppositeCoord = p[0][oppositeCoordName])
- } else {
- var ts = obtainCubicBezierTCoef(coord, p[0][coordName], p[1][bezierCoordName], p[2][bezierCoordName], p[3][coordName]);
- ts.forEach(function(t) {
- if (t >= 0 && t <= 1) {
- var tmpCoord = Math.pow(1 - t, 3) * p[0][oppositeCoordName] + 3 * Math.pow(1 - t, 2) * t * p[1][bezierOppositeCoordName] + 3 * (1 - t) * t * t * p[2][bezierOppositeCoordName] + t * t * t * p[3][oppositeCoordName];
- if (visibleArea[0] <= tmpCoord && visibleArea[1] >= tmpCoord) {
- oppositeCoord = tmpCoord
- }
- }
- })
- }
- if (null !== oppositeCoord) {
- return "break"
- }
- };
- for (var i = 0; i < nearestPoints.length; i++) {
- var _ret = _loop(i);
- if ("break" === _ret) {
- break
- }
- }
- return oppositeCoord
- },
- getNearestPointsByCoord: function(coord, isArgument) {
- var that = this;
- var rotated = that.getOptions().rotated;
- var isOpposite = !isArgument && !rotated || isArgument && rotated;
- var coordName = isOpposite ? "vy" : "vx";
- var points = that.getVisiblePoints();
- var allPoints = that.getPoints();
- var bezierPoints = that._segments.length > 0 ? that._segments.reduce(function(a, seg) {
- return a.concat(seg.line)
- }, []) : [];
- var nearestPoints = [];
- if (that.isVisible() && allPoints.length > 0) {
- if (allPoints.length > 1) {
- that.findNeighborPointsByCoord(coord, coordName, points.slice(0), allPoints, function(point, nextPoint) {
- var index = bezierPoints.indexOf(point);
- nearestPoints.push([point, bezierPoints[index + 1], bezierPoints[index + 2], nextPoint])
- })
- } else {
- if (allPoints[0][coordName] === coord) {
- nearestPoints.push([allPoints[0]])
- }
- }
- }
- return nearestPoints
- }
- });
- exports.polar.line = _extend({}, polarScatterSeries, lineMethods, {
- _sortPoints: function(points) {
- return points
- },
- _prepareSegment: function(points, rotated, lastSegment) {
- var preparedPoints = [];
- var centerPoint = this.getValueAxis().getCenter();
- var i;
- lastSegment && this._closeSegment(points);
- if (this.argumentAxisType !== DISCRETE && this.valueAxisType !== DISCRETE) {
- for (i = 1; i < points.length; i++) {
- preparedPoints = preparedPoints.concat(this._getTangentPoints(points[i], points[i - 1], centerPoint))
- }
- if (!preparedPoints.length) {
- preparedPoints = points
- }
- } else {
- return lineSeries._prepareSegment.call(this, points)
- }
- return {
- line: preparedPoints
- }
- },
- _getRemainingAngle: function(angle) {
- var normAngle = normalizeAngle(angle);
- return angle >= 0 ? 360 - normAngle : -normAngle
- },
- _closeSegment: function(points) {
- var point;
- var differenceAngle;
- if (this._segments.length) {
- point = this._segments[0].line[0]
- } else {
- point = clonePoint(points[0], points[0].x, points[0].y, points[0].angle)
- }
- if (points[points.length - 1].angle !== point.angle) {
- if (normalizeAngle(Math.round(points[points.length - 1].angle)) === normalizeAngle(Math.round(point.angle))) {
- point.angle = points[points.length - 1].angle
- } else {
- differenceAngle = points[points.length - 1].angle - point.angle;
- point.angle = points[points.length - 1].angle + this._getRemainingAngle(differenceAngle)
- }
- points.push(point)
- }
- },
- _getTangentPoints: function(point, prevPoint, centerPoint) {
- var tangentPoints = [];
- var betweenAngle = Math.round(prevPoint.angle - point.angle);
- var tan = (prevPoint.radius - point.radius) / betweenAngle;
- var i;
- if (0 === betweenAngle) {
- tangentPoints = [prevPoint, point]
- } else {
- if (betweenAngle > 0) {
- for (i = betweenAngle; i >= 0; i--) {
- tangentPoints.push(getTangentPoint(point, prevPoint, centerPoint, tan, i))
- }
- } else {
- for (i = 0; i >= betweenAngle; i--) {
- tangentPoints.push(getTangentPoint(point, prevPoint, centerPoint, tan, betweenAngle - i))
- }
- }
- }
- return tangentPoints
- }
- })
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/base_axis.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _smart_formatter = __webpack_require__( /*! ./smart_formatter */ 405);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _utils2 = _interopRequireDefault(_utils);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _axes_constants = __webpack_require__( /*! ./axes_constants */ 248);
- var _axes_constants2 = _interopRequireDefault(_axes_constants);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
- var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
- var _format_helper2 = _interopRequireDefault(_format_helper);
- var _parse_utils = __webpack_require__( /*! ../components/parse_utils */ 244);
- var _parse_utils2 = _interopRequireDefault(_parse_utils);
- var _tick_generator = __webpack_require__( /*! ./tick_generator */ 406);
- var _tick_generator2 = _interopRequireDefault(_tick_generator);
- var _translator2d = __webpack_require__( /*! ../translators/translator2d */ 249);
- var _translator2d2 = _interopRequireDefault(_translator2d);
- var _range = __webpack_require__( /*! ../translators/range */ 108);
- var _tick = __webpack_require__( /*! ./tick */ 407);
- var _math2 = __webpack_require__( /*! ../../core/utils/math */ 28);
- var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- var _xy_axes = __webpack_require__( /*! ./xy_axes */ 408);
- var _xy_axes2 = _interopRequireDefault(_xy_axes);
- var _polar_axes = __webpack_require__( /*! ./polar_axes */ 784);
- var _polar_axes2 = _interopRequireDefault(_polar_axes);
- var _constant_line = __webpack_require__( /*! ./constant_line */ 785);
- var _constant_line2 = _interopRequireDefault(_constant_line);
- var _strip = __webpack_require__( /*! ./strip */ 786);
- var _strip2 = _interopRequireDefault(_strip);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- var convertTicksToValues = _axes_constants2.default.convertTicksToValues;
- var patchFontOptions = _utils2.default.patchFontOptions;
- var getVizRangeObject = _utils2.default.getVizRangeObject;
- var _math = Math;
- var _abs = _math.abs;
- var _max = _math.max;
- var _min = _math.min;
- var _isArray = Array.isArray;
- var DEFAULT_AXIS_LABEL_SPACING = 5;
- var MAX_GRID_BORDER_ADHENSION = 4;
- var TOP = _axes_constants2.default.top;
- var BOTTOM = _axes_constants2.default.bottom;
- var LEFT = _axes_constants2.default.left;
- var RIGHT = _axes_constants2.default.right;
- var CENTER = _axes_constants2.default.center;
- var KEEP = "keep";
- var SHIFT = "shift";
- var RESET = "reset";
- var ROTATE = "rotate";
- var DEFAULT_AXIS_DIVISION_FACTOR = 50;
- var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 15;
- var SCROLL_THRESHOLD = 5;
- var MAX_MARGIN_VALUE = .8;
- var dateIntervals = {
- day: 864e5,
- week: 6048e5
- };
- function getTickGenerator(options, incidentOccurred, skipTickGeneration, rangeIsEmpty, adjustDivisionFactor) {
- return _tick_generator2.default.tickGenerator({
- axisType: options.type,
- dataType: options.dataType,
- logBase: options.logarithmBase,
- axisDivisionFactor: adjustDivisionFactor(options.axisDivisionFactor || DEFAULT_AXIS_DIVISION_FACTOR),
- minorAxisDivisionFactor: adjustDivisionFactor(options.minorAxisDivisionFactor || DEFAULT_MINOR_AXIS_DIVISION_FACTOR),
- numberMultipliers: options.numberMultipliers,
- calculateMinors: options.minorTick.visible || options.minorGrid.visible || options.calculateMinors,
- allowDecimals: options.allowDecimals,
- endOnTick: options.endOnTick,
- incidentOccurred: incidentOccurred,
- firstDayOfWeek: options.workWeek && options.workWeek[0],
- skipTickGeneration: skipTickGeneration,
- skipCalculationLimits: options.skipCalculationLimits,
- generateExtraTick: options.generateExtraTick,
- minTickInterval: options.minTickInterval,
- rangeIsEmpty: rangeIsEmpty
- })
- }
- function createMajorTick(axis, renderer, skippedCategory) {
- var options = axis.getOptions();
- return (0, _tick.tick)(axis, renderer, options.tick, options.grid, skippedCategory, false)
- }
- function createMinorTick(axis, renderer) {
- var options = axis.getOptions();
- return (0, _tick.tick)(axis, renderer, options.minorTick, options.minorGrid)
- }
- function createBoundaryTick(axis, renderer, isFirst) {
- var options = axis.getOptions();
- return (0, _tick.tick)(axis, renderer, (0, _extend.extend)({}, options.tick, {
- visible: options.showCustomBoundaryTicks
- }), options.grid, void 0, false, isFirst ? -1 : 1)
- }
- function callAction(elements, action, actionArgument1, actionArgument2) {
- (elements || []).forEach(function(e) {
- return e[action](actionArgument1, actionArgument2)
- })
- }
- function initTickCoords(ticks) {
- callAction(ticks, "initCoords")
- }
- function drawTickMarks(ticks, options) {
- callAction(ticks, "drawMark", options)
- }
- function drawGrids(ticks, drawLine) {
- callAction(ticks, "drawGrid", drawLine)
- }
- function updateTicksPosition(ticks, options, animate) {
- callAction(ticks, "updateTickPosition", options, animate)
- }
- function updateGridsPosition(ticks, animate) {
- callAction(ticks, "updateGridPosition", animate)
- }
- var measureLabels = exports.measureLabels = function(items) {
- items.forEach(function(item) {
- item.labelBBox = item.label ? item.label.getBBox() : {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- }
- })
- };
- function cleanUpInvalidTicks(ticks) {
- var i = ticks.length - 1;
- for (i; i >= 0; i--) {
- if (!removeInvalidTick(ticks, i)) {
- break
- }
- }
- for (i = 0; i < ticks.length; i++) {
- if (removeInvalidTick(ticks, i)) {
- i--
- } else {
- break
- }
- }
- }
- function removeInvalidTick(ticks, i) {
- if (null === ticks[i].coords.x || null === ticks[i].coords.y) {
- ticks.splice(i, 1);
- return true
- }
- return false
- }
- function validateAxisOptions(options) {
- var labelOptions = options.label;
- var position = options.position;
- var defaultPosition = options.isHorizontal ? BOTTOM : LEFT;
- var secondaryPosition = options.isHorizontal ? TOP : RIGHT;
- if (position !== defaultPosition && position !== secondaryPosition) {
- position = defaultPosition
- }
- if (position === RIGHT && !labelOptions.userAlignment) {
- labelOptions.alignment = LEFT
- }
- options.position = position;
- options.hoverMode = options.hoverMode ? options.hoverMode.toLowerCase() : "none";
- labelOptions.minSpacing = (0, _type.isDefined)(labelOptions.minSpacing) ? labelOptions.minSpacing : DEFAULT_AXIS_LABEL_SPACING;
- options.type && (options.type = options.type.toLowerCase());
- options.argumentType && (options.argumentType = options.argumentType.toLowerCase());
- options.valueType && (options.valueType = options.valueType.toLowerCase())
- }
- function getOptimalAngle(boxes, labelOpt) {
- var angle = 180 * _math.asin((boxes[0].height + labelOpt.minSpacing) / (boxes[1].x - boxes[0].x)) / _math.PI;
- return angle < 45 ? -45 : -90
- }
- function updateLabels(ticks, step, func) {
- ticks.forEach(function(tick, index) {
- if (tick.label) {
- if (index % step !== 0) {
- tick.removeLabel()
- } else {
- if (func) {
- func(tick, index)
- }
- }
- }
- })
- }
- function valueOf(value) {
- return value.valueOf()
- }
- function getZoomBoundValue(optionValue, dataValue) {
- if (void 0 === optionValue) {
- return dataValue
- } else {
- if (null === optionValue) {
- return
- } else {
- return optionValue
- }
- }
- }
- function configureGenerator(options, axisDivisionFactor, viewPort, screenDelta, minTickInterval) {
- var tickGeneratorOptions = (0, _extend.extend)({}, options, {
- endOnTick: true,
- axisDivisionFactor: axisDivisionFactor,
- skipCalculationLimits: true,
- generateExtraTick: true,
- minTickInterval: minTickInterval
- });
- return function(tickInterval, skipTickGeneration, min, max, breaks) {
- return getTickGenerator(tickGeneratorOptions, _common.noop, skipTickGeneration, viewPort.isEmpty(), function(v) {
- return v
- })({
- min: min,
- max: max,
- categories: viewPort.categories,
- isSpacedMargin: viewPort.isSpacedMargin,
- checkMinDataVisibility: viewPort.checkMinDataVisibility,
- checkMaxDataVisibility: viewPort.checkMaxDataVisibility
- }, screenDelta, tickInterval, (0, _type.isDefined)(tickInterval), void 0, void 0, void 0, breaks)
- }
- }
- function convertVisualRangeObject(visualRange, optionValue) {
- return _utils2.default.convertVisualRangeObject(visualRange, !_isArray(optionValue))
- }
- function getConstantLineSharpDirection(coord, axisCanvas) {
- return Math.max(axisCanvas.start, axisCanvas.end) !== coord ? 1 : -1
- }
- var calculateCanvasMargins = exports.calculateCanvasMargins = function(bBoxes, canvas) {
- var cLeft = canvas.left;
- var cTop = canvas.top;
- var cRight = canvas.width - canvas.right;
- var cBottom = canvas.height - canvas.bottom;
- return bBoxes.reduce(function(margins, bBox) {
- if (!bBox || bBox.isEmpty) {
- return margins
- }
- return {
- left: _max(margins.left, cLeft - bBox.x),
- top: _max(margins.top, cTop - bBox.y),
- right: _max(margins.right, bBox.x + bBox.width - cRight),
- bottom: _max(margins.bottom, bBox.y + bBox.height - cBottom)
- }
- }, {
- left: 0,
- right: 0,
- top: 0,
- bottom: 0
- })
- };
- var Axis = exports.Axis = function(renderSettings) {
- var that = this;
- that._renderer = renderSettings.renderer;
- that._incidentOccurred = renderSettings.incidentOccurred;
- that._eventTrigger = renderSettings.eventTrigger;
- that._stripsGroup = renderSettings.stripsGroup;
- that._labelAxesGroup = renderSettings.labelAxesGroup;
- that._constantLinesGroup = renderSettings.constantLinesGroup;
- that._scaleBreaksGroup = renderSettings.scaleBreaksGroup;
- that._axesContainerGroup = renderSettings.axesContainerGroup;
- that._gridContainerGroup = renderSettings.gridGroup;
- that._axisCssPrefix = renderSettings.widgetClass + "-" + (renderSettings.axisClass ? renderSettings.axisClass + "-" : "");
- that._setType(renderSettings.axisType, renderSettings.drawingType);
- that._createAxisGroups();
- that._translator = that._createTranslator();
- that.isArgumentAxis = renderSettings.isArgumentAxis;
- that._viewport = {};
- that._firstDrawing = true;
- that._initRange = {}
- };
- Axis.prototype = {
- constructor: Axis,
- _drawAxis: function() {
- var options = this._options;
- if (!options.visible) {
- return
- }
- this._axisElement = this._createAxisElement();
- this._updateAxisElementPosition();
- this._axisElement.attr({
- "stroke-width": options.width,
- stroke: options.color,
- "stroke-opacity": options.opacity
- }).sharp(this._getSharpParam(true), this.getAxisSharpDirection()).append(this._axisLineGroup)
- },
- _createPathElement: function(points, attr, sharpDirection) {
- return this.sharp(this._renderer.path(points, "line").attr(attr), sharpDirection)
- },
- sharp: function(svgElement) {
- var sharpDirection = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
- return svgElement.sharp(this._getSharpParam(), sharpDirection)
- },
- getAxisSharpDirection: function() {
- var position = this._options.position;
- return position === TOP || position === LEFT ? 1 : -1
- },
- getSharpDirectionByCoords: function(coords) {
- var canvas = this._getCanvasStartEnd();
- var maxCoord = Math.max(canvas.start, canvas.end);
- return this.getRadius ? 0 : maxCoord !== coords[this._isHorizontal ? "x" : "y"] ? 1 : -1
- },
- _getGridLineDrawer: function() {
- var that = this;
- return function(tick, gridStyle) {
- var grid = that._getGridPoints(tick.coords);
- if (grid.points) {
- return that._createPathElement(grid.points, gridStyle, that.getSharpDirectionByCoords(tick.coords))
- }
- return null
- }
- },
- _getGridPoints: function(coords) {
- var that = this;
- var isHorizontal = this._isHorizontal;
- var tickPositionField = isHorizontal ? "x" : "y";
- var orthogonalPositions = this._orthogonalPositions;
- var positionFrom = orthogonalPositions.start;
- var positionTo = orthogonalPositions.end;
- var borderOptions = that.borderOptions;
- var canvasStart = isHorizontal ? LEFT : TOP;
- var canvasEnd = isHorizontal ? RIGHT : BOTTOM;
- var axisCanvas = that.getCanvas();
- var canvas = {
- left: axisCanvas.left,
- right: axisCanvas.width - axisCanvas.right,
- top: axisCanvas.top,
- bottom: axisCanvas.height - axisCanvas.bottom
- };
- var firstBorderLinePosition = borderOptions.visible && borderOptions[canvasStart] ? canvas[canvasStart] : void 0;
- var lastBorderLinePosition = borderOptions.visible && borderOptions[canvasEnd] ? canvas[canvasEnd] : void 0;
- var minDelta = MAX_GRID_BORDER_ADHENSION + firstBorderLinePosition;
- var maxDelta = lastBorderLinePosition - MAX_GRID_BORDER_ADHENSION;
- if (that.areCoordsOutsideAxis(coords) || void 0 === coords[tickPositionField] || coords[tickPositionField] < minDelta || coords[tickPositionField] > maxDelta) {
- return {
- points: null
- }
- }
- return {
- points: isHorizontal ? null !== coords[tickPositionField] ? [coords[tickPositionField], positionFrom, coords[tickPositionField], positionTo] : null : null !== coords[tickPositionField] ? [positionFrom, coords[tickPositionField], positionTo, coords[tickPositionField]] : null
- }
- },
- _getConstantLinePos: function(parsedValue, canvasStart, canvasEnd) {
- var value = this._getTranslatedCoord(parsedValue);
- if (!(0, _type.isDefined)(value) || value < _min(canvasStart, canvasEnd) || value > _max(canvasStart, canvasEnd)) {
- return
- }
- return value
- },
- _getConstantLineGraphicAttributes: function(value) {
- var positionFrom = this._orthogonalPositions.start;
- var positionTo = this._orthogonalPositions.end;
- return {
- points: this._isHorizontal ? [value, positionFrom, value, positionTo] : [positionFrom, value, positionTo, value]
- }
- },
- _createConstantLine: function(value, attr) {
- return this._createPathElement(this._getConstantLineGraphicAttributes(value).points, attr, getConstantLineSharpDirection(value, this._getCanvasStartEnd()))
- },
- _drawConstantLineLabelText: function(text, x, y, _ref, group) {
- var font = _ref.font,
- cssClass = _ref.cssClass;
- return this._renderer.text(text, x, y).css(patchFontOptions((0, _extend.extend)({}, this._options.label.font, font))).attr({
- align: "center",
- "class": cssClass
- }).append(group)
- },
- _drawConstantLineLabels: function(parsedValue, lineLabelOptions, value, group) {
- var that = this;
- var text = lineLabelOptions.text;
- var options = that._options;
- var labelOptions = options.label;
- that._checkAlignmentConstantLineLabels(lineLabelOptions);
- text = (0, _type.isDefined)(text) ? text : that.formatLabel(parsedValue, labelOptions);
- var coords = that._getConstantLineLabelsCoords(value, lineLabelOptions);
- return that._drawConstantLineLabelText(text, coords.x, coords.y, lineLabelOptions, group)
- },
- _getStripPos: function(startValue, endValue, canvasStart, canvasEnd, range) {
- var isContinuous = !!(range.minVisible || range.maxVisible);
- var categories = (range.categories || []).reduce(function(result, cat) {
- result.push(cat.valueOf());
- return result
- }, []);
- var start;
- var end;
- if (!isContinuous) {
- if ((0, _type.isDefined)(startValue) && (0, _type.isDefined)(endValue)) {
- var parsedStartValue = this.parser(startValue);
- var parsedEndValue = this.parser(endValue);
- var startCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedStartValue) ? parsedStartValue.valueOf() : void 0, categories);
- var endCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedEndValue) ? parsedEndValue.valueOf() : void 0, categories);
- if (startCategoryIndex === -1 || endCategoryIndex === -1) {
- return {
- from: 0,
- to: 0,
- outOfCanvas: true
- }
- }
- if (startCategoryIndex > endCategoryIndex) {
- var swap = endValue;
- endValue = startValue;
- startValue = swap
- }
- }
- }
- if ((0, _type.isDefined)(startValue)) {
- startValue = this.validateUnit(startValue, "E2105", "strip");
- start = this._getTranslatedCoord(startValue, -1)
- } else {
- start = canvasStart
- }
- if ((0, _type.isDefined)(endValue)) {
- endValue = this.validateUnit(endValue, "E2105", "strip");
- end = this._getTranslatedCoord(endValue, 1)
- } else {
- end = canvasEnd
- }
- var stripPosition = start < end ? {
- from: start,
- to: end
- } : {
- from: end,
- to: start
- };
- var visibleArea = this.getVisibleArea();
- if (stripPosition.from <= visibleArea[0] && stripPosition.to <= visibleArea[0] || stripPosition.from >= visibleArea[1] && stripPosition.to >= visibleArea[1]) {
- stripPosition.outOfCanvas = true
- }
- return stripPosition
- },
- _getStripGraphicAttributes: function(fromPoint, toPoint) {
- var x;
- var y;
- var width;
- var height;
- var orthogonalPositions = this._orthogonalPositions;
- var positionFrom = orthogonalPositions.start;
- var positionTo = orthogonalPositions.end;
- if (this._isHorizontal) {
- x = fromPoint;
- y = _min(positionFrom, positionTo);
- width = toPoint - fromPoint;
- height = _abs(positionFrom - positionTo)
- } else {
- x = _min(positionFrom, positionTo);
- y = fromPoint;
- width = _abs(positionFrom - positionTo);
- height = _abs(fromPoint - toPoint)
- }
- return {
- x: x,
- y: y,
- width: width,
- height: height
- }
- },
- _createStrip: function(attrs) {
- return this._renderer.rect(attrs.x, attrs.y, attrs.width, attrs.height)
- },
- _adjustStripLabels: function() {
- var that = this;
- this._strips.forEach(function(strip) {
- if (strip.label) {
- strip.label.attr(that._getAdjustedStripLabelCoords(strip))
- }
- })
- },
- _adjustLabelsCoord: function(offset, maxWidth, checkCanvas) {
- var that = this;
- that._majorTicks.forEach(function(tick) {
- if (tick.label) {
- tick.label.attr(that._getLabelAdjustedCoord(tick, offset + (tick.labelOffset || 0), maxWidth, checkCanvas))
- }
- })
- },
- _adjustLabels: function(offset) {
- var that = this;
- var maxSize = that._majorTicks.reduce(function(size, tick) {
- if (!tick.label) {
- return size
- }
- var bBox = tick.labelRotationAngle ? _utils2.default.rotateBBox(tick.labelBBox, [tick.labelCoords.x, tick.labelCoords.y], -tick.labelRotationAngle) : tick.labelBBox;
- return {
- width: _max(size.width || 0, bBox.width),
- height: _max(size.height || 0, bBox.height),
- offset: _max(size.offset || 0, tick.labelOffset || 0)
- }
- }, {});
- var additionalOffset = that._isHorizontal ? maxSize.height : maxSize.width;
- that._adjustLabelsCoord(offset, maxSize.width);
- return offset + additionalOffset + (additionalOffset && that._options.label.indentFromAxis) + maxSize.offset
- },
- _getLabelAdjustedCoord: function(tick, offset, maxWidth) {
- offset = offset || 0;
- var that = this;
- var options = that._options;
- var box = _utils2.default.rotateBBox(tick.labelBBox, [tick.labelCoords.x, tick.labelCoords.y], -tick.labelRotationAngle || 0);
- var position = options.position;
- var textAlign = tick.labelAlignment || options.label.alignment;
- var isDiscrete = "discrete" === that._options.type;
- var isFlatLabel = tick.labelRotationAngle % 90 === 0;
- var indentFromAxis = options.label.indentFromAxis;
- var axisPosition = that._axisPosition;
- var labelCoords = tick.labelCoords;
- var labelX = labelCoords.x;
- var translateX;
- var translateY;
- if (that._isHorizontal) {
- if (position === BOTTOM) {
- translateY = axisPosition + indentFromAxis - box.y + offset
- } else {
- translateY = axisPosition - indentFromAxis - (box.y + box.height) - offset
- }
- if (textAlign === RIGHT) {
- translateX = isDiscrete && isFlatLabel ? tick.coords.x - (box.x + box.width) : labelX - box.x - box.width
- } else {
- if (textAlign === LEFT) {
- translateX = isDiscrete && isFlatLabel ? labelX - box.x - (tick.coords.x - labelX) : labelX - box.x
- } else {
- translateX = labelX - box.x - box.width / 2
- }
- }
- } else {
- translateY = labelCoords.y - box.y - box.height / 2;
- if (position === LEFT) {
- if (textAlign === LEFT) {
- translateX = axisPosition - indentFromAxis - maxWidth - box.x
- } else {
- if (textAlign === CENTER) {
- translateX = axisPosition - indentFromAxis - maxWidth / 2 - box.x - box.width / 2
- } else {
- translateX = axisPosition - indentFromAxis - box.x - box.width
- }
- }
- translateX -= offset
- } else {
- if (textAlign === RIGHT) {
- translateX = axisPosition + indentFromAxis + maxWidth - box.x - box.width
- } else {
- if (textAlign === CENTER) {
- translateX = axisPosition + indentFromAxis + maxWidth / 2 - box.x - box.width / 2
- } else {
- translateX = axisPosition + indentFromAxis - box.x
- }
- }
- translateX += offset
- }
- }
- return {
- translateX: translateX,
- translateY: translateY
- }
- },
- _createAxisConstantLineGroups: function() {
- var that = this;
- var renderer = that._renderer;
- var classSelector = that._axisCssPrefix;
- var constantLinesClass = classSelector + "constant-lines";
- var insideGroup = renderer.g().attr({
- "class": constantLinesClass
- });
- var outsideGroup1 = renderer.g().attr({
- "class": constantLinesClass
- });
- var outsideGroup2 = renderer.g().attr({
- "class": constantLinesClass
- });
- return {
- inside: insideGroup,
- outside1: outsideGroup1,
- left: outsideGroup1,
- top: outsideGroup1,
- outside2: outsideGroup2,
- right: outsideGroup2,
- bottom: outsideGroup2,
- remove: function() {
- this.inside.remove();
- this.outside1.remove();
- this.outside2.remove()
- },
- clear: function() {
- this.inside.clear();
- this.outside1.clear();
- this.outside2.clear()
- }
- }
- },
- _createAxisGroups: function() {
- var that = this;
- var renderer = that._renderer;
- var classSelector = that._axisCssPrefix;
- that._axisGroup = renderer.g().attr({
- "class": classSelector + "axis"
- });
- that._axisStripGroup = renderer.g().attr({
- "class": classSelector + "strips"
- });
- that._axisGridGroup = renderer.g().attr({
- "class": classSelector + "grid"
- });
- that._axisElementsGroup = renderer.g().attr({
- "class": classSelector + "elements"
- }).append(that._axisGroup);
- that._axisLineGroup = renderer.g().attr({
- "class": classSelector + "line"
- }).append(that._axisGroup);
- that._axisTitleGroup = renderer.g().attr({
- "class": classSelector + "title"
- }).append(that._axisGroup);
- that._axisConstantLineGroups = {
- above: that._createAxisConstantLineGroups(),
- under: that._createAxisConstantLineGroups()
- };
- that._axisStripLabelGroup = renderer.g().attr({
- "class": classSelector + "axis-labels"
- })
- },
- _clearAxisGroups: function() {
- var that = this;
- that._axisGroup.remove();
- that._axisStripGroup.remove();
- that._axisStripLabelGroup.remove();
- that._axisConstantLineGroups.above.remove();
- that._axisConstantLineGroups.under.remove();
- that._axisGridGroup.remove();
- that._axisTitleGroup.clear();
- that._axisElementsGroup.clear();
- that._axisLineGroup && that._axisLineGroup.clear();
- that._axisStripGroup && that._axisStripGroup.clear();
- that._axisGridGroup && that._axisGridGroup.clear();
- that._axisConstantLineGroups.above.clear();
- that._axisConstantLineGroups.under.clear();
- that._axisStripLabelGroup && that._axisStripLabelGroup.clear()
- },
- _getLabelFormatObject: function(value, labelOptions, range, point, tickInterval, ticks) {
- range = range || this._getViewportRange();
- var formatObject = {
- value: value,
- valueText: (0, _smart_formatter.smartFormatter)(value, {
- labelOptions: labelOptions,
- ticks: ticks || convertTicksToValues(this._majorTicks),
- tickInterval: (0, _type.isDefined)(tickInterval) ? tickInterval : this._tickInterval,
- dataType: this._options.dataType,
- logarithmBase: this._options.logarithmBase,
- type: this._options.type,
- showTransition: !this._options.marker.visible,
- point: point
- }) || "",
- min: range.minVisible,
- max: range.maxVisible
- };
- if (point) {
- formatObject.point = point
- }
- return formatObject
- },
- formatLabel: function(value, labelOptions, range, point, tickInterval, ticks) {
- var formatObject = this._getLabelFormatObject(value, labelOptions, range, point, tickInterval, ticks);
- return (0, _type.isFunction)(labelOptions.customizeText) ? labelOptions.customizeText.call(formatObject, formatObject) : formatObject.valueText
- },
- formatHint: function(value, labelOptions, range) {
- var formatObject = this._getLabelFormatObject(value, labelOptions, range);
- return (0, _type.isFunction)(labelOptions.customizeHint) ? labelOptions.customizeHint.call(formatObject, formatObject) : void 0
- },
- formatRange: function(startValue, endValue, interval) {
- return (0, _smart_formatter.formatRange)(startValue, endValue, interval, this.getOptions())
- },
- _setTickOffset: function() {
- var options = this._options;
- var discreteAxisDivisionMode = options.discreteAxisDivisionMode;
- this._tickOffset = +("crossLabels" !== discreteAxisDivisionMode || !discreteAxisDivisionMode)
- },
- getMargins: function() {
- var that = this;
- var options = that._options;
- var position = options.position;
- var placeholderSize = options.placeholderSize;
- var canvas = that.getCanvas();
- var cLeft = canvas.left;
- var cTop = canvas.top;
- var cRight = canvas.width - canvas.right;
- var cBottom = canvas.height - canvas.bottom;
- var edgeMarginCorrection = _max(options.grid.visible && options.grid.width || 0, options.tick.visible && options.tick.width || 0);
- var constantLineAboveSeries = that._axisConstantLineGroups.above;
- var constantLineUnderSeries = that._axisConstantLineGroups.under;
- var boxes = [that._axisElementsGroup, constantLineAboveSeries.outside1, constantLineAboveSeries.outside2, constantLineUnderSeries.outside1, constantLineUnderSeries.outside2, that._axisLineGroup].map(function(group) {
- return group && group.getBBox()
- }).concat(function(group) {
- var box = group && group.getBBox();
- if (!box || box.isEmpty) {
- return box
- }
- if (that._isHorizontal) {
- box.x = cLeft;
- box.width = cRight - cLeft
- } else {
- box.y = cTop;
- box.height = cBottom - cTop
- }
- return box
- }(that._axisTitleGroup));
- var margins = calculateCanvasMargins(boxes, canvas);
- margins[position] += options.crosshairMargin;
- if (placeholderSize) {
- margins[position] = placeholderSize
- }
- if (edgeMarginCorrection) {
- if (that._isHorizontal && canvas.right < edgeMarginCorrection && margins.right < edgeMarginCorrection) {
- margins.right = edgeMarginCorrection
- }
- if (!that._isHorizontal && canvas.bottom < edgeMarginCorrection && margins.bottom < edgeMarginCorrection) {
- margins.bottom = edgeMarginCorrection
- }
- }
- return margins
- },
- validateUnit: function(unit, idError, parameters) {
- var that = this;
- unit = that.parser(unit);
- if (void 0 === unit && idError) {
- that._incidentOccurred(idError, [parameters])
- }
- return unit
- },
- _setType: function(axisType, drawingType) {
- var that = this;
- var axisTypeMethods;
- switch (axisType) {
- case "xyAxes":
- axisTypeMethods = _xy_axes2.default;
- break;
- case "polarAxes":
- axisTypeMethods = _polar_axes2.default
- }(0, _extend.extend)(that, axisTypeMethods[drawingType])
- },
- _getSharpParam: function() {
- return true
- },
- _disposeBreaksGroup: _common.noop,
- dispose: function() {
- var that = this;
- [that._axisElementsGroup, that._axisStripGroup, that._axisGroup].forEach(function(g) {
- g.dispose()
- });
- that._strips = that._title = null;
- that._axisStripGroup = that._axisConstantLineGroups = that._axisStripLabelGroup = that._axisBreaksGroup = null;
- that._axisLineGroup = that._axisElementsGroup = that._axisGridGroup = null;
- that._axisGroup = that._axisTitleGroup = null;
- that._axesContainerGroup = that._stripsGroup = that._constantLinesGroup = null;
- that._renderer = that._options = that._textOptions = that._textFontStyles = null;
- that._translator = null;
- that._majorTicks = that._minorTicks = null;
- that._disposeBreaksGroup()
- },
- getOptions: function() {
- return this._options
- },
- setPane: function(pane) {
- this.pane = pane;
- this._options.pane = pane
- },
- setTypes: function(type, axisType, typeSelector) {
- this._options.type = type || this._options.type;
- this._options[typeSelector] = axisType || this._options[typeSelector];
- this._updateTranslator()
- },
- resetTypes: function(typeSelector) {
- this._options.type = this._initTypes.type;
- this._options[typeSelector] = this._initTypes[typeSelector]
- },
- getTranslator: function() {
- return this._translator
- },
- updateOptions: function(options) {
- var that = this;
- var labelOpt = options.label;
- validateAxisOptions(options);
- that._options = options;
- options.tick = options.tick || {};
- options.minorTick = options.minorTick || {};
- options.grid = options.grid || {};
- options.minorGrid = options.minorGrid || {};
- options.title = options.title || {};
- options.marker = options.marker || {};
- that._initTypes = {
- type: options.type,
- argumentType: options.argumentType,
- valueType: options.valueType
- };
- that._setTickOffset();
- that._isHorizontal = options.isHorizontal;
- that.pane = options.pane;
- that.name = options.name;
- that.priority = options.priority;
- that._hasLabelFormat = "" !== labelOpt.format && (0, _type.isDefined)(labelOpt.format);
- that._textOptions = {
- opacity: labelOpt.opacity,
- align: "center",
- "class": labelOpt.cssClass
- };
- that._textFontStyles = _utils2.default.patchFontOptions(labelOpt.font);
- if (options.type === _axes_constants2.default.logarithmic) {
- if (options.logarithmBaseError) {
- that._incidentOccurred("E2104");
- delete options.logarithmBaseError
- }
- }
- that._updateTranslator();
- that._createConstantLines();
- that._strips = (options.strips || []).map(function(o) {
- return (0, _strip2.default)(that, o)
- });
- that._majorTicks = that._minorTicks = null;
- that._firstDrawing = true
- },
- calculateInterval: function(value, prevValue) {
- var options = this._options;
- return !options || options.type !== _axes_constants2.default.logarithmic ? _abs(value - prevValue) : _utils2.default.getLog(value / prevValue, options.logarithmBase)
- },
- _processCanvas: function(canvas) {
- return canvas
- },
- updateCanvas: function(canvas) {
- var positions = this._orthogonalPositions = {
- start: !this._isHorizontal ? canvas.left : canvas.top,
- end: !this._isHorizontal ? canvas.width - canvas.right : canvas.height - canvas.bottom
- };
- this._canvas = canvas;
- positions.center = positions.start + (positions.end - positions.start) / 2;
- this._translator.updateCanvas(this._processCanvas(canvas));
- this._initAxisPositions()
- },
- getCanvas: function() {
- return this._canvas
- },
- getAxisShift: function() {
- return this._axisShift || 0
- },
- hideTitle: function() {
- var that = this;
- if (that._options.title.text) {
- that._incidentOccurred("W2105", [that._isHorizontal ? "horizontal" : "vertical"]);
- that._axisTitleGroup.clear()
- }
- },
- getTitle: function() {
- return this._title
- },
- hideOuterElements: function() {
- var that = this;
- var options = that._options;
- if ((options.label.visible || that._outsideConstantLines.length) && !that._translator.getBusinessRange().isEmpty()) {
- that._incidentOccurred("W2106", [that._isHorizontal ? "horizontal" : "vertical"]);
- that._axisElementsGroup.clear();
- callAction(that._outsideConstantLines, "removeLabel")
- }
- },
- adjustViewport: function(businessRange) {
- var that = this;
- var options = that._options;
- var isDiscrete = options.type === _axes_constants2.default.discrete;
- var categories = that._seriesData && that._seriesData.categories || [];
- var wholeRange = that.adjustRange(getVizRangeObject(options.wholeRange));
- var visualRange = that.getViewport() || {};
- var result = new _range.Range(businessRange);
- that._addConstantLinesToRange(result, "minVisible", "maxVisible");
- var minDefined = (0, _type.isDefined)(visualRange.startValue);
- var maxDefined = (0, _type.isDefined)(visualRange.endValue);
- if (!isDiscrete) {
- minDefined = minDefined && (!(0, _type.isDefined)(wholeRange.endValue) || visualRange.startValue < wholeRange.endValue);
- maxDefined = maxDefined && (!(0, _type.isDefined)(wholeRange.startValue) || visualRange.endValue > wholeRange.startValue)
- }
- var minVisible = minDefined ? visualRange.startValue : result.minVisible;
- var maxVisible = maxDefined ? visualRange.endValue : result.maxVisible;
- if (!isDiscrete) {
- result.min = (0, _type.isDefined)(wholeRange.startValue) ? wholeRange.startValue : result.min;
- result.max = (0, _type.isDefined)(wholeRange.endValue) ? wholeRange.endValue : result.max
- } else {
- var categoriesInfo = _utils2.default.getCategoriesInfo(categories, wholeRange.startValue, wholeRange.endValue);
- categories = categoriesInfo.categories;
- result.categories = categories
- }
- var adjustedVisualRange = _utils2.default.adjustVisualRange({
- axisType: options.type,
- dataType: options.dataType,
- base: options.logarithmBase
- }, {
- startValue: minDefined ? visualRange.startValue : void 0,
- endValue: maxDefined ? visualRange.endValue : void 0,
- length: visualRange.length
- }, {
- categories: categories,
- min: wholeRange.startValue,
- max: wholeRange.endValue
- }, {
- categories: categories,
- min: minVisible,
- max: maxVisible
- });
- result.minVisible = adjustedVisualRange.startValue;
- result.maxVisible = adjustedVisualRange.endValue;
- !(0, _type.isDefined)(result.min) && (result.min = result.minVisible);
- !(0, _type.isDefined)(result.max) && (result.max = result.maxVisible);
- result.addRange({});
- return result
- },
- adjustRange: function(range) {
- range = range || {};
- var isDiscrete = this._options.type === _axes_constants2.default.discrete;
- var isLogarithmic = this._options.type === _axes_constants2.default.logarithmic;
- if (isLogarithmic) {
- range.startValue = range.startValue <= 0 ? null : range.startValue;
- range.endValue = range.endValue <= 0 ? null : range.endValue
- }
- if (!isDiscrete && (0, _type.isDefined)(range.startValue) && (0, _type.isDefined)(range.endValue) && range.startValue > range.endValue) {
- var tmp = range.endValue;
- range.endValue = range.startValue;
- range.startValue = tmp
- }
- return range
- },
- _getVisualRangeUpdateMode: function(viewport, newRange, oppositeValue) {
- var value = this._options.visualRangeUpdateMode;
- var translator = this._translator;
- var range = this._seriesData;
- if (this.isArgumentAxis) {
- if ([SHIFT, KEEP, RESET].indexOf(value) === -1) {
- if (range.axisType === _axes_constants2.default.discrete) {
- var categories = range.categories;
- var newCategories = newRange.categories;
- var visualRange = this.visualRange();
- if (categories && newCategories && categories.length && newCategories.map(function(c) {
- return c.valueOf()
- }).join(",").indexOf(categories.map(function(c) {
- return c.valueOf()
- }).join(",")) !== -1 && (visualRange.startValue.valueOf() !== categories[0].valueOf() || visualRange.endValue.valueOf() !== categories[categories.length - 1].valueOf())) {
- value = KEEP
- } else {
- value = RESET
- }
- } else {
- var minPoint = translator.translate(range.min);
- var minVisiblePoint = translator.translate(viewport.startValue);
- var maxPoint = translator.translate(range.max);
- var maxVisiblePoint = translator.translate(viewport.endValue);
- if (minPoint === minVisiblePoint && maxPoint === maxVisiblePoint) {
- value = RESET
- } else {
- if (minPoint !== minVisiblePoint && maxPoint === maxVisiblePoint) {
- value = SHIFT
- } else {
- value = KEEP
- }
- }
- }
- }
- } else {
- if ([KEEP, RESET].indexOf(value) === -1) {
- if (oppositeValue === KEEP) {
- value = KEEP
- } else {
- value = RESET
- }
- }
- }
- return value
- },
- _handleBusinessRangeChanged: function(oppositeVisualRangeUpdateMode, axisReinitialized, newRange) {
- var that = this;
- var visualRange = this.visualRange();
- if (axisReinitialized || that._translator.getBusinessRange().isEmpty()) {
- return
- }
- var visualRangeUpdateMode = that._lastVisualRangeUpdateMode = that._getVisualRangeUpdateMode(visualRange, newRange, oppositeVisualRangeUpdateMode);
- if (!that.isArgumentAxis) {
- var viewport = that.getViewport();
- if (!(0, _type.isDefined)(viewport.startValue) && !(0, _type.isDefined)(viewport.endValue) && !(0, _type.isDefined)(viewport.length)) {
- visualRangeUpdateMode = RESET
- }
- }
- that._prevDataWasEmpty && (visualRangeUpdateMode = KEEP);
- if (visualRangeUpdateMode === KEEP) {
- that._setVisualRange([visualRange.startValue, visualRange.endValue])
- }
- if (visualRangeUpdateMode === RESET) {
- that._setVisualRange([null, null])
- }
- if (visualRangeUpdateMode === SHIFT) {
- that._setVisualRange({
- length: that.getVisualRangeLength()
- })
- }
- },
- getVisualRangeLength: function(range) {
- var currentBusinessRange = range || this._translator.getBusinessRange();
- var _this$_options = this._options,
- type = _this$_options.type,
- logarithmBase = _this$_options.logarithmBase;
- var length;
- if (type === _axes_constants2.default.logarithmic) {
- length = (0, _math2.adjust)(_utils2.default.getLog(currentBusinessRange.maxVisible / currentBusinessRange.minVisible, logarithmBase))
- } else {
- if (type === _axes_constants2.default.discrete) {
- var categoriesInfo = _utils2.default.getCategoriesInfo(currentBusinessRange.categories, currentBusinessRange.minVisible, currentBusinessRange.maxVisible);
- length = categoriesInfo.categories.length
- } else {
- length = currentBusinessRange.maxVisible - currentBusinessRange.minVisible
- }
- }
- return length
- },
- getVisualRangeCenter: function(range) {
- var businessRange = this._translator.getBusinessRange();
- var currentBusinessRange = range || businessRange;
- var _this$_options2 = this._options,
- type = _this$_options2.type,
- logarithmBase = _this$_options2.logarithmBase;
- var center;
- if (!(0, _type.isDefined)(currentBusinessRange.minVisible) || !(0, _type.isDefined)(currentBusinessRange.maxVisible)) {
- return
- }
- if (type === _axes_constants2.default.logarithmic) {
- center = _utils2.default.raiseTo((0, _math2.adjust)(_utils2.default.getLog(currentBusinessRange.maxVisible * currentBusinessRange.minVisible, logarithmBase)) / 2, logarithmBase)
- } else {
- if (type === _axes_constants2.default.discrete) {
- var categoriesInfo = _utils2.default.getCategoriesInfo(currentBusinessRange.categories, currentBusinessRange.minVisible, currentBusinessRange.maxVisible);
- var index = Math.ceil(categoriesInfo.categories.length / 2) - 1;
- center = businessRange.categories.indexOf(categoriesInfo.categories[index])
- } else {
- center = (currentBusinessRange.maxVisible.valueOf() + currentBusinessRange.minVisible.valueOf()) / 2
- }
- }
- return center
- },
- setBusinessRange: function(range, axisReinitialized, oppositeVisualRangeUpdateMode, argCategories) {
- var that = this;
- var options = that._options;
- var isDiscrete = options.type === _axes_constants2.default.discrete;
- that._handleBusinessRangeChanged(oppositeVisualRangeUpdateMode, axisReinitialized, range);
- that._seriesData = new _range.Range(range);
- var dataIsEmpty = that._seriesData.isEmpty();
- that._prevDataWasEmpty = dataIsEmpty;
- that._seriesData.addRange({
- categories: options.categories,
- dataType: options.dataType,
- axisType: options.type,
- base: options.logarithmBase,
- invert: options.inverted
- });
- if (!isDiscrete) {
- if (!(0, _type.isDefined)(that._seriesData.min) && !(0, _type.isDefined)(that._seriesData.max)) {
- var visualRange = that.getViewport();
- visualRange && that._seriesData.addRange({
- min: visualRange.startValue,
- max: visualRange.endValue
- })
- }
- var synchronizedValue = options.synchronizedValue;
- if ((0, _type.isDefined)(synchronizedValue)) {
- that._seriesData.addRange({
- min: synchronizedValue,
- max: synchronizedValue
- })
- }
- }
- that._seriesData.minVisible = void 0 === that._seriesData.minVisible ? that._seriesData.min : that._seriesData.minVisible;
- that._seriesData.maxVisible = void 0 === that._seriesData.maxVisible ? that._seriesData.max : that._seriesData.maxVisible;
- if (!that.isArgumentAxis && options.showZero) {
- that._seriesData.correctValueZeroLevel()
- }
- that._seriesData.sortCategories(that.getCategoriesSorter(argCategories));
- that._seriesData.breaks = that._breaks = that._getScaleBreaks(options, that._seriesData, that._series, that.isArgumentAxis);
- that._translator.updateBusinessRange(that.adjustViewport(that._seriesData))
- },
- _addConstantLinesToRange: function(dataRange, minValueField, maxValueField) {
- this._outsideConstantLines.concat(this._insideConstantLines || []).forEach(function(cl) {
- if (cl.options.extendAxis) {
- var _dataRange$addRange;
- var value = cl.getParsedValue();
- dataRange.addRange((_dataRange$addRange = {}, _defineProperty(_dataRange$addRange, minValueField, value), _defineProperty(_dataRange$addRange, maxValueField, value), _dataRange$addRange))
- }
- })
- },
- setGroupSeries: function(series) {
- this._series = series
- },
- getLabelsPosition: function() {
- var that = this;
- var options = that._options;
- var position = options.position;
- var labelShift = options.label.indentFromAxis + (that._axisShift || 0) + that._constantLabelOffset;
- var axisPosition = that._axisPosition;
- return position === TOP || position === LEFT ? axisPosition - labelShift : axisPosition + labelShift
- },
- getFormattedValue: function(value, options, point) {
- var labelOptions = this._options.label;
- return (0, _type.isDefined)(value) ? this.formatLabel(value, (0, _extend.extend)(true, {}, labelOptions, options), void 0, point) : null
- },
- _getBoundaryTicks: function(majors, viewPort) {
- var that = this;
- var length = majors.length;
- var options = that._options;
- var customBounds = options.customBoundTicks;
- var min = viewPort.minVisible;
- var max = viewPort.maxVisible;
- var addMinMax = options.showCustomBoundaryTicks ? that._boundaryTicksVisibility : {};
- var boundaryTicks = [];
- if (options.type === _axes_constants2.default.discrete) {
- if (that._tickOffset && 0 !== majors.length) {
- boundaryTicks = [majors[0], majors[majors.length - 1]]
- }
- } else {
- if (customBounds) {
- if (addMinMax.min && (0, _type.isDefined)(customBounds[0])) {
- boundaryTicks.push(customBounds[0])
- }
- if (addMinMax.max && (0, _type.isDefined)(customBounds[1])) {
- boundaryTicks.push(customBounds[1])
- }
- } else {
- if (addMinMax.min && (0 === length || majors[0] > min)) {
- boundaryTicks.push(min)
- }
- if (addMinMax.max && (0 === length || majors[length - 1] < max)) {
- boundaryTicks.push(max)
- }
- }
- }
- return boundaryTicks
- },
- setPercentLabelFormat: function() {
- if (!this._hasLabelFormat) {
- this._options.label.format = "percent"
- }
- },
- resetAutoLabelFormat: function() {
- if (!this._hasLabelFormat) {
- delete this._options.label.format
- }
- },
- getMultipleAxesSpacing: function() {
- return this._options.multipleAxesSpacing || 0
- },
- getTicksValues: function() {
- return {
- majorTicksValues: convertTicksToValues(this._majorTicks),
- minorTicksValues: convertTicksToValues(this._minorTicks)
- }
- },
- setTicks: function(ticks) {
- var majors = ticks.majorTicks || [];
- this._majorTicks = majors.map(createMajorTick(this, this._renderer, this._getSkippedCategory(majors)));
- this._minorTicks = (ticks.minorTicks || []).map(createMinorTick(this, this._renderer));
- this._isSynchronized = true
- },
- _adjustDivisionFactor: function(val) {
- return val
- },
- _getTicks: function(viewPort, incidentOccurred, skipTickGeneration) {
- var that = this;
- var options = that._options;
- var customTicks = options.customTicks;
- var customMinorTicks = options.customMinorTicks;
- return getTickGenerator(options, incidentOccurred || that._incidentOccurred, skipTickGeneration, that._translator.getBusinessRange().isEmpty(), that._adjustDivisionFactor.bind(that))({
- min: viewPort.minVisible,
- max: viewPort.maxVisible,
- categories: viewPort.categories,
- isSpacedMargin: viewPort.isSpacedMargin,
- checkMinDataVisibility: viewPort.checkMinDataVisibility,
- checkMaxDataVisibility: viewPort.checkMaxDataVisibility
- }, that._getScreenDelta(), options.tickInterval, "ignore" === options.label.overlappingBehavior || options.forceUserTickInterval, {
- majors: customTicks,
- minors: customMinorTicks
- }, options.minorTickInterval, options.minorTickCount, that._breaks)
- },
- _createTicksAndLabelFormat: function(range, incidentOccurred) {
- var options = this._options;
- var ticks = this._getTicks(range, incidentOccurred, false);
- if (!range.isEmpty() && options.type === _axes_constants2.default.discrete && "datetime" === options.dataType && !this._hasLabelFormat && ticks.ticks.length) {
- options.label.format = _format_helper2.default.getDateFormatByTicks(ticks.ticks)
- }
- return ticks
- },
- getAggregationInfo: function(useAllAggregatedPoints, range) {
- var that = this;
- var options = that._options;
- var marginOptions = that._marginOptions;
- var businessRange = new _range.Range(that.getTranslator().getBusinessRange()).addRange(range);
- var visualRange = that.getViewport();
- var minVisible = visualRange && (0, _type.isDefined)(visualRange.startValue) ? visualRange.startValue : businessRange.minVisible;
- var maxVisible = visualRange && (0, _type.isDefined)(visualRange.endValue) ? visualRange.endValue : businessRange.maxVisible;
- var ticks = [];
- var aggregationInterval = options.aggregationInterval;
- var aggregationGroupWidth = options.aggregationGroupWidth;
- if (!aggregationGroupWidth && marginOptions) {
- if (marginOptions.checkInterval) {
- aggregationGroupWidth = options.axisDivisionFactor
- }
- if (marginOptions.sizePointNormalState) {
- aggregationGroupWidth = Math.min(marginOptions.sizePointNormalState, options.axisDivisionFactor)
- }
- }
- var minInterval = !options.aggregationGroupWidth && !aggregationInterval && range.interval;
- var generateTicks = configureGenerator(options, aggregationGroupWidth, businessRange, that._getScreenDelta(), minInterval);
- var tickInterval = generateTicks(aggregationInterval, true, minVisible, maxVisible, that._breaks).tickInterval;
- if (options.type !== _axes_constants2.default.discrete) {
- var min = useAllAggregatedPoints ? businessRange.min : minVisible;
- var max = useAllAggregatedPoints ? businessRange.max : maxVisible;
- if ((0, _type.isDefined)(min) && (0, _type.isDefined)(max)) {
- var add = _utils2.default.getAddFunction({
- base: options.logarithmBase,
- axisType: options.type,
- dataType: options.dataType
- }, false);
- var start = min;
- var end = max;
- if (!useAllAggregatedPoints) {
- var maxMinDistance = Math.max(that.calculateInterval(max, min), "datetime" === options.dataType ? (0, _date.dateToMilliseconds)(tickInterval) : tickInterval);
- start = add(min, maxMinDistance, -1);
- end = add(max, maxMinDistance)
- }
- start = start < businessRange.min ? businessRange.min : start;
- end = end > businessRange.max ? businessRange.max : end;
- var breaks = that._getScaleBreaks(options, {
- minVisible: start,
- maxVisible: end
- }, that._series, that.isArgumentAxis);
- ticks = generateTicks(tickInterval, false, start, end, breaks).ticks
- }
- }
- that._aggregationInterval = tickInterval;
- return {
- interval: tickInterval,
- ticks: ticks
- }
- },
- createTicks: function(canvas) {
- var that = this;
- var renderer = that._renderer;
- var options = that._options;
- if (!canvas) {
- return
- }
- that._isSynchronized = false;
- that.updateCanvas(canvas);
- that._estimatedTickInterval = that._getTicks(that.adjustViewport(this._seriesData), _common.noop, true).tickInterval;
- var range = that._getViewportRange();
- var margins = this._calculateValueMargins();
- range.addRange({
- minVisible: margins.minValue,
- maxVisible: margins.maxValue,
- isSpacedMargin: margins.isSpacedMargin,
- checkMinDataVisibility: !this.isArgumentAxis && margins.checkInterval && !(0, _type.isDefined)(options.min) && margins.minValue.valueOf() > 0,
- checkMaxDataVisibility: !this.isArgumentAxis && margins.checkInterval && !(0, _type.isDefined)(options.max) && margins.maxValue.valueOf() < 0
- });
- var ticks = that._createTicksAndLabelFormat(range);
- var boundaryTicks = that._getBoundaryTicks(ticks.ticks, that._getViewportRange());
- if (options.showCustomBoundaryTicks && boundaryTicks.length) {
- that._boundaryTicks = [boundaryTicks[0]].map(createBoundaryTick(that, renderer, true));
- if (boundaryTicks.length > 1) {
- that._boundaryTicks = that._boundaryTicks.concat([boundaryTicks[1]].map(createBoundaryTick(that, renderer, false)))
- }
- } else {
- that._boundaryTicks = []
- }
- var minors = (ticks.minorTicks || []).filter(function(minor) {
- return !boundaryTicks.some(function(boundary) {
- return valueOf(boundary) === valueOf(minor)
- })
- });
- that._tickInterval = ticks.tickInterval;
- that._minorTickInterval = ticks.minorTickInterval;
- var oldMajorTicks = that._majorTicks || [];
- var majorTicksByValues = oldMajorTicks.reduce(function(r, t) {
- r[t.value.valueOf()] = t;
- return r
- }, {});
- var sameType = (0, _type.type)(ticks.ticks[0]) === (0, _type.type)(oldMajorTicks[0] && oldMajorTicks[0].value);
- var skippedCategory = that._getSkippedCategory(ticks.ticks);
- var majorTicks = ticks.ticks.map(function(v) {
- var tick = majorTicksByValues[v.valueOf()];
- if (tick && sameType) {
- delete majorTicksByValues[v.valueOf()];
- tick.setSkippedCategory(skippedCategory);
- return tick
- } else {
- return createMajorTick(that, renderer, skippedCategory)(v)
- }
- });
- that._majorTicks = majorTicks;
- var oldMinorTicks = that._minorTicks || [];
- that._minorTicks = minors.map(function(v, i) {
- var minorTick = oldMinorTicks[i];
- if (minorTick) {
- minorTick.updateValue(v);
- return minorTick
- }
- return createMinorTick(that, renderer)(v)
- });
- that._ticksToRemove = Object.keys(majorTicksByValues).map(function(k) {
- return majorTicksByValues[k]
- }).concat(oldMinorTicks.slice(that._minorTicks.length, oldMinorTicks.length));
- that._correctedBreaks = ticks.breaks;
- that._reinitTranslator(that._getViewportRange())
- },
- _reinitTranslator: function(range) {
- var that = this;
- var translator = that._translator;
- if (that._correctedBreaks) {
- range.breaks = that._correctedBreaks
- }
- if (that._isSynchronized) {
- return
- }
- translator.updateBusinessRange(that.adjustViewport(range))
- },
- _getViewportRange: function() {
- return this.adjustViewport(this._seriesData)
- },
- setMarginOptions: function(options) {
- this._marginOptions = options
- },
- getMarginOptions: function() {
- return (0, _type.isDefined)(this._marginOptions) ? this._marginOptions : {}
- },
- allowToExtendVisualRange: function(isEnd) {
- var wholeRange = this.adjustRange(getVizRangeObject(this._options.wholeRange));
- var bound = isEnd ? wholeRange.endValue : wholeRange.startValue;
- return !this.isArgumentAxis || !(0, _type.isDefined)(bound) && this.isExtremePosition(isEnd)
- },
- _calculateRangeInterval: function(interval) {
- var isDateTime = "datetime" === this._options.dataType;
- var minArgs = [];
- var addToArgs = function(value) {
- (0, _type.isDefined)(value) && minArgs.push(isDateTime ? (0, _date.dateToMilliseconds)(value) : value)
- };
- addToArgs(this._tickInterval);
- addToArgs(this._estimatedTickInterval);
- (0, _type.isDefined)(interval) && minArgs.push(interval);
- addToArgs(this._aggregationInterval);
- return this._calculateWorkWeekInterval(_min.apply(this, minArgs))
- },
- _calculateWorkWeekInterval: function(businessInterval) {
- var options = this._options;
- if ("datetime" === options.dataType && options.workdaysOnly && businessInterval) {
- var workWeek = options.workWeek.length * dateIntervals.day;
- var weekend = dateIntervals.week - workWeek;
- if (workWeek !== businessInterval && weekend < businessInterval) {
- var weekendsCount = Math.ceil(businessInterval / dateIntervals.week);
- businessInterval = weekend >= businessInterval ? dateIntervals.day : businessInterval - weekend * weekendsCount
- } else {
- if (weekend >= businessInterval && businessInterval > dateIntervals.day) {
- businessInterval = dateIntervals.day
- }
- }
- }
- return businessInterval
- },
- _calculateValueMargins: function(ticks) {
- this._resetMargins();
- var that = this;
- var margins = that.getMarginOptions();
- var marginSize = (margins.size || 0) / 2;
- var options = that._options;
- var dataRange = this._getViewportRange();
- var viewPort = this.getViewport();
- var screenDelta = that._getScreenDelta();
- var isDiscrete = (options.type || "").indexOf(_axes_constants2.default.discrete) !== -1;
- var valueMarginsEnabled = options.valueMarginsEnabled && !isDiscrete;
- var translator = that._translator;
- var minValueMargin = options.minValueMargin;
- var maxValueMargin = options.maxValueMargin;
- var minPadding = 0;
- var maxPadding = 0;
- var interval = 0;
- var rangeInterval;
- if (dataRange.stubData || !screenDelta) {
- return {
- startPadding: 0,
- endPadding: 0
- }
- }
- function getConvertIntervalCoefficient(intervalInPx) {
- var ratioOfCanvasRange = translator.ratioOfCanvasRange();
- return ratioOfCanvasRange / (ratioOfCanvasRange * screenDelta / (intervalInPx + screenDelta))
- }
- if (that.isArgumentAxis && margins.checkInterval) {
- rangeInterval = that._calculateRangeInterval(dataRange.interval);
- var pxInterval = translator.getInterval(rangeInterval);
- if (isFinite(pxInterval)) {
- interval = Math.ceil(pxInterval / (2 * getConvertIntervalCoefficient(pxInterval)))
- } else {
- rangeInterval = 0
- }
- }
- var minPercentPadding;
- var maxPercentPadding;
- var maxPaddingValue = screenDelta * MAX_MARGIN_VALUE / 2;
- if (valueMarginsEnabled) {
- if ((0, _type.isDefined)(minValueMargin)) {
- minPercentPadding = isFinite(minValueMargin) ? minValueMargin : 0
- } else {
- minPadding = Math.max(marginSize, interval);
- minPadding = Math.min(maxPaddingValue, minPadding)
- }
- if ((0, _type.isDefined)(maxValueMargin)) {
- maxPercentPadding = isFinite(maxValueMargin) ? maxValueMargin : 0
- } else {
- maxPadding = Math.max(marginSize, interval);
- maxPadding = Math.min(maxPaddingValue, maxPadding)
- }
- }
- var percentStick = margins.percentStick && !this.isArgumentAxis;
- if (percentStick) {
- if (1 === _abs(dataRange.max)) {
- maxPadding = 0
- }
- if (1 === _abs(dataRange.min)) {
- minPadding = 0
- }
- }
- var canvasStartEnd = that._getCanvasStartEnd();
- var commonMargin = 1 + (minPercentPadding || 0) + (maxPercentPadding || 0);
- var screenDeltaWithMargins = (screenDelta - minPadding - maxPadding) / commonMargin || screenDelta;
- if (void 0 !== minPercentPadding || void 0 !== maxPercentPadding) {
- if (void 0 !== minPercentPadding) {
- minPadding = screenDeltaWithMargins * minPercentPadding
- }
- if (void 0 !== maxPercentPadding) {
- maxPadding = screenDeltaWithMargins * maxPercentPadding
- }
- }
- var minValue;
- var maxValue;
- if (options.type !== _axes_constants2.default.discrete && ticks && ticks.length > 1 && !options.skipViewportExtending && !viewPort.action && false !== options.endOnTick) {
- var length = ticks.length;
- var firstTickPosition = translator.translate(ticks[0].value);
- var lastTickPosition = translator.translate(ticks[length - 1].value);
- var invertMultiplier = firstTickPosition > lastTickPosition ? -1 : 1;
- var minTickPadding = _max(invertMultiplier * (canvasStartEnd.start - firstTickPosition), 0);
- var maxTickPadding = _max(invertMultiplier * (lastTickPosition - canvasStartEnd.end), 0);
- if (minTickPadding > minPadding || maxTickPadding > maxPadding) {
- var commonPadding = maxTickPadding + minTickPadding;
- var coeff = getConvertIntervalCoefficient(commonPadding);
- if (minTickPadding >= minPadding) {
- minValue = ticks[0].value
- }
- if (maxTickPadding >= maxPadding) {
- maxValue = ticks[length - 1].value
- }
- minPadding = _max(minTickPadding, minPadding) / coeff;
- maxPadding = _max(maxTickPadding, maxPadding) / coeff
- }
- }
- minPercentPadding = void 0 === minPercentPadding ? minPadding / screenDeltaWithMargins : minPercentPadding;
- maxPercentPadding = void 0 === maxPercentPadding ? maxPadding / screenDeltaWithMargins : maxPercentPadding;
- if (!isDiscrete) {
- if (this._translator.isInverted()) {
- minValue = (0, _type.isDefined)(minValue) ? minValue : translator.from(canvasStartEnd.start + screenDelta * minPercentPadding, -1);
- maxValue = (0, _type.isDefined)(maxValue) ? maxValue : translator.from(canvasStartEnd.end - screenDelta * maxPercentPadding, 1)
- } else {
- minValue = (0, _type.isDefined)(minValue) ? minValue : translator.from(canvasStartEnd.start - screenDelta * minPercentPadding, -1);
- maxValue = (0, _type.isDefined)(maxValue) ? maxValue : translator.from(canvasStartEnd.end + screenDelta * maxPercentPadding, 1)
- }
- }
- function correctZeroLevel(minPoint, maxPoint) {
- var minExpectedPadding = _abs(canvasStartEnd.start - minPoint);
- var maxExpectedPadding = _abs(canvasStartEnd.end - maxPoint);
- var coeff = getConvertIntervalCoefficient(minExpectedPadding + maxExpectedPadding);
- minPadding = minExpectedPadding / coeff;
- maxPadding = maxExpectedPadding / coeff
- }
- if (!that.isArgumentAxis) {
- if (minValue * dataRange.min <= 0 && minValue * dataRange.minVisible <= 0) {
- correctZeroLevel(translator.translate(0), translator.translate(maxValue));
- minValue = 0
- }
- if (maxValue * dataRange.max <= 0 && maxValue * dataRange.maxVisible <= 0) {
- correctZeroLevel(translator.translate(minValue), translator.translate(0));
- maxValue = 0
- }
- }
- return {
- startPadding: this._translator.isInverted() ? maxPadding : minPadding,
- endPadding: this._translator.isInverted() ? minPadding : maxPadding,
- minValue: minValue,
- maxValue: maxValue,
- interval: rangeInterval,
- isSpacedMargin: minPadding === maxPadding && 0 !== minPadding
- }
- },
- applyMargins: function() {
- if (this._isSynchronized) {
- return
- }
- var margins = this._calculateValueMargins(this._majorTicks);
- var canvas = (0, _extend.extend)({}, this._canvas, {
- startPadding: margins.startPadding,
- endPadding: margins.endPadding
- });
- this._translator.updateCanvas(this._processCanvas(canvas));
- if (isFinite(margins.interval)) {
- var br = this._translator.getBusinessRange();
- br.addRange({
- interval: margins.interval
- });
- this._translator.updateBusinessRange(br)
- }
- },
- _resetMargins: function() {
- this._reinitTranslator(this._getViewportRange());
- if (this._canvas) {
- this._translator.updateCanvas(this._processCanvas(this._canvas))
- }
- },
- _createConstantLines: function() {
- var _this = this;
- var constantLines = (this._options.constantLines || []).map(function(o) {
- return (0, _constant_line2.default)(_this, o)
- });
- this._outsideConstantLines = constantLines.filter(function(l) {
- return "outside" === l.labelPosition
- });
- this._insideConstantLines = constantLines.filter(function(l) {
- return "inside" === l.labelPosition
- })
- },
- draw: function(canvas, borderOptions) {
- var that = this;
- var options = this._options;
- that.borderOptions = borderOptions || {
- visible: false
- };
- that._resetMargins();
- that.createTicks(canvas);
- that.applyMargins();
- that._clearAxisGroups();
- initTickCoords(that._majorTicks);
- initTickCoords(that._minorTicks);
- initTickCoords(that._boundaryTicks);
- that._axisGroup.append(that._axesContainerGroup);
- that._drawAxis();
- that._drawTitle();
- drawTickMarks(that._majorTicks, options.tick);
- drawTickMarks(that._minorTicks, options.minorTick);
- drawTickMarks(that._boundaryTicks, options.tick);
- var drawGridLine = that._getGridLineDrawer();
- drawGrids(that._majorTicks, drawGridLine);
- drawGrids(that._minorTicks, drawGridLine);
- callAction(that._majorTicks, "drawLabel", that._getViewportRange());
- that._majorTicks.forEach(function(tick) {
- tick.labelRotationAngle = 0;
- tick.labelAlignment = void 0;
- tick.labelOffset = 0
- });
- callAction(that._outsideConstantLines.concat(that._insideConstantLines), "draw");
- callAction(that._strips, "draw");
- that._dateMarkers = that._drawDateMarkers() || [];
- that._labelAxesGroup && that._axisStripLabelGroup.append(that._labelAxesGroup);
- that._gridContainerGroup && that._axisGridGroup.append(that._gridContainerGroup);
- that._stripsGroup && that._axisStripGroup.append(that._stripsGroup);
- if (that._constantLinesGroup) {
- that._axisConstantLineGroups.above.inside.append(that._constantLinesGroup.above);
- that._axisConstantLineGroups.above.outside1.append(that._constantLinesGroup.above);
- that._axisConstantLineGroups.above.outside2.append(that._constantLinesGroup.above);
- that._axisConstantLineGroups.under.inside.append(that._constantLinesGroup.under);
- that._axisConstantLineGroups.under.outside1.append(that._constantLinesGroup.under);
- that._axisConstantLineGroups.under.outside2.append(that._constantLinesGroup.under)
- }
- that._measureTitle();
- measureLabels(that._majorTicks);
- var textWidth;
- var textHeight;
- var convertedTickInterval;
- var tickInterval = that._tickInterval;
- if ((0, _type.isDefined)(tickInterval)) {
- convertedTickInterval = that.getTranslator().getInterval("datetime" === options.dataType ? (0, _date.dateToMilliseconds)(tickInterval) : tickInterval)
- }
- if (that._isHorizontal) {
- textWidth = convertedTickInterval;
- textHeight = options.placeholderSize
- } else {
- textWidth = options.placeholderSize;
- textHeight = convertedTickInterval
- }
- var displayMode = that._validateDisplayMode(options.label.displayMode);
- var overlappingMode = that._validateOverlappingMode(options.label.overlappingBehavior, displayMode);
- var wordWrapMode = options.label.wordWrap || "none";
- var overflowMode = options.label.textOverflow || "none";
- if (("none" !== wordWrapMode || "none" !== overflowMode) && displayMode !== ROTATE && overlappingMode !== ROTATE && "auto" !== overlappingMode) {
- var correctByWidth = false;
- var correctByHeight = false;
- if (textWidth) {
- if (that._majorTicks.some(function(tick) {
- return tick.labelBBox.width > textWidth
- })) {
- correctByWidth = true
- }
- }
- if (textHeight) {
- if (that._majorTicks.some(function(tick) {
- return tick.labelBBox.height > textHeight
- })) {
- correctByHeight = true
- }
- }
- if (correctByWidth || correctByHeight) {
- that._majorTicks.forEach(function(tick) {
- tick.label && tick.label.setMaxSize(textWidth, textHeight, options.label)
- });
- measureLabels(that._majorTicks)
- }
- }
- measureLabels(that._outsideConstantLines);
- measureLabels(that._insideConstantLines);
- measureLabels(that._strips);
- measureLabels(that._dateMarkers);
- that._adjustConstantLineLabels(that._insideConstantLines);
- that._adjustStripLabels();
- var offset = that._constantLabelOffset = that._adjustConstantLineLabels(that._outsideConstantLines);
- if (!that._translator.getBusinessRange().isEmpty()) {
- that._setLabelsPlacement();
- offset = that._adjustLabels(offset)
- }
- offset = that._adjustDateMarkers(offset);
- that._adjustTitle(offset)
- },
- _measureTitle: _common.noop,
- animate: function() {
- callAction(this._majorTicks, "animateLabels")
- },
- updateSize: function(canvas, animate) {
- var updateTitle = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true;
- var that = this;
- that.updateCanvas(canvas);
- if (updateTitle) {
- that._checkTitleOverflow();
- that._measureTitle();
- that._updateTitleCoords()
- }
- that._reinitTranslator(that._getViewportRange());
- that.applyMargins();
- var animationEnabled = !that._firstDrawing && animate;
- var options = this._options;
- initTickCoords(that._majorTicks);
- initTickCoords(that._minorTicks);
- initTickCoords(that._boundaryTicks);
- cleanUpInvalidTicks(that._majorTicks);
- cleanUpInvalidTicks(that._minorTicks);
- cleanUpInvalidTicks(that._boundaryTicks);
- if (this._axisElement) {
- that._updateAxisElementPosition()
- }
- updateTicksPosition(that._majorTicks, options.tick, animationEnabled);
- updateTicksPosition(that._minorTicks, options.minorTick, animationEnabled);
- updateTicksPosition(that._boundaryTicks, options.tick);
- callAction(that._majorTicks, "updateLabelPosition", animationEnabled);
- that._outsideConstantLines.concat(that._insideConstantLines || []).forEach(function(l) {
- return l.updatePosition(animationEnabled)
- });
- callAction(that._strips, "updatePosition", animationEnabled);
- updateGridsPosition(that._majorTicks, animationEnabled);
- updateGridsPosition(that._minorTicks, animationEnabled);
- if (animationEnabled) {
- callAction(that._ticksToRemove || [], "fadeOutElements")
- }
- that.prepareAnimation();
- that._ticksToRemove = null;
- if (!that._translator.getBusinessRange().isEmpty()) {
- that._firstDrawing = false
- }
- },
- prepareAnimation: function() {
- var that = this;
- var action = "saveCoords";
- callAction(that._majorTicks, action);
- callAction(that._minorTicks, action);
- callAction(that._insideConstantLines, action);
- callAction(that._outsideConstantLines, action);
- callAction(that._strips, action)
- },
- applyClipRects: function(elementsClipID, canvasClipID) {
- this._axisGroup.attr({
- "clip-path": canvasClipID
- });
- this._axisStripGroup.attr({
- "clip-path": elementsClipID
- })
- },
- _mergeViewportOptions: function() {
- var that = this;
- var options = that._options;
- var visualRange = {};
- var visualRangeOptionValue = options._customVisualRange;
- if (((0, _type.isDefined)(options.max) || (0, _type.isDefined)(options.min)) && !(0, _type.isDefined)(visualRangeOptionValue.startValue) && !(0, _type.isDefined)(visualRangeOptionValue.endValue) && !(0, _type.isDefined)(visualRangeOptionValue.length)) {
- visualRange = {
- startValue: options.min,
- endValue: options.max
- }
- } else {
- visualRange = visualRangeOptionValue
- }
- that._setVisualRange(visualRange)
- },
- _validateVisualRange: function(visualRange) {
- var range = getVizRangeObject(visualRange);
- if (void 0 !== range.startValue) {
- range.startValue = this.validateUnit(range.startValue)
- }
- if (void 0 !== range.endValue) {
- range.endValue = this.validateUnit(range.endValue)
- }
- return convertVisualRangeObject(range, visualRange)
- },
- _validateOptions: function(options) {
- var that = this;
- if (void 0 !== options.min) {
- options.min = that.validateUnit(options.min, "E2106")
- }
- if (void 0 !== options.max) {
- options.max = that.validateUnit(options.max, "E2106")
- }
- options.wholeRange = that._validateVisualRange(options.wholeRange);
- options.visualRange = options._customVisualRange = that._validateVisualRange(options._customVisualRange);
- that._mergeViewportOptions()
- },
- validate: function() {
- var that = this;
- var options = that._options;
- var dataType = that.isArgumentAxis ? options.argumentType : options.valueType;
- var parser = dataType ? _parse_utils2.default.getParser(dataType) : function(unit) {
- return unit
- };
- that.parser = parser;
- options.dataType = dataType;
- that._validateOptions(options)
- },
- resetVisualRange: function(isSilent) {
- this._seriesData.minVisible = this._seriesData.min;
- this._seriesData.maxVisible = this._seriesData.max;
- this.handleZooming([null, null], {
- start: !!isSilent,
- end: !!isSilent
- })
- },
- _applyZooming: function(visualRange, allowPartialUpdate) {
- var that = this;
- that._resetVisualRangeOption();
- that._setVisualRange(visualRange, allowPartialUpdate);
- var viewPort = that.getViewport();
- that._breaks = that._getScaleBreaks(that._options, {
- minVisible: viewPort.startValue,
- maxVisible: viewPort.endValue
- }, that._series, that.isArgumentAxis);
- that._translator.updateBusinessRange(that._getViewportRange())
- },
- getZoomStartEventArg: function(event, actionType) {
- return {
- axis: this,
- range: this.visualRange(),
- cancel: false,
- event: event,
- actionType: actionType
- }
- },
- getZoomEndEventArg: function(previousRange, event, actionType, zoomFactor, shift) {
- var newRange = this.visualRange();
- return {
- axis: this,
- previousRange: previousRange,
- range: newRange,
- cancel: false,
- event: event,
- actionType: actionType,
- zoomFactor: zoomFactor,
- shift: shift,
- rangeStart: newRange.startValue,
- rangeEnd: newRange.endValue
- }
- },
- getZoomBounds: function() {
- var wholeRange = _utils2.default.getVizRangeObject(this._options.wholeRange);
- var range = this.getTranslator().getBusinessRange();
- var secondPriorityRange = {
- startValue: getZoomBoundValue(this._initRange.startValue, range.min),
- endValue: getZoomBoundValue(this._initRange.endValue, range.max)
- };
- return {
- startValue: getZoomBoundValue(wholeRange.startValue, secondPriorityRange.startValue),
- endValue: getZoomBoundValue(wholeRange.endValue, secondPriorityRange.endValue)
- }
- },
- setInitRange: function() {
- this._initRange = {};
- if (0 === Object.keys(this._options.wholeRange || {}).length) {
- this._initRange = this.getZoomBounds()
- }
- },
- _resetVisualRangeOption: function() {
- this._options._customVisualRange = {}
- },
- setCustomVisualRange: function(range) {
- this._options._customVisualRange = range
- },
- visualRange: function visualRange() {
- var that = this;
- var args = arguments;
- var visualRange;
- if (0 === args.length) {
- var adjustedRange = that._getAdjustedBusinessRange();
- var startValue = adjustedRange.minVisible;
- var endValue = adjustedRange.maxVisible;
- if (that._options.type === _axes_constants2.default.discrete) {
- startValue = (0, _type.isDefined)(startValue) ? startValue : adjustedRange.categories[0];
- endValue = (0, _type.isDefined)(endValue) ? endValue : adjustedRange.categories[adjustedRange.categories.length - 1];
- return {
- startValue: startValue,
- endValue: endValue,
- categories: _utils2.default.getCategoriesInfo(adjustedRange.categories, startValue, endValue).categories
- }
- }
- return {
- startValue: startValue,
- endValue: endValue
- }
- } else {
- if (_isArray(args[0])) {
- visualRange = args[0]
- } else {
- if ((0, _type.isPlainObject)(args[0])) {
- visualRange = (0, _extend.extend)({}, args[0])
- } else {
- visualRange = [args[0], args[1]]
- }
- }
- }
- var zoomResults = that.handleZooming(visualRange, args[1]);
- if (!zoomResults.isPrevented) {
- that._visualRange(that, zoomResults)
- }
- },
- handleZooming: function(visualRange, preventEvents, domEvent, action) {
- var that = this;
- preventEvents = preventEvents || {};
- if ((0, _type.isDefined)(visualRange)) {
- visualRange = that._validateVisualRange(visualRange);
- visualRange.action = action
- }
- var zoomStartEvent = that.getZoomStartEventArg(domEvent, action);
- var previousRange = zoomStartEvent.range;
- !preventEvents.start && that._eventTrigger("zoomStart", zoomStartEvent);
- var zoomResults = {
- isPrevented: zoomStartEvent.cancel,
- skipEventRising: preventEvents.skipEventRising,
- range: visualRange || zoomStartEvent.range
- };
- if (!zoomStartEvent.cancel) {
- (0, _type.isDefined)(visualRange) && that._applyZooming(visualRange, preventEvents.allowPartialUpdate);
- if (!(0, _type.isDefined)(that._storedZoomEndParams)) {
- that._storedZoomEndParams = {
- startRange: previousRange,
- type: this.getOptions().type
- }
- }
- that._storedZoomEndParams.event = domEvent;
- that._storedZoomEndParams.action = action;
- that._storedZoomEndParams.prevent = !!preventEvents.end
- }
- return zoomResults
- },
- handleZoomEnd: function() {
- var that = this;
- if ((0, _type.isDefined)(that._storedZoomEndParams) && !that._storedZoomEndParams.prevent) {
- var previousRange = that._storedZoomEndParams.startRange;
- var domEvent = that._storedZoomEndParams.event;
- var action = that._storedZoomEndParams.action;
- var previousBusinessRange = {
- minVisible: previousRange.startValue,
- maxVisible: previousRange.endValue,
- categories: previousRange.categories
- };
- var typeIsNotChanged = that.getOptions().type === that._storedZoomEndParams.type;
- var shift = typeIsNotChanged ? (0, _math2.adjust)(that.getVisualRangeCenter() - that.getVisualRangeCenter(previousBusinessRange)) : NaN;
- var zoomFactor = typeIsNotChanged ? +(Math.round(that.getVisualRangeLength(previousBusinessRange) / that.getVisualRangeLength() + "e+2") + "e-2") : NaN;
- var zoomEndEvent = that.getZoomEndEventArg(previousRange, domEvent, action, zoomFactor, shift);
- zoomEndEvent.cancel = that.isZoomingLowerLimitOvercome(1 === zoomFactor ? "pan" : "zoom", zoomFactor);
- that._eventTrigger("zoomEnd", zoomEndEvent);
- if (zoomEndEvent.cancel) {
- that.restorePreviousVisualRange(previousRange)
- }
- that._storedZoomEndParams = null
- }
- },
- restorePreviousVisualRange: function(previousRange) {
- var that = this;
- that._storedZoomEndParams = null;
- that._applyZooming(previousRange);
- that._visualRange(that, previousRange)
- },
- isZoomingLowerLimitOvercome: function(actionType, zoomFactor, range) {
- var that = this;
- var options = that._options;
- var minZoom = options.minVisualRangeLength;
- var isOvercoming = "zoom" === actionType && zoomFactor >= 1;
- var businessRange = that._translator.getBusinessRange();
- var visualRange;
- if ((0, _type.isDefined)(range)) {
- visualRange = that.adjustRange(_utils2.default.getVizRangeObject(range));
- visualRange = {
- minVisible: visualRange.startValue,
- maxVisible: visualRange.endValue,
- categories: businessRange.categories
- }
- }
- var visualRangeLength = that.getVisualRangeLength(visualRange);
- if ("discrete" !== options.type) {
- if ((0, _type.isDefined)(minZoom)) {
- if ("datetime" === options.dataType && !(0, _type.isNumeric)(minZoom)) {
- minZoom = (0, _date.dateToMilliseconds)(minZoom)
- }
- isOvercoming &= minZoom >= visualRangeLength
- } else {
- var canvasLength = that._translator.canvasLength;
- var fullRange = {
- minVisible: businessRange.min,
- maxVisible: businessRange.max,
- categories: businessRange.categories
- };
- isOvercoming &= that.getVisualRangeLength(fullRange) / canvasLength >= visualRangeLength
- }
- } else {
- !(0, _type.isDefined)(minZoom) && (minZoom = 1);
- isOvercoming &= (0, _type.isDefined)(range) && that.getVisualRangeLength() === minZoom && visualRangeLength <= minZoom
- }
- return !!isOvercoming
- },
- dataVisualRangeIsReduced: function() {
- var minDataValue;
- var maxDataValue;
- var translator = this.getTranslator();
- if ("discrete" === this._options.type) {
- var categories = translator.getBusinessRange().categories;
- minDataValue = categories[0];
- maxDataValue = categories[categories.length - 1]
- } else {
- var seriesData = this._seriesData;
- minDataValue = seriesData.min;
- maxDataValue = seriesData.max
- }
- if (!(0, _type.isDefined)(minDataValue) || !(0, _type.isDefined)(maxDataValue)) {
- return false
- }
- var startPoint = translator.translate(minDataValue);
- var endPoint = translator.translate(maxDataValue);
- var edges = [Math.min(startPoint, endPoint), Math.max(startPoint, endPoint)];
- var visualRange = this.visualRange();
- var visualRangeStartPoint = translator.translate(visualRange.startValue);
- var visualRangeEndPoint = translator.translate(visualRange.endValue);
- return visualRangeStartPoint > edges[0] && visualRangeStartPoint < edges[1] || visualRangeEndPoint > edges[0] && visualRangeEndPoint < edges[1] || visualRangeStartPoint === visualRangeEndPoint && edges[0] !== edges[1]
- },
- isExtremePosition: function(isMax) {
- var extremeDataValue;
- var seriesData;
- if ("discrete" === this._options.type) {
- seriesData = this._translator.getBusinessRange();
- extremeDataValue = isMax ? seriesData.categories[seriesData.categories.length - 1] : seriesData.categories[0]
- } else {
- seriesData = this.getZoomBounds();
- extremeDataValue = isMax ? seriesData.endValue : seriesData.startValue
- }
- var translator = this.getTranslator();
- var extremePoint = translator.translate(extremeDataValue);
- var visualRange = this.visualRange();
- var visualRangePoint = isMax ? translator.translate(visualRange.endValue) : translator.translate(visualRange.startValue);
- return _abs(visualRangePoint - extremePoint) < SCROLL_THRESHOLD
- },
- getViewport: function() {
- return this._viewport
- },
- getFullTicks: function() {
- var majors = this._majorTicks || [];
- if (this._options.type === _axes_constants2.default.discrete) {
- return convertTicksToValues(majors)
- } else {
- return convertTicksToValues(majors.concat(this._minorTicks, this._boundaryTicks)).sort(function(a, b) {
- return valueOf(a) - valueOf(b)
- })
- }
- },
- measureLabels: function(canvas, withIndents) {
- var that = this;
- var options = that._options;
- var widthAxis = options.visible ? options.width : 0;
- var ticks;
- var indent = withIndents ? options.label.indentFromAxis + .5 * options.tick.length : 0;
- var tickInterval;
- var viewportRange = that._getViewportRange();
- if (viewportRange.isEmpty() || !options.label.visible || !that._axisElementsGroup) {
- return {
- height: widthAxis,
- width: widthAxis,
- x: 0,
- y: 0
- }
- }
- if (that._majorTicks) {
- ticks = convertTicksToValues(that._majorTicks)
- } else {
- this.updateCanvas(canvas);
- ticks = that._createTicksAndLabelFormat(viewportRange, _common.noop);
- tickInterval = ticks.tickInterval;
- ticks = ticks.ticks
- }
- var maxText = ticks.reduce(function(prevLabel, tick, index) {
- var label = that.formatLabel(tick, options.label, viewportRange, void 0, tickInterval, ticks);
- if (prevLabel.length < label.length) {
- return label
- } else {
- return prevLabel
- }
- }, that.formatLabel(ticks[0], options.label, viewportRange, void 0, tickInterval, ticks));
- var text = that._renderer.text(maxText, 0, 0).css(that._textFontStyles).attr(that._textOptions).append(that._renderer.root);
- var box = text.getBBox();
- text.remove();
- return {
- x: box.x,
- y: box.y,
- width: box.width + indent,
- height: box.height + indent
- }
- },
- _setLabelsPlacement: function() {
- if (!this._options.label.visible) {
- return
- }
- var that = this;
- var labelOpt = that._options.label;
- var displayMode = that._validateDisplayMode(labelOpt.displayMode);
- var overlappingMode = that._validateOverlappingMode(labelOpt.overlappingBehavior, displayMode);
- var ignoreOverlapping = "none" === overlappingMode || "ignore" === overlappingMode;
- var behavior = {
- rotationAngle: labelOpt.rotationAngle,
- staggeringSpacing: labelOpt.staggeringSpacing
- };
- var notRecastStep;
- var boxes = that._majorTicks.map(function(tick) {
- return tick.labelBBox
- });
- var step;
- step = that._getStep(boxes);
- switch (displayMode) {
- case ROTATE:
- if (ignoreOverlapping) {
- notRecastStep = true;
- step = 1
- }
- that._applyLabelMode(displayMode, step, boxes, labelOpt, notRecastStep);
- break;
- case "stagger":
- if (ignoreOverlapping) {
- step = 2
- }
- that._applyLabelMode(displayMode, _max(step, 2), boxes, labelOpt);
- break;
- default:
- that._applyLabelOverlapping(boxes, overlappingMode, step, behavior)
- }
- },
- _applyLabelOverlapping: function(boxes, mode, step, behavior) {
- var that = this;
- var labelOpt = that._options.label;
- var majorTicks = that._majorTicks;
- if ("none" === mode || "ignore" === mode) {
- return
- }
- var checkLabels = function(box, index, array) {
- if (0 === index) {
- return false
- }
- return _axes_constants2.default.areLabelsOverlap(box, array[index - 1], labelOpt.minSpacing, labelOpt.alignment)
- };
- if (step > 1 && boxes.some(checkLabels)) {
- that._applyLabelMode(mode, step, boxes, behavior)
- }
- that._checkBoundedLabelsOverlapping(majorTicks, boxes, mode)
- },
- _applyLabelMode: function(mode, step, boxes, behavior, notRecastStep) {
- var that = this;
- var majorTicks = that._majorTicks;
- var labelOpt = that._options.label;
- var angle = behavior.rotationAngle;
- var alignment;
- var func;
- switch (mode) {
- case ROTATE:
- if (!labelOpt.userAlignment) {
- alignment = angle < 0 ? RIGHT : LEFT;
- if (angle % 90 === 0) {
- alignment = CENTER
- }
- }
- step = notRecastStep ? step : that._getStep(boxes, angle);
- func = function(tick) {
- tick.label.rotate(angle);
- tick.labelRotationAngle = angle;
- alignment && (tick.labelAlignment = alignment)
- };
- updateLabels(majorTicks, step, func);
- break;
- case "stagger":
- var labelHeight = that._getMaxLabelHeight(boxes, behavior.staggeringSpacing);
- func = function(tick, index) {
- if (index / (step - 1) % 2 !== 0) {
- tick.labelOffset = labelHeight
- }
- };
- updateLabels(majorTicks, step - 1, func);
- break;
- case "auto":
- case "_auto":
- if (2 === step) {
- that._applyLabelMode("stagger", step, boxes, behavior)
- } else {
- that._applyLabelMode(ROTATE, step, boxes, {
- rotationAngle: getOptimalAngle(boxes, labelOpt)
- })
- }
- break;
- default:
- updateLabels(majorTicks, step)
- }
- },
- getMarkerTrackers: _common.noop,
- _drawDateMarkers: _common.noop,
- _adjustDateMarkers: _common.noop,
- coordsIn: _common.noop,
- areCoordsOutsideAxis: _common.noop,
- _getSkippedCategory: _common.noop,
- _initAxisPositions: _common.noop,
- _drawTitle: _common.noop,
- _updateTitleCoords: _common.noop,
- _adjustConstantLineLabels: _common.noop,
- _createTranslator: function() {
- return new _translator2d2.default.Translator2D({}, {}, {})
- },
- _updateTranslator: function() {
- var translator = this._translator;
- translator.update(translator.getBusinessRange(), this._canvas || {}, this._getTranslatorOptions())
- },
- _getTranslatorOptions: function() {
- var options = this._options;
- return {
- isHorizontal: this._isHorizontal,
- shiftZeroValue: !this.isArgumentAxis,
- interval: options.semiDiscreteInterval,
- stick: this._getStick(),
- breaksSize: options.breakStyle ? options.breakStyle.width : 0
- }
- },
- getVisibleArea: function() {
- var canvas = this._getCanvasStartEnd();
- return [canvas.start, canvas.end].sort(function(a, b) {
- return a - b
- })
- },
- _getCanvasStartEnd: function() {
- var isHorizontal = this._isHorizontal;
- var canvas = this._canvas || {};
- var invert = this._translator.getBusinessRange().invert;
- var coords = isHorizontal ? [canvas.left, canvas.width - canvas.right] : [canvas.height - canvas.bottom, canvas.top];
- invert && coords.reverse();
- return {
- start: coords[0],
- end: coords[1]
- }
- },
- _getScreenDelta: function() {
- var that = this;
- var canvas = that._getCanvasStartEnd();
- var breaks = that._breaks;
- var breaksLength = breaks ? breaks.length : 0;
- var screenDelta = _abs(canvas.start - canvas.end);
- return screenDelta - (breaksLength ? breaks[breaksLength - 1].cumulativeWidth : 0)
- },
- _getScaleBreaks: function() {
- return []
- },
- _adjustTitle: _common.noop,
- _checkTitleOverflow: _common.noop,
- getSpiderTicks: _common.noop,
- setSpiderTicks: _common.noop,
- _checkBoundedLabelsOverlapping: _common.noop,
- drawScaleBreaks: _common.noop,
- _visualRange: _common.noop,
- _rotateConstantLine: _common.noop,
- applyVisualRangeSetter: _common.noop,
- getCategoriesSorter: function(argCategories) {
- var sort;
- if (this.isArgumentAxis) {
- sort = argCategories
- } else {
- var categoriesSortingMethod = this._options.categoriesSortingMethod;
- sort = (0, _type.isDefined)(categoriesSortingMethod) ? categoriesSortingMethod : this._options.categories
- }
- return sort
- },
- _getAdjustedBusinessRange: function() {
- return this.adjustViewport(this._translator.getBusinessRange())
- },
- _getTickMarkPoints: _common.noop,
- _validateOverlappingMode: _common.noop,
- _getStep: _common.noop,
- _validateDisplayMode: _common.noop,
- shift: _common.noop
- }
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/common.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dxBaseGauge = __webpack_require__( /*! ./base_gauge */ 145).dxBaseGauge;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _isDefined = typeUtils.isDefined;
- var _isArray = Array.isArray;
- var _isNumber = typeUtils.isNumeric;
- var axisModule = __webpack_require__( /*! ../axes/base_axis */ 204);
- var _map = __webpack_require__( /*! ../core/utils */ 10).map;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var _compareArrays = __webpack_require__( /*! ./base_gauge */ 145).compareArrays;
- var _isFinite = isFinite;
- var _Number = Number;
- var _min = Math.min;
- var _max = Math.max;
- var _extend = extend;
- var _each = each;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var SHIFT_ANGLE = 90;
- var OPTION_VALUE = "value";
- var OPTION_SUBVALUES = "subvalues";
- var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 5;
- var DEFAULT_NUMBER_MULTIPLIERS = [1, 2, 5];
- function processValue(value, fallbackValue) {
- if (null === value) {
- return value
- }
- return _isFinite(value) ? _Number(value) : fallbackValue
- }
- function parseArrayOfNumbers(arg) {
- return _isArray(arg) ? arg : _isNumber(arg) ? [arg] : null
- }
- exports.dxGauge = dxBaseGauge.inherit({
- _initCore: function() {
- var that = this;
- var renderer = that._renderer;
- that._setupValue(that.option(OPTION_VALUE));
- that.__subvalues = parseArrayOfNumbers(that.option(OPTION_SUBVALUES));
- that._setupSubvalues(that.__subvalues);
- selectMode(that);
- that.callBase.apply(that, arguments);
- that._rangeContainer = new that._factory.RangeContainer({
- renderer: renderer,
- container: renderer.root,
- translator: that._translator,
- themeManager: that._themeManager
- });
- that._initScale()
- },
- _fontFields: ["scale.label.font", "valueIndicators.rangebar.text.font", "valueIndicators.textcloud.text.font", "indicator.text.font"],
- _initScale: function() {
- var that = this;
- that._scaleGroup = that._renderer.g().attr({
- "class": "dxg-scale"
- }).linkOn(that._renderer.root, "scale");
- that._scale = new axisModule.Axis({
- incidentOccurred: that._incidentOccurred,
- renderer: that._renderer,
- axesContainerGroup: that._scaleGroup,
- axisType: that._scaleTypes.type,
- drawingType: that._scaleTypes.drawingType,
- widgetClass: "dxg"
- })
- },
- _disposeCore: function() {
- var that = this;
- that.callBase.apply(that, arguments);
- that._scale.dispose();
- that._scaleGroup.linkOff();
- that._rangeContainer.dispose();
- that._disposeValueIndicators();
- that._scale = that._scaleGroup = that._rangeContainer = null
- },
- _disposeValueIndicators: function() {
- var that = this;
- that._valueIndicator && that._valueIndicator.dispose();
- that._subvalueIndicatorsSet && that._subvalueIndicatorsSet.dispose();
- that._valueIndicator = that._subvalueIndicatorsSet = null
- },
- _setupDomainCore: function() {
- var that = this;
- var scaleOption = that.option("scale") || {};
- var startValue = that.option("startValue");
- var endValue = that.option("endValue");
- startValue = _isNumber(startValue) ? _Number(startValue) : _isNumber(scaleOption.startValue) ? _Number(scaleOption.startValue) : 0;
- endValue = _isNumber(endValue) ? _Number(endValue) : _isNumber(scaleOption.endValue) ? _Number(scaleOption.endValue) : 100;
- that._baseValue = startValue < endValue ? startValue : endValue;
- that._translator.setDomain(startValue, endValue)
- },
- _cleanContent: function() {
- var that = this;
- that._rangeContainer.clean();
- that._cleanValueIndicators()
- },
- _measureScale: function(scaleOptions) {
- var that = this;
- var majorTick = scaleOptions.tick;
- var majorTickEnabled = majorTick.visible && majorTick.length > 0 && majorTick.width > 0;
- var minorTick = scaleOptions.minorTick;
- var minorTickEnabled = minorTick.visible && minorTick.length > 0 && minorTick.width > 0;
- var label = scaleOptions.label;
- var indentFromTick = Number(label.indentFromTick);
- if (!majorTickEnabled && !minorTickEnabled && !label.visible) {
- return {}
- }
- var textParams = that._scale.measureLabels(extend({}, that._canvas));
- var layoutValue = that._getScaleLayoutValue();
- var result = {
- min: layoutValue,
- max: layoutValue
- };
- var coefs = that._getTicksCoefficients(scaleOptions);
- var innerCoef = coefs.inner;
- var outerCoef = coefs.outer;
- if (majorTickEnabled) {
- result.min = _min(result.min, layoutValue - innerCoef * majorTick.length);
- result.max = _max(result.max, layoutValue + outerCoef * majorTick.length)
- }
- if (minorTickEnabled) {
- result.min = _min(result.min, layoutValue - innerCoef * minorTick.length);
- result.max = _max(result.max, layoutValue + outerCoef * minorTick.length)
- }
- label.visible && that._correctScaleIndents(result, indentFromTick, textParams);
- return result
- },
- _renderContent: function() {
- var that = this;
- var scaleOptions = that._prepareScaleSettings();
- that._rangeContainer.render(_extend(that._getOption("rangeContainer"), {
- vertical: that._area.vertical
- }));
- that._renderScale(scaleOptions);
- var elements = _map([that._rangeContainer].concat(that._prepareValueIndicators()), function(element) {
- return element && element.enabled ? element : null
- });
- that._applyMainLayout(elements, that._measureScale(scaleOptions));
- _each(elements, function(_, element) {
- element.resize(that._getElementLayout(element.getOffset()))
- });
- that._shiftScale(that._getElementLayout(0), scaleOptions);
- that._beginValueChanging();
- that._updateActiveElements();
- that._endValueChanging()
- },
- _prepareScaleSettings: function() {
- var that = this;
- var userOptions = that.option("scale");
- var scaleOptions = extend(true, {}, that._themeManager.theme("scale"), userOptions);
- scaleOptions.label.indentFromAxis = 0;
- scaleOptions.isHorizontal = !that._area.vertical;
- scaleOptions.forceUserTickInterval |= _isDefined(userOptions) && _isDefined(userOptions.tickInterval) && !_isDefined(userOptions.scaleDivisionFactor);
- scaleOptions.axisDivisionFactor = scaleOptions.scaleDivisionFactor || that._gridSpacingFactor;
- scaleOptions.minorAxisDivisionFactor = scaleOptions.minorScaleDivisionFactor || DEFAULT_MINOR_AXIS_DIVISION_FACTOR;
- scaleOptions.numberMultipliers = DEFAULT_NUMBER_MULTIPLIERS;
- scaleOptions.tickOrientation = that._getTicksOrientation(scaleOptions);
- if (scaleOptions.label.useRangeColors) {
- scaleOptions.label.customizeColor = function() {
- return that._rangeContainer.getColorForValue(this.value)
- }
- }
- return scaleOptions
- },
- _renderScale: function(scaleOptions) {
- var that = this;
- var bounds = that._translator.getDomain();
- var startValue = bounds[0];
- var endValue = bounds[1];
- var angles = that._translator.getCodomain();
- var invert = startValue > endValue;
- var min = _min(startValue, endValue);
- var max = _max(startValue, endValue);
- scaleOptions.min = min;
- scaleOptions.max = max;
- scaleOptions.startAngle = SHIFT_ANGLE - angles[0];
- scaleOptions.endAngle = SHIFT_ANGLE - angles[1];
- scaleOptions.skipViewportExtending = true;
- that._scale.updateOptions(scaleOptions);
- that._scale.setBusinessRange({
- axisType: "continuous",
- dataType: "numeric",
- min: min,
- max: max,
- invert: invert
- });
- that._updateScaleTickIndent(scaleOptions);
- that._scaleGroup.linkAppend();
- that._scale.draw(extend({}, that._canvas))
- },
- _updateIndicatorSettings: function(settings) {
- var that = this;
- settings.currentValue = settings.baseValue = _isFinite(that._translator.translate(settings.baseValue)) ? _Number(settings.baseValue) : that._baseValue;
- settings.vertical = that._area.vertical;
- if (settings.text && !settings.text.format) {
- settings.text.format = that._defaultFormatOptions
- }
- },
- _prepareIndicatorSettings: function(options, defaultTypeField) {
- var that = this;
- var theme = that._themeManager.theme("valueIndicators");
- var type = _normalizeEnum(options.type || that._themeManager.theme(defaultTypeField));
- var settings = _extend(true, {}, theme._default, theme[type], options);
- settings.type = type;
- settings.animation = that._animationSettings;
- settings.containerBackgroundColor = that._containerBackgroundColor;
- that._updateIndicatorSettings(settings);
- return settings
- },
- _cleanValueIndicators: function() {
- this._valueIndicator && this._valueIndicator.clean();
- this._subvalueIndicatorsSet && this._subvalueIndicatorsSet.clean()
- },
- _prepareValueIndicators: function() {
- var that = this;
- that._prepareValueIndicator();
- null !== that.__subvalues && that._prepareSubvalueIndicators();
- return [that._valueIndicator, that._subvalueIndicatorsSet]
- },
- _updateActiveElements: function() {
- this._updateValueIndicator();
- this._updateSubvalueIndicators()
- },
- _prepareValueIndicator: function() {
- var that = this;
- var target = that._valueIndicator;
- var settings = that._prepareIndicatorSettings(that.option("valueIndicator") || {}, "valueIndicatorType");
- if (target && target.type !== settings.type) {
- target.dispose();
- target = null
- }
- if (!target) {
- target = that._valueIndicator = that._createIndicator(settings.type, that._renderer.root, "dxg-value-indicator", "value-indicator")
- }
- target.render(settings)
- },
- _createSubvalueIndicatorsSet: function() {
- var that = this;
- var root = that._renderer.root;
- return new ValueIndicatorsSet({
- createIndicator: function(type, i) {
- return that._createIndicator(type, root, "dxg-subvalue-indicator", "subvalue-indicator", i)
- },
- createPalette: function(palette) {
- return that._themeManager.createPalette(palette)
- }
- })
- },
- _prepareSubvalueIndicators: function() {
- var that = this;
- var target = that._subvalueIndicatorsSet;
- var settings = that._prepareIndicatorSettings(that.option("subvalueIndicator") || {}, "subvalueIndicatorType");
- if (!target) {
- target = that._subvalueIndicatorsSet = that._createSubvalueIndicatorsSet()
- }
- var isRecreate = settings.type !== target.type;
- target.type = settings.type;
- var dummy = that._createIndicator(settings.type, that._renderer.root);
- if (dummy) {
- dummy.dispose();
- target.render(settings, isRecreate)
- }
- },
- _setupValue: function(value) {
- this.__value = processValue(value, this.__value)
- },
- _setupSubvalues: function(subvalues) {
- var vals = void 0 === subvalues ? this.__subvalues : parseArrayOfNumbers(subvalues);
- var i;
- var ii;
- var list;
- if (null === vals) {
- return
- }
- for (i = 0, ii = vals.length, list = []; i < ii; ++i) {
- list.push(processValue(vals[i], this.__subvalues[i]))
- }
- this.__subvalues = list
- },
- _updateValueIndicator: function() {
- var that = this;
- that._valueIndicator && that._valueIndicator.value(that.__value, that._noAnimation)
- },
- _updateSubvalueIndicators: function() {
- var that = this;
- that._subvalueIndicatorsSet && that._subvalueIndicatorsSet.values(that.__subvalues, that._noAnimation)
- },
- value: function(arg) {
- if (void 0 !== arg) {
- this._changeValue(arg);
- return this
- }
- return this.__value
- },
- subvalues: function(arg) {
- if (void 0 !== arg) {
- this._changeSubvalues(arg);
- return this
- }
- return null !== this.__subvalues ? this.__subvalues.slice() : void 0
- },
- _changeValue: function(value) {
- var that = this;
- that._setupValue(value);
- that._beginValueChanging();
- that._updateValueIndicator();
- if (that.__value !== that.option(OPTION_VALUE)) {
- that.option(OPTION_VALUE, that.__value)
- }
- that._endValueChanging()
- },
- _changeSubvalues: function(subvalues) {
- var that = this;
- if (null !== that.__subvalues) {
- that._setupSubvalues(subvalues);
- that._beginValueChanging();
- that._updateSubvalueIndicators();
- that._endValueChanging()
- } else {
- that.__subvalues = parseArrayOfNumbers(subvalues);
- that._setContentSize();
- that._renderContent()
- }
- if (!_compareArrays(that.__subvalues, that.option(OPTION_SUBVALUES))) {
- that.option(OPTION_SUBVALUES, that.__subvalues)
- }
- },
- _optionChangesMap: {
- scale: "DOMAIN",
- rangeContainer: "MOSTLY_TOTAL",
- valueIndicator: "MOSTLY_TOTAL",
- subvalueIndicator: "MOSTLY_TOTAL",
- containerBackgroundColor: "MOSTLY_TOTAL",
- value: "VALUE",
- subvalues: "SUBVALUES",
- valueIndicators: "MOSTLY_TOTAL"
- },
- _customChangesOrder: ["VALUE", "SUBVALUES"],
- _change_VALUE: function() {
- this._changeValue(this.option(OPTION_VALUE))
- },
- _change_SUBVALUES: function() {
- this._changeSubvalues(this.option(OPTION_SUBVALUES))
- },
- _applyMainLayout: null,
- _getElementLayout: null,
- _createIndicator: function(type, owner, className, trackerType, trackerIndex, _strict) {
- var that = this;
- var indicator = that._factory.createIndicator({
- renderer: that._renderer,
- translator: that._translator,
- owner: owner,
- tracker: that._tracker,
- className: className
- }, type, _strict);
- if (indicator) {
- indicator.type = type;
- indicator._trackerInfo = {
- type: trackerType,
- index: trackerIndex
- }
- }
- return indicator
- },
- _getApproximateScreenRange: null
- });
- function valueGetter(arg) {
- return arg ? arg.value : null
- }
- function setupValues(that, fieldName, optionItems) {
- var currentValues = that[fieldName];
- var newValues = _isArray(optionItems) ? _map(optionItems, valueGetter) : [];
- var i = 0;
- var ii = newValues.length;
- var list = [];
- for (; i < ii; ++i) {
- list.push(processValue(newValues[i], currentValues[i]))
- }
- that[fieldName] = list
- }
- function selectMode(gauge) {
- if (void 0 === gauge.option(OPTION_VALUE) && void 0 === gauge.option(OPTION_SUBVALUES)) {
- if (void 0 !== gauge.option("valueIndicators")) {
- disableDefaultMode(gauge);
- selectHardMode(gauge)
- }
- }
- }
- function disableDefaultMode(that) {
- that.value = that.subvalues = _noop;
- that._setupValue = that._setupSubvalues = that._updateValueIndicator = that._updateSubvalueIndicators = null
- }
- function selectHardMode(that) {
- that._indicatorValues = [];
- setupValues(that, "_indicatorValues", that.option("valueIndicators"));
- that._valueIndicators = [];
- var _applyMostlyTotalChange = that._applyMostlyTotalChange;
- that._applyMostlyTotalChange = function() {
- setupValues(this, "_indicatorValues", this.option("valueIndicators"));
- _applyMostlyTotalChange.call(this)
- };
- that._updateActiveElements = updateActiveElements_hardMode;
- that._prepareValueIndicators = prepareValueIndicators_hardMode;
- that._disposeValueIndicators = disposeValueIndicators_hardMode;
- that._cleanValueIndicators = cleanValueIndicators_hardMode;
- that.indicatorValue = indicatorValue_hardMode
- }
- function updateActiveElements_hardMode() {
- var that = this;
- _each(that._valueIndicators, function(_, valueIndicator) {
- valueIndicator.value(that._indicatorValues[valueIndicator.index], that._noAnimation)
- })
- }
- function prepareValueIndicators_hardMode() {
- var that = this;
- var valueIndicators = that._valueIndicators || [];
- var userOptions = that.option("valueIndicators");
- var optionList = [];
- var i = 0;
- var ii;
- for (ii = _isArray(userOptions) ? userOptions.length : 0; i < ii; ++i) {
- optionList.push(userOptions[i])
- }
- for (ii = valueIndicators.length; i < ii; ++i) {
- optionList.push(null)
- }
- var newValueIndicators = [];
- _each(optionList, function(i, userSettings) {
- var valueIndicator = valueIndicators[i];
- if (!userSettings) {
- valueIndicator && valueIndicator.dispose();
- return
- }
- var settings = that._prepareIndicatorSettings(userSettings, "valueIndicatorType");
- if (valueIndicator && valueIndicator.type !== settings.type) {
- valueIndicator.dispose();
- valueIndicator = null
- }
- if (!valueIndicator) {
- valueIndicator = that._createIndicator(settings.type, that._renderer.root, "dxg-value-indicator", "value-indicator", i, true)
- }
- if (valueIndicator) {
- valueIndicator.index = i;
- valueIndicator.render(settings);
- newValueIndicators.push(valueIndicator)
- }
- });
- that._valueIndicators = newValueIndicators;
- return that._valueIndicators
- }
- function disposeValueIndicators_hardMode() {
- _each(this._valueIndicators, function(_, valueIndicator) {
- valueIndicator.dispose()
- });
- this._valueIndicators = null
- }
- function cleanValueIndicators_hardMode() {
- _each(this._valueIndicators, function(_, valueIndicator) {
- valueIndicator.clean()
- })
- }
- function indicatorValue_hardMode(index, value) {
- return accessPointerValue(this, this._valueIndicators, this._indicatorValues, index, value)
- }
- function accessPointerValue(that, pointers, values, index, value) {
- if (void 0 !== value) {
- if (void 0 !== values[index]) {
- values[index] = processValue(value, values[index]);
- pointers[index] && pointers[index].value(values[index])
- }
- return that
- } else {
- return values[index]
- }
- }
- function ValueIndicatorsSet(parameters) {
- this._parameters = parameters;
- this._indicators = []
- }
- ValueIndicatorsSet.prototype = {
- constructor: ValueIndicatorsSet,
- dispose: function() {
- var that = this;
- _each(that._indicators, function(_, indicator) {
- indicator.dispose()
- });
- that._parameters = that._options = that._indicators = that._colorPalette = that._palette = null;
- return that
- },
- clean: function() {
- var that = this;
- that._sample && that._sample.clean().dispose();
- _each(that._indicators, function(_, indicator) {
- indicator.clean()
- });
- that._sample = that._options = that._palette = null;
- return that
- },
- render: function(options, isRecreate) {
- var that = this;
- that._options = options;
- that._sample = that._parameters.createIndicator(that.type);
- that._sample.render(options);
- that.enabled = that._sample.enabled;
- that._palette = _isDefined(options.palette) ? that._parameters.createPalette(options.palette) : null;
- if (that.enabled) {
- that._generatePalette(that._indicators.length);
- that._indicators = _map(that._indicators, function(indicator, i) {
- if (isRecreate) {
- indicator.dispose();
- indicator = that._parameters.createIndicator(that.type, i)
- }
- indicator.render(that._getIndicatorOptions(i));
- return indicator
- })
- }
- return that
- },
- getOffset: function() {
- return this._sample.getOffset()
- },
- resize: function(layout) {
- var that = this;
- that._layout = layout;
- _each(that._indicators, function(_, indicator) {
- indicator.resize(layout)
- });
- return that
- },
- measure: function(layout) {
- return this._sample.measure(layout)
- },
- _getIndicatorOptions: function(index) {
- var result = this._options;
- if (this._colorPalette) {
- result = _extend({}, result, {
- color: this._colorPalette[index]
- })
- }
- return result
- },
- _generatePalette: function(count) {
- var that = this;
- var colors = null;
- if (that._palette) {
- that._palette.reset();
- colors = that._palette.generateColors(count, {
- repeat: true
- })
- }
- that._colorPalette = colors
- },
- _adjustIndicatorsCount: function(count) {
- var that = this;
- var indicators = that._indicators;
- var i;
- var ii;
- var indicator;
- var indicatorsLen = indicators.length;
- if (indicatorsLen > count) {
- for (i = count, ii = indicatorsLen; i < ii; ++i) {
- indicators[i].clean().dispose()
- }
- that._indicators = indicators.slice(0, count);
- that._generatePalette(indicators.length)
- } else {
- if (indicatorsLen < count) {
- that._generatePalette(count);
- for (i = indicatorsLen, ii = count; i < ii; ++i) {
- indicator = that._parameters.createIndicator(that.type, i);
- indicator.render(that._getIndicatorOptions(i)).resize(that._layout);
- indicators.push(indicator)
- }
- }
- }
- },
- values: function(arg, _noAnimation) {
- var that = this;
- if (!that.enabled) {
- return
- }
- if (void 0 !== arg) {
- if (!_isArray(arg)) {
- arg = _isFinite(arg) ? [Number(arg)] : null
- }
- if (arg) {
- that._adjustIndicatorsCount(arg.length);
- _each(that._indicators, function(i, indicator) {
- indicator.value(arg[i], _noAnimation)
- })
- }
- return that
- }
- return _map(that._indicators, function(indicator) {
- return indicator.value()
- })
- }
- };
- exports.createIndicatorCreator = function(indicators) {
- return function(parameters, type, _strict) {
- var indicatorType = indicators[_normalizeEnum(type)] || !_strict && indicators._default;
- return indicatorType ? new indicatorType(parameters) : null
- }
- }
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/common.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _format = __webpack_require__( /*! ../axes/smart_formatter */ 405).smartFormatter;
- var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
- var HEIGHT_COMPACT_MODE = 24;
- var POINTER_SIZE = 4;
- var EMPTY_SLIDER_MARKER_TEXT = ". . .";
- var utils = {
- trackerSettings: {
- fill: "grey",
- stroke: "grey",
- opacity: 1e-4
- },
- animationSettings: {
- duration: 250
- }
- };
- var consts = {
- emptySliderMarkerText: EMPTY_SLIDER_MARKER_TEXT,
- pointerSize: POINTER_SIZE
- };
- var formatValue = function(value, formatOptions, tickIntervalsInfo, valueType, type, logarithmBase) {
- var formatObject = {
- value: value,
- valueText: _format(value, {
- labelOptions: formatOptions,
- ticks: tickIntervalsInfo ? tickIntervalsInfo.ticks : [],
- tickInterval: tickIntervalsInfo ? tickIntervalsInfo.tickInterval : void 0,
- dataType: valueType,
- type: type,
- logarithmBase: logarithmBase
- })
- };
- return String(isFunction(formatOptions.customizeText) ? formatOptions.customizeText.call(formatObject, formatObject) : formatObject.valueText)
- };
- exports.utils = utils;
- exports.consts = consts;
- exports.formatValue = formatValue;
- exports.HEIGHT_COMPACT_MODE = HEIGHT_COMPACT_MODE
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/exporter/file_saver.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _window = __webpack_require__( /*! ../core/utils/window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _ui = __webpack_require__( /*! ../ui/widget/ui.errors */ 17);
- var _ui2 = _interopRequireDefault(_ui);
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _type2 = _interopRequireDefault(_type);
- var _console = __webpack_require__( /*! ../core/utils/console */ 73);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var window = _window2.default.getWindow();
- var navigator = _window2.default.getNavigator();
- var FILE_EXTESIONS = {
- EXCEL: "xlsx",
- CSS: "css",
- PNG: "png",
- JPEG: "jpeg",
- GIF: "gif",
- SVG: "svg",
- PDF: "pdf"
- };
- var MIME_TYPES = exports.MIME_TYPES = {
- CSS: "text/css",
- EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
- PNG: "image/png",
- JPEG: "image/jpeg",
- GIF: "image/gif",
- SVG: "image/svg+xml",
- PDF: "application/pdf"
- };
- exports.fileSaver = {
- _revokeObjectURLTimeout: 3e4,
- _getDataUri: function(format, data) {
- return "data:" + MIME_TYPES[format] + ";base64," + data
- },
- _linkDownloader: function(fileName, href) {
- var exportLinkElement = _dom_adapter2.default.createElement("a");
- exportLinkElement.download = fileName;
- exportLinkElement.href = href;
- exportLinkElement.target = "_blank";
- return exportLinkElement
- },
- _formDownloader: function(proxyUrl, fileName, contentType, data) {
- var formAttributes = {
- method: "post",
- action: proxyUrl,
- enctype: "multipart/form-data"
- };
- var exportForm = (0, _renderer2.default)("<form>").css({
- display: "none"
- }).attr(formAttributes);
- exportForm.append('<input type="hidden" name="fileName" value="' + fileName + '" />');
- exportForm.append('<input type="hidden" name="contentType" value="' + contentType + '" />');
- exportForm.append('<input type="hidden" name="data" value="' + data + '" />');
- exportForm.appendTo("body");
- _events_engine2.default.trigger(exportForm, "submit");
- if (_events_engine2.default.trigger(exportForm, "submit")) {
- exportForm.remove()
- }
- return exportForm
- },
- _saveByProxy: function(proxyUrl, fileName, format, data) {
- return this._formDownloader(proxyUrl, fileName, MIME_TYPES[format], data)
- },
- _winJSBlobSave: function(blob, fileName, format) {
- var savePicker = new Windows.Storage.Pickers.FileSavePicker;
- savePicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.documentsLibrary;
- savePicker.fileTypeChoices.insert(MIME_TYPES[format], ["." + FILE_EXTESIONS[format]]);
- savePicker.suggestedFileName = fileName;
- savePicker.pickSaveFileAsync().then(function(file) {
- if (file) {
- file.openAsync(Windows.Storage.FileAccessMode.readWrite).then(function(outputStream) {
- var inputStream = blob.msDetachStream();
- Windows.Storage.Streams.RandomAccessStream.copyAsync(inputStream, outputStream).then(function() {
- outputStream.flushAsync().done(function() {
- inputStream.close();
- outputStream.close()
- })
- })
- })
- }
- })
- },
- _click: function(link) {
- try {
- link.dispatchEvent(new MouseEvent("click", {
- cancelable: true
- }))
- } catch (e) {
- var event = _dom_adapter2.default.getDocument().createEvent("MouseEvents");
- event.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
- link.dispatchEvent(event)
- }
- },
- _saveBlobAs: function(fileName, format, data) {
- var _this = this;
- this._blobSaved = false;
- if (_type2.default.isDefined(navigator.msSaveOrOpenBlob)) {
- navigator.msSaveOrOpenBlob(data, fileName);
- this._blobSaved = true
- } else {
- if (_type2.default.isDefined(window.WinJS)) {
- this._winJSBlobSave(data, fileName, format);
- this._blobSaved = true
- } else {
- var URL = window.URL || window.webkitURL || window.mozURL || window.msURL || window.oURL;
- if (_type2.default.isDefined(URL)) {
- var objectURL = URL.createObjectURL(data);
- var downloadLink = this._linkDownloader(fileName, objectURL);
- setTimeout(function() {
- URL.revokeObjectURL(objectURL);
- _this._objectUrlRevoked = true
- }, this._revokeObjectURLTimeout);
- this._click(downloadLink)
- } else {
- _console.logger.warn("window.URL || window.webkitURL || window.mozURL || window.msURL || window.oURL is not defined")
- }
- }
- }
- },
- saveAs: function(fileName, format, data, proxyURL, forceProxy) {
- fileName += "." + FILE_EXTESIONS[format];
- if (forceProxy) {
- this._saveByProxy(proxyURL, fileName, format, data)
- } else {
- if (_type2.default.isFunction(window.Blob)) {
- this._saveBlobAs(fileName, format, data)
- } else {
- if (_type2.default.isDefined(proxyURL) && !_type2.default.isDefined(navigator.userAgent.match(/iPad/i))) {
- this._saveByProxy(proxyURL, fileName, format, data)
- } else {
- if (!_type2.default.isDefined(navigator.userAgent.match(/iPad/i))) {
- _ui2.default.log("E1034")
- }
- var downloadLink = this._linkDownloader(fileName, this._getDataUri(format, data));
- this._click(downloadLink)
- }
- }
- }
- }
- }
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/localization/ldml/date.format.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var ARABIC_COMMA = "\u060c";
- var FORMAT_SEPARATORS = " .,:;/\\<>()-[]" + ARABIC_COMMA;
- var ARABIC_ZERO_CODE = 1632;
- var checkDigit = function(char) {
- var code = char && char.charCodeAt(0);
- return char >= "0" && char <= "9" || code >= ARABIC_ZERO_CODE && code < ARABIC_ZERO_CODE + 10
- };
- var checkPatternContinue = function(text, index, isDigit) {
- var char = text[index];
- var prevChar = text[index - 1];
- var nextChar = text[index + 1];
- if (!isDigit) {
- if ("." === char || " " === char && "." === prevChar) {
- return true
- }
- if ("-" === char && !checkDigit(nextChar)) {
- return true
- }
- }
- return FORMAT_SEPARATORS.indexOf(char) < 0 && isDigit === checkDigit(char)
- };
- var getPatternStartIndex = function(defaultPattern, index) {
- if (!checkDigit(defaultPattern[index])) {
- while (index > 0 && !checkDigit(defaultPattern[index - 1]) && ("." === defaultPattern[index - 1] || FORMAT_SEPARATORS.indexOf(defaultPattern[index - 1]) < 0)) {
- index--
- }
- }
- return index
- };
- var getDifference = function(defaultPattern, patterns, processedIndexes, isDigit) {
- var i = 0;
- var result = [];
- var patternsFilter = function(pattern) {
- return defaultPattern[i] !== pattern[i] && (void 0 === isDigit || checkDigit(defaultPattern[i]) === isDigit)
- };
- if (!Array.isArray(patterns)) {
- patterns = [patterns]
- }
- for (i = 0; i < defaultPattern.length; i++) {
- if (processedIndexes.indexOf(i) < 0 && patterns.filter(patternsFilter).length) {
- i = getPatternStartIndex(defaultPattern, i);
- do {
- isDigit = checkDigit(defaultPattern[i]);
- if (!result.length && !isDigit && checkDigit(patterns[0][i])) {
- break
- }
- result.push(i);
- processedIndexes.unshift(i);
- i++
- } while (defaultPattern[i] && checkPatternContinue(defaultPattern, i, isDigit));
- break
- }
- }
- if (1 === result.length && ("0" === defaultPattern[processedIndexes[0] - 1] || "\u0660" === defaultPattern[processedIndexes[0] - 1])) {
- processedIndexes.unshift(processedIndexes[0] - 1)
- }
- return result
- };
- var replaceCharsCore = function(pattern, indexes, char, patternPositions) {
- var baseCharIndex = indexes[0];
- var patternIndex = baseCharIndex < patternPositions.length ? patternPositions[baseCharIndex] : baseCharIndex;
- indexes.forEach(function(_, index) {
- pattern = pattern.substr(0, patternIndex + index) + (char.length > 1 ? char[index] : char) + pattern.substr(patternIndex + index + 1)
- });
- if (1 === indexes.length) {
- pattern = pattern.replace("0" + char, char + char);
- pattern = pattern.replace("\u0660" + char, char + char)
- }
- return pattern
- };
- var replaceChars = function(pattern, indexes, char, patternPositions) {
- var i;
- var index;
- var patternIndex;
- if (!checkDigit(pattern[indexes[0]] || "0")) {
- var letterCount = Math.max(indexes.length <= 3 ? 3 : 4, char.length);
- while (indexes.length > letterCount) {
- index = indexes.pop();
- patternIndex = patternPositions[index];
- patternPositions[index] = -1;
- for (i = index + 1; i < patternPositions.length; i++) {
- patternPositions[i]--
- }
- pattern = pattern.substr(0, patternIndex) + pattern.substr(patternIndex + 1)
- }
- index = indexes[indexes.length - 1] + 1, patternIndex = index < patternPositions.length ? patternPositions[index] : index;
- while (indexes.length < letterCount) {
- indexes.push(indexes[indexes.length - 1] + 1);
- for (i = index; i < patternPositions.length; i++) {
- patternPositions[i]++
- }
- pattern = pattern.substr(0, patternIndex) + " " + pattern.substr(patternIndex)
- }
- }
- pattern = replaceCharsCore(pattern, indexes, char, patternPositions);
- return pattern
- };
- var formatValue = function(value, formatter) {
- if (Array.isArray(value)) {
- return value.map(function(value) {
- return (formatter(value) || "").toString()
- })
- }
- return (formatter(value) || "").toString()
- };
- var ESCAPE_CHARS_REGEXP = /[a-zA-Z]/g;
- var escapeChars = function(pattern, defaultPattern, processedIndexes, patternPositions) {
- var escapeIndexes = defaultPattern.split("").map(function(char, index) {
- if (processedIndexes.indexOf(index) < 0 && (char.match(ESCAPE_CHARS_REGEXP) || "'" === char)) {
- return patternPositions[index]
- }
- return -1
- });
- pattern = pattern.split("").map(function(char, index) {
- var result = char;
- var isCurrentCharEscaped = escapeIndexes.indexOf(index) >= 0;
- var isPrevCharEscaped = index > 0 && escapeIndexes.indexOf(index - 1) >= 0;
- var isNextCharEscaped = escapeIndexes.indexOf(index + 1) >= 0;
- if (isCurrentCharEscaped) {
- if (!isPrevCharEscaped) {
- result = "'" + result
- }
- if (!isNextCharEscaped) {
- result += "'"
- }
- }
- return result
- }).join("");
- return pattern
- };
- var getFormat = function(formatter) {
- var processedIndexes = [];
- var defaultPattern = formatValue(new Date(2009, 8, 8, 6, 5, 4), formatter);
- var patternPositions = defaultPattern.split("").map(function(_, index) {
- return index
- });
- var result = defaultPattern;
- var replacedPatterns = {};
- var datePatterns = [{
- date: new Date(2009, 8, 8, 6, 5, 4, 100),
- pattern: "S"
- }, {
- date: new Date(2009, 8, 8, 6, 5, 2),
- pattern: "s"
- }, {
- date: new Date(2009, 8, 8, 6, 2, 4),
- pattern: "m"
- }, {
- date: new Date(2009, 8, 8, 18, 5, 4),
- pattern: "H",
- isDigit: true
- }, {
- date: new Date(2009, 8, 8, 2, 5, 4),
- pattern: "h",
- isDigit: true
- }, {
- date: new Date(2009, 8, 8, 18, 5, 4),
- pattern: "a",
- isDigit: false
- }, {
- date: new Date(2009, 8, 1, 6, 5, 4),
- pattern: "d"
- }, {
- date: [new Date(2009, 8, 2, 6, 5, 4), new Date(2009, 8, 3, 6, 5, 4), new Date(2009, 8, 4, 6, 5, 4)],
- pattern: "E"
- }, {
- date: new Date(2009, 9, 6, 6, 5, 4),
- pattern: "M"
- }, {
- date: new Date(1998, 8, 8, 6, 5, 4),
- pattern: "y"
- }];
- if (!result) {
- return
- }
- datePatterns.forEach(function(test) {
- var diff = getDifference(defaultPattern, formatValue(test.date, formatter), processedIndexes, test.isDigit);
- var pattern = "M" === test.pattern && !replacedPatterns.d ? "L" : test.pattern;
- result = replaceChars(result, diff, pattern, patternPositions);
- replacedPatterns[pattern] = diff.length
- });
- result = escapeChars(result, defaultPattern, processedIndexes, patternPositions);
- if (processedIndexes.length) {
- return result
- }
- };
- exports.getFormat = getFormat
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/core/utils/svg.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var window = __webpack_require__( /*! ./window */ 7).getWindow();
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- function getMarkup(element, backgroundColor) {
- var temp = domAdapter.createElement("div");
- var clone = element.cloneNode(true);
- if (backgroundColor) {
- $(clone).css("backgroundColor", backgroundColor)
- }
- temp.appendChild(clone);
- return temp.innerHTML
- }
- function fixNamespaces(markup) {
- var first = true;
- if (markup.indexOf("xmlns:xlink") === -1) {
- markup = markup.replace("<svg", '<svg xmlns:xlink="http://www.w3.org/1999/xlink"')
- }
- markup = markup.replace(/xmlns="[\s\S]*?"/gi, function(match) {
- if (!first) {
- return ""
- }
- first = false;
- return match
- });
- return markup.replace(/xmlns:NS1="[\s\S]*?"/gi, "").replace(/NS1:xmlns:xlink="([\s\S]*?)"/gi, 'xmlns:xlink="$1"')
- }
- function decodeHtmlEntities(markup) {
- return markup.replace(/"/gi, """).replace(/&/gi, "&").replace(/'/gi, "'").replace(/</gi, "<").replace(/>/gi, ">").replace(/ /gi, " ").replace(/­/gi, "­")
- }
- exports.getSvgMarkup = function(element, backgroundColor) {
- return fixNamespaces(decodeHtmlEntities(getMarkup(element, backgroundColor)))
- };
- exports.getSvgElement = function(markup) {
- return domAdapter.isNode(markup) ? markup : (new window.DOMParser).parseFromString(markup, "image/svg+xml").childNodes[0]
- }
- },
- /*!********************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/template_engine_registry.js ***!
- \********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _errors = __webpack_require__( /*! ../../core/errors */ 21);
- var _errors2 = _interopRequireDefault(_errors);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var templateEngines = {};
- var currentTemplateEngine;
- var registerTemplateEngine = function(name, templateEngine) {
- templateEngines[name] = templateEngine
- };
- var setTemplateEngine = function(templateEngine) {
- if ((0, _type.isString)(templateEngine)) {
- currentTemplateEngine = templateEngines[templateEngine];
- if (!currentTemplateEngine) {
- throw _errors2.default.Error("E0020", templateEngine)
- }
- } else {
- currentTemplateEngine = templateEngine
- }
- };
- var getCurrentTemplateEngine = function() {
- return currentTemplateEngine
- };
- module.exports.setTemplateEngine = setTemplateEngine;
- module.exports.getCurrentTemplateEngine = getCurrentTemplateEngine;
- module.exports.registerTemplateEngine = registerTemplateEngine
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/localization/ldml/date.parser.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var escapeRegExp = __webpack_require__( /*! ../../core/utils/common */ 4).escapeRegExp;
- var FORMAT_TYPES = {
- 3: "abbreviated",
- 4: "wide",
- 5: "narrow"
- };
- var monthRegExpGenerator = function(count, dateParts) {
- if (count > 2) {
- return Object.keys(FORMAT_TYPES).map(function(count) {
- return ["format", "standalone"].map(function(type) {
- return dateParts.getMonthNames(FORMAT_TYPES[count], type).join("|")
- }).join("|")
- }).join("|")
- }
- return "0?[1-9]|1[012]"
- };
- var PATTERN_REGEXPS = {
- y: function(count) {
- return "[0-9]+"
- },
- M: monthRegExpGenerator,
- L: monthRegExpGenerator,
- Q: function(count, dateParts) {
- if (count > 2) {
- return dateParts.getQuarterNames(FORMAT_TYPES[count], "format").join("|")
- }
- return "0?[1-4]"
- },
- E: function(count, dateParts) {
- return "\\D*"
- },
- a: function(count, dateParts) {
- return dateParts.getPeriodNames(FORMAT_TYPES[count < 3 ? 3 : count], "format").join("|")
- },
- d: function(count) {
- return "0?[1-9]|[12][0-9]|3[01]"
- },
- H: function(count) {
- return "0?[0-9]|1[0-9]|2[0-3]"
- },
- h: function(count) {
- return "0?[1-9]|1[012]"
- },
- m: function(count) {
- return "0?[0-9]|[1-5][0-9]"
- },
- s: function(count) {
- return "0?[0-9]|[1-5][0-9]"
- },
- S: function(count) {
- return "[0-9]{1," + count + "}"
- }
- };
- var parseNumber = Number;
- var caseInsensitiveIndexOf = function(array, value) {
- return array.map(function(item) {
- return item.toLowerCase()
- }).indexOf(value.toLowerCase())
- };
- var monthPatternParser = function(text, count, dateParts) {
- if (count > 2) {
- return ["format", "standalone"].map(function(type) {
- return Object.keys(FORMAT_TYPES).map(function(count) {
- var monthNames = dateParts.getMonthNames(FORMAT_TYPES[count], type);
- return caseInsensitiveIndexOf(monthNames, text)
- })
- }).reduce(function(a, b) {
- return a.concat(b)
- }).filter(function(index) {
- return index >= 0
- })[0]
- }
- return parseNumber(text) - 1
- };
- var PATTERN_PARSERS = {
- y: function(text, count) {
- var year = parseNumber(text);
- if (2 === count) {
- return year < 30 ? 2e3 + year : 1900 + year
- }
- return year
- },
- M: monthPatternParser,
- L: monthPatternParser,
- Q: function(text, count, dateParts) {
- if (count > 2) {
- return dateParts.getQuarterNames(FORMAT_TYPES[count], "format").indexOf(text)
- }
- return parseNumber(text) - 1
- },
- E: function(text, count, dateParts) {
- var dayNames = dateParts.getDayNames(FORMAT_TYPES[count < 3 ? 3 : count], "format");
- return caseInsensitiveIndexOf(dayNames, text)
- },
- a: function(text, count, dateParts) {
- var periodNames = dateParts.getPeriodNames(FORMAT_TYPES[count < 3 ? 3 : count], "format");
- return caseInsensitiveIndexOf(periodNames, text)
- },
- d: parseNumber,
- H: parseNumber,
- h: parseNumber,
- m: parseNumber,
- s: parseNumber,
- S: function(text, count) {
- count = Math.max(count, 3);
- text = text.slice(0, 3);
- while (count < 3) {
- text += "0";
- count++
- }
- return parseNumber(text)
- }
- };
- var ORDERED_PATTERNS = ["y", "M", "d", "h", "m", "s", "S"];
- var PATTERN_SETTERS = {
- y: "setFullYear",
- M: "setMonth",
- L: "setMonth",
- a: function(date, value, datePartValues) {
- var hours = date.getHours();
- var hourPartValue = datePartValues.h;
- if (void 0 !== hourPartValue && hourPartValue !== hours) {
- hours--
- }
- if (!value && 12 === hours) {
- hours = 0
- } else {
- if (value && 12 !== hours) {
- hours += 12
- }
- }
- date.setHours(hours)
- },
- d: "setDate",
- H: "setHours",
- h: "setHours",
- m: "setMinutes",
- s: "setSeconds",
- S: "setMilliseconds"
- };
- var getSameCharCount = function(text, index) {
- var char = text[index];
- var count = 0;
- do {
- index++;
- count++
- } while (text[index] === char);
- return count
- };
- var createPattern = function(char, count) {
- var result = "";
- for (var i = 0; i < count; i++) {
- result += char
- }
- return result
- };
- var getRegExpInfo = function(format, dateParts) {
- var regexpText = "";
- var stubText = "";
- var isEscaping;
- var patterns = [];
- var addPreviousStub = function() {
- if (stubText) {
- patterns.push("'" + stubText + "'");
- regexpText += escapeRegExp(stubText) + ")";
- stubText = ""
- }
- };
- for (var i = 0; i < format.length; i++) {
- var char = format[i];
- var isEscapeChar = "'" === char;
- var regexpPart = PATTERN_REGEXPS[char];
- if (isEscapeChar) {
- isEscaping = !isEscaping;
- if ("'" !== format[i - 1]) {
- continue
- }
- }
- if (regexpPart && !isEscaping) {
- var count = getSameCharCount(format, i);
- var pattern = createPattern(char, count);
- addPreviousStub();
- patterns.push(pattern);
- regexpText += "(" + regexpPart(count, dateParts) + ")";
- i += count - 1
- } else {
- if (!stubText) {
- regexpText += "("
- }
- stubText += char
- }
- }
- addPreviousStub();
- return {
- patterns: patterns,
- regexp: new RegExp("^" + regexpText + "$", "i")
- }
- };
- var getPatternSetters = function() {
- return PATTERN_SETTERS
- };
- var setPatternPart = function(date, pattern, text, dateParts, datePartValues) {
- var patternChar = pattern[0];
- var partSetter = PATTERN_SETTERS[patternChar];
- var partParser = PATTERN_PARSERS[patternChar];
- if (partSetter && partParser) {
- var value = partParser(text, pattern.length, dateParts);
- datePartValues[pattern] = value;
- if (date[partSetter]) {
- date[partSetter](value)
- } else {
- partSetter(date, value, datePartValues)
- }
- }
- };
- var setPatternPartFromNow = function(date, pattern, now) {
- var setterName = PATTERN_SETTERS[pattern];
- var getterName = "g" + setterName.substr(1);
- var value = now[getterName]();
- date[setterName](value)
- };
- var getShortPatterns = function(fullPatterns) {
- return fullPatterns.map(function(pattern) {
- if ("'" === pattern[0]) {
- return ""
- } else {
- return "H" === pattern[0] ? "h" : pattern[0]
- }
- })
- };
- var getMaxOrderedPatternIndex = function(patterns) {
- var indexes = patterns.map(function(pattern) {
- return ORDERED_PATTERNS.indexOf(pattern)
- });
- return Math.max.apply(Math, indexes)
- };
- var getOrderedFormatPatterns = function(formatPatterns) {
- var otherPatterns = formatPatterns.filter(function(pattern) {
- return ORDERED_PATTERNS.indexOf(pattern) < 0
- });
- return ORDERED_PATTERNS.concat(otherPatterns)
- };
- var getParser = function(format, dateParts) {
- var regExpInfo = getRegExpInfo(format, dateParts);
- return function(text) {
- var regExpResult = regExpInfo.regexp.exec(text);
- if (regExpResult) {
- var now = new Date;
- var date = new Date(now.getFullYear(), 0, 1);
- var formatPatterns = getShortPatterns(regExpInfo.patterns);
- var maxPatternIndex = getMaxOrderedPatternIndex(formatPatterns);
- var orderedFormatPatterns = getOrderedFormatPatterns(formatPatterns);
- var datePartValues = {};
- orderedFormatPatterns.forEach(function(pattern, index) {
- if (!pattern || index < ORDERED_PATTERNS.length && index > maxPatternIndex) {
- return
- }
- var patternIndex = formatPatterns.indexOf(pattern);
- if (patternIndex >= 0) {
- var regExpPattern = regExpInfo.patterns[patternIndex];
- var regExpText = regExpResult[patternIndex + 1];
- setPatternPart(date, regExpPattern, regExpText, dateParts, datePartValues)
- } else {
- setPatternPartFromNow(date, pattern, now)
- }
- });
- return date
- }
- return null
- }
- };
- exports.getParser = getParser;
- exports.getRegExpInfo = getRegExpInfo;
- exports.getPatternSetters = getPatternSetters
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/bundles/modules/parts/core.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var DevExpress = __webpack_require__( /*! ../../../bundles/modules/core */ 147);
- __webpack_require__( /*! ../../../integration/jquery */ 268);
- __webpack_require__( /*! ../../../integration/angular */ 460);
- __webpack_require__( /*! ../../../integration/knockout */ 475);
- __webpack_require__( /*! ../../../localization/globalize/core */ 127);
- __webpack_require__( /*! ../../../localization/globalize/message */ 484);
- __webpack_require__( /*! ../../../localization/globalize/number */ 183);
- __webpack_require__( /*! ../../../localization/globalize/date */ 485);
- __webpack_require__( /*! ../../../localization/globalize/currency */ 486);
- __webpack_require__( /*! ../../../events/click */ 19);
- __webpack_require__( /*! ../../../events/contextmenu */ 168);
- __webpack_require__( /*! ../../../events/double_click */ 128);
- __webpack_require__( /*! ../../../events/drag */ 56);
- __webpack_require__( /*! ../../../events/hold */ 88);
- __webpack_require__( /*! ../../../events/hover */ 148);
- __webpack_require__( /*! ../../../events/pointer */ 23);
- __webpack_require__( /*! ../../../events/swipe */ 174);
- __webpack_require__( /*! ../../../events/transform */ 285);
- module.exports = DevExpress
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/mobile/hide_top_overlay.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
- var hideCallback = function() {
- var callbacks = [];
- return {
- add: function(callback) {
- var indexOfCallback = inArray(callback, callbacks);
- if (indexOfCallback === -1) {
- callbacks.push(callback)
- }
- },
- remove: function(callback) {
- var indexOfCallback = inArray(callback, callbacks);
- if (indexOfCallback !== -1) {
- callbacks.splice(indexOfCallback, 1)
- }
- },
- fire: function() {
- var callback = callbacks.pop();
- var result = !!callback;
- if (result) {
- callback()
- }
- return result
- },
- hasCallback: function() {
- return callbacks.length > 0
- },
- reset: function() {
- callbacks = []
- }
- }
- }();
- module.exports = function() {
- return hideCallback.fire()
- };
- module.exports.hideCallback = hideCallback
- }, , , , , , , , , , , , , , , , , , , , , , , , , ,
- /*!********************************************!*\
- !*** ./artifacts/transpiled/viz/export.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./core/export */ 93)
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/base_chart.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var noop = commonUtils.noop;
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var iteratorModule = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
- var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96);
- var coreDataUtils = __webpack_require__( /*! ../../core/utils/data */ 20);
- var legendModule = __webpack_require__( /*! ../components/legend */ 201);
- var dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 243);
- var seriesModule = __webpack_require__( /*! ../series/base_series */ 245);
- var chartThemeManagerModule = __webpack_require__( /*! ../components/chart_theme_manager */ 401);
- var LayoutManagerModule = __webpack_require__( /*! ./layout_manager */ 402);
- var trackerModule = __webpack_require__( /*! ./tracker */ 777);
- var REINIT_REFRESH_ACTION = "_reinit";
- var REINIT_DATA_SOURCE_REFRESH_ACTION = "_updateDataSource";
- var DATA_INIT_REFRESH_ACTION = "_dataInit";
- var FORCE_RENDER_REFRESH_ACTION = "_forceRender";
- var RESIZE_REFRESH_ACTION = "_resize";
- var ACTIONS_BY_PRIORITY = [REINIT_REFRESH_ACTION, REINIT_DATA_SOURCE_REFRESH_ACTION, DATA_INIT_REFRESH_ACTION, FORCE_RENDER_REFRESH_ACTION, RESIZE_REFRESH_ACTION];
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _map = vizUtils.map;
- var _each = iteratorModule.each;
- var _reverseEach = iteratorModule.reverseEach;
- var _extend = extend;
- var _isArray = Array.isArray;
- var _isDefined = typeUtils.isDefined;
- var _setCanvasValues = vizUtils.setCanvasValues;
- var DEFAULT_OPACITY = .3;
- var REFRESH_SERIES_DATA_INIT_ACTION_OPTIONS = ["series", "commonSeriesSettings", "dataPrepareSettings", "seriesSelectionMode", "pointSelectionMode", "synchronizeMultiAxes", "resolveLabelsOverlapping"];
- var REFRESH_SERIES_FAMILIES_ACTION_OPTIONS = ["equalBarWidth", "minBubbleSize", "maxBubbleSize", "barWidth", "barGroupPadding", "barGroupWidth", "negativesAsZeroes", "negativesAsZeros"];
- var FORCE_RENDER_REFRESH_ACTION_OPTIONS = ["adaptiveLayout", "crosshair", "resolveLabelOverlapping", "adjustOnZoom", "zoomingMode", "scrollingMode", "stickyHovering"];
- var FONT = "font";
- function checkHeightRollingStock(rollingStocks, stubCanvas) {
- var canvasSize = stubCanvas.end - stubCanvas.start;
- var size = 0;
- rollingStocks.forEach(function(rollingStock) {
- size += rollingStock.getBoundingRect().width
- });
- while (canvasSize < size) {
- size -= findAndKillSmallValue(rollingStocks)
- }
- }
- function findAndKillSmallValue(rollingStocks) {
- var smallestObject = rollingStocks.reduce(function(prev, rollingStock, index) {
- if (!rollingStock) {
- return prev
- }
- var value = rollingStock.value();
- return value < prev.value ? {
- value: value,
- rollingStock: rollingStock,
- index: index
- } : prev
- }, {
- rollingStock: void 0,
- value: 1 / 0,
- index: void 0
- });
- smallestObject.rollingStock.getLabels()[0].draw(false);
- var width = smallestObject.rollingStock.getBoundingRect().width;
- rollingStocks[smallestObject.index] = null;
- return width
- }
- function checkStackOverlap(rollingStocks) {
- var i;
- var j;
- var iLength;
- var jLength;
- var overlap = false;
- for (i = 0, iLength = rollingStocks.length - 1; i < iLength; i++) {
- for (j = i + 1, jLength = rollingStocks.length; j < jLength; j++) {
- if (i !== j && checkStacksOverlapping(rollingStocks[i], rollingStocks[j], true)) {
- overlap = true;
- break
- }
- }
- if (overlap) {
- break
- }
- }
- return overlap
- }
- function resolveLabelOverlappingInOneDirection(points, canvas, isRotated, shiftFunction) {
- var customSorting = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function() {
- return 0
- };
- var rollingStocks = [];
- var stubCanvas = {
- start: isRotated ? canvas.left : canvas.top,
- end: isRotated ? canvas.width - canvas.right : canvas.height - canvas.bottom
- };
- var hasStackedSeries = false;
- points.forEach(function(p) {
- if (!p) {
- return
- }
- hasStackedSeries = hasStackedSeries || p.series.isStackedSeries() || p.series.isFullStackedSeries();
- p.getLabels().forEach(function(l) {
- l.isVisible() && rollingStocks.push(new RollingStock(l, isRotated, shiftFunction))
- })
- });
- if (hasStackedSeries) {
- !isRotated && rollingStocks.reverse()
- } else {
- var rollingStocksTmp = rollingStocks.slice();
- rollingStocks.sort(function(a, b) {
- return customSorting(a, b) || a.getInitialPosition() - b.getInitialPosition() || rollingStocksTmp.indexOf(a) - rollingStocksTmp.indexOf(b)
- })
- }
- if (!checkStackOverlap(rollingStocks)) {
- return false
- }
- checkHeightRollingStock(rollingStocks, stubCanvas);
- prepareOverlapStacks(rollingStocks);
- rollingStocks.reverse();
- moveRollingStock(rollingStocks, stubCanvas);
- return true
- }
- function checkStacksOverlapping(firstRolling, secondRolling, inTwoSides) {
- if (!firstRolling || !secondRolling) {
- return
- }
- var firstRect = firstRolling.getBoundingRect();
- var secondRect = secondRolling.getBoundingRect();
- var oppositeOverlapping = inTwoSides ? firstRect.oppositeStart <= secondRect.oppositeStart && firstRect.oppositeEnd > secondRect.oppositeStart || secondRect.oppositeStart <= firstRect.oppositeStart && secondRect.oppositeEnd > firstRect.oppositeStart : true;
- return firstRect.end > secondRect.start && oppositeOverlapping
- }
- function prepareOverlapStacks(rollingStocks) {
- var i;
- var currentRollingStock;
- var root;
- for (i = 0; i < rollingStocks.length - 1; i++) {
- currentRollingStock = root || rollingStocks[i];
- if (checkStacksOverlapping(currentRollingStock, rollingStocks[i + 1])) {
- currentRollingStock.toChain(rollingStocks[i + 1]);
- rollingStocks[i + 1] = null;
- root = currentRollingStock
- } else {
- root = rollingStocks[i + 1] || currentRollingStock
- }
- }
- }
- function moveRollingStock(rollingStocks, canvas) {
- var i;
- var j;
- var currentRollingStock;
- var nextRollingStock;
- var currentBBox;
- var nextBBox;
- for (i = 0; i < rollingStocks.length; i++) {
- currentRollingStock = rollingStocks[i];
- if (rollingStocksIsOut(currentRollingStock, canvas)) {
- currentBBox = currentRollingStock.getBoundingRect();
- for (j = i + 1; j < rollingStocks.length; j++) {
- nextRollingStock = rollingStocks[j];
- if (!nextRollingStock) {
- continue
- }
- nextBBox = nextRollingStock.getBoundingRect();
- if (nextBBox.end > currentBBox.start - (currentBBox.end - canvas.end)) {
- nextRollingStock.toChain(currentRollingStock);
- rollingStocks[i] = currentRollingStock = null;
- break
- }
- }
- }
- currentRollingStock && currentRollingStock.setRollingStockInCanvas(canvas)
- }
- }
- function rollingStocksIsOut(rollingStock, canvas) {
- return rollingStock && rollingStock.getBoundingRect().end > canvas.end
- }
- function RollingStock(label, isRotated, shiftFunction) {
- var bBox = label.getBoundingRect();
- var x = bBox.x;
- var y = bBox.y;
- var endX = bBox.x + bBox.width;
- var endY = bBox.y + bBox.height;
- this.labels = [label];
- this.shiftFunction = shiftFunction;
- this._bBox = {
- start: isRotated ? x : y,
- width: isRotated ? bBox.width : bBox.height,
- end: isRotated ? endX : endY,
- oppositeStart: isRotated ? y : x,
- oppositeEnd: isRotated ? endY : endX
- };
- this._initialPosition = isRotated ? bBox.x : bBox.y;
- return this
- }
- RollingStock.prototype = {
- toChain: function(nextRollingStock) {
- var nextRollingStockBBox = nextRollingStock.getBoundingRect();
- nextRollingStock.shift(nextRollingStockBBox.start - this._bBox.end);
- this._changeBoxWidth(nextRollingStockBBox.width);
- this.labels = this.labels.concat(nextRollingStock.labels)
- },
- getBoundingRect: function() {
- return this._bBox
- },
- shift: function(shiftLength) {
- var shiftFunction = this.shiftFunction;
- _each(this.labels, function(index, label) {
- var bBox = label.getBoundingRect();
- var coords = shiftFunction(bBox, shiftLength);
- if (!label.hideInsideLabel(coords)) {
- label.shift(coords.x, coords.y)
- }
- });
- this._bBox.end -= shiftLength;
- this._bBox.start -= shiftLength
- },
- setRollingStockInCanvas: function(canvas) {
- if (this._bBox.end > canvas.end) {
- this.shift(this._bBox.end - canvas.end)
- }
- },
- getLabels: function() {
- return this.labels
- },
- value: function() {
- return this.labels[0].getData().value
- },
- getInitialPosition: function() {
- return this._initialPosition
- },
- _changeBoxWidth: function(width) {
- this._bBox.end += width;
- this._bBox.width += width
- }
- };
- function getLegendFields(name) {
- return {
- nameField: name + "Name",
- colorField: name + "Color",
- indexField: name + "Index"
- }
- }
- function getLegendSettings(legendDataField) {
- var formatObjectFields = getLegendFields(legendDataField);
- return {
- getFormatObject: function(data) {
- var res = {};
- res[formatObjectFields.indexField] = data.id;
- res[formatObjectFields.colorField] = data.states.normal.fill;
- res[formatObjectFields.nameField] = data.text;
- return res
- },
- textField: formatObjectFields.nameField
- }
- }
- function checkOverlapping(firstRect, secondRect) {
- return (firstRect.x <= secondRect.x && secondRect.x <= firstRect.x + firstRect.width || firstRect.x >= secondRect.x && firstRect.x <= secondRect.x + secondRect.width) && (firstRect.y <= secondRect.y && secondRect.y <= firstRect.y + firstRect.height || firstRect.y >= secondRect.y && firstRect.y <= secondRect.y + secondRect.height)
- }
- var overlapping = {
- resolveLabelOverlappingInOneDirection: resolveLabelOverlappingInOneDirection
- };
- var BaseChart = BaseWidget.inherit({
- _eventsMap: {
- onSeriesClick: {
- name: "seriesClick"
- },
- onPointClick: {
- name: "pointClick"
- },
- onArgumentAxisClick: {
- name: "argumentAxisClick"
- },
- onLegendClick: {
- name: "legendClick"
- },
- onSeriesSelectionChanged: {
- name: "seriesSelectionChanged"
- },
- onPointSelectionChanged: {
- name: "pointSelectionChanged"
- },
- onSeriesHoverChanged: {
- name: "seriesHoverChanged"
- },
- onPointHoverChanged: {
- name: "pointHoverChanged"
- },
- onDone: {
- name: "done"
- },
- onZoomStart: {
- name: "zoomStart"
- },
- onZoomEnd: {
- name: "zoomEnd"
- }
- },
- _fontFields: ["legend." + FONT, "legend.title." + FONT, "legend.title.subtitle." + FONT, "commonSeriesSettings.label." + FONT],
- _rootClassPrefix: "dxc",
- _rootClass: "dxc-chart",
- _initialChanges: ["INIT"],
- _themeDependentChanges: ["REFRESH_SERIES_REINIT"],
- _getThemeManagerOptions: function() {
- var themeOptions = this.callBase.apply(this, arguments);
- themeOptions.options = this.option();
- return themeOptions
- },
- _createThemeManager: function() {
- var chartOption = this.option();
- var themeManager = new chartThemeManagerModule.ThemeManager(this._getThemeManagerOptions());
- themeManager.setTheme(chartOption.theme, chartOption.rtlEnabled);
- return themeManager
- },
- _initCore: function() {
- var that = this;
- that._canvasClipRect = that._renderer.clipRect();
- that._createHtmlStructure();
- that._createLegend();
- that._createTracker();
- that._needHandleRenderComplete = true;
- that.layoutManager = new LayoutManagerModule.LayoutManager;
- that._createScrollBar();
- eventsEngine.on(that._$element, "contextmenu", function(event) {
- that.eventType = "contextmenu";
- if (eventUtils.isTouchEvent(event) || eventUtils.isPointerEvent(event)) {
- event.preventDefault()
- }
- });
- eventsEngine.on(that._$element, "MSHoldVisual", function(event) {
- that.eventType = "MSHoldVisual";
- event.preventDefault()
- })
- },
- _getLayoutItems: noop,
- _layoutManagerOptions: function() {
- return this._themeManager.getOptions("adaptiveLayout")
- },
- _reinit: function() {
- var that = this;
- _setCanvasValues(that._canvas);
- that._reinitAxes();
- that._requestChange(["DATA_SOURCE", "DATA_INIT", "CORRECT_AXIS", "FULL_RENDER"])
- },
- _correctAxes: noop,
- _createHtmlStructure: function() {
- var that = this;
- var renderer = that._renderer;
- var root = renderer.root;
- var createConstantLinesGroup = function() {
- return renderer.g().attr({
- "class": "dxc-constant-lines-group"
- }).linkOn(root, "constant-lines")
- };
- that._constantLinesGroup = {
- dispose: function() {
- this.under.dispose();
- this.above.dispose()
- },
- linkOff: function() {
- this.under.linkOff();
- this.above.linkOff()
- },
- clear: function() {
- this.under.linkRemove().clear();
- this.above.linkRemove().clear()
- },
- linkAppend: function() {
- this.under.linkAppend();
- this.above.linkAppend()
- }
- };
- that._backgroundRect = renderer.rect().attr({
- fill: "gray",
- opacity: 1e-4
- }).append(root);
- that._panesBackgroundGroup = renderer.g().attr({
- "class": "dxc-background"
- }).append(root);
- that._stripsGroup = renderer.g().attr({
- "class": "dxc-strips-group"
- }).linkOn(root, "strips");
- that._gridGroup = renderer.g().attr({
- "class": "dxc-grids-group"
- }).linkOn(root, "grids");
- that._panesBorderGroup = renderer.g().attr({
- "class": "dxc-border"
- }).linkOn(root, "border");
- that._axesGroup = renderer.g().attr({
- "class": "dxc-axes-group"
- }).linkOn(root, "axes");
- that._labelAxesGroup = renderer.g().attr({
- "class": "dxc-strips-labels-group"
- }).linkOn(root, "strips-labels");
- that._constantLinesGroup.under = createConstantLinesGroup();
- that._seriesGroup = renderer.g().attr({
- "class": "dxc-series-group"
- }).linkOn(root, "series");
- that._constantLinesGroup.above = createConstantLinesGroup();
- that._scaleBreaksGroup = renderer.g().attr({
- "class": "dxc-scale-breaks"
- }).linkOn(root, "scale-breaks");
- that._labelsGroup = renderer.g().attr({
- "class": "dxc-labels-group"
- }).linkOn(root, "labels");
- that._crosshairCursorGroup = renderer.g().attr({
- "class": "dxc-crosshair-cursor"
- }).linkOn(root, "crosshair");
- that._legendGroup = renderer.g().attr({
- "class": "dxc-legend",
- "clip-path": that._getCanvasClipRectID()
- }).linkOn(root, "legend").linkAppend(root).enableLinks();
- that._scrollBarGroup = renderer.g().attr({
- "class": "dxc-scroll-bar"
- }).linkOn(root, "scroll-bar")
- },
- _disposeObjectsInArray: function(propName, fieldNames) {
- _each(this[propName] || [], function(_, item) {
- if (fieldNames && item) {
- _each(fieldNames, function(_, field) {
- item[field] && item[field].dispose()
- })
- } else {
- item && item.dispose()
- }
- });
- this[propName] = null
- },
- _disposeCore: function() {
- var that = this;
- var disposeObject = function(propName) {
- if (that[propName]) {
- that[propName].dispose();
- that[propName] = null
- }
- };
- var unlinkGroup = function(name) {
- that[name].linkOff()
- };
- var disposeObjectsInArray = this._disposeObjectsInArray;
- that._renderer.stopAllAnimations();
- disposeObjectsInArray.call(that, "series");
- disposeObject("_tracker");
- disposeObject("_crosshair");
- that.layoutManager = that._userOptions = that._canvas = that._groupsData = null;
- unlinkGroup("_stripsGroup");
- unlinkGroup("_gridGroup");
- unlinkGroup("_axesGroup");
- unlinkGroup("_constantLinesGroup");
- unlinkGroup("_labelAxesGroup");
- unlinkGroup("_panesBorderGroup");
- unlinkGroup("_seriesGroup");
- unlinkGroup("_labelsGroup");
- unlinkGroup("_crosshairCursorGroup");
- unlinkGroup("_legendGroup");
- unlinkGroup("_scrollBarGroup");
- unlinkGroup("_scaleBreaksGroup");
- disposeObject("_canvasClipRect");
- disposeObject("_panesBackgroundGroup");
- disposeObject("_backgroundRect");
- disposeObject("_stripsGroup");
- disposeObject("_gridGroup");
- disposeObject("_axesGroup");
- disposeObject("_constantLinesGroup");
- disposeObject("_labelAxesGroup");
- disposeObject("_panesBorderGroup");
- disposeObject("_seriesGroup");
- disposeObject("_labelsGroup");
- disposeObject("_crosshairCursorGroup");
- disposeObject("_legendGroup");
- disposeObject("_scrollBarGroup");
- disposeObject("_scaleBreaksGroup")
- },
- _getAnimationOptions: function() {
- return this._themeManager.getOptions("animation")
- },
- _getDefaultSize: function() {
- return {
- width: 400,
- height: 400
- }
- },
- _getOption: function(name) {
- return this._themeManager.getOptions(name)
- },
- _applySize: function(rect) {
- this._rect = rect.slice();
- if (!this._changes.has("FULL_RENDER")) {
- this._processRefreshData(RESIZE_REFRESH_ACTION)
- }
- },
- _resize: function() {
- this._doRender(this.__renderOptions || {
- animate: false,
- isResize: true
- })
- },
- _trackerType: "ChartTracker",
- _createTracker: function() {
- var that = this;
- that._tracker = new trackerModule[that._trackerType]({
- seriesGroup: that._seriesGroup,
- renderer: that._renderer,
- tooltip: that._tooltip,
- legend: that._legend,
- eventTrigger: that._eventTrigger
- })
- },
- _getTrackerSettings: function() {
- return this._getSelectionModes()
- },
- _getSelectionModes: function() {
- var themeManager = this._themeManager;
- return {
- seriesSelectionMode: themeManager.getOptions("seriesSelectionMode"),
- pointSelectionMode: themeManager.getOptions("pointSelectionMode")
- }
- },
- _updateTracker: function(trackerCanvases) {
- var that = this;
- that._tracker.update(that._getTrackerSettings());
- that._tracker.setCanvases({
- left: 0,
- right: that._canvas.width,
- top: 0,
- bottom: that._canvas.height
- }, trackerCanvases)
- },
- _createCanvasFromRect: function(rect) {
- var currentCanvas = this._canvas;
- return _setCanvasValues({
- left: rect[0],
- top: rect[1],
- right: currentCanvas.width - rect[2],
- bottom: currentCanvas.height - rect[3],
- width: currentCanvas.width,
- height: currentCanvas.height
- })
- },
- _doRender: function(_options) {
- var that = this;
- if (0 === that._canvas.width && 0 === that._canvas.height) {
- return
- }
- that._resetIsReady();
- var drawOptions = that._prepareDrawOptions(_options);
- var recreateCanvas = drawOptions.recreateCanvas;
- that.__originalCanvas = that._canvas;
- that._canvas = extend({}, that._canvas);
- if (recreateCanvas) {
- that.__currentCanvas = that._canvas
- } else {
- that._canvas = that.__currentCanvas
- }
- that.DEBUG_canvas = _setCanvasValues(that._canvas);
- recreateCanvas && that._updateCanvasClipRect(that._canvas);
- this._canvas = this._createCanvasFromRect(this._rect);
- that._renderer.stopAllAnimations(true);
- that._cleanGroups();
- var startTime = new Date;
- that._renderElements(drawOptions);
- that._lastRenderingTime = new Date - startTime
- },
- _layoutAxes: noop,
- _renderElements: function(drawOptions) {
- var that = this;
- var preparedOptions = that._prepareToRender(drawOptions);
- var isRotated = that._isRotated();
- var isLegendInside = that._isLegendInside();
- var trackerCanvases = [];
- var dirtyCanvas = extend({}, that._canvas);
- var argBusinessRange;
- var zoomMinArg;
- var zoomMaxArg;
- that.DEBUG_dirtyCanvas = dirtyCanvas;
- that._renderer.lock();
- if (drawOptions.drawLegend && that._legend) {
- that._legendGroup.linkAppend()
- }
- that.layoutManager.setOptions(that._layoutManagerOptions());
- var layoutTargets = that._getLayoutTargets();
- this._layoutAxes(function(needSpace) {
- var axisDrawOptions = needSpace ? extend({}, drawOptions, {
- animate: false
- }) : drawOptions;
- var canvas = that._renderAxes(axisDrawOptions, preparedOptions);
- that._shrinkAxes(needSpace, canvas)
- });
- that._applyClipRects(preparedOptions);
- that._appendSeriesGroups();
- that._createCrosshairCursor();
- layoutTargets.forEach(function(_ref) {
- var canvas = _ref.canvas;
- trackerCanvases.push({
- left: canvas.left,
- right: canvas.width - canvas.right,
- top: canvas.top,
- bottom: canvas.height - canvas.bottom
- })
- });
- if (that._scrollBar) {
- argBusinessRange = that._argumentAxes[0].getTranslator().getBusinessRange();
- if ("discrete" === argBusinessRange.axisType && argBusinessRange.categories && argBusinessRange.categories.length <= 1 || "discrete" !== argBusinessRange.axisType && argBusinessRange.min === argBusinessRange.max) {
- zoomMinArg = zoomMaxArg = void 0
- } else {
- zoomMinArg = argBusinessRange.minVisible;
- zoomMaxArg = argBusinessRange.maxVisible
- }
- that._scrollBar.init(argBusinessRange, !that._argumentAxes[0].getOptions().valueMarginsEnabled).setPosition(zoomMinArg, zoomMaxArg)
- }
- that._updateTracker(trackerCanvases);
- that._updateLegendPosition(drawOptions, isLegendInside);
- that._applyPointMarkersAutoHiding();
- that._renderSeries(drawOptions, isRotated, isLegendInside);
- that._renderer.unlock()
- },
- _createCrosshairCursor: noop,
- _appendSeriesGroups: function() {
- this._seriesGroup.linkAppend();
- this._labelsGroup.linkAppend();
- this._appendAdditionalSeriesGroups()
- },
- _renderSeries: function(drawOptions, isRotated, isLegendInside) {
- this._calculateSeriesLayout(drawOptions, isRotated);
- this._renderSeriesElements(drawOptions, isRotated, isLegendInside)
- },
- _calculateSeriesLayout: function(drawOptions, isRotated) {
- drawOptions.hideLayoutLabels = this.layoutManager.needMoreSpaceForPanesCanvas(this._getLayoutTargets(), isRotated) && !this._themeManager.getOptions("adaptiveLayout").keepLabels;
- this._updateSeriesDimensions(drawOptions)
- },
- _renderSeriesElements: function(drawOptions, isRotated, isLegendInside) {
- var that = this;
- var i;
- var series = that.series;
- var singleSeries;
- var seriesLength = series.length;
- var resolveLabelOverlapping = that._themeManager.getOptions("resolveLabelOverlapping");
- for (i = 0; i < seriesLength; i++) {
- singleSeries = series[i];
- that._applyExtraSettings(singleSeries, drawOptions);
- singleSeries.draw(drawOptions.animate && singleSeries.getPoints().length <= drawOptions.animationPointsLimit && that._renderer.animationEnabled(), drawOptions.hideLayoutLabels, that._getLegendCallBack(singleSeries))
- }
- if ("none" === resolveLabelOverlapping) {
- that._adjustSeriesLabels(false)
- } else {
- that._locateLabels(resolveLabelOverlapping)
- }
- that._renderTrackers(isLegendInside);
- that._tracker.repairTooltip();
- that._clearCanvas();
- that._renderExtraElements();
- that._drawn();
- that._renderCompleteHandler()
- },
- _locateLabels: function(resolveLabelOverlapping) {
- this._resolveLabelOverlapping(resolveLabelOverlapping)
- },
- _renderExtraElements: function() {},
- _clearCanvas: function() {
- this._canvas = this.__originalCanvas
- },
- _resolveLabelOverlapping: function(resolveLabelOverlapping) {
- var func;
- switch (resolveLabelOverlapping) {
- case "stack":
- func = this._resolveLabelOverlappingStack;
- break;
- case "hide":
- func = this._resolveLabelOverlappingHide;
- break;
- case "shift":
- func = this._resolveLabelOverlappingShift
- }
- return typeUtils.isFunction(func) && func.call(this)
- },
- _getVisibleSeries: function() {
- return commonUtils.grep(this.getAllSeries(), function(series) {
- return series.isVisible()
- })
- },
- _resolveLabelOverlappingHide: function() {
- var labels = [];
- var currentLabel;
- var nextLabel;
- var currentLabelRect;
- var nextLabelRect;
- var i;
- var j;
- var points;
- var series = this._getVisibleSeries();
- for (i = 0; i < series.length; i++) {
- points = series[i].getVisiblePoints();
- for (j = 0; j < points.length; j++) {
- labels.push.apply(labels, points[j].getLabels())
- }
- }
- for (i = 0; i < labels.length; i++) {
- currentLabel = labels[i];
- if (!currentLabel.isVisible()) {
- continue
- }
- currentLabelRect = currentLabel.getBoundingRect();
- for (j = i + 1; j < labels.length; j++) {
- nextLabel = labels[j];
- nextLabelRect = nextLabel.getBoundingRect();
- if (checkOverlapping(currentLabelRect, nextLabelRect)) {
- nextLabel.draw(false)
- }
- }
- }
- },
- _cleanGroups: function() {
- var that = this;
- that._stripsGroup.linkRemove().clear();
- that._gridGroup.linkRemove().clear();
- that._axesGroup.linkRemove().clear();
- that._constantLinesGroup.above.clear();
- that._labelAxesGroup.linkRemove().clear();
- that._labelsGroup.linkRemove().clear();
- that._crosshairCursorGroup.linkRemove().clear();
- that._scaleBreaksGroup.linkRemove().clear()
- },
- _allowLegendInsidePosition: function() {
- return false
- },
- _updateLegendPosition: noop,
- _createLegend: function() {
- var that = this;
- var legendSettings = getLegendSettings(that._legendDataField);
- that._legend = new legendModule.Legend({
- renderer: that._renderer,
- group: that._legendGroup,
- backgroundClass: "dxc-border",
- itemGroupClass: "dxc-item",
- titleGroupClass: "dxc-title",
- textField: legendSettings.textField,
- getFormatObject: legendSettings.getFormatObject,
- allowInsidePosition: that._allowLegendInsidePosition()
- });
- that._updateLegend();
- that._layout.add(that._legend)
- },
- _updateLegend: function() {
- var that = this;
- var themeManager = that._themeManager;
- var legendOptions = themeManager.getOptions("legend");
- var legendData = that._getLegendData();
- legendOptions.containerBackgroundColor = themeManager.getOptions("containerBackgroundColor");
- legendOptions._incidentOccurred = that._incidentOccurred;
- that._legend.update(legendData, legendOptions, themeManager.theme("legend").title);
- this._change(["LAYOUT"])
- },
- _prepareDrawOptions: function(drawOptions) {
- var animationOptions = this._getAnimationOptions();
- var options = extend({}, {
- force: false,
- adjustAxes: true,
- drawLegend: true,
- drawTitle: true,
- animate: animationOptions.enabled,
- animationPointsLimit: animationOptions.maxPointCountSupported
- }, drawOptions, this.__renderOptions);
- if (!_isDefined(options.recreateCanvas)) {
- options.recreateCanvas = options.adjustAxes && options.drawLegend && options.drawTitle
- }
- return options
- },
- _processRefreshData: function(newRefreshAction) {
- var currentRefreshActionPosition = inArray(this._currentRefreshData, ACTIONS_BY_PRIORITY);
- var newRefreshActionPosition = inArray(newRefreshAction, ACTIONS_BY_PRIORITY);
- if (!this._currentRefreshData || currentRefreshActionPosition >= 0 && newRefreshActionPosition < currentRefreshActionPosition) {
- this._currentRefreshData = newRefreshAction
- }
- this._requestChange(["REFRESH"])
- },
- _getLegendData: function() {
- return _map(this._getLegendTargets(), function(item) {
- var legendData = item.legendData;
- var style = item.getLegendStyles;
- var opacity = style.normal.opacity;
- if (!item.visible) {
- if (!_isDefined(opacity) || opacity > DEFAULT_OPACITY) {
- opacity = DEFAULT_OPACITY
- }
- legendData.textOpacity = DEFAULT_OPACITY
- }
- legendData.states = {
- hover: style.hover,
- selection: style.selection,
- normal: _extend({}, style.normal, {
- opacity: opacity
- })
- };
- return legendData
- })
- },
- _getLegendOptions: function(item) {
- return {
- legendData: {
- text: item[this._legendItemTextField],
- id: item.index,
- visible: true
- },
- getLegendStyles: item.getLegendStyles(),
- visible: item.isVisible()
- }
- },
- _disposeSeries: function(seriesIndex) {
- var that = this;
- if (that.series) {
- if (_isDefined(seriesIndex)) {
- that.series[seriesIndex].dispose();
- that.series.splice(seriesIndex, 1)
- } else {
- _each(that.series, function(_, s) {
- return s.dispose()
- });
- that.series.length = 0
- }
- }
- if (!that.series || !that.series.length) {
- that.series = []
- }
- },
- _disposeSeriesFamilies: function() {
- var that = this;
- _each(that.seriesFamilies || [], function(_, family) {
- family.dispose()
- });
- that.seriesFamilies = null;
- that._needHandleRenderComplete = true
- },
- _simulateOptionChange: function(fullName, value, previousValue) {
- var that = this;
- var optionSetter = coreDataUtils.compileSetter(fullName);
- optionSetter(that._options, value, {
- functionsAsIs: true,
- merge: !that._getOptionsByReference()[fullName]
- });
- that._notifyOptionChanged(fullName, value, previousValue);
- that._changes.reset()
- },
- _optionChanged: function(arg) {
- this._themeManager.resetOptions(arg.name);
- this.callBase.apply(this, arguments)
- },
- _applyChanges: function() {
- var that = this;
- that._themeManager.update(that._options);
- that.callBase.apply(that, arguments)
- },
- _optionChangesMap: {
- animation: "ANIMATION",
- dataSource: "DATA_SOURCE",
- palette: "PALETTE",
- paletteExtensionMode: "PALETTE",
- legend: "FORCE_DATA_INIT",
- seriesTemplate: "FORCE_DATA_INIT",
- "export": "FORCE_RENDER",
- valueAxis: "AXES_AND_PANES",
- argumentAxis: "AXES_AND_PANES",
- commonAxisSettings: "AXES_AND_PANES",
- panes: "AXES_AND_PANES",
- defaultPane: "AXES_AND_PANES",
- useAggregation: "AXES_AND_PANES",
- containerBackgroundColor: "AXES_AND_PANES",
- rotated: "ROTATED",
- autoHidePointMarkers: "REFRESH_SERIES_REINIT",
- customizePoint: "REFRESH_SERIES_REINIT",
- customizeLabel: "REFRESH_SERIES_REINIT",
- scrollBar: "SCROLL_BAR"
- },
- _optionChangesOrder: ["ROTATED", "PALETTE", "REFRESH_SERIES_REINIT", "AXES_AND_PANES", "INIT", "REINIT", "DATA_SOURCE", "REFRESH_SERIES_DATA_INIT", "DATA_INIT", "FORCE_DATA_INIT", "REFRESH_AXES", "CORRECT_AXIS"],
- _customChangesOrder: ["ANIMATION", "REFRESH_SERIES_FAMILIES", "FORCE_RENDER", "VISUAL_RANGE", "SCROLL_BAR", "CHART_TOOLTIP", "REINIT", "REFRESH", "FULL_RENDER"],
- _change_ANIMATION: function() {
- this._renderer.updateAnimationOptions(this._getAnimationOptions())
- },
- _change_DATA_SOURCE: function() {
- this._needHandleRenderComplete = true;
- this._updateDataSource()
- },
- _change_PALETTE: function() {
- this._themeManager.updatePalette();
- this._refreshSeries("DATA_INIT")
- },
- _change_REFRESH_SERIES_DATA_INIT: function() {
- this._refreshSeries("DATA_INIT")
- },
- _change_DATA_INIT: function() {
- if ((!this.series || this.needToPopulateSeries) && !this._changes.has("FORCE_DATA_INIT")) {
- this._dataInit()
- }
- },
- _change_FORCE_DATA_INIT: function() {
- this._dataInit()
- },
- _change_REFRESH_SERIES_FAMILIES: function() {
- this._processSeriesFamilies();
- this._populateBusinessRange();
- this._processRefreshData(FORCE_RENDER_REFRESH_ACTION)
- },
- _change_FORCE_RENDER: function() {
- this._processRefreshData(FORCE_RENDER_REFRESH_ACTION)
- },
- _change_AXES_AND_PANES: function() {
- this._refreshSeries("INIT")
- },
- _change_ROTATED: function() {
- this._createScrollBar();
- this._refreshSeries("INIT")
- },
- _change_REFRESH_SERIES_REINIT: function() {
- this._refreshSeries("INIT")
- },
- _change_REFRESH_AXES: function() {
- var that = this;
- _setCanvasValues(that._canvas);
- that._reinitAxes();
- that._requestChange(["CORRECT_AXIS", "FULL_RENDER"])
- },
- _change_SCROLL_BAR: function() {
- this._createScrollBar();
- this._processRefreshData(FORCE_RENDER_REFRESH_ACTION)
- },
- _change_CHART_TOOLTIP: function() {
- this._organizeStackPoints()
- },
- _change_REINIT: function() {
- this._processRefreshData(REINIT_REFRESH_ACTION)
- },
- _refreshSeries: function(actionName) {
- this.needToPopulateSeries = true;
- this._requestChange([actionName])
- },
- _change_CORRECT_AXIS: function() {
- this._correctAxes()
- },
- _doRefresh: function() {
- var methodName = this._currentRefreshData;
- if (methodName) {
- this._currentRefreshData = null;
- this._renderer.stopAllAnimations(true);
- this[methodName]()
- }
- },
- _updateCanvasClipRect: function(canvas) {
- var that = this;
- var width = Math.max(canvas.width - canvas.left - canvas.right, 0);
- var height = Math.max(canvas.height - canvas.top - canvas.bottom, 0);
- that._canvasClipRect.attr({
- x: canvas.left,
- y: canvas.top,
- width: width,
- height: height
- });
- that._backgroundRect.attr({
- x: canvas.left,
- y: canvas.top,
- width: width,
- height: height
- })
- },
- _getCanvasClipRectID: function() {
- return this._canvasClipRect.id
- },
- _dataSourceChangedHandler: function() {
- if (this._changes.has("INIT")) {
- this._requestChange(["DATA_INIT"])
- } else {
- this._requestChange(["FORCE_DATA_INIT"])
- }
- },
- _dataInit: function() {
- this._dataSpecificInit(true)
- },
- _processSingleSeries: function(singleSeries) {
- singleSeries.createPoints(false)
- },
- _handleSeriesDataUpdated: function() {
- var _this = this;
- if (this._getVisibleSeries().some(function(s) {
- return s.useAggregation()
- })) {
- this._populateMarginOptions()
- }
- this.series.forEach(function(s) {
- return _this._processSingleSeries(s)
- }, this)
- },
- _dataSpecificInit: function(needRedraw) {
- var that = this;
- if (!that.series || that.needToPopulateSeries) {
- that.series = that._populateSeries()
- }
- that._repopulateSeries();
- that._seriesPopulatedHandlerCore();
- that._populateBusinessRange();
- that._tracker.updateSeries(that.series, this._changes.has("INIT"));
- that._updateLegend();
- if (needRedraw) {
- this._requestChange(["FULL_RENDER"])
- }
- },
- _forceRender: function() {
- this._doRender({
- force: true
- })
- },
- _repopulateSeries: function() {
- var that = this;
- var themeManager = that._themeManager;
- var data = that._dataSourceItems();
- var dataValidatorOptions = themeManager.getOptions("dataPrepareSettings");
- var seriesTemplate = themeManager.getOptions("seriesTemplate");
- if (seriesTemplate) {
- that._populateSeries(data)
- }
- that._groupSeries();
- var parsedData = dataValidatorModule.validateData(data, that._groupsData, that._incidentOccurred, dataValidatorOptions);
- themeManager.resetPalette();
- that.series.forEach(function(singleSeries) {
- singleSeries.updateData(parsedData[singleSeries.getArgumentField()])
- });
- that._handleSeriesDataUpdated();
- that._organizeStackPoints()
- },
- _organizeStackPoints: function() {
- var that = this;
- var themeManager = that._themeManager;
- var sharedTooltip = themeManager.getOptions("tooltip").shared;
- var stackPoints = {};
- _each(that.series || [], function(_, singleSeries) {
- that._resetStackPoints(singleSeries);
- sharedTooltip && that._prepareStackPoints(singleSeries, stackPoints)
- })
- },
- _renderCompleteHandler: function() {
- var that = this;
- var allSeriesInited = true;
- if (that._needHandleRenderComplete) {
- _each(that.series, function(_, s) {
- allSeriesInited = allSeriesInited && s.canRenderCompleteHandle()
- });
- if (allSeriesInited) {
- that._needHandleRenderComplete = false;
- that._eventTrigger("done", {
- target: that
- })
- }
- }
- },
- _dataIsReady: function() {
- return _isDefined(this.option("dataSource")) && this._dataIsLoaded()
- },
- _populateSeriesOptions: function(data) {
- var that = this;
- var themeManager = that._themeManager;
- var seriesTemplate = themeManager.getOptions("seriesTemplate");
- var seriesOptions = seriesTemplate ? vizUtils.processSeriesTemplate(seriesTemplate, data || []) : that.option("series");
- var allSeriesOptions = _isArray(seriesOptions) ? seriesOptions : seriesOptions ? [seriesOptions] : [];
- var extraOptions = that._getExtraOptions();
- var particularSeriesOptions;
- var seriesTheme;
- var seriesThemes = [];
- var seriesVisibilityChanged = function(target) {
- that._specialProcessSeries();
- that._populateBusinessRange(target && target.getValueAxis(), true);
- that._renderer.stopAllAnimations(true);
- that._updateLegend();
- that._requestChange(["FULL_RENDER"])
- };
- for (var i = 0; i < allSeriesOptions.length; i++) {
- particularSeriesOptions = _extend(true, {}, allSeriesOptions[i], extraOptions);
- if (!particularSeriesOptions.name) {
- particularSeriesOptions.name = "Series " + (i + 1).toString()
- }
- particularSeriesOptions.rotated = that._isRotated();
- particularSeriesOptions.customizePoint = themeManager.getOptions("customizePoint");
- particularSeriesOptions.customizeLabel = themeManager.getOptions("customizeLabel");
- particularSeriesOptions.visibilityChanged = seriesVisibilityChanged;
- particularSeriesOptions.incidentOccurred = that._incidentOccurred;
- seriesTheme = themeManager.getOptions("series", particularSeriesOptions, allSeriesOptions.length);
- if (that._checkPaneName(seriesTheme)) {
- seriesThemes.push(seriesTheme)
- }
- }
- return seriesThemes
- },
- _populateSeries: function(data) {
- var that = this;
- var seriesBasis = [];
- var incidentOccurred = that._incidentOccurred;
- var seriesThemes = that._populateSeriesOptions(data);
- var particularSeries;
- var disposeSeriesFamilies = false;
- that.needToPopulateSeries = false;
- _each(seriesThemes, function(_, theme) {
- var curSeries = that.series && that.series.filter(function(s) {
- return s.name === theme.name && seriesBasis.map(function(sb) {
- return sb.series
- }).indexOf(s) === -1
- })[0];
- if (curSeries && curSeries.type === theme.type) {
- seriesBasis.push({
- series: curSeries,
- options: theme
- })
- } else {
- seriesBasis.push({
- options: theme
- });
- disposeSeriesFamilies = true
- }
- });
- that._tracker.clearHover();
- _reverseEach(that.series, function(index, series) {
- if (!seriesBasis.some(function(s) {
- return series === s.series
- })) {
- that._disposeSeries(index);
- disposeSeriesFamilies = true
- }
- });
- !disposeSeriesFamilies && (disposeSeriesFamilies = seriesBasis.some(function(sb) {
- return sb.series.name !== seriesThemes[sb.series.index].name;
- }));
- that.series = [];
- disposeSeriesFamilies && that._disposeSeriesFamilies();
- that._themeManager.resetPalette();
- var eventPipe = function(data) {
- that.series.forEach(function(currentSeries) {
- currentSeries.notify(data)
- })
- };
- _each(seriesBasis, function(_, basis) {
- var seriesTheme = basis.options;
- var renderSettings = {
- commonSeriesModes: that._getSelectionModes(),
- argumentAxis: that.getArgumentAxis(),
- valueAxis: that._getValueAxis(seriesTheme.pane, seriesTheme.axis)
- };
- if (basis.series) {
- particularSeries = basis.series;
- particularSeries.updateOptions(seriesTheme, renderSettings)
- } else {
- particularSeries = new seriesModule.Series(_extend({
- renderer: that._renderer,
- seriesGroup: that._seriesGroup,
- labelsGroup: that._labelsGroup,
- eventTrigger: that._eventTrigger,
- eventPipe: eventPipe,
- incidentOccurred: incidentOccurred
- }, renderSettings), seriesTheme)
- }
- if (!particularSeries.isUpdated) {
- incidentOccurred("E2101", [seriesTheme.type])
- } else {
- particularSeries.index = that.series.length;
- that.series.push(particularSeries)
- }
- });
- return that.series
- },
- getAllSeries: function() {
- return (this.series || []).slice()
- },
- getSeriesByName: function(name) {
- var found = null;
- _each(this.series, function(i, singleSeries) {
- if (singleSeries.name === name) {
- found = singleSeries;
- return false
- }
- });
- return found
- },
- getSeriesByPos: function(pos) {
- return (this.series || [])[pos]
- },
- clearSelection: function() {
- this._tracker.clearSelection()
- },
- hideTooltip: function() {
- this._tracker._hideTooltip()
- },
- clearHover: function() {
- this._tracker.clearHover()
- },
- render: function(renderOptions) {
- var that = this;
- that.__renderOptions = renderOptions;
- that.__forceRender = renderOptions && renderOptions.force;
- that.callBase.apply(that, arguments);
- that.__renderOptions = that.__forceRender = null;
- return that
- },
- refresh: function() {
- this._disposeSeries();
- this._disposeSeriesFamilies();
- this._requestChange(["CONTAINER_SIZE", "REFRESH_SERIES_REINIT"])
- },
- _getMinSize: function() {
- var adaptiveLayout = this._layoutManagerOptions();
- return [adaptiveLayout.width, adaptiveLayout.height]
- },
- _change_REFRESH: function() {
- if (!this._changes.has("INIT")) {
- this._doRefresh()
- } else {
- this._currentRefreshData = null
- }
- },
- _change_FULL_RENDER: function() {
- this._forceRender()
- },
- _change_INIT: function() {
- this._reinit()
- },
- _stopCurrentHandling: function() {
- this._tracker.stopCurrentHandling()
- }
- });
- REFRESH_SERIES_DATA_INIT_ACTION_OPTIONS.forEach(function(name) {
- BaseChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_DATA_INIT"
- });
- FORCE_RENDER_REFRESH_ACTION_OPTIONS.forEach(function(name) {
- BaseChart.prototype._optionChangesMap[name] = "FORCE_RENDER"
- });
- REFRESH_SERIES_FAMILIES_ACTION_OPTIONS.forEach(function(name) {
- BaseChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_FAMILIES"
- });
- exports.overlapping = overlapping;
- exports.BaseChart = BaseChart;
- BaseChart.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
- BaseChart.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
- BaseChart.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
- BaseChart.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin);
- BaseChart.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin);
- var _change_TITLE = BaseChart.prototype._change_TITLE;
- BaseChart.prototype._change_TITLE = function() {
- _change_TITLE.apply(this, arguments);
- this._change(["FORCE_RENDER"])
- };
- var _change_TOOLTIP = BaseChart.prototype._change_TOOLTIP;
- BaseChart.prototype._change_TOOLTIP = function() {
- _change_TOOLTIP.apply(this, arguments);
- this._change(["CHART_TOOLTIP"])
- }
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/base_theme_manager.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var paletteModule = __webpack_require__( /*! ../palette */ 164);
- var _isString = typeUtils.isString;
- var _parseScalar = __webpack_require__( /*! ./utils */ 10).parseScalar;
- var themeModule = __webpack_require__( /*! ../themes */ 50);
- var _getTheme = themeModule.getTheme;
- var _addCacheItem = themeModule.addCacheItem;
- var _removeCacheItem = themeModule.removeCacheItem;
- var _extend = extend;
- var _each = each;
- __webpack_require__( /*! ./themes/generic.light */ 754);
- __webpack_require__( /*! ./themes/generic.dark */ 755);
- __webpack_require__( /*! ./themes/generic.contrast */ 756);
- __webpack_require__( /*! ./themes/generic.carmine */ 757);
- __webpack_require__( /*! ./themes/generic.darkmoon */ 758);
- __webpack_require__( /*! ./themes/generic.softblue */ 759);
- __webpack_require__( /*! ./themes/generic.darkviolet */ 760);
- __webpack_require__( /*! ./themes/generic.greenmist */ 761);
- __webpack_require__( /*! ./themes/material */ 762);
- __webpack_require__( /*! ./themes/ios */ 763);
- function getThemePart(theme, path) {
- var _theme = theme;
- path && _each(path.split("."), function(_, pathItem) {
- return _theme = _theme[pathItem]
- });
- return _theme
- }
- exports.BaseThemeManager = Class.inherit({
- ctor: function(options) {
- this._themeSection = options.themeSection;
- this._fontFields = options.fontFields || [];
- _addCacheItem(this)
- },
- dispose: function() {
- var that = this;
- _removeCacheItem(that);
- that._callback = that._theme = that._font = null;
- return that
- },
- setCallback: function(callback) {
- this._callback = callback;
- return this
- },
- setTheme: function(theme, rtl) {
- this._current = theme;
- this._rtl = rtl;
- return this.refresh()
- },
- refresh: function() {
- var that = this;
- var current = that._current || {};
- var theme = _getTheme(current.name || current);
- that._themeName = theme.name;
- that._defaultPalette = theme.defaultPalette;
- that._font = _extend({}, theme.font, current.font);
- that._themeSection && _each(that._themeSection.split("."), function(_, path) {
- theme = _extend(true, {}, theme[path])
- });
- that._theme = _extend(true, {}, theme, _isString(current) ? {} : current);
- that._initializeTheme();
- if (_parseScalar(that._rtl, that._theme.rtlEnabled)) {
- _extend(true, that._theme, that._theme._rtl)
- }
- that._callback();
- return that
- },
- theme: function(path) {
- return getThemePart(this._theme, path)
- },
- themeName: function() {
- return this._themeName
- },
- createPalette: function(palette, options) {
- return paletteModule.createPalette(palette, options, this._defaultPalette)
- },
- createDiscretePalette: function(palette, count) {
- return paletteModule.getDiscretePalette(palette, count, this._defaultPalette)
- },
- createGradientPalette: function(palette) {
- return paletteModule.getGradientPalette(palette, this._defaultPalette)
- },
- getAccentColor: function(palette) {
- return paletteModule.getAccentColor(palette, this._defaultPalette)
- },
- _initializeTheme: function() {
- var that = this;
- _each(that._fontFields || [], function(_, path) {
- that._initializeFont(getThemePart(that._theme, path))
- })
- },
- _initializeFont: function(font) {
- _extend(font, this._font, _extend({}, font))
- }
- })
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/viz/core/layout_element.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var _round = Math.round;
- var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
- var defaultOffset = {
- horizontal: 0,
- vertical: 0
- };
- var alignFactors = {
- center: .5,
- right: 1,
- bottom: 1,
- left: 0,
- top: 0
- };
- function LayoutElement(options) {
- this._options = options
- }
- LayoutElement.prototype = {
- constructor: LayoutElement,
- position: function(options) {
- var that = this;
- var ofBBox = options.of.getLayoutOptions();
- var myBBox = that.getLayoutOptions();
- var at = options.at;
- var my = options.my;
- var offset = options.offset || defaultOffset;
- var shiftX = -alignFactors[my.horizontal] * myBBox.width + ofBBox.x + alignFactors[at.horizontal] * ofBBox.width + parseInt(offset.horizontal);
- var shiftY = -alignFactors[my.vertical] * myBBox.height + ofBBox.y + alignFactors[at.vertical] * ofBBox.height + parseInt(offset.vertical);
- that.shift(_round(shiftX), _round(shiftY))
- },
- getLayoutOptions: noop
- };
- function WrapperLayoutElement(renderElement, bBox) {
- this._renderElement = renderElement;
- this._cacheBBox = bBox
- }
- var wrapperLayoutElementPrototype = WrapperLayoutElement.prototype = objectUtils.clone(LayoutElement.prototype);
- wrapperLayoutElementPrototype.constructor = WrapperLayoutElement;
- wrapperLayoutElementPrototype.getLayoutOptions = function() {
- return this._cacheBBox || this._renderElement.getBBox()
- };
- wrapperLayoutElementPrototype.shift = function(shiftX, shiftY) {
- var bBox = this.getLayoutOptions();
- this._renderElement.move(_round(shiftX - bBox.x), _round(shiftY - bBox.y))
- };
- exports.LayoutElement = LayoutElement;
- exports.WrapperLayoutElement = WrapperLayoutElement
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/components/data_validator.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var STRING = "string";
- var NUMERIC = "numeric";
- var DATETIME = "datetime";
- var DISCRETE = "discrete";
- var SEMIDISCRETE = "semidiscrete";
- var CONTINUOUS = "continuous";
- var LOGARITHMIC = "logarithmic";
- var VALUE_TYPE = "valueType";
- var ARGUMENT_TYPE = "argumentType";
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var axisTypeParser = __webpack_require__( /*! ../core/utils */ 10).enumParser([STRING, NUMERIC, DATETIME]);
- var _getParser = __webpack_require__( /*! ./parse_utils */ 244).getParser;
- var _isDefined = typeUtils.isDefined;
- var _isFunction = typeUtils.isFunction;
- var _isArray = Array.isArray;
- var _isString = typeUtils.isString;
- var _isDate = typeUtils.isDate;
- var _isNumber = typeUtils.isNumeric;
- var _isObject = typeUtils.isObject;
- function groupingValues(data, others, valueField, index) {
- if (index >= 0) {
- data.slice(index).forEach(function(cell) {
- if (_isDefined(cell[valueField])) {
- others[valueField] += cell[valueField];
- cell[valueField] = void 0
- }
- })
- }
- }
- function processGroups(groups) {
- groups.forEach(function(group) {
- group.valueType = group.valueAxisType = null;
- group.series.forEach(function(series) {
- series.updateDataType({})
- });
- group.valueAxis && group.valueAxis.resetTypes(VALUE_TYPE)
- })
- }
- function sortValues(data, asc, selector) {
- var func = asc ? function(a, b) {
- return a - b
- } : function(a, b) {
- return b - a
- };
- data.sort(function(a, b) {
- var valA = selector(a);
- var valB = selector(b);
- var aa = _isDefined(valA) ? 1 : 0;
- var bb = _isDefined(valB) ? 1 : 0;
- return aa && bb ? func(valA, valB) : func(aa, bb)
- });
- return data
- }
- function resetArgumentAxes(axes) {
- axes && axes.forEach(function(axis) {
- axis.resetTypes(ARGUMENT_TYPE)
- })
- }
- function parseCategories(categories, parser) {
- var newArray = [];
- categories.forEach(function(category) {
- var parsedCategory = parser(category);
- void 0 !== parsedCategory && newArray.push(parsedCategory)
- });
- return newArray
- }
- function parseAxisCategories(groupsData, parsers) {
- var argumentCategories = groupsData.argumentOptions && groupsData.argumentOptions.categories;
- groupsData.groups.forEach(function(valueGroup, i) {
- var categories = valueGroup.valueOptions && valueGroup.valueOptions.categories;
- if (categories) {
- valueGroup.valueOptions.categories = parseCategories(categories, parsers[i + 1])
- }
- });
- if (argumentCategories) {
- groupsData.argumentOptions.categories = parseCategories(argumentCategories, parsers[0])
- }
- }
- function filterForLogAxis(val, field, incidentOccurred) {
- if (val <= 0 && null !== val) {
- incidentOccurred("E2004", [field]);
- val = null
- }
- return val
- }
- function eigen(x) {
- return x
- }
- function getType(unit, type) {
- var result = type;
- if (type === STRING || _isString(unit)) {
- result = STRING
- } else {
- if (type === DATETIME || _isDate(unit)) {
- result = DATETIME
- } else {
- if (_isNumber(unit)) {
- result = NUMERIC
- }
- }
- }
- return result
- }
- function correctAxisType(type, axisType, hasCategories, incidentOccurred) {
- if (type === STRING && (axisType === CONTINUOUS || axisType === LOGARITHMIC || axisType === SEMIDISCRETE)) {
- incidentOccurred("E2002")
- }
- return axisType === LOGARITHMIC ? LOGARITHMIC : hasCategories || axisType === DISCRETE || type === STRING ? DISCRETE : axisType === SEMIDISCRETE ? SEMIDISCRETE : CONTINUOUS
- }
- function validUnit(unit, field, incidentOccurred) {
- if (unit) {
- incidentOccurred(!_isNumber(unit) && !_isDate(unit) && !_isString(unit) ? "E2003" : "E2004", [field])
- }
- }
- function createParserUnit(type, axisType, incidentOccurred) {
- var parser = type ? _getParser(type) : eigen;
- var filter = axisType === LOGARITHMIC ? filterForLogAxis : eigen;
- var filterInfinity = axisType !== DISCRETE ? function(x) {
- return isFinite(x) || void 0 === x ? x : null
- } : eigen;
- return function(unit, field) {
- var filterLogValues = function(x) {
- return filter(x, field, incidentOccurred)
- };
- var parseUnit = filterLogValues(filterInfinity(parser(unit)));
- if (void 0 === parseUnit) {
- validUnit(unit, field, incidentOccurred)
- }
- return parseUnit
- }
- }
- function prepareParsers(groupsData, incidentOccurred) {
- var argumentParser = createParserUnit(groupsData.argumentType, groupsData.argumentAxisType, incidentOccurred);
- var sizeParser;
- var valueParser;
- var categoryParsers = [argumentParser];
- var cache = {};
- var list = [];
- groupsData.groups.forEach(function(group, groupIndex) {
- group.series.forEach(function(series) {
- valueParser = createParserUnit(group.valueType, group.valueAxisType, incidentOccurred);
- sizeParser = createParserUnit(NUMERIC, CONTINUOUS, incidentOccurred);
- cache[series.getArgumentField()] = argumentParser;
- series.getValueFields().forEach(function(field) {
- categoryParsers[groupIndex + 1] = valueParser;
- cache[field] = valueParser
- });
- if (series.getSizeField()) {
- cache[series.getSizeField()] = sizeParser
- }
- })
- });
- for (var field in cache) {
- list.push([field, cache[field]])
- }
- list.length && parseAxisCategories(groupsData, categoryParsers);
- return list
- }
- function getParsedCell(cell, parsers) {
- var i;
- var ii = parsers.length;
- var obj = extend({}, cell);
- var field;
- var value;
- for (i = 0; i < ii; ++i) {
- field = parsers[i][0];
- value = cell[field];
- obj[field] = parsers[i][1](value, field)
- }
- return obj
- }
- function parse(data, parsers) {
- var parsedData = [];
- var i;
- var ii = data.length;
- parsedData.length = ii;
- for (i = 0; i < ii; ++i) {
- parsedData[i] = getParsedCell(data[i], parsers)
- }
- return parsedData
- }
- function findIndexByThreshold(data, valueField, threshold) {
- var i;
- var ii = data.length;
- var value;
- for (i = 0; i < ii; ++i) {
- value = data[i][valueField];
- if (_isDefined(value) && threshold > value) {
- break
- }
- }
- return i
- }
- function groupMinSlices(originalData, argumentField, valueField, smallValuesGrouping) {
- smallValuesGrouping = smallValuesGrouping || {};
- var mode = smallValuesGrouping.mode;
- var others = {};
- if (!mode || "none" === mode) {
- return
- }
- others[argumentField] = String(smallValuesGrouping.groupName || "others");
- others[valueField] = 0;
- var data = sortValues(originalData.slice(), false, function(a) {
- return a[valueField]
- });
- groupingValues(data, others, valueField, "smallValueThreshold" === mode ? findIndexByThreshold(data, valueField, smallValuesGrouping.threshold) : smallValuesGrouping.topCount);
- others[valueField] && originalData.push(others)
- }
- function groupPieData(data, groupsData) {
- var firstSeries = groupsData.groups[0] && groupsData.groups[0].series[0];
- var isPie = firstSeries && ("pie" === firstSeries.type || "doughnut" === firstSeries.type || "donut" === firstSeries.type);
- if (!isPie) {
- return
- }
- groupsData.groups.forEach(function(group) {
- group.series.forEach(function(series) {
- groupMinSlices(data, series.getArgumentField(), series.getValueFields()[0], series.getOptions().smallValuesGrouping)
- })
- })
- }
- function addUniqueItemToCollection(item, collection, itemsHash) {
- if (!itemsHash[item]) {
- collection.push(item);
- itemsHash[item] = true
- }
- }
- function getUniqueArgumentFields(groupsData) {
- var uniqueArgumentFields = [];
- var hash = {};
- groupsData.groups.forEach(function(group) {
- group.series.forEach(function(series) {
- addUniqueItemToCollection(series.getArgumentField(), uniqueArgumentFields, hash)
- })
- });
- return uniqueArgumentFields
- }
- function sort(a, b) {
- var result = a - b;
- if (isNaN(result)) {
- if (!_isDefined(a)) {
- return 1
- }
- if (!_isDefined(b)) {
- return -1
- }
- return 0
- }
- return result
- }
- function sortByArgument(data, argumentField) {
- return data.slice().sort(function(a, b) {
- return sort(a[argumentField], b[argumentField])
- })
- }
- function sortByCallback(data, callback) {
- return data.slice().sort(callback)
- }
- function checkValueTypeOfGroup(group, cell) {
- group.series.forEach(function(series) {
- series.getValueFields().forEach(function(field) {
- group.valueType = getType(cell[field], group.valueType)
- })
- });
- return group.valueType
- }
- function getSortByCategories(categories) {
- var hash = {};
- categories.forEach(function(value, i) {
- hash[value] = i
- });
- return function(data, argumentField) {
- return sortValues(data.slice(), true, function(a) {
- return hash[a[argumentField]]
- })
- }
- }
- function sortData(data, groupsData, options, uniqueArgumentFields) {
- var dataByArguments = {};
- var isDiscrete = groupsData.argumentAxisType === DISCRETE;
- var userCategories = isDiscrete && groupsData.argumentOptions && groupsData.argumentOptions.categories;
- var sortFunction = function(data) {
- return data
- };
- var sortingMethodOption = options.sortingMethod;
- var reSortCategories;
- if (!userCategories && _isFunction(sortingMethodOption)) {
- data = sortByCallback(data, sortingMethodOption)
- }
- if (isDiscrete) {
- groupsData.categories = getCategories(data, uniqueArgumentFields, userCategories)
- }
- if (userCategories || !_isFunction(sortingMethodOption) && groupsData.argumentType === STRING && !options._skipArgumentSorting) {
- sortFunction = getSortByCategories(groupsData.categories)
- } else {
- if (true === sortingMethodOption && groupsData.argumentType !== STRING) {
- sortFunction = sortByArgument;
- reSortCategories = isDiscrete
- }
- }
- uniqueArgumentFields.forEach(function(field) {
- dataByArguments[field] = sortFunction(data, field)
- });
- if (reSortCategories) {
- groupsData.categories = groupsData.categories.sort(sort)
- }
- return dataByArguments
- }
- function checkItemExistence(collection, item) {
- return collection.map(function(collectionItem) {
- return collectionItem.valueOf()
- }).indexOf(item.valueOf()) === -1
- }
- function getCategories(data, uniqueArgumentFields, userCategories) {
- var categories = userCategories ? userCategories.slice() : [];
- uniqueArgumentFields.forEach(function(field) {
- data.forEach(function(item) {
- var dataItem = item[field];
- _isDefined(dataItem) && checkItemExistence(categories, dataItem) && categories.push(dataItem)
- })
- });
- return categories
- }
- function checkArgumentTypeOfGroup(series, cell, groupsData) {
- series.forEach(function(currentSeries) {
- groupsData.argumentType = getType(cell[currentSeries.getArgumentField()], groupsData.argumentType)
- });
- return groupsData.argumentType
- }
- function checkType(data, groupsData, checkTypeForAllData) {
- var groupsWithUndefinedValueType = [];
- var groupsWithUndefinedArgumentType = [];
- var argumentTypeGroup = groupsData.argumentOptions && axisTypeParser(groupsData.argumentOptions.argumentType);
- var groupsIndexes;
- groupsData.groups.forEach(function(group) {
- if (!group.series.length) {
- return
- }
- var valueTypeGroup = group.valueOptions && axisTypeParser(group.valueOptions.valueType);
- group.valueType = valueTypeGroup;
- groupsData.argumentType = argumentTypeGroup;
- !valueTypeGroup && groupsWithUndefinedValueType.push(group);
- !argumentTypeGroup && groupsWithUndefinedArgumentType.push(group)
- });
- if (groupsWithUndefinedValueType.length || groupsWithUndefinedArgumentType.length) {
- groupsIndexes = groupsWithUndefinedValueType.map(function(_, index) {
- return index
- });
- data.some(function(cell) {
- var defineArg;
- groupsWithUndefinedValueType.forEach(function(group, groupIndex) {
- if (checkValueTypeOfGroup(group, cell) && groupsIndexes.indexOf(groupIndex) >= 0) {
- groupsIndexes.splice(groupIndex, 1)
- }
- });
- if (!defineArg) {
- groupsWithUndefinedArgumentType.forEach(function(group) {
- defineArg = checkArgumentTypeOfGroup(group.series, cell, groupsData)
- })
- }
- if (!checkTypeForAllData && defineArg && 0 === groupsIndexes.length) {
- return true
- }
- })
- }
- }
- function checkAxisType(groupsData, incidentOccurred) {
- var argumentOptions = groupsData.argumentOptions || {};
- var userArgumentCategories = argumentOptions && argumentOptions.categories || [];
- var argumentAxisType = correctAxisType(groupsData.argumentType, argumentOptions.type, !!userArgumentCategories.length, incidentOccurred);
- groupsData.groups.forEach(function(group) {
- var valueOptions = group.valueOptions || {};
- var valueCategories = valueOptions.categories || [];
- var valueAxisType = correctAxisType(group.valueType, valueOptions.type, !!valueCategories.length, incidentOccurred);
- group.series.forEach(function(series) {
- var optionsSeries = {};
- optionsSeries.argumentAxisType = argumentAxisType;
- optionsSeries.valueAxisType = valueAxisType;
- groupsData.argumentAxisType = groupsData.argumentAxisType || optionsSeries.argumentAxisType;
- group.valueAxisType = group.valueAxisType || optionsSeries.valueAxisType;
- optionsSeries.argumentType = groupsData.argumentType;
- optionsSeries.valueType = group.valueType;
- optionsSeries.showZero = valueOptions.showZero;
- series.updateDataType(optionsSeries)
- });
- group.valueAxisType = group.valueAxisType || valueAxisType;
- if (group.valueAxis) {
- group.valueAxis.setTypes(group.valueAxisType, group.valueType, VALUE_TYPE);
- group.valueAxis.validate()
- }
- });
- groupsData.argumentAxisType = groupsData.argumentAxisType || argumentAxisType;
- if (groupsData.argumentAxes) {
- groupsData.argumentAxes.forEach(function(axis) {
- axis.setTypes(groupsData.argumentAxisType, groupsData.argumentType, ARGUMENT_TYPE);
- axis.validate()
- })
- }
- }
- function verifyData(source, incidentOccurred) {
- var data = [];
- var sourceIsDefined = _isDefined(source);
- var hasError = sourceIsDefined && !_isArray(source);
- var i;
- var ii;
- var k;
- var item;
- if (sourceIsDefined && !hasError) {
- for (i = 0, ii = source.length, k = 0; i < ii; ++i) {
- item = source[i];
- if (_isObject(item)) {
- data[k++] = item
- } else {
- if (item) {
- hasError = true
- }
- }
- }
- }
- if (hasError) {
- incidentOccurred("E2001")
- }
- return data
- }
- function validateData(data, groupsData, incidentOccurred, options) {
- data = verifyData(data, incidentOccurred);
- groupsData.argumentType = groupsData.argumentAxisType = null;
- processGroups(groupsData.groups);
- resetArgumentAxes(groupsData.argumentAxes);
- checkType(data, groupsData, options.checkTypeForAllData);
- checkAxisType(groupsData, incidentOccurred);
- if (options.convertToAxisDataType) {
- data = parse(data, prepareParsers(groupsData, incidentOccurred))
- }
- groupPieData(data, groupsData);
- var dataByArgumentFields = sortData(data, groupsData, options, getUniqueArgumentFields(groupsData));
- return dataByArgumentFields
- }
- exports.validateData = validateData
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/viz/components/parse_utils.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var dateSerialization = __webpack_require__( /*! ../../core/utils/date_serialization */ 52);
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var parsers = {
- string: function(val) {
- return isDefined(val) ? "" + val : val
- },
- numeric: function(val) {
- if (!isDefined(val)) {
- return val
- }
- var parsedVal = Number(val);
- if (isNaN(parsedVal)) {
- parsedVal = void 0
- }
- return parsedVal
- },
- datetime: function(val) {
- if (!isDefined(val)) {
- return val
- }
- var parsedVal;
- var numVal = Number(val);
- if (!isNaN(numVal)) {
- parsedVal = new Date(numVal)
- } else {
- parsedVal = dateSerialization.deserializeDate(val)
- }
- if (isNaN(Number(parsedVal))) {
- parsedVal = void 0
- }
- return parsedVal
- }
- };
- function correctValueType(type) {
- return "numeric" === type || "datetime" === type || "string" === type ? type : ""
- }
- module.exports = {
- correctValueType: correctValueType,
- getParser: function(valueType) {
- return parsers[correctValueType(valueType)] || noop
- }
- };
- module.exports.parsers = parsers
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/base_series.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var seriesNS = {};
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var pointModule = __webpack_require__( /*! ./points/base_point */ 767);
- var _isDefined = typeUtils.isDefined;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _isEmptyObject = typeUtils.isEmptyObject;
- var _normalizeEnum = vizUtils.normalizeEnum;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var states = __webpack_require__( /*! ../components/consts */ 117).states;
- var rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 247);
- var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106);
- var lineSeries = __webpack_require__( /*! ./line_series */ 203);
- var areaSeries = __webpack_require__( /*! ./area_series */ 165);
- var barSeries = __webpack_require__( /*! ./bar_series */ 143);
- var rangeSeries = __webpack_require__( /*! ./range_series */ 772);
- var bubbleSeries = __webpack_require__( /*! ./bubble_series */ 773);
- var pieSeries = __webpack_require__( /*! ./pie_series */ 774);
- var financialSeries = __webpack_require__( /*! ./financial_series */ 775);
- var stackedSeries = __webpack_require__( /*! ./stacked_series */ 776);
- var DISCRETE = "discrete";
- var SELECTED_STATE = states.selectedMark;
- var HOVER_STATE = states.hoverMark;
- var HOVER = states.hover;
- var NORMAL = states.normal;
- var SELECTION = states.selection;
- var APPLY_SELECTED = states.applySelected;
- var APPLY_HOVER = states.applyHover;
- var RESET_ITEM = states.resetItem;
- var NONE_MODE = "none";
- var INCLUDE_POINTS = "includepoints";
- var NEAREST_POINT = "nearestpoint";
- var SERIES_SELECTION_CHANGED = "seriesSelectionChanged";
- var POINT_SELECTION_CHANGED = "pointSelectionChanged";
- var SERIES_HOVER_CHANGED = "seriesHoverChanged";
- var POINT_HOVER_CHANGED = "pointHoverChanged";
- var ALL_SERIES_POINTS = "allseriespoints";
- var ALL_ARGUMENT_POINTS = "allargumentpoints";
- var POINT_HOVER = "pointHover";
- var CLEAR_POINT_HOVER = "clearPointHover";
- var SERIES_SELECT = "seriesSelect";
- var POINT_SELECT = "pointSelect";
- var POINT_DESELECT = "pointDeselect";
- var getEmptyBusinessRange = function() {
- return {
- arg: {},
- val: {}
- }
- };
- function triggerEvent(element, event, point) {
- element && element.trigger(event, point)
- }
- seriesNS.mixins = {
- chart: {},
- pie: {},
- polar: {}
- };
- seriesNS.mixins.chart.scatter = scatterSeries.chart;
- seriesNS.mixins.polar.scatter = scatterSeries.polar;
- _extend(seriesNS.mixins.pie, pieSeries);
- _extend(seriesNS.mixins.chart, lineSeries.chart, areaSeries.chart, barSeries.chart, rangeSeries.chart, bubbleSeries.chart, financialSeries, stackedSeries.chart);
- _extend(seriesNS.mixins.polar, lineSeries.polar, areaSeries.polar, barSeries.polar, rangeSeries.polar, bubbleSeries.polar, stackedSeries.polar);
- function includePointsMode(mode) {
- mode = _normalizeEnum(mode);
- return mode === INCLUDE_POINTS || mode === ALL_SERIES_POINTS
- }
- function getLabelOptions(labelOptions, defaultColor) {
- var opt = labelOptions || {};
- var labelFont = _extend({}, opt.font) || {};
- var labelBorder = opt.border || {};
- var labelConnector = opt.connector || {};
- var backgroundAttr = {
- fill: opt.backgroundColor || defaultColor,
- "stroke-width": labelBorder.visible ? labelBorder.width || 0 : 0,
- stroke: labelBorder.visible && labelBorder.width ? labelBorder.color : "none",
- dashStyle: labelBorder.dashStyle
- };
- var connectorAttr = {
- stroke: labelConnector.visible && labelConnector.width ? labelConnector.color || defaultColor : "none",
- "stroke-width": labelConnector.visible ? labelConnector.width || 0 : 0
- };
- labelFont.color = "none" === opt.backgroundColor && "#ffffff" === _normalizeEnum(labelFont.color) && "inside" !== opt.position ? defaultColor : labelFont.color;
- return {
- alignment: opt.alignment,
- format: opt.format,
- argumentFormat: opt.argumentFormat,
- customizeText: typeUtils.isFunction(opt.customizeText) ? opt.customizeText : void 0,
- attributes: {
- font: labelFont
- },
- visible: 0 !== labelFont.size ? opt.visible : false,
- showForZeroValues: opt.showForZeroValues,
- horizontalOffset: opt.horizontalOffset,
- verticalOffset: opt.verticalOffset,
- radialOffset: opt.radialOffset,
- background: backgroundAttr,
- position: opt.position,
- connector: connectorAttr,
- rotationAngle: opt.rotationAngle,
- wordWrap: opt.wordWrap,
- textOverflow: opt.textOverflow,
- cssClass: opt.cssClass
- }
- }
- function setPointHoverState(point, legendCallback) {
- point.fullState |= HOVER_STATE;
- point.applyView(legendCallback)
- }
- function releasePointHoverState(point, legendCallback) {
- point.fullState &= ~HOVER_STATE;
- point.applyView(legendCallback);
- point.releaseHoverState()
- }
- function setPointSelectedState(point, legendCallback) {
- point.fullState |= SELECTED_STATE;
- point.applyView(legendCallback)
- }
- function releasePointSelectedState(point, legendCallback) {
- point.fullState &= ~SELECTED_STATE;
- point.applyView(legendCallback)
- }
- function mergePointOptionsCore(base, extra) {
- var options = _extend({}, base, extra);
- options.border = _extend({}, base && base.border, extra && extra.border);
- return options
- }
- function mergePointOptions(base, extra) {
- var options = mergePointOptionsCore(base, extra);
- options.image = _extend(true, {}, base.image, extra.image);
- options.selectionStyle = mergePointOptionsCore(base.selectionStyle, extra.selectionStyle);
- options.hoverStyle = mergePointOptionsCore(base.hoverStyle, extra.hoverStyle);
- return options
- }
- function Series(settings, options) {
- var that = this;
- that.fullState = 0;
- that._extGroups = settings;
- that._renderer = settings.renderer;
- that._group = settings.renderer.g().attr({
- "class": "dxc-series"
- });
- that._eventTrigger = settings.eventTrigger;
- that._eventPipe = settings.eventPipe;
- that._incidentOccurred = settings.incidentOccurred;
- that._legendCallback = _noop;
- that.updateOptions(options, settings)
- }
- function getData(pointData) {
- return pointData.data
- }
- exports.Series = Series;
- exports.mixins = seriesNS.mixins;
- Series.prototype = {
- constructor: Series,
- _createLegendState: _noop,
- getLegendStyles: function() {
- return this._styles.legendStyles
- },
- _createStyles: function(options) {
- var that = this;
- var mainSeriesColor = options.mainSeriesColor;
- that._styles = {
- normal: that._parseStyle(options, mainSeriesColor, mainSeriesColor),
- hover: that._parseStyle(options.hoverStyle || {}, mainSeriesColor, mainSeriesColor),
- selection: that._parseStyle(options.selectionStyle || {}, mainSeriesColor, mainSeriesColor),
- legendStyles: {
- normal: that._createLegendState(options, mainSeriesColor),
- hover: that._createLegendState(options.hoverStyle || {}, mainSeriesColor),
- selection: that._createLegendState(options.selectionStyle || {}, mainSeriesColor)
- }
- }
- },
- setClippingParams: function(baseId, wideId, forceClipping) {
- this._paneClipRectID = baseId;
- this._widePaneClipRectID = wideId;
- this._forceClipping = forceClipping
- },
- applyClip: function() {
- this._group.attr({
- "clip-path": this._paneClipRectID
- })
- },
- resetClip: function() {
- this._group.attr({
- "clip-path": null
- })
- },
- getTagField: function() {
- return this._options.tagField || "tag"
- },
- getValueFields: _noop,
- getSizeField: _noop,
- getArgumentField: _noop,
- getPoints: function() {
- return this._points
- },
- getPointsInViewPort: function() {
- return rangeCalculator.getPointsInViewPort(this)
- },
- _createPoint: function(data, index, oldPoint) {
- data.index = index;
- var that = this;
- var pointsByArgument = that.pointsByArgument;
- var options = that._getCreatingPointOptions(data);
- var arg = data.argument.valueOf();
- var point = oldPoint;
- if (point) {
- point.update(data, options)
- } else {
- point = new pointModule.Point(that, data, options);
- if (that.isSelected() && includePointsMode(that.lastSelectionMode)) {
- point.setView(SELECTION)
- }
- }
- var pointByArgument = pointsByArgument[arg];
- if (pointByArgument) {
- pointByArgument.push(point)
- } else {
- pointsByArgument[arg] = [point]
- }
- if (point.hasValue()) {
- that.customizePoint(point, data)
- }
- return point
- },
- getRangeData: function() {
- return this._visible ? this._getRangeData() : getEmptyBusinessRange()
- },
- getArgumentRange: function() {
- return this._visible ? rangeCalculator.getArgumentRange(this) : getEmptyBusinessRange()
- },
- getViewport: function() {
- return rangeCalculator.getViewport(this)
- },
- _deleteGroup: function(groupName) {
- var group = this[groupName];
- if (group) {
- group.dispose();
- this[groupName] = null
- }
- },
- updateOptions: function(newOptions, settings) {
- var that = this;
- var widgetType = newOptions.widgetType;
- var oldType = that.type;
- var newType = newOptions.type;
- that.type = newType && _normalizeEnum(newType.toString());
- if (!that._checkType(widgetType) || that._checkPolarBarType(widgetType, newOptions)) {
- that.dispose();
- that.isUpdated = false;
- return
- }
- if (oldType !== that.type) {
- that._firstDrawing = true;
- that._resetType(oldType, widgetType);
- that._setType(that.type, widgetType)
- } else {
- that._defineDrawingState()
- }
- that._options = newOptions;
- that._pointOptions = null;
- that.name = newOptions.name;
- that.pane = newOptions.pane;
- that.tag = newOptions.tag;
- if (settings) {
- that._seriesModes = settings.commonSeriesModes || that._seriesModes;
- that._valueAxis = settings.valueAxis || that._valueAxis;
- that.axis = that._valueAxis && that._valueAxis.name;
- that._argumentAxis = settings.argumentAxis || that._argumentAxis
- }
- that._createStyles(newOptions);
- that._stackName = null;
- that._updateOptions(newOptions);
- that._visible = newOptions.visible;
- that.isUpdated = true;
- that.stack = newOptions.stack;
- that.barOverlapGroup = newOptions.barOverlapGroup;
- that._createGroups();
- that._processEmptyValue = newOptions.ignoreEmptyPoints ? function(x) {
- return null === x ? void 0 : x
- } : function(x) {
- return x
- }
- },
- _defineDrawingState: function() {
- this._firstDrawing = true
- },
- _disposePoints: function(points) {
- _each(points || [], function(_, p) {
- p.dispose()
- })
- },
- updateDataType: function(settings) {
- var that = this;
- that.argumentType = settings.argumentType;
- that.valueType = settings.valueType;
- that.argumentAxisType = settings.argumentAxisType;
- that.valueAxisType = settings.valueAxisType;
- that.showZero = settings.showZero;
- return that
- },
- getOptions: function() {
- return this._options
- },
- _getOldPoint: function(data, oldPointsByArgument, index) {
- var arg = data.argument && data.argument.valueOf();
- var point = (oldPointsByArgument[arg] || [])[0];
- if (point) {
- oldPointsByArgument[arg].splice(0, 1)
- }
- return point
- },
- updateData: function(data) {
- var that = this;
- var options = that._options;
- var nameField = options.nameField;
- data = data || [];
- if (data.length) {
- that._canRenderCompleteHandle = true
- }
- var dataSelector = this._getPointDataSelector();
- var itemsWithoutArgument = 0;
- that._data = data.reduce(function(data, dataItem, index) {
- var pointDataItem = dataSelector(dataItem);
- if (_isDefined(pointDataItem.argument)) {
- if (!nameField || dataItem[nameField] === options.nameFieldValue) {
- pointDataItem.index = index;
- data.push(pointDataItem)
- }
- } else {
- itemsWithoutArgument++
- }
- return data
- }, []);
- if (itemsWithoutArgument && itemsWithoutArgument === data.length) {
- that._incidentOccurred("W2002", [that.name, that.getArgumentField()])
- }
- that._endUpdateData()
- },
- _getData: function() {
- var data = this._data || [];
- if (this.useAggregation()) {
- data = this._resample(this.getArgumentAxis().getAggregationInfo(this._useAllAggregatedPoints, this.argumentAxisType !== DISCRETE ? this.getArgumentRange() : {}), data)
- }
- return data
- },
- useAggregation: function() {
- var aggregation = this.getOptions().aggregation;
- return aggregation && aggregation.enabled
- },
- autoHidePointMarkersEnabled: _noop,
- usePointsToDefineAutoHiding: _noop,
- createPoints: function(useAllAggregatedPoints) {
- this._normalizeUsingAllAggregatedPoints(useAllAggregatedPoints);
- this._createPoints()
- },
- _normalizeUsingAllAggregatedPoints: function(useAllAggregatedPoints) {
- this._useAllAggregatedPoints = this.useAggregation() && (this.argumentAxisType === DISCRETE || (this._data || []).length > 1 && !!useAllAggregatedPoints)
- },
- _createPoints: function() {
- var that = this;
- var oldPointsByArgument = that.pointsByArgument || {};
- var data = that._getData();
- that.pointsByArgument = {};
- that._calculateErrorBars(data);
- var skippedFields = {};
- var points = data.reduce(function(points, pointDataItem) {
- if (that._checkData(pointDataItem, skippedFields)) {
- var pointIndex = points.length;
- var oldPoint = that._getOldPoint(pointDataItem, oldPointsByArgument, pointIndex);
- var point = that._createPoint(pointDataItem, pointIndex, oldPoint);
- points.push(point)
- }
- return points
- }, []);
- for (var field in skippedFields) {
- if (skippedFields[field] === data.length) {
- that._incidentOccurred("W2002", [that.name, field])
- }
- }
- Object.keys(oldPointsByArgument).forEach(function(key) {
- return that._disposePoints(oldPointsByArgument[key])
- });
- that._points = points
- },
- _removeOldSegments: function() {
- var that = this;
- var startIndex = that._segments.length;
- _each(that._graphics.splice(startIndex, that._graphics.length) || [], function(_, elem) {
- that._removeElement(elem)
- });
- if (that._trackers) {
- _each(that._trackers.splice(startIndex, that._trackers.length) || [], function(_, elem) {
- elem.remove()
- })
- }
- },
- _drawElements: function(animationEnabled, firstDrawing, translateAllPoints) {
- var that = this;
- var points = that._points || [];
- var closeSegment = points[0] && points[0].hasValue() && that._options.closed;
- var groupForPoint = {
- markers: that._markersGroup,
- errorBars: that._errorBarGroup
- };
- that._drawnPoints = [];
- that._graphics = that._graphics || [];
- that._segments = [];
- var segments = points.reduce(function(segments, p) {
- var segment = segments[segments.length - 1];
- if (!p.translated || translateAllPoints) {
- p.translate();
- !translateAllPoints && p.setDefaultCoords()
- }
- if (p.hasValue() && p.hasCoords()) {
- translateAllPoints && that._drawPoint({
- point: p,
- groups: groupForPoint,
- hasAnimation: animationEnabled,
- firstDrawing: firstDrawing
- });
- segment.push(p)
- } else {
- if (!p.hasValue()) {
- segment.length && segments.push([])
- } else {
- p.setInvisibility()
- }
- }
- return segments
- }, [
- []
- ]);
- segments.forEach(function(segment, index) {
- if (segment.length) {
- that._drawSegment(segment, animationEnabled, index, closeSegment && index === this.length - 1)
- }
- }, segments);
- that._firstDrawing = points.length ? false : true;
- that._removeOldSegments();
- animationEnabled && that._animate(firstDrawing)
- },
- draw: function(animationEnabled, hideLayoutLabels, legendCallback) {
- var that = this;
- var firstDrawing = that._firstDrawing;
- that._legendCallback = legendCallback || that._legendCallback;
- if (!that._visible) {
- animationEnabled = false;
- that._group.remove();
- return
- }
- that._appendInGroup();
- that._applyVisibleArea();
- that._setGroupsSettings(animationEnabled, firstDrawing);
- !firstDrawing && that._drawElements(false, firstDrawing, false);
- that._drawElements(animationEnabled, firstDrawing, true);
- hideLayoutLabels && that.hideLabels();
- if (that.isSelected()) {
- that._changeStyle(that.lastSelectionMode, void 0, true)
- } else {
- if (that.isHovered()) {
- that._changeStyle(that.lastHoverMode, void 0, true)
- }
- }
- },
- _setLabelGroupSettings: function(animationEnabled) {
- var settings = {
- "class": "dxc-labels",
- "pointer-events": "none"
- };
- this._applyElementsClipRect(settings);
- this._applyClearingSettings(settings);
- animationEnabled && (settings.opacity = .001);
- this._labelsGroup.attr(settings).append(this._extGroups.labelsGroup)
- },
- _checkType: function(widgetType) {
- return !!seriesNS.mixins[widgetType][this.type]
- },
- _checkPolarBarType: function(widgetType, options) {
- return "polar" === widgetType && options.spiderWidget && this.type.indexOf("bar") !== -1
- },
- _resetType: function(seriesType, widgetType) {
- var methodName;
- var methods;
- if (seriesType) {
- methods = seriesNS.mixins[widgetType][seriesType];
- for (methodName in methods) {
- delete this[methodName]
- }
- }
- },
- _setType: function(seriesType, widgetType) {
- var methodName;
- var methods = seriesNS.mixins[widgetType][seriesType];
- for (methodName in methods) {
- this[methodName] = methods[methodName]
- }
- },
- _setPointsView: function(view, target) {
- this.getPoints().forEach(function(point) {
- if (target !== point) {
- point.setView(view)
- }
- })
- },
- _resetPointsView: function(view, target) {
- this.getPoints().forEach(function(point) {
- if (target !== point) {
- point.resetView(view)
- }
- })
- },
- _resetNearestPoint: function() {
- var that = this;
- that._nearestPoint && null !== that._nearestPoint.series && that._nearestPoint.resetView(HOVER);
- that._nearestPoint = null
- },
- _setSelectedState: function(mode) {
- var that = this;
- that.lastSelectionMode = _normalizeEnum(mode || that._options.selectionMode);
- that.fullState = that.fullState | SELECTED_STATE;
- that._resetNearestPoint();
- that._changeStyle(that.lastSelectionMode);
- if (that.lastSelectionMode !== NONE_MODE && that.isHovered() && includePointsMode(that.lastHoverMode)) {
- that._resetPointsView(HOVER)
- }
- },
- _releaseSelectedState: function() {
- var that = this;
- that.fullState = that.fullState & ~SELECTED_STATE;
- that._changeStyle(that.lastSelectionMode, SELECTION);
- if (that.lastSelectionMode !== NONE_MODE && that.isHovered() && includePointsMode(that.lastHoverMode)) {
- that._setPointsView(HOVER)
- }
- },
- isFullStackedSeries: function() {
- return 0 === this.type.indexOf("fullstacked")
- },
- isStackedSeries: function() {
- return 0 === this.type.indexOf("stacked")
- },
- isFinancialSeries: function() {
- return "stock" === this.type || "candlestick" === this.type
- },
- _canChangeView: function() {
- return !this.isSelected() && _normalizeEnum(this._options.hoverMode) !== NONE_MODE
- },
- _changeStyle: function(mode, resetView, skipPoints) {
- var that = this;
- var state = that.fullState;
- var styles = [NORMAL, HOVER, SELECTION, SELECTION];
- if ("none" === that.lastHoverMode) {
- state &= ~HOVER_STATE
- }
- if ("none" === that.lastSelectionMode) {
- state &= ~SELECTED_STATE
- }
- if (includePointsMode(mode) && !skipPoints) {
- if (!resetView) {
- that._setPointsView(styles[state])
- } else {
- that._resetPointsView(resetView)
- }
- }
- that._legendCallback([RESET_ITEM, APPLY_HOVER, APPLY_SELECTED, APPLY_SELECTED][state]);
- that._applyStyle(that._styles[styles[state]])
- },
- updateHover: function(x, y) {
- var that = this;
- var currentNearestPoint = that._nearestPoint;
- var point = that.isHovered() && that.lastHoverMode === NEAREST_POINT && that.getNeighborPoint(x, y);
- if (point !== currentNearestPoint && !(that.isSelected() && that.lastSelectionMode !== NONE_MODE)) {
- that._resetNearestPoint();
- if (point) {
- point.setView(HOVER);
- that._nearestPoint = point
- }
- }
- },
- _getMainAxisName: function() {
- return this._options.rotated ? "X" : "Y"
- },
- areLabelsVisible: function() {
- return !_isDefined(this._options.maxLabelCount) || this._points.length <= this._options.maxLabelCount
- },
- getLabelVisibility: function() {
- return this.areLabelsVisible() && this._options.label && this._options.label.visible
- },
- customizePoint: function customizePoint(point, pointData) {
- var that = this;
- var options = that._options;
- var customizePoint = options.customizePoint;
- var customizeObject;
- var pointOptions;
- var customLabelOptions;
- var customOptions;
- var customizeLabel = options.customizeLabel;
- var useLabelCustomOptions;
- var usePointCustomOptions;
- if (customizeLabel && customizeLabel.call) {
- customizeObject = _extend({
- seriesName: that.name
- }, pointData);
- customizeObject.series = that;
- customLabelOptions = customizeLabel.call(customizeObject, customizeObject);
- useLabelCustomOptions = customLabelOptions && !_isEmptyObject(customLabelOptions);
- customLabelOptions = useLabelCustomOptions ? _extend(true, {}, options.label, customLabelOptions) : null
- }
- if (customizePoint && customizePoint.call) {
- customizeObject = customizeObject || _extend({
- seriesName: that.name
- }, pointData);
- customizeObject.series = that;
- customOptions = customizePoint.call(customizeObject, customizeObject);
- usePointCustomOptions = customOptions && !_isEmptyObject(customOptions)
- }
- if (useLabelCustomOptions || usePointCustomOptions) {
- pointOptions = that._parsePointOptions(that._preparePointOptions(customOptions), customLabelOptions || options.label, pointData, point);
- pointOptions.styles.useLabelCustomOptions = useLabelCustomOptions;
- pointOptions.styles.usePointCustomOptions = usePointCustomOptions;
- point.updateOptions(pointOptions)
- }
- },
- show: function() {
- if (!this._visible) {
- this._changeVisibility(true)
- }
- },
- hide: function() {
- if (this._visible) {
- this._changeVisibility(false)
- }
- },
- _changeVisibility: function(visibility) {
- var that = this;
- that._visible = that._options.visible = visibility;
- that._updatePointsVisibility();
- that.hidePointTooltip();
- that._options.visibilityChanged(that)
- },
- _updatePointsVisibility: _noop,
- hideLabels: function() {
- _each(this._points, function(_, point) {
- point._label.draw(false)
- })
- },
- _parsePointOptions: function(pointOptions, labelOptions, data, point) {
- var that = this;
- var options = that._options;
- var styles = that._createPointStyles(pointOptions, data, point);
- var parsedOptions = _extend({}, pointOptions, {
- type: options.type,
- rotated: options.rotated,
- styles: styles,
- widgetType: options.widgetType,
- visibilityChanged: options.visibilityChanged
- });
- parsedOptions.label = getLabelOptions(labelOptions, styles.normal.fill);
- if (that.areErrorBarsVisible()) {
- parsedOptions.errorBars = options.valueErrorBar
- }
- return parsedOptions
- },
- _preparePointOptions: function(customOptions) {
- var pointOptions = this._getOptionsForPoint();
- return customOptions ? mergePointOptions(pointOptions, customOptions) : pointOptions
- },
- _getMarkerGroupOptions: function() {
- return _extend(false, {}, this._getOptionsForPoint(), {
- hoverStyle: {},
- selectionStyle: {}
- })
- },
- _getAggregationMethod: function(isDiscrete) {
- var options = this.getOptions().aggregation;
- var method = _normalizeEnum(options.method);
- var customAggregator = "custom" === method && options.calculate;
- var aggregator;
- if (isDiscrete) {
- aggregator = function(_ref) {
- var data = _ref.data;
- return data[0]
- }
- } else {
- aggregator = this._aggregators[method] || this._aggregators[this._defaultAggregator]
- }
- return customAggregator || aggregator
- },
- _resample: function(_ref2, data) {
- var interval = _ref2.interval,
- ticks = _ref2.ticks;
- var that = this;
- var isDiscrete = that.argumentAxisType === DISCRETE || that.valueAxisType === DISCRETE;
- var dataIndex = 0;
- var dataSelector = this._getPointDataSelector();
- var options = that.getOptions();
- var addAggregatedData = function(target, data, aggregationInfo) {
- if (!data) {
- return
- }
- var processData = function(d) {
- var pointData = d && dataSelector(d, options);
- if (pointData && that._checkData(pointData)) {
- pointData.aggregationInfo = aggregationInfo;
- target.push(pointData)
- }
- };
- if (data.length) {
- data.forEach(processData)
- } else {
- processData(data)
- }
- };
- var aggregationMethod = this._getAggregationMethod(isDiscrete);
- if (isDiscrete) {
- return data.reduce(function(result, dataItem, index, data) {
- result[1].push(dataItem);
- if (index === data.length - 1 || (index + 1) % interval === 0) {
- var dataInInterval = result[1];
- var aggregationInfo = {
- aggregationInterval: interval,
- data: dataInInterval.map(getData)
- };
- addAggregatedData(result[0], aggregationMethod(aggregationInfo, that));
- result[1] = []
- }
- return result
- }, [
- [],
- []
- ])[0]
- }
- var aggregatedData = [];
- for (var i = 1; i < ticks.length; i++) {
- var intervalEnd = ticks[i];
- var intervalStart = ticks[i - 1];
- var dataInInterval = [];
- while (data[dataIndex] && data[dataIndex].argument < intervalEnd) {
- if (data[dataIndex].argument >= intervalStart) {
- dataInInterval.push(data[dataIndex])
- }
- dataIndex++
- }
- var aggregationInfo = {
- intervalStart: intervalStart,
- intervalEnd: intervalEnd,
- aggregationInterval: interval,
- data: dataInInterval.map(getData)
- };
- addAggregatedData(aggregatedData, aggregationMethod(aggregationInfo, that), aggregationInfo)
- }
- that._endUpdateData();
- return aggregatedData
- },
- canRenderCompleteHandle: function() {
- var result = this._canRenderCompleteHandle;
- delete this._canRenderCompleteHandle;
- return !!result
- },
- isHovered: function() {
- return !!(1 & this.fullState)
- },
- isSelected: function() {
- return !!(2 & this.fullState)
- },
- isVisible: function() {
- return this._visible
- },
- getAllPoints: function() {
- this._createAllAggregatedPoints();
- return (this._points || []).slice()
- },
- getPointByPos: function(pos) {
- this._createAllAggregatedPoints();
- return (this._points || [])[pos]
- },
- getVisiblePoints: function() {
- return (this._drawnPoints || []).slice()
- },
- selectPoint: function(point) {
- if (!point.isSelected()) {
- setPointSelectedState(point, this._legendCallback);
- this._eventPipe({
- action: POINT_SELECT,
- target: point
- });
- this._eventTrigger(POINT_SELECTION_CHANGED, {
- target: point
- })
- }
- },
- deselectPoint: function(point) {
- if (point.isSelected()) {
- releasePointSelectedState(point, this._legendCallback);
- this._eventPipe({
- action: POINT_DESELECT,
- target: point
- });
- this._eventTrigger(POINT_SELECTION_CHANGED, {
- target: point
- })
- }
- },
- hover: function(mode) {
- var that = this;
- var eventTrigger = that._eventTrigger;
- if (that.isHovered()) {
- return
- }
- that.lastHoverMode = _normalizeEnum(mode || that._options.hoverMode);
- that.fullState = that.fullState | HOVER_STATE;
- that._changeStyle(that.lastHoverMode, void 0, that.isSelected() && that.lastSelectionMode !== NONE_MODE);
- eventTrigger(SERIES_HOVER_CHANGED, {
- target: that
- })
- },
- clearHover: function() {
- var that = this;
- var eventTrigger = that._eventTrigger;
- if (!that.isHovered()) {
- return
- }
- that._resetNearestPoint();
- that.fullState = that.fullState & ~HOVER_STATE;
- that._changeStyle(that.lastHoverMode, HOVER, that.isSelected() && that.lastSelectionMode !== NONE_MODE);
- eventTrigger(SERIES_HOVER_CHANGED, {
- target: that
- })
- },
- hoverPoint: function(point) {
- var that = this;
- if (!point.isHovered()) {
- point.clearHover();
- setPointHoverState(point, that._legendCallback);
- that._canChangeView() && that._applyStyle(that._styles.hover);
- that._eventPipe({
- action: POINT_HOVER,
- target: point
- });
- that._eventTrigger(POINT_HOVER_CHANGED, {
- target: point
- })
- }
- },
- clearPointHover: function() {
- var that = this;
- that.getPoints().some(function(currentPoint) {
- if (currentPoint.isHovered()) {
- releasePointHoverState(currentPoint, that._legendCallback);
- that._canChangeView() && that._applyStyle(that._styles.normal);
- that._eventPipe({
- action: CLEAR_POINT_HOVER,
- target: currentPoint
- });
- that._eventTrigger(POINT_HOVER_CHANGED, {
- target: currentPoint
- });
- return true
- }
- return false
- })
- },
- showPointTooltip: function(point) {
- triggerEvent(this._extGroups.seriesGroup, "showpointtooltip", point)
- },
- hidePointTooltip: function(point) {
- triggerEvent(this._extGroups.seriesGroup, "hidepointtooltip", point)
- },
- select: function() {
- var that = this;
- if (!that.isSelected()) {
- that._setSelectedState(that._options.selectionMode);
- that._eventPipe({
- action: SERIES_SELECT,
- target: that
- });
- that._group.toForeground();
- that._eventTrigger(SERIES_SELECTION_CHANGED, {
- target: that
- })
- }
- },
- clearSelection: function() {
- var that = this;
- if (that.isSelected()) {
- that._releaseSelectedState();
- that._eventTrigger(SERIES_SELECTION_CHANGED, {
- target: that
- })
- }
- },
- getPointsByArg: function(arg, skipPointsCreation) {
- var that = this;
- var argValue = arg.valueOf();
- var points = that.pointsByArgument[argValue];
- if (!points && !skipPointsCreation && that._createAllAggregatedPoints()) {
- points = that.pointsByArgument[argValue]
- }
- return points || []
- },
- _createAllAggregatedPoints: function() {
- if (this.useAggregation() && !this._useAllAggregatedPoints) {
- this.createPoints(true);
- return true
- }
- return false
- },
- getPointsByKeys: function(arg) {
- return this.getPointsByArg(arg)
- },
- notify: function(data) {
- var that = this;
- var action = data.action;
- var seriesModes = that._seriesModes;
- var target = data.target;
- var targetOptions = target.getOptions();
- var pointHoverMode = _normalizeEnum(targetOptions.hoverMode);
- var selectionModeOfPoint = _normalizeEnum(targetOptions.selectionMode);
- if (action === POINT_HOVER) {
- that._hoverPointHandler(target, pointHoverMode, data.notifyLegend)
- } else {
- if (action === CLEAR_POINT_HOVER) {
- that._clearPointHoverHandler(target, pointHoverMode, data.notifyLegend)
- } else {
- if (action === SERIES_SELECT) {
- target !== that && "single" === seriesModes.seriesSelectionMode && that.clearSelection()
- } else {
- if (action === POINT_SELECT) {
- if ("single" === seriesModes.pointSelectionMode) {
- that.getPoints().some(function(currentPoint) {
- if (currentPoint !== target && currentPoint.isSelected()) {
- that.deselectPoint(currentPoint);
- return true
- }
- return false
- })
- }
- that._selectPointHandler(target, selectionModeOfPoint)
- } else {
- if (action === POINT_DESELECT) {
- that._deselectPointHandler(target, selectionModeOfPoint)
- }
- }
- }
- }
- }
- },
- _selectPointHandler: function(target, mode) {
- var that = this;
- if (mode === ALL_SERIES_POINTS) {
- target.series === that && that._setPointsView(SELECTION, target)
- } else {
- if (mode === ALL_ARGUMENT_POINTS) {
- that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
- currentPoint !== target && currentPoint.setView(SELECTION)
- })
- }
- }
- },
- _deselectPointHandler: function(target, mode) {
- if (mode === ALL_SERIES_POINTS) {
- target.series === this && this._resetPointsView(SELECTION, target)
- } else {
- if (mode === ALL_ARGUMENT_POINTS) {
- this.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
- currentPoint !== target && currentPoint.resetView(SELECTION)
- })
- }
- }
- },
- _hoverPointHandler: function(target, mode, notifyLegend) {
- var that = this;
- if (target.series !== that && mode === ALL_ARGUMENT_POINTS) {
- that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
- currentPoint.setView(HOVER)
- });
- notifyLegend && that._legendCallback(target)
- } else {
- if (mode === ALL_SERIES_POINTS && target.series === that) {
- that._setPointsView(HOVER, target)
- }
- }
- },
- _clearPointHoverHandler: function(target, mode, notifyLegend) {
- var that = this;
- if (mode === ALL_ARGUMENT_POINTS) {
- target.series !== that && that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
- currentPoint.resetView(HOVER)
- });
- notifyLegend && that._legendCallback(target)
- } else {
- if (mode === ALL_SERIES_POINTS && target.series === that) {
- that._resetPointsView(HOVER, target)
- }
- }
- },
- _deletePoints: function() {
- var that = this;
- that._disposePoints(that._points);
- that._points = that._drawnPoints = null
- },
- _deleteTrackers: function() {
- var that = this;
- _each(that._trackers || [], function(_, tracker) {
- tracker.remove()
- });
- that._trackersGroup && that._trackersGroup.dispose();
- that._trackers = that._trackersGroup = null
- },
- dispose: function() {
- var that = this;
- that._deletePoints();
- that._group.dispose();
- that._labelsGroup && that._labelsGroup.dispose();
- that._errorBarGroup && that._errorBarGroup.dispose();
- that._deleteTrackers();
- that._group = that._extGroups = that._markersGroup = that._elementsGroup = that._bordersGroup = that._labelsGroup = that._errorBarGroup = that._graphics = that._rangeData = that._renderer = that._styles = that._options = that._pointOptions = that._drawnPoints = that.pointsByArgument = that._segments = that._prevSeries = null
- },
- correctPosition: _noop,
- drawTrackers: _noop,
- getNeighborPoint: _noop,
- areErrorBarsVisible: _noop,
- getMarginOptions: function() {
- return this._patchMarginOptions({
- percentStick: this.isFullStackedSeries()
- })
- },
- getColor: function() {
- return this.getLegendStyles().normal.fill
- },
- getOpacity: function() {
- return this._options.opacity
- },
- getStackName: function() {
- return this._stackName
- },
- getBarOverlapGroup: function() {
- return this._options.barOverlapGroup
- },
- getPointByCoord: function(x, y) {
- var point = this.getNeighborPoint(x, y);
- return point && point.coordsIn(x, y) ? point : null
- },
- getValueAxis: function() {
- return this._valueAxis
- },
- getArgumentAxis: function() {
- return this._argumentAxis
- },
- getMarkersGroup: function() {
- return this._markersGroup
- },
- getRenderer: function() {
- return this._renderer
- }
- }
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/label.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _format_helper = __webpack_require__( /*! ../../../format_helper */ 64);
- var _utils = __webpack_require__( /*! ../../core/utils */ 10);
- var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 3);
- var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0);
- var _math = Math;
- var _round = _math.round;
- var _floor = _math.floor;
- var _abs = _math.abs;
- var CONNECTOR_LENGTH = 12;
- var LABEL_BACKGROUND_PADDING_X = 8;
- var LABEL_BACKGROUND_PADDING_Y = 4;
- function getClosestCoord(point, coords) {
- var closestDistance = 1 / 0;
- var closestCoord;
- (0, _iterator.each)(coords, function(_, coord) {
- var x = point[0] - coord[0];
- var y = point[1] - coord[1];
- var distance = x * x + y * y;
- if (distance < closestDistance) {
- closestDistance = distance;
- closestCoord = coord
- }
- });
- return [_floor(closestCoord[0]), _floor(closestCoord[1])]
- }
- function getCrossCoord(rect, coord, indexOffset) {
- return (coord - rect[0 + indexOffset]) / (rect[2 + indexOffset] - rect[0 + indexOffset]) * (rect[3 - indexOffset] - rect[1 - indexOffset]) + rect[1 - indexOffset]
- }
- var barPointStrategy = {
- isLabelInside: function(labelPoint, figure) {
- var xc = labelPoint.x + labelPoint.width / 2;
- var yc = labelPoint.y + labelPoint.height / 2;
- return figure.x <= xc && xc <= figure.x + figure.width && figure.y <= yc && yc <= figure.y + figure.height
- },
- prepareLabelPoints: function(bBox, rotatedBBox, isHorizontal, angle, figureCenter) {
- var x1 = rotatedBBox.x;
- var xc = x1 + rotatedBBox.width / 2;
- var x2 = x1 + rotatedBBox.width - 1;
- var y1 = rotatedBBox.y;
- var yc = y1 + rotatedBBox.height / 2;
- var y2 = y1 + rotatedBBox.height - 1;
- var labelPoints;
- var isRectangular = _abs(angle) % 90 === 0;
- if (figureCenter[0] > x1 && figureCenter[0] < x2) {
- if (isRectangular) {
- labelPoints = [
- [figureCenter[0], _abs(figureCenter[1] - y1) < _abs(figureCenter[1] - y2) ? y1 : y2]
- ]
- } else {
- labelPoints = [
- [figureCenter[0], getCrossCoord([x1, y1, x2, y2], figureCenter[0], 0)]
- ]
- }
- } else {
- if (figureCenter[1] > y1 && figureCenter[1] < y2) {
- if (isRectangular) {
- labelPoints = [
- [_abs(figureCenter[0] - x1) < _abs(figureCenter[0] - x2) ? x1 : x2, figureCenter[1]]
- ]
- } else {
- labelPoints = [
- [getCrossCoord([x1, y1, x2, y2], figureCenter[1], 1), figureCenter[1]]
- ]
- }
- } else {
- if (isRectangular) {
- labelPoints = [
- [x1, y1],
- [isHorizontal ? x1 : xc, isHorizontal ? yc : y1],
- [x2, y1],
- [x1, y2],
- [isHorizontal ? x2 : xc, isHorizontal ? yc : y2],
- [x2, y2]
- ]
- } else {
- labelPoints = [
- [xc, yc]
- ]
- }
- }
- }
- return labelPoints
- },
- isHorizontal: function(bBox, figure) {
- return bBox.x > figure.x + figure.width || bBox.x + bBox.width < figure.x
- },
- getFigureCenter: function(figure) {
- return [_floor(figure.x + figure.width / 2), _floor(figure.y + figure.height / 2)]
- },
- findFigurePoint: function(figure, labelPoint) {
- var figureCenter = barPointStrategy.getFigureCenter(figure);
- var point = getClosestCoord(labelPoint, [
- [figure.x, figureCenter[1]],
- [figureCenter[0], figure.y + figure.height],
- [figure.x + figure.width, figureCenter[1]],
- [figureCenter[0], figure.y]
- ]);
- return point
- },
- adjustPoints: function(points) {
- var lineIsVertical = _abs(points[1] - points[3]) <= 1;
- var lineIsHorizontal = _abs(points[0] - points[2]) <= 1;
- if (lineIsHorizontal) {
- points[0] = points[2]
- }
- if (lineIsVertical) {
- points[1] = points[3]
- }
- return points
- }
- };
- var symbolPointStrategy = {
- isLabelInside: function() {
- return false
- },
- prepareLabelPoints: barPointStrategy.prepareLabelPoints,
- isHorizontal: function(bBox, figure) {
- return bBox.x > figure.x + figure.r || bBox.x + bBox.width < figure.x - figure.r
- },
- getFigureCenter: function(figure) {
- return [figure.x, figure.y]
- },
- findFigurePoint: function(figure, labelPoint) {
- var angle = Math.atan2(figure.y - labelPoint[1], labelPoint[0] - figure.x);
- return [_round(figure.x + figure.r * Math.cos(angle)), _round(figure.y - figure.r * Math.sin(angle))]
- },
- adjustPoints: barPointStrategy.adjustPoints
- };
- var piePointStrategy = {
- isLabelInside: function(_0, _1, isOutside) {
- return !isOutside
- },
- prepareLabelPoints: function(bBox, rotatedBBox, isHorizontal, angle) {
- var xl = bBox.x;
- var xr = xl + bBox.width;
- var xc = xl + _round(bBox.width / 2);
- var yt = bBox.y;
- var yb = yt + bBox.height;
- var yc = yt + _round(bBox.height / 2);
- var points = [
- [
- [xl, yt],
- [xr, yt]
- ],
- [
- [xr, yt],
- [xr, yb]
- ],
- [
- [xr, yb],
- [xl, yb]
- ],
- [
- [xl, yb],
- [xl, yt]
- ]
- ];
- var cosSin = (0, _utils.getCosAndSin)(angle);
- if (0 === angle) {
- points = isHorizontal ? [
- [xl, yc],
- [xr, yc]
- ] : [
- [xc, yt],
- [xc, yb]
- ]
- } else {
- points = points.map(function(pair) {
- return pair.map(function(point) {
- return [_round((point[0] - xc) * cosSin.cos + (point[1] - yc) * cosSin.sin + xc), _round(-(point[0] - xc) * cosSin.sin + (point[1] - yc) * cosSin.cos + yc)]
- })
- }).reduce(function(r, pair) {
- var point1x = pair[0][0];
- var point1y = pair[0][1];
- var point2x = pair[1][0];
- var point2y = pair[1][1];
- if (isHorizontal) {
- if (point1y >= yc && yc >= point2y || point1y <= yc && yc <= point2y) {
- r.push([(yc - point1y) * (point2x - point1x) / (point2y - point1y) + point1x, yc])
- }
- } else {
- if (point1x >= xc && xc >= point2x || point1x <= xc && xc <= point2x) {
- r.push([xc, (xc - point1x) * (point2y - point1y) / (point2x - point1x) + point1y])
- }
- }
- return r
- }, [])
- }
- return points
- },
- isHorizontal: function(bBox, figure) {
- return bBox.x > figure.x || figure.x > bBox.x + bBox.width
- },
- getFigureCenter: symbolPointStrategy.getFigureCenter,
- findFigurePoint: function(figure, labelPoint, isHorizontal) {
- if (!isHorizontal) {
- return [figure.x, figure.y]
- }
- var labelX = labelPoint[0];
- var x = _round(figure.x + (figure.y - labelPoint[1]) / Math.tan((0, _utils.degreesToRadians)(figure.angle)));
- var points = [figure.x, figure.y, x, labelPoint[1]];
- if (!(figure.x <= x && x <= labelX) && !(labelX <= x && x <= figure.x)) {
- if (_abs(figure.x - labelX) < CONNECTOR_LENGTH) {
- points = [figure.x, figure.y]
- } else {
- if (figure.x <= labelX) {
- points[2] = figure.x + CONNECTOR_LENGTH
- } else {
- points[2] = figure.x - CONNECTOR_LENGTH
- }
- }
- }
- return points
- },
- adjustPoints: function(points) {
- return points
- }
- };
- function selectStrategy(figure) {
- return void 0 !== figure.angle && piePointStrategy || void 0 !== figure.r && symbolPointStrategy || barPointStrategy
- }
- function disposeItem(obj, field) {
- obj[field] && obj[field].dispose();
- obj[field] = null
- }
- function checkBackground(background) {
- return background && (background.fill && "none" !== background.fill || background["stroke-width"] > 0 && background.stroke && "none" !== background.stroke)
- }
- function checkConnector(connector) {
- return connector && connector["stroke-width"] > 0 && connector.stroke && "none" !== connector.stroke
- }
- function formatText(data, options) {
- var format = options.format;
- data.valueText = (0, _format_helper.format)(data.value, format);
- data.argumentText = (0, _format_helper.format)(data.argument, options.argumentFormat);
- if (void 0 !== data.percent) {
- data.percentText = (0, _format_helper.format)(data.percent, {
- type: "percent",
- precision: format && format.percentPrecision
- })
- }
- if (void 0 !== data.total) {
- data.totalText = (0, _format_helper.format)(data.total, format)
- }
- if (void 0 !== data.openValue) {
- data.openValueText = (0, _format_helper.format)(data.openValue, format)
- }
- if (void 0 !== data.closeValue) {
- data.closeValueText = (0, _format_helper.format)(data.closeValue, format)
- }
- if (void 0 !== data.lowValue) {
- data.lowValueText = (0, _format_helper.format)(data.lowValue, format)
- }
- if (void 0 !== data.highValue) {
- data.highValueText = (0, _format_helper.format)(data.highValue, format)
- }
- if (void 0 !== data.reductionValue) {
- data.reductionValueText = (0, _format_helper.format)(data.reductionValue, format)
- }
- return options.customizeText ? options.customizeText.call(data, data) : data.valueText
- }
- function Label(renderSettings) {
- this._renderer = renderSettings.renderer;
- this._container = renderSettings.labelsGroup;
- this._point = renderSettings.point;
- this._strategy = renderSettings.strategy;
- this._rowCount = 1
- }
- Label.prototype = {
- constructor: Label,
- setColor: function(color) {
- this._color = color
- },
- setOptions: function(options) {
- this._options = options
- },
- setData: function(data) {
- this._data = data
- },
- setDataField: function(fieldName, fieldValue) {
- this._data = this._data || {};
- this._data[fieldName] = fieldValue
- },
- getData: function() {
- return this._data
- },
- setFigureToDrawConnector: function(figure) {
- this._figure = figure
- },
- dispose: function() {
- var that = this;
- disposeItem(that, "_group");
- that._data = that._options = that._textContent = that._visible = that._insideGroup = that._text = that._background = that._connector = that._figure = null
- },
- _setVisibility: function(value, state) {
- this._group && this._group.attr({
- visibility: value
- });
- this._visible = state
- },
- isVisible: function() {
- return this._visible
- },
- hide: function(holdInvisible) {
- this._holdVisibility = !!holdInvisible;
- this._hide()
- },
- _hide: function() {
- this._setVisibility("hidden", false)
- },
- show: function(holdVisible) {
- var correctPosition = !this._drawn;
- if (this._point.hasValue()) {
- this._holdVisibility = !!holdVisible;
- this._show();
- correctPosition && this._point.correctLabelPosition(this)
- }
- },
- _show: function() {
- var that = this;
- var renderer = that._renderer;
- var container = that._container;
- var options = that._options || {};
- var text = that._textContent = formatText(that._data, that._options) || null;
- if (text) {
- if (!that._group) {
- that._group = renderer.g().append(container);
- that._insideGroup = renderer.g().append(that._group);
- that._text = renderer.text("", 0, 0).append(that._insideGroup)
- }
- that._text.css(options.attributes ? (0, _utils.patchFontOptions)(options.attributes.font) : {});
- if (checkBackground(options.background)) {
- that._background = that._background || renderer.rect().append(that._insideGroup).toBackground();
- that._background.attr(options.background);
- that._color && that._background.attr({
- fill: that._color
- })
- } else {
- disposeItem(that, "_background")
- }
- if (checkConnector(options.connector)) {
- that._connector = that._connector || renderer.path([], "line").sharp().append(that._group).toBackground();
- that._connector.attr(options.connector);
- that._color && that._connector.attr({
- stroke: that._color
- })
- } else {
- disposeItem(that, "_connector")
- }
- that._text.attr({
- text: text,
- align: options.textAlignment,
- "class": options.cssClass
- });
- that._updateBackground(that._text.getBBox());
- that._setVisibility("visible", true);
- that._drawn = true
- } else {
- that._hide()
- }
- },
- _getLabelVisibility: function(isVisible) {
- return this._holdVisibility ? this.isVisible() : isVisible
- },
- draw: function(isVisible) {
- if (this._getLabelVisibility(isVisible)) {
- this._show();
- this._point && this._point.correctLabelPosition(this)
- } else {
- this._drawn = false;
- this._hide()
- }
- return this
- },
- _updateBackground: function(bBox) {
- var that = this;
- if (that._background) {
- bBox.x -= LABEL_BACKGROUND_PADDING_X;
- bBox.y -= LABEL_BACKGROUND_PADDING_Y;
- bBox.width += 2 * LABEL_BACKGROUND_PADDING_X;
- bBox.height += 2 * LABEL_BACKGROUND_PADDING_Y;
- that._background.attr(bBox)
- }
- that._bBoxWithoutRotation = (0, _extend.extend)({}, bBox);
- var rotationAngle = that._options.rotationAngle || 0;
- that._insideGroup.rotate(rotationAngle, bBox.x + bBox.width / 2, bBox.y + bBox.height / 2);
- bBox = (0, _utils.rotateBBox)(bBox, [bBox.x + bBox.width / 2, bBox.y + bBox.height / 2], -rotationAngle);
- that._bBox = bBox
- },
- getFigureCenter: function() {
- var figure = this._figure;
- var strategy = this._strategy || selectStrategy(figure);
- return strategy.getFigureCenter(figure)
- },
- _getConnectorPoints: function() {
- var that = this;
- var figure = that._figure;
- var options = that._options;
- var strategy = that._strategy || selectStrategy(figure);
- var bBox = that._shiftBBox(that._bBoxWithoutRotation);
- var rotatedBBox = that.getBoundingRect();
- var labelPoint;
- var points = [];
- var isHorizontal;
- if (!strategy.isLabelInside(bBox, figure, "inside" !== options.position)) {
- isHorizontal = strategy.isHorizontal(bBox, figure);
- var figureCenter = that.getFigureCenter();
- points = strategy.prepareLabelPoints(bBox, rotatedBBox, isHorizontal, -options.rotationAngle || 0, figureCenter);
- labelPoint = getClosestCoord(figureCenter, points);
- points = strategy.findFigurePoint(figure, labelPoint, isHorizontal);
- points = points.concat(labelPoint)
- }
- return strategy.adjustPoints(points)
- },
- fit: function(maxWidth) {
- var padding = this._background ? 2 * LABEL_BACKGROUND_PADDING_X : 0;
- var rowCountChanged = false;
- if (this._text) {
- var result = this._text.setMaxSize(maxWidth - padding, void 0, this._options);
- var rowCount = result.rowCount;
- if (0 === rowCount) {
- rowCount = 1
- }
- if (rowCount !== this._rowCount) {
- rowCountChanged = true;
- this._rowCount = rowCount
- }
- result.textIsEmpty && disposeItem(this, "_background")
- }
- this._updateBackground(this._text.getBBox());
- return rowCountChanged
- },
- resetEllipsis: function() {
- this._text && this._text.restoreText();
- this._updateBackground(this._text.getBBox())
- },
- setTrackerData: function(point) {
- this._text.data({
- "chart-data-point": point
- });
- this._background && this._background.data({
- "chart-data-point": point
- })
- },
- hideInsideLabel: function(coords) {
- return this._point.hideInsideLabel(this, coords)
- },
- getPoint: function() {
- return this._point
- },
- shift: function(x, y) {
- var that = this;
- if (that._textContent) {
- that._insideGroup.attr({
- translateX: that._x = _round(x - that._bBox.x),
- translateY: that._y = _round(y - that._bBox.y)
- });
- if (that._connector) {
- that._connector.attr({
- points: that._getConnectorPoints()
- })
- }
- }
- return that
- },
- getBoundingRect: function() {
- return this._shiftBBox(this._bBox)
- },
- _shiftBBox: function(bBox) {
- return this._textContent ? {
- x: bBox.x + this._x,
- y: bBox.y + this._y,
- width: bBox.width,
- height: bBox.height
- } : {}
- },
- getLayoutOptions: function() {
- var options = this._options;
- return {
- alignment: options.alignment,
- background: checkBackground(options.background),
- horizontalOffset: options.horizontalOffset,
- verticalOffset: options.verticalOffset,
- radialOffset: options.radialOffset,
- position: options.position,
- connectorOffset: (checkConnector(options.connector) ? CONNECTOR_LENGTH : 0) + (checkBackground(options.background) ? LABEL_BACKGROUND_PADDING_X : 0)
- }
- }
- };
- exports.Label = Label;
- Label._DEBUG_formatText = formatText
- },
- /*!**************************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/helpers/range_data_calculator.js ***!
- \**************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _require = __webpack_require__( /*! ../../core/utils */ 10),
- unique = _require.unique,
- getAddFunction = _require.getAddFunction;
- var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
- var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
- var DISCRETE = "discrete";
- function continuousRangeCalculator(range, minValue, maxValue) {
- range.min = range.min < minValue ? range.min : minValue;
- range.max = range.max > maxValue ? range.max : maxValue
- }
- function getRangeCalculator(axisType, axis) {
- if (axisType === DISCRETE) {
- return function(range, minValue, maxValue) {
- if (minValue !== maxValue) {
- range.categories.push(maxValue)
- }
- range.categories.push(minValue)
- }
- }
- if (axis) {
- return function(range, value) {
- var interval = axis.calculateInterval(value, range.prevValue);
- var minInterval = range.interval;
- range.interval = (minInterval < interval ? minInterval : interval) || minInterval;
- range.prevValue = value;
- continuousRangeCalculator(range, value, value)
- }
- }
- return continuousRangeCalculator
- }
- function getInitialRange(axisType, dataType, firstValue) {
- var range = {
- axisType: axisType,
- dataType: dataType
- };
- if (axisType === DISCRETE) {
- range.categories = []
- } else {
- range.min = firstValue;
- range.max = firstValue
- }
- return range
- }
- function processCategories(range) {
- if (range.categories) {
- range.categories = unique(range.categories)
- }
- }
- function getValueForArgument(point, extraPoint, x, range) {
- if (extraPoint && _isDefined(extraPoint.value)) {
- var y1 = point.value;
- var y2 = extraPoint.value;
- var x1 = point.argument;
- var x2 = extraPoint.argument;
- var r = (x - x1) * (y2 - y1) / (x2 - x1) + y1.valueOf();
- return "datetime" === range.dataType ? new Date(r) : r
- } else {
- return point.value
- }
- }
- function calculateRangeBetweenPoints(rangeCalculator, range, point, prevPoint, bound) {
- var value = getValueForArgument(point, prevPoint, bound, range);
- rangeCalculator(range, value, value)
- }
- function isLineSeries(series) {
- return series.type.toLowerCase().indexOf("line") >= 0 || series.type.toLowerCase().indexOf("area") >= 0
- }
- function getViewportReducer(series) {
- var rangeCalculator = getRangeCalculator(series.valueAxisType);
- var axis = series.getArgumentAxis();
- var viewport = axis && series.getArgumentAxis().visualRange() || {};
- var calculatePointBetweenPoints = isLineSeries(series) ? calculateRangeBetweenPoints : noop;
- if (axis && axis.getMarginOptions().checkInterval) {
- var range = series.getArgumentAxis().getTranslator().getBusinessRange();
- var add = getAddFunction(range, false);
- var interval = range.interval;
- if (isFinite(interval) && _isDefined(viewport.startValue) && _isDefined(viewport.endValue)) {
- viewport.startValue = add(viewport.startValue, interval, -1);
- viewport.endValue = add(viewport.endValue, interval)
- }
- }
- var viewportFilter = getViewPortFilter(viewport);
- return function(range, point, index, points) {
- var argument = point.argument;
- if (!point.hasValue()) {
- return range
- }
- if (viewportFilter(argument)) {
- if (!range.startCalc) {
- range.startCalc = true;
- calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.startValue)
- }
- rangeCalculator(range, point.getMinValue(), point.getMaxValue())
- } else {
- if (!viewport.categories && _isDefined(viewport.startValue) && argument > viewport.startValue) {
- if (!range.startCalc) {
- calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.startValue)
- }
- range.endCalc = true;
- calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.endValue)
- }
- }
- return range
- }
- }
- function getViewPortFilter(viewport) {
- if (viewport.categories) {
- var dictionary = viewport.categories.reduce(function(result, category) {
- result[category.valueOf()] = true;
- return result
- }, {});
- return function(argument) {
- return _isDefined(argument) && dictionary[argument.valueOf()]
- }
- }
- if (!_isDefined(viewport.startValue) && !_isDefined(viewport.endValue)) {
- return function() {
- return true
- }
- }
- if (!_isDefined(viewport.endValue)) {
- return function(argument) {
- return argument >= viewport.startValue
- }
- }
- if (!_isDefined(viewport.startValue)) {
- return function(argument) {
- return argument <= viewport.endValue
- }
- }
- return function(argument) {
- return argument >= viewport.startValue && argument <= viewport.endValue
- }
- }
- module.exports = {
- getViewPortFilter: getViewPortFilter,
- getArgumentRange: function(series) {
- var data = series._data || [];
- var range = {};
- if (data.length) {
- if (series.argumentAxisType === DISCRETE) {
- range = {
- categories: data.map(function(item) {
- return item.argument
- })
- }
- } else {
- var interval;
- if (data.length > 1) {
- var i1 = series.getArgumentAxis().calculateInterval(data[0].argument, data[1].argument);
- var i2 = series.getArgumentAxis().calculateInterval(data[data.length - 1].argument, data[data.length - 2].argument);
- interval = Math.min(i1, i2)
- }
- range = {
- min: data[0].argument,
- max: data[data.length - 1].argument,
- interval: interval
- }
- }
- }
- return range
- },
- getRangeData: function(series) {
- var points = series.getPoints();
- var useAggregation = series.useAggregation();
- var argumentCalculator = getRangeCalculator(series.argumentAxisType, points.length > 1 && series.getArgumentAxis());
- var valueRangeCalculator = getRangeCalculator(series.valueAxisType);
- var viewportReducer = getViewportReducer(series);
- var range = points.reduce(function(range, point, index, points) {
- var argument = point.argument;
- argumentCalculator(range.arg, argument, argument);
- if (point.hasValue()) {
- valueRangeCalculator(range.val, point.getMinValue(), point.getMaxValue());
- viewportReducer(range.viewport, point, index, points)
- }
- return range
- }, {
- arg: getInitialRange(series.argumentAxisType, series.argumentType, points.length ? points[0].argument : void 0),
- val: getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0),
- viewport: getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0)
- });
- if (useAggregation) {
- var argumentRange = this.getArgumentRange(series);
- if (series.argumentAxisType === DISCRETE) {
- range.arg = argumentRange
- } else {
- var viewport = series.getArgumentAxis().getViewport();
- if (_isDefined(viewport.startValue) || _isDefined(viewport.length)) {
- argumentCalculator(range.arg, argumentRange.min, argumentRange.min)
- }
- if (_isDefined(viewport.endValue) || _isDefined(viewport.length) && _isDefined(viewport.startValue)) {
- argumentCalculator(range.arg, argumentRange.max, argumentRange.max)
- }
- }
- }
- processCategories(range.arg);
- processCategories(range.val);
- return range
- },
- getViewport: function(series) {
- var points = series.getPoints();
- var range = {};
- var reducer = getViewportReducer(series);
- range = getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0);
- points.some(function(point, index) {
- reducer(range, point, index, points);
- return range.endCalc
- });
- return range
- },
- getPointsInViewPort: function(series) {
- var argumentViewPortFilter = getViewPortFilter(series.getArgumentAxis().visualRange() || {});
- var valueViewPort = series.getValueAxis().visualRange() || {};
- var valueViewPortFilter = getViewPortFilter(valueViewPort);
- var points = series.getPoints();
- var addValue = function(values, point, isEdge) {
- var minValue = point.getMinValue();
- var maxValue = point.getMaxValue();
- var isMinValueInViewPort = valueViewPortFilter(minValue);
- var isMaxValueInViewPort = valueViewPortFilter(maxValue);
- if (isMinValueInViewPort) {
- values.push(minValue)
- }
- if (maxValue !== minValue && isMaxValueInViewPort) {
- values.push(maxValue)
- }
- if (isEdge && !isMinValueInViewPort && !isMaxValueInViewPort) {
- if (!values.length) {
- values.push(valueViewPort.startValue)
- } else {
- values.push(valueViewPort.endValue)
- }
- }
- };
- var addEdgePoints = isLineSeries(series) ? function(result, points, index) {
- var point = points[index];
- var prevPoint = points[index - 1];
- var nextPoint = points[index + 1];
- if (nextPoint && argumentViewPortFilter(nextPoint.argument)) {
- addValue(result[1], point, true)
- }
- if (prevPoint && argumentViewPortFilter(prevPoint.argument)) {
- addValue(result[1], point, true)
- }
- } : noop;
- var checkPointInViewport = function(result, point, index) {
- if (argumentViewPortFilter(point.argument)) {
- addValue(result[0], point)
- } else {
- addEdgePoints(result, points, index)
- }
- return result
- };
- return points.reduce(checkPointInViewport, [
- [],
- []
- ])
- }
- }
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/axes_constants.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _map = __webpack_require__( /*! ../core/utils */ 10).map;
- module.exports = {
- logarithmic: "logarithmic",
- discrete: "discrete",
- numeric: "numeric",
- left: "left",
- right: "right",
- top: "top",
- bottom: "bottom",
- center: "center",
- horizontal: "horizontal",
- vertical: "vertical",
- convertTicksToValues: function(ticks) {
- return _map(ticks || [], function(item) {
- return item.value
- })
- },
- validateOverlappingMode: function(mode) {
- return "ignore" === mode || "none" === mode ? mode : "hide"
- },
- getTicksCountInRange: function(ticks, valueKey, range) {
- var i = 1;
- if (ticks.length > 1) {
- for (; i < ticks.length; i++) {
- if (Math.abs(ticks[i].coords[valueKey] - ticks[0].coords[valueKey]) >= range) {
- break
- }
- }
- }
- return i
- },
- areLabelsOverlap: function(bBox1, bBox2, spacing, alignment) {
- var horizontalInverted = bBox1.x > bBox2.x;
- var verticalInverted = bBox1.y > bBox2.y;
- var x1 = bBox1.x;
- var x2 = bBox2.x;
- var width1 = bBox1.width;
- var width2 = bBox2.width;
- if ("left" === alignment) {
- x1 += width1 / 2;
- x2 += width2 / 2
- } else {
- if ("right" === alignment) {
- x1 -= width1 / 2;
- x2 -= width2 / 2
- }
- }
- var hasHorizontalOverlapping = horizontalInverted ? x2 + width2 + spacing > x1 : x1 + width1 + spacing > x2;
- var hasVerticalOverlapping = verticalInverted ? bBox2.y + bBox2.height > bBox1.y : bBox1.y + bBox1.height > bBox2.y;
- return hasHorizontalOverlapping && hasVerticalOverlapping
- }
- }
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/translators/translator2d.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var Range = __webpack_require__( /*! ./range */ 108).Range;
- var categoryTranslator = __webpack_require__( /*! ./category_translator */ 779);
- var intervalTranslator = __webpack_require__( /*! ./interval_translator */ 780);
- var datetimeTranslator = __webpack_require__( /*! ./datetime_translator */ 781);
- var logarithmicTranslator = __webpack_require__( /*! ./logarithmic_translator */ 782);
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var getLog = vizUtils.getLog;
- var getPower = vizUtils.getPower;
- var isDefined = typeUtils.isDefined;
- var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
- var _abs = Math.abs;
- var CANVAS_PROP = ["width", "height", "left", "top", "bottom", "right"];
- var _Translator2d;
- var addInterval = __webpack_require__( /*! ../../core/utils/date */ 22).addInterval;
- var dummyTranslator = {
- to: function(value) {
- var coord = this._canvasOptions.startPoint + (this._options.conversionValue ? value : Math.round(value));
- return coord > this._canvasOptions.endPoint ? this._canvasOptions.endPoint : coord
- },
- from: function(value) {
- return value - this._canvasOptions.startPoint
- }
- };
- var validateCanvas = function(canvas) {
- each(CANVAS_PROP, function(_, prop) {
- canvas[prop] = parseInt(canvas[prop]) || 0
- });
- return canvas
- };
- var makeCategoriesToPoints = function(categories) {
- var categoriesToPoints = {};
- categories.forEach(function(item, i) {
- categoriesToPoints[item.valueOf()] = i
- });
- return categoriesToPoints
- };
- var validateBusinessRange = function(businessRange) {
- if (!(businessRange instanceof Range)) {
- businessRange = new Range(businessRange)
- }
- function validate(valueSelector, baseValueSelector) {
- if (!isDefined(businessRange[valueSelector]) && isDefined(businessRange[baseValueSelector])) {
- businessRange[valueSelector] = businessRange[baseValueSelector]
- }
- }
- validate("minVisible", "min");
- validate("maxVisible", "max");
- return businessRange
- };
- function prepareBreaks(breaks, range) {
- var transform = "logarithmic" === range.axisType ? function(value) {
- return getLog(value, range.base)
- } : function(value) {
- return value
- };
- var array = [];
- var br;
- var transformFrom;
- var transformTo;
- var i;
- var length = breaks.length;
- var sum = 0;
- for (i = 0; i < length; i++) {
- br = breaks[i];
- transformFrom = transform(br.from);
- transformTo = transform(br.to);
- sum += transformTo - transformFrom;
- array.push({
- trFrom: transformFrom,
- trTo: transformTo,
- from: br.from,
- to: br.to,
- length: sum,
- cumulativeWidth: br.cumulativeWidth
- })
- }
- return array
- }
- function getCanvasBounds(range) {
- var min = range.min;
- var max = range.max;
- var minVisible = range.minVisible;
- var maxVisible = range.maxVisible;
- var isLogarithmic = "logarithmic" === range.axisType;
- if (isLogarithmic) {
- maxVisible = getLog(maxVisible, range.base);
- minVisible = getLog(minVisible, range.base);
- min = getLog(min, range.base);
- max = getLog(max, range.base)
- }
- return {
- base: range.base,
- rangeMin: min,
- rangeMax: max,
- rangeMinVisible: minVisible,
- rangeMaxVisible: maxVisible
- }
- }
- function getCheckingMethodsAboutBreaks(inverted) {
- return {
- isStartSide: !inverted ? function(pos, breaks, start, end) {
- return pos < breaks[0][start]
- } : function(pos, breaks, start, end) {
- return pos <= breaks[breaks.length - 1][end]
- },
- isEndSide: !inverted ? function(pos, breaks, start, end) {
- return pos >= breaks[breaks.length - 1][end]
- } : function(pos, breaks, start, end) {
- return pos > breaks[0][start]
- },
- isInBreak: !inverted ? function(pos, br, start, end) {
- return pos >= br[start] && pos < br[end]
- } : function(pos, br, start, end) {
- return pos > br[end] && pos <= br[start]
- },
- isBetweenBreaks: !inverted ? function(pos, br, prevBreak, start, end) {
- return pos < br[start] && pos >= prevBreak[end]
- } : function(pos, br, prevBreak, start, end) {
- return pos >= br[end] && pos < prevBreak[start]
- },
- getLength: !inverted ? function(br) {
- return br.length
- } : function(br, lastBreak) {
- return lastBreak.length - br.length
- },
- getBreaksSize: !inverted ? function(br) {
- return br.cumulativeWidth
- } : function(br, lastBreak) {
- return lastBreak.cumulativeWidth - br.cumulativeWidth
- }
- }
- }
- exports.Translator2D = _Translator2d = function(businessRange, canvas, options) {
- this.update(businessRange, canvas, options)
- };
- _Translator2d.prototype = {
- constructor: _Translator2d,
- reinit: function() {
- var that = this;
- var options = that._options;
- var range = that._businessRange;
- var categories = range.categories || [];
- var script = {};
- var canvasOptions = that._prepareCanvasOptions();
- var visibleCategories = vizUtils.getCategoriesInfo(categories, range.minVisible, range.maxVisible).categories;
- var categoriesLength = visibleCategories.length;
- if (range.isEmpty()) {
- script = dummyTranslator
- } else {
- switch (range.axisType) {
- case "logarithmic":
- script = logarithmicTranslator;
- break;
- case "semidiscrete":
- script = intervalTranslator;
- canvasOptions.ratioOfCanvasRange = canvasOptions.canvasLength / (addInterval(canvasOptions.rangeMaxVisible, options.interval) - canvasOptions.rangeMinVisible);
- break;
- case "discrete":
- script = categoryTranslator;
- that._categories = categories;
- canvasOptions.interval = that._getDiscreteInterval(options.addSpiderCategory ? categoriesLength + 1 : categoriesLength, canvasOptions);
- that._categoriesToPoints = makeCategoriesToPoints(categories, canvasOptions.invert);
- if (categoriesLength) {
- canvasOptions.startPointIndex = that._categoriesToPoints[visibleCategories[0].valueOf()];
- that.visibleCategories = visibleCategories
- }
- break;
- default:
- if ("datetime" === range.dataType) {
- script = datetimeTranslator
- }
- }
- }(that._oldMethods || []).forEach(function(methodName) {
- delete that[methodName]
- });
- that._oldMethods = Object.keys(script);
- extend(that, script);
- that._conversionValue = options.conversionValue ? function(value) {
- return value
- } : function(value) {
- return Math.round(value)
- };
- that.sc = {};
- that._checkingMethodsAboutBreaks = [getCheckingMethodsAboutBreaks(false), getCheckingMethodsAboutBreaks(that.isInverted())];
- that._translateBreaks();
- that._calculateSpecialValues()
- },
- _translateBreaks: function() {
- var breaks = this._breaks;
- var size = this._options.breaksSize;
- var i;
- var b;
- var end;
- var length;
- if (void 0 === breaks) {
- return
- }
- for (i = 0, length = breaks.length; i < length; i++) {
- b = breaks[i];
- end = this.translate(b.to);
- b.end = end;
- b.start = !b.gapSize ? !this.isInverted() ? end - size : end + size : end
- }
- },
- _checkValueAboutBreaks: function(breaks, pos, start, end, methods) {
- var i;
- var length;
- var prop = {
- length: 0,
- breaksSize: void 0,
- inBreak: false
- };
- var br;
- var prevBreak;
- var lastBreak = breaks[breaks.length - 1];
- if (methods.isStartSide(pos, breaks, start, end)) {
- return prop
- } else {
- if (methods.isEndSide(pos, breaks, start, end)) {
- return {
- length: lastBreak.length,
- breaksSize: lastBreak.cumulativeWidth,
- inBreak: false
- }
- }
- }
- for (i = 0, length = breaks.length; i < length; i++) {
- br = breaks[i];
- prevBreak = breaks[i - 1];
- if (methods.isInBreak(pos, br, start, end)) {
- prop.inBreak = true;
- prop.break = br;
- break
- }
- if (prevBreak && methods.isBetweenBreaks(pos, br, prevBreak, start, end)) {
- prop = {
- length: methods.getLength(prevBreak, lastBreak),
- breaksSize: methods.getBreaksSize(prevBreak, lastBreak),
- inBreak: false
- };
- break
- }
- }
- return prop
- },
- isInverted: function() {
- return !(this._options.isHorizontal ^ this._businessRange.invert)
- },
- _getDiscreteInterval: function(categoriesLength, canvasOptions) {
- var correctedCategoriesCount = categoriesLength - (this._options.stick ? 1 : 0);
- return correctedCategoriesCount > 0 ? canvasOptions.canvasLength / correctedCategoriesCount : canvasOptions.canvasLength
- },
- _prepareCanvasOptions: function() {
- var that = this;
- var businessRange = that._businessRange;
- var canvasOptions = that._canvasOptions = getCanvasBounds(businessRange);
- var canvas = that._canvas;
- var breaks = that._breaks;
- var length;
- canvasOptions.startPadding = canvas.startPadding || 0;
- canvasOptions.endPadding = canvas.endPadding || 0;
- if (that._options.isHorizontal) {
- canvasOptions.startPoint = canvas.left + canvasOptions.startPadding;
- length = canvas.width;
- canvasOptions.endPoint = canvas.width - canvas.right - canvasOptions.endPadding;
- canvasOptions.invert = businessRange.invert
- } else {
- canvasOptions.startPoint = canvas.top + canvasOptions.startPadding;
- length = canvas.height;
- canvasOptions.endPoint = canvas.height - canvas.bottom - canvasOptions.endPadding;
- canvasOptions.invert = !businessRange.invert
- }
- that.canvasLength = canvasOptions.canvasLength = canvasOptions.endPoint - canvasOptions.startPoint;
- canvasOptions.rangeDoubleError = Math.pow(10, getPower(canvasOptions.rangeMax - canvasOptions.rangeMin) - getPower(length) - 2);
- canvasOptions.ratioOfCanvasRange = canvasOptions.canvasLength / (canvasOptions.rangeMaxVisible - canvasOptions.rangeMinVisible);
- if (void 0 !== breaks) {
- canvasOptions.ratioOfCanvasRange = (canvasOptions.canvasLength - breaks[breaks.length - 1].cumulativeWidth) / (canvasOptions.rangeMaxVisible - canvasOptions.rangeMinVisible - breaks[breaks.length - 1].length)
- }
- return canvasOptions
- },
- updateCanvas: function(canvas) {
- this._canvas = validateCanvas(canvas);
- this.reinit()
- },
- updateBusinessRange: function(businessRange) {
- var that = this;
- var breaks = businessRange.breaks || [];
- that._businessRange = validateBusinessRange(businessRange);
- that._breaks = breaks.length ? prepareBreaks(breaks, that._businessRange) : void 0;
- that.reinit()
- },
- update: function(businessRange, canvas, options) {
- var that = this;
- that._options = extend(that._options || {}, options);
- that._canvas = validateCanvas(canvas);
- that.updateBusinessRange(businessRange)
- },
- getBusinessRange: function() {
- return this._businessRange
- },
- getEventScale: function(zoomEvent) {
- return zoomEvent.deltaScale || 1
- },
- getCanvasVisibleArea: function() {
- return {
- min: this._canvasOptions.startPoint,
- max: this._canvasOptions.endPoint
- }
- },
- _calculateSpecialValues: function() {
- var that = this;
- var canvasOptions = that._canvasOptions;
- var startPoint = canvasOptions.startPoint - canvasOptions.startPadding;
- var endPoint = canvasOptions.endPoint + canvasOptions.endPadding;
- var range = that._businessRange;
- var minVisible = range.minVisible;
- var maxVisible = range.maxVisible;
- var canvas_position_center_middle = startPoint + canvasOptions.canvasLength / 2;
- var canvas_position_default;
- if (minVisible < 0 && maxVisible > 0 && minVisible !== maxVisible) {
- canvas_position_default = that.translate(0, 1)
- }
- if (!isDefined(canvas_position_default)) {
- var invert = range.invert ^ (minVisible < 0 && maxVisible <= 0);
- if (that._options.isHorizontal) {
- canvas_position_default = invert ? endPoint : startPoint
- } else {
- canvas_position_default = invert ? startPoint : endPoint
- }
- }
- that.sc = {
- canvas_position_default: canvas_position_default,
- canvas_position_left: startPoint,
- canvas_position_top: startPoint,
- canvas_position_center: canvas_position_center_middle,
- canvas_position_middle: canvas_position_center_middle,
- canvas_position_right: endPoint,
- canvas_position_bottom: endPoint,
- canvas_position_start: canvasOptions.invert ? endPoint : startPoint,
- canvas_position_end: canvasOptions.invert ? startPoint : endPoint
- }
- },
- translateSpecialCase: function(value) {
- return this.sc[value]
- },
- _calculateProjection: function(distance) {
- var canvasOptions = this._canvasOptions;
- return canvasOptions.invert ? canvasOptions.endPoint - distance : canvasOptions.startPoint + distance
- },
- _calculateUnProjection: function(distance) {
- var canvasOptions = this._canvasOptions;
- return canvasOptions.invert ? canvasOptions.rangeMaxVisible.valueOf() - distance : canvasOptions.rangeMinVisible.valueOf() + distance
- },
- getMinBarSize: function(minBarSize) {
- var visibleArea = this.getCanvasVisibleArea();
- var minValue = this.from(visibleArea.min + minBarSize);
- return _abs(this.from(visibleArea.min) - (!isDefined(minValue) ? this.from(visibleArea.max) : minValue))
- },
- checkMinBarSize: function(value, minShownValue, stackValue) {
- return _abs(value) < minShownValue ? value >= 0 ? minShownValue : -minShownValue : value
- },
- translate: function(bp, direction) {
- var specialValue = this.translateSpecialCase(bp);
- if (isDefined(specialValue)) {
- return Math.round(specialValue)
- }
- if (isNaN(bp)) {
- return null
- }
- return this.to(bp, direction)
- },
- getInterval: function(interval) {
- var canvasOptions = this._canvasOptions;
- interval = isDefined(interval) ? interval : this._businessRange.interval;
- if (interval) {
- return Math.round(canvasOptions.ratioOfCanvasRange * interval)
- }
- return Math.round(canvasOptions.endPoint - canvasOptions.startPoint)
- },
- zoom: function(translate, scale, wholeRange) {
- var canvasOptions = this._canvasOptions;
- if (canvasOptions.rangeMinVisible.valueOf() === canvasOptions.rangeMaxVisible.valueOf() && 0 !== translate) {
- return this.zoomZeroLengthRange(translate, scale)
- }
- var startPoint = canvasOptions.startPoint;
- var endPoint = canvasOptions.endPoint;
- var isInverted = this.isInverted();
- var newStart = (startPoint + translate) / scale;
- var newEnd = (endPoint + translate) / scale;
- wholeRange = wholeRange || {};
- var minPoint = this.to(isInverted ? wholeRange.endValue : wholeRange.startValue);
- var maxPoint = this.to(isInverted ? wholeRange.startValue : wholeRange.endValue);
- var min;
- var max;
- if (minPoint > newStart) {
- newEnd -= newStart - minPoint;
- newStart = minPoint;
- min = isInverted ? wholeRange.endValue : wholeRange.startValue
- }
- if (maxPoint < newEnd) {
- newStart -= newEnd - maxPoint;
- newEnd = maxPoint;
- max = isInverted ? wholeRange.startValue : wholeRange.endValue
- }
- if (maxPoint - minPoint < newEnd - newStart) {
- newStart = minPoint;
- newEnd = maxPoint
- }
- translate = (endPoint - startPoint) * newStart / (newEnd - newStart) - startPoint;
- scale = (startPoint + translate) / newStart || 1;
- min = isDefined(min) ? min : adjust(this.from(newStart, 1));
- max = isDefined(max) ? max : adjust(this.from(newEnd, -1));
- if (min > max) {
- min = min > wholeRange.endValue ? wholeRange.endValue : min;
- max = max < wholeRange.startValue ? wholeRange.startValue : max
- } else {
- min = min < wholeRange.startValue ? wholeRange.startValue : min;
- max = max > wholeRange.endValue ? wholeRange.endValue : max
- }
- return {
- min: min,
- max: max,
- translate: adjust(translate),
- scale: adjust(scale)
- }
- },
- zoomZeroLengthRange: function(translate, scale) {
- var canvasOptions = this._canvasOptions;
- var min = canvasOptions.rangeMin;
- var max = canvasOptions.rangeMax;
- var correction = (max.valueOf() !== min.valueOf() ? max.valueOf() - min.valueOf() : _abs(canvasOptions.rangeMinVisible.valueOf() - min.valueOf())) / canvasOptions.canvasLength;
- var isDateTime = typeUtils.isDate(max) || typeUtils.isDate(min);
- var isLogarithmic = "logarithmic" === this._businessRange.axisType;
- var newMin = canvasOptions.rangeMinVisible.valueOf() - correction;
- var newMax = canvasOptions.rangeMaxVisible.valueOf() + correction;
- newMin = isLogarithmic ? adjust(Math.pow(canvasOptions.base, newMin)) : isDateTime ? new Date(newMin) : newMin;
- newMax = isLogarithmic ? adjust(Math.pow(canvasOptions.base, newMax)) : isDateTime ? new Date(newMax) : newMax;
- return {
- min: newMin,
- max: newMax,
- translate: translate,
- scale: scale
- }
- },
- getMinScale: function(zoom) {
- return zoom ? 1.1 : .9
- },
- getScale: function(val1, val2) {
- var canvasOptions = this._canvasOptions;
- if (canvasOptions.rangeMax === canvasOptions.rangeMin) {
- return 1
- }
- val1 = isDefined(val1) ? this._fromValue(val1) : canvasOptions.rangeMin;
- val2 = isDefined(val2) ? this._fromValue(val2) : canvasOptions.rangeMax;
- return (canvasOptions.rangeMax - canvasOptions.rangeMin) / Math.abs(val1 - val2)
- },
- isValid: function(value) {
- var co = this._canvasOptions;
- value = this._fromValue(value);
- return null !== value && !isNaN(value) && value.valueOf() + co.rangeDoubleError >= co.rangeMin && value.valueOf() - co.rangeDoubleError <= co.rangeMax
- },
- getCorrectValue: function(value, direction) {
- var that = this;
- var breaks = that._breaks;
- var prop;
- value = that._fromValue(value);
- if (that._breaks) {
- prop = that._checkValueAboutBreaks(breaks, value, "trFrom", "trTo", that._checkingMethodsAboutBreaks[0]);
- if (true === prop.inBreak) {
- return that._toValue(direction > 0 ? prop.break.trTo : prop.break.trFrom)
- }
- }
- return that._toValue(value)
- },
- to: function(bp, direction) {
- var range = this.getBusinessRange();
- if (isDefined(range.maxVisible) && isDefined(range.minVisible) && range.maxVisible.valueOf() === range.minVisible.valueOf()) {
- if (!isDefined(bp) || range.maxVisible.valueOf() !== bp.valueOf()) {
- return null
- }
- return this.translateSpecialCase(0 === bp && this._options.shiftZeroValue ? "canvas_position_default" : "canvas_position_middle")
- }
- bp = this._fromValue(bp);
- var that = this;
- var canvasOptions = that._canvasOptions;
- var breaks = that._breaks;
- var prop = {
- length: 0
- };
- var commonBreakSize = 0;
- if (void 0 !== breaks) {
- prop = that._checkValueAboutBreaks(breaks, bp, "trFrom", "trTo", that._checkingMethodsAboutBreaks[0]);
- commonBreakSize = isDefined(prop.breaksSize) ? prop.breaksSize : 0
- }
- if (true === prop.inBreak) {
- if (direction > 0) {
- return prop.break.start
- } else {
- if (direction < 0) {
- return prop.break.end
- } else {
- return null
- }
- }
- }
- return that._conversionValue(that._calculateProjection((bp - canvasOptions.rangeMinVisible - prop.length) * canvasOptions.ratioOfCanvasRange + commonBreakSize))
- },
- from: function(pos, direction) {
- var that = this;
- var breaks = that._breaks;
- var prop = {
- length: 0
- };
- var canvasOptions = that._canvasOptions;
- var startPoint = canvasOptions.startPoint;
- var commonBreakSize = 0;
- if (void 0 !== breaks) {
- prop = that._checkValueAboutBreaks(breaks, pos, "start", "end", that._checkingMethodsAboutBreaks[1]);
- commonBreakSize = isDefined(prop.breaksSize) ? prop.breaksSize : 0
- }
- if (true === prop.inBreak) {
- if (direction > 0) {
- return that._toValue(prop.break.trTo)
- } else {
- if (direction < 0) {
- return that._toValue(prop.break.trFrom)
- } else {
- return null
- }
- }
- }
- return that._toValue(that._calculateUnProjection((pos - startPoint - commonBreakSize) / canvasOptions.ratioOfCanvasRange + prop.length))
- },
- isValueProlonged: false,
- getRange: function() {
- return [this._toValue(this._canvasOptions.rangeMin), this._toValue(this._canvasOptions.rangeMax)]
- },
- getScreenRange: function() {
- return [this._canvasOptions.startPoint, this._canvasOptions.endPoint]
- },
- add: function(value, diff, dir) {
- return this._add(value, diff, (this._businessRange.invert ? -1 : 1) * dir)
- },
- _add: function(value, diff, coeff) {
- return this._toValue(this._fromValue(value) + diff * coeff)
- },
- _fromValue: function(value) {
- return null !== value ? Number(value) : null
- },
- _toValue: function(value) {
- return null !== value ? Number(value) : null
- },
- ratioOfCanvasRange: function() {
- return this._canvasOptions.ratioOfCanvasRange
- }
- }
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/base_indicators.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var _isFinite = isFinite;
- var _Number = Number;
- var _round = Math.round;
- var baseGaugeModule = __webpack_require__( /*! ./base_gauge */ 145);
- var _formatValue = baseGaugeModule.formatValue;
- var _getSampleText = baseGaugeModule.getSampleText;
- var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var BaseElement = Class.inherit({
- ctor: function(parameters) {
- var that = this;
- each(parameters, function(name, value) {
- that["_" + name] = value
- });
- that._init()
- },
- dispose: function() {
- var that = this;
- that._dispose();
- each(that, function(name) {
- that[name] = null
- });
- return that
- },
- getOffset: function() {
- return _Number(this._options.offset) || 0
- }
- });
- var BaseIndicator = BaseElement.inherit({
- _init: function() {
- var that = this;
- that._rootElement = that._createRoot().linkOn(that._owner, {
- name: "value-indicator",
- after: "core"
- });
- that._trackerElement = that._createTracker()
- },
- _dispose: function() {
- this._rootElement.linkOff()
- },
- _setupAnimation: function() {
- var that = this;
- if (that._options.animation) {
- that._animation = {
- step: function(pos) {
- that._actualValue = that._animation.start + that._animation.delta * pos;
- that._actualPosition = that._translator.translate(that._actualValue);
- that._move()
- },
- duration: that._options.animation.duration > 0 ? _Number(that._options.animation.duration) : 0,
- easing: that._options.animation.easing
- }
- }
- },
- _runAnimation: function(value) {
- var that = this;
- var animation = that._animation;
- animation.start = that._actualValue;
- animation.delta = value - that._actualValue;
- that._rootElement.animate({
- _: 0
- }, {
- step: animation.step,
- duration: animation.duration,
- easing: animation.easing
- })
- },
- _createRoot: function() {
- return this._renderer.g().attr({
- "class": this._className
- })
- },
- _createTracker: function() {
- return this._renderer.path([], "area")
- },
- _getTrackerSettings: noop,
- clean: function() {
- var that = this;
- that._animation && that._rootElement.stopAnimation();
- that._rootElement.linkRemove().clear();
- that._clear();
- that._tracker.detach(that._trackerElement);
- that._options = that.enabled = that._animation = null;
- return that
- },
- render: function(options) {
- var that = this;
- that.type = options.type;
- that._options = options;
- that._actualValue = that._currentValue = that._translator.adjust(that._options.currentValue);
- that.enabled = that._isEnabled();
- if (that.enabled) {
- that._setupAnimation();
- that._rootElement.attr({
- fill: that._options.color
- }).linkAppend();
- that._tracker.attach(that._trackerElement, that, that._trackerInfo)
- }
- return that
- },
- resize: function(layout) {
- var that = this;
- that._rootElement.clear();
- that._clear();
- that.visible = that._isVisible(layout);
- if (that.visible) {
- extend(that._options, layout);
- that._actualPosition = that._translator.translate(that._actualValue);
- that._render();
- that._trackerElement.attr(that._getTrackerSettings());
- that._move()
- }
- return that
- },
- value: function(arg, _noAnimation) {
- var that = this;
- var val;
- var rootElement = this._rootElement;
- var visibility = null;
- if (void 0 === arg) {
- return that._currentValue
- }
- if (null === arg) {
- visibility = "hidden";
- that._currentValue = arg
- } else {
- val = that._translator.adjust(arg);
- if (that._currentValue !== val && _isFinite(val)) {
- that._currentValue = val;
- if (that.visible) {
- if (that._animation && !_noAnimation) {
- that._runAnimation(val)
- } else {
- that._actualValue = val;
- that._actualPosition = that._translator.translate(val);
- that._move()
- }
- }
- }
- }
- rootElement.attr({
- visibility: visibility
- });
- return that
- },
- _isEnabled: null,
- _isVisible: null,
- _render: null,
- _clear: null,
- _move: null
- });
- var COEFFICIENTS_MAP = {};
- COEFFICIENTS_MAP["right-bottom"] = COEFFICIENTS_MAP.rb = [0, -1, -1, 0, 0, 1, 1, 0];
- COEFFICIENTS_MAP["bottom-right"] = COEFFICIENTS_MAP.br = [-1, 0, 0, -1, 1, 0, 0, 1];
- COEFFICIENTS_MAP["left-bottom"] = COEFFICIENTS_MAP.lb = [0, -1, 1, 0, 0, 1, -1, 0];
- COEFFICIENTS_MAP["bottom-left"] = COEFFICIENTS_MAP.bl = [1, 0, 0, -1, -1, 0, 0, 1];
- COEFFICIENTS_MAP["left-top"] = COEFFICIENTS_MAP.lt = [0, 1, 1, 0, 0, -1, -1, 0];
- COEFFICIENTS_MAP["top-left"] = COEFFICIENTS_MAP.tl = [1, 0, 0, 1, -1, 0, 0, -1];
- COEFFICIENTS_MAP["right-top"] = COEFFICIENTS_MAP.rt = [0, 1, -1, 0, 0, -1, 1, 0];
- COEFFICIENTS_MAP["top-right"] = COEFFICIENTS_MAP.tr = [-1, 0, 0, 1, 1, 0, 0, -1];
- function getTextCloudInfo(options) {
- var x = options.x;
- var y = options.y;
- var type = COEFFICIENTS_MAP[options.type];
- var cloudWidth = options.textWidth + 2 * options.horMargin;
- var cloudHeight = options.textHeight + 2 * options.verMargin;
- var tailWidth;
- var tailHeight;
- var cx = x;
- var cy = y;
- tailWidth = tailHeight = options.tailLength;
- if (1 & type[0]) {
- tailHeight = Math.min(tailHeight, cloudHeight / 3)
- } else {
- tailWidth = Math.min(tailWidth, cloudWidth / 3)
- }
- return {
- cx: _round(cx + type[0] * tailWidth + (type[0] + type[2]) * cloudWidth / 2),
- cy: _round(cy + type[1] * tailHeight + (type[1] + type[3]) * cloudHeight / 2),
- points: [_round(x), _round(y), _round(x += type[0] * (cloudWidth + tailWidth)), _round(y += type[1] * (cloudHeight + tailHeight)), _round(x += type[2] * cloudWidth), _round(y += type[3] * cloudHeight), _round(x += type[4] * cloudWidth), _round(y += type[5] * cloudHeight), _round(x += type[6] * (cloudWidth - tailWidth)), _round(y += type[7] * (cloudHeight - tailHeight))]
- }
- }
- var BaseTextCloudMarker = BaseIndicator.inherit({
- _move: function() {
- var that = this;
- var textCloudOptions = that._getTextCloudOptions();
- var text = _formatValue(that._actualValue, that._options.text);
- that._text.attr({
- text: text
- });
- var bBox = that._text.getBBox();
- var info = getTextCloudInfo({
- x: textCloudOptions.x,
- y: textCloudOptions.y,
- textWidth: bBox.width || text.length * that._textUnitWidth,
- textHeight: bBox.height || that._textHeight,
- horMargin: that._options.horizontalOffset,
- verMargin: that._options.verticalOffset,
- tailLength: that._options.arrowLength,
- type: textCloudOptions.type
- });
- that._text.attr({
- x: info.cx,
- y: info.cy + that._textVerticalOffset
- });
- that._cloud.attr({
- points: info.points
- });
- that._trackerElement && that._trackerElement.attr({
- points: info.points
- })
- },
- _measureText: function() {
- var that = this;
- var root;
- var text;
- var bBox;
- var sampleText;
- if (!that._textVerticalOffset) {
- root = that._createRoot().append(that._owner);
- sampleText = _getSampleText(that._translator, that._options.text);
- text = that._renderer.text(sampleText, 0, 0).attr({
- align: "center"
- }).css(_patchFontOptions(that._options.text.font)).append(root);
- bBox = text.getBBox();
- root.remove();
- that._textVerticalOffset = -bBox.y - bBox.height / 2;
- that._textWidth = bBox.width;
- that._textHeight = bBox.height;
- that._textUnitWidth = that._textWidth / sampleText.length;
- that._textFullWidth = that._textWidth + 2 * that._options.horizontalOffset;
- that._textFullHeight = that._textHeight + 2 * that._options.verticalOffset
- }
- },
- _render: function() {
- var that = this;
- that._measureText();
- that._cloud = that._cloud || that._renderer.path([], "area").append(that._rootElement);
- that._text = that._text || that._renderer.text().append(that._rootElement);
- that._text.attr({
- align: "center"
- }).css(_patchFontOptions(that._options.text.font))
- },
- _clear: function() {
- delete this._cloud;
- delete this._text
- },
- getTooltipParameters: function() {
- var position = this._getTextCloudOptions();
- return {
- x: position.x,
- y: position.y,
- value: this._currentValue,
- color: this._options.color
- }
- }
- });
- var BaseRangeBar = BaseIndicator.inherit({
- _measureText: function() {
- var that = this;
- var root;
- var text;
- var bBox;
- that._hasText = that._isTextVisible();
- if (that._hasText && !that._textVerticalOffset) {
- root = that._createRoot().append(that._owner);
- text = that._renderer.text(_getSampleText(that._translator, that._options.text), 0, 0).attr({
- "class": "dxg-text",
- align: "center"
- }).css(_patchFontOptions(that._options.text.font)).append(root);
- bBox = text.getBBox();
- root.remove();
- that._textVerticalOffset = -bBox.y - bBox.height / 2;
- that._textWidth = bBox.width;
- that._textHeight = bBox.height
- }
- },
- _move: function() {
- var that = this;
- that._updateBarItemsPositions();
- if (that._hasText) {
- that._text.attr({
- text: _formatValue(that._actualValue, that._options.text)
- });
- that._updateTextPosition();
- that._updateLinePosition()
- }
- },
- _updateBarItems: function() {
- var that = this;
- var options = that._options;
- var spaceColor;
- var translator = that._translator;
- that._setBarSides();
- that._startPosition = translator.translate(translator.getDomainStart());
- that._endPosition = translator.translate(translator.getDomainEnd());
- that._basePosition = translator.translate(options.baseValue);
- that._space = that._getSpace();
- var backgroundColor = options.backgroundColor || "none";
- if ("none" !== backgroundColor && that._space > 0) {
- spaceColor = options.containerBackgroundColor || "none"
- } else {
- that._space = 0;
- spaceColor = "none"
- }
- that._backItem1.attr({
- fill: backgroundColor
- });
- that._backItem2.attr({
- fill: backgroundColor
- });
- that._spaceItem1.attr({
- fill: spaceColor
- });
- that._spaceItem2.attr({
- fill: spaceColor
- })
- },
- _getSpace: function() {
- return 0
- },
- _updateTextItems: function() {
- var that = this;
- if (that._hasText) {
- that._line = that._line || that._renderer.path([], "line").attr({
- "class": "dxg-main-bar",
- "stroke-linecap": "square"
- }).append(that._rootElement);
- that._text = that._text || that._renderer.text("", 0, 0).attr({
- "class": "dxg-text"
- }).append(that._rootElement);
- that._text.attr({
- align: that._getTextAlign()
- }).css(that._getFontOptions());
- that._setTextItemsSides()
- } else {
- if (that._line) {
- that._line.remove();
- delete that._line
- }
- if (that._text) {
- that._text.remove();
- delete that._text
- }
- }
- },
- _isTextVisible: function() {
- return false
- },
- _getTextAlign: function() {
- return "center"
- },
- _getFontOptions: function() {
- var options = this._options;
- var font = options.text.font;
- if (!font || !font.color) {
- font = extend({}, font, {
- color: options.color
- })
- }
- return _patchFontOptions(font)
- },
- _updateBarItemsPositions: function() {
- var that = this;
- var positions = that._getPositions();
- that._backItem1.attr(that._buildItemSettings(positions.start, positions.back1));
- that._backItem2.attr(that._buildItemSettings(positions.back2, positions.end));
- that._spaceItem1.attr(that._buildItemSettings(positions.back1, positions.main1));
- that._spaceItem2.attr(that._buildItemSettings(positions.main2, positions.back2));
- that._mainItem.attr(that._buildItemSettings(positions.main1, positions.main2));
- that._trackerElement && that._trackerElement.attr(that._buildItemSettings(positions.main1, positions.main2))
- },
- _render: function() {
- var that = this;
- that._measureText();
- if (!that._backItem1) {
- that._backItem1 = that._createBarItem();
- that._backItem1.attr({
- "class": "dxg-back-bar"
- })
- }
- if (!that._backItem2) {
- that._backItem2 = that._createBarItem();
- that._backItem2.attr({
- "class": "dxg-back-bar"
- })
- }
- if (!that._spaceItem1) {
- that._spaceItem1 = that._createBarItem();
- that._spaceItem1.attr({
- "class": "dxg-space-bar"
- })
- }
- if (!that._spaceItem2) {
- that._spaceItem2 = that._createBarItem();
- that._spaceItem2.attr({
- "class": "dxg-space-bar"
- })
- }
- if (!that._mainItem) {
- that._mainItem = that._createBarItem();
- that._mainItem.attr({
- "class": "dxg-main-bar"
- })
- }
- that._updateBarItems();
- that._updateTextItems()
- },
- _clear: function() {
- var that = this;
- delete that._backItem1;
- delete that._backItem2;
- delete that._spaceItem1;
- delete that._spaceItem2;
- delete that._mainItem;
- delete that._hasText;
- delete that._line;
- delete that._text
- },
- getTooltipParameters: function() {
- var position = this._getTooltipPosition();
- return {
- x: position.x,
- y: position.y,
- value: this._currentValue,
- color: this._options.color,
- offset: 0
- }
- }
- });
- exports.BaseElement = BaseElement;
- exports.BaseIndicator = BaseIndicator;
- exports.BaseTextCloudMarker = BaseTextCloudMarker;
- exports.BaseRangeBar = BaseRangeBar;
- exports.getTextCloudInfo = getTextCloudInfo
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/common.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
- exports.buildRectAppearance = function(option) {
- var border = option.border || {};
- return {
- fill: option.color,
- opacity: option.opacity,
- stroke: border.color,
- "stroke-width": border.width,
- "stroke-opacity": border.opacity,
- hatching: option.hatching
- }
- };
- exports.buildTextAppearance = function(options, filter) {
- return {
- attr: options["stroke-width"] ? {
- stroke: options.stroke,
- "stroke-width": options["stroke-width"],
- "stroke-opacity": options["stroke-opacity"],
- filter: filter
- } : {},
- css: _patchFontOptions(options.font)
- }
- }
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/components/tracker.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _eventData = __webpack_require__( /*! ../../events/utils */ 8).eventData;
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var clickEventName = __webpack_require__( /*! ../../events/click */ 19).name;
- var downPointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).down;
- var movePointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).move;
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- function Tracker(parameters) {
- this._initHandlers(parameters)
- }
- Tracker.prototype = {
- constructor: Tracker,
- _initHandlers: function(parameters) {
- var document = domAdapter.getDocument();
- parameters.getCoords = function(e) {
- var data = _eventData(e);
- var offset = parameters.widget._renderer.getRootOffset();
- return [data.x - offset.left, data.y - offset.top]
- };
- parameters.root.on(clickEventName, clickHandler);
- parameters.root.on(downPointerEventName, downHandler);
- eventsEngine.on(document, downPointerEventName, downHandler);
- eventsEngine.on(document, movePointerEventName, moveHandler);
- this._disposeHandlers = function() {
- parameters.root.off(clickEventName, clickHandler);
- parameters.root.off(downPointerEventName, downHandler);
- eventsEngine.off(document, downPointerEventName, downHandler);
- eventsEngine.off(document, movePointerEventName, moveHandler)
- };
- function clickHandler(e) {
- processClick(e, parameters)
- }
- var isRootDown = false;
- function downHandler(e) {
- if (isRootDown) {
- isRootDown = false
- } else {
- if (void 0 !== parameters.getData(e)) {
- isRootDown = true
- }
- moveHandler(e)
- }
- }
- function moveHandler(e) {
- processHover(e, parameters);
- parameters.widget._getOption("tooltip").enabled && processTooltip(e, parameters)
- }
- },
- dispose: function() {
- this._disposeHandlers()
- }
- };
- function processClick(e, params) {
- var id = params.getData(e);
- if (id >= 0) {
- params.click({
- node: params.getNode(id),
- coords: params.getCoords(e),
- event: e
- })
- }
- }
- function processHover(e, params) {
- var id = params.getData(e);
- if (id >= 0) {
- params.getNode(id).setHover()
- } else {
- params.widget.clearHover()
- }
- }
- function processTooltip(e, params) {
- var id = params.getData(e, true);
- var coords;
- if (id >= 0) {
- coords = _eventData(e);
- params.getNode(id).showTooltip([coords.x, coords.y])
- } else {
- params.widget.hideTooltip()
- }
- }
- module.exports.Tracker = Tracker
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/core/renderer_base.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dataUtils = __webpack_require__( /*! ./element_data */ 39);
- var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11);
- var windowUtils = __webpack_require__( /*! ./utils/window */ 7);
- var window = windowUtils.getWindow();
- var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
- var styleUtils = __webpack_require__( /*! ./utils/style */ 85);
- var sizeUtils = __webpack_require__( /*! ./utils/size */ 171);
- var htmlParser = __webpack_require__( /*! ./utils/html_parser */ 255);
- var renderer = function(selector, context) {
- return new initRender(selector, context)
- };
- var initRender = function(selector, context) {
- if (!selector) {
- this.length = 0;
- return this
- }
- if ("string" === typeof selector) {
- if ("body" === selector) {
- this[0] = context ? context.body : domAdapter.getBody();
- this.length = 1;
- return this
- }
- context = context || domAdapter.getDocument();
- if ("<" === selector[0]) {
- this[0] = domAdapter.createElement(selector.slice(1, -1), context);
- this.length = 1;
- return this
- } [].push.apply(this, domAdapter.querySelectorAll(context, selector));
- return this
- } else {
- if (domAdapter.isNode(selector) || typeUtils.isWindow(selector)) {
- this[0] = selector;
- this.length = 1;
- return this
- } else {
- if (Array.isArray(selector)) {
- [].push.apply(this, selector);
- return this
- }
- }
- }
- return renderer(selector.toArray ? selector.toArray() : [selector])
- };
- renderer.fn = {
- dxRenderer: true
- };
- initRender.prototype = renderer.fn;
- var repeatMethod = function(methodName, args) {
- for (var i = 0; i < this.length; i++) {
- var item = renderer(this[i]);
- item[methodName].apply(item, args)
- }
- return this
- };
- var setAttributeValue = function(element, attrName, value) {
- if (void 0 !== value && null !== value) {
- domAdapter.setAttribute(element, attrName, value)
- } else {
- domAdapter.removeAttribute(element, attrName)
- }
- };
- initRender.prototype.show = function() {
- return this.toggle(true)
- };
- initRender.prototype.hide = function() {
- return this.toggle(false)
- };
- initRender.prototype.toggle = function(value) {
- if (this[0]) {
- this.toggleClass("dx-state-invisible", !value)
- }
- return this
- };
- initRender.prototype.attr = function(attrName, value) {
- if (this.length > 1 && arguments.length > 1) {
- return repeatMethod.call(this, "attr", arguments)
- }
- if (!this[0]) {
- if (typeUtils.isObject(attrName) || void 0 !== value) {
- return this
- } else {
- return
- }
- }
- if (!this[0].getAttribute) {
- return this.prop(attrName, value)
- }
- if ("string" === typeof attrName && 1 === arguments.length) {
- var result = this[0].getAttribute(attrName);
- return null == result ? void 0 : result
- } else {
- if (typeUtils.isPlainObject(attrName)) {
- for (var key in attrName) {
- this.attr(key, attrName[key])
- }
- } else {
- setAttributeValue(this[0], attrName, value)
- }
- }
- return this
- };
- initRender.prototype.removeAttr = function(attrName) {
- this[0] && domAdapter.removeAttribute(this[0], attrName);
- return this
- };
- initRender.prototype.prop = function(propName, value) {
- if (!this[0]) {
- return this
- }
- if ("string" === typeof propName && 1 === arguments.length) {
- return this[0][propName]
- } else {
- if (typeUtils.isPlainObject(propName)) {
- for (var key in propName) {
- this.prop(key, propName[key])
- }
- } else {
- domAdapter.setProperty(this[0], propName, value)
- }
- }
- return this
- };
- initRender.prototype.addClass = function(className) {
- return this.toggleClass(className, true)
- };
- initRender.prototype.removeClass = function(className) {
- return this.toggleClass(className, false)
- };
- initRender.prototype.hasClass = function(className) {
- if (!this[0] || void 0 === this[0].className) {
- return false
- }
- var classNames = className.split(" ");
- for (var i = 0; i < classNames.length; i++) {
- if (this[0].classList) {
- if (this[0].classList.contains(classNames[i])) {
- return true
- }
- } else {
- var _className = typeUtils.isString(this[0].className) ? this[0].className : domAdapter.getAttribute(this[0], "class");
- if ((_className || "").split(" ").indexOf(classNames[i]) >= 0) {
- return true
- }
- }
- }
- return false
- };
- initRender.prototype.toggleClass = function(className, value) {
- if (this.length > 1) {
- return repeatMethod.call(this, "toggleClass", arguments)
- }
- if (!this[0] || !className) {
- return this
- }
- value = void 0 === value ? !this.hasClass(className) : value;
- var classNames = className.split(" ");
- for (var i = 0; i < classNames.length; i++) {
- domAdapter.setClass(this[0], classNames[i], value)
- }
- return this
- };
- ["width", "height", "outerWidth", "outerHeight", "innerWidth", "innerHeight"].forEach(function(methodName) {
- var partialName = methodName.toLowerCase().indexOf("width") >= 0 ? "Width" : "Height";
- var propName = partialName.toLowerCase();
- var isOuter = 0 === methodName.indexOf("outer");
- var isInner = 0 === methodName.indexOf("inner");
- initRender.prototype[methodName] = function(value) {
- if (this.length > 1 && arguments.length > 0) {
- return repeatMethod.call(this, methodName, arguments)
- }
- var element = this[0];
- if (!element) {
- return
- }
- if (typeUtils.isWindow(element)) {
- return isOuter ? element["inner" + partialName] : domAdapter.getDocumentElement()["client" + partialName]
- }
- if (domAdapter.isDocument(element)) {
- var documentElement = domAdapter.getDocumentElement();
- var body = domAdapter.getBody();
- return Math.max(body["scroll" + partialName], body["offset" + partialName], documentElement["scroll" + partialName], documentElement["offset" + partialName], documentElement["client" + partialName])
- }
- if (0 === arguments.length || "boolean" === typeof value) {
- var include = {
- paddings: isInner || isOuter,
- borders: isOuter,
- margins: value
- };
- return sizeUtils.getSize(element, propName, include)
- }
- if (void 0 === value || null === value) {
- return this
- }
- if (typeUtils.isNumeric(value)) {
- var elementStyles = window.getComputedStyle(element);
- var sizeAdjustment = sizeUtils.getElementBoxParams(propName, elementStyles);
- var isBorderBox = "border-box" === elementStyles.boxSizing;
- value = Number(value);
- if (isOuter) {
- value -= isBorderBox ? 0 : sizeAdjustment.border + sizeAdjustment.padding
- } else {
- if (isInner) {
- value += isBorderBox ? sizeAdjustment.border : -sizeAdjustment.padding
- } else {
- if (isBorderBox) {
- value += sizeAdjustment.border + sizeAdjustment.padding
- }
- }
- }
- }
- value += typeUtils.isNumeric(value) ? "px" : "";
- domAdapter.setStyle(element, propName, value);
- return this
- }
- });
- initRender.prototype.html = function(value) {
- if (!arguments.length) {
- return this[0].innerHTML
- }
- this.empty();
- if ("string" === typeof value && !htmlParser.isTablePart(value) || "number" === typeof value) {
- this[0].innerHTML = value;
- return this
- }
- return this.append(htmlParser.parseHTML(value))
- };
- var appendElements = function(element, nextSibling) {
- if (!this[0] || !element) {
- return
- }
- if ("string" === typeof element) {
- element = htmlParser.parseHTML(element)
- } else {
- if (element.nodeType) {
- element = [element]
- } else {
- if (typeUtils.isNumeric(element)) {
- element = [domAdapter.createTextNode(element)]
- }
- }
- }
- for (var i = 0; i < element.length; i++) {
- var item = element[i];
- var container = this[0];
- var wrapTR = "TABLE" === container.tagName && "TR" === item.tagName;
- if (wrapTR && container.tBodies && container.tBodies.length) {
- container = container.tBodies[0]
- }
- domAdapter.insertElement(container, item.nodeType ? item : item[0], nextSibling)
- }
- };
- var setCss = function(name, value) {
- if (!this[0] || !this[0].style) {
- return
- }
- if (null === value || "number" === typeof value && isNaN(value)) {
- return
- }
- name = styleUtils.styleProp(name);
- for (var i = 0; i < this.length; i++) {
- this[i].style[name] = styleUtils.normalizeStyleProp(name, value)
- }
- };
- initRender.prototype.css = function(name, value) {
- if (typeUtils.isString(name)) {
- if (2 === arguments.length) {
- setCss.call(this, name, value)
- } else {
- if (!this[0]) {
- return
- }
- name = styleUtils.styleProp(name);
- var result = window.getComputedStyle(this[0])[name] || this[0].style[name];
- return typeUtils.isNumeric(result) ? result.toString() : result
- }
- } else {
- if (typeUtils.isPlainObject(name)) {
- for (var key in name) {
- setCss.call(this, key, name[key])
- }
- }
- }
- return this
- };
- initRender.prototype.prepend = function(element) {
- if (arguments.length > 1) {
- for (var i = 0; i < arguments.length; i++) {
- this.prepend(arguments[i])
- }
- return this
- }
- appendElements.apply(this, [element, this[0].firstChild]);
- return this
- };
- initRender.prototype.append = function(element) {
- if (arguments.length > 1) {
- for (var i = 0; i < arguments.length; i++) {
- this.append(arguments[i])
- }
- return this
- }
- appendElements.apply(this, [element]);
- return this
- };
- initRender.prototype.prependTo = function(element) {
- if (this.length > 1) {
- for (var i = this.length - 1; i >= 0; i--) {
- renderer(this[i]).prependTo(element)
- }
- return this
- }
- element = renderer(element);
- if (element[0]) {
- domAdapter.insertElement(element[0], this[0], element[0].firstChild)
- }
- return this
- };
- initRender.prototype.appendTo = function(element) {
- if (this.length > 1) {
- return repeatMethod.call(this, "appendTo", arguments)
- }
- domAdapter.insertElement(renderer(element)[0], this[0]);
- return this
- };
- initRender.prototype.insertBefore = function(element) {
- if (element && element[0]) {
- domAdapter.insertElement(element[0].parentNode, this[0], element[0])
- }
- return this
- };
- initRender.prototype.insertAfter = function(element) {
- if (element && element[0]) {
- domAdapter.insertElement(element[0].parentNode, this[0], element[0].nextSibling)
- }
- return this
- };
- initRender.prototype.before = function(element) {
- if (this[0]) {
- domAdapter.insertElement(this[0].parentNode, element[0], this[0])
- }
- return this
- };
- initRender.prototype.after = function(element) {
- if (this[0]) {
- domAdapter.insertElement(this[0].parentNode, element[0], this[0].nextSibling)
- }
- return this
- };
- initRender.prototype.wrap = function(wrapper) {
- if (this[0]) {
- var wrap = renderer(wrapper);
- wrap.insertBefore(this);
- wrap.append(this)
- }
- return this
- };
- initRender.prototype.wrapInner = function(wrapper) {
- var contents = this.contents();
- if (contents.length) {
- contents.wrap(wrapper)
- } else {
- this.append(wrapper)
- }
- return this
- };
- initRender.prototype.replaceWith = function(element) {
- if (!(element && element[0])) {
- return
- }
- if (element.is(this)) {
- return this
- }
- element.insertBefore(this);
- this.remove();
- return element
- };
- initRender.prototype.remove = function() {
- if (this.length > 1) {
- return repeatMethod.call(this, "remove", arguments)
- }
- dataUtils.cleanDataRecursive(this[0], true);
- domAdapter.removeElement(this[0]);
- return this
- };
- initRender.prototype.detach = function() {
- if (this.length > 1) {
- return repeatMethod.call(this, "detach", arguments)
- }
- domAdapter.removeElement(this[0]);
- return this
- };
- initRender.prototype.empty = function() {
- if (this.length > 1) {
- return repeatMethod.call(this, "empty", arguments)
- }
- dataUtils.cleanDataRecursive(this[0]);
- domAdapter.setText(this[0], "");
- return this
- };
- initRender.prototype.clone = function() {
- var result = [];
- for (var i = 0; i < this.length; i++) {
- result.push(this[i].cloneNode(true))
- }
- return renderer(result)
- };
- initRender.prototype.text = function(value) {
- if (!arguments.length) {
- var result = "";
- for (var i = 0; i < this.length; i++) {
- result += this[i] && this[i].textContent || ""
- }
- return result
- }
- var text = typeUtils.isFunction(value) ? value() : value;
- dataUtils.cleanDataRecursive(this[0], false);
- domAdapter.setText(this[0], typeUtils.isDefined(text) ? text : "");
- return this
- };
- initRender.prototype.val = function(value) {
- if (1 === arguments.length) {
- return this.prop("value", typeUtils.isDefined(value) ? value : "")
- }
- return this.prop("value")
- };
- initRender.prototype.contents = function() {
- if (!this[0]) {
- return renderer()
- }
- var result = [];
- result.push.apply(result, this[0].childNodes);
- return renderer(result)
- };
- initRender.prototype.find = function(selector) {
- var result = renderer();
- if (!selector) {
- return result
- }
- var nodes = [];
- var i;
- if ("string" === typeof selector) {
- selector = selector.trim();
- for (i = 0; i < this.length; i++) {
- var element = this[i];
- if (domAdapter.isElementNode(element)) {
- var elementId = element.getAttribute("id");
- var queryId = elementId || "dx-query-children";
- if (!elementId) {
- setAttributeValue(element, "id", queryId)
- }
- queryId = "[id='" + queryId + "'] ";
- var querySelector = queryId + selector.replace(/([^\\])(,)/g, "$1, " + queryId);
- nodes.push.apply(nodes, domAdapter.querySelectorAll(element, querySelector));
- setAttributeValue(element, "id", elementId)
- } else {
- if (domAdapter.isDocument(element)) {
- nodes.push.apply(nodes, domAdapter.querySelectorAll(element, selector))
- }
- }
- }
- } else {
- for (i = 0; i < this.length; i++) {
- selector = domAdapter.isNode(selector) ? selector : selector[0];
- if (this[i] !== selector && this[i].contains(selector)) {
- nodes.push(selector)
- }
- }
- }
- return result.add(nodes)
- };
- var isVisible = function(_, element) {
- if (!element.nodeType) {
- return true
- }
- return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length)
- };
- initRender.prototype.filter = function(selector) {
- if (!selector) {
- return renderer()
- }
- if (":visible" === selector) {
- return this.filter(isVisible)
- } else {
- if (":hidden" === selector) {
- return this.filter(function(_, element) {
- return !isVisible(_, element)
- })
- }
- }
- var result = [];
- for (var i = 0; i < this.length; i++) {
- var item = this[i];
- if (domAdapter.isElementNode(item) && "string" === typeUtils.type(selector)) {
- domAdapter.elementMatches(item, selector) && result.push(item)
- } else {
- if (domAdapter.isNode(selector) || typeUtils.isWindow(selector)) {
- selector === item && result.push(item)
- } else {
- if (typeUtils.isFunction(selector)) {
- selector.call(item, i, item) && result.push(item)
- } else {
- for (var j = 0; j < selector.length; j++) {
- selector[j] === item && result.push(item)
- }
- }
- }
- }
- }
- return renderer(result)
- };
- initRender.prototype.not = function(selector) {
- var result = [];
- var nodes = this.filter(selector).toArray();
- for (var i = 0; i < this.length; i++) {
- if (nodes.indexOf(this[i]) === -1) {
- result.push(this[i])
- }
- }
- return renderer(result)
- };
- initRender.prototype.is = function(selector) {
- return !!this.filter(selector).length
- };
- initRender.prototype.children = function(selector) {
- var result = [];
- for (var i = 0; i < this.length; i++) {
- var nodes = this[i] ? this[i].childNodes : [];
- for (var j = 0; j < nodes.length; j++) {
- if (domAdapter.isElementNode(nodes[j])) {
- result.push(nodes[j])
- }
- }
- }
- result = renderer(result);
- return selector ? result.filter(selector) : result
- };
- initRender.prototype.siblings = function() {
- var element = this[0];
- if (!element || !element.parentNode) {
- return renderer()
- }
- var result = [];
- var parentChildNodes = element.parentNode.childNodes || [];
- for (var i = 0; i < parentChildNodes.length; i++) {
- var node = parentChildNodes[i];
- if (domAdapter.isElementNode(node) && node !== element) {
- result.push(node)
- }
- }
- return renderer(result)
- };
- initRender.prototype.each = function(callback) {
- for (var i = 0; i < this.length; i++) {
- if (false === callback.call(this[i], i, this[i])) {
- break
- }
- }
- };
- initRender.prototype.index = function(element) {
- if (!element) {
- return this.parent().children().index(this)
- }
- element = renderer(element);
- return this.toArray().indexOf(element[0])
- };
- initRender.prototype.get = function(index) {
- return this[index < 0 ? this.length + index : index]
- };
- initRender.prototype.eq = function(index) {
- index = index < 0 ? this.length + index : index;
- return renderer(this[index])
- };
- initRender.prototype.first = function() {
- return this.eq(0)
- };
- initRender.prototype.last = function() {
- return this.eq(-1)
- };
- initRender.prototype.parent = function(selector) {
- if (!this[0]) {
- return renderer()
- }
- var result = renderer(this[0].parentNode);
- return !selector || result.is(selector) ? result : renderer()
- };
- initRender.prototype.parents = function(selector) {
- var result = [];
- var parent = this.parent();
- while (parent && parent[0] && !domAdapter.isDocument(parent[0])) {
- if (domAdapter.isElementNode(parent[0])) {
- if (!selector || selector && parent.is(selector)) {
- result.push(parent.get(0))
- }
- }
- parent = parent.parent()
- }
- return renderer(result)
- };
- initRender.prototype.closest = function(selector) {
- if (this.is(selector)) {
- return this
- }
- var parent = this.parent();
- while (parent && parent.length) {
- if (parent.is(selector)) {
- return parent
- }
- parent = parent.parent()
- }
- return renderer()
- };
- initRender.prototype.next = function(selector) {
- if (!this[0]) {
- return renderer()
- }
- var next = renderer(this[0].nextSibling);
- if (!arguments.length) {
- return next
- }
- while (next && next.length) {
- if (next.is(selector)) {
- return next
- }
- next = next.next()
- }
- return renderer()
- };
- initRender.prototype.prev = function() {
- if (!this[0]) {
- return renderer()
- }
- return renderer(this[0].previousSibling)
- };
- initRender.prototype.add = function(selector) {
- var targets = renderer(selector);
- var result = this.toArray();
- for (var i = 0; i < targets.length; i++) {
- var target = targets[i];
- if (result.indexOf(target) === -1) {
- result.push(target)
- }
- }
- return renderer(result)
- };
- var emptyArray = [];
- initRender.prototype.splice = function() {
- return renderer(emptyArray.splice.apply(this, arguments))
- };
- initRender.prototype.slice = function() {
- return renderer(emptyArray.slice.apply(this, arguments))
- };
- initRender.prototype.toArray = function() {
- return emptyArray.slice.call(this)
- };
- var getWindowByElement = function(element) {
- return typeUtils.isWindow(element) ? element : element.defaultView
- };
- initRender.prototype.offset = function() {
- if (!this[0]) {
- return
- }
- if (!this[0].getClientRects().length) {
- return {
- top: 0,
- left: 0
- }
- }
- var rect = this[0].getBoundingClientRect();
- var win = getWindowByElement(this[0].ownerDocument);
- var docElem = this[0].ownerDocument.documentElement;
- return {
- top: rect.top + win.pageYOffset - docElem.clientTop,
- left: rect.left + win.pageXOffset - docElem.clientLeft
- }
- };
- initRender.prototype.offsetParent = function() {
- if (!this[0]) {
- return renderer()
- }
- var offsetParent = renderer(this[0].offsetParent);
- while (offsetParent[0] && "static" === offsetParent.css("position")) {
- offsetParent = renderer(offsetParent[0].offsetParent)
- }
- offsetParent = offsetParent[0] ? offsetParent : renderer(domAdapter.getDocumentElement());
- return offsetParent
- };
- initRender.prototype.position = function() {
- if (!this[0]) {
- return
- }
- var offset;
- var marginTop = parseFloat(this.css("marginTop"));
- var marginLeft = parseFloat(this.css("marginLeft"));
- if ("fixed" === this.css("position")) {
- offset = this[0].getBoundingClientRect();
- return {
- top: offset.top - marginTop,
- left: offset.left - marginLeft
- }
- }
- offset = this.offset();
- var offsetParent = this.offsetParent();
- var parentOffset = {
- top: 0,
- left: 0
- };
- if ("HTML" !== offsetParent[0].nodeName) {
- parentOffset = offsetParent.offset()
- }
- parentOffset = {
- top: parentOffset.top + parseFloat(offsetParent.css("borderTopWidth")),
- left: parentOffset.left + parseFloat(offsetParent.css("borderLeftWidth"))
- };
- return {
- top: offset.top - parentOffset.top - marginTop,
- left: offset.left - parentOffset.left - marginLeft
- }
- };
- [{
- name: "scrollLeft",
- offsetProp: "pageXOffset",
- scrollWindow: function(win, value) {
- win.scrollTo(value, win.pageYOffset)
- }
- }, {
- name: "scrollTop",
- offsetProp: "pageYOffset",
- scrollWindow: function(win, value) {
- win.scrollTo(win.pageXOffset, value)
- }
- }].forEach(function(directionStrategy) {
- var propName = directionStrategy.name;
- initRender.prototype[propName] = function(value) {
- if (!this[0]) {
- return
- }
- var window = getWindowByElement(this[0]);
- if (void 0 === value) {
- return window ? window[directionStrategy.offsetProp] : this[0][propName]
- }
- if (window) {
- directionStrategy.scrollWindow(window, value)
- } else {
- this[0][propName] = value
- }
- return this
- }
- });
- initRender.prototype.data = function(key, value) {
- if (!this[0]) {
- return
- }
- if (arguments.length < 2) {
- return dataUtils.data.call(renderer, this[0], key)
- }
- dataUtils.data.call(renderer, this[0], key, value);
- return this
- };
- initRender.prototype.removeData = function(key) {
- this[0] && dataUtils.removeData(this[0], key);
- return this
- };
- var rendererWrapper = function() {
- return renderer.apply(this, arguments)
- };
- Object.defineProperty(rendererWrapper, "fn", {
- enumerable: true,
- configurable: true,
- get: function() {
- return renderer.fn
- },
- set: function(value) {
- renderer.fn = value
- }
- });
- module.exports = {
- set: function(strategy) {
- renderer = strategy
- },
- get: function() {
- return rendererWrapper
- }
- }
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/events/core/hook_touch_props.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var touchPropsToHook = ["pageX", "pageY", "screenX", "screenY", "clientX", "clientY"];
- var touchPropHook = function(name, event) {
- if (event[name] && !event.touches || !event.touches) {
- return event[name]
- }
- var touches = event.touches.length ? event.touches : event.changedTouches;
- if (!touches.length) {
- return
- }
- return touches[0][name]
- };
- module.exports = function(callback) {
- touchPropsToHook.forEach(function(name) {
- callback(name, function(event) {
- return touchPropHook(name, event)
- })
- }, this)
- }
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/core/utils/html_parser.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var merge = __webpack_require__( /*! ./array */ 14).merge;
- var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
- var isTagName = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i;
- var tagWrappers = {
- "default": {
- tagsCount: 0,
- startTags: "",
- endTags: ""
- },
- thead: {
- tagsCount: 1,
- startTags: "<table>",
- endTags: "</table>"
- },
- td: {
- tagsCount: 3,
- startTags: "<table><tbody><tr>",
- endTags: "</tr></tbody></table>"
- },
- col: {
- tagsCount: 2,
- startTags: "<table><colgroup>",
- endTags: "</colgroup></table>"
- },
- tr: {
- tagsCount: 2,
- startTags: "<table><tbody>",
- endTags: "</tbody></table>"
- }
- };
- tagWrappers.tbody = tagWrappers.colgroup = tagWrappers.caption = tagWrappers.tfoot = tagWrappers.thead;
- tagWrappers.th = tagWrappers.td;
- var parseHTML = function(html) {
- if ("string" !== typeof html) {
- return null
- }
- var fragment = domAdapter.createDocumentFragment();
- var container = fragment.appendChild(domAdapter.createElement("div"));
- var tags = isTagName.exec(html);
- var firstRootTag = tags && tags[1].toLowerCase();
- var tagWrapper = tagWrappers[firstRootTag] || tagWrappers.default;
- container.innerHTML = tagWrapper.startTags + html + tagWrapper.endTags;
- for (var i = 0; i < tagWrapper.tagsCount; i++) {
- container = container.lastChild
- }
- return merge([], container.childNodes)
- };
- var isTablePart = function(html) {
- var tags = isTagName.exec(html);
- return tags && tags[1] in tagWrappers
- };
- exports.parseHTML = parseHTML;
- exports.isTablePart = isTablePart
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/localization/utils.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.toFixed = void 0;
- var _math = __webpack_require__( /*! ../core/utils/math */ 28);
- var DECIMAL_BASE = 10;
- function roundByAbs(value) {
- var valueSign = (0, _math.sign)(value);
- return valueSign * Math.round(Math.abs(value))
- }
- function adjustValue(value, precision) {
- var precisionMultiplier = Math.pow(DECIMAL_BASE, precision);
- var roundMultiplier = precisionMultiplier * DECIMAL_BASE;
- var intermediateValue = value * roundMultiplier / DECIMAL_BASE;
- return roundByAbs(intermediateValue) / precisionMultiplier
- }
- function toFixed(value, precision) {
- var valuePrecision = precision || 0;
- var adjustedValue = valuePrecision > 0 ? adjustValue.apply(void 0, arguments) : value;
- return adjustedValue.toFixed(valuePrecision)
- }
- exports.toFixed = toFixed
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/localization/ldml/date.formatter.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function leftPad(text, length) {
- while (text.length < length) {
- text = "0" + text
- }
- return text
- }
- var FORMAT_TYPES = {
- 3: "abbreviated",
- 4: "wide",
- 5: "narrow"
- };
- var LDML_FORMATTERS = {
- y: function(date, count, useUtc) {
- var year = date[useUtc ? "getUTCFullYear" : "getFullYear"]();
- if (2 === count) {
- year %= 100
- }
- return leftPad(year.toString(), count)
- },
- M: function(date, count, useUtc, dateParts) {
- var month = date[useUtc ? "getUTCMonth" : "getMonth"]();
- var formatType = FORMAT_TYPES[count];
- if (formatType) {
- return dateParts.getMonthNames(formatType, "format")[month]
- }
- return leftPad((month + 1).toString(), Math.min(count, 2))
- },
- L: function(date, count, useUtc, dateParts) {
- var month = date[useUtc ? "getUTCMonth" : "getMonth"]();
- var formatType = FORMAT_TYPES[count];
- if (formatType) {
- return dateParts.getMonthNames(formatType, "standalone")[month]
- }
- return leftPad((month + 1).toString(), Math.min(count, 2))
- },
- Q: function(date, count, useUtc, dateParts) {
- var month = date[useUtc ? "getUTCMonth" : "getMonth"]();
- var quarter = Math.floor(month / 3);
- var formatType = FORMAT_TYPES[count];
- if (formatType) {
- return dateParts.getQuarterNames(formatType)[quarter]
- }
- return leftPad((quarter + 1).toString(), Math.min(count, 2))
- },
- E: function(date, count, useUtc, dateParts) {
- var day = date[useUtc ? "getUTCDay" : "getDay"]();
- var formatType = FORMAT_TYPES[count < 3 ? 3 : count];
- return dateParts.getDayNames(formatType)[day]
- },
- a: function(date, count, useUtc, dateParts) {
- var hours = date[useUtc ? "getUTCHours" : "getHours"]();
- var period = hours < 12 ? 0 : 1;
- var formatType = FORMAT_TYPES[count];
- return dateParts.getPeriodNames(formatType)[period]
- },
- d: function(date, count, useUtc) {
- return leftPad(date[useUtc ? "getUTCDate" : "getDate"]().toString(), Math.min(count, 2))
- },
- H: function(date, count, useUtc) {
- return leftPad(date[useUtc ? "getUTCHours" : "getHours"]().toString(), Math.min(count, 2))
- },
- h: function(date, count, useUtc) {
- var hours = date[useUtc ? "getUTCHours" : "getHours"]();
- return leftPad((hours % 12 || 12).toString(), Math.min(count, 2))
- },
- m: function(date, count, useUtc) {
- return leftPad(date[useUtc ? "getUTCMinutes" : "getMinutes"]().toString(), Math.min(count, 2))
- },
- s: function(date, count, useUtc) {
- return leftPad(date[useUtc ? "getUTCSeconds" : "getSeconds"]().toString(), Math.min(count, 2))
- },
- S: function(date, count, useUtc) {
- return leftPad(date[useUtc ? "getUTCMilliseconds" : "getMilliseconds"]().toString(), 3).substr(0, count)
- },
- x: function(date, count, useUtc) {
- var timezoneOffset = useUtc ? 0 : date.getTimezoneOffset();
- var signPart = timezoneOffset > 0 ? "-" : "+";
- var timezoneOffsetAbs = Math.abs(timezoneOffset);
- var hours = Math.floor(timezoneOffsetAbs / 60);
- var minutes = timezoneOffsetAbs % 60;
- var hoursPart = leftPad(hours.toString(), 2);
- var minutesPart = leftPad(minutes.toString(), 2);
- return signPart + hoursPart + (count >= 3 ? ":" : "") + (count > 1 || minutes ? minutesPart : "")
- },
- X: function(date, count, useUtc) {
- if (useUtc || !date.getTimezoneOffset()) {
- return "Z"
- }
- return LDML_FORMATTERS.x(date, count, useUtc)
- },
- Z: function(date, count, useUtc) {
- return LDML_FORMATTERS.X(date, count >= 5 ? 3 : 2, useUtc)
- }
- };
- var getFormatter = function(format, dateParts) {
- return function(date) {
- var charIndex;
- var formatter;
- var char;
- var charCount = 0;
- var separator = "'";
- var isEscaping = false;
- var isCurrentCharEqualsNext;
- var result = "";
- if (!date) {
- return null
- }
- if (!format) {
- return date
- }
- var useUtc = "Z" === format[format.length - 1] || "'Z'" === format.slice(-3);
- for (charIndex = 0; charIndex < format.length; charIndex++) {
- char = format[charIndex];
- formatter = LDML_FORMATTERS[char];
- isCurrentCharEqualsNext = char === format[charIndex + 1];
- charCount++;
- if (!isCurrentCharEqualsNext) {
- if (formatter && !isEscaping) {
- result += formatter(date, charCount, useUtc, dateParts)
- }
- charCount = 0
- }
- if (char === separator && !isCurrentCharEqualsNext) {
- isEscaping = !isEscaping
- } else {
- if (isEscaping || !formatter) {
- result += char
- }
- }
- if (char === separator && isCurrentCharEqualsNext) {
- charIndex++
- }
- }
- return result
- }
- };
- module.exports.getFormatter = getFormatter
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/localization/default_date_names.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
- var DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
- var PERIODS = ["AM", "PM"];
- var QUARTERS = ["Q1", "Q2", "Q3", "Q4"];
- var cutCaptions = function(captions, format) {
- var lengthByFormat = {
- abbreviated: 3,
- "short": 2,
- narrow: 1
- };
- return iteratorUtils.map(captions, function(caption) {
- return caption.substr(0, lengthByFormat[format])
- })
- };
- module.exports = {
- getMonthNames: function(format) {
- return cutCaptions(MONTHS, format)
- },
- getDayNames: function(format) {
- return cutCaptions(DAYS, format)
- },
- getQuarterNames: function(format) {
- return QUARTERS
- },
- getPeriodNames: function(format) {
- return PERIODS
- }
- }
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.fill_helper.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- var _excel3 = __webpack_require__( /*! ./excel.pattern_fill_helper */ 436);
- var _excel4 = _interopRequireDefault(_excel3);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var fillHelper = {
- tryCreateTag: function(sourceObj) {
- var result = null;
- if ((0, _type.isDefined)(sourceObj)) {
- result = {
- patternFill: _excel4.default.tryCreateTag(sourceObj.patternFill)
- };
- if (fillHelper.isEmpty(result)) {
- result = null
- }
- }
- return result
- },
- tryCreateFillFromSimpleFormat: function() {
- var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
- backgroundColor = _ref.backgroundColor,
- fillPatternType = _ref.fillPatternType,
- fillPatternColor = _ref.fillPatternColor;
- if ((0, _type.isDefined)(backgroundColor) && !((0, _type.isDefined)(fillPatternType) && (0, _type.isDefined)(fillPatternColor))) {
- return {
- patternFill: {
- patternType: "solid",
- foregroundColor: {
- rgb: backgroundColor
- }
- }
- }
- } else {
- if ((0, _type.isDefined)(fillPatternType) && (0, _type.isDefined)(fillPatternColor)) {
- return {
- patternFill: {
- patternType: fillPatternType,
- foregroundColor: {
- rgb: fillPatternColor
- },
- backgroundColor: {
- rgb: backgroundColor
- }
- }
- }
- }
- }
- },
- copySimpleFormat: function(source, target) {
- if (void 0 !== source.backgroundColor) {
- target.backgroundColor = source.backgroundColor
- }
- if (void 0 !== source.fillPatternType) {
- target.fillPatternType = source.fillPatternType
- }
- if (void 0 !== source.fillPatternColor) {
- target.fillPatternColor = source.fillPatternColor
- }
- },
- copy: function(source) {
- var result = null;
- if ((0, _type.isDefined)(source)) {
- result = {};
- if (void 0 !== source.patternFill) {
- result.patternFill = _excel4.default.copy(source.patternFill)
- }
- }
- return result
- },
- areEqual: function(leftTag, rightTag) {
- return fillHelper.isEmpty(leftTag) && fillHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && _excel4.default.areEqual(leftTag.patternFill, rightTag.patternFill)
- },
- isEmpty: function(tag) {
- return !(0, _type.isDefined)(tag) || _excel4.default.isEmpty(tag.patternFill)
- },
- toXml: function(tag) {
- return _excel2.default.toXml("fill", {}, _excel4.default.toXml(tag.patternFill))
- }
- };
- exports.default = fillHelper
- },
- /*!*******************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.color_helper.js ***!
- \*******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var colorHelper = {
- _tryConvertColor: function(source) {
- if ("string" !== typeof source) {
- return source
- }
- var result;
- if (source.length > 0 && "#" === source[0]) {
- var colorCode = source.substr(1, source.length);
- if (6 === colorCode.length) {
- result = "FF" + colorCode
- } else {
- if (8 === colorCode.length) {
- result = colorCode[6] + colorCode[7] + colorCode.substr(0, 6)
- } else {
- result = colorCode
- }
- }
- } else {
- result = source
- }
- return result
- },
- tryCreateTag: function(sourceObj) {
- var result = null;
- if ((0, _type.isDefined)(sourceObj)) {
- if ("string" === typeof sourceObj) {
- result = {
- rgb: this._tryConvertColor(sourceObj)
- }
- } else {
- result = {
- rgb: this._tryConvertColor(sourceObj.rgb),
- theme: sourceObj.theme
- }
- }
- if (colorHelper.isEmpty(result)) {
- result = null
- }
- }
- return result
- },
- copy: function(source) {
- var result = null;
- if ((0, _type.isDefined)(source)) {
- if ("string" === typeof source) {
- result = source
- } else {
- result = {};
- if (void 0 !== source.rgb) {
- result.rgb = source.rgb
- }
- if (void 0 !== source.theme) {
- result.theme = source.theme
- }
- }
- }
- return result
- },
- isEmpty: function(tag) {
- return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.rgb) && !(0, _type.isDefined)(tag.theme)
- },
- areEqual: function(leftTag, rightTag) {
- return colorHelper.isEmpty(leftTag) && colorHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.rgb === rightTag.rgb && leftTag.theme === rightTag.theme
- },
- toXml: function(tagName, tag) {
- return _excel2.default.toXml(tagName, {
- rgb: tag.rgb,
- theme: tag.theme
- })
- }
- };
- exports.default = colorHelper
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.font_helper.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- var _excel3 = __webpack_require__( /*! ./excel.color_helper */ 260);
- var _excel4 = _interopRequireDefault(_excel3);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var fontHelper = {
- tryCreateTag: function(sourceObj) {
- var result = null;
- if ((0, _type.isDefined)(sourceObj)) {
- result = {
- size: sourceObj.size,
- name: sourceObj.name,
- family: sourceObj.family,
- scheme: sourceObj.scheme,
- bold: sourceObj.bold,
- italic: sourceObj.italic,
- underline: sourceObj.underline,
- color: _excel4.default.tryCreateTag(sourceObj.color)
- };
- if (fontHelper.isEmpty(result)) {
- result = null
- }
- }
- return result
- },
- copy: function(source) {
- var result = null;
- if ((0, _type.isDefined)(source)) {
- result = {};
- if (void 0 !== source.size) {
- result.size = source.size
- }
- if (void 0 !== source.name) {
- result.name = source.name
- }
- if (void 0 !== source.family) {
- result.family = source.family
- }
- if (void 0 !== source.scheme) {
- result.scheme = source.scheme
- }
- if (void 0 !== source.bold) {
- result.bold = source.bold
- }
- if (void 0 !== source.italic) {
- result.italic = source.italic
- }
- if (void 0 !== source.underline) {
- result.underline = source.underline
- }
- if (void 0 !== source.color) {
- result.color = _excel4.default.copy(source.color)
- }
- }
- return result
- },
- areEqual: function(leftTag, rightTag) {
- return fontHelper.isEmpty(leftTag) && fontHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.size === rightTag.size && leftTag.name === rightTag.name && leftTag.family === rightTag.family && leftTag.scheme === rightTag.scheme && (leftTag.bold === rightTag.bold || !leftTag.bold === !rightTag.bold) && (leftTag.italic === rightTag.italic || !leftTag.italic === !rightTag.italic) && leftTag.underline === rightTag.underline && _excel4.default.areEqual(leftTag.color, rightTag.color)
- },
- isEmpty: function(tag) {
- return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.size) && !(0, _type.isDefined)(tag.name) && !(0, _type.isDefined)(tag.family) && !(0, _type.isDefined)(tag.scheme) && (!(0, _type.isDefined)(tag.bold) || !tag.bold) && (!(0, _type.isDefined)(tag.italic) || !tag.italic) && !(0, _type.isDefined)(tag.underline) && _excel4.default.isEmpty(tag.color)
- },
- toXml: function(tag) {
- var content = [(0, _type.isDefined)(tag.bold) && tag.bold ? _excel2.default.toXml("b", {}) : "", (0, _type.isDefined)(tag.size) ? _excel2.default.toXml("sz", {
- val: tag.size
- }) : "", (0, _type.isDefined)(tag.color) ? _excel4.default.toXml("color", tag.color) : "", (0, _type.isDefined)(tag.name) ? _excel2.default.toXml("name", {
- val: tag.name
- }) : "", (0, _type.isDefined)(tag.family) ? _excel2.default.toXml("family", {
- val: tag.family
- }) : "", (0, _type.isDefined)(tag.scheme) ? _excel2.default.toXml("scheme", {
- val: tag.scheme
- }) : "", (0, _type.isDefined)(tag.italic) && tag.italic ? _excel2.default.toXml("i", {}) : "", (0, _type.isDefined)(tag.underline) ? _excel2.default.toXml("u", {
- val: tag.underline
- }) : ""].join("");
- return _excel2.default.toXml("font", {}, content)
- }
- };
- exports.default = fontHelper
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/exporter/image_creator.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _color = __webpack_require__( /*! ../color */ 94);
- var _color2 = _interopRequireDefault(_color);
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _svg = __webpack_require__( /*! ../core/utils/svg */ 209);
- var _svg2 = _interopRequireDefault(_svg);
- var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
- var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _dom = __webpack_require__( /*! ../core/utils/dom */ 12);
- var _dom2 = _interopRequireDefault(_dom);
- var _window = __webpack_require__( /*! ../core/utils/window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 33);
- var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var window = _window2.default.getWindow();
- var _math = Math;
- var PI = _math.PI;
- var _min = _math.min;
- var _abs = _math.abs;
- var _sqrt = _math.sqrt;
- var _pow = _math.pow;
- var _atan2 = _math.atan2;
- var _cos = _math.cos;
- var _sin = _math.sin;
- var _number = Number;
- var IMAGE_QUALITY = 1;
- var TEXT_DECORATION_LINE_WIDTH_COEFF = .05;
- var DEFAULT_FONT_SIZE = "10px";
- var DEFAULT_FONT_FAMILY = "sans-serif";
- var DEFAULT_TEXT_COLOR = "#000";
- function createCanvas(width, height, margin) {
- var canvas = (0, _renderer2.default)("<canvas>")[0];
- canvas.width = width + 2 * margin;
- canvas.height = height + 2 * margin;
- canvas.hidden = true;
- return canvas
- }
- function getStringFromCanvas(canvas, mimeType) {
- var dataURL = canvas.toDataURL(mimeType, IMAGE_QUALITY);
- var imageData = window.atob(dataURL.substring(("data:" + mimeType + ";base64,").length));
- return imageData
- }
- function arcTo(x1, y1, x2, y2, radius, largeArcFlag, clockwise, context) {
- var cBx = (x1 + x2) / 2;
- var cBy = (y1 + y2) / 2;
- var aB = _atan2(y1 - y2, x1 - x2);
- var k = largeArcFlag ? 1 : -1;
- aB += 90 * (PI / 180) * (clockwise ? 1 : -1);
- var opSide = _sqrt(_pow(x2 - x1, 2) + _pow(y2 - y1, 2)) / 2;
- var adjSide = _sqrt(_abs(_pow(radius, 2) - _pow(opSide, 2)));
- var centerX = cBx + k * (adjSide * _cos(aB));
- var centerY = cBy + k * (adjSide * _sin(aB));
- var startAngle = _atan2(y1 - centerY, x1 - centerX);
- var endAngle = _atan2(y2 - centerY, x2 - centerX);
- context.arc(centerX, centerY, radius, startAngle, endAngle, !clockwise)
- }
- function getElementOptions(element, rootAppended) {
- var attr = parseAttributes(element.attributes || {});
- var options = (0, _extend.extend)({}, attr, {
- text: element.textContent.replace(/\s+/g, " "),
- textAlign: "middle" === attr["text-anchor"] ? "center" : attr["text-anchor"]
- });
- var transform = attr.transform;
- var coords;
- if (transform) {
- coords = transform.match(/translate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*)*/);
- if (coords) {
- coords = coords[0].match(/-*\d+([.]\d+)*/g);
- options.translateX = _number(coords[0]);
- options.translateY = coords[1] ? _number(coords[1]) : 0
- }
- coords = transform.match(/rotate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*,*\s*-*\d+([.]\d+)*)*/);
- if (coords) {
- coords = coords[0].match(/-*\d+([.]\d+)*/g);
- options.rotationAngle = _number(coords[0]);
- options.rotationX = coords[1] && _number(coords[1]);
- options.rotationY = coords[2] && _number(coords[2])
- }
- coords = transform.match(/scale\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*)*/);
- if (coords) {
- coords = coords[0].match(/-*\d+([.]\d+)*/g);
- options.scaleX = _number(coords[0]);
- if (coords.length > 1) {
- options.scaleY = _number(coords[1])
- } else {
- options.scaleY = options.scaleX
- }
- }
- }
- parseStyles(element, options, rootAppended);
- return options
- }
- function drawRect(context, options) {
- var x = options.x;
- var y = options.y;
- var width = options.width;
- var height = options.height;
- var cornerRadius = options.rx;
- if (!cornerRadius) {
- context.rect(x, y, width, height)
- } else {
- cornerRadius = _min(cornerRadius, width / 2, height / 2);
- context.save();
- context.translate(x, y);
- context.moveTo(width / 2, 0);
- context.arcTo(width, 0, width, height, cornerRadius);
- context.arcTo(width, height, 0, height, cornerRadius);
- context.arcTo(0, height, 0, 0, cornerRadius);
- context.arcTo(0, 0, cornerRadius, 0, cornerRadius);
- context.lineTo(width / 2, 0);
- context.restore()
- }
- }
- function drawImage(context, options, shared) {
- var d = new _deferred.Deferred;
- var image = new window.Image;
- image.onload = function() {
- context.save();
- context.globalAlpha = options.globalAlpha;
- transformElement(context, options);
- clipElement(context, options, shared);
- context.drawImage(image, options.x, options.y, options.width, options.height);
- context.restore();
- d.resolve()
- };
- image.onerror = function() {
- d.resolve()
- };
- image.setAttribute("crossOrigin", "anonymous");
- image.src = options.href || options["xlink:href"];
- return d
- }
- function drawPath(context, dAttr) {
- var dArray = dAttr.replace(/,/g, " ").split(/([A-Z])/i).filter(function(item) {
- return "" !== item.trim()
- });
- var i = 0;
- var prevParams;
- var prevParamsLen;
- do {
- var params = (dArray[i + 1] || "").trim().split(" ");
- switch (dArray[i]) {
- case "M":
- context.moveTo(_number(params[0]), _number(params[1]));
- i += 2;
- break;
- case "L":
- for (var j = 0; j < params.length / 2; j++) {
- context.lineTo(_number(params[2 * j]), _number(params[2 * j + 1]))
- }
- i += 2;
- break;
- case "C":
- context.bezierCurveTo(_number(params[0]), _number(params[1]), _number(params[2]), _number(params[3]), _number(params[4]), _number(params[5]));
- i += 2;
- break;
- case "a":
- prevParams = dArray[i - 1].trim().split(" ");
- prevParamsLen = prevParams.length - 1;
- arcTo(_number(prevParams[prevParamsLen - 1]), _number(prevParams[prevParamsLen]), _number(prevParams[prevParamsLen - 1]) + _number(params[5]), _number(prevParams[prevParamsLen]) + _number(params[6]), _number(params[0]), _number(params[3]), _number(params[4]), context);
- i += 2;
- break;
- case "A":
- prevParams = dArray[i - 1].trim().split(" ");
- prevParamsLen = prevParams.length - 1;
- arcTo(_number(prevParams[prevParamsLen - 1]), _number(prevParams[prevParamsLen]), _number(params[5]), _number(params[6]), _number(params[0]), _number(params[3]), _number(params[4]), context);
- i += 2;
- break;
- case "Z":
- context.closePath();
- i += 1
- }
- } while (i < dArray.length)
- }
- function parseStyles(element, options, rootAppended) {
- var style = element.style || {};
- var field;
- for (field in style) {
- if ("" !== style[field]) {
- options[(0, _inflector.camelize)(field)] = style[field]
- }
- }
- if (rootAppended && _dom_adapter2.default.isElementNode(element)) {
- style = window.getComputedStyle(element);
- ["fill", "stroke", "stroke-width", "font-family", "font-size", "font-style", "font-weight"].forEach(function(prop) {
- if (prop in style && "" !== style[prop]) {
- options[(0, _inflector.camelize)(prop)] = style[prop]
- }
- });
- ["opacity", "fill-opacity", "stroke-opacity"].forEach(function(prop) {
- if (prop in style && "" !== style[prop] && "1" !== style[prop]) {
- options[prop] = _number(style[prop])
- }
- })
- }
- options.textDecoration = options.textDecoration || options.textDecorationLine;
- options.globalAlpha = (0, _type.isDefined)(options.opacity) ? options.opacity : options.globalAlpha
- }
- function parseUrl(urlString) {
- var matches = urlString && urlString.match(/url\(.*#(.*?)["']?\)/i);
- return matches && matches[1]
- }
- function setFontStyle(context, options) {
- var fontParams = [];
- options.fontSize = options.fontSize || DEFAULT_FONT_SIZE;
- options.fontFamily || DEFAULT_FONT_FAMILY;
- options.fill = options.fill || DEFAULT_TEXT_COLOR;
- options.fontStyle && fontParams.push(options.fontStyle);
- options.fontWeight && fontParams.push(options.fontWeight);
- fontParams.push(options.fontSize);
- fontParams.push(options.fontFamily);
- context.font = fontParams.join(" ");
- context.textAlign = options.textAlign;
- context.fillStyle = options.fill;
- context.globalAlpha = options.globalAlpha
- }
- function drawText(context, options, shared) {
- setFontStyle(context, options);
- applyFilter(context, options, shared);
- options.text && context.fillText(options.text, options.x || 0, options.y || 0);
- strokeElement(context, options, true);
- drawTextDecoration(context, options, shared)
- }
- function drawTextDecoration(context, options, shared) {
- if (!options.textDecoration || "none" === options.textDecoration) {
- return
- }
- var x = options.x;
- var textWidth = context.measureText(options.text).width;
- var textHeight = parseInt(options.fontSize, 10);
- var lineHeight = textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF < 1 ? 1 : textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF;
- var y = options.y;
- switch (options.textDecoration) {
- case "line-through":
- y -= textHeight / 3 + lineHeight / 2;
- break;
- case "overline":
- y -= textHeight - lineHeight;
- break;
- case "underline":
- y += lineHeight
- }
- context.rect(x, y, textWidth, lineHeight);
- fillElement(context, options, shared);
- strokeElement(context, options)
- }
- function aggregateOpacity(options) {
- options.strokeOpacity = void 0 !== options["stroke-opacity"] ? options["stroke-opacity"] : 1;
- options.fillOpacity = void 0 !== options["fill-opacity"] ? options["fill-opacity"] : 1;
- if (void 0 !== options.opacity) {
- options.strokeOpacity *= options.opacity;
- options.fillOpacity *= options.opacity
- }
- }
- function hasTspan(element) {
- var nodes = element.childNodes;
- for (var i = 0; i < nodes.length; i++) {
- if ("tspan" === nodes[i].tagName) {
- return true
- }
- }
- return false
- }
- function drawTextElement(childNodes, context, options, shared) {
- var lines = [];
- var line;
- var offset = 0;
- for (var i = 0; i < childNodes.length; i++) {
- var element = childNodes[i];
- if (void 0 === element.tagName) {
- drawElement(element, context, options, shared)
- } else {
- if ("tspan" === element.tagName || "text" === element.tagName) {
- var elementOptions = getElementOptions(element, shared.rootAppended);
- var mergedOptions = (0, _extend.extend)({}, options, elementOptions);
- if ("tspan" === element.tagName && hasTspan(element)) {
- drawTextElement(element.childNodes, context, mergedOptions, shared);
- continue
- }
- mergedOptions.textAlign = "start";
- if (!line || void 0 !== elementOptions.x) {
- line = {
- elements: [],
- options: [],
- widths: [],
- offsets: []
- };
- lines.push(line)
- }
- if (void 0 !== elementOptions.y) {
- offset = 0
- }
- if (void 0 !== elementOptions.dy) {
- offset += parseFloat(elementOptions.dy)
- }
- line.elements.push(element);
- line.options.push(mergedOptions);
- line.offsets.push(offset);
- setFontStyle(context, mergedOptions);
- line.widths.push(context.measureText(mergedOptions.text).width)
- }
- }
- }
- lines.forEach(function(line) {
- var commonWidth = line.widths.reduce(function(commonWidth, width) {
- return commonWidth + width
- }, 0);
- var xDiff = 0;
- var currentOffset = 0;
- if ("center" === options.textAlign) {
- xDiff = commonWidth / 2
- }
- if ("end" === options.textAlign) {
- xDiff = commonWidth
- }
- line.options.forEach(function(o, index) {
- var width = line.widths[index];
- o.x = o.x - xDiff + currentOffset;
- o.y += line.offsets[index];
- currentOffset += width
- });
- line.elements.forEach(function(element, index) {
- drawTextElement(element.childNodes, context, line.options[index], shared)
- })
- })
- }
- function drawElement(element, context, parentOptions, shared) {
- var tagName = element.tagName;
- var isText = "text" === tagName || "tspan" === tagName || void 0 === tagName;
- var isImage = "image" === tagName;
- var options = (0, _extend.extend)({}, parentOptions, getElementOptions(element, shared.rootAppended));
- if ("hidden" === options.visibility || options["hidden-for-export"]) {
- return
- }
- context.save();
- !isImage && transformElement(context, options);
- clipElement(context, options, shared);
- aggregateOpacity(options);
- var promise;
- context.beginPath();
- switch (element.tagName) {
- case void 0:
- drawText(context, options, shared);
- break;
- case "text":
- case "tspan":
- drawTextElement(element.childNodes, context, options, shared);
- break;
- case "image":
- promise = drawImage(context, options, shared);
- break;
- case "path":
- drawPath(context, options.d);
- break;
- case "rect":
- drawRect(context, options);
- context.closePath();
- break;
- case "circle":
- context.arc(options.cx, options.cy, options.r, 0, 2 * PI, 1)
- }
- if (!isText) {
- applyFilter(context, options, shared);
- fillElement(context, options, shared);
- strokeElement(context, options)
- }
- applyGradient(context, options, shared, element);
- context.restore();
- return promise
- }
- function applyGradient(context, options, _ref, element) {
- var gradients = _ref.gradients;
- if (0 === gradients.length) {
- return
- }
- var id = parseUrl(options.fill);
- if (id && gradients[id]) {
- var box = element.getBBox();
- var gradient = context.createLinearGradient(box.x, 0, box.x + box.width, 0);
- gradients[id].forEach(function(opt) {
- var offset = parseInt(opt.offset.replace(/%/, ""));
- gradient.addColorStop(offset / 100, opt.stopColor)
- });
- context.globalAlpha = options.opacity;
- context.fillStyle = gradient;
- context.fill()
- }
- }
- function applyFilter(context, options, shared) {
- var filterOptions;
- var id = parseUrl(options.filter);
- if (id) {
- filterOptions = shared.filters[id];
- if (!filterOptions) {
- filterOptions = {
- offsetX: 0,
- offsetY: 0,
- blur: 0,
- color: "#000"
- }
- }
- context.shadowOffsetX = filterOptions.offsetX;
- context.shadowOffsetY = filterOptions.offsetY;
- context.shadowColor = filterOptions.color;
- context.shadowBlur = filterOptions.blur
- }
- }
- function transformElement(context, options) {
- context.translate(options.translateX || 0, options.translateY || 0);
- options.translateX = void 0;
- options.translateY = void 0;
- if (options.rotationAngle) {
- context.translate(options.rotationX || 0, options.rotationY || 0);
- context.rotate(options.rotationAngle * PI / 180);
- context.translate(-(options.rotationX || 0), -(options.rotationY || 0));
- options.rotationAngle = void 0;
- options.rotationX = void 0;
- options.rotationY = void 0
- }
- if (isFinite(options.scaleX)) {
- context.scale(options.scaleX, options.scaleY);
- options.scaleX = void 0;
- options.scaleY = void 0
- }
- }
- function clipElement(context, options, shared) {
- if (options["clip-path"]) {
- drawElement(shared.clipPaths[parseUrl(options["clip-path"])], context, {}, shared);
- context.clip();
- options["clip-path"] = void 0
- }
- }
- function hex2rgba(hexColor, alpha) {
- var color = new _color2.default(hexColor);
- return "rgba(" + color.r + "," + color.g + "," + color.b + "," + alpha + ")"
- }
- function createGradient(element) {
- var options = [];
- (0, _iterator.each)(element.childNodes, function(_, _ref2) {
- var attributes = _ref2.attributes;
- options.push({
- offset: attributes.offset.value,
- stopColor: attributes["stop-color"].value
- })
- });
- return options
- }
- function createFilter(element) {
- var color;
- var filterOptions = {};
- (0, _iterator.each)(element.childNodes, function(_, node) {
- var attr = node.attributes;
- if (!attr.result) {
- return
- }
- switch (attr.result.value) {
- case "gaussianBlurResult":
- filterOptions.blur = _number(attr.stdDeviation.value);
- break;
- case "offsetResult":
- filterOptions.offsetX = _number(attr.dx.value);
- filterOptions.offsetY = _number(attr.dy.value);
- break;
- case "floodResult":
- color = attr["flood-color"] ? attr["flood-color"].value : "#000";
- var opacity = attr["flood-opacity"] ? attr["flood-opacity"].value : 1;
- filterOptions.color = hex2rgba(color, opacity)
- }
- });
- return filterOptions
- }
- function asyncEach(array, callback) {
- var d = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new _deferred.Deferred;
- if (0 === array.length) {
- return d.resolve()
- }
- var result = callback(array[0]);
- function next() {
- asyncEach(Array.prototype.slice.call(array, 1), callback, d)
- }
- if ((0, _type.isPromise)(result)) {
- result.then(next)
- } else {
- next()
- }
- return d
- }
- function drawCanvasElements(elements, context, parentOptions, shared) {
- return asyncEach(elements, function(element) {
- switch (element.tagName && element.tagName.toLowerCase()) {
- case "g":
- case "svg":
- var options = (0, _extend.extend)({}, parentOptions, getElementOptions(element, shared.rootAppended));
- context.save();
- transformElement(context, options);
- clipElement(context, options, shared);
- var onDone = function() {
- context.restore()
- };
- var d = drawCanvasElements(element.childNodes, context, options, shared);
- if ((0, _type.isPromise)(d)) {
- d.then(onDone)
- } else {
- onDone()
- }
- return d;
- case "defs":
- return drawCanvasElements(element.childNodes, context, {}, shared);
- case "clippath":
- shared.clipPaths[element.attributes.id.textContent] = element.childNodes[0];
- break;
- case "pattern":
- shared.patterns[element.attributes.id.textContent] = element;
- break;
- case "filter":
- shared.filters[element.id] = createFilter(element);
- break;
- case "lineargradient":
- shared.gradients[element.attributes.id.textContent] = createGradient(element);
- break;
- default:
- return drawElement(element, context, parentOptions, shared)
- }
- })
- }
- function setLineDash(context, options) {
- var matches = options["stroke-dasharray"] && options["stroke-dasharray"].match(/(\d+)/g);
- if (matches && matches.length) {
- matches = (0, _iterator.map)(matches, function(item) {
- return _number(item)
- });
- context.setLineDash(matches)
- }
- }
- function strokeElement(context, options, isText) {
- var stroke = options.stroke;
- if (stroke && "none" !== stroke && 0 !== options["stroke-width"]) {
- setLineDash(context, options);
- context.lineJoin = options["stroke-linejoin"];
- context.lineWidth = options["stroke-width"];
- context.globalAlpha = options.strokeOpacity;
- context.strokeStyle = stroke;
- isText ? context.strokeText(options.text, options.x, options.y) : context.stroke();
- context.globalAlpha = 1
- }
- }
- function getPattern(context, pattern, shared) {
- var options = getElementOptions(pattern, shared.rootAppended);
- var patternCanvas = createCanvas(options.width, options.height, 0);
- var patternContext = patternCanvas.getContext("2d");
- drawCanvasElements(pattern.childNodes, patternContext, options, shared);
- return context.createPattern(patternCanvas, "repeat")
- }
- function fillElement(context, options, shared) {
- var fill = options.fill;
- if (fill && "none" !== fill) {
- if (fill.search(/url/) === -1) {
- context.fillStyle = fill
- } else {
- var pattern = shared.patterns[parseUrl(fill)];
- if (!pattern) {
- return
- }
- context.fillStyle = getPattern(context, pattern, shared)
- }
- context.globalAlpha = options.fillOpacity;
- context.fill();
- context.globalAlpha = 1
- }
- }
- var parseAttributes = function(attributes) {
- var newAttributes = {};
- var attr;
- (0, _iterator.each)(attributes, function(index, item) {
- attr = item.textContent;
- if (isFinite(attr)) {
- attr = _number(attr)
- }
- newAttributes[item.name.toLowerCase()] = attr
- });
- return newAttributes
- };
- function drawBackground(context, width, height, backgroundColor, margin) {
- context.fillStyle = backgroundColor || "#ffffff";
- context.fillRect(-margin, -margin, width + 2 * margin, height + 2 * margin)
- }
- function createInvisibleDiv() {
- var invisibleDiv = _dom_adapter2.default.createElement("div");
- invisibleDiv.style.left = "-9999px";
- invisibleDiv.style.position = "absolute";
- return invisibleDiv
- }
- function getCanvasFromSvg(markup, width, height, backgroundColor, margin) {
- var canvas = createCanvas(width, height, margin);
- var context = canvas.getContext("2d");
- var svgElem = _svg2.default.getSvgElement(markup);
- var invisibleDiv;
- var markupIsDomElement = _dom_adapter2.default.isElementNode(markup);
- context.translate(margin, margin);
- _dom_adapter2.default.getBody().appendChild(canvas);
- if (!markupIsDomElement) {
- invisibleDiv = createInvisibleDiv();
- invisibleDiv.appendChild(svgElem);
- _dom_adapter2.default.getBody().appendChild(invisibleDiv)
- }
- if (svgElem.attributes.direction) {
- canvas.dir = svgElem.attributes.direction.textContent
- }
- drawBackground(context, width, height, backgroundColor, margin);
- return drawCanvasElements(svgElem.childNodes, context, {}, {
- clipPaths: {},
- patterns: {},
- filters: {},
- gradients: {},
- rootAppended: markupIsDomElement && _dom2.default.contains(_dom_adapter2.default.getBody(), markup)
- }).then(function() {
- invisibleDiv && _dom_adapter2.default.getBody().removeChild(invisibleDiv);
- _dom_adapter2.default.getBody().removeChild(canvas);
- return canvas
- })
- }
- exports.imageCreator = {
- getImageData: function(markup, options) {
- var mimeType = "image/" + options.format;
- var width = options.width;
- var height = options.height;
- var backgroundColor = options.backgroundColor;
- if ((0, _type.isFunction)(options.__parseAttributesFn)) {
- parseAttributes = options.__parseAttributesFn
- }
- var deferred = new _deferred.Deferred;
- getCanvasFromSvg(markup, width, height, backgroundColor, options.margin).then(function(canvas) {
- deferred.resolve(getStringFromCanvas(canvas, mimeType))
- });
- return deferred
- },
- getData: function(markup, options) {
- var that = this;
- var deferred = new _deferred.Deferred;
- exports.imageCreator.getImageData(markup, options).then(function(binaryData) {
- var mimeType = "image/" + options.format;
- var data = (0, _type.isFunction)(window.Blob) && !options.forceProxy ? that._getBlob(binaryData, mimeType) : that._getBase64(binaryData);
- deferred.resolve(data)
- });
- return deferred
- },
- _getBlob: function(binaryData, mimeType) {
- var dataArray = new Uint8Array(binaryData.length);
- for (var i = 0; i < binaryData.length; i++) {
- dataArray[i] = binaryData.charCodeAt(i)
- }
- return new window.Blob([dataArray.buffer], {
- type: mimeType
- })
- },
- _getBase64: function(binaryData) {
- return window.btoa(binaryData)
- }
- };
- exports.getData = function(data, options, callback) {
- return exports.imageCreator.getData(data, options).then(callback)
- };
- exports.testFormats = function(formats) {
- var canvas = createCanvas(100, 100, 0);
- return formats.reduce(function(r, f) {
- var mimeType = ("image/" + f).toLowerCase();
- if (canvas.toDataURL(mimeType).indexOf(mimeType) !== -1) {
- r.supported.push(f)
- } else {
- r.unsupported.push(f)
- }
- return r
- }, {
- supported: [],
- unsupported: []
- })
- }
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/core/utils/queue.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errors = __webpack_require__( /*! ../errors */ 21);
- var when = __webpack_require__( /*! ../../core/utils/deferred */ 6).when;
- function createQueue(discardPendingTasks) {
- var _tasks = [];
- var _busy = false;
- function exec() {
- while (_tasks.length) {
- _busy = true;
- var task = _tasks.shift();
- var result = task();
- if (void 0 === result) {
- continue
- }
- if (result.then) {
- when(result).always(exec);
- return
- }
- throw errors.Error("E0015")
- }
- _busy = false
- }
- function add(task, removeTaskCallback) {
- if (!discardPendingTasks) {
- _tasks.push(task)
- } else {
- if (_tasks[0] && removeTaskCallback) {
- removeTaskCallback(_tasks[0])
- }
- _tasks = [task]
- }
- if (!_busy) {
- exec()
- }
- }
- function busy() {
- return _busy
- }
- return {
- add: add,
- busy: busy
- }
- }
- exports.create = createQueue;
- exports.enqueue = createQueue().add
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/animation/easing.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
- var CSS_TRANSITION_EASING_REGEX = /cubic-bezier\((\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\)/;
- var TransitionTimingFuncMap = {
- linear: "cubic-bezier(0, 0, 1, 1)",
- swing: "cubic-bezier(0.445, 0.05, 0.55, 0.95)",
- ease: "cubic-bezier(0.25, 0.1, 0.25, 1)",
- "ease-in": "cubic-bezier(0.42, 0, 1, 1)",
- "ease-out": "cubic-bezier(0, 0, 0.58, 1)",
- "ease-in-out": "cubic-bezier(0.42, 0, 0.58, 1)"
- };
- var polynomBezier = function(x1, y1, x2, y2) {
- var Cx = 3 * x1;
- var Bx = 3 * (x2 - x1) - Cx;
- var Ax = 1 - Cx - Bx;
- var Cy = 3 * y1;
- var By = 3 * (y2 - y1) - Cy;
- var Ay = 1 - Cy - By;
- var bezierX = function(t) {
- return t * (Cx + t * (Bx + t * Ax))
- };
- var bezierY = function(t) {
- return t * (Cy + t * (By + t * Ay))
- };
- var findXFor = function(t) {
- var x = t;
- var i = 0;
- var z;
- while (i < 14) {
- z = bezierX(x) - t;
- if (Math.abs(z) < .001) {
- break
- }
- x -= z / derivativeX(x);
- i++
- }
- return x
- };
- var derivativeX = function(t) {
- return Cx + t * (2 * Bx + 3 * t * Ax)
- };
- return function(t) {
- return bezierY(findXFor(t))
- }
- };
- var easing = {};
- var convertTransitionTimingFuncToEasing = function(cssTransitionEasing) {
- cssTransitionEasing = TransitionTimingFuncMap[cssTransitionEasing] || cssTransitionEasing;
- var coeffs = cssTransitionEasing.match(CSS_TRANSITION_EASING_REGEX);
- var forceName;
- if (!coeffs) {
- forceName = "linear";
- coeffs = TransitionTimingFuncMap[forceName].match(CSS_TRANSITION_EASING_REGEX)
- }
- coeffs = coeffs.slice(1, 5);
- for (var i = 0; i < coeffs.length; i++) {
- coeffs[i] = parseFloat(coeffs[i])
- }
- var easingName = forceName || "cubicbezier_" + coeffs.join("_").replace(/\./g, "p");
- if (!isFunction(easing[easingName])) {
- easing[easingName] = function(x, t, b, c, d) {
- return c * polynomBezier(coeffs[0], coeffs[1], coeffs[2], coeffs[3])(t / d) + b
- }
- }
- return easingName
- };
- exports.setEasing = function(value) {
- easing = value
- };
- exports.getEasing = function(name) {
- return easing[name]
- };
- exports.convertTransitionTimingFuncToEasing = convertTransitionTimingFuncToEasing
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/events/pointer/touch.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var BaseStrategy = __webpack_require__( /*! ./base */ 154);
- var eventMap = {
- dxpointerdown: "touchstart",
- dxpointermove: "touchmove",
- dxpointerup: "touchend",
- dxpointercancel: "touchcancel",
- dxpointerover: "",
- dxpointerout: "",
- dxpointerenter: "",
- dxpointerleave: ""
- };
- var normalizeTouchEvent = function(e) {
- var pointers = [];
- each(e.touches, function(_, touch) {
- pointers.push(extend({
- pointerId: touch.identifier
- }, touch))
- });
- return {
- pointers: pointers,
- pointerId: e.changedTouches[0].identifier
- }
- };
- var skipTouchWithSameIdentifier = function(pointerEvent) {
- return "ios" === devices.real().platform && ("dxpointerdown" === pointerEvent || "dxpointerup" === pointerEvent)
- };
- var TouchStrategy = BaseStrategy.inherit({
- ctor: function() {
- this.callBase.apply(this, arguments);
- this._pointerId = 0
- },
- _handler: function(e) {
- if (skipTouchWithSameIdentifier(this._eventName)) {
- var touch = e.changedTouches[0];
- if (this._pointerId === touch.identifier && 0 !== this._pointerId) {
- return
- }
- this._pointerId = touch.identifier
- }
- return this.callBase.apply(this, arguments)
- },
- _fireEvent: function(args) {
- return this.callBase(extend(normalizeTouchEvent(args.originalEvent), args))
- }
- });
- TouchStrategy.map = eventMap;
- TouchStrategy.normalize = normalizeTouchEvent;
- module.exports = TouchStrategy
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/events/pointer/observer.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var addEventsListener = function(events, handler) {
- readyCallbacks.add(function() {
- events.split(" ").forEach(function(event) {
- domAdapter.listen(domAdapter.getDocument(), event, handler, true)
- })
- })
- };
- var Observer = function(eventMap, pointerEquals, onPointerAdding) {
- onPointerAdding = onPointerAdding || function() {};
- var pointers = [];
- var getPointerIndex = function(e) {
- var index = -1;
- each(pointers, function(i, pointer) {
- if (!pointerEquals(e, pointer)) {
- return true
- }
- index = i;
- return false
- });
- return index
- };
- var addPointer = function(e) {
- if (getPointerIndex(e) === -1) {
- onPointerAdding(e);
- pointers.push(e)
- }
- };
- var removePointer = function(e) {
- var index = getPointerIndex(e);
- if (index > -1) {
- pointers.splice(index, 1)
- }
- };
- var updatePointer = function(e) {
- pointers[getPointerIndex(e)] = e
- };
- addEventsListener(eventMap.dxpointerdown, addPointer);
- addEventsListener(eventMap.dxpointermove, updatePointer);
- addEventsListener(eventMap.dxpointerup, removePointer);
- addEventsListener(eventMap.dxpointercancel, removePointer);
- this.pointers = function() {
- return pointers
- };
- this.reset = function() {
- pointers = []
- }
- };
- module.exports = Observer
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/events/pointer/mouse.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var BaseStrategy = __webpack_require__( /*! ./base */ 154);
- var Observer = __webpack_require__( /*! ./observer */ 266);
- var eventMap = {
- dxpointerdown: "mousedown",
- dxpointermove: "mousemove",
- dxpointerup: "mouseup",
- dxpointercancel: "",
- dxpointerover: "mouseover",
- dxpointerout: "mouseout",
- dxpointerenter: "mouseenter",
- dxpointerleave: "mouseleave"
- };
- var normalizeMouseEvent = function(e) {
- e.pointerId = 1;
- return {
- pointers: observer.pointers(),
- pointerId: 1
- }
- };
- var observer;
- var activated = false;
- var activateStrategy = function() {
- if (activated) {
- return
- }
- observer = new Observer(eventMap, function() {
- return true
- });
- activated = true
- };
- var MouseStrategy = BaseStrategy.inherit({
- ctor: function() {
- this.callBase.apply(this, arguments);
- activateStrategy()
- },
- _fireEvent: function(args) {
- return this.callBase(extend(normalizeMouseEvent(args.originalEvent), args))
- }
- });
- MouseStrategy.map = eventMap;
- MouseStrategy.normalize = normalizeMouseEvent;
- MouseStrategy.activate = activateStrategy;
- MouseStrategy.resetObserver = function() {
- observer.reset()
- };
- module.exports = MouseStrategy
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var compareVersions = __webpack_require__( /*! ../core/utils/version */ 61).compare;
- var errors = __webpack_require__( /*! ../core/utils/error */ 129);
- var useJQuery = __webpack_require__( /*! ./jquery/use_jquery */ 80)();
- if (useJQuery && compareVersions(jQuery.fn.jquery, [1, 10]) < 0) {
- throw errors.Error("E0012")
- }
- __webpack_require__( /*! ./jquery/renderer */ 450);
- __webpack_require__( /*! ./jquery/hooks */ 451);
- __webpack_require__( /*! ./jquery/deferred */ 452);
- __webpack_require__( /*! ./jquery/hold_ready */ 453);
- __webpack_require__( /*! ./jquery/events */ 454);
- __webpack_require__( /*! ./jquery/easing */ 455);
- __webpack_require__( /*! ./jquery/element_data */ 456);
- __webpack_require__( /*! ./jquery/element */ 457);
- __webpack_require__( /*! ./jquery/component_registrator */ 458);
- __webpack_require__( /*! ./jquery/ajax */ 459)
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/ui/themes_callback.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 26);
- module.exports = new Callbacks
- },
- /*!*********************************!*\
- !*** external "window.angular" ***!
- \*********************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports) {
- module.exports = window.angular
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/utils/locker.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errors = __webpack_require__( /*! ../errors */ 21);
- var Locker = function() {
- var info = {};
- var currentCount = function(lockName) {
- return info[lockName] || 0
- };
- return {
- obtain: function(lockName) {
- info[lockName] = currentCount(lockName) + 1
- },
- release: function(lockName) {
- var count = currentCount(lockName);
- if (count < 1) {
- throw errors.Error("E0014")
- }
- if (1 === count) {
- delete info[lockName]
- } else {
- info[lockName] = count - 1
- }
- },
- locked: function(lockName) {
- return currentCount(lockName) > 0
- }
- }
- };
- module.exports = Locker
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/ui/selection/selection.strategy.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dataQuery = __webpack_require__( /*! ../../data/query */ 42);
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var getKeyHash = commonUtils.getKeyHash;
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
- module.exports = Class.inherit({
- ctor: function(options) {
- this.options = options;
- this._clearItemKeys()
- },
- _clearItemKeys: function() {
- this._setOption("addedItemKeys", []);
- this._setOption("removedItemKeys", []);
- this._setOption("removedItems", []);
- this._setOption("addedItems", [])
- },
- validate: commonUtils.noop,
- _setOption: function(name, value) {
- this.options[name] = value
- },
- onSelectionChanged: function onSelectionChanged() {
- var addedItemKeys = this.options.addedItemKeys;
- var removedItemKeys = this.options.removedItemKeys;
- var addedItems = this.options.addedItems;
- var removedItems = this.options.removedItems;
- var selectedItems = this.options.selectedItems;
- var selectedItemKeys = this.options.selectedItemKeys;
- var onSelectionChanged = this.options.onSelectionChanged || commonUtils.noop;
- this._clearItemKeys();
- onSelectionChanged({
- selectedItems: selectedItems,
- selectedItemKeys: selectedItemKeys,
- addedItemKeys: addedItemKeys,
- removedItemKeys: removedItemKeys,
- addedItems: addedItems,
- removedItems: removedItems
- })
- },
- equalKeys: function(key1, key2) {
- if (this.options.equalByReference) {
- if (typeUtils.isObject(key1) && typeUtils.isObject(key2)) {
- return key1 === key2
- }
- }
- return commonUtils.equalByValue(key1, key2)
- },
- _clearSelection: function(keys, preserve, isDeselect, isSelectAll) {
- keys = keys || [];
- keys = Array.isArray(keys) ? keys : [keys];
- this.validate();
- return this.selectedItemKeys(keys, preserve, isDeselect, isSelectAll)
- },
- _loadFilteredData: function(remoteFilter, localFilter, select, isSelectAll) {
- var filterLength = encodeURI(JSON.stringify(remoteFilter)).length;
- var needLoadAllData = this.options.maxFilterLengthInRequest && filterLength > this.options.maxFilterLengthInRequest;
- var deferred = new Deferred;
- var loadOptions = {
- filter: needLoadAllData ? void 0 : remoteFilter,
- select: needLoadAllData ? this.options.dataFields() : select || this.options.dataFields()
- };
- if (remoteFilter && 0 === remoteFilter.length) {
- deferred.resolve([])
- } else {
- this.options.load(loadOptions).done(function(items) {
- var filteredItems = typeUtils.isPlainObject(items) ? items.data : items;
- if (localFilter && !isSelectAll) {
- filteredItems = filteredItems.filter(localFilter)
- } else {
- if (needLoadAllData) {
- filteredItems = dataQuery(filteredItems).filter(remoteFilter).toArray()
- }
- }
- deferred.resolve(filteredItems)
- }).fail(deferred.reject.bind(deferred))
- }
- return deferred
- },
- updateSelectedItemKeyHash: function(keys) {
- for (var i = 0; i < keys.length; i++) {
- var keyHash = getKeyHash(keys[i]);
- if (!typeUtils.isObject(keyHash)) {
- this.options.keyHashIndices[keyHash] = this.options.keyHashIndices[keyHash] || [];
- var keyIndices = this.options.keyHashIndices[keyHash];
- keyIndices.push(i)
- }
- }
- },
- _isAnyItemSelected: function(items) {
- for (var i = 0; i < items.length; i++) {
- if (this.options.isItemSelected(items[i])) {
- return
- }
- }
- return false
- },
- _getFullSelectAllState: function() {
- var items = this.options.plainItems();
- var dataFilter = this.options.filter();
- var selectedItems = this.options.selectedItems;
- if (dataFilter) {
- selectedItems = dataQuery(selectedItems).filter(dataFilter).toArray()
- }
- var selectedItemsLength = selectedItems.length;
- if (!selectedItemsLength) {
- return this._isAnyItemSelected(items)
- }
- if (selectedItemsLength >= this.options.totalCount()) {
- return true
- }
- return
- },
- _getVisibleSelectAllState: function() {
- var items = this.options.plainItems();
- var hasSelectedItems = false;
- var hasUnselectedItems = false;
- for (var i = 0; i < items.length; i++) {
- var item = items[i];
- var itemData = this.options.getItemData(item);
- var key = this.options.keyOf(itemData);
- if (this.options.isSelectableItem(item)) {
- if (this.isItemKeySelected(key)) {
- hasSelectedItems = true
- } else {
- hasUnselectedItems = true
- }
- }
- }
- if (hasSelectedItems) {
- return !hasUnselectedItems ? true : void 0
- } else {
- return false
- }
- }
- })
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/utils.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var ko = __webpack_require__( /*! knockout */ 62);
- var getClosestNodeWithContext = function getClosestNodeWithContext(node) {
- var context = ko.contextFor(node);
- if (!context && node.parentNode) {
- return getClosestNodeWithContext(node.parentNode)
- }
- return node
- };
- module.exports.getClosestNodeWithContext = getClosestNodeWithContext
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/bundles/modules/data.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var DevExpress = __webpack_require__( /*! ./core */ 147);
- module.exports = DevExpress.data = DevExpress.data || {};
- Object.defineProperty(DevExpress.data, "errorHandler", {
- get: function() {
- /*! ../../data/errors */
- return __webpack_require__(36).errorHandler
- },
- set: function(value) {
- __webpack_require__( /*! ../../data/errors */ 36).errorHandler = value
- }
- });
- Object.defineProperty(DevExpress.data, "_errorHandler", {
- get: function() {
- /*! ../../data/errors */
- return __webpack_require__(36)._errorHandler
- },
- set: function(value) {
- __webpack_require__( /*! ../../data/errors */ 36)._errorHandler = value
- }
- });
- DevExpress.data.DataSource = __webpack_require__( /*! ../../data/data_source */ 487);
- DevExpress.data.query = __webpack_require__( /*! ../../data/query */ 42);
- DevExpress.data.Store = __webpack_require__( /*! ../../data/abstract_store */ 98);
- DevExpress.data.ArrayStore = __webpack_require__( /*! ../../data/array_store */ 68);
- DevExpress.data.CustomStore = __webpack_require__( /*! ../../data/custom_store */ 149);
- DevExpress.data.LocalStore = __webpack_require__( /*! ../../data/local_store */ 488);
- DevExpress.data.base64_encode = __webpack_require__( /*! ../../data/utils */ 41).base64_encode;
- DevExpress.data.Guid = __webpack_require__( /*! ../../core/guid */ 40);
- DevExpress.data.utils = {};
- DevExpress.data.utils.compileGetter = __webpack_require__( /*! ../../core/utils/data */ 20).compileGetter;
- DevExpress.data.utils.compileSetter = __webpack_require__( /*! ../../core/utils/data */ 20).compileSetter;
- DevExpress.EndpointSelector = __webpack_require__( /*! ../../data/endpoint_selector */ 489);
- DevExpress.data.queryImpl = __webpack_require__( /*! ../../data/query */ 42).queryImpl;
- DevExpress.data.queryAdapters = __webpack_require__( /*! ../../data/query_adapters */ 181);
- var dataUtils = __webpack_require__( /*! ../../data/utils */ 41);
- DevExpress.data.utils.normalizeBinaryCriterion = dataUtils.normalizeBinaryCriterion;
- DevExpress.data.utils.normalizeSortingInfo = dataUtils.normalizeSortingInfo;
- DevExpress.data.utils.errorMessageFromXhr = dataUtils.errorMessageFromXhr;
- DevExpress.data.utils.aggregators = dataUtils.aggregators;
- DevExpress.data.utils.keysEqual = dataUtils.keysEqual;
- DevExpress.data.utils.isDisjunctiveOperator = dataUtils.isDisjunctiveOperator;
- DevExpress.data.utils.isConjunctiveOperator = dataUtils.isConjunctiveOperator;
- DevExpress.data.utils.processRequestResultLock = dataUtils.processRequestResultLock;
- DevExpress.data.utils.toComparable = __webpack_require__( /*! ../../core/utils/data */ 20).toComparable;
- DevExpress.data.utils.multiLevelGroup = __webpack_require__( /*! ../../data/store_helper */ 81).multiLevelGroup;
- DevExpress.data.utils.arrangeSortingInfo = __webpack_require__( /*! ../../data/store_helper */ 81).arrangeSortingInfo;
- DevExpress.data.utils.normalizeDataSourceOptions = __webpack_require__( /*! ../../data/data_source/data_source */ 45).normalizeDataSourceOptions
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/data/proxy_url_formatter.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
- var callOnce = __webpack_require__( /*! ../core/utils/call_once */ 63);
- var DXPROXY_HOST = "dxproxy.devexpress.com:8000";
- var urlMapping = {};
- var getUrlParser = callOnce(function() {
- var a = domAdapter.createElement("a");
- var props = ["protocol", "hostname", "port", "pathname", "search", "hash"];
- var normalizePath = function(value) {
- if ("/" !== value.charAt(0)) {
- value = "/" + value
- }
- return value
- };
- return function(url) {
- a.href = url;
- var result = {};
- each(props, function() {
- result[this] = a[this]
- });
- result.pathname = normalizePath(result.pathname);
- return result
- }
- });
- var parseUrl = function(url) {
- var urlParser = getUrlParser();
- return urlParser(url)
- };
- var extractProxyAppId = function() {
- return window.location.pathname.split("/")[1]
- };
- module.exports = {
- parseUrl: parseUrl,
- isProxyUsed: function() {
- return window.location.host === DXPROXY_HOST
- },
- formatProxyUrl: function(localUrl) {
- var urlData = parseUrl(localUrl);
- if (!/^(localhost$|127\.)/i.test(urlData.hostname)) {
- return localUrl
- }
- var proxyUrlPart = DXPROXY_HOST + "/" + extractProxyAppId() + "_" + urlData.port;
- urlMapping[proxyUrlPart] = urlData.hostname + ":" + urlData.port;
- var resultUrl = "http://" + proxyUrlPart + urlData.pathname + urlData.search;
- return resultUrl
- },
- formatLocalUrl: function(proxyUrl) {
- if (proxyUrl.indexOf(DXPROXY_HOST) < 0) {
- return proxyUrl
- }
- var resultUrl = proxyUrl;
- for (var proxyUrlPart in urlMapping) {
- if (Object.prototype.hasOwnProperty.call(urlMapping, proxyUrlPart)) {
- if (proxyUrl.indexOf(proxyUrlPart) >= 0) {
- resultUrl = proxyUrl.replace(proxyUrlPart, urlMapping[proxyUrlPart]);
- break
- }
- }
- }
- return resultUrl
- }
- }
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/data/odata/store.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var config = __webpack_require__( /*! ../../core/config */ 31);
- var odataUtils = __webpack_require__( /*! ./utils */ 110);
- var proxyUrlFormatter = __webpack_require__( /*! ../proxy_url_formatter */ 275);
- var errors = __webpack_require__( /*! ../errors */ 36).errors;
- var query = __webpack_require__( /*! ../query */ 42);
- var Store = __webpack_require__( /*! ../abstract_store */ 98);
- var mixins = __webpack_require__( /*! ./mixins */ 277);
- var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- __webpack_require__( /*! ./query_adapter */ 156);
- var ANONYMOUS_KEY_NAME = "5d46402c-7899-4ea9-bd81-8b73c47c7683";
- function expandKeyType(key, keyType) {
- var result = {};
- result[key] = keyType;
- return result
- }
- function mergeFieldTypesWithKeyType(fieldTypes, keyType) {
- var result = {};
- for (var field in fieldTypes) {
- result[field] = fieldTypes[field]
- }
- for (var keyName in keyType) {
- if (keyName in result) {
- if (result[keyName] !== keyType[keyName]) {
- errors.log("W4001", keyName)
- }
- } else {
- result[keyName] = keyType[keyName]
- }
- }
- return result
- }
- var ODataStore = Store.inherit({
- ctor: function(options) {
- this.callBase(options);
- this._extractServiceOptions(options);
- var key = this.key();
- var fieldTypes = options.fieldTypes;
- var keyType = options.keyType;
- if (keyType) {
- var keyTypeIsString = "string" === typeof keyType;
- if (!key) {
- key = keyTypeIsString ? ANONYMOUS_KEY_NAME : Object.keys(keyType);
- this._legacyAnonymousKey = key
- }
- if (keyTypeIsString) {
- keyType = expandKeyType(key, keyType)
- }
- fieldTypes = mergeFieldTypesWithKeyType(fieldTypes, keyType)
- }
- this._fieldTypes = fieldTypes || {};
- if (2 === this.version()) {
- this._updateMethod = "MERGE"
- } else {
- this._updateMethod = "PATCH"
- }
- },
- _customLoadOptions: function() {
- return ["expand", "customQueryParams"]
- },
- _byKeyImpl: function(key, extraOptions) {
- var params = {};
- if (extraOptions) {
- params.$expand = odataUtils.generateExpand(this._version, extraOptions.expand, extraOptions.select) || void 0;
- params.$select = odataUtils.generateSelect(this._version, extraOptions.select) || void 0
- }
- return this._sendRequest(this._byKeyUrl(key), "GET", params)
- },
- createQuery: function(loadOptions) {
- var url;
- loadOptions = loadOptions || {};
- var queryOptions = {
- adapter: "odata",
- beforeSend: this._beforeSend,
- errorHandler: this._errorHandler,
- jsonp: this._jsonp,
- version: this._version,
- withCredentials: this._withCredentials,
- expand: loadOptions.expand,
- requireTotalCount: loadOptions.requireTotalCount,
- deserializeDates: this._deserializeDates,
- fieldTypes: this._fieldTypes
- };
- if (isDefined(loadOptions.urlOverride)) {
- url = loadOptions.urlOverride
- } else {
- url = this._url
- }
- if (isDefined(this._filterToLower)) {
- queryOptions.filterToLower = this._filterToLower
- }
- if (loadOptions.customQueryParams) {
- var params = mixins.escapeServiceOperationParams(loadOptions.customQueryParams, this.version());
- if (4 === this.version()) {
- url = mixins.formatFunctionInvocationUrl(url, params)
- } else {
- queryOptions.params = params
- }
- }
- return query(url, queryOptions)
- },
- _insertImpl: function(values) {
- this._requireKey();
- var that = this;
- var d = new Deferred;
- when(this._sendRequest(this._url, "POST", null, values)).done(function(serverResponse) {
- d.resolve(config().useLegacyStoreResult ? values : serverResponse || values, that.keyOf(serverResponse))
- }).fail(d.reject);
- return d.promise()
- },
- _updateImpl: function(key, values) {
- var d = new Deferred;
- when(this._sendRequest(this._byKeyUrl(key), this._updateMethod, null, values)).done(function(serverResponse) {
- if (config().useLegacyStoreResult) {
- d.resolve(key, values)
- } else {
- d.resolve(serverResponse || values, key)
- }
- }).fail(d.reject);
- return d.promise()
- },
- _removeImpl: function(key) {
- var d = new Deferred;
- when(this._sendRequest(this._byKeyUrl(key), "DELETE")).done(function() {
- d.resolve(key)
- }).fail(d.reject);
- return d.promise()
- },
- _convertKey: function(value) {
- var result = value;
- var fieldTypes = this._fieldTypes;
- var key = this.key() || this._legacyAnonymousKey;
- if (Array.isArray(key)) {
- result = {};
- for (var i = 0; i < key.length; i++) {
- var keyName = key[i];
- result[keyName] = odataUtils.convertPrimitiveValue(fieldTypes[keyName], value[keyName])
- }
- } else {
- if (fieldTypes[key]) {
- result = odataUtils.convertPrimitiveValue(fieldTypes[key], value)
- }
- }
- return result
- },
- _byKeyUrl: function(value, useOriginalHost) {
- var baseUrl = useOriginalHost ? proxyUrlFormatter.formatLocalUrl(this._url) : this._url;
- var convertedKey = this._convertKey(value);
- return baseUrl + "(" + encodeURIComponent(odataUtils.serializeKey(convertedKey, this._version)) + ")"
- }
- }, "odata").include(mixins.SharedMethods);
- module.exports = ODataStore
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/data/odata/mixins.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var stringUtils = __webpack_require__( /*! ../../core/utils/string */ 44);
- var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var odataUtils = __webpack_require__( /*! ./utils */ 110);
- __webpack_require__( /*! ./query_adapter */ 156);
- var DEFAULT_PROTOCOL_VERSION = 2;
- var formatFunctionInvocationUrl = function(baseUrl, args) {
- return stringUtils.format("{0}({1})", baseUrl, iteratorUtils.map(args || {}, function(value, key) {
- return stringUtils.format("{0}={1}", key, value)
- }).join(","))
- };
- var escapeServiceOperationParams = function(params, version) {
- if (!params) {
- return params
- }
- var result = {};
- iteratorUtils.each(params, function(k, v) {
- result[k] = odataUtils.serializeValue(v, version)
- });
- return result
- };
- var SharedMethods = {
- _extractServiceOptions: function(options) {
- options = options || {};
- this._url = String(options.url).replace(/\/+$/, "");
- this._beforeSend = options.beforeSend;
- this._jsonp = options.jsonp;
- this._version = options.version || DEFAULT_PROTOCOL_VERSION;
- this._withCredentials = options.withCredentials;
- this._deserializeDates = options.deserializeDates;
- this._filterToLower = options.filterToLower
- },
- _sendRequest: function(url, method, params, payload) {
- return odataUtils.sendRequest(this.version(), {
- url: url,
- method: method,
- params: params || {},
- payload: payload
- }, {
- beforeSend: this._beforeSend,
- jsonp: this._jsonp,
- withCredentials: this._withCredentials,
- deserializeDates: this._deserializeDates
- })
- },
- version: function() {
- return this._version
- }
- };
- exports.SharedMethods = SharedMethods;
- exports.escapeServiceOperationParams = escapeServiceOperationParams;
- exports.formatFunctionInvocationUrl = formatFunctionInvocationUrl
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/localization/ldml/number.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var fitIntoRange = __webpack_require__( /*! ../../core/utils/math */ 28).fitIntoRange;
- var toFixed = __webpack_require__( /*! ../utils */ 256).toFixed;
- var DEFAULT_CONFIG = {
- thousandsSeparator: ",",
- decimalSeparator: "."
- };
- var ESCAPING_CHAR = "'";
- var MAXIMUM_NUMBER_LENGTH = 15;
- function getGroupSizes(formatString) {
- return formatString.split(",").slice(1).map(function(str) {
- return str.split("").filter(function(char) {
- return "#" === char || "0" === char
- }).length
- })
- }
- function getSignParts(format) {
- var signParts = format.split(";");
- if (1 === signParts.length) {
- signParts.push("-" + signParts[0])
- }
- return signParts
- }
- function reverseString(str) {
- return str.toString().split("").reverse().join("")
- }
- function isPercentFormat(format) {
- return format.indexOf("%") !== -1 && !format.match(/'[^']*%[^']*'/g)
- }
- function getNonRequiredDigitCount(floatFormat) {
- if (!floatFormat) {
- return 0
- }
- return floatFormat.length - floatFormat.replace(/[#]/g, "").length
- }
- function getRequiredDigitCount(floatFormat) {
- if (!floatFormat) {
- return 0
- }
- return floatFormat.length - floatFormat.replace(/[0]/g, "").length
- }
- function normalizeValueString(valuePart, minDigitCount, maxDigitCount) {
- if (!valuePart) {
- return ""
- }
- if (valuePart.length > maxDigitCount) {
- valuePart = valuePart.substr(0, maxDigitCount)
- }
- while (valuePart.length > minDigitCount && "0" === valuePart.slice(-1)) {
- valuePart = valuePart.substr(0, valuePart.length - 1)
- }
- while (valuePart.length < minDigitCount) {
- valuePart += "0"
- }
- return valuePart
- }
- function applyGroups(valueString, groupSizes, thousandsSeparator) {
- if (!groupSizes.length) {
- return valueString
- }
- var groups = [];
- var index = 0;
- while (valueString) {
- var groupSize = groupSizes[index];
- groups.push(valueString.slice(0, groupSize));
- valueString = valueString.slice(groupSize);
- if (index < groupSizes.length - 1) {
- index++
- }
- }
- return groups.join(thousandsSeparator)
- }
- function formatNumberPart(format, valueString) {
- return format.split(ESCAPING_CHAR).map(function(formatPart, escapeIndex) {
- var isEscape = escapeIndex % 2;
- if (!formatPart && isEscape) {
- return ESCAPING_CHAR
- }
- return isEscape ? formatPart : formatPart.replace(/[,#0]+/, valueString)
- }).join("")
- }
- function getFloatPointIndex(format) {
- var isEscape = false;
- for (var index = 0; index < format.length; index++) {
- if ("'" === format[index]) {
- isEscape = !isEscape
- }
- if ("." === format[index] && !isEscape) {
- return index
- }
- }
- return format.length
- }
- function getFormatter(format, config) {
- config = config || DEFAULT_CONFIG;
- return function(value) {
- if ("number" !== typeof value || isNaN(value)) {
- return ""
- }
- var signFormatParts = getSignParts(format);
- var isPositiveZero = 1 / value === 1 / 0;
- var isPositive = value > 0 || isPositiveZero;
- var numberFormat = signFormatParts[isPositive ? 0 : 1];
- if (isPercentFormat(numberFormat)) {
- value = 100 * value
- }
- if (!isPositive) {
- value = -value
- }
- var floatPointIndex = getFloatPointIndex(numberFormat);
- var floatFormatParts = [numberFormat.substr(0, floatPointIndex), numberFormat.substr(floatPointIndex + 1)];
- var minFloatPrecision = getRequiredDigitCount(floatFormatParts[1]);
- var maxFloatPrecision = minFloatPrecision + getNonRequiredDigitCount(floatFormatParts[1]);
- var minIntegerPrecision = getRequiredDigitCount(floatFormatParts[0]);
- var maxIntegerPrecision = getNonRequiredDigitCount(floatFormatParts[0]) ? void 0 : minIntegerPrecision;
- var integerLength = Math.floor(value).toString().length;
- var floatPrecision = fitIntoRange(maxFloatPrecision, 0, MAXIMUM_NUMBER_LENGTH - integerLength);
- var groupSizes = getGroupSizes(floatFormatParts[0]).reverse();
- var valueParts = toFixed(value, floatPrecision < 0 ? 0 : floatPrecision).split(".");
- var valueIntegerPart = normalizeValueString(reverseString(valueParts[0]), minIntegerPrecision, maxIntegerPrecision);
- var valueFloatPart = normalizeValueString(valueParts[1], minFloatPrecision, maxFloatPrecision);
- valueIntegerPart = applyGroups(valueIntegerPart, groupSizes, config.thousandsSeparator);
- var integerString = reverseString(formatNumberPart(reverseString(floatFormatParts[0]), valueIntegerPart));
- var floatString = maxFloatPrecision ? formatNumberPart(floatFormatParts[1], valueFloatPart) : "";
- var result = integerString + (floatString.match(/\d/) ? config.decimalSeparator : "") + floatString;
- return result
- }
- }
- function parseValue(text, isPercent, isNegative) {
- var value = (isPercent ? .01 : 1) * parseFloat(text) || 0;
- return isNegative ? -value : value
- }
- function prepareValueText(valueText, formatter, isPercent, isIntegerPart) {
- var nextValueText = valueText;
- var char;
- var text;
- var nextText;
- do {
- if (nextText) {
- char = text.length === nextText.length ? "0" : "1";
- valueText = isIntegerPart ? char + valueText : valueText + char
- }
- text = nextText || formatter(parseValue(nextValueText, isPercent));
- nextValueText = isIntegerPart ? "1" + nextValueText : nextValueText + "1";
- nextText = formatter(parseValue(nextValueText, isPercent))
- } while (text !== nextText && (isIntegerPart ? text.length === nextText.length : text.length <= nextText.length));
- if (isIntegerPart && nextText.length > text.length) {
- var hasGroups = formatter(12345).indexOf("12345") === -1;
- do {
- valueText = "1" + valueText
- } while (hasGroups && parseValue(valueText, isPercent) < 1e5)
- }
- return valueText
- }
- function getFormatByValueText(valueText, formatter, isPercent, isNegative) {
- var format = formatter(parseValue(valueText, isPercent, isNegative));
- var valueTextParts = valueText.split(".");
- var valueTextWithModifiedFloat = valueTextParts[0] + ".3" + valueTextParts[1].slice(1);
- var valueWithModifiedFloat = parseValue(valueTextWithModifiedFloat, isPercent, isNegative);
- var decimalSeparatorIndex = formatter(valueWithModifiedFloat).indexOf("3") - 1;
- format = format.replace(/(\d)\D(\d)/g, "$1,$2");
- if (decimalSeparatorIndex >= 0) {
- format = format.slice(0, decimalSeparatorIndex) + "." + format.slice(decimalSeparatorIndex + 1)
- }
- format = format.replace(/1+/, "1").replace(/1/g, "#");
- if (!isPercent) {
- format = format.replace("%", "'%'")
- }
- return format
- }
- function getFormat(formatter) {
- var valueText = ".";
- var isPercent = formatter(1).indexOf("100") >= 0;
- valueText = prepareValueText(valueText, formatter, isPercent, true);
- valueText = prepareValueText(valueText, formatter, isPercent, false);
- var positiveFormat = getFormatByValueText(valueText, formatter, isPercent, false);
- var negativeFormat = getFormatByValueText(valueText, formatter, isPercent, true);
- return negativeFormat === "-" + positiveFormat ? positiveFormat : positiveFormat + ";" + negativeFormat
- }
- exports.getFormatter = getFormatter;
- exports.getFormat = getFormat
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/localization/language_codes.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var locale = __webpack_require__( /*! ./core */ 87).locale;
- var LANGUAGE_CODES = {
- ar: 1,
- bg: 2,
- ca: 3,
- "zh-Hans": 4,
- cs: 5,
- da: 6,
- de: 7,
- el: 8,
- en: 9,
- es: 10,
- fi: 11,
- fr: 12,
- he: 13,
- hu: 14,
- is: 15,
- it: 16,
- ja: 17,
- ko: 18,
- nl: 19,
- no: 20,
- pl: 21,
- pt: 22,
- rm: 23,
- ro: 24,
- ru: 25,
- hr: 26,
- sk: 27,
- sq: 28,
- sv: 29,
- th: 30,
- tr: 31,
- ur: 32,
- id: 33,
- uk: 34,
- be: 35,
- sl: 36,
- et: 37,
- lv: 38,
- lt: 39,
- tg: 40,
- fa: 41,
- vi: 42,
- hy: 43,
- az: 44,
- eu: 45,
- hsb: 46,
- mk: 47,
- tn: 50,
- xh: 52,
- zu: 53,
- af: 54,
- ka: 55,
- fo: 56,
- hi: 57,
- mt: 58,
- se: 59,
- ga: 60,
- ms: 62,
- kk: 63,
- ky: 64,
- sw: 65,
- tk: 66,
- uz: 67,
- tt: 68,
- bn: 69,
- pa: 70,
- gu: 71,
- or: 72,
- ta: 73,
- te: 74,
- kn: 75,
- ml: 76,
- as: 77,
- mr: 78,
- sa: 79,
- mn: 80,
- bo: 81,
- cy: 82,
- km: 83,
- lo: 84,
- gl: 86,
- kok: 87,
- syr: 90,
- si: 91,
- iu: 93,
- am: 94,
- tzm: 95,
- ne: 97,
- fy: 98,
- ps: 99,
- fil: 100,
- dv: 101,
- ha: 104,
- yo: 106,
- quz: 107,
- nso: 108,
- ba: 109,
- lb: 110,
- kl: 111,
- ig: 112,
- ii: 120,
- arn: 122,
- moh: 124,
- br: 126,
- ug: 128,
- mi: 129,
- oc: 130,
- co: 131,
- gsw: 132,
- sah: 133,
- qut: 134,
- rw: 135,
- wo: 136,
- prs: 140,
- gd: 145,
- "ar-SA": 1025,
- "bg-BG": 1026,
- "ca-ES": 1027,
- "zh-TW": 1028,
- "cs-CZ": 1029,
- "da-DK": 1030,
- "de-DE": 1031,
- "el-GR": 1032,
- "en-US": 1033,
- "fi-FI": 1035,
- "fr-FR": 1036,
- "he-IL": 1037,
- "hu-HU": 1038,
- "is-IS": 1039,
- "it-IT": 1040,
- "ja-JP": 1041,
- "ko-KR": 1042,
- "nl-NL": 1043,
- "nb-NO": 1044,
- "pl-PL": 1045,
- "pt-BR": 1046,
- "rm-CH": 1047,
- "ro-RO": 1048,
- "ru-RU": 1049,
- "hr-HR": 1050,
- "sk-SK": 1051,
- "sq-AL": 1052,
- "sv-SE": 1053,
- "th-TH": 1054,
- "tr-TR": 1055,
- "ur-PK": 1056,
- "id-ID": 1057,
- "uk-UA": 1058,
- "be-BY": 1059,
- "sl-SI": 1060,
- "et-EE": 1061,
- "lv-LV": 1062,
- "lt-LT": 1063,
- "tg-Cyrl-TJ": 1064,
- "fa-IR": 1065,
- "vi-VN": 1066,
- "hy-AM": 1067,
- "az-Latn-AZ": 1068,
- "eu-ES": 1069,
- "hsb-DE": 1070,
- "mk-MK": 1071,
- "tn-ZA": 1074,
- "xh-ZA": 1076,
- "zu-ZA": 1077,
- "af-ZA": 1078,
- "ka-GE": 1079,
- "fo-FO": 1080,
- "hi-IN": 1081,
- "mt-MT": 1082,
- "se-NO": 1083,
- "ms-MY": 1086,
- "kk-KZ": 1087,
- "ky-KG": 1088,
- "sw-KE": 1089,
- "tk-TM": 1090,
- "uz-Latn-UZ": 1091,
- "tt-RU": 1092,
- "bn-IN": 1093,
- "pa-IN": 1094,
- "gu-IN": 1095,
- "or-IN": 1096,
- "ta-IN": 1097,
- "te-IN": 1098,
- "kn-IN": 1099,
- "ml-IN": 1100,
- "as-IN": 1101,
- "mr-IN": 1102,
- "sa-IN": 1103,
- "mn-MN": 1104,
- "bo-CN": 1105,
- "cy-GB": 1106,
- "km-KH": 1107,
- "lo-LA": 1108,
- "gl-ES": 1110,
- "kok-IN": 1111,
- "syr-SY": 1114,
- "si-LK": 1115,
- "iu-Cans-CA": 1117,
- "am-ET": 1118,
- "ne-NP": 1121,
- "fy-NL": 1122,
- "ps-AF": 1123,
- "fil-PH": 1124,
- "dv-MV": 1125,
- "ha-Latn-NG": 1128,
- "yo-NG": 1130,
- "quz-BO": 1131,
- "nso-ZA": 1132,
- "ba-RU": 1133,
- "lb-LU": 1134,
- "kl-GL": 1135,
- "ig-NG": 1136,
- "ii-CN": 1144,
- "arn-CL": 1146,
- "moh-CA": 1148,
- "br-FR": 1150,
- "ug-CN": 1152,
- "mi-NZ": 1153,
- "oc-FR": 1154,
- "co-FR": 1155,
- "gsw-FR": 1156,
- "sah-RU": 1157,
- "qut-GT": 1158,
- "rw-RW": 1159,
- "wo-SN": 1160,
- "prs-AF": 1164,
- "gd-GB": 1169,
- "ar-IQ": 2049,
- "zh-CN": 2052,
- "de-CH": 2055,
- "en-GB": 2057,
- "es-MX": 2058,
- "fr-BE": 2060,
- "it-CH": 2064,
- "nl-BE": 2067,
- "nn-NO": 2068,
- "pt-PT": 2070,
- "sr-Latn-CS": 2074,
- "sv-FI": 2077,
- "az-Cyrl-AZ": 2092,
- "dsb-DE": 2094,
- "se-SE": 2107,
- "ga-IE": 2108,
- "ms-BN": 2110,
- "uz-Cyrl-UZ": 2115,
- "bn-BD": 2117,
- "mn-Mong-CN": 2128,
- "iu-Latn-CA": 2141,
- "tzm-Latn-DZ": 2143,
- "quz-EC": 2155,
- "ar-EG": 3073,
- "zh-HK": 3076,
- "de-AT": 3079,
- "en-AU": 3081,
- "es-ES": 3082,
- "fr-CA": 3084,
- "sr-Cyrl-CS": 3098,
- "se-FI": 3131,
- "quz-PE": 3179,
- "ar-LY": 4097,
- "zh-SG": 4100,
- "de-LU": 4103,
- "en-CA": 4105,
- "es-GT": 4106,
- "fr-CH": 4108,
- "hr-BA": 4122,
- "smj-NO": 4155,
- "ar-DZ": 5121,
- "zh-MO": 5124,
- "de-LI": 5127,
- "en-NZ": 5129,
- "es-CR": 5130,
- "fr-LU": 5132,
- "bs-Latn-BA": 5146,
- "smj-SE": 5179,
- "ar-MA": 6145,
- "en-IE": 6153,
- "es-PA": 6154,
- "fr-MC": 6156,
- "sr-Latn-BA": 6170,
- "sma-NO": 6203,
- "ar-TN": 7169,
- "en-ZA": 7177,
- "es-DO": 7178,
- "sr-Cyrl-BA": 7194,
- "sma-SE": 7227,
- "ar-OM": 8193,
- "en-JM": 8201,
- "es-VE": 8202,
- "bs-Cyrl-BA": 8218,
- "sms-FI": 8251,
- "ar-YE": 9217,
- "en-029": 9225,
- "es-CO": 9226,
- "sr-Latn-RS": 9242,
- "smn-FI": 9275,
- "ar-SY": 10241,
- "en-BZ": 10249,
- "es-PE": 10250,
- "sr-Cyrl-RS": 10266,
- "ar-JO": 11265,
- "en-TT": 11273,
- "es-AR": 11274,
- "sr-Latn-ME": 11290,
- "ar-LB": 12289,
- "en-ZW": 12297,
- "es-EC": 12298,
- "sr-Cyrl-ME": 12314,
- "ar-KW": 13313,
- "en-PH": 13321,
- "es-CL": 13322,
- "ar-AE": 14337,
- "es-UY": 14346,
- "ar-BH": 15361,
- "es-PY": 15370,
- "ar-QA": 16385,
- "en-IN": 16393,
- "es-BO": 16394,
- "en-MY": 17417,
- "es-SV": 17418,
- "en-SG": 18441,
- "es-HN": 18442,
- "es-NI": 19466,
- "es-PR": 20490,
- "es-US": 21514,
- "bs-Cyrl": 25626,
- "bs-Latn": 26650,
- "sr-Cyrl": 27674,
- "sr-Latn": 28698,
- smn: 28731,
- "az-Cyrl": 29740,
- sms: 29755,
- zh: 30724,
- nn: 30740,
- bs: 30746,
- "az-Latn": 30764,
- sma: 30779,
- "uz-Cyrl": 30787,
- "mn-Cyrl": 30800,
- "iu-Cans": 30813,
- "zh-Hant": 31748,
- nb: 31764,
- sr: 31770,
- "tg-Cyrl": 31784,
- dsb: 31790,
- smj: 31803,
- "uz-Latn": 31811,
- "mn-Mong": 31824,
- "iu-Latn": 31837,
- "tzm-Latn": 31839,
- "ha-Latn": 31848
- };
- exports.getLanguageId = function() {
- return LANGUAGE_CODES[locale()]
- }
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/core/utils/storage.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow();
- var getSessionStorage = function() {
- var sessionStorage;
- try {
- sessionStorage = window.sessionStorage
- } catch (e) {}
- return sessionStorage
- };
- exports.sessionStorage = getSessionStorage
- },
- /*!***********************************************************************************!*\
- !*** ./artifacts/transpiled/animation/transition_executor/transition_executor.js ***!
- \***********************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var fx = __webpack_require__( /*! ../fx */ 38);
- var animationPresetsModule = __webpack_require__( /*! ../presets/presets */ 179);
- var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- var directionPostfixes = {
- forward: " dx-forward",
- backward: " dx-backward",
- none: " dx-no-direction",
- undefined: " dx-no-direction"
- };
- var DX_ANIMATING_CLASS = "dx-animating";
- var TransitionExecutor = Class.inherit({
- ctor: function() {
- this._accumulatedDelays = {
- enter: 0,
- leave: 0
- };
- this._animations = [];
- this.reset()
- },
- _createAnimations: function($elements, initialConfig, configModifier, type) {
- var that = this;
- var result = [];
- configModifier = configModifier || {};
- var animationConfig = this._prepareElementAnimationConfig(initialConfig, configModifier, type);
- if (animationConfig) {
- $elements.each(function() {
- var animation = that._createAnimation($(this), animationConfig, configModifier);
- if (animation) {
- animation.element.addClass(DX_ANIMATING_CLASS);
- animation.setup();
- result.push(animation)
- }
- })
- }
- return result
- },
- _prepareElementAnimationConfig: function(config, configModifier, type) {
- var result;
- if ("string" === typeof config) {
- var presetName = config;
- config = animationPresetsModule.presets.getPreset(presetName)
- }
- if (!config) {
- result = void 0
- } else {
- if (typeUtils.isFunction(config[type])) {
- result = config[type]
- } else {
- result = extend({
- skipElementInitialStyles: true,
- cleanupWhen: this._completePromise
- }, config, configModifier);
- if (!result.type || "css" === result.type) {
- var cssClass = "dx-" + type;
- var extraCssClasses = (result.extraCssClasses ? " " + result.extraCssClasses : "") + directionPostfixes[result.direction];
- result.type = "css";
- result.from = (result.from || cssClass) + extraCssClasses;
- result.to = result.to || cssClass + "-active"
- }
- result.staggerDelay = result.staggerDelay || 0;
- result.delay = result.delay || 0;
- if (result.staggerDelay) {
- result.delay += this._accumulatedDelays[type];
- this._accumulatedDelays[type] += result.staggerDelay
- }
- }
- }
- return result
- },
- _createAnimation: function($element, animationConfig, configModifier) {
- var result;
- if (typeUtils.isPlainObject(animationConfig)) {
- result = fx.createAnimation($element, animationConfig)
- } else {
- if (typeUtils.isFunction(animationConfig)) {
- result = animationConfig($element, configModifier)
- }
- }
- return result
- },
- _startAnimations: function() {
- var animations = this._animations;
- for (var i = 0; i < animations.length; i++) {
- animations[i].start()
- }
- },
- _stopAnimations: function(jumpToEnd) {
- var animations = this._animations;
- for (var i = 0; i < animations.length; i++) {
- animations[i].stop(jumpToEnd)
- }
- },
- _clearAnimations: function() {
- var animations = this._animations;
- for (var i = 0; i < animations.length; i++) {
- animations[i].element.removeClass(DX_ANIMATING_CLASS)
- }
- this._animations.length = 0
- },
- reset: function() {
- this._accumulatedDelays.enter = 0;
- this._accumulatedDelays.leave = 0;
- this._clearAnimations();
- this._completeDeferred = new Deferred;
- this._completePromise = this._completeDeferred.promise()
- },
- enter: function($elements, animationConfig, configModifier) {
- var animations = this._createAnimations($elements, animationConfig, configModifier, "enter");
- this._animations.push.apply(this._animations, animations)
- },
- leave: function($elements, animationConfig, configModifier) {
- var animations = this._createAnimations($elements, animationConfig, configModifier, "leave");
- this._animations.push.apply(this._animations, animations)
- },
- start: function() {
- var that = this;
- var result;
- if (!this._animations.length) {
- that.reset();
- result = (new Deferred).resolve().promise()
- } else {
- var animationDeferreds = iteratorUtils.map(this._animations, function(animation) {
- var result = new Deferred;
- animation.deferred.always(function() {
- result.resolve()
- });
- return result.promise()
- });
- result = when.apply($, animationDeferreds).always(function() {
- that._completeDeferred.resolve();
- that.reset()
- });
- commonUtils.executeAsync(function() {
- that._startAnimations()
- })
- }
- return result
- },
- stop: function(jumpToEnd) {
- this._stopAnimations(jumpToEnd)
- }
- });
- exports.TransitionExecutor = TransitionExecutor
- },
- /*!****************************************!*\
- !*** ./artifacts/transpiled/events.js ***!
- \****************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventsEngine = __webpack_require__( /*! ./events/core/events_engine */ 5);
- exports.on = eventsEngine.on;
- exports.one = eventsEngine.one;
- exports.off = eventsEngine.off;
- exports.trigger = eventsEngine.trigger;
- exports.triggerHandler = eventsEngine.triggerHandler;
- exports.Event = eventsEngine.Event
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/ui/selection/selection.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var deferredStrategy = __webpack_require__( /*! ./selection.strategy.deferred */ 470);
- var standardStrategy = __webpack_require__( /*! ./selection.strategy.standard */ 471);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
- module.exports = Class.inherit({
- ctor: function(options) {
- this.options = extend(this._getDefaultOptions(), options, {
- selectedItemKeys: options.selectedKeys || []
- });
- this._selectionStrategy = this.options.deferred ? new deferredStrategy(this.options) : new standardStrategy(this.options);
- this._focusedItemIndex = -1;
- if (!this.options.equalByReference) {
- this._selectionStrategy.updateSelectedItemKeyHash(this.options.selectedItemKeys)
- }
- },
- _getDefaultOptions: function() {
- return {
- allowNullValue: false,
- deferred: false,
- equalByReference: false,
- mode: "multiple",
- selectedItems: [],
- selectionFilter: [],
- maxFilterLengthInRequest: 0,
- onSelectionChanged: noop,
- key: noop,
- keyOf: function(item) {
- return item
- },
- load: function() {
- return (new Deferred).resolve([])
- },
- totalCount: function() {
- return -1
- },
- isSelectableItem: function() {
- return true
- },
- isItemSelected: function() {
- return false
- },
- getItemData: function(item) {
- return item
- },
- dataFields: noop,
- filter: noop
- }
- },
- validate: function() {
- this._selectionStrategy.validate()
- },
- getSelectedItemKeys: function() {
- return this._selectionStrategy.getSelectedItemKeys()
- },
- getSelectedItems: function() {
- return this._selectionStrategy.getSelectedItems()
- },
- selectionFilter: function(value) {
- if (void 0 === value) {
- return this.options.selectionFilter
- }
- var filterIsChanged = this.options.selectionFilter !== value && JSON.stringify(this.options.selectionFilter) !== JSON.stringify(value);
- this.options.selectionFilter = value;
- filterIsChanged && this.onSelectionChanged()
- },
- setSelection: function(keys) {
- return this.selectedItemKeys(keys)
- },
- select: function(keys) {
- return this.selectedItemKeys(keys, true)
- },
- deselect: function(keys) {
- return this.selectedItemKeys(keys, true, true)
- },
- selectedItemKeys: function(keys, preserve, isDeselect, isSelectAll) {
- var that = this;
- keys = keys || [];
- keys = Array.isArray(keys) ? keys : [keys];
- that.validate();
- return this._selectionStrategy.selectedItemKeys(keys, preserve, isDeselect, isSelectAll)
- },
- clearSelection: function() {
- return this.selectedItemKeys([])
- },
- _addSelectedItem: function(itemData, key) {
- this._selectionStrategy.addSelectedItem(key, itemData)
- },
- _removeSelectedItem: function(key) {
- this._selectionStrategy.removeSelectedItem(key)
- },
- _setSelectedItems: function(keys, items) {
- this._selectionStrategy.setSelectedItems(keys, items)
- },
- onSelectionChanged: function() {
- this._selectionStrategy.onSelectionChanged()
- },
- changeItemSelection: function(itemIndex, keys) {
- var isSelectedItemsChanged;
- var items = this.options.plainItems();
- var item = items[itemIndex];
- if (!this.isSelectable() || !this.isDataItem(item)) {
- return false
- }
- var itemData = this.options.getItemData(item);
- var itemKey = this.options.keyOf(itemData);
- keys = keys || {};
- if (keys.shift && "multiple" === this.options.mode && this._focusedItemIndex >= 0) {
- isSelectedItemsChanged = this.changeItemSelectionWhenShiftKeyPressed(itemIndex, items)
- } else {
- if (keys.control) {
- this._resetItemSelectionWhenShiftKeyPressed();
- var isSelected = this._selectionStrategy.isItemDataSelected(itemData);
- if ("single" === this.options.mode) {
- this.clearSelectedItems()
- }
- if (isSelected) {
- this._removeSelectedItem(itemKey)
- } else {
- this._addSelectedItem(itemData, itemKey)
- }
- isSelectedItemsChanged = true
- } else {
- this._resetItemSelectionWhenShiftKeyPressed();
- var isKeysEqual = this._selectionStrategy.equalKeys(this.options.selectedItemKeys[0], itemKey);
- if (1 !== this.options.selectedItemKeys.length || !isKeysEqual) {
- this._setSelectedItems([itemKey], [itemData]);
- isSelectedItemsChanged = true
- }
- }
- }
- if (isSelectedItemsChanged) {
- this._focusedItemIndex = itemIndex;
- this.onSelectionChanged();
- return true
- }
- },
- isDataItem: function(item) {
- return this.options.isSelectableItem(item)
- },
- isSelectable: function() {
- return "single" === this.options.mode || "multiple" === this.options.mode
- },
- isItemDataSelected: function(data) {
- return this._selectionStrategy.isItemDataSelected(data)
- },
- isItemSelected: function(arg) {
- return this._selectionStrategy.isItemKeySelected(arg)
- },
- _resetItemSelectionWhenShiftKeyPressed: function() {
- delete this._shiftFocusedItemIndex
- },
- _resetFocusedItemIndex: function() {
- this._focusedItemIndex = -1
- },
- changeItemSelectionWhenShiftKeyPressed: function(itemIndex, items) {
- var isSelectedItemsChanged = false;
- var itemIndexStep;
- var index;
- var keyOf = this.options.keyOf;
- var focusedItem = items[this._focusedItemIndex];
- var focusedData = this.options.getItemData(focusedItem);
- var focusedKey = keyOf(focusedData);
- var isFocusedItemSelected = focusedItem && this.isItemDataSelected(focusedData);
- if (!isDefined(this._shiftFocusedItemIndex)) {
- this._shiftFocusedItemIndex = this._focusedItemIndex
- }
- var data;
- var itemKey;
- if (this._shiftFocusedItemIndex !== this._focusedItemIndex) {
- itemIndexStep = this._focusedItemIndex < this._shiftFocusedItemIndex ? 1 : -1;
- for (index = this._focusedItemIndex; index !== this._shiftFocusedItemIndex; index += itemIndexStep) {
- if (this.isDataItem(items[index])) {
- itemKey = keyOf(this.options.getItemData(items[index]));
- this._removeSelectedItem(itemKey);
- isSelectedItemsChanged = true
- }
- }
- }
- if (itemIndex !== this._shiftFocusedItemIndex) {
- itemIndexStep = itemIndex < this._shiftFocusedItemIndex ? 1 : -1;
- for (index = itemIndex; index !== this._shiftFocusedItemIndex; index += itemIndexStep) {
- if (this.isDataItem(items[index])) {
- data = this.options.getItemData(items[index]);
- itemKey = keyOf(data);
- this._addSelectedItem(data, itemKey);
- isSelectedItemsChanged = true
- }
- }
- }
- if (this.isDataItem(focusedItem) && !isFocusedItemSelected) {
- this._addSelectedItem(focusedData, focusedKey);
- isSelectedItemsChanged = true
- }
- return isSelectedItemsChanged
- },
- clearSelectedItems: function() {
- this._setSelectedItems([], [])
- },
- selectAll: function(isOnePage) {
- this._resetFocusedItemIndex();
- if (isOnePage) {
- return this._onePageSelectAll(false)
- } else {
- return this.selectedItemKeys([], true, false, true)
- }
- },
- deselectAll: function(isOnePage) {
- this._resetFocusedItemIndex();
- if (isOnePage) {
- return this._onePageSelectAll(true)
- } else {
- return this.selectedItemKeys([], true, true, true)
- }
- },
- _onePageSelectAll: function(isDeselect) {
- var items = this.options.plainItems();
- for (var i = 0; i < items.length; i++) {
- var item = items[i];
- if (this.isDataItem(item)) {
- var itemData = this.options.getItemData(item);
- var itemKey = this.options.keyOf(itemData);
- var isSelected = this.isItemSelected(itemKey);
- if (!isSelected && !isDeselect) {
- this._addSelectedItem(itemData, itemKey)
- }
- if (isSelected && isDeselect) {
- this._removeSelectedItem(itemKey)
- }
- }
- }
- this.onSelectionChanged();
- return (new Deferred).resolve()
- },
- getSelectAllState: function(visibleOnly) {
- return this._selectionStrategy.getSelectAllState(visibleOnly)
- }
- })
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/core/utils/selection_filter.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var getKeyHash = __webpack_require__( /*! ./common */ 4).getKeyHash;
- var equalByValue = __webpack_require__( /*! ./common */ 4).equalByValue;
- var typeUtils = __webpack_require__( /*! ./type */ 1);
- var SelectionFilterCreator = function(selectedItemKeys, isSelectAll) {
- this.getLocalFilter = function(keyGetter, equalKeys, equalByReference, keyExpr) {
- equalKeys = void 0 === equalKeys ? equalByValue : equalKeys;
- return functionFilter.bind(this, equalKeys, keyGetter, equalByReference, keyExpr)
- };
- this.getExpr = function(keyExpr) {
- if (!keyExpr) {
- return
- }
- var filterExpr;
- selectedItemKeys.forEach(function(key, index) {
- filterExpr = filterExpr || [];
- var filterExprPart;
- if (index > 0) {
- filterExpr.push(isSelectAll ? "and" : "or")
- }
- if (typeUtils.isString(keyExpr)) {
- filterExprPart = getFilterForPlainKey(keyExpr, key)
- } else {
- filterExprPart = getFilterForCompositeKey(keyExpr, key)
- }
- filterExpr.push(filterExprPart)
- });
- if (filterExpr && 1 === filterExpr.length) {
- filterExpr = filterExpr[0]
- }
- return filterExpr
- };
- this.getCombinedFilter = function(keyExpr, dataSourceFilter) {
- var filterExpr = this.getExpr(keyExpr);
- var combinedFilter = filterExpr;
- if (isSelectAll && dataSourceFilter) {
- if (filterExpr) {
- combinedFilter = [];
- combinedFilter.push(filterExpr);
- combinedFilter.push(dataSourceFilter)
- } else {
- combinedFilter = dataSourceFilter
- }
- }
- return combinedFilter
- };
- var selectedItemKeyHashesMap;
- var getSelectedItemKeyHashesMap = function(selectedItemKeys) {
- if (!selectedItemKeyHashesMap) {
- selectedItemKeyHashesMap = {};
- for (var i = 0; i < selectedItemKeys.length; i++) {
- selectedItemKeyHashesMap[getKeyHash(selectedItemKeys[i])] = true
- }
- }
- return selectedItemKeyHashesMap
- };
- var normalizeKeys = function(keys, keyOf, keyExpr) {
- return Array.isArray(keyExpr) ? keys.map(function(key) {
- return keyOf(key)
- }) : keys
- };
- var functionFilter = function(equalKeys, keyOf, equalByReference, keyExpr, item) {
- var key = keyOf(item);
- var keyHash;
- var i;
- if (!equalByReference) {
- keyHash = getKeyHash(key);
- if (!typeUtils.isObject(keyHash)) {
- var selectedKeyHashesMap = getSelectedItemKeyHashesMap(normalizeKeys(selectedItemKeys, keyOf, keyExpr));
- if (selectedKeyHashesMap[keyHash]) {
- return !isSelectAll
- }
- return !!isSelectAll
- }
- }
- for (i = 0; i < selectedItemKeys.length; i++) {
- if (equalKeys(selectedItemKeys[i], key)) {
- return !isSelectAll
- }
- }
- return !!isSelectAll
- };
- var getFilterForPlainKey = function(keyExpr, keyValue) {
- if (void 0 === keyValue) {
- return
- }
- return [keyExpr, isSelectAll ? "<>" : "=", keyValue]
- };
- var getFilterForCompositeKey = function(keyExpr, itemKeyValue) {
- var filterExpr = [];
- for (var i = 0, length = keyExpr.length; i < length; i++) {
- var currentKeyExpr = keyExpr[i];
- var currentKeyValue = itemKeyValue && itemKeyValue[currentKeyExpr];
- var filterExprPart = getFilterForPlainKey(currentKeyExpr, currentKeyValue);
- if (!filterExprPart) {
- break
- }
- if (i > 0) {
- filterExpr.push(isSelectAll ? "or" : "and")
- }
- filterExpr.push(filterExprPart)
- }
- return filterExpr
- }
- };
- exports.SelectionFilterCreator = SelectionFilterCreator
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/events/transform.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var mathUtils = __webpack_require__( /*! ../core/utils/math */ 28);
- var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var errors = __webpack_require__( /*! ../core/errors */ 21);
- var eventUtils = __webpack_require__( /*! ./utils */ 8);
- var Emitter = __webpack_require__( /*! ./core/emitter */ 123);
- var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
- var DX_PREFIX = "dx";
- var TRANSFORM = "transform";
- var TRANSLATE = "translate";
- var ZOOM = "zoom";
- var PINCH = "pinch";
- var ROTATE = "rotate";
- var START_POSTFIX = "start";
- var UPDATE_POSTFIX = "";
- var END_POSTFIX = "end";
- var eventAliases = [];
- var addAlias = function(eventName, eventArgs) {
- eventAliases.push({
- name: eventName,
- args: eventArgs
- })
- };
- addAlias(TRANSFORM, {
- scale: true,
- deltaScale: true,
- rotation: true,
- deltaRotation: true,
- translation: true,
- deltaTranslation: true
- });
- addAlias(TRANSLATE, {
- translation: true,
- deltaTranslation: true
- });
- addAlias(ZOOM, {
- scale: true,
- deltaScale: true
- });
- addAlias(PINCH, {
- scale: true,
- deltaScale: true
- });
- addAlias(ROTATE, {
- rotation: true,
- deltaRotation: true
- });
- var getVector = function(first, second) {
- return {
- x: second.pageX - first.pageX,
- y: -second.pageY + first.pageY,
- centerX: .5 * (second.pageX + first.pageX),
- centerY: .5 * (second.pageY + first.pageY)
- }
- };
- var getEventVector = function(e) {
- var pointers = e.pointers;
- return getVector(pointers[0], pointers[1])
- };
- var getDistance = function(vector) {
- return Math.sqrt(vector.x * vector.x + vector.y * vector.y)
- };
- var getScale = function(firstVector, secondVector) {
- return getDistance(firstVector) / getDistance(secondVector)
- };
- var getRotation = function(firstVector, secondVector) {
- var scalarProduct = firstVector.x * secondVector.x + firstVector.y * secondVector.y;
- var distanceProduct = getDistance(firstVector) * getDistance(secondVector);
- if (0 === distanceProduct) {
- return 0
- }
- var sign = mathUtils.sign(firstVector.x * secondVector.y - secondVector.x * firstVector.y);
- var angle = Math.acos(mathUtils.fitIntoRange(scalarProduct / distanceProduct, -1, 1));
- return sign * angle
- };
- var getTranslation = function(firstVector, secondVector) {
- return {
- x: firstVector.centerX - secondVector.centerX,
- y: firstVector.centerY - secondVector.centerY
- }
- };
- var TransformEmitter = Emitter.inherit({
- configure: function(data, eventName) {
- if (eventName.indexOf(ZOOM) > -1) {
- errors.log("W0005", eventName, "15.1", "Use '" + eventName.replace(ZOOM, PINCH) + "' event instead")
- }
- this.callBase(data)
- },
- validatePointers: function(e) {
- return eventUtils.hasTouches(e) > 1
- },
- start: function(e) {
- this._accept(e);
- var startVector = getEventVector(e);
- this._startVector = startVector;
- this._prevVector = startVector;
- this._fireEventAliases(START_POSTFIX, e)
- },
- move: function(e) {
- var currentVector = getEventVector(e);
- var eventArgs = this._getEventArgs(currentVector);
- this._fireEventAliases(UPDATE_POSTFIX, e, eventArgs);
- this._prevVector = currentVector
- },
- end: function(e) {
- var eventArgs = this._getEventArgs(this._prevVector);
- this._fireEventAliases(END_POSTFIX, e, eventArgs)
- },
- _getEventArgs: function(vector) {
- return {
- scale: getScale(vector, this._startVector),
- deltaScale: getScale(vector, this._prevVector),
- rotation: getRotation(vector, this._startVector),
- deltaRotation: getRotation(vector, this._prevVector),
- translation: getTranslation(vector, this._startVector),
- deltaTranslation: getTranslation(vector, this._prevVector)
- }
- },
- _fireEventAliases: function(eventPostfix, originalEvent, eventArgs) {
- eventArgs = eventArgs || {};
- iteratorUtils.each(eventAliases, function(_, eventAlias) {
- var args = {};
- iteratorUtils.each(eventAlias.args, function(name) {
- if (name in eventArgs) {
- args[name] = eventArgs[name]
- }
- });
- this._fireEvent(DX_PREFIX + eventAlias.name + eventPostfix, originalEvent, args)
- }.bind(this))
- }
- });
- var eventNames = eventAliases.reduce(function(result, eventAlias) {
- [START_POSTFIX, UPDATE_POSTFIX, END_POSTFIX].forEach(function(eventPostfix) {
- result.push(DX_PREFIX + eventAlias.name + eventPostfix)
- });
- return result
- }, []);
- registerEmitter({
- emitter: TransformEmitter,
- events: eventNames
- });
- iteratorUtils.each(eventNames, function(_, eventName) {
- exports[eventName.substring(DX_PREFIX.length)] = eventName
- })
- }, , ,
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/bundles/modules/parts/data.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var DevExpress = __webpack_require__( /*! ./core */ 212);
- var data = DevExpress.data = __webpack_require__( /*! ../../../bundles/modules/data */ 274);
- data.odata = __webpack_require__( /*! ../../../bundles/modules/data.odata */ 490);
- module.exports = data
- }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/pie_point.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
- var _extend = extend;
- var _round = Math.round;
- var _sqrt = Math.sqrt;
- var _acos = Math.acos;
- var DEG = 180 / Math.PI;
- var _abs = Math.abs;
- var vizUtils = __webpack_require__( /*! ../../core/utils */ 10);
- var _normalizeAngle = vizUtils.normalizeAngle;
- var _getCosAndSin = vizUtils.getCosAndSin;
- var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
- var getVerticallyShiftedAngularCoords = vizUtils.getVerticallyShiftedAngularCoords;
- var RADIAL_LABEL_INDENT = __webpack_require__( /*! ../../components/consts */ 117).radialLabelIndent;
- module.exports = _extend({}, symbolPoint, {
- _updateData: function(data, argumentChanged) {
- var that = this;
- symbolPoint._updateData.call(this, data);
- if (argumentChanged || !_isDefined(that._visible)) {
- that._visible = true
- }
- that.minValue = that.initialMinValue = that.originalMinValue = _isDefined(data.minValue) ? data.minValue : 0
- },
- animate: function(complete, duration, delay) {
- var that = this;
- that.graphic.animate({
- x: that.centerX,
- y: that.centerY,
- outerRadius: that.radiusOuter,
- innerRadius: that.radiusInner,
- startAngle: that.toAngle,
- endAngle: that.fromAngle
- }, {
- delay: delay,
- partitionDuration: duration
- }, complete)
- },
- correctPosition: function(correction) {
- var that = this;
- that.correctRadius(correction);
- that.correctLabelRadius(correction.radiusOuter + RADIAL_LABEL_INDENT);
- that.centerX = correction.centerX;
- that.centerY = correction.centerY
- },
- correctRadius: function(correction) {
- this.radiusInner = correction.radiusInner;
- this.radiusOuter = correction.radiusOuter
- },
- correctLabelRadius: function(radiusLabels) {
- this.radiusLabels = radiusLabels
- },
- correctValue: function(correction, percent, base) {
- var that = this;
- that.value = (base || that.normalInitialValue) + correction;
- that.minValue = correction;
- that.percent = percent;
- that._label.setDataField("percent", percent)
- },
- _updateLabelData: function() {
- this._label.setData(this._getLabelFormatObject())
- },
- _getShiftLabelCoords: function() {
- var that = this;
- var bBox = that._label.getBoundingRect();
- var coord = that._getLabelCoords(that._label);
- var visibleArea = that._getVisibleArea();
- if (that._isLabelDrawingWithoutPoints) {
- return that._checkLabelPosition(coord, bBox, visibleArea)
- } else {
- return that._getLabelExtraCoord(coord, that._checkVerticalLabelPosition(coord, bBox, visibleArea), bBox)
- }
- },
- _getLabelPosition: function(options) {
- return options.position
- },
- _getLabelCoords: function(label) {
- var that = this;
- var bBox = label.getBoundingRect();
- var options = label.getLayoutOptions();
- var angleFunctions = _getCosAndSin(that.middleAngle);
- var position = that._getLabelPosition(options);
- var radiusInner = that.radiusInner;
- var radiusOuter = that.radiusOuter;
- var radiusLabels = that.radiusLabels;
- var columnsPosition = "columns" === position;
- var rad;
- var x;
- if ("inside" === position) {
- rad = radiusInner + (radiusOuter - radiusInner) / 2 + options.radialOffset;
- x = that.centerX + rad * angleFunctions.cos - bBox.width / 2
- } else {
- rad = radiusLabels + options.radialOffset;
- if (angleFunctions.cos > .1 || columnsPosition && angleFunctions.cos >= 0) {
- x = that.centerX + rad * angleFunctions.cos
- } else {
- if (angleFunctions.cos < -.1 || columnsPosition && angleFunctions.cos < 0) {
- x = that.centerX + rad * angleFunctions.cos - bBox.width
- } else {
- x = that.centerX + rad * angleFunctions.cos - bBox.width / 2
- }
- }
- }
- return {
- x: x,
- y: _round(that.centerY - rad * angleFunctions.sin - bBox.height / 2)
- }
- },
- _correctLabelCoord: function(coord, moveLabelsFromCenter) {
- var that = this;
- var label = that._label;
- var bBox = label.getBoundingRect();
- var labelWidth = bBox.width;
- var options = label.getLayoutOptions();
- var visibleArea = that._getVisibleArea();
- var rightBorderX = visibleArea.maxX - labelWidth;
- var leftBorderX = visibleArea.minX;
- var angleOfPoint = _normalizeAngle(that.middleAngle);
- var centerX = that.centerX;
- var connectorOffset = options.connectorOffset;
- var x = coord.x;
- if ("columns" === options.position) {
- if (angleOfPoint <= 90 || angleOfPoint >= 270) {
- x = rightBorderX
- } else {
- x = leftBorderX
- }
- coord.x = x
- } else {
- if ("inside" !== options.position && moveLabelsFromCenter) {
- if (angleOfPoint <= 90 || angleOfPoint >= 270) {
- if (x - connectorOffset < centerX) {
- x = centerX + connectorOffset
- }
- } else {
- if (x + labelWidth + connectorOffset > centerX) {
- x = centerX - labelWidth - connectorOffset
- }
- }
- coord.x = x
- }
- }
- return coord
- },
- drawLabel: function() {
- this.translate();
- this._isLabelDrawingWithoutPoints = true;
- this._drawLabel();
- this._isLabelDrawingWithoutPoints = false
- },
- updateLabelCoord: function(moveLabelsFromCenter) {
- var that = this;
- var bBox = that._label.getBoundingRect();
- var coord = that._correctLabelCoord(bBox, moveLabelsFromCenter);
- coord = that._checkHorizontalLabelPosition(coord, bBox, that._getVisibleArea());
- that._label.shift(_round(coord.x), _round(bBox.y))
- },
- _checkVerticalLabelPosition: function(coord, box, visibleArea) {
- var x = coord.x;
- var y = coord.y;
- if (coord.y + box.height > visibleArea.maxY) {
- y = visibleArea.maxY - box.height
- } else {
- if (coord.y < visibleArea.minY) {
- y = visibleArea.minY
- }
- }
- return {
- x: x,
- y: y
- }
- },
- _getLabelExtraCoord: function(coord, shiftCoord, box) {
- return coord.y !== shiftCoord.y ? getVerticallyShiftedAngularCoords({
- x: coord.x,
- y: coord.y,
- width: box.width,
- height: box.height
- }, shiftCoord.y - coord.y, {
- x: this.centerX,
- y: this.centerY
- }) : coord
- },
- _checkHorizontalLabelPosition: function(coord, box, visibleArea) {
- var x = coord.x;
- var y = coord.y;
- if (coord.x + box.width > visibleArea.maxX) {
- x = visibleArea.maxX - box.width
- } else {
- if (coord.x < visibleArea.minX) {
- x = visibleArea.minX
- }
- }
- return {
- x: x,
- y: y
- }
- },
- applyWordWrap: function(moveLabelsFromCenter) {
- var that = this;
- var label = that._label;
- var box = label.getBoundingRect();
- var visibleArea = that._getVisibleArea();
- var position = label.getLayoutOptions().position;
- var width = box.width;
- var rowCountChanged = false;
- if ("columns" === position && that.series.index > 0) {
- width = visibleArea.maxX - that.centerX - that.radiusLabels
- } else {
- if ("inside" === position) {
- if (width > visibleArea.maxX - visibleArea.minX) {
- width = visibleArea.maxX - visibleArea.minX
- }
- } else {
- if (moveLabelsFromCenter && box.x < that.centerX && box.width + box.x > that.centerX) {
- width = Math.floor((visibleArea.maxX - visibleArea.minX) / 2)
- } else {
- if (box.x + width > visibleArea.maxX) {
- width = visibleArea.maxX - box.x
- } else {
- if (box.x < visibleArea.minX) {
- width = box.x + width - visibleArea.minX
- }
- }
- }
- }
- }
- if (width < box.width) {
- rowCountChanged = label.fit(width)
- }
- return rowCountChanged
- },
- setLabelTrackerData: function() {
- this._label.setTrackerData(this)
- },
- _checkLabelPosition: function(coord, bBox, visibleArea) {
- coord = this._checkHorizontalLabelPosition(coord, bBox, visibleArea);
- return this._checkVerticalLabelPosition(coord, bBox, visibleArea)
- },
- _getLabelConnector: function() {
- var that = this;
- var rad = that.radiusOuter;
- var seriesStyle = that._options.styles.normal;
- var strokeWidthBy2 = seriesStyle["stroke-width"] / 2;
- var borderWidth = that.series.getOptions().containerBackgroundColor === seriesStyle.stroke ? _round(strokeWidthBy2) : _round(-strokeWidthBy2);
- var angleFunctions = _getCosAndSin(_round(that.middleAngle));
- return {
- x: _round(that.centerX + (rad - borderWidth) * angleFunctions.cos),
- y: _round(that.centerY - (rad - borderWidth) * angleFunctions.sin),
- angle: that.middleAngle
- }
- },
- _drawMarker: function(renderer, group, animationEnabled, firstDrawing) {
- var that = this;
- var radiusOuter = that.radiusOuter;
- var radiusInner = that.radiusInner;
- var fromAngle = that.fromAngle;
- var toAngle = that.toAngle;
- if (animationEnabled) {
- radiusInner = radiusOuter = 0;
- if (!firstDrawing) {
- fromAngle = toAngle = that.shiftedAngle
- }
- }
- that.graphic = renderer.arc(that.centerX, that.centerY, radiusInner, radiusOuter, toAngle, fromAngle).attr({
- "stroke-linejoin": "round"
- }).smartAttr(that._getStyle()).data({
- "chart-data-point": that
- }).sharp().append(group)
- },
- getTooltipParams: function() {
- var that = this;
- var angleFunctions = _getCosAndSin(that.middleAngle);
- var radiusInner = that.radiusInner;
- var radiusOuter = that.radiusOuter;
- return {
- x: that.centerX + (radiusInner + (radiusOuter - radiusInner) / 2) * angleFunctions.cos,
- y: that.centerY - (radiusInner + (radiusOuter - radiusInner) / 2) * angleFunctions.sin,
- offset: 0
- }
- },
- _translate: function() {
- var that = this;
- var angle = that.shiftedAngle || 0;
- var value = that.value;
- var minValue = that.minValue;
- var translator = that._getValTranslator();
- that.fromAngle = translator.translate(minValue) + angle;
- that.toAngle = translator.translate(value) + angle;
- that.middleAngle = translator.translate((value - minValue) / 2 + minValue) + angle;
- if (!that.isVisible()) {
- that.middleAngle = that.toAngle = that.fromAngle = that.fromAngle || angle
- }
- },
- getMarkerVisibility: function() {
- return true
- },
- _updateMarker: function(animationEnabled, style, _, callback) {
- var that = this;
- if (!animationEnabled) {
- style = _extend({
- x: that.centerX,
- y: that.centerY,
- outerRadius: that.radiusOuter,
- innerRadius: that.radiusInner,
- startAngle: that.toAngle,
- endAngle: that.fromAngle
- }, style)
- }
- that.graphic.smartAttr(style).sharp();
- callback && callback()
- },
- getLegendStyles: function() {
- return this._styles.legendStyles
- },
- isInVisibleArea: function() {
- return true
- },
- hide: function() {
- var that = this;
- if (that._visible) {
- that._visible = false;
- that.hideTooltip();
- that._options.visibilityChanged()
- }
- },
- show: function() {
- var that = this;
- if (!that._visible) {
- that._visible = true;
- that._options.visibilityChanged()
- }
- },
- setInvisibility: function() {
- this._label.draw(false)
- },
- isVisible: function() {
- return this._visible
- },
- _getFormatObject: function(tooltip) {
- var formatObject = symbolPoint._getFormatObject.call(this, tooltip);
- var percent = this.percent;
- formatObject.percent = percent;
- formatObject.percentText = tooltip.formatValue(percent, "percent");
- return formatObject
- },
- getColor: function() {
- return this._styles.normal.fill
- },
- coordsIn: function(x, y) {
- var that = this;
- var lx = x - that.centerX;
- var ly = y - that.centerY;
- var r = _sqrt(lx * lx + ly * ly);
- var fromAngle = that.fromAngle % 360;
- var toAngle = that.toAngle % 360;
- var angle;
- if (r < that.radiusInner || r > that.radiusOuter || 0 === r) {
- return false
- }
- angle = _acos(lx / r) * DEG * (ly > 0 ? -1 : 1);
- if (angle < 0) {
- angle += 360
- }
- if (fromAngle === toAngle && _abs(that.toAngle - that.fromAngle) > 1e-4) {
- return true
- } else {
- return fromAngle >= toAngle ? angle <= fromAngle && angle >= toAngle : !(angle >= fromAngle && angle <= toAngle)
- }
- }
- })
- },
- /*!**********************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/range_symbol_point.js ***!
- \**********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each;
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
- var labelModule = __webpack_require__( /*! ./label */ 246);
- var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
- var _extend = extend;
- var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
- var _math = Math;
- var _abs = _math.abs;
- var _min = _math.min;
- var _max = _math.max;
- var _round = _math.round;
- var DEFAULT_IMAGE_WIDTH = 20;
- var DEFAULT_IMAGE_HEIGHT = 20;
- module.exports = _extend({}, symbolPoint, {
- deleteLabel: function() {
- var that = this;
- that._topLabel.dispose();
- that._topLabel = null;
- that._bottomLabel.dispose();
- that._bottomLabel = null
- },
- hideMarker: function(type) {
- var graphic = this.graphic;
- var marker = graphic && graphic[type + "Marker"];
- var label = this["_" + type + "Label"];
- if (marker && "hidden" !== marker.attr("visibility")) {
- marker.attr({
- visibility: "hidden"
- })
- }
- label.draw(false)
- },
- setInvisibility: function() {
- this.hideMarker("top");
- this.hideMarker("bottom")
- },
- clearVisibility: function() {
- var that = this;
- var graphic = that.graphic;
- var topMarker = graphic && graphic.topMarker;
- var bottomMarker = graphic && graphic.bottomMarker;
- if (topMarker && topMarker.attr("visibility")) {
- topMarker.attr({
- visibility: null
- })
- }
- if (bottomMarker && bottomMarker.attr("visibility")) {
- bottomMarker.attr({
- visibility: null
- })
- }
- },
- clearMarker: function() {
- var that = this;
- var graphic = that.graphic;
- var topMarker = graphic && graphic.topMarker;
- var bottomMarker = graphic && graphic.bottomMarker;
- var emptySettings = that._emptySettings;
- topMarker && topMarker.attr(emptySettings);
- bottomMarker && bottomMarker.attr(emptySettings)
- },
- _getLabelPosition: function(markerType) {
- var position;
- var labelsInside = "inside" === this._options.label.position;
- if (!this._options.rotated) {
- position = "top" === markerType ^ labelsInside ? "top" : "bottom"
- } else {
- position = "top" === markerType ^ labelsInside ? "right" : "left"
- }
- return position
- },
- _getLabelMinFormatObject: function() {
- var that = this;
- return {
- index: 0,
- argument: that.initialArgument,
- value: that.initialMinValue,
- seriesName: that.series.name,
- originalValue: that.originalMinValue,
- originalArgument: that.originalArgument,
- point: that
- }
- },
- _updateLabelData: function() {
- var maxFormatObject = this._getLabelFormatObject();
- maxFormatObject.index = 1;
- this._topLabel.setData(maxFormatObject);
- this._bottomLabel.setData(this._getLabelMinFormatObject())
- },
- _updateLabelOptions: function() {
- var that = this;
- var options = this._options.label;
- (!that._topLabel || !that._bottomLabel) && that._createLabel();
- that._topLabel.setOptions(options);
- that._bottomLabel.setOptions(options)
- },
- _createLabel: function() {
- var options = {
- renderer: this.series._renderer,
- labelsGroup: this.series._labelsGroup,
- point: this
- };
- this._topLabel = new labelModule.Label(options);
- this._bottomLabel = new labelModule.Label(options)
- },
- _getGraphicBBox: function(location) {
- var options = this._options;
- var images = this._getImage(options.image);
- var image = "top" === location ? this._checkImage(images.top) : this._checkImage(images.bottom);
- var bBox;
- var coord = this._getPositionFromLocation(location);
- if (options.visible) {
- bBox = image ? this._getImageBBox(coord.x, coord.y) : this._getSymbolBBox(coord.x, coord.y, options.styles.normal.r)
- } else {
- bBox = {
- x: coord.x,
- y: coord.y,
- width: 0,
- height: 0
- }
- }
- return bBox
- },
- _getPositionFromLocation: function(location) {
- var x;
- var y;
- var isTop = "top" === location;
- if (!this._options.rotated) {
- x = this.x;
- y = isTop ? _min(this.y, this.minY) : _max(this.y, this.minY)
- } else {
- x = isTop ? _max(this.x, this.minX) : _min(this.x, this.minX);
- y = this.y
- }
- return {
- x: x,
- y: y
- }
- },
- _checkOverlay: function(bottomCoord, topCoord, topValue) {
- return bottomCoord < topCoord + topValue
- },
- _getOverlayCorrections: function(topCoords, bottomCoords) {
- var rotated = this._options.rotated;
- var coordSelector = !rotated ? "y" : "x";
- var valueSelector = !rotated ? "height" : "width";
- var visibleArea = this.series.getValueAxis().getVisibleArea();
- var minBound = visibleArea[0];
- var maxBound = visibleArea[1];
- var delta = _round((topCoords[coordSelector] + topCoords[valueSelector] - bottomCoords[coordSelector]) / 2);
- var coord1 = topCoords[coordSelector] - delta;
- var coord2 = bottomCoords[coordSelector] + delta;
- if (coord1 < minBound) {
- delta = minBound - topCoords[coordSelector];
- coord1 += delta;
- coord2 += delta
- } else {
- if (coord2 + bottomCoords[valueSelector] > maxBound) {
- delta = -(bottomCoords[coordSelector] + bottomCoords[valueSelector] - maxBound);
- coord1 += delta;
- coord2 += delta
- }
- }
- return {
- coord1: coord1,
- coord2: coord2
- }
- },
- _checkLabelsOverlay: function(topLocation) {
- var that = this;
- var topCoords = that._topLabel.getBoundingRect();
- var bottomCoords = that._bottomLabel.getBoundingRect();
- var corrections = {};
- if (!that._options.rotated) {
- if ("top" === topLocation) {
- if (this._checkOverlay(bottomCoords.y, topCoords.y, topCoords.height)) {
- corrections = this._getOverlayCorrections(topCoords, bottomCoords);
- that._topLabel.shift(topCoords.x, corrections.coord1);
- that._bottomLabel.shift(bottomCoords.x, corrections.coord2)
- }
- } else {
- if (this._checkOverlay(topCoords.y, bottomCoords.y, bottomCoords.height)) {
- corrections = this._getOverlayCorrections(bottomCoords, topCoords);
- that._topLabel.shift(topCoords.x, corrections.coord2);
- that._bottomLabel.shift(bottomCoords.x, corrections.coord1)
- }
- }
- } else {
- if ("top" === topLocation) {
- if (this._checkOverlay(topCoords.x, bottomCoords.x, bottomCoords.width)) {
- corrections = this._getOverlayCorrections(bottomCoords, topCoords);
- that._topLabel.shift(corrections.coord2, topCoords.y);
- that._bottomLabel.shift(corrections.coord1, bottomCoords.y)
- }
- } else {
- if (this._checkOverlay(bottomCoords.x, topCoords.x, topCoords.width)) {
- corrections = this._getOverlayCorrections(topCoords, bottomCoords);
- that._topLabel.shift(corrections.coord1, topCoords.y);
- that._bottomLabel.shift(corrections.coord2, bottomCoords.y)
- }
- }
- }
- },
- _drawLabel: function() {
- var that = this;
- var labels = [];
- var notInverted = that._options.rotated ? that.x >= that.minX : that.y < that.minY;
- var customVisibility = that._getCustomLabelVisibility();
- var topLabel = that._topLabel;
- var bottomLabel = that._bottomLabel;
- topLabel.pointPosition = notInverted ? "top" : "bottom";
- bottomLabel.pointPosition = notInverted ? "bottom" : "top";
- if ((that.series.getLabelVisibility() || customVisibility) && that.hasValue() && false !== customVisibility) {
- false !== that.visibleTopMarker && labels.push(topLabel);
- false !== that.visibleBottomMarker && labels.push(bottomLabel);
- each(labels, function(_, label) {
- label.draw(true)
- });
- that._checkLabelsOverlay(that._topLabel.pointPosition)
- } else {
- topLabel.draw(false);
- bottomLabel.draw(false)
- }
- },
- _getImage: function(imageOption) {
- var image = {};
- if (_isDefined(imageOption)) {
- if ("string" === typeof imageOption) {
- image.top = image.bottom = imageOption
- } else {
- image.top = {
- url: "string" === typeof imageOption.url ? imageOption.url : imageOption.url && imageOption.url.rangeMaxPoint,
- width: "number" === typeof imageOption.width ? imageOption.width : imageOption.width && imageOption.width.rangeMaxPoint,
- height: "number" === typeof imageOption.height ? imageOption.height : imageOption.height && imageOption.height.rangeMaxPoint
- };
- image.bottom = {
- url: "string" === typeof imageOption.url ? imageOption.url : imageOption.url && imageOption.url.rangeMinPoint,
- width: "number" === typeof imageOption.width ? imageOption.width : imageOption.width && imageOption.width.rangeMinPoint,
- height: "number" === typeof imageOption.height ? imageOption.height : imageOption.height && imageOption.height.rangeMinPoint
- }
- }
- }
- return image
- },
- _checkSymbol: function(oldOptions, newOptions) {
- var that = this;
- var oldSymbol = oldOptions.symbol;
- var newSymbol = newOptions.symbol;
- var symbolChanged = "circle" === oldSymbol && "circle" !== newSymbol || "circle" !== oldSymbol && "circle" === newSymbol;
- var oldImages = that._getImage(oldOptions.image);
- var newImages = that._getImage(newOptions.image);
- var topImageChanged = that._checkImage(oldImages.top) !== that._checkImage(newImages.top);
- var bottomImageChanged = that._checkImage(oldImages.bottom) !== that._checkImage(newImages.bottom);
- return symbolChanged || topImageChanged || bottomImageChanged
- },
- _getSettingsForTwoMarkers: function(style) {
- var that = this;
- var options = that._options;
- var settings = {};
- var x = options.rotated ? _min(that.x, that.minX) : that.x;
- var y = options.rotated ? that.y : _min(that.y, that.minY);
- var radius = style.r;
- var points = that._populatePointShape(options.symbol, radius);
- settings.top = _extend({
- translateX: x + that.width,
- translateY: y,
- r: radius
- }, style);
- settings.bottom = _extend({
- translateX: x,
- translateY: y + that.height,
- r: radius
- }, style);
- if (points) {
- settings.top.points = settings.bottom.points = points
- }
- return settings
- },
- _hasGraphic: function() {
- return this.graphic && this.graphic.topMarker && this.graphic.bottomMarker
- },
- _drawOneMarker: function(renderer, markerType, imageSettings, settings) {
- var that = this;
- var graphic = that.graphic;
- if (graphic[markerType]) {
- that._updateOneMarker(markerType, settings)
- } else {
- graphic[markerType] = that._createMarker(renderer, graphic, imageSettings, settings)
- }
- },
- _drawMarker: function(renderer, group, animationEnabled, firstDrawing, style) {
- var that = this;
- var settings = that._getSettingsForTwoMarkers(style || that._getStyle());
- var image = that._getImage(that._options.image);
- if (that._checkImage(image.top)) {
- settings.top = that._getImageSettings(settings.top, image.top)
- }
- if (that._checkImage(image.bottom)) {
- settings.bottom = that._getImageSettings(settings.bottom, image.bottom)
- }
- that.graphic = that.graphic || renderer.g().append(group);
- that.visibleTopMarker && that._drawOneMarker(renderer, "topMarker", image.top, settings.top);
- that.visibleBottomMarker && that._drawOneMarker(renderer, "bottomMarker", image.bottom, settings.bottom)
- },
- _getSettingsForTracker: function(radius) {
- var that = this;
- var rotated = that._options.rotated;
- return {
- translateX: rotated ? _min(that.x, that.minX) - radius : that.x - radius,
- translateY: rotated ? that.y - radius : _min(that.y, that.minY) - radius,
- width: that.width + 2 * radius,
- height: that.height + 2 * radius
- }
- },
- isInVisibleArea: function() {
- var that = this;
- var rotated = that._options.rotated;
- var argument = !rotated ? that.x : that.y;
- var maxValue = !rotated ? _max(that.minY, that.y) : _max(that.minX, that.x);
- var minValue = !rotated ? _min(that.minY, that.y) : _min(that.minX, that.x);
- var tmp;
- var visibleTopMarker = true;
- var visibleBottomMarker = true;
- var visibleRangeArea = true;
- var visibleArgArea = that.series.getArgumentAxis().getVisibleArea();
- var visibleValArea = that.series.getValueAxis().getVisibleArea();
- var notVisibleByArg = visibleArgArea[1] < argument || visibleArgArea[0] > argument;
- var notVisibleByVal = visibleValArea[0] > minValue && visibleValArea[0] > maxValue || visibleValArea[1] < minValue && visibleValArea[1] < maxValue;
- if (notVisibleByArg || notVisibleByVal) {
- visibleTopMarker = visibleBottomMarker = visibleRangeArea = false
- } else {
- visibleTopMarker = visibleValArea[0] <= minValue && visibleValArea[1] > minValue;
- visibleBottomMarker = visibleValArea[0] < maxValue && visibleValArea[1] >= maxValue;
- if (rotated) {
- tmp = visibleTopMarker;
- visibleTopMarker = visibleBottomMarker;
- visibleBottomMarker = tmp
- }
- }
- that.visibleTopMarker = visibleTopMarker;
- that.visibleBottomMarker = visibleBottomMarker;
- return visibleRangeArea
- },
- getTooltipParams: function() {
- var that = this;
- var x;
- var y;
- var rotated = that._options.rotated;
- var minValue = !rotated ? _min(that.y, that.minY) : _min(that.x, that.minX);
- var side = !rotated ? "height" : "width";
- var visibleArea = that._getVisibleArea();
- var minVisible = rotated ? visibleArea.minX : visibleArea.minY;
- var maxVisible = rotated ? visibleArea.maxX : visibleArea.maxY;
- var min = _max(minVisible, minValue);
- var max = _min(maxVisible, minValue + that[side]);
- if (!rotated) {
- x = that.x;
- y = min + (max - min) / 2
- } else {
- y = that.y;
- x = min + (max - min) / 2
- }
- return {
- x: x,
- y: y,
- offset: 0
- }
- },
- _translate: function() {
- var that = this;
- var rotated = that._options.rotated;
- symbolPoint._translate.call(that);
- that.height = rotated ? 0 : _abs(that.minY - that.y);
- that.width = rotated ? _abs(that.x - that.minX) : 0
- },
- hasCoords: function() {
- return symbolPoint.hasCoords.call(this) && !(null === this.minX || null === this.minY)
- },
- _updateData: function(data) {
- var that = this;
- symbolPoint._updateData.call(that, data);
- that.minValue = that.initialMinValue = that.originalMinValue = data.minValue
- },
- _getImageSettings: function(settings, image) {
- return {
- href: image.url || image.toString(),
- width: image.width || DEFAULT_IMAGE_WIDTH,
- height: image.height || DEFAULT_IMAGE_HEIGHT,
- translateX: settings.translateX,
- translateY: settings.translateY
- }
- },
- getCrosshairData: function(x, y) {
- var that = this;
- var rotated = that._options.rotated;
- var minX = that.minX;
- var minY = that.minY;
- var vx = that.vx;
- var vy = that.vy;
- var value = that.value;
- var minValue = that.minValue;
- var argument = that.argument;
- var coords = {
- axis: that.series.axis,
- x: vx,
- y: vy,
- yValue: value,
- xValue: argument
- };
- if (rotated) {
- coords.yValue = argument;
- if (_abs(vx - x) < _abs(minX - x)) {
- coords.xValue = value
- } else {
- coords.x = minX;
- coords.xValue = minValue
- }
- } else {
- if (_abs(vy - y) >= _abs(minY - y)) {
- coords.y = minY;
- coords.yValue = minValue
- }
- }
- return coords
- },
- _updateOneMarker: function(markerType, settings) {
- this.graphic && this.graphic[markerType] && this.graphic[markerType].attr(settings)
- },
- _updateMarker: function(animationEnabled, style) {
- this._drawMarker(void 0, void 0, false, false, style)
- },
- _getFormatObject: function(tooltip) {
- var that = this;
- var initialMinValue = that.initialMinValue;
- var initialValue = that.initialValue;
- var initialArgument = that.initialArgument;
- var minValue = tooltip.formatValue(initialMinValue);
- var value = tooltip.formatValue(initialValue);
- return {
- argument: initialArgument,
- argumentText: tooltip.formatValue(initialArgument, "argument"),
- valueText: minValue + " - " + value,
- rangeValue1Text: minValue,
- rangeValue2Text: value,
- rangeValue1: initialMinValue,
- rangeValue2: initialValue,
- seriesName: that.series.name,
- point: that,
- originalMinValue: that.originalMinValue,
- originalValue: that.originalValue,
- originalArgument: that.originalArgument
- }
- },
- getLabel: function() {
- return [this._topLabel, this._bottomLabel]
- },
- getLabels: function() {
- return [this._topLabel, this._bottomLabel]
- },
- getBoundingRect: noop,
- coordsIn: function(x, y) {
- var trackerRadius = this._storeTrackerR();
- var xCond = x >= this.x - trackerRadius && x <= this.x + trackerRadius;
- var yCond = y >= this.y - trackerRadius && y <= this.y + trackerRadius;
- if (this._options.rotated) {
- return yCond && (xCond || x >= this.minX - trackerRadius && x <= this.minX + trackerRadius)
- } else {
- return xCond && (yCond || y >= this.minY - trackerRadius && y <= this.minY + trackerRadius)
- }
- },
- getMaxValue: function() {
- if ("discrete" !== this.series.valueAxisType) {
- return this.minValue > this.value ? this.minValue : this.value
- }
- return this.value
- },
- getMinValue: function() {
- if ("discrete" !== this.series.valueAxisType) {
- return this.minValue < this.value ? this.minValue : this.value
- }
- return this.minValue
- }
- })
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/candlestick_point.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
- var barPoint = __webpack_require__( /*! ./bar_point */ 202);
- var _math = Math;
- var _abs = _math.abs;
- var _min = _math.min;
- var _max = _math.max;
- var _round = _math.round;
- var DEFAULT_FINANCIAL_TRACKER_MARGIN = 2;
- module.exports = _extend({}, barPoint, {
- _getContinuousPoints: function(openCoord, closeCoord) {
- var that = this;
- var x = that.x;
- var createPoint = that._options.rotated ? function(x, y) {
- return [y, x]
- } : function(x, y) {
- return [x, y]
- };
- var width = that.width;
- var highCoord = that.highY;
- var max = _abs(highCoord - openCoord) < _abs(highCoord - closeCoord) ? openCoord : closeCoord;
- var min = max === closeCoord ? openCoord : closeCoord;
- var points;
- if (min === max) {
- points = [].concat(createPoint(x, that.highY)).concat(createPoint(x, that.lowY)).concat(createPoint(x, that.closeY)).concat(createPoint(x - width / 2, that.closeY)).concat(createPoint(x + width / 2, that.closeY)).concat(createPoint(x, that.closeY))
- } else {
- points = [].concat(createPoint(x, that.highY)).concat(createPoint(x, max)).concat(createPoint(x + width / 2, max)).concat(createPoint(x + width / 2, min)).concat(createPoint(x, min)).concat(createPoint(x, that.lowY)).concat(createPoint(x, min)).concat(createPoint(x - width / 2, min)).concat(createPoint(x - width / 2, max)).concat(createPoint(x, max))
- }
- return points
- },
- _getCrockPoints: function(y) {
- var that = this;
- var x = that.x;
- var createPoint = that._options.rotated ? function(x, y) {
- return [y, x]
- } : function(x, y) {
- return [x, y]
- };
- return [].concat(createPoint(x, that.highY)).concat(createPoint(x, that.lowY)).concat(createPoint(x, y)).concat(createPoint(x - that.width / 2, y)).concat(createPoint(x + that.width / 2, y)).concat(createPoint(x, y))
- },
- _getPoints: function() {
- var that = this;
- var points;
- var closeCoord = that.closeY;
- var openCoord = that.openY;
- if (null !== closeCoord && null !== openCoord) {
- points = that._getContinuousPoints(openCoord, closeCoord)
- } else {
- if (openCoord === closeCoord) {
- points = [that.x, that.highY, that.x, that.lowY]
- } else {
- points = that._getCrockPoints(null !== openCoord ? openCoord : closeCoord)
- }
- }
- return points
- },
- getColor: function() {
- var that = this;
- return that._isReduction ? that._options.reduction.color : that._styles.normal.stroke || that.series.getColor()
- },
- _drawMarkerInGroup: function(group, attributes, renderer) {
- var that = this;
- that.graphic = renderer.path(that._getPoints(), "area").attr({
- "stroke-linecap": "square"
- }).attr(attributes).data({
- "chart-data-point": that
- }).sharp().append(group)
- },
- _fillStyle: function() {
- var that = this;
- var styles = that._options.styles;
- if (that._isReduction && that._isPositive) {
- that._styles = styles.reductionPositive
- } else {
- if (that._isReduction) {
- that._styles = styles.reduction
- } else {
- if (that._isPositive) {
- that._styles = styles.positive
- } else {
- that._styles = styles
- }
- }
- }
- },
- _getMinTrackerWidth: function() {
- return 2 + 2 * this._styles.normal["stroke-width"]
- },
- correctCoordinates: function(correctOptions) {
- var minWidth = this._getMinTrackerWidth();
- var maxWidth = 10;
- var width = correctOptions.width;
- width = width < minWidth ? minWidth : width > maxWidth ? maxWidth : width;
- this.width = width + width % 2;
- this.xCorrection = correctOptions.offset
- },
- _getMarkerGroup: function(group) {
- var that = this;
- var markerGroup;
- if (that._isReduction && that._isPositive) {
- markerGroup = group.reductionPositiveMarkersGroup
- } else {
- if (that._isReduction) {
- markerGroup = group.reductionMarkersGroup
- } else {
- if (that._isPositive) {
- markerGroup = group.defaultPositiveMarkersGroup
- } else {
- markerGroup = group.defaultMarkersGroup
- }
- }
- }
- return markerGroup
- },
- _drawMarker: function(renderer, group) {
- this._drawMarkerInGroup(this._getMarkerGroup(group), this._getStyle(), renderer)
- },
- _getSettingsForTracker: function() {
- var that = this;
- var highY = that.highY;
- var lowY = that.lowY;
- var rotated = that._options.rotated;
- var x;
- var y;
- var width;
- var height;
- if (highY === lowY) {
- highY = rotated ? highY + DEFAULT_FINANCIAL_TRACKER_MARGIN : highY - DEFAULT_FINANCIAL_TRACKER_MARGIN;
- lowY = rotated ? lowY - DEFAULT_FINANCIAL_TRACKER_MARGIN : lowY + DEFAULT_FINANCIAL_TRACKER_MARGIN
- }
- if (rotated) {
- x = _min(lowY, highY);
- y = that.x - that.width / 2;
- width = _abs(lowY - highY);
- height = that.width
- } else {
- x = that.x - that.width / 2;
- y = _min(lowY, highY);
- width = that.width;
- height = _abs(lowY - highY)
- }
- return {
- x: x,
- y: y,
- width: width,
- height: height
- }
- },
- _getGraphicBBox: function() {
- var that = this;
- var rotated = that._options.rotated;
- var x = that.x;
- var width = that.width;
- var lowY = that.lowY;
- var highY = that.highY;
- return {
- x: !rotated ? x - _round(width / 2) : lowY,
- y: !rotated ? highY : x - _round(width / 2),
- width: !rotated ? width : highY - lowY,
- height: !rotated ? lowY - highY : width
- }
- },
- getTooltipParams: function(location) {
- var that = this;
- if (that.graphic) {
- var minValue = _min(that.lowY, that.highY);
- var maxValue = _max(that.lowY, that.highY);
- var visibleArea = that._getVisibleArea();
- var rotated = that._options.rotated;
- var minVisible = rotated ? visibleArea.minX : visibleArea.minY;
- var maxVisible = rotated ? visibleArea.maxX : visibleArea.maxY;
- var min = _max(minVisible, minValue);
- var max = _min(maxVisible, maxValue);
- var centerCoord = that.getCenterCoord();
- if ("edge" === location) {
- centerCoord[rotated ? "x" : "y"] = rotated ? max : min
- }
- centerCoord.offset = 0;
- return centerCoord
- }
- },
- getCenterCoord: function() {
- if (this.graphic) {
- var that = this;
- var x;
- var y;
- var minValue = _min(that.lowY, that.highY);
- var maxValue = _max(that.lowY, that.highY);
- var visibleArea = that._getVisibleArea();
- var rotated = that._options.rotated;
- var minVisible = rotated ? visibleArea.minX : visibleArea.minY;
- var maxVisible = rotated ? visibleArea.maxX : visibleArea.maxY;
- var min = _max(minVisible, minValue);
- var max = _min(maxVisible, maxValue);
- var center = min + (max - min) / 2;
- if (rotated) {
- y = that.x;
- x = center
- } else {
- x = that.x;
- y = center
- }
- return {
- x: x,
- y: y
- }
- }
- },
- hasValue: function() {
- return null !== this.highValue && null !== this.lowValue
- },
- hasCoords: function() {
- return null !== this.x && null !== this.lowY && null !== this.highY
- },
- _translate: function() {
- var that = this;
- var rotated = that._options.rotated;
- var valTranslator = that._getValTranslator();
- var x = that._getArgTranslator().translate(that.argument);
- that.vx = that.vy = that.x = null === x ? x : x + (that.xCorrection || 0);
- that.openY = null !== that.openValue ? valTranslator.translate(that.openValue) : null;
- that.highY = valTranslator.translate(that.highValue);
- that.lowY = valTranslator.translate(that.lowValue);
- that.closeY = null !== that.closeValue ? valTranslator.translate(that.closeValue) : null;
- var centerValue = _min(that.lowY, that.highY) + _abs(that.lowY - that.highY) / 2;
- that._calculateVisibility(!rotated ? that.x : centerValue, !rotated ? centerValue : that.x)
- },
- getCrosshairData: function(x, y) {
- var that = this;
- var rotated = that._options.rotated;
- var origY = rotated ? x : y;
- var yValue;
- var argument = that.argument;
- var coords;
- var coord = "low";
- if (_abs(that.lowY - origY) < _abs(that.closeY - origY)) {
- yValue = that.lowY
- } else {
- yValue = that.closeY;
- coord = "close"
- }
- if (_abs(yValue - origY) >= _abs(that.openY - origY)) {
- yValue = that.openY;
- coord = "open"
- }
- if (_abs(yValue - origY) >= _abs(that.highY - origY)) {
- yValue = that.highY;
- coord = "high"
- }
- if (rotated) {
- coords = {
- y: that.vy,
- x: yValue,
- xValue: that[coord + "Value"],
- yValue: argument
- }
- } else {
- coords = {
- x: that.vx,
- y: yValue,
- xValue: argument,
- yValue: that[coord + "Value"]
- }
- }
- coords.axis = that.series.axis;
- return coords
- },
- _updateData: function(data) {
- var that = this;
- var label = that._label;
- var reductionColor = this._options.reduction.color;
- that.value = that.initialValue = data.reductionValue;
- that.originalValue = data.value;
- that.lowValue = that.originalLowValue = data.lowValue;
- that.highValue = that.originalHighValue = data.highValue;
- that.openValue = that.originalOpenValue = data.openValue;
- that.closeValue = that.originalCloseValue = data.closeValue;
- that._isPositive = data.openValue < data.closeValue;
- that._isReduction = data.isReduction;
- if (that._isReduction) {
- label.setColor(reductionColor)
- }
- },
- _updateMarker: function(animationEnabled, style, group) {
- var that = this;
- var graphic = that.graphic;
- graphic.attr({
- points: that._getPoints()
- }).smartAttr(style).sharp();
- group && graphic.append(that._getMarkerGroup(group))
- },
- _getLabelFormatObject: function() {
- var that = this;
- return {
- openValue: that.openValue,
- highValue: that.highValue,
- lowValue: that.lowValue,
- closeValue: that.closeValue,
- reductionValue: that.initialValue,
- argument: that.initialArgument,
- value: that.initialValue,
- seriesName: that.series.name,
- originalOpenValue: that.originalOpenValue,
- originalCloseValue: that.originalCloseValue,
- originalLowValue: that.originalLowValue,
- originalHighValue: that.originalHighValue,
- originalArgument: that.originalArgument,
- point: that
- }
- },
- _getFormatObject: function(tooltip) {
- var that = this;
- var highValue = tooltip.formatValue(that.highValue);
- var openValue = tooltip.formatValue(that.openValue);
- var closeValue = tooltip.formatValue(that.closeValue);
- var lowValue = tooltip.formatValue(that.lowValue);
- var symbolMethods = symbolPoint;
- var formatObject = symbolMethods._getFormatObject.call(that, tooltip);
- return _extend({}, formatObject, {
- valueText: "h: " + highValue + ("" !== openValue ? " o: " + openValue : "") + ("" !== closeValue ? " c: " + closeValue : "") + " l: " + lowValue,
- highValueText: highValue,
- openValueText: openValue,
- closeValueText: closeValue,
- lowValueText: lowValue
- })
- },
- getMaxValue: function() {
- return this.highValue
- },
- getMinValue: function() {
- return this.lowValue
- }
- })
- },
- /*!********************************************************************!*\
- !*** ./artifacts/transpiled/viz/components/chart_theme_manager.js ***!
- \********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var BaseThemeManager = __webpack_require__( /*! ../core/base_theme_manager */ 241).BaseThemeManager;
- var _isString = typeUtils.isString;
- var _isDefined = typeUtils.isDefined;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var ThemeManager = BaseThemeManager.inherit(function() {
- var ctor = function(params) {
- var that = this;
- that.callBase.apply(that, arguments);
- var options = params.options || {};
- that._userOptions = options;
- that._mergeAxisTitleOptions = [];
- that._multiPieColors = {};
- that._callback = noop
- };
- var dispose = function() {
- var that = this;
- that.palette && that.palette.dispose();
- that.palette = that._userOptions = that._mergedSettings = that._multiPieColors = null;
- return that.callBase.apply(that, arguments)
- };
- var resetPalette = function() {
- this.palette.reset();
- this._multiPieColors = {}
- };
- var processTitleOptions = function(options) {
- return _isString(options) ? {
- text: options
- } : options
- };
- var processAxisOptions = function(axisOptions) {
- if (!axisOptions) {
- return {}
- }
- axisOptions = extend(true, {}, axisOptions);
- axisOptions.title = processTitleOptions(axisOptions.title);
- if ("logarithmic" === axisOptions.type && axisOptions.logarithmBase <= 0 || axisOptions.logarithmBase && !typeUtils.isNumeric(axisOptions.logarithmBase)) {
- axisOptions.logarithmBase = void 0;
- axisOptions.logarithmBaseError = true
- }
- if (axisOptions.label) {
- if (axisOptions.label.alignment) {
- axisOptions.label.userAlignment = true
- }
- }
- return axisOptions
- };
- var applyParticularAxisOptions = function(name, userOptions, rotated) {
- var theme = this._theme;
- var position = !(rotated ^ "valueAxis" === name) ? "horizontalAxis" : "verticalAxis";
- var processedUserOptions = processAxisOptions(userOptions, name);
- var commonAxisSettings = processAxisOptions(this._userOptions.commonAxisSettings, name);
- var mergeOptions = extend(true, {}, theme.commonAxisSettings, theme[position], theme[name], commonAxisSettings, processedUserOptions);
- mergeOptions.workWeek = processedUserOptions.workWeek || theme[name].workWeek;
- mergeOptions.forceUserTickInterval |= _isDefined(processedUserOptions.tickInterval) && !_isDefined(processedUserOptions.axisDivisionFactor);
- return mergeOptions
- };
- var mergeOptions = function(name, userOptions) {
- userOptions = userOptions || this._userOptions[name];
- var theme = this._theme[name];
- var result = this._mergedSettings[name];
- if (result) {
- return result
- }
- if (typeUtils.isPlainObject(theme) && typeUtils.isPlainObject(userOptions)) {
- result = extend(true, {}, theme, userOptions)
- } else {
- result = _isDefined(userOptions) ? userOptions : theme
- }
- this._mergedSettings[name] = result;
- return result
- };
- var applyParticularTheme = {
- base: mergeOptions,
- argumentAxis: applyParticularAxisOptions,
- valueAxisRangeSelector: function() {
- return mergeOptions.call(this, "valueAxis")
- },
- valueAxis: applyParticularAxisOptions,
- series: function(name, userOptions, seriesCount) {
- var that = this;
- var theme = that._theme;
- var userCommonSettings = that._userOptions.commonSeriesSettings || {};
- var themeCommonSettings = theme.commonSeriesSettings;
- var widgetType = that._themeSection.split(".").slice(-1)[0];
- var type = _normalizeEnum(userOptions.type || userCommonSettings.type || themeCommonSettings.type || "pie" === widgetType && theme.type);
- var palette = that.palette;
- var isBar = ~type.indexOf("bar");
- var isLine = ~type.indexOf("line");
- var isArea = ~type.indexOf("area");
- var isBubble = "bubble" === type;
- var mainSeriesColor;
- var resolveLabelsOverlapping = that.getOptions("resolveLabelsOverlapping");
- var containerBackgroundColor = that.getOptions("containerBackgroundColor");
- var seriesTemplate = applyParticularTheme.seriesTemplate.call(this);
- if (isBar || isBubble) {
- userOptions = extend(true, {}, userCommonSettings, userCommonSettings[type], userOptions);
- var seriesVisibility = userOptions.visible;
- userCommonSettings = {
- type: {}
- };
- extend(true, userOptions, userOptions.point);
- userOptions.visible = seriesVisibility
- }
- var settings = extend(true, {
- aggregation: {}
- }, themeCommonSettings, themeCommonSettings[type], userCommonSettings, userCommonSettings[type], userOptions);
- settings.aggregation.enabled = "chart" === widgetType && normalizeAggregationEnabled(settings.aggregation, that.getOptions("useAggregation"));
- settings.type = type;
- settings.widgetType = widgetType;
- settings.containerBackgroundColor = containerBackgroundColor;
- if ("pie" !== widgetType) {
- mainSeriesColor = settings.color || palette.getNextColor(seriesCount)
- } else {
- mainSeriesColor = function(argument, index, count) {
- var cat = "".concat(argument, "-").concat(index);
- if (!that._multiPieColors[cat]) {
- that._multiPieColors[cat] = palette.getNextColor(count)
- }
- return that._multiPieColors[cat]
- }
- }
- settings.mainSeriesColor = mainSeriesColor;
- settings.resolveLabelsOverlapping = resolveLabelsOverlapping;
- if (settings.label && (isLine || isArea && "rangearea" !== type || "scatter" === type)) {
- settings.label.position = "outside"
- }
- if (seriesTemplate) {
- settings.nameField = seriesTemplate.nameField
- }
- return settings
- },
- animation: function(name) {
- var userOptions = this._userOptions[name];
- userOptions = typeUtils.isPlainObject(userOptions) ? userOptions : _isDefined(userOptions) ? {
- enabled: !!userOptions
- } : {};
- return mergeOptions.call(this, name, userOptions)
- },
- seriesTemplate: function() {
- var value = mergeOptions.call(this, "seriesTemplate");
- if (value) {
- value.nameField = value.nameField || "series"
- }
- return value
- },
- zoomAndPan: function() {
- function parseOption(option) {
- option = _normalizeEnum(option);
- var pan = "pan" === option || "both" === option;
- var zoom = "zoom" === option || "both" === option;
- return {
- pan: pan,
- zoom: zoom,
- none: !pan && !zoom
- }
- }
- var userOptions = this._userOptions.zoomAndPan;
- if (!_isDefined(userOptions)) {
- var zoomingMode = _normalizeEnum(this.getOptions("zoomingMode"));
- var scrollingMode = _normalizeEnum(this.getOptions("scrollingMode"));
- var allowZoom = ["all", "mouse", "touch"].indexOf(zoomingMode) !== -1;
- var allowScroll = ["all", "mouse", "touch"].indexOf(scrollingMode) !== -1;
- userOptions = {
- argumentAxis: allowZoom && allowScroll ? "both" : allowZoom ? "zoom" : allowScroll ? "pan" : "none",
- allowMouseWheel: "all" === zoomingMode || "mouse" === zoomingMode,
- allowTouchGestures: "all" === zoomingMode || "touch" === zoomingMode || "all" === scrollingMode || "touch" === scrollingMode
- }
- }
- var options = mergeOptions.call(this, "zoomAndPan", userOptions);
- return {
- valueAxis: parseOption(options.valueAxis),
- argumentAxis: parseOption(options.argumentAxis),
- dragToZoom: !!options.dragToZoom,
- dragBoxStyle: {
- "class": "dxc-shutter",
- fill: options.dragBoxStyle.color,
- opacity: options.dragBoxStyle.opacity
- },
- panKey: options.panKey,
- allowMouseWheel: !!options.allowMouseWheel,
- allowTouchGestures: !!options.allowTouchGestures
- }
- }
- };
- var normalizeAggregationEnabled = function(aggregation, useAggregation) {
- return !!(!_isDefined(aggregation.enabled) ? useAggregation : aggregation.enabled)
- };
- return {
- _themeSection: "chart",
- ctor: ctor,
- dispose: dispose,
- resetPalette: resetPalette,
- getOptions: function(name) {
- return (applyParticularTheme[name] || applyParticularTheme.base).apply(this, arguments)
- },
- refresh: function() {
- this._mergedSettings = {};
- return this.callBase.apply(this, arguments)
- },
- _initializeTheme: function() {
- var that = this;
- that.callBase.apply(that, arguments);
- that.updatePalette()
- },
- resetOptions: function(name) {
- this._mergedSettings[name] = null
- },
- update: function(options) {
- this._userOptions = options
- },
- updatePalette: function() {
- var that = this;
- that.palette = that.createPalette(that.getOptions("palette"), {
- useHighlight: true,
- extensionMode: that.getOptions("paletteExtensionMode")
- })
- }
- }
- }());
- exports.ThemeManager = ThemeManager
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/layout_manager.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var layoutElementModule = __webpack_require__( /*! ../core/layout_element */ 242);
- var _isNumber = __webpack_require__( /*! ../../core/utils/type */ 1).isNumeric;
- var _min = Math.min;
- var _max = Math.max;
- var _floor = Math.floor;
- var _sqrt = Math.sqrt;
- var consts = __webpack_require__( /*! ../components/consts */ 117);
- var RADIAL_LABEL_INDENT = consts.radialLabelIndent;
- function getNearestCoord(firstCoord, secondCoord, pointCenterCoord) {
- var nearestCoord;
- if (pointCenterCoord < firstCoord) {
- nearestCoord = firstCoord
- } else {
- if (secondCoord < pointCenterCoord) {
- nearestCoord = secondCoord
- } else {
- nearestCoord = pointCenterCoord
- }
- }
- return nearestCoord
- }
- function getLabelLayout(point) {
- if (point._label.isVisible() && "inside" !== point._label.getLayoutOptions().position) {
- return point._label.getBoundingRect()
- }
- }
- function getPieRadius(series, paneCenterX, paneCenterY, accessibleRadius, minR) {
- series.some(function(singleSeries) {
- return singleSeries.getVisiblePoints().reduce(function(radiusIsFound, point) {
- var labelBBox = getLabelLayout(point);
- if (labelBBox) {
- var xCoords = getNearestCoord(labelBBox.x, labelBBox.x + labelBBox.width, paneCenterX);
- var yCoords = getNearestCoord(labelBBox.y, labelBBox.y + labelBBox.height, paneCenterY);
- accessibleRadius = _min(_max(getLengthFromCenter(xCoords, yCoords, paneCenterX, paneCenterY) - RADIAL_LABEL_INDENT, minR), accessibleRadius);
- radiusIsFound = true
- }
- return radiusIsFound
- }, false)
- });
- return accessibleRadius
- }
- function getSizeLabels(series) {
- return series.reduce(function(res, singleSeries) {
- var maxWidth = singleSeries.getVisiblePoints().reduce(function(width, point) {
- var labelBBox = getLabelLayout(point);
- if (labelBBox && labelBBox.width > width) {
- width = labelBBox.width
- }
- return width
- }, 0);
- var rWidth = maxWidth;
- if (maxWidth) {
- res.outerLabelsCount++;
- if (res.outerLabelsCount > 1) {
- maxWidth += consts.pieLabelSpacing
- }
- rWidth += consts.pieLabelSpacing
- }
- res.sizes.push(maxWidth);
- res.rSizes.push(rWidth);
- res.common += maxWidth;
- return res
- }, {
- sizes: [],
- rSizes: [],
- common: 0,
- outerLabelsCount: 0
- })
- }
- function correctLabelRadius(labelSizes, radius, series, canvas, averageWidthLabels, centerX) {
- var curRadius;
- var i;
- var runningWidth = 0;
- var sizes = labelSizes.sizes;
- var rSizes = labelSizes.rSizes;
- for (i = 0; i < series.length; i++) {
- if (0 === sizes[i]) {
- curRadius && (curRadius += rSizes[i - 1]);
- continue
- }
- curRadius = _floor(curRadius ? curRadius + rSizes[i - 1] : radius);
- series[i].correctLabelRadius(curRadius);
- runningWidth += averageWidthLabels || sizes[i];
- rSizes[i] = averageWidthLabels || rSizes[i];
- series[i].setVisibleArea({
- left: _floor(centerX - radius - runningWidth),
- right: _floor(canvas.width - (centerX + radius + runningWidth)),
- top: canvas.top,
- bottom: canvas.bottom,
- width: canvas.width,
- height: canvas.height
- })
- }
- }
- function getLengthFromCenter(x, y, paneCenterX, paneCenterY) {
- return _sqrt((x - paneCenterX) * (x - paneCenterX) + (y - paneCenterY) * (y - paneCenterY))
- }
- function getInnerRadius(series) {
- var innerRadius;
- if ("pie" === series.type) {
- innerRadius = 0
- } else {
- innerRadius = _isNumber(series.innerRadius) ? Number(series.innerRadius) : .5;
- innerRadius = innerRadius < .2 ? .2 : innerRadius;
- innerRadius = innerRadius > .8 ? .8 : innerRadius
- }
- return innerRadius
- }
- var inverseAlign = {
- left: "right",
- right: "left",
- top: "bottom",
- bottom: "top",
- center: "center"
- };
- function downSize(canvas, layoutOptions) {
- canvas[layoutOptions.cutLayoutSide] += "horizontal" === layoutOptions.cutSide ? layoutOptions.width : layoutOptions.height
- }
- function getOffset(layoutOptions, offsets) {
- var side = layoutOptions.cutLayoutSide;
- var offset = {
- horizontal: 0,
- vertical: 0
- };
- switch (side) {
- case "top":
- case "left":
- offset[layoutOptions.cutSide] = -offsets[side];
- break;
- case "bottom":
- case "right":
- offset[layoutOptions.cutSide] = offsets[side]
- }
- return offset
- }
- function LayoutManager() {}
- function toLayoutElementCoords(canvas) {
- return new layoutElementModule.WrapperLayoutElement(null, {
- x: canvas.left,
- y: canvas.top,
- width: canvas.width - canvas.left - canvas.right,
- height: canvas.height - canvas.top - canvas.bottom
- })
- }
- function getAverageLabelWidth(centerX, radius, canvas, sizeLabels) {
- return (centerX - radius - RADIAL_LABEL_INDENT - canvas.left) / sizeLabels.outerLabelsCount
- }
- function getFullRadiusWithLabels(centerX, canvas, sizeLabels) {
- return centerX - canvas.left - (sizeLabels.outerLabelsCount > 0 ? sizeLabels.common + RADIAL_LABEL_INDENT : 0)
- }
- function correctAvailableRadius(availableRadius, canvas, series, minR, paneCenterX, paneCenterY) {
- var sizeLabels = getSizeLabels(series);
- var averageWidthLabels;
- var fullRadiusWithLabels = getFullRadiusWithLabels(paneCenterX, canvas, sizeLabels);
- if (fullRadiusWithLabels < minR) {
- availableRadius = minR;
- averageWidthLabels = getAverageLabelWidth(paneCenterX, availableRadius, canvas, sizeLabels)
- } else {
- availableRadius = _min(getPieRadius(series, paneCenterX, paneCenterY, availableRadius, minR), fullRadiusWithLabels)
- }
- correctLabelRadius(sizeLabels, availableRadius + RADIAL_LABEL_INDENT, series, canvas, averageWidthLabels, paneCenterX);
- return availableRadius
- }
- LayoutManager.prototype = {
- constructor: LayoutManager,
- setOptions: function(options) {
- this._options = options
- },
- applyPieChartSeriesLayout: function(canvas, series, hideLayoutLabels) {
- var paneSpaceHeight = canvas.height - canvas.top - canvas.bottom;
- var paneSpaceWidth = canvas.width - canvas.left - canvas.right;
- var paneCenterX = paneSpaceWidth / 2 + canvas.left;
- var paneCenterY = paneSpaceHeight / 2 + canvas.top;
- var piePercentage = this._options.piePercentage;
- var availableRadius;
- var minR;
- if (_isNumber(piePercentage)) {
- availableRadius = minR = piePercentage * _min(canvas.height, canvas.width) / 2
- } else {
- availableRadius = _min(paneSpaceWidth, paneSpaceHeight) / 2;
- minR = this._options.minPiePercentage * availableRadius
- }
- if (!hideLayoutLabels) {
- availableRadius = correctAvailableRadius(availableRadius, canvas, series, minR, paneCenterX, paneCenterY)
- }
- return {
- centerX: _floor(paneCenterX),
- centerY: _floor(paneCenterY),
- radiusInner: _floor(availableRadius * getInnerRadius(series[0])),
- radiusOuter: _floor(availableRadius)
- }
- },
- applyEqualPieChartLayout: function(series, layout) {
- var radius = layout.radius;
- return {
- centerX: _floor(layout.x),
- centerY: _floor(layout.y),
- radiusInner: _floor(radius * getInnerRadius(series[0])),
- radiusOuter: _floor(radius)
- }
- },
- correctPieLabelRadius: function(series, layout, canvas) {
- var sizeLabels = getSizeLabels(series);
- var averageWidthLabels;
- var radius = layout.radiusOuter + RADIAL_LABEL_INDENT;
- var availableLabelWidth = layout.centerX - canvas.left - radius;
- if (sizeLabels.common + RADIAL_LABEL_INDENT > availableLabelWidth) {
- averageWidthLabels = getAverageLabelWidth(layout.centerX, layout.radiusOuter, canvas, sizeLabels)
- }
- correctLabelRadius(sizeLabels, radius, series, canvas, averageWidthLabels, layout.centerX)
- },
- needMoreSpaceForPanesCanvas: function(panes, rotated) {
- var options = this._options;
- var width = options.width;
- var height = options.height;
- var piePercentage = options.piePercentage;
- var percentageIsValid = _isNumber(piePercentage);
- var needHorizontalSpace = 0;
- var needVerticalSpace = 0;
- panes.forEach(function(pane) {
- var paneCanvas = pane.canvas;
- var minSize = percentageIsValid ? _min(paneCanvas.width, paneCanvas.height) * piePercentage : void 0;
- var needPaneHorizontalSpace = (percentageIsValid ? minSize : width) - (paneCanvas.width - paneCanvas.left - paneCanvas.right);
- var needPaneVerticalSpace = (percentageIsValid ? minSize : height) - (paneCanvas.height - paneCanvas.top - paneCanvas.bottom);
- if (rotated) {
- needHorizontalSpace += needPaneHorizontalSpace > 0 ? needPaneHorizontalSpace : 0;
- needVerticalSpace = _max(needPaneVerticalSpace > 0 ? needPaneVerticalSpace : 0, needVerticalSpace)
- } else {
- needHorizontalSpace = _max(needPaneHorizontalSpace > 0 ? needPaneHorizontalSpace : 0, needHorizontalSpace);
- needVerticalSpace += needPaneVerticalSpace > 0 ? needPaneVerticalSpace : 0
- }
- });
- return needHorizontalSpace > 0 || needVerticalSpace > 0 ? {
- width: needHorizontalSpace,
- height: needVerticalSpace
- } : false
- },
- layoutElements: function(elements, canvas, funcAxisDrawer, panes, rotated) {
- this._elements = elements;
- this._probeDrawing(canvas);
- this._drawElements(canvas);
- funcAxisDrawer();
- this._processAdaptiveLayout(panes, rotated, canvas, funcAxisDrawer);
- this._positionElements(canvas)
- },
- _processAdaptiveLayout: function(panes, rotated, canvas, funcAxisDrawer) {
- var that = this;
- var size = that.needMoreSpaceForPanesCanvas(panes, rotated);
- var items = this._elements;
- if (!size) {
- return
- }
- function processCanvases(item, layoutOptions, side) {
- if (!item.getLayoutOptions()[side]) {
- canvas[layoutOptions.cutLayoutSide] -= layoutOptions[side];
- size[side] = size[side] - layoutOptions[side]
- }
- }
- items.slice().reverse().forEach(function(item) {
- var layoutOptions = item.getLayoutOptions();
- var needRedraw = false;
- if (!layoutOptions) {
- return
- }
- var sizeObject = extend({}, layoutOptions);
- needRedraw = "vertical" === layoutOptions.cutSide && size.width < 0 || "horizontal" === layoutOptions.cutSide && size.height < 0 || "vertical" === layoutOptions.cutSide && size.height > 0 || "horizontal" === layoutOptions.cutSide && size.width > 0;
- var cutSide = "horizontal" === layoutOptions.cutSide ? "width" : "height";
- if (needRedraw) {
- var width = sizeObject.width - size.width;
- var height = sizeObject.height - size.height;
- if ("height" === cutSide && size.width < 0) {
- width = canvas.width - canvas.left - canvas.right
- }
- if ("width" === cutSide && size.height < 0) {
- height = canvas.height - canvas.top - canvas.bottom
- }
- item.draw(width, height)
- }
- processCanvases(item, layoutOptions, cutSide)
- });
- funcAxisDrawer(size)
- },
- _probeDrawing: function(canvas) {
- var that = this;
- this._elements.forEach(function(item) {
- var layoutOptions = item.getLayoutOptions();
- if (!layoutOptions) {
- return
- }
- var sizeObject = {
- width: canvas.width - canvas.left - canvas.right,
- height: canvas.height - canvas.top - canvas.bottom
- };
- if ("vertical" === layoutOptions.cutSide) {
- sizeObject.height -= that._options.height
- } else {
- sizeObject.width -= that._options.width
- }
- item.probeDraw(sizeObject.width, sizeObject.height);
- downSize(canvas, item.getLayoutOptions())
- })
- },
- _drawElements: function(canvas) {
- this._elements.slice().reverse().forEach(function(item) {
- var layoutOptions = item.getLayoutOptions();
- if (!layoutOptions) {
- return
- }
- var sizeObject = {
- width: canvas.width - canvas.left - canvas.right,
- height: canvas.height - canvas.top - canvas.bottom
- };
- var cutSide = layoutOptions.cutSide;
- var length = "horizontal" === cutSide ? "width" : "height";
- sizeObject[length] = layoutOptions[length];
- item.draw(sizeObject.width, sizeObject.height)
- })
- },
- _positionElements: function(canvas) {
- var offsets = {
- left: 0,
- right: 0,
- top: 0,
- bottom: 0
- };
- this._elements.slice().reverse().forEach(function(item) {
- var layoutOptions = item.getLayoutOptions();
- if (!layoutOptions) {
- return
- }
- var position = layoutOptions.position;
- var cutSide = layoutOptions.cutSide;
- var my = {
- horizontal: position.horizontal,
- vertical: position.vertical
- };
- my[cutSide] = inverseAlign[my[cutSide]];
- item.position({
- of: toLayoutElementCoords(canvas),
- my: my,
- at: position,
- offset: getOffset(layoutOptions, offsets)
- });
- offsets[layoutOptions.cutLayoutSide] += layoutOptions["horizontal" === layoutOptions.cutSide ? "width" : "height"]
- })
- }
- };
- exports.LayoutManager = LayoutManager
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/viz/core/plaque.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.Plaque = void 0;
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function")
- }
- }
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) {
- descriptor.writable = true
- }
- Object.defineProperty(target, descriptor.key, descriptor)
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) {
- _defineProperties(Constructor.prototype, protoProps)
- }
- if (staticProps) {
- _defineProperties(Constructor, staticProps)
- }
- Object.defineProperty(Constructor, "prototype", {
- writable: false
- });
- return Constructor
- }
- var math = Math;
- var round = math.round;
- var max = math.max;
- var min = math.min;
- var sin = math.sin;
- var cos = math.cos;
- var asin = math.asin;
- var PI = math.PI;
- var buildPath = function() {
- for (var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++) {
- points[_key] = arguments[_key]
- }
- return points.join("")
- };
- function getArc(cornerRadius, xDirection, yDirection) {
- return "a ".concat(cornerRadius, " ").concat(cornerRadius, " 0 0 1 ").concat(xDirection * cornerRadius, " ").concat(yDirection * cornerRadius)
- }
- function getAbsoluteArc(cornerRadius, x, y) {
- return "A ".concat(cornerRadius, " ").concat(cornerRadius, " 0 0 1 ").concat(x, " ").concat(y)
- }
- function rotateX(x, y, angle, x0, y0) {
- return (x - x0) * round(cos(angle)) + (y - y0) * round(sin(angle)) + x0
- }
- function rotateY(x, y, angle, x0, y0) {
- return -(x - x0) * round(sin(angle)) + (y - y0) * round(cos(angle)) + y0
- }
- function rotateSize(options, angle) {
- if (angle % 90 === 0 && angle % 180 !== 0) {
- return {
- width: options.height,
- height: options.width
- }
- }
- return options
- }
- function getCloudAngle(_ref, x, y, anchorX, anchorY) {
- var width = _ref.width,
- height = _ref.height;
- var halfWidth = width / 2;
- var halfHeight = height / 2;
- var xr = Math.ceil(x + halfWidth);
- var xl = Math.floor(x - halfWidth);
- var yt = Math.floor(y - halfHeight);
- var yb = Math.ceil(y + halfHeight);
- if (anchorX < xl && anchorY < yt || anchorX >= xl && anchorX <= xr && anchorY < yt) {
- return 270
- }
- if (anchorX > xr && anchorY > yb || anchorX >= xl && anchorX <= xr && anchorY > yb) {
- return 90
- } else {
- if (anchorX < xl && anchorY > yb || anchorX < xl && anchorY >= yt && anchorY <= yb) {
- return 180
- }
- }
- return 0
- }
- function getCloudPoints(_ref2, x, y, anchorX, anchorY, _ref3, bounded) {
- var width = _ref2.width,
- height = _ref2.height;
- var arrowWidth = _ref3.arrowWidth,
- _ref3$cornerRadius = _ref3.cornerRadius,
- cornerRadius = void 0 === _ref3$cornerRadius ? 0 : _ref3$cornerRadius;
- var halfArrowWidth = arrowWidth / 2;
- var halfWidth = width / 2;
- var halfHeight = height / 2;
- var xr = Math.ceil(x + halfWidth);
- var xl = Math.floor(x - halfWidth);
- var yt = Math.floor(y - halfHeight);
- var yb = Math.ceil(y + halfHeight);
- var leftTopCorner = [xl, yt];
- var rightTopCorner = [xr, yt];
- var rightBottomCorner = [xr, yb];
- var leftBottomCorner = [xl, yb];
- var arrowX = anchorX <= xl ? xl : xr <= anchorX ? xr : anchorX;
- var arrowY = anchorY <= yt ? yt : yb <= anchorY ? yb : anchorY;
- var arrowBaseBottom = min(arrowY + halfArrowWidth, yb);
- var arrowBaseTop = max(arrowY - halfArrowWidth, yt);
- var arrowBaseLeft = max(arrowX - halfArrowWidth, xl);
- cornerRadius = Math.min(width / 2, height / 2, cornerRadius);
- var points;
- leftTopCorner[1] += cornerRadius;
- rightTopCorner[0] -= cornerRadius;
- rightBottomCorner[1] -= cornerRadius;
- leftBottomCorner[0] += cornerRadius;
- if (!bounded || xl <= anchorX && anchorX <= xr && yt <= anchorY && anchorY <= yb) {
- points = buildPath(leftTopCorner, getArc(cornerRadius, 1, -1), "L", rightTopCorner, getArc(cornerRadius, 1, 1), "L", rightBottomCorner, getArc(cornerRadius, -1, 1), "L", leftBottomCorner, getArc(cornerRadius, -1, -1))
- } else {
- if (anchorX > xr && anchorY < yt) {
- var arrowAngle = arrowWidth / cornerRadius || 0;
- var angle = PI / 4 + arrowAngle / 2;
- var endAngle = PI / 4 - arrowAngle / 2;
- var arrowEndPointX = rightTopCorner[0] + cos(endAngle) * cornerRadius;
- var arrowEndPointY = rightTopCorner[1] + (1 - sin(endAngle)) * cornerRadius;
- var arrowArc = buildPath("L", rightTopCorner, getArc(cornerRadius, cos(angle), 1 - sin(angle)), "L", [anchorX, anchorY, arrowEndPointX, arrowEndPointY], getAbsoluteArc(cornerRadius, rightTopCorner[0] + cornerRadius, rightTopCorner[1] + cornerRadius));
- if (Math.abs(angle) > PI / 2) {
- arrowArc = buildPath("L", [arrowBaseLeft, yt, anchorX, anchorY, xr, arrowBaseBottom])
- }
- points = buildPath(leftTopCorner, getArc(cornerRadius, 1, -1), arrowArc, "L", rightBottomCorner, getArc(cornerRadius, -1, 1), "L", leftBottomCorner, getArc(cornerRadius, -1, -1))
- } else {
- if (anchorX > xr && anchorY >= yt && anchorY <= yb) {
- var _arrowArc;
- if (arrowBaseTop >= rightTopCorner[1] + cornerRadius && arrowBaseBottom <= rightBottomCorner[1]) {
- _arrowArc = buildPath(getArc(cornerRadius, 1, 1), "L", [xr, arrowBaseTop, anchorX, anchorY, xr, arrowBaseBottom], "L", rightBottomCorner, getArc(cornerRadius, -1, 1))
- } else {
- if (arrowBaseTop < rightTopCorner[1] + cornerRadius && arrowBaseBottom >= rightTopCorner[1] + cornerRadius && arrowBaseBottom <= rightBottomCorner[1]) {
- var arrowWidthRest = rightTopCorner[1] + cornerRadius - arrowBaseTop;
- var _angle = arrowWidthRest / cornerRadius;
- var arrowBaseTopX = rightTopCorner[0] + cos(_angle) * cornerRadius;
- var arrowBaseTopY = rightTopCorner[1] + (1 - sin(_angle)) * cornerRadius;
- _arrowArc = buildPath(getArc(cornerRadius, cos(_angle), 1 - sin(_angle)), "L", [arrowBaseTopX, arrowBaseTopY, anchorX, anchorY, xr, arrowBaseBottom], "L", rightBottomCorner, getArc(cornerRadius, -1, 1))
- } else {
- if (arrowBaseTop < rightTopCorner[1] + cornerRadius && arrowBaseBottom < rightTopCorner[1] + cornerRadius) {
- var _arrowWidthRest = rightTopCorner[1] + cornerRadius - arrowBaseTop;
- var _arrowAngle = _arrowWidthRest / cornerRadius;
- var _angle2 = _arrowAngle;
- var _arrowBaseTopX = rightTopCorner[0] + cos(_angle2) * cornerRadius;
- var _arrowBaseTopY = rightTopCorner[1] + (1 - sin(_angle2)) * cornerRadius;
- var bottomAngle = Math.sin((rightTopCorner[1] + cornerRadius - arrowBaseBottom) / cornerRadius);
- var arrowBaseBottomX = rightTopCorner[0] + cornerRadius * cos(bottomAngle);
- var arrowBaseBottomY = rightTopCorner[1] + cornerRadius * (1 - sin(bottomAngle));
- _arrowArc = buildPath(getArc(cornerRadius, cos(_angle2), 1 - sin(_angle2)), "L", [_arrowBaseTopX, _arrowBaseTopY, anchorX, anchorY, arrowBaseBottomX, arrowBaseBottomY], getAbsoluteArc(cornerRadius, rightTopCorner[0] + cornerRadius, rightTopCorner[1] + cornerRadius), "L", rightBottomCorner, getArc(cornerRadius, -1, 1))
- } else {
- if (arrowBaseTop <= rightTopCorner[1] + cornerRadius && arrowBaseBottom >= rightBottomCorner[1]) {
- var topAngle = asin((rightTopCorner[1] + cornerRadius - arrowBaseTop) / cornerRadius);
- var _arrowBaseTopX2 = rightTopCorner[0] + cornerRadius * cos(topAngle);
- var _arrowBaseTopY2 = rightTopCorner[1] + cornerRadius * (1 - sin(topAngle));
- var _bottomAngle = asin((arrowBaseBottom - rightBottomCorner[1]) / cornerRadius);
- var _arrowBaseBottomX = rightBottomCorner[0] + cornerRadius * (cos(_bottomAngle) - 1);
- var _arrowBaseBottomY = rightBottomCorner[1] + cornerRadius * sin(_bottomAngle);
- _arrowArc = buildPath(getArc(cornerRadius, cos(topAngle), 1 - sin(topAngle)), "L", [_arrowBaseTopX2, _arrowBaseTopY2, anchorX, anchorY, _arrowBaseBottomX, _arrowBaseBottomY], getAbsoluteArc(cornerRadius, rightBottomCorner[0] - cornerRadius, rightBottomCorner[1] + cornerRadius))
- } else {
- if (arrowBaseTop > rightTopCorner[1] + cornerRadius && arrowBaseTop <= rightBottomCorner[1] && arrowBaseBottom > rightBottomCorner[1]) {
- var _bottomAngle2 = asin((arrowBaseBottom - rightBottomCorner[1]) / cornerRadius);
- var _arrowBaseBottomX2 = rightBottomCorner[0] + cornerRadius * (cos(_bottomAngle2) - 1);
- var _arrowBaseBottomY2 = rightBottomCorner[1] + cornerRadius * sin(_bottomAngle2);
- _arrowArc = buildPath(getArc(cornerRadius, 1, 1), "L", [xr, arrowBaseTop, anchorX, anchorY, _arrowBaseBottomX2, _arrowBaseBottomY2], getAbsoluteArc(cornerRadius, rightBottomCorner[0] - cornerRadius, rightBottomCorner[1] + cornerRadius))
- } else {
- if (arrowBaseTop > rightTopCorner[1] + cornerRadius && arrowBaseBottom > rightBottomCorner[1]) {
- var _bottomAngle3 = asin((arrowBaseBottom - rightBottomCorner[1]) / cornerRadius);
- var _arrowBaseBottomX3 = rightBottomCorner[0] + cornerRadius * (cos(_bottomAngle3) - 1);
- var _arrowBaseBottomY3 = rightBottomCorner[1] + cornerRadius * sin(_bottomAngle3);
- var _topAngle = asin((arrowBaseTop - rightBottomCorner[1]) / cornerRadius);
- var _arrowBaseTopX3 = rightBottomCorner[0] + cornerRadius * (cos(_topAngle) - 1);
- var _arrowBaseTopY3 = rightBottomCorner[1] + cornerRadius * sin(_topAngle);
- _arrowArc = buildPath(getArc(cornerRadius, 1, 1), "L", rightBottomCorner, getArc(cornerRadius, cos(_topAngle) - 1, sin(_topAngle)), "L", [_arrowBaseTopX3, _arrowBaseTopY3, anchorX, anchorY, _arrowBaseBottomX3, _arrowBaseBottomY3], getAbsoluteArc(cornerRadius, rightBottomCorner[0] - cornerRadius, rightBottomCorner[1] + cornerRadius))
- }
- }
- }
- }
- }
- }
- points = buildPath(leftTopCorner, getArc(cornerRadius, 1, -1), "L", rightTopCorner, _arrowArc, "L", leftBottomCorner, getArc(cornerRadius, -1, -1))
- }
- }
- }
- return buildPath("M", points, "Z")
- }
- exports.Plaque = function() {
- function Plaque(options, widget, root, renderContent) {
- var bounded = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : true;
- var measureContent = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : function(_, g) {
- return g.getBBox()
- };
- var moveContentGroup = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : function(_, g, x, y) {
- return g.move(x, y)
- };
- _classCallCheck(this, Plaque);
- this.widget = widget;
- this.options = options;
- this.root = root;
- this.renderContent = renderContent;
- this.bonded = bounded;
- this.measureContent = measureContent;
- this.moveContentGroup = moveContentGroup
- }
- _createClass(Plaque, [{
- key: "draw",
- value: function(_ref4) {
- var anchorX = _ref4.x,
- anchorY = _ref4.y,
- _ref4$canvas = _ref4.canvas,
- canvas = void 0 === _ref4$canvas ? {} : _ref4$canvas,
- offsetX = _ref4.offsetX,
- offsetY = _ref4.offsetY,
- _ref4$offset = _ref4.offset,
- offset = void 0 === _ref4$offset ? 0 : _ref4$offset;
- var options = this.options;
- var x = options.x,
- y = options.y;
- var bounds = {
- xl: canvas.left,
- xr: canvas.width - canvas.right,
- width: canvas.width - canvas.right - canvas.left,
- yt: canvas.top,
- yb: canvas.height - canvas.bottom,
- height: canvas.height - canvas.bottom - canvas.top
- };
- if (!((0, _type.isDefined)(anchorX) && (0, _type.isDefined)(anchorY)) && !((0, _type.isDefined)(x) && (0, _type.isDefined)(y))) {
- return
- }
- if ((0, _type.isDefined)(anchorX) && (anchorX < bounds.xl || bounds.xr < anchorX || anchorY < bounds.yt || bounds.yb < anchorY)) {
- return
- }
- if (!this._root) {
- this._draw()
- }
- var shadowSettings = (0, _extend.extend)({
- x: "-50%",
- y: "-50%",
- width: "200%",
- height: "200%"
- }, options.shadow);
- var contentWidth = options.width > 0 ? options.width : null;
- var contentHeight = options.height > 0 ? options.height : null;
- this.renderContent(this.widget, this._contentGroup, {
- width: contentWidth,
- height: contentHeight
- });
- var bBox = this._contentBBox = this.measureContent(this.widget, this._contentGroup);
- var size = this._size = {
- width: max(contentWidth, bBox.width) + 2 * options.paddingLeftRight,
- height: max(contentHeight, bBox.height) + 2 * options.paddingTopBottom,
- offset: offset
- };
- var xOff = shadowSettings.offsetX;
- var yOff = shadowSettings.offsetY;
- var blur = 2 * shadowSettings.blur + 1;
- var lm = max(blur - xOff, 0);
- var rm = max(blur + xOff, 0);
- var tm = max(blur - yOff, 0);
- var bm = max(blur + yOff, 0);
- this.margins = {
- lm: lm,
- rm: rm,
- tm: tm,
- bm: bm
- };
- if (!(0, _type.isDefined)(x)) {
- if ((0, _type.isDefined)(offsetX)) {
- x = anchorX + offsetX
- } else {
- if (bounds.width < size.width) {
- x = round(bounds.xl + bounds.width / 2)
- } else {
- x = min(max(anchorX, Math.ceil(bounds.xl + size.width / 2 + lm)), Math.floor(bounds.xr - size.width / 2 - rm))
- }
- }
- } else {
- x += offsetX || 0;
- if (!(0, _type.isDefined)(anchorX)) {
- anchorX = x
- }
- }
- if (!(0, _type.isDefined)(y)) {
- if ((0, _type.isDefined)(offsetY)) {
- y = anchorY + offsetY
- } else {
- var y_top = anchorY - options.arrowLength - size.height / 2 - offset;
- var y_bottom = anchorY + options.arrowLength + size.height / 2 + offset;
- if (bounds.height < size.height + options.arrowLength) {
- y = round(bounds.yt + size.height / 2)
- } else {
- if (y_top - size.height / 2 - tm < bounds.yt) {
- if (y_bottom + size.height / 2 + bm < bounds.yb) {
- y = y_bottom;
- anchorY += offset
- } else {
- y = round(bounds.yt + size.height / 2)
- }
- } else {
- y = y_top;
- anchorY -= offset
- }
- }
- }
- } else {
- y += offsetY || 0;
- if (!(0, _type.isDefined)(anchorY)) {
- anchorY = y + size.height / 2
- }
- }
- this.anchorX = anchorX;
- this.anchorY = anchorY;
- this.move(x, y)
- }
- }, {
- key: "_draw",
- value: function() {
- var renderer = this.widget._renderer;
- var options = this.options;
- var cloudSettings = {
- opacity: options.opacity,
- "stroke-width": 0,
- fill: options.color
- };
- var borderOptions = options.border || {};
- if (borderOptions.visible) {
- (0, _extend.extend)(cloudSettings, {
- "stroke-width": borderOptions.width,
- stroke: borderOptions.color,
- "stroke-opacity": borderOptions.opacity,
- dashStyle: borderOptions.dashStyle
- })
- }
- var shadowSettings = (0, _extend.extend)({
- x: "-50%",
- y: "-50%",
- width: "200%",
- height: "200%"
- }, options.shadow);
- var shadow = this._shadow = renderer.shadowFilter().attr(shadowSettings);
- var group = this._root = renderer.g().append(this.root);
- if (options.type) {
- group.attr({
- "class": "dxc-".concat(options.type, "-annotation")
- })
- }
- var cloudGroup = renderer.g().attr({
- filter: shadow.id
- }).append(group);
- this._cloud = renderer.path([], "area").attr(cloudSettings).sharp().append(cloudGroup);
- this._contentGroup = renderer.g().append(group)
- }
- }, {
- key: "getBBox",
- value: function() {
- var size = this._size || {};
- var margins = this.margins || {};
- var rotationAngle = getCloudAngle(size, this.x, this.y, this.anchorX, this.anchorY);
- return {
- x: Math.floor(this.x - size.width / 2 - margins.lm),
- y: Math.floor(this.y - size.height / 2 - margins.tm - (270 === rotationAngle ? this.options.arrowLength : 0)),
- width: size.width + margins.lm + margins.rm,
- height: size.height + margins.tm + margins.bm + (90 === rotationAngle || 270 === rotationAngle ? this.options.arrowLength : 0)
- }
- }
- }, {
- key: "clear",
- value: function() {
- if (this._root) {
- this._root.remove();
- this._shadow.remove();
- this._root = null
- }
- return this
- }
- }, {
- key: "customizeCloud",
- value: function(attr) {
- if (this._cloud) {
- this._cloud.attr(attr)
- }
- }
- }, {
- key: "moveRoot",
- value: function(x, y) {
- if (this._root) {
- this._root.move(x, y)
- }
- }
- }, {
- key: "move",
- value: function(x, y) {
- x = round(x);
- y = round(y);
- this.x = x;
- this.y = y;
- var rotationAngle = getCloudAngle(this._size, x, y, this.anchorX, this.anchorY);
- var radRotationAngle = rotationAngle * PI / 180;
- this._cloud.attr({
- d: getCloudPoints(rotateSize(this._size, rotationAngle), x, y, rotateX(this.anchorX, this.anchorY, radRotationAngle, x, y), rotateY(this.anchorX, this.anchorY, radRotationAngle, x, y), this.options, this.bonded)
- }).rotate(rotationAngle, x, y);
- this.moveContentGroup(this.widget, this._contentGroup, x - this._contentBBox.x - this._contentBBox.width / 2, y - this._contentBBox.y - this._contentBBox.height / 2)
- }
- }, {
- key: "hitTest",
- value: function(x, y) {
- var _ref5 = this._size || {},
- width = _ref5.width,
- height = _ref5.height;
- return Math.abs(x - this.x) <= width / 2 && Math.abs(y - this.y) <= height / 2
- }
- }]);
- return Plaque
- }()
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/advanced_chart.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var iteratorModule = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var rangeModule = __webpack_require__( /*! ../translators/range */ 108);
- var DEFAULT_AXIS_NAME = "defaultAxisName";
- var axisModule = __webpack_require__( /*! ../axes/base_axis */ 204);
- var seriesFamilyModule = __webpack_require__( /*! ../core/series_family */ 409);
- var BaseChart = __webpack_require__( /*! ./base_chart */ 240).BaseChart;
- var crosshairModule = __webpack_require__( /*! ./crosshair */ 410);
- var _isArray = Array.isArray;
- var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var _each = iteratorModule.each;
- var _reverseEach = iteratorModule.reverseEach;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var _extend = extend;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _map = vizUtils.map;
- var mergeMarginOptions = vizUtils.mergeMarginOptions;
- var FONT = "font";
- var COMMON_AXIS_SETTINGS = "commonAxisSettings";
- function prepareAxis(axisOptions) {
- return _isArray(axisOptions) ? 0 === axisOptions.length ? [{}] : axisOptions : [axisOptions]
- }
- function processBubbleMargin(opt, bubbleSize) {
- if (opt.processBubbleSize) {
- opt.size = bubbleSize
- }
- return opt
- }
- function estimateBubbleSize(size, panesCount, maxSize, rotated) {
- var width = rotated ? size.width / panesCount : size.width;
- var height = rotated ? size.height : size.height / panesCount;
- return Math.min(width, height) * maxSize
- }
- var AdvancedChart = BaseChart.inherit({
- _setDeprecatedOptions: function() {
- this.callBase.apply(this, arguments);
- _extend(this._deprecatedOptions, {
- barWidth: {
- since: "18.1",
- message: "Use the 'commonSeriesSettings.barPadding' or 'series.barPadding' option instead"
- },
- equalBarWidth: {
- since: "18.1",
- message: "Use the 'commonSeriesSettings.ignoreEmptyPoints' or 'series.ignoreEmptyPoints' option instead"
- }
- })
- },
- _fontFields: [COMMON_AXIS_SETTINGS + ".label." + FONT, COMMON_AXIS_SETTINGS + ".title." + FONT],
- _dispose: function() {
- var that = this;
- var disposeObjectsInArray = this._disposeObjectsInArray;
- that.callBase();
- that.panes = null;
- if (that._legend) {
- that._legend.dispose();
- that._legend = null
- }
- disposeObjectsInArray.call(that, "panesBackground");
- disposeObjectsInArray.call(that, "seriesFamilies");
- that._disposeAxes()
- },
- _reinitAxes: function() {
- this.panes = this._createPanes();
- this._populateAxes();
- this._axesReinitialized = true
- },
- _getCrosshairMargins: function() {
- var crosshairOptions = this._getCrosshairOptions() || {};
- var crosshairEnabled = crosshairOptions.enabled;
- var margins = crosshairModule.getMargins();
- return {
- x: crosshairEnabled && crosshairOptions.horizontalLine.visible ? margins.x : 0,
- y: crosshairEnabled && crosshairOptions.verticalLine.visible ? margins.y : 0
- }
- },
- _populateAxes: function() {
- var that = this;
- var panes = that.panes;
- var rotated = that._isRotated();
- var argumentAxesOptions = prepareAxis(that.option("argumentAxis") || {})[0];
- var valueAxisOption = that.option("valueAxis");
- var valueAxesOptions = prepareAxis(valueAxisOption || {});
- var argumentAxesPopulatedOptions = [];
- var valueAxesPopulatedOptions = [];
- var axisNames = [];
- var valueAxesCounter = 0;
- var paneWithNonVirtualAxis;
- var crosshairMargins = that._getCrosshairMargins();
- function getNextAxisName() {
- return DEFAULT_AXIS_NAME + valueAxesCounter++
- }
- if (rotated) {
- paneWithNonVirtualAxis = "right" === argumentAxesOptions.position ? panes[panes.length - 1].name : panes[0].name
- } else {
- paneWithNonVirtualAxis = "top" === argumentAxesOptions.position ? panes[0].name : panes[panes.length - 1].name
- }
- argumentAxesPopulatedOptions = _map(panes, function(pane) {
- var virtual = pane.name !== paneWithNonVirtualAxis;
- return that._populateAxesOptions("argumentAxis", argumentAxesOptions, {
- pane: pane.name,
- name: null,
- optionPath: "argumentAxis",
- crosshairMargin: rotated ? crosshairMargins.x : crosshairMargins.y
- }, rotated, virtual)
- });
- _each(valueAxesOptions, function(priority, axisOptions) {
- var axisPanes = [];
- var name = axisOptions.name;
- if (name && inArray(name, axisNames) !== -1) {
- that._incidentOccurred("E2102");
- return
- }
- name && axisNames.push(name);
- if (axisOptions.pane) {
- axisPanes.push(axisOptions.pane)
- }
- if (axisOptions.panes && axisOptions.panes.length) {
- axisPanes = axisPanes.concat(axisOptions.panes.slice(0))
- }
- axisPanes = vizUtils.unique(axisPanes);
- if (!axisPanes.length) {
- axisPanes.push(void 0)
- }
- _each(axisPanes, function(_, pane) {
- var optionPath = _isArray(valueAxisOption) ? "valueAxis[".concat(priority, "]") : "valueAxis";
- valueAxesPopulatedOptions.push(that._populateAxesOptions("valueAxis", axisOptions, {
- name: name || getNextAxisName(),
- pane: pane,
- priority: priority,
- optionPath: optionPath,
- crosshairMargin: rotated ? crosshairMargins.y : crosshairMargins.x
- }, rotated))
- })
- });
- that._redesignAxes(argumentAxesPopulatedOptions, true, paneWithNonVirtualAxis);
- that._redesignAxes(valueAxesPopulatedOptions, false)
- },
- _redesignAxes: function(options, isArgumentAxes, paneWithNonVirtualAxis) {
- var that = this;
- var axesBasis = [];
- var axes = isArgumentAxes ? that._argumentAxes : that._valueAxes;
- _each(options, function(_, opt) {
- var curAxes = axes && axes.filter(function(a) {
- return a.name === opt.name && (!_isDefined(opt.pane) && that.panes.some(function(p) {
- return p.name === a.pane
- }) || a.pane === opt.pane)
- });
- if (curAxes && curAxes.length > 0) {
- _each(curAxes, function(_, axis) {
- axis.updateOptions(opt);
- axis.validate();
- axesBasis.push({
- axis: axis
- })
- })
- } else {
- axesBasis.push({
- options: opt
- })
- }
- });
- if (axes) {
- _reverseEach(axes, function(index, axis) {
- if (!axesBasis.some(function(basis) {
- return basis.axis && basis.axis === axis
- })) {
- that._disposeAxis(index, isArgumentAxes)
- }
- })
- } else {
- if (isArgumentAxes) {
- axes = that._argumentAxes = []
- } else {
- axes = that._valueAxes = []
- }
- }
- _each(axesBasis, function(index, basis) {
- var axis = basis.axis;
- if (basis.axis && isArgumentAxes) {
- basis.axis.isVirtual = basis.axis.pane !== paneWithNonVirtualAxis
- } else {
- if (basis.options) {
- axis = that._createAxis(isArgumentAxes, basis.options, isArgumentAxes ? basis.options.pane !== paneWithNonVirtualAxis : void 0, isArgumentAxes ? index : void 0);
- axes.push(axis)
- }
- }
- axis.applyVisualRangeSetter(that._getVisualRangeSetter())
- })
- },
- _disposeAxis: function(index, isArgumentAxis) {
- var axes = isArgumentAxis ? this._argumentAxes : this._valueAxes;
- var axis = axes[index];
- if (!axis) {
- return
- }
- axis.dispose();
- axes.splice(index, 1)
- },
- _prepareStackPoints: function(singleSeries, stackPoints) {
- var points = singleSeries.getPoints();
- var stackName = singleSeries.getStackName();
- _each(points, function(_, point) {
- var argument = point.argument;
- if (!stackPoints[argument]) {
- stackPoints[argument] = {};
- stackPoints[argument][null] = []
- }
- if (stackName && !_isArray(stackPoints[argument][stackName])) {
- stackPoints[argument][stackName] = [];
- _each(stackPoints[argument][null], function(_, point) {
- if (!point.stackName) {
- stackPoints[argument][stackName].push(point)
- }
- })
- }
- if (stackName) {
- stackPoints[argument][stackName].push(point);
- stackPoints[argument][null].push(point)
- } else {
- _each(stackPoints[argument], function(_, stack) {
- stack.push(point)
- })
- }
- point.stackPoints = stackPoints[argument][stackName];
- point.stackName = stackName
- })
- },
- _resetStackPoints: function(singleSeries) {
- _each(singleSeries.getPoints(), function(_, point) {
- point.stackPoints = null;
- point.stackName = null
- })
- },
- _disposeAxes: function() {
- var that = this;
- var disposeObjectsInArray = that._disposeObjectsInArray;
- disposeObjectsInArray.call(that, "_argumentAxes");
- disposeObjectsInArray.call(that, "_valueAxes")
- },
- _appendAdditionalSeriesGroups: function() {
- this._crosshairCursorGroup.linkAppend();
- this._scrollBar && this._scrollBarGroup.linkAppend()
- },
- _getLegendTargets: function() {
- var _this = this;
- return (this.series || []).map(function(s) {
- var item = _this._getLegendOptions(s);
- item.legendData.series = s;
- if (!s.getOptions().showInLegend) {
- item.legendData.visible = false
- }
- return item
- })
- },
- _legendItemTextField: "name",
- _seriesPopulatedHandlerCore: function() {
- this._processSeriesFamilies();
- this._processValueAxisFormat()
- },
- _renderTrackers: function() {
- var that = this;
- var i;
- for (i = 0; i < that.series.length; ++i) {
- that.series[i].drawTrackers()
- }
- },
- _specialProcessSeries: function() {
- this._processSeriesFamilies()
- },
- _processSeriesFamilies: function() {
- var that = this;
- var types = [];
- var families = [];
- var paneSeries;
- var themeManager = that._themeManager;
- var negativesAsZeroes = themeManager.getOptions("negativesAsZeroes");
- var negativesAsZeros = themeManager.getOptions("negativesAsZeros");
- var familyOptions = {
- equalBarWidth: themeManager.getOptions("equalBarWidth"),
- minBubbleSize: themeManager.getOptions("minBubbleSize"),
- maxBubbleSize: themeManager.getOptions("maxBubbleSize"),
- barWidth: themeManager.getOptions("barWidth"),
- barGroupPadding: themeManager.getOptions("barGroupPadding"),
- barGroupWidth: themeManager.getOptions("barGroupWidth"),
- negativesAsZeroes: _isDefined(negativesAsZeroes) ? negativesAsZeroes : negativesAsZeros
- };
- if (that.seriesFamilies && that.seriesFamilies.length) {
- _each(that.seriesFamilies, function(_, family) {
- family.updateOptions(familyOptions);
- family.adjustSeriesValues()
- });
- return
- }
- _each(that.series, function(_, item) {
- if (inArray(item.type, types) === -1) {
- types.push(item.type)
- }
- });
- _each(that._getLayoutTargets(), function(_, pane) {
- paneSeries = that._getSeriesForPane(pane.name);
- _each(types, function(_, type) {
- var family = new seriesFamilyModule.SeriesFamily({
- type: type,
- pane: pane.name,
- equalBarWidth: familyOptions.equalBarWidth,
- minBubbleSize: familyOptions.minBubbleSize,
- maxBubbleSize: familyOptions.maxBubbleSize,
- barWidth: familyOptions.barWidth,
- barGroupPadding: familyOptions.barGroupPadding,
- barGroupWidth: familyOptions.barGroupWidth,
- negativesAsZeroes: familyOptions.negativesAsZeroes,
- rotated: that._isRotated()
- });
- family.add(paneSeries);
- family.adjustSeriesValues();
- families.push(family)
- })
- });
- that.seriesFamilies = families
- },
- _updateSeriesDimensions: function() {
- var that = this;
- var i;
- var seriesFamilies = that.seriesFamilies || [];
- for (i = 0; i < seriesFamilies.length; i++) {
- var family = seriesFamilies[i];
- family.updateSeriesValues();
- family.adjustSeriesDimensions()
- }
- },
- _getLegendCallBack: function(series) {
- return this._legend && this._legend.getActionCallback(series)
- },
- _appendAxesGroups: function() {
- var that = this;
- that._stripsGroup.linkAppend();
- that._gridGroup.linkAppend();
- that._axesGroup.linkAppend();
- that._constantLinesGroup.linkAppend();
- that._labelAxesGroup.linkAppend();
- that._scaleBreaksGroup.linkAppend()
- },
- _populateMarginOptions: function() {
- var that = this;
- var bubbleSize = estimateBubbleSize(that.getSize(), that.panes.length, that._themeManager.getOptions("maxBubbleSize"), that._isRotated());
- var argumentMarginOptions = {};
- that._valueAxes.forEach(function(valueAxis) {
- var groupSeries = that.series.filter(function(series) {
- return series.getValueAxis() === valueAxis
- });
- var marginOptions = {};
- groupSeries.forEach(function(series) {
- if (series.isVisible()) {
- var seriesMarginOptions = processBubbleMargin(series.getMarginOptions(), bubbleSize);
- marginOptions = mergeMarginOptions(marginOptions, seriesMarginOptions);
- argumentMarginOptions = mergeMarginOptions(argumentMarginOptions, seriesMarginOptions)
- }
- });
- valueAxis.setMarginOptions(marginOptions)
- });
- that._argumentAxes.forEach(function(a) {
- return a.setMarginOptions(argumentMarginOptions)
- })
- },
- _populateBusinessRange: function(updatedAxis, keepRange) {
- var that = this;
- var rotated = that._isRotated();
- var argRange = new rangeModule.Range({
- rotated: !!rotated
- });
- var series = that._getVisibleSeries();
- that._valueAxes.forEach(function(valueAxis) {
- var groupRange = new rangeModule.Range({
- rotated: !!rotated,
- pane: valueAxis.pane,
- axis: valueAxis.name
- });
- var groupSeries = series.filter(function(series) {
- return series.getValueAxis() === valueAxis
- });
- groupSeries.forEach(function(series) {
- var seriesRange = series.getRangeData();
- groupRange.addRange(seriesRange.val);
- argRange.addRange(seriesRange.arg)
- });
- if (!updatedAxis || updatedAxis && groupSeries.length && valueAxis === updatedAxis) {
- valueAxis.setGroupSeries(groupSeries);
- valueAxis.setBusinessRange(groupRange, that._axesReinitialized || keepRange, that._argumentAxes[0]._lastVisualRangeUpdateMode)
- }
- });
- if (!updatedAxis || updatedAxis && series.length) {
- that._argumentAxes.forEach(function(a) {
- return a.setBusinessRange(argRange, that._axesReinitialized, void 0, that._groupsData.categories)
- })
- }
- that._populateMarginOptions()
- },
- getArgumentAxis: function() {
- return (this._argumentAxes || []).filter(function(a) {
- return !a.isVirtual
- })[0]
- },
- getValueAxis: function(name) {
- var _this2 = this;
- return (this._valueAxes || []).filter(_isDefined(name) ? function(a) {
- return a.name === name
- } : function(a) {
- return a.pane === _this2.defaultPane
- })[0]
- },
- _getGroupsData: function() {
- var that = this;
- var groups = [];
- that._valueAxes.forEach(function(axis) {
- groups.push({
- series: that.series.filter(function(series) {
- return series.getValueAxis() === axis
- }),
- valueAxis: axis,
- valueOptions: axis.getOptions()
- })
- });
- return {
- groups: groups,
- argumentAxes: that._argumentAxes,
- argumentOptions: that._argumentAxes[0].getOptions()
- }
- },
- _groupSeries: function() {
- var that = this;
- that._correctValueAxes(false);
- that._groupsData = that._getGroupsData()
- },
- _processValueAxisFormat: function() {
- var axesWithFullStackedFormat = [];
- this.series.forEach(function(series) {
- var axis = series.getValueAxis();
- if (series.isFullStackedSeries()) {
- axis.setPercentLabelFormat();
- axesWithFullStackedFormat.push(axis)
- }
- });
- this._valueAxes.forEach(function(axis) {
- if (axesWithFullStackedFormat.indexOf(axis) === -1) {
- axis.resetAutoLabelFormat()
- }
- })
- },
- _populateAxesOptions: function(typeSelector, userOptions, axisOptions, rotated, virtual) {
- var that = this;
- var preparedUserOptions = that._prepareStripsAndConstantLines(typeSelector, userOptions, rotated);
- var options = _extend(true, {}, preparedUserOptions, axisOptions, that._prepareAxisOptions(typeSelector, preparedUserOptions, rotated));
- if (virtual) {
- options.visible = options.tick.visible = options.minorTick.visible = options.label.visible = false;
- options.title = {}
- }
- return options
- },
- _createAxis: function(isArgumentAxes, options, virtual, index) {
- var that = this;
- var typeSelector = isArgumentAxes ? "argumentAxis" : "valueAxis";
- var renderingSettings = _extend({
- renderer: that._renderer,
- incidentOccurred: that._incidentOccurred,
- eventTrigger: that._eventTrigger,
- axisClass: isArgumentAxes ? "arg" : "val",
- widgetClass: "dxc",
- stripsGroup: that._stripsGroup,
- labelAxesGroup: that._labelAxesGroup,
- constantLinesGroup: that._constantLinesGroup,
- scaleBreaksGroup: that._scaleBreaksGroup,
- axesContainerGroup: that._axesGroup,
- gridGroup: that._gridGroup,
- isArgumentAxis: isArgumentAxes
- }, that._getAxisRenderingOptions(typeSelector));
- var axis = new axisModule.Axis(renderingSettings);
- axis.updateOptions(options);
- axis.isVirtual = virtual;
- return axis
- },
- _getVisualRangeSetter: _noop,
- _getTrackerSettings: function() {
- return _extend(this.callBase(), {
- argumentAxis: this.getArgumentAxis()
- })
- },
- _prepareStripsAndConstantLines: function(typeSelector, userOptions, rotated) {
- userOptions = this._themeManager.getOptions(typeSelector, userOptions, rotated);
- if (userOptions.strips) {
- _each(userOptions.strips, function(i) {
- userOptions.strips[i] = _extend(true, {}, userOptions.stripStyle, userOptions.strips[i])
- })
- }
- if (userOptions.constantLines) {
- _each(userOptions.constantLines, function(i, line) {
- userOptions.constantLines[i] = _extend(true, {}, userOptions.constantLineStyle, line)
- })
- }
- return userOptions
- },
- _legendDataField: "series",
- _adjustSeriesLabels: _noop,
- _correctValueAxes: _noop,
- refresh: function() {
- this._disposeAxes();
- this.callBase()
- },
- _layoutAxes: function(drawAxes) {
- var that = this;
- var cleanPanesCanvases = drawAxes();
- var needSpace = that.checkForMoreSpaceForPanesCanvas();
- if (needSpace) {
- var size = this._layout.backward(this._rect, this._rect, [needSpace.width, needSpace.height]);
- needSpace.width = Math.max(0, size[0]);
- needSpace.height = Math.max(0, size[1]);
- this._canvas = this._createCanvasFromRect(this._rect);
- drawAxes(needSpace, cleanPanesCanvases)
- }
- },
- checkForMoreSpaceForPanesCanvas: function() {
- return this.layoutManager.needMoreSpaceForPanesCanvas(this._getLayoutTargets(), this._isRotated())
- },
- _notify: function() {
- this._axesReinitialized = false
- }
- });
- exports.AdvancedChart = AdvancedChart
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/smart_formatter.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.smartFormatter = smartFormatter;
- exports.formatRange = formatRange;
- var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
- var _format_helper2 = _interopRequireDefault(_format_helper);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
- var _date2 = _interopRequireDefault(_date);
- var _math = __webpack_require__( /*! ../../core/utils/math */ 28);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var _format = _format_helper2.default.format;
- var floor = Math.floor;
- var abs = Math.abs;
- var EXPONENTIAL = "exponential";
- var formats = ["fixedPoint", "thousands", "millions", "billions", "trillions", EXPONENTIAL];
- var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "month", "year"];
- function getDatesDifferences(prevDate, curDate, nextDate, tickFormat) {
- var prevDifferences;
- var nextDifferences;
- var dateUnitInterval;
- var dateUnitsLength = dateUnitIntervals.length;
- var i;
- var j;
- if ("week" === tickFormat) {
- tickFormat = "day"
- } else {
- if ("quarter" === tickFormat) {
- tickFormat = "month"
- } else {
- if ("shorttime" === tickFormat) {
- tickFormat = "hour"
- } else {
- if ("longtime" === tickFormat) {
- tickFormat = "second"
- }
- }
- }
- }
- var tickFormatIndex = dateUnitIntervals.indexOf(tickFormat);
- if (nextDate) {
- nextDifferences = _date2.default.getDatesDifferences(curDate, nextDate);
- prevDifferences = _date2.default.getDatesDifferences(curDate, prevDate);
- if (nextDifferences[tickFormat]) {
- for (i = dateUnitsLength - 1; i >= tickFormatIndex; i--) {
- dateUnitInterval = dateUnitIntervals[i];
- if (i === tickFormatIndex) {
- setDateUnitInterval(nextDifferences, tickFormatIndex + (nextDifferences.millisecond ? 2 : 1))
- } else {
- if (nextDifferences[dateUnitInterval]) {
- resetDateUnitInterval(nextDifferences, i);
- break
- }
- }
- }
- }
- } else {
- prevDifferences = _date2.default.getDatesDifferences(prevDate, curDate);
- for (i = dateUnitsLength - 1; i >= tickFormatIndex; i--) {
- dateUnitInterval = dateUnitIntervals[i];
- if (prevDifferences[dateUnitInterval]) {
- if (i - tickFormatIndex > 1) {
- for (j = tickFormatIndex + 1; j >= 0; j--) {
- resetDateUnitInterval(prevDifferences, j)
- }
- break
- } else {
- if (isDateTimeStart(curDate, dateUnitInterval)) {
- for (j = i - 1; j > 0; j--) {
- resetDateUnitInterval(prevDifferences, j)
- }
- break
- }
- }
- }
- }
- }
- return nextDate ? nextDifferences : prevDifferences
- }
- function isDateTimeStart(date, dateUnitInterval) {
- var unitNumbers = [date.getMilliseconds(), date.getSeconds(), date.getMinutes(), date.getHours(), date.getDate(), date.getMonth()];
- var unitIndex = dateUnitIntervals.indexOf(dateUnitInterval);
- var i;
- for (i = 0; i < unitIndex; i++) {
- if (4 === i && 1 !== unitNumbers[i] || 4 !== i && 0 !== unitNumbers[i]) {
- return false
- }
- }
- return true
- }
- function resetDateUnitInterval(differences, intervalIndex) {
- var dateUnitInterval = dateUnitIntervals[intervalIndex];
- if (differences[dateUnitInterval]) {
- differences[dateUnitInterval] = false;
- differences.count--
- }
- }
- function setDateUnitInterval(differences, intervalIndex) {
- var dateUnitInterval = dateUnitIntervals[intervalIndex];
- if (false === differences[dateUnitInterval]) {
- differences[dateUnitInterval] = true;
- differences.count++
- }
- }
- function getNoZeroIndex(str) {
- return str.length - parseInt(str).toString().length
- }
- function getTransitionTickIndex(ticks, value) {
- var i;
- var curDiff;
- var minDiff;
- var nearestTickIndex = 0;
- minDiff = abs(value - ticks[0]);
- for (i = 1; i < ticks.length; i++) {
- curDiff = abs(value - ticks[i]);
- if (curDiff < minDiff) {
- minDiff = curDiff;
- nearestTickIndex = i
- }
- }
- return nearestTickIndex
- }
- function splitDecimalNumber(value) {
- return value.toString().split(".")
- }
- function createFormat(type) {
- var formatter;
- if ((0, _type.isFunction)(type)) {
- formatter = type;
- type = null
- }
- return {
- type: type,
- formatter: formatter
- }
- }
- function smartFormatter(tick, options) {
- var tickInterval = options.tickInterval;
- var tickIntervalIndex;
- var tickIndex;
- var actualIndex;
- var stringTick = abs(tick).toString();
- var precision = 0;
- var typeFormat;
- var offset = 0;
- var separatedTickInterval;
- var indexOfFormat = 0;
- var indexOfTick = -1;
- var datesDifferences;
- var format = options.labelOptions.format;
- var ticks = options.ticks;
- var log10Tick;
- var prevDateIndex;
- var nextDateIndex;
- var isLogarithmic = "logarithmic" === options.type;
- if (1 === ticks.length && 0 === ticks.indexOf(tick) && !(0, _type.isDefined)(tickInterval)) {
- tickInterval = abs(tick) >= 1 ? 1 : (0, _math.adjust)(1 - abs(tick), tick)
- }
- if (!(0, _type.isDefined)(format) && "discrete" !== options.type && tick && (10 === options.logarithmBase || !isLogarithmic)) {
- if ("datetime" !== options.dataType && (0, _type.isDefined)(tickInterval)) {
- if (ticks.length && ticks.indexOf(tick) === -1) {
- indexOfTick = getTransitionTickIndex(ticks, tick);
- tickInterval = (0, _math.adjust)(abs(tick - ticks[indexOfTick]), tick)
- }
- separatedTickInterval = splitDecimalNumber(tickInterval);
- if (separatedTickInterval < 2) {
- separatedTickInterval = splitDecimalNumber(tick)
- }
- if (isLogarithmic) {
- log10Tick = (0, _utils.getAdjustedLog10)(abs(tick));
- if (log10Tick > 0) {
- typeFormat = formats[floor(log10Tick / 3)] || EXPONENTIAL
- } else {
- if (log10Tick < -4) {
- typeFormat = EXPONENTIAL
- } else {
- precision = void 0
- }
- }
- } else {
- if (separatedTickInterval.length > 1 && !(0, _type.isExponential)(tickInterval)) {
- precision = separatedTickInterval[1].length;
- typeFormat = formats[indexOfFormat]
- } else {
- if ((0, _type.isExponential)(tickInterval) && (stringTick.indexOf(".") !== -1 || (0, _type.isExponential)(tick))) {
- typeFormat = EXPONENTIAL;
- if (!(0, _type.isExponential)(tick)) {
- precision = abs(getNoZeroIndex(stringTick.split(".")[1]) - (0, _math.getExponent)(tickInterval) + 1)
- } else {
- precision = Math.max(abs((0, _math.getExponent)(tick) - (0, _math.getExponent)(tickInterval)), abs((0, _math.getPrecision)(tick) - (0, _math.getPrecision)(tickInterval)))
- }
- } else {
- tickIntervalIndex = floor((0, _utils.getAdjustedLog10)(tickInterval));
- actualIndex = tickIndex = floor((0, _utils.getAdjustedLog10)(abs(tick)));
- if (tickIndex - tickIntervalIndex >= 2) {
- actualIndex = tickIntervalIndex
- }
- indexOfFormat = floor(actualIndex / 3);
- offset = 3 * indexOfFormat;
- if (indexOfFormat < 5) {
- if (tickIntervalIndex - offset === 2 && tickIndex >= 3) {
- indexOfFormat++;
- offset = 3 * indexOfFormat
- }
- typeFormat = formats[indexOfFormat]
- } else {
- typeFormat = formats[formats.length - 1]
- }
- if (offset > 0) {
- separatedTickInterval = splitDecimalNumber(tickInterval / Math.pow(10, offset));
- if (separatedTickInterval[1]) {
- precision = separatedTickInterval[1].length
- }
- }
- }
- }
- }
- if (void 0 !== typeFormat || void 0 !== precision) {
- format = {
- type: typeFormat,
- precision: precision
- }
- }
- } else {
- if ("datetime" === options.dataType) {
- typeFormat = _date2.default.getDateFormatByTickInterval(tickInterval);
- if (options.showTransition && ticks.length) {
- indexOfTick = ticks.map(Number).indexOf(+tick);
- if (1 === ticks.length && 0 === indexOfTick) {
- typeFormat = _format_helper2.default.getDateFormatByTicks(ticks)
- } else {
- if (indexOfTick === -1) {
- prevDateIndex = getTransitionTickIndex(ticks, tick)
- } else {
- prevDateIndex = 0 === indexOfTick ? ticks.length - 1 : indexOfTick - 1;
- nextDateIndex = 0 === indexOfTick ? 1 : -1
- }
- datesDifferences = getDatesDifferences(ticks[prevDateIndex], tick, ticks[nextDateIndex], typeFormat);
- typeFormat = _format_helper2.default.getDateFormatByDifferences(datesDifferences, typeFormat)
- }
- }
- format = createFormat(typeFormat)
- }
- }
- }
- return _format(tick, format)
- }
- function getHighDiffFormat(diff) {
- var stop = false;
- for (var i in diff) {
- if (true === diff[i] || "hour" === i || stop) {
- diff[i] = false;
- stop = true
- } else {
- if (false === diff[i]) {
- diff[i] = true
- }
- }
- }
- return createFormat(_format_helper2.default.getDateFormatByDifferences(diff))
- }
- function getHighAndSelfDiffFormat(diff, interval) {
- var stop = false;
- for (var i in diff) {
- if (stop) {
- diff[i] = false
- } else {
- if (i === interval) {
- stop = true
- } else {
- diff[i] = true
- }
- }
- }
- return createFormat(_format_helper2.default.getDateFormatByDifferences(diff))
- }
- function formatDateRange(startValue, endValue, tickInterval) {
- var diff = getDatesDifferences(startValue, endValue);
- var typeFormat = _date2.default.getDateFormatByTickInterval(tickInterval);
- var diffFormatType = _format_helper2.default.getDateFormatByDifferences(diff, typeFormat);
- var diffFormat = createFormat(diffFormatType);
- var values = [];
- if (tickInterval in diff) {
- var rangeFormat = getHighAndSelfDiffFormat(getDatesDifferences(startValue, endValue), tickInterval);
- var value = _format(startValue, rangeFormat);
- if (value) {
- values.push(value)
- }
- } else {
- var _rangeFormat = getHighDiffFormat(getDatesDifferences(startValue, endValue));
- var highValue = _format(startValue, _rangeFormat);
- if (highValue) {
- values.push(highValue)
- }
- values.push("".concat(_format(startValue, diffFormat), " - ").concat(_format(endValue, diffFormat)))
- }
- return values.join(", ")
- }
- function processDateInterval(interval) {
- if ((0, _type.isObject)(interval)) {
- var dateUnits = Object.keys(interval);
- var sum = dateUnits.reduce(function(sum, k) {
- return interval[k] + sum
- }, 0);
- if (1 === sum) {
- var dateUnit = dateUnits.filter(function(k) {
- return 1 === interval[k]
- })[0];
- return dateUnit.slice(0, dateUnit.length - 1)
- }
- }
- return interval
- }
- function formatRange(startValue, endValue, tickInterval, _ref) {
- var dataType = _ref.dataType,
- type = _ref.type,
- logarithmBase = _ref.logarithmBase;
- if ("discrete" === type) {
- return ""
- }
- if ("datetime" === dataType) {
- return formatDateRange(startValue, endValue, processDateInterval(tickInterval))
- }
- var formatOptions = {
- ticks: [],
- type: type,
- dataType: dataType,
- tickInterval: tickInterval,
- logarithmBase: logarithmBase,
- labelOptions: {}
- };
- return "".concat(smartFormatter(startValue, formatOptions), " - ").concat(smartFormatter(endValue, formatOptions))
- }
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/tick_generator.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
- var _date2 = _interopRequireDefault(_date);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _math = __webpack_require__( /*! ../../core/utils/math */ 28);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return
- }
- if ("string" === typeof o) {
- return _arrayLikeToArray(o, minLen)
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if ("Object" === n && o.constructor) {
- n = o.constructor.name
- }
- if ("Map" === n || "Set" === n) {
- return Array.from(o)
- }
- if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen)
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (null == len || len > arr.length) {
- len = arr.length
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- function _iterableToArrayLimit(arr, i) {
- var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
- if (null == _i) {
- return
- }
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s, _e;
- try {
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) {
- break
- }
- }
- } catch (err) {
- _d = true;
- _e = err
- } finally {
- try {
- if (!_n && null != _i.return) {
- _i.return()
- }
- } finally {
- if (_d) {
- throw _e
- }
- }
- }
- return _arr
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) {
- return arr
- }
- }
- var convertDateUnitToMilliseconds = _date2.default.convertDateUnitToMilliseconds;
- var dateToMilliseconds = _date2.default.dateToMilliseconds;
- var math = Math;
- var mathAbs = math.abs;
- var mathFloor = math.floor;
- var mathCeil = math.ceil;
- var mathPow = math.pow;
- var NUMBER_MULTIPLIERS = [1, 2, 2.5, 5];
- var LOGARITHMIC_MULTIPLIERS = [1, 2, 3, 5];
- var DATETIME_MULTIPLIERS = {
- millisecond: [1, 2, 5, 10, 25, 50, 100, 250, 500],
- second: [1, 2, 3, 5, 10, 15, 20, 30],
- minute: [1, 2, 3, 5, 10, 15, 20, 30],
- hour: [1, 2, 3, 4, 6, 8, 12],
- day: [1, 2],
- week: [1, 2],
- month: [1, 2, 3, 6]
- };
- var DATETIME_MULTIPLIERS_WITH_BIG_WEEKEND = (0, _extend.extend)({}, DATETIME_MULTIPLIERS, {
- day: [1]
- });
- var DATETIME_MINOR_MULTIPLIERS = {
- millisecond: [1, 2, 5, 10, 25, 50, 100, 250, 500],
- second: [1, 2, 3, 5, 10, 15, 20, 30],
- minute: [1, 2, 3, 5, 10, 15, 20, 30],
- hour: [1, 2, 3, 4, 6, 8, 12],
- day: [1, 2, 3, 7, 14],
- month: [1, 2, 3, 6]
- };
- var MINOR_DELIMITERS = [2, 4, 5, 8, 10];
- var VISIBILITY_DELIMITER = 3;
- var MINUTE = 6e4;
- function dummyGenerator(options) {
- return function(data, screenDelta, tickInterval, forceTickInterval) {
- var count = mathFloor(screenDelta / options.axisDivisionFactor);
- count = count < 1 ? 1 : count;
- var interval = screenDelta / count;
- return {
- ticks: interval > 0 ? Array.apply(null, new Array(count + 1)).map(function(_, i) {
- return interval * i
- }) : [],
- tickInterval: interval
- }
- }
- }
- function discreteGenerator(options) {
- return function(data, screenDelta, tickInterval, forceTickInterval) {
- var categories = (0, _utils.getCategoriesInfo)(data.categories, data.min, data.max).categories;
- return {
- ticks: categories,
- tickInterval: mathCeil(categories.length * options.axisDivisionFactor / screenDelta)
- }
- }
- }
- var getValue = function(value) {
- return value
- };
- var getLogValue = function(base) {
- return function(value) {
- return (0, _utils.getLog)(value, base)
- }
- };
- var raiseTo = function(base) {
- return function(value) {
- return mathPow(base, value)
- }
- };
- var correctValueByInterval = function(post, round, getValue) {
- return function(value, interval) {
- return (0, _math.adjust)(post(round((0, _math.adjust)(getValue(value) / interval)) * interval))
- }
- };
- function correctMinValueByEndOnTick(floorFunc, ceilFunc, resolveEndOnTick, endOnTick) {
- if ((0, _type.isDefined)(endOnTick)) {
- return endOnTick ? floorFunc : ceilFunc
- }
- return function(value, interval, businessViewInfo, forceEndOnTick) {
- var floorTickValue = floorFunc(value, interval);
- if (value - floorTickValue === 0 || !(0, _type.isDefined)(businessViewInfo) || resolveEndOnTick(value, floorTickValue, interval, businessViewInfo) || forceEndOnTick) {
- return floorTickValue
- }
- return ceilFunc(value, interval)
- }
- }
- function resolveEndOnTick(curValue, tickValue, interval, businessViewInfo) {
- var prevTickDataDiff = interval - mathAbs(tickValue - curValue);
- var intervalCount = math.max(mathCeil(businessViewInfo.businessDelta / interval), 2);
- var businessRatio = businessViewInfo.screenDelta / (intervalCount * interval);
- var potentialTickScreenDiff = math.round(businessRatio * prevTickDataDiff);
- var delimiterFactor = (0, _utils.getLog)(businessRatio * interval / businessViewInfo.axisDivisionFactor, 2) + 1;
- var delimiterMultiplier = (businessViewInfo.isSpacedMargin ? 2 : 1) * delimiterFactor;
- var screenDelimiter = math.round(VISIBILITY_DELIMITER * delimiterMultiplier);
- return businessViewInfo.businessDelta > businessViewInfo.interval && potentialTickScreenDiff >= screenDelimiter
- }
- function resolveEndOnTickLog(base) {
- return function(curValue, tickValue, interval, businessViewInfo) {
- return resolveEndOnTick((0, _utils.getLog)(curValue, base), (0, _utils.getLog)(tickValue, base), interval, businessViewInfo)
- }
- }
- function resolveEndOnTickDate(curValue, tickValue, interval, businessViewInfo) {
- return resolveEndOnTick(curValue.valueOf(), tickValue.valueOf(), dateToMilliseconds(interval), businessViewInfo)
- }
- function resolveExtraTickForHiddenDataPoint(checkDataVisibility, extremum, tick, businessViewInfo, isMin) {
- var screenRatio = businessViewInfo.screenDelta / businessViewInfo.businessDelta;
- var extDir = isMin ? 1 : -1;
- var tickDir = isMin ? -1 : 1;
- return checkDataVisibility && screenRatio * (extremum * extDir + tick * tickDir) < VISIBILITY_DELIMITER
- }
- function resolveExtraTickForHiddenDataPointLog(base) {
- return function(checkDataVisibility, extremum, tick, businessViewInfo, isMin) {
- return resolveExtraTickForHiddenDataPoint(checkDataVisibility, (0, _utils.getLog)(extremum, base), (0, _utils.getLog)(tick, base), businessViewInfo, isMin)
- }
- }
- function resolveExtraTickForHiddenDataPointDate(checkDataVisibility, extremum, tick, businessViewInfo, isMin) {
- return resolveExtraTickForHiddenDataPoint(checkDataVisibility, extremum.valueOf(), tick.valueOf(), businessViewInfo, isMin)
- }
- function getBusinessDelta(data, breaks) {
- var spacing = 0;
- if (breaks) {
- spacing = breaks.reduce(function(prev, item) {
- return prev + (item.to - item.from)
- }, 0)
- }
- return mathAbs(data.max - data.min - spacing)
- }
- function getBusinessDeltaLog(base) {
- var getLog = getLogValue(base);
- return function(data, breaks) {
- var spacing = 0;
- if (breaks) {
- spacing = breaks.reduce(function(prev, item) {
- return prev + mathAbs(getLog(item.to / item.from))
- }, 0)
- }
- return mathCeil(mathAbs(getLog(data.max / data.min)) - spacing)
- }
- }
- function getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor, addTickCount) {
- var count = screenDelta / axisDivisionFactor - (addTickCount || 0);
- count = count < 1 ? 1 : count;
- return businessDelta / count
- }
- function getMultiplierFactor(interval, factorDelta) {
- return mathPow(10, mathFloor((0, _utils.getLog)(interval, 10)) + (factorDelta || 0))
- }
- function calculateTickInterval(businessDelta, screenDelta, tickInterval, forceTickInterval, axisDivisionFactor, multipliers, allowDecimals, addTickCount, _, minTickInterval) {
- var interval = getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor, addTickCount);
- var result = 1;
- var onlyIntegers = false === allowDecimals;
- if (!forceTickInterval || !tickInterval) {
- if (interval >= 1 || !onlyIntegers && interval > 0) {
- result = adjustInterval(interval, multipliers, onlyIntegers)
- }
- if (!tickInterval || !forceTickInterval && tickInterval < result) {
- tickInterval = result
- }
- }
- if (!forceTickInterval && minTickInterval) {
- minTickInterval = adjustInterval(minTickInterval, multipliers, onlyIntegers);
- if (minTickInterval > tickInterval) {
- tickInterval = minTickInterval
- }
- }
- return tickInterval
- }
- function adjustInterval(interval, multipliers, onlyIntegers) {
- var factor = getMultiplierFactor(interval, -1);
- var result = 1;
- multipliers = multipliers || NUMBER_MULTIPLIERS;
- if (interval > 0) {
- interval /= factor;
- result = multipliers.concat(10 * multipliers[0]).map(function(m) {
- return 10 * m
- }).reduce(function(r, m) {
- if (.1 === factor && onlyIntegers && 25 === m) {
- return r
- }
- return r < interval ? m : r
- }, 0);
- result = (0, _math.adjust)(result * factor, factor)
- }
- return result
- }
- function calculateMinorTickInterval(businessDelta, screenDelta, tickInterval, axisDivisionFactor) {
- var interval = getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor);
- return tickInterval || MINOR_DELIMITERS.reduce(function(r, d) {
- var cur = businessDelta / d;
- return cur >= interval ? cur : r
- }, 0)
- }
- function getCalculateTickIntervalLog(skipCalculationLimits) {
- return function(businessDelta, screenDelta, tickInterval, forceTickInterval, axisDivisionFactor, multipliers, allowDecimals, _, __, minTickInterval) {
- var interval = getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor);
- var result = 0;
- var adjustInterval = getAdjustIntervalLog(skipCalculationLimits);
- if (!forceTickInterval || !tickInterval) {
- if (interval > 0) {
- result = adjustInterval(interval, multipliers)
- }
- if (!tickInterval || !forceTickInterval && tickInterval < result) {
- tickInterval = result
- }
- }
- if (!forceTickInterval && minTickInterval) {
- minTickInterval = adjustInterval(minTickInterval, multipliers);
- if (minTickInterval > tickInterval) {
- tickInterval = minTickInterval
- }
- }
- return tickInterval
- }
- }
- function getAdjustIntervalLog(skipCalculationLimits) {
- return function(interval, multipliers) {
- var factor = getMultiplierFactor(interval);
- multipliers = multipliers || LOGARITHMIC_MULTIPLIERS;
- if (!skipCalculationLimits && factor < 1) {
- factor = 1
- }
- return multipliers.concat(10 * multipliers[0]).reduce(function(r, m) {
- return r < interval ? m * factor : r
- }, 0)
- }
- }
- function getDataTimeMultipliers(gapSize) {
- if (gapSize && gapSize > 2) {
- return DATETIME_MULTIPLIERS_WITH_BIG_WEEKEND
- } else {
- return DATETIME_MULTIPLIERS
- }
- }
- function numbersReducer(interval, key) {
- return function(r, m) {
- if (!r && interval <= convertDateUnitToMilliseconds(key, m)) {
- r = {};
- r[key + "s"] = m
- }
- return r
- }
- }
- function yearsReducer(interval, factor) {
- return function(r, m) {
- var years = factor * m;
- if (!r && interval <= convertDateUnitToMilliseconds("year", years) && 2.5 !== years) {
- r = {
- years: years
- }
- }
- return r
- }
- }
- function calculateTickIntervalDateTime(businessDelta, screenDelta, tickInterval, forceTickInterval, axisDivisionFactor, multipliers, allowDecimals, addTickCount, gapSize, minTickInterval) {
- if (!forceTickInterval || !tickInterval) {
- var result = adjustIntervalDateTime(getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor), multipliers, null, gapSize);
- if (!tickInterval || !forceTickInterval && dateToMilliseconds(tickInterval) <= dateToMilliseconds(result)) {
- tickInterval = result
- }
- }
- if (!forceTickInterval && minTickInterval) {
- minTickInterval = adjustIntervalDateTime(minTickInterval, multipliers, null, gapSize);
- if (dateToMilliseconds(minTickInterval) > dateToMilliseconds(tickInterval)) {
- tickInterval = minTickInterval
- }
- }
- return tickInterval
- }
- function adjustIntervalDateTime(interval, multipliers, _, gapSize) {
- var result;
- multipliers = multipliers || getDataTimeMultipliers(gapSize);
- for (var key in multipliers) {
- result = multipliers[key].reduce(numbersReducer(interval, key), result);
- if (result) {
- break
- }
- }
- if (!result) {
- for (var factor = 1;; factor *= 10) {
- result = NUMBER_MULTIPLIERS.reduce(yearsReducer(interval, factor), result);
- if (result) {
- break
- }
- }
- }
- return result
- }
- function calculateMinorTickIntervalDateTime(businessDelta, screenDelta, tickInterval, axisDivisionFactor) {
- return calculateTickIntervalDateTime(businessDelta, screenDelta, tickInterval, true, axisDivisionFactor, DATETIME_MINOR_MULTIPLIERS)
- }
- function getTickIntervalByCustomTicks(getValue, postProcess) {
- return function(ticks) {
- return ticks ? postProcess(mathAbs((0, _math.adjust)(getValue(ticks[1]) - getValue(ticks[0])))) || void 0 : void 0
- }
- }
- function addInterval(value, interval, isNegative) {
- return _date2.default.addInterval(value, interval, isNegative)
- }
- function addIntervalLog(base) {
- return function(value, interval, isNegative) {
- return raiseTo(base)(addInterval((0, _utils.getLog)(value, base), interval, isNegative))
- }
- }
- function addIntervalDate(value, interval, isNegative) {
- return addInterval(value, interval, isNegative)
- }
- function addIntervalWithBreaks(addInterval, breaks, correctValue) {
- breaks = breaks.filter(function(b) {
- return !b.gapSize
- });
- return function(value, interval, isNegative) {
- var breakSize;
- value = addInterval(value, interval, isNegative);
- if (!breaks.every(function(item) {
- if (value >= addInterval(item.from, interval) && addInterval(value, interval) < item.to) {
- breakSize = item.to - item.from - 2 * (addInterval(item.from, interval) - item.from)
- }
- return !breakSize
- })) {
- value = correctValue(addInterval(value, breakSize), interval)
- }
- return value
- }
- }
- function calculateTicks(addInterval, correctMinValue, adjustInterval, resolveEndOnTick, resolveExtraTickForHiddenDataPoint) {
- return function(data, tickInterval, endOnTick, gaps, breaks, businessDelta, screenDelta, axisDivisionFactor, generateExtraTick) {
- var correctTickValue = correctTickValueOnGapSize(addInterval, gaps);
- var min = data.min;
- var max = data.max;
- var businessViewInfo = {
- screenDelta: screenDelta,
- businessDelta: businessDelta,
- axisDivisionFactor: axisDivisionFactor,
- isSpacedMargin: data.isSpacedMargin,
- interval: tickInterval
- };
- var cur = correctMinValue(min, tickInterval, businessViewInfo);
- var ticks = [];
- if (breaks && breaks.length) {
- addInterval = addIntervalWithBreaks(addInterval, breaks, correctMinValue)
- }
- if (cur > max) {
- cur = correctMinValue(min, adjustInterval(businessDelta / 2), businessViewInfo);
- if (cur > max) {
- endOnTick = true;
- cur = correctMinValue(min, tickInterval, businessViewInfo, endOnTick)
- }
- }
- cur = correctTickValue(cur);
- var prev;
- while (cur < max && cur !== prev || generateExtraTick && cur <= max) {
- ticks.push(cur);
- prev = cur;
- cur = correctTickValue(addInterval(cur, tickInterval))
- }
- if (endOnTick || cur - max === 0 || !(0, _type.isDefined)(endOnTick) && resolveEndOnTick(max, cur, tickInterval, businessViewInfo)) {
- ticks.push(cur)
- }
- if (ticks.length > 0) {
- if (ticks[0].valueOf() > 0 && resolveExtraTickForHiddenDataPoint(data.checkMinDataVisibility, min, ticks[0], businessViewInfo, true)) {
- cur = addInterval(ticks[0], tickInterval, true);
- ticks.unshift(cur)
- } else {
- if (ticks[ticks.length - 1].valueOf() < 0 && resolveExtraTickForHiddenDataPoint(data.checkMaxDataVisibility, max, ticks[ticks.length - 1], businessViewInfo, false)) {
- cur = addInterval(ticks[ticks.length - 1], tickInterval);
- ticks.push(cur)
- }
- }
- }
- return ticks
- }
- }
- function calculateMinorTicks(updateTickInterval, addInterval, correctMinValue, correctTickValue, ceil) {
- return function(min, max, majorTicks, minorTickInterval, tickInterval, breaks, maxCount) {
- var factor = tickInterval / minorTickInterval;
- var lastMajor = majorTicks[majorTicks.length - 1];
- var firstMajor = majorTicks[0];
- var tickBalance = maxCount - 1;
- if (breaks && breaks.length) {
- addInterval = addIntervalWithBreaks(addInterval, breaks, correctMinValue)
- }
- minorTickInterval = updateTickInterval(minorTickInterval, firstMajor, factor);
- if (0 === minorTickInterval) {
- return []
- }
- var cur = correctTickValue(correctMinValue(min, tickInterval, min), minorTickInterval);
- var ticks = [];
- while (cur < firstMajor && (!tickBalance || tickBalance > 0)) {
- cur >= min && ticks.push(cur);
- tickBalance--;
- cur = addInterval(cur, minorTickInterval)
- }
- var middleTicks = majorTicks.reduce(function(r, tick) {
- tickBalance = maxCount - 1;
- if (null === r.prevTick) {
- r.prevTick = tick;
- return r
- }
- minorTickInterval = updateTickInterval(minorTickInterval, tick, factor);
- var cur = correctTickValue(r.prevTick, minorTickInterval);
- while (cur < tick && (!tickBalance || tickBalance > 0)) {
- cur !== r.prevTick && r.minors.push(cur);
- tickBalance--;
- cur = addInterval(cur, minorTickInterval)
- }
- r.prevTick = tick;
- return r
- }, {
- prevTick: null,
- minors: []
- });
- ticks = ticks.concat(middleTicks.minors);
- minorTickInterval = updateTickInterval(minorTickInterval, ceil(max, tickInterval, min), factor);
- cur = correctTickValue(lastMajor, minorTickInterval);
- var prev;
- while (cur < max && cur !== prev) {
- ticks.push(cur);
- prev = cur;
- cur = addInterval(cur, minorTickInterval)
- }
- if (lastMajor - max !== 0 && cur - max === 0) {
- ticks.push(cur)
- }
- return ticks
- }
- }
- function filterTicks(ticks, breaks) {
- if (breaks.length) {
- var result = breaks.reduce(function(result, b) {
- var tmpTicks = [];
- var i;
- for (i = result[1]; i < ticks.length; i++) {
- var tickValue = ticks[i];
- if (tickValue < b.from) {
- tmpTicks.push(tickValue)
- }
- if (tickValue >= b.to) {
- break
- }
- }
- return [result[0].concat(tmpTicks), i]
- }, [
- [], 0
- ]);
- return result[0].concat(ticks.slice(result[1]))
- }
- return ticks
- }
- function correctTickValueOnGapSize(addInterval, breaks) {
- return function(value) {
- var gapSize;
- if (!breaks.every(function(item) {
- if (value >= item.from && value < item.to) {
- gapSize = item.gapSize
- }
- return !gapSize
- })) {
- value = addInterval(value, gapSize)
- }
- return value
- }
- }
- function generator(options, getBusinessDelta, calculateTickInterval, calculateMinorTickInterval, getMajorTickIntervalByCustomTicks, getMinorTickIntervalByCustomTicks, convertTickInterval, calculateTicks, calculateMinorTicks, processScaleBreaks) {
- function processCustomTicks(customTicks) {
- return {
- tickInterval: getMajorTickIntervalByCustomTicks(customTicks.majors),
- ticks: customTicks.majors || [],
- minorTickInterval: getMinorTickIntervalByCustomTicks(customTicks.minors),
- minorTicks: customTicks.minors || []
- }
- }
- function correctUserTickInterval(tickInterval, businessDelta, limit) {
- if (tickInterval && businessDelta / convertTickInterval(tickInterval) >= limit + 1) {
- options.incidentOccurred("W2003");
- tickInterval = void 0
- }
- return tickInterval
- }
- function generateMajorTicks(ticks, data, businessDelta, screenDelta, tickInterval, forceTickInterval, customTicks, breaks) {
- if (customTicks.majors) {
- ticks.breaks = breaks;
- return ticks
- }
- var gaps = breaks.filter(function(b) {
- return b.gapSize
- });
- var majorTicks;
- tickInterval = options.skipCalculationLimits ? tickInterval : correctUserTickInterval(tickInterval, businessDelta, screenDelta);
- tickInterval = calculateTickInterval(businessDelta, screenDelta, tickInterval, forceTickInterval, options.axisDivisionFactor, options.numberMultipliers, options.allowDecimals, breaks.length, gaps[0] && gaps[0].gapSize.days, options.minTickInterval);
- if (!options.skipTickGeneration) {
- majorTicks = calculateTicks(data, tickInterval, options.endOnTick, gaps, breaks, businessDelta, screenDelta, options.axisDivisionFactor, options.generateExtraTick);
- breaks = processScaleBreaks(breaks, majorTicks, tickInterval);
- majorTicks = filterTicks(majorTicks, breaks);
- ticks.breaks = breaks;
- ticks.ticks = ticks.ticks.concat(majorTicks)
- }
- ticks.tickInterval = tickInterval;
- return ticks
- }
- function generateMinorTicks(ticks, data, businessDelta, screenDelta, minorTickInterval, minorTickCount, customTicks) {
- if (!options.calculateMinors) {
- return ticks
- }
- if (customTicks.minors) {
- return ticks
- }
- var minorBusinessDelta = convertTickInterval(ticks.tickInterval);
- var minorScreenDelta = screenDelta * minorBusinessDelta / businessDelta;
- var breaks = ticks.breaks;
- if (!minorTickInterval && minorTickCount) {
- minorTickInterval = getMinorTickIntervalByCustomTicks([minorBusinessDelta / (minorTickCount + 1), minorBusinessDelta / (minorTickCount + 1) * 2])
- } else {
- minorTickCount = void 0
- }
- minorTickInterval = correctUserTickInterval(minorTickInterval, minorBusinessDelta, minorScreenDelta);
- minorTickInterval = calculateMinorTickInterval(minorBusinessDelta, minorScreenDelta, minorTickInterval, options.minorAxisDivisionFactor);
- ticks.minorTicks = filterTicks(ticks.minorTicks.concat(calculateMinorTicks(data.min, data.max, ticks.ticks, minorTickInterval, ticks.tickInterval, breaks, minorTickCount)), breaks);
- ticks.minorTickInterval = minorTickInterval;
- return ticks
- }
- return function(data, screenDelta, tickInterval, forceTickInterval, customTicks, minorTickInterval, minorTickCount, breaks) {
- customTicks = customTicks || {};
- var businessDelta = getBusinessDelta(data, breaks);
- var result = processCustomTicks(customTicks);
- if (!isNaN(businessDelta)) {
- if (0 === businessDelta && !customTicks.majors) {
- result.ticks = [data.min]
- } else {
- result = generateMajorTicks(result, data, businessDelta, screenDelta, tickInterval, forceTickInterval, customTicks, breaks || []);
- if (!options.skipTickGeneration && businessDelta > 0) {
- result = generateMinorTicks(result, data, businessDelta, screenDelta, minorTickInterval, minorTickCount, customTicks)
- }
- }
- }
- return result
- }
- }
- function getBaseTick(breakValue, _ref, interval, getValue) {
- var _ref2 = _slicedToArray(_ref, 2),
- tick = _ref2[0],
- insideTick = _ref2[1];
- if (!(0, _type.isDefined)(tick) || mathAbs(getValue(breakValue) - getValue(tick)) / interval > .25) {
- if ((0, _type.isDefined)(insideTick)) {
- tick = insideTick
- } else {
- if (!(0, _type.isDefined)(tick)) {
- tick = breakValue
- }
- }
- }
- return tick
- }
- function getScaleBreaksProcessor(convertTickInterval, getValue, addCorrection) {
- return function(breaks, ticks, tickInterval) {
- var interval = convertTickInterval(tickInterval);
- var correction = .5 * interval;
- return breaks.reduce(function(result, b) {
- var breakTicks = ticks.filter(function(tick) {
- return tick <= b.from
- });
- var from = addCorrection(getBaseTick(b.from, [].concat(breakTicks[breakTicks.length - 1], ticks[breakTicks.length]), interval, getValue), correction);
- breakTicks = ticks.filter(function(tick) {
- return tick >= b.to
- });
- var to = addCorrection(getBaseTick(b.to, [].concat(breakTicks[0], ticks[ticks.length - breakTicks.length - 1]), interval, getValue), -correction);
- if (getValue(to) - getValue(from) < interval && !b.gapSize) {
- return result
- }
- if (b.gapSize) {
- return result.concat([b])
- }
- return result.concat([{
- from: from,
- to: to,
- cumulativeWidth: b.cumulativeWidth
- }])
- }, [])
- }
- }
- function numericGenerator(options) {
- var floor = correctValueByInterval(getValue, mathFloor, getValue);
- var ceil = correctValueByInterval(getValue, mathCeil, getValue);
- var calculateTickIntervalByCustomTicks = getTickIntervalByCustomTicks(getValue, getValue);
- return generator(options, getBusinessDelta, calculateTickInterval, calculateMinorTickInterval, calculateTickIntervalByCustomTicks, calculateTickIntervalByCustomTicks, getValue, calculateTicks(addInterval, correctMinValueByEndOnTick(floor, ceil, resolveEndOnTick, options.endOnTick), adjustInterval, resolveEndOnTick, resolveExtraTickForHiddenDataPoint), calculateMinorTicks(getValue, addInterval, floor, addInterval, getValue), getScaleBreaksProcessor(getValue, getValue, function(value, correction) {
- return value + correction
- }))
- }
- function logarithmicGenerator(options) {
- var base = options.logBase;
- var raise = raiseTo(base);
- var log = getLogValue(base);
- var floor = correctValueByInterval(raise, mathFloor, log);
- var ceil = correctValueByInterval(raise, mathCeil, log);
- var ceilNumber = correctValueByInterval(getValue, mathCeil, getValue);
- return generator(options, getBusinessDeltaLog(base), getCalculateTickIntervalLog(options.skipCalculationLimits), calculateMinorTickInterval, getTickIntervalByCustomTicks(log, getValue), getTickIntervalByCustomTicks(getValue, getValue), getValue, calculateTicks(addIntervalLog(base), correctMinValueByEndOnTick(floor, ceil, resolveEndOnTickLog(base), options.endOnTick), getAdjustIntervalLog(options.skipCalculationLimits), resolveEndOnTickLog(base), resolveExtraTickForHiddenDataPointLog(base)), calculateMinorTicks(function(_, tick, factor) {
- return tick / factor
- }, addInterval, floor, ceilNumber, ceil), getScaleBreaksProcessor(getValue, log, function(value, correction) {
- return raise(log(value) + correction)
- }))
- }
- function dateGenerator(options) {
- function floor(value, interval) {
- var floorNumber = correctValueByInterval(getValue, mathFloor, getValue);
- var intervalObject = (0, _type.isString)(interval) ? _date2.default.getDateIntervalByString(interval.toLowerCase()) : interval;
- var divider = dateToMilliseconds(interval);
- if (intervalObject.days % 7 === 0 || interval.quarters) {
- intervalObject = adjustIntervalDateTime(divider)
- }
- var correctDateWithUnitBeginning = function(v) {
- return _date2.default.correctDateWithUnitBeginning(v, intervalObject, null, options.firstDayOfWeek)
- };
- var floorAtStartDate = function(v) {
- return new Date(mathFloor((v.getTime() - v.getTimezoneOffset() * MINUTE) / divider) * divider + v.getTimezoneOffset() * MINUTE)
- };
- value = correctDateWithUnitBeginning(value);
- if ("years" in intervalObject) {
- value.setFullYear(floorNumber(value.getFullYear(), intervalObject.years, 0))
- } else {
- if ("quarters" in intervalObject) {
- value = correctDateWithUnitBeginning(floorAtStartDate(value))
- } else {
- if ("months" in intervalObject) {
- value.setMonth(floorNumber(value.getMonth(), intervalObject.months, 0))
- } else {
- if ("weeks" in intervalObject || "days" in intervalObject) {
- value = correctDateWithUnitBeginning(floorAtStartDate(value))
- } else {
- if ("hours" in intervalObject) {
- value.setHours(floorNumber(value.getHours(), intervalObject.hours, 0))
- } else {
- if ("minutes" in intervalObject) {
- value.setMinutes(floorNumber(value.getMinutes(), intervalObject.minutes, 0))
- } else {
- if ("seconds" in intervalObject) {
- value.setSeconds(floorNumber(value.getSeconds(), intervalObject.seconds, 0))
- } else {
- if ("milliseconds" in intervalObject) {
- value = floorAtStartDate(value)
- }
- }
- }
- }
- }
- }
- }
- }
- return value
- }
- function ceil(value, interval) {
- var newValue = floor(value, interval);
- while (value - newValue > 0) {
- newValue = addIntervalDate(newValue, interval)
- }
- return newValue
- }
- var calculateTickIntervalByCustomTicks = getTickIntervalByCustomTicks(getValue, _date2.default.convertMillisecondsToDateUnits);
- return generator(options, getBusinessDelta, calculateTickIntervalDateTime, calculateMinorTickIntervalDateTime, calculateTickIntervalByCustomTicks, calculateTickIntervalByCustomTicks, dateToMilliseconds, calculateTicks(addIntervalDate, correctMinValueByEndOnTick(floor, ceil, resolveEndOnTickDate, options.endOnTick), adjustIntervalDateTime, resolveEndOnTickDate, resolveExtraTickForHiddenDataPointDate), calculateMinorTicks(getValue, addIntervalDate, floor, addIntervalDate, getValue), getScaleBreaksProcessor(dateToMilliseconds, getValue, function(value, correction) {
- return new Date(value.getTime() + correction)
- }))
- }
- exports.tickGenerator = function(options) {
- var result;
- if (options.rangeIsEmpty) {
- result = dummyGenerator(options)
- } else {
- if ("discrete" === options.axisType) {
- result = discreteGenerator(options)
- } else {
- if ("logarithmic" === options.axisType) {
- result = logarithmicGenerator(options)
- } else {
- if ("datetime" === options.dataType) {
- result = dateGenerator(options)
- } else {
- result = numericGenerator(options)
- }
- }
- }
- }
- return result
- }
- },
- /*!***********************************************!*\
- !*** ./artifacts/transpiled/viz/axes/tick.js ***!
- \***********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- function getPathStyle(options) {
- return {
- stroke: options.color,
- "stroke-width": options.width,
- "stroke-opacity": options.opacity,
- opacity: 1
- }
- }
- function createTick(axis, renderer, tickOptions, gridOptions, skippedCategory, skipLabels, offset) {
- var tickOffset = offset || axis._tickOffset;
- var lineGroup = axis._axisLineGroup;
- var elementsGroup = axis._axisElementsGroup;
- var tickStyle = getPathStyle(tickOptions);
- var gridStyle = getPathStyle(gridOptions);
- var emptyStrRegExp = /^\s+$/;
- var axisOptions = axis.getOptions();
- var labelOptions = axisOptions.label;
- var labelStyle = axis._textOptions;
- function getLabelFontStyle(tick) {
- var fontStyle = axis._textFontStyles;
- var customizeColor = labelOptions.customizeColor;
- if (customizeColor && customizeColor.call) {
- fontStyle = extend({}, axis._textFontStyles, {
- fill: customizeColor.call(tick, tick)
- })
- }
- return fontStyle
- }
- function createLabelHint(tick, range) {
- var labelHint = axis.formatHint(tick.value, labelOptions, range);
- if (isDefined(labelHint) && "" !== labelHint) {
- tick.label.setTitle(labelHint)
- }
- }
- return function(value) {
- var tick = {
- value: value,
- updateValue: function(newValue) {
- this.value = value = newValue
- },
- initCoords: function() {
- this.coords = axis._getTranslatedValue(value, tickOffset);
- this.labelCoords = axis._getTranslatedValue(value)
- },
- saveCoords: function() {
- this._storedCoords = this.coords;
- this._storedLabelsCoords = this.labelCoords
- },
- drawMark: function(options) {
- if (!tickOptions.visible || skippedCategory === value) {
- return
- }
- if (axis.areCoordsOutsideAxis(this.coords)) {
- return
- }
- if (this.mark) {
- this.mark.append(lineGroup);
- axis.sharp(this.mark, axis.getSharpDirectionByCoords(this.coords));
- this.updateTickPosition(options)
- } else {
- this.mark = axis._createPathElement([], tickStyle, axis.getSharpDirectionByCoords(this.coords)).append(lineGroup);
- this.updateTickPosition(options)
- }
- },
- setSkippedCategory: function(category) {
- skippedCategory = category
- },
- _updateLine: function(lineElement, settings, storedSettings, animate, isGridLine) {
- if (!lineElement) {
- return
- }
- if (null === settings.points || null === settings.r) {
- lineElement.remove();
- return
- }
- if (animate && storedSettings && null !== storedSettings.points) {
- settings.opacity = 1;
- lineElement.attr(storedSettings);
- lineElement.animate(settings)
- } else {
- settings.opacity = animate ? 0 : 1;
- lineElement.attr(settings);
- animate && lineElement.animate({
- opacity: 1
- }, {
- delay: .5,
- partitionDuration: .5
- })
- }
- this.coords.angle && axis._rotateTick(lineElement, this.coords, isGridLine)
- },
- updateTickPosition: function(options, animate) {
- this._updateLine(this.mark, {
- points: axis._getTickMarkPoints(tick.coords, tickOptions.length, options)
- }, this._storedCoords && {
- points: axis._getTickMarkPoints(tick._storedCoords, tickOptions.length, options)
- }, animate, false)
- },
- drawLabel: function(range) {
- var labelIsVisible = labelOptions.visible && !skipLabels && !axis.getTranslator().getBusinessRange().isEmpty() && !axis.areCoordsOutsideAxis(this.labelCoords);
- if (!labelIsVisible) {
- if (this.label) {
- this.label.remove()
- }
- return
- }
- var text = axis.formatLabel(value, labelOptions, range);
- if (this.label) {
- this.label.attr({
- text: text,
- rotate: 0
- }).append(elementsGroup);
- createLabelHint(this, range);
- this.updateLabelPosition();
- return
- }
- if (isDefined(text) && "" !== text && !emptyStrRegExp.test(text)) {
- this.label = renderer.text(text).css(getLabelFontStyle(this)).attr(labelStyle).data("chart-data-argument", this.value).append(elementsGroup);
- this.updateLabelPosition();
- createLabelHint(this, range)
- }
- },
- fadeOutElements: function() {
- var startSettings = {
- opacity: 1
- };
- var endSettings = {
- opacity: 0
- };
- var animationSettings = {
- partitionDuration: .5
- };
- if (this.label) {
- this._fadeOutLabel()
- }
- if (this.grid) {
- this.grid.append(axis._axisGridGroup).attr(startSettings).animate(endSettings, animationSettings)
- }
- if (this.mark) {
- this.mark.append(axis._axisLineGroup).attr(startSettings).animate(endSettings, animationSettings)
- }
- },
- _fadeInLabel: function() {
- var group = axis._renderer.g().attr({
- opacity: 0
- }).append(axis._axisElementsGroup).animate({
- opacity: 1
- }, {
- delay: .5,
- partitionDuration: .5
- });
- this.label.append(group)
- },
- _fadeOutLabel: function() {
- var group = axis._renderer.g().attr({
- opacity: 1
- }).animate({
- opacity: 0
- }, {
- partitionDuration: .5
- }).append(axis._axisElementsGroup);
- this.label.append(group)
- },
- updateLabelPosition: function(animate) {
- if (!this.label) {
- return
- }
- if (animate && this._storedLabelsCoords) {
- this.label.attr({
- x: this._storedLabelsCoords.x,
- y: this._storedLabelsCoords.y
- });
- this.label.animate({
- x: this.labelCoords.x,
- y: this.labelCoords.y
- })
- } else {
- this.label.attr({
- x: this.labelCoords.x,
- y: this.labelCoords.y
- });
- if (animate) {
- this._fadeInLabel()
- }
- }
- },
- drawGrid: function(drawLine) {
- if (gridOptions.visible && skippedCategory !== this.value) {
- if (this.grid) {
- this.grid.append(axis._axisGridGroup);
- axis.sharp(this.grid, axis.getSharpDirectionByCoords(this.coords));
- this.updateGridPosition()
- } else {
- this.grid = drawLine(this, gridStyle);
- this.grid && this.grid.append(axis._axisGridGroup)
- }
- }
- },
- updateGridPosition: function(animate) {
- this._updateLine(this.grid, axis._getGridPoints(tick.coords), this._storedCoords && axis._getGridPoints(this._storedCoords), animate, true)
- },
- removeLabel: function() {
- this.label.remove();
- this.label = null
- }
- };
- return tick
- }
- }
- exports.tick = createTick
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/xy_axes.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _range = __webpack_require__( /*! ../translators/range */ 108);
- var _range2 = _interopRequireDefault(_range);
- var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
- var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
- var _date2 = _interopRequireDefault(_date);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _datetime_breaks = __webpack_require__( /*! ./datetime_breaks */ 783);
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _utils2 = _interopRequireDefault(_utils);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _axes_constants = __webpack_require__( /*! ./axes_constants */ 248);
- var _axes_constants2 = _interopRequireDefault(_axes_constants);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var getNextDateUnit = _date2.default.getNextDateUnit;
- var correctDateWithUnitBeginning = _date2.default.correctDateWithUnitBeginning;
- var _math = Math;
- var _max = _math.max;
- var TOP = _axes_constants2.default.top;
- var BOTTOM = _axes_constants2.default.bottom;
- var LEFT = _axes_constants2.default.left;
- var RIGHT = _axes_constants2.default.right;
- var CENTER = _axes_constants2.default.center;
- var SCALE_BREAK_OFFSET = 3;
- var RANGE_RATIO = .3;
- var WAVED_LINE_CENTER = 2;
- var WAVED_LINE_TOP = 0;
- var WAVED_LINE_BOTTOM = 4;
- var WAVED_LINE_LENGTH = 24;
- var TICKS_CORRECTIONS = {
- left: -1,
- top: -1,
- right: 0,
- bottom: 0,
- center: -.5
- };
- function prepareDatesDifferences(datesDifferences, tickInterval) {
- var dateUnitInterval;
- var i;
- if ("week" === tickInterval) {
- tickInterval = "day"
- }
- if ("quarter" === tickInterval) {
- tickInterval = "month"
- }
- if (datesDifferences[tickInterval]) {
- for (i = 0; i < _date2.default.dateUnitIntervals.length; i++) {
- dateUnitInterval = _date2.default.dateUnitIntervals[i];
- if (datesDifferences[dateUnitInterval]) {
- datesDifferences[dateUnitInterval] = false;
- datesDifferences.count--
- }
- if (dateUnitInterval === tickInterval) {
- break
- }
- }
- }
- }
- function sortingBreaks(breaks) {
- return breaks.sort(function(a, b) {
- return a.from - b.from
- })
- }
- function filterBreaks(breaks, viewport, breakStyle) {
- var minVisible = viewport.minVisible;
- var maxVisible = viewport.maxVisible;
- var breakSize = breakStyle ? breakStyle.width : 0;
- return breaks.reduce(function(result, currentBreak) {
- var from = currentBreak.from;
- var to = currentBreak.to;
- var lastResult = result[result.length - 1];
- var newBreak;
- if (!(0, _type.isDefined)(from) || !(0, _type.isDefined)(to)) {
- return result
- }
- if (from > to) {
- to = [from, from = to][0]
- }
- if (result.length && from < lastResult.to) {
- if (to > lastResult.to) {
- lastResult.to = to > maxVisible ? maxVisible : to;
- if (lastResult.gapSize) {
- lastResult.gapSize = void 0;
- lastResult.cumulativeWidth += breakSize
- }
- }
- } else {
- if ((from >= minVisible && from < maxVisible || to <= maxVisible && to > minVisible) && to - from < maxVisible - minVisible) {
- from = from >= minVisible ? from : minVisible;
- to = to <= maxVisible ? to : maxVisible;
- newBreak = {
- from: from,
- to: to,
- cumulativeWidth: (lastResult ? lastResult.cumulativeWidth : 0) + breakSize
- };
- if (currentBreak.gapSize) {
- newBreak.gapSize = _date2.default.convertMillisecondsToDateUnits(to - from);
- newBreak.cumulativeWidth = lastResult ? lastResult.cumulativeWidth : 0
- }
- result.push(newBreak)
- }
- }
- return result
- }, [])
- }
- function getMarkerDates(min, max, markerInterval) {
- var origMin = min;
- var dates;
- min = correctDateWithUnitBeginning(min, markerInterval);
- max = correctDateWithUnitBeginning(max, markerInterval);
- dates = _date2.default.getSequenceByInterval(min, max, markerInterval);
- if (dates.length && origMin > dates[0]) {
- dates = dates.slice(1)
- }
- return dates
- }
- function getStripHorizontalAlignmentPosition(alignment) {
- var position = "start";
- if ("center" === alignment) {
- position = "center"
- }
- if ("right" === alignment) {
- position = "end"
- }
- return position
- }
- function getStripVerticalAlignmentPosition(alignment) {
- var position = "start";
- if ("center" === alignment) {
- position = "center"
- }
- if ("bottom" === alignment) {
- position = "end"
- }
- return position
- }
- function getMarkerInterval(tickInterval) {
- var markerInterval = getNextDateUnit(tickInterval);
- if ("quarter" === markerInterval) {
- markerInterval = getNextDateUnit(markerInterval)
- }
- return markerInterval
- }
- function getMarkerFormat(curDate, prevDate, tickInterval, markerInterval) {
- var format = markerInterval;
- var datesDifferences = prevDate && _date2.default.getDatesDifferences(prevDate, curDate);
- if (prevDate && "year" !== tickInterval) {
- prepareDatesDifferences(datesDifferences, tickInterval);
- format = (0, _format_helper.getDateFormatByDifferences)(datesDifferences)
- }
- return format
- }
- function getMaxSide(act, boxes) {
- return boxes.reduce(function(prevValue, box) {
- return _max(prevValue, act(box))
- }, 0)
- }
- function getDistanceByAngle(bBox, rotationAngle) {
- rotationAngle = _math.abs(rotationAngle);
- rotationAngle = rotationAngle % 180 >= 90 ? 90 - rotationAngle % 90 : rotationAngle % 90;
- var a = rotationAngle * (_math.PI / 180);
- if (a >= _math.atan(bBox.height / bBox.width)) {
- return bBox.height / _math.abs(_math.sin(a))
- } else {
- return bBox.width
- }
- }
- function getMaxConstantLinePadding(constantLines) {
- return constantLines.reduce(function(padding, options) {
- return _max(padding, options.paddingTopBottom)
- }, 0)
- }
- function getConstantLineLabelMarginForVerticalAlignment(constantLines, alignment, labelHeight) {
- return constantLines.some(function(options) {
- return options.label.verticalAlignment === alignment
- }) && labelHeight || 0
- }
- function getLeftMargin(bBox) {
- return _math.abs(bBox.x) || 0
- }
- function getRightMargin(bBox) {
- return _math.abs(bBox.width - _math.abs(bBox.x)) || 0
- }
- function generateRangesOnPoints(points, edgePoints, getRange) {
- var i;
- var length;
- var maxRange = null;
- var ranges = [];
- var curValue;
- var prevValue;
- var curRange;
- for (i = 1, length = points.length; i < length; i++) {
- curValue = points[i];
- prevValue = points[i - 1];
- curRange = getRange(curValue, prevValue);
- if (edgePoints.indexOf(curValue) >= 0) {
- if (!maxRange || curRange > maxRange.length) {
- maxRange = {
- start: curValue,
- end: prevValue,
- length: curRange
- }
- }
- } else {
- if (maxRange && curRange < maxRange.length) {
- ranges.push(maxRange)
- } else {
- ranges.push({
- start: curValue,
- end: prevValue,
- length: curRange
- })
- }
- maxRange = null
- }
- }
- if (maxRange) {
- ranges.push(maxRange)
- }
- return ranges
- }
- function generateAutoBreaks(_ref, series, _ref2) {
- var logarithmBase = _ref.logarithmBase,
- type = _ref.type,
- maxAutoBreakCount = _ref.maxAutoBreakCount;
- var minVisible = _ref2.minVisible,
- maxVisible = _ref2.maxVisible;
- var breaks = [];
- var getRange = "logarithmic" === type ? function(min, max) {
- return _utils2.default.getLog(max / min, logarithmBase)
- } : function(min, max) {
- return max - min
- };
- var visibleRange = getRange(minVisible, maxVisible);
- var points = series.reduce(function(result, s) {
- var points = s.getPointsInViewPort();
- result[0] = result[0].concat(points[0]);
- result[1] = result[1].concat(points[1]);
- return result
- }, [
- [],
- []
- ]);
- var sortedAllPoints = points[0].concat(points[1]).sort(function(a, b) {
- return b - a
- });
- var edgePoints = points[1].filter(function(p) {
- return points[0].indexOf(p) < 0
- });
- var minDiff = RANGE_RATIO * visibleRange;
- var ranges = generateRangesOnPoints(sortedAllPoints, edgePoints, getRange).sort(function(a, b) {
- return b.length - a.length
- });
- var epsilon = _math.min.apply(null, ranges.map(function(r) {
- return r.length
- })) / 1e3;
- var _maxAutoBreakCount = (0, _type.isDefined)(maxAutoBreakCount) ? _math.min(maxAutoBreakCount, ranges.length) : ranges.length;
- for (var i = 0; i < _maxAutoBreakCount; i++) {
- if (ranges[i].length >= minDiff) {
- if (visibleRange <= ranges[i].length) {
- break
- }
- visibleRange -= ranges[i].length;
- if (visibleRange > epsilon || visibleRange < -epsilon) {
- breaks.push({
- from: ranges[i].start,
- to: ranges[i].end
- });
- minDiff = RANGE_RATIO * visibleRange
- }
- } else {
- break
- }
- }
- sortingBreaks(breaks);
- return breaks
- }
- module.exports = {
- linear: {
- _getStep: function(boxes, rotationAngle) {
- var spacing = this._options.label.minSpacing;
- var func = this._isHorizontal ? function(box) {
- return box.width + spacing
- } : function(box) {
- return box.height
- };
- var maxLabelLength = getMaxSide(func, boxes);
- if (rotationAngle) {
- maxLabelLength = getDistanceByAngle({
- width: maxLabelLength,
- height: this._getMaxLabelHeight(boxes, 0)
- }, rotationAngle)
- }
- return _axes_constants2.default.getTicksCountInRange(this._majorTicks, this._isHorizontal ? "x" : "y", maxLabelLength)
- },
- _getMaxLabelHeight: function(boxes, spacing) {
- return getMaxSide(function(box) {
- return box.height
- }, boxes) + spacing
- },
- _validateOverlappingMode: function(mode, displayMode) {
- if (this._isHorizontal && ("rotate" === displayMode || "stagger" === displayMode) || !this._isHorizontal) {
- return _axes_constants2.default.validateOverlappingMode(mode)
- }
- return mode
- },
- _validateDisplayMode: function(mode) {
- return this._isHorizontal ? mode : "standard"
- },
- getMarkerTrackers: function() {
- return this._markerTrackers
- },
- _getSharpParam: function(opposite) {
- return this._isHorizontal ^ opposite ? "h" : "v"
- },
- _createAxisElement: function() {
- return this._renderer.path([], "line")
- },
- _updateAxisElementPosition: function() {
- var axisCoord = this._axisPosition;
- var canvas = this._getCanvasStartEnd();
- this._axisElement.attr({
- points: this._isHorizontal ? [canvas.start, axisCoord, canvas.end, axisCoord] : [axisCoord, canvas.start, axisCoord, canvas.end]
- })
- },
- _getTranslatedCoord: function(value, offset) {
- return this._translator.translate(value, offset)
- },
- _initAxisPositions: function() {
- var that = this;
- var position = that._options.position;
- that._axisPosition = that._orthogonalPositions["top" === position || "left" === position ? "start" : "end"]
- },
- _getTickMarkPoints: function(coords, length, tickOptions) {
- var isHorizontal = this._isHorizontal;
- var options = this._options;
- var tickStartCoord;
- if ((0, _type.isDefined)(options.tickOrientation)) {
- tickStartCoord = TICKS_CORRECTIONS[options.tickOrientation] * length
- } else {
- var shift = tickOptions.shift || 0;
- if ("left" === options.position || "top" === options.position) {
- shift = -shift
- }
- tickStartCoord = shift + this.getTickStartPositionShift(length)
- }
- return [coords.x + (isHorizontal ? 0 : tickStartCoord), coords.y + (isHorizontal ? tickStartCoord : 0), coords.x + (isHorizontal ? 0 : tickStartCoord + length), coords.y + (isHorizontal ? tickStartCoord + length : 0)]
- },
- getTickStartPositionShift: function(length) {
- var options = this._options;
- return length % 2 === 1 ? options.width % 2 === 0 && ("left" === options.position || "top" === options.position) || options.width % 2 === 1 && ("right" === options.position || "bottom" === options.position) ? Math.floor(-length / 2) : -Math.floor(length / 2) : -length / 2 + (options.width % 2 === 0 ? 0 : "bottom" === options.position || "right" === options.position ? -1 : 1)
- },
- _getTitleCoords: function() {
- var that = this;
- var horizontal = that._isHorizontal;
- var x = that._axisPosition;
- var y = that._axisPosition;
- var align = that._options.title.alignment;
- var canvas = that._getCanvasStartEnd();
- var fromStartToEnd = horizontal || that._options.position === LEFT;
- var canvasStart = fromStartToEnd ? canvas.start : canvas.end;
- var canvasEnd = fromStartToEnd ? canvas.end : canvas.start;
- var coord = align === LEFT ? canvasStart : align === RIGHT ? canvasEnd : canvas.start + (canvas.end - canvas.start) / 2;
- if (horizontal) {
- x = coord
- } else {
- y = coord
- }
- return {
- x: x,
- y: y
- }
- },
- _drawTitleText: function(group, coords) {
- var options = this._options;
- var titleOptions = options.title;
- var attrs = {
- opacity: titleOptions.opacity,
- align: titleOptions.alignment,
- "class": titleOptions.cssClass
- };
- if (!titleOptions.text || !group) {
- return
- }
- coords = coords || this._getTitleCoords();
- if (!this._isHorizontal) {
- attrs.rotate = options.position === LEFT ? 270 : 90
- }
- var text = this._renderer.text(titleOptions.text, coords.x, coords.y).css(_utils2.default.patchFontOptions(titleOptions.font)).attr(attrs).append(group);
- this._checkTitleOverflow(text);
- return text
- },
- _updateTitleCoords: function() {
- this._title && this._title.element.attr(this._getTitleCoords())
- },
- _drawTitle: function() {
- var title = this._drawTitleText(this._axisTitleGroup);
- if (title) {
- this._title = {
- element: title
- }
- }
- },
- _measureTitle: function() {
- if (this._title) {
- if (this._title.bBox && !this._title.originalSize) {
- this._title.originalSize = this._title.bBox
- }
- this._title.bBox = this._title.element.getBBox()
- }
- },
- _drawDateMarker: function(date, options, range) {
- var that = this;
- var markerOptions = that._options.marker;
- var invert = that._translator.getBusinessRange().invert;
- var textIndent = markerOptions.width + markerOptions.textLeftIndent;
- var pathElement;
- if (null === options.x) {
- return
- }
- if (!options.withoutStick) {
- pathElement = that._renderer.path([options.x, options.y, options.x, options.y + markerOptions.separatorHeight], "line").attr({
- "stroke-width": markerOptions.width,
- stroke: markerOptions.color,
- "stroke-opacity": markerOptions.opacity,
- sharp: "h"
- }).append(that._axisElementsGroup)
- }
- var text = String(that.formatLabel(date, options.labelOptions, range));
- return {
- date: date,
- x: options.x,
- y: options.y,
- cropped: options.withoutStick,
- label: that._renderer.text(text, options.x, options.y).css(_utils2.default.patchFontOptions(markerOptions.label.font)).append(that._axisElementsGroup),
- line: pathElement,
- getEnd: function() {
- return this.x + (invert ? -1 : 1) * (textIndent + this.labelBBox.width)
- },
- setTitle: function() {
- this.title = text
- },
- hideLabel: function() {
- this.label.dispose();
- this.label = null;
- this.title = text
- },
- hide: function() {
- if (pathElement) {
- pathElement.dispose();
- pathElement = null
- }
- this.label.dispose();
- this.label = null;
- this.hidden = true
- }
- }
- },
- _drawDateMarkers: function() {
- var that = this;
- var options = that._options;
- var translator = that._translator;
- var viewport = that._getViewportRange();
- var minBound = viewport.minVisible;
- var dateMarkers = [];
- var dateMarker;
- function draw(markerDate, format, withoutStick) {
- return that._drawDateMarker(markerDate, {
- x: translator.translate(markerDate),
- y: markersAreaTop,
- labelOptions: that._getLabelFormatOptions(format),
- withoutStick: withoutStick
- }, viewport)
- }
- if (viewport.isEmpty() || !options.marker.visible || "datetime" !== options.argumentType || "discrete" === options.type || that._majorTicks.length <= 1) {
- return []
- }
- var markersAreaTop = that._axisPosition + options.marker.topIndent;
- var tickInterval = _date2.default.getDateUnitInterval(this._tickInterval);
- var markerInterval = getMarkerInterval(tickInterval);
- var markerDates = getMarkerDates(minBound, viewport.maxVisible, markerInterval);
- if (markerDates.length > 1 || 1 === markerDates.length && minBound < markerDates[0]) {
- dateMarkers = markerDates.reduce(function(markers, curDate, i, dates) {
- var marker = draw(curDate, getMarkerFormat(curDate, dates[i - 1] || minBound < curDate && minBound, tickInterval, markerInterval));
- marker && markers.push(marker);
- return markers
- }, []);
- if (minBound < markerDates[0]) {
- dateMarker = draw(minBound, getMarkerFormat(minBound, markerDates[0], tickInterval, markerInterval), true);
- dateMarker && dateMarkers.unshift(dateMarker)
- }
- }
- return dateMarkers
- },
- _adjustDateMarkers: function(offset) {
- offset = offset || 0;
- var that = this;
- var markerOptions = this._options.marker;
- var textIndent = markerOptions.width + markerOptions.textLeftIndent;
- var invert = this._translator.getBusinessRange().invert;
- var canvas = that._getCanvasStartEnd();
- var dateMarkers = this._dateMarkers;
- if (!dateMarkers.length) {
- return offset
- }
- if (dateMarkers[0].cropped) {
- if (!this._checkMarkersPosition(invert, dateMarkers[1], dateMarkers[0])) {
- dateMarkers[0].hideLabel()
- }
- }
- var prevDateMarker;
- dateMarkers.forEach(function(marker, i, markers) {
- if (marker.cropped) {
- return
- }
- if (invert ? marker.getEnd() < canvas.end : marker.getEnd() > canvas.end) {
- marker.hideLabel()
- } else {
- if (that._checkMarkersPosition(invert, marker, prevDateMarker)) {
- prevDateMarker = marker
- } else {
- marker.hide()
- }
- }
- });
- this._dateMarkers.forEach(function(marker) {
- if (marker.label) {
- var labelBBox = marker.labelBBox;
- var dy = marker.y + markerOptions.textTopIndent - labelBBox.y;
- marker.label.attr({
- translateX: invert ? marker.x - textIndent - labelBBox.x - labelBBox.width : marker.x + textIndent - labelBBox.x,
- translateY: dy + offset
- })
- }
- if (marker.line) {
- marker.line.attr({
- translateY: offset
- })
- }
- });
- that._initializeMarkersTrackers(offset);
- return offset + markerOptions.topIndent + markerOptions.separatorHeight
- },
- _checkMarkersPosition: function(invert, dateMarker, prevDateMarker) {
- if (void 0 === prevDateMarker) {
- return true
- }
- return invert ? dateMarker.x < prevDateMarker.getEnd() : dateMarker.x > prevDateMarker.getEnd()
- },
- _initializeMarkersTrackers: function(offset) {
- var that = this;
- var separatorHeight = that._options.marker.separatorHeight;
- var renderer = that._renderer;
- var businessRange = this._translator.getBusinessRange();
- var canvas = that._getCanvasStartEnd();
- var group = that._axisElementsGroup;
- that._markerTrackers = this._dateMarkers.filter(function(marker) {
- return !marker.hidden
- }).map(function(marker, i, markers) {
- var nextMarker = markers[i + 1] || {
- x: canvas.end,
- date: businessRange.max
- };
- var x = marker.x;
- var y = marker.y + offset;
- var markerTracker = renderer.path([x, y, x, y + separatorHeight, nextMarker.x, y + separatorHeight, nextMarker.x, y, x, y], "area").attr({
- "stroke-width": 1,
- stroke: "grey",
- fill: "grey",
- opacity: 1e-4
- }).append(group);
- markerTracker.data("range", {
- startValue: marker.date,
- endValue: nextMarker.date
- });
- if (marker.title) {
- markerTracker.setTitle(marker.title)
- }
- return markerTracker
- })
- },
- _getLabelFormatOptions: function(formatString) {
- var that = this;
- var markerLabelOptions = that._markerLabelOptions;
- if (!markerLabelOptions) {
- that._markerLabelOptions = markerLabelOptions = (0, _extend.extend)(true, {}, that._options.marker.label)
- }
- if (!(0, _type.isDefined)(that._options.marker.label.format)) {
- markerLabelOptions.format = formatString
- }
- return markerLabelOptions
- },
- _adjustConstantLineLabels: function(constantLines) {
- var that = this;
- var axisPosition = that._options.position;
- var canvas = that.getCanvas();
- var canvasLeft = canvas.left;
- var canvasRight = canvas.width - canvas.right;
- var canvasTop = canvas.top;
- var canvasBottom = canvas.height - canvas.bottom;
- var verticalCenter = canvasTop + (canvasBottom - canvasTop) / 2;
- var horizontalCenter = canvasLeft + (canvasRight - canvasLeft) / 2;
- var maxLabel = 0;
- constantLines.forEach(function(item) {
- var isHorizontal = that._isHorizontal;
- var linesOptions = item.options;
- var paddingTopBottom = linesOptions.paddingTopBottom;
- var paddingLeftRight = linesOptions.paddingLeftRight;
- var labelOptions = linesOptions.label;
- var labelVerticalAlignment = labelOptions.verticalAlignment;
- var labelHorizontalAlignment = labelOptions.horizontalAlignment;
- var labelIsInside = "inside" === labelOptions.position;
- var label = item.label;
- var box = item.labelBBox;
- var translateX;
- var translateY;
- if (null === label || box.isEmpty) {
- return
- }
- if (isHorizontal) {
- if (labelIsInside) {
- if (labelHorizontalAlignment === LEFT) {
- translateX = item.coord - paddingLeftRight - box.x - box.width
- } else {
- translateX = item.coord + paddingLeftRight - box.x
- }
- switch (labelVerticalAlignment) {
- case CENTER:
- translateY = verticalCenter - box.y - box.height / 2;
- break;
- case BOTTOM:
- translateY = canvasBottom - paddingTopBottom - box.y - box.height;
- break;
- default:
- translateY = canvasTop + paddingTopBottom - box.y
- }
- } else {
- if (axisPosition === labelVerticalAlignment) {
- maxLabel = _max(maxLabel, box.height + paddingTopBottom)
- }
- translateX = item.coord - box.x - box.width / 2;
- if (labelVerticalAlignment === BOTTOM) {
- translateY = canvasBottom + paddingTopBottom - box.y
- } else {
- translateY = canvasTop - paddingTopBottom - box.y - box.height
- }
- }
- } else {
- if (labelIsInside) {
- if (labelVerticalAlignment === BOTTOM) {
- translateY = item.coord + paddingTopBottom - box.y
- } else {
- translateY = item.coord - paddingTopBottom - box.y - box.height
- }
- switch (labelHorizontalAlignment) {
- case CENTER:
- translateX = horizontalCenter - box.x - box.width / 2;
- break;
- case RIGHT:
- translateX = canvasRight - paddingLeftRight - box.x - box.width;
- break;
- default:
- translateX = canvasLeft + paddingLeftRight - box.x
- }
- } else {
- if (axisPosition === labelHorizontalAlignment) {
- maxLabel = _max(maxLabel, box.width + paddingLeftRight)
- }
- translateY = item.coord - box.y - box.height / 2;
- if (labelHorizontalAlignment === RIGHT) {
- translateX = canvasRight + paddingLeftRight - box.x
- } else {
- translateX = canvasLeft - paddingLeftRight - box.x - box.width
- }
- }
- }
- label.attr({
- translateX: translateX,
- translateY: translateY
- })
- });
- return maxLabel
- },
- _drawConstantLinesForEstimating: function(constantLines) {
- var that = this;
- var renderer = this._renderer;
- var group = renderer.g();
- constantLines.forEach(function(options) {
- that._drawConstantLineLabelText(options.label.text, 0, 0, options.label, group).attr({
- align: "center"
- })
- });
- return group.append(renderer.root)
- },
- _estimateLabelHeight: function(bBox, labelOptions) {
- var height = bBox.height;
- var drawingType = labelOptions.drawingType;
- if ("stagger" === this._validateDisplayMode(drawingType) || "stagger" === this._validateOverlappingMode(labelOptions.overlappingBehavior, drawingType)) {
- height = 2 * height + labelOptions.staggeringSpacing
- }
- if ("rotate" === this._validateDisplayMode(drawingType) || "rotate" === this._validateOverlappingMode(labelOptions.overlappingBehavior, drawingType)) {
- var sinCos = _utils2.default.getCosAndSin(labelOptions.rotationAngle);
- height = height * sinCos.cos + bBox.width * sinCos.sin
- }
- return height && (height + labelOptions.indentFromAxis || 0) || 0
- },
- estimateMargins: function(canvas) {
- this.updateCanvas(canvas);
- var that = this;
- var range = that._getViewportRange();
- var ticksData = this._createTicksAndLabelFormat(range);
- var ticks = ticksData.ticks;
- var tickInterval = ticksData.tickInterval;
- var options = this._options;
- var constantLineOptions = that._outsideConstantLines.filter(function(l) {
- return l.labelOptions.visible
- }).map(function(l) {
- return l.options
- });
- var rootElement = that._renderer.root;
- var labelIsVisible = options.label.visible && !range.isEmpty() && ticks.length;
- var labelValue = labelIsVisible && that.formatLabel(ticks[ticks.length - 1], options.label, void 0, void 0, tickInterval, ticks);
- var labelElement = labelIsVisible && that._renderer.text(labelValue, 0, 0).css(that._textFontStyles).attr(that._textOptions).append(rootElement);
- var titleElement = that._drawTitleText(rootElement, {
- x: 0,
- y: 0
- });
- var constantLinesLabelsElement = that._drawConstantLinesForEstimating(constantLineOptions);
- var labelBox = labelElement && labelElement.getBBox() || {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- };
- var titleBox = titleElement && titleElement.getBBox() || {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- };
- var constantLinesBox = constantLinesLabelsElement.getBBox();
- var titleHeight = titleBox.height ? titleBox.height + options.title.margin : 0;
- var labelHeight = that._estimateLabelHeight(labelBox, options.label);
- var constantLinesHeight = constantLinesBox.height ? constantLinesBox.height + getMaxConstantLinePadding(constantLineOptions) : 0;
- var height = labelHeight + titleHeight;
- var margins = {
- left: _max(getLeftMargin(labelBox), getLeftMargin(constantLinesBox)),
- right: _max(getRightMargin(labelBox), getRightMargin(constantLinesBox)),
- top: ("top" === options.position ? height : 0) + getConstantLineLabelMarginForVerticalAlignment(constantLineOptions, "top", constantLinesHeight),
- bottom: ("top" !== options.position ? height : 0) + getConstantLineLabelMarginForVerticalAlignment(constantLineOptions, "bottom", constantLinesHeight)
- };
- labelElement && labelElement.remove();
- titleElement && titleElement.remove();
- constantLinesLabelsElement && constantLinesLabelsElement.remove();
- return margins
- },
- _checkAlignmentConstantLineLabels: function(labelOptions) {
- var position = labelOptions.position;
- var verticalAlignment = (labelOptions.verticalAlignment || "").toLowerCase();
- var horizontalAlignment = (labelOptions.horizontalAlignment || "").toLowerCase();
- if (this._isHorizontal) {
- if ("outside" === position) {
- verticalAlignment = verticalAlignment === BOTTOM ? BOTTOM : TOP;
- horizontalAlignment = CENTER
- } else {
- verticalAlignment = verticalAlignment === CENTER ? CENTER : verticalAlignment === BOTTOM ? BOTTOM : TOP;
- horizontalAlignment = horizontalAlignment === LEFT ? LEFT : RIGHT
- }
- } else {
- if ("outside" === position) {
- verticalAlignment = CENTER;
- horizontalAlignment = horizontalAlignment === LEFT ? LEFT : RIGHT
- } else {
- verticalAlignment = verticalAlignment === BOTTOM ? BOTTOM : TOP;
- horizontalAlignment = horizontalAlignment === RIGHT ? RIGHT : horizontalAlignment === CENTER ? CENTER : LEFT
- }
- }
- labelOptions.verticalAlignment = verticalAlignment;
- labelOptions.horizontalAlignment = horizontalAlignment
- },
- _getConstantLineLabelsCoords: function(value, lineLabelOptions) {
- var that = this;
- var x = value;
- var y = value;
- if (that._isHorizontal) {
- y = that._orthogonalPositions["top" === lineLabelOptions.verticalAlignment ? "start" : "end"]
- } else {
- x = that._orthogonalPositions["right" === lineLabelOptions.horizontalAlignment ? "end" : "start"]
- }
- return {
- x: x,
- y: y
- }
- },
- _getAdjustedStripLabelCoords: function(strip) {
- var stripOptions = strip.options;
- var paddingTopBottom = stripOptions.paddingTopBottom;
- var paddingLeftRight = stripOptions.paddingLeftRight;
- var horizontalAlignment = stripOptions.label.horizontalAlignment;
- var verticalAlignment = stripOptions.label.verticalAlignment;
- var box = strip.labelBBox;
- var labelHeight = box.height;
- var labelWidth = box.width;
- var labelCoords = strip.labelCoords;
- var y = labelCoords.y - box.y;
- var x = labelCoords.x - box.x;
- if (verticalAlignment === TOP) {
- y += paddingTopBottom
- } else {
- if (verticalAlignment === CENTER) {
- y -= labelHeight / 2
- } else {
- if (verticalAlignment === BOTTOM) {
- y -= paddingTopBottom + labelHeight
- }
- }
- }
- if (horizontalAlignment === LEFT) {
- x += paddingLeftRight
- } else {
- if (horizontalAlignment === CENTER) {
- x -= labelWidth / 2
- } else {
- if (horizontalAlignment === RIGHT) {
- x -= paddingLeftRight + labelWidth
- }
- }
- }
- return {
- translateX: x,
- translateY: y
- }
- },
- _adjustTitle: function(offset) {
- offset = offset || 0;
- if (!this._title) {
- return
- }
- var that = this;
- var options = that._options;
- var position = options.position;
- var margin = options.title.margin;
- var title = that._title;
- var boxTitle = title.bBox;
- var x = boxTitle.x;
- var y = boxTitle.y;
- var width = boxTitle.width;
- var height = boxTitle.height;
- var axisPosition = that._axisPosition;
- var loCoord = axisPosition - margin - offset;
- var hiCoord = axisPosition + margin + offset;
- var params = {};
- if (that._isHorizontal) {
- if (position === TOP) {
- params.translateY = loCoord - (y + height)
- } else {
- params.translateY = hiCoord - y
- }
- } else {
- if (position === LEFT) {
- params.translateX = loCoord - (x + width)
- } else {
- params.translateX = hiCoord - x
- }
- }
- title.element.attr(params)
- },
- _checkTitleOverflow: function(titleElement) {
- if (!this._title && !titleElement) {
- return
- }
- var canvasLength = this._getScreenDelta();
- var title = titleElement ? {
- bBox: titleElement.getBBox(),
- element: titleElement
- } : this._title;
- var titleOptions = this._options.title;
- var boxTitle = title.bBox;
- if ((this._isHorizontal ? boxTitle.width : boxTitle.height) > canvasLength) {
- title.element.setMaxSize(canvasLength, void 0, {
- wordWrap: titleOptions.wordWrap || "none",
- textOverflow: titleOptions.textOverflow || "ellipsis"
- });
- this._wrapped = titleOptions.wordWrap && "none" !== titleOptions.wordWrap
- } else {
- var moreThanOriginalSize = title.originalSize && canvasLength > (this._isHorizontal ? title.originalSize.width : title.originalSize.height);
- !this._wrapped && moreThanOriginalSize && title.element.restoreText()
- }
- },
- coordsIn: function(x, y) {
- var canvas = this.getCanvas();
- var isHorizontal = this._options.isHorizontal;
- var position = this._options.position;
- var coord = isHorizontal ? y : x;
- if (isHorizontal && (x < canvas.left || x > canvas.width - canvas.right) || !isHorizontal && (y < canvas.top || y > canvas.height - canvas.bottom)) {
- return false
- }
- if (isHorizontal && position === _axes_constants2.default.top || !isHorizontal && position === _axes_constants2.default.left) {
- return coord < canvas[position]
- }
- return coord > canvas[isHorizontal ? "height" : "width"] - canvas[position]
- },
- _boundaryTicksVisibility: {
- min: true,
- max: true
- },
- _setVisualRange: function(visualRange, allowPartialUpdate) {
- var range = this.adjustRange(_utils2.default.getVizRangeObject(visualRange));
- if (allowPartialUpdate) {
- (0, _type.isDefined)(range.startValue) && (this._viewport.startValue = range.startValue);
- (0, _type.isDefined)(range.endValue) && (this._viewport.endValue = range.endValue)
- } else {
- this._viewport = range
- }
- },
- applyVisualRangeSetter: function(visualRangeSetter) {
- this._visualRange = visualRangeSetter
- },
- adjust: function(alignToBounds) {
- var that = this;
- var seriesData = that._seriesData;
- var viewport = {
- min: seriesData.min,
- max: seriesData.max
- };
- if (!alignToBounds) {
- viewport = that._series.filter(function(s) {
- return s.isVisible()
- }).reduce(function(range, s) {
- var seriesRange = s.getViewport();
- range.min = (0, _type.isDefined)(seriesRange.min) ? range.min < seriesRange.min ? range.min : seriesRange.min : range.min;
- range.max = (0, _type.isDefined)(seriesRange.max) ? range.max > seriesRange.max ? range.max : seriesRange.max : range.max;
- if (s.showZero) {
- range = new _range2.default.Range(range);
- range.correctValueZeroLevel()
- }
- return range
- }, {})
- }
- if ((0, _type.isDefined)(viewport.min) && (0, _type.isDefined)(viewport.max)) {
- seriesData.minVisible = viewport.min;
- seriesData.maxVisible = viewport.max
- }
- that._translator.updateBusinessRange(that.adjustViewport(seriesData));
- that._breaks = that._getScaleBreaks(that._options, {
- minVisible: seriesData.minVisible,
- maxVisible: seriesData.maxVisible
- }, that._series, that.isArgumentAxis)
- },
- hasWrap: function() {
- return this._wrapped
- },
- getAxisPosition: function() {
- return this._axisPosition
- },
- _getStick: function() {
- return !this._options.valueMarginsEnabled
- },
- _getStripLabelCoords: function(from, to, stripLabelOptions) {
- var that = this;
- var orthogonalPositions = that._orthogonalPositions;
- var isHorizontal = that._isHorizontal;
- var horizontalAlignment = stripLabelOptions.horizontalAlignment;
- var verticalAlignment = stripLabelOptions.verticalAlignment;
- var x;
- var y;
- if (isHorizontal) {
- if (horizontalAlignment === CENTER) {
- x = from + (to - from) / 2
- } else {
- if (horizontalAlignment === LEFT) {
- x = from
- } else {
- if (horizontalAlignment === RIGHT) {
- x = to
- }
- }
- }
- y = orthogonalPositions[getStripVerticalAlignmentPosition(verticalAlignment)]
- } else {
- x = orthogonalPositions[getStripHorizontalAlignmentPosition(horizontalAlignment)];
- if (verticalAlignment === TOP) {
- y = from
- } else {
- if (verticalAlignment === CENTER) {
- y = to + (from - to) / 2
- } else {
- if (verticalAlignment === BOTTOM) {
- y = to
- }
- }
- }
- }
- return {
- x: x,
- y: y
- }
- },
- _getTranslatedValue: function(value, offset) {
- var pos1 = this._translator.translate(value, offset, "semidiscrete" === this._options.type && this._options.tickInterval);
- var pos2 = this._axisPosition;
- var isHorizontal = this._isHorizontal;
- return {
- x: isHorizontal ? pos1 : pos2,
- y: isHorizontal ? pos2 : pos1
- }
- },
- areCoordsOutsideAxis: function(coords) {
- var coord = this._isHorizontal ? coords.x : coords.y;
- var visibleArea = this.getVisibleArea();
- if (coord < visibleArea[0] || coord > visibleArea[1]) {
- return true
- }
- return false
- },
- _getSkippedCategory: function(ticks) {
- var skippedCategory;
- if (this._options.type === _axes_constants2.default.discrete && this._tickOffset && 0 !== ticks.length) {
- skippedCategory = ticks[ticks.length - 1]
- }
- return skippedCategory
- },
- _getScaleBreaks: function(axisOptions, viewport, series, isArgumentAxis) {
- var that = this;
- var breaks = (axisOptions.breaks || []).map(function(b) {
- return {
- from: that.parser(b.startValue),
- to: that.parser(b.endValue)
- }
- });
- if ("discrete" !== axisOptions.type && "datetime" === axisOptions.dataType && axisOptions.workdaysOnly) {
- breaks = breaks.concat((0, _datetime_breaks.generateDateBreaks)(viewport.minVisible, viewport.maxVisible, axisOptions.workWeek, axisOptions.singleWorkdays, axisOptions.holidays))
- }
- if (!isArgumentAxis && "discrete" !== axisOptions.type && "datetime" !== axisOptions.dataType && axisOptions.autoBreaksEnabled && 0 !== axisOptions.maxAutoBreakCount) {
- breaks = breaks.concat(generateAutoBreaks(axisOptions, series, viewport))
- }
- return filterBreaks(sortingBreaks(breaks), viewport, axisOptions.breakStyle)
- },
- _drawBreak: function(translatedEnd, positionFrom, positionTo, width, options, group) {
- var that = this;
- var breakStart = translatedEnd - (!that._translator.isInverted() ? width + 1 : 0);
- var attr = {
- "stroke-width": 1,
- stroke: options.borderColor,
- sharp: !options.isWaved ? options.isHorizontal ? "h" : "v" : void 0
- };
- var spaceAttr = {
- stroke: options.color,
- "stroke-width": width
- };
- var getPoints = that._isHorizontal ? rotateLine : function(p) {
- return p
- };
- var drawer = getLineDrawer(that._renderer, group, getPoints, positionFrom, breakStart, positionTo, options.isWaved);
- drawer(width / 2, spaceAttr);
- drawer(0, attr);
- drawer(width, attr)
- },
- _createBreakClipRect: function(from, to) {
- var that = this;
- var canvas = that._canvas;
- var clipWidth = to - from;
- var clipRect;
- if (that._isHorizontal) {
- clipRect = that._renderer.clipRect(canvas.left, from, canvas.width, clipWidth)
- } else {
- clipRect = that._renderer.clipRect(from, canvas.top, clipWidth, canvas.height)
- }
- that._breaksElements = that._breaksElements || [];
- that._breaksElements.push(clipRect);
- return clipRect.id
- },
- _createBreaksGroup: function(clipFrom, clipTo) {
- var that = this;
- var group = that._renderer.g().attr({
- "class": that._axisCssPrefix + "breaks",
- "clip-path": that._createBreakClipRect(clipFrom, clipTo)
- }).append(that._scaleBreaksGroup);
- that._breaksElements = that._breaksElements || [];
- that._breaksElements.push(group);
- return group
- },
- _disposeBreaksGroup: function() {
- (this._breaksElements || []).forEach(function(clipRect) {
- clipRect.dispose()
- });
- this._breaksElements = null
- },
- drawScaleBreaks: function(customCanvas) {
- var that = this;
- var options = that._options;
- var breakStyle = options.breakStyle;
- var position = options.position;
- var positionFrom;
- var positionTo;
- var breaks = that._translator.getBusinessRange().breaks || [];
- var additionGroup;
- var additionBreakFrom;
- var additionBreakTo;
- that._disposeBreaksGroup();
- if (!(breaks && breaks.length)) {
- return
- }
- var breakOptions = {
- color: that._options.containerColor,
- borderColor: breakStyle.color,
- isHorizontal: that._isHorizontal,
- isWaved: "straight" !== breakStyle.line.toLowerCase()
- };
- if (customCanvas) {
- positionFrom = customCanvas.start;
- positionTo = customCanvas.end
- } else {
- positionFrom = that._orthogonalPositions.start - (options.visible && !that._axisShift && ("left" === position || "top" === position) ? SCALE_BREAK_OFFSET : 0);
- positionTo = that._orthogonalPositions.end + (options.visible && ("right" === position || "bottom" === position) ? SCALE_BREAK_OFFSET : 0)
- }
- var mainGroup = that._createBreaksGroup(positionFrom, positionTo);
- if (that._axisShift && options.visible) {
- additionBreakFrom = that._axisPosition - that._axisShift - SCALE_BREAK_OFFSET;
- additionBreakTo = additionBreakFrom + 2 * SCALE_BREAK_OFFSET;
- additionGroup = that._createBreaksGroup(additionBreakFrom, additionBreakTo);
- }
- breaks.forEach(function(br) {
- if (!br.gapSize) {
- var breakCoord = that._getTranslatedCoord(br.to);
- that._drawBreak(breakCoord, positionFrom, positionTo, breakStyle.width, breakOptions, mainGroup);
- if (that._axisShift && options.visible) {
- that._drawBreak(breakCoord, additionBreakFrom, additionBreakTo, breakStyle.width, breakOptions, additionGroup)
- }
- }
- })
- },
- _getSpiderCategoryOption: _common.noop,
- shift: function(margins) {
- var that = this;
- var options = that._options;
- var isHorizontal = options.isHorizontal;
- var axesSpacing = that.getMultipleAxesSpacing();
- var constantLinesGroups = that._axisConstantLineGroups;
- function shiftGroup(side, group) {
- var attr = {
- translateX: 0,
- translateY: 0
- };
- var shift = margins[side] ? margins[side] + axesSpacing : 0;
- attr[isHorizontal ? "translateY" : "translateX"] = ("left" === side || "top" === side ? -1 : 1) * shift;
- (group[side] || group).attr(attr);
- return shift
- }
- that._axisShift = shiftGroup(options.position, that._axisGroup);
- (isHorizontal ? ["top", "bottom"] : ["left", "right"]).forEach(function(side) {
- shiftGroup(side, constantLinesGroups.above);
- shiftGroup(side, constantLinesGroups.under)
- })
- }
- }
- };
- function getLineDrawer(renderer, root, rotatePoints, positionFrom, breakStart, positionTo, isWaved) {
- var elementType = isWaved ? "bezier" : "line";
- var group = renderer.g().append(root);
- return function(offset, attr) {
- renderer.path(rotatePoints(getPoints(positionFrom, breakStart, positionTo, offset, isWaved)), elementType).attr(attr).append(group)
- }
- }
- function getPoints(positionFrom, breakStart, positionTo, offset, isWaved) {
- if (!isWaved) {
- return [positionFrom, breakStart + offset, positionTo, breakStart + offset]
- }
- breakStart += offset;
- var currentPosition;
- var topPoint = breakStart + WAVED_LINE_TOP;
- var centerPoint = breakStart + WAVED_LINE_CENTER;
- var bottomPoint = breakStart + WAVED_LINE_BOTTOM;
- var points = [
- [positionFrom, centerPoint]
- ];
- for (currentPosition = positionFrom; currentPosition < positionTo + WAVED_LINE_LENGTH; currentPosition += WAVED_LINE_LENGTH) {
- points.push([currentPosition + 6, topPoint, currentPosition + 6, topPoint, currentPosition + 12, centerPoint, currentPosition + 18, bottomPoint, currentPosition + 18, bottomPoint, currentPosition + 24, centerPoint])
- }
- return [].concat.apply([], points)
- }
- function rotateLine(lineCoords) {
- var points = [];
- var i;
- for (i = 0; i < lineCoords.length; i += 2) {
- points.push(lineCoords[i + 1]);
- points.push(lineCoords[i])
- }
- return points
- }
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/core/series_family.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isNumeric = __webpack_require__( /*! ../../core/utils/type */ 1).isNumeric;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var sign = __webpack_require__( /*! ../../core/utils/math */ 28).sign;
- var _math = Math;
- var _round = _math.round;
- var _abs = _math.abs;
- var _pow = _math.pow;
- var _each = each;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var vizUtils = __webpack_require__( /*! ./utils */ 10);
- var DEFAULT_BAR_GROUP_PADDING = .3;
- var _normalizeEnum = vizUtils.normalizeEnum;
- function validateBarPadding(barPadding) {
- return barPadding < 0 || barPadding > 1 ? void 0 : barPadding
- }
- function validateBarGroupPadding(barGroupPadding) {
- return barGroupPadding < 0 || barGroupPadding > 1 ? DEFAULT_BAR_GROUP_PADDING : barGroupPadding
- }
- function isStackExist(series, arg, equalBarWidth) {
- return series.some(function(s) {
- return equalBarWidth && !s.getOptions().ignoreEmptyPoints || s.getPointsByArg(arg, true).some(function(point) {
- return point.hasValue()
- })
- })
- }
- function correctStackCoordinates(series, currentStacks, arg, stack, parameters, barsArea, seriesStackIndexCallback) {
- series.forEach(function(series) {
- var stackIndex = seriesStackIndexCallback(currentStacks.indexOf(stack), currentStacks.length);
- var points = series.getPointsByArg(arg, true);
- var barPadding = validateBarPadding(series.getOptions().barPadding);
- var barWidth = series.getOptions().barWidth;
- var offset = getOffset(stackIndex, parameters);
- var width = parameters.width;
- if (stackIndex === -1) {
- return
- }
- if (isDefined(barPadding) || isDefined(barWidth)) {
- var extraParameters = calculateParams(barsArea, currentStacks.length, 1 - barPadding, barWidth);
- width = extraParameters.width;
- offset = getOffset(stackIndex, extraParameters)
- }
- correctPointCoordinates(points, width, offset)
- })
- }
- function adjustBarSeriesDimensionsCore(series, options, seriesStackIndexCallback) {
- var commonStacks = [];
- var allArguments = [];
- var seriesInStacks = {};
- var barWidth = options.barWidth;
- var barGroupWidth = options.barGroupWidth;
- var interval = series[0] && series[0].getArgumentAxis().getTranslator().getInterval();
- var barsArea = barGroupWidth ? interval > barGroupWidth ? barGroupWidth : interval : interval * (1 - validateBarGroupPadding(options.barGroupPadding));
- series.forEach(function(s, i) {
- var stackName = s.getStackName() || s.getBarOverlapGroup() || i.toString();
- var argument;
- for (argument in s.pointsByArgument) {
- if (allArguments.indexOf(argument.valueOf()) === -1) {
- allArguments.push(argument.valueOf())
- }
- }
- if (commonStacks.indexOf(stackName) === -1) {
- commonStacks.push(stackName);
- seriesInStacks[stackName] = []
- }
- seriesInStacks[stackName].push(s)
- });
- allArguments.forEach(function(arg) {
- var currentStacks = commonStacks.reduce(function(stacks, stack) {
- if (isStackExist(seriesInStacks[stack], arg, options.equalBarWidth)) {
- stacks.push(stack)
- }
- return stacks
- }, []);
- var parameters = calculateParams(barsArea, currentStacks.length, barWidth);
- commonStacks.forEach(function(stack) {
- correctStackCoordinates(seriesInStacks[stack], currentStacks, arg, stack, parameters, barsArea, seriesStackIndexCallback)
- })
- })
- }
- function calculateParams(barsArea, count, percentWidth, fixedBarWidth) {
- var spacing;
- var width;
- if (fixedBarWidth) {
- width = Math.min(fixedBarWidth, _round(barsArea / count));
- spacing = count > 1 ? _round((barsArea - width * count) / (count - 1)) : 0
- } else {
- if (isDefined(percentWidth)) {
- width = _round(barsArea * percentWidth / count);
- spacing = _round(count > 1 ? (barsArea - barsArea * percentWidth) / (count - 1) : 0)
- } else {
- spacing = _round(barsArea / count * .2);
- width = _round((barsArea - spacing * (count - 1)) / count)
- }
- }
- return {
- width: width > 1 ? width : 1,
- spacing: spacing,
- middleIndex: count / 2
- }
- }
- function getOffset(stackIndex, parameters) {
- return (stackIndex - parameters.middleIndex + .5) * parameters.width - (parameters.middleIndex - stackIndex - .5) * parameters.spacing
- }
- function correctPointCoordinates(points, width, offset) {
- _each(points, function(_, point) {
- point.correctCoordinates({
- width: width,
- offset: offset
- })
- })
- }
- function getValueType(value) {
- return value >= 0 ? "positive" : "negative"
- }
- function getVisibleSeries(that) {
- return that.series.filter(function(s) {
- return s.isVisible()
- })
- }
- function getAbsStackSumByArg(stackKeepers, stackName, argument) {
- var positiveStackValue = (stackKeepers.positive[stackName] || {})[argument] || 0;
- var negativeStackValue = -(stackKeepers.negative[stackName] || {})[argument] || 0;
- return positiveStackValue + negativeStackValue
- }
- function getStackSumByArg(stackKeepers, stackName, argument) {
- var positiveStackValue = (stackKeepers.positive[stackName] || {})[argument] || 0;
- var negativeStackValue = (stackKeepers.negative[stackName] || {})[argument] || 0;
- return positiveStackValue + negativeStackValue
- }
- function getSeriesStackIndexCallback(inverted) {
- if (!inverted) {
- return function(index) {
- return index
- }
- } else {
- return function(index, stackCount) {
- return stackCount - index - 1
- }
- }
- }
- function isInverted(series) {
- return series[0] && series[0].getArgumentAxis().getTranslator().isInverted()
- }
- function adjustBarSeriesDimensions() {
- var series = getVisibleSeries(this);
- adjustBarSeriesDimensionsCore(series, this._options, getSeriesStackIndexCallback(isInverted(series)))
- }
- function getFirstValueSign(series) {
- var points = series.getPoints();
- var value;
- for (var i = 0; i < points.length; i++) {
- var point = points[i];
- value = point.initialValue && point.initialValue.valueOf();
- if (Math.abs(value) > 0) {
- break
- }
- }
- return sign(value)
- }
- function adjustStackedSeriesValues() {
- var that = this;
- var negativesAsZeroes = that._options.negativesAsZeroes;
- var series = getVisibleSeries(that);
- var stackKeepers = {
- positive: {},
- negative: {}
- };
- var holesStack = {
- left: {},
- right: {}
- };
- var lastSeriesInPositiveStack = {};
- var lastSeriesInNegativeStack = {};
- series.forEach(function(singleSeries) {
- var stackName = singleSeries.getStackName() || singleSeries.getBarOverlapGroup();
- var hole = false;
- var stack = getFirstValueSign(singleSeries) < 0 ? lastSeriesInNegativeStack : lastSeriesInPositiveStack;
- singleSeries._prevSeries = stack[stackName];
- stack[stackName] = singleSeries;
- singleSeries.holes = extend(true, {}, holesStack);
- singleSeries.getPoints().forEach(function(point, index, points) {
- var value = point.initialValue && point.initialValue.valueOf();
- var argument = point.argument.valueOf();
- var stacks = value >= 0 ? stackKeepers.positive : stackKeepers.negative;
- var isNotBarSeries = "bar" !== singleSeries.type;
- if (negativesAsZeroes && value < 0) {
- stacks = stackKeepers.positive;
- value = 0;
- point.resetValue()
- }
- stacks[stackName] = stacks[stackName] || {};
- var currentStack = stacks[stackName];
- if (currentStack[argument]) {
- if (isNotBarSeries) {
- point.correctValue(currentStack[argument])
- }
- currentStack[argument] += value
- } else {
- currentStack[argument] = value;
- if (isNotBarSeries) {
- point.resetCorrection()
- }
- }
- if (!point.hasValue()) {
- var prevPoint = points[index - 1];
- if (!hole && prevPoint && prevPoint.hasValue()) {
- argument = prevPoint.argument.valueOf();
- prevPoint._skipSetRightHole = true;
- holesStack.right[argument] = (holesStack.right[argument] || 0) + (prevPoint.value.valueOf() - (isFinite(prevPoint.minValue) ? prevPoint.minValue.valueOf() : 0))
- }
- hole = true
- } else {
- if (hole) {
- hole = false;
- holesStack.left[argument] = (holesStack.left[argument] || 0) + (point.value.valueOf() - (isFinite(point.minValue) ? point.minValue.valueOf() : 0));
- point._skipSetLeftHole = true
- }
- }
- })
- });
- series.forEach(function(singleSeries) {
- var holes = singleSeries.holes;
- singleSeries.getPoints().forEach(function(point) {
- var argument = point.argument.valueOf();
- point.resetHoles();
- !point._skipSetLeftHole && point.setHole(holes.left[argument] || holesStack.left[argument] && 0, "left");
- !point._skipSetRightHole && point.setHole(holes.right[argument] || holesStack.right[argument] && 0, "right");
- point._skipSetLeftHole = null;
- point._skipSetRightHole = null
- })
- });
- that._stackKeepers = stackKeepers;
- series.forEach(function(singleSeries) {
- singleSeries.getPoints().forEach(function(point) {
- var argument = point.argument.valueOf();
- var stackName = singleSeries.getStackName() || singleSeries.getBarOverlapGroup();
- var absTotal = getAbsStackSumByArg(stackKeepers, stackName, argument);
- var total = getStackSumByArg(stackKeepers, stackName, argument);
- point.setPercentValue(absTotal, total, holesStack.left[argument], holesStack.right[argument])
- })
- })
- }
- function updateStackedSeriesValues() {
- var that = this;
- var series = getVisibleSeries(that);
- var stack = that._stackKeepers;
- var stackKeepers = {
- positive: {},
- negative: {}
- };
- _each(series, function(_, singleSeries) {
- var minBarSize = singleSeries.getOptions().minBarSize;
- var valueAxisTranslator = singleSeries.getValueAxis().getTranslator();
- var minShownBusinessValue = minBarSize && valueAxisTranslator.getMinBarSize(minBarSize);
- var stackName = singleSeries.getStackName();
- _each(singleSeries.getPoints(), function(index, point) {
- if (!point.hasValue()) {
- return
- }
- var value = point.initialValue && point.initialValue.valueOf();
- var argument = point.argument.valueOf();
- if (that.fullStacked) {
- value = value / getAbsStackSumByArg(stack, stackName, argument) || 0
- }
- var updateValue = valueAxisTranslator.checkMinBarSize(value, minShownBusinessValue, point.value);
- var valueType = getValueType(updateValue);
- var currentStack = stackKeepers[valueType][stackName] = stackKeepers[valueType][stackName] || {};
- if (currentStack[argument]) {
- point.minValue = currentStack[argument];
- currentStack[argument] += updateValue
- } else {
- currentStack[argument] = updateValue
- }
- point.value = currentStack[argument]
- })
- });
- if (that.fullStacked) {
- updateFullStackedSeriesValues(series, stackKeepers)
- }
- }
- function updateFullStackedSeriesValues(series, stackKeepers) {
- _each(series, function(_, singleSeries) {
- var stackName = singleSeries.getStackName ? singleSeries.getStackName() : "default";
- _each(singleSeries.getPoints(), function(index, point) {
- var stackSum = getAbsStackSumByArg(stackKeepers, stackName, point.argument.valueOf());
- point.value = point.value / stackSum;
- if (isNumeric(point.minValue)) {
- point.minValue = point.minValue / stackSum
- }
- })
- })
- }
- function updateBarSeriesValues() {
- _each(this.series, function(_, singleSeries) {
- var minBarSize = singleSeries.getOptions().minBarSize;
- var valueAxisTranslator = singleSeries.getValueAxis().getTranslator();
- var minShownBusinessValue = minBarSize && valueAxisTranslator.getMinBarSize(minBarSize);
- if (minShownBusinessValue) {
- _each(singleSeries.getPoints(), function(index, point) {
- if (point.hasValue()) {
- point.value = valueAxisTranslator.checkMinBarSize(point.initialValue, minShownBusinessValue)
- }
- })
- }
- })
- }
- function adjustCandlestickSeriesDimensions() {
- var series = getVisibleSeries(this);
- adjustBarSeriesDimensionsCore(series, {
- barWidth: null,
- equalBarWidth: true,
- barGroupPadding: .3
- }, getSeriesStackIndexCallback(isInverted(series)))
- }
- function adjustBubbleSeriesDimensions() {
- var series = getVisibleSeries(this);
- if (!series.length) {
- return
- }
- var options = this._options;
- var visibleAreaX = series[0].getArgumentAxis().getVisibleArea();
- var visibleAreaY = series[0].getValueAxis().getVisibleArea();
- var min = _math.min(visibleAreaX[1] - visibleAreaX[0], visibleAreaY[1] - visibleAreaY[0]);
- var minBubbleArea = _pow(options.minBubbleSize, 2);
- var maxBubbleArea = _pow(min * options.maxBubbleSize, 2);
- var equalBubbleSize = (min * options.maxBubbleSize + options.minBubbleSize) / 2;
- var minPointSize = 1 / 0;
- var maxPointSize = -(1 / 0);
- var pointSize;
- _each(series, function(_, seriesItem) {
- _each(seriesItem.getPoints(), function(_, point) {
- maxPointSize = maxPointSize > point.size ? maxPointSize : point.size;
- minPointSize = minPointSize < point.size ? minPointSize : point.size
- })
- });
- var sizeDispersion = maxPointSize - minPointSize;
- var areaDispersion = _abs(maxBubbleArea - minBubbleArea);
- _each(series, function(_, seriesItem) {
- _each(seriesItem.getPoints(), function(_, point) {
- if (maxPointSize === minPointSize) {
- pointSize = _round(equalBubbleSize)
- } else {
- var sizeProportion = _abs(point.size - minPointSize) / sizeDispersion;
- var bubbleArea = areaDispersion * sizeProportion + minBubbleArea;
- pointSize = _round(_math.sqrt(bubbleArea))
- }
- point.correctCoordinates(pointSize)
- })
- })
- }
- function SeriesFamily(options) {
- var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
- debug.assert(options.type, "type was not passed or empty");
- var that = this;
- that.type = _normalizeEnum(options.type);
- that.pane = options.pane;
- that.series = [];
- that.updateOptions(options);
- switch (that.type) {
- case "bar":
- that.adjustSeriesDimensions = adjustBarSeriesDimensions;
- that.updateSeriesValues = updateBarSeriesValues;
- that.adjustSeriesValues = adjustStackedSeriesValues;
- break;
- case "rangebar":
- that.adjustSeriesDimensions = adjustBarSeriesDimensions;
- break;
- case "fullstackedbar":
- that.fullStacked = true;
- that.adjustSeriesDimensions = adjustBarSeriesDimensions;
- that.adjustSeriesValues = adjustStackedSeriesValues;
- that.updateSeriesValues = updateStackedSeriesValues;
- break;
- case "stackedbar":
- that.adjustSeriesDimensions = adjustBarSeriesDimensions;
- that.adjustSeriesValues = adjustStackedSeriesValues;
- that.updateSeriesValues = updateStackedSeriesValues;
- break;
- case "fullstackedarea":
- case "fullstackedline":
- case "fullstackedspline":
- case "fullstackedsplinearea":
- that.fullStacked = true;
- that.adjustSeriesValues = adjustStackedSeriesValues;
- break;
- case "stackedarea":
- case "stackedsplinearea":
- case "stackedline":
- case "stackedspline":
- that.adjustSeriesValues = adjustStackedSeriesValues;
- break;
- case "candlestick":
- case "stock":
- that.adjustSeriesDimensions = adjustCandlestickSeriesDimensions;
- break;
- case "bubble":
- that.adjustSeriesDimensions = adjustBubbleSeriesDimensions
- }
- }
- exports.SeriesFamily = SeriesFamily;
- SeriesFamily.prototype = {
- constructor: SeriesFamily,
- adjustSeriesDimensions: _noop,
- adjustSeriesValues: _noop,
- updateSeriesValues: _noop,
- updateOptions: function(options) {
- this._options = options
- },
- dispose: function() {
- this.series = null
- },
- add: function(series) {
- var type = this.type;
- this.series = vizUtils.map(series, function(singleSeries) {
- return singleSeries.type === type ? singleSeries : null
- })
- }
- }
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/crosshair.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var math = Math;
- var mathAbs = math.abs;
- var mathMin = math.min;
- var mathMax = math.max;
- var mathFloor = math.floor;
- var HORIZONTAL = "horizontal";
- var VERTICAL = "vertical";
- var LABEL_BACKGROUND_PADDING_X = 8;
- var LABEL_BACKGROUND_PADDING_Y = 4;
- var CENTER = "center";
- var RIGHT = "right";
- var LEFT = "left";
- var TOP = "top";
- var BOTTOM = "bottom";
- exports.getMargins = function() {
- return {
- x: LABEL_BACKGROUND_PADDING_X,
- y: LABEL_BACKGROUND_PADDING_Y
- }
- };
- function getRectangleBBox(bBox) {
- return {
- x: bBox.x - LABEL_BACKGROUND_PADDING_X,
- y: bBox.y - LABEL_BACKGROUND_PADDING_Y,
- width: bBox.width + 2 * LABEL_BACKGROUND_PADDING_X,
- height: bBox.height + 2 * LABEL_BACKGROUND_PADDING_Y
- }
- }
- function getLabelCheckerPosition(x, y, isHorizontal, canvas) {
- var params = isHorizontal ? ["x", "width", "y", "height", y, 0] : ["y", "height", "x", "width", x, 1];
- return function(bBox, position, coord) {
- var labelCoord = {
- x: coord.x,
- y: coord.y
- };
- var rectangleBBox = getRectangleBBox(bBox);
- var delta = isHorizontal ? coord.y - bBox.y - bBox.height / 2 : coord.y - bBox.y;
- labelCoord.y = isHorizontal || !isHorizontal && position === BOTTOM ? coord.y + delta : coord.y;
- if (rectangleBBox[params[0]] < 0) {
- labelCoord[params[0]] -= rectangleBBox[params[0]]
- } else {
- if (rectangleBBox[params[0]] + rectangleBBox[params[1]] + delta * params[5] > canvas[params[1]]) {
- labelCoord[params[0]] -= rectangleBBox[params[0]] + rectangleBBox[params[1]] + delta * params[5] - canvas[params[1]]
- }
- }
- if (params[4] - rectangleBBox[params[3]] / 2 < 0) {
- labelCoord[params[2]] -= params[4] - rectangleBBox[params[3]] / 2
- } else {
- if (params[4] + rectangleBBox[params[3]] / 2 > canvas[params[3]]) {
- labelCoord[params[2]] -= params[4] + rectangleBBox[params[3]] / 2 - canvas[params[3]]
- }
- }
- return labelCoord
- }
- }
- function Crosshair(renderer, options, params, group) {
- var that = this;
- that._renderer = renderer;
- that._crosshairGroup = group;
- that._options = {};
- that.update(options, params)
- }
- Crosshair.prototype = {
- constructor: Crosshair,
- update: function(options, params) {
- var that = this;
- var canvas = params.canvas;
- that._canvas = {
- top: canvas.top,
- bottom: canvas.height - canvas.bottom,
- left: canvas.left,
- right: canvas.width - canvas.right,
- width: canvas.width,
- height: canvas.height
- };
- that._axes = params.axes;
- that._panes = params.panes;
- that._prepareOptions(options, HORIZONTAL);
- that._prepareOptions(options, VERTICAL)
- },
- dispose: function() {
- var that = this;
- that._renderer = that._crosshairGroup = that._options = that._axes = that._canvas = that._horizontalGroup = that._verticalGroup = that._horizontal = that._vertical = that._circle = that._panes = null
- },
- _prepareOptions: function(options, direction) {
- var lineOptions = options[direction + "Line"];
- this._options[direction] = {
- visible: lineOptions.visible,
- line: {
- stroke: lineOptions.color || options.color,
- "stroke-width": lineOptions.width || options.width,
- dashStyle: lineOptions.dashStyle || options.dashStyle,
- opacity: lineOptions.opacity || options.opacity,
- "stroke-linecap": "butt"
- },
- label: (0, _extend.extend)(true, {}, options.label, lineOptions.label)
- }
- },
- _createLines: function(options, sharpParam, group) {
- var lines = [];
- var canvas = this._canvas;
- var points = [canvas.left, canvas.top, canvas.left, canvas.top];
- for (var i = 0; i < 2; i++) {
- lines.push(this._renderer.path(points, "line").attr(options).sharp(sharpParam).append(group))
- }
- return lines
- },
- render: function() {
- var that = this;
- var renderer = that._renderer;
- var options = that._options;
- var verticalOptions = options.vertical;
- var horizontalOptions = options.horizontal;
- var extraOptions = horizontalOptions.visible ? horizontalOptions.line : verticalOptions.line;
- var circleOptions = {
- stroke: extraOptions.stroke,
- "stroke-width": extraOptions["stroke-width"],
- dashStyle: extraOptions.dashStyle,
- opacity: extraOptions.opacity
- };
- var canvas = that._canvas;
- that._horizontal = {};
- that._vertical = {};
- that._circle = renderer.circle(canvas.left, canvas.top, 0).attr(circleOptions).append(that._crosshairGroup);
- that._horizontalGroup = renderer.g().append(that._crosshairGroup);
- that._verticalGroup = renderer.g().append(that._crosshairGroup);
- if (verticalOptions.visible) {
- that._vertical.lines = that._createLines(verticalOptions.line, "h", that._verticalGroup);
- that._vertical.labels = that._createLabels(that._axes[0], verticalOptions, false, that._verticalGroup)
- }
- if (horizontalOptions.visible) {
- that._horizontal.lines = that._createLines(horizontalOptions.line, "v", that._horizontalGroup);
- that._horizontal.labels = that._createLabels(that._axes[1], horizontalOptions, true, that._horizontalGroup)
- }
- that.hide()
- },
- _createLabels: function(axes, options, isHorizontal, group) {
- var that = this;
- var canvas = that._canvas;
- var renderer = that._renderer;
- var x;
- var y;
- var text;
- var labels = [];
- var background;
- var currentLabelPos;
- var labelOptions = options.label;
- if (labelOptions.visible) {
- axes.forEach(function(axis) {
- var position = axis.getOptions().position;
- if (axis.getTranslator().getBusinessRange().isEmpty()) {
- return
- }
- currentLabelPos = axis.getLabelsPosition();
- if (isHorizontal) {
- y = canvas.top;
- x = currentLabelPos
- } else {
- x = canvas.left;
- y = currentLabelPos
- }
- var align = position === TOP || position === BOTTOM ? CENTER : position === RIGHT ? LEFT : RIGHT;
- background = renderer.rect(0, 0, 0, 0).attr({
- fill: labelOptions.backgroundColor || options.line.stroke
- }).append(group);
- text = renderer.text("0", 0, 0).css((0, _utils.patchFontOptions)(options.label.font)).attr({
- align: align,
- "class": labelOptions.cssClass
- }).append(group);
- labels.push({
- text: text,
- background: background,
- axis: axis,
- options: labelOptions,
- pos: {
- coord: currentLabelPos,
- side: position
- },
- startXY: {
- x: x,
- y: y
- }
- })
- })
- }
- return labels
- },
- _updateText: function(value, axisName, labels, point, func) {
- var that = this;
- labels.forEach(function(label) {
- var axis = label.axis;
- var coord = label.startXY;
- var textElement = label.text;
- var backgroundElement = label.background;
- var text = "";
- if (!axis.name || axis.name === axisName) {
- text = axis.getFormattedValue(value, label.options, point)
- }
- if (text) {
- textElement.attr({
- text: text,
- x: coord.x,
- y: coord.y
- });
- textElement.attr(func(textElement.getBBox(), label.pos.side, coord));
- that._updateLinesCanvas(label);
- backgroundElement.attr(getRectangleBBox(textElement.getBBox()))
- } else {
- textElement.attr({
- text: ""
- });
- backgroundElement.attr({
- x: 0,
- y: 0,
- width: 0,
- height: 0
- })
- }
- })
- },
- hide: function() {
- this._crosshairGroup.attr({
- visibility: "hidden"
- })
- },
- _updateLinesCanvas: function(label) {
- var position = label.pos.side;
- var labelCoord = label.pos.coord;
- var coords = this._linesCanvas;
- var canvas = this._canvas;
- coords[position] = coords[position] !== canvas[position] && mathAbs(coords[position] - canvas[position]) < mathAbs(labelCoord - canvas[position]) ? coords[position] : labelCoord
- },
- _updateLines: function(lines, x, y, r, isHorizontal) {
- var coords = this._linesCanvas;
- var canvas = this._canvas;
- var points = isHorizontal ? [
- [mathMin(x - r, coords.left), canvas.top, x - r, canvas.top],
- [x + r, canvas.top, mathMax(coords.right, x + r), canvas.top]
- ] : [
- [canvas.left, mathMin(coords.top, y - r), canvas.left, y - r],
- [canvas.left, y + r, canvas.left, mathMax(coords.bottom, y + r)]
- ];
- for (var i = 0; i < 2; i++) {
- lines[i].attr({
- points: points[i]
- }).sharp(isHorizontal ? "v" : "h", isHorizontal ? y === canvas.bottom ? -1 : 1 : x === canvas.right ? -1 : 1)
- }
- },
- _resetLinesCanvas: function() {
- var canvas = this._canvas;
- this._linesCanvas = {
- left: canvas.left,
- right: canvas.right,
- top: canvas.top,
- bottom: canvas.bottom
- }
- },
- _getClipRectForPane: function(x, y) {
- var panes = this._panes;
- var i;
- var coords;
- for (i = 0; i < panes.length; i++) {
- coords = panes[i].coords;
- if (coords.left <= x && coords.right >= x && coords.top <= y && coords.bottom >= y) {
- return panes[i].clipRect
- }
- }
- return {
- id: null
- }
- },
- show: function(data) {
- var that = this;
- var point = data.point;
- var pointData = point.getCrosshairData(data.x, data.y);
- var r = point.getPointRadius();
- var horizontal = that._horizontal;
- var vertical = that._vertical;
- var rad = !r ? 0 : r + 3;
- var canvas = that._canvas;
- var x = mathFloor(pointData.x);
- var y = mathFloor(pointData.y);
- if (x >= canvas.left && x <= canvas.right && y >= canvas.top && y <= canvas.bottom) {
- that._crosshairGroup.attr({
- visibility: "visible"
- });
- that._resetLinesCanvas();
- that._circle.attr({
- cx: x,
- cy: y,
- r: rad,
- "clip-path": that._getClipRectForPane(x, y).id
- });
- if (horizontal.lines) {
- that._updateText(pointData.yValue, pointData.axis, horizontal.labels, point, getLabelCheckerPosition(x, y, true, canvas));
- that._updateLines(horizontal.lines, x, y, rad, true);
- that._horizontalGroup.attr({
- translateY: y - canvas.top
- })
- }
- if (vertical.lines) {
- that._updateText(pointData.xValue, pointData.axis, vertical.labels, point, getLabelCheckerPosition(x, y, false, canvas));
- that._updateLines(vertical.lines, x, y, rad, false);
- that._verticalGroup.attr({
- translateX: x - canvas.left
- })
- }
- } else {
- that.hide()
- }
- }
- };
- exports.Crosshair = Crosshair
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/core/annotations.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.plugins = exports.__test_utils = exports.createAnnotations = void 0;
- var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _tooltip = __webpack_require__( /*! ../core/tooltip */ 107);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _utils = __webpack_require__( /*! ./utils */ 10);
- var _plaque = __webpack_require__( /*! ./plaque */ 403);
- var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
- var _pointer2 = _interopRequireDefault(_pointer);
- var _drag = __webpack_require__( /*! ../../events/drag */ 56);
- var _drag2 = _interopRequireDefault(_drag);
- var _utils2 = __webpack_require__( /*! ../../events/utils */ 8);
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var EVENT_NS = "annotations";
- var DOT_EVENT_NS = "." + EVENT_NS;
- var POINTER_ACTION = (0, _utils2.addNamespace)([_pointer2.default.down, _pointer2.default.move], EVENT_NS);
- var POINTER_UP_EVENT_NAME = (0, _utils2.addNamespace)(_pointer2.default.up, EVENT_NS);
- var DRAG_START_EVENT_NAME = _drag2.default.start + DOT_EVENT_NS;
- var DRAG_EVENT_NAME = _drag2.default.move + DOT_EVENT_NS;
- var DRAG_END_EVENT_NAME = _drag2.default.end + DOT_EVENT_NS;
- function coreAnnotation(options, _draw) {
- return {
- type: options.type,
- name: options.name,
- x: options.x,
- y: options.y,
- value: options.value,
- argument: options.argument,
- axis: options.axis,
- series: options.series,
- options: options,
- offsetX: options.offsetX,
- offsetY: options.offsetY,
- draw: function(widget, group) {
- var _this = this;
- var annotationGroup = widget._renderer.g().append(group);
- this.plaque = new _plaque.Plaque(options, widget, annotationGroup, _draw.bind(this), (0, _type.isDefined)(options.value) || (0, _type.isDefined)(options.argument));
- this.plaque.draw(widget._getAnnotationCoords(this));
- if (options.allowDragging) {
- annotationGroup.on(DRAG_START_EVENT_NAME, {
- immediate: true
- }, function(e) {
- _this._dragOffsetX = _this.plaque.x - e.pageX;
- _this._dragOffsetY = _this.plaque.y - e.pageY
- }).on(DRAG_EVENT_NAME, function(e) {
- _this.plaque.move(e.pageX + _this._dragOffsetX, e.pageY + _this._dragOffsetY)
- }).on(DRAG_END_EVENT_NAME, function(e) {
- _this.offsetX = (_this.offsetX || 0) + e.offset.x;
- _this.offsetY = (_this.offsetY || 0) + e.offset.y
- })
- }
- },
- hitTest: function(x, y) {
- return this.plaque.hitTest(x, y)
- },
- showTooltip: function(tooltip, _ref) {
- var x = _ref.x,
- y = _ref.y;
- if (tooltip.annotation !== this) {
- if (tooltip.show(this.options, {
- x: x,
- y: y
- }, {
- target: this.options
- }, this.options.customizeTooltip)) {
- tooltip.annotation = this
- }
- } else {
- tooltip.move(x, y)
- }
- }
- }
- }
- function labelAnnotation(options) {
- return coreAnnotation(options, function(widget, group, _ref2) {
- var width = _ref2.width,
- height = _ref2.height;
- var text = widget._renderer.text(options.text).css((0, _utils.patchFontOptions)(options.font)).attr({
- "class": options.cssClass
- }).append(group);
- if ((0, _type.isDefined)(width) || (0, _type.isDefined)(height)) {
- text.setMaxSize(width, height, {
- wordWrap: options.wordWrap,
- textOverflow: options.textOverflow
- })
- }
- })
- }
- function imageAnnotation(options) {
- var _ref3 = options.image || {},
- width = _ref3.width,
- height = _ref3.height,
- url = _ref3.url,
- location = _ref3.location;
- return coreAnnotation(options, function(widget, group, _ref4) {
- var outerWidth = _ref4.width,
- outerHeight = _ref4.height;
- var imageWidth = outerWidth > 0 ? Math.min(width, outerWidth) : width;
- var imageHeight = outerHeight > 0 ? Math.min(height, outerHeight) : height;
- widget._renderer.image(0, 0, imageWidth, imageHeight, url, location || "center").append(group)
- })
- }
- function createAnnotation(item, commonOptions, customizeAnnotation) {
- var options = (0, _extend.extend)(true, {}, commonOptions, item);
- if (customizeAnnotation && customizeAnnotation.call) {
- options = (0, _extend.extend)(true, options, customizeAnnotation(item))
- }
- if ("image" === options.type) {
- return imageAnnotation(options)
- } else {
- if ("text" === options.type) {
- return labelAnnotation(options)
- }
- }
- }
- var createAnnotations = exports.createAnnotations = function(items) {
- var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
- var customizeAnnotation = arguments.length > 2 ? arguments[2] : void 0;
- return items.reduce(function(arr, item) {
- var annotation = createAnnotation(item, options, customizeAnnotation);
- annotation && arr.push(annotation);
- return arr
- }, [])
- };
- exports.__test_utils = {
- stub_createAnnotations: function(stub) {
- this.old_createAnnotations = createAnnotations;
- exports.createAnnotations = createAnnotations = stub
- },
- restore_createAnnotations: function() {
- exports.createAnnotations = createAnnotations = this.old_createAnnotations
- }
- };
- var chartPlugin = {
- name: "annotations_chart",
- init: function() {},
- dispose: function() {},
- members: {
- _getAnnotationCoords: function(annotation) {
- var coords = {
- offsetX: annotation.offsetX,
- offsetY: annotation.offsetY
- };
- var argCoordName = this._options.rotated ? "y" : "x";
- var valCoordName = this._options.rotated ? "x" : "y";
- var argAxis = this.getArgumentAxis();
- var argument = argAxis.validateUnit(annotation.argument);
- var axis = this.getValueAxis(annotation.axis);
- var series;
- var pane = (0, _type.isDefined)(axis) ? axis.pane : void 0;
- if (annotation.series) {
- series = this.series.filter(function(s) {
- return s.name === annotation.series
- })[0];
- axis = series && series.getValueAxis();
- (0, _type.isDefined)(axis) && (pane = axis.pane)
- }
- if ((0, _type.isDefined)(argument)) {
- if (series) {
- var center = series.getPointCenterByArg(argument);
- center && (coords[argCoordName] = center[argCoordName])
- } else {
- coords[argCoordName] = argAxis.getTranslator().translate(argument)
- }!(0, _type.isDefined)(pane) && (pane = argAxis.pane)
- }
- var value = axis && axis.validateUnit(annotation.value);
- if ((0, _type.isDefined)(value)) {
- coords[valCoordName] = axis && axis.getTranslator().translate(value);
- !(0, _type.isDefined)(pane) && (0, _type.isDefined)(axis) && (pane = axis.pane)
- }
- coords.canvas = this._getCanvasForPane(pane);
- if ((0, _type.isDefined)(coords[argCoordName]) && !(0, _type.isDefined)(value)) {
- if (!(0, _type.isDefined)(axis) && !(0, _type.isDefined)(series)) {
- coords[valCoordName] = argAxis.getAxisPosition()
- } else {
- if ((0, _type.isDefined)(axis) && !(0, _type.isDefined)(series)) {
- coords[valCoordName] = this._argumentAxes.filter(function(a) {
- return a.pane === axis.pane
- })[0].getAxisPosition()
- } else {
- if ((0, _type.isDefined)(series) && series.checkSeriesViewportCoord(argAxis, coords[argCoordName])) {
- coords[valCoordName] = series.getSeriesPairCoord(coords[argCoordName], true)
- }
- }
- }
- }
- if (!(0, _type.isDefined)(argument) && (0, _type.isDefined)(coords[valCoordName])) {
- if ((0, _type.isDefined)(axis) && !(0, _type.isDefined)(series)) {
- coords[argCoordName] = axis.getAxisPosition()
- } else {
- if ((0, _type.isDefined)(series)) {
- if (series.checkSeriesViewportCoord(axis, coords[valCoordName])) {
- coords[argCoordName] = series.getSeriesPairCoord(coords[valCoordName], false)
- }
- }
- }
- }
- return coords
- },
- _annotationsPointerEventHandler: function(event) {
- var originalEvent = event.originalEvent || {};
- var touch = originalEvent.touches && originalEvent.touches[0] || {};
- var rootOffset = this._renderer.getRootOffset();
- var coords = {
- x: touch.pageX || originalEvent.pageX || event.pageX,
- y: touch.pageY || originalEvent.pageY || event.pageY
- };
- var annotation = this._annotations.items.filter(function(a) {
- return a.hitTest(coords.x - rootOffset.left, coords.y - rootOffset.top)
- })[0];
- if (!annotation || !annotation.options.tooltipEnabled) {
- this._annotations.hideTooltip();
- return
- }
- this.hideTooltip();
- this.clearHover();
- if (annotation.options.allowDragging && event.type === _pointer2.default.down) {
- this._annotations._hideToolTipForDrag = true
- }
- if (!this._annotations._hideToolTipForDrag) {
- annotation.showTooltip(this._annotations.tooltip, coords);
- event.stopPropagation()
- }
- }
- }
- };
- var corePlugin = {
- name: "annotations_core",
- init: function() {
- this._annotations = {
- items: [],
- _hideToolTipForDrag: false,
- tooltip: new _tooltip.Tooltip({
- cssClass: "".concat(this._rootClassPrefix, "-annotation-tooltip"),
- eventTrigger: this._eventTrigger,
- widgetRoot: this.element()
- }),
- hideTooltip: function() {
- this.tooltip.annotation = null;
- this.tooltip.hide()
- }
- };
- this._annotations.tooltip.setRendererOptions(this._getRendererOptions());
- var tooltipOptions = (0, _extend.extend)({}, this._themeManager.getOptions("tooltip"));
- tooltipOptions.customizeTooltip = void 0;
- this._annotations.tooltip.update(tooltipOptions)
- },
- dispose: function() {
- this._annotationsGroup.linkRemove().linkOff();
- _events_engine2.default.off((0, _dom_adapter.getDocument)(), DOT_EVENT_NS);
- this._annotationsGroup.off(DOT_EVENT_NS);
- this._annotations.tooltip && this._annotations.tooltip.dispose()
- },
- extenders: {
- _createHtmlStructure: function() {
- var _this2 = this;
- this._annotationsGroup = this._renderer.g().attr({
- "class": "".concat(this._rootClassPrefix, "-annotations")
- }).linkOn(this._renderer.root, "annotations").linkAppend();
- _events_engine2.default.on((0, _dom_adapter.getDocument)(), POINTER_ACTION, function() {
- return _this2._annotations.hideTooltip()
- });
- _events_engine2.default.on((0, _dom_adapter.getDocument)(), POINTER_UP_EVENT_NAME, function(event) {
- _this2._annotations._hideToolTipForDrag = false;
- _this2._annotationsPointerEventHandler(event)
- });
- this._annotationsGroup.on(POINTER_ACTION, this._annotationsPointerEventHandler.bind(this))
- },
- _renderExtraElements: function() {
- var _this3 = this;
- this._annotationsGroup.clear();
- this._annotations.items.forEach(function(item) {
- return item.draw(_this3, _this3._annotationsGroup)
- })
- },
- _stopCurrentHandling: function() {
- this._annotations.hideTooltip()
- }
- },
- members: {
- _buildAnnotations: function() {
- this._annotations.items = [];
- var items = this._getOption("annotations");
- if (!items || !items.length) {
- return
- }
- this._annotations.items = createAnnotations(items, this._getOption("commonAnnotationSettings"), this._getOption("customizeAnnotation"))
- },
- _getAnnotationCoords: function() {
- return {}
- }
- },
- customize: function(constructor) {
- constructor.addChange({
- code: "ANNOTATIONITEMS",
- handler: function() {
- this._requestChange(["ANNOTATIONS"])
- },
- isOptionChange: true,
- option: "annotations"
- });
- constructor.addChange({
- code: "ANNOTATIONSSETTINGS",
- handler: function() {
- this._requestChange(["ANNOTATIONS"])
- },
- isOptionChange: true,
- option: "commonAnnotationSettings"
- });
- constructor.addChange({
- code: "ANNOTATIONS",
- handler: function() {
- this._buildAnnotations();
- this._change(["FORCE_RENDER"])
- },
- isThemeDependent: true,
- isOptionChange: true
- })
- },
- fontFields: ["commonAnnotationSettings.font"]
- };
- exports.plugins = {
- core: corePlugin,
- chart: chartPlugin
- }
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/translators/translator1d.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _Number = Number;
- function Translator1D() {
- this.setDomain(arguments[0], arguments[1]).setCodomain(arguments[2], arguments[3])
- }
- Translator1D.prototype = {
- constructor: Translator1D,
- setDomain: function(domain1, domain2) {
- var that = this;
- that._domain1 = _Number(domain1);
- that._domain2 = _Number(domain2);
- that._domainDelta = that._domain2 - that._domain1;
- return that
- },
- setCodomain: function(codomain1, codomain2) {
- var that = this;
- that._codomain1 = _Number(codomain1);
- that._codomain2 = _Number(codomain2);
- that._codomainDelta = that._codomain2 - that._codomain1;
- return that
- },
- getDomain: function() {
- return [this._domain1, this._domain2]
- },
- getCodomain: function() {
- return [this._codomain1, this._codomain2]
- },
- getDomainStart: function() {
- return this._domain1
- },
- getDomainEnd: function() {
- return this._domain2
- },
- getCodomainStart: function() {
- return this._codomain1
- },
- getCodomainEnd: function() {
- return this._codomain2
- },
- getDomainRange: function() {
- return this._domainDelta
- },
- getCodomainRange: function() {
- return this._codomainDelta
- },
- translate: function(value) {
- var ratio = (_Number(value) - this._domain1) / this._domainDelta;
- return 0 <= ratio && ratio <= 1 ? this._codomain1 + ratio * this._codomainDelta : NaN
- },
- adjust: function(value) {
- var ratio = (_Number(value) - this._domain1) / this._domainDelta;
- var result = NaN;
- if (ratio < 0) {
- result = this._domain1
- } else {
- if (ratio > 1) {
- result = this._domain2
- } else {
- if (0 <= ratio && ratio <= 1) {
- result = _Number(value)
- }
- }
- }
- return result
- }
- };
- exports.Translator1D = Translator1D
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/base_range_container.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var iterateUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var BaseElement = __webpack_require__( /*! ./base_indicators */ 250).BaseElement;
- var _Number = Number;
- var _abs = Math.abs;
- var _isString = __webpack_require__( /*! ../../core/utils/type */ 1).isString;
- var _isArray = Array.isArray;
- var _isFinite = isFinite;
- var _each = iterateUtils.each;
- var BaseRangeContainer = BaseElement.inherit({
- _init: function() {
- this._root = this._renderer.g().attr({
- "class": "dxg-range-container"
- }).linkOn(this._container, "range-container")
- },
- _dispose: function() {
- this._root.linkOff()
- },
- clean: function() {
- this._root.linkRemove().clear();
- this._options = this.enabled = null;
- return this
- },
- _getRanges: function() {
- var that = this;
- var options = that._options;
- var translator = that._translator;
- var totalStart = translator.getDomain()[0];
- var totalEnd = translator.getDomain()[1];
- var totalDelta = totalEnd - totalStart;
- var isNotEmptySegment = totalDelta >= 0 ? isNotEmptySegmentAsc : isNotEmptySegmentDesc;
- var subtractSegment = totalDelta >= 0 ? subtractSegmentAsc : subtractSegmentDesc;
- var list = [];
- var ranges = [];
- var backgroundRanges = [{
- start: totalStart,
- end: totalEnd
- }];
- var threshold = _abs(totalDelta) / 1e4;
- var backgroundColor = _isString(options.backgroundColor) ? options.backgroundColor : "none";
- var width = options.width || {};
- var startWidth = _Number(width > 0 ? width : width.start);
- var endWidth = _Number(width > 0 ? width : width.end);
- var deltaWidth = endWidth - startWidth;
- if (void 0 !== options.ranges && !_isArray(options.ranges)) {
- return null
- }
- if (!(startWidth >= 0 && endWidth >= 0 && startWidth + endWidth > 0)) {
- return null
- }
- list = (_isArray(options.ranges) ? options.ranges : []).reduce(function(result, rangeOptions, i) {
- rangeOptions = rangeOptions || {};
- var start = translator.adjust(rangeOptions.startValue);
- var end = translator.adjust(rangeOptions.endValue);
- if (_isFinite(start) && _isFinite(end) && isNotEmptySegment(start, end, threshold)) {
- result.push({
- start: start,
- end: end,
- color: rangeOptions.color,
- classIndex: i
- })
- }
- return result
- }, []);
- var palette = that._themeManager.createPalette(options.palette, {
- type: "indicatingSet",
- extensionMode: options.paletteExtensionMode,
- keepLastColorInEnd: true,
- count: list.length
- });
- _each(list, function(_, item) {
- var paletteColor = palette.getNextColor();
- item.color = _isString(item.color) && item.color || paletteColor || "none";
- item.className = "dxg-range dxg-range-" + item.classIndex;
- delete item.classIndex
- });
- _each(list, function(_, item) {
- var i;
- var ii;
- var sub;
- var subs;
- var range;
- var newRanges = [];
- var newBackgroundRanges = [];
- for (i = 0, ii = ranges.length; i < ii; ++i) {
- range = ranges[i];
- subs = subtractSegment(range.start, range.end, item.start, item.end);
- (sub = subs[0]) && (sub.color = range.color) && (sub.className = range.className) && newRanges.push(sub);
- (sub = subs[1]) && (sub.color = range.color) && (sub.className = range.className) && newRanges.push(sub)
- }
- newRanges.push(item);
- ranges = newRanges;
- for (i = 0, ii = backgroundRanges.length; i < ii; ++i) {
- range = backgroundRanges[i];
- subs = subtractSegment(range.start, range.end, item.start, item.end);
- (sub = subs[0]) && newBackgroundRanges.push(sub);
- (sub = subs[1]) && newBackgroundRanges.push(sub)
- }
- backgroundRanges = newBackgroundRanges
- });
- _each(backgroundRanges, function(_, range) {
- range.color = backgroundColor;
- range.className = "dxg-range dxg-background-range";
- ranges.push(range)
- });
- _each(ranges, function(_, range) {
- range.startWidth = (range.start - totalStart) / totalDelta * deltaWidth + startWidth;
- range.endWidth = (range.end - totalStart) / totalDelta * deltaWidth + startWidth
- });
- return ranges
- },
- render: function(options) {
- var that = this;
- that._options = options;
- that._processOptions();
- that._ranges = that._getRanges();
- if (that._ranges) {
- that.enabled = true;
- that._root.linkAppend()
- }
- return that
- },
- resize: function(layout) {
- var that = this;
- that._root.clear();
- if (that._isVisible(layout)) {
- _each(that._ranges, function(_, range) {
- that._createRange(range, layout).attr({
- fill: range.color,
- "class": range.className
- }).append(that._root)
- })
- }
- return that
- },
- _processOptions: null,
- _isVisible: null,
- _createRange: null,
- getColorForValue: function(value) {
- var color = null;
- _each(this._ranges, function(_, range) {
- if (range.start <= value && value <= range.end || range.start >= value && value >= range.end) {
- color = range.color;
- return false
- }
- });
- return color
- }
- });
- function subtractSegmentAsc(segmentStart, segmentEnd, otherStart, otherEnd) {
- var result;
- if (otherStart > segmentStart && otherEnd < segmentEnd) {
- result = [{
- start: segmentStart,
- end: otherStart
- }, {
- start: otherEnd,
- end: segmentEnd
- }]
- } else {
- if (otherStart >= segmentEnd || otherEnd <= segmentStart) {
- result = [{
- start: segmentStart,
- end: segmentEnd
- }]
- } else {
- if (otherStart <= segmentStart && otherEnd >= segmentEnd) {
- result = []
- } else {
- if (otherStart > segmentStart) {
- result = [{
- start: segmentStart,
- end: otherStart
- }]
- } else {
- if (otherEnd < segmentEnd) {
- result = [{
- start: otherEnd,
- end: segmentEnd
- }]
- }
- }
- }
- }
- }
- return result
- }
- function subtractSegmentDesc(segmentStart, segmentEnd, otherStart, otherEnd) {
- var result;
- if (otherStart < segmentStart && otherEnd > segmentEnd) {
- result = [{
- start: segmentStart,
- end: otherStart
- }, {
- start: otherEnd,
- end: segmentEnd
- }]
- } else {
- if (otherStart <= segmentEnd || otherEnd >= segmentStart) {
- result = [{
- start: segmentStart,
- end: segmentEnd
- }]
- } else {
- if (otherStart >= segmentStart && otherEnd <= segmentEnd) {
- result = []
- } else {
- if (otherStart < segmentStart) {
- result = [{
- start: segmentStart,
- end: otherStart
- }]
- } else {
- if (otherEnd > segmentEnd) {
- result = [{
- start: otherEnd,
- end: segmentEnd
- }]
- }
- }
- }
- }
- }
- return result
- }
- function isNotEmptySegmentAsc(start, end, threshold) {
- return end - start >= threshold
- }
- function isNotEmptySegmentDesc(start, end, threshold) {
- return start - end >= threshold
- }
- module.exports = BaseRangeContainer
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/circular_gauge.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _isFinite = isFinite;
- var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
- var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var dxBaseGauge = __webpack_require__( /*! ./base_gauge */ 145).dxBaseGauge;
- var dxGauge = __webpack_require__( /*! ./common */ 205).dxGauge;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _normalizeAngle = vizUtils.normalizeAngle;
- var _getCosAndSin = vizUtils.getCosAndSin;
- var circularIndicatorsModule = __webpack_require__( /*! ./circular_indicators */ 799);
- var createIndicatorCreator = __webpack_require__( /*! ./common */ 205).createIndicatorCreator;
- var CircularRangeContainer = __webpack_require__( /*! ./circular_range_container */ 800);
- var _abs = Math.abs;
- var _max = Math.max;
- var _min = Math.min;
- var _round = Math.round;
- var _each = each;
- var PI = Math.PI;
- function getSides(startAngle, endAngle) {
- var startCosSin = _getCosAndSin(startAngle);
- var endCosSin = _getCosAndSin(endAngle);
- var startCos = startCosSin.cos;
- var startSin = startCosSin.sin;
- var endCos = endCosSin.cos;
- var endSin = endCosSin.sin;
- return {
- left: startSin <= 0 && endSin >= 0 || startSin <= 0 && endSin <= 0 && startCos <= endCos || startSin >= 0 && endSin >= 0 && startCos >= endCos ? -1 : _min(startCos, endCos, 0),
- right: startSin >= 0 && endSin <= 0 || startSin >= 0 && endSin >= 0 && startCos >= endCos || startSin <= 0 && endSin <= 0 && startCos <= endCos ? 1 : _max(startCos, endCos, 0),
- up: startCos <= 0 && endCos >= 0 || startCos <= 0 && endCos <= 0 && startSin >= endSin || startCos >= 0 && endCos >= 0 && startSin <= endSin ? -1 : -_max(startSin, endSin, 0),
- down: startCos >= 0 && endCos <= 0 || startCos >= 0 && endCos >= 0 && startSin <= endSin || startCos <= 0 && endCos <= 0 && startSin >= endSin ? 1 : -_min(startSin, endSin, 0)
- }
- }
- var dxCircularGauge = dxGauge.inherit({
- _rootClass: "dxg-circular-gauge",
- _factoryMethods: {
- rangeContainer: "createCircularRangeContainer",
- indicator: "createCircularIndicator"
- },
- _gridSpacingFactor: 17,
- _scaleTypes: {
- type: "polarAxes",
- drawingType: "circular"
- },
- _getThemeManagerOptions: function() {
- var options = this.callBase.apply(this, arguments);
- options.subTheme = "_circular";
- return options
- },
- _updateScaleTickIndent: function(scaleOptions) {
- var indentFromTick = scaleOptions.label.indentFromTick;
- var length = scaleOptions.tick.visible ? scaleOptions.tick.length : 0;
- var textParams = this._scale.measureLabels(extend({}, this._canvas));
- var tickCorrection = length;
- if ("inside" === scaleOptions.orientation) {
- tickCorrection = 0
- } else {
- if ("center" === scaleOptions.orientation) {
- tickCorrection = .5 * length
- }
- }
- scaleOptions.label.indentFromAxis = indentFromTick >= 0 ? indentFromTick + tickCorrection : indentFromTick - tickCorrection - _max(textParams.width, textParams.height);
- this._scale.updateOptions(scaleOptions)
- },
- _setupCodomain: function() {
- var that = this;
- var geometry = that.option("geometry") || {};
- var startAngle = geometry.startAngle;
- var endAngle = geometry.endAngle;
- var sides;
- startAngle = _isFinite(startAngle) ? _normalizeAngle(startAngle) : 225;
- endAngle = _isFinite(endAngle) ? _normalizeAngle(endAngle) : -45;
- if (_abs(startAngle - endAngle) < 1) {
- endAngle -= 360;
- sides = {
- left: -1,
- up: -1,
- right: 1,
- down: 1
- }
- } else {
- startAngle < endAngle && (endAngle -= 360);
- sides = getSides(startAngle, endAngle)
- }
- that._area = {
- x: 0,
- y: 0,
- radius: 100,
- startCoord: startAngle,
- endCoord: endAngle,
- sides: sides
- };
- that._translator.setCodomain(startAngle, endAngle)
- },
- _shiftScale: function(layout) {
- var scale = this._scale;
- var canvas = scale.getCanvas();
- canvas.width = canvas.height = 2 * layout.radius;
- scale.draw(canvas);
- var centerCoords = scale.getCenter();
- scale.shift({
- right: layout.x - centerCoords.x,
- bottom: layout.y - centerCoords.y
- })
- },
- _getScaleLayoutValue: function() {
- return this._area.radius
- },
- _getTicksOrientation: function(scaleOptions) {
- return scaleOptions.orientation
- },
- _getTicksCoefficients: function(options) {
- var coefs = {
- inner: 0,
- outer: 1
- };
- if ("inside" === options.orientation) {
- coefs.inner = 1;
- coefs.outer = 0
- } else {
- if ("center" === options.orientation) {
- coefs.inner = coefs.outer = .5
- }
- }
- return coefs
- },
- _correctScaleIndents: function(result, indentFromTick, textParams) {
- if (indentFromTick >= 0) {
- result.horizontalOffset = indentFromTick + textParams.width;
- result.verticalOffset = indentFromTick + textParams.height
- } else {
- result.horizontalOffset = result.verticalOffset = 0;
- result.min -= -indentFromTick + _max(textParams.width, textParams.height)
- }
- result.inverseHorizontalOffset = textParams.width / 2;
- result.inverseVerticalOffset = textParams.height / 2
- },
- _measureMainElements: function(elements, scaleMeasurement) {
- var that = this;
- var radius = that._area.radius;
- var maxRadius = 0;
- var minRadius = 1 / 0;
- var maxHorizontalOffset = 0;
- var maxVerticalOffset = 0;
- var maxInverseHorizontalOffset = 0;
- var maxInverseVerticalOffset = 0;
- var scale = that._scale;
- _each(elements.concat(scale), function(_, element) {
- var bounds = element.measure ? element.measure({
- radius: radius - element.getOffset()
- }) : scaleMeasurement;
- bounds.min > 0 && (minRadius = _min(minRadius, bounds.min));
- bounds.max > 0 && (maxRadius = _max(maxRadius, bounds.max));
- bounds.horizontalOffset > 0 && (maxHorizontalOffset = _max(maxHorizontalOffset, bounds.max + bounds.horizontalOffset));
- bounds.verticalOffset > 0 && (maxVerticalOffset = _max(maxVerticalOffset, bounds.max + bounds.verticalOffset));
- bounds.inverseHorizontalOffset > 0 && (maxInverseHorizontalOffset = _max(maxInverseHorizontalOffset, bounds.inverseHorizontalOffset));
- bounds.inverseVerticalOffset > 0 && (maxInverseVerticalOffset = _max(maxInverseVerticalOffset, bounds.inverseVerticalOffset))
- });
- maxHorizontalOffset = _max(maxHorizontalOffset - maxRadius, 0);
- maxVerticalOffset = _max(maxVerticalOffset - maxRadius, 0);
- return {
- minRadius: minRadius,
- maxRadius: maxRadius,
- horizontalMargin: maxHorizontalOffset,
- verticalMargin: maxVerticalOffset,
- inverseHorizontalMargin: maxInverseHorizontalOffset,
- inverseVerticalMargin: maxInverseVerticalOffset
- }
- },
- _applyMainLayout: function(elements, scaleMeasurement) {
- var measurements = this._measureMainElements(elements, scaleMeasurement);
- var area = this._area;
- var sides = area.sides;
- var margins = {
- left: (sides.left < -.1 ? measurements.horizontalMargin : measurements.inverseHorizontalMargin) || 0,
- right: (sides.right > .1 ? measurements.horizontalMargin : measurements.inverseHorizontalMargin) || 0,
- top: (sides.up < -.1 ? measurements.verticalMargin : measurements.inverseVerticalMargin) || 0,
- bottom: (sides.down > .1 ? measurements.verticalMargin : measurements.inverseVerticalMargin) || 0
- };
- var rect = selectRectByAspectRatio(this._innerRect, (sides.down - sides.up) / (sides.right - sides.left), margins);
- var radius = _min(getWidth(rect) / (sides.right - sides.left), getHeight(rect) / (sides.down - sides.up));
- radius = radius - measurements.maxRadius + area.radius;
- var x = rect.left - getWidth(rect) * sides.left / (sides.right - sides.left);
- var y = rect.top - getHeight(rect) * sides.up / (sides.down - sides.up);
- area.x = _round(x);
- area.y = _round(y);
- area.radius = radius;
- rect.left -= margins.left;
- rect.right += margins.right;
- rect.top -= margins.top;
- rect.bottom += margins.bottom;
- this._innerRect = rect
- },
- _getElementLayout: function(offset) {
- return {
- x: this._area.x,
- y: this._area.y,
- radius: _round(this._area.radius - offset)
- }
- },
- _getApproximateScreenRange: function() {
- var that = this;
- var area = that._area;
- var r = _min(that._canvas.width / (area.sides.right - area.sides.left), that._canvas.height / (area.sides.down - area.sides.up));
- r > area.totalRadius && (r = area.totalRadius);
- r = .8 * r;
- return -that._translator.getCodomainRange() * r * PI / 180
- },
- _getDefaultSize: function() {
- return {
- width: 300,
- height: 300
- }
- },
- _factory: objectUtils.clone(dxBaseGauge.prototype._factory)
- });
- function getWidth(rect) {
- return rect.right - rect.left
- }
- function getHeight(rect) {
- return rect.bottom - rect.top
- }
- function selectRectByAspectRatio(srcRect, aspectRatio, margins) {
- var rect = extend({}, srcRect);
- var selfAspectRatio;
- var width = 0;
- var height = 0;
- margins = margins || {};
- if (aspectRatio > 0) {
- rect.left += margins.left || 0;
- rect.right -= margins.right || 0;
- rect.top += margins.top || 0;
- rect.bottom -= margins.bottom || 0;
- if (getWidth(rect) > 0 && getHeight(rect) > 0) {
- selfAspectRatio = getHeight(rect) / getWidth(rect);
- if (selfAspectRatio > 1) {
- aspectRatio < selfAspectRatio ? width = getWidth(rect) : height = getHeight(rect)
- } else {
- aspectRatio > selfAspectRatio ? height = getHeight(rect) : width = getWidth(rect)
- }
- width > 0 || (width = height / aspectRatio);
- height > 0 || (height = width * aspectRatio);
- width = (getWidth(rect) - width) / 2;
- height = (getHeight(rect) - height) / 2;
- rect.left += width;
- rect.right -= width;
- rect.top += height;
- rect.bottom -= height
- } else {
- rect.left = rect.right = (rect.left + rect.right) / 2;
- rect.top = rect.bottom = (rect.top + rect.bottom) / 2
- }
- }
- return rect
- }
- dxCircularGauge._TESTS_selectRectByAspectRatio = selectRectByAspectRatio;
- var indicators = dxCircularGauge.prototype._factory.indicators = {};
- dxCircularGauge.prototype._factory.createIndicator = createIndicatorCreator(indicators);
- indicators._default = circularIndicatorsModule._default;
- indicators.rectangleneedle = circularIndicatorsModule.rectangleneedle;
- indicators.triangleneedle = circularIndicatorsModule.triangleneedle;
- indicators.twocolorneedle = circularIndicatorsModule.twocolorneedle;
- indicators.trianglemarker = circularIndicatorsModule.trianglemarker;
- indicators.textcloud = circularIndicatorsModule.textcloud;
- indicators.rangebar = circularIndicatorsModule.rangebar;
- dxCircularGauge.prototype._factory.RangeContainer = CircularRangeContainer;
- registerComponent("dxCircularGauge", dxCircularGauge);
- module.exports = dxCircularGauge
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/projection.main.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var eventEmitterModule = __webpack_require__( /*! ./event_emitter */ 416);
- var _Number = Number;
- var _min = Math.min;
- var _max = Math.max;
- var _abs = Math.abs;
- var _round = Math.round;
- var _ln = Math.log;
- var _pow = Math.pow;
- var TWO_TO_LN2 = 2 / Math.LN2;
- var MIN_BOUNDS_RANGE = 1 / 3600 / 180 / 10;
- var DEFAULT_MIN_ZOOM = 1;
- var DEFAULT_MAX_ZOOM = 256;
- var DEFAULT_CENTER = [NaN, NaN];
- var DEFAULT_ENGINE_NAME = "mercator";
- function floatsEqual(f1, f2) {
- return _abs(f1 - f2) < 1e-8
- }
- function arraysEqual(a1, a2) {
- return floatsEqual(a1[0], a2[0]) && floatsEqual(a1[1], a2[1])
- }
- function parseAndClamp(value, minValue, maxValue, defaultValue) {
- var val = _Number(value);
- return isFinite(val) ? _min(_max(val, minValue), maxValue) : defaultValue
- }
- function parseAndClampArray(value, minValue, maxValue, defaultValue) {
- return [parseAndClamp(value[0], minValue[0], maxValue[0], defaultValue[0]), parseAndClamp(value[1], minValue[1], maxValue[1], defaultValue[1])]
- }
- function getEngine(engine) {
- return engine instanceof Engine && engine || projection.get(engine) || projection.get(DEFAULT_ENGINE_NAME)
- }
- function Projection(parameters) {
- var that = this;
- that._initEvents();
- that._params = parameters;
- that._engine = getEngine();
- that._center = that._engine.center();
- that._adjustCenter()
- }
- Projection.prototype = {
- constructor: Projection,
- _minZoom: DEFAULT_MIN_ZOOM,
- _maxZoom: DEFAULT_MAX_ZOOM,
- _zoom: DEFAULT_MIN_ZOOM,
- _center: DEFAULT_CENTER,
- _canvas: {},
- _scale: [],
- dispose: function() {
- this._disposeEvents()
- },
- setEngine: function(value) {
- var that = this;
- var engine = getEngine(value);
- if (that._engine !== engine) {
- that._engine = engine;
- that._fire("engine");
- if (that._changeCenter(engine.center())) {
- that._triggerCenterChanged()
- }
- if (that._changeZoom(that._minZoom)) {
- that._triggerZoomChanged()
- }
- that._adjustCenter();
- that._setupScreen()
- }
- },
- setBounds: function(bounds) {
- if (void 0 !== bounds) {
- this.setEngine(this._engine.original().bounds(bounds))
- }
- },
- _setupScreen: function() {
- var that = this;
- var canvas = that._canvas;
- var width = canvas.width;
- var height = canvas.height;
- var aspectRatio = that._engine.ar();
- that._x0 = canvas.left + width / 2;
- that._y0 = canvas.top + height / 2;
- if (width / height <= aspectRatio) {
- that._xRadius = width / 2;
- that._yRadius = width / 2 / aspectRatio
- } else {
- that._xRadius = height / 2 * aspectRatio;
- that._yRadius = height / 2
- }
- that._fire("screen")
- },
- setSize: function(canvas) {
- var that = this;
- that._canvas = canvas;
- that._setupScreen()
- },
- _toScreen: function(coordinates) {
- return [this._x0 + this._xRadius * coordinates[0], this._y0 + this._yRadius * coordinates[1]]
- },
- _fromScreen: function(coordinates) {
- return [(coordinates[0] - this._x0) / this._xRadius, (coordinates[1] - this._y0) / this._yRadius]
- },
- _toTransformed: function(coordinates) {
- return [coordinates[0] * this._zoom + this._xCenter, coordinates[1] * this._zoom + this._yCenter]
- },
- _toTransformedFast: function(coordinates) {
- return [coordinates[0] * this._zoom, coordinates[1] * this._zoom]
- },
- _fromTransformed: function(coordinates) {
- return [(coordinates[0] - this._xCenter) / this._zoom, (coordinates[1] - this._yCenter) / this._zoom]
- },
- _adjustCenter: function() {
- var that = this;
- var center = that._engine.project(that._center);
- that._xCenter = -center[0] * that._zoom || 0;
- that._yCenter = -center[1] * that._zoom || 0
- },
- project: function(coordinates) {
- return this._engine.project(coordinates)
- },
- transform: function(coordinates) {
- return this._toScreen(this._toTransformedFast(coordinates))
- },
- isInvertible: function() {
- return this._engine.isInvertible()
- },
- getSquareSize: function(size) {
- return [size[0] * this._zoom * this._xRadius, size[1] * this._zoom * this._yRadius]
- },
- getZoom: function() {
- return this._zoom
- },
- _changeZoom: function(value) {
- var that = this;
- var oldZoom = that._zoom;
- var newZoom = that._zoom = parseAndClamp(value, that._minZoom, that._maxZoom, that._minZoom);
- var isChanged = !floatsEqual(oldZoom, newZoom);
- if (isChanged) {
- that._adjustCenter();
- that._fire("zoom")
- }
- return isChanged
- },
- setZoom: function(value) {
- if (this._engine.isInvertible() && this._changeZoom(value)) {
- this._triggerZoomChanged()
- }
- },
- getScaledZoom: function() {
- return _round((this._scale.length - 1) * _ln(this._zoom) / _ln(this._maxZoom))
- },
- setScaledZoom: function(scaledZoom) {
- this.setZoom(this._scale[_round(scaledZoom)])
- },
- changeScaledZoom: function(deltaZoom) {
- this.setZoom(this._scale[_max(_min(_round(this.getScaledZoom() + deltaZoom), this._scale.length - 1), 0)])
- },
- getZoomScalePartition: function() {
- return this._scale.length - 1
- },
- _setupScaling: function() {
- var that = this;
- var k = _round(TWO_TO_LN2 * _ln(that._maxZoom));
- var i = 1;
- k = k > 4 ? k : 4;
- var step = _pow(that._maxZoom, 1 / k);
- var zoom = that._minZoom;
- that._scale = [zoom];
- for (; i <= k; ++i) {
- that._scale.push(zoom *= step)
- }
- },
- setMaxZoom: function(maxZoom) {
- var that = this;
- that._minZoom = DEFAULT_MIN_ZOOM;
- that._maxZoom = parseAndClamp(maxZoom, that._minZoom, _Number.MAX_VALUE, DEFAULT_MAX_ZOOM);
- that._setupScaling();
- if (that._zoom > that._maxZoom) {
- that.setZoom(that._maxZoom)
- }
- that._fire("max-zoom")
- },
- getCenter: function() {
- return this._center.slice()
- },
- setCenter: function(value) {
- if (this._engine.isInvertible() && this._changeCenter(value || [])) {
- this._triggerCenterChanged()
- }
- },
- _changeCenter: function(value) {
- var that = this;
- var engine = that._engine;
- var oldCenter = that._center;
- var newCenter = that._center = parseAndClampArray(value, engine.min(), engine.max(), engine.center());
- var isChanged = !arraysEqual(oldCenter, newCenter);
- if (isChanged) {
- that._adjustCenter();
- that._fire("center")
- }
- return isChanged
- },
- _triggerCenterChanged: function() {
- this._params.centerChanged(this.getCenter())
- },
- _triggerZoomChanged: function() {
- this._params.zoomChanged(this.getZoom())
- },
- setCenterByPoint: function(coordinates, screenPosition) {
- var that = this;
- var p = that._engine.project(coordinates);
- var q = that._fromScreen(screenPosition);
- that.setCenter(that._engine.unproject([-q[0] / that._zoom + p[0], -q[1] / that._zoom + p[1]]))
- },
- beginMoveCenter: function() {
- if (this._engine.isInvertible()) {
- this._moveCenter = this._center
- }
- },
- endMoveCenter: function() {
- var that = this;
- if (that._moveCenter) {
- if (!arraysEqual(that._moveCenter, that._center)) {
- that._triggerCenterChanged()
- }
- that._moveCenter = null
- }
- },
- moveCenter: function(shift) {
- var that = this;
- if (that._moveCenter) {
- var current = that._toScreen(that._toTransformed(that._engine.project(that._center)));
- var center = that._engine.unproject(that._fromTransformed(that._fromScreen([current[0] + shift[0], current[1] + shift[1]])));
- that._changeCenter(center)
- }
- },
- getViewport: function() {
- var that = this;
- var unproject = that._engine.unproject;
- var lt = unproject(that._fromTransformed([-1, -1]));
- var lb = unproject(that._fromTransformed([-1, 1]));
- var rt = unproject(that._fromTransformed([1, -1]));
- var rb = unproject(that._fromTransformed([1, 1]));
- var minMax = findMinMax([selectFarthestPoint(lt[0], lb[0], rt[0], rb[0]), selectFarthestPoint(lt[1], rt[1], lb[1], rb[1])], [selectFarthestPoint(rt[0], rb[0], lt[0], lb[0]), selectFarthestPoint(lb[1], rb[1], lt[1], rt[1])]);
- return [].concat(minMax.min, minMax.max)
- },
- setViewport: function(viewport) {
- var engine = this._engine;
- var data = viewport ? getZoomAndCenterFromViewport(engine.project, engine.unproject, viewport) : [this._minZoom, engine.center()];
- this.setZoom(data[0]);
- this.setCenter(data[1])
- },
- getTransform: function() {
- return {
- translateX: this._xCenter * this._xRadius,
- translateY: this._yCenter * this._yRadius
- }
- },
- fromScreenPoint: function(coordinates) {
- return this._engine.unproject(this._fromTransformed(this._fromScreen(coordinates)))
- },
- _eventNames: ["engine", "screen", "center", "zoom", "max-zoom"]
- };
- eventEmitterModule.makeEventEmitter(Projection);
- function selectFarthestPoint(point1, point2, basePoint1, basePoint2) {
- var basePoint = (basePoint1 + basePoint2) / 2;
- return _abs(point1 - basePoint) > _abs(point2 - basePoint) ? point1 : point2
- }
- function selectClosestPoint(point1, point2, basePoint1, basePoint2) {
- var basePoint = (basePoint1 + basePoint2) / 2;
- return _abs(point1 - basePoint) < _abs(point2 - basePoint) ? point1 : point2
- }
- function getZoomAndCenterFromViewport(project, unproject, viewport) {
- var lt = project([viewport[0], viewport[3]]);
- var lb = project([viewport[0], viewport[1]]);
- var rt = project([viewport[2], viewport[3]]);
- var rb = project([viewport[2], viewport[1]]);
- var l = selectClosestPoint(lt[0], lb[0], rt[0], rb[0]);
- var r = selectClosestPoint(rt[0], rb[0], lt[0], lb[0]);
- var t = selectClosestPoint(lt[1], rt[1], lb[1], rb[1]);
- var b = selectClosestPoint(lb[1], rb[1], lt[1], rt[1]);
- return [2 / _max(_abs(l - r), _abs(t - b)), unproject([(l + r) / 2, (t + b) / 2])]
- }
- function setMinMax(engine, p1, p2) {
- var minMax = findMinMax(p1, p2);
- engine.min = returnArray(minMax.min);
- engine.max = returnArray(minMax.max)
- }
- function Engine(parameters) {
- var that = this;
- var project = createProjectMethod(parameters.to);
- var unproject = parameters.from ? createUnprojectMethod(parameters.from) : returnValue(DEFAULT_CENTER);
- that.project = project;
- that.unproject = unproject;
- that.original = returnValue(that);
- that.source = function() {
- return extend({}, parameters)
- };
- that.isInvertible = returnValue(!!parameters.from);
- that.ar = returnValue(parameters.aspectRatio > 0 ? _Number(parameters.aspectRatio) : 1);
- that.center = returnArray(unproject([0, 0]));
- setMinMax(that, [unproject([-1, 0])[0], unproject([0, 1])[1]], [unproject([1, 0])[0], unproject([0, -1])[1]])
- }
- Engine.prototype.aspectRatio = function(aspectRatio) {
- var engine = new Engine(extend(this.source(), {
- aspectRatio: aspectRatio
- }));
- engine.original = this.original;
- engine.min = this.min;
- engine.max = this.max;
- return engine
- };
- Engine.prototype.bounds = function(bounds) {
- bounds = bounds || [];
- var parameters = this.source();
- var min = this.min();
- var max = this.max();
- var b1 = parseAndClampArray([bounds[0], bounds[1]], min, max, min);
- var b2 = parseAndClampArray([bounds[2], bounds[3]], min, max, max);
- var p1 = parameters.to(b1);
- var p2 = parameters.to(b2);
- var delta = _min(_abs(p2[0] - p1[0]) > MIN_BOUNDS_RANGE ? _abs(p2[0] - p1[0]) : 2, _abs(p2[1] - p1[1]) > MIN_BOUNDS_RANGE ? _abs(p2[1] - p1[1]) : 2);
- if (delta < 2) {
- extend(parameters, createProjectUnprojectMethods(parameters.to, parameters.from, p1, p2, delta))
- }
- var engine = new Engine(parameters);
- engine.original = this.original;
- setMinMax(engine, b1, b2);
- return engine
- };
- function isEngine(engine) {
- return engine instanceof Engine
- }
- function invertVerticalAxis(pair) {
- return [pair[0], -pair[1]]
- }
- function createProjectMethod(method) {
- return function(arg) {
- return invertVerticalAxis(method(arg))
- }
- }
- function createUnprojectMethod(method) {
- return function(arg) {
- return method(invertVerticalAxis(arg))
- }
- }
- function returnValue(value) {
- return function() {
- return value
- }
- }
- function returnArray(value) {
- return function() {
- return value.slice()
- }
- }
- function projection(parameters) {
- return parameters && parameters.to ? new Engine(parameters) : null
- }
- function findMinMax(p1, p2) {
- return {
- min: [_min(p1[0], p2[0]), _min(p1[1], p2[1])],
- max: [_max(p1[0], p2[0]), _max(p1[1], p2[1])]
- }
- }
- var projectionsCache = {};
- projection.get = function(name) {
- return projectionsCache[name] || null
- };
- projection.add = function(name, engine) {
- if (!projectionsCache[name] && isEngine(engine)) {
- projectionsCache[name] = engine
- }
- return projection
- };
- function createProjectUnprojectMethods(project, unproject, p1, p2, delta) {
- var x0 = (p1[0] + p2[0]) / 2 - delta / 2;
- var y0 = (p1[1] + p2[1]) / 2 - delta / 2;
- var k = 2 / delta;
- return {
- to: function(coordinates) {
- var p = project(coordinates);
- return [-1 + (p[0] - x0) * k, -1 + (p[1] - y0) * k]
- },
- from: function(coordinates) {
- var p = [x0 + (coordinates[0] + 1) / k, y0 + (coordinates[1] + 1) / k];
- return unproject(p)
- }
- }
- }
- exports.Projection = Projection;
- exports.projection = projection;
- exports._TESTS_Engine = Engine
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/event_emitter.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var eventEmitterMethods = {
- _initEvents: function() {
- var names = this._eventNames;
- var i;
- var ii = names.length;
- var events = this._events = {};
- for (i = 0; i < ii; ++i) {
- events[names[i]] = Callbacks()
- }
- },
- _disposeEvents: function() {
- var events = this._events;
- var name;
- for (name in events) {
- events[name].empty()
- }
- this._events = null
- },
- on: function(handlers) {
- var events = this._events;
- var name;
- for (name in handlers) {
- events[name].add(handlers[name])
- }
- return dispose;
- function dispose() {
- for (name in handlers) {
- events[name].remove(handlers[name])
- }
- }
- },
- _fire: function(name, arg) {
- this._events[name].fire(arg)
- }
- };
- exports.makeEventEmitter = function(target) {
- var proto = target.prototype;
- var name;
- for (name in eventEmitterMethods) {
- proto[name] = eventEmitterMethods[name]
- }
- };
- exports._TESTS_eventEmitterMethods = eventEmitterMethods
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/projection.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var projectionModule = __webpack_require__( /*! ./projection.main */ 415);
- var projection = projectionModule.projection;
- var _min = Math.min;
- var _max = Math.max;
- var _sin = Math.sin;
- var _asin = Math.asin;
- var _tan = Math.tan;
- var _atan = Math.atan;
- var _exp = Math.exp;
- var _log = Math.log;
- var PI = Math.PI;
- var PI_DIV_4 = PI / 4;
- var GEO_LON_BOUND = 180;
- var GEO_LAT_BOUND = 90;
- var RADIANS = PI / 180;
- var MERCATOR_LAT_BOUND = (2 * _atan(_exp(PI)) - PI / 2) / RADIANS;
- var MILLER_LAT_BOUND = (2.5 * _atan(_exp(.8 * PI)) - .625 * PI) / RADIANS;
- function clamp(value, threshold) {
- return _max(_min(value, +threshold), -threshold)
- }
- projection.add("mercator", projection({
- aspectRatio: 1,
- to: function(coordinates) {
- return [coordinates[0] / GEO_LON_BOUND, _log(_tan(PI_DIV_4 + clamp(coordinates[1], MERCATOR_LAT_BOUND) * RADIANS / 2)) / PI]
- },
- from: function(coordinates) {
- return [coordinates[0] * GEO_LON_BOUND, (2 * _atan(_exp(coordinates[1] * PI)) - PI / 2) / RADIANS]
- }
- }));
- projection.add("equirectangular", projection({
- aspectRatio: 2,
- to: function(coordinates) {
- return [coordinates[0] / GEO_LON_BOUND, coordinates[1] / GEO_LAT_BOUND]
- },
- from: function(coordinates) {
- return [coordinates[0] * GEO_LON_BOUND, coordinates[1] * GEO_LAT_BOUND]
- }
- }));
- projection.add("lambert", projection({
- aspectRatio: 2,
- to: function(coordinates) {
- return [coordinates[0] / GEO_LON_BOUND, _sin(clamp(coordinates[1], GEO_LAT_BOUND) * RADIANS)]
- },
- from: function(coordinates) {
- return [coordinates[0] * GEO_LON_BOUND, _asin(clamp(coordinates[1], 1)) / RADIANS]
- }
- }));
- projection.add("miller", projection({
- aspectRatio: 1,
- to: function(coordinates) {
- return [coordinates[0] / GEO_LON_BOUND, 1.25 * _log(_tan(PI_DIV_4 + clamp(coordinates[1], MILLER_LAT_BOUND) * RADIANS * .4)) / PI]
- },
- from: function(coordinates) {
- return [coordinates[0] * GEO_LON_BOUND, (2.5 * _atan(_exp(.8 * coordinates[1] * PI)) - .625 * PI) / RADIANS]
- }
- }));
- exports.projection = projection
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/sparklines/base_sparkline.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
- var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
- var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var DEFAULT_LINE_SPACING = 2;
- var DEFAULT_EVENTS_DELAY = 100;
- var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
- var translator2DModule = __webpack_require__( /*! ../translators/translator2d */ 249);
- var _extend = extend;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- function generateDefaultCustomizeTooltipCallback(fontOptions, rtlEnabled) {
- var lineSpacing = fontOptions.lineSpacing;
- var lineHeight = (void 0 !== lineSpacing && null !== lineSpacing ? lineSpacing : DEFAULT_LINE_SPACING) + fontOptions.size;
- return function(customizeObject) {
- var html = "";
- var vt = customizeObject.valueText;
- for (var i = 0; i < vt.length; i += 2) {
- html += "<tr><td>" + vt[i] + "</td><td style='width: 15px'></td><td style='text-align: " + (rtlEnabled ? "left" : "right") + "'>" + vt[i + 1] + "</td></tr>"
- }
- return {
- html: "<table style='border-spacing:0px; line-height: " + lineHeight + "px'>" + html + "</table>"
- }
- }
- }
- function generateCustomizeTooltipCallback(customizeTooltip, fontOptions, rtlEnabled) {
- var defaultCustomizeTooltip = generateDefaultCustomizeTooltipCallback(fontOptions, rtlEnabled);
- if (isFunction(customizeTooltip)) {
- return function(customizeObject) {
- var res = customizeTooltip.call(customizeObject, customizeObject);
- if (!("html" in res) && !("text" in res)) {
- _extend(res, defaultCustomizeTooltip.call(customizeObject, customizeObject))
- }
- return res
- }
- } else {
- return defaultCustomizeTooltip
- }
- }
- function createAxis(isHorizontal) {
- var translator = new translator2DModule.Translator2D({}, {}, {
- shiftZeroValue: !isHorizontal,
- isHorizontal: !!isHorizontal
- });
- return {
- getTranslator: function() {
- return translator
- },
- update: function(range, canvas, options) {
- translator.update(range, canvas, options)
- },
- getVisibleArea: function() {
- var visibleArea = translator.getCanvasVisibleArea();
- return [visibleArea.min, visibleArea.max]
- },
- visualRange: _noop,
- calculateInterval: _noop,
- getMarginOptions: function() {
- return {}
- }
- }
- }
- var BaseSparkline = BaseWidget.inherit({
- _getLayoutItems: _noop,
- _useLinks: false,
- _themeDependentChanges: ["OPTIONS"],
- _initCore: function() {
- var that = this;
- that._tooltipTracker = that._renderer.root;
- that._tooltipTracker.attr({
- "pointer-events": "visible"
- });
- that._createHtmlElements();
- that._initTooltipEvents();
- that._argumentAxis = createAxis(true);
- that._valueAxis = createAxis()
- },
- _getDefaultSize: function() {
- return this._defaultSize
- },
- _disposeCore: function() {
- this._disposeWidgetElements();
- this._disposeTooltipEvents();
- this._ranges = null
- },
- _optionChangesOrder: ["OPTIONS"],
- _change_OPTIONS: function() {
- this._prepareOptions();
- this._change(["UPDATE"])
- },
- _customChangesOrder: ["UPDATE"],
- _change_UPDATE: function() {
- this._update()
- },
- _update: function() {
- var that = this;
- if (that._tooltipShown) {
- that._tooltipShown = false;
- that._tooltip.hide()
- }
- that._cleanWidgetElements();
- that._updateWidgetElements();
- that._drawWidgetElements()
- },
- _updateWidgetElements: function() {
- var canvas = this._getCorrectCanvas();
- this._updateRange();
- this._argumentAxis.update(this._ranges.arg, canvas, this._getStick());
- this._valueAxis.update(this._ranges.val, canvas)
- },
- _getStick: function() {},
- _applySize: function(rect) {
- this._allOptions.size = {
- width: rect[2] - rect[0],
- height: rect[3] - rect[1]
- };
- this._change(["UPDATE"])
- },
- _setupResizeHandler: _noop,
- _prepareOptions: function() {
- return _extend(true, {}, this._themeManager.theme(), this.option())
- },
- _getTooltipCoords: function() {
- var canvas = this._canvas;
- var rootOffset = this._renderer.getRootOffset();
- return {
- x: canvas.width / 2 + rootOffset.left,
- y: canvas.height / 2 + rootOffset.top
- }
- },
- _initTooltipEvents: function() {
- var that = this;
- var data = {
- widget: that
- };
- that._showTooltipCallback = function() {
- var tooltip;
- if (!that._tooltipShown) {
- that._tooltipShown = true;
- tooltip = that._getTooltip();
- tooltip.isEnabled() && that._tooltip.show(that._getTooltipData(), that._getTooltipCoords(), {})
- }
- that._DEBUG_showCallback && that._DEBUG_showCallback()
- };
- that._hideTooltipCallback = function() {
- var tooltipWasShown = that._tooltipShown;
- that._hideTooltipTimeout = null;
- if (that._tooltipShown) {
- that._tooltipShown = false;
- that._tooltip.hide()
- }
- that._DEBUG_hideCallback && that._DEBUG_hideCallback(tooltipWasShown)
- };
- that._disposeCallbacks = function() {
- that = that._showTooltipCallback = that._hideTooltipCallback = that._disposeCallbacks = null
- };
- that._tooltipTracker.on(mouseEvents, data).on(touchEvents, data);
- that._tooltipTracker.on(menuEvents)
- },
- _stopCurrentHandling: function() {
- this._hideTooltip()
- },
- _disposeTooltipEvents: function() {
- var that = this;
- clearTimeout(that._hideTooltipTimeout);
- that._tooltipTracker.off();
- that._disposeCallbacks()
- },
- _getTooltip: function() {
- var that = this;
- if (!that._tooltip) {
- _initTooltip.apply(this, arguments);
- that._setTooltipRendererOptions(that._tooltipRendererOptions);
- that._tooltipRendererOptions = null;
- that._setTooltipOptions()
- }
- return that._tooltip
- }
- });
- var menuEvents = {
- "contextmenu.sparkline-tooltip": function(event) {
- if (eventUtils.isTouchEvent(event) || eventUtils.isPointerEvent(event)) {
- event.preventDefault()
- }
- },
- "MSHoldVisual.sparkline-tooltip": function(event) {
- event.preventDefault()
- }
- };
- var mouseEvents = {
- "mouseover.sparkline-tooltip": function(event) {
- isPointerDownCalled = false;
- var widget = event.data.widget;
- widget._x = event.pageX;
- widget._y = event.pageY;
- widget._tooltipTracker.off(mouseMoveEvents).on(mouseMoveEvents, event.data);
- widget._showTooltip()
- },
- "mouseout.sparkline-tooltip": function(event) {
- if (isPointerDownCalled) {
- return
- }
- var widget = event.data.widget;
- widget._tooltipTracker.off(mouseMoveEvents);
- widget._hideTooltip(DEFAULT_EVENTS_DELAY)
- }
- };
- var mouseMoveEvents = {
- "mousemove.sparkline-tooltip": function(event) {
- var widget = event.data.widget;
- widget._x = event.pageX;
- widget._y = event.pageY;
- widget._showTooltip()
- }
- };
- var active_touch_tooltip_widget = null;
- var touchStartTooltipProcessing = function(event) {
- var widget = active_touch_tooltip_widget;
- if (widget && widget !== event.data.widget) {
- widget._hideTooltip(DEFAULT_EVENTS_DELAY)
- }
- widget = active_touch_tooltip_widget = event.data.widget;
- widget._showTooltip();
- widget._touch = true
- };
- var touchStartDocumentProcessing = function() {
- var widget = active_touch_tooltip_widget;
- if (widget) {
- if (!widget._touch) {
- widget._hideTooltip(DEFAULT_EVENTS_DELAY);
- active_touch_tooltip_widget = null
- }
- widget._touch = null
- }
- };
- var touchEndDocumentProcessing = function() {
- var widget = active_touch_tooltip_widget;
- if (widget) {
- widget._hideTooltip(DEFAULT_EVENTS_DELAY);
- active_touch_tooltip_widget = null
- }
- };
- var isPointerDownCalled = false;
- var touchEvents = {
- "pointerdown.sparkline-tooltip": touchStartTooltipProcessing,
- "touchstart.sparkline-tooltip": touchStartTooltipProcessing
- };
- ready(function() {
- eventsEngine.subscribeGlobal(domAdapter.getDocument(), {
- "pointerdown.sparkline-tooltip": function() {
- isPointerDownCalled = true;
- touchStartDocumentProcessing()
- },
- "touchstart.sparkline-tooltip": touchStartDocumentProcessing,
- "pointerup.sparkline-tooltip": touchEndDocumentProcessing,
- "touchend.sparkline-tooltip": touchEndDocumentProcessing
- })
- });
- module.exports = BaseSparkline;
- module.exports._DEBUG_reset = function() {
- active_touch_tooltip_widget = null
- };
- BaseSparkline.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
- var _initTooltip = BaseSparkline.prototype._initTooltip;
- BaseSparkline.prototype._initTooltip = _noop;
- var _disposeTooltip = BaseSparkline.prototype._disposeTooltip;
- BaseSparkline.prototype._disposeTooltip = function() {
- if (this._tooltip) {
- _disposeTooltip.apply(this, arguments)
- }
- };
- BaseSparkline.prototype._setTooltipRendererOptions = function() {
- var options = this._getRendererOptions();
- if (this._tooltip) {
- this._tooltip.setRendererOptions(options)
- } else {
- this._tooltipRendererOptions = options
- }
- };
- BaseSparkline.prototype._setTooltipOptions = function() {
- var tooltip = this._tooltip;
- var options = tooltip && this._getOption("tooltip");
- tooltip && tooltip.update(_extend({}, options, {
- customizeTooltip: generateCustomizeTooltipCallback(options.customizeTooltip, options.font, this.option("rtlEnabled")),
- enabled: options.enabled && this._isTooltipEnabled()
- }))
- };
- BaseSparkline.prototype._showTooltip = function() {
- var that = this;
- ++that._DEBUG_clearHideTooltipTimeout;
- clearTimeout(that._hideTooltipTimeout);
- that._hideTooltipTimeout = null;
- that._showTooltipCallback()
- };
- BaseSparkline.prototype._hideTooltip = function(delay) {
- var that = this;
- ++that._DEBUG_clearShowTooltipTimeout;
- clearTimeout(that._hideTooltipTimeout);
- if (delay) {
- ++that._DEBUG_hideTooltipTimeoutSet;
- that._hideTooltipTimeout = setTimeout(that._hideTooltipCallback, delay)
- } else {
- that._hideTooltipCallback()
- }
- };
- var exportPlugin = extend(true, {}, __webpack_require__( /*! ../core/export */ 93).plugin, {
- init: _noop,
- dispose: _noop,
- customize: null,
- members: {
- _getExportMenuOptions: null
- }
- });
- BaseSparkline.addPlugin(exportPlugin)
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tiling.squarified.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _max = Math.max;
- var _squarify = __webpack_require__( /*! ./tiling.squarified.base */ 420);
- function accumulate(total, current) {
- return _max(total, current)
- }
- function squarified(data) {
- return _squarify(data, accumulate, false)
- }
- __webpack_require__( /*! ./tiling */ 120).addAlgorithm("squarified", squarified);
- module.exports = squarified
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tiling.squarified.base.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _max = Math.max;
- var _round = Math.round;
- var tiling = __webpack_require__( /*! ./tiling */ 120);
- function compare(a, b) {
- return b.value - a.value
- }
- function getAspectRatio(value) {
- return _max(value, 1 / value)
- }
- function findAppropriateCollection(nodes, head, context) {
- var bestAspectRatio = 1 / 0;
- var nextAspectRatio;
- var sum = 0;
- var nextSum;
- var i;
- var j;
- var ii = nodes.length;
- var coeff = context.areaToValue / context.staticSide;
- var totalAspectRatio;
- for (i = head; i < ii;) {
- nextSum = sum + nodes[i].value;
- totalAspectRatio = context.staticSide / coeff / nextSum;
- nextAspectRatio = 0;
- for (j = head; j <= i; ++j) {
- nextAspectRatio = context.accumulate(nextAspectRatio, getAspectRatio(totalAspectRatio * nodes[j].value / nextSum), j - head + 1)
- }
- if (nextAspectRatio < bestAspectRatio) {
- bestAspectRatio = nextAspectRatio;
- sum = nextSum;
- ++i
- } else {
- break
- }
- }
- return {
- sum: sum,
- count: i - head,
- side: _round(coeff * sum)
- }
- }
- function getArea(rect) {
- return (rect[2] - rect[0]) * (rect[3] - rect[1])
- }
- function doStep(nodes, head, context) {
- var sidesData = tiling.buildSidesData(context.rect, context.directions, context.staticSideIndex);
- var area = getArea(context.rect);
- var rowData = area > 0 ? findAppropriateCollection(nodes, head, {
- areaToValue: area / context.sum,
- accumulate: context.accumulate,
- staticSide: sidesData.staticSide
- }) : {
- sum: 1,
- side: sidesData.variedSide,
- count: nodes.length - head
- };
- tiling.calculateRectangles(nodes, head, context.rect, sidesData, rowData);
- context.sum -= rowData.sum;
- return head + rowData.count
- }
- module.exports = function(data, accumulate, isFixedStaticSide) {
- var items = data.items;
- var ii = items.length;
- var i;
- var context = {
- sum: data.sum,
- rect: data.rect,
- directions: data.directions,
- accumulate: accumulate
- };
- if (isFixedStaticSide) {
- context.staticSideIndex = tiling.getStaticSideIndex(context.rect)
- }
- items.sort(compare);
- for (i = 0; i < ii;) {
- i = doStep(items, i, context)
- }
- }
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/colorizing.discrete.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function discreteColorizer(options, themeManager, root) {
- var palette = themeManager.createPalette(options.palette, {
- useHighlight: true,
- extensionMode: options.paletteExtensionMode,
- count: options.colorizeGroups ? getNodesCount(root) : getLeafsCount(root)
- });
- return (options.colorizeGroups ? discreteGroupColorizer : discreteLeafColorizer)(palette, root)
- }
- function getLeafsCount(root) {
- var allNodes = root.nodes.slice();
- var i;
- var ii = allNodes.length;
- var count = 0;
- var node;
- for (i = 0; i < ii; ++i) {
- node = allNodes[i];
- if (node.isNode()) {
- count = Math.max(count, getLeafsCount(node))
- } else {
- count += 1
- }
- }
- return count
- }
- function discreteLeafColorizer(palette) {
- var colors = palette.generateColors();
- return function(node) {
- return colors[node.index]
- }
- }
- function getNodesCount(root) {
- var allNodes = root.nodes.slice();
- var i;
- var ii = allNodes.length;
- var count = 0;
- var node;
- for (i = 0; i < ii; ++i) {
- node = allNodes[i];
- if (node.isNode()) {
- count += getNodesCount(node) + 1
- }
- }
- return count
- }
- function prepareDiscreteGroupColors(palette, root) {
- var colors = {};
- var allNodes = root.nodes.slice();
- var i;
- var ii = allNodes.length;
- var node;
- for (i = 0; i < ii; ++i) {
- node = allNodes[i];
- if (node.isNode()) {
- allNodes = allNodes.concat(node.nodes);
- ii = allNodes.length
- } else {
- if (!colors[node.parent._id]) {
- colors[node.parent._id] = palette.getNextColor()
- }
- }
- }
- return colors
- }
- function discreteGroupColorizer(palette, root) {
- var colors = prepareDiscreteGroupColors(palette, root);
- return function(node) {
- return colors[node._id]
- }
- }
- __webpack_require__( /*! ./colorizing */ 121).addColorizer("discrete", discreteColorizer);
- module.exports = discreteColorizer
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/hover.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
- var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
- var common = __webpack_require__( /*! ./common */ 251);
- var _parseScalar = __webpack_require__( /*! ../core/utils */ 10).parseScalar;
- var _buildRectAppearance = common.buildRectAppearance;
- var STATE_CODE = 1;
- __webpack_require__( /*! ./api */ 146);
- __webpack_require__( /*! ./states */ 423);
- proto._eventsMap.onHoverChanged = {
- name: "hoverChanged"
- };
- expand(proto._handlers, "calculateAdditionalStates", function(states, options) {
- states[1] = options.hoverStyle ? _buildRectAppearance(options.hoverStyle) : {}
- });
- __webpack_require__( /*! ./tree_map.base */ 70).addChange({
- code: "HOVER_ENABLED",
- handler: function() {
- var hoverEnabled = _parseScalar(this._getOption("hoverEnabled", true), true);
- if (!hoverEnabled) {
- this.clearHover()
- }
- this._hoverEnabled = hoverEnabled
- },
- isThemeDependent: true,
- isOptionChange: true,
- option: "hoverEnabled"
- });
- nodeProto.statesMap[1] = 1;
- nodeProto.additionalStates.push(1);
- expand(proto, "_extendProxyType", function(proto) {
- var that = this;
- proto.setHover = function() {
- that._hoverNode(this._id)
- };
- proto.isHovered = function() {
- return that._hoverIndex === this._id
- }
- });
- expand(proto, "_onNodesCreated", function() {
- this._hoverIndex = -1
- });
- expand(proto, "_changeGroupSettings", function() {
- var that = this;
- that._groupHoverEnabled = _parseScalar(that._getOption("group").hoverEnabled, true);
- if (!that._groupHoverEnabled) {
- that.clearHover()
- }
- });
- proto._applyHoverState = function(index, state) {
- setNodeStateRecursive(this._nodes[index], STATE_CODE, state);
- this._eventTrigger("hoverChanged", {
- node: this._nodes[index].proxy
- })
- };
- function setNodeStateRecursive(node, code, state) {
- var nodes = node.isNode() && node.nodes;
- var i;
- var ii = nodes && nodes.length;
- node.setState(code, state);
- for (i = 0; i < ii; ++i) {
- setNodeStateRecursive(nodes[i], code, state)
- }
- }
- proto._hoverNode = function(index) {
- var that = this;
- var currentIndex = that._hoverIndex;
- if (that._hoverEnabled && currentIndex !== index) {
- if (!that._groupHoverEnabled && index >= 0 && that._nodes[index].isNode()) {
- that.clearHover();
- return
- }
- that._context.suspend();
- that._hoverIndex = -1;
- if (currentIndex >= 0) {
- that._applyHoverState(currentIndex, false)
- }
- that._hoverIndex = index;
- if (index >= 0) {
- that._applyHoverState(index, true)
- }
- that._context.resume()
- }
- };
- proto.clearHover = function() {
- this._hoverNode(-1)
- }
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/states.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
- var handlers = proto._handlers;
- var _calculateState = handlers.calculateState;
- var _buildState = nodeProto._buildState;
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- handlers.calculateState = function(options) {
- var states = {
- 0: _calculateState(options)
- };
- handlers.calculateAdditionalStates(states, options);
- return states
- };
- handlers.calculateAdditionalStates = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- nodeProto.code = 0;
- nodeProto.statesMap = {
- 0: 0
- };
- nodeProto.additionalStates = [];
- nodeProto._buildState = function(state, extra) {
- var states = {
- 0: _buildState(state[0], extra)
- };
- if (this.additionalStates.length) {
- buildAdditionalStates(states, states[0], state, this.additionalStates)
- }
- return states
- };
- nodeProto._getState = function() {
- return this.state[this.statesMap[this.code]]
- };
- nodeProto.setState = function(code, state) {
- if (state) {
- this.code |= code
- } else {
- this.code &= ~code
- }
- this.ctx.change(["TILES"])
- };
- function buildAdditionalStates(states, base, source, list) {
- var i;
- var ii = list.length;
- for (i = 0; i < ii; ++i) {
- states[list[i]] = _extend({}, base, source[list[i]])
- }
- }
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tooltip.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
- __webpack_require__( /*! ./api */ 146);
- expand(proto, "_extendProxyType", function(proto) {
- var that = this;
- proto.showTooltip = function(coords) {
- that._showTooltip(this._id, coords)
- }
- });
- expand(proto, "_onNodesCreated", function() {
- if (this._tooltipIndex >= 0) {
- this._tooltip.hide()
- }
- this._tooltipIndex = -1
- });
- expand(proto, "_onTilingPerformed", function() {
- if (this._tooltipIndex >= 0) {
- this._moveTooltip(this._nodes[this._tooltipIndex])
- }
- });
- function getCoords(rect, renderer) {
- var offset = renderer.getRootOffset();
- return [(rect[0] + rect[2]) / 2 + offset.left, (rect[1] + rect[3]) / 2 + offset.top]
- }
- proto._showTooltip = function(index, coords) {
- var that = this;
- var tooltip = that._tooltip;
- var node = that._nodes[index];
- var state = that._tooltipIndex === index || tooltip.show({
- value: node.value,
- valueText: tooltip.formatValue(node.value),
- node: node.proxy
- }, {
- x: 0,
- y: 0,
- offset: 0
- }, {
- node: node.proxy
- });
- if (state) {
- that._moveTooltip(node, coords)
- } else {
- tooltip.hide()
- }
- that._tooltipIndex = state ? index : -1
- };
- proto._moveTooltip = function(node, coords) {
- var xy = coords || node.rect && getCoords(node.rect, this._renderer) || [-1e3, -1e3];
- this._tooltip.move(xy[0], xy[1], 0)
- };
- proto.hideTooltip = function() {
- if (this._tooltipIndex >= 0) {
- this._tooltipIndex = -1;
- this._tooltip.hide()
- }
- };
- __webpack_require__( /*! ./tree_map.base */ 70).addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin)
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/funnel.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var tiling = __webpack_require__( /*! ./tiling */ 837);
- var dynamicSlope = __webpack_require__( /*! ./tiling.funnel */ 838);
- var dynamicHeight = __webpack_require__( /*! ./tiling.pyramid */ 839);
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var Item = __webpack_require__( /*! ./item */ 840);
- var NODES_CREATE_CHANGE = "NODES_CREATE";
- tiling.addAlgorithm("dynamicslope", dynamicSlope, true);
- tiling.addAlgorithm("dynamicheight", dynamicHeight);
- function invertFigure(figure) {
- return figure.map(function(coord, index) {
- return index % 2 ? 1 - coord : coord
- })
- }
- var dxFunnel = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
- _rootClass: "dxf-funnel",
- _rootClassPrefix: "dxf",
- _proxyData: [],
- _optionChangesMap: {
- dataSource: "DATA_SOURCE",
- neckWidth: NODES_CREATE_CHANGE,
- neckHeight: NODES_CREATE_CHANGE,
- inverted: NODES_CREATE_CHANGE,
- algorithm: NODES_CREATE_CHANGE,
- item: NODES_CREATE_CHANGE,
- valueField: NODES_CREATE_CHANGE,
- argumentField: NODES_CREATE_CHANGE,
- colorField: NODES_CREATE_CHANGE,
- palette: NODES_CREATE_CHANGE,
- paletteExtensionMode: NODES_CREATE_CHANGE,
- sortData: NODES_CREATE_CHANGE
- },
- _themeDependentChanges: [NODES_CREATE_CHANGE],
- _getDefaultSize: function() {
- return {
- width: 400,
- height: 400
- }
- },
- _themeSection: "funnel",
- _fontFields: ["legend.title.font", "legend.title.subtitle.font", "legend.font"],
- _optionChangesOrder: ["DATA_SOURCE"],
- _initialChanges: ["DATA_SOURCE"],
- _initCore: function() {
- this._group = this._renderer.g().append(this._renderer.root);
- this._items = []
- },
- _eventsMap: {
- onHoverChanged: {
- name: "hoverChanged"
- },
- onSelectionChanged: {
- name: "selectionChanged"
- }
- },
- _disposeCore: noop,
- _applySize: function(rect) {
- this._rect = rect.slice();
- this._change(["TILING"]);
- return this._rect
- },
- _getAlignmentRect: function() {
- return this._rect
- },
- _change_TILING: function() {
- var that = this;
- var items = that._items;
- var rect = that._rect;
- var convertCoord = function(coord, index) {
- var offset = index % 2;
- return rect[0 + offset] + (rect[2 + offset] - rect[0 + offset]) * coord
- };
- this._group.clear();
- items.forEach(function(item, index) {
- var coords = item.figure.map(convertCoord);
- var element = that._renderer.path([], "area").attr({
- points: coords
- }).append(that._group);
- item.coords = coords;
- item.element = element
- });
- this._requestChange(["TILES"])
- },
- _customChangesOrder: [NODES_CREATE_CHANGE, "LAYOUT", "TILING", "TILES", "DRAWN"],
- _dataSourceChangedHandler: function() {
- this._requestChange([NODES_CREATE_CHANGE])
- },
- _change_DRAWN: function() {
- this._drawn()
- },
- _change_DATA_SOURCE: function() {
- this._change(["DRAWN"]);
- this._updateDataSource()
- },
- _change_NODES_CREATE: function() {
- this._buildNodes()
- },
- _change_TILES: function() {
- this._applyTilesAppearance()
- },
- _suspend: function() {
- if (!this._applyingChanges) {
- this._suspendChanges()
- }
- },
- _resume: function() {
- if (!this._applyingChanges) {
- this._resumeChanges()
- }
- },
- _applyTilesAppearance: function() {
- this._items.forEach(function(item) {
- var state = item.getState();
- item.element.smartAttr(item.states[state])
- })
- },
- _hitTestTargets: function(x, y) {
- var that = this;
- var data;
- this._proxyData.some(function(callback) {
- data = callback.call(that, x, y);
- if (data) {
- return true
- }
- });
- return data
- },
- clearHover: function() {
- this._suspend();
- this._items.forEach(function(item) {
- item.isHovered() && item.hover(false)
- });
- this._resume()
- },
- clearSelection: function() {
- this._suspend();
- this._items.forEach(function(item) {
- item.isSelected() && item.select(false)
- });
- this._resume()
- },
- _getData: function() {
- var that = this;
- var data = that._dataSourceItems() || [];
- var valueField = that._getOption("valueField", true);
- var argumentField = that._getOption("argumentField", true);
- var colorField = that._getOption("colorField", true);
- var processedData = data.reduce(function(d, item) {
- var value = Number(item[valueField]);
- if (value >= 0) {
- d[0].push({
- value: value,
- color: item[colorField],
- argument: item[argumentField],
- dataItem: item
- });
- d[1] += value
- }
- return d
- }, [
- [], 0
- ]);
- var items = processedData[0];
- if (!processedData[1]) {
- items = items.map(function(item) {
- item.value += 1;
- return item
- })
- }
- if (data.length > 0 && 0 === items.length) {
- that._incidentOccurred("E2005", valueField)
- }
- if (that._getOption("sortData", true)) {
- items.sort(function(a, b) {
- return b.value - a.value
- })
- }
- return items
- },
- _buildNodes: function() {
- var that = this;
- var data = that._getData();
- var algorithm = tiling.getAlgorithm(that._getOption("algorithm", true));
- var percents = algorithm.normalizeValues(data);
- var itemOptions = that._getOption("item");
- var figures = algorithm.getFigures(percents, that._getOption("neckWidth", true), that._getOption("neckHeight", true));
- var palette = that._themeManager.createPalette(that._getOption("palette", true), {
- useHighlight: true,
- extensionMode: that._getOption("paletteExtensionMode", true),
- count: figures.length
- });
- that._items = figures.map(function(figure, index) {
- var curData = data[index];
- var node = new Item(that, {
- figure: figure,
- data: curData,
- percent: percents[index],
- id: index,
- color: curData.color || palette.getNextColor(),
- itemOptions: itemOptions
- });
- return node
- });
- if (that._getOption("inverted", true)) {
- that._items.forEach(function(item) {
- item.figure = invertFigure(item.figure)
- })
- }
- that._renderer.initHatching();
- that._change(["TILING", "DRAWN"])
- },
- _showTooltip: noop,
- hideTooltip: noop,
- getAllItems: function() {
- return this._items.slice()
- },
- _getLegendData: function() {
- return this._items.map(function(item) {
- return {
- id: item.id,
- visible: true,
- text: item.argument,
- item: item,
- states: item.states
- }
- })
- },
- _getMinSize: function() {
- var adaptiveLayout = this._getOption("adaptiveLayout");
- return [adaptiveLayout.width, adaptiveLayout.height]
- }
- });
- __webpack_require__( /*! ../../core/component_registrator */ 9)("dxFunnel", dxFunnel);
- module.exports = dxFunnel;
- dxFunnel.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/sankey.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _constants = __webpack_require__( /*! ./constants */ 427);
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var Node = __webpack_require__( /*! ./node_item */ 845);
- var Link = __webpack_require__( /*! ./link_item */ 846);
- var defaultLayoutBuilder = __webpack_require__( /*! ./layout */ 847);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _isString = typeUtils.isString;
- var _isNumber = typeUtils.isNumeric;
- function moveLabel(node, labelOptions, availableLabelWidth, rect) {
- if (node.label.getBBox().width > availableLabelWidth) {
- node.labelText.applyEllipsis(availableLabelWidth)
- }
- var bBox = node.label.getBBox();
- var verticalOffset = labelOptions.verticalOffset;
- var horizontalOffset = labelOptions.horizontalOffset;
- var labelOffsetY = Math.round(node.rect.y + node.rect.height / 2 - bBox.y - bBox.height / 2) + verticalOffset;
- var labelOffsetX = node.rect.x + horizontalOffset + node.rect.width - bBox.x;
- if (labelOffsetX + bBox.width >= rect[2] - rect[0]) {
- labelOffsetX = node.rect.x - horizontalOffset - bBox.x - bBox.width
- }
- if (labelOffsetY >= rect[3]) {
- labelOffsetY = rect[3]
- }
- if (labelOffsetY - bBox.height < rect[1]) {
- labelOffsetY = node.rect.y - bBox.y + verticalOffset
- }
- node.labelText.attr({
- translateX: labelOffsetX,
- translateY: labelOffsetY
- })
- }
- function getConnectedLinks(layout, nodeName, linkType) {
- var result = [];
- var attrName = "in" === linkType ? "_to" : "_from";
- var invertedAttrName = "in" === linkType ? "_from" : "_to";
- layout.links.map(function(link) {
- return link[attrName]._name === nodeName
- }).forEach(function(connected, idx) {
- connected && result.push({
- index: idx,
- weight: layout.links[idx]._weight,
- node: layout.links[idx][invertedAttrName]._name
- })
- });
- return result
- }
- var dxSankey = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
- _rootClass: "dxs-sankey",
- _rootClassPrefix: "dxs",
- _proxyData: [],
- _optionChangesMap: {
- dataSource: "DATA_SOURCE",
- sortData: "DATA_SOURCE",
- alignment: "DATA_SOURCE",
- node: "BUILD_LAYOUT",
- link: "BUILD_LAYOUT",
- palette: "BUILD_LAYOUT",
- paletteExtensionMode: "BUILD_LAYOUT"
- },
- _themeDependentChanges: ["BUILD_LAYOUT"],
- _getDefaultSize: function() {
- return {
- width: 400,
- height: 400
- }
- },
- _themeSection: "sankey",
- _fontFields: ["label.font"],
- _optionChangesOrder: ["DATA_SOURCE"],
- _initialChanges: ["DATA_SOURCE"],
- _initCore: function() {
- this._groupLinks = this._renderer.g().append(this._renderer.root);
- this._groupNodes = this._renderer.g().append(this._renderer.root);
- this._groupLabels = this._renderer.g().attr({
- "class": this._rootClassPrefix + "-labels"
- }).append(this._renderer.root);
- this._drawLabels = true;
- this._nodes = [];
- this._links = [];
- this._gradients = []
- },
- _disposeCore: noop,
- _applySize: function(rect) {
- this._rect = rect.slice();
- var adaptiveLayout = this._getOption("adaptiveLayout");
- if (adaptiveLayout.keepLabels || this._rect[2] - this._rect[0] > adaptiveLayout.width) {
- this._drawLabels = true
- } else {
- this._drawLabels = false
- }
- this._change(["BUILD_LAYOUT"]);
- return this._rect
- },
- _eventsMap: {
- onNodeHoverChanged: {
- name: "nodeHoverChanged"
- },
- onLinkHoverChanged: {
- name: "linkHoverChanged"
- }
- },
- _customChangesOrder: ["BUILD_LAYOUT", "NODES_DRAW", "LINKS_DRAW", "LABELS", "DRAWN"],
- _dataSourceChangedHandler: function() {
- this._requestChange(["BUILD_LAYOUT"])
- },
- _change_DRAWN: function() {
- this._drawn()
- },
- _change_DATA_SOURCE: function() {
- this._change(["DRAWN"]);
- this._updateDataSource()
- },
- _change_LABELS: function() {
- this._applyLabelsAppearance()
- },
- _change_BUILD_LAYOUT: function() {
- this._groupNodes.clear();
- this._groupLinks.clear();
- this._groupLabels.clear();
- this._buildLayout()
- },
- _change_NODES_DRAW: function() {
- var that = this;
- var nodes = that._nodes;
- nodes.forEach(function(node, index) {
- var element = that._renderer.rect().attr(node.rect).append(that._groupNodes);
- node.element = element
- });
- this._applyNodesAppearance()
- },
- _change_LINKS_DRAW: function() {
- var that = this;
- var links = that._links;
- links.forEach(function(link, index) {
- var group = that._renderer.g().attr({
- "class": "link",
- "data-link-idx": index
- }).append(that._groupLinks);
- link.overlayElement = that._renderer.path([], "area").attr({
- d: link.d
- }).append(group);
- link.element = that._renderer.path([], "area").attr({
- d: link.d
- }).append(group)
- });
- this._applyLinksAppearance()
- },
- _suspend: function() {
- if (!this._applyingChanges) {
- this._suspendChanges()
- }
- },
- _resume: function() {
- if (!this._applyingChanges) {
- this._resumeChanges()
- }
- },
- _showTooltip: noop,
- hideTooltip: noop,
- clearHover: function() {
- this._suspend();
- this._nodes.forEach(function(node) {
- node.isHovered() && node.hover(false)
- });
- this._links.forEach(function(link) {
- link.isHovered() && link.hover(false);
- link.isAdjacentNodeHovered() && link.adjacentNodeHover(false)
- });
- this._resume()
- },
- _applyNodesAppearance: function() {
- this._nodes.forEach(function(node) {
- var state = node.getState();
- node.element.smartAttr(node.states[state])
- })
- },
- _applyLinksAppearance: function() {
- this._links.forEach(function(link) {
- var state = link.getState();
- link.element.smartAttr(link.states[state]);
- link.overlayElement.smartAttr(link.overlayStates[state])
- })
- },
- _hitTestTargets: function(x, y) {
- var that = this;
- var data;
- this._proxyData.some(function(callback) {
- data = callback.call(that, x, y);
- if (data) {
- return true
- }
- });
- return data
- },
- _getData: function() {
- var that = this;
- var data = that._dataSourceItems() || [];
- var sourceField = that._getOption("sourceField", true);
- var targetField = that._getOption("targetField", true);
- var weightField = that._getOption("weightField", true);
- var processedData = [];
- data.forEach(function(item) {
- var hasItemOwnProperty = Object.prototype.hasOwnProperty.bind(item);
- if (!hasItemOwnProperty(sourceField)) {
- that._incidentOccurred("E2007", sourceField)
- } else {
- if (!hasItemOwnProperty(targetField)) {
- that._incidentOccurred("E2007", targetField)
- } else {
- if (!hasItemOwnProperty(weightField)) {
- that._incidentOccurred("E2007", weightField)
- } else {
- if (!_isString(item[sourceField])) {
- that._incidentOccurred("E2008", sourceField)
- } else {
- if (!_isString(item[targetField])) {
- that._incidentOccurred("E2008", targetField)
- } else {
- if (!_isNumber(item[weightField]) || item[weightField] <= 0) {
- that._incidentOccurred("E2009", weightField)
- } else {
- processedData.push([item[sourceField], item[targetField], item[weightField]])
- }
- }
- }
- }
- }
- }
- });
- return processedData
- },
- _buildLayout: function() {
- var _this = this;
- var that = this;
- var data = that._getData();
- var availableRect = this._rect;
- var nodeOptions = that._getOption("node");
- var sortData = that._getOption("sortData");
- var layoutBuilder = that._getOption("layoutBuilder", true) || defaultLayoutBuilder;
- var rect = {
- x: availableRect[0],
- y: availableRect[1],
- width: availableRect[2] - availableRect[0],
- height: availableRect[3] - availableRect[1]
- };
- var layout = layoutBuilder.computeLayout(data, sortData, {
- availableRect: rect,
- nodePadding: nodeOptions.padding,
- nodeWidth: nodeOptions.width,
- nodeAlign: that._getOption("alignment", true)
- }, that._incidentOccurred);
- that._layoutMap = layout;
- if (!Object.prototype.hasOwnProperty.call(layout, "error")) {
- var nodeColors = {};
- var nodeIdx = 0;
- var linkOptions = that._getOption("link");
- var totalNodesNum = layout.nodes.map(function(item) {
- return item.length
- }).reduce(function(previousValue, currentValue) {
- return previousValue + currentValue
- }, 0);
- var palette = that._themeManager.createPalette(that._getOption("palette", true), {
- useHighlight: true,
- extensionMode: that._getOption("paletteExtensionMode", true),
- count: totalNodesNum
- });
- that._nodes = [];
- that._links = [];
- that._gradients.forEach(function(gradient) {
- gradient.dispose()
- });
- that._gradients = [];
- that._shadowFilter && that._shadowFilter.dispose();
- layout.nodes.forEach(function(cascadeNodes) {
- cascadeNodes.forEach(function(node) {
- var color = nodeOptions.color || palette.getNextColor();
- var nodeItem = new Node(that, {
- id: nodeIdx,
- color: color,
- rect: node,
- options: nodeOptions,
- linksIn: getConnectedLinks(layout, node._name, "in"),
- linksOut: getConnectedLinks(layout, node._name, "out")
- });
- that._nodes.push(nodeItem);
- nodeIdx++;
- nodeColors[node._name] = color
- })
- });
- layout.links.forEach(function(link) {
- var gradient = null;
- if (linkOptions.colorMode === _constants.COLOR_MODE_GRADIENT) {
- gradient = that._renderer.linearGradient([{
- offset: "0%",
- "stop-color": nodeColors[link._from._name]
- }, {
- offset: "100%",
- "stop-color": nodeColors[link._to._name]
- }]);
- _this._gradients.push(gradient)
- }
- var color = linkOptions.color;
- if (linkOptions.colorMode === _constants.COLOR_MODE_SOURCE) {
- color = nodeColors[link._from._name]
- } else {
- if (linkOptions.colorMode === _constants.COLOR_MODE_TARGET) {
- color = nodeColors[link._to._name]
- }
- }
- var linkItem = new Link(that, {
- d: link.d,
- boundingRect: link._boundingRect,
- color: color,
- options: linkOptions,
- connection: {
- source: link._from._name,
- target: link._to._name,
- weight: link._weight
- },
- gradient: gradient
- });
- that._links.push(linkItem)
- });
- that._renderer.initHatching();
- that._change(["NODES_DRAW", "LINKS_DRAW", "LABELS"])
- }
- that._change(["DRAWN"])
- },
- _applyLabelsAppearance: function() {
- var that = this;
- var labelOptions = that._getOption("label");
- var availableWidth = that._rect[2] - that._rect[0];
- var nodeOptions = that._getOption("node");
- that._shadowFilter = that._renderer.shadowFilter("-50%", "-50%", "200%", "200%").attr(labelOptions.shadow);
- that._groupLabels.clear();
- if (that._drawLabels && labelOptions.visible) {
- var availableLabelWidth = (availableWidth - (nodeOptions.width + labelOptions.horizontalOffset) - that._layoutMap.cascades.length * nodeOptions.width) / (that._layoutMap.cascades.length - 1) - labelOptions.horizontalOffset;
- that._nodes.forEach(function(node) {
- that._createLabel(node, labelOptions, that._shadowFilter.id);
- moveLabel(node, labelOptions, availableLabelWidth, that._rect)
- });
- if ("none" !== labelOptions.overlappingBehavior) {
- that._nodes.forEach(function(thisNode) {
- var thisBox = thisNode.label.getBBox();
- that._nodes.forEach(function(otherNode) {
- var otherBox = otherNode.label.getBBox();
- if (thisNode.id !== otherNode.id && defaultLayoutBuilder.overlap(thisBox, otherBox)) {
- if ("ellipsis" === labelOptions.overlappingBehavior) {
- thisNode.labelText.applyEllipsis(otherBox.x - thisBox.x)
- } else {
- if ("hide" === labelOptions.overlappingBehavior) {
- thisNode.labelText.remove()
- }
- }
- }
- })
- })
- }
- }
- },
- _createLabel: function(node, labelOptions, filter) {
- var textData = labelOptions.customizeText(node);
- var settings = node.getLabelAttributes(labelOptions, filter);
- if (textData) {
- node.label = this._renderer.g().append(this._groupLabels);
- node.labelText = this._renderer.text(textData).attr(settings.attr).css(settings.css);
- node.labelText.append(node.label)
- }
- },
- _getMinSize: function() {
- var adaptiveLayout = this._getOption("adaptiveLayout");
- return [adaptiveLayout.width, adaptiveLayout.height]
- },
- getAllNodes: function() {
- return this._nodes.slice()
- },
- getAllLinks: function() {
- return this._links.slice()
- }
- });
- __webpack_require__( /*! ../../core/component_registrator */ 9)("dxSankey", dxSankey);
- module.exports = dxSankey;
- dxSankey.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/constants.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.COLOR_MODE_GRADIENT = "gradient";
- exports.COLOR_MODE_SOURCE = "source";
- exports.COLOR_MODE_TARGET = "target";
- exports.COLOR_MODE_NONE = "none"
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/graph.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var WHITE = "white";
- var GRAY = "gray";
- var BLACK = "black";
- var routines = {
- maxOfArray: function(arr, callback) {
- var m = 0;
- var callback_function = function(v) {
- return v
- };
- if (callback) {
- callback_function = callback
- }
- for (var i = 0; i < arr.length; i++) {
- if (callback_function(arr[i]) > m) {
- m = callback_function(arr[i])
- }
- }
- return m
- }
- };
- var getVertices = function(links) {
- var vert = [];
- links.forEach(function(link) {
- if (vert.indexOf(link[0]) === -1) {
- vert.push(link[0])
- }
- if (vert.indexOf(link[1]) === -1) {
- vert.push(link[1])
- }
- });
- return vert
- };
- var getAdjacentVertices = function(links, vertex) {
- var avert = [];
- links.forEach(function(link) {
- if (link[0] === vertex && avert.indexOf(link[1]) === -1) {
- avert.push(link[1])
- }
- });
- return avert
- };
- var getReverseAdjacentVertices = function(links, vertex) {
- var avert = [];
- links.forEach(function(link) {
- if (link[1] === vertex && avert.indexOf(link[0]) === -1) {
- avert.push(link[0])
- }
- });
- return avert
- };
- var struct = {
- _hasCycle: false,
- _sortedList: [],
- hasCycle: function(links) {
- var _this = this;
- this._hasCycle = false;
- this._sortedList = [];
- var vertices = {};
- var allVertices = getVertices(links);
- allVertices.forEach(function(vertex) {
- vertices[vertex] = {
- color: WHITE
- }
- });
- allVertices.forEach(function(vertex) {
- if (vertices[vertex].color === WHITE) {
- _this._depthFirstSearch(links, vertices, vertex)
- }
- });
- this._sortedList.reverse();
- return this._hasCycle
- },
- _depthFirstSearch: function(links, vertices, vertex) {
- vertices[vertex].color = GRAY;
- var averts = getAdjacentVertices(links, vertex);
- for (var a = 0; a < averts.length; a++) {
- if (vertices[averts[a]].color === WHITE) {
- this._depthFirstSearch(links, vertices, averts[a])
- } else {
- if (vertices[averts[a]].color === GRAY) {
- this._hasCycle = true
- }
- }
- }
- this._sortedList.push({
- name: vertex,
- lp: null,
- incoming: getReverseAdjacentVertices(links, vertex),
- outgoing: getAdjacentVertices(links, vertex)
- });
- vertices[vertex].color = BLACK
- },
- computeLongestPaths: function(links) {
- var sortedVertices = this._sortedList;
- sortedVertices.forEach(function(vertex) {
- var averts = getReverseAdjacentVertices(links, vertex.name);
- if (0 === averts.length) {
- vertex.lp = 0
- } else {
- var maxLP = [];
- averts.forEach(function(adjacentVertex) {
- maxLP.push(sortedVertices.filter(function(sv) {
- return sv.name === adjacentVertex
- })[0].lp)
- });
- vertex.lp = routines.maxOfArray(maxLP) + 1
- }
- });
- return this._sortedList
- }
- };
- module.exports = {
- struct: struct,
- routines: routines,
- getVertices: getVertices,
- getAdjacentVertices: getAdjacentVertices,
- getReverseAdjacentVertices: getReverseAdjacentVertices
- }
- }, , ,
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel_creator.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _class = __webpack_require__( /*! ../core/class */ 15);
- var _class2 = _interopRequireDefault(_class);
- var _window = __webpack_require__( /*! ../core/utils/window */ 7);
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
- var _ui = __webpack_require__( /*! ../ui/widget/ui.errors */ 17);
- var _ui2 = _interopRequireDefault(_ui);
- var _string = __webpack_require__( /*! ../core/utils/string */ 44);
- var _string2 = _interopRequireDefault(_string);
- var _jszip = __webpack_require__( /*! jszip */ 432);
- var _jszip2 = _interopRequireDefault(_jszip);
- var _file_saver = __webpack_require__( /*! ./file_saver */ 207);
- var _file_saver2 = _interopRequireDefault(_file_saver);
- var _excel_format_converter = __webpack_require__( /*! ./excel_format_converter */ 178);
- var _excel_format_converter2 = _interopRequireDefault(_excel_format_converter);
- var _excel = __webpack_require__( /*! ./excel/excel.file */ 433);
- var _excel2 = _interopRequireDefault(_excel);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var XML_TAG = '<?xml version="1.0" encoding="utf-8"?>';
- var GROUP_SHEET_PR_XML = '<sheetPr><outlinePr summaryBelow="0"/></sheetPr>';
- var SINGLE_SHEET_PR_XML = "<sheetPr/>";
- var BASE_STYLE_XML2 = '<borders count="1"><border><left style="thin"><color rgb="FFD3D3D3"/></left><right style="thin"><color rgb="FFD3D3D3"/></right><top style="thin"><color rgb="FFD3D3D3"/></top><bottom style="thin"><color rgb="FFD3D3D3"/></bottom></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>';
- var OPEN_XML_FORMAT_URL = "http://schemas.openxmlformats.org";
- var RELATIONSHIP_PART_NAME = "rels";
- var XL_FOLDER_NAME = "xl";
- var WORKBOOK_FILE_NAME = "workbook.xml";
- var CONTENTTYPES_FILE_NAME = "[Content_Types].xml";
- var SHAREDSTRING_FILE_NAME = "sharedStrings.xml";
- var STYLE_FILE_NAME = "styles.xml";
- var WORKSHEETS_FOLDER = "worksheets";
- var WORKSHEET_FILE_NAME = "sheet1.xml";
- var WORKSHEET_HEADER_XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">';
- var VALID_TYPES = {
- "boolean": "b",
- date: "d",
- number: "n",
- string: "s"
- };
- var EXCEL_START_TIME = Date.UTC(1899, 11, 30);
- var DAYS_COUNT_BEFORE_29_FEB_1900 = 60;
- var MAX_DIGIT_WIDTH_IN_PIXELS = 7;
- var UNSUPPORTED_FORMAT_MAPPING = {
- quarter: "shortDate",
- quarterAndYear: "shortDate",
- minute: "longTime",
- millisecond: "longTime"
- };
- var ExcelCreator = _class2.default.inherit({
- _getXMLTag: function(tagName, attributes, content) {
- var result = "<" + tagName;
- var i;
- var length = attributes.length;
- var attr;
- for (i = 0; i < length; i++) {
- attr = attributes[i];
- if (void 0 !== attr.value) {
- result = result + " " + attr.name + '="' + attr.value + '"'
- }
- }
- return (0, _type.isDefined)(content) ? result + ">" + content + "</" + tagName + ">" : result + " />"
- },
- _convertToExcelCellRef: function(zeroBasedRowIndex, zeroBasedCellIndex) {
- var columnName = "";
- var max = 26;
- var charCode;
- var isCellIndexFound;
- while (!isCellIndexFound) {
- charCode = 65 + (zeroBasedCellIndex >= max ? zeroBasedCellIndex % max : Math.ceil(zeroBasedCellIndex));
- columnName = String.fromCharCode(charCode) + columnName;
- if (zeroBasedCellIndex >= max) {
- zeroBasedCellIndex = Math.floor(zeroBasedCellIndex / max) - 1
- } else {
- isCellIndexFound = true
- }
- }
- return columnName + (zeroBasedRowIndex + 1)
- },
- _convertToExcelCellRefAndTrackMaxIndex: function(rowIndex, cellIndex) {
- if (this._maxRowIndex < Number(rowIndex)) {
- this._maxRowIndex = Number(rowIndex)
- }
- if (this._maxColumnIndex < Number(cellIndex)) {
- this._maxColumnIndex = Number(cellIndex)
- }
- return this._convertToExcelCellRef(rowIndex, cellIndex)
- },
- _getDataType: function(dataType) {
- return VALID_TYPES[dataType] || VALID_TYPES.string
- },
- _tryGetExcelCellDataType: function(object) {
- if ((0, _type.isDefined)(object)) {
- if ("number" === typeof object) {
- if (isFinite(object)) {
- return VALID_TYPES.number
- } else {
- return VALID_TYPES.string
- }
- } else {
- if ((0, _type.isString)(object)) {
- return VALID_TYPES.string
- } else {
- if ((0, _type.isDate)(object)) {
- return VALID_TYPES.number
- } else {
- if ((0, _type.isBoolean)(object)) {
- return VALID_TYPES.boolean
- }
- }
- }
- }
- }
- },
- _formatObjectConverter: function(format, dataType) {
- var result = {
- format: format,
- precision: format && format.precision,
- dataType: dataType
- };
- if ((0, _type.isObject)(format)) {
- return (0, _extend.extend)(result, format, {
- format: format.formatter || format.type,
- currency: format.currency
- })
- }
- return result
- },
- _tryConvertToExcelNumberFormat: function(format, dataType) {
- var newFormat = this._formatObjectConverter(format, dataType);
- format = newFormat.format;
- var currency = newFormat.currency;
- dataType = newFormat.dataType;
- if ((0, _type.isDefined)(format) && "date" === dataType) {
- format = UNSUPPORTED_FORMAT_MAPPING[format && format.type || format] || format
- }
- return _excel_format_converter2.default.convertFormat(format, newFormat.precision, dataType, currency)
- },
- _appendString: function(value) {
- if ((0, _type.isDefined)(value)) {
- value = String(value);
- if (value.length) {
- value = _string2.default.encodeHtml(value);
- if (void 0 === this._stringHash[value]) {
- this._stringHash[value] = this._stringArray.length;
- this._stringArray.push(value)
- }
- return this._stringHash[value]
- }
- }
- },
- _tryGetExcelDateValue: function(date) {
- var days;
- var totalTime;
- if ((0, _type.isDate)(date)) {
- days = Math.floor((Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - EXCEL_START_TIME) / 864e5);
- if (days < DAYS_COUNT_BEFORE_29_FEB_1900) {
- days--
- }
- totalTime = (3600 * date.getHours() + 60 * date.getMinutes() + date.getSeconds()) / 86400;
- return days + totalTime
- }
- },
- _prepareValue: function(rowIndex, cellIndex) {
- var dataProvider = this._dataProvider;
- var cellData = dataProvider.getCellData(rowIndex, cellIndex) || {};
- var value = cellData.value;
- var cellSourceData = cellData.cellSourceData;
- var sourceValue;
- var type = this._getDataType(dataProvider.getCellType(rowIndex, cellIndex));
- if (type === VALID_TYPES.date && !(0, _type.isDate)(value)) {
- type = VALID_TYPES.string
- }
- switch (type) {
- case VALID_TYPES.string:
- sourceValue = value;
- value = this._appendString(value);
- break;
- case VALID_TYPES.date:
- sourceValue = value;
- value = this._tryGetExcelDateValue(value);
- type = VALID_TYPES.number
- }
- return {
- value: value,
- type: type,
- sourceValue: sourceValue,
- cellSourceData: cellSourceData
- }
- },
- _callCustomizeExcelCell: function(_ref) {
- var dataProvider = _ref.dataProvider,
- value = _ref.value,
- style = _ref.style,
- sourceData = _ref.sourceData;
- var styleCopy = _excel2.default.copyCellFormat(style);
- var args = {
- value: value,
- numberFormat: styleCopy.numberFormat,
- clearStyle: function() {
- this.horizontalAlignment = null;
- this.verticalAlignment = null;
- this.wrapTextEnabled = null;
- this.font = null;
- this.numberFormat = null
- }
- };
- if ((0, _type.isDefined)(styleCopy)) {
- if ((0, _type.isDefined)(styleCopy.alignment)) {
- args.horizontalAlignment = styleCopy.alignment.horizontal;
- args.verticalAlignment = styleCopy.alignment.vertical;
- args.wrapTextEnabled = styleCopy.alignment.wrapText
- }
- args.backgroundColor = styleCopy.backgroundColor;
- args.fillPatternType = styleCopy.fillPatternType;
- args.fillPatternColor = styleCopy.fillPatternColor;
- args.font = styleCopy.font
- }
- dataProvider.customizeExcelCell(args, sourceData);
- var newStyle = styleCopy || {};
- newStyle.font = args.font;
- newStyle.alignment = newStyle.alignment || {};
- newStyle.alignment.horizontal = args.horizontalAlignment;
- newStyle.alignment.vertical = args.verticalAlignment;
- newStyle.alignment.wrapText = args.wrapTextEnabled;
- newStyle.backgroundColor = args.backgroundColor;
- newStyle.fillPatternType = args.fillPatternType;
- newStyle.fillPatternColor = args.fillPatternColor;
- newStyle.numberFormat = args.numberFormat;
- return {
- value: args.value,
- style: newStyle
- }
- },
- _getDataArray: function() {
- var that = this;
- var rowIndex;
- var cellIndex;
- var cellsArray;
- var cellData;
- var result = [];
- var dataProvider = that._dataProvider;
- var rowsLength = dataProvider.getRowsCount();
- var columns = dataProvider.getColumns();
- var cellsLength;
- for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) {
- cellsArray = [];
- cellsLength = columns.length;
- for (cellIndex = 0; cellIndex !== cellsLength; cellIndex++) {
- cellData = that._prepareValue(rowIndex, cellIndex);
- var styleArrayIndex = dataProvider.getStyleId(rowIndex, cellIndex);
- var cellStyleId = this._styleArrayIndexToCellStyleIdMap[styleArrayIndex];
- if (dataProvider.hasCustomizeExcelCell && dataProvider.hasCustomizeExcelCell()) {
- var value = cellData.sourceValue || cellData.value;
- var modifiedExcelCell = this._callCustomizeExcelCell({
- dataProvider: dataProvider,
- value: value,
- style: that._styleArray[styleArrayIndex],
- sourceData: cellData.cellSourceData
- });
- if (modifiedExcelCell.value !== value) {
- if (_typeof(modifiedExcelCell.value) !== _typeof(value) || "number" === typeof modifiedExcelCell.value && !isFinite(modifiedExcelCell.value)) {
- var cellDataType = this._tryGetExcelCellDataType(modifiedExcelCell.value);
- if ((0, _type.isDefined)(cellDataType)) {
- cellData.type = cellDataType
- }
- }
- switch (cellData.type) {
- case VALID_TYPES.string:
- cellData.value = this._appendString(modifiedExcelCell.value);
- break;
- case VALID_TYPES.date:
- cellData.value = modifiedExcelCell.value;
- break;
- case VALID_TYPES.number:
- var newValue = modifiedExcelCell.value;
- var excelDateValue = this._tryGetExcelDateValue(newValue);
- if ((0, _type.isDefined)(excelDateValue)) {
- newValue = excelDateValue
- }
- cellData.value = newValue;
- break;
- default:
- cellData.value = modifiedExcelCell.value
- }
- }
- cellStyleId = this._excelFile.registerCellFormat(modifiedExcelCell.style)
- }
- cellsArray.push({
- style: cellStyleId,
- value: cellData.value,
- type: cellData.type
- })
- }
- if (!that._needSheetPr && dataProvider.getGroupLevel(rowIndex) > 0) {
- that._needSheetPr = true
- }
- result.push(cellsArray)
- }
- return result
- },
- _calculateWidth: function(pixelsWidth) {
- pixelsWidth = parseInt(pixelsWidth, 10);
- if (!pixelsWidth || pixelsWidth < 5) {
- pixelsWidth = 100
- }
- return Math.min(255, Math.floor((pixelsWidth - 5) / MAX_DIGIT_WIDTH_IN_PIXELS * 100 + .5) / 100)
- },
- _prepareStyleData: function() {
- var _this = this;
- var that = this;
- var styles = that._dataProvider.getStyles();
- that._dataProvider.getColumns().forEach(function(column) {
- that._colsArray.push(that._calculateWidth(column.width))
- });
- var fonts = [{
- size: 11,
- color: {
- theme: 1
- },
- name: "Calibri",
- family: 2,
- scheme: "minor",
- bold: false
- }, {
- size: 11,
- color: {
- theme: 1
- },
- name: "Calibri",
- family: 2,
- scheme: "minor",
- bold: true
- }];
- this._excelFile.registerFont(fonts[0]);
- this._excelFile.registerFont(fonts[1]);
- styles.forEach(function(style) {
- var numberFormat = that._tryConvertToExcelNumberFormat(style.format, style.dataType);
- if (!(0, _type.isDefined)(numberFormat)) {
- numberFormat = 0
- }
- that._styleArray.push({
- font: fonts[Number(!!style.bold)],
- numberFormat: numberFormat,
- alignment: {
- vertical: "top",
- wrapText: !!style.wrapText,
- horizontal: style.alignment || "left"
- }
- })
- });
- that._styleArrayIndexToCellStyleIdMap = that._styleArray.map(function(item) {
- return _this._excelFile.registerCellFormat(item)
- })
- },
- _prepareCellData: function() {
- this._cellsArray = this._getDataArray()
- },
- _createXMLRelationships: function(xmlRelationships) {
- return this._getXMLTag("Relationships", [{
- name: "xmlns",
- value: OPEN_XML_FORMAT_URL + "/package/2006/relationships"
- }], xmlRelationships)
- },
- _createXMLRelationship: function(id, type, target) {
- return this._getXMLTag("Relationship", [{
- name: "Id",
- value: "rId" + id
- }, {
- name: "Type",
- value: OPEN_XML_FORMAT_URL + "/officeDocument/2006/relationships/" + type
- }, {
- name: "Target",
- value: target
- }])
- },
- _getWorkbookContent: function() {
- var content = '<bookViews><workbookView xWindow="0" yWindow="0" windowWidth="0" windowHeight="0"/></bookViews><sheets><sheet name="Sheet" sheetId="1" r:id="rId1" /></sheets><definedNames><definedName name="_xlnm.Print_Titles" localSheetId="0">Sheet!$1:$1</definedName><definedName name="_xlnm._FilterDatabase" hidden="0" localSheetId="0">Sheet!$A$1:$F$6332</definedName></definedNames>';
- return XML_TAG + this._getXMLTag("workbook", [{
- name: "xmlns:r",
- value: OPEN_XML_FORMAT_URL + "/officeDocument/2006/relationships"
- }, {
- name: "xmlns",
- value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main"
- }], content)
- },
- _getContentTypesContent: function() {
- return XML_TAG + '<Types xmlns="' + OPEN_XML_FORMAT_URL + '/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /></Types>'
- },
- _generateStylesXML: function() {
- var that = this;
- var folder = that._zip.folder(XL_FOLDER_NAME);
- var XML = "";
- XML += this._excelFile.generateNumberFormatsXml();
- XML += this._excelFile.generateFontsXml();
- XML += this._excelFile.generateFillsXml();
- XML += BASE_STYLE_XML2;
- XML += this._excelFile.generateCellFormatsXml();
- XML += that._getXMLTag("cellStyles", [{
- name: "count",
- value: 1
- }], that._getXMLTag("cellStyle", [{
- name: "name",
- value: "Normal"
- }, {
- name: "xfId",
- value: 0
- }, {
- name: "builtinId",
- value: 0
- }]));
- XML = XML_TAG + that._getXMLTag("styleSheet", [{
- name: "xmlns",
- value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main"
- }], XML);
- folder.file(STYLE_FILE_NAME, XML);
- that._styleArray = []
- },
- _generateStringsXML: function() {
- var folder = this._zip.folder(XL_FOLDER_NAME);
- var stringIndex;
- var stringsLength = this._stringArray.length;
- var sharedStringXml = XML_TAG;
- for (stringIndex = 0; stringIndex < stringsLength; stringIndex++) {
- this._stringArray[stringIndex] = this._getXMLTag("si", [], this._getXMLTag("t", [], this._stringArray[stringIndex]))
- }
- sharedStringXml += this._getXMLTag("sst", [{
- name: "xmlns",
- value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main"
- }, {
- name: "count",
- value: this._stringArray.length
- }, {
- name: "uniqueCount",
- value: this._stringArray.length
- }], this._stringArray.join(""));
- folder.file(SHAREDSTRING_FILE_NAME, sharedStringXml);
- this._stringArray = []
- },
- _getPaneXML: function() {
- var attributes = [{
- name: "activePane",
- value: "bottomLeft"
- }, {
- name: "state",
- value: "frozen"
- }];
- var frozenArea = this._dataProvider.getFrozenArea();
- if (!(frozenArea.x || frozenArea.y)) {
- return ""
- }
- if (frozenArea.x) {
- attributes.push({
- name: "xSplit",
- value: frozenArea.x
- })
- }
- if (frozenArea.y) {
- attributes.push({
- name: "ySplit",
- value: frozenArea.y
- })
- }
- attributes.push({
- name: "topLeftCell",
- value: this._convertToExcelCellRefAndTrackMaxIndex(frozenArea.y, frozenArea.x)
- });
- return this._getXMLTag("pane", attributes)
- },
- _getAutoFilterXML: function(maxCellIndex) {
- if (this._options.autoFilterEnabled) {
- return '<autoFilter ref="A' + this._dataProvider.getHeaderRowCount() + ":" + maxCellIndex + '" />'
- }
- return ""
- },
- _getIgnoredErrorsXML: function(maxCellIndex) {
- if (this._options.ignoreErrors) {
- return '<ignoredErrors><ignoredError sqref="A1:' + maxCellIndex + '" numberStoredAsText="1" /></ignoredErrors>'
- }
- return ""
- },
- _generateWorksheetXML: function() {
- var colIndex;
- var rowIndex;
- var cellData;
- var xmlCells;
- var xmlRows = [];
- var rowsLength = this._cellsArray.length;
- var cellsLength;
- var colsLength = this._colsArray.length;
- var rSpans = "1:" + colsLength;
- var headerRowCount = this._dataProvider.getHeaderRowCount ? this._dataProvider.getHeaderRowCount() : 1;
- var xmlResult = [WORKSHEET_HEADER_XML];
- xmlResult.push(this._needSheetPr ? GROUP_SHEET_PR_XML : SINGLE_SHEET_PR_XML);
- xmlResult.push('<dimension ref="A1:C1"/>');
- xmlResult.push("<sheetViews><sheetView ");
- xmlResult.push(this._rtlEnabled ? 'rightToLeft="1" ' : "");
- xmlResult.push('tabSelected="1" workbookViewId="0">');
- xmlResult.push(this._getPaneXML());
- xmlResult.push("</sheetView></sheetViews>");
- xmlResult.push('<sheetFormatPr defaultRowHeight="15"');
- xmlResult.push(' outlineLevelRow="' + (this._dataProvider.getRowsCount() > 0 ? this._dataProvider.getGroupLevel(0) : 0) + '"');
- xmlResult.push(' x14ac:dyDescent="0.25"/>');
- for (colIndex = 0; colIndex < colsLength; colIndex++) {
- this._colsArray[colIndex] = this._getXMLTag("col", [{
- name: "width",
- value: this._colsArray[colIndex]
- }, {
- name: "min",
- value: Number(colIndex) + 1
- }, {
- name: "max",
- value: Number(colIndex) + 1
- }])
- }
- xmlResult.push(this._getXMLTag("cols", [], this._colsArray.join("")) + "<sheetData>");
- for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) {
- xmlCells = [];
- cellsLength = this._cellsArray[rowIndex].length;
- for (colIndex = 0; colIndex < cellsLength; colIndex++) {
- rowIndex = Number(rowIndex);
- cellData = this._cellsArray[rowIndex][colIndex];
- xmlCells.push(this._getXMLTag("c", [{
- name: "r",
- value: this._convertToExcelCellRefAndTrackMaxIndex(rowIndex, colIndex)
- }, {
- name: "s",
- value: cellData.style
- }, {
- name: "t",
- value: cellData.type
- }], (0, _type.isDefined)(cellData.value) ? this._getXMLTag("v", [], cellData.value) : null))
- }
- xmlRows.push(this._getXMLTag("row", [{
- name: "r",
- value: Number(rowIndex) + 1
- }, {
- name: "spans",
- value: rSpans
- }, {
- name: "outlineLevel",
- value: rowIndex >= headerRowCount ? this._dataProvider.getGroupLevel(rowIndex) : 0
- }, {
- name: "x14ac:dyDescent",
- value: "0.25"
- }], xmlCells.join("")));
- this._cellsArray[rowIndex] = null;
- if (xmlRows.length > 1e4) {
- xmlResult.push(xmlRows.join(""));
- xmlRows = []
- }
- }
- xmlResult.push(xmlRows.join(""));
- xmlRows = [];
- var rightBottomCellRef = this._convertToExcelCellRef(this._maxRowIndex, this._maxColumnIndex);
- xmlResult.push("</sheetData>" + this._getAutoFilterXML(rightBottomCellRef) + this._generateMergingXML() + this._getIgnoredErrorsXML(rightBottomCellRef) + "</worksheet>");
- this._zip.folder(XL_FOLDER_NAME).folder(WORKSHEETS_FOLDER).file(WORKSHEET_FILE_NAME, xmlResult.join(""));
- this._colsArray = [];
- this._cellsArray = [];
- xmlResult = []
- },
- _generateMergingXML: function() {
- var k;
- var l;
- var cellIndex;
- var rowIndex;
- var rowsLength = (0, _type.isDefined)(this._dataProvider.getHeaderRowCount) ? this._dataProvider.getHeaderRowCount() : this._dataProvider.getRowsCount();
- var columnsLength = this._dataProvider.getColumns().length;
- var usedArea = [];
- var mergeArray = [];
- var mergeIndex;
- var mergeXML = "";
- for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) {
- for (cellIndex = 0; cellIndex !== columnsLength; cellIndex++) {
- if (!(0, _type.isDefined)(usedArea[rowIndex]) || !(0, _type.isDefined)(usedArea[rowIndex][cellIndex])) {
- var cellMerge = this._dataProvider.getCellMerging(rowIndex, cellIndex);
- if (cellMerge.colspan || cellMerge.rowspan) {
- mergeArray.push({
- start: this._convertToExcelCellRefAndTrackMaxIndex(rowIndex, cellIndex),
- end: this._convertToExcelCellRefAndTrackMaxIndex(rowIndex + (cellMerge.rowspan || 0), cellIndex + (cellMerge.colspan || 0))
- });
- for (k = rowIndex; k <= rowIndex + cellMerge.rowspan || 0; k++) {
- for (l = cellIndex; l <= cellIndex + cellMerge.colspan || 0; l++) {
- if (!(0, _type.isDefined)(usedArea[k])) {
- usedArea[k] = []
- }
- usedArea[k][l] = true
- }
- }
- }
- }
- }
- }
- var mergeArrayLength = mergeArray.length;
- for (mergeIndex = 0; mergeIndex < mergeArrayLength; mergeIndex++) {
- mergeXML += this._getXMLTag("mergeCell", [{
- name: "ref",
- value: mergeArray[mergeIndex].start + ":" + mergeArray[mergeIndex].end
- }])
- }
- return mergeXML.length ? this._getXMLTag("mergeCells", [{
- name: "count",
- value: mergeArrayLength
- }], mergeXML) : ""
- },
- _generateCommonXML: function() {
- var relsFileContent = XML_TAG + this._createXMLRelationships(this._createXMLRelationship(1, "officeDocument", "xl/" + WORKBOOK_FILE_NAME));
- var folder = this._zip.folder(XL_FOLDER_NAME);
- var relsXML = XML_TAG;
- this._zip.folder("_" + RELATIONSHIP_PART_NAME).file("." + RELATIONSHIP_PART_NAME, relsFileContent);
- var xmlRelationships = this._createXMLRelationship(1, "worksheet", "worksheets/" + WORKSHEET_FILE_NAME) + this._createXMLRelationship(2, "styles", STYLE_FILE_NAME) + this._createXMLRelationship(3, "sharedStrings", SHAREDSTRING_FILE_NAME);
- relsXML += this._createXMLRelationships(xmlRelationships);
- folder.folder("_" + RELATIONSHIP_PART_NAME).file(WORKBOOK_FILE_NAME + ".rels", relsXML);
- folder.file(WORKBOOK_FILE_NAME, this._getWorkbookContent());
- this._zip.file(CONTENTTYPES_FILE_NAME, this._getContentTypesContent())
- },
- _generateContent: function() {
- this._prepareStyleData();
- this._prepareCellData();
- this._generateWorkXML();
- this._generateCommonXML()
- },
- _generateWorkXML: function() {
- this._generateStylesXML();
- this._generateStringsXML();
- this._generateWorksheetXML()
- },
- ctor: function(dataProvider, options) {
- this._rtlEnabled = options && !!options.rtlEnabled;
- this._options = options;
- this._maxRowIndex = 0;
- this._maxColumnIndex = 0;
- this._stringArray = [];
- this._stringHash = {};
- this._styleArray = [];
- this._colsArray = [];
- this._cellsArray = [];
- this._needSheetPr = false;
- this._dataProvider = dataProvider;
- this._excelFile = new _excel2.default;
- if ((0, _type.isDefined)(ExcelCreator.JSZip)) {
- this._zip = new ExcelCreator.JSZip
- } else {
- this._zip = null
- }
- },
- _checkZipState: function() {
- if (!this._zip) {
- throw _ui2.default.Error("E1041", "JSZip")
- }
- },
- ready: function() {
- return this._dataProvider.ready()
- },
- getData: function(isBlob) {
- var options = {
- type: isBlob ? "blob" : "base64",
- compression: "DEFLATE",
- mimeType: _file_saver2.default.MIME_TYPES.EXCEL
- };
- this._checkZipState();
- this._generateContent();
- return this._zip.generateAsync ? this._zip.generateAsync(options) : this._zip.generate(options)
- }
- });
- ExcelCreator.JSZip = _jszip2.default;
- exports.ExcelCreator = ExcelCreator;
- exports.getData = function(data, options, callback) {
- var excelCreator = new exports.ExcelCreator(data, options);
- excelCreator._checkZipState();
- excelCreator.ready().done(function() {
- if (excelCreator._zip.generateAsync) {
- excelCreator.getData((0, _type.isFunction)((0, _window.getWindow)().Blob)).then(callback)
- } else {
- callback(excelCreator.getData((0, _type.isFunction)((0, _window.getWindow)().Blob)))
- }
- })
- };
- exports.__internals = {
- CONTENTTYPES_FILE_NAME: CONTENTTYPES_FILE_NAME,
- RELATIONSHIP_PART_NAME: RELATIONSHIP_PART_NAME,
- XL_FOLDER_NAME: XL_FOLDER_NAME,
- WORKBOOK_FILE_NAME: WORKBOOK_FILE_NAME,
- STYLE_FILE_NAME: STYLE_FILE_NAME,
- WORKSHEET_FILE_NAME: WORKSHEET_FILE_NAME,
- WORKSHEETS_FOLDER: WORKSHEETS_FOLDER,
- WORKSHEET_HEADER_XML: WORKSHEET_HEADER_XML,
- SHAREDSTRING_FILE_NAME: SHAREDSTRING_FILE_NAME,
- GROUP_SHEET_PR_XML: GROUP_SHEET_PR_XML,
- SINGLE_SHEET_PR_XML: SINGLE_SHEET_PR_XML,
- BASE_STYLE_XML2: BASE_STYLE_XML2,
- XML_TAG: XML_TAG
- }
- },
- /*!*******************************!*\
- !*** external "window.JSZip" ***!
- \*******************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports) {
- module.exports = window.JSZip
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.file.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = void 0;
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- var _excel3 = __webpack_require__( /*! ./excel.cell_format_helper */ 434);
- var _excel4 = _interopRequireDefault(_excel3);
- var _excel5 = __webpack_require__( /*! ./excel.fill_helper */ 259);
- var _excel6 = _interopRequireDefault(_excel5);
- var _excel7 = __webpack_require__( /*! ./excel.font_helper */ 261);
- var _excel8 = _interopRequireDefault(_excel7);
- var _excel9 = __webpack_require__( /*! ./excel.number_format_helper */ 437);
- var _excel10 = _interopRequireDefault(_excel9);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function")
- }
- }
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) {
- descriptor.writable = true
- }
- Object.defineProperty(target, descriptor.key, descriptor)
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) {
- _defineProperties(Constructor.prototype, protoProps)
- }
- if (staticProps) {
- _defineProperties(Constructor, staticProps)
- }
- Object.defineProperty(Constructor, "prototype", {
- writable: false
- });
- return Constructor
- }
- var ExcelFile = function() {
- function ExcelFile() {
- _classCallCheck(this, ExcelFile);
- this._cellFormatTags = [];
- this._fillTags = [];
- this._fontTags = [];
- this._numberFormatTags = [];
- this._fillTags.push(_excel6.default.tryCreateTag({
- patternFill: {
- patternType: "none"
- }
- }))
- }
- _createClass(ExcelFile, [{
- key: "registerCellFormat",
- value: function(cellFormat) {
- var result;
- var cellFormatTag = _excel4.default.tryCreateTag(cellFormat, {
- registerFill: this.registerFill.bind(this),
- registerFont: this.registerFont.bind(this),
- registerNumberFormat: this.registerNumberFormat.bind(this)
- });
- if ((0, _type.isDefined)(cellFormatTag)) {
- for (var i = 0; i < this._cellFormatTags.length; i++) {
- if (_excel4.default.areEqual(this._cellFormatTags[i], cellFormatTag)) {
- result = i;
- break
- }
- }
- if (void 0 === result) {
- result = this._cellFormatTags.push(cellFormatTag) - 1
- }
- }
- return result
- }
- }, {
- key: "generateCellFormatsXml",
- value: function() {
- var cellFormatTagsAsXmlStringsArray = this._cellFormatTags.map(function(tag) {
- return _excel4.default.toXml(tag)
- });
- return _excel2.default.toXml("cellXfs", {
- count: cellFormatTagsAsXmlStringsArray.length
- }, cellFormatTagsAsXmlStringsArray.join(""))
- }
- }, {
- key: "registerFill",
- value: function(fill) {
- var result;
- var fillTag = _excel6.default.tryCreateTag(fill);
- if ((0, _type.isDefined)(fillTag)) {
- for (var i = 0; i < this._fillTags.length; i++) {
- if (_excel6.default.areEqual(this._fillTags[i], fillTag)) {
- result = i;
- break
- }
- }
- if (void 0 === result) {
- if (this._fillTags.length < 2) {
- this._fillTags.push(_excel6.default.tryCreateTag({
- patternFill: {
- patternType: "Gray125"
- }
- }))
- }
- result = this._fillTags.push(fillTag) - 1
- }
- }
- return result
- }
- }, {
- key: "generateFillsXml",
- value: function() {
- var tagsAsXmlStringsArray = this._fillTags.map(function(tag) {
- return _excel6.default.toXml(tag)
- });
- return _excel2.default.toXml("fills", {
- count: tagsAsXmlStringsArray.length
- }, tagsAsXmlStringsArray.join(""))
- }
- }, {
- key: "registerFont",
- value: function(font) {
- var result;
- var fontTag = _excel8.default.tryCreateTag(font);
- if ((0, _type.isDefined)(fontTag)) {
- for (var i = 0; i < this._fontTags.length; i++) {
- if (_excel8.default.areEqual(this._fontTags[i], fontTag)) {
- result = i;
- break
- }
- }
- if (void 0 === result) {
- result = this._fontTags.push(fontTag) - 1
- }
- }
- return result
- }
- }, {
- key: "generateFontsXml",
- value: function() {
- var xmlStringsArray = this._fontTags.map(function(tag) {
- return _excel8.default.toXml(tag)
- });
- return _excel2.default.toXml("fonts", {
- count: xmlStringsArray.length
- }, xmlStringsArray.join(""))
- }
- }, {
- key: "_convertNumberFormatIndexToId",
- value: function(index) {
- var CUSTOM_FORMAT_ID_START_VALUE = 165;
- return CUSTOM_FORMAT_ID_START_VALUE + index
- }
- }, {
- key: "registerNumberFormat",
- value: function(numberFormat) {
- var result;
- var tag = _excel10.default.tryCreateTag(numberFormat);
- if ((0, _type.isDefined)(tag)) {
- for (var i = 0; i < this._numberFormatTags.length; i++) {
- if (_excel10.default.areEqual(this._numberFormatTags[i], tag)) {
- result = this._numberFormatTags[i][_excel10.default.ID_PROPERTY_NAME];
- break
- }
- }
- if (void 0 === result) {
- tag[_excel10.default.ID_PROPERTY_NAME] = this._convertNumberFormatIndexToId(this._numberFormatTags.length);
- result = tag[_excel10.default.ID_PROPERTY_NAME];
- this._numberFormatTags.push(tag)
- }
- }
- return result
- }
- }, {
- key: "generateNumberFormatsXml",
- value: function() {
- if (this._numberFormatTags.length > 0) {
- var xmlStringsArray = this._numberFormatTags.map(function(tag) {
- return _excel10.default.toXml(tag)
- });
- return _excel2.default.toXml("numFmts", {
- count: xmlStringsArray.length
- }, xmlStringsArray.join(""))
- } else {
- return ""
- }
- }
- }], [{
- key: "copyCellFormat",
- value: function(source) {
- return _excel4.default.copy(source)
- }
- }]);
- return ExcelFile
- }();
- exports.default = ExcelFile;
- module.exports = ExcelFile
- },
- /*!*************************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.cell_format_helper.js ***!
- \*************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- var _excel3 = __webpack_require__( /*! ./excel.cell_alignment_helper */ 435);
- var _excel4 = _interopRequireDefault(_excel3);
- var _excel5 = __webpack_require__( /*! ./excel.fill_helper */ 259);
- var _excel6 = _interopRequireDefault(_excel5);
- var _excel7 = __webpack_require__( /*! ./excel.font_helper */ 261);
- var _excel8 = _interopRequireDefault(_excel7);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var cellFormatHelper = {
- tryCreateTag: function(sourceObj, sharedItemsContainer) {
- var result = null;
- if ((0, _type.isDefined)(sourceObj)) {
- var numberFormatId;
- if ("number" === typeof sourceObj.numberFormat) {
- numberFormatId = sourceObj.numberFormat
- } else {
- numberFormatId = sharedItemsContainer.registerNumberFormat(sourceObj.numberFormat)
- }
- var fill = sourceObj.fill;
- if (!(0, _type.isDefined)(fill)) {
- fill = _excel6.default.tryCreateFillFromSimpleFormat(sourceObj)
- }
- result = {
- numberFormatId: numberFormatId,
- alignment: _excel4.default.tryCreateTag(sourceObj.alignment),
- fontId: sharedItemsContainer.registerFont(sourceObj.font),
- fillId: sharedItemsContainer.registerFill(fill)
- };
- if (cellFormatHelper.isEmpty(result)) {
- result = null
- }
- }
- return result
- },
- copy: function(source) {
- var result;
- if (null === source) {
- result = null
- } else {
- if ((0, _type.isDefined)(source)) {
- result = {};
- if (void 0 !== source.numberFormat) {
- result.numberFormat = source.numberFormat
- }
- if (void 0 !== source.fill) {
- result.fill = _excel6.default.copy(source.fill)
- } else {
- _excel6.default.copySimpleFormat(source, result)
- }
- if (void 0 !== source.alignment) {
- result.alignment = _excel4.default.copy(source.alignment)
- }
- if (void 0 !== source.font) {
- result.font = _excel8.default.copy(source.font)
- }
- }
- }
- return result
- },
- areEqual: function(leftTag, rightTag) {
- return cellFormatHelper.isEmpty(leftTag) && cellFormatHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.fontId === rightTag.fontId && leftTag.numberFormatId === rightTag.numberFormatId && leftTag.fillId === rightTag.fillId && _excel4.default.areEqual(leftTag.alignment, rightTag.alignment)
- },
- isEmpty: function(tag) {
- return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.fontId) && !(0, _type.isDefined)(tag.numberFormatId) && !(0, _type.isDefined)(tag.fillId) && _excel4.default.isEmpty(tag.alignment)
- },
- toXml: function(tag) {
- var isAlignmentEmpty = _excel4.default.isEmpty(tag.alignment);
- var applyNumberFormat;
- if ((0, _type.isDefined)(tag.numberFormatId)) {
- applyNumberFormat = tag.numberFormatId > 0 ? 1 : 0
- }
- return _excel2.default.toXml("xf", {
- xfId: 0,
- applyAlignment: isAlignmentEmpty ? null : 1,
- fontId: tag.fontId,
- applyNumberFormat: applyNumberFormat,
- fillId: tag.fillId,
- numFmtId: tag.numberFormatId
- }, isAlignmentEmpty ? null : _excel4.default.toXml(tag.alignment))
- }
- };
- exports.default = cellFormatHelper
- },
- /*!****************************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.cell_alignment_helper.js ***!
- \****************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var cellAlignmentHelper = {
- tryCreateTag: function(sourceObj) {
- var result = null;
- if ((0, _type.isDefined)(sourceObj)) {
- result = {
- vertical: sourceObj.vertical,
- wrapText: sourceObj.wrapText,
- horizontal: sourceObj.horizontal
- };
- if (cellAlignmentHelper.isEmpty(result)) {
- result = null
- }
- }
- return result
- },
- copy: function(source) {
- var result = null;
- if ((0, _type.isDefined)(source)) {
- result = {};
- if (void 0 !== source.horizontal) {
- result.horizontal = source.horizontal
- }
- if (void 0 !== source.vertical) {
- result.vertical = source.vertical
- }
- if (void 0 !== source.wrapText) {
- result.wrapText = source.wrapText
- }
- }
- return result
- },
- areEqual: function(leftTag, rightTag) {
- return cellAlignmentHelper.isEmpty(leftTag) && cellAlignmentHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.vertical === rightTag.vertical && leftTag.wrapText === rightTag.wrapText && leftTag.horizontal === rightTag.horizontal
- },
- isEmpty: function(tag) {
- return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.vertical) && !(0, _type.isDefined)(tag.wrapText) && !(0, _type.isDefined)(tag.horizontal)
- },
- toXml: function(tag) {
- return _excel2.default.toXml("alignment", {
- vertical: tag.vertical,
- wrapText: (0, _type.isDefined)(tag.wrapText) ? Number(tag.wrapText) : void 0,
- horizontal: tag.horizontal
- })
- }
- };
- exports.default = cellAlignmentHelper
- },
- /*!**************************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.pattern_fill_helper.js ***!
- \**************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- var _excel3 = __webpack_require__( /*! ./excel.color_helper */ 260);
- var _excel4 = _interopRequireDefault(_excel3);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var patternFillHelper = {
- tryCreateTag: function(sourceObj) {
- var result = null;
- if ((0, _type.isDefined)(sourceObj)) {
- result = {
- patternType: sourceObj.patternType,
- backgroundColor: _excel4.default.tryCreateTag(sourceObj.backgroundColor),
- foregroundColor: _excel4.default.tryCreateTag(sourceObj.foregroundColor)
- };
- if (patternFillHelper.isEmpty(result)) {
- result = null
- }
- }
- return result
- },
- copy: function(source) {
- var result = null;
- if ((0, _type.isDefined)(source)) {
- result = {};
- if (void 0 !== source.patternType) {
- result.patternType = source.patternType
- }
- if (void 0 !== source.backgroundColor) {
- result.backgroundColor = _excel4.default.copy(source.backgroundColor)
- }
- if (void 0 !== source.foregroundColor) {
- result.foregroundColor = _excel4.default.copy(source.foregroundColor)
- }
- }
- return result
- },
- areEqual: function(leftTag, rightTag) {
- return patternFillHelper.isEmpty(leftTag) && patternFillHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.patternType === rightTag.patternType && _excel4.default.areEqual(leftTag.backgroundColor, rightTag.backgroundColor) && _excel4.default.areEqual(leftTag.foregroundColor, rightTag.foregroundColor)
- },
- isEmpty: function(tag) {
- return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.patternType)
- },
- toXml: function(tag) {
- var content = [(0, _type.isDefined)(tag.foregroundColor) ? _excel4.default.toXml("fgColor", tag.foregroundColor) : "", (0, _type.isDefined)(tag.backgroundColor) ? _excel4.default.toXml("bgColor", tag.backgroundColor) : ""].join("");
- return _excel2.default.toXml("patternFill", {
- patternType: tag.patternType
- }, content)
- }
- };
- exports.default = patternFillHelper
- },
- /*!***************************************************************************!*\
- !*** ./artifacts/transpiled/exporter/excel/excel.number_format_helper.js ***!
- \***************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
- var _excel2 = _interopRequireDefault(_excel);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var numberFormatHelper = {
- ID_PROPERTY_NAME: "id",
- tryCreateTag: function(sourceObj) {
- var result = null;
- if ("string" === typeof sourceObj) {
- result = {
- formatCode: sourceObj
- };
- if (numberFormatHelper.isEmpty(result)) {
- result = null
- }
- }
- return result
- },
- areEqual: function(leftTag, rightTag) {
- return numberFormatHelper.isEmpty(leftTag) && numberFormatHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.formatCode === rightTag.formatCode
- },
- isEmpty: function(tag) {
- return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.formatCode) || "" === tag.formatCode
- },
- toXml: function(tag) {
- return _excel2.default.toXml("numFmt", {
- numFmtId: tag[numberFormatHelper.ID_PROPERTY_NAME],
- formatCode: tag.formatCode
- })
- }
- };
- exports.default = numberFormatHelper
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/exporter/svg_creator.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../core/renderer */ 2);
- var ajax = __webpack_require__( /*! ../core/utils/ajax */ 58);
- var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
- var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var svgUtils = __webpack_require__( /*! ../core/utils/svg */ 209);
- var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- exports.svgCreator = {
- _markup: "",
- _imageArray: {},
- _imageDeferreds: [],
- _getBinaryFile: function(src, callback) {
- ajax.sendRequest({
- url: src,
- method: "GET",
- responseType: "arraybuffer"
- }).done(callback).fail(function() {
- callback(false)
- })
- },
- _loadImages: function() {
- var that = this;
- each(that._imageArray, function(src) {
- var deferred = new Deferred;
- that._imageDeferreds.push(deferred);
- that._getBinaryFile(src, function(response) {
- if (!response) {
- delete that._imageArray[src];
- deferred.resolve();
- return
- }
- var i;
- var binary = "";
- var bytes = new Uint8Array(response);
- var length = bytes.byteLength;
- for (i = 0; i < length; i++) {
- binary += String.fromCharCode(bytes[i])
- }
- that._imageArray[src] = "data:image/png;base64," + window.btoa(binary);
- deferred.resolve()
- })
- })
- },
- _parseImages: function(element) {
- var href;
- var that = this;
- if ("image" === element.tagName) {
- href = $(element).attr("href") || $(element).attr("xlink:href");
- if (!that._imageArray[href]) {
- that._imageArray[href] = ""
- }
- }
- each(element.childNodes, function(_, element) {
- that._parseImages(element)
- })
- },
- _prepareImages: function(svgElem) {
- this._parseImages(svgElem);
- this._loadImages();
- return when.apply($, this._imageDeferreds)
- },
- getData: function(data, options) {
- var markup;
- var that = this;
- var xmlVersion = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
- var blob = new Deferred;
- var svgElem = svgUtils.getSvgElement(data);
- var $svgObject = $(svgElem);
- markup = xmlVersion + svgUtils.getSvgMarkup($svgObject.get(0), options.backgroundColor);
- that._prepareImages(svgElem).done(function() {
- each(that._imageArray, function(href, dataURI) {
- var regexpString = "href=['|\"]".concat(href, "['|\"]");
- markup = markup.replace(new RegExp(regexpString, "gi"), 'href="'.concat(dataURI, '"'))
- });
- blob.resolve(isFunction(window.Blob) ? that._getBlob(markup) : that._getBase64(markup))
- });
- return blob
- },
- _getBlob: function(markup) {
- return new window.Blob([markup], {
- type: "image/svg+xml"
- })
- },
- _getBase64: function(markup) {
- return window.btoa(markup)
- }
- };
- exports.getData = function(data, options, callback) {
- return exports.svgCreator.getData(data, options).done(callback)
- }
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/core/http_request.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var windowUtils = __webpack_require__( /*! ./utils/window */ 7);
- var window = windowUtils.getWindow();
- var injector = __webpack_require__( /*! ./utils/dependency_injector */ 54);
- var nativeXMLHttpRequest = {
- getXhr: function() {
- return new window.XMLHttpRequest
- }
- };
- module.exports = injector(nativeXMLHttpRequest)
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/exporter/pdf_creator.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var VERSION = __webpack_require__( /*! ../core/version */ 157);
- var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
- var imageCreator = __webpack_require__( /*! ./image_creator */ 262).imageCreator;
- var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- var mainPageTemplate = "%PDF-1.3\r\n2 0 obj\r\n<</ProcSet[/PDF/ImageB/ImageC/ImageI]/XObject<</I0 5 0 R>>>>\r\nendobj\r\n4 0 obj\r\n<</Type/Pages/Kids[1 0 R]/Count 1>>\r\nendobj\r\n7 0 obj\r\n<</OpenAction[1 0 R /FitH null]/Type/Catalog/Pages 4 0 R/PageLayout/OneColumn>>\r\nendobj\r\n1 0 obj\r\n<</Type/Page/Resources 2 0 R/MediaBox[0 0 _width_ _height_]/Contents 3 0 R/Parent 4 0 R>>\r\nendobj\r\n";
- var contentTemplate = "3 0 obj\r\n<</Length 52>>stream\r\n0.20 w\n0 G\nq _width_ 0 0 _height_ 0.00 0.00 cm /I0 Do Q\r\nendstream\r\nendobj\r\n";
- var infoTemplate = "6 0 obj\r\n<</CreationDate _date_/Producer(DevExtreme _version_)>>\r\nendobj\r\n";
- var imageStartTemplate = "5 0 obj\r\n<</Type/XObject/Subtype/Image/Width _width_/Height _height_/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/DCTDecode/Length _length_>>stream\r\n";
- var imageEndTemplate = "\r\nendstream\r\nendobj\r\n";
- var trailerTemplate = "trailer\r\n<<\r\n/Size 8\r\n/Root 7 0 R\r\n/Info 6 0 R\r\n>>\r\nstartxref\r\n_length_\r\n%%EOF";
- var xrefTemplate = "xref\r\n0 8\r\n0000000000 65535 f\r\n0000000241 00000 n\r\n0000000010 00000 n\r\n_main_ 00000 n\r\n0000000089 00000 n\r\n_image_ 00000 n\r\n_info_ 00000 n\r\n0000000143 00000 n\r\n";
- var pad = function pad(str, len) {
- return str.length < len ? pad("0" + str, len) : str
- };
- var composePdfString = function(imageString, options, curDate) {
- var margin = 2 * (options.margin || 0);
- var width = options.width + margin;
- var height = options.height + margin;
- var widthPt = (.75 * width).toFixed(2);
- var heightPt = (.75 * height).toFixed(2);
- var mainPage = mainPageTemplate.replace("_width_", widthPt).replace("_height_", heightPt);
- var content = contentTemplate.replace("_width_", widthPt).replace("_height_", heightPt);
- var info = infoTemplate.replace("_date_", curDate).replace("_version_", VERSION);
- var image = imageStartTemplate.replace("_width_", width).replace("_height_", height).replace("_length_", imageString.length) + imageString + imageEndTemplate;
- var xref = getXref(mainPage.length, content.length, info.length);
- var mainContent = mainPage + content + info + image;
- var trailer = trailerTemplate.replace("_length_", mainContent.length);
- return mainContent + xref + trailer
- };
- var getXref = function(mainPageLength, contentLength, infoLength) {
- return xrefTemplate.replace("_main_", pad(mainPageLength + "", 10)).replace("_info_", pad(mainPageLength + contentLength + "", 10)).replace("_image_", pad(mainPageLength + contentLength + infoLength + "", 10))
- };
- var getCurDate = function() {
- return new Date
- };
- var getBlob = function(binaryData) {
- var i = 0;
- var dataArray = new Uint8Array(binaryData.length);
- for (; i < binaryData.length; i++) {
- dataArray[i] = binaryData.charCodeAt(i)
- }
- return new window.Blob([dataArray.buffer], {
- type: "application/pdf"
- })
- };
- var getBase64 = function(binaryData) {
- return window.btoa(binaryData)
- };
- exports.getData = function(data, options, callback) {
- var imageData = imageCreator.getImageData(data, extend({}, options, {
- format: "JPEG"
- }));
- var blob = new Deferred;
- blob.done(callback);
- return when(imageData).done(function(imageString) {
- var binaryData = composePdfString(imageString, options, getCurDate());
- var pdfData = isFunction(window.Blob) ? getBlob(binaryData) : getBase64(binaryData);
- blob.resolve(pdfData)
- })
- };
- exports.__tests = {
- set_composePdfString: function(func) {
- exports.__tests.composePdfString = composePdfString;
- composePdfString = func
- },
- restore_composePdfString: function(func) {
- if (exports.__tests.composePdfString) {
- composePdfString = exports.__tests.composePdfString;
- exports.__tests.composePdfString = null
- }
- },
- set_getCurDate: function(func) {
- exports.__tests.getCurDate = getCurDate;
- getCurDate = func
- },
- restore_getCurDate: function(func) {
- if (exports.__tests.getCurDate) {
- getCurDate = exports.__tests.getCurDate;
- exports.__tests.getCurDate = null
- }
- },
- set_getBlob: function(func) {
- exports.__tests.getBlob = getBlob;
- getBlob = func
- },
- restore_getBlob: function(func) {
- if (exports.__tests.getBlob) {
- getBlob = exports.__tests.getBlob;
- exports.__tests.getBlob = null
- }
- },
- set_getBase64: function(func) {
- exports.__tests.getBase64 = getBase64;
- getBase64 = func
- },
- restore_getBase64: function(func) {
- if (exports.__tests.getBase64) {
- getBase64 = exports.__tests.getBase64;
- exports.__tests.getBase64 = null
- }
- }
- }
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/exporter/exceljs/excelExporter.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.exportDataGrid = void 0;
- var _exportDataGrid = __webpack_require__( /*! ./exportDataGrid */ 442);
- exports.exportDataGrid = _exportDataGrid.exportDataGrid
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/exporter/exceljs/exportDataGrid.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.MAX_EXCEL_COLUMN_WIDTH = exports.exportDataGrid = void 0;
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _excel_format_converter = __webpack_require__( /*! ../excel_format_converter */ 178);
- var _excel_format_converter2 = _interopRequireDefault(_excel_format_converter);
- var _message = __webpack_require__( /*! ../../localization/message */ 13);
- var _message2 = _interopRequireDefault(_message);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var MAX_DIGIT_WIDTH_IN_PIXELS = 7;
- var MAX_EXCEL_COLUMN_WIDTH = 255;
- function exportDataGrid(options) {
- if (!(0, _type.isDefined)(options)) {
- return
- }
- var customizeCell = options.customizeCell,
- component = options.component,
- worksheet = options.worksheet,
- _options$topLeftCell = options.topLeftCell,
- topLeftCell = void 0 === _options$topLeftCell ? {
- row: 1,
- column: 1
- } : _options$topLeftCell,
- autoFilterEnabled = options.autoFilterEnabled,
- _options$keepColumnWi = options.keepColumnWidths,
- keepColumnWidths = void 0 === _options$keepColumnWi ? true : _options$keepColumnWi,
- _options$selectedRows = options.selectedRowsOnly,
- selectedRowsOnly = void 0 === _options$selectedRows ? false : _options$selectedRows,
- _options$loadPanel = options.loadPanel,
- loadPanel = void 0 === _options$loadPanel ? {
- enabled: true,
- text: _message2.default.format("dxDataGrid-exporting")
- } : _options$loadPanel;
- var initialLoadPanelOptions = (0, _extend.extend)({}, component.option("loadPanel"));
- if ("animation" in component.option("loadPanel")) {
- loadPanel.animation = null
- }
- component.option("loadPanel", loadPanel);
- worksheet.properties.outlineProperties = {
- summaryBelow: false,
- summaryRight: false
- };
- var cellsRange = {
- from: {
- row: topLeftCell.row,
- column: topLeftCell.column
- },
- to: {
- row: topLeftCell.row,
- column: topLeftCell.column
- }
- };
- var dataProvider = component.getDataProvider(selectedRowsOnly);
- return new Promise(function(resolve) {
- dataProvider.ready().done(function() {
- var columns = dataProvider.getColumns();
- var headerRowCount = dataProvider.getHeaderRowCount();
- var dataRowsCount = dataProvider.getRowsCount();
- if (keepColumnWidths) {
- _setColumnsWidth(worksheet, columns, cellsRange.from.column)
- }
- var mergedCells = [];
- var mergeRanges = [];
- for (var rowIndex = 0; rowIndex < dataRowsCount; rowIndex++) {
- var row = worksheet.getRow(cellsRange.from.row + rowIndex);
- _exportRow(rowIndex, columns.length, row, cellsRange.from.column, dataProvider, customizeCell, headerRowCount, mergedCells, mergeRanges);
- if (rowIndex >= headerRowCount) {
- row.outlineLevel = dataProvider.getGroupLevel(rowIndex)
- }
- if (rowIndex >= 1) {
- cellsRange.to.row++
- }
- }
- _mergeCells(worksheet, topLeftCell, mergeRanges);
- cellsRange.to.column += columns.length > 0 ? columns.length - 1 : 0;
- var worksheetViewSettings = worksheet.views[0] || {};
- if (component.option("rtlEnabled")) {
- worksheetViewSettings.rightToLeft = true
- }
- if (headerRowCount > 0) {
- if (Object.keys(worksheetViewSettings).indexOf("state") === -1) {
- (0, _extend.extend)(worksheetViewSettings, {
- state: "frozen",
- ySplit: cellsRange.from.row + dataProvider.getFrozenArea().y - 1
- })
- }
- _setAutoFilter(dataProvider, worksheet, component, cellsRange, autoFilterEnabled)
- }
- if (Object.keys(worksheetViewSettings).length > 0) {
- worksheet.views = [worksheetViewSettings]
- }
- resolve(cellsRange)
- }).always(function() {
- component.option("loadPanel", initialLoadPanelOptions)
- })
- })
- }
- function _exportRow(rowIndex, cellCount, row, startColumnIndex, dataProvider, customizeCell, headerRowCount, mergedCells, mergeRanges) {
- var styles = dataProvider.getStyles();
- for (var cellIndex = 0; cellIndex < cellCount; cellIndex++) {
- var cellData = dataProvider.getCellData(rowIndex, cellIndex, true);
- var gridCell = cellData.cellSourceData;
- var excelCell = row.getCell(startColumnIndex + cellIndex);
- excelCell.value = cellData.value;
- if ((0, _type.isDefined)(excelCell.value)) {
- var _styles$dataProvider$ = styles[dataProvider.getStyleId(rowIndex, cellIndex)],
- bold = _styles$dataProvider$.bold,
- alignment = _styles$dataProvider$.alignment,
- wrapText = _styles$dataProvider$.wrapText,
- format = _styles$dataProvider$.format,
- dataType = _styles$dataProvider$.dataType;
- var numberFormat = _tryConvertToExcelNumberFormat(format, dataType);
- if ((0, _type.isDefined)(numberFormat)) {
- numberFormat = numberFormat.replace(/"/g, "")
- } else {
- if ((0, _type.isString)(excelCell.value) && /^[@=+-]/.test(excelCell.value)) {
- numberFormat = "@"
- }
- }
- _setNumberFormat(excelCell, numberFormat);
- _setFont(excelCell, bold);
- _setAlignment(excelCell, wrapText, alignment)
- }
- if ((0, _type.isDefined)(customizeCell)) {
- customizeCell({
- cell: excelCell,
- excelCell: excelCell,
- gridCell: gridCell
- })
- }
- if (rowIndex < headerRowCount) {
- var mergeRange = _tryGetMergeRange(rowIndex, cellIndex, mergedCells, dataProvider);
- if ((0, _type.isDefined)(mergeRange)) {
- mergeRanges.push(mergeRange)
- }
- }
- }
- }
- function _setAutoFilter(dataProvider, worksheet, component, cellsRange, autoFilterEnabled) {
- if (!(0, _type.isDefined)(autoFilterEnabled)) {
- autoFilterEnabled = !!component.option("export.excelFilterEnabled")
- }
- if (autoFilterEnabled) {
- if (!(0, _type.isDefined)(worksheet.autoFilter) && dataProvider.getRowsCount() > 0) {
- worksheet.autoFilter = cellsRange
- }
- }
- }
- function _setNumberFormat(excelCell, numberFormat) {
- excelCell.numFmt = numberFormat
- }
- function _tryConvertToExcelNumberFormat(format, dataType) {
- var newFormat = _formatObjectConverter(format, dataType);
- var currency = newFormat.currency;
- format = newFormat.format;
- dataType = newFormat.dataType;
- return _excel_format_converter2.default.convertFormat(format, newFormat.precision, dataType, currency)
- }
- function _formatObjectConverter(format, dataType) {
- var result = {
- format: format,
- precision: format && format.precision,
- dataType: dataType
- };
- if ((0, _type.isObject)(format)) {
- return (0, _extend.extend)(result, format, {
- format: format.formatter || format.type,
- currency: format.currency
- })
- }
- return result
- }
- function _setFont(excelCell, bold) {
- if ((0, _type.isDefined)(bold)) {
- excelCell.font = excelCell.font || {};
- excelCell.font.bold = bold
- }
- }
- function _setAlignment(excelCell, wrapText, horizontalAlignment) {
- excelCell.alignment = excelCell.alignment || {};
- if ((0, _type.isDefined)(wrapText)) {
- excelCell.alignment.wrapText = wrapText
- }
- if ((0, _type.isDefined)(horizontalAlignment)) {
- excelCell.alignment.horizontal = horizontalAlignment
- }
- }
- function _setColumnsWidth(worksheet, columns, startColumnIndex) {
- if (!(0, _type.isDefined)(columns)) {
- return
- }
- for (var i = 0; i < columns.length; i++) {
- var columnWidth = columns[i].width;
- if ("number" === typeof columnWidth && isFinite(columnWidth)) {
- worksheet.getColumn(startColumnIndex + i).width = Math.min(MAX_EXCEL_COLUMN_WIDTH, Math.floor(columnWidth / MAX_DIGIT_WIDTH_IN_PIXELS * 100) / 100)
- }
- }
- }
- function _tryGetMergeRange(rowIndex, cellIndex, mergedCells, dataProvider) {
- if (!mergedCells[rowIndex] || !mergedCells[rowIndex][cellIndex]) {
- var cellMerge = dataProvider.getCellMerging(rowIndex, cellIndex);
- if (cellMerge.colspan || cellMerge.rowspan) {
- for (var i = rowIndex; i <= rowIndex + cellMerge.rowspan || 0; i++) {
- for (var j = cellIndex; j <= cellIndex + cellMerge.colspan || 0; j++) {
- if (!mergedCells[i]) {
- mergedCells[i] = []
- }
- mergedCells[i][j] = true
- }
- }
- return {
- start: {
- row: rowIndex,
- column: cellIndex
- },
- end: {
- row: rowIndex + (cellMerge.rowspan || 0),
- column: cellIndex + (cellMerge.colspan || 0)
- }
- }
- }
- }
- }
- function _mergeCells(worksheet, topLeftCell, mergeRanges) {
- mergeRanges.forEach(function(mergeRange) {
- worksheet.mergeCells(mergeRange.start.row + topLeftCell.row, mergeRange.start.column + topLeftCell.column, mergeRange.end.row + topLeftCell.row, mergeRange.end.column + topLeftCell.column)
- })
- }
- exports.exportDataGrid = exportDataGrid;
- exports.MAX_EXCEL_COLUMN_WIDTH = MAX_EXCEL_COLUMN_WIDTH
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/localization/default_messages.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = {
- en: {
- Yes: "Yes",
- No: "No",
- Cancel: "Cancel",
- Clear: "Clear",
- Done: "Done",
- Loading: "Loading...",
- Select: "Select...",
- Search: "Search",
- Back: "Back",
- OK: "OK",
- "dxCollectionWidget-noDataText": "No data to display",
- "dxDropDownEditor-selectLabel": "Select",
- "validation-required": "Required",
- "validation-required-formatted": "{0} is required",
- "validation-numeric": "Value must be a number",
- "validation-numeric-formatted": "{0} must be a number",
- "validation-range": "Value is out of range",
- "validation-range-formatted": "{0} is out of range",
- "validation-stringLength": "The length of the value is not correct",
- "validation-stringLength-formatted": "The length of {0} is not correct",
- "validation-custom": "Value is invalid",
- "validation-custom-formatted": "{0} is invalid",
- "validation-compare": "Values do not match",
- "validation-compare-formatted": "{0} does not match",
- "validation-pattern": "Value does not match pattern",
- "validation-pattern-formatted": "{0} does not match pattern",
- "validation-email": "Email is invalid",
- "validation-email-formatted": "{0} is invalid",
- "validation-mask": "Value is invalid",
- "dxLookup-searchPlaceholder": "Minimum character number: {0}",
- "dxList-pullingDownText": "Pull down to refresh...",
- "dxList-pulledDownText": "Release to refresh...",
- "dxList-refreshingText": "Refreshing...",
- "dxList-pageLoadingText": "Loading...",
- "dxList-nextButtonText": "More",
- "dxList-selectAll": "Select All",
- "dxListEditDecorator-delete": "Delete",
- "dxListEditDecorator-more": "More",
- "dxScrollView-pullingDownText": "Pull down to refresh...",
- "dxScrollView-pulledDownText": "Release to refresh...",
- "dxScrollView-refreshingText": "Refreshing...",
- "dxScrollView-reachBottomText": "Loading...",
- "dxDateBox-simulatedDataPickerTitleTime": "Select time",
- "dxDateBox-simulatedDataPickerTitleDate": "Select date",
- "dxDateBox-simulatedDataPickerTitleDateTime": "Select date and time",
- "dxDateBox-validation-datetime": "Value must be a date or time",
- "dxFileUploader-selectFile": "Select file",
- "dxFileUploader-dropFile": "or Drop file here",
- "dxFileUploader-bytes": "bytes",
- "dxFileUploader-kb": "kb",
- "dxFileUploader-Mb": "Mb",
- "dxFileUploader-Gb": "Gb",
- "dxFileUploader-upload": "Upload",
- "dxFileUploader-uploaded": "Uploaded",
- "dxFileUploader-readyToUpload": "Ready to upload",
- "dxFileUploader-uploadFailedMessage": "Upload failed",
- "dxFileUploader-invalidFileExtension": "File type is not allowed",
- "dxFileUploader-invalidMaxFileSize": "File is too large",
- "dxFileUploader-invalidMinFileSize": "File is too small",
- "dxRangeSlider-ariaFrom": "From",
- "dxRangeSlider-ariaTill": "Till",
- "dxSwitch-switchedOnText": "ON",
- "dxSwitch-switchedOffText": "OFF",
- "dxForm-optionalMark": "optional",
- "dxForm-requiredMessage": "{0} is required",
- "dxNumberBox-invalidValueMessage": "Value must be a number",
- "dxNumberBox-noDataText": "No data",
- "dxDataGrid-columnChooserTitle": "Column Chooser",
- "dxDataGrid-columnChooserEmptyText": "Drag a column here to hide it",
- "dxDataGrid-groupContinuesMessage": "Continues on the next page",
- "dxDataGrid-groupContinuedMessage": "Continued from the previous page",
- "dxDataGrid-groupHeaderText": "Group by This Column",
- "dxDataGrid-ungroupHeaderText": "Ungroup",
- "dxDataGrid-ungroupAllText": "Ungroup All",
- "dxDataGrid-editingEditRow": "Edit",
- "dxDataGrid-editingSaveRowChanges": "Save",
- "dxDataGrid-editingCancelRowChanges": "Cancel",
- "dxDataGrid-editingDeleteRow": "Delete",
- "dxDataGrid-editingUndeleteRow": "Undelete",
- "dxDataGrid-editingConfirmDeleteMessage": "Are you sure you want to delete this record?",
- "dxDataGrid-validationCancelChanges": "Cancel changes",
- "dxDataGrid-groupPanelEmptyText": "Drag a column header here to group by that column",
- "dxDataGrid-noDataText": "No data",
- "dxDataGrid-searchPanelPlaceholder": "Search...",
- "dxDataGrid-filterRowShowAllText": "(All)",
- "dxDataGrid-filterRowResetOperationText": "Reset",
- "dxDataGrid-filterRowOperationEquals": "Equals",
- "dxDataGrid-filterRowOperationNotEquals": "Does not equal",
- "dxDataGrid-filterRowOperationLess": "Less than",
- "dxDataGrid-filterRowOperationLessOrEquals": "Less than or equal to",
- "dxDataGrid-filterRowOperationGreater": "Greater than",
- "dxDataGrid-filterRowOperationGreaterOrEquals": "Greater than or equal to",
- "dxDataGrid-filterRowOperationStartsWith": "Starts with",
- "dxDataGrid-filterRowOperationContains": "Contains",
- "dxDataGrid-filterRowOperationNotContains": "Does not contain",
- "dxDataGrid-filterRowOperationEndsWith": "Ends with",
- "dxDataGrid-filterRowOperationBetween": "Between",
- "dxDataGrid-filterRowOperationBetweenStartText": "Start",
- "dxDataGrid-filterRowOperationBetweenEndText": "End",
- "dxDataGrid-applyFilterText": "Apply filter",
- "dxDataGrid-trueText": "true",
- "dxDataGrid-falseText": "false",
- "dxDataGrid-sortingAscendingText": "Sort Ascending",
- "dxDataGrid-sortingDescendingText": "Sort Descending",
- "dxDataGrid-sortingClearText": "Clear Sorting",
- "dxDataGrid-editingSaveAllChanges": "Save changes",
- "dxDataGrid-editingCancelAllChanges": "Discard changes",
- "dxDataGrid-editingAddRow": "Add a row",
- "dxDataGrid-summaryMin": "Min: {0}",
- "dxDataGrid-summaryMinOtherColumn": "Min of {1} is {0}",
- "dxDataGrid-summaryMax": "Max: {0}",
- "dxDataGrid-summaryMaxOtherColumn": "Max of {1} is {0}",
- "dxDataGrid-summaryAvg": "Avg: {0}",
- "dxDataGrid-summaryAvgOtherColumn": "Avg of {1} is {0}",
- "dxDataGrid-summarySum": "Sum: {0}",
- "dxDataGrid-summarySumOtherColumn": "Sum of {1} is {0}",
- "dxDataGrid-summaryCount": "Count: {0}",
- "dxDataGrid-columnFixingFix": "Fix",
- "dxDataGrid-columnFixingUnfix": "Unfix",
- "dxDataGrid-columnFixingLeftPosition": "To the left",
- "dxDataGrid-columnFixingRightPosition": "To the right",
- "dxDataGrid-exportTo": "Export",
- "dxDataGrid-exportToExcel": "Export to Excel file",
- "dxDataGrid-exporting": "Exporting...",
- "dxDataGrid-excelFormat": "Excel file",
- "dxDataGrid-selectedRows": "Selected rows",
- "dxDataGrid-exportSelectedRows": "Export selected rows",
- "dxDataGrid-exportAll": "Export all data",
- "dxDataGrid-headerFilterEmptyValue": "(Blanks)",
- "dxDataGrid-headerFilterOK": "OK",
- "dxDataGrid-headerFilterCancel": "Cancel",
- "dxDataGrid-ariaColumn": "Column",
- "dxDataGrid-ariaValue": "Value",
- "dxDataGrid-ariaFilterCell": "Filter cell",
- "dxDataGrid-ariaCollapse": "Collapse",
- "dxDataGrid-ariaExpand": "Expand",
- "dxDataGrid-ariaDataGrid": "Data grid",
- "dxDataGrid-ariaSearchInGrid": "Search in data grid",
- "dxDataGrid-ariaSelectAll": "Select all",
- "dxDataGrid-ariaSelectRow": "Select row",
- "dxDataGrid-filterBuilderPopupTitle": "Filter Builder",
- "dxDataGrid-filterPanelCreateFilter": "Create Filter",
- "dxDataGrid-filterPanelClearFilter": "Clear",
- "dxDataGrid-filterPanelFilterEnabledHint": "Enable the filter",
- "dxTreeList-ariaTreeList": "Tree list",
- "dxTreeList-editingAddRowToNode": "Add",
- "dxPager-infoText": "Page {0} of {1} ({2} items)",
- "dxPager-pagesCountText": "of",
- "dxPivotGrid-grandTotal": "Grand Total",
- "dxPivotGrid-total": "{0} Total",
- "dxPivotGrid-fieldChooserTitle": "Field Chooser",
- "dxPivotGrid-showFieldChooser": "Show Field Chooser",
- "dxPivotGrid-expandAll": "Expand All",
- "dxPivotGrid-collapseAll": "Collapse All",
- "dxPivotGrid-sortColumnBySummary": 'Sort "{0}" by This Column',
- "dxPivotGrid-sortRowBySummary": 'Sort "{0}" by This Row',
- "dxPivotGrid-removeAllSorting": "Remove All Sorting",
- "dxPivotGrid-dataNotAvailable": "N/A",
- "dxPivotGrid-rowFields": "Row Fields",
- "dxPivotGrid-columnFields": "Column Fields",
- "dxPivotGrid-dataFields": "Data Fields",
- "dxPivotGrid-filterFields": "Filter Fields",
- "dxPivotGrid-allFields": "All Fields",
- "dxPivotGrid-columnFieldArea": "Drop Column Fields Here",
- "dxPivotGrid-dataFieldArea": "Drop Data Fields Here",
- "dxPivotGrid-rowFieldArea": "Drop Row Fields Here",
- "dxPivotGrid-filterFieldArea": "Drop Filter Fields Here",
- "dxScheduler-editorLabelTitle": "Subject",
- "dxScheduler-editorLabelStartDate": "Start Date",
- "dxScheduler-editorLabelEndDate": "End Date",
- "dxScheduler-editorLabelDescription": "Description",
- "dxScheduler-editorLabelRecurrence": "Repeat",
- "dxScheduler-openAppointment": "Open appointment",
- "dxScheduler-recurrenceNever": "Never",
- "dxScheduler-recurrenceDaily": "Daily",
- "dxScheduler-recurrenceWeekly": "Weekly",
- "dxScheduler-recurrenceMonthly": "Monthly",
- "dxScheduler-recurrenceYearly": "Yearly",
- "dxScheduler-recurrenceRepeatEvery": "Repeat Every",
- "dxScheduler-recurrenceRepeatOn": "Repeat On",
- "dxScheduler-recurrenceEnd": "End repeat",
- "dxScheduler-recurrenceAfter": "After",
- "dxScheduler-recurrenceOn": "On",
- "dxScheduler-recurrenceRepeatDaily": "day(s)",
- "dxScheduler-recurrenceRepeatWeekly": "week(s)",
- "dxScheduler-recurrenceRepeatMonthly": "month(s)",
- "dxScheduler-recurrenceRepeatYearly": "year(s)",
- "dxScheduler-switcherDay": "Day",
- "dxScheduler-switcherWeek": "Week",
- "dxScheduler-switcherWorkWeek": "Work Week",
- "dxScheduler-switcherMonth": "Month",
- "dxScheduler-switcherAgenda": "Agenda",
- "dxScheduler-switcherTimelineDay": "Timeline Day",
- "dxScheduler-switcherTimelineWeek": "Timeline Week",
- "dxScheduler-switcherTimelineWorkWeek": "Timeline Work Week",
- "dxScheduler-switcherTimelineMonth": "Timeline Month",
- "dxScheduler-recurrenceRepeatOnDate": "on date",
- "dxScheduler-recurrenceRepeatCount": "occurrence(s)",
- "dxScheduler-allDay": "All day",
- "dxScheduler-confirmRecurrenceEditMessage": "Do you want to edit only this appointment or the whole series?",
- "dxScheduler-confirmRecurrenceDeleteMessage": "Do you want to delete only this appointment or the whole series?",
- "dxScheduler-confirmRecurrenceEditSeries": "Edit series",
- "dxScheduler-confirmRecurrenceDeleteSeries": "Delete series",
- "dxScheduler-confirmRecurrenceEditOccurrence": "Edit appointment",
- "dxScheduler-confirmRecurrenceDeleteOccurrence": "Delete appointment",
- "dxScheduler-noTimezoneTitle": "No timezone",
- "dxScheduler-moreAppointments": "{0} more",
- "dxCalendar-todayButtonText": "Today",
- "dxCalendar-ariaWidgetName": "Calendar",
- "dxColorView-ariaRed": "Red",
- "dxColorView-ariaGreen": "Green",
- "dxColorView-ariaBlue": "Blue",
- "dxColorView-ariaAlpha": "Transparency",
- "dxColorView-ariaHex": "Color code",
- "dxTagBox-selected": "{0} selected",
- "dxTagBox-allSelected": "All selected ({0})",
- "dxTagBox-moreSelected": "{0} more",
- "vizExport-printingButtonText": "Print",
- "vizExport-titleMenuText": "Exporting/Printing",
- "vizExport-exportButtonText": "{0} file",
- "dxFilterBuilder-and": "And",
- "dxFilterBuilder-or": "Or",
- "dxFilterBuilder-notAnd": "Not And",
- "dxFilterBuilder-notOr": "Not Or",
- "dxFilterBuilder-addCondition": "Add Condition",
- "dxFilterBuilder-addGroup": "Add Group",
- "dxFilterBuilder-enterValueText": "<enter a value>",
- "dxFilterBuilder-filterOperationEquals": "Equals",
- "dxFilterBuilder-filterOperationNotEquals": "Does not equal",
- "dxFilterBuilder-filterOperationLess": "Is less than",
- "dxFilterBuilder-filterOperationLessOrEquals": "Is less than or equal to",
- "dxFilterBuilder-filterOperationGreater": "Is greater than",
- "dxFilterBuilder-filterOperationGreaterOrEquals": "Is greater than or equal to",
- "dxFilterBuilder-filterOperationStartsWith": "Starts with",
- "dxFilterBuilder-filterOperationContains": "Contains",
- "dxFilterBuilder-filterOperationNotContains": "Does not contain",
- "dxFilterBuilder-filterOperationEndsWith": "Ends with",
- "dxFilterBuilder-filterOperationIsBlank": "Is blank",
- "dxFilterBuilder-filterOperationIsNotBlank": "Is not blank",
- "dxFilterBuilder-filterOperationBetween": "Is between",
- "dxFilterBuilder-filterOperationAnyOf": "Is any of",
- "dxFilterBuilder-filterOperationNoneOf": "Is none of",
- "dxHtmlEditor-dialogColorCaption": "Change Font Color",
- "dxHtmlEditor-dialogBackgroundCaption": "Change Background Color",
- "dxHtmlEditor-dialogLinkCaption": "Add Link",
- "dxHtmlEditor-dialogLinkUrlField": "URL",
- "dxHtmlEditor-dialogLinkTextField": "Text",
- "dxHtmlEditor-dialogLinkTargetField": "Open link in new window",
- "dxHtmlEditor-dialogImageCaption": "Add Image",
- "dxHtmlEditor-dialogImageUrlField": "URL",
- "dxHtmlEditor-dialogImageAltField": "Alternate text",
- "dxHtmlEditor-dialogImageWidthField": "Width (px)",
- "dxHtmlEditor-dialogImageHeightField": "Height (px)",
- "dxHtmlEditor-heading": "Heading",
- "dxHtmlEditor-normalText": "Normal text",
- "dxFileManager-newFolderName": "Untitled folder",
- "dxFileManager-errorNoAccess": "Access denied. The operation cannot be completed.",
- "dxFileManager-errorDirectoryExistsFormat": "Directory '{0}' already exists.",
- "dxFileManager-errorFileExistsFormat": "File '{0}' already exists.",
- "dxFileManager-errorFileNotFoundFormat": "File '{0}' not found",
- "dxFileManager-errorDefault": "Unspecified error."
- }
- }
- },
- /*!**********************************************************************!*\
- !*** ./artifacts/transpiled/localization/cldr-data/parentLocales.js ***!
- \**********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = {
- "en-150": "en-001",
- "en-AG": "en-001",
- "en-AI": "en-001",
- "en-AU": "en-001",
- "en-BB": "en-001",
- "en-BM": "en-001",
- "en-BS": "en-001",
- "en-BW": "en-001",
- "en-BZ": "en-001",
- "en-CC": "en-001",
- "en-CK": "en-001",
- "en-CM": "en-001",
- "en-CX": "en-001",
- "en-CY": "en-001",
- "en-DG": "en-001",
- "en-DM": "en-001",
- "en-ER": "en-001",
- "en-FJ": "en-001",
- "en-FK": "en-001",
- "en-FM": "en-001",
- "en-GB": "en-001",
- "en-GD": "en-001",
- "en-GG": "en-001",
- "en-GH": "en-001",
- "en-GI": "en-001",
- "en-GM": "en-001",
- "en-GY": "en-001",
- "en-HK": "en-001",
- "en-IE": "en-001",
- "en-IL": "en-001",
- "en-IM": "en-001",
- "en-IN": "en-001",
- "en-IO": "en-001",
- "en-JE": "en-001",
- "en-JM": "en-001",
- "en-KE": "en-001",
- "en-KI": "en-001",
- "en-KN": "en-001",
- "en-KY": "en-001",
- "en-LC": "en-001",
- "en-LR": "en-001",
- "en-LS": "en-001",
- "en-MG": "en-001",
- "en-MO": "en-001",
- "en-MS": "en-001",
- "en-MT": "en-001",
- "en-MU": "en-001",
- "en-MV": "en-001",
- "en-MW": "en-001",
- "en-MY": "en-001",
- "en-NA": "en-001",
- "en-NF": "en-001",
- "en-NG": "en-001",
- "en-NR": "en-001",
- "en-NU": "en-001",
- "en-NZ": "en-001",
- "en-PG": "en-001",
- "en-PK": "en-001",
- "en-PN": "en-001",
- "en-PW": "en-001",
- "en-RW": "en-001",
- "en-SB": "en-001",
- "en-SC": "en-001",
- "en-SD": "en-001",
- "en-SG": "en-001",
- "en-SH": "en-001",
- "en-SL": "en-001",
- "en-SS": "en-001",
- "en-SX": "en-001",
- "en-SZ": "en-001",
- "en-TC": "en-001",
- "en-TK": "en-001",
- "en-TO": "en-001",
- "en-TT": "en-001",
- "en-TV": "en-001",
- "en-TZ": "en-001",
- "en-UG": "en-001",
- "en-VC": "en-001",
- "en-VG": "en-001",
- "en-VU": "en-001",
- "en-WS": "en-001",
- "en-ZA": "en-001",
- "en-ZM": "en-001",
- "en-ZW": "en-001",
- "en-AT": "en-150",
- "en-BE": "en-150",
- "en-CH": "en-150",
- "en-DE": "en-150",
- "en-DK": "en-150",
- "en-FI": "en-150",
- "en-NL": "en-150",
- "en-SE": "en-150",
- "en-SI": "en-150",
- "hi-Latn": "en-IN",
- "es-AR": "es-419",
- "es-BO": "es-419",
- "es-BR": "es-419",
- "es-BZ": "es-419",
- "es-CL": "es-419",
- "es-CO": "es-419",
- "es-CR": "es-419",
- "es-CU": "es-419",
- "es-DO": "es-419",
- "es-EC": "es-419",
- "es-GT": "es-419",
- "es-HN": "es-419",
- "es-MX": "es-419",
- "es-NI": "es-419",
- "es-PA": "es-419",
- "es-PE": "es-419",
- "es-PR": "es-419",
- "es-PY": "es-419",
- "es-SV": "es-419",
- "es-US": "es-419",
- "es-UY": "es-419",
- "es-VE": "es-419",
- nb: "no",
- nn: "no",
- "pt-AO": "pt-PT",
- "pt-CH": "pt-PT",
- "pt-CV": "pt-PT",
- "pt-FR": "pt-PT",
- "pt-GQ": "pt-PT",
- "pt-GW": "pt-PT",
- "pt-LU": "pt-PT",
- "pt-MO": "pt-PT",
- "pt-MZ": "pt-PT",
- "pt-ST": "pt-PT",
- "pt-TL": "pt-PT",
- "az-Arab": "und",
- "az-Cyrl": "und",
- "bal-Latn": "und",
- "blt-Latn": "und",
- "bm-Nkoo": "und",
- "bs-Cyrl": "und",
- "byn-Latn": "und",
- "cu-Glag": "und",
- "dje-Arab": "und",
- "dyo-Arab": "und",
- "en-Dsrt": "und",
- "en-Shaw": "und",
- "ff-Adlm": "und",
- "ff-Arab": "und",
- "ha-Arab": "und",
- "iu-Latn": "und",
- "kk-Arab": "und",
- "ks-Deva": "und",
- "ku-Arab": "und",
- "ky-Arab": "und",
- "ky-Latn": "und",
- "ml-Arab": "und",
- "mn-Mong": "und",
- "mni-Mtei": "und",
- "ms-Arab": "und",
- "pa-Arab": "und",
- "sat-Deva": "und",
- "sd-Deva": "und",
- "sd-Khoj": "und",
- "sd-Sind": "und",
- "shi-Latn": "und",
- "so-Arab": "und",
- "sr-Latn": "und",
- "sw-Arab": "und",
- "tg-Arab": "und",
- "ug-Cyrl": "und",
- "uz-Arab": "und",
- "uz-Cyrl": "und",
- "vai-Latn": "und",
- "wo-Arab": "und",
- "yo-Arab": "und",
- "yue-Hans": "und",
- "zh-Hant": "und",
- "zh-Hant-MO": "zh-Hant-HK"
- }
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/core/events_strategy.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
- var isFunction = __webpack_require__( /*! ./utils/type */ 1).isFunction;
- var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
- var Class = __webpack_require__( /*! ./class */ 15);
- module.exports = Class.inherit({
- ctor: function(owner) {
- this._events = {};
- this._owner = owner
- },
- hasEvent: function(eventName) {
- var callbacks = this._events[eventName];
- if (callbacks) {
- return callbacks.has()
- }
- return false
- },
- fireEvent: function(eventName, eventArgs) {
- var callbacks = this._events[eventName];
- if (callbacks) {
- callbacks.fireWith(this._owner, eventArgs)
- }
- },
- on: function(eventName, eventHandler) {
- var callbacks = this._events[eventName];
- if (!callbacks) {
- callbacks = Callbacks();
- this._events[eventName] = callbacks
- }
- var addFn = callbacks.originalAdd || callbacks.add;
- addFn.call(callbacks, eventHandler)
- },
- off: function(eventName, eventHandler) {
- var callbacks = this._events[eventName];
- if (callbacks) {
- if (isFunction(eventHandler)) {
- callbacks.remove(eventHandler)
- } else {
- callbacks.empty()
- }
- }
- },
- dispose: function() {
- each(this._events, function() {
- this.empty()
- })
- }
- })
- },
- /*!**********************************************************************************!*\
- !*** ./artifacts/transpiled/mobile/init_mobile_viewport/init_mobile_viewport.js ***!
- \**********************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var resizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130);
- var support = __webpack_require__( /*! ../../core/utils/support */ 43);
- var styleUtils = __webpack_require__( /*! ../../core/utils/style */ 85);
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var initMobileViewport = function(options) {
- options = extend({}, options);
- var realDevice = devices.real();
- var allowZoom = options.allowZoom;
- var allowPan = options.allowPan;
- var allowSelection = "allowSelection" in options ? options.allowSelection : "generic" === realDevice.platform;
- var metaSelector = "meta[name=viewport]";
- if (!$(metaSelector).length) {
- $("<meta>").attr("name", "viewport").appendTo("head")
- }
- var metaVerbs = ["width=device-width"];
- var msTouchVerbs = [];
- if (allowZoom) {
- msTouchVerbs.push("pinch-zoom")
- } else {
- metaVerbs.push("initial-scale=1.0", "maximum-scale=1.0, user-scalable=no")
- }
- if (allowPan) {
- msTouchVerbs.push("pan-x", "pan-y")
- }
- if (!allowPan && !allowZoom) {
- $("html, body").css({
- msContentZooming: "none",
- msUserSelect: "none",
- overflow: "hidden"
- })
- } else {
- $("html").css("msOverflowStyle", "-ms-autohiding-scrollbar")
- }
- if (!allowSelection && support.supportProp("userSelect")) {
- $(".dx-viewport").css(styleUtils.styleProp("userSelect"), "none")
- }
- $(metaSelector).attr("content", metaVerbs.join());
- $("html").css("msTouchAction", msTouchVerbs.join(" ") || "none");
- realDevice = devices.real();
- if (support.touch && !("win" === realDevice.platform && 10 === realDevice.version[0])) {
- eventsEngine.off(domAdapter.getDocument(), ".dxInitMobileViewport");
- eventsEngine.on(domAdapter.getDocument(), "dxpointermove.dxInitMobileViewport", function(e) {
- var count = e.pointers.length;
- var isTouchEvent = "touch" === e.pointerType;
- var zoomDisabled = !allowZoom && count > 1;
- var panDisabled = !allowPan && 1 === count && !e.isScrollingEvent;
- if (isTouchEvent && (zoomDisabled || panDisabled)) {
- e.preventDefault()
- }
- })
- }
- if (realDevice.ios) {
- var isPhoneGap = "file:" === domAdapter.getLocation().protocol;
- if (!isPhoneGap) {
- resizeCallbacks.add(function() {
- var windowWidth = $(window).width();
- $("body").width(windowWidth)
- })
- }
- }
- if (realDevice.android) {
- resizeCallbacks.add(function() {
- setTimeout(function() {
- var activeElement = domAdapter.getActiveElement();
- activeElement.scrollIntoViewIfNeeded ? activeElement.scrollIntoViewIfNeeded() : activeElement.scrollIntoView(false)
- })
- })
- }
- };
- exports.initMobileViewport = initMobileViewport
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/events/pointer/mspointer.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var BaseStrategy = __webpack_require__( /*! ./base */ 154);
- var Observer = __webpack_require__( /*! ./observer */ 266);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var eventMap = {
- dxpointerdown: "pointerdown",
- dxpointermove: "pointermove",
- dxpointerup: "pointerup",
- dxpointercancel: "pointercancel",
- dxpointerover: "pointerover",
- dxpointerout: "pointerout",
- dxpointerenter: "pointerenter",
- dxpointerleave: "pointerleave"
- };
- var observer;
- var activated = false;
- var activateStrategy = function() {
- if (activated) {
- return
- }
- observer = new Observer(eventMap, function(a, b) {
- return a.pointerId === b.pointerId
- }, function(e) {
- if (e.isPrimary) {
- observer.reset()
- }
- });
- activated = true
- };
- var MsPointerStrategy = BaseStrategy.inherit({
- ctor: function() {
- this.callBase.apply(this, arguments);
- activateStrategy()
- },
- _fireEvent: function(args) {
- return this.callBase(extend({
- pointers: observer.pointers(),
- pointerId: args.originalEvent.pointerId
- }, args))
- }
- });
- MsPointerStrategy.map = eventMap;
- MsPointerStrategy.resetObserver = function() {
- observer.reset()
- };
- module.exports = MsPointerStrategy
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/events/pointer/mouse_and_touch.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var BaseStrategy = __webpack_require__( /*! ./base */ 154);
- var MouseStrategy = __webpack_require__( /*! ./mouse */ 267);
- var TouchStrategy = __webpack_require__( /*! ./touch */ 265);
- var eventUtils = __webpack_require__( /*! ../utils */ 8);
- var eventMap = {
- dxpointerdown: "touchstart mousedown",
- dxpointermove: "touchmove mousemove",
- dxpointerup: "touchend mouseup",
- dxpointercancel: "touchcancel",
- dxpointerover: "mouseover",
- dxpointerout: "mouseout",
- dxpointerenter: "mouseenter",
- dxpointerleave: "mouseleave"
- };
- var activated = false;
- var activateStrategy = function() {
- if (activated) {
- return
- }
- MouseStrategy.activate();
- activated = true
- };
- var MouseAndTouchStrategy = BaseStrategy.inherit({
- EVENT_LOCK_TIMEOUT: 100,
- ctor: function() {
- this.callBase.apply(this, arguments);
- activateStrategy()
- },
- _handler: function(e) {
- var isMouseEvent = eventUtils.isMouseEvent(e);
- if (!isMouseEvent) {
- this._skipNextEvents = true
- }
- if (isMouseEvent && this._mouseLocked) {
- return
- }
- if (isMouseEvent && this._skipNextEvents) {
- this._skipNextEvents = false;
- this._mouseLocked = true;
- clearTimeout(this._unlockMouseTimer);
- var that = this;
- this._unlockMouseTimer = setTimeout(function() {
- that._mouseLocked = false
- }, this.EVENT_LOCK_TIMEOUT);
- return
- }
- return this.callBase(e)
- },
- _fireEvent: function(args) {
- var isMouseEvent = eventUtils.isMouseEvent(args.originalEvent);
- var normalizer = isMouseEvent ? MouseStrategy.normalize : TouchStrategy.normalize;
- return this.callBase(extend(normalizer(args.originalEvent), args))
- },
- dispose: function() {
- this.callBase();
- this._skipNextEvents = false;
- this._mouseLocked = false;
- clearTimeout(this._unlockMouseTimer)
- }
- });
- MouseAndTouchStrategy.map = eventMap;
- MouseAndTouchStrategy.resetObserver = MouseStrategy.resetObserver;
- module.exports = MouseAndTouchStrategy
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/localization.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var core = __webpack_require__( /*! ./localization/core */ 87);
- var message = __webpack_require__( /*! ./localization/message */ 13);
- var number = __webpack_require__( /*! ./localization/number */ 51);
- var date = __webpack_require__( /*! ./localization/date */ 32);
- __webpack_require__( /*! ./localization/currency */ 152);
- exports.locale = core.locale.bind(core);
- exports.loadMessages = message.load.bind(message);
- exports.formatMessage = message.format.bind(message);
- exports.formatNumber = number.format.bind(number);
- exports.parseNumber = number.parse.bind(number);
- exports.formatDate = date.format.bind(date);
- exports.parseDate = date.parse.bind(date);
- exports.message = message;
- exports.number = number;
- exports.date = date
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/renderer.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var rendererBase = __webpack_require__( /*! ../../core/renderer_base */ 253);
- var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
- if (useJQuery) {
- rendererBase.set(jQuery)
- }
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/hooks.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
- var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var isNumeric = __webpack_require__( /*! ../../core/utils/type */ 1).isNumeric;
- var setEventFixMethod = __webpack_require__( /*! ../../events/utils */ 8).setEventFixMethod;
- var registerEvent = __webpack_require__( /*! ../../events/core/event_registrator */ 71);
- var hookTouchProps = __webpack_require__( /*! ../../events/core/hook_touch_props */ 254);
- if (useJQuery) {
- if (compareVersion(jQuery.fn.jquery, [3]) < 0) {
- var POINTER_TYPE_MAP = {
- 2: "touch",
- 3: "pen",
- 4: "mouse"
- };
- each(["MSPointerDown", "MSPointerMove", "MSPointerUp", "MSPointerCancel", "MSPointerOver", "MSPointerOut", "mouseenter", "mouseleave", "pointerdown", "pointermove", "pointerup", "pointercancel", "pointerover", "pointerout", "pointerenter", "pointerleave"], function() {
- jQuery.event.fixHooks[this] = {
- filter: function(event, originalEvent) {
- var pointerType = originalEvent.pointerType;
- if (isNumeric(pointerType)) {
- event.pointerType = POINTER_TYPE_MAP[pointerType]
- }
- return event
- },
- props: jQuery.event.mouseHooks.props.concat(["pointerId", "pointerType", "originalTarget", "width", "height", "pressure", "result", "tiltX", "charCode", "tiltY", "detail", "isPrimary", "prevValue"])
- }
- });
- each(["touchstart", "touchmove", "touchend", "touchcancel"], function() {
- jQuery.event.fixHooks[this] = {
- filter: function(event, originalEvent) {
- hookTouchProps(function(name, hook) {
- event[name] = hook(originalEvent)
- });
- return event
- },
- props: jQuery.event.mouseHooks.props.concat(["touches", "changedTouches", "targetTouches", "detail", "result", "originalTarget", "charCode", "prevValue"])
- }
- });
- jQuery.event.fixHooks.wheel = jQuery.event.mouseHooks;
- var DX_EVENT_HOOKS = {
- props: jQuery.event.mouseHooks.props.concat(["pointerType", "pointerId", "pointers"])
- };
- registerEvent.callbacks.add(function(name) {
- jQuery.event.fixHooks[name] = DX_EVENT_HOOKS
- });
- var fix = function(event, originalEvent) {
- var fixHook = jQuery.event.fixHooks[originalEvent.type] || jQuery.event.mouseHooks;
- var props = fixHook.props ? jQuery.event.props.concat(fixHook.props) : jQuery.event.props;
- var propIndex = props.length;
- while (propIndex--) {
- var prop = props[propIndex];
- event[prop] = originalEvent[prop]
- }
- return fixHook.filter ? fixHook.filter(event, originalEvent) : event
- };
- setEventFixMethod(fix)
- } else {
- hookTouchProps(function(name, hook) {
- jQuery.event.addProp(name, hook)
- })
- }
- }
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/deferred.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
- var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
- if (useJQuery) {
- var Deferred = jQuery.Deferred;
- var strategy = {
- Deferred: Deferred
- };
- strategy.when = compareVersion(jQuery.fn.jquery, [3]) < 0 ? jQuery.when : function(singleArg) {
- if (0 === arguments.length) {
- return (new Deferred).resolve()
- } else {
- if (1 === arguments.length) {
- return singleArg && singleArg.then ? singleArg : (new Deferred).resolve(singleArg)
- } else {
- return jQuery.when.apply(jQuery, arguments)
- }
- }
- };
- deferredUtils.setStrategy(strategy)
- }
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/hold_ready.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var themes_callback = __webpack_require__( /*! ../../ui/themes_callback */ 269);
- var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
- if (jQuery && !themes_callback.fired()) {
- var holdReady = jQuery.holdReady || jQuery.fn.holdReady;
- holdReady(true);
- themes_callback.add(function() {
- ready(function() {
- holdReady(false)
- })
- })
- }
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/events.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
- var registerEventCallbacks = __webpack_require__( /*! ../../events/core/event_registrator_callbacks */ 122);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- if (useJQuery) {
- registerEventCallbacks.add(function(name, eventObject) {
- jQuery.event.special[name] = eventObject
- });
- if (eventsEngine.passiveEventHandlersSupported()) {
- eventsEngine.forcePassiveFalseEventNames.forEach(function(eventName) {
- jQuery.event.special[eventName] = {
- setup: function(data, namespaces, handler) {
- domAdapter.listen(this, eventName, handler, {
- passive: false
- })
- }
- }
- })
- }
- eventsEngine.set({
- on: function(element) {
- jQuery(element).on.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
- },
- one: function(element) {
- jQuery(element).one.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
- },
- off: function(element) {
- jQuery(element).off.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
- },
- trigger: function(element) {
- jQuery(element).trigger.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
- },
- triggerHandler: function(element) {
- jQuery(element).triggerHandler.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
- },
- Event: jQuery.Event
- })
- }
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/easing.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var easing = __webpack_require__( /*! ../../animation/easing */ 264);
- if (jQuery) {
- easing.setEasing(jQuery.easing)
- }
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/element_data.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
- var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
- if (useJQuery) {
- dataUtils.setDataStrategy(jQuery)
- }
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/element.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var setPublicElementWrapper = __webpack_require__( /*! ../../core/utils/dom */ 12).setPublicElementWrapper;
- var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
- var getPublicElement = function($element) {
- return $element
- };
- if (useJQuery) {
- setPublicElementWrapper(getPublicElement)
- }
- },
- /*!**************************************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/component_registrator.js ***!
- \**************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var componentRegistratorCallbacks = __webpack_require__( /*! ../../core/component_registrator_callbacks */ 153);
- var errors = __webpack_require__( /*! ../../core/errors */ 21);
- if (jQuery) {
- var registerJQueryComponent = function(name, componentClass) {
- jQuery.fn[name] = function(options) {
- var isMemberInvoke = "string" === typeof options;
- var result;
- if (isMemberInvoke) {
- var memberName = options;
- var memberArgs = [].slice.call(arguments).slice(1);
- this.each(function() {
- var instance = componentClass.getInstance(this);
- if (!instance) {
- throw errors.Error("E0009", name)
- }
- var member = instance[memberName];
- var memberValue = member.apply(instance, memberArgs);
- if (void 0 === result) {
- result = memberValue
- }
- })
- } else {
- this.each(function() {
- var instance = componentClass.getInstance(this);
- if (instance) {
- instance.option(options)
- } else {
- new componentClass(this, options)
- }
- });
- result = this
- }
- return result
- }
- };
- componentRegistratorCallbacks.add(registerJQueryComponent)
- }
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/integration/jquery/ajax.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var jQuery = __webpack_require__( /*! jquery */ 55);
- var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
- var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
- if (useJQuery) {
- ajax.inject({
- sendRequest: function(options) {
- if (!options.responseType && !options.upload) {
- return jQuery.ajax(options)
- }
- return this.callBase.apply(this, [options])
- }
- })
- }
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/integration/angular.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var angular = __webpack_require__( /*! angular */ 270);
- if (angular) {
- __webpack_require__( /*! ./jquery */ 268);
- __webpack_require__( /*! ./angular/component_registrator */ 461);
- __webpack_require__( /*! ./angular/event_registrator */ 472);
- __webpack_require__( /*! ./angular/components */ 473);
- __webpack_require__( /*! ./angular/action_executors */ 474)
- }
- },
- /*!***************************************************************************!*\
- !*** ./artifacts/transpiled/integration/angular/component_registrator.js ***!
- \***************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _config = __webpack_require__( /*! ../../core/config */ 31);
- var _config2 = _interopRequireDefault(_config);
- var _component_registrator_callbacks = __webpack_require__( /*! ../../core/component_registrator_callbacks */ 153);
- var _component_registrator_callbacks2 = _interopRequireDefault(_component_registrator_callbacks);
- var _class = __webpack_require__( /*! ../../core/class */ 15);
- var _class2 = _interopRequireDefault(_class);
- var _callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var _callbacks2 = _interopRequireDefault(_callbacks);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _type2 = _interopRequireDefault(_type);
- var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var _iterator2 = _interopRequireDefault(_iterator);
- var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
- var _array2 = _interopRequireDefault(_array);
- var _locker = __webpack_require__( /*! ../../core/utils/locker */ 271);
- var _locker2 = _interopRequireDefault(_locker);
- var _ui = __webpack_require__( /*! ../../ui/widget/ui.widget */ 18);
- var _ui2 = _interopRequireDefault(_ui);
- var _editor = __webpack_require__( /*! ../../ui/editor/editor */ 49);
- var _editor2 = _interopRequireDefault(_editor);
- var _template = __webpack_require__( /*! ./template */ 466);
- var _template2 = _interopRequireDefault(_template);
- var _module = __webpack_require__( /*! ./module */ 180);
- var _module2 = _interopRequireDefault(_module);
- var _uiCollection_widget = __webpack_require__( /*! ../../ui/collection/ui.collection_widget.edit */ 53);
- var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget);
- var _data = __webpack_require__( /*! ../../core/utils/data */ 20);
- var _data2 = _interopRequireDefault(_data);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _extend2 = _interopRequireDefault(_extend);
- var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
- var _inflector2 = _interopRequireDefault(_inflector);
- var _errors = __webpack_require__( /*! ../../core/errors */ 21);
- var _errors2 = _interopRequireDefault(_errors);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var each = _iterator2.default.each;
- var inArray = _array2.default.inArray;
- var compileSetter = _data2.default.compileSetter;
- var compileGetter = _data2.default.compileGetter;
- var extendFromObject = _extend2.default.extendFromObject;
- var ITEM_ALIAS_ATTRIBUTE_NAME = "dxItemAlias";
- var SKIP_APPLY_ACTION_CATEGORIES = ["rendering"];
- var NG_MODEL_OPTION = "value";
- var safeApply = function(func, scope) {
- if (scope.$root.$$phase) {
- return func(scope)
- } else {
- return scope.$apply(function() {
- return func(scope)
- })
- }
- };
- var ComponentBuilder = _class2.default.inherit({
- ctor: function(options) {
- this._componentDisposing = (0, _callbacks2.default)();
- this._optionChangedCallbacks = (0, _callbacks2.default)();
- this._ngLocker = new _locker2.default;
- this._scope = options.scope;
- this._$element = options.$element;
- this._$templates = options.$templates;
- this._componentClass = options.componentClass;
- this._parse = options.parse;
- this._compile = options.compile;
- this._itemAlias = options.itemAlias;
- this._transcludeFn = options.transcludeFn;
- this._digestCallbacks = options.dxDigestCallbacks;
- this._normalizeOptions(options.ngOptions);
- this._initComponentBindings();
- this._initComponent(this._scope);
- if (!options.ngOptions) {
- this._addOptionsStringWatcher(options.ngOptionsString)
- }
- },
- _addOptionsStringWatcher: function(optionsString) {
- var _this = this;
- var clearOptionsStringWatcher = this._scope.$watch(optionsString, function(newOptions) {
- if (!newOptions) {
- return
- }
- clearOptionsStringWatcher();
- _this._normalizeOptions(newOptions);
- _this._initComponentBindings();
- _this._component.option(_this._evalOptions(_this._scope))
- });
- this._componentDisposing.add(clearOptionsStringWatcher)
- },
- _normalizeOptions: function(options) {
- var _this2 = this;
- this._ngOptions = extendFromObject({}, options);
- if (!options) {
- return
- }
- if (!Object.prototype.hasOwnProperty.call(options, "bindingOptions") && options.bindingOptions) {
- this._ngOptions.bindingOptions = options.bindingOptions
- }
- if (options.bindingOptions) {
- each(options.bindingOptions, function(key, value) {
- if ("string" === _type2.default.type(value)) {
- _this2._ngOptions.bindingOptions[key] = {
- dataPath: value
- }
- }
- })
- }
- },
- _initComponent: function(scope) {
- this._component = new this._componentClass(this._$element, this._evalOptions(scope));
- this._component._isHidden = true;
- this._handleDigestPhase()
- },
- _handleDigestPhase: function() {
- var _this3 = this;
- var beginUpdate = function() {
- _this3._component.beginUpdate()
- };
- var endUpdate = function() {
- _this3._component.endUpdate()
- };
- this._digestCallbacks.begin.add(beginUpdate);
- this._digestCallbacks.end.add(endUpdate);
- this._componentDisposing.add(function() {
- _this3._digestCallbacks.begin.remove(beginUpdate);
- _this3._digestCallbacks.end.remove(endUpdate)
- })
- },
- _initComponentBindings: function() {
- var _this4 = this;
- var optionDependencies = {};
- if (!this._ngOptions.bindingOptions) {
- return
- }
- each(this._ngOptions.bindingOptions, function(optionPath, value) {
- var separatorIndex = optionPath.search(/\[|\./);
- var optionForSubscribe = separatorIndex > -1 ? optionPath.substring(0, separatorIndex) : optionPath;
- var prevWatchMethod;
- var clearWatcher;
- var valuePath = value.dataPath;
- var deepWatch = true;
- var forcePlainWatchMethod = false;
- if (void 0 !== value.deep) {
- forcePlainWatchMethod = deepWatch = !!value.deep
- }
- if (!optionDependencies[optionForSubscribe]) {
- optionDependencies[optionForSubscribe] = {}
- }
- optionDependencies[optionForSubscribe][optionPath] = valuePath;
- var watchCallback = function(newValue, oldValue) {
- if (_this4._ngLocker.locked(optionPath)) {
- return
- }
- _this4._ngLocker.obtain(optionPath);
- _this4._component.option(optionPath, newValue);
- updateWatcher();
- if (_this4._component._optionValuesEqual(optionPath, oldValue, newValue) && _this4._ngLocker.locked(optionPath)) {
- _this4._ngLocker.release(optionPath)
- }
- };
- var updateWatcher = function() {
- var watchMethod = Array.isArray(_this4._scope.$eval(valuePath)) && !forcePlainWatchMethod ? "$watchCollection" : "$watch";
- if (prevWatchMethod !== watchMethod) {
- if (clearWatcher) {
- clearWatcher()
- }
- clearWatcher = _this4._scope[watchMethod](valuePath, watchCallback, deepWatch);
- prevWatchMethod = watchMethod
- }
- };
- updateWatcher();
- _this4._componentDisposing.add(clearWatcher)
- });
- this._optionChangedCallbacks.add(function(args) {
- var optionName = args.name;
- var fullName = args.fullName;
- var component = args.component;
- if (_this4._ngLocker.locked(fullName)) {
- _this4._ngLocker.release(fullName);
- return
- }
- if (!optionDependencies || !optionDependencies[optionName]) {
- return
- }
- var isActivePhase = _this4._scope.$root.$$phase;
- var obtainOption = function() {
- _this4._ngLocker.obtain(fullName)
- };
- if (isActivePhase) {
- _this4._digestCallbacks.begin.add(obtainOption)
- } else {
- obtainOption()
- }
- safeApply(function() {
- each(optionDependencies[optionName], function(optionPath, valuePath) {
- if (!_this4._optionsAreLinked(fullName, optionPath)) {
- return
- }
- var value = component.option(optionPath);
- _this4._parse(valuePath).assign(_this4._scope, value);
- var scopeValue = _this4._parse(valuePath)(_this4._scope);
- if (scopeValue !== value) {
- args.component.option(optionPath, scopeValue)
- }
- })
- }, _this4._scope);
- var releaseOption = function releaseOption() {
- if (_this4._ngLocker.locked(fullName)) {
- _this4._ngLocker.release(fullName)
- }
- _this4._digestCallbacks.begin.remove(obtainOption);
- _this4._digestCallbacks.end.remove(releaseOption)
- };
- if (isActivePhase) {
- _this4._digestCallbacks.end.addPrioritized(releaseOption)
- } else {
- releaseOption()
- }
- })
- },
- _optionsAreNested: function(optionPath1, optionPath2) {
- var parentSeparator = optionPath1[optionPath2.length];
- return 0 === optionPath1.indexOf(optionPath2) && ("." === parentSeparator || "[" === parentSeparator)
- },
- _optionsAreLinked: function(optionPath1, optionPath2) {
- if (optionPath1 === optionPath2) {
- return true
- }
- return optionPath1.length > optionPath2.length ? this._optionsAreNested(optionPath1, optionPath2) : this._optionsAreNested(optionPath2, optionPath1)
- },
- _compilerByTemplate: function(template) {
- var _this5 = this;
- var scopeItemsPath = this._getScopeItemsPath();
- return function(options) {
- var $resultMarkup = (0, _renderer2.default)(template).clone();
- var dataIsScope = options.model && options.model.constructor === _this5._scope.$root.constructor;
- var templateScope = dataIsScope ? options.model : options.noModel ? _this5._scope : _this5._createScopeWithData(options);
- if (scopeItemsPath) {
- _this5._synchronizeScopes(templateScope, scopeItemsPath, options.index)
- }
- $resultMarkup.appendTo(options.container);
- if (!options.noModel) {
- _events_engine2.default.on($resultMarkup, "$destroy", function() {
- var destroyAlreadyCalled = !templateScope.$parent;
- if (destroyAlreadyCalled) {
- return
- }
- templateScope.$destroy()
- })
- }
- var ngTemplate = _this5._compile($resultMarkup, _this5._transcludeFn);
- _this5._applyAsync(function(scope) {
- ngTemplate(scope, null, {
- parentBoundTranscludeFn: _this5._transcludeFn
- })
- }, templateScope);
- return $resultMarkup
- }
- },
- _applyAsync: function(func, scope) {
- var _this6 = this;
- func(scope);
- if (!scope.$root.$$phase) {
- if (!this._renderingTimer) {
- this._renderingTimer = setTimeout(function() {
- scope.$apply();
- _this6._renderingTimer = null
- })
- }
- this._componentDisposing.add(function() {
- clearTimeout(_this6._renderingTimer)
- })
- }
- },
- _getScopeItemsPath: function() {
- if (this._componentClass.subclassOf(_uiCollection_widget2.default) && this._ngOptions.bindingOptions && this._ngOptions.bindingOptions.items) {
- return this._ngOptions.bindingOptions.items.dataPath
- }
- },
- _createScopeWithData: function(options) {
- var newScope = this._scope.$new();
- if (this._itemAlias) {
- newScope[this._itemAlias] = options.model
- }
- if (_type2.default.isDefined(options.index)) {
- newScope.$index = options.index
- }
- return newScope
- },
- _synchronizeScopes: function(itemScope, parentPrefix, itemIndex) {
- if (this._itemAlias && "object" !== _typeof(itemScope[this._itemAlias])) {
- this._synchronizeScopeField({
- parentScope: this._scope,
- childScope: itemScope,
- fieldPath: this._itemAlias,
- parentPrefix: parentPrefix,
- itemIndex: itemIndex
- })
- }
- },
- _synchronizeScopeField: function(args) {
- var parentScope = args.parentScope;
- var childScope = args.childScope;
- var fieldPath = args.fieldPath;
- var parentPrefix = args.parentPrefix;
- var itemIndex = args.itemIndex;
- var innerPathSuffix = fieldPath === this._itemAlias ? "" : "." + fieldPath;
- var collectionField = void 0 !== itemIndex;
- var optionOuterBag = [parentPrefix];
- if (collectionField) {
- if (!_type2.default.isNumeric(itemIndex)) {
- return
- }
- optionOuterBag.push("[", itemIndex, "]")
- }
- optionOuterBag.push(innerPathSuffix);
- var optionOuterPath = optionOuterBag.join("");
- var clearParentWatcher = parentScope.$watch(optionOuterPath, function(newValue, oldValue) {
- if (newValue !== oldValue) {
- compileSetter(fieldPath)(childScope, newValue)
- }
- });
- var clearItemWatcher = childScope.$watch(fieldPath, function(newValue, oldValue) {
- if (newValue !== oldValue) {
- if (collectionField && !compileGetter(parentPrefix)(parentScope)[itemIndex]) {
- clearItemWatcher();
- return
- }
- compileSetter(optionOuterPath)(parentScope, newValue)
- }
- });
- this._componentDisposing.add([clearParentWatcher, clearItemWatcher])
- },
- _evalOptions: function(scope) {
- var _this8 = this;
- var result = extendFromObject({}, this._ngOptions);
- delete result.bindingOptions;
- if (this._ngOptions.bindingOptions) {
- each(this._ngOptions.bindingOptions, function(key, value) {
- result[key] = scope.$eval(value.dataPath)
- })
- }
- result._optionChangedCallbacks = this._optionChangedCallbacks;
- result._disposingCallbacks = this._componentDisposing;
- result.onActionCreated = function(component, action, config) {
- if (config && inArray(config.category, SKIP_APPLY_ACTION_CATEGORIES) > -1) {
- return action
- }
- var wrappedAction = function() {
- var _this7 = this;
- var args = arguments;
- if (!scope || !scope.$root || scope.$root.$$phase) {
- return action.apply(this, args)
- }
- return safeApply(function() {
- return action.apply(_this7, args)
- }, scope)
- };
- return wrappedAction
- };
- result.beforeActionExecute = result.onActionCreated;
- result.nestedComponentOptions = function(component) {
- return {
- templatesRenderAsynchronously: component.option("templatesRenderAsynchronously"),
- forceApplyBindings: component.option("forceApplyBindings"),
- modelByElement: component.option("modelByElement"),
- onActionCreated: component.option("onActionCreated"),
- beforeActionExecute: component.option("beforeActionExecute"),
- nestedComponentOptions: component.option("nestedComponentOptions")
- }
- };
- result.templatesRenderAsynchronously = true;
- if ((0, _config2.default)().wrapActionsBeforeExecute) {
- result.forceApplyBindings = function() {
- safeApply(function() {}, scope)
- }
- }
- result.integrationOptions = {
- createTemplate: function(element) {
- return new _template2.default(element, _this8._compilerByTemplate.bind(_this8))
- },
- watchMethod: function(fn, callback, options) {
- options = options || {};
- var immediateValue;
- var skipCallback = options.skipImmediate;
- var disposeWatcher = scope.$watch(function() {
- var value = fn();
- if (value instanceof Date) {
- value = value.valueOf()
- }
- return value
- }, function(newValue) {
- var isSameValue = immediateValue === newValue;
- if (!skipCallback && (!isSameValue || isSameValue && options.deep)) {
- callback(newValue)
- }
- skipCallback = false
- }, options.deep);
- if (!skipCallback) {
- immediateValue = fn();
- callback(immediateValue)
- }
- if ((0, _config2.default)().wrapActionsBeforeExecute) {
- _this8._applyAsync(function() {}, scope)
- }
- return disposeWatcher
- },
- templates: {
- "dx-polymorph-widget": {
- render: function(options) {
- var widgetName = options.model.widget;
- if (!widgetName) {
- return
- }
- if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) {
- var deprecatedName = widgetName;
- widgetName = _inflector2.default.camelize("dx-" + widgetName);
- _errors2.default.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead")
- }
- var markup = (0, _renderer2.default)("<div>").attr(_inflector2.default.dasherize(widgetName), "options").get(0);
- var newScope = _this8._scope.$new();
- newScope.options = options.model.options;
- options.container.append(markup);
- _this8._compile(markup)(newScope)
- }
- }
- }
- };
- result.modelByElement = function() {
- return scope
- };
- return result
- }
- });
- ComponentBuilder = ComponentBuilder.inherit({
- ctor: function(options) {
- this._componentName = options.componentName;
- this._ngModel = options.ngModel;
- this._ngModelController = options.ngModelController;
- this.callBase.apply(this, arguments)
- },
- _isNgModelRequired: function() {
- return (this._componentClass.subclassOf(_editor2.default) || this._componentClass.prototype instanceof _editor2.default) && this._ngModel
- },
- _initComponentBindings: function() {
- this.callBase.apply(this, arguments);
- this._initNgModelBinding()
- },
- _initNgModelBinding: function() {
- var _this9 = this;
- if (!this._isNgModelRequired()) {
- return
- }
- var clearNgModelWatcher = this._scope.$watch(this._ngModel, function(newValue, oldValue) {
- if (_this9._ngLocker.locked(NG_MODEL_OPTION)) {
- return
- }
- if (newValue === oldValue) {
- return
- }
- _this9._component.option(NG_MODEL_OPTION, newValue)
- });
- this._optionChangedCallbacks.add(function(args) {
- _this9._ngLocker.obtain(NG_MODEL_OPTION);
- try {
- if (args.name !== NG_MODEL_OPTION) {
- return
- }
- _this9._ngModelController.$setViewValue(args.value)
- } finally {
- if (_this9._ngLocker.locked(NG_MODEL_OPTION)) {
- _this9._ngLocker.release(NG_MODEL_OPTION)
- }
- }
- });
- this._componentDisposing.add(clearNgModelWatcher)
- },
- _evalOptions: function() {
- if (!this._isNgModelRequired()) {
- return this.callBase.apply(this, arguments)
- }
- var result = this.callBase.apply(this, arguments);
- result[NG_MODEL_OPTION] = this._parse(this._ngModel)(this._scope);
- return result
- }
- });
- var registeredComponents = {};
- var registerComponentDirective = function(name) {
- var priority = "dxValidator" !== name ? 1 : 10;
- _module2.default.directive(name, ["$compile", "$parse", "dxDigestCallbacks", function($compile, $parse, dxDigestCallbacks) {
- return {
- restrict: "A",
- require: "^?ngModel",
- priority: priority,
- compile: function($element) {
- var componentClass = registeredComponents[name];
- var $content = componentClass.subclassOf(_ui2.default) ? $element.contents().detach() : null;
- return function(scope, $element, attrs, ngModelController, transcludeFn) {
- $element.append($content);
- safeApply(function() {
- new ComponentBuilder({
- componentClass: componentClass,
- componentName: name,
- compile: $compile,
- parse: $parse,
- $element: $element,
- scope: scope,
- ngOptionsString: attrs[name],
- ngOptions: attrs[name] ? scope.$eval(attrs[name]) : {},
- ngModel: attrs.ngModel,
- ngModelController: ngModelController,
- transcludeFn: transcludeFn,
- itemAlias: attrs[ITEM_ALIAS_ATTRIBUTE_NAME],
- dxDigestCallbacks: dxDigestCallbacks
- })
- }, scope)
- }
- }
- }
- }])
- };
- _component_registrator_callbacks2.default.add(function(name, componentClass) {
- if (!registeredComponents[name]) {
- registerComponentDirective(name)
- }
- registeredComponents[name] = componentClass
- })
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/template.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _ui = __webpack_require__( /*! ./ui.template_base */ 74);
- var _ui2 = _interopRequireDefault(_ui);
- var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var _template_engine_registry = __webpack_require__( /*! ./template_engine_registry */ 210);
- __webpack_require__( /*! ./template_engines */ 463);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }(0, _template_engine_registry.registerTemplateEngine)("default", {
- compile: function(element) {
- return (0, _dom.normalizeTemplateElement)(element)
- },
- render: function(template, model, index) {
- return template.clone()
- }
- });
- (0, _template_engine_registry.setTemplateEngine)("default");
- var Template = _ui2.default.inherit({
- ctor: function(element) {
- this._element = element
- },
- _renderCore: function(options) {
- var transclude = options.transclude;
- if (!transclude && !this._compiledTemplate) {
- this._compiledTemplate = (0, _template_engine_registry.getCurrentTemplateEngine)().compile(this._element)
- }
- return (0, _renderer2.default)("<div>").append(transclude ? this._element : (0, _template_engine_registry.getCurrentTemplateEngine)().render(this._compiledTemplate, options.model, options.index)).contents()
- },
- source: function() {
- return (0, _renderer2.default)(this._element).clone()
- }
- });
- module.exports = Template
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/ui/widget/template_engines.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var _template_engine_registry = __webpack_require__( /*! ./template_engine_registry */ 210);
- (0, _template_engine_registry.registerTemplateEngine)("jquery-tmpl", {
- compile: function(element) {
- return (0, _dom.extractTemplateMarkup)(element)
- },
- render: function(template, data) {
- return jQuery.tmpl(template, data)
- }
- });
- (0, _template_engine_registry.registerTemplateEngine)("jsrender", {
- compile: function(element) {
- return (jQuery ? jQuery : jsrender).templates((0, _dom.extractTemplateMarkup)(element))
- },
- render: function(template, data) {
- return template.render(data)
- }
- });
- (0, _template_engine_registry.registerTemplateEngine)("mustache", {
- compile: function(element) {
- return (0, _dom.extractTemplateMarkup)(element)
- },
- render: function(template, data) {
- return Mustache.render(template, data)
- }
- });
- (0, _template_engine_registry.registerTemplateEngine)("hogan", {
- compile: function(element) {
- return Hogan.compile((0, _dom.extractTemplateMarkup)(element))
- },
- render: function(template, data) {
- return template.render(data)
- }
- });
- (0, _template_engine_registry.registerTemplateEngine)("underscore", {
- compile: function(element) {
- return _.template((0, _dom.extractTemplateMarkup)(element))
- },
- render: function(template, data) {
- return template(data)
- }
- });
- (0, _template_engine_registry.registerTemplateEngine)("handlebars", {
- compile: function(element) {
- return Handlebars.compile((0, _dom.extractTemplateMarkup)(element))
- },
- render: function(template, data) {
- return template(data)
- }
- });
- (0, _template_engine_registry.registerTemplateEngine)("doT", {
- compile: function(element) {
- return doT.template((0, _dom.extractTemplateMarkup)(element))
- },
- render: function(template, data) {
- return template(data)
- }
- })
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/ui/overlay/ui.overlay.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
- var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
- var window = windowUtils.getWindow();
- var navigator = windowUtils.getNavigator();
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var fx = __webpack_require__( /*! ../../animation/fx */ 38);
- var translator = __webpack_require__( /*! ../../animation/translator */ 27);
- var compareVersions = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
- var viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 78);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var getPublicElement = __webpack_require__( /*! ../../core/utils/dom */ 12).getPublicElement;
- var viewPortChanged = viewPortUtils.changeCallback;
- var hideTopOverlayCallback = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 213).hideCallback;
- var positionUtils = __webpack_require__( /*! ../../animation/position */ 77);
- var fitIntoRange = __webpack_require__( /*! ../../core/utils/math */ 28).fitIntoRange;
- var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var devices = __webpack_require__( /*! ../../core/devices */ 16);
- var browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
- var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
- var Widget = __webpack_require__( /*! ../widget/ui.widget */ 18);
- var KeyboardProcessor = __webpack_require__( /*! ../widget/ui.keyboard_processor */ 167);
- var selectors = __webpack_require__( /*! ../widget/selectors */ 66);
- var dragEvents = __webpack_require__( /*! ../../events/drag */ 56);
- var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
- var pointerEvents = __webpack_require__( /*! ../../events/pointer */ 23);
- var Resizable = __webpack_require__( /*! ../resizable */ 173);
- var EmptyTemplate = __webpack_require__( /*! ../widget/empty_template */ 109);
- var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
- var zIndexPool = __webpack_require__( /*! ./z_index */ 465);
- var swatch = __webpack_require__( /*! ../widget/swatch_container */ 150);
- var OVERLAY_CLASS = "dx-overlay";
- var OVERLAY_WRAPPER_CLASS = "dx-overlay-wrapper";
- var OVERLAY_CONTENT_CLASS = "dx-overlay-content";
- var OVERLAY_SHADER_CLASS = "dx-overlay-shader";
- var OVERLAY_MODAL_CLASS = "dx-overlay-modal";
- var INNER_OVERLAY_CLASS = "dx-inner-overlay";
- var INVISIBLE_STATE_CLASS = "dx-state-invisible";
- var ANONYMOUS_TEMPLATE_NAME = "content";
- var RTL_DIRECTION_CLASS = "dx-rtl";
- var ACTIONS = ["onShowing", "onShown", "onHiding", "onHidden", "onPositioning", "onPositioned", "onResizeStart", "onResize", "onResizeEnd"];
- var OVERLAY_STACK = [];
- var DISABLED_STATE_CLASS = "dx-state-disabled";
- var PREVENT_SAFARI_SCROLLING_CLASS = "dx-prevent-safari-scrolling";
- var TAB_KEY = "tab";
- var POSITION_ALIASES = {
- top: {
- my: "top center",
- at: "top center"
- },
- bottom: {
- my: "bottom center",
- at: "bottom center"
- },
- right: {
- my: "right center",
- at: "right center"
- },
- left: {
- my: "left center",
- at: "left center"
- },
- center: {
- my: "center",
- at: "center"
- },
- "right bottom": {
- my: "right bottom",
- at: "right bottom"
- },
- "right top": {
- my: "right top",
- at: "right top"
- },
- "left bottom": {
- my: "left bottom",
- at: "left bottom"
- },
- "left top": {
- my: "left top",
- at: "left top"
- }
- };
- var realDevice = devices.real();
- var realVersion = realDevice.version;
- var firefoxDesktop = browser.mozilla && "desktop" === realDevice.deviceType;
- var iOS = "ios" === realDevice.platform;
- var hasSafariAddressBar = browser.safari && "desktop" !== realDevice.deviceType;
- var iOS7_0andBelow = iOS && compareVersions(realVersion, [7, 1]) < 0;
- var android4_0nativeBrowser = "android" === realDevice.platform && 0 === compareVersions(realVersion, [4, 0], 2) && navigator.userAgent.indexOf("Chrome") === -1;
- var forceRepaint = function($element) {
- if (iOS7_0andBelow || firefoxDesktop) {
- $element.width()
- }
- if (android4_0nativeBrowser) {
- var $parents = $element.parents();
- var inScrollView = $parents.is(".dx-scrollable-native");
- if (!inScrollView) {
- $parents.css("backfaceVisibility", "hidden");
- $parents.css("backfaceVisibility");
- $parents.css("backfaceVisibility", "visible")
- }
- }
- };
- var getElement = function(value) {
- return value && $(value.target || value)
- };
- ready(function() {
- eventsEngine.subscribeGlobal(domAdapter.getDocument(), pointerEvents.down, function(e) {
- for (var i = OVERLAY_STACK.length - 1; i >= 0; i--) {
- if (!OVERLAY_STACK[i]._proxiedDocumentDownHandler(e)) {
- return
- }
- }
- })
- });
- var Overlay = Widget.inherit({
- _supportedKeys: function() {
- var offsetSize = 5;
- var move = function(top, left, e) {
- if (!this.option("dragEnabled")) {
- return
- }
- e.preventDefault();
- e.stopPropagation();
- var allowedOffsets = this._allowedOffsets();
- var offset = {
- top: fitIntoRange(top, -allowedOffsets.top, allowedOffsets.bottom),
- left: fitIntoRange(left, -allowedOffsets.left, allowedOffsets.right)
- };
- this._changePosition(offset)
- };
- return extend(this.callBase(), {
- escape: function() {
- this.hide()
- },
- upArrow: move.bind(this, -offsetSize, 0),
- downArrow: move.bind(this, offsetSize, 0),
- leftArrow: move.bind(this, 0, -offsetSize),
- rightArrow: move.bind(this, 0, offsetSize)
- })
- },
- _getDefaultOptions: function() {
- return extend(this.callBase(), {
- activeStateEnabled: false,
- visible: false,
- deferRendering: true,
- shading: true,
- shadingColor: "",
- position: {
- my: "center",
- at: "center"
- },
- width: function() {
- return .8 * $(window).width()
- },
- minWidth: null,
- maxWidth: null,
- height: function() {
- return .8 * $(window).height()
- },
- minHeight: null,
- maxHeight: null,
- animation: {
- show: {
- type: "pop",
- duration: 300,
- from: {
- scale: .55
- }
- },
- hide: {
- type: "pop",
- duration: 300,
- to: {
- opacity: 0,
- scale: .55
- },
- from: {
- opacity: 1,
- scale: 1
- }
- }
- },
- closeOnOutsideClick: false,
- closeOnBackButton: true,
- onShowing: null,
- onShown: null,
- onHiding: null,
- onHidden: null,
- contentTemplate: "content",
- dragEnabled: false,
- resizeEnabled: false,
- onResizeStart: null,
- onResize: null,
- onResizeEnd: null,
- innerOverlay: false,
- target: void 0,
- container: void 0,
- hideTopOverlayHandler: void 0,
- closeOnTargetScroll: false,
- onPositioned: null,
- boundaryOffset: {
- h: 0,
- v: 0
- },
- propagateOutsideClick: false,
- ignoreChildEvents: true,
- _checkParentVisibility: true
- })
- },
- _defaultOptionsRules: function() {
- return this.callBase().concat([{
- device: function() {
- var realDevice = devices.real();
- var realPlatform = realDevice.platform;
- var realVersion = realDevice.version;
- return "android" === realPlatform && compareVersions(realVersion, [4, 2]) < 0
- },
- options: {
- animation: {
- show: {
- type: "fade",
- duration: 400
- },
- hide: {
- type: "fade",
- duration: 400,
- to: {
- opacity: 0
- },
- from: {
- opacity: 1
- }
- }
- }
- }
- }, {
- device: function() {
- return !windowUtils.hasWindow()
- },
- options: {
- width: null,
- height: null,
- animation: null,
- _checkParentVisibility: false
- }
- }])
- },
- _setOptionsByReference: function() {
- this.callBase();
- extend(this._optionsByReference, {
- animation: true
- })
- },
- _getAnonymousTemplateName: function() {
- return ANONYMOUS_TEMPLATE_NAME
- },
- _wrapper: function() {
- return this._$wrapper
- },
- _container: function() {
- return this._$content
- },
- _eventBindingTarget: function() {
- return this._$content
- },
- _init: function() {
- this.callBase();
- this._initActions();
- this._initCloseOnOutsideClickHandler();
- this._initTabTerminatorHandler();
- this._$wrapper = $("<div>").addClass(OVERLAY_WRAPPER_CLASS);
- this._$content = $("<div>").addClass(OVERLAY_CONTENT_CLASS);
- this._initInnerOverlayClass();
- var $element = this.$element();
- this._$wrapper.addClass($element.attr("class"));
- $element.addClass(OVERLAY_CLASS);
- this._$wrapper.attr("data-bind", "dxControlsDescendantBindings: true");
- eventsEngine.on(this._$wrapper, "MSPointerDown", noop);
- eventsEngine.on(this._$wrapper, "focusin", function(e) {
- e.stopPropagation()
- });
- this._toggleViewPortSubscription(true)
- },
- _initOptions: function(options) {
- this._initTarget(options.target);
- var container = void 0 === options.container ? this.option("container") : options.container;
- this._initContainer(container);
- this._initHideTopOverlayHandler(options.hideTopOverlayHandler);
- this.callBase(options)
- },
- _initInnerOverlayClass: function() {
- this._$content.toggleClass(INNER_OVERLAY_CLASS, this.option("innerOverlay"))
- },
- _initTarget: function(target) {
- if (!typeUtils.isDefined(target)) {
- return
- }
- var options = this.option();
- each(["position.of", "animation.show.from.position.of", "animation.show.to.position.of", "animation.hide.from.position.of", "animation.hide.to.position.of"], function(_, path) {
- var pathParts = path.split(".");
- var option = options;
- while (option) {
- if (1 === pathParts.length) {
- if (typeUtils.isPlainObject(option)) {
- option[pathParts.shift()] = target
- }
- break
- } else {
- option = option[pathParts.shift()]
- }
- }
- })
- },
- _initContainer: function(container) {
- container = void 0 === container ? viewPortUtils.value() : container;
- var $element = this.$element();
- var $container = $element.closest(container);
- if (!$container.length) {
- $container = $(container).first()
- }
- this._$container = $container.length ? $container : $element.parent()
- },
- _initHideTopOverlayHandler: function(handler) {
- this._hideTopOverlayHandler = void 0 !== handler ? handler : this._defaultHideTopOverlayHandler.bind(this)
- },
- _defaultHideTopOverlayHandler: function() {
- this.hide()
- },
- _initActions: function() {
- this._actions = {};
- each(ACTIONS, function(_, action) {
- this._actions[action] = this._createActionByOption(action, {
- excludeValidators: ["disabled", "readOnly"]
- }) || noop
- }.bind(this))
- },
- _initCloseOnOutsideClickHandler: function() {
- var that = this;
- this._proxiedDocumentDownHandler = function() {
- return that._documentDownHandler.apply(that, arguments)
- }
- },
- _documentDownHandler: function(e) {
- if (this._showAnimationProcessing) {
- this._stopAnimation()
- }
- var closeOnOutsideClick = this.option("closeOnOutsideClick");
- if (typeUtils.isFunction(closeOnOutsideClick)) {
- closeOnOutsideClick = closeOnOutsideClick(e)
- }
- var $container = this._$content;
- var isAttachedTarget = $(window.document).is(e.target) || domUtils.contains(window.document, e.target);
- var isInnerOverlay = $(e.target).closest("." + INNER_OVERLAY_CLASS).length;
- var outsideClick = isAttachedTarget && !isInnerOverlay && !($container.is(e.target) || domUtils.contains($container.get(0), e.target));
- if (outsideClick && closeOnOutsideClick) {
- if (this.option("shading")) {
- e.preventDefault()
- }
- this.hide()
- }
- return this.option("propagateOutsideClick")
- },
- _initTemplates: function() {
- this.callBase();
- this._defaultTemplates.content = new EmptyTemplate(this)
- },
- _isTopOverlay: function() {
- var overlayStack = this._overlayStack();
- for (var i = overlayStack.length - 1; i >= 0; i--) {
- var tabbableElements = overlayStack[i]._findTabbableBounds();
- if (tabbableElements.first || tabbableElements.last) {
- return overlayStack[i] === this
- }
- }
- return false
- },
- _overlayStack: function() {
- return OVERLAY_STACK
- },
- _zIndexInitValue: function() {
- return Overlay.baseZIndex()
- },
- _toggleViewPortSubscription: function(toggle) {
- viewPortChanged.remove(this._viewPortChangeHandle);
- if (toggle) {
- this._viewPortChangeHandle = this._viewPortChangeHandler.bind(this);
- viewPortChanged.add(this._viewPortChangeHandle)
- }
- },
- _viewPortChangeHandler: function() {
- this._initContainer(this.option("container"));
- this._refresh()
- },
- _renderVisibilityAnimate: function(visible) {
- this._stopAnimation();
- return visible ? this._show() : this._hide()
- },
- _normalizePosition: function() {
- var position = this.option("position");
- this._position = "function" === typeof position ? position() : position
- },
- _getAnimationConfig: function() {
- var animation = this.option("animation");
- if (typeUtils.isFunction(animation)) {
- animation = animation.call(this)
- }
- return animation
- },
- _show: function() {
- var that = this;
- var deferred = new Deferred;
- this._parentHidden = this._isParentHidden();
- deferred.done(function() {
- delete that._parentHidden
- });
- if (this._parentHidden) {
- this._isHidden = true;
- return deferred.resolve()
- }
- if (this._currentVisible) {
- return (new Deferred).resolve().promise()
- }
- this._currentVisible = true;
- this._isShown = false;
- this._normalizePosition();
- var animation = that._getAnimationConfig() || {};
- var showAnimation = this._normalizeAnimation(animation.show, "to");
- var startShowAnimation = showAnimation && showAnimation.start || noop;
- var completeShowAnimation = showAnimation && showAnimation.complete || noop;
- if (this._isHidingActionCanceled) {
- delete this._isHidingActionCanceled;
- deferred.resolve()
- } else {
- var show = function() {
- this._renderVisibility(true);
- if (this._isShowingActionCanceled) {
- delete this._isShowingActionCanceled;
- deferred.resolve();
- return
- }
- this._animate(showAnimation, function() {
- if (that.option("focusStateEnabled")) {
- eventsEngine.trigger(that._focusTarget(), "focus")
- }
- completeShowAnimation.apply(this, arguments);
- that._showAnimationProcessing = false;
- that._isShown = true;
- that._actions.onShown();
- that._toggleSafariScrolling(false);
- deferred.resolve()
- }, function() {
- startShowAnimation.apply(this, arguments);
- that._showAnimationProcessing = true
- })
- }.bind(this);
- if (this.option("templatesRenderAsynchronously")) {
- this._stopShowTimer();
- this._asyncShowTimeout = setTimeout(show)
- } else {
- show()
- }
- }
- return deferred.promise()
- },
- _normalizeAnimation: function(animation, prop) {
- if (animation) {
- animation = extend({
- type: "slide"
- }, animation);
- if (animation[prop] && "object" === _typeof(animation[prop])) {
- extend(animation[prop], {
- position: this._position
- })
- }
- }
- return animation
- },
- _hide: function() {
- if (!this._currentVisible) {
- return (new Deferred).resolve().promise()
- }
- this._currentVisible = false;
- var that = this;
- var deferred = new Deferred;
- var animation = that._getAnimationConfig() || {};
- var hideAnimation = this._normalizeAnimation(animation.hide, "from");
- var startHideAnimation = hideAnimation && hideAnimation.start || noop;
- var completeHideAnimation = hideAnimation && hideAnimation.complete || noop;
- var hidingArgs = {
- cancel: false
- };
- if (this._isShowingActionCanceled) {
- deferred.resolve()
- } else {
- this._actions.onHiding(hidingArgs);
- that._toggleSafariScrolling(true);
- if (hidingArgs.cancel) {
- this._isHidingActionCanceled = true;
- this.option("visible", true);
- deferred.resolve()
- } else {
- this._forceFocusLost();
- this._toggleShading(false);
- this._toggleSubscriptions(false);
- this._stopShowTimer();
- this._animate(hideAnimation, function() {
- that._$content.css("pointerEvents", "");
- that._renderVisibility(false);
- completeHideAnimation.apply(this, arguments);
- that._actions.onHidden();
- deferred.resolve()
- }, function() {
- that._$content.css("pointerEvents", "none");
- startHideAnimation.apply(this, arguments)
- })
- }
- }
- return deferred.promise()
- },
- _forceFocusLost: function() {
- var activeElement = domAdapter.getActiveElement();
- var shouldResetActiveElement = !!this._$content.find(activeElement).length;
- if (shouldResetActiveElement) {
- domUtils.resetActiveElement()
- }
- },
- _animate: function(animation, completeCallback, startCallback) {
- if (animation) {
- startCallback = startCallback || animation.start || noop;
- fx.animate(this._$content, extend({}, animation, {
- start: startCallback,
- complete: completeCallback
- }))
- } else {
- completeCallback()
- }
- },
- _stopAnimation: function() {
- fx.stop(this._$content, true)
- },
- _renderVisibility: function(visible) {
- if (visible && this._isParentHidden()) {
- return
- }
- this._currentVisible = visible;
- this._stopAnimation();
- if (!visible) {
- domUtils.triggerHidingEvent(this._$content)
- }
- this._toggleVisibility(visible);
- this._$content.toggleClass(INVISIBLE_STATE_CLASS, !visible);
- this._updateZIndexStackPosition(visible);
- if (visible) {
- this._renderContent();
- var showingArgs = {
- cancel: false
- };
- this._actions.onShowing(showingArgs);
- if (showingArgs.cancel) {
- this._toggleVisibility(false);
- this._$content.toggleClass(INVISIBLE_STATE_CLASS, true);
- this._updateZIndexStackPosition(false);
- this._moveFromContainer();
- this._isShowingActionCanceled = true;
- this.option("visible", false);
- return
- }
- this._moveToContainer();
- this._renderGeometry();
- domUtils.triggerShownEvent(this._$content);
- domUtils.triggerResizeEvent(this._$content)
- } else {
- this._moveFromContainer()
- }
- this._toggleShading(visible);
- this._toggleSubscriptions(visible)
- },
- _updateZIndexStackPosition: function(pushToStack) {
- var overlayStack = this._overlayStack();
- var index = inArray(this, overlayStack);
- if (pushToStack) {
- if (index === -1) {
- this._zIndex = zIndexPool.create(this._zIndexInitValue());
- overlayStack.push(this)
- }
- this._$wrapper.css("zIndex", this._zIndex);
- this._$content.css("zIndex", this._zIndex)
- } else {
- if (index !== -1) {
- overlayStack.splice(index, 1);
- zIndexPool.remove(this._zIndex)
- }
- }
- },
- _toggleShading: function(visible) {
- this._$wrapper.toggleClass(OVERLAY_MODAL_CLASS, this.option("shading") && !this.option("container"));
- this._$wrapper.toggleClass(OVERLAY_SHADER_CLASS, visible && this.option("shading"));
- this._$wrapper.css("backgroundColor", this.option("shading") ? this.option("shadingColor") : "");
- this._toggleTabTerminator(visible && this.option("shading"))
- },
- _initTabTerminatorHandler: function() {
- var that = this;
- this._proxiedTabTerminatorHandler = function() {
- that._tabKeyHandler.apply(that, arguments)
- }
- },
- _toggleTabTerminator: function(enabled) {
- var eventName = eventUtils.addNamespace("keydown", this.NAME);
- if (enabled) {
- eventsEngine.on(domAdapter.getDocument(), eventName, this._proxiedTabTerminatorHandler)
- } else {
- eventsEngine.off(domAdapter.getDocument(), eventName, this._proxiedTabTerminatorHandler)
- }
- },
- _findTabbableBounds: function() {
- var $elements = this._$wrapper.find("*");
- var elementsCount = $elements.length - 1;
- var result = {
- first: null,
- last: null
- };
- for (var i = 0; i <= elementsCount; i++) {
- if (!result.first && $elements.eq(i).is(selectors.tabbable)) {
- result.first = $elements.eq(i)
- }
- if (!result.last && $elements.eq(elementsCount - i).is(selectors.tabbable)) {
- result.last = $elements.eq(elementsCount - i)
- }
- if (result.first && result.last) {
- break
- }
- }
- return result
- },
- _tabKeyHandler: function(e) {
- if (eventUtils.normalizeKeyName(e) !== TAB_KEY || !this._isTopOverlay()) {
- return
- }
- var tabbableElements = this._findTabbableBounds();
- var $firstTabbable = tabbableElements.first;
- var $lastTabbable = tabbableElements.last;
- var isTabOnLast = !e.shiftKey && e.target === $lastTabbable.get(0);
- var isShiftTabOnFirst = e.shiftKey && e.target === $firstTabbable.get(0);
- var isEmptyTabList = 0 === tabbableElements.length;
- var isOutsideTarget = !domUtils.contains(this._$wrapper.get(0), e.target);
- if (isTabOnLast || isShiftTabOnFirst || isEmptyTabList || isOutsideTarget) {
- e.preventDefault();
- var $focusElement = e.shiftKey ? $lastTabbable : $firstTabbable;
- eventsEngine.trigger($focusElement, "focusin");
- eventsEngine.trigger($focusElement, "focus")
- }
- },
- _toggleSubscriptions: function(enabled) {
- if (windowUtils.hasWindow()) {
- this._toggleHideTopOverlayCallback(enabled);
- this._toggleParentsScrollSubscription(enabled)
- }
- },
- _toggleHideTopOverlayCallback: function(subscribe) {
- if (!this._hideTopOverlayHandler) {
- return
- }
- if (subscribe && this.option("closeOnBackButton")) {
- hideTopOverlayCallback.add(this._hideTopOverlayHandler)
- } else {
- hideTopOverlayCallback.remove(this._hideTopOverlayHandler)
- }
- },
- _toggleParentsScrollSubscription: function(subscribe) {
- if (!this._position) {
- return
- }
- var target = this._position.of || $();
- var closeOnScroll = this.option("closeOnTargetScroll");
- var $parents = getElement(target).parents();
- var scrollEvent = eventUtils.addNamespace("scroll", this.NAME);
- if ("generic" === devices.real().platform) {
- $parents = $parents.add(window)
- }
- this._proxiedTargetParentsScrollHandler = this._proxiedTargetParentsScrollHandler || function(e) {
- this._targetParentsScrollHandler(e)
- }.bind(this);
- eventsEngine.off($().add(this._$prevTargetParents), scrollEvent, this._proxiedTargetParentsScrollHandler);
- if (subscribe && closeOnScroll) {
- eventsEngine.on($parents, scrollEvent, this._proxiedTargetParentsScrollHandler);
- this._$prevTargetParents = $parents
- }
- },
- _targetParentsScrollHandler: function(e) {
- var closeHandled = false;
- var closeOnScroll = this.option("closeOnTargetScroll");
- if (typeUtils.isFunction(closeOnScroll)) {
- closeHandled = closeOnScroll(e)
- }
- if (!closeHandled && !this._showAnimationProcessing) {
- this.hide()
- }
- },
- _render: function() {
- this.callBase();
- this._appendContentToElement();
- this._renderVisibilityAnimate(this.option("visible"))
- },
- _appendContentToElement: function() {
- if (!this._$content.parent().is(this.$element())) {
- this._$content.appendTo(this.$element())
- }
- },
- _renderContent: function() {
- var shouldDeferRendering = !this._currentVisible && this.option("deferRendering");
- var isParentHidden = this.option("visible") && this._isParentHidden();
- if (isParentHidden) {
- this._isHidden = true;
- return
- }
- if (this._contentAlreadyRendered || shouldDeferRendering) {
- return
- }
- this._contentAlreadyRendered = true;
- this._appendContentToElement();
- this.callBase()
- },
- _isParentHidden: function() {
- if (!this.option("_checkParentVisibility")) {
- return false
- }
- if (void 0 !== this._parentHidden) {
- return this._parentHidden
- }
- var $parent = this.$element().parent();
- if ($parent.is(":visible")) {
- return false
- }
- var isHidden = false;
- $parent.add($parent.parents()).each(function() {
- var $element = $(this);
- if ("none" === $element.css("display")) {
- isHidden = true;
- return false
- }
- });
- return isHidden || !domAdapter.getBody().contains($parent.get(0))
- },
- _renderContentImpl: function() {
- var _this = this;
- var whenContentRendered = new Deferred;
- var contentTemplateOption = this.option("contentTemplate");
- var contentTemplate = this._getTemplate(contentTemplateOption);
- var transclude = this._getAnonymousTemplateName() === contentTemplateOption;
- contentTemplate && contentTemplate.render({
- container: getPublicElement(this.$content()),
- noModel: true,
- transclude: transclude,
- onRendered: function() {
- whenContentRendered.resolve()
- }
- });
- this._renderDrag();
- this._renderResize();
- this._renderScrollTerminator();
- whenContentRendered.done(function() {
- if (_this.option("visible")) {
- _this._moveToContainer()
- }
- });
- return whenContentRendered.promise()
- },
- _renderDrag: function() {
- var $dragTarget = this._getDragTarget();
- if (!$dragTarget) {
- return
- }
- var startEventName = eventUtils.addNamespace(dragEvents.start, this.NAME);
- var updateEventName = eventUtils.addNamespace(dragEvents.move, this.NAME);
- eventsEngine.off($dragTarget, startEventName);
- eventsEngine.off($dragTarget, updateEventName);
- if (!this.option("dragEnabled")) {
- return
- }
- eventsEngine.on($dragTarget, startEventName, this._dragStartHandler.bind(this));
- eventsEngine.on($dragTarget, updateEventName, this._dragUpdateHandler.bind(this))
- },
- _renderResize: function() {
- this._resizable = this._createComponent(this._$content, Resizable, {
- handles: this.option("resizeEnabled") ? "all" : "none",
- onResizeEnd: this._resizeEndHandler.bind(this),
- onResize: this._actions.onResize.bind(this),
- onResizeStart: this._actions.onResizeStart.bind(this),
- minHeight: 100,
- minWidth: 100,
- area: this._getDragResizeContainer()
- })
- },
- _resizeEndHandler: function() {
- this._positionChangeHandled = true;
- var width = this._resizable.option("width");
- var height = this._resizable.option("height");
- width && this.option("width", width);
- height && this.option("height", height);
- this._actions.onResizeEnd()
- },
- _renderScrollTerminator: function() {
- var $scrollTerminator = this._wrapper();
- var terminatorEventName = eventUtils.addNamespace(dragEvents.move, this.NAME);
- eventsEngine.off($scrollTerminator, terminatorEventName);
- eventsEngine.on($scrollTerminator, terminatorEventName, {
- validate: function() {
- return true
- },
- getDirection: function() {
- return "both"
- },
- _toggleGestureCover: function(toggle) {
- if (!toggle) {
- this._toggleGestureCoverImpl(toggle)
- }
- },
- _clearSelection: noop,
- isNative: true
- }, function(e) {
- var originalEvent = e.originalEvent.originalEvent;
- e._cancelPreventDefault = true;
- if (originalEvent && "mousemove" !== originalEvent.type) {
- e.preventDefault()
- }
- })
- },
- _getDragTarget: function() {
- return this.$content()
- },
- _dragStartHandler: function(e) {
- e.targetElements = [];
- this._prevOffset = {
- x: 0,
- y: 0
- };
- var allowedOffsets = this._allowedOffsets();
- e.maxTopOffset = allowedOffsets.top;
- e.maxBottomOffset = allowedOffsets.bottom;
- e.maxLeftOffset = allowedOffsets.left;
- e.maxRightOffset = allowedOffsets.right
- },
- _getDragResizeContainer: function() {
- var isContainerDefined = viewPortUtils.originalViewPort().get(0) || this.option("container");
- var $container = !isContainerDefined ? $(window) : this._$container;
- return $container
- },
- _deltaSize: function() {
- var $content = this._$content;
- var $container = this._getDragResizeContainer();
- var contentWidth = $content.outerWidth();
- var contentHeight = $content.outerHeight();
- var containerWidth = $container.outerWidth();
- var containerHeight = $container.outerHeight();
- if (this._isWindow($container)) {
- var document = domAdapter.getDocument();
- var fullPageHeight = Math.max($(document).outerHeight(), containerHeight);
- var fullPageWidth = Math.max($(document).outerWidth(), containerWidth);
- containerHeight = fullPageHeight;
- containerWidth = fullPageWidth
- }
- return {
- width: containerWidth - contentWidth,
- height: containerHeight - contentHeight
- }
- },
- _dragUpdateHandler: function(e) {
- var offset = e.offset;
- var prevOffset = this._prevOffset;
- var targetOffset = {
- top: offset.y - prevOffset.y,
- left: offset.x - prevOffset.x
- };
- this._changePosition(targetOffset);
- this._prevOffset = offset
- },
- _changePosition: function(offset) {
- var position = translator.locate(this._$content);
- translator.move(this._$content, {
- left: position.left + offset.left,
- top: position.top + offset.top
- });
- this._positionChangeHandled = true
- },
- _allowedOffsets: function() {
- var position = translator.locate(this._$content);
- var deltaSize = this._deltaSize();
- var isAllowedDrag = deltaSize.height >= 0 && deltaSize.width >= 0;
- var shaderOffset = this.option("shading") && !this.option("container") && !this._isWindow(this._getContainer()) ? translator.locate(this._$wrapper) : {
- top: 0,
- left: 0
- };
- var boundaryOffset = this.option("boundaryOffset");
- return {
- top: isAllowedDrag ? position.top + shaderOffset.top + boundaryOffset.v : 0,
- bottom: isAllowedDrag ? -position.top - shaderOffset.top + deltaSize.height - boundaryOffset.v : 0,
- left: isAllowedDrag ? position.left + shaderOffset.left + boundaryOffset.h : 0,
- right: isAllowedDrag ? -position.left - shaderOffset.left + deltaSize.width - boundaryOffset.h : 0
- }
- },
- _moveFromContainer: function() {
- this._$content.appendTo(this.$element());
- this._detachWrapperToContainer()
- },
- _detachWrapperToContainer: function() {
- this._$wrapper.detach()
- },
- _moveToContainer: function() {
- this._attachWrapperToContainer();
- this._$content.appendTo(this._$wrapper)
- },
- _attachWrapperToContainer: function() {
- var $element = this.$element();
- var containerDefined = void 0 !== this.option("container");
- var renderContainer = containerDefined ? this._$container : swatch.getSwatchContainer($element);
- if (renderContainer && renderContainer[0] === $element.parent()[0]) {
- renderContainer = $element
- }
- this._$wrapper.appendTo(renderContainer)
- },
- _fixHeightAfterSafariAddressBarResizing: function() {
- if (this._isWindow(this._getContainer()) && hasSafariAddressBar) {
- this._$wrapper.css("minHeight", window.innerHeight)
- }
- },
- _renderGeometry: function(isDimensionChanged) {
- if (this.option("visible") && windowUtils.hasWindow()) {
- this._renderGeometryImpl(isDimensionChanged)
- }
- },
- _renderGeometryImpl: function(isDimensionChanged) {
- this._stopAnimation();
- this._normalizePosition();
- this._renderShading();
- this._fixHeightAfterSafariAddressBarResizing();
- this._renderDimensions();
- var resultPosition = this._renderPosition();
- this._actions.onPositioned({
- position: resultPosition
- })
- },
- _fixWrapperPosition: function() {
- this._$wrapper.css("position", this._useFixedPosition() ? "fixed" : "absolute")
- },
- _useFixedPosition: function() {
- var $container = this._getContainer();
- return this._isWindow($container) && (!iOS || void 0 !== this._bodyScrollTop)
- },
- _toggleSafariScrolling: function(scrollingEnabled) {
- if (iOS && this._useFixedPosition()) {
- var body = domAdapter.getBody();
- if (scrollingEnabled) {
- $(body).removeClass(PREVENT_SAFARI_SCROLLING_CLASS);
- window.scrollTo(0, this._bodyScrollTop);
- this._bodyScrollTop = void 0
- } else {
- if (this.option("visible")) {
- this._bodyScrollTop = window.pageYOffset;
- $(body).addClass(PREVENT_SAFARI_SCROLLING_CLASS)
- }
- }
- }
- },
- _renderShading: function() {
- this._fixWrapperPosition();
- this._renderShadingDimensions();
- this._renderShadingPosition()
- },
- _renderShadingPosition: function() {
- if (this.option("shading")) {
- var $container = this._getContainer();
- positionUtils.setup(this._$wrapper, {
- my: "top left",
- at: "top left",
- of: $container
- })
- }
- },
- _renderShadingDimensions: function() {
- var wrapperWidth;
- var wrapperHeight;
- if (this.option("shading")) {
- var $container = this._getContainer();
- wrapperWidth = this._isWindow($container) ? "100%" : $container.outerWidth(), wrapperHeight = this._isWindow($container) ? "100%" : $container.outerHeight()
- } else {
- wrapperWidth = "";
- wrapperHeight = ""
- }
- this._$wrapper.css({
- width: wrapperWidth,
- height: wrapperHeight
- })
- },
- _isWindow: function($element) {
- return !!$element && typeUtils.isWindow($element.get(0))
- },
- _getContainer: function() {
- var position = this._position;
- var container = this.option("container");
- var positionOf = position ? position.of || window : null;
- return getElement(container || positionOf)
- },
- _renderDimensions: function() {
- var content = this._$content.get(0);
- this._$content.css({
- minWidth: this._getOptionValue("minWidth", content),
- maxWidth: this._getOptionValue("maxWidth", content),
- minHeight: this._getOptionValue("minHeight", content),
- maxHeight: this._getOptionValue("maxHeight", content),
- width: this._getOptionValue("width", content),
- height: this._getOptionValue("height", content)
- })
- },
- _renderPosition: function() {
- if (this._positionChangeHandled) {
- var allowedOffsets = this._allowedOffsets();
- this._changePosition({
- top: fitIntoRange(0, -allowedOffsets.top, allowedOffsets.bottom),
- left: fitIntoRange(0, -allowedOffsets.left, allowedOffsets.right)
- })
- } else {
- this._renderOverlayBoundaryOffset();
- translator.resetPosition(this._$content);
- var position = this._transformStringPosition(this._position, POSITION_ALIASES);
- var resultPosition = positionUtils.setup(this._$content, position);
- forceRepaint(this._$content);
- this._actions.onPositioning();
- return resultPosition
- }
- },
- _transformStringPosition: function(position, positionAliases) {
- if (typeUtils.isString(position)) {
- position = extend({}, positionAliases[position])
- }
- return position
- },
- _renderOverlayBoundaryOffset: function() {
- var boundaryOffset = this.option("boundaryOffset");
- this._$content.css("margin", boundaryOffset.v + "px " + boundaryOffset.h + "px")
- },
- _focusTarget: function() {
- return this._$content
- },
- _attachKeyboardEvents: function() {
- this._keyboardProcessor = new KeyboardProcessor({
- element: this._$content,
- handler: this._keyboardHandler,
- context: this
- })
- },
- _keyboardHandler: function(options) {
- var e = options.originalEvent;
- var $target = $(e.target);
- if ($target.is(this._$content) || !this.option("ignoreChildEvents")) {
- this.callBase.apply(this, arguments)
- }
- },
- _isVisible: function() {
- return this.option("visible")
- },
- _visibilityChanged: function(visible) {
- if (visible) {
- if (this.option("visible")) {
- this._renderVisibilityAnimate(visible)
- }
- } else {
- this._renderVisibilityAnimate(visible)
- }
- },
- _dimensionChanged: function() {
- this._renderGeometry(true)
- },
- _clean: function() {
- if (!this._contentAlreadyRendered) {
- this.$content().empty()
- }
- this._renderVisibility(false);
- this._stopShowTimer();
- this._cleanFocusState()
- },
- _stopShowTimer: function() {
- if (this._asyncShowTimeout) {
- clearTimeout(this._asyncShowTimeout)
- }
- this._asyncShowTimeout = null
- },
- _dispose: function() {
- fx.stop(this._$content, false);
- clearTimeout(this._deferShowTimer);
- this._toggleViewPortSubscription(false);
- this._toggleSubscriptions(false);
- this._updateZIndexStackPosition(false);
- this._toggleTabTerminator(false);
- this._toggleSafariScrolling(true);
- this._actions = null;
- this.callBase();
- zIndexPool.remove(this._zIndex);
- this._$wrapper.remove();
- this._$content.remove()
- },
- _toggleDisabledState: function(value) {
- this.callBase.apply(this, arguments);
- this._$content.toggleClass(DISABLED_STATE_CLASS, Boolean(value))
- },
- _toggleRTLDirection: function(rtl) {
- this._$content.toggleClass(RTL_DIRECTION_CLASS, rtl)
- },
- _optionChanged: function(args) {
- var value = args.value;
- if (inArray(args.name, ACTIONS) > -1) {
- this._initActions();
- return
- }
- switch (args.name) {
- case "dragEnabled":
- this._renderDrag();
- this._renderGeometry();
- break;
- case "resizeEnabled":
- this._renderResize();
- this._renderGeometry();
- break;
- case "shading":
- case "shadingColor":
- this._toggleShading(this.option("visible"));
- break;
- case "width":
- case "height":
- case "minWidth":
- case "maxWidth":
- case "minHeight":
- case "maxHeight":
- case "boundaryOffset":
- this._renderGeometry();
- break;
- case "position":
- this._positionChangeHandled = false;
- this._renderGeometry();
- break;
- case "visible":
- this._renderVisibilityAnimate(value).done(function() {
- if (!this._animateDeferred) {
- return
- }
- this._animateDeferred.resolveWith(this)
- }.bind(this));
- break;
- case "target":
- this._initTarget(value);
- this._invalidate();
- break;
- case "container":
- this._initContainer(value);
- this._invalidate();
- break;
- case "innerOverlay":
- this._initInnerOverlayClass();
- break;
- case "deferRendering":
- case "contentTemplate":
- this._contentAlreadyRendered = false;
- this._clean();
- this._invalidate();
- break;
- case "closeOnBackButton":
- this._toggleHideTopOverlayCallback(this.option("visible"));
- break;
- case "closeOnTargetScroll":
- this._toggleParentsScrollSubscription(this.option("visible"));
- break;
- case "closeOnOutsideClick":
- case "animation":
- case "propagateOutsideClick":
- break;
- case "rtlEnabled":
- this._contentAlreadyRendered = false;
- this.option("visible", false);
- this.callBase(args);
- break;
- default:
- this.callBase(args)
- }
- },
- toggle: function(showing) {
- showing = void 0 === showing ? !this.option("visible") : showing;
- if (showing === this.option("visible")) {
- return (new Deferred).resolve().promise()
- }
- var animateDeferred = new Deferred;
- this._animateDeferred = animateDeferred;
- this.option("visible", showing);
- return animateDeferred.promise().done(function() {
- delete this._animateDeferred
- }.bind(this))
- },
- $content: function() {
- return this._$content
- },
- show: function() {
- return this.toggle(true)
- },
- hide: function() {
- return this.toggle(false)
- },
- content: function() {
- return getPublicElement(this._$content)
- },
- repaint: function() {
- this._renderGeometry();
- domUtils.triggerResizeEvent(this._$content)
- }
- });
- Overlay.baseZIndex = function(zIndex) {
- return zIndexPool.base(zIndex)
- };
- registerComponent("dxOverlay", Overlay);
- module.exports = Overlay
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/ui/overlay/z_index.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.clearStack = exports.remove = exports.create = exports.base = void 0;
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- var baseZIndex = 1500;
- var zIndexStack = [];
- exports.base = function(ZIndex) {
- baseZIndex = (0, _common.ensureDefined)(ZIndex, baseZIndex);
- return baseZIndex
- };
- exports.create = function() {
- var baseIndex = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : baseZIndex;
- var length = zIndexStack.length;
- var index = (length ? zIndexStack[length - 1] : baseIndex) + 1;
- zIndexStack.push(index);
- return index
- };
- exports.remove = function(zIndex) {
- var position = zIndexStack.indexOf(zIndex);
- if (position >= 0) {
- zIndexStack.splice(position, 1)
- }
- };
- exports.clearStack = function() {
- zIndexStack = []
- }
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/integration/angular/template.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var TemplateBase = __webpack_require__( /*! ../../ui/widget/ui.template_base */ 74);
- var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
- var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var NgTemplate = TemplateBase.inherit({
- ctor: function(element, templateCompiler) {
- this._element = element;
- this._compiledTemplate = templateCompiler(domUtils.normalizeTemplateElement(this._element))
- },
- _renderCore: function(options) {
- var compiledTemplate = this._compiledTemplate;
- return isFunction(compiledTemplate) ? compiledTemplate(options) : compiledTemplate
- },
- source: function() {
- return $(this._element).clone()
- }
- });
- module.exports = NgTemplate
- },
- /*!*************************************************************************!*\
- !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.base.js ***!
- \*************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
- var _renderer2 = _interopRequireDefault(_renderer);
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- var _common2 = _interopRequireDefault(_common);
- var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
- var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var _iterator2 = _interopRequireDefault(_iterator);
- var _action = __webpack_require__( /*! ../../core/action */ 111);
- var _action2 = _interopRequireDefault(_action);
- var _guid = __webpack_require__( /*! ../../core/guid */ 40);
- var _guid2 = _interopRequireDefault(_guid);
- var _ui = __webpack_require__( /*! ../widget/ui.widget */ 18);
- var _ui2 = _interopRequireDefault(_ui);
- var _utils = __webpack_require__( /*! ../../events/utils */ 8);
- var _utils2 = _interopRequireDefault(_utils);
- var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
- var _pointer2 = _interopRequireDefault(_pointer);
- var _data_helper = __webpack_require__( /*! ../../data_helper */ 84);
- var _data_helper2 = _interopRequireDefault(_data_helper);
- var _item = __webpack_require__( /*! ./item */ 126);
- var _item2 = _interopRequireDefault(_item);
- var _selectors = __webpack_require__( /*! ../widget/selectors */ 66);
- var _selectors2 = _interopRequireDefault(_selectors);
- var _message = __webpack_require__( /*! ../../localization/message */ 13);
- var _message2 = _interopRequireDefault(_message);
- var _hold = __webpack_require__( /*! ../../events/hold */ 88);
- var _hold2 = _interopRequireDefault(_hold);
- var _data = __webpack_require__( /*! ../../core/utils/data */ 20);
- var _click = __webpack_require__( /*! ../../events/click */ 19);
- var _click2 = _interopRequireDefault(_click);
- var _contextmenu = __webpack_require__( /*! ../../events/contextmenu */ 168);
- var _contextmenu2 = _interopRequireDefault(_contextmenu);
- var _bindable_template = __webpack_require__( /*! ../widget/bindable_template */ 65);
- var _bindable_template2 = _interopRequireDefault(_bindable_template);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var COLLECTION_CLASS = "dx-collection";
- var ITEM_CLASS = "dx-item";
- var CONTENT_CLASS_POSTFIX = "-content";
- var ITEM_CONTENT_PLACEHOLDER_CLASS = "dx-item-content-placeholder";
- var ITEM_DATA_KEY = "dxItemData";
- var ITEM_INDEX_KEY = "dxItemIndex";
- var ITEM_TEMPLATE_ID_PREFIX = "tmpl-";
- var ITEMS_SELECTOR = "[data-options*='dxItem']";
- var SELECTED_ITEM_CLASS = "dx-item-selected";
- var ITEM_RESPONSE_WAIT_CLASS = "dx-item-response-wait";
- var EMPTY_COLLECTION = "dx-empty-collection";
- var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper";
- var ITEM_PATH_REGEX = /^([^.]+\[\d+\]\.)+([\w.]+)$/;
- var FOCUS_UP = "up";
- var FOCUS_DOWN = "down";
- var FOCUS_LEFT = "left";
- var FOCUS_RIGHT = "right";
- var FOCUS_PAGE_UP = "pageup";
- var FOCUS_PAGE_DOWN = "pagedown";
- var FOCUS_LAST = "last";
- var FOCUS_FIRST = "first";
- var CollectionWidget = _ui2.default.inherit({
- _activeStateUnit: "." + ITEM_CLASS,
- _supportedKeys: function() {
- var enter = function(e) {
- var $itemElement = (0, _renderer2.default)(this.option("focusedElement"));
- if (!$itemElement.length) {
- return
- }
- this._itemClickHandler((0, _extend.extend)({}, e, {
- target: $itemElement,
- currentTarget: $itemElement
- }))
- };
- var space = function(e) {
- e.preventDefault();
- enter.call(this, e)
- };
- var move = function(location, e) {
- e.preventDefault();
- e.stopPropagation();
- this._moveFocus(location, e)
- };
- return (0, _extend.extend)(this.callBase(), {
- space: space,
- enter: enter,
- leftArrow: move.bind(this, FOCUS_LEFT),
- rightArrow: move.bind(this, FOCUS_RIGHT),
- upArrow: move.bind(this, FOCUS_UP),
- downArrow: move.bind(this, FOCUS_DOWN),
- pageUp: move.bind(this, FOCUS_UP),
- pageDown: move.bind(this, FOCUS_DOWN),
- home: move.bind(this, FOCUS_FIRST),
- end: move.bind(this, FOCUS_LAST)
- })
- },
- _getDefaultOptions: function() {
- return (0, _extend.extend)(this.callBase(), {
- selectOnFocus: false,
- loopItemFocus: true,
- items: [],
- itemTemplate: "item",
- onItemRendered: null,
- onItemClick: null,
- onItemHold: null,
- itemHoldTimeout: 750,
- onItemContextMenu: null,
- onFocusedItemChanged: null,
- noDataText: _message2.default.format("dxCollectionWidget-noDataText"),
- dataSource: null,
- _itemAttributes: {},
- itemTemplateProperty: "template",
- focusOnSelectedItem: true,
- focusedElement: null,
- displayExpr: void 0,
- disabledExpr: function(data) {
- return data ? data.disabled : void 0
- },
- visibleExpr: function(data) {
- return data ? data.visible : void 0
- }
- })
- },
- _getAnonymousTemplateName: function() {
- return "item"
- },
- _init: function() {
- this._compileDisplayGetter();
- this.callBase();
- this._cleanRenderedItems();
- this._refreshDataSource()
- },
- _compileDisplayGetter: function() {
- var displayExpr = this.option("displayExpr");
- this._displayGetter = displayExpr ? (0, _data.compileGetter)(this.option("displayExpr")) : void 0
- },
- _initTemplates: function() {
- this._initItemsFromMarkup();
- this.callBase();
- this._initDefaultItemTemplate()
- },
- _initDefaultItemTemplate: function() {
- var fieldsMap = this._getFieldsMap();
- this._defaultTemplates.item = new _bindable_template2.default(function($container, data) {
- if ((0, _type.isPlainObject)(data)) {
- this._prepareDefaultItemTemplate(data, $container)
- } else {
- if (fieldsMap && (0, _type.isFunction)(fieldsMap.text)) {
- data = fieldsMap.text(data)
- }
- $container.text(String(_common2.default.ensureDefined(data, "")))
- }
- }.bind(this), this._getBindableFields(), this.option("integrationOptions.watchMethod"), fieldsMap)
- },
- _getBindableFields: function() {
- return ["text", "html"]
- },
- _getFieldsMap: function() {
- if (this._displayGetter) {
- return {
- text: this._displayGetter
- }
- }
- },
- _prepareDefaultItemTemplate: function(data, $container) {
- if ((0, _type.isDefined)(data.text)) {
- $container.text(data.text)
- }
- if ((0, _type.isDefined)(data.html)) {
- $container.html(data.html)
- }
- },
- _initItemsFromMarkup: function() {
- var _this = this;
- var $items = this.$element().contents().filter(ITEMS_SELECTOR);
- if (!$items.length || this.option("items").length) {
- return
- }
- var items = [].slice.call($items).map(function(item) {
- var $item = (0, _renderer2.default)(item);
- var result = (0, _dom.getElementOptions)(item).dxItem;
- var isTemplateRequired = $item.html().trim() && !result.template;
- if (isTemplateRequired) {
- result.template = _this._prepareItemTemplate($item)
- } else {
- $item.remove()
- }
- return result
- });
- this.option("items", items)
- },
- _prepareItemTemplate: function($item) {
- var templateId = ITEM_TEMPLATE_ID_PREFIX + new _guid2.default;
- var $template = $item.detach().clone().removeAttr("data-options").addClass(TEMPLATE_WRAPPER_CLASS);
- this._saveTemplate(templateId, $template);
- return templateId
- },
- _dataSourceOptions: function() {
- return {
- paginate: false
- }
- },
- _cleanRenderedItems: function() {
- this._renderedItemsCount = 0
- },
- _focusTarget: function() {
- return this.$element()
- },
- _focusInHandler: function(e) {
- this.callBase.apply(this, arguments);
- if ((0, _array.inArray)(e.target, this._focusTarget()) === -1) {
- return
- }
- var $focusedElement = (0, _renderer2.default)(this.option("focusedElement"));
- if ($focusedElement.length) {
- this._setFocusedItem($focusedElement)
- } else {
- var $activeItem = this._getActiveItem();
- if ($activeItem.length) {
- this.option("focusedElement", (0, _dom.getPublicElement)($activeItem))
- }
- }
- },
- _focusOutHandler: function() {
- this.callBase.apply(this, arguments);
- var $target = (0, _renderer2.default)(this.option("focusedElement"));
- this._updateFocusedItemState($target, false)
- },
- _getActiveItem: function(last) {
- var $focusedElement = (0, _renderer2.default)(this.option("focusedElement"));
- if ($focusedElement.length) {
- return $focusedElement
- }
- var index = this.option("focusOnSelectedItem") ? this.option("selectedIndex") : 0;
- var activeElements = this._getActiveElement();
- var lastIndex = activeElements.length - 1;
- if (index < 0) {
- index = last ? lastIndex : 0
- }
- return activeElements.eq(index)
- },
- _moveFocus: function(location) {
- var $items = this._getAvailableItems();
- var $newTarget;
- switch (location) {
- case FOCUS_PAGE_UP:
- case FOCUS_UP:
- $newTarget = this._prevItem($items);
- break;
- case FOCUS_PAGE_DOWN:
- case FOCUS_DOWN:
- $newTarget = this._nextItem($items);
- break;
- case FOCUS_RIGHT:
- $newTarget = this.option("rtlEnabled") ? this._prevItem($items) : this._nextItem($items);
- break;
- case FOCUS_LEFT:
- $newTarget = this.option("rtlEnabled") ? this._nextItem($items) : this._prevItem($items);
- break;
- case FOCUS_FIRST:
- $newTarget = $items.first();
- break;
- case FOCUS_LAST:
- $newTarget = $items.last();
- break;
- default:
- return false
- }
- if (0 !== $newTarget.length) {
- this.option("focusedElement", (0, _dom.getPublicElement)($newTarget))
- }
- },
- _getVisibleItems: function($itemElements) {
- $itemElements = $itemElements || this._itemElements();
- return $itemElements.filter(":visible")
- },
- _getAvailableItems: function($itemElements) {
- return this._getVisibleItems($itemElements).not(".dx-state-disabled")
- },
- _prevItem: function($items) {
- var $target = this._getActiveItem();
- var targetIndex = $items.index($target);
- var $last = $items.last();
- var $item = (0, _renderer2.default)($items[targetIndex - 1]);
- var loop = this.option("loopItemFocus");
- if (0 === $item.length && loop) {
- $item = $last
- }
- return $item
- },
- _nextItem: function($items) {
- var $target = this._getActiveItem(true);
- var targetIndex = $items.index($target);
- var $first = $items.first();
- var $item = (0, _renderer2.default)($items[targetIndex + 1]);
- var loop = this.option("loopItemFocus");
- if (0 === $item.length && loop) {
- $item = $first
- }
- return $item
- },
- _selectFocusedItem: function($target) {
- this.selectItem($target)
- },
- _updateFocusedItemState: function(target, isFocused, needCleanItemId) {
- var $target = (0, _renderer2.default)(target);
- if ($target.length) {
- this._refreshActiveDescendant();
- this._refreshItemId($target, needCleanItemId);
- this._toggleFocusClass(isFocused, $target)
- }
- },
- _refreshActiveDescendant: function($target) {
- this.setAria("activedescendant", (0, _type.isDefined)(this.option("focusedElement")) ? this.getFocusedItemId() : null, $target)
- },
- _refreshItemId: function($target, needCleanItemId) {
- if (!needCleanItemId && this.option("focusedElement")) {
- this.setAria("id", this.getFocusedItemId(), $target)
- } else {
- this.setAria("id", null, $target)
- }
- },
- _setFocusedItem: function($target) {
- if (!$target || !$target.length) {
- return
- }
- this._updateFocusedItemState($target, true);
- this.onFocusedItemChanged(this.getFocusedItemId());
- if (this.option("selectOnFocus")) {
- this._selectFocusedItem($target)
- }
- },
- _findItemElementByItem: function(item) {
- var result = (0, _renderer2.default)();
- var that = this;
- this.itemElements().each(function() {
- var $item = (0, _renderer2.default)(this);
- if ($item.data(that._itemDataKey()) === item) {
- result = $item;
- return false
- }
- });
- return result
- },
- _getIndexByItem: function(item) {
- return this.option("items").indexOf(item)
- },
- _itemOptionChanged: function(item, property, value, oldValue) {
- var $item = this._findItemElementByItem(item);
- if (!$item.length) {
- return
- }
- if (!this.constructor.ItemClass.getInstance($item).setDataField(property, value)) {
- this._refreshItem($item, item)
- }
- var isDisabling = "disabled" === property && value;
- if (isDisabling) {
- this._resetItemFocus($item)
- }
- },
- _resetItemFocus: function($item) {
- if ($item.is(this.option("focusedElement"))) {
- this.option("focusedElement", null)
- }
- },
- _refreshItem: function($item) {
- var itemData = this._getItemData($item);
- var index = $item.data(this._itemIndexKey());
- this._renderItem(this._renderedItemsCount + index, itemData, null, $item)
- },
- _optionChanged: function(args) {
- if ("items" === args.name) {
- var matches = args.fullName.match(ITEM_PATH_REGEX);
- if (matches && matches.length) {
- var property = matches[matches.length - 1];
- var itemPath = args.fullName.replace("." + property, "");
- var item = this.option(itemPath);
- this._itemOptionChanged(item, property, args.value, args.previousValue);
- return
- }
- }
- switch (args.name) {
- case "items":
- case "_itemAttributes":
- case "itemTemplateProperty":
- this._cleanRenderedItems();
- this._invalidate();
- break;
- case "dataSource":
- this._refreshDataSource();
- this._renderEmptyMessage();
- break;
- case "noDataText":
- this._renderEmptyMessage();
- break;
- case "itemTemplate":
- this._invalidate();
- break;
- case "onItemRendered":
- this._createItemRenderAction();
- break;
- case "onItemClick":
- break;
- case "onItemHold":
- case "itemHoldTimeout":
- this._attachHoldEvent();
- break;
- case "onItemContextMenu":
- this._attachContextMenuEvent();
- break;
- case "onFocusedItemChanged":
- this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged");
- break;
- case "selectOnFocus":
- case "loopItemFocus":
- case "focusOnSelectedItem":
- break;
- case "focusedElement":
- this._updateFocusedItemState(args.previousValue, false, true);
- this._setFocusedItem((0, _renderer2.default)(args.value));
- break;
- case "displayExpr":
- this._compileDisplayGetter();
- this._initDefaultItemTemplate();
- this._invalidate();
- break;
- case "visibleExpr":
- case "disabledExpr":
- this._invalidate();
- break;
- default:
- this.callBase(args)
- }
- },
- _invalidate: function() {
- this.option("focusedElement", null);
- return this.callBase.apply(this, arguments)
- },
- _loadNextPage: function() {
- var dataSource = this._dataSource;
- this._expectNextPageLoading();
- dataSource.pageIndex(1 + dataSource.pageIndex());
- return dataSource.load()
- },
- _expectNextPageLoading: function() {
- this._startIndexForAppendedItems = 0
- },
- _expectLastItemLoading: function() {
- this._startIndexForAppendedItems = -1
- },
- _forgetNextPageLoading: function() {
- this._startIndexForAppendedItems = null
- },
- _dataSourceChangedHandler: function(newItems) {
- var items = this.option("items");
- if (this._initialized && items && this._shouldAppendItems()) {
- this._renderedItemsCount = items.length;
- if (!this._isLastPage() || this._startIndexForAppendedItems !== -1) {
- this.option().items = items.concat(newItems.slice(this._startIndexForAppendedItems))
- }
- this._forgetNextPageLoading();
- this._refreshContent()
- } else {
- this.option("items", newItems.slice())
- }
- },
- _refreshContent: function() {
- this._prepareContent();
- this._renderContent()
- },
- _dataSourceLoadErrorHandler: function() {
- this._forgetNextPageLoading();
- this.option("items", this.option("items"))
- },
- _shouldAppendItems: function() {
- return null != this._startIndexForAppendedItems && this._allowDynamicItemsAppend()
- },
- _allowDynamicItemsAppend: function() {
- return false
- },
- _clean: function() {
- this._cleanFocusState();
- this._cleanItemContainer()
- },
- _cleanItemContainer: function() {
- (0, _renderer2.default)(this._itemContainer()).empty()
- },
- _dispose: function() {
- this.callBase();
- clearTimeout(this._itemFocusTimeout)
- },
- _refresh: function() {
- this._cleanRenderedItems();
- this.callBase.apply(this, arguments)
- },
- _itemContainer: function() {
- return this.$element()
- },
- _itemClass: function() {
- return ITEM_CLASS
- },
- _itemContentClass: function() {
- return this._itemClass() + CONTENT_CLASS_POSTFIX
- },
- _selectedItemClass: function() {
- return SELECTED_ITEM_CLASS
- },
- _itemResponseWaitClass: function() {
- return ITEM_RESPONSE_WAIT_CLASS
- },
- _itemSelector: function() {
- return "." + this._itemClass()
- },
- _itemDataKey: function() {
- return ITEM_DATA_KEY
- },
- _itemIndexKey: function() {
- return ITEM_INDEX_KEY
- },
- _itemElements: function() {
- return this._itemContainer().find(this._itemSelector())
- },
- _initMarkup: function() {
- this.callBase();
- this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged");
- this.$element().addClass(COLLECTION_CLASS);
- this._prepareContent()
- },
- _prepareContent: _common2.default.deferRenderer(function() {
- this._renderContentImpl()
- }),
- _renderContent: function() {
- this._fireContentReadyAction()
- },
- _render: function() {
- this.callBase();
- this._attachClickEvent();
- this._attachHoldEvent();
- this._attachContextMenuEvent()
- },
- _attachClickEvent: function() {
- var itemSelector = this._itemSelector();
- var clickEventNamespace = _utils2.default.addNamespace(_click2.default.name, this.NAME);
- var pointerDownEventNamespace = _utils2.default.addNamespace(_pointer2.default.down, this.NAME);
- var that = this;
- var pointerDownAction = new _action2.default(function(args) {
- var event = args.event;
- that._itemPointerDownHandler(event)
- });
- _events_engine2.default.off(this._itemContainer(), clickEventNamespace, itemSelector);
- _events_engine2.default.off(this._itemContainer(), pointerDownEventNamespace, itemSelector);
- _events_engine2.default.on(this._itemContainer(), clickEventNamespace, itemSelector, function(e) {
- this._itemClickHandler(e)
- }.bind(this));
- _events_engine2.default.on(this._itemContainer(), pointerDownEventNamespace, itemSelector, function(e) {
- pointerDownAction.execute({
- element: (0, _renderer2.default)(e.target),
- event: e
- })
- })
- },
- _itemClickHandler: function(e, args, config) {
- this._itemDXEventHandler(e, "onItemClick", args, config)
- },
- _itemPointerDownHandler: function(e) {
- if (!this.option("focusStateEnabled")) {
- return
- }
- this._itemFocusHandler = function() {
- clearTimeout(this._itemFocusTimeout);
- this._itemFocusHandler = null;
- if (e.isDefaultPrevented()) {
- return
- }
- var $target = (0, _renderer2.default)(e.target);
- var $closestItem = $target.closest(this._itemElements());
- var $closestFocusable = this._closestFocusable($target);
- if ($closestItem.length && $closestFocusable && (0, _array.inArray)($closestFocusable.get(0), this._focusTarget()) !== -1) {
- this.option("focusedElement", (0, _dom.getPublicElement)($closestItem))
- }
- }.bind(this);
- this._itemFocusTimeout = setTimeout(this._forcePointerDownFocus.bind(this))
- },
- _closestFocusable: function($target) {
- if ($target.is(_selectors2.default.focusable)) {
- return $target
- } else {
- $target = $target.parent();
- while ($target.length && !_dom_adapter2.default.isDocument($target.get(0))) {
- if ($target.is(_selectors2.default.focusable)) {
- return $target
- }
- $target = $target.parent()
- }
- }
- },
- _forcePointerDownFocus: function() {
- this._itemFocusHandler && this._itemFocusHandler()
- },
- _updateFocusState: function() {
- this.callBase.apply(this, arguments);
- this._forcePointerDownFocus()
- },
- _attachHoldEvent: function() {
- var $itemContainer = this._itemContainer();
- var itemSelector = this._itemSelector();
- var eventName = _utils2.default.addNamespace(_hold2.default.name, this.NAME);
- _events_engine2.default.off($itemContainer, eventName, itemSelector);
- _events_engine2.default.on($itemContainer, eventName, itemSelector, {
- timeout: this._getHoldTimeout()
- }, this._itemHoldHandler.bind(this))
- },
- _getHoldTimeout: function() {
- return this.option("itemHoldTimeout")
- },
- _shouldFireHoldEvent: function() {
- return this.hasActionSubscription("onItemHold")
- },
- _itemHoldHandler: function(e) {
- if (this._shouldFireHoldEvent()) {
- this._itemDXEventHandler(e, "onItemHold")
- } else {
- e.cancel = true
- }
- },
- _attachContextMenuEvent: function() {
- var $itemContainer = this._itemContainer();
- var itemSelector = this._itemSelector();
- var eventName = _utils2.default.addNamespace(_contextmenu2.default.name, this.NAME);
- _events_engine2.default.off($itemContainer, eventName, itemSelector);
- _events_engine2.default.on($itemContainer, eventName, itemSelector, this._itemContextMenuHandler.bind(this))
- },
- _shouldFireContextMenuEvent: function() {
- return this.hasActionSubscription("onItemContextMenu")
- },
- _itemContextMenuHandler: function(e) {
- if (this._shouldFireContextMenuEvent()) {
- this._itemDXEventHandler(e, "onItemContextMenu")
- } else {
- e.cancel = true
- }
- },
- _renderContentImpl: function() {
- var items = this.option("items") || [];
- if (this._renderedItemsCount) {
- this._renderItems(items.slice(this._renderedItemsCount))
- } else {
- this._renderItems(items)
- }
- },
- _renderItems: function(items) {
- if (items.length) {
- _iterator2.default.each(items, function(index, itemData) {
- this._renderItem(this._renderedItemsCount + index, itemData)
- }.bind(this))
- }
- this._renderEmptyMessage()
- },
- _renderItem: function(index, itemData, $container, $itemToReplace) {
- $container = $container || this._itemContainer();
- var $itemFrame = this._renderItemFrame(index, itemData, $container, $itemToReplace);
- this._setElementData($itemFrame, itemData, index);
- $itemFrame.attr(this.option("_itemAttributes"));
- this._attachItemClickEvent(itemData, $itemFrame);
- var $itemContent = this._getItemContent($itemFrame);
- var renderContentPromise = this._renderItemContent({
- index: index,
- itemData: itemData,
- container: (0, _dom.getPublicElement)($itemContent),
- contentClass: this._itemContentClass(),
- defaultTemplateName: this.option("itemTemplate")
- });
- var that = this;
- (0, _deferred.when)(renderContentPromise).done(function($itemContent) {
- that._postprocessRenderItem({
- itemElement: $itemFrame,
- itemContent: $itemContent,
- itemData: itemData,
- itemIndex: index
- });
- that._executeItemRenderAction(index, itemData, (0, _dom.getPublicElement)($itemFrame))
- });
- return $itemFrame
- },
- _getItemContent: function($itemFrame) {
- var $itemContent = $itemFrame.find("." + ITEM_CONTENT_PLACEHOLDER_CLASS);
- $itemContent.removeClass(ITEM_CONTENT_PLACEHOLDER_CLASS);
- return $itemContent
- },
- _attachItemClickEvent: function(itemData, $itemElement) {
- if (!itemData || !itemData.onClick) {
- return
- }
- _events_engine2.default.on($itemElement, _click2.default.name, function(e) {
- this._itemEventHandlerByHandler($itemElement, itemData.onClick, {
- event: e
- })
- }.bind(this))
- },
- _renderItemContent: function(args) {
- var itemTemplateName = this._getItemTemplateName(args);
- var itemTemplate = this._getTemplate(itemTemplateName);
- this._addItemContentClasses(args);
- var $templateResult = (0, _renderer2.default)(this._createItemByTemplate(itemTemplate, args));
- if (!$templateResult.hasClass(TEMPLATE_WRAPPER_CLASS)) {
- return args.container
- }
- return this._renderItemContentByNode(args, $templateResult)
- },
- _renderItemContentByNode: function(args, $node) {
- (0, _renderer2.default)(args.container).replaceWith($node);
- args.container = (0, _dom.getPublicElement)($node);
- this._addItemContentClasses(args);
- return $node
- },
- _addItemContentClasses: function(args) {
- var classes = [ITEM_CLASS + CONTENT_CLASS_POSTFIX, args.contentClass];
- (0, _renderer2.default)(args.container).addClass(classes.join(" "))
- },
- _appendItemToContainer: function($container, $itemFrame, index) {
- $itemFrame.appendTo($container)
- },
- _renderItemFrame: function(index, itemData, $container, $itemToReplace) {
- var $itemFrame = (0, _renderer2.default)("<div>");
- new this.constructor.ItemClass($itemFrame, this._itemOptions(), itemData || {});
- if ($itemToReplace && $itemToReplace.length) {
- $itemToReplace.replaceWith($itemFrame)
- } else {
- this._appendItemToContainer.call(this, $container, $itemFrame, index)
- }
- return $itemFrame
- },
- _itemOptions: function() {
- var that = this;
- return {
- watchMethod: function() {
- return that.option("integrationOptions.watchMethod")
- },
- owner: that,
- fieldGetter: function(field) {
- var expr = that.option(field + "Expr");
- var getter = (0, _data.compileGetter)(expr);
- return getter
- }
- }
- },
- _postprocessRenderItem: _common2.default.noop,
- _executeItemRenderAction: function(index, itemData, itemElement) {
- this._getItemRenderAction()({
- itemElement: itemElement,
- itemIndex: index,
- itemData: itemData
- })
- },
- _setElementData: function(element, data, index) {
- element.addClass([ITEM_CLASS, this._itemClass()].join(" ")).data(this._itemDataKey(), data).data(this._itemIndexKey(), index)
- },
- _createItemRenderAction: function() {
- return this._itemRenderAction = this._createActionByOption("onItemRendered", {
- element: this.element(),
- excludeValidators: ["disabled", "readOnly"],
- category: "rendering"
- })
- },
- _getItemRenderAction: function() {
- return this._itemRenderAction || this._createItemRenderAction()
- },
- _getItemTemplateName: function(args) {
- var data = args.itemData;
- var templateProperty = args.templateProperty || this.option("itemTemplateProperty");
- var template = data && data[templateProperty];
- return template || args.defaultTemplateName
- },
- _createItemByTemplate: function(itemTemplate, renderArgs) {
- return itemTemplate.render({
- model: renderArgs.itemData,
- container: renderArgs.container,
- index: renderArgs.index
- })
- },
- _emptyMessageContainer: function() {
- return this._itemContainer()
- },
- _renderEmptyMessage: function(items) {
- items = items || this.option("items");
- var noDataText = this.option("noDataText");
- var hideNoData = !noDataText || items && items.length || this._isDataSourceLoading();
- if (hideNoData && this._$noData) {
- this._$noData.remove();
- this._$noData = null;
- this.setAria("label", void 0)
- }
- if (!hideNoData) {
- this._$noData = this._$noData || (0, _renderer2.default)("<div>").addClass("dx-empty-message");
- this._$noData.appendTo(this._emptyMessageContainer()).html(noDataText);
- this.setAria("label", noDataText)
- }
- this.$element().toggleClass(EMPTY_COLLECTION, !hideNoData)
- },
- _itemDXEventHandler: function(dxEvent, handlerOptionName, actionArgs, actionConfig) {
- this._itemEventHandler(dxEvent.target, handlerOptionName, (0, _extend.extend)(actionArgs, {
- event: dxEvent
- }), actionConfig)
- },
- _itemEventHandler: function(initiator, handlerOptionName, actionArgs, actionConfig) {
- var action = this._createActionByOption(handlerOptionName, (0, _extend.extend)({
- validatingTargetName: "itemElement"
- }, actionConfig));
- return this._itemEventHandlerImpl(initiator, action, actionArgs)
- },
- _itemEventHandlerByHandler: function(initiator, handler, actionArgs, actionConfig) {
- var action = this._createAction(handler, (0, _extend.extend)({
- validatingTargetName: "itemElement"
- }, actionConfig));
- return this._itemEventHandlerImpl(initiator, action, actionArgs)
- },
- _itemEventHandlerImpl: function(initiator, action, actionArgs) {
- var $itemElement = this._closestItemElement((0, _renderer2.default)(initiator));
- var args = (0, _extend.extend)({}, actionArgs);
- return action((0, _extend.extend)(actionArgs, this._extendActionArgs($itemElement), args))
- },
- _extendActionArgs: function($itemElement) {
- return {
- itemElement: (0, _dom.getPublicElement)($itemElement),
- itemIndex: this._itemElements().index($itemElement),
- itemData: this._getItemData($itemElement)
- }
- },
- _closestItemElement: function($element) {
- return (0, _renderer2.default)($element).closest(this._itemSelector())
- },
- _getItemData: function(itemElement) {
- return (0, _renderer2.default)(itemElement).data(this._itemDataKey())
- },
- _getSummaryItemsWidth: function(items, includeMargin) {
- var result = 0;
- if (items) {
- _iterator2.default.each(items, function(_, item) {
- result += (0, _renderer2.default)(item).outerWidth(includeMargin || false)
- })
- }
- return result
- },
- getFocusedItemId: function() {
- if (!this._focusedItemId) {
- this._focusedItemId = "dx-" + new _guid2.default
- }
- return this._focusedItemId
- },
- itemElements: function() {
- return this._itemElements()
- },
- itemsContainer: function() {
- return this._itemContainer()
- }
- }).include(_data_helper2.default);
- CollectionWidget.ItemClass = _item2.default;
- module.exports = CollectionWidget
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/data/remote_query.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var queryAdapters = __webpack_require__( /*! ./query_adapters */ 181);
- var errorsModule = __webpack_require__( /*! ./errors */ 36);
- var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
- var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
- var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
- var arrayQueryImpl = __webpack_require__( /*! ./array_query */ 155);
- var remoteQueryImpl = function remoteQueryImpl(url, queryOptions, tasks) {
- tasks = tasks || [];
- queryOptions = queryOptions || {};
- var createTask = function(name, args) {
- return {
- name: name,
- args: args
- }
- };
- var exec = function(executorTask) {
- var d = new Deferred;
- var _adapterFactory;
- var _adapter;
- var _taskQueue;
- var _currentTask;
- var _mergedSortArgs;
- var rejectWithNotify = function(error) {
- var handler = queryOptions.errorHandler;
- if (handler) {
- handler(error)
- }
- errorsModule._errorHandler(error);
- d.reject(error)
- };
- function mergeSortTask(task) {
- switch (task.name) {
- case "sortBy":
- _mergedSortArgs = [task.args];
- return true;
- case "thenBy":
- if (!_mergedSortArgs) {
- throw errorsModule.errors.Error("E4004")
- }
- _mergedSortArgs.push(task.args);
- return true
- }
- return false
- }
- function unmergeSortTasks() {
- var head = _taskQueue[0];
- var unmergedTasks = [];
- if (head && "multiSort" === head.name) {
- _taskQueue.shift();
- each(head.args[0], function() {
- unmergedTasks.push(createTask(unmergedTasks.length ? "thenBy" : "sortBy", this))
- })
- }
- _taskQueue = unmergedTasks.concat(_taskQueue)
- }
- try {
- _adapterFactory = queryOptions.adapter;
- if (!isFunction(_adapterFactory)) {
- _adapterFactory = queryAdapters[_adapterFactory]
- }
- _adapter = _adapterFactory(queryOptions);
- _taskQueue = [].concat(tasks).concat(executorTask);
- var optimize = _adapter.optimize;
- if (optimize) {
- optimize(_taskQueue)
- }
- while (_taskQueue.length) {
- _currentTask = _taskQueue[0];
- if (!mergeSortTask(_currentTask)) {
- if (_mergedSortArgs) {
- _taskQueue.unshift(createTask("multiSort", [_mergedSortArgs]));
- _mergedSortArgs = null;
- continue
- }
- if ("enumerate" !== String(_currentTask.name)) {
- if (!_adapter[_currentTask.name] || false === _adapter[_currentTask.name].apply(_adapter, _currentTask.args)) {
- break
- }
- }
- }
- _taskQueue.shift()
- }
- unmergeSortTasks();
- _adapter.exec(url).done(function(result, extra) {
- if (!_taskQueue.length) {
- d.resolve(result, extra)
- } else {
- var clientChain = arrayQueryImpl(result, {
- errorHandler: queryOptions.errorHandler
- });
- each(_taskQueue, function() {
- clientChain = clientChain[this.name].apply(clientChain, this.args)
- });
- clientChain.done(d.resolve).fail(d.reject)
- }
- }).fail(rejectWithNotify)
- } catch (x) {
- rejectWithNotify(x)
- }
- return d.promise()
- };
- var query = {};
- each(["sortBy", "thenBy", "filter", "slice", "select", "groupBy"], function() {
- var name = String(this);
- query[name] = function() {
- return remoteQueryImpl(url, queryOptions, tasks.concat(createTask(name, arguments)))
- }
- });
- each(["count", "min", "max", "sum", "avg", "aggregate", "enumerate"], function() {
- var name = String(this);
- query[name] = function() {
- return exec.call(this, createTask(name, arguments))
- }
- });
- return query
- };
- module.exports = remoteQueryImpl
- },
- /*!**********************************************************************************!*\
- !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.strategy.js ***!
- \**********************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var abstract = Class.abstract;
- var EditStrategy = Class.inherit({
- ctor: function(collectionWidget) {
- this._collectionWidget = collectionWidget
- },
- getIndexByItemData: abstract,
- getItemDataByIndex: abstract,
- getKeysByItems: abstract,
- getItemsByKeys: abstract,
- itemsGetter: abstract,
- getKeyByIndex: function(index) {
- var resultIndex = this._denormalizeItemIndex(index);
- return this.getKeysByItems([this.getItemDataByIndex(resultIndex)])[0]
- },
- _equalKeys: function(key1, key2) {
- if (this._collectionWidget._isKeySpecified()) {
- return commonUtils.equalByValue(key1, key2)
- } else {
- return key1 === key2
- }
- },
- beginCache: function() {
- this._cache = {}
- },
- endCache: function() {
- this._cache = null
- },
- getIndexByKey: abstract,
- getNormalizedIndex: function(value) {
- if (this._isNormalizedItemIndex(value)) {
- return value
- }
- if (this._isItemIndex(value)) {
- return this._normalizeItemIndex(value)
- }
- if (this._isDOMNode(value)) {
- return this._getNormalizedItemIndex(value)
- }
- return this._normalizeItemIndex(this.getIndexByItemData(value))
- },
- getIndex: function(value) {
- if (this._isNormalizedItemIndex(value)) {
- return this._denormalizeItemIndex(value)
- }
- if (this._isItemIndex(value)) {
- return value
- }
- if (this._isDOMNode(value)) {
- return this._denormalizeItemIndex(this._getNormalizedItemIndex(value))
- }
- return this.getIndexByItemData(value)
- },
- getItemElement: function(value) {
- if (this._isNormalizedItemIndex(value)) {
- return this._getItemByNormalizedIndex(value)
- }
- if (this._isItemIndex(value)) {
- return this._getItemByNormalizedIndex(this._normalizeItemIndex(value))
- }
- if (this._isDOMNode(value)) {
- return $(value)
- }
- var normalizedItemIndex = this._normalizeItemIndex(this.getIndexByItemData(value));
- return this._getItemByNormalizedIndex(normalizedItemIndex)
- },
- deleteItemAtIndex: abstract,
- itemPlacementFunc: function(movingIndex, destinationIndex) {
- return this._itemsFromSameParent(movingIndex, destinationIndex) && movingIndex < destinationIndex ? "after" : "before"
- },
- moveItemAtIndexToIndex: abstract,
- _isNormalizedItemIndex: function(index) {
- return "number" === typeof index && Math.round(index) === index
- },
- _isDOMNode: function(value) {
- var $value;
- try {
- $value = $(value)
- } catch (error) {
- return false
- }
- return $value && $value.length && $value.get(0).nodeType
- },
- _isItemIndex: abstract,
- _getNormalizedItemIndex: abstract,
- _normalizeItemIndex: abstract,
- _denormalizeItemIndex: abstract,
- _getItemByNormalizedIndex: abstract,
- _itemsFromSameParent: abstract
- });
- module.exports = EditStrategy
- },
- /*!**************************************************************************!*\
- !*** ./artifacts/transpiled/ui/selection/selection.strategy.deferred.js ***!
- \**************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var SelectionStrategy = __webpack_require__( /*! ./selection.strategy */ 272);
- var errors = __webpack_require__( /*! ../widget/ui.errors */ 17);
- var dataQuery = __webpack_require__( /*! ../../data/query */ 42);
- var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
- module.exports = SelectionStrategy.inherit({
- getSelectedItems: function() {
- return this._loadFilteredData(this.options.selectionFilter)
- },
- getSelectedItemKeys: function() {
- var d = new Deferred;
- var that = this;
- var key = this.options.key();
- var select = typeUtils.isString(key) ? [key] : key;
- this._loadFilteredData(this.options.selectionFilter, null, select).done(function(items) {
- var keys = items.map(function(item) {
- return that.options.keyOf(item)
- });
- d.resolve(keys)
- }).fail(d.reject);
- return d.promise()
- },
- selectedItemKeys: function(keys, preserve, isDeselect, isSelectAll) {
- if (isSelectAll) {
- var filter = this.options.filter();
- if (!filter) {
- this._setOption("selectionFilter", isDeselect ? [] : null)
- } else {
- this._addSelectionFilter(isDeselect, filter, isSelectAll)
- }
- } else {
- if (!preserve) {
- this._setOption("selectionFilter", [])
- }
- for (var i = 0; i < keys.length; i++) {
- if (isDeselect) {
- this.removeSelectedItem(keys[i])
- } else {
- this.addSelectedItem(keys[i])
- }
- }
- }
- this.onSelectionChanged();
- return (new Deferred).resolve()
- },
- setSelectedItems: function(keys) {
- this._setOption("selectionFilter", null);
- for (var i = 0; i < keys.length; i++) {
- this.addSelectedItem(keys[i])
- }
- },
- isItemDataSelected: function(itemData) {
- return this.isItemKeySelected(itemData)
- },
- isItemKeySelected: function(itemData) {
- var selectionFilter = this.options.selectionFilter;
- if (!selectionFilter) {
- return true
- }
- return !!dataQuery([itemData]).filter(selectionFilter).toArray().length
- },
- _getFilterByKey: function(key) {
- var keyField = this.options.key();
- var filter = [keyField, "=", key];
- if (Array.isArray(keyField)) {
- filter = [];
- for (var i = 0; i < keyField.length; i++) {
- filter.push([keyField[i], "=", key[keyField[i]]]);
- if (i !== keyField.length - 1) {
- filter.push("and")
- }
- }
- }
- return filter
- },
- addSelectedItem: function(key) {
- var filter = this._getFilterByKey(key);
- this._addSelectionFilter(false, filter)
- },
- removeSelectedItem: function(key) {
- var filter = this._getFilterByKey(key);
- this._addSelectionFilter(true, filter)
- },
- validate: function() {
- var key = this.options.key;
- if (key && void 0 === key()) {
- throw errors.Error("E1042", "Deferred selection")
- }
- },
- _findSubFilter: function(selectionFilter, filter) {
- if (!selectionFilter) {
- return -1
- }
- var filterString = JSON.stringify(filter);
- for (var index = 0; index < selectionFilter.length; index++) {
- var subFilter = selectionFilter[index];
- if (subFilter && JSON.stringify(subFilter) === filterString) {
- return index
- }
- }
- return -1
- },
- _isLastSubFilter: function(selectionFilter, filter) {
- if (selectionFilter && filter) {
- return this._findSubFilter(selectionFilter, filter) === selectionFilter.length - 1 || 0 === this._findSubFilter([selectionFilter], filter)
- }
- return false
- },
- _addFilterOperator: function(selectionFilter, filterOperator) {
- if (selectionFilter.length > 1 && typeUtils.isString(selectionFilter[1]) && selectionFilter[1] !== filterOperator) {
- selectionFilter = [selectionFilter]
- }
- if (selectionFilter.length) {
- selectionFilter.push(filterOperator)
- }
- return selectionFilter
- },
- _denormalizeFilter: function(filter) {
- if (filter && typeUtils.isString(filter[0])) {
- filter = [filter]
- }
- return filter
- },
- _addSelectionFilter: function(isDeselect, filter, isSelectAll) {
- var that = this;
- var currentFilter = isDeselect ? ["!", filter] : filter;
- var currentOperation = isDeselect ? "and" : "or";
- var needAddFilter = true;
- var selectionFilter = that.options.selectionFilter || [];
- selectionFilter = that._denormalizeFilter(selectionFilter);
- if (selectionFilter && selectionFilter.length) {
- that._removeSameFilter(selectionFilter, filter, isDeselect, isSelectAll);
- var filterIndex = that._removeSameFilter(selectionFilter, filter, !isDeselect);
- var isKeyOperatorsAfterRemoved = this._isKeyFilter(filter) && this._hasKeyFiltersOnlyStartingFromIndex(selectionFilter, filterIndex);
- needAddFilter = filter.length && !isKeyOperatorsAfterRemoved;
- if (needAddFilter) {
- selectionFilter = that._addFilterOperator(selectionFilter, currentOperation)
- }
- }
- if (needAddFilter) {
- selectionFilter.push(currentFilter)
- }
- selectionFilter = that._normalizeFilter(selectionFilter);
- that._setOption("selectionFilter", !isDeselect && !selectionFilter.length ? null : selectionFilter)
- },
- _normalizeFilter: function(filter) {
- if (filter && 1 === filter.length) {
- filter = filter[0]
- }
- return filter
- },
- _removeFilterByIndex: function(filter, filterIndex, isSelectAll) {
- var operation = filter[1];
- if (filterIndex > 0) {
- filter.splice(filterIndex - 1, 2)
- } else {
- filter.splice(filterIndex, 2)
- }
- if (isSelectAll && "and" === operation) {
- filter.splice(0, filter.length)
- }
- },
- _isSimpleKeyFilter: function(filter, key) {
- return 3 === filter.length && filter[0] === key && "=" === filter[1]
- },
- _isKeyFilter: function(filter) {
- if (2 === filter.length && "!" === filter[0]) {
- return this._isKeyFilter(filter[1])
- }
- var keyField = this.options.key();
- if (Array.isArray(keyField)) {
- if (filter.length !== 2 * keyField.length - 1) {
- return false
- }
- for (var i = 0; i < keyField.length; i++) {
- if (i > 0 && "and" !== filter[i]) {
- return false
- }
- if (!this._isSimpleKeyFilter(filter[2 * i], keyField[i])) {
- return false
- }
- }
- return true
- }
- return this._isSimpleKeyFilter(filter, keyField)
- },
- _hasKeyFiltersOnlyStartingFromIndex: function(selectionFilter, filterIndex) {
- if (filterIndex >= 0) {
- for (var i = filterIndex; i < selectionFilter.length; i++) {
- if ("string" !== typeof selectionFilter[i] && !this._isKeyFilter(selectionFilter[i])) {
- return false
- }
- }
- return true
- }
- return false
- },
- _removeSameFilter: function(selectionFilter, filter, inverted, isSelectAll) {
- filter = inverted ? ["!", filter] : filter;
- if (JSON.stringify(filter) === JSON.stringify(selectionFilter)) {
- selectionFilter.splice(0, selectionFilter.length);
- return 0
- }
- var filterIndex = this._findSubFilter(selectionFilter, filter);
- if (filterIndex >= 0) {
- this._removeFilterByIndex(selectionFilter, filterIndex, isSelectAll);
- return filterIndex
- } else {
- for (var i = 0; i < selectionFilter.length; i++) {
- if (Array.isArray(selectionFilter[i]) && selectionFilter[i].length > 2) {
- var _filterIndex = this._removeSameFilter(selectionFilter[i], filter, false, isSelectAll);
- if (_filterIndex >= 0) {
- if (!selectionFilter[i].length) {
- this._removeFilterByIndex(selectionFilter, i, isSelectAll)
- } else {
- if (1 === selectionFilter[i].length) {
- selectionFilter[i] = selectionFilter[i][0]
- }
- }
- return _filterIndex
- }
- }
- }
- return -1
- }
- },
- getSelectAllState: function() {
- var filter = this.options.filter();
- var selectionFilter = this.options.selectionFilter;
- if (!selectionFilter) {
- return true
- }
- if (!selectionFilter.length) {
- return false
- }
- if (!filter || !filter.length) {
- return
- }
- selectionFilter = this._denormalizeFilter(selectionFilter);
- if (this._isLastSubFilter(selectionFilter, filter)) {
- return true
- }
- if (this._isLastSubFilter(selectionFilter, ["!", filter])) {
- return false
- }
- return
- }
- })
- },
- /*!**************************************************************************!*\
- !*** ./artifacts/transpiled/ui/selection/selection.strategy.standard.js ***!
- \**************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var getKeyHash = commonUtils.getKeyHash;
- var dataQuery = __webpack_require__( /*! ../../data/query */ 42);
- var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var SelectionFilterCreator = __webpack_require__( /*! ../../core/utils/selection_filter */ 284).SelectionFilterCreator;
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- var errors = __webpack_require__( /*! ../widget/ui.errors */ 17);
- var SelectionStrategy = __webpack_require__( /*! ./selection.strategy */ 272);
- module.exports = SelectionStrategy.inherit({
- ctor: function(options) {
- this.callBase(options);
- this._initSelectedItemKeyHash()
- },
- _initSelectedItemKeyHash: function() {
- this._setOption("keyHashIndices", this.options.equalByReference ? null : {})
- },
- getSelectedItemKeys: function() {
- return this.options.selectedItemKeys.slice(0)
- },
- getSelectedItems: function() {
- return this.options.selectedItems.slice(0)
- },
- _preserveSelectionUpdate: function(items, isDeselect) {
- var keyOf = this.options.keyOf;
- var keyIndicesToRemoveMap;
- var keyIndex;
- var i;
- if (!keyOf) {
- return
- }
- var isBatchDeselect = isDeselect && items.length > 1 && !this.options.equalByReference;
- if (isBatchDeselect) {
- keyIndicesToRemoveMap = {}
- }
- for (i = 0; i < items.length; i++) {
- var item = items[i];
- var key = keyOf(item);
- if (isDeselect) {
- keyIndex = this.removeSelectedItem(key, keyIndicesToRemoveMap);
- if (keyIndicesToRemoveMap && keyIndex >= 0) {
- keyIndicesToRemoveMap[keyIndex] = true
- }
- } else {
- this.addSelectedItem(key, item)
- }
- }
- if (isBatchDeselect) {
- this._batchRemoveSelectedItems(keyIndicesToRemoveMap)
- }
- },
- _batchRemoveSelectedItems: function(keyIndicesToRemoveMap) {
- var selectedItemKeys = this.options.selectedItemKeys.slice(0);
- var selectedItems = this.options.selectedItems.slice(0);
- this.options.selectedItemKeys.length = 0;
- this.options.selectedItems.length = 0;
- for (var i = 0; i < selectedItemKeys.length; i++) {
- if (!keyIndicesToRemoveMap[i]) {
- this.options.selectedItemKeys.push(selectedItemKeys[i]);
- this.options.selectedItems.push(selectedItems[i])
- }
- }
- this._initSelectedItemKeyHash();
- this.updateSelectedItemKeyHash(this.options.selectedItemKeys)
- },
- _loadSelectedItemsCore: function(keys, isDeselect, isSelectAll) {
- var deferred = new Deferred;
- var key = this.options.key();
- if (!keys.length && !isSelectAll) {
- deferred.resolve([]);
- return deferred
- }
- var filter = this.options.filter();
- if (isSelectAll && isDeselect && !filter) {
- deferred.resolve(this.getSelectedItems());
- return deferred
- }
- var selectionFilterCreator = new SelectionFilterCreator(keys, isSelectAll);
- var combinedFilter = selectionFilterCreator.getCombinedFilter(key, filter);
- var deselectedItems = [];
- if (isDeselect) {
- deselectedItems = combinedFilter ? dataQuery(this.options.selectedItems).filter(combinedFilter).toArray() : this.options.selectedItems.slice(0)
- }
- var filteredItems = deselectedItems.length ? deselectedItems : this.options.plainItems(true).filter(this.options.isSelectableItem).map(this.options.getItemData);
- var localFilter = selectionFilterCreator.getLocalFilter(this.options.keyOf, this.equalKeys.bind(this), this.options.equalByReference, key);
- filteredItems = filteredItems.filter(localFilter);
- if (deselectedItems.length || !isSelectAll && filteredItems.length === keys.length) {
- deferred.resolve(filteredItems)
- } else {
- deferred = this._loadFilteredData(combinedFilter, localFilter, null, isSelectAll)
- }
- return deferred
- },
- _replaceSelectionUpdate: function(items) {
- var internalKeys = [];
- var keyOf = this.options.keyOf;
- if (!keyOf) {
- return
- }
- for (var i = 0; i < items.length; i++) {
- var item = items[i];
- var key = keyOf(item);
- internalKeys.push(key)
- }
- this.setSelectedItems(internalKeys, items)
- },
- _warnOnIncorrectKeys: function(keys) {
- var allowNullValue = this.options.allowNullValue;
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if ((!allowNullValue || null !== key) && !this.isItemKeySelected(key)) {
- errors.log("W1002", key)
- }
- }
- },
- _loadSelectedItems: function(keys, isDeselect, isSelectAll) {
- var that = this;
- var deferred = new Deferred;
- when(that._lastLoadDeferred).always(function() {
- that._loadSelectedItemsCore(keys, isDeselect, isSelectAll).done(deferred.resolve).fail(deferred.reject)
- });
- that._lastLoadDeferred = deferred;
- return deferred
- },
- selectedItemKeys: function(keys, preserve, isDeselect, isSelectAll) {
- var that = this;
- var deferred = that._loadSelectedItems(keys, isDeselect, isSelectAll);
- deferred.done(function(items) {
- if (preserve) {
- that._preserveSelectionUpdate(items, isDeselect)
- } else {
- that._replaceSelectionUpdate(items)
- }
- if (!isSelectAll && !isDeselect) {
- that._warnOnIncorrectKeys(keys)
- }
- that.onSelectionChanged()
- });
- return deferred
- },
- addSelectedItem: function(key, itemData) {
- var keyHash = this._getKeyHash(key);
- if (this._indexOfSelectedItemKey(keyHash) === -1) {
- if (!typeUtils.isObject(keyHash) && this.options.keyHashIndices) {
- this.options.keyHashIndices[keyHash] = [this.options.selectedItemKeys.length]
- }
- this.options.selectedItemKeys.push(key);
- this.options.addedItemKeys.push(key);
- this.options.addedItems.push(itemData);
- this.options.selectedItems.push(itemData)
- }
- },
- _getSelectedIndexByKey: function(key, ignoreIndicesMap) {
- var selectedItemKeys = this.options.selectedItemKeys;
- for (var index = 0; index < selectedItemKeys.length; index++) {
- if ((!ignoreIndicesMap || !ignoreIndicesMap[index]) && this.equalKeys(selectedItemKeys[index], key)) {
- return index
- }
- }
- return -1
- },
- _getSelectedIndexByHash: function(key, ignoreIndicesMap) {
- var indices = this.options.keyHashIndices[key];
- if (indices && indices.length > 1 && ignoreIndicesMap) {
- indices = indices.filter(function(index) {
- return !ignoreIndicesMap[index]
- })
- }
- return indices && indices[0] >= 0 ? indices[0] : -1
- },
- _indexOfSelectedItemKey: function(key, ignoreIndicesMap) {
- var selectedIndex;
- if (this.options.equalByReference) {
- selectedIndex = this.options.selectedItemKeys.indexOf(key)
- } else {
- if (typeUtils.isObject(key)) {
- selectedIndex = this._getSelectedIndexByKey(key, ignoreIndicesMap)
- } else {
- selectedIndex = this._getSelectedIndexByHash(key, ignoreIndicesMap)
- }
- }
- return selectedIndex
- },
- _shiftSelectedKeyIndices: function(keyIndex) {
- for (var currentKeyIndex = keyIndex; currentKeyIndex < this.options.selectedItemKeys.length; currentKeyIndex++) {
- var currentKey = this.options.selectedItemKeys[currentKeyIndex];
- var currentKeyHash = getKeyHash(currentKey);
- var currentKeyIndices = this.options.keyHashIndices[currentKeyHash];
- if (!currentKeyIndices) {
- continue
- }
- for (var i = 0; i < currentKeyIndices.length; i++) {
- if (currentKeyIndices[i] > keyIndex) {
- currentKeyIndices[i]--
- }
- }
- }
- },
- removeSelectedItem: function(key, keyIndicesToRemoveMap) {
- var keyHash = this._getKeyHash(key);
- var isBatchDeselect = !!keyIndicesToRemoveMap;
- var keyIndex = this._indexOfSelectedItemKey(keyHash, keyIndicesToRemoveMap);
- if (keyIndex < 0) {
- return keyIndex
- }
- this.options.removedItemKeys.push(key);
- this.options.removedItems.push(this.options.selectedItems[keyIndex]);
- if (isBatchDeselect) {
- return keyIndex
- }
- this.options.selectedItemKeys.splice(keyIndex, 1);
- this.options.selectedItems.splice(keyIndex, 1);
- if (typeUtils.isObject(keyHash) || !this.options.keyHashIndices) {
- return keyIndex
- }
- var keyIndices = this.options.keyHashIndices[keyHash];
- if (!keyIndices) {
- return keyIndex
- }
- keyIndices.shift();
- if (!keyIndices.length) {
- delete this.options.keyHashIndices[keyHash]
- }
- this._shiftSelectedKeyIndices(keyIndex);
- return keyIndex
- },
- _updateAddedItemKeys: function(keys, items) {
- for (var i = 0; i < keys.length; i++) {
- if (!this.isItemKeySelected(keys[i])) {
- this.options.addedItemKeys.push(keys[i]);
- this.options.addedItems.push(items[i])
- }
- }
- },
- _updateRemovedItemKeys: function(keys, oldSelectedKeys, oldSelectedItems) {
- for (var i = 0; i < oldSelectedKeys.length; i++) {
- if (!this.isItemKeySelected(oldSelectedKeys[i])) {
- this.options.removedItemKeys.push(oldSelectedKeys[i]);
- this.options.removedItems.push(oldSelectedItems[i])
- }
- }
- },
- _getKeyHash: function(key) {
- return this.options.equalByReference ? key : getKeyHash(key)
- },
- setSelectedItems: function(keys, items) {
- this._updateAddedItemKeys(keys, items);
- var oldSelectedKeys = this.options.selectedItemKeys;
- var oldSelectedItems = this.options.selectedItems;
- if (!this.options.equalByReference) {
- this._initSelectedItemKeyHash();
- this.updateSelectedItemKeyHash(keys)
- }
- this._setOption("selectedItemKeys", keys);
- this._setOption("selectedItems", items);
- this._updateRemovedItemKeys(keys, oldSelectedKeys, oldSelectedItems)
- },
- isItemDataSelected: function(itemData) {
- var key = this.options.keyOf(itemData);
- return this.isItemKeySelected(key)
- },
- isItemKeySelected: function(key) {
- var keyHash = this._getKeyHash(key);
- var index = this._indexOfSelectedItemKey(keyHash);
- return index !== -1
- },
- getSelectAllState: function(visibleOnly) {
- if (visibleOnly) {
- return this._getVisibleSelectAllState()
- } else {
- return this._getFullSelectAllState()
- }
- }
- })
- },
- /*!***********************************************************************!*\
- !*** ./artifacts/transpiled/integration/angular/event_registrator.js ***!
- \***********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventRegistratorCallbacks = __webpack_require__( /*! ../../events/core/event_registrator_callbacks */ 122);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var ngModule = __webpack_require__( /*! ./module */ 180);
- eventRegistratorCallbacks.add(function(name) {
- var ngEventName = name.slice(0, 2) + name.charAt(2).toUpperCase() + name.slice(3);
- ngModule.directive(ngEventName, ["$parse", function($parse) {
- return function(scope, element, attr) {
- var attrValue = attr[ngEventName].trim();
- var handler;
- var eventOptions = {};
- if ("{" === attrValue.charAt(0)) {
- eventOptions = scope.$eval(attrValue);
- handler = $parse(eventOptions.execute)
- } else {
- handler = $parse(attr[ngEventName])
- }
- eventsEngine.on(element, name, eventOptions, function(e) {
- scope.$apply(function() {
- handler(scope, {
- $event: e
- })
- })
- })
- }
- }])
- })
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/integration/angular/components.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var ngModule = __webpack_require__( /*! ./module */ 180);
- ngModule.service("dxDigestCallbacks", ["$rootScope", function($rootScope) {
- var begin = Callbacks();
- var prioritizedEnd = Callbacks();
- var end = Callbacks();
- var digestPhase = false;
- $rootScope.$watch(function() {
- if (digestPhase) {
- return
- }
- digestPhase = true;
- begin.fire();
- $rootScope.$$postDigest(function() {
- digestPhase = false;
- prioritizedEnd.fire();
- end.fire()
- })
- });
- return {
- begin: {
- add: function(callback) {
- if (digestPhase) {
- callback()
- }
- begin.add(callback)
- },
- remove: begin.remove.bind(begin)
- },
- end: {
- add: end.add.bind(end),
- addPrioritized: prioritizedEnd.add.bind(prioritizedEnd),
- remove: end.remove.bind(end)
- }
- }
- }])
- },
- /*!**********************************************************************!*\
- !*** ./artifacts/transpiled/integration/angular/action_executors.js ***!
- \**********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Action = __webpack_require__( /*! ../../core/action */ 111);
- Action.registerExecutor({
- ngExpression: {
- execute: function(e) {
- if ("string" === typeof e.action) {
- e.context.$eval(e.action)
- }
- }
- }
- })
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var ko = __webpack_require__( /*! knockout */ 62);
- if (ko) {
- var errors = __webpack_require__( /*! ../core/errors */ 21);
- var compareVersion = __webpack_require__( /*! ../core/utils/version */ 61).compare;
- if (compareVersion(ko.version, [2, 3]) < 0) {
- throw errors.Error("E0013")
- }
- __webpack_require__( /*! ./knockout/component_registrator */ 476);
- __webpack_require__( /*! ./knockout/event_registrator */ 478);
- __webpack_require__( /*! ./knockout/components */ 479);
- __webpack_require__( /*! ./knockout/validation */ 480);
- __webpack_require__( /*! ./knockout/variable_wrapper_utils */ 481);
- __webpack_require__( /*! ./knockout/clean_node */ 482);
- __webpack_require__( /*! ./knockout/clean_node_old */ 483)
- }
- },
- /*!****************************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/component_registrator.js ***!
- \****************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var ko = __webpack_require__( /*! knockout */ 62);
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- var errors = __webpack_require__( /*! ../../core/errors */ 21);
- var inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
- var isPlainObject = __webpack_require__( /*! ../../core/utils/type */ 1).isPlainObject;
- var registerComponentCallbacks = __webpack_require__( /*! ../../core/component_registrator_callbacks */ 153);
- var Widget = __webpack_require__( /*! ../../ui/widget/ui.widget */ 18);
- var KoTemplate = __webpack_require__( /*! ./template */ 477);
- var Editor = __webpack_require__( /*! ../../ui/editor/editor */ 49);
- var Locker = __webpack_require__( /*! ../../core/utils/locker */ 271);
- var getClosestNodeWithContext = __webpack_require__( /*! ./utils */ 273).getClosestNodeWithContext;
- var config = __webpack_require__( /*! ../../core/config */ 31);
- var LOCKS_DATA_KEY = "dxKoLocks";
- var CREATED_WITH_KO_DATA_KEY = "dxKoCreation";
- var editorsBindingHandlers = [];
- var registerComponentKoBinding = function(componentName, componentClass) {
- if (componentClass.subclassOf(Editor)) {
- editorsBindingHandlers.push(componentName)
- }
- ko.bindingHandlers[componentName] = {
- init: function(domNode, valueAccessor) {
- var $element = $(domNode);
- var optionChangedCallbacks = Callbacks();
- var optionsByReference = {};
- var component;
- var knockoutConfig = config().knockout;
- var isBindingPropertyPredicateName = knockoutConfig && knockoutConfig.isBindingPropertyPredicateName;
- var isBindingPropertyPredicate;
- var ctorOptions = {
- onInitializing: function() {
- optionsByReference = this._getOptionsByReference();
- ko.computed(function() {
- var model = ko.unwrap(valueAccessor());
- if (component) {
- component.beginUpdate()
- }
- isBindingPropertyPredicate = isBindingPropertyPredicateName && model && model[isBindingPropertyPredicateName];
- unwrapModel(model);
- if (component) {
- component.endUpdate()
- }
- }, null, {
- disposeWhenNodeIsRemoved: domNode
- });
- component = this
- },
- modelByElement: function($element) {
- if ($element.length) {
- var node = getClosestNodeWithContext($element.get(0));
- return ko.dataFor(node)
- }
- },
- nestedComponentOptions: function(component) {
- return {
- modelByElement: component.option("modelByElement"),
- nestedComponentOptions: component.option("nestedComponentOptions")
- }
- },
- _optionChangedCallbacks: optionChangedCallbacks,
- integrationOptions: {
- watchMethod: function(fn, callback, options) {
- options = options || {};
- var skipCallback = options.skipImmediate;
- var watcher = ko.computed(function() {
- var newValue = ko.unwrap(fn());
- if (!skipCallback) {
- callback(newValue)
- }
- skipCallback = false
- });
- return function() {
- watcher.dispose()
- }
- },
- templates: {
- "dx-polymorph-widget": {
- render: function(options) {
- var widgetName = ko.utils.unwrapObservable(options.model.widget);
- if (!widgetName) {
- return
- }
- if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) {
- var deprecatedName = widgetName;
- widgetName = inflector.camelize("dx-" + widgetName);
- errors.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead")
- }
- var markup = $("<div>").attr("data-bind", widgetName + ": options").get(0);
- $(options.container).append(markup);
- ko.applyBindings(options.model, markup)
- }
- }
- },
- createTemplate: function(element) {
- return new KoTemplate(element)
- }
- }
- };
- var optionNameToModelMap = {};
- var applyModelValueToOption = function(optionName, modelValue, unwrap) {
- var locks = $element.data(LOCKS_DATA_KEY);
- var optionValue = unwrap ? ko.unwrap(modelValue) : modelValue;
- if (ko.isWriteableObservable(modelValue)) {
- optionNameToModelMap[optionName] = modelValue
- }
- if (component) {
- if (locks.locked(optionName)) {
- return
- }
- locks.obtain(optionName);
- try {
- if (ko.ignoreDependencies) {
- ko.ignoreDependencies(component.option, component, [optionName, optionValue])
- } else {
- component.option(optionName, optionValue)
- }
- } finally {
- locks.release(optionName)
- }
- } else {
- ctorOptions[optionName] = optionValue
- }
- };
- var handleOptionChanged = function(args) {
- var optionName = args.fullName;
- var optionValue = args.value;
- if (!(optionName in optionNameToModelMap)) {
- return
- }
- var $element = this._$element;
- var locks = $element.data(LOCKS_DATA_KEY);
- if (locks.locked(optionName)) {
- return
- }
- locks.obtain(optionName);
- try {
- optionNameToModelMap[optionName](optionValue)
- } finally {
- locks.release(optionName)
- }
- };
- var createComponent = function() {
- optionChangedCallbacks.add(handleOptionChanged);
- $element.data(CREATED_WITH_KO_DATA_KEY, true).data(LOCKS_DATA_KEY, new Locker);
- new componentClass($element, ctorOptions);
- ctorOptions = null
- };
- var unwrapModelValue = function(currentModel, propertyName, propertyPath) {
- if (propertyPath === isBindingPropertyPredicateName) {
- return
- }
- if (!isBindingPropertyPredicate || isBindingPropertyPredicate(propertyPath, propertyName, currentModel)) {
- var unwrappedPropertyValue;
- ko.computed(function() {
- var propertyValue = currentModel[propertyName];
- applyModelValueToOption(propertyPath, propertyValue, true);
- unwrappedPropertyValue = ko.unwrap(propertyValue)
- }, null, {
- disposeWhenNodeIsRemoved: domNode
- });
- if (isPlainObject(unwrappedPropertyValue)) {
- if (!optionsByReference[propertyPath]) {
- unwrapModel(unwrappedPropertyValue, propertyPath)
- }
- }
- } else {
- applyModelValueToOption(propertyPath, currentModel[propertyName], false)
- }
- };
- var unwrapModel = function(model, propertyPath) {
- for (var propertyName in model) {
- if (Object.prototype.hasOwnProperty.call(model, propertyName)) {
- unwrapModelValue(model, propertyName, propertyPath ? [propertyPath, propertyName].join(".") : propertyName)
- }
- }
- };
- createComponent();
- return {
- controlsDescendantBindings: componentClass.subclassOf(Widget)
- }
- }
- };
- if ("dxValidator" === componentName) {
- ko.bindingHandlers.dxValidator.after = editorsBindingHandlers
- }
- };
- registerComponentCallbacks.add(function(name, componentClass) {
- registerComponentKoBinding(name, componentClass)
- })
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/template.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var ko = __webpack_require__( /*! knockout */ 62);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var TemplateBase = __webpack_require__( /*! ../../ui/widget/ui.template_base */ 74);
- var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
- var getClosestNodeWithContext = __webpack_require__( /*! ./utils */ 273).getClosestNodeWithContext;
- var getParentContext = function(data) {
- var parentNode = domAdapter.createElement("div");
- ko.applyBindingsToNode(parentNode, null, data);
- var parentContext = ko.contextFor(parentNode);
- ko.cleanNode(parentNode);
- return parentContext
- };
- var KoTemplate = TemplateBase.inherit({
- ctor: function(element) {
- this._element = element;
- this._template = $("<div>").append(domUtils.normalizeTemplateElement(element));
- this._registerKoTemplate()
- },
- _registerKoTemplate: function() {
- var template = this._template.get(0);
- new ko.templateSources.anonymousTemplate(template).nodes(template)
- },
- _prepareDataForContainer: function(data, container) {
- if (container && container.length) {
- var containerElement = container.get(0);
- var node = getClosestNodeWithContext(containerElement);
- var containerContext = ko.contextFor(node);
- data = void 0 !== data ? data : ko.dataFor(node) || {};
- if (containerContext) {
- return data === containerContext.$data ? containerContext : containerContext.createChildContext(data)
- }
- }
- return getParentContext(data).createChildContext(data)
- },
- _renderCore: function(options) {
- var model = this._prepareDataForContainer(options.model, $(options.container));
- if (typeUtils.isDefined(options.index)) {
- model.$index = options.index
- }
- var $placeholder = $("<div>").appendTo(options.container);
- var $result;
- ko.renderTemplate(this._template.get(0), model, {
- afterRender: function(nodes) {
- $result = $(nodes)
- }
- }, $placeholder.get(0), "replaceNode");
- return $result
- },
- source: function() {
- return $(this._element).clone()
- },
- dispose: function() {
- this._template.remove()
- }
- });
- module.exports = KoTemplate
- },
- /*!************************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/event_registrator.js ***!
- \************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var $ = __webpack_require__( /*! ../../core/renderer */ 2);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var ko = __webpack_require__( /*! knockout */ 62);
- var isPlainObject = __webpack_require__( /*! ../../core/utils/type */ 1).isPlainObject;
- var eventRegistratorCallbacks = __webpack_require__( /*! ../../events/core/event_registrator_callbacks */ 122);
- var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
- eventRegistratorCallbacks.add(function(name) {
- var koBindingEventName = eventUtils.addNamespace(name, name + "Binding");
- ko.bindingHandlers[name] = {
- update: function(element, valueAccessor, allBindingsAccessor, viewModel) {
- var $element = $(element);
- var unwrappedValue = ko.utils.unwrapObservable(valueAccessor());
- var eventSource = unwrappedValue.execute ? unwrappedValue.execute : unwrappedValue;
- eventsEngine.off($element, koBindingEventName);
- eventsEngine.on($element, koBindingEventName, isPlainObject(unwrappedValue) ? unwrappedValue : {}, function(e) {
- eventSource.call(viewModel, viewModel, e)
- })
- }
- }
- })
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/components.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var ko = __webpack_require__( /*! knockout */ 62);
- var iconUtils = __webpack_require__( /*! ../../core/utils/icon */ 60);
- ko.bindingHandlers.dxControlsDescendantBindings = {
- init: function(_, valueAccessor) {
- return {
- controlsDescendantBindings: ko.unwrap(valueAccessor())
- }
- }
- };
- ko.bindingHandlers.dxIcon = {
- init: function(element, valueAccessor) {
- var options = ko.utils.unwrapObservable(valueAccessor()) || {};
- var iconElement = iconUtils.getImageContainer(options);
- ko.virtualElements.emptyNode(element);
- if (iconElement) {
- ko.virtualElements.prepend(element, iconElement.get(0))
- }
- },
- update: function(element, valueAccessor) {
- var options = ko.utils.unwrapObservable(valueAccessor()) || {};
- var iconElement = iconUtils.getImageContainer(options);
- ko.virtualElements.emptyNode(element);
- if (iconElement) {
- ko.virtualElements.prepend(element, iconElement.get(0))
- }
- }
- };
- ko.virtualElements.allowedBindings.dxIcon = true
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/validation.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
- var ValidationEngine = __webpack_require__( /*! ../../ui/validation_engine */ 99);
- var ko = __webpack_require__( /*! knockout */ 62);
- var koDxValidator = Class.inherit({
- ctor: function(target, option) {
- var that = this;
- that.target = target;
- that.validationRules = option.validationRules;
- that.name = option.name;
- that.isValid = ko.observable(true);
- that.validationError = ko.observable();
- each(this.validationRules, function(_, rule) {
- rule.validator = that
- })
- },
- validate: function() {
- var result = ValidationEngine.validate(this.target(), this.validationRules, this.name);
- this._applyValidationResult(result);
- return result
- },
- reset: function() {
- this.target(null);
- var result = {
- isValid: true,
- brokenRule: null
- };
- this._applyValidationResult(result);
- return result
- },
- _applyValidationResult: function(result) {
- result.validator = this;
- this.target.dxValidator.isValid(result.isValid);
- this.target.dxValidator.validationError(result.brokenRule);
- this.fireEvent("validated", [result])
- }
- }).include(EventsMixin);
- ko.extenders.dxValidator = function(target, option) {
- target.dxValidator = new koDxValidator(target, option);
- target.subscribe(target.dxValidator.validate.bind(target.dxValidator));
- return target
- };
- ValidationEngine.registerModelForValidation = function(model) {
- each(model, function(name, member) {
- if (ko.isObservable(member) && member.dxValidator) {
- ValidationEngine.registerValidatorInGroup(model, member.dxValidator)
- }
- })
- };
- ValidationEngine.unregisterModelForValidation = function(model) {
- each(model, function(name, member) {
- if (ko.isObservable(member) && member.dxValidator) {
- ValidationEngine.removeRegisteredValidator(model, member.dxValidator)
- }
- })
- };
- ValidationEngine.validateModel = ValidationEngine.validateGroup
- },
- /*!*****************************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/variable_wrapper_utils.js ***!
- \*****************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var ko = __webpack_require__( /*! knockout */ 62);
- var variableWrapper = __webpack_require__( /*! ../../core/utils/variable_wrapper */ 86);
- variableWrapper.inject({
- isWrapped: ko.isObservable,
- isWritableWrapped: ko.isWritableObservable,
- wrap: ko.observable,
- unwrap: function(value) {
- if (ko.isObservable(value)) {
- return ko.utils.unwrapObservable(value)
- }
- return this.callBase(value)
- },
- assign: function(variable, value) {
- if (ko.isObservable(variable)) {
- variable(value)
- } else {
- this.callBase(variable, value)
- }
- }
- })
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/clean_node.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var elementData = __webpack_require__( /*! ../../core/element_data */ 39);
- var afterCleanData = elementData.afterCleanData;
- var strategyChanging = elementData.strategyChanging;
- var ko = __webpack_require__( /*! knockout */ 62);
- var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
- var originalKOCleanExternalData = ko.utils.domNodeDisposal.cleanExternalData;
- var patchCleanData = function() {
- afterCleanData(function(nodes) {
- for (var i = 0; i < nodes.length; i++) {
- nodes[i].cleanedByJquery = true
- }
- for (i = 0; i < nodes.length; i++) {
- if (!nodes[i].cleanedByKo) {
- ko.cleanNode(nodes[i])
- }
- delete nodes[i].cleanedByKo
- }
- for (i = 0; i < nodes.length; i++) {
- delete nodes[i].cleanedByJquery
- }
- });
- ko.utils.domNodeDisposal.cleanExternalData = function(node) {
- node.cleanedByKo = true;
- if (!node.cleanedByJquery) {
- elementData.cleanData([node])
- }
- }
- };
- var restoreOriginCleanData = function() {
- afterCleanData(function() {});
- ko.utils.domNodeDisposal.cleanExternalData = originalKOCleanExternalData
- };
- patchCleanData();
- strategyChanging.add(function(strategy) {
- var isJQuery = !!strategy.fn;
- if (isJQuery && compareVersion(strategy.fn.jquery, [2, 0]) < 0) {
- restoreOriginCleanData()
- }
- })
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/integration/knockout/clean_node_old.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var ko = __webpack_require__( /*! knockout */ 62);
- var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
- var strategyChanging = __webpack_require__( /*! ../../core/element_data */ 39).strategyChanging;
- var patchCleanData = function(jQuery) {
- var cleanKoData = function(element, andSelf) {
- var cleanNode = function() {
- ko.cleanNode(this)
- };
- if (andSelf) {
- element.each(cleanNode)
- } else {
- element.find("*").each(cleanNode)
- }
- };
- var originalEmpty = jQuery.fn.empty;
- jQuery.fn.empty = function() {
- cleanKoData(this, false);
- return originalEmpty.apply(this, arguments)
- };
- var originalRemove = jQuery.fn.remove;
- jQuery.fn.remove = function(selector, keepData) {
- if (!keepData) {
- var subject = this;
- if (selector) {
- subject = subject.filter(selector)
- }
- cleanKoData(subject, true)
- }
- return originalRemove.call(this, selector, keepData)
- };
- var originalHtml = jQuery.fn.html;
- jQuery.fn.html = function(value) {
- if ("string" === typeof value) {
- cleanKoData(this, false)
- }
- return originalHtml.apply(this, arguments)
- };
- var originalReplaceWith = jQuery.fn.replaceWith;
- jQuery.fn.replaceWith = function() {
- var result = originalReplaceWith.apply(this, arguments);
- if (!this.parent().length) {
- cleanKoData(this, true)
- }
- return result
- }
- };
- strategyChanging.add(function(strategy) {
- var isJQuery = !!strategy.fn;
- if (isJQuery && compareVersion(strategy.fn.jquery, [2, 0]) < 0) {
- patchCleanData(strategy)
- }
- })
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/localization/globalize/message.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- __webpack_require__( /*! ./core */ 127);
- var Globalize = __webpack_require__( /*! globalize */ 72);
- var messageLocalization = __webpack_require__( /*! ../message */ 13);
- var coreLocalization = __webpack_require__( /*! ../core */ 87);
- __webpack_require__( /*! globalize/message */ 72);
- if (Globalize && Globalize.formatMessage) {
- var DEFAULT_LOCALE = "en";
- var originalLoadMessages = Globalize.loadMessages;
- Globalize.loadMessages = function(messages) {
- messageLocalization.load(messages)
- };
- var globalizeMessageLocalization = {
- ctor: function() {
- this.load(this._dictionary)
- },
- load: function(messages) {
- this.callBase(messages);
- originalLoadMessages(messages)
- },
- getMessagesByLocales: function() {
- return Globalize.cldr.get("globalize-messages")
- },
- getFormatter: function(key, locale) {
- var currentLocale = locale || coreLocalization.locale();
- var formatter = this._getFormatterBase(key, locale);
- if (!formatter) {
- formatter = this._formatterByGlobalize(key, locale)
- }
- if (!formatter && currentLocale !== DEFAULT_LOCALE) {
- formatter = this.getFormatter(key, DEFAULT_LOCALE)
- }
- return formatter
- },
- _formatterByGlobalize: function(key, locale) {
- var currentGlobalize = !locale || locale === coreLocalization.locale() ? Globalize : new Globalize(locale);
- var result;
- if (this._messageLoaded(key, locale)) {
- result = currentGlobalize.messageFormatter(key)
- }
- return result
- },
- _messageLoaded: function(key, locale) {
- var currentCldr = locale ? new Globalize(locale).cldr : Globalize.locale();
- var value = currentCldr.get(["globalize-messages/{bundle}", key]);
- return !!value
- },
- _loadSingle: function(key, value, locale) {
- var data = {};
- data[locale] = {};
- data[locale][key] = value;
- this.load(data)
- }
- };
- messageLocalization.inject(globalizeMessageLocalization)
- }
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/localization/globalize/date.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- __webpack_require__( /*! ./core */ 127);
- __webpack_require__( /*! ./number */ 183);
- __webpack_require__( /*! globalize/date */ 72);
- var timeData = {
- supplemental: {
- version: {
- _cldrVersion: "28",
- _unicodeVersion: "8.0.0",
- _number: "$Revision: 11969 $"
- },
- timeData: {
- "001": {
- _allowed: "H h",
- _preferred: "H"
- },
- DE: {
- _allowed: "H",
- _preferred: "H"
- },
- JP: {
- _allowed: "H K h",
- _preferred: "H"
- },
- RU: {
- _allowed: "H",
- _preferred: "H"
- },
- US: {
- _allowed: "H h",
- _preferred: "h"
- }
- }
- }
- };
- var enCaGregorian = {
- main: {
- en: {
- identity: {
- version: {
- _cldrVersion: "28",
- _number: "$Revision: 11972 $"
- },
- language: "en"
- },
- dates: {
- calendars: {
- gregorian: {
- months: {
- format: {
- abbreviated: {
- 1: "Jan",
- 2: "Feb",
- 3: "Mar",
- 4: "Apr",
- 5: "May",
- 6: "Jun",
- 7: "Jul",
- 8: "Aug",
- 9: "Sep",
- 10: "Oct",
- 11: "Nov",
- 12: "Dec"
- },
- narrow: {
- 1: "J",
- 2: "F",
- 3: "M",
- 4: "A",
- 5: "M",
- 6: "J",
- 7: "J",
- 8: "A",
- 9: "S",
- 10: "O",
- 11: "N",
- 12: "D"
- },
- wide: {
- 1: "January",
- 2: "February",
- 3: "March",
- 4: "April",
- 5: "May",
- 6: "June",
- 7: "July",
- 8: "August",
- 9: "September",
- 10: "October",
- 11: "November",
- 12: "December"
- }
- },
- "stand-alone": {
- abbreviated: {
- 1: "Jan",
- 2: "Feb",
- 3: "Mar",
- 4: "Apr",
- 5: "May",
- 6: "Jun",
- 7: "Jul",
- 8: "Aug",
- 9: "Sep",
- 10: "Oct",
- 11: "Nov",
- 12: "Dec"
- },
- narrow: {
- 1: "J",
- 2: "F",
- 3: "M",
- 4: "A",
- 5: "M",
- 6: "J",
- 7: "J",
- 8: "A",
- 9: "S",
- 10: "O",
- 11: "N",
- 12: "D"
- },
- wide: {
- 1: "January",
- 2: "February",
- 3: "March",
- 4: "April",
- 5: "May",
- 6: "June",
- 7: "July",
- 8: "August",
- 9: "September",
- 10: "October",
- 11: "November",
- 12: "December"
- }
- }
- },
- days: {
- format: {
- abbreviated: {
- sun: "Sun",
- mon: "Mon",
- tue: "Tue",
- wed: "Wed",
- thu: "Thu",
- fri: "Fri",
- sat: "Sat"
- },
- narrow: {
- sun: "S",
- mon: "M",
- tue: "T",
- wed: "W",
- thu: "T",
- fri: "F",
- sat: "S"
- },
- "short": {
- sun: "Su",
- mon: "Mo",
- tue: "Tu",
- wed: "We",
- thu: "Th",
- fri: "Fr",
- sat: "Sa"
- },
- wide: {
- sun: "Sunday",
- mon: "Monday",
- tue: "Tuesday",
- wed: "Wednesday",
- thu: "Thursday",
- fri: "Friday",
- sat: "Saturday"
- }
- },
- "stand-alone": {
- abbreviated: {
- sun: "Sun",
- mon: "Mon",
- tue: "Tue",
- wed: "Wed",
- thu: "Thu",
- fri: "Fri",
- sat: "Sat"
- },
- narrow: {
- sun: "S",
- mon: "M",
- tue: "T",
- wed: "W",
- thu: "T",
- fri: "F",
- sat: "S"
- },
- "short": {
- sun: "Su",
- mon: "Mo",
- tue: "Tu",
- wed: "We",
- thu: "Th",
- fri: "Fr",
- sat: "Sa"
- },
- wide: {
- sun: "Sunday",
- mon: "Monday",
- tue: "Tuesday",
- wed: "Wednesday",
- thu: "Thursday",
- fri: "Friday",
- sat: "Saturday"
- }
- }
- },
- quarters: {
- format: {
- abbreviated: {
- 1: "Q1",
- 2: "Q2",
- 3: "Q3",
- 4: "Q4"
- },
- narrow: {
- 1: "1",
- 2: "2",
- 3: "3",
- 4: "4"
- },
- wide: {
- 1: "1st quarter",
- 2: "2nd quarter",
- 3: "3rd quarter",
- 4: "4th quarter"
- }
- },
- "stand-alone": {
- abbreviated: {
- 1: "Q1",
- 2: "Q2",
- 3: "Q3",
- 4: "Q4"
- },
- narrow: {
- 1: "1",
- 2: "2",
- 3: "3",
- 4: "4"
- },
- wide: {
- 1: "1st quarter",
- 2: "2nd quarter",
- 3: "3rd quarter",
- 4: "4th quarter"
- }
- }
- },
- dayPeriods: {
- format: {
- abbreviated: {
- midnight: "midnight",
- am: "AM",
- "am-alt-variant": "am",
- noon: "noon",
- pm: "PM",
- "pm-alt-variant": "pm",
- morning1: "in the morning",
- afternoon1: "in the afternoon",
- evening1: "in the evening",
- night1: "at night"
- },
- narrow: {
- midnight: "mi",
- am: "a",
- "am-alt-variant": "am",
- noon: "n",
- pm: "p",
- "pm-alt-variant": "pm",
- morning1: "in the morning",
- afternoon1: "in the afternoon",
- evening1: "in the evening",
- night1: "at night"
- },
- wide: {
- midnight: "midnight",
- am: "AM",
- "am-alt-variant": "am",
- noon: "noon",
- pm: "PM",
- "pm-alt-variant": "pm",
- morning1: "in the morning",
- afternoon1: "in the afternoon",
- evening1: "in the evening",
- night1: "at night"
- }
- },
- "stand-alone": {
- abbreviated: {
- midnight: "midnight",
- am: "AM",
- "am-alt-variant": "am",
- noon: "noon",
- pm: "PM",
- "pm-alt-variant": "pm",
- morning1: "in the morning",
- afternoon1: "in the afternoon",
- evening1: "in the evening",
- night1: "at night"
- },
- narrow: {
- midnight: "midnight",
- am: "AM",
- "am-alt-variant": "am",
- noon: "noon",
- pm: "PM",
- "pm-alt-variant": "pm",
- morning1: "in the morning",
- afternoon1: "in the afternoon",
- evening1: "in the evening",
- night1: "at night"
- },
- wide: {
- midnight: "midnight",
- am: "AM",
- "am-alt-variant": "am",
- noon: "noon",
- pm: "PM",
- "pm-alt-variant": "pm",
- morning1: "morning",
- afternoon1: "afternoon",
- evening1: "evening",
- night1: "night"
- }
- }
- },
- eras: {
- eraNames: {
- 0: "Before Christ",
- "0-alt-variant": "Before Common Era",
- 1: "Anno Domini",
- "1-alt-variant": "Common Era"
- },
- eraAbbr: {
- 0: "BC",
- "0-alt-variant": "BCE",
- 1: "AD",
- "1-alt-variant": "CE"
- },
- eraNarrow: {
- 0: "B",
- "0-alt-variant": "BCE",
- 1: "A",
- "1-alt-variant": "CE"
- }
- },
- dateFormats: {
- full: "EEEE, MMMM d, y",
- "long": "MMMM d, y",
- medium: "MMM d, y",
- "short": "M/d/yy"
- },
- timeFormats: {
- full: "h:mm:ss a zzzz",
- "long": "h:mm:ss a z",
- medium: "h:mm:ss a",
- "short": "h:mm a"
- },
- dateTimeFormats: {
- full: "{1} 'at' {0}",
- "long": "{1} 'at' {0}",
- medium: "{1}, {0}",
- "short": "{1}, {0}",
- availableFormats: {
- d: "d",
- E: "ccc",
- Ed: "d E",
- Ehm: "E h:mm a",
- EHm: "E HH:mm",
- Ehms: "E h:mm:ss a",
- EHms: "E HH:mm:ss",
- Gy: "y G",
- GyMMM: "MMM y G",
- GyMMMd: "MMM d, y G",
- GyMMMEd: "E, MMM d, y G",
- h: "h a",
- H: "HH",
- hm: "h:mm a",
- Hm: "HH:mm",
- hms: "h:mm:ss a",
- Hms: "HH:mm:ss",
- hmsv: "h:mm:ss a v",
- Hmsv: "HH:mm:ss v",
- hmv: "h:mm a v",
- Hmv: "HH:mm v",
- M: "L",
- Md: "M/d",
- MEd: "E, M/d",
- MMM: "LLL",
- MMMd: "MMM d",
- MMMEd: "E, MMM d",
- MMMMd: "MMMM d",
- ms: "mm:ss",
- y: "y",
- yM: "M/y",
- yMd: "M/d/y",
- yMEd: "E, M/d/y",
- yMMM: "MMM y",
- yMMMd: "MMM d, y",
- yMMMEd: "E, MMM d, y",
- yMMMM: "MMMM y",
- yQQQ: "QQQ y",
- yQQQQ: "QQQQ y"
- },
- appendItems: {
- Day: "{0} ({2}: {1})",
- "Day-Of-Week": "{0} {1}",
- Era: "{0} {1}",
- Hour: "{0} ({2}: {1})",
- Minute: "{0} ({2}: {1})",
- Month: "{0} ({2}: {1})",
- Quarter: "{0} ({2}: {1})",
- Second: "{0} ({2}: {1})",
- Timezone: "{0} {1}",
- Week: "{0} ({2}: {1})",
- Year: "{0} {1}"
- },
- intervalFormats: {
- intervalFormatFallback: "{0} \u2013 {1}",
- d: {
- d: "d \u2013 d"
- },
- h: {
- a: "h a \u2013 h a",
- h: "h \u2013 h a"
- },
- H: {
- H: "HH \u2013 HH"
- },
- hm: {
- a: "h:mm a \u2013 h:mm a",
- h: "h:mm \u2013 h:mm a",
- m: "h:mm \u2013 h:mm a"
- },
- Hm: {
- H: "HH:mm \u2013 HH:mm",
- m: "HH:mm \u2013 HH:mm"
- },
- hmv: {
- a: "h:mm a \u2013 h:mm a v",
- h: "h:mm \u2013 h:mm a v",
- m: "h:mm \u2013 h:mm a v"
- },
- Hmv: {
- H: "HH:mm \u2013 HH:mm v",
- m: "HH:mm \u2013 HH:mm v"
- },
- hv: {
- a: "h a \u2013 h a v",
- h: "h \u2013 h a v"
- },
- Hv: {
- H: "HH \u2013 HH v"
- },
- M: {
- M: "M \u2013 M"
- },
- Md: {
- d: "M/d \u2013 M/d",
- M: "M/d \u2013 M/d"
- },
- MEd: {
- d: "E, M/d \u2013 E, M/d",
- M: "E, M/d \u2013 E, M/d"
- },
- MMM: {
- M: "MMM \u2013 MMM"
- },
- MMMd: {
- d: "MMM d \u2013 d",
- M: "MMM d \u2013 MMM d"
- },
- MMMEd: {
- d: "E, MMM d \u2013 E, MMM d",
- M: "E, MMM d \u2013 E, MMM d"
- },
- y: {
- y: "y \u2013 y"
- },
- yM: {
- M: "M/y \u2013 M/y",
- y: "M/y \u2013 M/y"
- },
- yMd: {
- d: "M/d/y \u2013 M/d/y",
- M: "M/d/y \u2013 M/d/y",
- y: "M/d/y \u2013 M/d/y"
- },
- yMEd: {
- d: "E, M/d/y \u2013 E, M/d/y",
- M: "E, M/d/y \u2013 E, M/d/y",
- y: "E, M/d/y \u2013 E, M/d/y"
- },
- yMMM: {
- M: "MMM \u2013 MMM y",
- y: "MMM y \u2013 MMM y"
- },
- yMMMd: {
- d: "MMM d \u2013 d, y",
- M: "MMM d \u2013 MMM d, y",
- y: "MMM d, y \u2013 MMM d, y"
- },
- yMMMEd: {
- d: "E, MMM d \u2013 E, MMM d, y",
- M: "E, MMM d \u2013 E, MMM d, y",
- y: "E, MMM d, y \u2013 E, MMM d, y"
- },
- yMMMM: {
- M: "MMMM \u2013 MMMM y",
- y: "MMMM y \u2013 MMMM y"
- }
- }
- }
- }
- }
- }
- }
- }
- };
- var weekData = {
- supplemental: {
- version: {
- _cldrVersion: "28",
- _unicodeVersion: "8.0.0",
- _number: "$Revision: 11969 $"
- },
- weekData: {
- minDays: {
- "001": "1",
- US: "1",
- DE: "4"
- },
- firstDay: {
- "001": "mon",
- DE: "mon",
- RU: "mon",
- JP: "sun",
- US: "sun"
- },
- weekendStart: {
- "001": "sat"
- },
- weekendEnd: {
- "001": "sun"
- }
- }
- }
- };
- var ACCEPTABLE_JSON_FORMAT_PROPERTIES = ["skeleton", "date", "time", "datetime", "raw"];
- var Globalize = __webpack_require__( /*! globalize */ 72);
- var dateLocalization = __webpack_require__( /*! ../date */ 32);
- var isObject = __webpack_require__( /*! ../../core/utils/type */ 1).isObject;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- if (Globalize && Globalize.formatDate) {
- if ("en" === Globalize.locale().locale) {
- Globalize.load(weekData, timeData, enCaGregorian);
- Globalize.locale("en")
- }
- var formattersCache = {};
- var FORMATS_TO_GLOBALIZE_MAP = {
- shortdate: {
- path: "dateTimeFormats/availableFormats/yMd"
- },
- shorttime: {
- path: "timeFormats/short"
- },
- longdate: {
- path: "dateFormats/full"
- },
- longtime: {
- path: "timeFormats/medium"
- },
- monthandday: {
- path: "dateTimeFormats/availableFormats/MMMMd"
- },
- monthandyear: {
- path: "dateTimeFormats/availableFormats/yMMMM"
- },
- quarterandyear: {
- path: "dateTimeFormats/availableFormats/yQQQ"
- },
- day: {
- path: "dateTimeFormats/availableFormats/d"
- },
- year: {
- path: "dateTimeFormats/availableFormats/y"
- },
- shortdateshorttime: {
- path: "dateTimeFormats/short",
- parts: ["shorttime", "shortdate"]
- },
- mediumdatemediumtime: {
- path: "dateTimeFormats/medium",
- parts: ["shorttime", "monthandday"]
- },
- longdatelongtime: {
- path: "dateTimeFormats/medium",
- parts: ["longtime", "longdate"]
- },
- month: {
- pattern: "LLLL"
- },
- shortyear: {
- pattern: "yy"
- },
- dayofweek: {
- pattern: "EEEE"
- },
- quarter: {
- pattern: "QQQ"
- },
- millisecond: {
- pattern: "SSS"
- },
- hour: {
- pattern: "HH"
- },
- minute: {
- pattern: "mm"
- },
- second: {
- pattern: "ss"
- }
- };
- var globalizeDateLocalization = {
- _getPatternByFormat: function(format) {
- var that = this;
- var lowerFormat = format.toLowerCase();
- var globalizeFormat = FORMATS_TO_GLOBALIZE_MAP[lowerFormat];
- if ("datetime-local" === lowerFormat) {
- return "yyyy-MM-ddTHH':'mm':'ss"
- }
- if (!globalizeFormat) {
- return
- }
- var result = globalizeFormat.path && that._getFormatStringByPath(globalizeFormat.path) || globalizeFormat.pattern;
- if (globalizeFormat.parts) {
- iteratorUtils.each(globalizeFormat.parts, function(index, part) {
- result = result.replace("{" + index + "}", that._getPatternByFormat(part))
- })
- }
- return result
- },
- _getFormatStringByPath: function(path) {
- return Globalize.locale().main("dates/calendars/gregorian/" + path)
- },
- getPeriodNames: function() {
- var json = Globalize.locale().main("dates/calendars/gregorian/dayPeriods/stand-alone/wide");
- return [json.am, json.pm]
- },
- getMonthNames: function(format, type) {
- var months = Globalize.locale().main("dates/calendars/gregorian/months/" + ("format" === type ? type : "stand-alone") + "/" + (format || "wide"));
- return iteratorUtils.map(months, function(month) {
- return month
- })
- },
- getDayNames: function(format) {
- var days = Globalize.locale().main("dates/calendars/gregorian/days/stand-alone/" + (format || "wide"));
- return iteratorUtils.map(days, function(day) {
- return day
- })
- },
- getTimeSeparator: function() {
- return Globalize.locale().main("numbers/symbols-numberSystem-latn/timeSeparator")
- },
- format: function(date, _format) {
- if (!date) {
- return
- }
- if (!_format) {
- return date
- }
- var formatter;
- var formatCacheKey;
- if ("function" === typeof _format) {
- return _format(date)
- }
- if (_format.formatter) {
- return _format.formatter(date)
- }
- _format = _format.type || _format;
- if ("string" === typeof _format) {
- formatCacheKey = Globalize.locale().locale + ":" + _format;
- formatter = formattersCache[formatCacheKey];
- if (!formatter) {
- _format = {
- raw: this._getPatternByFormat(_format) || _format
- };
- formatter = formattersCache[formatCacheKey] = Globalize.dateFormatter(_format)
- }
- } else {
- if (!this._isAcceptableFormat(_format)) {
- return
- }
- formatter = Globalize.dateFormatter(_format)
- }
- return formatter(date)
- },
- parse: function(text, format) {
- if (!text) {
- return
- }
- if (!format || "function" === typeof format || isObject(format) && !this._isAcceptableFormat(format)) {
- if (format) {
- var parsedValue = this.callBase(text, format);
- if (parsedValue) {
- return parsedValue
- }
- }
- return Globalize.parseDate(text)
- }
- if (format.parser) {
- return format.parser(text)
- }
- if ("string" === typeof format) {
- format = {
- raw: this._getPatternByFormat(format) || format
- }
- }
- return Globalize.parseDate(text, format)
- },
- _isAcceptableFormat: function(format) {
- if (format.parser) {
- return true
- }
- for (var i = 0; i < ACCEPTABLE_JSON_FORMAT_PROPERTIES.length; i++) {
- if (Object.prototype.hasOwnProperty.call(format, ACCEPTABLE_JSON_FORMAT_PROPERTIES[i])) {
- return true
- }
- }
- },
- firstDayOfWeekIndex: function() {
- var firstDay = Globalize.locale().supplemental.weekData.firstDay();
- return inArray(firstDay, this._getDayKeys())
- },
- _getDayKeys: function() {
- var days = Globalize.locale().main("dates/calendars/gregorian/days/format/short");
- return iteratorUtils.map(days, function(day, key) {
- return key
- })
- }
- };
- dateLocalization.inject(globalizeDateLocalization)
- }
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/localization/globalize/currency.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
- return typeof obj
- } : function(obj) {
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
- }, _typeof(obj)
- }
- __webpack_require__( /*! ./core */ 127);
- __webpack_require__( /*! ./number */ 183);
- __webpack_require__( /*! ../currency */ 152);
- __webpack_require__( /*! globalize/currency */ 72);
- var enCurrencyUSD = {
- main: {
- en: {
- identity: {
- version: {
- _cldrVersion: "28",
- _number: "$Revision: 11972 $"
- },
- language: "en"
- },
- numbers: {
- currencies: {
- USD: {
- displayName: "US Dollar",
- "displayName-count-one": "US dollar",
- "displayName-count-other": "US dollars",
- symbol: "$",
- "symbol-alt-narrow": "$"
- }
- }
- }
- }
- }
- };
- var currencyData = {
- supplemental: {
- version: {
- _cldrVersion: "28",
- _unicodeVersion: "8.0.0",
- _number: "$Revision: 11969 $"
- },
- currencyData: {
- fractions: {
- DEFAULT: {
- _rounding: "0",
- _digits: "2"
- }
- }
- }
- }
- };
- var Globalize = __webpack_require__( /*! globalize */ 72);
- var config = __webpack_require__( /*! ../../core/config */ 31);
- var numberLocalization = __webpack_require__( /*! ../number */ 51);
- if (Globalize && Globalize.formatCurrency) {
- if ("en" === Globalize.locale().locale) {
- Globalize.load(enCurrencyUSD, currencyData);
- Globalize.locale("en")
- }
- var formattersCache = {};
- var getFormatter = function(currency, format) {
- var formatter;
- var formatCacheKey;
- if ("object" === _typeof(format)) {
- formatCacheKey = Globalize.locale().locale + ":" + currency + ":" + JSON.stringify(format)
- } else {
- formatCacheKey = Globalize.locale().locale + ":" + currency + ":" + format
- }
- formatter = formattersCache[formatCacheKey];
- if (!formatter) {
- formatter = formattersCache[formatCacheKey] = Globalize.currencyFormatter(currency, format)
- }
- return formatter
- };
- var globalizeCurrencyLocalization = {
- _formatNumberCore: function(value, format, formatConfig) {
- if ("currency" === format) {
- var currency = formatConfig && formatConfig.currency || config().defaultCurrency;
- return getFormatter(currency, this._normalizeFormatConfig(format, formatConfig, value))(value)
- }
- return this.callBase.apply(this, arguments)
- },
- _normalizeFormatConfig: function(format, formatConfig, value) {
- var config = this.callBase(format, formatConfig, value);
- if ("currency" === format) {
- config.style = "accounting"
- }
- return config
- },
- format: function(value, _format) {
- if ("number" !== typeof value) {
- return value
- }
- _format = this._normalizeFormat(_format);
- if (_format) {
- if ("default" === _format.currency) {
- _format.currency = config().defaultCurrency
- }
- if ("currency" === _format.type) {
- return this._formatNumber(value, this._parseNumberFormatString("currency"), _format)
- } else {
- if (!_format.type && _format.currency) {
- return getFormatter(_format.currency, _format)(value)
- }
- }
- }
- return this.callBase.apply(this, arguments)
- },
- getCurrencySymbol: function(currency) {
- if (!currency) {
- currency = config().defaultCurrency
- }
- return Globalize.cldr.main("numbers/currencies/" + currency)
- },
- getOpenXmlCurrencyFormat: function(currency) {
- var currencySymbol = this.getCurrencySymbol(currency).symbol;
- var currencyFormat = Globalize.cldr.main("numbers/currencyFormats-numberSystem-latn");
- var i;
- var result;
- var symbol;
- var encodeSymbols;
- if (currencyFormat.accounting) {
- encodeSymbols = {
- ".00": "{0}",
- "'": "\\'",
- "\\(": "\\(",
- "\\)": "\\)",
- " ": "\\ ",
- '"': """,
- "\\\xa4": currencySymbol
- };
- result = currencyFormat.accounting.split(";");
- for (i = 0; i < result.length; i++) {
- for (symbol in encodeSymbols) {
- if (Object.prototype.hasOwnProperty.call(encodeSymbols, symbol)) {
- result[i] = result[i].replace(new RegExp(symbol, "g"), encodeSymbols[symbol])
- }
- }
- }
- return 2 === result.length ? result[0] + "_);" + result[1] : result[0]
- }
- }
- };
- numberLocalization.inject(globalizeCurrencyLocalization)
- }
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/data/data_source.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./data_source/data_source */ 45).DataSource
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/data/local_store.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
- var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
- var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
- var window = windowUtils.getWindow();
- var Class = __webpack_require__( /*! ../core/class */ 15);
- var abstract = Class.abstract;
- var errors = __webpack_require__( /*! ./errors */ 36).errors;
- var ArrayStore = __webpack_require__( /*! ./array_store */ 68);
- var LocalStoreBackend = Class.inherit({
- ctor: function(store, storeOptions) {
- this._store = store;
- this._dirty = !!storeOptions.data;
- this.save();
- var immediate = this._immediate = storeOptions.immediate;
- var flushInterval = Math.max(100, storeOptions.flushInterval || 1e4);
- if (!immediate) {
- var saveProxy = this.save.bind(this);
- setInterval(saveProxy, flushInterval);
- eventsEngine.on(window, "beforeunload", saveProxy);
- if (window.cordova) {
- domAdapter.listen(domAdapter.getDocument(), "pause", saveProxy, false)
- }
- }
- },
- notifyChanged: function() {
- this._dirty = true;
- if (this._immediate) {
- this.save()
- }
- },
- load: function() {
- this._store._array = this._loadImpl();
- this._dirty = false
- },
- save: function() {
- if (!this._dirty) {
- return
- }
- this._saveImpl(this._store._array);
- this._dirty = false
- },
- _loadImpl: abstract,
- _saveImpl: abstract
- });
- var DomLocalStoreBackend = LocalStoreBackend.inherit({
- ctor: function(store, storeOptions) {
- var name = storeOptions.name;
- if (!name) {
- throw errors.Error("E4013")
- }
- this._key = "dx-data-localStore-" + name;
- this.callBase(store, storeOptions)
- },
- _loadImpl: function() {
- var raw = window.localStorage.getItem(this._key);
- if (raw) {
- return JSON.parse(raw)
- }
- return []
- },
- _saveImpl: function(array) {
- if (!array.length) {
- window.localStorage.removeItem(this._key)
- } else {
- window.localStorage.setItem(this._key, JSON.stringify(array))
- }
- }
- });
- var localStoreBackends = {
- dom: DomLocalStoreBackend
- };
- var LocalStore = ArrayStore.inherit({
- ctor: function(options) {
- if ("string" === typeof options) {
- options = {
- name: options
- }
- } else {
- options = options || {}
- }
- this.callBase(options);
- this._backend = new localStoreBackends[options.backend || "dom"](this, options);
- this._backend.load()
- },
- clear: function() {
- this.callBase();
- this._backend.notifyChanged()
- },
- _insertImpl: function(values) {
- var b = this._backend;
- return this.callBase(values).done(b.notifyChanged.bind(b))
- },
- _updateImpl: function(key, values) {
- var b = this._backend;
- return this.callBase(key, values).done(b.notifyChanged.bind(b))
- },
- _removeImpl: function(key) {
- var b = this._backend;
- return this.callBase(key).done(b.notifyChanged.bind(b))
- }
- }, "local");
- module.exports = LocalStore
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/data/endpoint_selector.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errors = __webpack_require__( /*! ../core/errors */ 21);
- var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
- var proxyUrlFormatter = __webpack_require__( /*! ./proxy_url_formatter */ 275);
- var IS_WINJS_ORIGIN;
- var IS_LOCAL_ORIGIN;
- function isLocalHostName(url) {
- return /^(localhost$|127\.)/i.test(url)
- }
- var EndpointSelector = function(config) {
- this.config = config;
- IS_WINJS_ORIGIN = "ms-appx:" === window.location.protocol;
- IS_LOCAL_ORIGIN = isLocalHostName(window.location.hostname)
- };
- EndpointSelector.prototype = {
- urlFor: function(key) {
- var bag = this.config[key];
- if (!bag) {
- throw errors.Error("E0006")
- }
- if (proxyUrlFormatter.isProxyUsed()) {
- return proxyUrlFormatter.formatProxyUrl(bag.local)
- }
- if (bag.production) {
- if (IS_WINJS_ORIGIN && !Debug.debuggerEnabled || !IS_WINJS_ORIGIN && !IS_LOCAL_ORIGIN) {
- return bag.production
- }
- }
- return bag.local
- }
- };
- module.exports = EndpointSelector
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/bundles/modules/data.odata.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- __webpack_require__( /*! ./data */ 274);
- DevExpress.data.ODataStore = __webpack_require__( /*! ../../data/odata/store */ 276);
- DevExpress.data.ODataContext = __webpack_require__( /*! ../../data/odata/context */ 491);
- DevExpress.data.utils = DevExpress.data.utils || {};
- DevExpress.data.utils.odata = {};
- DevExpress.data.utils.odata.keyConverters = __webpack_require__( /*! ../../data/odata/utils */ 110).keyConverters;
- DevExpress.data.EdmLiteral = __webpack_require__( /*! ../../data/odata/utils */ 110).EdmLiteral;
- var ODataUtilsModule = __webpack_require__( /*! ../../data/odata/utils */ 110);
- DevExpress.data.utils.odata.serializePropName = ODataUtilsModule.serializePropName;
- DevExpress.data.utils.odata.serializeValue = ODataUtilsModule.serializeValue;
- DevExpress.data.utils.odata.serializeKey = ODataUtilsModule.serializeKey;
- DevExpress.data.utils.odata.sendRequest = ODataUtilsModule.sendRequest;
- DevExpress.data.OData__internals = ODataUtilsModule.OData__internals;
- DevExpress.data.queryAdapters = DevExpress.data.queryAdapters || {};
- DevExpress.data.queryAdapters.odata = __webpack_require__( /*! ../../data/odata/query_adapter */ 156).odata
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/data/odata/context.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var errorsModule = __webpack_require__( /*! ../errors */ 36);
- var ODataStore = __webpack_require__( /*! ./store */ 276);
- var mixins = __webpack_require__( /*! ./mixins */ 277);
- var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
- var when = deferredUtils.when;
- var Deferred = deferredUtils.Deferred;
- __webpack_require__( /*! ./query_adapter */ 156);
- var ODataContext = Class.inherit({
- ctor: function(options) {
- var that = this;
- that._extractServiceOptions(options);
- that._errorHandler = options.errorHandler;
- each(options.entities || [], function(entityAlias, entityOptions) {
- that[entityAlias] = new ODataStore(extend({}, options, {
- url: that._url + "/" + encodeURIComponent(entityOptions.name || entityAlias)
- }, entityOptions))
- })
- },
- get: function(operationName, params) {
- return this.invoke(operationName, params, "GET")
- },
- invoke: function(operationName, params, httpMethod) {
- params = params || {};
- httpMethod = (httpMethod || "POST").toLowerCase();
- var d = new Deferred;
- var url = this._url + "/" + encodeURIComponent(operationName);
- var payload;
- if (4 === this.version()) {
- if ("get" === httpMethod) {
- url = mixins.formatFunctionInvocationUrl(url, mixins.escapeServiceOperationParams(params, this.version()));
- params = null
- } else {
- if ("post" === httpMethod) {
- payload = params;
- params = null
- }
- }
- }
- when(this._sendRequest(url, httpMethod, mixins.escapeServiceOperationParams(params, this.version()), payload)).done(function(r) {
- if (typeUtils.isPlainObject(r) && operationName in r) {
- r = r[operationName]
- }
- d.resolve(r)
- }).fail(this._errorHandler).fail(errorsModule._errorHandler).fail(d.reject);
- return d.promise()
- },
- objectLink: function(entityAlias, key) {
- var store = this[entityAlias];
- if (!store) {
- throw errorsModule.errors.Error("E4015", entityAlias)
- }
- if (!typeUtils.isDefined(key)) {
- return null
- }
- return {
- __metadata: {
- uri: store._byKeyUrl(key, true)
- }
- }
- }
- }).include(mixins.SharedMethods);
- module.exports = ODataContext
- }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/bundles/modules/viz.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- __webpack_require__( /*! ./core */ 147);
- module.exports = DevExpress.viz = DevExpress.viz || {}
- },
- /*!*******************************************!*\
- !*** ./artifacts/transpiled/viz/chart.js ***!
- \*******************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _common = __webpack_require__( /*! ../core/utils/common */ 4);
- var _extend2 = __webpack_require__( /*! ../core/utils/extend */ 0);
- var _array = __webpack_require__( /*! ../core/utils/array */ 14);
- var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9);
- var _component_registrator2 = _interopRequireDefault(_component_registrator);
- var _utils = __webpack_require__( /*! ./core/utils */ 10);
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _math = __webpack_require__( /*! ../core/utils/math */ 28);
- var _base_chart = __webpack_require__( /*! ./chart_components/base_chart */ 240);
- var _layout_manager = __webpack_require__( /*! ./chart_components/layout_manager */ 402);
- var _layout_manager2 = _interopRequireDefault(_layout_manager);
- var _multi_axes_synchronizer = __webpack_require__( /*! ./chart_components/multi_axes_synchronizer */ 778);
- var _multi_axes_synchronizer2 = _interopRequireDefault(_multi_axes_synchronizer);
- var _advanced_chart = __webpack_require__( /*! ./chart_components/advanced_chart */ 404);
- var _scroll_bar = __webpack_require__( /*! ./chart_components/scroll_bar */ 787);
- var _scroll_bar2 = _interopRequireDefault(_scroll_bar);
- var _crosshair = __webpack_require__( /*! ./chart_components/crosshair */ 410);
- var _crosshair2 = _interopRequireDefault(_crosshair);
- var _range_data_calculator = __webpack_require__( /*! ./series/helpers/range_data_calculator */ 247);
- var _range_data_calculator2 = _interopRequireDefault(_range_data_calculator);
- var _range = __webpack_require__( /*! ./translators/range */ 108);
- var _range2 = _interopRequireDefault(_range);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- var DEFAULT_PANE_NAME = "default";
- var VISUAL_RANGE = "VISUAL_RANGE";
- var DEFAULT_PANES = [{
- name: DEFAULT_PANE_NAME,
- border: {}
- }];
- var _isArray = Array.isArray;
- function getFirstAxisNameForPane(axes, paneName, defaultPane) {
- var result;
- for (var i = 0; i < axes.length; i++) {
- if (axes[i].pane === paneName || void 0 === axes[i].pane && paneName === defaultPane) {
- result = axes[i].name;
- break
- }
- }
- if (!result) {
- result = axes[0].name
- }
- return result
- }
- function changeVisibilityAxisGrids(axis, gridVisibility, minorGridVisibility) {
- var gridOpt = axis.getOptions().grid;
- var minorGridOpt = axis.getOptions().minorGrid;
- gridOpt.visible = gridVisibility;
- minorGridOpt && (minorGridOpt.visible = minorGridVisibility)
- }
- function hideGridsOnNonFirstValueAxisForPane(axesForPane) {
- var axisShown = false;
- var hiddenStubAxis = [];
- var minorGridVisibility = axesForPane.some(function(axis) {
- var minorGridOptions = axis.getOptions().minorGrid;
- return minorGridOptions && minorGridOptions.visible
- });
- var gridVisibility = axesForPane.some(function(axis) {
- var gridOptions = axis.getOptions().grid;
- return gridOptions && gridOptions.visible
- });
- if (axesForPane.length > 1) {
- axesForPane.forEach(function(axis) {
- var gridOpt = axis.getOptions().grid;
- if (axisShown) {
- changeVisibilityAxisGrids(axis, false, false)
- } else {
- if (gridOpt && gridOpt.visible) {
- if (axis.getTranslator().getBusinessRange().isEmpty()) {
- changeVisibilityAxisGrids(axis, false, false);
- hiddenStubAxis.push(axis)
- } else {
- axisShown = true;
- changeVisibilityAxisGrids(axis, gridVisibility, minorGridVisibility)
- }
- }
- }
- });
- !axisShown && hiddenStubAxis.length && changeVisibilityAxisGrids(hiddenStubAxis[0], gridVisibility, minorGridVisibility)
- }
- }
- function findAxisOptions(valueAxes, valueAxesOptions, axisName) {
- var result;
- var axInd;
- for (axInd = 0; axInd < valueAxesOptions.length; axInd++) {
- if (valueAxesOptions[axInd].name === axisName) {
- result = valueAxesOptions[axInd];
- result.priority = axInd;
- break
- }
- }
- if (!result) {
- for (axInd = 0; axInd < valueAxes.length; axInd++) {
- if (valueAxes[axInd].name === axisName) {
- result = valueAxes[axInd].getOptions();
- result.priority = valueAxes[axInd].priority;
- break
- }
- }
- }
- return result
- }
- function findAxis(paneName, axisName, axes) {
- for (var i = 0; i < axes.length; i++) {
- var axis = axes[i];
- if (axis.name === axisName && axis.pane === paneName) {
- return axis
- }
- }
- if (paneName) {
- return findAxis(void 0, axisName, axes)
- }
- }
- function compareAxes(a, b) {
- return a.priority - b.priority
- }
- function doesPaneExist(panes, paneName) {
- var found = false;
- (0, _iterator.each)(panes, function(_, pane) {
- if (pane.name === paneName) {
- found = true;
- return false
- }
- });
- return found
- }
- var prepareSegmentRectPoints = function(left, top, width, height, borderOptions) {
- var maxSW = ~~((width < height ? width : height) / 2);
- var sw = borderOptions.width || 0;
- var newSW = sw < maxSW ? sw : maxSW;
- left += newSW / 2;
- top += newSW / 2;
- width -= newSW;
- height -= newSW;
- var right = left + width;
- var bottom = top + height;
- var points = [];
- var segments = [];
- var segmentSequence;
- var visiblyOpt = 0;
- var prevSegmentVisibility = 0;
- var allSegment = {
- top: [
- [left, top],
- [right, top]
- ],
- right: [
- [right, top],
- [right, bottom]
- ],
- bottom: [
- [right, bottom],
- [left, bottom]
- ],
- left: [
- [left, bottom],
- [left, top]
- ]
- };
- (0, _iterator.each)(allSegment, function(seg) {
- var visibility = !!borderOptions[seg];
- visiblyOpt = 2 * visiblyOpt + ~~visibility
- });
- switch (visiblyOpt) {
- case 13:
- case 9:
- segmentSequence = ["left", "top", "right", "bottom"];
- break;
- case 11:
- segmentSequence = ["bottom", "left", "top", "right"];
- break;
- default:
- segmentSequence = ["top", "right", "bottom", "left"]
- }(0, _iterator.each)(segmentSequence, function(_, seg) {
- var segmentVisibility = !!borderOptions[seg];
- if (!prevSegmentVisibility && segments.length) {
- points.push(segments);
- segments = []
- }
- if (segmentVisibility) {
- (0, _iterator.each)(allSegment[seg].slice(prevSegmentVisibility), function(_, segment) {
- segments = segments.concat(segment)
- })
- }
- prevSegmentVisibility = ~~segmentVisibility
- });
- segments.length && points.push(segments);
- 1 === points.length && (points = points[0]);
- return {
- points: points,
- pathType: 15 === visiblyOpt ? "area" : "line"
- }
- };
- function accumulate(field, src1, src2, auxSpacing) {
- var val1 = src1[field] || 0;
- var val2 = src2[field] || 0;
- return val1 + val2 + (val1 && val2 ? auxSpacing : 0)
- }
- function pickMax(field, src1, src2) {
- return pickMaxValue(src1[field], src2[field])
- }
- function pickMaxValue(val1, val2) {
- return Math.max(val1 || 0, val2 || 0)
- }
- function getAxisMargins(axis) {
- return axis.getMargins()
- }
- function getHorizontalAxesMargins(axes, getMarginsFunc) {
- return axes.reduce(function(margins, axis) {
- var axisMargins = getMarginsFunc(axis);
- var paneMargins = margins.panes[axis.pane] = margins.panes[axis.pane] || {};
- var spacing = axis.getMultipleAxesSpacing();
- paneMargins.top = accumulate("top", paneMargins, axisMargins, spacing);
- paneMargins.bottom = accumulate("bottom", paneMargins, axisMargins, spacing);
- paneMargins.left = pickMax("left", paneMargins, axisMargins);
- paneMargins.right = pickMax("right", paneMargins, axisMargins);
- margins.top = pickMax("top", paneMargins, margins);
- margins.bottom = pickMax("bottom", paneMargins, margins);
- margins.left = pickMax("left", paneMargins, margins);
- margins.right = pickMax("right", paneMargins, margins);
- return margins
- }, {
- panes: {}
- })
- }
- function getVerticalAxesMargins(axes) {
- return axes.reduce(function(margins, axis) {
- var axisMargins = axis.getMargins();
- var paneMargins = margins.panes[axis.pane] = margins.panes[axis.pane] || {};
- var spacing = axis.getMultipleAxesSpacing();
- paneMargins.top = pickMax("top", paneMargins, axisMargins);
- paneMargins.bottom = pickMax("bottom", paneMargins, axisMargins);
- paneMargins.left = accumulate("left", paneMargins, axisMargins, spacing);
- paneMargins.right = accumulate("right", paneMargins, axisMargins, spacing);
- margins.top = pickMax("top", paneMargins, margins);
- margins.bottom = pickMax("bottom", paneMargins, margins);
- margins.left = pickMax("left", paneMargins, margins);
- margins.right = pickMax("right", paneMargins, margins);
- return margins
- }, {
- panes: {}
- })
- }
- function performActionOnAxes(axes, action, actionArgument1, actionArgument2, actionArgument3) {
- axes.forEach(function(axis) {
- axis[action](actionArgument1 && actionArgument1[axis.pane], actionArgument2 && actionArgument2[axis.pane] || actionArgument2, actionArgument3)
- })
- }
- function shrinkCanvases(isRotated, canvases, verticalMargins, horizontalMargins) {
- function getMargin(side, margins, pane) {
- var m = (isRotated ? ["left", "right"] : ["top", "bottom"]).indexOf(side) === -1 ? margins : margins.panes[pane] || {};
- return m[side]
- }
- function getMaxMargin(side, margins1, margins2, pane) {
- return pickMaxValue(getMargin(side, margins1, pane), getMargin(side, margins2, pane))
- }
- for (var pane in canvases) {
- canvases[pane].top = canvases[pane].originalTop + getMaxMargin("top", verticalMargins, horizontalMargins, pane);
- canvases[pane].bottom = canvases[pane].originalBottom + getMaxMargin("bottom", verticalMargins, horizontalMargins, pane);
- canvases[pane].left = canvases[pane].originalLeft + getMaxMargin("left", verticalMargins, horizontalMargins, pane);
- canvases[pane].right = canvases[pane].originalRight + getMaxMargin("right", verticalMargins, horizontalMargins, pane)
- }
- return canvases
- }
- function drawAxesWithTicks(axes, condition, canvases, panesBorderOptions) {
- if (condition) {
- performActionOnAxes(axes, "createTicks", canvases);
- _multi_axes_synchronizer2.default.synchronize(axes)
- }
- performActionOnAxes(axes, "draw", !condition && canvases, panesBorderOptions)
- }
- function shiftAxis(side1, side2) {
- var shifts = {};
- return function(axis) {
- var shift = shifts[axis.pane] = shifts[axis.pane] || {
- top: 0,
- left: 0,
- bottom: 0,
- right: 0
- };
- var spacing = axis.getMultipleAxesSpacing();
- var margins = axis.getMargins();
- axis.shift(shift);
- shift[side1] = accumulate(side1, shift, margins, spacing);
- shift[side2] = accumulate(side2, shift, margins, spacing)
- }
- }
- function getCommonSize(side, margins) {
- var size = 0;
- var pane;
- for (pane in margins.panes) {
- var paneMargins = margins.panes[pane];
- size += "height" === side ? paneMargins.top + paneMargins.bottom : paneMargins.left + paneMargins.right
- }
- return size
- }
- function checkUsedSpace(sizeShortage, side, axes, getMarginFunc) {
- var size = 0;
- if (sizeShortage[side] > 0) {
- size = getCommonSize(side, getMarginFunc(axes, getAxisMargins));
- performActionOnAxes(axes, "hideTitle");
- sizeShortage[side] -= size - getCommonSize(side, getMarginFunc(axes, getAxisMargins))
- }
- if (sizeShortage[side] > 0) {
- performActionOnAxes(axes, "hideOuterElements")
- }
- }
- function axisAnimationEnabled(drawOptions, series) {
- var pointsCount = series.reduce(function(sum, s) {
- return sum += s.getPoints().length
- }, 0) / series.length;
- return drawOptions.animate && pointsCount <= drawOptions.animationPointsLimit
- }
- var dxChart = _advanced_chart.AdvancedChart.inherit({
- _themeSection: "chart",
- _fontFields: ["crosshair.label.font"],
- _setDeprecatedOptions: function() {
- this.callBase.apply(this, arguments);
- (0, _extend2.extend)(this._deprecatedOptions, {
- useAggregation: {
- since: "18.1",
- message: "Use the 'commonSeriesSettings.aggregation.enabled' or 'series.aggregation.enabled' option instead"
- },
- "argumentAxis.min": {
- since: "18.2",
- message: "Use the 'argumentAxis.visualRange' option instead"
- },
- "argumentAxis.max": {
- since: "18.2",
- message: "Use the 'argumentAxis.visualRange' option instead"
- },
- "valueAxis.min": {
- since: "18.2",
- message: "Use the 'valueAxis.visualRange' option instead"
- },
- "valueAxis.max": {
- since: "18.2",
- message: "Use the 'valueAxis.visualRange' option instead"
- },
- zoomingMode: {
- since: "18.2",
- message: "Use the 'zoomAndPan' option instead"
- },
- scrollingMode: {
- since: "18.2",
- message: "Use the 'zoomAndPan' option instead"
- }
- })
- },
- _partialOptionChangesMap: {
- visualRange: VISUAL_RANGE,
- _customVisualRange: VISUAL_RANGE,
- strips: "REFRESH_AXES",
- constantLines: "REFRESH_AXES"
- },
- _partialOptionChangesPath: {
- argumentAxis: ["strips", "constantLines", "visualRange", "_customVisualRange"],
- valueAxis: ["strips", "constantLines", "visualRange", "_customVisualRange"]
- },
- _initCore: function() {
- this.paneAxis = {};
- this._panesClipRects = {};
- this.callBase()
- },
- _disposeCore: function() {
- var that = this;
- var disposeObjectsInArray = this._disposeObjectsInArray;
- var panesClipRects = that._panesClipRects;
- that.callBase();
- disposeObjectsInArray.call(panesClipRects, "fixed");
- disposeObjectsInArray.call(panesClipRects, "base");
- disposeObjectsInArray.call(panesClipRects, "wide");
- that._panesClipRects = null
- },
- _correctAxes: function() {
- this._correctValueAxes(true)
- },
- _getExtraOptions: _common.noop,
- _cleanPanesClipRects: function(clipArrayName) {
- var that = this;
- var clipArray = that._panesClipRects[clipArrayName];
- (0, _iterator.each)(clipArray || [], function(_, clipRect) {
- clipRect && clipRect.dispose()
- });
- that._panesClipRects[clipArrayName] = []
- },
- _createPanes: function() {
- var that = this;
- var panes = that.option("panes");
- var panesNameCounter = 0;
- var defaultPane;
- if (!panes || _isArray(panes) && !panes.length) {
- panes = DEFAULT_PANES
- }
- that._cleanPanesClipRects("fixed");
- that._cleanPanesClipRects("base");
- that._cleanPanesClipRects("wide");
- defaultPane = that.option("defaultPane");
- panes = (0, _extend2.extend)(true, [], _isArray(panes) ? panes : [panes]);
- (0, _iterator.each)(panes, function(_, pane) {
- pane.name = !(0, _type.isDefined)(pane.name) ? DEFAULT_PANE_NAME + panesNameCounter++ : pane.name
- });
- if ((0, _type.isDefined)(defaultPane)) {
- if (!doesPaneExist(panes, defaultPane)) {
- that._incidentOccurred("W2101", [defaultPane]);
- defaultPane = panes[panes.length - 1].name
- }
- } else {
- defaultPane = panes[panes.length - 1].name
- }
- that.defaultPane = defaultPane;
- panes = that._isRotated() ? panes.reverse() : panes;
- return panes
- },
- _getAxisRenderingOptions: function() {
- return {
- axisType: "xyAxes",
- drawingType: "linear"
- }
- },
- _prepareAxisOptions: function(typeSelector, userOptions, rotated) {
- return {
- isHorizontal: "argumentAxis" === typeSelector !== rotated,
- containerColor: this._themeManager.getOptions("containerBackgroundColor")
- }
- },
- _checkPaneName: function(seriesTheme) {
- var paneList = (0, _utils.map)(this.panes, function(pane) {
- return pane.name
- });
- seriesTheme.pane = seriesTheme.pane || this.defaultPane;
- return (0, _array.inArray)(seriesTheme.pane, paneList) !== -1
- },
- _getValueAxis: function(paneName, axisName) {
- var that = this;
- var valueAxes = that._valueAxes;
- var valueAxisOptions = that.option("valueAxis") || {};
- var valueAxesOptions = _isArray(valueAxisOptions) ? valueAxisOptions : [valueAxisOptions];
- var rotated = that._isRotated();
- var crosshairMargins = that._getCrosshairMargins();
- var axisOptions;
- var axis;
- axisName = axisName || getFirstAxisNameForPane(valueAxes, paneName, that.defaultPane);
- axis = findAxis(paneName, axisName, valueAxes);
- if (!axis) {
- axisOptions = findAxisOptions(valueAxes, valueAxesOptions, axisName);
- if (!axisOptions) {
- that._incidentOccurred("W2102", [axisName]);
- axisOptions = {
- name: axisName,
- priority: valueAxes.length
- }
- }
- axis = that._createAxis(false, that._populateAxesOptions("valueAxis", axisOptions, {
- pane: paneName,
- name: axisName,
- optionPath: _isArray(valueAxisOptions) ? "valueAxis[".concat(axisOptions.priority, "]") : "valueAxis",
- crosshairMargin: rotated ? crosshairMargins.y : crosshairMargins.x
- }, rotated));
- axis.applyVisualRangeSetter(that._getVisualRangeSetter());
- valueAxes.push(axis)
- }
- axis.setPane(paneName);
- return axis
- },
- _correctValueAxes: function(needHideGrids) {
- var that = this;
- var synchronizeMultiAxes = that._themeManager.getOptions("synchronizeMultiAxes");
- var valueAxes = that._valueAxes;
- var paneWithAxis = {};
- that.series.forEach(function(series) {
- var axis = series.getValueAxis();
- paneWithAxis[axis.pane] = true
- });
- that.panes.forEach(function(pane) {
- var paneName = pane.name;
- if (!paneWithAxis[paneName]) {
- that._getValueAxis(paneName)
- }
- if (needHideGrids && synchronizeMultiAxes) {
- hideGridsOnNonFirstValueAxisForPane(valueAxes.filter(function(axis) {
- return axis.pane === paneName
- }))
- }
- });
- that._valueAxes = valueAxes.filter(function(axis) {
- if (!axis.pane) {
- axis.setPane(that.defaultPane)
- }
- return doesPaneExist(that.panes, axis.pane)
- }).sort(compareAxes);
- var defaultAxis = this.getValueAxis();
- that._valueAxes.forEach(function(axis) {
- var optionPath = axis.getOptions().optionPath;
- if (optionPath) {
- var axesWithSamePath = that._valueAxes.filter(function(a) {
- return a.getOptions().optionPath === optionPath
- });
- if (axesWithSamePath.length > 1) {
- if (axesWithSamePath.some(function(a) {
- return a === defaultAxis
- })) {
- axesWithSamePath.forEach(function(a) {
- if (a !== defaultAxis) {
- a.getOptions().optionPath = null
- }
- })
- } else {
- axesWithSamePath.forEach(function(a, i) {
- if (0 !== i) {
- a.getOptions().optionPath = null
- }
- })
- }
- }
- }
- })
- },
- _getSeriesForPane: function(paneName) {
- var paneSeries = [];
- (0, _iterator.each)(this.series, function(_, oneSeries) {
- if (oneSeries.pane === paneName) {
- paneSeries.push(oneSeries)
- }
- });
- return paneSeries
- },
- _createPanesBorderOptions: function() {
- var commonBorderOptions = this._themeManager.getOptions("commonPaneSettings").border;
- var panesBorderOptions = {};
- this.panes.forEach(function(pane) {
- return panesBorderOptions[pane.name] = (0, _extend2.extend)(true, {}, commonBorderOptions, pane.border)
- });
- return panesBorderOptions
- },
- _createScrollBar: function() {
- var that = this;
- var scrollBarOptions = that._themeManager.getOptions("scrollBar") || {};
- var scrollBarGroup = that._scrollBarGroup;
- if (scrollBarOptions.visible) {
- scrollBarOptions.rotated = that._isRotated();
- that._scrollBar = (that._scrollBar || new _scroll_bar2.default.ScrollBar(that._renderer, scrollBarGroup)).update(scrollBarOptions)
- } else {
- scrollBarGroup.linkRemove();
- that._scrollBar && that._scrollBar.dispose();
- that._scrollBar = null
- }
- },
- _prepareToRender: function(drawOptions) {
- var panesBorderOptions = this._createPanesBorderOptions();
- this._createPanesBackground();
- this._appendAxesGroups();
- this._adjustViewport();
- return panesBorderOptions
- },
- _adjustViewport: function() {
- var that = this;
- var series = that._getVisibleSeries();
- var argumentAxis = that.getArgumentAxis();
- var useAggregation = series.some(function(s) {
- return s.useAggregation()
- });
- var adjustOnZoom = that._themeManager.getOptions("adjustOnZoom");
- var alignToBounds = !argumentAxis.dataVisualRangeIsReduced();
- if (!useAggregation && !adjustOnZoom) {
- return
- }
- that._valueAxes.forEach(function(axis) {
- return axis.adjust(alignToBounds)
- })
- },
- _recreateSizeDependentObjects: function(isCanvasChanged) {
- var that = this;
- var series = that._getVisibleSeries();
- var useAggregation = series.some(function(s) {
- return s.useAggregation()
- });
- var zoomChanged = that._isZooming();
- if (!useAggregation) {
- return
- }
- that._argumentAxes.forEach(function(axis) {
- axis.updateCanvas(that._canvas)
- });
- series.forEach(function(series) {
- if (series.useAggregation() && (isCanvasChanged || zoomChanged || !series._useAllAggregatedPoints)) {
- series.createPoints()
- }
- });
- that._processSeriesFamilies()
- },
- _isZooming: function() {
- var that = this;
- var argumentAxis = that.getArgumentAxis();
- if (!argumentAxis || !argumentAxis.getTranslator()) {
- return false
- }
- var businessRange = argumentAxis.getTranslator().getBusinessRange();
- var zoomRange = argumentAxis.getViewport();
- var min = zoomRange ? zoomRange.min : 0;
- var max = zoomRange ? zoomRange.max : 0;
- if ("logarithmic" === businessRange.axisType) {
- min = (0, _utils.getLog)(min, businessRange.base);
- max = (0, _utils.getLog)(max, businessRange.base)
- }
- var viewportDistance = "discrete" === businessRange.axisType ? (0, _utils.getCategoriesInfo)(businessRange.categories, min, max).categories.length : Math.abs(max - min);
- var precision = (0, _math.getPrecision)(viewportDistance);
- precision = precision > 1 ? Math.pow(10, precision - 2) : 1;
- var zoomChanged = Math.round((that._zoomLength - viewportDistance) * precision) / precision !== 0;
- that._zoomLength = viewportDistance;
- return zoomChanged
- },
- _handleSeriesDataUpdated: function() {
- var that = this;
- var viewport = new _range2.default.Range;
- that.series.forEach(function(s) {
- viewport.addRange(s.getArgumentRange())
- });
- that._argumentAxes.forEach(function(axis) {
- axis.updateCanvas(that._canvas);
- axis.setBusinessRange(viewport, that._axesReinitialized)
- });
- that.callBase()
- },
- _isLegendInside: function() {
- return this._legend && "inside" === this._legend.getPosition()
- },
- _isRotated: function() {
- return this._themeManager.getOptions("rotated")
- },
- _getLayoutTargets: function() {
- return this.panes
- },
- _applyClipRects: function(panesBorderOptions) {
- var that = this;
- var canvasClipRectID = that._getCanvasClipRectID();
- var i;
- that._drawPanesBorders(panesBorderOptions);
- that._createClipRectsForPanes();
- for (i = 0; i < that._argumentAxes.length; i++) {
- that._argumentAxes[i].applyClipRects(that._getElementsClipRectID(that._argumentAxes[i].pane), canvasClipRectID)
- }
- for (i = 0; i < that._valueAxes.length; i++) {
- that._valueAxes[i].applyClipRects(that._getElementsClipRectID(that._valueAxes[i].pane), canvasClipRectID)
- }
- that._fillPanesBackground()
- },
- _updateLegendPosition: function(drawOptions, legendHasInsidePosition) {
- var that = this;
- if (drawOptions.drawLegend && that._legend && legendHasInsidePosition) {
- var panes = that.panes;
- var newCanvas = (0, _extend2.extend)({}, panes[0].canvas);
- var layoutManager = new _layout_manager2.default.LayoutManager;
- newCanvas.right = panes[panes.length - 1].canvas.right;
- newCanvas.bottom = panes[panes.length - 1].canvas.bottom;
- layoutManager.setOptions({
- width: 0,
- height: 0
- });
- layoutManager.layoutElements([that._legend], newCanvas, _common.noop, [{
- canvas: newCanvas
- }], void 0)
- }
- },
- _allowLegendInsidePosition: function() {
- return true
- },
- _applyExtraSettings: function(series) {
- var that = this;
- var paneIndex = that._getPaneIndex(series.pane);
- var panesClipRects = that._panesClipRects;
- var wideClipRect = panesClipRects.wide[paneIndex];
- series.setClippingParams(panesClipRects.base[paneIndex].id, wideClipRect && wideClipRect.id, that._getPaneBorderVisibility(paneIndex))
- },
- _updatePanesCanvases: function(drawOptions) {
- if (!drawOptions.recreateCanvas) {
- return
- }(0, _utils.updatePanesCanvases)(this.panes, this._canvas, this._isRotated())
- },
- _renderScaleBreaks: function() {
- this._valueAxes.concat(this._argumentAxes).forEach(function(axis) {
- axis.drawScaleBreaks()
- })
- },
- _applyPointMarkersAutoHiding: function() {
- var that = this;
- if (!that._themeManager.getOptions("autoHidePointMarkers")) {
- that.series.forEach(function(s) {
- return s.autoHidePointMarkers = false
- });
- return
- }
- that.panes.forEach(function(pane) {
- var series = that.series.filter(function(s) {
- return s.pane === pane.name && s.usePointsToDefineAutoHiding()
- });
- var argAxis = that.getArgumentAxis();
- var argVisualRange = argAxis.visualRange();
- var argTranslator = argAxis.getTranslator();
- var argAxisType = argAxis.getOptions().type;
- var argViewPortFilter = _range_data_calculator2.default.getViewPortFilter(argVisualRange || {});
- var points = [];
- var overloadedSeries = {};
- series.forEach(function(s) {
- var valAxis = s.getValueAxis();
- var valVisualRange = valAxis.visualRange();
- var valTranslator = valAxis.getTranslator();
- var seriesIndex = that.series.indexOf(s);
- var valViewPortFilter = _range_data_calculator2.default.getViewPortFilter(valVisualRange || {});
- overloadedSeries[seriesIndex] = {};
- series.forEach(function(sr) {
- return overloadedSeries[seriesIndex][that.series.indexOf(sr)] = 0
- });
- var seriesPoints = [];
- s.getPoints().filter(function(p) {
- return p.getOptions().visible && argViewPortFilter(p.argument) && (valViewPortFilter(p.getMinValue(true)) || valViewPortFilter(p.getMaxValue(true)))
- }).forEach(function(p) {
- var tp = {
- seriesIndex: seriesIndex,
- argument: p.argument,
- value: p.getMaxValue(true),
- size: p.bubbleSize || p.getOptions().size
- };
- if (p.getMinValue(true) !== p.getMaxValue(true)) {
- var mp = (0, _extend2.extend)({}, tp);
- mp.value = p.getMinValue(true);
- mp.x = argTranslator.to(mp.argument, 1);
- mp.y = valTranslator.to(mp.value, 1);
- seriesPoints.push(mp)
- }
- tp.x = argTranslator.to(tp.argument, 1);
- tp.y = valTranslator.to(tp.value, 1);
- seriesPoints.push(tp)
- });
- overloadedSeries[seriesIndex].pointsCount = seriesPoints.length;
- overloadedSeries[seriesIndex].total = 0;
- overloadedSeries[seriesIndex].continuousSeries = 0;
- points = points.concat(seriesPoints)
- });
- var sortingCallback = "discrete" === argAxisType ? function(p1, p2) {
- return argVisualRange.categories.indexOf(p1.argument) - argVisualRange.categories.indexOf(p2.argument)
- } : function(p1, p2) {
- return p1.argument - p2.argument
- };
- points.sort(sortingCallback);
- var isContinuousSeries = false;
- for (var i = 0; i < points.length - 1; i++) {
- var curPoint = points[i];
- var size = curPoint.size;
- if ((0, _type.isDefined)(curPoint.x) && (0, _type.isDefined)(curPoint.y)) {
- for (var j = i + 1; j < points.length; j++) {
- var nextPoint = points[j];
- var next_x = (0, _type.isDefined)(nextPoint) ? nextPoint.x : null;
- var next_y = (0, _type.isDefined)(nextPoint) ? nextPoint.y : null;
- if (!(0, _type.isDefined)(next_x) || Math.abs(curPoint.x - next_x) >= size) {
- isContinuousSeries &= j !== i + 1;
- break
- } else {
- var distance = (0, _type.isDefined)(next_x) && (0, _type.isDefined)(next_y) && Math.sqrt(Math.pow(curPoint.x - next_x, 2) + Math.pow(curPoint.y - next_y, 2));
- if (distance && distance < size) {
- overloadedSeries[curPoint.seriesIndex][nextPoint.seriesIndex]++;
- overloadedSeries[curPoint.seriesIndex].total++;
- if (!isContinuousSeries) {
- overloadedSeries[curPoint.seriesIndex].continuousSeries++;
- isContinuousSeries = true
- }
- }
- }
- }
- }
- }
- series.forEach(function(s) {
- var seriesIndex = that.series.indexOf(s);
- s.autoHidePointMarkers = false;
- var tickCount = argAxis.getTicksValues().majorTicksValues.length;
- if (s.autoHidePointMarkersEnabled() && ("discrete" === argAxisType || overloadedSeries[seriesIndex].pointsCount > tickCount)) {
- for (var index in overloadedSeries[seriesIndex]) {
- var _i = parseInt(index);
- if (isNaN(_i) || overloadedSeries[seriesIndex].total / overloadedSeries[seriesIndex].continuousSeries < 3) {
- continue
- }
- if (_i === seriesIndex) {
- if (2 * overloadedSeries[_i][_i] >= overloadedSeries[_i].pointsCount) {
- s.autoHidePointMarkers = true;
- break
- }
- } else {
- if (overloadedSeries[seriesIndex].total >= overloadedSeries[seriesIndex].pointsCount) {
- s.autoHidePointMarkers = true;
- break
- }
- }
- }
- }
- })
- })
- },
- _renderAxes: function(drawOptions, panesBorderOptions) {
- function calculateTitlesWidth(axes) {
- return axes.map(function(axis) {
- if (!axis.getTitle) {
- return 0
- }
- var title = axis.getTitle();
- return title ? title.bBox.width : 0
- })
- }
- var that = this;
- var rotated = that._isRotated();
- var synchronizeMultiAxes = that._themeManager.getOptions("synchronizeMultiAxes");
- var extendedArgAxes = (that._scrollBar ? [that._scrollBar] : []).concat(that._argumentAxes);
- var verticalAxes = rotated ? extendedArgAxes : that._valueAxes;
- var horizontalAxes = rotated ? that._valueAxes : extendedArgAxes;
- var allAxes = verticalAxes.concat(horizontalAxes);
- that._updatePanesCanvases(drawOptions);
- var panesCanvases = that.panes.reduce(function(canvases, pane) {
- canvases[pane.name] = (0, _extend2.extend)({}, pane.canvas);
- return canvases
- }, {});
- var cleanPanesCanvases = (0, _extend2.extend)(true, {}, panesCanvases);
- if (!drawOptions.adjustAxes) {
- drawAxesWithTicks(verticalAxes, !rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
- drawAxesWithTicks(horizontalAxes, rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
- performActionOnAxes(allAxes, "prepareAnimation");
- that._renderScaleBreaks();
- return false
- }
- if (that._scrollBar) {
- that._scrollBar.setPane(that.panes)
- }
- var vAxesMargins = {
- panes: {}
- };
- var hAxesMargins = getHorizontalAxesMargins(horizontalAxes, function(axis) {
- return axis.estimateMargins(panesCanvases[axis.pane])
- });
- panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
- drawAxesWithTicks(verticalAxes, !rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
- vAxesMargins = getVerticalAxesMargins(verticalAxes);
- panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
- drawAxesWithTicks(horizontalAxes, rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
- hAxesMargins = getHorizontalAxesMargins(horizontalAxes, getAxisMargins);
- panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
- var oldTitlesWidth = calculateTitlesWidth(verticalAxes);
- performActionOnAxes(allAxes, "updateSize", panesCanvases, axisAnimationEnabled(drawOptions, that._getVisibleSeries()));
- horizontalAxes.forEach(shiftAxis("top", "bottom"));
- verticalAxes.forEach(shiftAxis("left", "right"));
- that._renderScaleBreaks();
- that.panes.forEach(function(pane) {
- (0, _extend2.extend)(pane.canvas, panesCanvases[pane.name])
- });
- that._valueAxes.forEach(function(axis) {
- axis.setInitRange()
- });
- verticalAxes.forEach(function(axis, i) {
- if (axis.hasWrap && axis.hasWrap()) {
- var title = axis.getTitle();
- var newTitleWidth = title ? title.bBox.width : 0;
- var offset = newTitleWidth - oldTitlesWidth[i];
- if ("right" === axis.getOptions().position) {
- vAxesMargins.right += offset
- } else {
- vAxesMargins.left += offset;
- that.panes.forEach(function(_ref) {
- var name = _ref.name;
- return vAxesMargins.panes[name].left += offset
- })
- }
- panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
- performActionOnAxes(allAxes, "updateSize", panesCanvases, false, false);
- oldTitlesWidth = calculateTitlesWidth(verticalAxes)
- }
- });
- return cleanPanesCanvases
- },
- _shrinkAxes: function(sizeShortage, panesCanvases) {
- if (!sizeShortage || !panesCanvases) {
- return
- }
- this._renderer.stopAllAnimations(true);
- var that = this;
- var rotated = that._isRotated();
- var extendedArgAxes = (that._scrollBar ? [that._scrollBar] : []).concat(that._argumentAxes);
- var verticalAxes = rotated ? extendedArgAxes : that._valueAxes;
- var horizontalAxes = rotated ? that._valueAxes : extendedArgAxes;
- var allAxes = verticalAxes.concat(horizontalAxes);
- if (sizeShortage.width || sizeShortage.height) {
- checkUsedSpace(sizeShortage, "height", horizontalAxes, getHorizontalAxesMargins);
- checkUsedSpace(sizeShortage, "width", verticalAxes, getVerticalAxesMargins);
- performActionOnAxes(allAxes, "updateSize", panesCanvases);
- panesCanvases = shrinkCanvases(rotated, panesCanvases, getVerticalAxesMargins(verticalAxes), getHorizontalAxesMargins(horizontalAxes, getAxisMargins));
- performActionOnAxes(allAxes, "updateSize", panesCanvases);
- horizontalAxes.forEach(shiftAxis("top", "bottom"));
- verticalAxes.forEach(shiftAxis("left", "right"));
- that.panes.forEach(function(pane) {
- (0, _extend2.extend)(pane.canvas, panesCanvases[pane.name])
- })
- }
- },
- _getPanesParameters: function() {
- var that = this;
- var panes = that.panes;
- var params = [];
- for (var i = 0; i < panes.length; i++) {
- if (that._getPaneBorderVisibility(i)) {
- params.push({
- coords: panes[i].borderCoords,
- clipRect: that._panesClipRects.fixed[i]
- })
- }
- }
- return params
- },
- _createCrosshairCursor: function() {
- var that = this;
- var options = that._themeManager.getOptions("crosshair") || {};
- var argumentAxis = that.getArgumentAxis();
- var axes = !that._isRotated() ? [
- [argumentAxis], that._valueAxes
- ] : [that._valueAxes, [argumentAxis]];
- var parameters = {
- canvas: that._getCommonCanvas(),
- panes: that._getPanesParameters(),
- axes: axes
- };
- if (!options || !options.enabled) {
- return
- }
- if (!that._crosshair) {
- that._crosshair = new _crosshair2.default.Crosshair(that._renderer, options, parameters, that._crosshairCursorGroup)
- } else {
- that._crosshair.update(options, parameters)
- }
- that._crosshair.render()
- },
- _getCommonCanvas: function() {
- var commonCanvas;
- var panes = this.panes;
- for (var i = 0; i < panes.length; i++) {
- var canvas = panes[i].canvas;
- if (!commonCanvas) {
- commonCanvas = (0, _extend2.extend)({}, canvas)
- } else {
- commonCanvas.right = canvas.right;
- commonCanvas.bottom = canvas.bottom
- }
- }
- return commonCanvas
- },
- _createPanesBackground: function() {
- var that = this;
- var defaultBackgroundColor = that._themeManager.getOptions("commonPaneSettings").backgroundColor;
- var renderer = that._renderer;
- var rects = [];
- that._panesBackgroundGroup.clear();
- for (var i = 0; i < that.panes.length; i++) {
- var backgroundColor = that.panes[i].backgroundColor || defaultBackgroundColor;
- if (!backgroundColor || "none" === backgroundColor) {
- rects.push(null);
- continue
- }
- var rect = renderer.rect(0, 0, 0, 0).attr({
- fill: backgroundColor,
- "stroke-width": 0
- }).append(that._panesBackgroundGroup);
- rects.push(rect)
- }
- that.panesBackground = rects
- },
- _fillPanesBackground: function() {
- var that = this;
- (0, _iterator.each)(that.panes, function(i, pane) {
- var bc = pane.borderCoords;
- if (null !== that.panesBackground[i]) {
- that.panesBackground[i].attr({
- x: bc.left,
- y: bc.top,
- width: bc.width,
- height: bc.height
- })
- }
- })
- },
- _calcPaneBorderCoords: function(pane) {
- var canvas = pane.canvas;
- var bc = pane.borderCoords = pane.borderCoords || {};
- bc.left = canvas.left;
- bc.top = canvas.top;
- bc.right = canvas.width - canvas.right;
- bc.bottom = canvas.height - canvas.bottom;
- bc.width = Math.max(bc.right - bc.left, 0);
- bc.height = Math.max(bc.bottom - bc.top, 0)
- },
- _drawPanesBorders: function(panesBorderOptions) {
- var that = this;
- var rotated = that._isRotated();
- that._panesBorderGroup.linkRemove().clear();
- (0, _iterator.each)(that.panes, function(i, pane) {
- var borderOptions = panesBorderOptions[pane.name];
- var attr = {
- fill: "none",
- stroke: borderOptions.color,
- "stroke-opacity": borderOptions.opacity,
- "stroke-width": borderOptions.width,
- dashStyle: borderOptions.dashStyle,
- "stroke-linecap": "square"
- };
- that._calcPaneBorderCoords(pane, rotated);
- if (!borderOptions.visible) {
- return
- }
- var bc = pane.borderCoords;
- var segmentRectParams = prepareSegmentRectPoints(bc.left, bc.top, bc.width, bc.height, borderOptions);
- that._renderer.path(segmentRectParams.points, segmentRectParams.pathType).attr(attr).append(that._panesBorderGroup)
- });
- that._panesBorderGroup.linkAppend()
- },
- _createClipRect: function(clipArray, index, left, top, width, height) {
- var that = this;
- var clipRect = clipArray[index];
- if (!clipRect) {
- clipRect = that._renderer.clipRect(left, top, width, height);
- clipArray[index] = clipRect
- } else {
- clipRect.attr({
- x: left,
- y: top,
- width: width,
- height: height
- })
- }
- },
- _createClipRectsForPanes: function() {
- var that = this;
- var canvas = that._canvas;
- (0, _iterator.each)(that.panes, function(i, pane) {
- var needWideClipRect = false;
- var bc = pane.borderCoords;
- var left = bc.left;
- var top = bc.top;
- var width = bc.width;
- var height = bc.height;
- var panesClipRects = that._panesClipRects;
- that._createClipRect(panesClipRects.fixed, i, left, top, width, height);
- that._createClipRect(panesClipRects.base, i, left, top, width, height);
- (0, _iterator.each)(that.series, function(_, series) {
- if (series.pane === pane.name && (series.isFinancialSeries() || series.areErrorBarsVisible())) {
- needWideClipRect = true
- }
- });
- if (needWideClipRect) {
- if (that._isRotated()) {
- top = 0;
- height = canvas.height
- } else {
- left = 0;
- width = canvas.width
- }
- that._createClipRect(panesClipRects.wide, i, left, top, width, height)
- } else {
- panesClipRects.wide[i] = null
- }
- })
- },
- _getPaneIndex: function(paneName) {
- var paneIndex;
- (0, _iterator.each)(this.panes, function(index, pane) {
- if (pane.name === paneName) {
- paneIndex = index;
- return false
- }
- });
- return paneIndex
- },
- _getPaneBorderVisibility: function(paneIndex) {
- var commonPaneBorderVisible = this._themeManager.getOptions("commonPaneSettings").border.visible;
- var pane = this.panes[paneIndex] || {};
- var paneBorder = pane.border || {};
- return "visible" in paneBorder ? paneBorder.visible : commonPaneBorderVisible
- },
- _getElementsClipRectID: function(paneName) {
- return this._panesClipRects.fixed[this._getPaneIndex(paneName)].id
- },
- _getCanvasForPane: function(paneName) {
- var panes = this.panes;
- var panesNumber = panes.length;
- for (var i = 0; i < panesNumber; i++) {
- if (panes[i].name === paneName) {
- return panes[i].canvas
- }
- }
- },
- _getTrackerSettings: function() {
- var that = this;
- var themeManager = that._themeManager;
- return (0, _extend2.extend)(this.callBase(), {
- chart: that,
- rotated: that._isRotated(),
- crosshair: that._getCrosshairOptions().enabled ? that._crosshair : null,
- stickyHovering: themeManager.getOptions("stickyHovering")
- })
- },
- _resolveLabelOverlappingStack: function() {
- var that = this;
- var isRotated = that._isRotated();
- var shiftDirection = isRotated ? function(box, length) {
- return {
- x: box.x - length,
- y: box.y
- }
- } : function(box, length) {
- return {
- x: box.x,
- y: box.y - length
- }
- };
- (0, _iterator.each)(that._getStackPoints(), function(_, stacks) {
- (0, _iterator.each)(stacks, function(_, points) {
- _base_chart.overlapping.resolveLabelOverlappingInOneDirection(points, that._getCommonCanvas(), isRotated, shiftDirection, function(a, b) {
- var coordPosition = isRotated ? 1 : 0;
- var figureCenter1 = a.labels[0].getFigureCenter()[coordPosition];
- var figureCenter12 = b.labels[0].getFigureCenter()[coordPosition];
- if (figureCenter1 - figureCenter12 === 0) {
- return (a.value() - b.value()) * (a.labels[0].getPoint().series.getValueAxis().getTranslator().isInverted() ? -1 : 1)
- }
- return 0
- })
- })
- })
- },
- _getStackPoints: function() {
- var stackPoints = {};
- var visibleSeries = this._getVisibleSeries();
- (0, _iterator.each)(visibleSeries, function(_, singleSeries) {
- var points = singleSeries.getPoints();
- var stackName = singleSeries.getStackName() || null;
- (0, _iterator.each)(points, function(_, point) {
- var argument = point.argument;
- if (!stackPoints[argument]) {
- stackPoints[argument] = {}
- }
- if (!stackPoints[argument][stackName]) {
- stackPoints[argument][stackName] = []
- }
- stackPoints[argument][stackName].push(point)
- })
- });
- return stackPoints
- },
- _getCrosshairOptions: function() {
- return this._getOption("crosshair")
- },
- _parseVisualRangeOption: function(fullName, value) {
- var that = this;
- var name = fullName.split(/[.[]/)[0];
- var index = fullName.match(/\d+/g);
- if (fullName.indexOf("visualRange") > 0) {
- that._setCustomVisualRange("argumentAxis" === name, (0, _type.isDefined)(index) ? parseInt(index[0]) : index, value)
- } else {
- if (("object" === (0, _type.type)(value) || "array" === (0, _type.type)(value)) && name.indexOf("Axis") > 0 && JSON.stringify(value).indexOf("visualRange") > 0) {
- if ((0, _type.isDefined)(value.visualRange)) {
- that._setCustomVisualRange("argumentAxis" === name, (0, _type.isDefined)(index) ? parseInt(index[0]) : index, value.visualRange)
- } else {
- if (_isArray(value)) {
- value.forEach(function(a, i) {
- return that._setCustomVisualRange("argumentAxis" === name, i, a.visualRange)
- })
- }
- }
- }
- }
- },
- _setCustomVisualRange: function(isArgumentAxis, index, value) {
- var that = this;
- var axesName = isArgumentAxis ? "argumentAxis" : "valueAxis";
- var options = that._options[axesName];
- if (!options) {
- return
- }
- if (isArgumentAxis || !(0, _type.isDefined)(index)) {
- options._customVisualRange = value
- } else {
- options[index]._customVisualRange = value
- }
- that._axesReinitialized = true
- },
- zoomArgument: function(min, max) {
- var that = this;
- if (!that._initialized || !(0, _type.isDefined)(min) && !(0, _type.isDefined)(max)) {
- return
- }
- that.getArgumentAxis().visualRange([min, max])
- },
- resetVisualRange: function() {
- var that = this;
- that._argumentAxes.forEach(function(axis) {
- axis.resetVisualRange(that.getArgumentAxis() !== axis)
- });
- that._valueAxes.forEach(function(axis) {
- return axis.resetVisualRange(false)
- });
- that._requestChange([VISUAL_RANGE])
- },
- _getVisualRangeSetter: function() {
- var chart = this;
- return function(axis, _ref2) {
- var skipEventRising = _ref2.skipEventRising,
- range = _ref2.range;
- if (axis.getOptions().optionPath) {
- chart._parseVisualRangeOption(axis.getOptions().optionPath + ".visualRange", range);
- axis.setCustomVisualRange(range)
- }
- axis.skipEventRising = skipEventRising;
- if (axis.isArgumentAxis) {
- if (axis !== chart.getArgumentAxis()) {
- return
- }
- chart._argumentAxes.filter(function(a) {
- return a !== axis
- }).forEach(function(a) {
- return a.visualRange(range, {
- start: true,
- end: true
- })
- })
- }
- if (chart._applyingChanges) {
- chart._change_VISUAL_RANGE()
- } else {
- chart._requestChange([VISUAL_RANGE])
- }
- }
- },
- getVisibleArgumentBounds: function() {
- var translator = this._argumentAxes[0].getTranslator();
- var range = translator.getBusinessRange();
- var isDiscrete = "discrete" === range.axisType;
- var categories = range.categories;
- return {
- minVisible: isDiscrete ? range.minVisible || categories[0] : range.minVisible,
- maxVisible: isDiscrete ? range.maxVisible || categories[categories.length - 1] : range.maxVisible
- }
- },
- _change_VISUAL_RANGE: function() {
- var that = this;
- that._recreateSizeDependentObjects(false);
- if (!that._changes.has("FULL_RENDER")) {
- that._doRender({
- force: true,
- drawTitle: false,
- drawLegend: false,
- adjustAxes: this.option("adjustAxesOnZoom") || false,
- animate: false
- });
- that._raiseZoomEndHandlers()
- }
- },
- _change_FULL_RENDER: function() {
- this.callBase();
- if (this._changes.has(VISUAL_RANGE)) {
- this._raiseZoomEndHandlers()
- }
- },
- _raiseZoomEndHandlers: function() {
- this._argumentAxes.forEach(function(axis) {
- return axis.handleZoomEnd()
- });
- this._valueAxes.forEach(function(axis) {
- return axis.handleZoomEnd()
- })
- },
- _notifyOptionChanged: function(option, value, previousValue) {
- this.callBase.apply(this, arguments);
- if (!this._optionChangedLocker) {
- this._parseVisualRangeOption(option, value)
- }
- },
- _setOptionsByReference: function() {
- this.callBase();
- (0, _extend2.extend)(this._optionsByReference, {
- "argumentAxis.visualRange": true,
- "valueAxis.visualRange": true
- })
- },
- option: function option() {
- var option = this.callBase.apply(this, arguments);
- if ("array" === (0, _type.type)(this._options.valueAxis)) {
- for (var i = 0; i < this._options.valueAxis.length; i++) {
- var optionPath = "valueAxis[".concat(i, "].visualRange");
- this._optionsByReference[optionPath] = true
- }
- }
- return option
- },
- _optionChanged: function(arg) {
- var that = this;
- if (!that._optionChangedLocker) {
- if (arg.fullName.indexOf("visualRange") > 0) {
- var axisPath;
- if (arg.fullName) {
- axisPath = arg.fullName.slice(0, arg.fullName.indexOf("."))
- }
- var visualRange = arg.value;
- var options = {
- skipEventRising: true
- };
- var pathElements = arg.fullName.split(".");
- var destElem = pathElements[pathElements.length - 1];
- if ("endValue" === destElem || "startValue" === destElem) {
- options = {
- allowPartialUpdate: true
- };
- visualRange = _defineProperty({}, destElem, arg.value)
- }
- var axis = [that.getArgumentAxis()].concat(that._valueAxes).filter(function(a) {
- return a.getOptions().optionPath === axisPath
- })[0];
- if (axis) {
- axis.visualRange(visualRange, options)
- }
- } else {
- if (that.getPartialChangeOptionsName(arg).indexOf("visualRange") > -1) {
- if ("argumentAxis" === arg.name) {
- that.getArgumentAxis().visualRange(arg.value.visualRange)
- } else {
- if ("valueAxis" === arg.name) {
- if ("object" === (0, _type.type)(arg.value)) {
- that._valueAxes[0].visualRange(arg.value.visualRange)
- } else {
- arg.value.forEach(function(v, index) {
- if ((0, _type.isDefined)(v.visualRange) && (0, _type.isDefined)(that._valueAxes[index])) {
- that._valueAxes[index].visualRange(arg.value[index].visualRange)
- }
- })
- }
- }
- }
- }
- }
- }
- that.callBase(arg)
- },
- _notify: function() {
- var that = this;
- that.callBase();
- if (true === that.option("disableTwoWayBinding")) {
- return
- }
- var argumentVisualRange = (0, _utils.convertVisualRangeObject)(this._argumentAxes[0].visualRange(), !_isArray(that.option("argumentAxis.visualRange")));
- if (!this._argumentAxes[0].skipEventRising || !rangesAreEqual(argumentVisualRange, that.option("argumentAxis.visualRange"))) {
- that.option("argumentAxis.visualRange", argumentVisualRange)
- } else {
- this._argumentAxes[0].skipEventRising = null
- }
- that._valueAxes.forEach(function(axis) {
- if (axis.getOptions().optionPath) {
- var path = "".concat(axis.getOptions().optionPath, ".visualRange");
- var visualRange = (0, _utils.convertVisualRangeObject)(axis.visualRange(), !_isArray(that.option(path)));
- if (!axis.skipEventRising || !rangesAreEqual(visualRange, that.option(path))) {
- that.option(path, visualRange)
- } else {
- axis.skipEventRising = null
- }
- }
- })
- }
- });
- function rangesAreEqual(range, rangeFromOptions) {
- if (_isArray(rangeFromOptions)) {
- return range.length === rangeFromOptions.length && range.every(function(item, i) {
- return item === rangeFromOptions[i]
- })
- } else {
- return range.startValue === rangeFromOptions.startValue && range.endValue === rangeFromOptions.endValue
- }
- }
- dxChart.addPlugin(__webpack_require__( /*! ./chart_components/shutter_zoom */ 788));
- dxChart.addPlugin(__webpack_require__( /*! ./chart_components/zoom_and_pan */ 789));
- dxChart.addPlugin(__webpack_require__( /*! ./core/annotations */ 411).plugins.core);
- dxChart.addPlugin(__webpack_require__( /*! ./core/annotations */ 411).plugins.chart);
- (0, _component_registrator2.default)("dxChart", dxChart);
- module.exports = dxChart;
- module.exports._test_prepareSegmentRectPoints = function() {
- var original = prepareSegmentRectPoints.original || prepareSegmentRectPoints;
- if (arguments[0]) {
- prepareSegmentRectPoints = arguments[0]
- }
- prepareSegmentRectPoints.original = original;
- prepareSegmentRectPoints.restore = function() {
- prepareSegmentRectPoints = original
- };
- return prepareSegmentRectPoints
- }
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.light.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var WHITE = "#ffffff";
- var BLACK = "#000000";
- var LIGHT_GREY = "#d3d3d3";
- var GREY_GREEN = "#303030";
- var SOME_GREY = "#2b2b2b";
- var RED = "#ff0000";
- var PRIMARY_TITLE_COLOR = "#232323";
- var SECONDARY_TITLE_COLOR = "#767676";
- var NONE = "none";
- var SOLID = "solid";
- var TOP = "top";
- var RIGHT = "right";
- var BOTTOM = "bottom";
- var LEFT = "left";
- var CENTER = "center";
- var INSIDE = "inside";
- var OUTSIDE = "outside";
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- registerTheme({
- name: "generic.light",
- isDefault: true,
- font: {
- color: SECONDARY_TITLE_COLOR,
- family: "'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif",
- weight: 400,
- size: 12,
- cursor: "default"
- },
- redrawOnResize: true,
- backgroundColor: WHITE,
- primaryTitleColor: PRIMARY_TITLE_COLOR,
- secondaryTitleColor: SECONDARY_TITLE_COLOR,
- gridColor: LIGHT_GREY,
- axisColor: SECONDARY_TITLE_COLOR,
- title: {
- backgroundColor: WHITE,
- font: {
- size: 28,
- family: "'Segoe UI Light', 'Helvetica Neue Light', 'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif",
- weight: 200
- },
- subtitle: {
- font: {
- size: 16
- },
- offset: 0,
- wordWrap: "normal",
- textOverflow: "ellipsis"
- },
- wordWrap: "normal",
- textOverflow: "ellipsis"
- },
- loadingIndicator: {
- text: "Loading..."
- },
- "export": {
- backgroundColor: WHITE,
- margin: 10,
- font: {
- size: 14,
- color: PRIMARY_TITLE_COLOR,
- weight: 400
- },
- button: {
- margin: {
- top: 8,
- left: 10,
- right: 10,
- bottom: 8
- },
- "default": {
- color: "#333",
- borderColor: "#ddd",
- backgroundColor: WHITE
- },
- hover: {
- color: "#333",
- borderColor: "#bebebe",
- backgroundColor: "#e6e6e6"
- },
- focus: {
- color: BLACK,
- borderColor: "#9d9d9d",
- backgroundColor: "#e6e6e6"
- },
- active: {
- color: "#333",
- borderColor: "#9d9d9d",
- backgroundColor: "#d4d4d4"
- }
- },
- shadowColor: LIGHT_GREY
- },
- tooltip: {
- enabled: false,
- border: {
- width: 1,
- color: LIGHT_GREY,
- dashStyle: SOLID,
- visible: true
- },
- font: {
- color: PRIMARY_TITLE_COLOR
- },
- color: WHITE,
- arrowLength: 10,
- paddingLeftRight: 18,
- paddingTopBottom: 15,
- textAlignment: "center",
- shared: false,
- location: CENTER,
- shadow: {
- opacity: .4,
- offsetX: 0,
- offsetY: 4,
- blur: 2,
- color: BLACK
- }
- },
- legend: {
- hoverMode: "includePoints",
- verticalAlignment: TOP,
- horizontalAlignment: RIGHT,
- position: OUTSIDE,
- visible: true,
- margin: 10,
- markerSize: 12,
- border: {
- visible: false,
- width: 1,
- cornerRadius: 0,
- dashStyle: SOLID
- },
- paddingLeftRight: 20,
- paddingTopBottom: 15,
- columnCount: 0,
- rowCount: 0,
- columnItemSpacing: 20,
- rowItemSpacing: 8,
- title: {
- backgroundColor: WHITE,
- margin: {
- left: 0,
- bottom: 9,
- right: 0,
- top: 0
- },
- font: {
- size: 18,
- weight: 200
- },
- subtitle: {
- offset: 0,
- font: {
- size: 14
- },
- wordWrap: "none",
- textOverflow: "ellipsis"
- },
- wordWrap: "none",
- textOverflow: "ellipsis"
- }
- },
- "chart:common": {
- animation: {
- enabled: true,
- duration: 1e3,
- easing: "easeOutCubic",
- maxPointCountSupported: 300
- },
- commonSeriesSettings: {
- border: {
- visible: false,
- width: 2
- },
- showInLegend: true,
- visible: true,
- hoverMode: "nearestPoint",
- selectionMode: "includePoints",
- hoverStyle: {
- hatching: {
- direction: RIGHT,
- width: 2,
- step: 6,
- opacity: .75
- },
- border: {
- visible: false,
- width: 3
- }
- },
- selectionStyle: {
- hatching: {
- direction: RIGHT,
- width: 2,
- step: 6,
- opacity: .5
- },
- border: {
- visible: false,
- width: 3
- }
- },
- valueErrorBar: {
- displayMode: "auto",
- value: 1,
- color: BLACK,
- lineWidth: 2,
- edgeLength: 8
- },
- label: {
- visible: false,
- alignment: CENTER,
- rotationAngle: 0,
- horizontalOffset: 0,
- verticalOffset: 0,
- radialOffset: 0,
- showForZeroValues: true,
- customizeText: void 0,
- maxLabelCount: void 0,
- position: OUTSIDE,
- font: {
- color: WHITE
- },
- border: {
- visible: false,
- width: 1,
- color: LIGHT_GREY,
- dashStyle: SOLID
- },
- connector: {
- visible: false,
- width: 1
- }
- }
- },
- seriesSelectionMode: "single",
- pointSelectionMode: "single",
- equalRowHeight: true,
- dataPrepareSettings: {
- checkTypeForAllData: false,
- convertToAxisDataType: true,
- sortingMethod: true
- },
- title: {
- margin: 10
- },
- adaptiveLayout: {
- width: 80,
- height: 80,
- keepLabels: true
- },
- _rtl: {
- legend: {
- itemTextPosition: LEFT
- }
- },
- resolveLabelOverlapping: NONE
- },
- "chart:common:axis": {
- visible: true,
- valueMarginsEnabled: true,
- placeholderSize: null,
- logarithmBase: 10,
- discreteAxisDivisionMode: "betweenLabels",
- width: 1,
- label: {
- visible: true
- },
- grid: {
- visible: false,
- width: 1
- },
- minorGrid: {
- visible: false,
- width: 1,
- opacity: .3
- },
- tick: {
- visible: true,
- width: 1,
- length: 7,
- shift: 3
- },
- minorTick: {
- visible: false,
- width: 1,
- opacity: .3,
- length: 7,
- shift: 3
- },
- stripStyle: {
- paddingLeftRight: 10,
- paddingTopBottom: 5
- },
- constantLineStyle: {
- width: 1,
- color: BLACK,
- dashStyle: SOLID,
- label: {
- visible: true,
- position: INSIDE
- }
- },
- marker: {
- label: {}
- }
- },
- chart: {
- commonSeriesSettings: {
- type: "line",
- stack: "default",
- aggregation: {
- enabled: void 0
- },
- point: {
- visible: true,
- symbol: "circle",
- size: 12,
- border: {
- visible: false,
- width: 1
- },
- hoverMode: "onlyPoint",
- selectionMode: "onlyPoint",
- hoverStyle: {
- border: {
- visible: true,
- width: 4
- }
- },
- selectionStyle: {
- border: {
- visible: true,
- width: 4
- }
- }
- },
- scatter: {},
- line: {
- width: 2,
- dashStyle: SOLID,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- stackedline: {
- width: 2,
- dashStyle: SOLID,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- stackedspline: {
- width: 2,
- dashStyle: SOLID,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- fullstackedline: {
- width: 2,
- dashStyle: SOLID,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- fullstackedspline: {
- width: 2,
- dashStyle: SOLID,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- stepline: {
- width: 2,
- dashStyle: SOLID,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- area: {
- point: {
- visible: false
- },
- opacity: .5
- },
- stackedarea: {
- point: {
- visible: false
- },
- opacity: .5
- },
- fullstackedarea: {
- point: {
- visible: false
- },
- opacity: .5
- },
- fullstackedsplinearea: {
- point: {
- visible: false
- },
- opacity: .5
- },
- steparea: {
- border: {
- visible: true,
- width: 2
- },
- point: {
- visible: false
- },
- hoverStyle: {
- border: {
- visible: true,
- width: 3
- }
- },
- selectionStyle: {
- border: {
- visible: true,
- width: 3
- }
- },
- opacity: .5
- },
- spline: {
- width: 2,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- splinearea: {
- point: {
- visible: false
- },
- opacity: .5
- },
- stackedsplinearea: {
- point: {
- visible: false
- },
- opacity: .5
- },
- bar: {
- cornerRadius: 0,
- point: {
- hoverStyle: {
- border: {
- visible: false
- }
- },
- selectionStyle: {
- border: {
- visible: false
- }
- }
- }
- },
- stackedbar: {
- cornerRadius: 0,
- point: {
- hoverStyle: {
- border: {
- visible: false
- }
- },
- selectionStyle: {
- border: {
- visible: false
- }
- }
- },
- label: {
- position: INSIDE
- }
- },
- fullstackedbar: {
- cornerRadius: 0,
- point: {
- hoverStyle: {
- border: {
- visible: false
- }
- },
- selectionStyle: {
- border: {
- visible: false
- }
- }
- },
- label: {
- position: INSIDE
- }
- },
- rangebar: {
- cornerRadius: 0,
- point: {
- hoverStyle: {
- border: {
- visible: false
- }
- },
- selectionStyle: {
- border: {
- visible: false
- }
- }
- }
- },
- rangearea: {
- point: {
- visible: false
- },
- opacity: .5
- },
- rangesplinearea: {
- point: {
- visible: false
- },
- opacity: .5
- },
- bubble: {
- opacity: .5,
- point: {
- hoverStyle: {
- border: {
- visible: false
- }
- },
- selectionStyle: {
- border: {
- visible: false
- }
- }
- }
- },
- candlestick: {
- width: 1,
- reduction: {
- color: RED
- },
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- },
- point: {
- border: {
- visible: true
- }
- }
- },
- stock: {
- width: 1,
- reduction: {
- color: RED
- },
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- },
- point: {
- border: {
- visible: true
- }
- }
- }
- },
- crosshair: {
- enabled: false,
- color: "#f05b41",
- width: 1,
- dashStyle: SOLID,
- label: {
- visible: false,
- font: {
- color: WHITE,
- size: 12
- }
- },
- verticalLine: {
- visible: true
- },
- horizontalLine: {
- visible: true
- }
- },
- commonAxisSettings: {
- multipleAxesSpacing: 5,
- forceUserTickInterval: false,
- breakStyle: {
- width: 5,
- color: "#ababab",
- line: "waved"
- },
- label: {
- displayMode: "standard",
- overlappingBehavior: "hide",
- indentFromAxis: 10,
- wordWrap: "normal",
- textOverflow: "none"
- },
- title: {
- font: {
- size: 16
- },
- margin: 6,
- alignment: CENTER
- },
- constantLineStyle: {
- paddingLeftRight: 10,
- paddingTopBottom: 10
- }
- },
- horizontalAxis: {
- position: BOTTOM,
- axisDivisionFactor: 70,
- label: {
- rotationAngle: 90,
- staggeringSpacing: 5,
- alignment: CENTER
- },
- stripStyle: {
- label: {
- horizontalAlignment: CENTER,
- verticalAlignment: TOP
- }
- },
- constantLineStyle: {
- label: {
- horizontalAlignment: RIGHT,
- verticalAlignment: TOP
- }
- },
- constantLines: []
- },
- verticalAxis: {
- position: LEFT,
- axisDivisionFactor: 40,
- label: {
- alignment: RIGHT
- },
- stripStyle: {
- label: {
- horizontalAlignment: LEFT,
- verticalAlignment: CENTER
- }
- },
- constantLineStyle: {
- label: {
- horizontalAlignment: LEFT,
- verticalAlignment: TOP
- }
- },
- constantLines: []
- },
- argumentAxis: {
- endOnTick: false,
- workWeek: [1, 2, 3, 4, 5]
- },
- valueAxis: {
- grid: {
- visible: true
- },
- autoBreaksEnabled: false,
- maxAutoBreakCount: 4
- },
- commonPaneSettings: {
- backgroundColor: NONE,
- border: {
- color: LIGHT_GREY,
- width: 1,
- visible: false,
- top: true,
- bottom: true,
- left: true,
- right: true,
- dashStyle: SOLID
- }
- },
- scrollBar: {
- visible: false,
- offset: 5,
- color: "gray",
- width: 10
- },
- adjustOnZoom: true,
- autoHidePointMarkers: true,
- rotated: false,
- zoomingMode: NONE,
- scrollingMode: NONE,
- synchronizeMultiAxes: true,
- stickyHovering: true,
- equalBarWidth: true,
- barGroupPadding: .3,
- minBubbleSize: 12,
- maxBubbleSize: .2,
- zoomAndPan: {
- dragBoxStyle: {
- color: "#2a2a2a",
- opacity: .2
- },
- panKey: "shift",
- allowMouseWheel: true,
- allowTouchGestures: true
- },
- commonAnnotationSettings: {
- font: {
- color: "#333333"
- },
- tooltipEnabled: true,
- border: {
- width: 1,
- color: "#dddddd",
- dashStyle: SOLID,
- visible: true
- },
- color: WHITE,
- opacity: .9,
- arrowLength: 14,
- arrowWidth: 14,
- paddingLeftRight: 10,
- paddingTopBottom: 10,
- shadow: {
- opacity: .15,
- offsetX: 0,
- offsetY: 1,
- blur: 4,
- color: BLACK
- },
- image: {
- width: 30,
- height: 30
- },
- wordWrap: "normal",
- textOverflow: "ellipsis",
- allowDragging: false
- }
- },
- pie: {
- innerRadius: .5,
- minDiameter: .5,
- type: "pie",
- dataPrepareSettings: {
- _skipArgumentSorting: true
- },
- commonSeriesSettings: {
- pie: {
- border: {
- visible: false,
- width: 2,
- color: WHITE
- },
- hoverStyle: {
- hatching: {
- direction: RIGHT,
- width: 4,
- step: 10,
- opacity: .75
- },
- border: {
- visible: false,
- width: 2
- }
- },
- selectionStyle: {
- hatching: {
- direction: RIGHT,
- width: 4,
- step: 10,
- opacity: .5
- },
- border: {
- visible: false,
- width: 2
- }
- }
- },
- doughnut: {
- border: {
- visible: false,
- width: 2,
- color: WHITE
- },
- hoverStyle: {
- hatching: {
- direction: RIGHT,
- width: 4,
- step: 10,
- opacity: .75
- },
- border: {
- visible: false,
- width: 2
- }
- },
- selectionStyle: {
- hatching: {
- direction: RIGHT,
- width: 4,
- step: 10,
- opacity: .5
- },
- border: {
- visible: false,
- width: 2
- }
- }
- },
- donut: {
- border: {
- visible: false,
- width: 2,
- color: WHITE
- },
- hoverStyle: {
- hatching: {
- direction: RIGHT,
- width: 4,
- step: 10,
- opacity: .75
- },
- border: {
- visible: false,
- width: 2
- }
- },
- selectionStyle: {
- hatching: {
- direction: RIGHT,
- width: 4,
- step: 10,
- opacity: .5
- },
- border: {
- visible: false,
- width: 2
- }
- }
- },
- label: {
- textOverflow: "ellipsis",
- wordWrap: "normal"
- }
- },
- legend: {
- hoverMode: "allArgumentPoints",
- backgroundColor: NONE
- },
- adaptiveLayout: {
- keepLabels: false
- }
- },
- gauge: {
- scale: {
- tick: {
- visible: true,
- length: 5,
- width: 2,
- opacity: 1
- },
- minorTick: {
- visible: false,
- length: 3,
- width: 1,
- opacity: 1
- },
- label: {
- visible: true,
- alignment: CENTER,
- hideFirstOrLast: "last",
- overlappingBehavior: "hide"
- },
- position: TOP,
- endOnTick: false
- },
- rangeContainer: {
- offset: 0,
- width: 5,
- backgroundColor: "#808080"
- },
- valueIndicators: {
- _default: {
- color: "#c2c2c2"
- },
- rangebar: {
- space: 2,
- size: 10,
- color: "#cbc5cf",
- backgroundColor: NONE,
- text: {
- indent: 0,
- font: {
- size: 14,
- color: null
- }
- }
- },
- twocolorneedle: {
- secondColor: "#e18e92"
- },
- trianglemarker: {
- space: 2,
- length: 14,
- width: 13,
- color: "#8798a5"
- },
- textcloud: {
- arrowLength: 5,
- horizontalOffset: 6,
- verticalOffset: 3,
- color: "#679ec5",
- text: {
- font: {
- color: WHITE,
- size: 18
- }
- }
- }
- },
- indicator: {
- hasPositiveMeaning: true,
- layout: {
- horizontalAlignment: CENTER,
- verticalAlignment: BOTTOM
- },
- text: {
- font: {
- size: 18
- }
- }
- },
- _circular: {
- scale: {
- scaleDivisionFactor: 17,
- orientation: OUTSIDE,
- label: {
- indentFromTick: 10
- }
- },
- rangeContainer: {
- orientation: OUTSIDE
- },
- valueIndicatorType: "rectangleneedle",
- subvalueIndicatorType: "trianglemarker",
- valueIndicators: {
- _type: "rectangleneedle",
- _default: {
- offset: 20,
- indentFromCenter: 0,
- width: 2,
- spindleSize: 14,
- spindleGapSize: 10,
- beginAdaptingAtRadius: 50
- },
- triangleneedle: {
- width: 4
- },
- twocolorneedle: {
- space: 2,
- secondFraction: .4
- },
- rangebar: {
- offset: 30
- },
- trianglemarker: {
- offset: 6
- },
- textcloud: {
- offset: -6
- }
- }
- },
- _linear: {
- scale: {
- scaleDivisionFactor: 25,
- horizontalOrientation: RIGHT,
- verticalOrientation: BOTTOM,
- label: {
- indentFromTick: -10
- }
- },
- rangeContainer: {
- horizontalOrientation: RIGHT,
- verticalOrientation: BOTTOM
- },
- valueIndicatorType: "rangebar",
- subvalueIndicatorType: "trianglemarker",
- valueIndicators: {
- _type: "rectangle",
- _default: {
- offset: 2.5,
- length: 15,
- width: 15
- },
- rectangle: {
- width: 10
- },
- rangebar: {
- offset: 10,
- horizontalOrientation: RIGHT,
- verticalOrientation: BOTTOM
- },
- trianglemarker: {
- offset: 10,
- horizontalOrientation: LEFT,
- verticalOrientation: TOP
- },
- textcloud: {
- offset: -1,
- horizontalOrientation: LEFT,
- verticalOrientation: TOP
- }
- }
- }
- },
- barGauge: {
- backgroundColor: "#e0e0e0",
- relativeInnerRadius: .3,
- barSpacing: 4,
- resolveLabelOverlapping: "hide",
- label: {
- indent: 20,
- connectorWidth: 2,
- font: {
- size: 16
- }
- },
- legend: {
- visible: false
- },
- indicator: {
- hasPositiveMeaning: true,
- layout: {
- horizontalAlignment: CENTER,
- verticalAlignment: BOTTOM
- },
- text: {
- font: {
- size: 18
- }
- }
- }
- },
- rangeSelector: {
- scale: {
- valueMarginsEnabled: true,
- width: 1,
- color: BLACK,
- opacity: .1,
- showCustomBoundaryTicks: true,
- label: {
- overlappingBehavior: "hide",
- alignment: CENTER,
- visible: true,
- topIndent: 7,
- font: {
- size: 11
- }
- },
- tick: {
- width: 1,
- color: BLACK,
- opacity: .17,
- visible: true,
- length: 12
- },
- minorTick: {
- width: 1,
- color: BLACK,
- opacity: .05,
- visible: true,
- length: 12
- },
- marker: {
- width: 1,
- color: "#000000",
- opacity: .1,
- visible: true,
- separatorHeight: 33,
- topIndent: 10,
- textLeftIndent: 7,
- textTopIndent: 11,
- label: {}
- },
- logarithmBase: 10,
- workWeek: [1, 2, 3, 4, 5],
- breakStyle: {
- width: 5,
- color: "#ababab",
- line: "waved"
- },
- endOnTick: false
- },
- selectedRangeColor: "#606060",
- sliderMarker: {
- visible: true,
- paddingTopBottom: 2,
- paddingLeftRight: 4,
- color: "#606060",
- invalidRangeColor: RED,
- font: {
- color: WHITE,
- size: 11
- }
- },
- sliderHandle: {
- width: 1,
- color: BLACK,
- opacity: .2
- },
- shutter: {
- opacity: .75
- },
- background: {
- color: "#c0bae1",
- visible: true,
- image: {
- location: "full"
- }
- },
- behavior: {
- snapToTicks: true,
- animationEnabled: true,
- moveSelectedRangeByClick: true,
- manualRangeSelectionEnabled: true,
- allowSlidersSwap: true,
- callValueChanged: "onMovingComplete"
- },
- redrawOnResize: true,
- chart: {
- equalBarWidth: true,
- barGroupPadding: .3,
- minBubbleSize: 12,
- maxBubbleSize: .2,
- topIndent: .1,
- bottomIndent: 0,
- valueAxis: {
- inverted: false,
- logarithmBase: 10
- },
- commonSeriesSettings: {
- type: "area",
- aggregation: {
- enabled: void 0
- },
- point: {
- visible: false
- },
- scatter: {
- point: {
- visible: true
- }
- }
- }
- }
- },
- map: {
- title: {
- margin: 10
- },
- background: {
- borderWidth: 1,
- borderColor: "#cacaca"
- },
- layer: {
- label: {
- enabled: false,
- stroke: WHITE,
- "stroke-width": 1,
- "stroke-opacity": .7,
- font: {
- color: SOME_GREY,
- size: 12
- }
- }
- },
- "layer:area": {
- borderWidth: 1,
- borderColor: WHITE,
- color: "#d2d2d2",
- hoveredBorderColor: GREY_GREEN,
- selectedBorderWidth: 2,
- selectedBorderColor: GREY_GREEN,
- label: {
- "stroke-width": 2,
- font: {
- size: 16
- }
- }
- },
- "layer:line": {
- borderWidth: 2,
- color: "#ba8365",
- hoveredColor: "#a94813",
- selectedBorderWidth: 3,
- selectedColor: "#e55100",
- label: {
- "stroke-width": 2,
- font: {
- size: 16
- }
- }
- },
- "layer:marker": {
- label: {
- enabled: true,
- "stroke-width": 1,
- font: {
- size: 12
- }
- }
- },
- "layer:marker:dot": {
- borderWidth: 2,
- borderColor: WHITE,
- size: 8,
- selectedStep: 2,
- backStep: 18,
- backColor: WHITE,
- backOpacity: .32,
- shadow: true
- },
- "layer:marker:bubble": {
- minSize: 20,
- maxSize: 50,
- hoveredBorderWidth: 1,
- hoveredBorderColor: GREY_GREEN,
- selectedBorderWidth: 2,
- selectedBorderColor: GREY_GREEN
- },
- "layer:marker:pie": {
- size: 50,
- hoveredBorderWidth: 1,
- hoveredBorderColor: GREY_GREEN,
- selectedBorderWidth: 2,
- selectedBorderColor: GREY_GREEN
- },
- "layer:marker:image": {
- size: 20
- },
- legend: {
- verticalAlignment: BOTTOM,
- horizontalAlignment: RIGHT,
- position: INSIDE,
- backgroundOpacity: .65,
- border: {
- visible: true
- },
- paddingLeftRight: 16,
- paddingTopBottom: 12
- },
- controlBar: {
- borderColor: "#5d5d5d",
- borderWidth: 3,
- color: WHITE,
- margin: 20,
- opacity: .3
- },
- _rtl: {
- legend: {
- itemTextPosition: LEFT
- }
- }
- },
- treeMap: {
- tile: {
- border: {
- width: 1,
- opacity: .2,
- color: "#000000"
- },
- color: "#5f8b95",
- hoverStyle: {
- hatching: {
- opacity: .75,
- step: 6,
- width: 2,
- direction: "right"
- },
- border: {}
- },
- selectionStyle: {
- hatching: {
- opacity: .5,
- step: 6,
- width: 2,
- direction: "right"
- },
- border: {
- opacity: 1
- }
- },
- label: {
- visible: true,
- paddingLeftRight: 5,
- paddingTopBottom: 4,
- stroke: "#000000",
- "stroke-width": 1,
- "stroke-opacity": .3,
- font: {
- color: "#ffffff",
- weight: 300
- },
- shadow: {
- opacity: .8,
- offsetX: 0,
- offsetY: 1,
- blur: 1,
- color: "#000000"
- },
- wordWrap: "normal",
- textOverflow: "ellipsis"
- }
- },
- group: {
- padding: 4,
- border: {
- width: 1
- },
- color: "#eeeeee",
- hoverStyle: {
- hatching: {
- opacity: 0,
- step: 6,
- width: 2,
- direction: "right"
- },
- border: {}
- },
- selectionStyle: {
- hatching: {
- opacity: 0,
- step: 6,
- width: 2,
- direction: "right"
- },
- border: {}
- },
- label: {
- visible: true,
- paddingLeftRight: 5,
- paddingTopBottom: 4,
- font: {
- color: SECONDARY_TITLE_COLOR,
- weight: 600
- },
- textOverflow: "ellipsis"
- }
- },
- title: {
- subtitle: {}
- },
- tooltip: {},
- loadingIndicator: {}
- },
- sparkline: {
- lineColor: "#666666",
- lineWidth: 2,
- areaOpacity: .2,
- minColor: "#e8c267",
- maxColor: "#e55253",
- barPositiveColor: "#a9a9a9",
- barNegativeColor: "#d7d7d7",
- winColor: "#a9a9a9",
- lossColor: "#d7d7d7",
- firstLastColor: "#666666",
- pointSymbol: "circle",
- pointColor: WHITE,
- pointSize: 4,
- type: "line",
- argumentField: "arg",
- valueField: "val",
- winlossThreshold: 0,
- showFirstLast: true,
- showMinMax: false,
- tooltip: {
- enabled: true
- }
- },
- bullet: {
- color: "#e8c267",
- targetColor: "#666666",
- targetWidth: 4,
- showTarget: true,
- showZeroLevel: true,
- tooltip: {
- enabled: true
- }
- },
- polar: {
- commonSeriesSettings: {
- type: "scatter",
- closed: true,
- point: {
- visible: true,
- symbol: "circle",
- size: 12,
- border: {
- visible: false,
- width: 1
- },
- hoverMode: "onlyPoint",
- selectionMode: "onlyPoint",
- hoverStyle: {
- border: {
- visible: true,
- width: 4
- },
- size: 12
- },
- selectionStyle: {
- border: {
- visible: true,
- width: 4
- },
- size: 12
- }
- },
- scatter: {},
- line: {
- width: 2,
- dashStyle: SOLID,
- hoverStyle: {
- width: 3,
- hatching: {
- direction: NONE
- }
- },
- selectionStyle: {
- width: 3
- }
- },
- area: {
- point: {
- visible: false
- },
- opacity: .5
- },
- stackedline: {
- width: 2
- },
- bar: {
- opacity: .8
- },
- stackedbar: {
- opacity: .8
- }
- },
- adaptiveLayout: {
- width: 80,
- height: 80,
- keepLabels: true
- },
- equalBarWidth: true,
- barGroupPadding: .3,
- commonAxisSettings: {
- visible: true,
- forceUserTickInterval: false,
- label: {
- overlappingBehavior: "hide",
- indentFromAxis: 5
- },
- grid: {
- visible: true
- },
- minorGrid: {
- visible: true
- },
- tick: {
- visible: true
- },
- title: {
- font: {
- size: 16
- },
- margin: 10
- }
- },
- argumentAxis: {
- startAngle: 0,
- firstPointOnStartAngle: false,
- period: void 0
- },
- valueAxis: {
- endOnTick: false,
- tick: {
- visible: false
- }
- },
- horizontalAxis: {
- position: TOP,
- axisDivisionFactor: 50,
- label: {
- alignment: CENTER
- }
- },
- verticalAxis: {
- position: TOP,
- axisDivisionFactor: 30,
- label: {
- alignment: RIGHT
- }
- }
- },
- funnel: {
- sortData: true,
- valueField: "val",
- colorField: "color",
- argumentField: "arg",
- hoverEnabled: true,
- selectionMode: "single",
- item: {
- border: {
- visible: false,
- width: 2,
- color: WHITE
- },
- hoverStyle: {
- hatching: {
- opacity: .75,
- step: 6,
- width: 2,
- direction: RIGHT
- },
- border: {}
- },
- selectionStyle: {
- hatching: {
- opacity: .5,
- step: 6,
- width: 2,
- direction: RIGHT
- },
- border: {}
- }
- },
- title: {
- margin: 10
- },
- adaptiveLayout: {
- width: 80,
- height: 80,
- keepLabels: true
- },
- legend: {
- visible: false
- },
- _rtl: {
- legend: {
- itemTextPosition: LEFT
- }
- },
- tooltip: {
- customizeTooltip: function(info) {
- return {
- text: info.item.argument + " " + info.valueText
- }
- }
- },
- inverted: false,
- algorithm: "dynamicSlope",
- neckWidth: 0,
- neckHeight: 0,
- resolveLabelOverlapping: "shift",
- label: {
- textOverflow: "ellipsis",
- wordWrap: "normal",
- visible: true,
- horizontalAlignment: RIGHT,
- horizontalOffset: 0,
- verticalOffset: 0,
- showForZeroValues: false,
- customizeText: function(info) {
- return info.item.argument + " " + info.valueText
- },
- position: "columns",
- font: {
- color: WHITE
- },
- border: {
- visible: false,
- width: 1,
- color: LIGHT_GREY,
- dashStyle: SOLID
- },
- connector: {
- visible: true,
- width: 1,
- opacity: .5
- }
- }
- },
- sankey: {
- sourceField: "source",
- targetField: "target",
- weightField: "weight",
- hoverEnabled: true,
- alignment: CENTER,
- adaptiveLayout: {
- width: 80,
- height: 80,
- keepLabels: true
- },
- label: {
- visible: true,
- horizontalOffset: 8,
- verticalOffset: 0,
- overlappingBehavior: "ellipsis",
- useNodeColors: false,
- font: {
- color: BLACK,
- weight: 500
- },
- border: {
- visible: false,
- width: 2,
- color: WHITE
- },
- customizeText: function(info) {
- return info.title
- },
- shadow: {
- opacity: .2,
- offsetX: 0,
- offsetY: 1,
- blur: 1,
- color: WHITE
- }
- },
- title: {
- margin: 10,
- font: {
- size: 28,
- weight: 200
- },
- subtitle: {
- font: {
- size: 16
- }
- }
- },
- tooltip: {
- enabled: true
- },
- node: {
- padding: 30,
- width: 8,
- opacity: 1,
- border: {
- color: WHITE,
- width: 1,
- visible: false
- },
- hoverStyle: {
- hatching: {
- opacity: .75,
- step: 6,
- width: 2,
- direction: RIGHT
- },
- border: {}
- }
- },
- link: {
- color: "#888888",
- colorMode: "none",
- opacity: .3,
- border: {
- color: WHITE,
- width: 1,
- visible: false
- },
- hoverStyle: {
- opacity: .5,
- hatching: {
- opacity: .75,
- step: 6,
- width: 2,
- direction: RIGHT
- },
- border: {}
- }
- }
- }
- });
- registerThemeAlias("generic.light.compact", "generic.light")
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.dark.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var WHITE = "#ffffff";
- var BLACK = "#000000";
- var SOME_GREY = "#2b2b2b";
- var RANGE_COLOR = "#b5b5b5";
- var GREY_GREEN = "#303030";
- var AREA_LAYER_COLOR = "#686868";
- var LINE_COLOR = "#c7c7c7";
- var TARGET_COLOR = "#8e8e8e";
- var POSITIVE_COLOR = "#b8b8b8";
- var BORDER_COLOR = "#494949";
- registerTheme({
- name: "generic.dark",
- font: {
- color: "#808080"
- },
- backgroundColor: "#2a2a2a",
- primaryTitleColor: "#dedede",
- secondaryTitleColor: "#a3a3a3",
- gridColor: "#555555",
- axisColor: "#a3a3a3",
- "export": {
- backgroundColor: "#2a2a2a",
- font: {
- color: "#dbdbdb"
- },
- button: {
- "default": {
- color: "#dedede",
- borderColor: "#4d4d4d",
- backgroundColor: "#2e2e2e"
- },
- hover: {
- color: "#dedede",
- borderColor: "#6c6c6c",
- backgroundColor: "#444"
- },
- focus: {
- color: "#dedede",
- borderColor: "#8d8d8d",
- backgroundColor: "#444444"
- },
- active: {
- color: "#dedede",
- borderColor: "#8d8d8d",
- backgroundColor: "#555555"
- }
- },
- shadowColor: "#292929"
- },
- tooltip: {
- color: SOME_GREY,
- border: {
- color: BORDER_COLOR
- },
- font: {
- color: "#929292"
- }
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: BORDER_COLOR
- }
- },
- valueErrorBar: {
- color: WHITE
- }
- }
- },
- "chart:common:axis": {
- constantLineStyle: {
- color: WHITE
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: BORDER_COLOR
- }
- },
- commonAxisSettings: {
- breakStyle: {
- color: "#818181"
- }
- },
- zoomAndPan: {
- dragBoxStyle: {
- color: WHITE
- }
- },
- commonAnnotationSettings: {
- font: {
- color: "#929292"
- },
- border: {
- color: BORDER_COLOR
- },
- color: SOME_GREY,
- shadow: {
- opacity: .008,
- offsetY: 4,
- blur: 8
- }
- }
- },
- gauge: {
- rangeContainer: {
- backgroundColor: RANGE_COLOR
- },
- valueIndicators: {
- _default: {
- color: RANGE_COLOR
- },
- rangebar: {
- color: "#84788b"
- },
- twocolorneedle: {
- secondColor: "#ba544d"
- },
- trianglemarker: {
- color: "#b7918f"
- },
- textcloud: {
- color: "#ba544d"
- }
- }
- },
- barGauge: {
- backgroundColor: "#3c3c3c"
- },
- rangeSelector: {
- scale: {
- tick: {
- color: WHITE,
- opacity: .32
- },
- minorTick: {
- color: WHITE,
- opacity: .1
- },
- breakStyle: {
- color: "#818181"
- }
- },
- selectedRangeColor: RANGE_COLOR,
- sliderMarker: {
- color: RANGE_COLOR,
- font: {
- color: GREY_GREEN
- }
- },
- sliderHandle: {
- color: WHITE,
- opacity: .2
- },
- shutter: {
- color: SOME_GREY,
- opacity: .9
- }
- },
- map: {
- background: {
- borderColor: "#3f3f3f"
- },
- layer: {
- label: {
- stroke: BLACK,
- font: {
- color: WHITE
- }
- }
- },
- "layer:area": {
- borderColor: GREY_GREEN,
- color: AREA_LAYER_COLOR,
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- "layer:line": {
- color: "#c77244",
- hoveredColor: "#ff5d04",
- selectedColor: "#ff784f"
- },
- "layer:marker:bubble": {
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- "layer:marker:pie": {
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- legend: {
- border: {
- color: "#3f3f3f"
- },
- font: {
- color: WHITE
- }
- },
- controlBar: {
- borderColor: LINE_COLOR,
- color: GREY_GREEN
- }
- },
- treeMap: {
- group: {
- color: "#4c4c4c",
- label: {
- font: {
- color: "#a3a3a3"
- }
- }
- }
- },
- sparkline: {
- lineColor: LINE_COLOR,
- firstLastColor: LINE_COLOR,
- barPositiveColor: POSITIVE_COLOR,
- barNegativeColor: TARGET_COLOR,
- winColor: POSITIVE_COLOR,
- lossColor: TARGET_COLOR,
- pointColor: GREY_GREEN
- },
- bullet: {
- targetColor: TARGET_COLOR
- },
- funnel: {
- item: {
- border: {
- color: "#2a2a2a"
- }
- }
- },
- sankey: {
- label: {
- font: {
- color: WHITE
- },
- shadow: {
- opacity: 0
- }
- },
- node: {
- border: {
- color: "#2a2a2a"
- }
- },
- link: {
- color: "#888888",
- border: {
- color: "#2a2a2a"
- },
- hoverStyle: {
- color: "#bbbbbb"
- }
- }
- }
- }, "generic.light");
- registerThemeAlias("generic.dark.compact", "generic.dark")
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.contrast.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var WHITE = "#ffffff";
- var BLACK = "#000000";
- var CONTRAST_ACTIVE = "#cf00da";
- var MARKER_COLOR = "#f8ca00";
- var AREA_LAYER_COLOR = "#686868";
- registerTheme({
- name: "generic.contrast",
- defaultPalette: "Bright",
- font: {
- color: WHITE
- },
- backgroundColor: BLACK,
- primaryTitleColor: WHITE,
- secondaryTitleColor: WHITE,
- gridColor: WHITE,
- axisColor: WHITE,
- "export": {
- backgroundColor: BLACK,
- font: {
- color: WHITE
- },
- button: {
- "default": {
- color: WHITE,
- borderColor: WHITE,
- backgroundColor: BLACK
- },
- hover: {
- color: WHITE,
- borderColor: WHITE,
- backgroundColor: "#cf00d7"
- },
- focus: {
- color: WHITE,
- borderColor: "#cf00d7",
- backgroundColor: BLACK
- },
- active: {
- color: BLACK,
- borderColor: WHITE,
- backgroundColor: WHITE
- }
- },
- borderColor: WHITE,
- menuButtonColor: BLACK,
- activeBackgroundColor: WHITE,
- activeColor: BLACK,
- selectedBorderColor: CONTRAST_ACTIVE,
- selectedColor: CONTRAST_ACTIVE,
- shadowColor: "none"
- },
- tooltip: {
- border: {
- color: WHITE
- },
- font: {
- color: WHITE
- },
- color: BLACK
- },
- "chart:common": {
- commonSeriesSettings: {
- valueErrorBar: {
- color: WHITE
- },
- hoverStyle: {
- hatching: {
- opacity: .5
- }
- },
- selectionStyle: {
- hatching: {
- opacity: .35
- }
- },
- label: {
- font: {
- color: WHITE
- },
- border: {
- color: WHITE
- }
- }
- }
- },
- "chart:common:axis": {
- constantLineStyle: {
- color: WHITE
- }
- },
- chart: {
- commonSeriesSettings: {},
- crosshair: {
- color: "#cf00d7"
- },
- commonPaneSettings: {
- backgroundColor: BLACK,
- border: {
- color: WHITE
- }
- },
- scrollBar: {
- color: WHITE
- },
- commonAxisSettings: {
- breakStyle: {
- color: "#cf00d7"
- }
- },
- zoomAndPan: {
- dragBoxStyle: {
- color: WHITE,
- opacity: .7
- }
- },
- commonAnnotationSettings: {
- font: {
- color: WHITE
- },
- border: {
- color: WHITE
- },
- color: BLACK
- }
- },
- pie: {
- commonSeriesSettings: {
- pie: {
- hoverStyle: {
- hatching: {
- opacity: .5
- }
- },
- selectionStyle: {
- hatching: {
- opacity: .35
- }
- }
- },
- doughnut: {
- hoverStyle: {
- hatching: {
- opacity: .5
- }
- },
- selectionStyle: {
- hatching: {
- opacity: .35
- }
- }
- },
- donut: {
- hoverStyle: {
- hatching: {
- opacity: .5
- }
- },
- selectionStyle: {
- hatching: {
- opacity: .35
- }
- }
- }
- }
- },
- gauge: {
- rangeContainer: {
- backgroundColor: WHITE
- },
- valueIndicators: {
- _default: {
- color: WHITE
- },
- rangebar: {
- color: WHITE,
- backgroundColor: BLACK
- },
- twocolorneedle: {
- secondColor: WHITE
- },
- trianglemarker: {
- color: WHITE
- },
- textcloud: {
- color: WHITE,
- text: {
- font: {
- color: BLACK
- }
- }
- }
- }
- },
- barGauge: {
- backgroundColor: "#3c3c3c"
- },
- rangeSelector: {
- scale: {
- tick: {
- color: WHITE,
- opacity: .4
- },
- minorTick: {
- color: WHITE,
- opacity: .12
- },
- breakStyle: {
- color: "#cf00d7"
- }
- },
- selectedRangeColor: CONTRAST_ACTIVE,
- sliderMarker: {
- color: CONTRAST_ACTIVE
- },
- sliderHandle: {
- color: CONTRAST_ACTIVE,
- opacity: 1
- },
- shutter: {
- opacity: .75
- },
- background: {
- color: BLACK
- }
- },
- map: {
- background: {
- borderColor: WHITE
- },
- layer: {
- label: {
- stroke: BLACK,
- font: {
- color: WHITE
- }
- }
- },
- "layer:area": {
- borderColor: BLACK,
- color: AREA_LAYER_COLOR,
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE,
- label: {
- font: {
- opacity: 1
- }
- }
- },
- "layer:line": {
- color: "#267cff",
- hoveredColor: "#f613ff",
- selectedColor: WHITE
- },
- "layer:marker:dot": {
- borderColor: BLACK,
- color: MARKER_COLOR,
- backColor: BLACK,
- backOpacity: .32
- },
- "layer:marker:bubble": {
- color: MARKER_COLOR,
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- "layer:marker:pie": {
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- controlBar: {
- borderColor: WHITE,
- color: BLACK,
- opacity: .3
- }
- },
- treeMap: {
- tile: {
- color: "#70c92f"
- },
- group: {
- color: "#797979",
- label: {
- font: {
- color: WHITE
- }
- }
- }
- },
- sparkline: {
- pointColor: BLACK
- },
- bullet: {},
- polar: {
- commonSeriesSettings: {}
- },
- funnel: {
- label: {
- connector: {
- opacity: 1
- }
- }
- },
- sankey: {
- label: {
- font: {
- color: WHITE
- },
- shadow: {
- opacity: 0
- }
- },
- node: {
- border: {
- visible: true,
- width: 1,
- color: WHITE
- }
- },
- link: {
- opacity: .5,
- border: {
- visible: true,
- width: 1,
- color: WHITE
- },
- hoverStyle: {
- opacity: .9
- }
- }
- }
- }, "generic.light");
- registerThemeAlias("generic.contrast.compact", "generic.contrast")
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.carmine.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var ACCENT_COLOR = "#f05b41";
- var BACKGROUND_COLOR = "#fff";
- var TITLE_COLOR = "#333";
- var SUBTITLE_COLOR = "#8899a8";
- var TEXT_COLOR = "#707070";
- var BORDER_COLOR = "#dee1e3";
- registerTheme({
- name: "generic.carmine",
- defaultPalette: "Carmine",
- backgroundColor: BACKGROUND_COLOR,
- primaryTitleColor: TITLE_COLOR,
- secondaryTitleColor: SUBTITLE_COLOR,
- gridColor: BORDER_COLOR,
- axisColor: TEXT_COLOR,
- "export": {
- backgroundColor: BACKGROUND_COLOR,
- font: {
- color: TITLE_COLOR
- },
- button: {
- "default": {
- color: TITLE_COLOR,
- borderColor: "#b1b7bd",
- backgroundColor: BACKGROUND_COLOR
- },
- hover: {
- color: TITLE_COLOR,
- borderColor: "#b1b7bd",
- backgroundColor: "#faf2f0"
- },
- focus: {
- color: TITLE_COLOR,
- borderColor: "#6d7781",
- backgroundColor: "#faf2f0"
- },
- active: {
- color: TITLE_COLOR,
- borderColor: "#6d7781",
- backgroundColor: "#f5e7e4"
- }
- }
- },
- legend: {
- font: {
- color: TEXT_COLOR
- }
- },
- tooltip: {
- color: BACKGROUND_COLOR,
- border: {
- color: BORDER_COLOR
- },
- font: {
- color: TITLE_COLOR
- }
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: BORDER_COLOR
- }
- }
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: BORDER_COLOR
- }
- },
- commonAxisSettings: {
- breakStyle: {
- color: "#c1c5c7"
- }
- },
- commonAnnotationSettings: {
- font: {
- color: TITLE_COLOR
- },
- border: {
- color: BORDER_COLOR
- },
- color: BACKGROUND_COLOR
- }
- },
- rangeSelector: {
- scale: {
- breakStyle: {
- color: "#c1c5c7"
- },
- tick: {
- opacity: .12
- }
- },
- selectedRangeColor: ACCENT_COLOR,
- sliderMarker: {
- color: ACCENT_COLOR
- },
- sliderHandle: {
- color: ACCENT_COLOR,
- opacity: .5
- }
- },
- sparkline: {
- pointColor: BACKGROUND_COLOR,
- minColor: "#f0ad4e",
- maxColor: "#f74d61"
- },
- treeMap: {
- group: {
- color: BORDER_COLOR,
- label: {
- font: {
- color: SUBTITLE_COLOR
- }
- }
- }
- },
- bullet: {
- color: ACCENT_COLOR
- },
- gauge: {
- valueIndicators: {
- rangebar: {
- color: ACCENT_COLOR
- },
- textcloud: {
- color: ACCENT_COLOR
- }
- }
- }
- }, "generic.light");
- registerThemeAlias("generic.carmine.compact", "generic.carmine")
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.darkmoon.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var ACCENT_COLOR = "#3debd3";
- var BACKGROUND_COLOR = "#465672";
- var TITLE_COLOR = "#fff";
- var SUBTITLE_COLOR = "#919bac";
- var TEXT_COLOR = "#c7ccd4";
- var BORDER_COLOR = "#596980";
- registerTheme({
- name: "generic.darkmoon",
- defaultPalette: "Dark Moon",
- backgroundColor: BACKGROUND_COLOR,
- primaryTitleColor: TITLE_COLOR,
- secondaryTitleColor: SUBTITLE_COLOR,
- gridColor: BORDER_COLOR,
- axisColor: TEXT_COLOR,
- "export": {
- backgroundColor: BACKGROUND_COLOR,
- font: {
- color: TITLE_COLOR
- },
- button: {
- "default": {
- color: TITLE_COLOR,
- borderColor: "#7a889e",
- backgroundColor: BACKGROUND_COLOR
- },
- hover: {
- color: TITLE_COLOR,
- borderColor: "#9da8b8",
- backgroundColor: "#596e92"
- },
- focus: {
- color: TITLE_COLOR,
- borderColor: "#c4cad4",
- backgroundColor: "#596e92"
- },
- active: {
- color: TITLE_COLOR,
- borderColor: "#c4cad4",
- backgroundColor: "#6b80a4"
- }
- }
- },
- legend: {
- font: {
- color: TEXT_COLOR
- }
- },
- tooltip: {
- color: "#62789e",
- border: {
- color: BORDER_COLOR
- },
- font: {
- color: TITLE_COLOR
- }
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: BORDER_COLOR
- }
- }
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: BORDER_COLOR
- }
- },
- commonAxisSettings: {
- breakStyle: {
- color: "#73869e"
- }
- },
- commonAnnotationSettings: {
- font: {
- color: TITLE_COLOR
- },
- border: {
- color: BORDER_COLOR
- },
- color: "#62789e"
- }
- },
- gauge: {
- valueIndicators: {
- rangebar: {
- color: ACCENT_COLOR
- },
- textcloud: {
- color: ACCENT_COLOR,
- text: {
- font: {
- color: BACKGROUND_COLOR
- }
- }
- }
- }
- },
- barGauge: {
- backgroundColor: "#526280"
- },
- funnel: {
- item: {
- border: {
- color: BACKGROUND_COLOR
- }
- }
- },
- sparkline: {
- pointColor: BACKGROUND_COLOR,
- minColor: "#f0ad4e",
- maxColor: "#f9517e"
- },
- treeMap: {
- group: {
- color: BORDER_COLOR,
- label: {
- font: {
- color: TITLE_COLOR
- }
- }
- }
- },
- map: {
- background: {
- borderColor: BORDER_COLOR
- },
- "layer:area": {
- color: "#97a3b6",
- borderColor: BACKGROUND_COLOR
- }
- },
- rangeSelector: {
- shutter: {
- color: BACKGROUND_COLOR
- },
- scale: {
- breakStyle: {
- color: "#73869e"
- },
- tick: {
- opacity: .2
- }
- },
- selectedRangeColor: ACCENT_COLOR,
- sliderMarker: {
- color: ACCENT_COLOR,
- font: {
- color: "#000"
- }
- },
- sliderHandle: {
- color: ACCENT_COLOR,
- opacity: .5
- }
- },
- bullet: {
- color: ACCENT_COLOR
- },
- sankey: {
- link: {
- border: {
- color: BACKGROUND_COLOR
- }
- },
- node: {
- border: {
- color: BACKGROUND_COLOR
- }
- }
- }
- }, "generic.dark");
- registerThemeAlias("generic.darkmoon.compact", "generic.darkmoon")
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.softblue.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var ACCENT_COLOR = "#7ab8eb";
- var BACKGROUND_COLOR = "#fff";
- var TITLE_COLOR = "#333";
- var SUBTITLE_COLOR = "#99a1a8";
- var TEXT_COLOR = "#707070";
- var BORDER_COLOR = "#e8eaeb";
- registerTheme({
- name: "generic.softblue",
- defaultPalette: "Soft Blue",
- backgroundColor: BACKGROUND_COLOR,
- primaryTitleColor: TITLE_COLOR,
- secondaryTitleColor: SUBTITLE_COLOR,
- gridColor: BORDER_COLOR,
- axisColor: TEXT_COLOR,
- "export": {
- backgroundColor: BACKGROUND_COLOR,
- font: {
- color: TITLE_COLOR
- },
- button: {
- "default": {
- color: TITLE_COLOR,
- borderColor: "#c9d0d4",
- backgroundColor: BACKGROUND_COLOR
- },
- hover: {
- color: TITLE_COLOR,
- borderColor: "#a7b2b9",
- backgroundColor: "#e6e6e6"
- },
- focus: {
- color: TITLE_COLOR,
- borderColor: "#82929b",
- backgroundColor: "#e6e6e6"
- },
- active: {
- color: TITLE_COLOR,
- borderColor: "#82929b",
- backgroundColor: "#d4d4d4"
- }
- }
- },
- legend: {
- font: {
- color: TEXT_COLOR
- }
- },
- tooltip: {
- color: BACKGROUND_COLOR,
- border: {
- color: BORDER_COLOR
- },
- font: {
- color: TITLE_COLOR
- }
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: BORDER_COLOR
- }
- }
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: BORDER_COLOR
- }
- },
- commonAxisSettings: {
- breakStyle: {
- color: "#cfd2d3"
- }
- },
- commonAnnotationSettings: {
- color: BACKGROUND_COLOR,
- border: {
- color: BORDER_COLOR
- },
- font: {
- color: TITLE_COLOR
- }
- }
- },
- rangeSelector: {
- scale: {
- breakStyle: {
- color: "#cfd2d3"
- },
- tick: {
- opacity: .12
- }
- },
- selectedRangeColor: ACCENT_COLOR,
- sliderMarker: {
- color: ACCENT_COLOR
- },
- sliderHandle: {
- color: ACCENT_COLOR,
- opacity: .5
- }
- },
- sparkline: {
- pointColor: BACKGROUND_COLOR,
- minColor: "#f0ad4e",
- maxColor: "#d9534f"
- },
- treeMap: {
- group: {
- color: BORDER_COLOR,
- label: {
- font: {
- color: SUBTITLE_COLOR
- }
- }
- }
- },
- bullet: {
- color: ACCENT_COLOR
- },
- gauge: {
- valueIndicators: {
- rangebar: {
- color: ACCENT_COLOR
- },
- textcloud: {
- color: ACCENT_COLOR
- }
- }
- }
- }, "generic.light");
- registerThemeAlias("generic.softblue.compact", "generic.softblue")
- },
- /*!********************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.darkviolet.js ***!
- \********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var ACCENT_COLOR = "#9c63ff";
- var BACKGROUND_COLOR = "#17171f";
- var TITLE_COLOR = "#f5f6f7";
- var SUBTITLE_COLOR = "#fff";
- var TEXT_COLOR = "#b2b2b6";
- var BORDER_COLOR = "#343840";
- registerTheme({
- name: "generic.darkviolet",
- defaultPalette: "Dark Violet",
- backgroundColor: BACKGROUND_COLOR,
- primaryTitleColor: TITLE_COLOR,
- secondaryTitleColor: SUBTITLE_COLOR,
- gridColor: BORDER_COLOR,
- axisColor: TEXT_COLOR,
- "export": {
- backgroundColor: BACKGROUND_COLOR,
- font: {
- color: TITLE_COLOR
- },
- button: {
- "default": {
- color: TITLE_COLOR,
- borderColor: "#414152",
- backgroundColor: BACKGROUND_COLOR
- },
- hover: {
- color: TITLE_COLOR,
- borderColor: "#5c5c74",
- backgroundColor: "#2d2d3c"
- },
- focus: {
- color: TITLE_COLOR,
- borderColor: "#7c7c97",
- backgroundColor: "#2d2d3c"
- },
- active: {
- color: TITLE_COLOR,
- borderColor: "#7c7c97",
- backgroundColor: "#3c3c51"
- }
- }
- },
- legend: {
- font: {
- color: TEXT_COLOR
- }
- },
- tooltip: {
- color: BACKGROUND_COLOR,
- border: {
- color: "#414152"
- },
- font: {
- color: TITLE_COLOR
- }
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: BORDER_COLOR
- }
- }
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: BORDER_COLOR
- }
- },
- commonAxisSettings: {
- breakStyle: {
- color: "#575e6b"
- }
- },
- commonAnnotationSettings: {
- font: {
- color: TITLE_COLOR
- },
- border: {
- color: "#414152"
- },
- color: BACKGROUND_COLOR
- }
- },
- funnel: {
- item: {
- border: {
- color: BACKGROUND_COLOR
- }
- }
- },
- sparkline: {
- pointColor: BACKGROUND_COLOR,
- minColor: "#f0ad4e",
- maxColor: "#d9534f"
- },
- treeMap: {
- group: {
- color: BORDER_COLOR,
- label: {
- font: {
- color: SUBTITLE_COLOR
- }
- }
- }
- },
- rangeSelector: {
- shutter: {
- color: BACKGROUND_COLOR
- },
- scale: {
- breakStyle: {
- color: "#575e6b"
- },
- tick: {
- opacity: .2
- }
- },
- selectedRangeColor: ACCENT_COLOR,
- sliderMarker: {
- color: ACCENT_COLOR,
- font: {
- color: "#fff"
- }
- },
- sliderHandle: {
- color: ACCENT_COLOR,
- opacity: .5
- }
- },
- bullet: {
- color: ACCENT_COLOR
- },
- gauge: {
- valueIndicators: {
- rangebar: {
- color: ACCENT_COLOR
- },
- textcloud: {
- color: ACCENT_COLOR
- }
- }
- },
- sankey: {
- link: {
- border: {
- color: BACKGROUND_COLOR
- }
- },
- node: {
- border: {
- color: BACKGROUND_COLOR
- }
- }
- }
- }, "generic.dark");
- registerThemeAlias("generic.darkviolet.compact", "generic.darkviolet")
- },
- /*!*******************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/generic.greenmist.js ***!
- \*******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var ACCENT_COLOR = "#3cbab2";
- var BACKGROUND_COLOR = "#f5f5f5";
- var TITLE_COLOR = "#28484f";
- var SUBTITLE_COLOR = "#7eb2be";
- var TEXT_COLOR = "#657c80";
- var BORDER_COLOR = "#dedede";
- registerTheme({
- name: "generic.greenmist",
- defaultPalette: "Green Mist",
- backgroundColor: BACKGROUND_COLOR,
- primaryTitleColor: TITLE_COLOR,
- secondaryTitleColor: SUBTITLE_COLOR,
- gridColor: BORDER_COLOR,
- axisColor: TEXT_COLOR,
- "export": {
- backgroundColor: BACKGROUND_COLOR,
- font: {
- color: TITLE_COLOR
- },
- button: {
- "default": {
- color: TITLE_COLOR,
- borderColor: "#a2b4b8",
- backgroundColor: BACKGROUND_COLOR
- },
- hover: {
- color: TITLE_COLOR,
- borderColor: "#7f989e",
- backgroundColor: "rgba(222, 222, 222, 0.4)"
- },
- focus: {
- color: TITLE_COLOR,
- borderColor: "#5f777c",
- backgroundColor: "rgba(222, 222, 222, 0.4)"
- },
- active: {
- color: TITLE_COLOR,
- borderColor: "#5f777c",
- backgroundColor: "rgba(222, 222, 222, 0.8)"
- }
- }
- },
- legend: {
- font: {
- color: TEXT_COLOR
- }
- },
- tooltip: {
- color: "#fff",
- border: {
- color: BORDER_COLOR
- },
- font: {
- color: TITLE_COLOR
- }
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: BORDER_COLOR
- }
- }
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: BORDER_COLOR
- }
- },
- commonAxisSettings: {
- breakStyle: {
- color: "#c1c1c1"
- }
- },
- commonAnnotationSettings: {
- color: "#fff",
- border: {
- color: BORDER_COLOR
- },
- font: {
- color: TITLE_COLOR
- }
- }
- },
- funnel: {
- item: {
- border: {
- color: BACKGROUND_COLOR
- }
- }
- },
- sparkline: {
- pointColor: BACKGROUND_COLOR,
- minColor: "#ffc852",
- maxColor: "#f74a5e"
- },
- treeMap: {
- group: {
- color: BORDER_COLOR,
- label: {
- font: {
- color: SUBTITLE_COLOR
- }
- }
- }
- },
- rangeSelector: {
- shutter: {
- color: BACKGROUND_COLOR
- },
- scale: {
- breakStyle: {
- color: "#c1c1c1"
- },
- tick: {
- opacity: .12
- }
- },
- selectedRangeColor: ACCENT_COLOR,
- sliderMarker: {
- color: ACCENT_COLOR
- },
- sliderHandle: {
- color: ACCENT_COLOR,
- opacity: .5
- }
- },
- bullet: {
- color: ACCENT_COLOR
- },
- gauge: {
- valueIndicators: {
- rangebar: {
- color: ACCENT_COLOR
- },
- textcloud: {
- color: ACCENT_COLOR
- }
- }
- }
- }, "generic.light");
- registerThemeAlias("generic.greenmist.compact", "generic.greenmist")
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/material.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var registerTheme = themeModule.registerTheme;
- var registerThemeAlias = themeModule.registerThemeAlias;
- var FONT_FAMILY = "'Roboto', 'RobotoFallback', 'Helvetica', 'Arial', sans-serif";
- var LIGHT_TITLE_COLOR = "rgba(0,0,0,0.87)";
- var LIGHT_LABEL_COLOR = "rgba(0,0,0,0.54)";
- var DARK_TITLE_COLOR = "rgba(255,255,255,0.87)";
- var DARK_LABEL_COLOR = "rgba(255,255,255,0.54)";
- var DARK_BACKGROUND_COLOR = "#363640";
- var WHITE = "#ffffff";
- var BLACK = "#000000";
- var RANGE_COLOR = "#b5b5b5";
- var AREA_LAYER_COLOR = "#686868";
- var LINE_COLOR = "#c7c7c7";
- var TARGET_COLOR = "#8e8e8e";
- var POSITIVE_COLOR = "#b8b8b8";
- var LABEL_BORDER_COLOR = "#494949";
- var BREAK_STYLE_COLOR = "#818181";
- registerTheme({
- name: "material",
- defaultPalette: "Material",
- font: {
- family: FONT_FAMILY
- },
- title: {
- margin: {
- top: 20,
- bottom: 20,
- left: 0,
- right: 0
- },
- font: {
- size: 20,
- family: FONT_FAMILY,
- weight: 500
- },
- horizontalAlignment: "left",
- subtitle: {
- font: {
- size: 14
- },
- horizontalAlignment: "left"
- }
- },
- tooltip: {
- shadow: {
- opacity: 0
- },
- border: {
- visible: false
- },
- paddingLeftRight: 8,
- paddingTopBottom: 6,
- arrowLength: 0,
- location: "edge",
- color: "#616161",
- font: {
- color: WHITE
- },
- cornerRadius: 4
- },
- chart: {
- commonAxisSettings: {
- minorTick: {
- opacity: .5
- },
- label: {
- font: {
- size: 11
- }
- }
- },
- commonAnnotationSettings: {
- font: {
- color: WHITE
- },
- border: {
- color: "#616161"
- },
- color: "#616161",
- arrowLength: 14,
- arrowWidth: 0,
- shadow: {
- opacity: .08,
- offsetY: 4,
- blur: 8
- },
- cornerRadius: 4
- }
- },
- pie: {
- title: {
- horizontalAlignment: "center",
- subtitle: {
- horizontalAlignment: "center"
- }
- }
- },
- polar: {
- commonAxisSettings: {
- minorTick: {
- opacity: .5
- }
- },
- title: {
- horizontalAlignment: "center",
- subtitle: {
- horizontalAlignment: "center"
- }
- }
- },
- funnel: {
- title: {
- horizontalAlignment: "center",
- subtitle: {
- horizontalAlignment: "center"
- }
- }
- },
- gauge: {
- title: {
- horizontalAlignment: "center",
- subtitle: {
- horizontalAlignment: "center"
- }
- }
- },
- barGauge: {
- title: {
- horizontalAlignment: "center",
- subtitle: {
- horizontalAlignment: "center"
- }
- }
- },
- rangeSelector: {
- sliderHandle: {
- opacity: .5
- }
- },
- treeMap: {
- group: {
- label: {
- font: {
- weight: 500
- }
- }
- }
- }
- }, "generic.light");
- registerTheme({
- name: "material.light",
- gridColor: "#e0e0e0",
- axisColor: LIGHT_LABEL_COLOR,
- primaryTitleColor: LIGHT_TITLE_COLOR,
- legend: {
- font: {
- color: LIGHT_LABEL_COLOR
- }
- },
- chart: {
- scrollBar: {
- color: "#bfbfbf",
- opacity: .7
- }
- },
- gauge: {
- rangeContainer: {
- backgroundColor: "rgba(0,0,0,0.2)"
- }
- },
- barGauge: {
- backgroundColor: "#efefef"
- }
- }, "material");
- registerTheme({
- name: "material.dark",
- gridColor: "#515159",
- backgroundColor: DARK_BACKGROUND_COLOR,
- axisColor: DARK_LABEL_COLOR,
- font: {
- color: DARK_LABEL_COLOR
- },
- primaryTitleColor: DARK_TITLE_COLOR,
- secondaryTitleColor: DARK_TITLE_COLOR,
- tooltip: {
- color: "#000"
- },
- "export": {
- backgroundColor: DARK_BACKGROUND_COLOR,
- font: {
- color: "#dbdbdb"
- },
- button: {
- "default": {
- color: "#dedede",
- borderColor: "#4d4d4d",
- backgroundColor: DARK_BACKGROUND_COLOR
- },
- hover: {
- color: "#dedede",
- borderColor: "#6c6c6c",
- backgroundColor: "#3f3f4b"
- },
- focus: {
- color: "#dedede",
- borderColor: "#8d8d8d",
- backgroundColor: "#494956"
- },
- active: {
- color: "#dedede",
- borderColor: "#8d8d8d",
- backgroundColor: "#494956"
- }
- },
- shadowColor: "#292929"
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: LABEL_BORDER_COLOR
- }
- },
- valueErrorBar: {
- color: WHITE
- }
- }
- },
- "chart:common:axis": {
- constantLineStyle: {
- color: WHITE
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: LABEL_BORDER_COLOR
- }
- },
- commonAxisSettings: {
- breakStyle: {
- color: BREAK_STYLE_COLOR
- }
- },
- zoomAndPan: {
- dragBoxStyle: {
- color: WHITE
- }
- },
- commonAnnotationSettings: {
- border: {
- color: "#000"
- },
- color: "#000"
- }
- },
- gauge: {
- rangeContainer: {
- backgroundColor: RANGE_COLOR
- },
- valueIndicators: {
- _default: {
- color: RANGE_COLOR
- },
- rangebar: {
- color: "#84788b"
- },
- twocolorneedle: {
- secondColor: "#ba544d"
- },
- trianglemarker: {
- color: "#b7918f"
- },
- textcloud: {
- color: "#ba544d"
- }
- }
- },
- barGauge: {
- backgroundColor: "#3c3c3c"
- },
- rangeSelector: {
- scale: {
- tick: {
- color: WHITE,
- opacity: .32
- },
- minorTick: {
- color: WHITE,
- opacity: .1
- },
- breakStyle: {
- color: BREAK_STYLE_COLOR
- }
- },
- selectedRangeColor: RANGE_COLOR,
- sliderMarker: {
- color: RANGE_COLOR,
- font: {
- color: DARK_BACKGROUND_COLOR
- }
- },
- sliderHandle: {
- color: WHITE,
- opacity: .2
- },
- shutter: {
- color: WHITE,
- opacity: .1
- }
- },
- map: {
- background: {
- borderColor: "#3f3f3f"
- },
- layer: {
- label: {
- stroke: BLACK,
- font: {
- color: WHITE
- }
- }
- },
- "layer:area": {
- borderColor: DARK_BACKGROUND_COLOR,
- color: AREA_LAYER_COLOR,
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- "layer:line": {
- color: "#c77244",
- hoveredColor: "#ff5d04",
- selectedColor: "#ff784f"
- },
- "layer:marker:bubble": {
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- "layer:marker:pie": {
- hoveredBorderColor: WHITE,
- selectedBorderColor: WHITE
- },
- legend: {
- border: {
- color: "#3f3f3f"
- },
- font: {
- color: WHITE
- }
- },
- controlBar: {
- borderColor: LINE_COLOR,
- color: DARK_BACKGROUND_COLOR
- }
- },
- treeMap: {
- group: {
- color: "#4c4c4c",
- label: {
- font: {
- color: "#a3a3a3"
- }
- }
- }
- },
- sparkline: {
- lineColor: LINE_COLOR,
- firstLastColor: LINE_COLOR,
- barPositiveColor: POSITIVE_COLOR,
- barNegativeColor: TARGET_COLOR,
- winColor: POSITIVE_COLOR,
- lossColor: TARGET_COLOR,
- pointColor: DARK_BACKGROUND_COLOR
- },
- bullet: {
- targetColor: TARGET_COLOR
- },
- funnel: {
- item: {
- border: {
- color: DARK_BACKGROUND_COLOR
- }
- }
- },
- sankey: {
- label: {
- font: {
- color: WHITE
- }
- }
- }
- }, "material");
- function registerMaterialColorScheme(accentName, themeName, accentColor) {
- registerTheme({
- name: "material." + accentName + "." + themeName,
- rangeSelector: {
- selectedRangeColor: accentColor,
- sliderMarker: {
- color: accentColor
- },
- sliderHandle: {
- color: accentColor
- }
- },
- map: {
- "layer:marker:dot": {
- color: accentColor
- },
- "layer:marker:bubble": {
- color: accentColor
- },
- legend: {
- markerColor: accentColor
- }
- },
- bullet: {
- color: accentColor
- },
- gauge: {
- valueIndicators: {
- rangebar: {
- color: accentColor
- },
- textcloud: {
- color: accentColor
- }
- }
- }
- }, "material." + themeName)
- }
- var materialAccents = {
- blue: "#03a9f4",
- lime: "#cddc39",
- orange: "#ff5722",
- purple: "#9c27b0",
- teal: "#009688"
- };
- for (var accent in materialAccents) {
- if (Object.prototype.hasOwnProperty.call(materialAccents, accent)) {
- var color = materialAccents[accent];
- registerMaterialColorScheme(accent, "light", color);
- registerMaterialColorScheme(accent, "dark", color);
- registerThemeAlias("material.".concat(accent, ".light.compact"), "material.".concat(accent, ".light"));
- registerThemeAlias("material.".concat(accent, ".dark.compact"), "material.".concat(accent, ".dark"))
- }
- }
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/viz/core/themes/ios.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var themeModule = __webpack_require__( /*! ../../themes */ 50);
- var IOS7_DEFAULT = "ios7.default";
- var SECONDARY_TEXT_COLOR = "#767676";
- var BORDER_COLOR = "#d3d3d3";
- var BLACK = "#000000";
- themeModule.registerTheme({
- name: IOS7_DEFAULT,
- backgroundColor: "#ffffff",
- primaryTitleColor: BLACK,
- secondaryTitleColor: SECONDARY_TEXT_COLOR,
- gridColor: "#ececec",
- axisColor: SECONDARY_TEXT_COLOR,
- legend: {
- font: {
- color: BLACK
- }
- },
- tooltip: {
- font: {
- color: SECONDARY_TEXT_COLOR
- }
- },
- "chart:common": {
- commonSeriesSettings: {
- label: {
- border: {
- color: BORDER_COLOR
- }
- }
- }
- },
- chart: {
- commonPaneSettings: {
- border: {
- color: BORDER_COLOR
- }
- }
- },
- rangeSelector: {
- scale: {
- tick: {
- color: BLACK,
- opacity: .1
- },
- minorTick: {
- color: BLACK,
- opacity: .03
- }
- }
- },
- treeMap: {
- group: {
- label: {
- font: {
- color: SECONDARY_TEXT_COLOR
- }
- }
- }
- }
- }, "generic.light")
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/core/errors_warnings.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var errorUtils = __webpack_require__( /*! ../../core/utils/error */ 129);
- var errors = __webpack_require__( /*! ../../core/errors */ 21);
- module.exports = errorUtils(errors.ERROR_MESSAGES, {
- E2001: "Invalid data source",
- E2002: "Axis type and data type are incompatible",
- E2003: 'The "{0}" data source field contains data of unsupported type',
- E2004: 'The "{0}" data source field is inconsistent',
- E2005: 'The value field "{0}" is absent in the data source or all its values are negative',
- E2006: "A cycle is detected in provided data",
- E2007: 'The value field "{0}" is absent in the data source',
- E2008: 'The value field "{0}" must be a string',
- E2009: 'The value field "{0}" must be a positive numeric value',
- E2101: "Unknown series type: {0}",
- E2102: "Ambiguity occurred between two value axes with the same name",
- E2103: 'The "{0}" option is given an invalid value. Assign a function instead',
- E2104: "Invalid logarithm base",
- E2105: 'Invalid value of a "{0}"',
- E2106: "Invalid visible range",
- E2202: "Invalid {0} scale value",
- E2203: "The range you are trying to set is invalid",
- W2002: "The {0} series cannot be drawn because the {1} data field is missing",
- W2003: "Tick interval is too small",
- W2101: 'The "{0}" pane does not exist; the last pane is used by default',
- W2102: 'A value axis with the "{0}" name was created automatically',
- W2103: "The chart title was hidden due to the container size",
- W2104: "The legend was hidden due to the container size",
- W2105: 'The title of the "{0}" axis was hidden due to the container size',
- W2106: 'The labels of the "{0}" axis were hidden due to the container size',
- W2107: "The export menu was hidden due to the container size",
- W2108: "The browser does not support exporting images to {0} format.",
- W2301: "Invalid value range"
- })
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/core/renderers/animation.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var animationFrame = __webpack_require__( /*! ../../../animation/frame */ 112);
- var noop = function() {};
- var easingFunctions = {
- easeOutCubic: function(pos, start, end) {
- return 1 === pos ? end : (1 - Math.pow(1 - pos, 3)) * (end - start) + +start
- },
- linear: function(pos, start, end) {
- return 1 === pos ? end : pos * (end - start) + +start
- }
- };
- exports.easingFunctions = easingFunctions;
- var animationSvgStep = {
- segments: function segments(elem, params, progress, easing, currentParams) {
- var from = params.from;
- var to = params.to;
- var curSeg;
- var seg;
- var i;
- var j;
- var segments = [];
- for (i = 0; i < from.length; i++) {
- curSeg = from[i];
- seg = [curSeg[0]];
- if (curSeg.length > 1) {
- for (j = 1; j < curSeg.length; j++) {
- seg.push(easing(progress, curSeg[j], to[i][j]))
- }
- }
- segments.push(seg)
- }
- currentParams.segments = params.end && 1 === progress ? params.end : segments;
- elem.attr({
- segments: segments
- })
- },
- arc: function(elem, params, progress, easing) {
- var from = params.from;
- var to = params.to;
- var current = {};
- for (var i in from) {
- current[i] = easing(progress, from[i], to[i])
- }
- elem.attr(current)
- },
- transform: function(elem, params, progress, easing, currentParams) {
- var from = params.from;
- var to = params.to;
- var current = {};
- for (var i in from) {
- current[i] = currentParams[i] = easing(progress, from[i], to[i])
- }
- elem.attr(current)
- },
- base: function(elem, params, progress, easing, currentParams, attributeName) {
- var obj = {};
- obj[attributeName] = currentParams[attributeName] = easing(progress, params.from, params.to);
- elem.attr(obj)
- },
- _: noop,
- complete: function(element, currentSettings) {
- element.attr(currentSettings)
- }
- };
- function step(now) {
- var that = this;
- var animateStep = that._animateStep;
- var attrName;
- that._progress = that._calcProgress(now);
- for (attrName in that.params) {
- var anim = animateStep[attrName] || animateStep.base;
- anim(that.element, that.params[attrName], that._progress, that._easing, that._currentParams, attrName)
- }
- that.options.step && that.options.step(that._easing(that._progress, 0, 1), that._progress);
- if (1 === that._progress) {
- return that.stop()
- }
- return true
- }
- function delayTick(now) {
- if (now - this._startTime >= this.delay) {
- this.tick = step
- }
- return true
- }
- function start(now) {
- this._startTime = now;
- this.tick = this.delay ? delayTick : step;
- return true
- }
- function Animation(element, params, options) {
- var that = this;
- that._progress = 0;
- that.element = element;
- that.params = params;
- that.options = options;
- that.duration = options.partitionDuration ? options.duration * options.partitionDuration : options.duration;
- that.delay = options.delay && options.duration * options.delay || 0;
- that._animateStep = options.animateStep || animationSvgStep;
- that._easing = easingFunctions[options.easing] || easingFunctions.easeOutCubic;
- that._currentParams = {};
- that.tick = start
- }
- Animation.prototype = {
- _calcProgress: function(now) {
- return Math.min(1, (now - this.delay - this._startTime) / this.duration)
- },
- stop: function(disableComplete) {
- var that = this;
- var options = that.options;
- var animateStep = that._animateStep;
- that.stop = that.tick = noop;
- animateStep.complete && animateStep.complete(that.element, that._currentParams);
- options.complete && !disableComplete && options.complete()
- }
- };
- function AnimationController(element) {
- var that = this;
- that._animationCount = 0;
- that._timerId = null;
- that._animations = {};
- that.element = element
- }
- exports.AnimationController = AnimationController;
- AnimationController.prototype = {
- _loop: function() {
- var that = this;
- var animations = that._animations;
- var activeAnimation = 0;
- var now = (new Date).getTime();
- var an;
- var endAnimation = that._endAnimation;
- for (an in animations) {
- if (!animations[an].tick(now)) {
- delete animations[an]
- }
- activeAnimation++
- }
- if (0 === activeAnimation) {
- that.stop();
- that._endAnimationTimer = endAnimation && setTimeout(function() {
- if (0 === that._animationCount) {
- endAnimation();
- that._endAnimation = null
- }
- });
- return
- }
- that._timerId = animationFrame.requestAnimationFrame.call(null, function() {
- that._loop()
- }, that.element)
- },
- addAnimation: function(animation) {
- var that = this;
- that._animations[that._animationCount++] = animation;
- clearTimeout(that._endAnimationTimer);
- if (!that._timerId) {
- clearTimeout(that._startDelay);
- that._startDelay = setTimeout(function() {
- that._timerId = 1;
- that._loop()
- }, 0)
- }
- },
- animateElement: function(elem, params, options) {
- if (elem && params && options) {
- elem.animation && elem.animation.stop();
- this.addAnimation(elem.animation = new Animation(elem, params, options))
- }
- },
- onEndAnimation: function(endAnimation) {
- this._animationCount ? this._endAnimation = endAnimation : endAnimation()
- },
- dispose: function() {
- this.stop();
- this.element = null
- },
- stop: function() {
- var that = this;
- that._animations = {};
- that._animationCount = 0;
- animationFrame.cancelAnimationFrame(that._timerId);
- clearTimeout(that._startDelay);
- clearTimeout(that._endAnimationTimer);
- that._timerId = null
- },
- lock: function() {
- var an;
- var animations = this._animations;
- var unstoppable;
- var hasUnstoppableInAnimations;
- for (an in animations) {
- unstoppable = animations[an].options.unstoppable;
- hasUnstoppableInAnimations = hasUnstoppableInAnimations || unstoppable;
- if (!unstoppable) {
- animations[an].stop(true);
- delete animations[an]
- }
- }!hasUnstoppableInAnimations && this.stop()
- }
- };
- exports.animationSvgStep = animationSvgStep;
- exports.Animation = Animation;
- exports.noop = noop
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/viz/core/layout.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _normalizeEnum = __webpack_require__( /*! ./utils */ 10).normalizeEnum;
- var _min = Math.min;
- var _max = Math.max;
- var _round = Math.round;
- var ALIGN_START = 0;
- var ALIGN_MIDDLE = 1;
- var ALIGN_END = 2;
- var horizontalAlignmentMap = {
- left: ALIGN_START,
- center: ALIGN_MIDDLE,
- right: ALIGN_END
- };
- var verticalAlignmentMap = {
- top: ALIGN_START,
- center: ALIGN_MIDDLE,
- bottom: ALIGN_END
- };
- var sideMap = {
- horizontal: 0,
- vertical: 1
- };
- var slicersMap = {};
- var BBOX_CEIL_CORRECTION = 2;
- slicersMap[ALIGN_START] = function(a, b, size) {
- return [a, _min(b, a + size)]
- };
- slicersMap[ALIGN_MIDDLE] = function(a, b, size) {
- return [_max(a, (a + b - size) / 2), _min(b, (a + b + size) / 2)]
- };
- slicersMap[ALIGN_END] = function(a, b, size) {
- return [_max(a, b - size), b]
- };
- function pickValue(value, map, defaultValue) {
- var val = _normalizeEnum(value);
- return val in map ? map[val] : defaultValue
- }
- function normalizeLayoutOptions(options) {
- var side = pickValue(options.side, sideMap, 1);
- var alignment = [pickValue(options.horizontalAlignment, horizontalAlignmentMap, ALIGN_MIDDLE), pickValue(options.verticalAlignment, verticalAlignmentMap, ALIGN_START)];
- return {
- side: side,
- primary: bringToEdge(alignment[side]),
- secondary: alignment[1 - side],
- weak: options.weak,
- priority: options.priority || 0,
- header: options.header,
- position: options.position
- }
- }
- function bringToEdge(primary) {
- return primary < 2 ? 0 : 2
- }
- function getConjugateSide(side) {
- return 1 - side
- }
- function getSlice(alignment, a, b, size) {
- return slicersMap[alignment](a, b, size)
- }
- function getShrink(alignment, size) {
- return (alignment > 0 ? -1 : 1) * size
- }
- function processForward(item, rect, minSize) {
- var side = item.side;
- var size = item.element.measure([rect[2] - rect[0], rect[3] - rect[1]]);
- var minSide = "indside" === item.position ? 0 : minSize[side];
- var isValid = size[side] < rect[2 + side] - rect[side] - minSide;
- if (isValid) {
- if ("inside" !== item.position) {
- rect[item.primary + side] += getShrink(item.primary, size[side])
- }
- item.size = size
- }
- return isValid
- }
- function processRectBackward(item, rect, alignmentRect) {
- var primarySide = item.side;
- var secondarySide = getConjugateSide(primarySide);
- var itemRect = [];
- var secondary = getSlice(item.secondary, alignmentRect[secondarySide], alignmentRect[2 + secondarySide], item.size[secondarySide]);
- itemRect[primarySide] = _round(itemRect[2 + primarySide] = rect[item.primary + primarySide] + ("inside" === item.position ? getShrink(item.primary, item.size[primarySide]) : 0));
- itemRect[item.primary + primarySide] = _round(rect[item.primary + primarySide] - getShrink(item.primary, item.size[primarySide]));
- if ("inside" !== item.position) {
- rect[item.primary + primarySide] = itemRect[item.primary + primarySide]
- }
- itemRect[secondarySide] = _round(secondary[0]);
- itemRect[2 + secondarySide] = _round(secondary[1]);
- return itemRect
- }
- function processBackward(item, rect, alignmentRect, fitRect, size, targetRect) {
- var itemRect = processRectBackward(item, rect, alignmentRect);
- var itemFitRect = processRectBackward(item, fitRect, fitRect);
- if (size[item.side] > 0) {
- size[item.side] -= item.size[item.side];
- targetRect[item.primary + item.side] = itemRect[item.primary + item.side];
- item.element.freeSpace()
- } else {
- item.element.move(itemRect, itemFitRect)
- }
- }
- function Layout() {
- this._targets = []
- }
- Layout.prototype = {
- constructor: Layout,
- dispose: function() {
- this._targets = null
- },
- add: function(target) {
- this._targets.push(target)
- },
- forward: function(targetRect, minSize) {
- var rect = targetRect.slice();
- var targets = createTargets(this._targets);
- var i;
- var ii = targets.length;
- var cache = [];
- for (i = 0; i < ii; ++i) {
- if (processForward(targets[i], rect, minSize)) {
- cache.push(targets[i])
- } else {
- targets[i].element.freeSpace()
- }
- }
- this._cache = cache.reverse();
- return rect
- },
- backward: function(targetRect, alignmentRect) {
- var size = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [0, 0];
- var backwardRect = targetRect.slice();
- var fitRect = targetRect.slice();
- var targets = this._cache;
- var targetSide = 0;
- var target;
- var i;
- var ii = targets.length;
- for (i = 0; i < ii; ++i) {
- target = targets[i];
- if (target.side !== targetSide) {
- backwardRect = targetRect.slice()
- }
- processBackward(target, backwardRect, alignmentRect, fitRect, size, targetRect);
- targetSide = target.side
- }
- return size
- }
- };
- function createTargets(targets) {
- var i;
- var ii = targets.length;
- var collection = [];
- var layout;
- for (i = 0; i < ii; ++i) {
- layout = targets[i].layoutOptions();
- if (layout) {
- layout = normalizeLayoutOptions(layout);
- layout.element = targets[i];
- collection.push(layout)
- }
- }
- collection.sort(function(a, b) {
- return b.side - a.side || a.priority - b.priority
- });
- collection = processWeakItems(collection);
- return collection
- }
- function processWeakItems(collection) {
- var weakItem = collection.filter(function(item) {
- return true === item.weak
- })[0];
- var headerItem;
- if (weakItem) {
- headerItem = collection.filter(function(item) {
- return weakItem.primary === item.primary && item.side === weakItem.side && item !== weakItem
- })[0]
- }
- if (weakItem && headerItem) {
- return [makeHeader(headerItem, weakItem)].concat(collection.filter(function(item) {
- return !(item === headerItem || item === weakItem)
- }))
- }
- return collection
- }
- function processBackwardHeaderRect(element, rect) {
- var rectCopy = rect.slice();
- var itemRect = processRectBackward(element, rectCopy, rectCopy);
- itemRect[element.side] = rect[element.side];
- itemRect[2 + element.side] = rect[2 + element.side];
- return itemRect
- }
- function makeHeader(header, weakElement) {
- var side = header.side;
- var primary = header.primary;
- var secondary = header.secondary;
- return {
- side: side,
- primary: primary,
- secondary: secondary,
- priority: 0,
- element: {
- measure: function(targetSize) {
- var result = targetSize.slice();
- var weakSize = weakElement.element.measure(targetSize.slice());
- targetSize[primary] -= weakSize[primary];
- var headerSize = header.element.measure(targetSize.slice());
- result[side] = weakSize[side] = headerSize[side] = Math.max(headerSize[side], weakSize[side]);
- weakElement.size = weakSize;
- header.size = headerSize;
- return result
- },
- move: function(rect, fitRect) {
- if (fitRect[2] - fitRect[0] < header.size[0] + weakElement.size[0] - BBOX_CEIL_CORRECTION) {
- this.freeSpace();
- return
- }
- var weakRect = processBackwardHeaderRect(weakElement, fitRect, fitRect);
- fitRect[2 + weakElement.primary] = weakRect[weakElement.primary];
- var headerFitReact = processBackwardHeaderRect(header, fitRect, fitRect);
- if (fitRect[2 + weakElement.primary] < rect[2 + weakElement.primary] && header.size[header.primary] > rect[2 + header.primary] - rect[header.primary]) {
- rect[2 + weakElement.primary] = fitRect[2 + weakElement.primary]
- }
- var headerRect = processBackwardHeaderRect(header, rect, rect);
- if (headerRect[2 + weakElement.primary] > fitRect[2 + weakElement.primary]) {
- rect[2 + weakElement.primary] = fitRect[2 + weakElement.primary];
- headerRect = processBackwardHeaderRect(header, rect, rect)
- }
- weakElement.element.move(weakRect);
- header.element.move(headerRect, headerFitReact)
- },
- freeSpace: function() {
- header.element.freeSpace();
- weakElement.element.freeSpace()
- }
- }
- }
- }
- module.exports = Layout
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/base_point.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var mixins = {};
- var statesConsts = __webpack_require__( /*! ../../components/consts */ 117).states;
- var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
- var barPoint = __webpack_require__( /*! ./bar_point */ 202);
- var bubblePoint = __webpack_require__( /*! ./bubble_point */ 768);
- var piePoint = __webpack_require__( /*! ./pie_point */ 398);
- var rangeSymbolPoint = __webpack_require__( /*! ./range_symbol_point */ 399);
- var rangeBarPoint = __webpack_require__( /*! ./range_bar_point */ 769);
- var candlestickPoint = __webpack_require__( /*! ./candlestick_point */ 400);
- var stockPoint = __webpack_require__( /*! ./stock_point */ 770);
- var polarPoints = __webpack_require__( /*! ./polar_point */ 771);
- var _normalizeEnum = __webpack_require__( /*! ../../core/utils */ 10).normalizeEnum;
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each;
- var _each = each;
- var _extend = extend;
- var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
- var _noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
- var SYMBOL_POINT = "symbolPoint";
- var POLAR_SYMBOL_POINT = "polarSymbolPoint";
- var BAR_POINT = "barPoint";
- var POLAR_BAR_POINT = "polarBarPoint";
- var PIE_POINT = "piePoint";
- var SELECTED_STATE = statesConsts.selectedMark;
- var HOVER_STATE = statesConsts.hoverMark;
- var NORMAL_STATE = statesConsts.normalMark;
- var HOVER = statesConsts.hover;
- var NORMAL = statesConsts.normal;
- var SELECTION = statesConsts.selection;
- var pointTypes = {
- chart: {
- scatter: SYMBOL_POINT,
- line: SYMBOL_POINT,
- spline: SYMBOL_POINT,
- stepline: SYMBOL_POINT,
- stackedline: SYMBOL_POINT,
- fullstackedline: SYMBOL_POINT,
- stackedspline: SYMBOL_POINT,
- fullstackedspline: SYMBOL_POINT,
- stackedsplinearea: SYMBOL_POINT,
- fullstackedsplinearea: SYMBOL_POINT,
- area: SYMBOL_POINT,
- splinearea: SYMBOL_POINT,
- steparea: SYMBOL_POINT,
- stackedarea: SYMBOL_POINT,
- fullstackedarea: SYMBOL_POINT,
- rangearea: "rangeSymbolPoint",
- bar: BAR_POINT,
- stackedbar: BAR_POINT,
- fullstackedbar: BAR_POINT,
- rangebar: "rangeBarPoint",
- bubble: "bubblePoint",
- stock: "stockPoint",
- candlestick: "candlestickPoint"
- },
- pie: {
- pie: PIE_POINT,
- doughnut: PIE_POINT,
- donut: PIE_POINT
- },
- polar: {
- scatter: POLAR_SYMBOL_POINT,
- line: POLAR_SYMBOL_POINT,
- area: POLAR_SYMBOL_POINT,
- bar: POLAR_BAR_POINT,
- stackedbar: POLAR_BAR_POINT
- }
- };
- function isNoneMode(mode) {
- return "none" === _normalizeEnum(mode)
- }
- function Point(series, dataItem, options) {
- this.fullState = NORMAL_STATE;
- this.series = series;
- this.update(dataItem, options);
- this._viewCounters = {
- hover: 0,
- selection: 0
- };
- this._emptySettings = {
- fill: null,
- stroke: null,
- dashStyle: null
- }
- }
- exports.Point = Point;
- mixins.symbolPoint = symbolPoint;
- mixins.barPoint = barPoint;
- mixins.bubblePoint = bubblePoint;
- mixins.piePoint = piePoint;
- mixins.rangeSymbolPoint = rangeSymbolPoint;
- mixins.rangeBarPoint = rangeBarPoint;
- mixins.candlestickPoint = candlestickPoint;
- mixins.stockPoint = stockPoint;
- mixins.polarSymbolPoint = polarPoints.polarSymbolPoint;
- mixins.polarBarPoint = polarPoints.polarBarPoint;
- Point.prototype = {
- constructor: Point,
- getColor: function() {
- if (!this.hasValue() && !this._styles.usePointCustomOptions) {
- this.series.customizePoint(this, this._dataItem)
- }
- return this._styles.normal.fill || this.series.getColor()
- },
- _getStyle: function() {
- return this._styles[this._currentStyle || "normal"]
- },
- update: function(dataItem, options) {
- this.updateOptions(options);
- this.updateData(dataItem)
- },
- updateData: function(dataItem) {
- var that = this;
- var argumentWasChanged = that.argument !== dataItem.argument;
- that.argument = that.initialArgument = that.originalArgument = dataItem.argument;
- that.tag = dataItem.tag;
- that.index = dataItem.index;
- that._dataItem = dataItem;
- that.data = dataItem.data;
- that.lowError = dataItem.lowError;
- that.highError = dataItem.highError;
- that.aggregationInfo = dataItem.aggregationInfo;
- that._updateData(dataItem, argumentWasChanged);
- !that.hasValue() && that.setInvisibility();
- that._fillStyle();
- that._updateLabelData()
- },
- deleteMarker: function() {
- var that = this;
- if (that.graphic) {
- that.graphic.dispose()
- }
- that.graphic = null
- },
- draw: function(renderer, groups, animationEnabled, firstDrawing) {
- var that = this;
- if (that._needDeletingOnDraw || that.series.autoHidePointMarkers && !that.isSelected()) {
- that.deleteMarker();
- that._needDeletingOnDraw = false
- }
- if (that._needClearingOnDraw) {
- that.clearMarker();
- that._needClearingOnDraw = false
- }
- if (!that._hasGraphic()) {
- that.getMarkerVisibility() && !that.series.autoHidePointMarkers && that._drawMarker(renderer, groups.markers, animationEnabled, firstDrawing)
- } else {
- that._updateMarker(animationEnabled, this._getStyle(), groups.markers)
- }
- that._drawLabel();
- that._drawErrorBar(renderer, groups.errorBars, animationEnabled);
- return that
- },
- _getViewStyle: function() {
- var state = NORMAL_STATE;
- var fullState = this.fullState;
- var styles = [NORMAL, HOVER, SELECTION, SELECTION];
- if (this._viewCounters.hover) {
- state |= HOVER_STATE
- }
- if (this._viewCounters.selection) {
- state |= SELECTED_STATE
- }
- if (isNoneMode(this.getOptions().selectionMode)) {
- fullState &= ~SELECTED_STATE
- }
- if (isNoneMode(this.getOptions().hoverMode)) {
- fullState &= ~HOVER_STATE
- }
- state |= fullState;
- return styles[state]
- },
- applyView: function(legendCallback) {
- var style = this._getViewStyle();
- var that = this;
- that._currentStyle = style;
- if (!that.graphic && that.series.autoHidePointMarkers && (style === SELECTION || style === HOVER)) {
- that._drawMarker(that.series.getRenderer(), that.series.getMarkersGroup())
- }
- if (that.graphic) {
- if (that.series.autoHidePointMarkers && style !== SELECTION && style !== HOVER) {
- that.deleteMarker()
- } else {
- if ("normal" === style) {
- that.clearMarker()
- } else {
- that.graphic.toForeground()
- }
- that._updateMarker(true, that._styles[style], void 0, legendCallback)
- }
- }
- },
- setView: function(style) {
- this._viewCounters[style]++;
- this.applyView()
- },
- resetView: function(style) {
- var viewCounters = this._viewCounters;
- --viewCounters[style];
- if (viewCounters[style] < 0) {
- viewCounters[style] = 0
- }
- this.applyView()
- },
- releaseHoverState: function() {
- var that = this;
- if (that.graphic && !that.isSelected()) {
- that.graphic.toBackground()
- }
- },
- select: function() {
- this.series.selectPoint(this)
- },
- clearSelection: function() {
- this.series.deselectPoint(this)
- },
- hover: function() {
- this.series.hoverPoint(this)
- },
- clearHover: function() {
- this.series.clearPointHover()
- },
- showTooltip: function() {
- this.series.showPointTooltip(this)
- },
- hideTooltip: function() {
- this.series.hidePointTooltip(this)
- },
- _checkLabelsChanging: function(oldType, newType) {
- var isNewRange = ~newType.indexOf("range");
- var isOldRange = ~oldType.indexOf("range");
- return isOldRange && !isNewRange || !isOldRange && isNewRange
- },
- updateOptions: function(newOptions) {
- if (!newOptions) {
- return
- }
- var that = this;
- var oldOptions = that._options;
- var widgetType = newOptions.widgetType;
- var oldType = oldOptions && oldOptions.type;
- var newType = newOptions.type;
- var newPointTypeMixin = pointTypes[widgetType][newType];
- if (oldType !== newType) {
- that._needDeletingOnDraw = true;
- that._needClearingOnDraw = false;
- if (oldType) {
- that._checkLabelsChanging(oldType, newType) && that.deleteLabel();
- that._resetType(mixins[pointTypes[oldType]])
- }
- that._setType(mixins[newPointTypeMixin])
- } else {
- that._needDeletingOnDraw = that._checkSymbol(oldOptions, newOptions);
- that._needClearingOnDraw = that._checkCustomize(oldOptions, newOptions)
- }
- that._options = newOptions;
- that._fillStyle();
- that._updateLabelOptions(newPointTypeMixin)
- },
- translate: function() {
- if (this.hasValue()) {
- this._translate();
- this.translated = true
- }
- },
- _checkCustomize: function(oldOptions, newOptions) {
- return oldOptions.styles.usePointCustomOptions && !newOptions.styles.usePointCustomOptions
- },
- _getCustomLabelVisibility: function() {
- return this._styles.useLabelCustomOptions ? !!this._options.label.visible : null
- },
- getBoundingRect: function() {
- return this._getGraphicBBox()
- },
- _resetType: function(methods) {
- for (var methodName in methods) {
- delete this[methodName]
- }
- },
- _setType: function(methods) {
- for (var methodName in methods) {
- this[methodName] = methods[methodName]
- }
- },
- isInVisibleArea: function() {
- return this.inVisibleArea
- },
- isSelected: function() {
- return !!(this.fullState & SELECTED_STATE)
- },
- isHovered: function() {
- return !!(this.fullState & HOVER_STATE)
- },
- getOptions: function() {
- return this._options
- },
- animate: function(complete, settings, partitionDuration) {
- if (!this.graphic) {
- complete && complete();
- return
- }
- this.graphic.animate(settings, {
- partitionDuration: partitionDuration
- }, complete)
- },
- getCoords: function(min) {
- var that = this;
- if (!min) {
- return {
- x: that.x,
- y: that.y
- }
- }
- if (!that._options.rotated) {
- return {
- x: that.x,
- y: that.minY + (that.y - that.minY ? 0 : 1)
- }
- }
- return {
- x: that.minX - (that.x - that.minX ? 0 : 1),
- y: that.y
- }
- },
- getDefaultCoords: function() {
- var that = this;
- return !that._options.rotated ? {
- x: that.x,
- y: that.defaultY
- } : {
- x: that.defaultX,
- y: that.y
- }
- },
- setDefaultCoords: function() {
- var coords = this.getDefaultCoords();
- this.x = coords.x;
- this.y = coords.y
- },
- _getVisibleArea: function() {
- return this.series.getVisibleArea()
- },
- _getArgTranslator: function() {
- return this.series.getArgumentAxis().getTranslator()
- },
- _getValTranslator: function() {
- return this.series.getValueAxis().getTranslator()
- },
- _calculateVisibility: function(x, y, width, height) {
- var that = this;
- var visibleArea = that._getVisibleArea();
- var rotated = that._options.rotated;
- if (visibleArea.minX > x + (width || 0) || visibleArea.maxX < x || visibleArea.minY > y + (height || 0) || visibleArea.maxY < y || rotated && _isDefined(width) && 0 !== width && (visibleArea.minX === x + width || visibleArea.maxX === x) || !rotated && _isDefined(height) && 0 !== height && (visibleArea.minY === y + height || visibleArea.maxY === y)) {
- that.inVisibleArea = false
- } else {
- that.inVisibleArea = true
- }
- },
- hasValue: function() {
- return null !== this.value && null !== this.minValue
- },
- hasCoords: _noop,
- correctPosition: _noop,
- correctRadius: _noop,
- correctLabelRadius: _noop,
- getCrosshairData: _noop,
- getPointRadius: _noop,
- _populatePointShape: _noop,
- _checkSymbol: _noop,
- getMarkerCoords: _noop,
- hide: _noop,
- show: _noop,
- hideMarker: _noop,
- setInvisibility: _noop,
- clearVisibility: _noop,
- isVisible: _noop,
- resetCorrection: _noop,
- correctValue: _noop,
- resetValue: _noop,
- setPercentValue: _noop,
- correctCoordinates: _noop,
- coordsIn: _noop,
- getTooltipParams: _noop,
- applyWordWrap: _noop,
- setLabelTrackerData: _noop,
- updateLabelCoord: _noop,
- drawLabel: _noop,
- correctLabelPosition: _noop,
- getMinValue: _noop,
- getMaxValue: _noop,
- _drawErrorBar: _noop,
- getMarkerVisibility: _noop,
- dispose: function() {
- var that = this;
- that.deleteMarker();
- that.deleteLabel();
- that._errorBar && this._errorBar.dispose();
- that._options = that._styles = that.series = that._errorBar = null
- },
- getTooltipFormatObject: function(tooltip) {
- var that = this;
- var tooltipFormatObject = that._getFormatObject(tooltip);
- var sharedTooltipValuesArray = [];
- var tooltipStackPointsFormatObject = [];
- if (that.stackPoints) {
- _each(that.stackPoints, function(_, point) {
- if (!point.isVisible()) {
- return
- }
- var formatObject = point._getFormatObject(tooltip);
- tooltipStackPointsFormatObject.push(formatObject);
- sharedTooltipValuesArray.push(formatObject.seriesName + ": " + formatObject.valueText)
- });
- _extend(tooltipFormatObject, {
- points: tooltipStackPointsFormatObject,
- valueText: sharedTooltipValuesArray.join("\n"),
- stackName: that.stackPoints.stackName
- })
- }
- var aggregationInfo = that.aggregationInfo;
- if (aggregationInfo) {
- var axis = that.series.getArgumentAxis();
- var rangeText = axis.formatRange(aggregationInfo.intervalStart, aggregationInfo.intervalEnd, aggregationInfo.aggregationInterval);
- if (rangeText) {
- tooltipFormatObject.valueText += "\n".concat(rangeText)
- }
- }
- return tooltipFormatObject
- },
- setHole: function(holeValue, position) {
- var that = this;
- var minValue = isFinite(that.minValue) ? that.minValue : 0;
- if (_isDefined(holeValue)) {
- if ("left" === position) {
- that.leftHole = that.value - holeValue;
- that.minLeftHole = minValue - holeValue
- } else {
- that.rightHole = that.value - holeValue;
- that.minRightHole = minValue - holeValue
- }
- }
- },
- resetHoles: function() {
- this.leftHole = null;
- this.minLeftHole = null;
- this.rightHole = null;
- this.minRightHole = null
- },
- getLabel: function() {
- return this._label
- },
- getLabels: function() {
- return [this._label]
- },
- getCenterCoord: function() {
- return {
- x: this.x,
- y: this.y
- }
- }
- }
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/bubble_point.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
- var _extend = extend;
- var MIN_BUBBLE_HEIGHT = 20;
- module.exports = _extend({}, symbolPoint, {
- correctCoordinates: function(diameter) {
- this.bubbleSize = diameter / 2
- },
- _drawMarker: function(renderer, group, animationEnabled) {
- var that = this;
- var attr = _extend({
- translateX: that.x,
- translateY: that.y
- }, that._getStyle());
- that.graphic = renderer.circle(0, 0, animationEnabled ? 0 : that.bubbleSize).smartAttr(attr).data({
- "chart-data-point": that
- }).append(group)
- },
- getTooltipParams: function(location) {
- var that = this;
- var graphic = that.graphic;
- if (!graphic) {
- return
- }
- var height = graphic.getBBox().height;
- return {
- x: that.x,
- y: that.y,
- offset: height < MIN_BUBBLE_HEIGHT || "edge" === location ? height / 2 : 0
- }
- },
- _getLabelFormatObject: function() {
- var formatObject = symbolPoint._getLabelFormatObject.call(this);
- formatObject.size = this.initialSize;
- return formatObject
- },
- _updateData: function(data) {
- symbolPoint._updateData.call(this, data);
- this.size = this.initialSize = data.size
- },
- _getGraphicBBox: function() {
- var that = this;
- return that._getSymbolBBox(that.x, that.y, that.bubbleSize)
- },
- _updateMarker: function(animationEnabled, style) {
- var that = this;
- if (!animationEnabled) {
- style = _extend({
- r: that.bubbleSize,
- translateX: that.x,
- translateY: that.y
- }, style)
- }
- that.graphic.smartAttr(style)
- },
- _getFormatObject: function(tooltip) {
- var formatObject = symbolPoint._getFormatObject.call(this, tooltip);
- formatObject.sizeText = tooltip.formatValue(this.initialSize);
- return formatObject
- },
- _storeTrackerR: function() {
- return this.bubbleSize
- },
- _getLabelCoords: function(label) {
- var coords;
- if ("inside" === label.getLayoutOptions().position) {
- coords = this._getLabelCoordOfPosition(label, "inside")
- } else {
- coords = symbolPoint._getLabelCoords.call(this, label)
- }
- return coords
- }
- })
- },
- /*!*******************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/range_bar_point.js ***!
- \*******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var barPoint = __webpack_require__( /*! ./bar_point */ 202);
- var rangeSymbolPointMethods = __webpack_require__( /*! ./range_symbol_point */ 399);
- var _extend = extend;
- module.exports = _extend({}, barPoint, {
- deleteLabel: rangeSymbolPointMethods.deleteLabel,
- _getFormatObject: rangeSymbolPointMethods._getFormatObject,
- clearVisibility: function() {
- var graphic = this.graphic;
- if (graphic && graphic.attr("visibility")) {
- graphic.attr({
- visibility: null
- })
- }
- },
- setInvisibility: function() {
- var graphic = this.graphic;
- if (graphic && "hidden" !== graphic.attr("visibility")) {
- graphic.attr({
- visibility: "hidden"
- })
- }
- this._topLabel.draw(false);
- this._bottomLabel.draw(false)
- },
- getTooltipParams: function(location) {
- var that = this;
- var edgeLocation = "edge" === location;
- var x;
- var y;
- if (that._options.rotated) {
- x = edgeLocation ? that.x + that.width : that.x + that.width / 2;
- y = that.y + that.height / 2
- } else {
- x = that.x + that.width / 2;
- y = edgeLocation ? that.y : that.y + that.height / 2
- }
- return {
- x: x,
- y: y,
- offset: 0
- }
- },
- _translate: function() {
- var that = this;
- var barMethods = barPoint;
- barMethods._translate.call(that);
- if (that._options.rotated) {
- that.width = that.width || 1
- } else {
- that.height = that.height || 1
- }
- },
- hasCoords: rangeSymbolPointMethods.hasCoords,
- _updateData: rangeSymbolPointMethods._updateData,
- _getLabelPosition: rangeSymbolPointMethods._getLabelPosition,
- _getLabelMinFormatObject: rangeSymbolPointMethods._getLabelMinFormatObject,
- _updateLabelData: rangeSymbolPointMethods._updateLabelData,
- _updateLabelOptions: rangeSymbolPointMethods._updateLabelOptions,
- getCrosshairData: rangeSymbolPointMethods.getCrosshairData,
- _createLabel: rangeSymbolPointMethods._createLabel,
- _checkOverlay: rangeSymbolPointMethods._checkOverlay,
- _checkLabelsOverlay: rangeSymbolPointMethods._checkLabelsOverlay,
- _getOverlayCorrections: rangeSymbolPointMethods._getOverlayCorrections,
- _drawLabel: rangeSymbolPointMethods._drawLabel,
- _getLabelCoords: rangeSymbolPointMethods._getLabelCoords,
- _getGraphicBBox: function(location) {
- var isTop = "top" === location;
- var bBox = barPoint._getGraphicBBox.call(this);
- if (!this._options.rotated) {
- bBox.y = isTop ? bBox.y : bBox.y + bBox.height;
- bBox.height = 0
- } else {
- bBox.x = isTop ? bBox.x + bBox.width : bBox.x;
- bBox.width = 0
- }
- return bBox
- },
- getLabel: rangeSymbolPointMethods.getLabel,
- getLabels: rangeSymbolPointMethods.getLabels,
- getBoundingRect: noop,
- getMinValue: rangeSymbolPointMethods.getMinValue,
- getMaxValue: rangeSymbolPointMethods.getMaxValue
- })
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/stock_point.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var isNumeric = __webpack_require__( /*! ../../../core/utils/type */ 1).isNumeric;
- var candlestickPoint = __webpack_require__( /*! ./candlestick_point */ 400);
- var _extend = extend;
- var _isNumeric = isNumeric;
- module.exports = _extend({}, candlestickPoint, {
- _getPoints: function() {
- var that = this;
- var createPoint = that._options.rotated ? function(x, y) {
- return [y, x]
- } : function(x, y) {
- return [x, y]
- };
- var openYExist = _isNumeric(that.openY);
- var closeYExist = _isNumeric(that.closeY);
- var x = that.x;
- var width = that.width;
- var points;
- points = [].concat(createPoint(x, that.highY));
- openYExist && (points = points.concat(createPoint(x, that.openY)));
- openYExist && (points = points.concat(createPoint(x - width / 2, that.openY)));
- openYExist && (points = points.concat(createPoint(x, that.openY)));
- closeYExist && (points = points.concat(createPoint(x, that.closeY)));
- closeYExist && (points = points.concat(createPoint(x + width / 2, that.closeY)));
- closeYExist && (points = points.concat(createPoint(x, that.closeY)));
- points = points.concat(createPoint(x, that.lowY));
- return points
- },
- _drawMarkerInGroup: function(group, attributes, renderer) {
- this.graphic = renderer.path(this._getPoints(), "line").attr({
- "stroke-linecap": "square"
- }).attr(attributes).data({
- "chart-data-point": this
- }).sharp().append(group)
- },
- _getMinTrackerWidth: function() {
- var width = 2 + this._styles.normal["stroke-width"];
- return width + width % 2
- }
- })
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/points/polar_point.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
- var _extend = extend;
- var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
- var barPoint = __webpack_require__( /*! ./bar_point */ 202);
- var piePoint = __webpack_require__( /*! ./pie_point */ 398);
- var isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
- var vizUtils = __webpack_require__( /*! ../../core/utils */ 10);
- var normalizeAngle = vizUtils.normalizeAngle;
- var _math = Math;
- var _max = _math.max;
- var RADIAL_LABEL_INDENT = __webpack_require__( /*! ../../components/consts */ 117).radialLabelIndent;
- var ERROR_BARS_ANGLE_OFFSET = 90;
- var CANVAS_POSITION_END = "canvas_position_end";
- var CANVAS_POSITION_DEFAULT = "canvas_position_default";
- exports.polarSymbolPoint = _extend({}, symbolPoint, {
- _getLabelCoords: piePoint._getLabelCoords,
- _moveLabelOnCanvas: barPoint._moveLabelOnCanvas,
- _getLabelPosition: function() {
- return "outside"
- },
- _getCoords: function(argument, value) {
- var axis = this.series.getValueAxis();
- var startAngle = axis.getAngles()[0];
- var angle = this._getArgTranslator().translate(argument);
- var radius = this._getValTranslator().translate(value);
- var coords = vizUtils.convertPolarToXY(axis.getCenter(), axis.getAngles()[0], angle, radius);
- coords.angle = angle + startAngle - 90, coords.radius = radius;
- return coords
- },
- _translate: function() {
- var that = this;
- var center = that.series.getValueAxis().getCenter();
- var coord = that._getCoords(that.argument, that.value);
- that.vx = normalizeAngle(coord.angle);
- that.vy = that.radiusOuter = that.radiusLabels = coord.radius;
- that.radiusLabels += RADIAL_LABEL_INDENT;
- that.radius = coord.radius;
- that.middleAngle = -coord.angle;
- that.angle = -coord.angle;
- that.x = coord.x;
- that.y = coord.y;
- that.defaultX = that.centerX = center.x;
- that.defaultY = that.centerY = center.y;
- that._translateErrorBars();
- that.inVisibleArea = true
- },
- _translateErrorBars: function() {
- var that = this;
- var errorBars = that._options.errorBars;
- var translator = that._getValTranslator();
- if (!errorBars) {
- return
- }
- isDefined(that.lowError) && (that._lowErrorCoord = that.centerY - translator.translate(that.lowError));
- isDefined(that.highError) && (that._highErrorCoord = that.centerY - translator.translate(that.highError));
- that._errorBarPos = that.centerX;
- that._baseErrorBarPos = "stdDeviation" === errorBars.type ? that._lowErrorCoord + (that._highErrorCoord - that._lowErrorCoord) / 2 : that.centerY - that.radius
- },
- _getTranslates: function(animationEnabled) {
- return animationEnabled ? this.getDefaultCoords() : {
- x: this.x,
- y: this.y
- }
- },
- getDefaultCoords: function() {
- var cosSin = vizUtils.getCosAndSin(-this.angle);
- var radius = this._getValTranslator().translate(CANVAS_POSITION_DEFAULT);
- var x = this.defaultX + radius * cosSin.cos;
- var y = this.defaultY + radius * cosSin.sin;
- return {
- x: x,
- y: y
- }
- },
- _addLabelAlignmentAndOffset: function(label, coord) {
- return coord
- },
- _checkLabelPosition: function(label, coord) {
- var that = this;
- var visibleArea = that._getVisibleArea();
- var graphicBBox = that._getGraphicBBox();
- if (that._isPointInVisibleArea(visibleArea, graphicBBox)) {
- coord = that._moveLabelOnCanvas(coord, visibleArea, label.getBoundingRect())
- }
- return coord
- },
- _getErrorBarSettings: function(errorBarOptions, animationEnabled) {
- var settings = symbolPoint._getErrorBarSettings.call(this, errorBarOptions, animationEnabled);
- settings.rotate = ERROR_BARS_ANGLE_OFFSET - this.angle;
- settings.rotateX = this.centerX;
- settings.rotateY = this.centerY;
- return settings
- },
- getCoords: function(min) {
- return min ? this.getDefaultCoords() : {
- x: this.x,
- y: this.y
- }
- }
- });
- exports.polarBarPoint = _extend({}, barPoint, {
- _translateErrorBars: exports.polarSymbolPoint._translateErrorBars,
- _getErrorBarSettings: exports.polarSymbolPoint._getErrorBarSettings,
- _moveLabelOnCanvas: barPoint._moveLabelOnCanvas,
- _getLabelCoords: piePoint._getLabelCoords,
- _getLabelConnector: piePoint._getLabelConnector,
- getTooltipParams: piePoint.getTooltipParams,
- _getLabelPosition: piePoint._getLabelPosition,
- _getCoords: exports.polarSymbolPoint._getCoords,
- _translate: function() {
- var that = this;
- var translator = that._getValTranslator();
- var maxRadius = translator.translate(CANVAS_POSITION_END);
- that.radiusInner = translator.translate(that.minValue);
- exports.polarSymbolPoint._translate.call(that);
- if (null === that.radiusInner) {
- that.radiusInner = that.radius = maxRadius
- } else {
- if (null === that.radius) {
- this.radius = this.value >= 0 ? maxRadius : 0
- }
- }
- that.radiusOuter = that.radiusLabels = _max(that.radiusInner, that.radius);
- that.radiusLabels += RADIAL_LABEL_INDENT;
- that.radiusInner = that.defaultRadius = _math.min(that.radiusInner, that.radius);
- that.middleAngle = that.angle = -normalizeAngle(that.middleAngleCorrection - that.angle)
- },
- _getErrorBarBaseEdgeLength: function() {
- var coord = this.getMarkerCoords();
- return _math.PI * coord.outerRadius * _math.abs(coord.startAngle - coord.endAngle) / 180
- },
- getMarkerCoords: function() {
- return {
- x: this.centerX,
- y: this.centerY,
- outerRadius: this.radiusOuter,
- innerRadius: this.defaultRadius,
- startAngle: this.middleAngle - this.interval / 2,
- endAngle: this.middleAngle + this.interval / 2
- }
- },
- _drawMarker: function(renderer, group, animationEnabled) {
- var that = this;
- var styles = that._getStyle();
- var coords = that.getMarkerCoords();
- var innerRadius = coords.innerRadius;
- var outerRadius = coords.outerRadius;
- var start = that._getCoords(that.argument, CANVAS_POSITION_DEFAULT);
- var x = coords.x;
- var y = coords.y;
- if (animationEnabled) {
- innerRadius = 0;
- outerRadius = 0;
- x = start.x;
- y = start.y
- }
- that.graphic = renderer.arc(x, y, innerRadius, outerRadius, coords.startAngle, coords.endAngle).attr(styles).data({
- "chart-data-point": that
- }).append(group)
- },
- _checkLabelPosition: function(label, coord) {
- var that = this;
- var visibleArea = that._getVisibleArea();
- var angleFunctions = vizUtils.getCosAndSin(that.middleAngle);
- var x = that.centerX + that.defaultRadius * angleFunctions.cos;
- var y = that.centerY - that.defaultRadius * angleFunctions.sin;
- if (x > visibleArea.minX && x < visibleArea.maxX && y > visibleArea.minY && y < visibleArea.maxY) {
- coord = that._moveLabelOnCanvas(coord, visibleArea, label.getBoundingRect())
- }
- return coord
- },
- _addLabelAlignmentAndOffset: function(label, coord) {
- return coord
- },
- correctCoordinates: function(correctOptions) {
- this.middleAngleCorrection = correctOptions.offset;
- this.interval = correctOptions.width
- },
- coordsIn: function(x, y) {
- var val = vizUtils.convertXYToPolar(this.series.getValueAxis().getCenter(), x, y);
- var coords = this.getMarkerCoords();
- var isBetweenAngles = coords.startAngle < coords.endAngle ? -val.phi >= coords.startAngle && -val.phi <= coords.endAngle : -val.phi <= coords.startAngle && -val.phi >= coords.endAngle;
- return val.r >= coords.innerRadius && val.r <= coords.outerRadius && isBetweenAngles
- }
- })
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/range_series.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _extend = extend;
- var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var _map = __webpack_require__( /*! ../core/utils */ 10).map;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
- var barSeries = __webpack_require__( /*! ./bar_series */ 143).chart.bar;
- var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart.area;
- exports.chart = {};
- var baseRangeSeries = {
- areErrorBarsVisible: _noop,
- _createErrorBarGroup: _noop,
- _checkData: function(data, skippedFields) {
- var valueFields = this.getValueFields();
- return scatterSeries._checkData.call(this, data, skippedFields, {
- minValue: valueFields[0],
- value: valueFields[1]
- }) && data.minValue === data.minValue
- },
- getValueRangeInitialValue: scatterSeries.getValueRangeInitialValue,
- _getPointDataSelector: function(data) {
- var _this = this;
- var valueFields = this.getValueFields();
- var val1Field = valueFields[0];
- var val2Field = valueFields[1];
- var tagField = this.getTagField();
- var argumentField = this.getArgumentField();
- return function(data) {
- return {
- tag: data[tagField],
- minValue: _this._processEmptyValue(data[val1Field]),
- value: _this._processEmptyValue(data[val2Field]),
- argument: data[argumentField],
- data: data
- }
- }
- },
- _defaultAggregator: "range",
- _aggregators: {
- range: function(_ref, series) {
- var _data$reduce;
- var intervalStart = _ref.intervalStart,
- data = _ref.data;
- if (!data.length) {
- return
- }
- var valueFields = series.getValueFields();
- var val1Field = valueFields[0];
- var val2Field = valueFields[1];
- var result = data.reduce(function(result, item) {
- var val1 = item[val1Field];
- var val2 = item[val2Field];
- if (!_isDefined(val1) || !_isDefined(val2)) {
- return result
- }
- result[val1Field] = Math.min(result[val1Field], Math.min(val1, val2));
- result[val2Field] = Math.max(result[val2Field], Math.max(val1, val2));
- return result
- }, (_data$reduce = {}, _defineProperty(_data$reduce, val1Field, 1 / 0), _defineProperty(_data$reduce, val2Field, -(1 / 0)), _defineProperty(_data$reduce, series.getArgumentField(), intervalStart), _data$reduce));
- if (!isFinite(result[val1Field]) || !isFinite(result[val2Field])) {
- if (data.filter(function(i) {
- return null === i[val1Field] && null === i[val2Field]
- }).length === data.length) {
- result[val1Field] = result[val2Field] = null
- } else {
- return
- }
- }
- return result
- }
- },
- getValueFields: function() {
- return [this._options.rangeValue1Field || "val1", this._options.rangeValue2Field || "val2"]
- },
- getSeriesPairCoord: function(coord, isArgument) {
- var oppositeCoord = null;
- var rotated = this._options.rotated;
- var isOpposite = !isArgument && !rotated || isArgument && rotated;
- var coordName = isOpposite ? "vy" : "vx";
- var minCoordName = rotated ? "minX" : "minY";
- var oppositeCoordName = isOpposite ? "vx" : "vy";
- var points = this.getPoints();
- for (var i = 0; i < points.length; i++) {
- var p = points[i];
- var tmpCoord = void 0;
- if (isArgument) {
- tmpCoord = p.getCenterCoord()[coordName[1]] === coord ? p[oppositeCoordName] : void 0
- } else {
- var coords = [Math.min(p[coordName], p[minCoordName]), Math.max(p[coordName], p[minCoordName])];
- tmpCoord = coord >= coords[0] && coord <= coords[1] ? p[oppositeCoordName] : void 0
- }
- if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
- oppositeCoord = tmpCoord;
- break
- }
- }
- return oppositeCoord
- }
- };
- exports.chart.rangebar = _extend({}, barSeries, baseRangeSeries);
- exports.chart.rangearea = _extend({}, areaSeries, {
- _drawPoint: function(options) {
- var point = options.point;
- if (point.isInVisibleArea()) {
- point.clearVisibility();
- point.draw(this._renderer, options.groups);
- this._drawnPoints.push(point);
- if (!point.visibleTopMarker) {
- point.hideMarker("top")
- }
- if (!point.visibleBottomMarker) {
- point.hideMarker("bottom")
- }
- } else {
- point.setInvisibility()
- }
- },
- _prepareSegment: function(points, rotated) {
- var processedPoints = this._processSinglePointsAreaSegment(points, rotated);
- var processedMinPointsCoords = _map(processedPoints, function(pt) {
- return pt.getCoords(true)
- });
- return {
- line: processedPoints,
- bottomLine: processedMinPointsCoords,
- area: _map(processedPoints, function(pt) {
- return pt.getCoords()
- }).concat(processedMinPointsCoords.slice().reverse()),
- singlePointSegment: processedPoints !== points
- }
- },
- _getDefaultSegment: function(segment) {
- var defaultSegment = areaSeries._getDefaultSegment.call(this, segment);
- defaultSegment.bottomLine = defaultSegment.line;
- return defaultSegment
- },
- _removeElement: function(element) {
- areaSeries._removeElement.call(this, element);
- element.bottomLine && element.bottomLine.remove()
- },
- _drawElement: function(segment, group) {
- var that = this;
- var drawnElement = areaSeries._drawElement.call(that, segment, group);
- drawnElement.bottomLine = that._bordersGroup && that._createBorderElement(segment.bottomLine, {
- "stroke-width": that._styles.normal.border["stroke-width"]
- }).append(that._bordersGroup);
- return drawnElement
- },
- _applyStyle: function(style) {
- var that = this;
- var elementsGroup = that._elementsGroup;
- var bordersGroup = that._bordersGroup;
- elementsGroup && elementsGroup.smartAttr(style.elements);
- bordersGroup && bordersGroup.attr(style.border);
- (that._graphics || []).forEach(function(graphic) {
- graphic.line && graphic.line.attr({
- "stroke-width": style.border["stroke-width"]
- });
- graphic.bottomLine && graphic.bottomLine.attr({
- "stroke-width": style.border["stroke-width"]
- })
- })
- },
- _updateElement: function(element, segment, animate, complete) {
- var bottomLineParams = {
- points: segment.bottomLine
- };
- var bottomBorderElement = element.bottomLine;
- areaSeries._updateElement.apply(this, arguments);
- if (bottomBorderElement) {
- animate ? bottomBorderElement.animate(bottomLineParams) : bottomBorderElement.attr(bottomLineParams)
- }
- }
- }, baseRangeSeries)
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/bubble_series.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- var lineSeries = __webpack_require__( /*! ./line_series */ 203).chart.line;
- var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
- var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart.area;
- var barSeries = __webpack_require__( /*! ./bar_series */ 143);
- var chartBarSeries = barSeries.chart.bar;
- var polarBarSeries = barSeries.polar.bar;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var _extend = extend;
- var _each = each;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- exports.chart = {};
- exports.chart.bubble = _extend({}, scatterSeries, {
- _calculateErrorBars: _noop,
- _getMainColor: chartBarSeries._getMainColor,
- _createPointStyles: chartBarSeries._createPointStyles,
- _updatePointsVisibility: chartBarSeries._updatePointsVisibility,
- _getOptionsForPoint: chartBarSeries._getOptionsForPoint,
- _applyMarkerClipRect: lineSeries._applyElementsClipRect,
- _parsePointStyle: polarBarSeries._parsePointStyle,
- _createLegendState: areaSeries._createLegendState,
- _setMarkerGroupSettings: polarBarSeries._setMarkerGroupSettings,
- areErrorBarsVisible: _noop,
- _createErrorBarGroup: _noop,
- _checkData: function(data, skippedFields) {
- return scatterSeries._checkData.call(this, data, skippedFields, {
- value: this.getValueFields()[0],
- size: this.getSizeField()
- })
- },
- _getPointDataSelector: function(data, options) {
- var sizeField = this.getSizeField();
- var baseGetter = scatterSeries._getPointDataSelector.call(this);
- return function(data) {
- var pointData = baseGetter(data);
- pointData.size = data[sizeField];
- return pointData
- }
- },
- _aggregators: {
- avg: function(_ref, series) {
- var _ref2;
- var data = _ref.data,
- intervalStart = _ref.intervalStart;
- if (!data.length) {
- return
- }
- var valueField = series.getValueFields()[0];
- var sizeField = series.getSizeField();
- var aggregate = data.reduce(function(result, item) {
- result[0] += item[valueField];
- result[1] += item[sizeField];
- result[2]++;
- return result
- }, [0, 0, 0]);
- return _ref2 = {}, _defineProperty(_ref2, valueField, aggregate[0] / aggregate[2]), _defineProperty(_ref2, sizeField, aggregate[1] / aggregate[2]), _defineProperty(_ref2, series.getArgumentField(), intervalStart), _ref2
- }
- },
- getValueFields: function() {
- return [this._options.valueField || "val"]
- },
- getSizeField: function() {
- return this._options.sizeField || "size"
- },
- _animate: function() {
- var that = this;
- var lastPointIndex = that._drawnPoints.length - 1;
- var labelsGroup = that._labelsGroup;
- var labelAnimFunc = function() {
- labelsGroup && labelsGroup.animate({
- opacity: 1
- }, {
- duration: that._defaultDuration
- })
- };
- _each(that._drawnPoints || [], function(i, p) {
- p.animate(i === lastPointIndex ? labelAnimFunc : void 0, {
- r: p.bubbleSize,
- translateX: p.x,
- translateY: p.y
- })
- })
- },
- _patchMarginOptions: function(options) {
- options.processBubbleSize = true;
- return options
- }
- })
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/series/pie_series.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106);
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var chartScatterSeries = scatterSeries.chart;
- var barSeries = __webpack_require__( /*! ./bar_series */ 143).chart.bar;
- var _extend = extend;
- var _each = each;
- var _noop = noop;
- var _map = vizUtils.map;
- var _isFinite = isFinite;
- var _max = Math.max;
- var ANIMATION_DURATION = .7;
- var INSIDE = "inside";
- exports.pie = _extend({}, barSeries, {
- _setGroupsSettings: function() {
- chartScatterSeries._setGroupsSettings.apply(this, arguments);
- this._labelsGroup.attr({
- "pointer-events": null
- })
- },
- _createErrorBarGroup: _noop,
- _drawPoint: function(options) {
- var point = options.point;
- var legendCallback = this._legendCallback;
- chartScatterSeries._drawPoint.call(this, options);
- !point.isVisible() && point.setInvisibility();
- point.isSelected() && legendCallback()
- },
- _getOldPoint: function(data, oldPointsByArgument, index) {
- var point = (this._points || [])[index];
- if (point) {
- oldPointsByArgument[point.argument.valueOf()] = oldPointsByArgument[point.argument.valueOf()].filter(function(p) {
- return p !== point
- })
- }
- return point
- },
- adjustLabels: function(moveLabelsFromCenter) {
- return (this._points || []).reduce(function(r, p) {
- if (p._label.isVisible()) {
- p.setLabelTrackerData();
- r = p.applyWordWrap(moveLabelsFromCenter) || r;
- p.updateLabelCoord(moveLabelsFromCenter);
- return r
- }
- }, false)
- },
- _applyElementsClipRect: _noop,
- getColor: _noop,
- areErrorBarsVisible: _noop,
- drawLabelsWOPoints: function() {
- var that = this;
- if (that._options.label.position === INSIDE) {
- return false
- }
- that._labelsGroup.append(that._extGroups.labelsGroup);
- (that._points || []).forEach(function(point) {
- point.drawLabel()
- });
- return true
- },
- getPointsCount: function() {
- var _this = this;
- return this._data.filter(function(d) {
- return _this._checkData(d)
- }).length
- },
- setMaxPointsCount: function(count) {
- this._pointsCount = count
- },
- _getCreatingPointOptions: function(data, dataIndex) {
- return this._getPointOptions(data, dataIndex)
- },
- _updateOptions: function(options) {
- this.labelSpace = 0;
- this.innerRadius = "pie" === this.type ? 0 : options.innerRadius
- },
- _checkData: function(data, skippedFields) {
- var base = barSeries._checkData.call(this, data, skippedFields, {
- value: this.getValueFields()[0]
- });
- return this._options.paintNullPoints ? base : base && null !== data.value
- },
- _createGroups: chartScatterSeries._createGroups,
- _setMarkerGroupSettings: function() {
- this._markersGroup.attr({
- "class": "dxc-markers"
- })
- },
- _getMainColor: function(data, point) {
- var pointsByArg = this.getPointsByArg(data.argument);
- var argumentIndex = point ? pointsByArg.indexOf(point) : pointsByArg.length;
- return this._options.mainSeriesColor(data.argument, argumentIndex, this._pointsCount)
- },
- _getPointOptions: function(data) {
- return this._parsePointOptions(this._preparePointOptions(), this._options.label, data)
- },
- _getRangeData: function() {
- return this._rangeData
- },
- _createPointStyles: function(pointOptions, data, point) {
- var that = this;
- var mainColor = pointOptions.color || that._getMainColor(data, point);
- return {
- normal: that._parsePointStyle(pointOptions, mainColor, mainColor),
- hover: that._parsePointStyle(pointOptions.hoverStyle, mainColor, mainColor),
- selection: that._parsePointStyle(pointOptions.selectionStyle, mainColor, mainColor),
- legendStyles: {
- normal: that._createLegendState(pointOptions, mainColor),
- hover: that._createLegendState(pointOptions.hoverStyle, mainColor),
- selection: that._createLegendState(pointOptions.selectionStyle, mainColor)
- }
- }
- },
- _getArrangeMinShownValue: function(points, total) {
- var minSegmentSize = this._options.minSegmentSize;
- var totalMinSegmentSize = 0;
- var totalNotMinValues = 0;
- total = total || points.length;
- _each(points, function(_, point) {
- if (point.isVisible()) {
- if (point.normalInitialValue < minSegmentSize * total / 360) {
- totalMinSegmentSize += minSegmentSize
- } else {
- totalNotMinValues += point.normalInitialValue
- }
- }
- });
- return totalMinSegmentSize < 360 ? minSegmentSize * totalNotMinValues / (360 - totalMinSegmentSize) : 0
- },
- _applyArrangeCorrection: function(points, minShownValue, total) {
- var options = this._options;
- var isClockWise = "anticlockwise" !== options.segmentsDirection;
- var shiftedAngle = _isFinite(options.startAngle) ? vizUtils.normalizeAngle(options.startAngle) : 0;
- var minSegmentSize = options.minSegmentSize;
- var percent;
- var correction = 0;
- var zeroTotalCorrection = 0;
- if (0 === total) {
- total = points.filter(function(el) {
- return el.isVisible()
- }).length;
- zeroTotalCorrection = 1
- }
- _each(isClockWise ? points : points.concat([]).reverse(), function(_, point) {
- var val = point.isVisible() ? zeroTotalCorrection || point.normalInitialValue : 0;
- var updatedZeroValue;
- if (minSegmentSize && point.isVisible() && val < minShownValue) {
- updatedZeroValue = minShownValue
- }
- percent = val / total;
- point.correctValue(correction, percent, zeroTotalCorrection + (updatedZeroValue || 0));
- point.shiftedAngle = shiftedAngle;
- correction += updatedZeroValue || val
- });
- this._rangeData = {
- val: {
- min: 0,
- max: correction
- }
- }
- },
- _removePoint: function(point) {
- var points = this.getPointsByArg(point.argument);
- points.splice(points.indexOf(point), 1);
- point.dispose()
- },
- arrangePoints: function() {
- var that = this;
- var originalPoints = that._points || [];
- var minSegmentSize = that._options.minSegmentSize;
- var minShownValue;
- var isAllPointsNegative = true;
- var i = 0;
- var len = originalPoints.length;
- while (i < len && isAllPointsNegative) {
- isAllPointsNegative = originalPoints[i].value <= 0;
- i++
- }
- var points = that._points = _map(originalPoints, function(point) {
- if (null === point.value || !isAllPointsNegative && point.value < 0) {
- that._removePoint(point);
- return null
- } else {
- return point
- }
- });
- var maxValue = points.reduce(function(max, p) {
- return _max(max, Math.abs(p.initialValue))
- }, 0);
- points.forEach(function(p) {
- p.normalInitialValue = p.initialValue / (0 !== maxValue ? maxValue : 1)
- });
- var total = points.reduce(function(total, point) {
- return total + (point.isVisible() ? point.normalInitialValue : 0)
- }, 0);
- if (minSegmentSize) {
- minShownValue = this._getArrangeMinShownValue(points, total)
- }
- that._applyArrangeCorrection(points, minShownValue, total)
- },
- correctPosition: function(correction, canvas) {
- var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
- debug.assert(correction, "correction was not passed");
- debug.assertParam(correction.centerX, "correction.centerX was not passed");
- debug.assertParam(correction.centerY, "correction.centerY was not passed");
- debug.assertParam(correction.radiusInner, "correction.radiusInner was not passed");
- debug.assertParam(correction.radiusOuter, "correction.radiusOuter was not passed");
- debug.assertParam(canvas, "correction.canvas was not passed");
- _each(this._points, function(_, point) {
- point.correctPosition(correction)
- });
- this.setVisibleArea(canvas)
- },
- correctRadius: function(correction) {
- this._points.forEach(function(point) {
- point.correctRadius(correction)
- })
- },
- correctLabelRadius: function(labelRadius) {
- this._points.forEach(function(point) {
- point.correctLabelRadius(labelRadius)
- })
- },
- setVisibleArea: function(canvas) {
- this._visibleArea = {
- minX: canvas.left,
- maxX: canvas.width - canvas.right,
- minY: canvas.top,
- maxY: canvas.height - canvas.bottom
- }
- },
- _applyVisibleArea: _noop,
- _animate: function(firstDrawing) {
- var that = this;
- var points = that._points;
- var pointsCount = points && points.length;
- var completeFunc = function() {
- that._animateComplete()
- };
- var animatePoint;
- if (firstDrawing) {
- animatePoint = function(p, i) {
- p.animate(i === pointsCount - 1 ? completeFunc : void 0, ANIMATION_DURATION, (1 - ANIMATION_DURATION) * i / (pointsCount - 1))
- }
- } else {
- animatePoint = function(p, i) {
- p.animate(i === pointsCount - 1 ? completeFunc : void 0)
- }
- }
- points.forEach(animatePoint)
- },
- getVisiblePoints: function() {
- return _map(this._points, function(p) {
- return p.isVisible() ? p : null
- })
- },
- getPointsByKeys: function(arg, argumentIndex) {
- var pointsByArg = this.getPointsByArg(arg);
- return pointsByArg[argumentIndex] && [pointsByArg[argumentIndex]] || []
- }
- });
- exports.doughnut = exports.donut = exports.pie
- },
- /*!*************************************************************!*\
- !*** ./artifacts/transpiled/viz/series/financial_series.js ***!
- \*************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
- var barSeries = __webpack_require__( /*! ./bar_series */ 143).chart.bar;
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var DEFAULT_FINANCIAL_POINT_SIZE = 10;
- exports.stock = _extend({}, scatterSeries, {
- _animate: _noop,
- _applyMarkerClipRect: function(settings) {
- settings["clip-path"] = this._forceClipping ? this._paneClipRectID : this._widePaneClipRectID
- },
- _updatePointsVisibility: barSeries._updatePointsVisibility,
- _getOptionsForPoint: barSeries._getOptionsForPoint,
- _createErrorBarGroup: _noop,
- areErrorBarsVisible: _noop,
- _createGroups: scatterSeries._createGroups,
- _setMarkerGroupSettings: function() {
- var that = this;
- var markersGroup = that._markersGroup;
- var styles = that._createPointStyles(that._getMarkerGroupOptions());
- var defaultStyle = _extend(styles.normal, {
- "class": "default-markers"
- });
- var defaultPositiveStyle = _extend(styles.positive.normal, {
- "class": "default-positive-markers"
- });
- var reductionStyle = _extend(styles.reduction.normal, {
- "class": "reduction-markers"
- });
- var reductionPositiveStyle = _extend(styles.reductionPositive.normal, {
- "class": "reduction-positive-markers"
- });
- var markerSettings = {
- "class": "dxc-markers"
- };
- that._applyMarkerClipRect(markerSettings);
- markersGroup.attr(markerSettings);
- that._createGroup("defaultMarkersGroup", markersGroup, markersGroup, defaultStyle);
- that._createGroup("reductionMarkersGroup", markersGroup, markersGroup, reductionStyle);
- that._createGroup("defaultPositiveMarkersGroup", markersGroup, markersGroup, defaultPositiveStyle);
- that._createGroup("reductionPositiveMarkersGroup", markersGroup, markersGroup, reductionPositiveStyle)
- },
- _setGroupsSettings: function() {
- scatterSeries._setGroupsSettings.call(this, false)
- },
- _getCreatingPointOptions: function() {
- var that = this;
- var defaultPointOptions;
- var creatingPointOptions = that._predefinedPointOptions;
- if (!creatingPointOptions) {
- defaultPointOptions = this._getPointOptions();
- that._predefinedPointOptions = creatingPointOptions = _extend(true, {
- styles: {}
- }, defaultPointOptions);
- creatingPointOptions.styles.normal = creatingPointOptions.styles.positive.normal = creatingPointOptions.styles.reduction.normal = creatingPointOptions.styles.reductionPositive.normal = {
- "stroke-width": defaultPointOptions.styles && defaultPointOptions.styles.normal && defaultPointOptions.styles.normal["stroke-width"]
- }
- }
- return creatingPointOptions
- },
- _checkData: function(data, skippedFields) {
- var valueFields = this.getValueFields();
- return scatterSeries._checkData.call(this, data, skippedFields, {
- openValue: valueFields[0],
- highValue: valueFields[1],
- lowValue: valueFields[2],
- closeValue: valueFields[3]
- }) && data.highValue === data.highValue && data.lowValue === data.lowValue
- },
- _getPointDataSelector: function(data, options) {
- var _this = this;
- var that = this;
- var level;
- var valueFields = that.getValueFields();
- var argumentField = that.getArgumentField();
- var openValueField = valueFields[0];
- var highValueField = valueFields[1];
- var lowValueField = valueFields[2];
- var closeValueField = valueFields[3];
- that.level = that._options.reduction.level;
- switch (_normalizeEnum(that.level)) {
- case "open":
- level = openValueField;
- break;
- case "high":
- level = highValueField;
- break;
- case "low":
- level = lowValueField;
- break;
- default:
- level = closeValueField;
- that.level = "close"
- }
- var prevLevelValue;
- return function(data) {
- var reductionValue = data[level];
- var isReduction = false;
- if (_isDefined(reductionValue)) {
- if (_isDefined(prevLevelValue)) {
- isReduction = reductionValue < prevLevelValue
- }
- prevLevelValue = reductionValue
- }
- return {
- argument: data[argumentField],
- highValue: _this._processEmptyValue(data[highValueField]),
- lowValue: _this._processEmptyValue(data[lowValueField]),
- closeValue: _this._processEmptyValue(data[closeValueField]),
- openValue: _this._processEmptyValue(data[openValueField]),
- reductionValue: reductionValue,
- tag: data[that.getTagField()],
- isReduction: isReduction,
- data: data
- }
- }
- },
- _parsePointStyle: function(style, defaultColor, innerColor) {
- return {
- stroke: style.color || defaultColor,
- "stroke-width": style.width,
- fill: style.color || innerColor
- }
- },
- _getDefaultStyle: function(options) {
- var that = this;
- var mainPointColor = options.color || that._options.mainSeriesColor;
- return {
- normal: that._parsePointStyle(options, mainPointColor, mainPointColor),
- hover: that._parsePointStyle(options.hoverStyle, mainPointColor, mainPointColor),
- selection: that._parsePointStyle(options.selectionStyle, mainPointColor, mainPointColor)
- }
- },
- _getReductionStyle: function(options) {
- var that = this;
- var reductionColor = options.reduction.color;
- return {
- normal: that._parsePointStyle({
- color: reductionColor,
- width: options.width,
- hatching: options.hatching
- }, reductionColor, reductionColor),
- hover: that._parsePointStyle(options.hoverStyle, reductionColor, reductionColor),
- selection: that._parsePointStyle(options.selectionStyle, reductionColor, reductionColor)
- }
- },
- _createPointStyles: function(pointOptions) {
- var that = this;
- var innerColor = that._options.innerColor;
- var styles = that._getDefaultStyle(pointOptions);
- var positiveStyle = _extend(true, {}, styles);
- var reductionStyle = that._getReductionStyle(pointOptions);
- var reductionPositiveStyle = _extend(true, {}, reductionStyle);
- positiveStyle.normal.fill = positiveStyle.hover.fill = positiveStyle.selection.fill = innerColor;
- reductionPositiveStyle.normal.fill = reductionPositiveStyle.hover.fill = reductionPositiveStyle.selection.fill = innerColor;
- styles.positive = positiveStyle;
- styles.reduction = reductionStyle;
- styles.reductionPositive = reductionPositiveStyle;
- return styles
- },
- _endUpdateData: function() {
- delete this._predefinedPointOptions
- },
- _defaultAggregator: "ohlc",
- _aggregators: {
- ohlc: function(_ref, series) {
- var intervalStart = _ref.intervalStart,
- data = _ref.data;
- if (!data.length) {
- return
- }
- var result = {};
- var valueFields = series.getValueFields();
- var highValueField = valueFields[1];
- var lowValueField = valueFields[2];
- result[highValueField] = -(1 / 0);
- result[lowValueField] = 1 / 0;
- result = data.reduce(function(result, item) {
- if (null !== item[highValueField]) {
- result[highValueField] = Math.max(result[highValueField], item[highValueField])
- }
- if (null !== item[lowValueField]) {
- result[lowValueField] = Math.min(result[lowValueField], item[lowValueField])
- }
- return result
- }, result);
- result[valueFields[0]] = data[0][valueFields[0]];
- result[valueFields[3]] = data[data.length - 1][valueFields[3]];
- if (!isFinite(result[highValueField])) {
- result[highValueField] = null
- }
- if (!isFinite(result[lowValueField])) {
- result[lowValueField] = null
- }
- result[series.getArgumentField()] = intervalStart;
- return result
- }
- },
- getValueFields: function() {
- var options = this._options;
- return [options.openValueField || "open", options.highValueField || "high", options.lowValueField || "low", options.closeValueField || "close"]
- },
- getArgumentField: function() {
- return this._options.argumentField || "date"
- },
- _patchMarginOptions: function(options) {
- var pointOptions = this._getCreatingPointOptions();
- var styles = pointOptions.styles;
- var border = [styles.normal, styles.hover, styles.selection].reduce(function(max, style) {
- return Math.max(max, style["stroke-width"])
- }, 0);
- options.size = DEFAULT_FINANCIAL_POINT_SIZE + border;
- options.sizePointNormalState = DEFAULT_FINANCIAL_POINT_SIZE;
- return options
- },
- getSeriesPairCoord: function(coord, isArgument) {
- var oppositeCoord = null;
- var points = this.getVisiblePoints();
- for (var i = 0; i < points.length; i++) {
- var p = points[i];
- var tmpCoord = void 0;
- if (isArgument) {
- tmpCoord = p.vx === coord ? (p.openY + p.closeY) / 2 : void 0
- } else {
- var coords = [Math.min(p.lowY, p.highY), Math.max(p.lowY, p.highY)];
- tmpCoord = coord >= coords[0] && coord <= coords[1] ? p.vx : void 0
- }
- if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
- oppositeCoord = tmpCoord;
- break
- }
- }
- return oppositeCoord
- },
- usePointsToDefineAutoHiding: function() {
- return false
- }
- });
- exports.candlestick = _extend({}, exports.stock, {
- _parsePointStyle: function(style, defaultColor, innerColor) {
- var color = style.color || innerColor;
- var base = exports.stock._parsePointStyle.call(this, style, defaultColor, color);
- base.fill = color;
- base.hatching = style.hatching;
- return base
- }
- })
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/series/stacked_series.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart;
- var chartAreaSeries = areaSeries.area;
- var barSeries = __webpack_require__( /*! ./bar_series */ 143);
- var chartBarSeries = barSeries.chart.bar;
- var lineSeries = __webpack_require__( /*! ./line_series */ 203).chart;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
- var baseStackedSeries = {
- _calculateErrorBars: _noop,
- _updateOptions: function(options) {
- this._stackName = "axis_" + (options.axis || "default")
- }
- };
- exports.chart = {};
- exports.polar = {};
- exports.chart.stackedline = _extend({}, lineSeries.line, baseStackedSeries, {});
- exports.chart.stackedspline = _extend({}, lineSeries.spline, baseStackedSeries, {});
- exports.chart.fullstackedline = _extend({}, lineSeries.line, baseStackedSeries, {
- getValueRangeInitialValue: areaSeries.area.getValueRangeInitialValue
- });
- exports.chart.fullstackedspline = _extend({}, lineSeries.spline, baseStackedSeries, {
- getValueRangeInitialValue: areaSeries.area.getValueRangeInitialValue
- });
- var stackedBar = exports.chart.stackedbar = _extend({}, chartBarSeries, baseStackedSeries, {
- _updateOptions: function(options) {
- baseStackedSeries._updateOptions.call(this, options);
- this._stackName = this._stackName + "_stack_" + (options.stack || "default")
- }
- });
- exports.chart.fullstackedbar = _extend({}, chartBarSeries, baseStackedSeries, {
- _updateOptions: stackedBar._updateOptions
- });
- function clonePoint(point, value, minValue, position) {
- point = objectUtils.clone(point);
- point.value = value;
- point.minValue = minValue;
- point.translate();
- point.argument = point.argument + position;
- return point
- }
- function preparePointsForStackedAreaSegment(points) {
- var i = 0;
- var p;
- var result = [];
- var array;
- var len = points.length;
- while (i < len) {
- p = points[i];
- array = [p];
- if (p.leftHole) {
- array = [clonePoint(p, p.leftHole, p.minLeftHole, "left"), p]
- }
- if (p.rightHole) {
- array.push(clonePoint(p, p.rightHole, p.minRightHole, "right"))
- }
- result.push(array);
- i++
- }
- return [].concat.apply([], result)
- }
- exports.chart.stackedarea = _extend({}, chartAreaSeries, baseStackedSeries, {
- _prepareSegment: function(points, rotated) {
- return chartAreaSeries._prepareSegment.call(this, preparePointsForStackedAreaSegment(points), rotated)
- },
- _appendInGroup: function() {
- this._group.append(this._extGroups.seriesGroup).toBackground()
- }
- });
- function getPointsByArgFromPrevSeries(prevSeries, argument) {
- var result;
- while (!result && prevSeries) {
- result = prevSeries._segmentByArg && prevSeries._segmentByArg[argument];
- prevSeries = prevSeries._prevSeries
- }
- return result
- }
- exports.chart.stackedsplinearea = _extend({}, areaSeries.splinearea, baseStackedSeries, {
- _prepareSegment: function(points, rotated) {
- var that = this;
- var areaSegment;
- points = preparePointsForStackedAreaSegment(points);
- if (!this._prevSeries || 1 === points.length) {
- areaSegment = areaSeries.splinearea._prepareSegment.call(this, points, rotated)
- } else {
- var forwardPoints = lineSeries.spline._calculateBezierPoints(points, rotated);
- var backwardPoints = vizUtils.map(points, function(p) {
- var point = p.getCoords(true);
- point.argument = p.argument;
- return point
- });
- var prevSeriesForwardPoints = [];
- var pointByArg = {};
- var i = 0;
- var len = that._prevSeries._segments.length;
- while (i < len) {
- prevSeriesForwardPoints = prevSeriesForwardPoints.concat(that._prevSeries._segments[i].line);
- i++
- }
- each(prevSeriesForwardPoints, function(_, p) {
- if (null !== p.argument) {
- var argument = p.argument.valueOf();
- if (!pointByArg[argument]) {
- pointByArg[argument] = [p]
- } else {
- pointByArg[argument].push(p)
- }
- }
- });
- that._prevSeries._segmentByArg = pointByArg;
- backwardPoints = lineSeries.spline._calculateBezierPoints(backwardPoints, rotated);
- each(backwardPoints, function(i, p) {
- var argument = p.argument.valueOf();
- var prevSeriesPoints;
- if (i % 3 === 0) {
- prevSeriesPoints = pointByArg[argument] || getPointsByArgFromPrevSeries(that._prevSeries, argument);
- if (prevSeriesPoints) {
- backwardPoints[i - 1] && prevSeriesPoints[0] && (backwardPoints[i - 1] = prevSeriesPoints[0]);
- backwardPoints[i + 1] && (backwardPoints[i + 1] = prevSeriesPoints[2] || p)
- }
- }
- });
- areaSegment = {
- line: forwardPoints,
- area: forwardPoints.concat(backwardPoints.reverse())
- };
- that._areaPointsToSplineAreaPoints(areaSegment.area)
- }
- return areaSegment
- },
- _appendInGroup: exports.chart.stackedarea._appendInGroup
- });
- exports.chart.fullstackedarea = _extend({}, chartAreaSeries, baseStackedSeries, {
- _prepareSegment: exports.chart.stackedarea._prepareSegment,
- _appendInGroup: exports.chart.stackedarea._appendInGroup
- });
- exports.chart.fullstackedsplinearea = _extend({}, areaSeries.splinearea, baseStackedSeries, {
- _prepareSegment: exports.chart.stackedsplinearea._prepareSegment,
- _appendInGroup: exports.chart.stackedarea._appendInGroup
- });
- exports.polar.stackedbar = _extend({}, barSeries.polar.bar, baseStackedSeries, {})
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/tracker.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var clickEvent = __webpack_require__( /*! ../../events/click */ 19);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var consts = __webpack_require__( /*! ../components/consts */ 117);
- var eventsConsts = consts.events;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var pointerEvents = __webpack_require__( /*! ../../events/pointer */ 23);
- var holdEvent = __webpack_require__( /*! ../../events/hold */ 88);
- var addNamespace = __webpack_require__( /*! ../../events/utils */ 8).addNamespace;
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var _floor = Math.floor;
- var _each = each;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var HOVER_STATE = consts.states.hoverMark;
- var NORMAL_STATE = consts.states.normalMark;
- var EVENT_NS = "dxChartTracker";
- var DOT_EVENT_NS = "." + EVENT_NS;
- var POINTER_ACTION = addNamespace([pointerEvents.down, pointerEvents.move], EVENT_NS);
- var LEGEND_CLICK = "legendClick";
- var SERIES_CLICK = "seriesClick";
- var POINT_CLICK = "pointClick";
- var POINT_DATA = "chart-data-point";
- var SERIES_DATA = "chart-data-series";
- var ARG_DATA = "chart-data-argument";
- var DELAY = 100;
- var NONE_MODE = "none";
- var ALL_ARGUMENT_POINTS_MODE = "allargumentpoints";
- var INCLUDE_POINTS_MODE = "includepoints";
- var EXLUDE_POINTS_MODE = "excludepoints";
- var LEGEND_HOVER_MODES = [INCLUDE_POINTS_MODE, EXLUDE_POINTS_MODE, NONE_MODE];
- function getData(event, dataKey) {
- var target = event.target;
- return ("tspan" === target.tagName ? target.parentNode : target)[dataKey]
- }
- function eventCanceled(event, target) {
- return event.cancel || !target.getOptions()
- }
- function inCanvas(canvas, x, y) {
- return x >= canvas.left && x <= canvas.right && y >= canvas.top && y <= canvas.bottom
- }
- function correctLegendHoverMode(mode) {
- if (LEGEND_HOVER_MODES.indexOf(mode) > -1) {
- return mode
- } else {
- return INCLUDE_POINTS_MODE
- }
- }
- function correctHoverMode(target) {
- var mode = target.getOptions().hoverMode;
- return mode === NONE_MODE ? mode : ALL_ARGUMENT_POINTS_MODE
- }
- var baseTrackerPrototype = {
- ctor: function(options) {
- var that = this;
- var data = {
- tracker: that
- };
- that._renderer = options.renderer;
- that._legend = options.legend;
- that._tooltip = options.tooltip;
- that._eventTrigger = options.eventTrigger;
- that._seriesGroup = options.seriesGroup;
- options.seriesGroup.off(DOT_EVENT_NS).on(addNamespace(eventsConsts.showPointTooltip, EVENT_NS), data, that._showPointTooltip).on(addNamespace(eventsConsts.hidePointTooltip, EVENT_NS), data, that._hidePointTooltip);
- that._renderer.root.off(DOT_EVENT_NS).on(POINTER_ACTION, data, that._pointerHandler).on(addNamespace(clickEvent.name, EVENT_NS), data, that._clickHandler).on(addNamespace(holdEvent.name, EVENT_NS), {
- timeout: 300
- }, _noop)
- },
- update: function() {},
- updateSeries: function(series, resetDecorations) {
- var that = this;
- var noHoveredSeries = !(series && series.some(function(s) {
- return s === that.hoveredSeries
- }) || that._hoveredPoint && that._hoveredPoint.series);
- if (that._storedSeries !== series) {
- that._storedSeries = series || []
- }
- if (noHoveredSeries) {
- that._clean();
- that._renderer.initHatching()
- }
- if (resetDecorations) {
- that.clearSelection();
- if (!noHoveredSeries) {
- that._hideTooltip(that.pointAtShownTooltip);
- that.clearHover()
- }
- }
- },
- setCanvases: function(mainCanvas, paneCanvases) {
- this._mainCanvas = mainCanvas;
- this._canvases = paneCanvases
- },
- repairTooltip: function() {
- var point = this.pointAtShownTooltip;
- if (!point || !point.series || !point.isVisible()) {
- this._hideTooltip(point, true)
- } else {
- this._showTooltip(point)
- }
- },
- _setHoveredPoint: function(point) {
- if (point === this._hoveredPoint) {
- return
- }
- this._releaseHoveredPoint();
- point.hover();
- this._hoveredPoint = point
- },
- _releaseHoveredPoint: function() {
- if (this._hoveredPoint && this._hoveredPoint.getOptions()) {
- this._hoveredPoint.clearHover();
- this._hoveredPoint = null;
- if (this._tooltip.isEnabled()) {
- this._hideTooltip(this._hoveredPoint)
- }
- }
- },
- _setHoveredSeries: function(series, mode) {
- this._releaseHoveredSeries();
- this._releaseHoveredPoint();
- series.hover(mode);
- this.hoveredSeries = series
- },
- _releaseHoveredSeries: function(needSetHoverView, hoveredPoint) {
- if (this.hoveredSeries) {
- this.hoveredSeries.clearHover();
- this.hoveredSeries = null
- }
- },
- clearSelection: function() {
- this._storedSeries.forEach(function(series) {
- if (series) {
- series.clearSelection();
- series.getPoints().forEach(function(point) {
- point.clearSelection()
- })
- }
- })
- },
- _clean: function() {
- var that = this;
- that.hoveredPoint = that.hoveredSeries = that._hoveredArgumentPoints = null;
- that._hideTooltip(that.pointAtShownTooltip)
- },
- clearHover: function() {
- this._resetHoveredArgument();
- this._releaseHoveredSeries();
- this._releaseHoveredPoint()
- },
- _hideTooltip: function(point, silent) {
- var that = this;
- if (!that._tooltip || point && that.pointAtShownTooltip !== point) {
- return
- }
- if (!silent && that.pointAtShownTooltip) {
- that.pointAtShownTooltip = null
- }
- that._tooltip.hide()
- },
- _showTooltip: function(point) {
- var that = this;
- var tooltipFormatObject;
- var eventData;
- if (point && point.getOptions()) {
- tooltipFormatObject = point.getTooltipFormatObject(that._tooltip);
- if (!isDefined(tooltipFormatObject.valueText) && !tooltipFormatObject.points || !point.isVisible()) {
- return
- }
- if (!that.pointAtShownTooltip || that.pointAtShownTooltip !== point) {
- eventData = {
- target: point
- }
- }
- var coords = point.getTooltipParams(that._tooltip.getLocation());
- var rootOffset = that._renderer.getRootOffset();
- coords.x += rootOffset.left;
- coords.y += rootOffset.top;
- if (!that._tooltip.show(tooltipFormatObject, coords, eventData)) {
- return
- }
- that.pointAtShownTooltip = point
- }
- },
- _showPointTooltip: function(event, point) {
- var that = event.data.tracker;
- var pointWithTooltip = that.pointAtShownTooltip;
- if (pointWithTooltip && pointWithTooltip !== point) {
- that._hideTooltip(pointWithTooltip)
- }
- that._showTooltip(point)
- },
- _hidePointTooltip: function(event, point) {
- event.data.tracker._hideTooltip(point)
- },
- _enableOutHandler: function() {
- if (this._outHandler) {
- return
- }
- var that = this;
- var handler = function(e) {
- var rootOffset = that._renderer.getRootOffset();
- var x = _floor(e.pageX - rootOffset.left);
- var y = _floor(e.pageY - rootOffset.top);
- if (!inCanvas(that._mainCanvas, x, y)) {
- that._pointerOut();
- that._disableOutHandler()
- }
- };
- eventsEngine.on(domAdapter.getDocument(), POINTER_ACTION, handler);
- this._outHandler = handler
- },
- _disableOutHandler: function() {
- this._outHandler && eventsEngine.off(domAdapter.getDocument(), POINTER_ACTION, this._outHandler);
- this._outHandler = null
- },
- stopCurrentHandling: function() {
- this._pointerOut(true)
- },
- _pointerOut: function(force) {
- this.clearHover();
- (force || this._tooltip.isEnabled()) && this._hideTooltip(this.pointAtShownTooltip)
- },
- _triggerLegendClick: function(eventArgs, elementClick) {
- var eventTrigger = this._eventTrigger;
- eventTrigger(LEGEND_CLICK, eventArgs, function() {
- !eventCanceled(eventArgs.event, eventArgs.target) && eventTrigger(elementClick, eventArgs)
- })
- },
- _hoverLegendItem: function(x, y) {
- var that = this;
- var item = that._legend.getItemByCoord(x, y);
- var series;
- var legendHoverMode = correctLegendHoverMode(that._legend.getOptions().hoverMode);
- if (item) {
- series = that._storedSeries[item.id];
- if (!series.isHovered() || series.lastHoverMode !== legendHoverMode) {
- that._setHoveredSeries(series, legendHoverMode)
- }
- that._tooltip.isEnabled() && that._hideTooltip(that.pointAtShownTooltip)
- } else {
- that.clearHover()
- }
- },
- _hoverArgument: function(argument, argumentIndex) {
- var that = this;
- var hoverMode = that._getArgumentHoverMode();
- if (isDefined(argument)) {
- that._releaseHoveredPoint();
- that._hoveredArgument = argument;
- that._argumentIndex = argumentIndex;
- that._notifySeries({
- action: "pointHover",
- notifyLegend: that._notifyLegendOnHoverArgument,
- target: {
- argument: argument,
- fullState: HOVER_STATE,
- argumentIndex: argumentIndex,
- getOptions: function() {
- return {
- hoverMode: hoverMode
- }
- }
- }
- })
- }
- },
- _resetHoveredArgument: function() {
- var that = this;
- var hoverMode;
- if (isDefined(that._hoveredArgument)) {
- hoverMode = that._getArgumentHoverMode();
- that._notifySeries({
- action: "clearPointHover",
- notifyLegend: that._notifyLegendOnHoverArgument,
- target: {
- fullState: NORMAL_STATE,
- argumentIndex: that._argumentIndex,
- argument: that._hoveredArgument,
- getOptions: function() {
- return {
- hoverMode: hoverMode
- }
- }
- }
- });
- that._hoveredArgument = null
- }
- },
- _notifySeries: function(data) {
- this._storedSeries.forEach(function(series) {
- series.notify(data)
- })
- },
- _pointerHandler: function(e) {
- var that = e.data.tracker;
- var rootOffset = that._renderer.getRootOffset();
- var x = _floor(e.pageX - rootOffset.left);
- var y = _floor(e.pageY - rootOffset.top);
- var canvas = that._getCanvas(x, y);
- var series = getData(e, SERIES_DATA);
- var point = getData(e, POINT_DATA) || series && series.getPointByCoord(x, y);
- if (point && !point.getMarkerVisibility()) {
- point = void 0
- }
- that._enableOutHandler();
- if (that._legend.coordsIn(x, y)) {
- that._hoverLegendItem(x, y);
- return
- }
- if (that.hoveredSeries && that.hoveredSeries !== that._stuckSeries) {
- that._releaseHoveredSeries()
- }
- if (that._hoverArgumentAxis(x, y, e)) {
- return
- }
- if (that._isPointerOut(canvas, point)) {
- that._pointerOut()
- }
- if (!canvas && !point) {
- return
- }
- if (series && !point) {
- point = series.getNeighborPoint(x, y);
- if (!that._stickyHovering && point && !point.coordsIn(x, y)) {
- point = null
- }
- if (series !== that.hoveredSeries) {
- that._setTimeout(function() {
- that._setHoveredSeries(series);
- that._setStuckSeries(e, series, x, y);
- that._pointerComplete(point, x, y)
- }, series);
- return
- }
- } else {
- if (point) {
- if (e.type !== pointerEvents.move && "touch" !== e.pointerType) {
- return
- }
- if (that.hoveredSeries) {
- that._setTimeout(function() {
- that._pointerOnPoint(point, x, y, e)
- }, point)
- } else {
- that._pointerOnPoint(point, x, y, e)
- }
- return
- } else {
- if (that._setStuckSeries(e, void 0, x, y) && that._stickyHovering) {
- series = that._stuckSeries;
- point = series.getNeighborPoint(x, y);
- that._releaseHoveredSeries();
- point && point.getMarkerVisibility() && that._setHoveredPoint(point)
- } else {
- if (!that._stickyHovering) {
- that._pointerOut()
- }
- }
- }
- }
- that._pointerComplete(point, x, y)
- },
- _pointerOnPoint: function(point, x, y) {
- this._resetHoveredArgument();
- this._setHoveredPoint(point);
- this._pointerComplete(point, x, y)
- },
- _pointerComplete: function(point) {
- this.pointAtShownTooltip !== point && this._tooltip.isEnabled() && this._showTooltip(point)
- },
- _clickHandler: function(e) {
- var that = e.data.tracker;
- var rootOffset = that._renderer.getRootOffset();
- var x = _floor(e.pageX - rootOffset.left);
- var y = _floor(e.pageY - rootOffset.top);
- var point = getData(e, POINT_DATA);
- var series = that._stuckSeries || getData(e, SERIES_DATA) || point && point.series;
- var axis = that._argumentAxis;
- if (that._legend.coordsIn(x, y)) {
- var item = that._legend.getItemByCoord(x, y);
- if (item) {
- that._legendClick(item, e)
- }
- } else {
- if (axis && axis.coordsIn(x, y)) {
- var argument = getData(e, ARG_DATA);
- if (isDefined(argument)) {
- that._eventTrigger("argumentAxisClick", {
- argument: argument,
- event: e
- })
- }
- } else {
- if (series) {
- point = point || series.getPointByCoord(x, y);
- if (point && point.getMarkerVisibility()) {
- that._pointClick(point, e)
- } else {
- getData(e, SERIES_DATA) && that._eventTrigger(SERIES_CLICK, {
- target: series,
- event: e
- })
- }
- }
- }
- }
- },
- dispose: function() {
- var that = this;
- that._disableOutHandler();
- that._renderer.root.off(DOT_EVENT_NS);
- that._seriesGroup.off(DOT_EVENT_NS)
- }
- };
- var ChartTracker = function(options) {
- this.ctor(options)
- };
- extend(ChartTracker.prototype, baseTrackerPrototype, {
- _pointClick: function(point, event) {
- var that = this;
- var eventTrigger = that._eventTrigger;
- var series = point.series;
- eventTrigger(POINT_CLICK, {
- target: point,
- event: event
- }, function() {
- !eventCanceled(event, series) && eventTrigger(SERIES_CLICK, {
- target: series,
- event: event
- })
- })
- },
- __trackerDelay: DELAY,
- update: function(options) {
- var that = this;
- baseTrackerPrototype.update.call(this, options);
- that._argumentAxis = options.argumentAxis || {};
- that._axisHoverEnabled = that._argumentAxis && _normalizeEnum(that._argumentAxis.getOptions().hoverMode) === ALL_ARGUMENT_POINTS_MODE;
- that._chart = options.chart;
- that._rotated = options.rotated;
- that._crosshair = options.crosshair;
- that._stickyHovering = options.stickyHovering
- },
- _getCanvas: function(x, y) {
- var that = this;
- var canvases = that._canvases || [];
- for (var i = 0; i < canvases.length; i++) {
- var c = canvases[i];
- if (inCanvas(c, x, y)) {
- return c
- }
- }
- return null
- },
- _isPointerOut: function(canvas) {
- return !canvas && this._stuckSeries
- },
- _hideCrosshair: function() {
- this._crosshair && this._crosshair.hide()
- },
- _moveCrosshair: function(point, x, y) {
- if (point && this._crosshair && point.isVisible()) {
- this._crosshair.show({
- point: point,
- x: x,
- y: y
- })
- }
- },
- _clean: function() {
- var that = this;
- baseTrackerPrototype._clean.call(that);
- that._resetTimer();
- that._stuckSeries = null
- },
- _getSeriesForShared: function(x, y) {
- var that = this;
- var points = [];
- var point = null;
- var distance = 1 / 0;
- if (that._tooltip.isShared() && !that.hoveredSeries) {
- _each(that._storedSeries, function(_, series) {
- var point = series.getNeighborPoint(x, y);
- point && points.push(point)
- });
- _each(points, function(_, p) {
- var coords = p.getCrosshairData(x, y);
- var d = vizUtils.getDistance(x, y, coords.x, coords.y);
- if (d < distance) {
- point = p;
- distance = d
- }
- })
- }
- return point && point.series
- },
- _setTimeout: function(callback, keeper) {
- var that = this;
- if (that._timeoutKeeper !== keeper) {
- that._resetTimer();
- that._hoverTimeout = setTimeout(function() {
- callback();
- that._timeoutKeeper = null
- }, DELAY);
- that._timeoutKeeper = keeper
- }
- },
- _resetTimer: function() {
- clearTimeout(this._hoverTimeout);
- this._timeoutKeeper = this._hoverTimeout = null
- },
- _stopEvent: function(e) {
- if (!isDefined(e.cancelable) || e.cancelable) {
- e.preventDefault();
- e.stopPropagation()
- }
- },
- _setStuckSeries: function(e, series, x, y) {
- if ("mouse" !== e.pointerType) {
- this._stuckSeries = null
- } else {
- this._stuckSeries = series || this._stuckSeries || this._getSeriesForShared(x, y)
- }
- return !!this._stuckSeries
- },
- _pointerOut: function() {
- var that = this;
- that._stuckSeries = null;
- that._hideCrosshair();
- that._resetTimer();
- baseTrackerPrototype._pointerOut.apply(that, arguments)
- },
- _hoverArgumentAxis: function(x, y, e) {
- var that = this;
- that._resetHoveredArgument();
- if (that._axisHoverEnabled && that._argumentAxis.coordsIn(x, y)) {
- that._hoverArgument(getData(e, ARG_DATA));
- return true
- }
- },
- _pointerComplete: function(point, x, y) {
- var that = this;
- that.hoveredSeries && that.hoveredSeries.updateHover(x, y);
- that._resetTimer();
- that._moveCrosshair(point, x, y);
- baseTrackerPrototype._pointerComplete.call(that, point)
- },
- _legendClick: function(item, e) {
- var series = this._storedSeries[item.id];
- this._triggerLegendClick({
- target: series,
- event: e
- }, SERIES_CLICK)
- },
- _hoverLegendItem: function(x, y) {
- this._stuckSeries = null;
- this._hideCrosshair();
- baseTrackerPrototype._hoverLegendItem.call(this, x, y)
- },
- _pointerOnPoint: function(point, x, y, e) {
- this._setStuckSeries(e, point.series, x, y);
- this._releaseHoveredSeries();
- baseTrackerPrototype._pointerOnPoint.call(this, point, x, y, e)
- },
- _notifyLegendOnHoverArgument: false,
- _getArgumentHoverMode: function() {
- return correctHoverMode(this._argumentAxis)
- },
- dispose: function() {
- this._resetTimer();
- baseTrackerPrototype.dispose.call(this)
- }
- });
- var PieTracker = function(options) {
- this.ctor(options)
- };
- extend(PieTracker.prototype, baseTrackerPrototype, {
- _isPointerOut: function(_, point) {
- return !point
- },
- _legendClick: function(item, e) {
- var that = this;
- var points = [];
- that._storedSeries.forEach(function(s) {
- return points.push.apply(points, s.getPointsByKeys(item.argument, item.argumentIndex))
- });
- that._eventTrigger(LEGEND_CLICK, {
- target: item.argument,
- points: points,
- event: e
- })
- },
- _pointClick: function(point, e) {
- this._eventTrigger(POINT_CLICK, {
- target: point,
- event: e
- })
- },
- _hoverLegendItem: function(x, y) {
- var that = this;
- var item = that._legend.getItemByCoord(x, y);
- that._resetHoveredArgument();
- if (item) {
- that._hoverArgument(item.argument, item.argumentIndex)
- } else {
- that.clearHover()
- }
- },
- _getArgumentHoverMode: function() {
- return correctHoverMode(this._legend)
- },
- _hoverArgumentAxis: _noop,
- _setStuckSeries: _noop,
- _getCanvas: _noop,
- _notifyLegendOnHoverArgument: true
- });
- exports.ChartTracker = ChartTracker;
- exports.PieTracker = PieTracker
- },
- /*!******************************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/multi_axes_synchronizer.js ***!
- \******************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _console = __webpack_require__( /*! ../../core/utils/console */ 73);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _math2 = __webpack_require__( /*! ../../core/utils/math */ 28);
- var _math = Math;
- var _floor = _math.floor;
- var _max = _math.max;
- var _abs = _math.abs;
- function getValueAxesPerPanes(valueAxes) {
- var result = {};
- valueAxes.forEach(function(axis) {
- var pane = axis.pane;
- if (!result[pane]) {
- result[pane] = []
- }
- result[pane].push(axis)
- });
- return result
- }
- var linearConverter = {
- transform: function(v, b) {
- return (0, _math2.adjust)((0, _utils.getLog)(v, b))
- },
- addInterval: function(v, i) {
- return (0, _math2.adjust)(v + i)
- },
- getInterval: function(base, tickInterval) {
- return tickInterval
- }
- };
- var logConverter = {
- transform: function(v, b) {
- return (0, _math2.adjust)((0, _utils.raiseTo)(v, b))
- },
- addInterval: function(v, i) {
- return (0, _math2.adjust)(v * i)
- },
- getInterval: function(base, tickInterval) {
- return _math.pow(base, tickInterval)
- }
- };
- function convertAxisInfo(axisInfo, converter) {
- if (!axisInfo.isLogarithmic) {
- return
- }
- var base = axisInfo.logarithmicBase;
- var tickValues = axisInfo.tickValues;
- var tick;
- var ticks = [];
- axisInfo.minValue = converter.transform(axisInfo.minValue, base);
- axisInfo.oldMinValue = converter.transform(axisInfo.oldMinValue, base);
- axisInfo.maxValue = converter.transform(axisInfo.maxValue, base);
- axisInfo.oldMaxValue = converter.transform(axisInfo.oldMaxValue, base);
- axisInfo.tickInterval = _math.round(axisInfo.tickInterval);
- if (axisInfo.tickInterval < 1) {
- axisInfo.tickInterval = 1
- }
- var interval = converter.getInterval(base, axisInfo.tickInterval);
- tick = converter.transform(tickValues[0], base);
- while (ticks.length < tickValues.length) {
- ticks.push(tick);
- tick = converter.addInterval(tick, interval)
- }
- ticks.tickInterval = axisInfo.tickInterval;
- axisInfo.tickValues = ticks
- }
- function populateAxesInfo(axes) {
- return axes.reduce(function(result, axis) {
- var ticksValues = axis.getTicksValues();
- var majorTicks = ticksValues.majorTicksValues;
- var options = axis.getOptions();
- var businessRange = axis.getTranslator().getBusinessRange();
- var visibleArea = axis.getVisibleArea();
- var tickInterval = axis._tickInterval;
- var synchronizedValue = options.synchronizedValue;
- if (majorTicks && majorTicks.length > 0 && (0, _type.isNumeric)(majorTicks[0]) && "discrete" !== options.type && !businessRange.isEmpty() && !(businessRange.breaks && businessRange.breaks.length) && "zoom" !== axis.getViewport().action) {
- axis.applyMargins();
- var startValue = axis.getTranslator().from(visibleArea[0]);
- var endValue = axis.getTranslator().from(visibleArea[1]);
- var minValue = startValue < endValue ? startValue : endValue;
- var maxValue = startValue < endValue ? endValue : startValue;
- if (minValue === maxValue && (0, _type.isDefined)(synchronizedValue)) {
- tickInterval = _abs(majorTicks[0] - synchronizedValue) || 1;
- minValue = majorTicks[0] - tickInterval;
- maxValue = majorTicks[0] + tickInterval
- }
- var axisInfo = {
- axis: axis,
- isLogarithmic: "logarithmic" === options.type,
- logarithmicBase: businessRange.base,
- tickValues: majorTicks,
- minorValues: ticksValues.minorTicksValues,
- minorTickInterval: axis._minorTickInterval,
- minValue: minValue,
- oldMinValue: minValue,
- maxValue: maxValue,
- oldMaxValue: maxValue,
- inverted: businessRange.invert,
- tickInterval: tickInterval,
- synchronizedValue: synchronizedValue
- };
- convertAxisInfo(axisInfo, linearConverter);
- result.push(axisInfo);
- _console.debug.assert(axisInfo.minValue === axisInfo.maxValue && (!(0, _type.isDefined)(axisInfo.tickInterval) || (0, _type.isDefined)(options.tickInterval)) || (0, _type.isDefined)(axisInfo.tickInterval), "tickInterval was not provided")
- }
- return result
- }, [])
- }
- function updateTickValues(axesInfo) {
- var maxTicksCount = axesInfo.reduce(function(max, axisInfo) {
- return _max(max, axisInfo.tickValues.length)
- }, 0);
- axesInfo.forEach(function(axisInfo) {
- var additionalStartTicksCount = 0;
- var synchronizedValue = axisInfo.synchronizedValue;
- var tickValues = axisInfo.tickValues;
- var tickInterval = axisInfo.tickInterval;
- if ((0, _type.isDefined)(synchronizedValue)) {
- axisInfo.baseTickValue = axisInfo.invertedBaseTickValue = synchronizedValue;
- axisInfo.tickValues = [axisInfo.baseTickValue]
- } else {
- if (tickValues.length > 1 && tickInterval) {
- var ticksMultiplier = _floor((maxTicksCount + 1) / tickValues.length);
- var ticksCount = ticksMultiplier > 1 ? _floor((maxTicksCount + 1) / ticksMultiplier) : maxTicksCount;
- additionalStartTicksCount = _floor((ticksCount - tickValues.length) / 2);
- while (additionalStartTicksCount > 0 && 0 !== tickValues[0]) {
- tickValues.unshift((0, _math2.adjust)(tickValues[0] - tickInterval));
- additionalStartTicksCount--
- }
- while (tickValues.length < ticksCount) {
- tickValues.push((0, _math2.adjust)(tickValues[tickValues.length - 1] + tickInterval))
- }
- axisInfo.tickInterval = tickInterval / ticksMultiplier
- }
- axisInfo.baseTickValue = tickValues[0];
- axisInfo.invertedBaseTickValue = tickValues[tickValues.length - 1]
- }
- })
- }
- function getAxisRange(axisInfo) {
- return axisInfo.maxValue - axisInfo.minValue || 1
- }
- function getMainAxisInfo(axesInfo) {
- for (var i = 0; i < axesInfo.length; i++) {
- if (!axesInfo[i].stubData) {
- return axesInfo[i]
- }
- }
- return null
- }
- function correctMinMaxValues(axesInfo) {
- var mainAxisInfo = getMainAxisInfo(axesInfo);
- var mainAxisInfoTickInterval = mainAxisInfo.tickInterval;
- axesInfo.forEach(function(axisInfo) {
- var mainAxisBaseValueOffset;
- if (axisInfo !== mainAxisInfo) {
- if (mainAxisInfoTickInterval && axisInfo.tickInterval) {
- if (axisInfo.stubData && (0, _type.isDefined)(axisInfo.synchronizedValue)) {
- axisInfo.oldMinValue = axisInfo.minValue = axisInfo.baseTickValue - (mainAxisInfo.baseTickValue - mainAxisInfo.minValue) / mainAxisInfoTickInterval * axisInfo.tickInterval;
- axisInfo.oldMaxValue = axisInfo.maxValue = axisInfo.baseTickValue - (mainAxisInfo.baseTickValue - mainAxisInfo.maxValue) / mainAxisInfoTickInterval * axisInfo.tickInterval
- }
- var scale = mainAxisInfoTickInterval / getAxisRange(mainAxisInfo) / axisInfo.tickInterval * getAxisRange(axisInfo);
- axisInfo.maxValue = axisInfo.minValue + getAxisRange(axisInfo) / scale
- }
- if (mainAxisInfo.inverted && !axisInfo.inverted || !mainAxisInfo.inverted && axisInfo.inverted) {
- mainAxisBaseValueOffset = mainAxisInfo.maxValue - mainAxisInfo.invertedBaseTickValue
- } else {
- mainAxisBaseValueOffset = mainAxisInfo.baseTickValue - mainAxisInfo.minValue
- }
- var valueFromAxisInfo = getAxisRange(axisInfo);
- var move = (mainAxisBaseValueOffset / getAxisRange(mainAxisInfo) - (axisInfo.baseTickValue - axisInfo.minValue) / valueFromAxisInfo) * valueFromAxisInfo;
- axisInfo.minValue -= move;
- axisInfo.maxValue -= move
- }
- })
- }
- function calculatePaddings(axesInfo) {
- var startPadding = 0;
- var endPadding = 0;
- axesInfo.forEach(function(axisInfo) {
- var inverted = axisInfo.inverted;
- var minPadding = axisInfo.minValue > axisInfo.oldMinValue ? (axisInfo.minValue - axisInfo.oldMinValue) / getAxisRange(axisInfo) : 0;
- var maxPadding = axisInfo.maxValue < axisInfo.oldMaxValue ? (axisInfo.oldMaxValue - axisInfo.maxValue) / getAxisRange(axisInfo) : 0;
- startPadding = _max(startPadding, inverted ? maxPadding : minPadding);
- endPadding = _max(endPadding, inverted ? minPadding : maxPadding)
- });
- return {
- start: startPadding,
- end: endPadding
- }
- }
- function correctMinMaxValuesByPaddings(axesInfo, paddings) {
- axesInfo.forEach(function(info) {
- var range = getAxisRange(info);
- var inverted = info.inverted;
- info.minValue = (0, _math2.adjust)(info.minValue - paddings[inverted ? "end" : "start"] * range);
- info.maxValue = (0, _math2.adjust)(info.maxValue + paddings[inverted ? "start" : "end"] * range)
- })
- }
- function updateTickValuesIfSynchronizedValueUsed(axesInfo) {
- var hasSynchronizedValue = false;
- axesInfo.forEach(function(info) {
- hasSynchronizedValue = hasSynchronizedValue || (0, _type.isDefined)(info.synchronizedValue)
- });
- axesInfo.forEach(function(info) {
- var tickInterval = info.tickInterval;
- var tickValues = info.tickValues;
- var maxValue = info.maxValue;
- var minValue = info.minValue;
- var tick;
- if (hasSynchronizedValue && tickInterval) {
- while ((tick = (0, _math2.adjust)(tickValues[0] - tickInterval)) >= minValue) {
- tickValues.unshift(tick)
- }
- tick = tickValues[tickValues.length - 1];
- while ((tick = (0, _math2.adjust)(tick + tickInterval)) <= maxValue) {
- tickValues.push(tick)
- }
- }
- while (tickValues[0] + tickInterval / 10 < minValue) {
- tickValues.shift()
- }
- while (tickValues[tickValues.length - 1] - tickInterval / 10 > maxValue) {
- tickValues.pop()
- }
- })
- }
- function applyMinMaxValues(axesInfo) {
- axesInfo.forEach(function(info) {
- var axis = info.axis;
- var range = axis.getTranslator().getBusinessRange();
- if (range.min === range.minVisible) {
- range.min = info.minValue
- }
- if (range.max === range.maxVisible) {
- range.max = info.maxValue
- }
- range.minVisible = info.minValue;
- range.maxVisible = info.maxValue;
- if (range.min > range.minVisible) {
- range.min = range.minVisible
- }
- if (range.max < range.maxVisible) {
- range.max = range.maxVisible
- }
- axis.getTranslator().updateBusinessRange(range);
- axis.setTicks({
- majorTicks: info.tickValues,
- minorTicks: info.minorValues
- })
- })
- }
- function correctAfterSynchronize(axesInfo) {
- var invalidAxisInfo = [];
- var correctValue;
- axesInfo.forEach(function(info) {
- if (info.oldMaxValue - info.oldMinValue === 0) {
- invalidAxisInfo.push(info)
- } else {
- if (!(0, _type.isDefined)(correctValue) && !(0, _type.isDefined)(info.synchronizedValue)) {
- correctValue = _abs((info.maxValue - info.minValue) / (info.tickValues[_floor(info.tickValues.length / 2)] - info.minValue || info.maxValue))
- }
- }
- });
- if (!(0, _type.isDefined)(correctValue)) {
- return
- }
- invalidAxisInfo.forEach(function(info) {
- var firstTick = info.tickValues[0];
- var correctedTick = firstTick * correctValue;
- if (firstTick > 0) {
- info.maxValue = correctedTick;
- info.minValue = 0
- } else {
- if (firstTick < 0) {
- info.minValue = correctedTick;
- info.maxValue = 0
- }
- }
- })
- }
- function updateMinorTicks(axesInfo) {
- axesInfo.forEach(function(axisInfo) {
- if (!axisInfo.minorTickInterval) {
- return
- }
- var ticks = [];
- var interval = axisInfo.minorTickInterval;
- var tickCount = axisInfo.tickInterval / interval - 1;
- for (var i = 1; i < axisInfo.tickValues.length; i++) {
- var tick = axisInfo.tickValues[i - 1];
- for (var j = 0; j < tickCount; j++) {
- tick += interval;
- ticks.push(tick)
- }
- }
- axisInfo.minorValues = ticks
- })
- }
- var multiAxesSynchronizer = {
- synchronize: function(valueAxes) {
- (0, _iterator.each)(getValueAxesPerPanes(valueAxes), function(_, axes) {
- if (axes.length > 1) {
- var axesInfo = populateAxesInfo(axes);
- if (axesInfo.length < 2 || !getMainAxisInfo(axesInfo)) {
- return
- }
- updateTickValues(axesInfo);
- correctMinMaxValues(axesInfo);
- var paddings = calculatePaddings(axesInfo);
- correctMinMaxValuesByPaddings(axesInfo, paddings);
- correctAfterSynchronize(axesInfo);
- updateTickValuesIfSynchronizedValueUsed(axesInfo);
- updateMinorTicks(axesInfo);
- axesInfo.forEach(function(info) {
- convertAxisInfo(info, logConverter)
- });
- applyMinMaxValues(axesInfo)
- }
- })
- }
- };
- module.exports = multiAxesSynchronizer
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/translators/category_translator.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
- var round = Math.round;
- function getValue(value) {
- return value
- }
- module.exports = {
- translate: function(category, directionOffset) {
- var that = this;
- var canvasOptions = that._canvasOptions;
- var categoryIndex = that._categoriesToPoints[category.valueOf()];
- var specialValue = that.translateSpecialCase(category);
- var startPointIndex = canvasOptions.startPointIndex || 0;
- var stickInterval = that._options.stick ? 0 : .5;
- if (isDefined(specialValue)) {
- return round(specialValue)
- }
- if (!categoryIndex && 0 !== categoryIndex) {
- return null
- }
- directionOffset = directionOffset || 0;
- var stickDelta = categoryIndex + stickInterval - startPointIndex + .5 * directionOffset;
- return round(that._calculateProjection(canvasOptions.interval * stickDelta))
- },
- getInterval: function() {
- return this._canvasOptions.interval
- },
- getEventScale: function(zoomEvent) {
- var scale = zoomEvent.deltaScale || 1;
- return 1 - (1 - scale) / (.75 + this.visibleCategories.length / this._categories.length)
- },
- zoom: function(translate, scale) {
- var that = this;
- var categories = that._categories;
- var canvasOptions = that._canvasOptions;
- var stick = that._options.stick;
- var invert = canvasOptions.invert;
- var interval = canvasOptions.interval * scale;
- var translateCategories = translate / interval;
- var visibleCount = (that.visibleCategories || []).length;
- var startCategoryIndex = parseInt((canvasOptions.startPointIndex || 0) + translateCategories + .5);
- var categoriesLength = parseInt(adjust(canvasOptions.canvasLength / interval) + (stick ? 1 : 0)) || 1;
- var endCategoryIndex;
- if (invert) {
- startCategoryIndex = parseInt((canvasOptions.startPointIndex || 0) + visibleCount - translateCategories + .5) - categoriesLength
- }
- if (startCategoryIndex < 0) {
- startCategoryIndex = 0
- }
- endCategoryIndex = startCategoryIndex + categoriesLength;
- if (endCategoryIndex > categories.length) {
- endCategoryIndex = categories.length;
- startCategoryIndex = endCategoryIndex - categoriesLength;
- if (startCategoryIndex < 0) {
- startCategoryIndex = 0
- }
- }
- var newVisibleCategories = categories.slice(parseInt(startCategoryIndex), parseInt(endCategoryIndex));
- var newInterval = that._getDiscreteInterval(newVisibleCategories.length, canvasOptions);
- scale = newInterval / canvasOptions.interval;
- translate = that.translate(!invert ? newVisibleCategories[0] : newVisibleCategories[newVisibleCategories.length - 1]) * scale - (canvasOptions.startPoint + (stick ? 0 : newInterval / 2));
- return {
- min: newVisibleCategories[0],
- max: newVisibleCategories[newVisibleCategories.length - 1],
- translate: translate,
- scale: scale
- }
- },
- getMinScale: function(zoom) {
- var that = this;
- var canvasOptions = that._canvasOptions;
- var categoriesLength = (that.visibleCategories || that._categories).length;
- categoriesLength += (parseInt(.1 * categoriesLength) || 1) * (zoom ? -2 : 2);
- return canvasOptions.canvasLength / (Math.max(categoriesLength, 1) * canvasOptions.interval)
- },
- getScale: function(min, max) {
- var that = this;
- var canvasOptions = that._canvasOptions;
- var visibleArea = that.getCanvasVisibleArea();
- var stickOffset = !that._options.stick && 1;
- var minPoint = isDefined(min) ? that.translate(min, -stickOffset) : null;
- var maxPoint = isDefined(max) ? that.translate(max, +stickOffset) : null;
- if (null === minPoint) {
- minPoint = canvasOptions.invert ? visibleArea.max : visibleArea.min
- }
- if (null === maxPoint) {
- maxPoint = canvasOptions.invert ? visibleArea.min : visibleArea.max
- }
- return that.canvasLength / Math.abs(maxPoint - minPoint)
- },
- isValid: function(value) {
- return isDefined(value) ? this._categoriesToPoints[value.valueOf()] >= 0 : false
- },
- getCorrectValue: getValue,
- to: function(value, direction) {
- var canvasOptions = this._canvasOptions;
- var categoryIndex = this._categoriesToPoints[value.valueOf()];
- var startPointIndex = canvasOptions.startPointIndex || 0;
- var stickDelta = categoryIndex + (this._options.stick ? 0 : .5) - startPointIndex + (this._businessRange.invert ? -1 : 1) * direction * .5;
- return round(this._calculateProjection(canvasOptions.interval * stickDelta))
- },
- from: function(position) {
- var direction = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
- var canvasOptions = this._canvasOptions;
- var startPoint = canvasOptions.startPoint;
- var categories = this.visibleCategories || this._categories;
- var categoriesLength = categories.length;
- var stickInterval = this._options.stick ? .5 : 0;
- var result = round((position - startPoint) / canvasOptions.interval + stickInterval - .5 - .5 * direction);
- if (result >= categoriesLength) {
- result = categoriesLength - 1
- }
- if (result < 0) {
- result = 0
- }
- if (canvasOptions.invert) {
- result = categoriesLength - result - 1
- }
- return categories[result]
- },
- _add: function() {
- return NaN
- },
- _toValue: getValue,
- isValueProlonged: true
- }
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/translators/interval_translator.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var isNumber = typeUtils.isNumeric;
- var isDefined = typeUtils.isDefined;
- var dateUtils = __webpack_require__( /*! ../../core/utils/date */ 22);
- var addInterval = dateUtils.addInterval;
- var dateToMilliseconds = dateUtils.dateToMilliseconds;
- var floor = Math.floor;
- var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
- module.exports = {
- _intervalize: function(value, interval) {
- if (!isDefined(value)) {
- return
- }
- if ("datetime" === this._businessRange.dataType) {
- if (isNumber(value)) {
- value = new Date(value)
- } else {
- value = new Date(value.getTime())
- }
- value = dateUtils.correctDateWithUnitBeginning(value, interval)
- } else {
- value = adjust(floor(adjust(value / interval)) * interval, interval)
- }
- return value
- },
- translate: function(bp, direction, interval) {
- var that = this;
- var specialValue = that.translateSpecialCase(bp);
- if (isDefined(specialValue)) {
- return Math.round(specialValue)
- }
- interval = interval || that._options.interval;
- if (!that.isValid(bp, interval)) {
- return null
- }
- return that.to(bp, direction, interval)
- },
- getInterval: function() {
- return Math.round(this._canvasOptions.ratioOfCanvasRange * (this._businessRange.interval || Math.abs(this._canvasOptions.rangeMax - this._canvasOptions.rangeMin)))
- },
- zoom: function() {},
- getMinScale: function() {},
- getScale: function() {},
- _parse: function(value) {
- return "datetime" === this._businessRange.dataType ? new Date(value) : Number(value)
- },
- _fromValue: function(value) {
- return this._parse(value)
- },
- _toValue: function(value) {
- return this._parse(value)
- },
- isValid: function(value, interval) {
- var that = this;
- var co = that._canvasOptions;
- var rangeMin = co.rangeMin;
- var rangeMax = co.rangeMax;
- interval = interval || that._options.interval;
- if (null === value || isNaN(value)) {
- return false
- }
- value = "datetime" === that._businessRange.dataType && isNumber(value) ? new Date(value) : value;
- if (interval !== that._options.interval) {
- rangeMin = that._intervalize(rangeMin, interval);
- rangeMax = that._intervalize(rangeMax, interval)
- }
- if (value.valueOf() < rangeMin || value.valueOf() >= addInterval(rangeMax, interval)) {
- return false
- }
- return true
- },
- to: function(bp, direction, interval) {
- var that = this;
- interval = interval || that._options.interval;
- var v1 = that._intervalize(bp, interval);
- var v2 = addInterval(v1, interval);
- var res = that._to(v1);
- var p2 = that._to(v2);
- if (!direction) {
- res = floor((res + p2) / 2)
- } else {
- if (direction > 0) {
- res = p2
- }
- }
- return res
- },
- _to: function(value) {
- var co = this._canvasOptions;
- var rMin = co.rangeMinVisible;
- var rMax = co.rangeMaxVisible;
- var offset = value - rMin;
- if (value < rMin) {
- offset = 0
- } else {
- if (value > rMax) {
- offset = addInterval(rMax, this._options.interval) - rMin
- }
- }
- return this._conversionValue(this._calculateProjection(offset * this._canvasOptions.ratioOfCanvasRange))
- },
- from: function(position, direction) {
- var that = this;
- var origInterval = that._options.interval;
- var interval = origInterval;
- var co = that._canvasOptions;
- var rMin = co.rangeMinVisible;
- var rMax = co.rangeMaxVisible;
- var value;
- if ("datetime" === that._businessRange.dataType) {
- interval = dateToMilliseconds(origInterval)
- }
- value = that._calculateUnProjection((position - that._canvasOptions.startPoint) / that._canvasOptions.ratioOfCanvasRange);
- value = that._intervalize(addInterval(value, interval / 2, direction > 0), origInterval);
- if (value < rMin) {
- value = rMin
- } else {
- if (value > rMax) {
- value = rMax
- }
- }
- return value
- },
- _add: function() {
- return NaN
- },
- isValueProlonged: true
- }
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/translators/datetime_translator.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function parse(value) {
- return null !== value ? new Date(value) : value
- }
- module.exports = {
- _fromValue: parse,
- _toValue: parse,
- _add: __webpack_require__( /*! ../../core/utils/date */ 22).addDateInterval
- }
- },
- /*!************************************************************************!*\
- !*** ./artifacts/transpiled/viz/translators/logarithmic_translator.js ***!
- \************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var raiseTo = vizUtils.raiseTo;
- var getLog = vizUtils.getLog;
- module.exports = {
- _fromValue: function(value) {
- return null !== value ? getLog(value, this._canvasOptions.base) : value
- },
- _toValue: function(value) {
- return null !== value ? raiseTo(value, this._canvasOptions.base) : value
- },
- getMinBarSize: function(minBarSize) {
- var visibleArea = this.getCanvasVisibleArea();
- var minValue = this.from(visibleArea.min + minBarSize);
- var canvasOptions = this._canvasOptions;
- return Math.pow(canvasOptions.base, canvasOptions.rangeMinVisible + this._fromValue(this.from(visibleArea.min)) - this._fromValue(!isDefined(minValue) ? this.from(visibleArea.max) : minValue))
- },
- checkMinBarSize: function(initialValue, minShownValue, stackValue) {
- var canvasOptions = this._canvasOptions;
- var prevValue = stackValue - initialValue;
- var baseMethod = this.constructor.prototype.checkMinBarSize;
- var minBarSize;
- var updateValue;
- if (isDefined(minShownValue) && prevValue > 0) {
- minBarSize = baseMethod(this._fromValue(stackValue / prevValue), this._fromValue(minShownValue) - canvasOptions.rangeMinVisible);
- updateValue = Math.pow(canvasOptions.base, this._fromValue(prevValue) + minBarSize) - prevValue
- } else {
- updateValue = baseMethod(initialValue, minShownValue)
- }
- return updateValue
- }
- }
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/datetime_breaks.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dateUtils = __webpack_require__( /*! ../../core/utils/date */ 22);
- var days = [0, 1, 2, 3, 4, 5, 6];
- function getWeekendDays(workdays) {
- return days.filter(function(day) {
- return !workdays.some(function(workDay) {
- return workDay === day
- })
- })
- }
- function getNextDayIndex(dayIndex) {
- return (dayIndex + 1) % 7
- }
- function dayBetweenWeekend(weekend, day) {
- var start = weekend.start;
- var end = weekend.end;
- while (start !== end) {
- if (start === day) {
- return true
- }
- start = getNextDayIndex(start)
- }
- return false
- }
- function getDaysDistance(day, end) {
- var length = 0;
- while (day !== end) {
- day = getNextDayIndex(day);
- length++
- }
- return length
- }
- function separateBreak(scaleBreak, day) {
- var result = [];
- var dayEnd = new Date(day);
- dayEnd.setDate(day.getDate() + 1);
- if (day > scaleBreak.from) {
- result.push({
- from: scaleBreak.from,
- to: day
- })
- }
- if (dayEnd < scaleBreak.to) {
- result.push({
- from: dayEnd,
- to: scaleBreak.to
- })
- }
- return result
- }
- function getWeekEndDayIndices(workDays) {
- var indices = getWeekendDays(workDays);
- if (indices.length < 7) {
- while (getNextDayIndex(indices[indices.length - 1]) === indices[0]) {
- indices.unshift(indices.pop())
- }
- }
- return indices
- }
- function generateDateBreaksForWeekend(min, max, weekendDayIndices) {
- var day = min.getDate();
- var breaks = [];
- var weekends = weekendDayIndices.reduce(function(obj, day) {
- var currentWeekEnd = obj[1];
- if (void 0 === currentWeekEnd.start) {
- currentWeekEnd = {
- start: day,
- end: getNextDayIndex(day)
- };
- obj[0].push(currentWeekEnd);
- return [obj[0], currentWeekEnd]
- } else {
- if (currentWeekEnd.end === day) {
- currentWeekEnd.end = getNextDayIndex(day);
- return obj
- }
- }
- currentWeekEnd = {
- start: day,
- end: getNextDayIndex(day)
- };
- obj[0].push(currentWeekEnd);
- return [obj[0], currentWeekEnd]
- }, [
- [], {}
- ]);
- weekends[0].forEach(function(weekend) {
- var currentDate = new Date(min);
- currentDate = dateUtils.trimTime(currentDate);
- while (currentDate < max) {
- day = currentDate.getDay();
- var date = currentDate.getDate();
- if (dayBetweenWeekend(weekend, day)) {
- var from = new Date(currentDate);
- var to;
- currentDate.setDate(date + getDaysDistance(day, weekend.end));
- to = new Date(currentDate);
- breaks.push({
- from: from,
- to: to
- })
- }
- currentDate.setDate(currentDate.getDate() + 1)
- }
- });
- return breaks
- }
- function excludeWorkDaysFromWeekEndBreaks(breaks, exactWorkDays) {
- var result = breaks.slice();
- var i;
- var processWorkDay = function(workday) {
- workday = dateUtils.trimTime(new Date(workday));
- if (result[i].from <= workday && result[i].to > workday) {
- var separatedBreak = separateBreak(result[i], workday);
- if (2 === separatedBreak.length) {
- result.splice(i, 1, separatedBreak[0], separatedBreak[1])
- } else {
- if (1 === separatedBreak.length) {
- result.splice(i, 1, separatedBreak[0])
- } else {
- result.splice(i, 1)
- }
- }
- }
- };
- for (i = 0; i < result.length; i++) {
- exactWorkDays.forEach(processWorkDay)
- }
- return result
- }
- function generateBreaksForHolidays(min, max, holidays, weekendDayIndices) {
- var day;
- var dayInWeekend = function(dayIndex) {
- return dayIndex === day
- };
- var adjustedMin = dateUtils.trimTime(min);
- var adjustedMax = dateUtils.trimTime(max);
- adjustedMax.setDate(max.getDate() + 1);
- return holidays.reduce(function(breaks, holiday) {
- var holidayStart;
- var holidayEnd;
- holiday = new Date(holiday);
- day = holiday.getDay();
- if (!weekendDayIndices.some(dayInWeekend) && holiday >= adjustedMin && holiday <= adjustedMax) {
- holidayStart = dateUtils.trimTime(holiday);
- holidayEnd = new Date(holidayStart);
- holidayEnd.setDate(holidayStart.getDate() + 1);
- breaks.push({
- from: holidayStart,
- to: holidayEnd
- })
- }
- return breaks
- }, [])
- }
- function calculateGaps(breaks) {
- return breaks.map(function(b) {
- return {
- from: b.from,
- to: b.to,
- gapSize: dateUtils.convertMillisecondsToDateUnits(b.to - b.from)
- }
- })
- }
- exports.generateDateBreaks = function(min, max, workWeek, singleWorkdays, holidays) {
- var weekendDayIndices = getWeekEndDayIndices(workWeek);
- var breaks = generateDateBreaksForWeekend(min, max, weekendDayIndices);
- breaks.push.apply(breaks, generateBreaksForHolidays(min, max, holidays || [], weekendDayIndices));
- return calculateGaps(excludeWorkDaysFromWeekEndBreaks(breaks, singleWorkdays || []))
- }
- },
- /*!*****************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/polar_axes.js ***!
- \*****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var constants = __webpack_require__( /*! ./axes_constants */ 248);
- var xyAxesLinear = __webpack_require__( /*! ./xy_axes */ 408).linear;
- var tick = __webpack_require__( /*! ./tick */ 407).tick;
- var _map = vizUtils.map;
- var baseAxisModule = __webpack_require__( /*! ./base_axis */ 204);
- var _math = Math;
- var _abs = _math.abs;
- var _round = _math.round;
- var convertPolarToXY = vizUtils.convertPolarToXY;
- var _extend = extend;
- var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var HALF_PI_ANGLE = 90;
- function getPolarQuarter(angle) {
- var quarter;
- angle = vizUtils.normalizeAngle(angle);
- if (angle >= 315 && angle <= 360 || angle < 45 && angle >= 0) {
- quarter = 1
- } else {
- if (angle >= 45 && angle < 135) {
- quarter = 2
- } else {
- if (angle >= 135 && angle < 225) {
- quarter = 3
- } else {
- if (angle >= 225 && angle < 315) {
- quarter = 4
- }
- }
- }
- }
- return quarter
- }
- var polarAxes = exports;
- var circularAxes = polarAxes.circular = {
- _calculateValueMargins: function(ticks) {
- var _this$_getViewportRan = this._getViewportRange(),
- minVisible = _this$_getViewportRan.minVisible,
- maxVisible = _this$_getViewportRan.maxVisible;
- if (ticks && ticks.length > 1) {
- minVisible = minVisible < ticks[0].value ? minVisible : ticks[0].value;
- maxVisible = minVisible > ticks[ticks.length - 1].value ? maxVisible : ticks[ticks.length - 1].value
- }
- return {
- minValue: minVisible,
- maxValue: maxVisible
- }
- },
- applyMargins: function() {
- var margins = this._calculateValueMargins(this._majorTicks);
- var br = this._translator.getBusinessRange();
- br.addRange({
- minVisible: margins.minValue,
- maxVisible: margins.maxValue,
- interval: this._calculateRangeInterval(br.interval)
- });
- this._translator.updateBusinessRange(br)
- },
- _getTranslatorOptions: function() {
- return {
- isHorizontal: true,
- conversionValue: true,
- addSpiderCategory: this._getSpiderCategoryOption(),
- stick: this._getStick()
- }
- },
- getCenter: function() {
- return this._center
- },
- getRadius: function() {
- return this._radius
- },
- getAngles: function() {
- var options = this._options;
- return [options.startAngle, options.endAngle]
- },
- _updateRadius: function(canvas) {
- var rad = Math.min(canvas.width - canvas.left - canvas.right, canvas.height - canvas.top - canvas.bottom) / 2;
- this._radius = rad < 0 ? 0 : rad
- },
- _updateCenter: function(canvas) {
- this._center = {
- x: canvas.left + (canvas.width - canvas.right - canvas.left) / 2,
- y: canvas.top + (canvas.height - canvas.top - canvas.bottom) / 2
- }
- },
- _processCanvas: function(canvas) {
- this._updateRadius(canvas);
- this._updateCenter(canvas);
- return {
- left: 0,
- right: 0,
- width: this._getScreenDelta()
- }
- },
- _createAxisElement: function() {
- return this._renderer.circle()
- },
- _updateAxisElementPosition: function() {
- var center = this.getCenter();
- this._axisElement.attr({
- cx: center.x,
- cy: center.y,
- r: this.getRadius()
- })
- },
- _boundaryTicksVisibility: {
- min: true
- },
- _getSpiderCategoryOption: function() {
- return this._options.firstPointOnStartAngle
- },
- _validateOptions: function(options) {
- var that = this;
- var originValue = options.originValue;
- var wholeRange = options.wholeRange = {};
- var period = options.period;
- if (isDefined(originValue)) {
- originValue = that.validateUnit(originValue)
- }
- if (period > 0 && options.argumentType === constants.numeric) {
- originValue = originValue || 0;
- wholeRange.endValue = originValue + period;
- that._viewport = vizUtils.getVizRangeObject([originValue, wholeRange.endValue])
- }
- if (isDefined(originValue)) {
- wholeRange.startValue = originValue
- }
- },
- getMargins: function() {
- var tickOptions = this._options.tick;
- var tickOuterLength = Math.max(tickOptions.visible ? tickOptions.length / 2 + tickOptions.shift : 0, 0);
- var radius = this.getRadius();
- var _this$_center = this._center,
- x = _this$_center.x,
- y = _this$_center.y;
- var labelBoxes = this._majorTicks.map(function(t) {
- return t.label && t.label.getBBox()
- }).filter(function(b) {
- return b
- });
- var canvas = extend({}, this._canvas, {
- left: x - radius,
- top: y - radius,
- right: this._canvas.width - (x + radius),
- bottom: this._canvas.height - (y + radius)
- });
- var margins = baseAxisModule.calculateCanvasMargins(labelBoxes, canvas);
- Object.keys(margins).forEach(function(k) {
- return margins[k] = margins[k] < tickOuterLength ? tickOuterLength : margins[k]
- });
- return margins
- },
- updateSize: function() {
- var that = this;
- baseAxisModule.Axis.prototype.updateSize.apply(that, arguments);
- baseAxisModule.measureLabels(that._majorTicks);
- that._adjustLabelsCoord(0, 0, true);
- this._checkBoundedLabelsOverlapping(this._majorTicks, this._majorTicks.map(function(t) {
- return t.labelBBox
- }))
- },
- _setVisualRange: _noop,
- allowToExtendVisualRange: function(isEnd) {
- return true
- },
- _getStick: function() {
- return this._options.firstPointOnStartAngle || this._options.type !== constants.discrete
- },
- _getTranslatedCoord: function(value, offset) {
- return this._translator.translate(value, offset) - HALF_PI_ANGLE
- },
- _getCanvasStartEnd: function() {
- return {
- start: 0 - HALF_PI_ANGLE,
- end: 360 - HALF_PI_ANGLE
- }
- },
- _getStripGraphicAttributes: function(fromAngle, toAngle) {
- var center = this.getCenter();
- var angle = this.getAngles()[0];
- var r = this.getRadius();
- return {
- x: center.x,
- y: center.y,
- innerRadius: 0,
- outerRadius: r,
- startAngle: -toAngle - angle,
- endAngle: -fromAngle - angle
- }
- },
- _createStrip: function(coords) {
- return this._renderer.arc(coords.x, coords.y, coords.innerRadius, coords.outerRadius, coords.startAngle, coords.endAngle)
- },
- _getStripLabelCoords: function(from, to) {
- var that = this;
- var coords = that._getStripGraphicAttributes(from, to);
- var angle = coords.startAngle + (coords.endAngle - coords.startAngle) / 2;
- var cosSin = vizUtils.getCosAndSin(angle);
- var halfRad = that.getRadius() / 2;
- var center = that.getCenter();
- var x = _round(center.x + halfRad * cosSin.cos);
- var y = _round(center.y - halfRad * cosSin.sin);
- return {
- x: x,
- y: y,
- align: constants.center
- }
- },
- _getConstantLineGraphicAttributes: function(value) {
- var center = this.getCenter();
- var r = this.getRadius();
- return {
- points: [center.x, center.y, center.x + r, center.y]
- }
- },
- _createConstantLine: function(value, attr) {
- return this._createPathElement(this._getConstantLineGraphicAttributes(value).points, attr)
- },
- _rotateConstantLine: function(line, value) {
- var _this$getCenter = this.getCenter(),
- x = _this$getCenter.x,
- y = _this$getCenter.y;
- line.rotate(value + this.getAngles()[0], x, y)
- },
- _getConstantLineLabelsCoords: function(value) {
- var that = this;
- var cosSin = vizUtils.getCosAndSin(-value - that.getAngles()[0]);
- var halfRad = that.getRadius() / 2;
- var center = that.getCenter();
- var x = _round(center.x + halfRad * cosSin.cos);
- var y = _round(center.y - halfRad * cosSin.sin);
- return {
- x: x,
- y: y
- }
- },
- _checkAlignmentConstantLineLabels: _noop,
- _adjustDivisionFactor: function(val) {
- return 180 * val / (this.getRadius() * Math.PI)
- },
- _getScreenDelta: function() {
- var angles = this.getAngles();
- return _math.abs(angles[0] - angles[1])
- },
- _getTickMarkPoints: function(coords, length, _ref) {
- var _ref$shift = _ref.shift,
- shift = void 0 === _ref$shift ? 0 : _ref$shift;
- var center = this.getCenter();
- var corrections = {
- inside: -1,
- center: -.5,
- outside: 0
- };
- var radiusWithTicks = this.getRadius() + length * corrections[this._options.tickOrientation || "center"];
- return [center.x + radiusWithTicks + shift, center.y, center.x + radiusWithTicks + length + shift, center.y]
- },
- _getLabelAdjustedCoord: function(tick, _offset, _maxWidth, checkCanvas) {
- var that = this;
- var labelCoords = tick.labelCoords;
- var labelY = labelCoords.y;
- var labelAngle = labelCoords.angle;
- var cosSin = vizUtils.getCosAndSin(labelAngle);
- var cos = cosSin.cos;
- var sin = cosSin.sin;
- var box = tick.labelBBox;
- var halfWidth = box.width / 2;
- var halfHeight = box.height / 2;
- var indentFromAxis = that._options.label.indentFromAxis || 0;
- var x = labelCoords.x + indentFromAxis * cos;
- var y = labelY + (labelY - box.y - halfHeight) + indentFromAxis * sin;
- var shiftX = 0;
- var shiftY = 0;
- switch (getPolarQuarter(labelAngle)) {
- case 1:
- shiftX = halfWidth;
- shiftY = halfHeight * sin;
- break;
- case 2:
- shiftX = halfWidth * cos;
- shiftY = halfHeight;
- break;
- case 3:
- shiftX = -halfWidth;
- shiftY = halfHeight * sin;
- break;
- case 4:
- shiftX = halfWidth * cos;
- shiftY = -halfHeight
- }
- if (checkCanvas) {
- var canvas = that._canvas;
- var boxShiftX = x - labelCoords.x + shiftX;
- var boxShiftY = y - labelCoords.y + shiftY;
- if (box.x + boxShiftX < canvas.originalLeft) {
- shiftX -= box.x + boxShiftX - canvas.originalLeft
- }
- if (box.x + box.width + boxShiftX > canvas.width - canvas.originalRight) {
- shiftX -= box.x + box.width + boxShiftX - (canvas.width - canvas.originalRight)
- }
- if (box.y + boxShiftY < canvas.originalTop) {
- shiftY -= box.y + boxShiftY - canvas.originalTop
- }
- if (box.y + box.height + boxShiftY > canvas.height - canvas.originalBottom) {
- shiftY -= box.y + box.height + boxShiftY - (canvas.height - canvas.originalBottom)
- }
- }
- return {
- x: x + shiftX,
- y: y + shiftY
- }
- },
- _getGridLineDrawer: function() {
- var that = this;
- return function(tick, gridStyle) {
- var center = that.getCenter();
- return that._createPathElement(that._getGridPoints().points, gridStyle).rotate(tick.coords.angle, center.x, center.y)
- }
- },
- _getGridPoints: function() {
- var r = this.getRadius();
- var center = this.getCenter();
- return {
- points: [center.x, center.y, center.x + r, center.y]
- }
- },
- _getTranslatedValue: function(value, offset) {
- var startAngle = this.getAngles()[0];
- var angle = this._translator.translate(value, -offset);
- var coords = convertPolarToXY(this.getCenter(), startAngle, angle, this.getRadius());
- return {
- x: coords.x,
- y: coords.y,
- angle: angle + startAngle - HALF_PI_ANGLE
- }
- },
- _getAdjustedStripLabelCoords: function(strip) {
- var box = strip.labelBBox;
- return {
- translateY: strip.label.attr("y") - box.y - box.height / 2
- }
- },
- coordsIn: function(x, y) {
- return vizUtils.convertXYToPolar(this.getCenter(), x, y).r > this.getRadius()
- },
- _rotateTick: function(element, coords) {
- var center = this.getCenter();
- element.rotate(coords.angle, center.x, center.y)
- },
- _validateOverlappingMode: function(mode) {
- return constants.validateOverlappingMode(mode)
- },
- _validateDisplayMode: function() {
- return "standard"
- },
- _getStep: function(boxes) {
- var that = this;
- var radius = that.getRadius() + (that._options.label.indentFromAxis || 0);
- var maxLabelBox = boxes.reduce(function(prevValue, box) {
- var curValue = prevValue;
- if (prevValue.width < box.width) {
- curValue.width = box.width
- }
- if (prevValue.height < box.height) {
- curValue.height = box.height
- }
- return curValue
- }, {
- width: 0,
- height: 0
- });
- var angle1 = _abs(2 * _math.atan(maxLabelBox.height / (2 * radius - maxLabelBox.width)) * 180 / _math.PI);
- var angle2 = _abs(2 * _math.atan(maxLabelBox.width / (2 * radius - maxLabelBox.height)) * 180 / _math.PI);
- return constants.getTicksCountInRange(that._majorTicks, "angle", _math.max(angle1, angle2))
- },
- _checkBoundedLabelsOverlapping: function(majorTicks, boxes, mode) {
- var labelOpt = this._options.label;
- mode = mode || this._validateOverlappingMode(labelOpt.overlappingBehavior);
- if ("hide" !== mode) {
- return
- }
- var lastVisibleLabelIndex = majorTicks.reduce(function(lastVisibleLabelIndex, tick, index) {
- return tick.label ? index : lastVisibleLabelIndex
- }, null);
- if (!lastVisibleLabelIndex) {
- return
- }
- if (constants.areLabelsOverlap(boxes[0], boxes[lastVisibleLabelIndex], labelOpt.minSpacing, constants.center)) {
- "first" === labelOpt.hideFirstOrLast ? majorTicks[0].label.remove() : majorTicks[lastVisibleLabelIndex].label.remove()
- }
- },
- shift: function(margins) {
- this._axisGroup.attr({
- translateX: margins.right,
- translateY: margins.bottom
- })
- }
- };
- polarAxes.circularSpider = _extend({}, circularAxes, {
- _createAxisElement: function() {
- return this._renderer.path([], "area")
- },
- _updateAxisElementPosition: function() {
- this._axisElement.attr({
- points: _map(this.getSpiderTicks(), function(tick) {
- return {
- x: tick.coords.x,
- y: tick.coords.y
- }
- })
- })
- },
- _getStick: function() {
- return true
- },
- _getSpiderCategoryOption: function() {
- return true
- },
- getSpiderTicks: function() {
- var that = this;
- var ticks = that.getFullTicks();
- that._spiderTicks = ticks.map(tick(that, that.renderer, {}, {}, that._getSkippedCategory(ticks), true));
- that._spiderTicks.forEach(function(tick) {
- tick.initCoords()
- });
- return that._spiderTicks
- },
- _getStripGraphicAttributes: function(fromAngle, toAngle) {
- var center = this.getCenter();
- var spiderTicks = this.getSpiderTicks();
- var firstTick;
- var lastTick;
- var points = [];
- var i = 0;
- var len = spiderTicks.length;
- while (i < len) {
- var _tick = spiderTicks[i].coords;
- if (_tick.angle >= fromAngle && _tick.angle <= toAngle) {
- if (!firstTick) {
- firstTick = (spiderTicks[i - 1] || spiderTicks[spiderTicks.length - 1]).coords;
- points.push((_tick.x + firstTick.x) / 2, (_tick.y + firstTick.y) / 2)
- }
- points.push(_tick.x, _tick.y);
- var nextTick = (spiderTicks[i + 1] || spiderTicks[0]).coords;
- lastTick = {
- x: (_tick.x + nextTick.x) / 2,
- y: (_tick.y + nextTick.y) / 2
- }
- }
- i++
- }
- points.push(lastTick.x, lastTick.y);
- points.push(center.x, center.y);
- return {
- points: points
- }
- },
- _createStrip: function(_ref2) {
- var points = _ref2.points;
- return this._renderer.path(points, "area")
- },
- _getTranslatedCoord: function(value, offset) {
- return this._translator.translate(value, offset) - HALF_PI_ANGLE
- },
- _setTickOffset: function() {
- this._tickOffset = false
- }
- });
- polarAxes.linear = {
- applyMargins: circularAxes.applyMargins,
- _resetMargins: function() {
- this._reinitTranslator(this._getViewportRange())
- },
- _setVisualRange: _noop,
- _getStick: xyAxesLinear._getStick,
- _getSpiderCategoryOption: _noop,
- _getTranslatorOptions: function() {
- return {
- isHorizontal: true,
- stick: this._getStick()
- }
- },
- _updateRadius: circularAxes._updateRadius,
- getRadius: circularAxes.getRadius,
- getCenter: circularAxes.getCenter,
- getAngles: circularAxes.getAngles,
- _updateCenter: circularAxes._updateCenter,
- _processCanvas: function(canvas) {
- this._updateRadius(canvas);
- this._updateCenter(canvas);
- return {
- left: 0,
- right: 0,
- width: this.getRadius()
- }
- },
- _createAxisElement: xyAxesLinear._createAxisElement,
- _updateAxisElementPosition: function() {
- var centerCoord = this.getCenter();
- this._axisElement.attr({
- points: [centerCoord.x, centerCoord.y, centerCoord.x + this.getRadius(), centerCoord.y]
- }).rotate(this.getAngles()[0] - HALF_PI_ANGLE, centerCoord.x, centerCoord.y)
- },
- _getScreenDelta: function() {
- return this.getRadius()
- },
- _getTickMarkPoints: function(coords, length) {
- return [coords.x - length / 2, coords.y, coords.x + length / 2, coords.y]
- },
- _getLabelAdjustedCoord: function(tick) {
- var that = this;
- var labelCoords = tick.labelCoords;
- var labelY = labelCoords.y;
- var cosSin = vizUtils.getCosAndSin(labelCoords.angle);
- var indentFromAxis = that._options.label.indentFromAxis || 0;
- var box = tick.labelBBox;
- var x = labelCoords.x - _abs(indentFromAxis * cosSin.sin) + _abs(box.width / 2 * cosSin.cos) - box.width / 2;
- var y = labelY + (labelY - box.y) - _abs(box.height / 2 * cosSin.sin) + _abs(indentFromAxis * cosSin.cos);
- return {
- x: x,
- y: y
- }
- },
- _getGridLineDrawer: function() {
- var that = this;
- return function(tick, gridStyle) {
- var grid = that._getGridPoints(tick.coords);
- return that._renderer.circle(grid.cx, grid.cy, grid.r).attr(gridStyle).sharp()
- }
- },
- _getGridPoints: function(coords) {
- var pos = this.getCenter();
- var radius = vizUtils.getDistance(pos.x, pos.y, coords.x, coords.y);
- if (radius > this.getRadius()) {
- return {
- cx: null,
- cy: null,
- r: null
- }
- }
- return {
- cx: pos.x,
- cy: pos.y,
- r: radius
- }
- },
- _getTranslatedValue: function(value, offset) {
- var startAngle = this.getAngles()[0];
- var xy = convertPolarToXY(this.getCenter(), startAngle, 0, this._translator.translate(value, offset));
- return {
- x: xy.x,
- y: xy.y,
- angle: startAngle - HALF_PI_ANGLE
- }
- },
- _getTranslatedCoord: function(value, offset) {
- return this._translator.translate(value, offset)
- },
- _getCanvasStartEnd: function() {
- return {
- start: 0,
- end: this.getRadius()
- }
- },
- _getStripGraphicAttributes: function(fromPoint, toPoint) {
- var center = this.getCenter();
- return {
- x: center.x,
- y: center.y,
- innerRadius: fromPoint,
- outerRadius: toPoint
- }
- },
- _createStrip: function(attrs) {
- return this._renderer.arc(attrs.x, attrs.y, attrs.innerRadius, attrs.outerRadius, 0, 360)
- },
- _getAdjustedStripLabelCoords: circularAxes._getAdjustedStripLabelCoords,
- _getStripLabelCoords: function(from, to) {
- var that = this;
- var labelPos = from + (to - from) / 2;
- var center = that.getCenter();
- var y = _round(center.y - labelPos);
- return {
- x: center.x,
- y: y,
- align: constants.center
- }
- },
- _getConstantLineGraphicAttributes: function(value) {
- var center = this.getCenter();
- return {
- cx: center.x,
- cy: center.y,
- r: value
- }
- },
- _createConstantLine: function(value, attr) {
- var attrs = this._getConstantLineGraphicAttributes(value);
- return this._renderer.circle(attrs.cx, attrs.cy, attrs.r).attr(attr).sharp()
- },
- _getConstantLineLabelsCoords: function(value) {
- var that = this;
- var center = that.getCenter();
- var y = _round(center.y - value);
- return {
- x: center.x,
- y: y
- }
- },
- _checkAlignmentConstantLineLabels: _noop,
- _rotateTick: function(element, coords, isGridLine) {
- !isGridLine && element.rotate(coords.angle + HALF_PI_ANGLE, coords.x, coords.y)
- },
- _validateOverlappingMode: circularAxes._validateOverlappingMode,
- _validateDisplayMode: circularAxes._validateDisplayMode,
- _getStep: function(boxes) {
- var quarter = getPolarQuarter(this.getAngles()[0]);
- var spacing = this._options.label.minSpacing;
- var func = 2 === quarter || 4 === quarter ? function(box) {
- return box.width + spacing
- } : function(box) {
- return box.height
- };
- var maxLabelLength = boxes.reduce(function(prevValue, box) {
- return _math.max(prevValue, func(box))
- }, 0);
- return constants.getTicksCountInRange(this._majorTicks, 2 === quarter || 4 === quarter ? "x" : "y", maxLabelLength)
- }
- };
- polarAxes.linearSpider = _extend({}, polarAxes.linear, {
- _createPathElement: function(points, attr) {
- return this._renderer.path(points, "area").attr(attr).sharp()
- },
- setSpiderTicks: function(ticks) {
- this._spiderTicks = ticks
- },
- _getGridLineDrawer: function() {
- var that = this;
- return function(tick, gridStyle, element) {
- return that._createPathElement(that._getGridPoints(tick.coords).points, gridStyle)
- }
- },
- _getGridPoints: function(coords) {
- var pos = this.getCenter();
- var radius = vizUtils.getDistance(pos.x, pos.y, coords.x, coords.y);
- return this._getGridPointsByRadius(radius)
- },
- _getGridPointsByRadius: function(radius) {
- var pos = this.getCenter();
- if (radius > this.getRadius()) {
- return {
- points: null
- }
- }
- return {
- points: _map(this._spiderTicks, function(tick) {
- var cosSin = vizUtils.getCosAndSin(tick.coords.angle);
- return {
- x: _round(pos.x + radius * cosSin.cos),
- y: _round(pos.y + radius * cosSin.sin)
- }
- })
- }
- },
- _getStripGraphicAttributes: function(fromPoint, toPoint) {
- var innerPoints = this._getGridPointsByRadius(toPoint).points;
- var outerPoints = this._getGridPointsByRadius(fromPoint).points;
- return {
- points: [outerPoints, innerPoints.reverse()]
- }
- },
- _createStrip: polarAxes.circularSpider._createStrip,
- _getConstantLineGraphicAttributes: function(value) {
- return this._getGridPointsByRadius(value)
- },
- _createConstantLine: function(value, attr) {
- return this._createPathElement(this._getConstantLineGraphicAttributes(value).points, attr)
- }
- })
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/constant_line.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = createConstantLine;
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- function createConstantLine(axis, options) {
- var labelOptions = options.label || {};
- var labelPosition = labelOptions.position || "inside";
- var parsedValue;
- var valueIsParsed = false;
- axis._checkAlignmentConstantLineLabels(labelOptions);
- var storedCoord;
- return {
- options: options,
- labelOptions: labelOptions,
- labelPosition: labelPosition,
- label: null,
- line: null,
- getParsedValue: function() {
- if (!valueIsParsed) {
- parsedValue = axis.validateUnit(options.value, "E2105", "constantLine");
- valueIsParsed = true;
- return parsedValue
- }
- return parsedValue
- },
- draw: function() {
- if (!(0, _type.isDefined)(options.value) || axis._translator.getBusinessRange().isEmpty()) {
- return this
- }
- var canvas = axis._getCanvasStartEnd();
- var parsedValue = this.getParsedValue();
- this.coord = axis._getConstantLinePos(parsedValue, canvas.start, canvas.end);
- var rootGroup = options.displayBehindSeries ? axis._axisConstantLineGroups.under : axis._axisConstantLineGroups.above;
- var group = rootGroup[labelPosition];
- if (!group) {
- var side = axis._isHorizontal ? labelOptions.verticalAlignment : labelOptions.horizontalAlignment;
- group = rootGroup[side]
- }
- if (!(0, _type.isDefined)(this.coord)) {
- return this
- }
- var path = axis._createConstantLine(this.coord, {
- stroke: options.color,
- "stroke-width": options.width,
- dashStyle: options.dashStyle
- });
- this.line = path.append(rootGroup.inside);
- this.label = labelOptions.visible ? axis._drawConstantLineLabels(parsedValue, labelOptions, this.coord, group) : null;
- this.updatePosition();
- return this
- },
- removeLabel: function() {
- this.label && this.label.remove()
- },
- updatePosition: function(animate) {
- var canvas = axis._getCanvasStartEnd();
- var coord = axis._getConstantLinePos(this.getParsedValue(), canvas.start, canvas.end);
- if (!(0, _type.isDefined)(coord)) {
- return
- }
- this.coord = coord;
- if (animate && storedCoord) {
- this.label && this.label.attr(axis._getConstantLineLabelsCoords(storedCoord, this.labelOptions));
- this.line && this.line.attr(axis._getConstantLineGraphicAttributes(storedCoord));
- this.label && this.label.animate(axis._getConstantLineLabelsCoords(this.coord, this.labelOptions));
- this.line && this.line.animate(axis._getConstantLineGraphicAttributes(this.coord))
- } else {
- this.label && this.label.attr(axis._getConstantLineLabelsCoords(this.coord, this.labelOptions));
- this.line && this.line.attr(axis._getConstantLineGraphicAttributes(this.coord));
- axis._rotateConstantLine(this.line, this.coord)
- }
- },
- saveCoords: function() {
- storedCoord = this.coord
- }
- }
- }
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/viz/axes/strip.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = createStrip;
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- function createStrip(axis, options) {
- var storedCoord;
- var labelOptions = options.label || {};
- return {
- options: options,
- label: null,
- rect: null,
- _getCoord: function() {
- var canvas = axis._getCanvasStartEnd();
- var range = axis._translator.getBusinessRange();
- return axis._getStripPos(options.startValue, options.endValue, canvas.start, canvas.end, range)
- },
- _drawLabel: function(coords) {
- return axis._renderer.text(labelOptions.text, coords.x, coords.y).css((0, _utils.patchFontOptions)((0, _extend.extend)({}, axis.getOptions().label.font, labelOptions.font))).attr({
- align: "center",
- "class": labelOptions.cssClass
- }).append(axis._axisStripLabelGroup)
- },
- draw: function() {
- if (axis._translator.getBusinessRange().isEmpty()) {
- return
- }
- if (((0, _type.isDefined)(options.startValue) || (0, _type.isDefined)(options.endValue)) && (0, _type.isDefined)(options.color)) {
- var stripPos = this._getCoord();
- this.labelCoords = labelOptions.text ? axis._getStripLabelCoords(stripPos.from, stripPos.to, labelOptions) : null;
- if (stripPos.outOfCanvas || !(0, _type.isDefined)(stripPos.to) || !(0, _type.isDefined)(stripPos.from)) {
- return
- }
- this.rect = axis._createStrip(axis._getStripGraphicAttributes(stripPos.from, stripPos.to)).attr({
- fill: options.color
- }).append(axis._axisStripGroup);
- this.label = labelOptions.text ? this._drawLabel(this.labelCoords) : null
- }
- },
- removeLabel: function() {},
- updatePosition: function(animate) {
- var stripPos = this._getCoord();
- if (animate && storedCoord) {
- this.label && this.label.attr(axis._getStripLabelCoords(storedCoord.from, storedCoord.to, options.label));
- this.rect && this.rect.attr(axis._getStripGraphicAttributes(storedCoord.from, storedCoord.to));
- this.label && this.label.animate(axis._getStripLabelCoords(stripPos.from, stripPos.to, options.label));
- this.rect && this.rect.animate(axis._getStripGraphicAttributes(stripPos.from, stripPos.to))
- } else {
- this.label && this.label.attr(axis._getStripLabelCoords(stripPos.from, stripPos.to, options.label));
- this.rect && this.rect.attr(axis._getStripGraphicAttributes(stripPos.from, stripPos.to))
- }
- },
- saveCoords: function() {
- storedCoord = this._getCoord()
- }
- }
- }
- },
- /*!*****************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/scroll_bar.js ***!
- \*****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _utils = __webpack_require__( /*! ../../events/utils */ 8);
- var _utils2 = _interopRequireDefault(_utils);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _translator2d = __webpack_require__( /*! ../translators/translator2d */ 249);
- var _translator2d2 = _interopRequireDefault(_translator2d);
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- var _drag = __webpack_require__( /*! ../../events/drag */ 56);
- var _drag2 = _interopRequireDefault(_drag);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var _min = Math.min;
- var _max = Math.max;
- var MIN_SCROLL_BAR_SIZE = 2;
- var ScrollBar = function(renderer, group) {
- this._translator = new _translator2d2.default.Translator2D({}, {}, {});
- this._scroll = renderer.rect().append(group);
- this._addEvents()
- };
- function _getXCoord(canvas, pos, offset, width) {
- var x = 0;
- if ("right" === pos) {
- x = canvas.width - canvas.right + offset
- } else {
- if ("left" === pos) {
- x = canvas.left - offset - width
- }
- }
- return x
- }
- function _getYCoord(canvas, pos, offset, width) {
- var y = 0;
- if ("top" === pos) {
- y = canvas.top - offset
- } else {
- if ("bottom" === pos) {
- y = canvas.height - canvas.bottom + width + offset
- }
- }
- return y
- }
- ScrollBar.prototype = {
- _addEvents: function() {
- var _this = this;
- var scrollElement = this._scroll.element;
- _events_engine2.default.on(scrollElement, _drag2.default.start, function(e) {
- _utils2.default.fireEvent({
- type: "dxc-scroll-start",
- originalEvent: e,
- target: scrollElement
- })
- });
- _events_engine2.default.on(scrollElement, _drag2.default.move, function(e) {
- var dX = -e.offset.x * _this._scale;
- var dY = -e.offset.y * _this._scale;
- var lx = _this._offset - (_this._layoutOptions.vertical ? dY : dX) / _this._scale;
- _this._applyPosition(lx, lx + _this._translator.canvasLength / _this._scale);
- _utils2.default.fireEvent({
- type: "dxc-scroll-move",
- originalEvent: e,
- target: scrollElement,
- offset: {
- x: dX,
- y: dY
- }
- })
- });
- _events_engine2.default.on(scrollElement, _drag2.default.end, function(e) {
- _utils2.default.fireEvent({
- type: "dxc-scroll-end",
- originalEvent: e,
- target: scrollElement,
- offset: {
- x: -e.offset.x * _this._scale,
- y: -e.offset.y * _this._scale
- }
- })
- })
- },
- update: function(options) {
- var that = this;
- var position = options.position;
- var isVertical = options.rotated;
- var defaultPosition = isVertical ? "right" : "top";
- var secondaryPosition = isVertical ? "left" : "bottom";
- if (position !== defaultPosition && position !== secondaryPosition) {
- position = defaultPosition
- }
- that._scroll.attr({
- rotate: !options.rotated ? -90 : 0,
- rotateX: 0,
- rotateY: 0,
- fill: options.color,
- width: options.width,
- opacity: options.opacity
- });
- that._layoutOptions = {
- width: options.width,
- offset: options.offset,
- vertical: isVertical,
- position: position
- };
- return that
- },
- init: function(range, stick) {
- var that = this;
- var isDiscrete = "discrete" === range.axisType;
- that._translateWithOffset = isDiscrete && !stick && 1 || 0;
- that._translator.update((0, _extend.extend)({}, range, {
- minVisible: null,
- maxVisible: null,
- visibleCategories: null
- }, isDiscrete && {
- min: null,
- max: null
- } || {}), that._canvas, {
- isHorizontal: !that._layoutOptions.vertical,
- stick: stick
- });
- return that
- },
- getOptions: function() {
- return this._layoutOptions
- },
- setPane: function(panes) {
- var position = this._layoutOptions.position;
- var pane;
- if ("left" === position || "top" === position) {
- pane = panes[0]
- } else {
- pane = panes[panes.length - 1]
- }
- this.pane = pane.name;
- return this
- },
- updateSize: function(canvas) {
- this._canvas = (0, _extend.extend)({}, canvas);
- var options = this._layoutOptions;
- var pos = options.position;
- var offset = options.offset;
- var width = options.width;
- this._scroll.attr({
- translateX: _getXCoord(canvas, pos, offset, width),
- translateY: _getYCoord(canvas, pos, offset, width)
- })
- },
- getMultipleAxesSpacing: function() {
- return 0
- },
- estimateMargins: function() {
- return this.getMargins()
- },
- getMargins: function() {
- var options = this._layoutOptions;
- var margins = {
- left: 0,
- top: 0,
- right: 0,
- bottom: 0
- };
- margins[options.position] = options.width + options.offset;
- return margins
- },
- draw: _common.noop,
- shift: _common.noop,
- hideTitle: _common.noop,
- hideOuterElements: _common.noop,
- prepareAnimation: _common.noop,
- setPosition: function(min, max) {
- var that = this;
- var translator = that._translator;
- var minPoint = (0, _type.isDefined)(min) ? translator.translate(min, -that._translateWithOffset) : translator.translate("canvas_position_start");
- var maxPoint = (0, _type.isDefined)(max) ? translator.translate(max, that._translateWithOffset) : translator.translate("canvas_position_end");
- that._offset = _min(minPoint, maxPoint);
- that._scale = translator.getScale(min, max);
- that._applyPosition(_min(minPoint, maxPoint), _max(minPoint, maxPoint))
- },
- dispose: function() {
- this._scroll.dispose();
- this._scroll = this._translator = null
- },
- _applyPosition: function(x1, x2) {
- var that = this;
- var visibleArea = that._translator.getCanvasVisibleArea();
- x1 = _max(x1, visibleArea.min);
- x1 = _min(x1, visibleArea.max);
- x2 = _min(x2, visibleArea.max);
- x2 = _max(x2, visibleArea.min);
- var height = Math.abs(x2 - x1);
- that._scroll.attr({
- y: x1,
- height: height < MIN_SCROLL_BAR_SIZE ? MIN_SCROLL_BAR_SIZE : height
- })
- }
- };
- exports.ScrollBar = ScrollBar
- },
- /*!*******************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/shutter_zoom.js ***!
- \*******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dragEvents = __webpack_require__( /*! ../../events/drag */ 56);
- var SHUTTER_EVENTS_NS = ".shutter-zoom";
- var DRAG_START_EVENT_NAME = dragEvents.start + SHUTTER_EVENTS_NS;
- var DRAG_UPDATE_EVENT_NAME = dragEvents.move + SHUTTER_EVENTS_NS;
- var DRAG_END_EVENT_NAME = dragEvents.end + SHUTTER_EVENTS_NS;
- function getPointerCoord(rootOffset, canvas, rotated, e) {
- var coord = Math.floor(rotated ? e.pageY - rootOffset.top : e.pageX - rootOffset.left);
- var min = rotated ? canvas.y1 : canvas.x1;
- var max = rotated ? canvas.y2 : canvas.x2;
- if (coord < min) {
- coord = min
- } else {
- if (coord > max) {
- coord = max
- }
- }
- return coord
- }
- function checkCoords(rootOffset, canvas, e) {
- var x = e.pageX - rootOffset.left;
- var y = e.pageY - rootOffset.top;
- return x >= canvas.x1 && x <= canvas.x2 && y >= canvas.y1 && y <= canvas.y2
- }
- function dragStartHandler(ctx) {
- return function(e) {
- var offset = ctx.getRootOffset();
- var canvas = ctx.getCanvas();
- if (!checkCoords(offset, canvas, e)) {
- e.cancel = true;
- return
- }
- ctx.rootOffset = offset;
- ctx.canvas = canvas;
- ctx.startCoord = getPointerCoord(offset, canvas, ctx.rotated, e);
- ctx.triggerStart();
- ctx.rect.attr({
- x: canvas.x1,
- y: canvas.y1,
- width: canvas.width,
- height: canvas.height
- }).append(ctx.root)
- }
- }
- function dragHandler(ctx) {
- return function(e) {
- var curCoord = getPointerCoord(ctx.rootOffset, ctx.canvas, ctx.rotated, e);
- var attr = {};
- ctx.curCoord = curCoord;
- attr[ctx.rotated ? "y" : "x"] = Math.min(ctx.startCoord, curCoord);
- attr[ctx.rotated ? "height" : "width"] = Math.abs(ctx.startCoord - curCoord);
- ctx.rect.attr(attr)
- }
- }
- function dragEndHandler(ctx) {
- return function(e) {
- ctx.triggerEnd();
- ctx.rect.remove()
- }
- }
- function shutterZoom(options) {
- var chart = options.chart;
- var renderer = options.renderer;
- var rotated = options.rotated;
- var rect = renderer.rect(0, 0, 0, 0).attr(options.shutterOptions);
- var shutter = {
- rect: rect,
- root: renderer.root,
- rotated: rotated,
- triggerStart: function() {
- chart._eventTrigger("zoomStart")
- },
- triggerEnd: function() {
- var tr = chart._argumentAxes[0].getTranslator();
- var rangeStart = Math.min(this.startCoord, this.curCoord);
- var rangeEnd = Math.max(this.startCoord, this.curCoord);
- chart._eventTrigger("zoomEnd", {
- rangeStart: tr.from(rangeStart),
- rangeEnd: tr.from(rangeEnd)
- })
- },
- dispose: function() {
- renderer.root.off(SHUTTER_EVENTS_NS);
- rect.dispose()
- },
- getRootOffset: function() {
- return renderer.getRootOffset()
- },
- getCanvas: function() {
- var canvas = chart._canvas;
- var panes = chart.panes;
- var firstPane = panes[0].canvas;
- var lastPane = panes[panes.length - 1].canvas;
- return {
- x1: firstPane.left,
- y1: firstPane.top,
- x2: canvas.width - lastPane.right,
- y2: canvas.height - lastPane.bottom,
- width: canvas.width - firstPane.left - lastPane.right,
- height: canvas.height - firstPane.top - lastPane.bottom
- }
- }
- };
- renderer.root.off(SHUTTER_EVENTS_NS).on(DRAG_START_EVENT_NAME, {
- direction: rotated ? "vertical" : "horizontal",
- immediate: true
- }, dragStartHandler(shutter)).on(DRAG_UPDATE_EVENT_NAME, dragHandler(shutter)).on(DRAG_END_EVENT_NAME, dragEndHandler(shutter));
- return shutter
- }
- module.exports = {
- name: "shutter_zoom",
- init: function() {
- var options = this.option("shutterZoom") || {};
- if (!options.enabled) {
- return
- }
- this._shutterZoom = shutterZoom({
- chart: this,
- renderer: this._renderer,
- rotated: this.option("rotated"),
- shutterOptions: options
- })
- },
- dispose: function() {
- this._shutterZoom && this._shutterZoom.dispose()
- }
- }
- },
- /*!*******************************************************************!*\
- !*** ./artifacts/transpiled/viz/chart_components/zoom_and_pan.js ***!
- \*******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _wheel = __webpack_require__( /*! ../../events/core/wheel */ 124);
- var _transform = __webpack_require__( /*! ../../events/transform */ 285);
- var _transform2 = _interopRequireDefault(_transform);
- var _drag = __webpack_require__( /*! ../../events/drag */ 56);
- var _drag2 = _interopRequireDefault(_drag);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var EVENTS_NS = ".zoomAndPanNS";
- var DRAG_START_EVENT_NAME = _drag2.default.start + EVENTS_NS;
- var DRAG_EVENT_NAME = _drag2.default.move + EVENTS_NS;
- var DRAG_END_EVENT_NAME = _drag2.default.end + EVENTS_NS;
- var PINCH_START_EVENT_NAME = _transform2.default.pinchstart + EVENTS_NS;
- var PINCH_EVENT_NAME = _transform2.default.pinch + EVENTS_NS;
- var PINCH_END_EVENT_NAME = _transform2.default.pinchend + EVENTS_NS;
- var SCROLL_BAR_START_EVENT_NAME = "dxc-scroll-start" + EVENTS_NS;
- var SCROLL_BAR_MOVE_EVENT_NAME = "dxc-scroll-move" + EVENTS_NS;
- var SCROLL_BAR_END_EVENT_NAME = "dxc-scroll-end" + EVENTS_NS;
- var GESTURE_TIMEOUT = 300;
- var MIN_DRAG_DELTA = 5;
- var _min = Math.min;
- var _max = Math.max;
- var _abs = Math.abs;
- function canvasToRect(canvas) {
- return {
- x: canvas.left,
- y: canvas.top,
- width: canvas.width - canvas.left - canvas.right,
- height: canvas.height - canvas.top - canvas.bottom
- }
- }
- function checkCoords(rect, coords) {
- var x = coords.x;
- var y = coords.y;
- return x >= rect.x && x <= rect.width + rect.x && y >= rect.y && y <= rect.height + rect.y
- }
- function sortAxes(axes, onlyAxisToNotify) {
- if (onlyAxisToNotify) {
- axes = axes.sort(function(a, b) {
- if (a === onlyAxisToNotify) {
- return -1
- }
- if (b === onlyAxisToNotify) {
- return 1
- }
- return 0
- })
- }
- return axes
- }
- function isNotEmptyAxisBusinessRange(axis) {
- return !axis.getTranslator().getBusinessRange().isEmpty()
- }
- module.exports = {
- name: "zoom_and_pan",
- init: function() {
- var chart = this;
- var renderer = this._renderer;
- function cancelEvent(e) {
- if (e.originalEvent) {
- cancelEvent(e.originalEvent)
- }
- if (false !== e.cancelable) {
- e.cancel = true
- }
- }
- function startAxesViewportChanging(zoomAndPan, actionField, e) {
- var options = zoomAndPan.options;
- var actionData = zoomAndPan.actionData;
- var axes = [];
- if (options.argumentAxis[actionField]) {
- axes.push(chart.getArgumentAxis())
- }
- if (options.valueAxis[actionField]) {
- axes = axes.concat(actionData.valueAxes)
- }
- axes.reduce(function(isPrevented, axis) {
- if (isPrevented) {
- return isPrevented
- }
- if (isNotEmptyAxisBusinessRange(axis)) {
- return axis.handleZooming(null, {
- end: true
- }, e, actionField).isPrevented
- }
- return isPrevented
- }, false) && cancelEvent(e)
- }
- function axesViewportChanging(zoomAndPan, actionField, e, offsetCalc, centerCalc) {
- function zoomAxes(axes, criteria, coordField, e, actionData) {
- var zoom = {
- zoomed: false
- };
- criteria && axes.filter(isNotEmptyAxisBusinessRange).forEach(function(axis) {
- var options = axis.getOptions();
- var viewport = axis.visualRange();
- var scale = axis.getTranslator().getEventScale(e);
- var translate = -offsetCalc(e, actionData, coordField, scale);
- zoom = (0, _extend.extend)(true, zoom, axis.getTranslator().zoom(translate, scale, axis.getZoomBounds()));
- var range = axis.adjustRange((0, _utils.getVizRangeObject)([zoom.min, zoom.max]));
- var isMinZoom = axis.isZoomingLowerLimitOvercome(actionField, scale, range);
- if (!(0, _type.isDefined)(viewport) || viewport.startValue.valueOf() !== range.startValue.valueOf() || viewport.endValue.valueOf() !== range.endValue.valueOf()) {
- axis.handleZooming(isMinZoom ? null : range, {
- start: true,
- end: true
- }, e, actionField);
- if (!isMinZoom) {
- zoom.zoomed = true;
- zoom.deltaTranslate = translate - zoom.translate
- }
- } else {
- if ("touch" === e.pointerType && "discrete" === options.type) {
- var isMinPosition = axis.isExtremePosition(false);
- var isMaxPosition = axis.isExtremePosition(true);
- var zoomInEnabled = scale > 1 && !isMinZoom;
- var zoomOutEnabled = scale < 1 && (!isMinPosition || !isMaxPosition);
- var panningEnabled = 1 === scale && !(isMinPosition && (translate < 0 && !options.inverted || translate > 0 && options.inverted) || isMaxPosition && (translate > 0 && !options.inverted || translate < 0 && options.inverted));
- zoom.enabled = zoomInEnabled || zoomOutEnabled || panningEnabled
- }
- }
- });
- return zoom
- }
- function storeOffset(e, actionData, zoom, coordField) {
- if (zoom.zoomed) {
- actionData.offset[coordField] = (e.offset ? e.offset[coordField] : actionData.offset[coordField]) + zoom.deltaTranslate
- }
- }
- function storeCenter(center, actionData, zoom, coordField) {
- if (zoom.zoomed) {
- actionData.center[coordField] = center[coordField] + zoom.deltaTranslate
- }
- }
- var rotated = chart.option("rotated");
- var actionData = zoomAndPan.actionData;
- var options = zoomAndPan.options;
- var argZoom = {};
- var valZoom = {};
- if (!actionData.fallback) {
- argZoom = zoomAxes(chart._argumentAxes, options.argumentAxis[actionField], rotated ? "y" : "x", e, actionData);
- valZoom = zoomAxes(actionData.valueAxes, options.valueAxis[actionField], rotated ? "x" : "y", e, actionData);
- chart._requestChange(["VISUAL_RANGE"]);
- storeOffset(e, actionData, argZoom, rotated ? "y" : "x");
- storeOffset(e, actionData, valZoom, rotated ? "x" : "y")
- }
- var center = centerCalc(e);
- storeCenter(center, actionData, argZoom, rotated ? "y" : "x");
- storeCenter(center, actionData, valZoom, rotated ? "x" : "y");
- if (!argZoom.zoomed && !valZoom.zoomed) {
- actionData.center = center
- }
- return argZoom.zoomed || valZoom.zoomed || actionData.fallback || argZoom.enabled || valZoom.enabled
- }
- function finishAxesViewportChanging(zoomAndPan, actionField, e, offsetCalc) {
- function zoomAxes(axes, criteria, coordField, e, actionData, onlyAxisToNotify) {
- var zoomStarted = false;
- criteria && axes.forEach(function(axis) {
- var silent = onlyAxisToNotify && axis !== onlyAxisToNotify;
- var scale = e.scale || 1;
- var zoom = axis.getTranslator().zoom(-offsetCalc(e, actionData, coordField, scale), scale, axis.getZoomBounds());
- var range = {
- startValue: zoom.min,
- endValue: zoom.max
- };
- var isMinZoom = axis.isZoomingLowerLimitOvercome(actionField, scale, range);
- axis.handleZooming(isMinZoom ? null : range, {
- start: true,
- end: silent
- }, e, actionField);
- isMinZoom ? axis.handleZoomEnd() : zoomStarted = true
- });
- return zoomStarted
- }
- var rotated = chart.option("rotated");
- var actionData = zoomAndPan.actionData;
- var options = zoomAndPan.options;
- var zoomStarted = true;
- if (actionData.fallback) {
- zoomStarted &= zoomAxes(chart._argumentAxes, options.argumentAxis[actionField], rotated ? "y" : "x", e, actionData, chart.getArgumentAxis());
- zoomStarted |= zoomAxes(actionData.valueAxes, options.valueAxis[actionField], rotated ? "x" : "y", e, actionData)
- } else {
- var axes = [];
- if (options.argumentAxis[actionField]) {
- axes.push(chart.getArgumentAxis())
- }
- if (options.valueAxis[actionField]) {
- axes = axes.concat(actionData.valueAxes)
- }
- axes.filter(isNotEmptyAxisBusinessRange).forEach(function(axis) {
- axis.handleZooming(null, {
- start: true
- }, e, actionField)
- });
- zoomStarted = zoomStarted && axes.length
- }
- zoomStarted && chart._requestChange(["VISUAL_RANGE"])
- }
- function prepareActionData(coords, action) {
- var axes = chart._argumentAxes.filter(function(axis) {
- return checkCoords(canvasToRect(axis.getCanvas()), coords)
- });
- return {
- fallback: chart._lastRenderingTime > GESTURE_TIMEOUT,
- cancel: !axes.length || !(0, _type.isDefined)(action),
- action: action,
- curAxisRect: axes.length && canvasToRect(axes[0].getCanvas()),
- valueAxes: axes.length && chart._valueAxes.filter(function(axis) {
- return checkCoords(canvasToRect(axis.getCanvas()), coords)
- }),
- offset: {
- x: 0,
- y: 0
- },
- center: coords,
- startCenter: coords
- }
- }
- function getPointerCoord(rect, e) {
- var rootOffset = renderer.getRootOffset();
- return {
- x: _min(_max(e.pageX - rootOffset.left, rect.x), rect.width + rect.x),
- y: _min(_max(e.pageY - rootOffset.top, rect.y), rect.height + rect.y)
- }
- }
- function calcCenterForPinch(e) {
- var rootOffset = renderer.getRootOffset();
- var x1 = e.pointers[0].pageX;
- var x2 = e.pointers[1].pageX;
- var y1 = e.pointers[0].pageY;
- var y2 = e.pointers[1].pageY;
- return {
- x: _min(x1, x2) + _abs(x2 - x1) / 2 - rootOffset.left,
- y: _min(y1, y2) + _abs(y2 - y1) / 2 - rootOffset.top
- }
- }
- function calcCenterForDrag(e) {
- var rootOffset = renderer.getRootOffset();
- return {
- x: e.pageX - rootOffset.left,
- y: e.pageY - rootOffset.top
- }
- }
- function calcOffsetForDrag(e, actionData, coordField) {
- return e.offset[coordField] - actionData.offset[coordField]
- }
- function preventDefaults(e) {
- if (false !== e.cancelable) {
- e.preventDefault();
- e.stopPropagation()
- }
- chart._stopCurrentHandling()
- }
- var zoomAndPan = {
- dragStartHandler: function(e) {
- var options = zoomAndPan.options;
- var isTouch = "touch" === e.pointerType;
- var wantPan = options.argumentAxis.pan || options.valueAxis.pan;
- var wantZoom = options.argumentAxis.zoom || options.valueAxis.zoom;
- var panKeyPressed = (0, _type.isDefined)(options.panKey) && e[(0, _utils.normalizeEnum)(options.panKey) + "Key"];
- var dragToZoom = options.dragToZoom;
- var action;
- e._cancelPreventDefault = true;
- if (isTouch) {
- if (options.allowTouchGestures && wantPan) {
- var cancelPanning = !zoomAndPan.panningVisualRangeEnabled() || zoomAndPan.skipEvent;
- action = cancelPanning ? null : "pan"
- }
- } else {
- if (dragToZoom && wantPan && panKeyPressed) {
- action = "pan"
- } else {
- if (!dragToZoom && wantPan) {
- action = "pan"
- } else {
- if (dragToZoom && wantZoom) {
- action = "zoom"
- }
- }
- }
- }
- var actionData = prepareActionData(calcCenterForDrag(e), action);
- if (actionData.cancel) {
- zoomAndPan.skipEvent = false;
- if (false !== e.cancelable) {
- e.cancel = true
- }
- return
- }
- zoomAndPan.actionData = actionData;
- if ("zoom" === action) {
- actionData.startCoords = getPointerCoord(actionData.curAxisRect, e);
- actionData.rect = renderer.rect(0, 0, 0, 0).attr(options.dragBoxStyle).append(renderer.root)
- } else {
- startAxesViewportChanging(zoomAndPan, "pan", e)
- }
- },
- dragHandler: function(e) {
- var rotated = chart.option("rotated");
- var options = zoomAndPan.options;
- var actionData = zoomAndPan.actionData;
- var isTouch = "touch" === e.pointerType;
- e._cancelPreventDefault = true;
- if (!actionData || isTouch && !zoomAndPan.panningVisualRangeEnabled()) {
- return
- }
- if ("zoom" === actionData.action) {
- preventDefaults(e);
- var curCanvas = actionData.curAxisRect;
- var startCoords = actionData.startCoords;
- var curCoords = getPointerCoord(curCanvas, e);
- var zoomArg = options.argumentAxis.zoom;
- var zoomVal = options.valueAxis.zoom;
- var rect = {
- x: _min(startCoords.x, curCoords.x),
- y: _min(startCoords.y, curCoords.y),
- width: _abs(startCoords.x - curCoords.x),
- height: _abs(startCoords.y - curCoords.y)
- };
- if (!zoomArg || !zoomVal) {
- if (!zoomArg && !rotated || !zoomVal && rotated) {
- rect.x = curCanvas.x;
- rect.width = curCanvas.width
- } else {
- rect.y = curCanvas.y;
- rect.height = curCanvas.height
- }
- }
- actionData.rect.attr(rect)
- } else {
- if ("pan" === actionData.action) {
- axesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag, function(e) {
- return e.offset
- });
- var deltaOffsetY = Math.abs(e.offset.y - actionData.offset.y);
- var deltaOffsetX = Math.abs(e.offset.x - actionData.offset.x);
- if (isTouch && (deltaOffsetY > MIN_DRAG_DELTA && deltaOffsetY > Math.abs(actionData.offset.x) || deltaOffsetX > MIN_DRAG_DELTA && deltaOffsetX > Math.abs(actionData.offset.y))) {
- return
- }
- preventDefaults(e)
- }
- }
- },
- dragEndHandler: function(e) {
- var rotated = chart.option("rotated");
- var options = zoomAndPan.options;
- var actionData = zoomAndPan.actionData;
- var isTouch = "touch" === e.pointerType;
- var panIsEmpty = actionData && "pan" === actionData.action && !actionData.fallback && 0 === actionData.offset.x && 0 === actionData.offset.y;
- if (!actionData || isTouch && !zoomAndPan.panningVisualRangeEnabled() || panIsEmpty) {
- return
- }(!isTouch || !zoomAndPan.actionData.isNative) && preventDefaults(e);
- if ("zoom" === actionData.action) {
- var zoomAxes = function(axes, criteria, coordField, startCoords, curCoords, onlyAxisToNotify) {
- axes = sortAxes(axes, onlyAxisToNotify);
- var curCoord = curCoords[coordField];
- var startCoord = startCoords[coordField];
- var zoomStarted = false;
- if (criteria && _abs(curCoord - startCoord) > MIN_DRAG_DELTA) {
- axes.some(function(axis) {
- var tr = axis.getTranslator();
- if (tr.getBusinessRange().isEmpty()) {
- return
- }
- var silent = onlyAxisToNotify && axis !== onlyAxisToNotify;
- var range = [tr.from(startCoord), tr.from(curCoord)];
- var isMinZoom = axis.isZoomingLowerLimitOvercome(actionData.action, tr.getMinScale(true), range);
- var result = axis.handleZooming(isMinZoom ? null : range, {
- start: !!silent,
- end: !!silent
- }, e, actionData.action);
- isMinZoom ? axis.handleZoomEnd() : zoomStarted = true;
- return onlyAxisToNotify && result.isPrevented
- })
- }
- return zoomStarted
- };
- var curCoords = getPointerCoord(actionData.curAxisRect, e);
- var argumentAxesZoomed = zoomAxes(chart._argumentAxes, options.argumentAxis.zoom, rotated ? "y" : "x", actionData.startCoords, curCoords, chart.getArgumentAxis());
- var valueAxesZoomed = zoomAxes(actionData.valueAxes, options.valueAxis.zoom, rotated ? "x" : "y", actionData.startCoords, curCoords);
- if (valueAxesZoomed || argumentAxesZoomed) {
- chart._requestChange(["VISUAL_RANGE"])
- }
- actionData.rect.dispose()
- } else {
- if ("pan" === actionData.action) {
- finishAxesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag)
- }
- }
- zoomAndPan.actionData = null
- },
- pinchStartHandler: function(e) {
- var actionData = prepareActionData(calcCenterForPinch(e), "zoom");
- actionData.isNative = !zoomAndPan.panningVisualRangeEnabled();
- if (actionData.cancel) {
- cancelEvent(e);
- return
- }
- zoomAndPan.actionData = actionData;
- startAxesViewportChanging(zoomAndPan, "zoom", e)
- },
- pinchHandler: function(e) {
- if (!zoomAndPan.actionData) {
- return
- }
- var viewportChanged = axesViewportChanging(zoomAndPan, "zoom", e, function(e, actionData, coordField, scale) {
- return calcCenterForPinch(e)[coordField] - actionData.center[coordField] + (actionData.center[coordField] - actionData.center[coordField] * scale)
- }, calcCenterForPinch);
- zoomAndPan.defineTouchBehavior(!viewportChanged, e);
- !viewportChanged && (zoomAndPan.actionData = null)
- },
- pinchEndHandler: function(e) {
- if (!zoomAndPan.actionData) {
- return
- }
- finishAxesViewportChanging(zoomAndPan, "zoom", e, function(e, actionData, coordField, scale) {
- return actionData.center[coordField] - actionData.startCenter[coordField] + (actionData.startCenter[coordField] - actionData.startCenter[coordField] * scale)
- });
- zoomAndPan.actionData = null
- },
- cleanup: function() {
- renderer.root.off(EVENTS_NS);
- zoomAndPan.actionData && zoomAndPan.actionData.rect && zoomAndPan.actionData.rect.dispose();
- zoomAndPan.actionData = null;
- renderer.root.css({
- "touch-action": "",
- "-ms-touch-action": ""
- })
- },
- setup: function(options) {
- zoomAndPan.cleanup();
- if (!options.argumentAxis.pan) {
- renderer.root.on(SCROLL_BAR_START_EVENT_NAME, cancelEvent)
- }
- if (options.argumentAxis.none && options.valueAxis.none) {
- return
- }
- zoomAndPan.options = options;
- var rotated = chart.option("rotated");
- if ((options.argumentAxis.zoom || options.valueAxis.zoom) && options.allowMouseWheel) {
- renderer.root.on(_wheel.name + EVENTS_NS, function(e) {
- function zoomAxes(axes, coord, delta, onlyAxisToNotify) {
- axes = sortAxes(axes, onlyAxisToNotify);
- var zoomStarted = false;
- axes.some(function(axis) {
- var translator = axis.getTranslator();
- if (translator.getBusinessRange().isEmpty()) {
- return
- }
- var silent = onlyAxisToNotify && axis !== onlyAxisToNotify;
- var scale = translator.getMinScale(delta > 0);
- var zoom = translator.zoom(-(coord - coord * scale), scale, axis.getZoomBounds());
- var range = {
- startValue: zoom.min,
- endValue: zoom.max
- };
- var isMinZoom = axis.isZoomingLowerLimitOvercome("zoom", scale, range);
- var result = axis.handleZooming(isMinZoom ? null : range, {
- start: !!silent,
- end: !!silent
- }, e, "zoom");
- isMinZoom ? axis.handleZoomEnd() : zoomStarted = true;
- return onlyAxisToNotify && result.isPrevented
- });
- return !!zoomStarted
- }
- var coords = calcCenterForDrag(e);
- var axesZoomed = false;
- var targetAxes;
- if (options.valueAxis.zoom) {
- targetAxes = chart._valueAxes.filter(function(axis) {
- return checkCoords(canvasToRect(axis.getCanvas()), coords)
- });
- if (0 === targetAxes.length) {
- var targetCanvas = chart._valueAxes.reduce(function(r, axis) {
- if (!r && axis.coordsIn(coords.x, coords.y)) {
- r = axis.getCanvas()
- }
- return r
- }, null);
- if (targetCanvas) {
- targetAxes = chart._valueAxes.filter(function(axis) {
- return checkCoords(canvasToRect(axis.getCanvas()), {
- x: targetCanvas.left,
- y: targetCanvas.top
- })
- })
- }
- }
- axesZoomed |= zoomAxes(targetAxes, rotated ? coords.x : coords.y, e.delta)
- }
- if (options.argumentAxis.zoom) {
- var canZoom = chart._argumentAxes.some(function(axis) {
- if (checkCoords(canvasToRect(axis.getCanvas()), coords) || axis.coordsIn(coords.x, coords.y)) {
- return true
- }
- return false
- });
- axesZoomed |= canZoom && zoomAxes(chart._argumentAxes, rotated ? coords.y : coords.x, e.delta, chart.getArgumentAxis())
- }
- if (axesZoomed) {
- chart._requestChange(["VISUAL_RANGE"]);
- zoomAndPan.panningVisualRangeEnabled(targetAxes) && preventDefaults(e)
- }
- })
- }
- if (options.allowTouchGestures) {
- if (options.argumentAxis.zoom || options.valueAxis.zoom) {
- renderer.root.on(PINCH_START_EVENT_NAME, {
- passive: false
- }, zoomAndPan.pinchStartHandler).on(PINCH_EVENT_NAME, {
- passive: false
- }, zoomAndPan.pinchHandler).on(PINCH_END_EVENT_NAME, zoomAndPan.pinchEndHandler)
- }
- }
- renderer.root.on(DRAG_START_EVENT_NAME, {
- immediate: true,
- passive: false
- }, zoomAndPan.dragStartHandler).on(DRAG_EVENT_NAME, {
- immediate: true,
- passive: false
- }, zoomAndPan.dragHandler).on(DRAG_END_EVENT_NAME, zoomAndPan.dragEndHandler);
- if (options.argumentAxis.pan) {
- renderer.root.on(SCROLL_BAR_START_EVENT_NAME, function(e) {
- zoomAndPan.actionData = {
- valueAxes: [],
- offset: {
- x: 0,
- y: 0
- },
- center: {
- x: 0,
- y: 0
- }
- };
- preventDefaults(e);
- startAxesViewportChanging(zoomAndPan, "pan", e)
- }).on(SCROLL_BAR_MOVE_EVENT_NAME, function(e) {
- preventDefaults(e);
- axesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag, function(e) {
- return e.offset
- })
- }).on(SCROLL_BAR_END_EVENT_NAME, function(e) {
- preventDefaults(e);
- finishAxesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag);
- zoomAndPan.actionData = null
- })
- }
- },
- defineTouchBehavior: function(isDefault, e) {
- zoomAndPan.actionData && (zoomAndPan.actionData.isNative = isDefault);
- if (!isDefault) {
- preventDefaults(e)
- }
- },
- panningVisualRangeEnabled: function(targetAxes) {
- if (targetAxes && targetAxes.length) {
- return targetAxes.some(function(axis) {
- return !axis.isExtremePosition(false) || !axis.isExtremePosition(true)
- })
- }
- var enablePanByValueAxis = chart._valueAxes.some(function(axis) {
- return !axis.isExtremePosition(false) || !axis.isExtremePosition(true)
- });
- var enablePanByArgumentAxis = chart._argumentAxes.some(function(axis) {
- return !axis.isExtremePosition(false) || !axis.isExtremePosition(true)
- });
- return enablePanByValueAxis || enablePanByArgumentAxis
- }
- };
- this._zoomAndPan = zoomAndPan
- },
- members: {
- _setupZoomAndPan: function() {
- this._zoomAndPan.setup(this._themeManager.getOptions("zoomAndPan"))
- }
- },
- dispose: function() {
- this._zoomAndPan.cleanup()
- },
- customize: function(constructor) {
- constructor.addChange({
- code: "ZOOM_AND_PAN",
- handler: function() {
- this._setupZoomAndPan()
- },
- isThemeDependent: true,
- isOptionChange: true,
- option: "zoomAndPan"
- })
- }
- }
- },
- /*!***********************************************!*\
- !*** ./artifacts/transpiled/viz/pie_chart.js ***!
- \***********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _consts = __webpack_require__( /*! ./components/consts */ 117);
- var _utils = __webpack_require__( /*! ./core/utils */ 10);
- var _extend2 = __webpack_require__( /*! ../core/utils/extend */ 0);
- var _type = __webpack_require__( /*! ../core/utils/type */ 1);
- var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
- var _range = __webpack_require__( /*! ./translators/range */ 108);
- var _range2 = _interopRequireDefault(_range);
- var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9);
- var _component_registrator2 = _interopRequireDefault(_component_registrator);
- var _base_chart = __webpack_require__( /*! ./chart_components/base_chart */ 240);
- var _common = __webpack_require__( /*! ../core/utils/common */ 4);
- var _translator1d = __webpack_require__( /*! ./translators/translator1d */ 412);
- var _translator1d2 = _interopRequireDefault(_translator1d);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var OPTIONS_FOR_REFRESH_SERIES = ["startAngle", "innerRadius", "segmentsDirection", "type"];
- var NORMAL_STATE = _consts.states.normalMark;
- var MAX_RESOLVE_ITERATION_COUNT = 5;
- var LEGEND_ACTIONS = [_consts.states.resetItem, _consts.states.applyHover, _consts.states.applySelected, _consts.states.applySelected];
- function getLegendItemAction(points) {
- var state = NORMAL_STATE;
- points.forEach(function(point) {
- state |= point.fullState
- });
- return LEGEND_ACTIONS[state]
- }
- function correctPercentValue(value) {
- if ((0, _type.isNumeric)(value)) {
- if (value > 1) {
- value = 1
- } else {
- if (value < 0) {
- value = 0
- }
- }
- } else {
- value = void 0
- }
- return value
- }
- var dxPieChart = _base_chart.BaseChart.inherit({
- _themeSection: "pie",
- _layoutManagerOptions: function() {
- return (0, _extend2.extend)(true, {}, this.callBase(), {
- piePercentage: correctPercentValue(this._themeManager.getOptions("diameter")),
- minPiePercentage: correctPercentValue(this._themeManager.getOptions("minDiameter"))
- })
- },
- _optionChangesMap: {
- diameter: "REINIT",
- minDiameter: "REINIT",
- sizeGroup: "REINIT"
- },
- _disposeCore: function() {
- pieSizeEqualizer.remove(this);
- this.callBase()
- },
- _groupSeries: function() {
- var series = this.series;
- this._groupsData = {
- groups: [{
- series: series,
- valueOptions: {
- valueType: "numeric"
- }
- }],
- argumentOptions: series[0] && series[0].getOptions()
- }
- },
- getArgumentAxis: function() {
- return null
- },
- _getValueAxis: function() {
- var translator = (new _translator1d2.default.Translator1D).setCodomain(360, 0);
- return {
- getTranslator: function() {
- return translator
- },
- setBusinessRange: function(range) {
- translator.setDomain(range.min, range.max)
- }
- }
- },
- _populateBusinessRange: function() {
- this.series.map(function(series) {
- var range = new _range2.default.Range;
- range.addRange(series.getRangeData().val);
- series.getValueAxis().setBusinessRange(range);
- return range
- })
- },
- _specialProcessSeries: function() {
- (0, _iterator.each)(this.series, function(_, singleSeries) {
- singleSeries.arrangePoints()
- })
- },
- _checkPaneName: function() {
- return true
- },
- _processSingleSeries: function(singleSeries) {
- this.callBase(singleSeries);
- singleSeries.arrangePoints()
- },
- _handleSeriesDataUpdated: function() {
- var maxPointCount = 0;
- this.series.forEach(function(s) {
- maxPointCount = Math.max(s.getPointsCount(), maxPointCount)
- });
- this.series.forEach(function(s) {
- s.setMaxPointsCount(maxPointCount)
- });
- this.callBase()
- },
- _getLegendOptions: function(item) {
- var legendItem = this.callBase(item);
- var legendData = legendItem.legendData;
- legendData.argument = item.argument;
- legendData.argumentIndex = item.argumentIndex;
- legendData.points = [item];
- return legendItem
- },
- _getLegendTargets: function() {
- var that = this;
- var itemsByArgument = {};
- (that.series || []).forEach(function(series) {
- series.getPoints().forEach(function(point) {
- var argument = point.argument.valueOf();
- var index = series.getPointsByArg(argument).indexOf(point);
- var key = argument.valueOf().toString() + index;
- itemsByArgument[key] = itemsByArgument[key] || [];
- var argumentCount = itemsByArgument[key].push(point);
- point.index = itemsByArgument[key][argumentCount - 2] ? itemsByArgument[key][argumentCount - 2].index : Object.keys(itemsByArgument).length - 1;
- point.argumentIndex = index
- })
- });
- var items = [];
- (0, _iterator.each)(itemsByArgument, function(_, points) {
- points.forEach(function(point, index) {
- if (0 === index) {
- items.push(that._getLegendOptions(point));
- return
- }
- var item = items[items.length - 1];
- item.legendData.points.push(point);
- if (!item.visible) {
- item.visible = point.isVisible()
- }
- })
- });
- return items
- },
- _getLayoutTargets: function() {
- return [{
- canvas: this._canvas
- }]
- },
- _getLayoutSeries: function(series, drawOptions) {
- var that = this;
- var layout;
- var canvas = that._canvas;
- var drawnLabels = false;
- layout = that.layoutManager.applyPieChartSeriesLayout(canvas, series, true);
- series.forEach(function(singleSeries) {
- singleSeries.correctPosition(layout, canvas);
- drawnLabels = singleSeries.drawLabelsWOPoints() || drawnLabels
- });
- if (drawnLabels) {
- layout = that.layoutManager.applyPieChartSeriesLayout(canvas, series, drawOptions.hideLayoutLabels)
- }
- series.forEach(function(singleSeries) {
- singleSeries.hideLabels()
- });
- that._sizeGroupLayout = {
- x: layout.centerX,
- y: layout.centerY,
- radius: layout.radiusOuter,
- drawOptions: drawOptions
- };
- return layout
- },
- _getLayoutSeriesForEqualPies: function(series, sizeGroupLayout) {
- var canvas = this._canvas;
- var layout = this.layoutManager.applyEqualPieChartLayout(series, sizeGroupLayout);
- series.forEach(function(s) {
- s.correctPosition(layout, canvas);
- s.drawLabelsWOPoints()
- });
- this.layoutManager.correctPieLabelRadius(series, layout, canvas);
- return layout
- },
- _updateSeriesDimensions: function(drawOptions) {
- var that = this;
- var visibleSeries = that._getVisibleSeries();
- var lengthVisibleSeries = visibleSeries.length;
- var innerRad;
- var delta;
- var layout;
- var sizeGroupLayout = drawOptions.sizeGroupLayout;
- if (lengthVisibleSeries) {
- layout = sizeGroupLayout ? that._getLayoutSeriesForEqualPies(visibleSeries, sizeGroupLayout) : that._getLayoutSeries(visibleSeries, drawOptions);
- delta = (layout.radiusOuter - layout.radiusInner - _consts.pieSeriesSpacing * (lengthVisibleSeries - 1)) / lengthVisibleSeries;
- innerRad = layout.radiusInner;
- that._setCenter({
- x: layout.centerX,
- y: layout.centerY
- });
- visibleSeries.forEach(function(singleSeries) {
- singleSeries.correctRadius({
- radiusInner: innerRad,
- radiusOuter: innerRad + delta
- });
- innerRad += delta + _consts.pieSeriesSpacing
- })
- }
- },
- _renderSeries: function(drawOptions, isRotated, isLegendInside) {
- this._calculateSeriesLayout(drawOptions, isRotated);
- if (!drawOptions.sizeGroupLayout && this.getSizeGroup()) {
- pieSizeEqualizer.queue(this);
- this._clearCanvas();
- return
- }
- this._renderSeriesElements(drawOptions, isRotated, isLegendInside)
- },
- _getLegendCallBack: function() {
- var that = this;
- var legend = this._legend;
- var items = this._getLegendTargets().map(function(i) {
- return i.legendData
- });
- return function(target) {
- items.forEach(function(data) {
- var points = [];
- var callback = legend.getActionCallback({
- index: data.id
- });
- that.series.forEach(function(series) {
- var seriesPoints = series.getPointsByKeys(data.argument, data.argumentIndex);
- points.push.apply(points, seriesPoints)
- });
- if (target && target.argument === data.argument && target.argumentIndex === data.argumentIndex) {
- points.push(target)
- }
- callback(getLegendItemAction(points))
- })
- }
- },
- _locateLabels: function(resolveLabelOverlapping) {
- var iterationCount = 0;
- var labelsWereOverlapped;
- var wordWrapApplied;
- do {
- labelsWereOverlapped = this._resolveLabelOverlapping(resolveLabelOverlapping);
- wordWrapApplied = this._adjustSeriesLabels("shift" === resolveLabelOverlapping)
- } while ((labelsWereOverlapped || wordWrapApplied) && ++iterationCount < MAX_RESOLVE_ITERATION_COUNT)
- },
- _adjustSeriesLabels: function(moveLabelsFromCenter) {
- return this.series.reduce(function(r, s) {
- return s.adjustLabels(moveLabelsFromCenter) || r
- }, false)
- },
- _prepareStackPoints: _common.noop,
- _resetStackPoints: _common.noop,
- _applyExtraSettings: _common.noop,
- _resolveLabelOverlappingShift: function() {
- var that = this;
- var inverseDirection = "anticlockwise" === that.option("segmentsDirection");
- var seriesByPosition = that.series.reduce(function(r, s) {
- (r[s.getOptions().label.position] || r.outside).push(s);
- return r
- }, {
- inside: [],
- columns: [],
- outside: []
- });
- var labelsOverlapped = false;
- if (seriesByPosition.inside.length > 0) {
- labelsOverlapped = resolve(seriesByPosition.inside.reduce(function(r, singleSeries) {
- return singleSeries.getVisiblePoints().reduce(function(r, point) {
- r.left.push(point);
- return r
- }, r)
- }, {
- left: [],
- right: []
- }), shiftInColumnFunction) || labelsOverlapped
- }
- labelsOverlapped = seriesByPosition.columns.reduce(function(r, singleSeries) {
- return resolve(dividePoints(singleSeries), shiftInColumnFunction) || r
- }, labelsOverlapped);
- if (seriesByPosition.outside.length > 0) {
- labelsOverlapped = resolve(seriesByPosition.outside.reduce(function(r, singleSeries) {
- return dividePoints(singleSeries, r)
- }, null), shiftFunction) || labelsOverlapped
- }
- return labelsOverlapped;
- function dividePoints(series, points) {
- return series.getVisiblePoints().reduce(function(r, point) {
- var angle = (0, _utils.normalizeAngle)(point.middleAngle);
- (angle <= 90 || angle >= 270 ? r.right : r.left).push(point);
- return r
- }, points || {
- left: [],
- right: []
- })
- }
- function resolve(points, shiftCallback) {
- var overlapped = false;
- if (inverseDirection) {
- points.left.reverse();
- points.right.reverse()
- }
- overlapped = _base_chart.overlapping.resolveLabelOverlappingInOneDirection(points.left, that._canvas, false, shiftCallback);
- return _base_chart.overlapping.resolveLabelOverlappingInOneDirection(points.right, that._canvas, false, shiftCallback) || overlapped
- }
- function shiftFunction(box, length) {
- return (0, _utils.getVerticallyShiftedAngularCoords)(box, -length, that._center)
- }
- function shiftInColumnFunction(box, length) {
- return {
- x: box.x,
- y: box.y - length
- }
- }
- },
- _setCenter: function(center) {
- this._center = center
- },
- _disposeSeries: function(seriesIndex) {
- this.callBase.apply(this, arguments);
- this._abstractSeries = null
- },
- _legendDataField: "point",
- _legendItemTextField: "argument",
- _applyPointMarkersAutoHiding: _common.noop,
- _renderTrackers: _common.noop,
- _trackerType: "PieTracker",
- _createScrollBar: _common.noop,
- _updateAxesLayout: _common.noop,
- _applyClipRects: _common.noop,
- _appendAdditionalSeriesGroups: _common.noop,
- _prepareToRender: _common.noop,
- _isLegendInside: _common.noop,
- _renderAxes: _common.noop,
- _shrinkAxes: _common.noop,
- _isRotated: _common.noop,
- _seriesPopulatedHandlerCore: _common.noop,
- _reinitAxes: _common.noop,
- _correctAxes: _common.noop,
- _getExtraOptions: function() {
- var that = this;
- return {
- startAngle: that.option("startAngle"),
- innerRadius: that.option("innerRadius"),
- segmentsDirection: that.option("segmentsDirection"),
- type: that.option("type")
- }
- },
- getSizeGroup: function() {
- return this._themeManager.getOptions("sizeGroup")
- },
- getSizeGroupLayout: function() {
- return this._sizeGroupLayout || {}
- }
- });
- (0, _iterator.each)(OPTIONS_FOR_REFRESH_SERIES, function(_, name) {
- dxPieChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_DATA_INIT"
- });
- (0, _component_registrator2.default)("dxPieChart", dxPieChart);
- module.exports = dxPieChart;
- var pieSizeEqualizer = function() {
- function equalize(group, allPies) {
- var pies = allPies.filter(function(p) {
- return p._isVisible() && p.getSizeGroup() === group
- });
- var minRadius = Math.min.apply(null, pies.map(function(p) {
- return p.getSizeGroupLayout().radius
- }));
- var minPie = pies.filter(function(p) {
- return p.getSizeGroupLayout().radius === minRadius
- });
- pies.forEach(function(p) {
- return p.render({
- force: true,
- sizeGroupLayout: minPie.length ? minPie[0].getSizeGroupLayout() : {}
- })
- })
- }
- function removeFromList(list, item) {
- return list.filter(function(li) {
- return li !== item
- })
- }
- function addToList(list, item) {
- return removeFromList(list, item).concat(item)
- }
- var pies = [];
- var timers = {};
- return {
- queue: function(pie) {
- var group = pie.getSizeGroup();
- pies = addToList(pies, pie);
- clearTimeout(timers[group]);
- timers[group] = setTimeout(function() {
- equalize(group, pies)
- })
- },
- remove: function(pie) {
- pies = removeFromList(pies, pie);
- if (!pies.length) {
- timers = {}
- }
- }
- }
- }()
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/viz/polar_chart.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
- var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
- var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
- var vizUtils = __webpack_require__( /*! ./core/utils */ 10);
- var AdvancedChart = __webpack_require__( /*! ./chart_components/advanced_chart */ 404).AdvancedChart;
- var DEFAULT_PANE_NAME = "default";
- var dxPolarChart = AdvancedChart.inherit({
- _themeSection: "polar",
- _createPanes: function() {
- return [{
- name: DEFAULT_PANE_NAME
- }]
- },
- _checkPaneName: function() {
- return true
- },
- _getAxisRenderingOptions: function(typeSelector) {
- var isArgumentAxis = "argumentAxis" === typeSelector;
- var type = isArgumentAxis ? "circular" : "linear";
- var useSpiderWeb = this.option("useSpiderWeb");
- if (useSpiderWeb) {
- type += "Spider"
- }
- return {
- axisType: "polarAxes",
- drawingType: type
- }
- },
- _prepareAxisOptions: function(typeSelector, axisOptions) {
- var isArgumentAxis = "argumentAxis" === typeSelector;
- var themeManager = this._themeManager;
- var axisUserOptions = this.option("argumentAxis");
- var argumentAxisOptions = themeManager.getOptions("argumentAxis", axisUserOptions) || {};
- var startAngle = isFinite(argumentAxisOptions.startAngle) ? vizUtils.normalizeAngle(argumentAxisOptions.startAngle) : 0;
- return {
- type: this.option("useSpiderWeb") && isArgumentAxis ? "discrete" : axisOptions.type,
- isHorizontal: true,
- showCustomBoundaryTicks: isArgumentAxis,
- startAngle: startAngle,
- endAngle: startAngle + 360
- }
- },
- _optionChangesMap: {
- useSpiderWeb: "AXES_AND_PANES"
- },
- _getExtraOptions: function() {
- return {
- spiderWidget: this.option("useSpiderWeb")
- }
- },
- _prepareToRender: function() {
- this._appendAxesGroups();
- return {}
- },
- _calcCanvas: function() {
- var canvas = extend({}, this._canvas);
- var argumentAxis = this.getArgumentAxis();
- var margins = argumentAxis.getMargins();
- Object.keys(margins).forEach(function(margin) {
- return canvas[margin] = canvas["original".concat(margin[0].toUpperCase()).concat(margin.slice(1))] + margins[margin]
- });
- return canvas
- },
- _renderAxes: function(drawOptions) {
- var that = this;
- var valueAxis = that._getValueAxis();
- var argumentAxis = that.getArgumentAxis();
- argumentAxis.draw(that._canvas);
- valueAxis.setSpiderTicks(argumentAxis.getSpiderTicks());
- var canvas = that._calcCanvas();
- argumentAxis.updateSize(canvas);
- valueAxis.draw(canvas);
- return canvas
- },
- _getValueAxis: function() {
- return this._valueAxes[0]
- },
- _shrinkAxes: function(sizeStorage) {
- var valueAxis = this._getValueAxis();
- var argumentAxis = this.getArgumentAxis();
- if (sizeStorage && (sizeStorage.width || sizeStorage.height)) {
- argumentAxis.hideOuterElements();
- var canvas = this._calcCanvas();
- argumentAxis.updateSize(canvas);
- valueAxis.updateSize(canvas)
- }
- },
- checkForMoreSpaceForPanesCanvas: function() {
- return this.layoutManager.needMoreSpaceForPanesCanvas([{
- canvas: this.getArgumentAxis().getCanvas()
- }], this._isRotated())
- },
- _getLayoutTargets: function() {
- return [{
- canvas: this._canvas
- }]
- },
- _getSeriesForPane: function() {
- return this.series
- },
- _applyExtraSettings: _noop,
- _applyPointMarkersAutoHiding: _noop,
- _createScrollBar: _noop,
- _applyClipRects: _noop,
- _isRotated: _noop,
- _getCrosshairOptions: _noop,
- _isLegendInside: _noop
- });
- registerComponent("dxPolarChart", dxPolarChart);
- module.exports = dxPolarChart
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/viz/linear_gauge.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./gauges/linear_gauge */ 793)
- },
- /*!*********************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/linear_gauge.js ***!
- \*********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var _max = Math.max;
- var _min = Math.min;
- var _round = Math.round;
- var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
- var dxBaseGauge = __webpack_require__( /*! ./base_gauge */ 145).dxBaseGauge;
- var dxGauge = __webpack_require__( /*! ./common */ 205).dxGauge;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var linearIndicatorsModule = __webpack_require__( /*! ./linear_indicators */ 796);
- var createIndicatorCreator = __webpack_require__( /*! ./common */ 205).createIndicatorCreator;
- var LinearRangeContainer = __webpack_require__( /*! ./linear_range_container */ 797);
- var dxLinearGauge = dxGauge.inherit({
- _rootClass: "dxg-linear-gauge",
- _factoryMethods: {
- rangeContainer: "createLinearRangeContainer",
- indicator: "createLinearIndicator"
- },
- _gridSpacingFactor: 25,
- _scaleTypes: {
- type: "xyAxes",
- drawingType: "linear"
- },
- _getTicksOrientation: function(scaleOptions) {
- return scaleOptions.isHorizontal ? scaleOptions.verticalOrientation : scaleOptions.horizontalOrientation
- },
- _getThemeManagerOptions: function() {
- var options = this.callBase.apply(this, arguments);
- options.subTheme = "_linear";
- return options
- },
- _updateScaleTickIndent: function(scaleOptions) {
- var indentFromTick = scaleOptions.label.indentFromTick;
- var length = scaleOptions.tick.length;
- var textParams = this._scale.measureLabels(extend({}, this._canvas));
- var verticalTextCorrection = scaleOptions.isHorizontal ? textParams.height + textParams.y : 0;
- var isIndentPositive = indentFromTick > 0;
- var orientation;
- var textCorrection;
- var tickCorrection;
- if (scaleOptions.isHorizontal) {
- orientation = isIndentPositive ? {
- center: .5,
- top: 0,
- bottom: 1
- } : {
- center: .5,
- top: 1,
- bottom: 0
- };
- tickCorrection = length * orientation[scaleOptions.verticalOrientation];
- textCorrection = textParams.y
- } else {
- orientation = isIndentPositive ? {
- center: .5,
- left: 0,
- right: 1
- } : {
- center: .5,
- left: 1,
- right: 0
- };
- tickCorrection = length * orientation[scaleOptions.horizontalOrientation];
- textCorrection = -textParams.width
- }
- scaleOptions.label.indentFromAxis = -indentFromTick + (isIndentPositive ? -tickCorrection + textCorrection : tickCorrection - verticalTextCorrection);
- this._scale.updateOptions(scaleOptions)
- },
- _shiftScale: function(layout, scaleOptions) {
- var that = this;
- var canvas = extend({}, that._canvas);
- var isHorizontal = scaleOptions.isHorizontal;
- var scale = that._scale;
- canvas[isHorizontal ? "left" : "top"] = that._area[isHorizontal ? "startCoord" : "endCoord"];
- canvas[isHorizontal ? "right" : "bottom"] = canvas[isHorizontal ? "width" : "height"] - that._area[isHorizontal ? "endCoord" : "startCoord"];
- scale.draw(canvas);
- scale.shift({
- left: -layout.x,
- top: -layout.y
- })
- },
- _setupCodomain: function() {
- var that = this;
- var geometry = that.option("geometry") || {};
- var vertical = "vertical" === _normalizeEnum(geometry.orientation);
- var initialStartCoord = -100;
- var initialEndCoord = 100;
- that._area = {
- vertical: vertical,
- x: 0,
- y: 0,
- startCoord: initialStartCoord,
- endCoord: initialEndCoord
- };
- that._rangeContainer.vertical = vertical;
- that._translator.setCodomain(initialStartCoord, initialEndCoord)
- },
- _getScaleLayoutValue: function() {
- return this._area[this._area.vertical ? "x" : "y"]
- },
- _getTicksCoefficients: function(options) {
- var coefs = {
- inner: 0,
- outer: 1
- };
- if (this._area.vertical) {
- if ("left" === options.horizontalOrientation) {
- coefs.inner = 1;
- coefs.outer = 0
- } else {
- if ("center" === options.horizontalOrientation) {
- coefs.inner = coefs.outer = .5
- }
- }
- } else {
- if ("top" === options.verticalOrientation) {
- coefs.inner = 1;
- coefs.outer = 0
- } else {
- if ("center" === options.verticalOrientation) {
- coefs.inner = coefs.outer = .5
- }
- }
- }
- return coefs
- },
- _correctScaleIndents: function(result, indentFromTick, textParams) {
- var vertical = this._area.vertical;
- if (indentFromTick >= 0) {
- result.max += indentFromTick + textParams[vertical ? "width" : "height"]
- } else {
- result.min -= -indentFromTick + textParams[vertical ? "width" : "height"]
- }
- result.indent = textParams[vertical ? "height" : "width"] / 2
- },
- _measureMainElements: function(elements, scaleMeasurement) {
- var that = this;
- var x = that._area.x;
- var y = that._area.y;
- var minBound = 1e3;
- var maxBound = 0;
- var indent = 0;
- var scale = that._scale;
- _each(elements.concat(scale), function(_, element) {
- var bounds = element.measure ? element.measure({
- x: x + element.getOffset(),
- y: y + element.getOffset()
- }) : scaleMeasurement;
- void 0 !== bounds.max && (maxBound = _max(maxBound, bounds.max));
- void 0 !== bounds.min && (minBound = _min(minBound, bounds.min));
- bounds.indent > 0 && (indent = _max(indent, bounds.indent))
- });
- return {
- minBound: minBound,
- maxBound: maxBound,
- indent: indent
- }
- },
- _applyMainLayout: function(elements, scaleMeasurement) {
- var that = this;
- var measurements = that._measureMainElements(elements, scaleMeasurement);
- var area = that._area;
- var rect;
- var offset;
- if (area.vertical) {
- rect = selectRectBySizes(that._innerRect, {
- width: measurements.maxBound - measurements.minBound
- });
- offset = (rect.left + rect.right) / 2 - (measurements.minBound + measurements.maxBound) / 2;
- area.startCoord = rect.bottom - measurements.indent;
- area.endCoord = rect.top + measurements.indent;
- area.x = _round(area.x + offset)
- } else {
- rect = selectRectBySizes(that._innerRect, {
- height: measurements.maxBound - measurements.minBound
- });
- offset = (rect.top + rect.bottom) / 2 - (measurements.minBound + measurements.maxBound) / 2;
- area.startCoord = rect.left + measurements.indent;
- area.endCoord = rect.right - measurements.indent;
- area.y = _round(area.y + offset)
- }
- that._translator.setCodomain(area.startCoord, area.endCoord);
- that._innerRect = rect
- },
- _getElementLayout: function(offset) {
- return {
- x: _round(this._area.x + offset),
- y: _round(this._area.y + offset)
- }
- },
- _getApproximateScreenRange: function() {
- var that = this;
- var area = that._area;
- var s = area.vertical ? that._canvas.height : that._canvas.width;
- s > area.totalSize && (s = area.totalSize);
- s = .8 * s;
- return s
- },
- _getDefaultSize: function() {
- var geometry = this.option("geometry") || {};
- if ("vertical" === geometry.orientation) {
- return {
- width: 100,
- height: 300
- }
- } else {
- return {
- width: 300,
- height: 100
- }
- }
- },
- _factory: objectUtils.clone(dxBaseGauge.prototype._factory)
- });
- function selectRectBySizes(srcRect, sizes, margins) {
- var rect = extend({}, srcRect);
- var step;
- margins = margins || {};
- if (sizes) {
- rect.left += margins.left || 0;
- rect.right -= margins.right || 0;
- rect.top += margins.top || 0;
- rect.bottom -= margins.bottom || 0;
- if (sizes.width > 0) {
- step = (rect.right - rect.left - sizes.width) / 2;
- if (step > 0) {
- rect.left += step;
- rect.right -= step
- }
- }
- if (sizes.height > 0) {
- step = (rect.bottom - rect.top - sizes.height) / 2;
- if (step > 0) {
- rect.top += step;
- rect.bottom -= step
- }
- }
- }
- return rect
- }
- dxLinearGauge._TESTS_selectRectBySizes = selectRectBySizes;
- var indicators = dxLinearGauge.prototype._factory.indicators = {};
- dxLinearGauge.prototype._factory.createIndicator = createIndicatorCreator(indicators);
- indicators._default = linearIndicatorsModule._default;
- indicators.rectangle = linearIndicatorsModule.rectangle;
- indicators.rhombus = linearIndicatorsModule.rhombus;
- indicators.circle = linearIndicatorsModule.circle;
- indicators.trianglemarker = linearIndicatorsModule.trianglemarker;
- indicators.textcloud = linearIndicatorsModule.textcloud;
- indicators.rangebar = linearIndicatorsModule.rangebar;
- dxLinearGauge.prototype._factory.RangeContainer = LinearRangeContainer;
- registerComponent("dxLinearGauge", dxLinearGauge);
- module.exports = dxLinearGauge
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/theme_manager.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _extend = extend;
- var BaseThemeManager = __webpack_require__( /*! ../core/base_theme_manager */ 241).BaseThemeManager;
- var ThemeManager = BaseThemeManager.inherit({
- ctor: function(options) {
- this.callBase.apply(this, arguments);
- this._subTheme = options.subTheme
- },
- _initializeTheme: function() {
- var that = this;
- var subTheme;
- if (that._subTheme) {
- subTheme = _extend(true, {}, that._theme[that._subTheme], that._theme);
- _extend(true, that._theme, subTheme)
- }
- that.callBase.apply(that, arguments)
- }
- });
- module.exports = {
- ThemeManager: ThemeManager
- }
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/tracker.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var Class = __webpack_require__( /*! ../../core/class */ 15);
- var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
- var wheelEvent = __webpack_require__( /*! ../../events/core/wheel */ 124);
- var TOOLTIP_HIDE_DELAY = 100;
- var Tracker = Class.inherit({
- ctor: function(parameters) {
- var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
- debug.assertParam(parameters, "parameters");
- debug.assertParam(parameters.renderer, "parameters.renderer");
- debug.assertParam(parameters.container, "parameters.container");
- var that = this;
- that._element = parameters.renderer.g().attr({
- "class": "dxg-tracker",
- stroke: "none",
- "stroke-width": 0,
- fill: "#000000",
- opacity: 1e-4
- }).linkOn(parameters.container, {
- name: "tracker",
- after: "peripheral"
- });
- that._showTooltipCallback = function() {
- var target = that._tooltipEvent.target;
- var data_target = target["gauge-data-target"];
- var data_info = target["gauge-data-info"];
- that._targetEvent = null;
- if (that._tooltipTarget !== target && that._callbacks["tooltip-show"](data_target, data_info)) {
- that._tooltipTarget = target
- }
- };
- that._hideTooltipCallback = function() {
- that._hideTooltipTimeout = null;
- that._targetEvent = null;
- if (that._tooltipTarget) {
- that._callbacks["tooltip-hide"]();
- that._tooltipTarget = null
- }
- };
- that._dispose = function() {
- clearTimeout(that._hideTooltipTimeout);
- that._showTooltipCallback = that._hideTooltipCallback = that._dispose = null
- };
- that._DEBUG_hideTooltipTimeoutSet = that._DEBUG_hideTooltipTimeoutCleared = 0;
- that.TOOLTIP_HIDE_DELAY = TOOLTIP_HIDE_DELAY
- },
- dispose: function() {
- var that = this;
- that._dispose();
- that.deactivate();
- that._element.linkOff();
- that._element = that._context = that._callbacks = null;
- return that
- },
- activate: function() {
- this._element.linkAppend();
- return this
- },
- deactivate: function() {
- this._element.linkRemove().clear();
- return this
- },
- attach: function(element, target, info) {
- element.data({
- "gauge-data-target": target,
- "gauge-data-info": info
- }).append(this._element);
- return this
- },
- detach: function(element) {
- element.remove();
- return this
- },
- setTooltipState: function(state) {
- var that = this;
- var data;
- that._element.off(tooltipMouseEvents).off(tooltipTouchEvents).off(tooltipMouseWheelEvents);
- if (state) {
- data = {
- tracker: that
- };
- that._element.on(tooltipMouseEvents, data).on(tooltipTouchEvents, data).on(tooltipMouseWheelEvents, data)
- }
- return that
- },
- setCallbacks: function(callbacks) {
- this._callbacks = callbacks;
- return this
- },
- _showTooltip: function(event) {
- var that = this;
- that._hideTooltipTimeout && ++that._DEBUG_hideTooltipTimeoutCleared;
- clearTimeout(that._hideTooltipTimeout);
- that._hideTooltipTimeout = null;
- if (that._tooltipTarget === event.target) {
- return
- }
- that._tooltipEvent = event;
- that._showTooltipCallback()
- },
- _hideTooltip: function(delay) {
- var that = this;
- clearTimeout(that._hideTooltipTimeout);
- if (delay) {
- ++that._DEBUG_hideTooltipTimeoutSet;
- that._hideTooltipTimeout = setTimeout(that._hideTooltipCallback, delay)
- } else {
- that._hideTooltipCallback()
- }
- }
- });
- var tooltipMouseEvents = {
- "mouseover.gauge-tooltip": handleTooltipMouseOver,
- "mouseout.gauge-tooltip": handleTooltipMouseOut
- };
- var tooltipMouseMoveEvents = {
- "mousemove.gauge-tooltip": handleTooltipMouseMove
- };
- var tooltipMouseWheelEvents = {};
- tooltipMouseWheelEvents[wheelEvent.name + ".gauge-tooltip"] = handleTooltipMouseWheel;
- var tooltipTouchEvents = {
- "touchstart.gauge-tooltip": handleTooltipTouchStart
- };
- function handleTooltipMouseOver(event) {
- var tracker = event.data.tracker;
- tracker._x = event.pageX;
- tracker._y = event.pageY;
- tracker._element.off(tooltipMouseMoveEvents).on(tooltipMouseMoveEvents, event.data);
- tracker._showTooltip(event)
- }
- function handleTooltipMouseMove(event) {
- var tracker = event.data.tracker;
- tracker._x = event.pageX;
- tracker._y = event.pageY;
- tracker._showTooltip(event)
- }
- function handleTooltipMouseOut(event) {
- var tracker = event.data.tracker;
- tracker._element.off(tooltipMouseMoveEvents);
- tracker._hideTooltip(TOOLTIP_HIDE_DELAY)
- }
- function handleTooltipMouseWheel(event) {
- event.data.tracker._hideTooltip()
- }
- var active_touch_tooltip_tracker = null;
- Tracker._DEBUG_reset = function() {
- active_touch_tooltip_tracker = null
- };
- function handleTooltipTouchStart(event) {
- event.preventDefault();
- var tracker = active_touch_tooltip_tracker;
- if (tracker && tracker !== event.data.tracker) {
- tracker._hideTooltip(TOOLTIP_HIDE_DELAY)
- }
- tracker = active_touch_tooltip_tracker = event.data.tracker;
- tracker._showTooltip(event);
- tracker._touch = true
- }
- function handleTooltipDocumentTouchStart() {
- var tracker = active_touch_tooltip_tracker;
- if (tracker) {
- if (!tracker._touch) {
- tracker._hideTooltip(TOOLTIP_HIDE_DELAY);
- active_touch_tooltip_tracker = null
- }
- tracker._touch = null
- }
- }
- function handleTooltipDocumentTouchEnd() {
- var tracker = active_touch_tooltip_tracker;
- if (tracker) {
- tracker._hideTooltip(TOOLTIP_HIDE_DELAY);
- active_touch_tooltip_tracker = null
- }
- }
- ready(function() {
- eventsEngine.subscribeGlobal(domAdapter.getDocument(), {
- "touchstart.gauge-tooltip": handleTooltipDocumentTouchStart,
- "touchend.gauge-tooltip": handleTooltipDocumentTouchEnd
- })
- });
- module.exports = Tracker
- },
- /*!**************************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/linear_indicators.js ***!
- \**************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var baseIndicatorsModule = __webpack_require__( /*! ./base_indicators */ 250);
- var BaseIndicator = baseIndicatorsModule.BaseIndicator;
- var BaseTextCloudMarker = baseIndicatorsModule.BaseTextCloudMarker;
- var BaseRangeBar = baseIndicatorsModule.BaseRangeBar;
- var _Number = Number;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var SimpleIndicator = BaseIndicator.inherit({
- _move: function() {
- var that = this;
- var delta = that._actualPosition - that._zeroPosition;
- that._rootElement.move(that.vertical ? 0 : delta, that.vertical ? delta : 0);
- that._trackerElement && that._trackerElement.move(that.vertical ? 0 : delta, that.vertical ? delta : 0)
- },
- _isEnabled: function() {
- this.vertical = this._options.vertical;
- return this._options.length > 0 && this._options.width > 0
- },
- _isVisible: function() {
- return true
- },
- _getTrackerSettings: function() {
- var options = this._options;
- var x1;
- var x2;
- var y1;
- var y2;
- var width = options.width / 2;
- var length = options.length / 2;
- var p = this._zeroPosition;
- width > 10 || (width = 10);
- length > 10 || (length = 10);
- if (this.vertical) {
- x1 = options.x - length;
- x2 = options.x + length;
- y1 = p + width;
- y2 = p - width
- } else {
- x1 = p - width;
- x2 = p + width;
- y1 = options.y + length;
- y2 = options.y - length
- }
- return {
- points: [x1, y1, x1, y2, x2, y2, x2, y1]
- }
- },
- _render: function() {
- var that = this;
- that._zeroPosition = that._translator.getCodomainStart()
- },
- _clear: function() {
- delete this._element
- },
- measure: function(layout) {
- var p = this.vertical ? layout.x : layout.y;
- return {
- min: p - this._options.length / 2,
- max: p + this._options.length / 2
- }
- },
- getTooltipParameters: function() {
- var that = this;
- var options = that._options;
- var p = that._actualPosition;
- var parameters = {
- x: p,
- y: p,
- value: that._currentValue,
- color: options.color,
- offset: options.width / 2
- };
- that.vertical ? parameters.x = options.x : parameters.y = options.y;
- return parameters
- }
- });
- var rectangle = SimpleIndicator.inherit({
- _render: function() {
- var that = this;
- var options = that._options;
- var x1;
- var x2;
- var y1;
- var y2;
- that.callBase();
- var p = that._zeroPosition;
- if (that.vertical) {
- x1 = options.x - options.length / 2;
- x2 = options.x + options.length / 2;
- y1 = p + options.width / 2;
- y2 = p - options.width / 2
- } else {
- x1 = p - options.width / 2;
- x2 = p + options.width / 2;
- y1 = options.y + options.length / 2;
- y2 = options.y - options.length / 2
- }
- that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
- that._element.attr({
- points: [x1, y1, x1, y2, x2, y2, x2, y1]
- })
- }
- });
- var rhombus = SimpleIndicator.inherit({
- _render: function() {
- var that = this;
- var options = that._options;
- var x;
- var y;
- var dx;
- var dy;
- that.callBase();
- if (that.vertical) {
- x = options.x;
- y = that._zeroPosition;
- dx = options.length / 2 || 0;
- dy = options.width / 2 || 0
- } else {
- x = that._zeroPosition;
- y = options.y;
- dx = options.width / 2 || 0;
- dy = options.length / 2 || 0
- }
- that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
- that._element.attr({
- points: [x - dx, y, x, y - dy, x + dx, y, x, y + dy]
- })
- }
- });
- var circle = SimpleIndicator.inherit({
- _render: function() {
- var that = this;
- var options = that._options;
- var x;
- var y;
- that.callBase();
- if (that.vertical) {
- x = options.x;
- y = that._zeroPosition
- } else {
- x = that._zeroPosition;
- y = options.y
- }
- var r = options.length / 2 || 0;
- that._element = that._element || that._renderer.circle().append(that._rootElement);
- that._element.attr({
- cx: x,
- cy: y,
- r: r
- })
- }
- });
- var triangleMarker = SimpleIndicator.inherit({
- _isEnabled: function() {
- var that = this;
- that.vertical = that._options.vertical;
- that._inverted = that.vertical ? "right" === _normalizeEnum(that._options.horizontalOrientation) : "bottom" === _normalizeEnum(that._options.verticalOrientation);
- return that._options.length > 0 && that._options.width > 0
- },
- _isVisible: function() {
- return true
- },
- _render: function() {
- var that = this;
- var options = that._options;
- var x1;
- var x2;
- var y1;
- var y2;
- var settings = {
- stroke: "none",
- "stroke-width": 0,
- "stroke-linecap": "square"
- };
- that.callBase();
- if (that.vertical) {
- x1 = options.x;
- y1 = that._zeroPosition;
- x2 = x1 + _Number(that._inverted ? options.length : -options.length);
- settings.points = [x1, y1, x2, y1 - options.width / 2, x2, y1 + options.width / 2]
- } else {
- y1 = options.y;
- x1 = that._zeroPosition;
- y2 = y1 + _Number(that._inverted ? options.length : -options.length);
- settings.points = [x1, y1, x1 - options.width / 2, y2, x1 + options.width / 2, y2]
- }
- if (options.space > 0) {
- settings["stroke-width"] = Math.min(options.space, options.width / 4) || 0;
- settings.stroke = settings["stroke-width"] > 0 ? options.containerBackgroundColor || "none" : "none"
- }
- that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
- that._element.attr(settings).sharp()
- },
- _getTrackerSettings: function() {
- var that = this;
- var options = that._options;
- var width = options.width / 2;
- var length = _Number(options.length);
- var x1;
- var x2;
- var y1;
- var y2;
- var result;
- width > 10 || (width = 10);
- length > 20 || (length = 20);
- if (that.vertical) {
- x1 = x2 = options.x;
- x2 = x1 + (that._inverted ? length : -length);
- y1 = that._zeroPosition + width;
- y2 = that._zeroPosition - width;
- result = [x1, y1, x2, y1, x2, y2, x1, y2]
- } else {
- y1 = options.y;
- y2 = y1 + (that._inverted ? length : -length);
- x1 = that._zeroPosition - width;
- x2 = that._zeroPosition + width;
- result = [x1, y1, x1, y2, x2, y2, x2, y1]
- }
- return {
- points: result
- }
- },
- measure: function(layout) {
- var that = this;
- var length = _Number(that._options.length);
- var minBound;
- var maxBound;
- if (that.vertical) {
- minBound = maxBound = layout.x;
- if (that._inverted) {
- maxBound = minBound + length
- } else {
- minBound = maxBound - length
- }
- } else {
- minBound = maxBound = layout.y;
- if (that._inverted) {
- maxBound = minBound + length
- } else {
- minBound = maxBound - length
- }
- }
- return {
- min: minBound,
- max: maxBound,
- indent: that._options.width / 2
- }
- },
- getTooltipParameters: function() {
- var that = this;
- var options = that._options;
- var s = (that._inverted ? options.length : -options.length) / 2;
- var parameters = that.callBase();
- that.vertical ? parameters.x += s : parameters.y += s;
- parameters.offset = options.length / 2;
- return parameters
- }
- });
- var textCloud = BaseTextCloudMarker.inherit({
- _isEnabled: function() {
- var that = this;
- that.vertical = that._options.vertical;
- that._inverted = that.vertical ? "right" === _normalizeEnum(that._options.horizontalOrientation) : "bottom" === _normalizeEnum(that._options.verticalOrientation);
- return true
- },
- _isVisible: function() {
- return true
- },
- _getTextCloudOptions: function() {
- var that = this;
- var x = that._actualPosition;
- var y = that._actualPosition;
- var type;
- if (that.vertical) {
- x = that._options.x;
- type = that._inverted ? "top-left" : "top-right"
- } else {
- y = that._options.y;
- type = that._inverted ? "right-top" : "right-bottom"
- }
- return {
- x: x,
- y: y,
- type: type
- }
- },
- measure: function(layout) {
- var that = this;
- var minBound;
- var maxBound;
- var arrowLength = _Number(that._options.arrowLength) || 0;
- var indent;
- that._measureText();
- if (that.vertical) {
- indent = that._textFullHeight;
- if (that._inverted) {
- minBound = layout.x;
- maxBound = layout.x + arrowLength + that._textFullWidth
- } else {
- minBound = layout.x - arrowLength - that._textFullWidth;
- maxBound = layout.x
- }
- } else {
- indent = that._textFullWidth;
- if (that._inverted) {
- minBound = layout.y;
- maxBound = layout.y + arrowLength + that._textFullHeight
- } else {
- minBound = layout.y - arrowLength - that._textFullHeight;
- maxBound = layout.y
- }
- }
- return {
- min: minBound,
- max: maxBound,
- indent: indent
- }
- }
- });
- var rangeBar = BaseRangeBar.inherit({
- _isEnabled: function() {
- var that = this;
- that.vertical = that._options.vertical;
- that._inverted = that.vertical ? "right" === _normalizeEnum(that._options.horizontalOrientation) : "bottom" === _normalizeEnum(that._options.verticalOrientation);
- return that._options.size > 0
- },
- _isVisible: function() {
- return true
- },
- _createBarItem: function() {
- return this._renderer.path([], "area").append(this._rootElement)
- },
- _createTracker: function() {
- return this._renderer.path([], "area")
- },
- _setBarSides: function() {
- var that = this;
- var options = that._options;
- var size = _Number(options.size);
- var minSide;
- var maxSide;
- if (that.vertical) {
- if (that._inverted) {
- minSide = options.x;
- maxSide = options.x + size
- } else {
- minSide = options.x - size;
- maxSide = options.x
- }
- } else {
- if (that._inverted) {
- minSide = options.y;
- maxSide = options.y + size
- } else {
- minSide = options.y - size;
- maxSide = options.y
- }
- }
- that._minSide = minSide;
- that._maxSide = maxSide;
- that._minBound = minSide;
- that._maxBound = maxSide
- },
- _getSpace: function() {
- var options = this._options;
- return options.space > 0 ? _Number(options.space) : 0
- },
- _isTextVisible: function() {
- var textOptions = this._options.text || {};
- return textOptions.indent > 0 || textOptions.indent < 0
- },
- _getTextAlign: function() {
- return this.vertical ? this._options.text.indent > 0 ? "left" : "right" : "center"
- },
- _setTextItemsSides: function() {
- var that = this;
- var indent = _Number(that._options.text.indent);
- if (indent > 0) {
- that._lineStart = that._maxSide;
- that._lineEnd = that._maxSide + indent;
- that._textPosition = that._lineEnd + (that.vertical ? 2 : that._textHeight / 2);
- that._maxBound = that._textPosition + (that.vertical ? that._textWidth : that._textHeight / 2)
- } else {
- if (indent < 0) {
- that._lineStart = that._minSide;
- that._lineEnd = that._minSide + indent;
- that._textPosition = that._lineEnd - (that.vertical ? 2 : that._textHeight / 2);
- that._minBound = that._textPosition - (that.vertical ? that._textWidth : that._textHeight / 2)
- }
- }
- },
- _getPositions: function() {
- var that = this;
- var startPosition = that._startPosition;
- var endPosition = that._endPosition;
- var space = that._space;
- var basePosition = that._basePosition;
- var actualPosition = that._actualPosition;
- var mainPosition1;
- var mainPosition2;
- var backPosition1;
- var backPosition2;
- if (startPosition < endPosition) {
- if (basePosition < actualPosition) {
- mainPosition1 = basePosition;
- mainPosition2 = actualPosition
- } else {
- mainPosition1 = actualPosition;
- mainPosition2 = basePosition
- }
- backPosition1 = mainPosition1 - space;
- backPosition2 = mainPosition2 + space
- } else {
- if (basePosition > actualPosition) {
- mainPosition1 = basePosition;
- mainPosition2 = actualPosition
- } else {
- mainPosition1 = actualPosition;
- mainPosition2 = basePosition
- }
- backPosition1 = mainPosition1 + space;
- backPosition2 = mainPosition2 - space
- }
- return {
- start: startPosition,
- end: endPosition,
- main1: mainPosition1,
- main2: mainPosition2,
- back1: backPosition1,
- back2: backPosition2
- }
- },
- _buildItemSettings: function(from, to) {
- var that = this;
- var side1 = that._minSide;
- var side2 = that._maxSide;
- var points = that.vertical ? [side1, from, side1, to, side2, to, side2, from] : [from, side1, from, side2, to, side2, to, side1];
- return {
- points: points
- }
- },
- _updateTextPosition: function() {
- var that = this;
- that._text.attr(that.vertical ? {
- x: that._textPosition,
- y: that._actualPosition + that._textVerticalOffset
- } : {
- x: that._actualPosition,
- y: that._textPosition + that._textVerticalOffset
- })
- },
- _updateLinePosition: function() {
- var that = this;
- var actualPosition = that._actualPosition;
- var side1;
- var side2;
- var points;
- if (that.vertical) {
- if (that._basePosition >= actualPosition) {
- side1 = actualPosition;
- side2 = actualPosition + 2
- } else {
- side1 = actualPosition - 2;
- side2 = actualPosition
- }
- points = [that._lineStart, side1, that._lineStart, side2, that._lineEnd, side2, that._lineEnd, side1]
- } else {
- if (that._basePosition <= actualPosition) {
- side1 = actualPosition - 2;
- side2 = actualPosition
- } else {
- side1 = actualPosition;
- side2 = actualPosition + 2
- }
- points = [side1, that._lineStart, side1, that._lineEnd, side2, that._lineEnd, side2, that._lineStart]
- }
- that._line.attr({
- points: points
- }).sharp()
- },
- _getTooltipPosition: function() {
- var that = this;
- var crossCenter = (that._minSide + that._maxSide) / 2;
- var alongCenter = (that._basePosition + that._actualPosition) / 2;
- return that.vertical ? {
- x: crossCenter,
- y: alongCenter
- } : {
- x: alongCenter,
- y: crossCenter
- }
- },
- measure: function(layout) {
- var that = this;
- var size = _Number(that._options.size);
- var textIndent = _Number(that._options.text.indent);
- var minBound;
- var maxBound;
- var indent;
- that._measureText();
- if (that.vertical) {
- minBound = maxBound = layout.x;
- if (that._inverted) {
- maxBound += size
- } else {
- minBound -= size
- }
- if (that._hasText) {
- indent = that._textHeight / 2;
- if (textIndent > 0) {
- maxBound += textIndent + that._textWidth
- }
- if (textIndent < 0) {
- minBound += textIndent - that._textWidth
- }
- }
- } else {
- minBound = maxBound = layout.y;
- if (that._inverted) {
- maxBound += size
- } else {
- minBound -= size
- }
- if (that._hasText) {
- indent = that._textWidth / 2;
- if (textIndent > 0) {
- maxBound += textIndent + that._textHeight
- }
- if (textIndent < 0) {
- minBound += textIndent - that._textHeight
- }
- }
- }
- return {
- min: minBound,
- max: maxBound,
- indent: indent
- }
- }
- });
- exports._default = rangeBar;
- exports.rectangle = rectangle;
- exports.rhombus = rhombus;
- exports.circle = circle;
- exports.trianglemarker = triangleMarker;
- exports.textcloud = textCloud;
- exports.rangebar = rangeBar
- },
- /*!*******************************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/linear_range_container.js ***!
- \*******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var BaseRangeContainer = __webpack_require__( /*! ./base_range_container */ 413);
- var _Number = Number;
- var _max = Math.max;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var LinearRangeContainer = BaseRangeContainer.inherit({
- _processOptions: function() {
- var that = this;
- that.vertical = that._options.vertical;
- that._inner = that._outer = 0;
- if (that.vertical) {
- switch (_normalizeEnum(that._options.horizontalOrientation)) {
- case "left":
- that._inner = 1;
- break;
- case "center":
- that._inner = that._outer = .5;
- break;
- default:
- that._outer = 1
- }
- } else {
- switch (_normalizeEnum(that._options.verticalOrientation)) {
- case "top":
- that._inner = 1;
- break;
- case "center":
- that._inner = that._outer = .5;
- break;
- default:
- that._outer = 1
- }
- }
- },
- _isVisible: function() {
- return true
- },
- _createRange: function(range, layout) {
- var that = this;
- var inner = that._inner;
- var outer = that._outer;
- var startPosition = that._translator.translate(range.start);
- var endPosition = that._translator.translate(range.end);
- var points;
- var x = layout.x;
- var y = layout.y;
- var startWidth = range.startWidth;
- var endWidth = range.endWidth;
- if (that.vertical) {
- points = [x - startWidth * inner, startPosition, x - endWidth * inner, endPosition, x + endWidth * outer, endPosition, x + startWidth * outer, startPosition]
- } else {
- points = [startPosition, y + startWidth * outer, startPosition, y - startWidth * inner, endPosition, y - endWidth * inner, endPosition, y + endWidth * outer]
- }
- return that._renderer.path(points, "area")
- },
- measure: function(layout) {
- var result = {};
- var width;
- result.min = result.max = layout[this.vertical ? "x" : "y"];
- width = this._options.width;
- width = _Number(width) || _max(_Number(width.start), _Number(width.end));
- result.min -= this._inner * width;
- result.max += this._outer * width;
- return result
- }
- });
- module.exports = LinearRangeContainer
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/circular_gauge.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./gauges/circular_gauge */ 414)
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/circular_indicators.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var baseIndicatorsModule = __webpack_require__( /*! ./base_indicators */ 250);
- var BaseIndicator = baseIndicatorsModule.BaseIndicator;
- var BaseTextCloudMarker = baseIndicatorsModule.BaseTextCloudMarker;
- var BaseRangeBar = baseIndicatorsModule.BaseRangeBar;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _Number = Number;
- var _getCosAndSin = vizUtils.getCosAndSin;
- var _convertAngleToRendererSpace = vizUtils.convertAngleToRendererSpace;
- var SimpleIndicator = BaseIndicator.inherit({
- _move: function() {
- var that = this;
- var options = that._options;
- var angle = _convertAngleToRendererSpace(that._actualPosition);
- that._rootElement.rotate(angle, options.x, options.y);
- that._trackerElement && that._trackerElement.rotate(angle, options.x, options.y)
- },
- _isEnabled: function() {
- return this._options.width > 0
- },
- _isVisible: function(layout) {
- return layout.radius - _Number(this._options.indentFromCenter) > 0
- },
- _getTrackerSettings: function() {
- var options = this._options;
- var radius = this._getRadius();
- var indentFromCenter = this._getIndentFromCenter();
- var x = options.x;
- var y = options.y - (radius + indentFromCenter) / 2;
- var width = options.width / 2;
- var length = (radius - indentFromCenter) / 2;
- width > 10 || (width = 10);
- length > 10 || (length = 10);
- return {
- points: [x - width, y - length, x - width, y + length, x + width, y + length, x + width, y - length]
- }
- },
- _render: function() {
- var that = this;
- that._renderPointer()
- },
- _clearPointer: function() {
- delete this._element
- },
- _clear: function() {
- this._clearPointer()
- },
- _getIndentFromCenter: function(radius) {
- return Number(this._options.indentFromCenter) || 0
- },
- _getRadius: function() {
- return 0
- },
- measure: function(layout) {
- var result = {
- max: layout.radius
- };
- if (this._options.indentFromCenter < 0) {
- result.inverseHorizontalOffset = result.inverseVerticalOffset = -_Number(this._options.indentFromCenter)
- }
- return result
- },
- getTooltipParameters: function() {
- var options = this._options;
- var cosSin = _getCosAndSin(this._actualPosition);
- var r = (this._getRadius() + this._getIndentFromCenter()) / 2;
- return {
- x: options.x + cosSin.cos * r,
- y: options.y - cosSin.sin * r,
- value: this._currentValue,
- color: options.color,
- offset: options.width / 2
- }
- }
- });
- var NeedleIndicator = SimpleIndicator.inherit({
- _isVisible: function(layout) {
- var indentFromCenter = this._adjustOffset(Number(this._options.indentFromCenter), layout.radius);
- var offset = this._adjustOffset(Number(this._options.offset), layout.radius);
- return layout.radius - indentFromCenter - offset > 0
- },
- getOffset: function() {
- return 0
- },
- _adjustOffset: function(value, radius) {
- var minRadius = Number(this._options.beginAdaptingAtRadius);
- var diff = radius / minRadius;
- if (diff < 1) {
- value = Math.floor(value * diff)
- }
- return value || 0
- },
- _getIndentFromCenter: function(radius) {
- return this._adjustOffset(Number(this._options.indentFromCenter), this._options.radius)
- },
- _getRadius: function() {
- var options = this._options;
- return options.radius - this._adjustOffset(Number(options.offset), options.radius)
- },
- _renderSpindle: function() {
- var that = this;
- var options = that._options;
- var radius = options.radius;
- var spindleSize = 2 * this._adjustOffset(_Number(options.spindleSize) / 2, radius);
- var gapSize;
- gapSize = 2 * this._adjustOffset(_Number(options.spindleGapSize) / 2, radius) || 0;
- if (gapSize > 0) {
- gapSize = gapSize <= spindleSize ? gapSize : spindleSize
- }
- if (spindleSize > 0) {
- that._spindleOuter = that._spindleOuter || that._renderer.circle().append(that._rootElement);
- that._spindleInner = that._spindleInner || that._renderer.circle().append(that._rootElement);
- that._spindleOuter.attr({
- "class": "dxg-spindle-border",
- cx: options.x,
- cy: options.y,
- r: spindleSize / 2
- });
- that._spindleInner.attr({
- "class": "dxg-spindle-hole",
- cx: options.x,
- cy: options.y,
- r: gapSize / 2,
- fill: options.containerBackgroundColor
- })
- }
- },
- _render: function() {
- var that = this;
- that.callBase();
- that._renderSpindle()
- },
- _clear: function() {
- this.callBase();
- delete this._spindleOuter;
- delete this._spindleInner
- }
- });
- var rectangleNeedle = NeedleIndicator.inherit({
- _renderPointer: function() {
- var that = this;
- var options = that._options;
- var y2 = options.y - this._getRadius();
- var y1 = options.y - this._getIndentFromCenter();
- var x1 = options.x - options.width / 2;
- var x2 = x1 + _Number(options.width);
- that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
- that._element.attr({
- points: [x1, y1, x1, y2, x2, y2, x2, y1]
- })
- }
- });
- var triangleNeedle = NeedleIndicator.inherit({
- _renderPointer: function() {
- var that = this;
- var options = that._options;
- var y2 = options.y - this._getRadius();
- var y1 = options.y - this._getIndentFromCenter();
- var x1 = options.x - options.width / 2;
- var x2 = options.x + options.width / 2;
- that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
- that._element.attr({
- points: [x1, y1, options.x, y2, x2, y1]
- })
- }
- });
- var twoColorNeedle = NeedleIndicator.inherit({
- _renderPointer: function() {
- var that = this;
- var options = that._options;
- var x1 = options.x - options.width / 2;
- var x2 = options.x + options.width / 2;
- var y4 = options.y - this._getRadius();
- var y1 = options.y - this._getIndentFromCenter();
- var fraction = _Number(options.secondFraction) || 0;
- var y2;
- var y3;
- if (fraction >= 1) {
- y2 = y3 = y1
- } else {
- if (fraction <= 0) {
- y2 = y3 = y4
- } else {
- y3 = y4 + (y1 - y4) * fraction;
- y2 = y3 + _Number(options.space)
- }
- }
- that._firstElement = that._firstElement || that._renderer.path([], "area").append(that._rootElement);
- that._spaceElement = that._spaceElement || that._renderer.path([], "area").append(that._rootElement);
- that._secondElement = that._secondElement || that._renderer.path([], "area").append(that._rootElement);
- that._firstElement.attr({
- points: [x1, y1, x1, y2, x2, y2, x2, y1]
- });
- that._spaceElement.attr({
- points: [x1, y2, x1, y3, x2, y3, x2, y2],
- "class": "dxg-hole",
- fill: options.containerBackgroundColor
- });
- that._secondElement.attr({
- points: [x1, y3, x1, y4, x2, y4, x2, y3],
- "class": "dxg-part",
- fill: options.secondColor
- })
- },
- _clearPointer: function() {
- delete this._firstElement;
- delete this._secondElement;
- delete this._spaceElement
- }
- });
- var triangleMarker = SimpleIndicator.inherit({
- _isEnabled: function() {
- return this._options.length > 0 && this._options.width > 0
- },
- _isVisible: function(layout) {
- return layout.radius > 0
- },
- _render: function() {
- var that = this;
- var options = that._options;
- var x = options.x;
- var y1 = options.y - options.radius;
- var dx = options.width / 2 || 0;
- var y2 = y1 - _Number(options.length);
- that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
- var settings = {
- points: [x, y1, x - dx, y2, x + dx, y2],
- stroke: "none",
- "stroke-width": 0,
- "stroke-linecap": "square"
- };
- if (options.space > 0) {
- settings["stroke-width"] = Math.min(options.space, options.width / 4) || 0;
- settings.stroke = settings["stroke-width"] > 0 ? options.containerBackgroundColor || "none" : "none"
- }
- that._element.attr(settings).sharp()
- },
- _clear: function() {
- delete this._element
- },
- _getTrackerSettings: function() {
- var options = this._options;
- var x = options.x;
- var y = options.y - options.radius - options.length / 2;
- var width = options.width / 2;
- var length = options.length / 2;
- width > 10 || (width = 10);
- length > 10 || (length = 10);
- return {
- points: [x - width, y - length, x - width, y + length, x + width, y + length, x + width, y - length]
- }
- },
- measure: function(layout) {
- return {
- min: layout.radius,
- max: layout.radius + _Number(this._options.length)
- }
- },
- getTooltipParameters: function() {
- var options = this._options;
- var cosSin = _getCosAndSin(this._actualPosition);
- var r = options.radius + options.length / 2;
- var parameters = this.callBase();
- parameters.x = options.x + cosSin.cos * r;
- parameters.y = options.y - cosSin.sin * r;
- parameters.offset = options.length / 2;
- return parameters
- }
- });
- var textCloud = BaseTextCloudMarker.inherit({
- _isEnabled: function() {
- return true
- },
- _isVisible: function(layout) {
- return layout.radius > 0
- },
- _getTextCloudOptions: function() {
- var that = this;
- var cosSin = _getCosAndSin(that._actualPosition);
- var nAngle = vizUtils.normalizeAngle(that._actualPosition);
- return {
- x: that._options.x + cosSin.cos * that._options.radius,
- y: that._options.y - cosSin.sin * that._options.radius,
- type: nAngle > 270 ? "left-top" : nAngle > 180 ? "top-right" : nAngle > 90 ? "right-bottom" : "bottom-left"
- }
- },
- measure: function(layout) {
- var that = this;
- var arrowLength = _Number(that._options.arrowLength) || 0;
- that._measureText();
- var verticalOffset = that._textFullHeight + arrowLength;
- var horizontalOffset = that._textFullWidth + arrowLength;
- return {
- min: layout.radius,
- max: layout.radius,
- horizontalOffset: horizontalOffset,
- verticalOffset: verticalOffset,
- inverseHorizontalOffset: horizontalOffset,
- inverseVerticalOffset: verticalOffset
- }
- }
- });
- var rangeBar = BaseRangeBar.inherit({
- _isEnabled: function() {
- return this._options.size > 0
- },
- _isVisible: function(layout) {
- return layout.radius - _Number(this._options.size) > 0
- },
- _createBarItem: function() {
- return this._renderer.arc().attr({
- "stroke-linejoin": "round"
- }).append(this._rootElement)
- },
- _createTracker: function() {
- return this._renderer.arc().attr({
- "stroke-linejoin": "round"
- })
- },
- _setBarSides: function() {
- var that = this;
- that._maxSide = that._options.radius;
- that._minSide = that._maxSide - _Number(that._options.size)
- },
- _getSpace: function() {
- var options = this._options;
- return options.space > 0 ? 180 * options.space / options.radius / Math.PI : 0
- },
- _isTextVisible: function() {
- var options = this._options.text || {};
- return options.indent > 0
- },
- _setTextItemsSides: function() {
- var that = this;
- var options = that._options;
- var indent = _Number(options.text.indent);
- that._lineFrom = options.y - options.radius;
- that._lineTo = that._lineFrom - indent;
- that._textRadius = options.radius + indent
- },
- _getPositions: function() {
- var that = this;
- var basePosition = that._basePosition;
- var actualPosition = that._actualPosition;
- var mainPosition1;
- var mainPosition2;
- if (basePosition >= actualPosition) {
- mainPosition1 = basePosition;
- mainPosition2 = actualPosition
- } else {
- mainPosition1 = actualPosition;
- mainPosition2 = basePosition
- }
- return {
- start: that._startPosition,
- end: that._endPosition,
- main1: mainPosition1,
- main2: mainPosition2,
- back1: Math.min(mainPosition1 + that._space, that._startPosition),
- back2: Math.max(mainPosition2 - that._space, that._endPosition)
- }
- },
- _buildItemSettings: function(from, to) {
- var that = this;
- return {
- x: that._options.x,
- y: that._options.y,
- innerRadius: that._minSide,
- outerRadius: that._maxSide,
- startAngle: to,
- endAngle: from
- }
- },
- _updateTextPosition: function() {
- var that = this;
- var cosSin = _getCosAndSin(that._actualPosition);
- var x = that._options.x + that._textRadius * cosSin.cos;
- var y = that._options.y - that._textRadius * cosSin.sin;
- x += cosSin.cos * that._textWidth * .6;
- y -= cosSin.sin * that._textHeight * .6;
- that._text.attr({
- x: x,
- y: y + that._textVerticalOffset
- })
- },
- _updateLinePosition: function() {
- var that = this;
- var x = that._options.x;
- var x1;
- var x2;
- if (that._basePosition > that._actualPosition) {
- x1 = x - 2;
- x2 = x
- } else {
- if (that._basePosition < that._actualPosition) {
- x1 = x;
- x2 = x + 2
- } else {
- x1 = x - 1;
- x2 = x + 1
- }
- }
- that._line.attr({
- points: [x1, that._lineFrom, x1, that._lineTo, x2, that._lineTo, x2, that._lineFrom]
- }).rotate(_convertAngleToRendererSpace(that._actualPosition), x, that._options.y).sharp()
- },
- _getTooltipPosition: function() {
- var that = this;
- var cosSin = _getCosAndSin((that._basePosition + that._actualPosition) / 2);
- var r = (that._minSide + that._maxSide) / 2;
- return {
- x: that._options.x + cosSin.cos * r,
- y: that._options.y - cosSin.sin * r
- }
- },
- measure: function(layout) {
- var that = this;
- var result = {
- min: layout.radius - _Number(that._options.size),
- max: layout.radius
- };
- that._measureText();
- if (that._hasText) {
- result.max += _Number(that._options.text.indent);
- result.horizontalOffset = that._textWidth;
- result.verticalOffset = that._textHeight
- }
- return result
- }
- });
- exports._default = rectangleNeedle;
- exports.rectangleneedle = rectangleNeedle;
- exports.triangleneedle = triangleNeedle;
- exports.twocolorneedle = twoColorNeedle;
- exports.trianglemarker = triangleMarker;
- exports.textcloud = textCloud;
- exports.rangebar = rangeBar
- },
- /*!*********************************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/circular_range_container.js ***!
- \*********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var BaseRangeContainer = __webpack_require__( /*! ./base_range_container */ 413);
- var _Number = Number;
- var _max = Math.max;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var CircularRangeContainer = BaseRangeContainer.inherit({
- _processOptions: function() {
- var that = this;
- that._inner = that._outer = 0;
- switch (_normalizeEnum(that._options.orientation)) {
- case "inside":
- that._inner = 1;
- break;
- case "center":
- that._inner = that._outer = .5;
- break;
- default:
- that._outer = 1
- }
- },
- _isVisible: function(layout) {
- var width = this._options.width;
- width = _Number(width) || _max(_Number(width.start), _Number(width.end));
- return layout.radius - this._inner * width > 0
- },
- _createRange: function(range, layout) {
- var that = this;
- var width = (range.startWidth + range.endWidth) / 2;
- return that._renderer.arc(layout.x, layout.y, layout.radius - that._inner * width, layout.radius + that._outer * width, that._translator.translate(range.end), that._translator.translate(range.start)).attr({
- "stroke-linejoin": "round"
- })
- },
- measure: function(layout) {
- var width = this._options.width;
- width = _Number(width) || _max(_Number(width.start), _Number(width.end));
- return {
- min: layout.radius - this._inner * width,
- max: layout.radius + this._outer * width
- }
- }
- });
- module.exports = CircularRangeContainer
- },
- /*!***********************************************!*\
- !*** ./artifacts/transpiled/viz/bar_gauge.js ***!
- \***********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./gauges/bar_gauge */ 802).dxBarGauge
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/gauges/bar_gauge.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var PI_DIV_180 = Math.PI / 180;
- var _abs = Math.abs;
- var _round = Math.round;
- var _floor = Math.floor;
- var _min = Math.min;
- var _max = Math.max;
- var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
- var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
- var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var baseGaugeModule = __webpack_require__( /*! ./base_gauge */ 145);
- var dxBaseGauge = baseGaugeModule.dxBaseGauge;
- var _getSampleText = baseGaugeModule.getSampleText;
- var _formatValue = baseGaugeModule.formatValue;
- var _compareArrays = baseGaugeModule.compareArrays;
- var dxCircularGauge = __webpack_require__( /*! ./circular_gauge */ 414);
- var _isArray = Array.isArray;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _convertAngleToRendererSpace = vizUtils.convertAngleToRendererSpace;
- var _getCosAndSin = vizUtils.getCosAndSin;
- var _patchFontOptions = vizUtils.patchFontOptions;
- var _Number = Number;
- var _isFinite = isFinite;
- var _noop = commonUtils.noop;
- var _extend = extend;
- var OPTION_VALUES = "values";
- var dxBarGauge = dxBaseGauge.inherit({
- _rootClass: "dxbg-bar-gauge",
- _themeSection: "barGauge",
- _fontFields: ["label.font", "legend.font", "legend.title.font", "legend.title.subtitle.font"],
- _initCore: function() {
- var that = this;
- that.callBase.apply(that, arguments);
- that._barsGroup = that._renderer.g().attr({
- "class": "dxbg-bars"
- }).linkOn(that._renderer.root, "bars");
- that._values = [];
- that._context = {
- renderer: that._renderer,
- translator: that._translator,
- tracker: that._tracker,
- group: that._barsGroup
- };
- that._animateStep = function(pos) {
- var bars = that._bars;
- var i;
- var ii;
- for (i = 0, ii = bars.length; i < ii; ++i) {
- bars[i].animate(pos)
- }
- };
- that._animateComplete = function() {
- that._bars.forEach(function(bar) {
- return bar.endAnimation()
- });
- that._checkOverlap()
- }
- },
- _disposeCore: function() {
- var that = this;
- that._barsGroup.linkOff();
- that._barsGroup = that._values = that._context = that._animateStep = that._animateComplete = null;
- that.callBase.apply(that, arguments)
- },
- _setupDomainCore: function() {
- var that = this;
- var startValue = that.option("startValue");
- var endValue = that.option("endValue");
- _isFinite(startValue) || (startValue = 0);
- _isFinite(endValue) || (endValue = 100);
- that._translator.setDomain(startValue, endValue);
- that._baseValue = that._translator.adjust(that.option("baseValue"));
- _isFinite(that._baseValue) || (that._baseValue = startValue < endValue ? startValue : endValue)
- },
- _getDefaultSize: function() {
- return {
- width: 300,
- height: 300
- }
- },
- _setupCodomain: dxCircularGauge.prototype._setupCodomain,
- _getApproximateScreenRange: function() {
- var that = this;
- var sides = that._area.sides;
- var width = that._canvas.width / (sides.right - sides.left);
- var height = that._canvas.height / (sides.down - sides.up);
- var r = width < height ? width : height;
- return -that._translator.getCodomainRange() * r * PI_DIV_180
- },
- _setupAnimationSettings: function() {
- var that = this;
- that.callBase.apply(that, arguments);
- if (that._animationSettings) {
- that._animationSettings.step = that._animateStep;
- that._animationSettings.complete = that._animateComplete
- }
- },
- _cleanContent: function() {
- var that = this;
- that._barsGroup.linkRemove();
- that._animationSettings && that._barsGroup.stopAnimation();
- that._barsGroup.clear()
- },
- _renderContent: function() {
- var that = this;
- var labelOptions = that.option("label");
- var text;
- var bBox;
- var context = that._context;
- that._barsGroup.linkAppend();
- context.textEnabled = void 0 === labelOptions || labelOptions && (!("visible" in labelOptions) || labelOptions.visible);
- if (context.textEnabled) {
- context.textColor = labelOptions && labelOptions.font && labelOptions.font.color || null;
- labelOptions = _extend(true, {}, that._themeManager.theme().label, labelOptions);
- context.formatOptions = {
- format: void 0 !== labelOptions.format ? labelOptions.format : that._defaultFormatOptions,
- customizeText: labelOptions.customizeText
- };
- context.textOptions = {
- align: "center"
- };
- context.fontStyles = _patchFontOptions(_extend({}, that._themeManager.theme().label.font, labelOptions.font, {
- color: null
- }));
- that._textIndent = labelOptions.indent > 0 ? _Number(labelOptions.indent) : 0;
- context.lineWidth = labelOptions.connectorWidth > 0 ? _Number(labelOptions.connectorWidth) : 0;
- context.lineColor = labelOptions.connectorColor || null;
- text = that._renderer.text(_getSampleText(that._translator, context.formatOptions), 0, 0).attr(context.textOptions).css(context.fontStyles).append(that._barsGroup);
- bBox = text.getBBox();
- text.remove();
- context.textY = bBox.y;
- context.textWidth = bBox.width;
- context.textHeight = bBox.height
- }
- dxCircularGauge.prototype._applyMainLayout.call(that);
- that._renderBars()
- },
- _measureMainElements: function() {
- var result = {
- maxRadius: this._area.radius
- };
- if (this._context.textEnabled) {
- result.horizontalMargin = this._context.textWidth;
- result.verticalMargin = this._context.textHeight;
- result.inverseHorizontalMargin = this._context.textWidth / 2;
- result.inverseVerticalMargin = this._context.textHeight / 2
- }
- return result
- },
- _renderBars: function() {
- var that = this;
- var options = _extend({}, that._themeManager.theme(), that.option());
- var radius;
- var area = that._area;
- var relativeInnerRadius = options.relativeInnerRadius > 0 && options.relativeInnerRadius < 1 ? _Number(options.relativeInnerRadius) : .1;
- radius = area.radius;
- if (that._context.textEnabled) {
- that._textIndent = _round(_min(that._textIndent, radius / 2));
- radius -= that._textIndent
- }
- that._outerRadius = _floor(radius);
- that._innerRadius = _floor(radius * relativeInnerRadius);
- that._barSpacing = options.barSpacing > 0 ? _Number(options.barSpacing) : 0;
- _extend(that._context, {
- backgroundColor: options.backgroundColor,
- x: area.x,
- y: area.y,
- startAngle: area.startCoord,
- endAngle: area.endCoord,
- baseAngle: that._translator.translate(that._baseValue)
- });
- that._arrangeBars()
- },
- _arrangeBars: function() {
- var that = this;
- var radius = that._outerRadius - that._innerRadius;
- var context = that._context;
- var i;
- var count = that._bars.length;
- that._beginValueChanging();
- context.barSize = count > 0 ? _max((radius - (count - 1) * that._barSpacing) / count, 1) : 0;
- var spacing = count > 1 ? _max(_min((radius - count * context.barSize) / (count - 1), that._barSpacing), 0) : 0;
- var _count = _min(_floor((radius + spacing) / context.barSize), count);
- that._setBarsCount(count);
- radius = that._outerRadius;
- context.textRadius = radius;
- context.textIndent = that._textIndent;
- that._palette.reset();
- var unitOffset = context.barSize + spacing;
- var colors = that._palette.generateColors(_count);
- for (i = 0; i < _count; ++i, radius -= unitOffset) {
- that._bars[i].arrange({
- radius: radius,
- color: colors[i]
- })
- }
- for (var _i = _count; _i < count; _i++) {
- that._bars[_i].hide()
- }
- if (that._animationSettings && !that._noAnimation) {
- that._animateBars()
- } else {
- that._updateBars()
- }
- that._endValueChanging()
- },
- _setBarsCount: function() {
- var that = this;
- if (that._bars.length > 0) {
- if (that._dummyBackground) {
- that._dummyBackground.dispose();
- that._dummyBackground = null
- }
- } else {
- if (!that._dummyBackground) {
- that._dummyBackground = that._renderer.arc().attr({
- "stroke-linejoin": "round"
- })
- }
- that._dummyBackground.attr({
- x: that._context.x,
- y: that._context.y,
- outerRadius: that._outerRadius,
- innerRadius: that._innerRadius,
- startAngle: that._context.endAngle,
- endAngle: that._context.startAngle,
- fill: that._context.backgroundColor
- }).append(that._barsGroup)
- }
- },
- _updateBars: function() {
- this._bars.forEach(function(bar) {
- return bar.applyValue()
- });
- this._checkOverlap()
- },
- _checkOverlap: function() {
- var that = this;
- var bars = that._bars;
- var overlapStrategy = _normalizeEnum(that._getOption("resolveLabelOverlapping", true));
- if ("none" === overlapStrategy) {
- return
- }
- var sortedBars = bars.concat().sort(function(a, b) {
- return a.getValue() - b.getValue()
- });
- var currentIndex = 0;
- var nextIndex = 1;
- while (currentIndex < sortedBars.length && nextIndex < sortedBars.length) {
- var current = sortedBars[currentIndex];
- var next = sortedBars[nextIndex];
- if (current.checkIntersect(next)) {
- next.hideLabel();
- nextIndex++
- } else {
- currentIndex = nextIndex;
- nextIndex = currentIndex + 1
- }
- }
- },
- _animateBars: function() {
- var that = this;
- var i;
- var ii = that._bars.length;
- if (ii > 0) {
- for (i = 0; i < ii; ++i) {
- that._bars[i].beginAnimation()
- }
- that._barsGroup.animate({
- _: 0
- }, that._animationSettings)
- }
- },
- _buildNodes: function() {
- var that = this;
- var options = that._options;
- that._palette = that._themeManager.createPalette(options.palette, {
- useHighlight: true,
- extensionMode: options.paletteExtensionMode
- });
- that._palette.reset();
- that._bars = that._bars || [];
- that._animationSettings && that._barsGroup.stopAnimation();
- var barValues = that._values.filter(_isFinite);
- var count = barValues.length;
- if (that._bars.length > count) {
- var ii = that._bars.length;
- for (var i = count; i < ii; ++i) {
- that._bars[i].dispose()
- }
- that._bars.splice(count, ii - count)
- } else {
- if (that._bars.length < count) {
- for (var _i2 = that._bars.length; _i2 < count; ++_i2) {
- that._bars.push(new BarWrapper(_i2, that._context))
- }
- }
- }
- that._bars.forEach(function(bar, index) {
- bar.update({
- color: that._palette.getNextColor(count),
- value: barValues[index]
- })
- })
- },
- _updateValues: function(values) {
- var that = this;
- var list = _isArray(values) && values || _isFinite(values) && [values] || [];
- var i;
- var ii = list.length;
- var value;
- that._values.length = ii;
- for (i = 0; i < ii; ++i) {
- value = list[i];
- that._values[i] = value = _Number(_isFinite(value) ? value : that._values[i])
- }
- if (!that._resizing) {
- if (!_compareArrays(that._values, that.option(OPTION_VALUES))) {
- that.option(OPTION_VALUES, that._values.slice())
- }
- }
- this._change(["NODES"])
- },
- values: function(arg) {
- if (void 0 !== arg) {
- this._updateValues(arg);
- return this
- } else {
- return this._values.slice(0)
- }
- },
- _optionChangesMap: {
- backgroundColor: "MOSTLY_TOTAL",
- relativeInnerRadius: "MOSTLY_TOTAL",
- barSpacing: "MOSTLY_TOTAL",
- label: "MOSTLY_TOTAL",
- resolveLabelOverlapping: "MOSTLY_TOTAL",
- palette: "MOSTLY_TOTAL",
- paletteExtensionMode: "MOSTLY_TOTAL",
- values: "VALUES"
- },
- _change_VALUES: function() {
- this._updateValues(this.option(OPTION_VALUES))
- },
- _factory: objectUtils.clone(dxBaseGauge.prototype._factory),
- _optionChangesOrder: ["VALUES", "NODES"],
- _initialChanges: ["VALUES"],
- _change_NODES: function() {
- this._buildNodes()
- },
- _change_MOSTLY_TOTAL: function() {
- this._change(["NODES"]);
- this.callBase()
- },
- _proxyData: [],
- _getLegendData: function() {
- var that = this;
- var formatOptions = {};
- var options = that._options;
- var labelFormatOptions = (options.label || {}).format;
- var legendFormatOptions = (options.legend || {}).itemTextFormat;
- if (legendFormatOptions) {
- formatOptions.format = legendFormatOptions
- } else {
- formatOptions.format = labelFormatOptions || that._defaultFormatOptions
- }
- return (this._bars || []).map(function(b) {
- return {
- id: b.index,
- item: {
- value: b.getValue(),
- color: b.getColor(),
- index: b.index
- },
- text: _formatValue(b.getValue(), formatOptions),
- visible: true,
- states: {
- normal: {
- fill: b.getColor()
- }
- }
- }
- })
- }
- });
- var BarWrapper = function(index, context) {
- var that = this;
- that._context = context;
- that._tracker = context.renderer.arc().attr({
- "stroke-linejoin": "round"
- });
- that.index = index
- };
- _extend(BarWrapper.prototype, {
- dispose: function() {
- var that = this;
- that._background.dispose();
- that._bar.dispose();
- if (that._context.textEnabled) {
- that._line.dispose();
- that._text.dispose()
- }
- that._context.tracker.detach(that._tracker);
- that._context = that._settings = that._background = that._bar = that._line = that._text = that._tracker = null;
- return that
- },
- arrange: function(options) {
- var that = this;
- var context = that._context;
- this._visible = true;
- context.tracker.attach(that._tracker, that, {
- index: that.index
- });
- that._background = context.renderer.arc().attr({
- "stroke-linejoin": "round",
- fill: context.backgroundColor
- }).append(context.group);
- that._settings = that._settings || {
- x: context.x,
- y: context.y,
- startAngle: context.baseAngle,
- endAngle: context.baseAngle
- };
- that._bar = context.renderer.arc().attr(_extend({
- "stroke-linejoin": "round"
- }, that._settings)).append(context.group);
- if (context.textEnabled) {
- that._line = context.renderer.path([], "line").attr({
- "stroke-width": context.lineWidth
- }).append(context.group);
- that._text = context.renderer.text().css(context.fontStyles).attr(context.textOptions).append(context.group)
- }
- that._angle = isFinite(that._angle) ? that._angle : context.baseAngle;
- that._settings.outerRadius = options.radius;
- that._settings.innerRadius = options.radius - context.barSize;
- that._settings.x = context.x;
- that._settings.y = context.y;
- that._background.attr(_extend({}, that._settings, {
- startAngle: context.endAngle,
- endAngle: context.startAngle,
- fill: that._context.backgroundColor
- }));
- that._bar.attr({
- x: context.x,
- y: context.y,
- outerRadius: that._settings.outerRadius,
- innerRadius: that._settings.innerRadius,
- fill: that._color
- });
- that._tracker.attr(that._settings);
- if (context.textEnabled) {
- that._line.attr({
- points: [context.x, context.y - that._settings.innerRadius, context.x, context.y - context.textRadius - context.textIndent],
- stroke: context.lineColor || that._color
- }).sharp();
- that._text.css({
- fill: context.textColor || that._color
- })
- }
- return that
- },
- getTooltipParameters: function() {
- var that = this;
- var cosSin = _getCosAndSin((that._angle + that._context.baseAngle) / 2);
- return {
- x: _round(that._context.x + (that._settings.outerRadius + that._settings.innerRadius) / 2 * cosSin.cos),
- y: _round(that._context.y - (that._settings.outerRadius + that._settings.innerRadius) / 2 * cosSin.sin),
- offset: 0,
- color: that._color,
- value: that._value
- }
- },
- setAngle: function(angle) {
- var that = this;
- var context = that._context;
- var settings = that._settings;
- var cosSin;
- that._angle = angle;
- setAngles(settings, context.baseAngle, angle);
- that._bar.attr(settings);
- that._tracker.attr(settings);
- if (context.textEnabled) {
- cosSin = _getCosAndSin(angle);
- var indent = context.textIndent;
- var radius = context.textRadius + indent;
- var x = context.x + radius * cosSin.cos;
- var y = context.y - radius * cosSin.sin;
- var halfWidth = .5 * context.textWidth;
- var textHeight = context.textHeight;
- var textY = context.textY;
- if (_abs(x - context.x) > indent) {
- x += x < context.x ? -halfWidth : halfWidth
- }
- if (_abs(y - context.y) <= indent) {
- y -= textY + .5 * textHeight
- } else {
- y -= y < context.y ? textY + textHeight : textY
- }
- var text = _formatValue(that._value, context.formatOptions, {
- index: that.index
- });
- var visibility = "" === text ? "hidden" : null;
- that._text.attr({
- text: text,
- x: x,
- y: y,
- visibility: visibility
- });
- that._line.attr({
- visibility: visibility
- });
- that._line.rotate(_convertAngleToRendererSpace(angle), context.x, context.y)
- }
- return that
- },
- hideLabel: function() {
- this._text.attr({
- visibility: "hidden"
- });
- this._line.attr({
- visibility: "hidden"
- })
- },
- checkIntersect: function(anotherBar) {
- var coords = this.calculateLabelCoords();
- var anotherCoords = anotherBar.calculateLabelCoords();
- if (!coords || !anotherCoords) {
- return false
- }
- var width = Math.max(0, Math.min(coords.bottomRight.x, anotherCoords.bottomRight.x) - Math.max(coords.topLeft.x, anotherCoords.topLeft.x));
- var height = Math.max(0, Math.min(coords.bottomRight.y, anotherCoords.bottomRight.y) - Math.max(coords.topLeft.y, anotherCoords.topLeft.y));
- return width * height !== 0
- },
- calculateLabelCoords: function() {
- if (!this._text) {
- return
- }
- var box = this._text.getBBox();
- return {
- topLeft: {
- x: box.x,
- y: box.y
- },
- bottomRight: {
- x: box.x + box.width,
- y: box.y + box.height
- }
- }
- },
- _processValue: function(value) {
- return this._context.translator.translate(this._context.translator.adjust(value))
- },
- applyValue: function() {
- if (!this._visible) {
- return this
- }
- return this.setAngle(this._processValue(this.getValue()))
- },
- update: function(_ref) {
- var color = _ref.color,
- value = _ref.value;
- this._color = color;
- this._value = value
- },
- hide: function() {
- this._visible = false
- },
- getColor: function() {
- return this._color
- },
- getValue: function() {
- return this._value
- },
- beginAnimation: function() {
- if (!this._visible) {
- return this
- }
- var that = this;
- var angle = this._processValue(this.getValue());
- if (!compareFloats(that._angle, angle)) {
- that._start = that._angle;
- that._delta = angle - that._angle;
- that._tracker.attr({
- visibility: "hidden"
- });
- if (that._context.textEnabled) {
- that._line.attr({
- visibility: "hidden"
- });
- that._text.attr({
- visibility: "hidden"
- })
- }
- } else {
- that.animate = _noop;
- that.setAngle(that._angle)
- }
- },
- animate: function(pos) {
- if (!this._visible) {
- return this
- }
- var that = this;
- that._angle = that._start + that._delta * pos;
- setAngles(that._settings, that._context.baseAngle, that._angle);
- that._bar.attr(that._settings)
- },
- endAnimation: function() {
- var that = this;
- if (void 0 !== that._delta) {
- if (compareFloats(that._angle, that._start + that._delta)) {
- that._tracker.attr({
- visibility: null
- });
- that.setAngle(that._angle)
- }
- } else {
- delete that.animate
- }
- delete that._start;
- delete that._delta
- }
- });
- function setAngles(target, angle1, angle2) {
- target.startAngle = angle1 < angle2 ? angle1 : angle2;
- target.endAngle = angle1 < angle2 ? angle2 : angle1
- }
- function compareFloats(value1, value2) {
- return _abs(value1 - value2) < 1e-4
- }
- registerComponent("dxBarGauge", dxBarGauge);
- exports.dxBarGauge = dxBarGauge;
- dxBarGauge.addPlugin(__webpack_require__( /*! ../components/legend */ 201).plugin);
- var __BarWrapper = BarWrapper;
- exports.BarWrapper = __BarWrapper;
- exports.stubBarWrapper = function(barWrapperType) {
- BarWrapper = barWrapperType
- };
- exports.restoreBarWrapper = function() {
- BarWrapper = __BarWrapper
- }
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./range_selector/range_selector */ 804)
- },
- /*!*******************************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/range_selector.js ***!
- \*******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9);
- var _component_registrator2 = _interopRequireDefault(_component_registrator);
- var _type2 = __webpack_require__( /*! ../../core/utils/type */ 1);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
- var _math = __webpack_require__( /*! ../../core/utils/math */ 28);
- var _range = __webpack_require__( /*! ../translators/range */ 108);
- var _range2 = _interopRequireDefault(_range);
- var _base_axis = __webpack_require__( /*! ../axes/base_axis */ 204);
- var _base_axis2 = _interopRequireDefault(_base_axis);
- var _parse_utils = __webpack_require__( /*! ../components/parse_utils */ 244);
- var _parse_utils2 = _interopRequireDefault(_parse_utils);
- var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
- var _format_helper2 = _interopRequireDefault(_format_helper);
- var _common = __webpack_require__( /*! ./common */ 206);
- var _common2 = _interopRequireDefault(_common);
- var _sliders_controller = __webpack_require__( /*! ./sliders_controller */ 805);
- var _sliders_controller2 = _interopRequireDefault(_sliders_controller);
- var _tracker = __webpack_require__( /*! ./tracker */ 808);
- var _range_view = __webpack_require__( /*! ./range_view */ 809);
- var _range_view2 = _interopRequireDefault(_range_view);
- var _series_data_source = __webpack_require__( /*! ./series_data_source */ 810);
- var _series_data_source2 = _interopRequireDefault(_series_data_source);
- var _tick_generator = __webpack_require__( /*! ../axes/tick_generator */ 406);
- var _tick_generator2 = _interopRequireDefault(_tick_generator);
- var _base_widget = __webpack_require__( /*! ../core/base_widget */ 96);
- var _base_widget2 = _interopRequireDefault(_base_widget);
- var _export = __webpack_require__( /*! ../core/export */ 93);
- var _title = __webpack_require__( /*! ../core/title */ 105);
- var _loading_indicator = __webpack_require__( /*! ../core/loading_indicator */ 119);
- var _data_source = __webpack_require__( /*! ../core/data_source */ 144);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var _max = Math.max;
- var _ceil = Math.ceil;
- var _floor = Math.floor;
- var START_VALUE = "startValue";
- var END_VALUE = "endValue";
- var DATETIME = "datetime";
- var VALUE = "value";
- var DISCRETE = "discrete";
- var SEMIDISCRETE = "semidiscrete";
- var STRING = "string";
- var VALUE_CHANGED = VALUE + "Changed";
- var CONTAINER_BACKGROUND_COLOR = "containerBackgroundColor";
- var SLIDER_MARKER = "sliderMarker";
- var OPTION_BACKGROUND = "background";
- var LOGARITHMIC = "logarithmic";
- var KEEP = "keep";
- var SHIFT = "shift";
- var RESET = "reset";
- var INVISIBLE_POS = -1e3;
- var SEMIDISCRETE_GRID_SPACING_FACTOR = 50;
- var DEFAULT_AXIS_DIVISION_FACTOR = 30;
- var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 15;
- var logarithmBase = 10;
- function calculateMarkerHeight(renderer, value, sliderMarkerOptions) {
- var formattedText = void 0 === value ? _common2.default.consts.emptySliderMarkerText : _common2.default.formatValue(value, sliderMarkerOptions);
- var textBBox = getTextBBox(renderer, formattedText, sliderMarkerOptions.font);
- return _ceil(textBBox.height) + 2 * sliderMarkerOptions.paddingTopBottom + _common2.default.consts.pointerSize
- }
- function calculateScaleLabelHalfWidth(renderer, value, scaleOptions, tickIntervalsInfo) {
- var formattedText = _common2.default.formatValue(value, scaleOptions.label, tickIntervalsInfo, scaleOptions.valueType, scaleOptions.type, scaleOptions.logarithmBase);
- var textBBox = getTextBBox(renderer, formattedText, scaleOptions.label.font);
- return _ceil(textBBox.width / 2)
- }
- function calculateIndents(renderer, scale, sliderMarkerOptions, indentOptions, tickIntervalsInfo) {
- var leftScaleLabelWidth = 0;
- var rightScaleLabelWidth = 0;
- var placeholderWidthLeft;
- var placeholderWidthRight;
- var placeholderHeight;
- var ticks = "semidiscrete" === scale.type ? scale.customTicks : tickIntervalsInfo.ticks;
- indentOptions = indentOptions || {};
- placeholderWidthLeft = indentOptions.left;
- placeholderWidthRight = indentOptions.right;
- placeholderHeight = sliderMarkerOptions.placeholderHeight;
- if (sliderMarkerOptions.visible) {
- var leftMarkerHeight = calculateMarkerHeight(renderer, scale.startValue, sliderMarkerOptions);
- var rightMarkerHeight = calculateMarkerHeight(renderer, scale.endValue, sliderMarkerOptions);
- if (void 0 === placeholderHeight) {
- placeholderHeight = _max(leftMarkerHeight, rightMarkerHeight)
- }
- }
- if (scale.label.visible) {
- var startTickValue = (0, _type2.isDefined)(scale.startValue) ? ticks[0] : void 0;
- var endTickValue = (0, _type2.isDefined)(scale.endValue) ? ticks[ticks.length - 1] : void 0;
- leftScaleLabelWidth = calculateScaleLabelHalfWidth(renderer, startTickValue, scale, tickIntervalsInfo);
- rightScaleLabelWidth = calculateScaleLabelHalfWidth(renderer, endTickValue, scale, tickIntervalsInfo)
- }
- placeholderWidthLeft = void 0 !== placeholderWidthLeft ? placeholderWidthLeft : leftScaleLabelWidth;
- placeholderWidthRight = (void 0 !== placeholderWidthRight ? placeholderWidthRight : rightScaleLabelWidth) || 1;
- return {
- left: placeholderWidthLeft,
- right: placeholderWidthRight,
- top: placeholderHeight || 0,
- bottom: 0
- }
- }
- function calculateValueType(firstValue, secondValue) {
- var typeFirstValue = (0, _type2.type)(firstValue);
- var typeSecondValue = (0, _type2.type)(secondValue);
- var validType = function(type) {
- return typeFirstValue === type || typeSecondValue === type
- };
- return validType("date") ? DATETIME : validType("number") ? "numeric" : validType(STRING) ? STRING : ""
- }
- function showScaleMarkers(scaleOptions) {
- return scaleOptions.valueType === DATETIME && scaleOptions.marker.visible
- }
- function updateTranslatorRangeInterval(translatorRange, scaleOptions) {
- var intervalX = scaleOptions.minorTickInterval || scaleOptions.tickInterval;
- if ("datetime" === scaleOptions.valueType) {
- intervalX = (0, _date.dateToMilliseconds)(intervalX)
- }
- translatorRange.addRange({
- interval: intervalX
- })
- }
- function checkLogarithmicOptions(options, defaultLogarithmBase, incidentOccurred) {
- if (!options) {
- return
- }
- var logarithmBase = options.logarithmBase;
- if (options.type === LOGARITHMIC && logarithmBase <= 0 || logarithmBase && !(0, _type2.isNumeric)(logarithmBase)) {
- options.logarithmBase = defaultLogarithmBase;
- incidentOccurred("E2104")
- } else {
- if (options.type !== LOGARITHMIC) {
- options.logarithmBase = void 0
- }
- }
- }
- function calculateScaleAreaHeight(renderer, scaleOptions, visibleMarkers, tickIntervalsInfo) {
- var labelScaleOptions = scaleOptions.label;
- var markerScaleOptions = scaleOptions.marker;
- var placeholderHeight = scaleOptions.placeholderHeight;
- var ticks = "semidiscrete" === scaleOptions.type ? scaleOptions.customTicks : tickIntervalsInfo.ticks;
- var text = _common2.default.formatValue(ticks[0], labelScaleOptions);
- if (placeholderHeight) {
- return placeholderHeight
- } else {
- return (labelScaleOptions.visible ? labelScaleOptions.topIndent + getTextBBox(renderer, text, labelScaleOptions.font).height : 0) + (visibleMarkers ? markerScaleOptions.topIndent + markerScaleOptions.separatorHeight : 0)
- }
- }
- function getMinorTickIntervalUnit(tickInterval, minorTickInterval, withCorrection) {
- var interval = (0, _date.getDateUnitInterval)(minorTickInterval);
- var majorUnit = (0, _date.getDateUnitInterval)(tickInterval);
- var idx = _date.dateUnitIntervals.indexOf(interval);
- if (withCorrection && interval === majorUnit && idx > 0) {
- interval = _date.dateUnitIntervals[idx - 1]
- }
- return interval
- }
- function getNextTickInterval(tickInterval, minorTickInterval, isDateType) {
- if (!tickInterval) {
- tickInterval = minorTickInterval
- } else {
- if (isDateType) {
- tickInterval = (0, _date.getNextDateUnit)(tickInterval)
- } else {
- tickInterval += minorTickInterval
- }
- }
- return tickInterval
- }
- function calculateTickIntervalsForSemidiscreteScale(scaleOptions, min, max, screenDelta) {
- var minorTickInterval = scaleOptions.minorTickInterval;
- var tickInterval = scaleOptions.tickInterval;
- var interval;
- var isDateType = "datetime" === scaleOptions.valueType;
- var gridSpacingFactor = scaleOptions.axisDivisionFactor || {};
- var tickCountByInterval;
- var tickCountByScreen;
- if (!tickInterval) {
- do {
- interval = getNextTickInterval(tickInterval, minorTickInterval, isDateType);
- if (tickInterval !== interval) {
- tickInterval = interval
- } else {
- break
- }
- if (isDateType) {
- interval = (0, _date.dateToMilliseconds)(tickInterval)
- }
- tickCountByInterval = _ceil((max - min) / interval);
- tickCountByScreen = _floor(screenDelta / (gridSpacingFactor[tickInterval] || SEMIDISCRETE_GRID_SPACING_FACTOR)) || 1
- } while (interval && tickCountByInterval > tickCountByScreen)
- }
- return {
- tickInterval: tickInterval,
- minorTickInterval: minorTickInterval,
- bounds: {
- minVisible: min,
- maxVisible: max
- },
- ticks: []
- }
- }
- function updateTickIntervals(scaleOptions, screenDelta, incidentOccurred, range) {
- var result;
- var min = (0, _type2.isDefined)(range.minVisible) ? range.minVisible : range.min;
- var max = (0, _type2.isDefined)(range.maxVisible) ? range.maxVisible : range.max;
- var categoriesInfo = scaleOptions._categoriesInfo;
- var bounds = {};
- if (scaleOptions.type === SEMIDISCRETE) {
- result = calculateTickIntervalsForSemidiscreteScale(scaleOptions, min, max, screenDelta)
- } else {
- var ticksInfo = _tick_generator2.default.tickGenerator({
- axisType: scaleOptions.type,
- dataType: scaleOptions.valueType,
- logBase: scaleOptions.logarithmBase,
- axisDivisionFactor: scaleOptions.axisDivisionFactor,
- minorAxisDivisionFactor: scaleOptions.minorAxisDivisionFactor,
- calculateMinors: true,
- allowDecimals: scaleOptions.allowDecimals,
- endOnTick: scaleOptions.endOnTick,
- incidentOccurred: incidentOccurred,
- rangeIsEmpty: range.isEmpty()
- })({
- min: min,
- max: max,
- categories: (0, _type2.isDefined)(categoriesInfo) ? categoriesInfo.categories : []
- }, screenDelta, scaleOptions.tickInterval, scaleOptions.forceUserTickInterval, void 0, scaleOptions.minorTickInterval, scaleOptions.minorTickCount);
- var length = ticksInfo.ticks.length;
- bounds.minVisible = ticksInfo.ticks[0] < min ? ticksInfo.ticks[0] : min;
- bounds.maxVisible = ticksInfo.ticks[length - 1] > max ? ticksInfo.ticks[length - 1] : max;
- result = {
- tickInterval: ticksInfo.tickInterval,
- minorTickInterval: 0 === scaleOptions.minorTickInterval ? 0 : ticksInfo.minorTickInterval,
- bounds: bounds,
- ticks: ticksInfo.ticks
- }
- }
- return result
- }
- function calculateTranslatorRange(seriesDataSource, scaleOptions) {
- var minValue;
- var maxValue;
- var inverted = false;
- var startValue = scaleOptions.startValue;
- var endValue = scaleOptions.endValue;
- var categories;
- var categoriesInfo;
- var translatorRange = seriesDataSource ? seriesDataSource.getBoundRange().arg : new _range2.default.Range;
- var isDate = "datetime" === scaleOptions.valueType;
- var minRange = scaleOptions.minRange;
- if (scaleOptions.type === DISCRETE) {
- var rangeForCategories = new _range2.default.Range({
- minVisible: startValue,
- maxVisible: endValue
- });
- rangeForCategories.addRange(translatorRange);
- translatorRange = rangeForCategories;
- categories = seriesDataSource ? seriesDataSource.argCategories : scaleOptions.categories || !seriesDataSource && startValue && endValue && [startValue, endValue];
- categories = categories || [];
- scaleOptions._categoriesInfo = categoriesInfo = (0, _utils.getCategoriesInfo)(categories, startValue, endValue)
- }
- if (scaleOptions.type === SEMIDISCRETE) {
- startValue = scaleOptions.startValue = correctValueByInterval(scaleOptions.startValue, isDate, minRange);
- endValue = scaleOptions.endValue = correctValueByInterval(scaleOptions.endValue, isDate, minRange);
- translatorRange.minVisible = correctValueByInterval(translatorRange.minVisible, isDate, minRange);
- translatorRange.maxVisible = correctValueByInterval(translatorRange.maxVisible, isDate, minRange);
- translatorRange.min = correctValueByInterval(translatorRange.min, isDate, minRange);
- translatorRange.max = correctValueByInterval(translatorRange.max, isDate, minRange)
- }
- if ((0, _type2.isDefined)(startValue) && (0, _type2.isDefined)(endValue)) {
- inverted = categoriesInfo ? categoriesInfo.inverted : startValue > endValue;
- minValue = categoriesInfo ? categoriesInfo.start : inverted ? endValue : startValue;
- maxValue = categoriesInfo ? categoriesInfo.end : inverted ? startValue : endValue
- } else {
- if ((0, _type2.isDefined)(startValue) || (0, _type2.isDefined)(endValue)) {
- minValue = startValue;
- maxValue = endValue
- } else {
- if (categoriesInfo) {
- minValue = categoriesInfo.start;
- maxValue = categoriesInfo.end
- }
- }
- }
- translatorRange.addRange({
- invert: inverted,
- min: minValue,
- max: maxValue,
- minVisible: minValue,
- maxVisible: maxValue,
- dataType: scaleOptions.valueType
- });
- translatorRange.addRange({
- categories: !seriesDataSource ? categories : void 0,
- base: scaleOptions.logarithmBase,
- axisType: scaleOptions.type,
- dataType: scaleOptions.valueType
- });
- seriesDataSource && translatorRange.sortCategories(categories);
- return translatorRange
- }
- function startEndNotDefined(start, end) {
- return !(0, _type2.isDefined)(start) || !(0, _type2.isDefined)(end)
- }
- function getTextBBox(renderer, text, fontOptions) {
- var textElement = renderer.text(text, INVISIBLE_POS, INVISIBLE_POS).css((0, _utils.patchFontOptions)(fontOptions)).append(renderer.root);
- var textBBox = textElement.getBBox();
- textElement.remove();
- return textBBox
- }
- function getDateMarkerVisibilityChecker(screenDelta) {
- return function(isDateScale, isMarkerVisible, min, max, tickInterval) {
- if (isMarkerVisible && isDateScale) {
- if (!(0, _type2.isDefined)(tickInterval) || tickInterval.years || tickInterval.months >= 6 || screenDelta / SEMIDISCRETE_GRID_SPACING_FACTOR < _ceil((max - min) / (0, _date.dateToMilliseconds)("year")) + 1) {
- isMarkerVisible = false
- }
- }
- return isMarkerVisible
- }
- }
- function updateScaleOptions(scaleOptions, seriesDataSource, translatorRange, tickIntervalsInfo, checkDateMarkerVisibility) {
- var isEmptyInterval;
- var categoriesInfo = scaleOptions._categoriesInfo;
- var isDateTime = scaleOptions.valueType === DATETIME;
- if (seriesDataSource && !seriesDataSource.isEmpty() && !translatorRange.isEmpty()) {
- var bounds = tickIntervalsInfo.bounds;
- translatorRange.addRange(bounds);
- scaleOptions.startValue = translatorRange.invert ? bounds.maxVisible : bounds.minVisible;
- scaleOptions.endValue = translatorRange.invert ? bounds.minVisible : bounds.maxVisible
- }
- scaleOptions.marker.visible = checkDateMarkerVisibility(isDateTime && scaleOptions.type.indexOf(DISCRETE) === -1, scaleOptions.marker.visible, scaleOptions.startValue, scaleOptions.endValue, tickIntervalsInfo.tickInterval);
- if (categoriesInfo) {
- scaleOptions.startValue = categoriesInfo.start;
- scaleOptions.endValue = categoriesInfo.end
- }
- if (scaleOptions.type.indexOf(DISCRETE) === -1) {
- isEmptyInterval = (0, _type2.isDate)(scaleOptions.startValue) && (0, _type2.isDate)(scaleOptions.endValue) && scaleOptions.startValue.getTime() === scaleOptions.endValue.getTime() || scaleOptions.startValue === scaleOptions.endValue
- }
- scaleOptions.isEmpty = startEndNotDefined(scaleOptions.startValue, scaleOptions.endValue) || isEmptyInterval;
- if (scaleOptions.isEmpty) {
- scaleOptions.startValue = scaleOptions.endValue = void 0
- } else {
- scaleOptions.minorTickInterval = tickIntervalsInfo.minorTickInterval;
- scaleOptions.tickInterval = tickIntervalsInfo.tickInterval;
- if (isDateTime && (!(0, _type2.isDefined)(scaleOptions.label.format) || scaleOptions.type === SEMIDISCRETE && scaleOptions.minorTickInterval !== scaleOptions.tickInterval)) {
- if (scaleOptions.type === DISCRETE) {
- scaleOptions.label.format = _format_helper2.default.getDateFormatByTicks(tickIntervalsInfo.ticks)
- } else {
- if (!scaleOptions.marker.visible) {
- scaleOptions.label.format = _format_helper2.default.getDateFormatByTickInterval(scaleOptions.startValue, scaleOptions.endValue, scaleOptions.tickInterval)
- } else {
- scaleOptions.label.format = (0, _date.getDateFormatByTickInterval)(scaleOptions.tickInterval)
- }
- }
- }
- }
- if (scaleOptions.type === SEMIDISCRETE) {
- var intervals = getIntervalCustomTicks(scaleOptions);
- scaleOptions.customMinorTicks = intervals.altIntervals;
- scaleOptions.customTicks = intervals.intervals;
- scaleOptions.customBoundTicks = [scaleOptions.customTicks[0]]
- }
- }
- function prepareScaleOptions(scaleOption, calculatedValueType, incidentOccurred, containerColor) {
- var parsedValue = 0;
- var valueType = _parse_utils2.default.correctValueType((0, _utils.normalizeEnum)(scaleOption.valueType));
- var validateStartEndValues = function(field, parser) {
- var messageToIncidentOccurred = field === START_VALUE ? "start" : "end";
- if ((0, _type2.isDefined)(scaleOption[field])) {
- parsedValue = parser(scaleOption[field]);
- if ((0, _type2.isDefined)(parsedValue)) {
- scaleOption[field] = parsedValue
- } else {
- scaleOption[field] = void 0;
- incidentOccurred("E2202", [messageToIncidentOccurred])
- }
- }
- };
- valueType = calculatedValueType || valueType;
- if (!valueType) {
- valueType = calculateValueType(scaleOption.startValue, scaleOption.endValue) || "numeric"
- }
- if (valueType === STRING || scaleOption.categories) {
- scaleOption.type = DISCRETE;
- valueType = STRING
- }
- scaleOption.containerColor = containerColor;
- scaleOption.valueType = valueType;
- scaleOption.dataType = valueType;
- var parser = _parse_utils2.default.getParser(valueType);
- validateStartEndValues(START_VALUE, parser);
- validateStartEndValues(END_VALUE, parser);
- checkLogarithmicOptions(scaleOption, logarithmBase, incidentOccurred);
- if (!scaleOption.type) {
- scaleOption.type = "continuous"
- }
- scaleOption.parser = parser;
- if (scaleOption.type === SEMIDISCRETE) {
- scaleOption.minorTick.visible = false;
- scaleOption.minorTickInterval = scaleOption.minRange;
- scaleOption.marker.visible = false;
- scaleOption.maxRange = void 0
- }
- scaleOption.forceUserTickInterval |= (0, _type2.isDefined)(scaleOption.tickInterval) && !(0, _type2.isDefined)(scaleOption.axisDivisionFactor);
- scaleOption.axisDivisionFactor = (0, _type2.isDefined)(scaleOption.axisDivisionFactor) ? scaleOption.axisDivisionFactor : DEFAULT_AXIS_DIVISION_FACTOR;
- scaleOption.minorAxisDivisionFactor = (0, _type2.isDefined)(scaleOption.minorAxisDivisionFactor) ? scaleOption.minorAxisDivisionFactor : DEFAULT_MINOR_AXIS_DIVISION_FACTOR;
- return scaleOption
- }
- function correctValueByInterval(value, isDate, interval) {
- if ((0, _type2.isDefined)(value)) {
- value = isDate ? (0, _date.correctDateWithUnitBeginning)(new Date(value), interval) : (0, _math.adjust)(_floor((0, _math.adjust)(value / interval)) * interval)
- }
- return value
- }
- function getIntervalCustomTicks(options) {
- var min = options.startValue;
- var max = options.endValue;
- var isDate = "datetime" === options.valueType;
- var tickInterval = options.tickInterval;
- var res = {
- intervals: []
- };
- if (!(0, _type2.isDefined)(min) || !(0, _type2.isDefined)(max)) {
- return res
- }
- res.intervals = (0, _date.getSequenceByInterval)(min, max, options.minorTickInterval);
- if (tickInterval !== options.minorTickInterval) {
- res.altIntervals = res.intervals;
- min = correctValueByInterval(min, isDate, tickInterval);
- max = correctValueByInterval(max, isDate, tickInterval);
- res.intervals = (0, _date.getSequenceByInterval)(min, max, tickInterval);
- res.intervals[0] = res.altIntervals[0]
- }
- return res
- }
- function getPrecisionForSlider(startValue, endValue, screenDelta) {
- var d = Math.abs(endValue - startValue) / screenDelta;
- var tail = d - _floor(d);
- return tail > 0 ? _ceil(Math.abs((0, _math.adjust)((0, _utils.getLog)(tail, 10)))) : 0
- }
- var dxRangeSelector = _base_widget2.default.inherit({
- _toggleParentsScrollSubscription: function() {},
- _eventsMap: {
- onValueChanged: {
- name: VALUE_CHANGED
- }
- },
- _setDeprecatedOptions: function() {
- this.callBase.apply(this, arguments);
- (0, _extend.extend)(this._deprecatedOptions, {
- "chart.barWidth": {
- since: "18.1",
- message: "Use the 'chart.commonSeriesSettings.barPadding' or 'chart.series.barPadding' option instead"
- },
- "chart.equalBarWidth": {
- since: "18.1",
- message: "Use the 'chart.commonSeriesSettings.ignoreEmptyPoints' or 'chart.series.ignoreEmptyPoints' option instead"
- },
- "chart.useAggregation": {
- since: "18.1",
- message: "Use the 'chart.commonSeriesSettings.aggregation.enabled' or 'chart.series.aggregation.enabled' option instead"
- }
- })
- },
- _rootClassPrefix: "dxrs",
- _rootClass: "dxrs-range-selector",
- _dataIsReady: function() {
- return this._dataIsLoaded()
- },
- _initialChanges: ["DATA_SOURCE", "VALUE"],
- _themeDependentChanges: ["MOSTLY_TOTAL"],
- _themeSection: "rangeSelector",
- _fontFields: ["scale.label.font", "sliderMarker.font"],
- _initCore: function() {
- var that = this;
- var renderer = that._renderer;
- var root = renderer.root;
- root.css({
- "touch-action": "pan-y"
- });
- that._clipRect = renderer.clipRect();
- var rangeViewGroup = renderer.g().attr({
- "class": "dxrs-view"
- }).append(root);
- var slidersGroup = renderer.g().attr({
- "class": "dxrs-slidersContainer",
- "clip-path": that._clipRect.id
- }).append(root);
- var scaleGroup = renderer.g().attr({
- "class": "dxrs-scale",
- "clip-path": that._clipRect.id
- }).append(root);
- var scaleBreaksGroup = renderer.g().attr({
- "class": "dxrs-scale-breaks"
- }).append(root);
- var trackersGroup = renderer.g().attr({
- "class": "dxrs-trackers"
- }).append(root);
- that._axis = new AxisWrapper({
- renderer: renderer,
- root: scaleGroup,
- scaleBreaksGroup: scaleBreaksGroup,
- updateSelectedRange: function(range, e) {
- that.setValue((0, _utils.convertVisualRangeObject)(range), e)
- },
- incidentOccurred: that._incidentOccurred
- });
- that._rangeView = new _range_view2.default.RangeView({
- renderer: renderer,
- root: rangeViewGroup,
- translator: that._axis.getTranslator()
- });
- that._slidersController = new _sliders_controller2.default.SlidersController({
- renderer: renderer,
- root: slidersGroup,
- trackersGroup: trackersGroup,
- updateSelectedRange: function(range, lastSelectedRange, e) {
- if (!that._rangeOption) {
- that.option(VALUE, (0, _utils.convertVisualRangeObject)(range, (0, _type2.isPlainObject)(that._options[VALUE])))
- }
- that._eventTrigger(VALUE_CHANGED, {
- value: (0, _utils.convertVisualRangeObject)(range),
- previousValue: (0, _utils.convertVisualRangeObject)(lastSelectedRange),
- event: e
- })
- },
- axis: that._axis,
- translator: that._axis.getTranslator()
- });
- that._tracker = new _tracker.Tracker({
- renderer: renderer,
- controller: that._slidersController
- })
- },
- _getDefaultSize: function() {
- return {
- width: 400,
- height: 160
- }
- },
- _disposeCore: function() {
- this._axis.dispose();
- this._slidersController.dispose();
- this._tracker.dispose()
- },
- _applySize: function(rect) {
- this._clientRect = rect.slice();
- this._change(["MOSTLY_TOTAL"])
- },
- _optionChangesMap: {
- scale: "SCALE",
- value: "VALUE",
- dataSource: "DATA_SOURCE"
- },
- _optionChangesOrder: ["SCALE", "DATA_SOURCE"],
- _change_SCALE: function() {
- this._change(["MOSTLY_TOTAL"])
- },
- _setValueByDataSource: function() {
- var that = this;
- var options = that._options;
- var axis = that._axis;
- if (options.dataSource) {
- var selectedRangeUpdateMode = that.option("selectedRangeUpdateMode");
- var value = that.getValue();
- var valueIsReady = (0, _type2.isDefined)(value[0]) && (0, _type2.isDefined)(value[1]);
- if ((0, _type2.isDefined)(selectedRangeUpdateMode)) {
- selectedRangeUpdateMode = (0, _utils.normalizeEnum)(selectedRangeUpdateMode);
- that.__skipAnimation = true
- } else {
- if (valueIsReady) {
- selectedRangeUpdateMode = RESET
- }
- }
- if ("auto" === selectedRangeUpdateMode && valueIsReady) {
- var rangesInfo = axis.allScaleSelected(value);
- if (rangesInfo.startValue && rangesInfo.endValue) {
- selectedRangeUpdateMode = RESET
- } else {
- if (rangesInfo.endValue) {
- selectedRangeUpdateMode = SHIFT
- } else {
- selectedRangeUpdateMode = KEEP
- }
- }
- }
- if (selectedRangeUpdateMode === RESET) {
- options[VALUE] = null
- } else {
- if (selectedRangeUpdateMode === SHIFT && valueIsReady) {
- var _value = that.getValue();
- that.__skipAnimation = true;
- options[VALUE] = {
- length: axis.getVisualRangeLength({
- minVisible: _value[0],
- maxVisible: _value[1]
- })
- }
- } else {
- if (selectedRangeUpdateMode === KEEP) {
- that.__skipAnimation = true
- }
- }
- }
- }
- },
- _change_DATA_SOURCE: function() {
- if (this._options.dataSource) {
- this._updateDataSource()
- }
- },
- _customChangesOrder: ["MOSTLY_TOTAL", "VALUE", "SLIDER_SELECTION"],
- _change_MOSTLY_TOTAL: function() {
- this._applyMostlyTotalChange()
- },
- _change_SLIDER_SELECTION: function() {
- var that = this;
- var value = that._options[VALUE];
- that._slidersController.setSelectedRange(value && (0, _utils.getVizRangeObject)(value))
- },
- _change_VALUE: function() {
- var that = this;
- var option = that._rangeOption;
- if (option) {
- that._options[VALUE] = option;
- that.setValue(option)
- }
- },
- _validateRange: function(start, end) {
- var that = this;
- var translator = that._axis.getTranslator();
- if ((0, _type2.isDefined)(start) && !translator.isValid(start) || (0, _type2.isDefined)(end) && !translator.isValid(end)) {
- that._incidentOccurred("E2203")
- }
- },
- _applyChanges: function() {
- var that = this;
- var value = that._options[VALUE];
- if (that._changes.has("VALUE") && value) {
- that._rangeOption = value
- }
- that.callBase.apply(that, arguments);
- that._rangeOption = null;
- that.__isResizing = that.__skipAnimation = false
- },
- _applyMostlyTotalChange: function() {
- var that = this;
- var renderer = that._renderer;
- var rect = that._clientRect;
- var currentAnimationEnabled;
- var canvas = {
- left: rect[0],
- top: rect[1],
- width: rect[2] - rect[0],
- height: rect[3] - rect[1]
- };
- if (that.__isResizing || that.__skipAnimation) {
- currentAnimationEnabled = renderer.animationEnabled();
- renderer.updateAnimationOptions({
- enabled: false
- })
- }
- that._clipRect.attr({
- x: rect[0],
- y: rect[1],
- width: rect[2] - rect[0],
- height: rect[3] - rect[1]
- });
- that._axis.getTranslator().update(new _range2.default.Range, canvas, {
- isHorizontal: true
- });
- that._updateContent({
- left: rect[0],
- top: rect[1],
- width: rect[2] - rect[0],
- height: rect[3] - rect[1]
- });
- if (that.__isResizing || that.__skipAnimation) {
- renderer.updateAnimationOptions({
- enabled: currentAnimationEnabled
- })
- }
- that._drawn()
- },
- _dataSourceChangedHandler: function() {
- this._setValueByDataSource();
- this._requestChange(["MOSTLY_TOTAL"])
- },
- _completeSeriesDataSourceCreation: function(scaleOptions, seriesDataSource) {
- var rect = this._clientRect;
- var canvas = {
- left: rect[0],
- top: rect[1],
- width: rect[2] - rect[0],
- height: rect[3] - rect[1]
- };
- this._axis.updateOptions((0, _extend.extend)({}, scaleOptions, {
- isHorizontal: true,
- label: {}
- }));
- seriesDataSource.isShowChart() && this._axis.setMarginOptions(seriesDataSource.getMarginOptions(canvas));
- this._axis.updateCanvas(canvas);
- seriesDataSource.createPoints()
- },
- _updateContent: function(canvas) {
- var that = this;
- var chartOptions = that.option("chart");
- var seriesDataSource = that._createSeriesDataSource(chartOptions);
- var isCompactMode = !(seriesDataSource && seriesDataSource.isShowChart() || that.option("background.image.url"));
- var scaleOptions = prepareScaleOptions(that._getOption("scale"), seriesDataSource && seriesDataSource.getCalculatedValueType(), that._incidentOccurred, this._getOption("containerBackgroundColor", true));
- seriesDataSource && that._completeSeriesDataSourceCreation(scaleOptions, seriesDataSource);
- var argTranslatorRange = calculateTranslatorRange(seriesDataSource, scaleOptions);
- var tickIntervalsInfo = updateTickIntervals(scaleOptions, canvas.width, that._incidentOccurred, argTranslatorRange);
- var chartThemeManager = seriesDataSource && seriesDataSource.isShowChart() && seriesDataSource.getThemeManager();
- if (chartThemeManager) {
- checkLogarithmicOptions(chartOptions && chartOptions.valueAxis, chartThemeManager.getOptions("valueAxis").logarithmBase, that._incidentOccurred)
- }
- updateScaleOptions(scaleOptions, seriesDataSource, argTranslatorRange, tickIntervalsInfo, getDateMarkerVisibilityChecker(canvas.width));
- updateTranslatorRangeInterval(argTranslatorRange, scaleOptions);
- var sliderMarkerOptions = that._prepareSliderMarkersOptions(scaleOptions, canvas.width, tickIntervalsInfo, argTranslatorRange);
- var indents = calculateIndents(that._renderer, scaleOptions, sliderMarkerOptions, that.option("indent"), tickIntervalsInfo);
- var rangeContainerCanvas = {
- left: canvas.left + indents.left,
- top: canvas.top + indents.top,
- width: canvas.left + indents.left + _max(canvas.width - indents.left - indents.right, 1),
- height: _max(!isCompactMode ? canvas.height - indents.top - indents.bottom - calculateScaleAreaHeight(that._renderer, scaleOptions, showScaleMarkers(scaleOptions), tickIntervalsInfo) : _common2.default.HEIGHT_COMPACT_MODE, 0),
- right: 0,
- bottom: 0
- };
- that._axis.update(scaleOptions, isCompactMode, rangeContainerCanvas, argTranslatorRange, seriesDataSource);
- scaleOptions.minorTickInterval = scaleOptions.isEmpty ? 0 : scaleOptions.minorTickInterval;
- that._updateElements(scaleOptions, sliderMarkerOptions, isCompactMode, rangeContainerCanvas, seriesDataSource);
- if (chartThemeManager) {
- chartThemeManager.dispose()
- }
- },
- _updateElements: function(scaleOptions, sliderMarkerOptions, isCompactMode, canvas, seriesDataSource) {
- var that = this;
- var behavior = that._getOption("behavior");
- var shutterOptions = that._getOption("shutter");
- var isNotSemiDiscrete = scaleOptions.type !== SEMIDISCRETE;
- shutterOptions.color = shutterOptions.color || that._getOption(CONTAINER_BACKGROUND_COLOR, true);
- that._rangeView.update(that.option("background"), that._themeManager.theme("background"), canvas, isCompactMode, behavior.animationEnabled && that._renderer.animationEnabled(), seriesDataSource);
- that._isUpdating = true;
- that._slidersController.update([canvas.top, canvas.top + canvas.height], behavior, isCompactMode, that._getOption("sliderHandle"), sliderMarkerOptions, shutterOptions, {
- minRange: isNotSemiDiscrete ? that.option("scale.minRange") : void 0,
- maxRange: isNotSemiDiscrete ? that.option("scale.maxRange") : void 0
- }, that._axis.getFullTicks(), that._getOption("selectedRangeColor", true));
- that._requestChange(["SLIDER_SELECTION"]);
- that._isUpdating = false;
- that._tracker.update(!that._axis.getTranslator().getBusinessRange().isEmpty(), behavior)
- },
- _createSeriesDataSource: function(chartOptions) {
- var that = this;
- var seriesDataSource;
- var dataSource = that._dataSourceItems();
- var scaleOptions = that._getOption("scale");
- var valueType = scaleOptions.valueType || calculateValueType(scaleOptions.startValue, scaleOptions.endValue);
- var valueAxis = new _base_axis2.default.Axis({
- renderer: that._renderer,
- axisType: "xyAxes",
- drawingType: "linear"
- });
- valueAxis.updateOptions({
- isHorizontal: false,
- label: {},
- categoriesSortingMethod: that._getOption("chart").valueAxis.categoriesSortingMethod
- });
- if (dataSource || chartOptions && chartOptions.series) {
- chartOptions = (0, _extend.extend)({}, chartOptions, {
- theme: that.option("theme")
- });
- seriesDataSource = new _series_data_source2.default.SeriesDataSource({
- renderer: that._renderer,
- dataSource: dataSource,
- valueType: (0, _utils.normalizeEnum)(valueType),
- axisType: scaleOptions.type,
- chart: chartOptions,
- dataSourceField: that.option("dataSourceField"),
- incidentOccurred: that._incidentOccurred,
- categories: scaleOptions.categories,
- argumentAxis: that._axis,
- valueAxis: valueAxis
- })
- }
- return seriesDataSource
- },
- _prepareSliderMarkersOptions: function(scaleOptions, screenDelta, tickIntervalsInfo, argRange) {
- var that = this;
- var minorTickInterval = tickIntervalsInfo.minorTickInterval;
- var tickInterval = tickIntervalsInfo.tickInterval;
- var interval = tickInterval;
- var endValue = scaleOptions.endValue;
- var startValue = scaleOptions.startValue;
- var sliderMarkerOptions = that._getOption(SLIDER_MARKER);
- var doNotSnap = !that._getOption("behavior").snapToTicks;
- var isTypeDiscrete = scaleOptions.type === DISCRETE;
- var isValueTypeDatetime = scaleOptions.valueType === DATETIME;
- sliderMarkerOptions.borderColor = that._getOption(CONTAINER_BACKGROUND_COLOR, true);
- if (!sliderMarkerOptions.format && !argRange.isEmpty()) {
- if (doNotSnap && (0, _type2.isNumeric)(scaleOptions.startValue)) {
- sliderMarkerOptions.format = {
- type: "fixedPoint",
- precision: getPrecisionForSlider(startValue, endValue, screenDelta)
- }
- }
- if (isValueTypeDatetime && !isTypeDiscrete) {
- if ((0, _type2.isDefined)(minorTickInterval) && 0 !== minorTickInterval) {
- interval = getMinorTickIntervalUnit(tickInterval, minorTickInterval, doNotSnap)
- }
- if (!scaleOptions.marker.visible) {
- if ((0, _type2.isDefined)(startValue) && (0, _type2.isDefined)(endValue)) {
- sliderMarkerOptions.format = _format_helper2.default.getDateFormatByTickInterval(startValue, endValue, interval)
- }
- } else {
- sliderMarkerOptions.format = (0, _date.getDateFormatByTickInterval)(interval)
- }
- }
- if (isValueTypeDatetime && isTypeDiscrete && tickIntervalsInfo.ticks.length) {
- sliderMarkerOptions.format = _format_helper2.default.getDateFormatByTicks(tickIntervalsInfo.ticks)
- }
- }
- return sliderMarkerOptions
- },
- getValue: function() {
- return (0, _utils.convertVisualRangeObject)(this._slidersController.getSelectedRange())
- },
- setValue: function(value, e) {
- var visualRange = (0, _utils.getVizRangeObject)(value);
- if (!this._isUpdating && value) {
- this._validateRange(visualRange.startValue, visualRange.endValue);
- var current = this._slidersController.getSelectedRange();
- if (!current || current.startValue !== visualRange.startValue || current.endValue !== visualRange.endValue) {
- this._slidersController.setSelectedRange((0, _utils.getVizRangeObject)(value), e)
- }
- }
- },
- _setContentSize: function() {
- this.__isResizing = 2 === this._changes.count();
- this.callBase.apply(this, arguments)
- }
- });
- (0, _iterator.each)(["selectedRangeColor", "containerBackgroundColor", "sliderMarker", "sliderHandle", "shutter", OPTION_BACKGROUND, "behavior", "chart", "indent"], function(_, name) {
- dxRangeSelector.prototype._optionChangesMap[name] = "MOSTLY_TOTAL"
- });
- function prepareAxisOptions(scaleOptions, isCompactMode, height, axisPosition) {
- scaleOptions.marker.label.font = scaleOptions.label.font;
- scaleOptions.color = scaleOptions.marker.color = scaleOptions.tick.color;
- scaleOptions.opacity = scaleOptions.marker.opacity = scaleOptions.tick.opacity;
- scaleOptions.width = scaleOptions.marker.width = scaleOptions.tick.width;
- scaleOptions.placeholderSize = (scaleOptions.placeholderHeight || 0) + axisPosition;
- scaleOptions.argumentType = scaleOptions.valueType;
- scaleOptions.visible = isCompactMode;
- scaleOptions.isHorizontal = true;
- scaleOptions.calculateMinors = true;
- scaleOptions.semiDiscreteInterval = scaleOptions.minRange;
- if (!isCompactMode) {
- scaleOptions.minorTick.length = scaleOptions.tick.length = height
- }
- scaleOptions.label.indentFromAxis = scaleOptions.label.topIndent + axisPosition;
- return scaleOptions
- }
- function createDateMarkersEvent(scaleOptions, markerTrackers, setSelectedRange) {
- (0, _iterator.each)(markerTrackers, function(_, value) {
- value.on("dxpointerdown", onPointerDown)
- });
- function onPointerDown(e) {
- var range = e.target.range;
- var minRange = scaleOptions.minRange ? (0, _date.addInterval)(range.startValue, scaleOptions.minRange) : void 0;
- var maxRange = scaleOptions.maxRange ? (0, _date.addInterval)(range.startValue, scaleOptions.maxRange) : void 0;
- if (!(minRange && minRange > range.endValue || maxRange && maxRange < range.endValue)) {
- setSelectedRange(range, e)
- }
- }
- }
- function getShiftDirection() {
- return 1
- }
- function getTickStartPositionShift(length) {
- return length % 2 === 1 ? -_floor(length / 2) : -length / 2
- }
- function AxisWrapper(params) {
- var that = this;
- that._axis = new _base_axis2.default.Axis({
- renderer: params.renderer,
- axesContainerGroup: params.root,
- scaleBreaksGroup: params.scaleBreaksGroup,
- incidentOccurred: params.incidentOccurred,
- axisType: "xyAxes",
- drawingType: "linear",
- widgetClass: "dxrs",
- axisClass: "range-selector",
- isArgumentAxis: true
- });
- that._updateSelectedRangeCallback = params.updateSelectedRange;
- that._axis.getAxisSharpDirection = that._axis.getSharpDirectionByCoords = getShiftDirection;
- that._axis.getTickStartPositionShift = getTickStartPositionShift
- }
- AxisWrapper.prototype = {
- constructor: AxisWrapper,
- dispose: function() {
- this._axis.dispose()
- },
- calculateInterval: function(value, prevValue) {
- return this._axis.calculateInterval(value, prevValue)
- },
- update: function(options, isCompactMode, canvas, businessRange, seriesDataSource) {
- var axis = this._axis;
- axis.updateOptions(prepareAxisOptions(options, isCompactMode, canvas.height, canvas.height / 2 - _ceil(options.width / 2)));
- axis.validate();
- axis.setBusinessRange(businessRange, true);
- if (void 0 !== seriesDataSource && seriesDataSource.isShowChart()) {
- axis.setMarginOptions(seriesDataSource.getMarginOptions(canvas))
- }
- axis.draw(canvas);
- axis.shift({
- left: 0,
- bottom: -canvas.height / 2 + canvas.top
- });
- if (axis.getMarkerTrackers()) {
- createDateMarkersEvent(options, axis.getMarkerTrackers(), this._updateSelectedRangeCallback)
- }
- axis.drawScaleBreaks({
- start: canvas.top,
- end: canvas.top + canvas.height
- })
- },
- visualRange: function() {},
- getViewport: function() {
- return {}
- },
- allScaleSelected: function(value) {
- var _this$_axis$visualRan = this._axis.visualRange(),
- startValue = _this$_axis$visualRan.startValue,
- endValue = _this$_axis$visualRan.endValue;
- return {
- startValue: value[0].valueOf() === startValue.valueOf(),
- endValue: value[1].valueOf() === endValue.valueOf()
- }
- }
- };
- ["setMarginOptions", "getFullTicks", "updateCanvas", "updateOptions", "getAggregationInfo", "getTranslator", "getVisualRangeLength", "getVisibleArea", "getMarginOptions"].forEach(function(methodName) {
- AxisWrapper.prototype[methodName] = function() {
- var axis = this._axis;
- return axis[methodName].apply(axis, arguments)
- }
- });
- (0, _component_registrator2.default)("dxRangeSelector", dxRangeSelector);
- module.exports = dxRangeSelector;
- dxRangeSelector.addPlugin(_export.plugin);
- dxRangeSelector.addPlugin(_title.plugin);
- dxRangeSelector.addPlugin(_loading_indicator.plugin);
- dxRangeSelector.addPlugin(_data_source.plugin)
- },
- /*!***********************************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/sliders_controller.js ***!
- \***********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var commonModule = __webpack_require__( /*! ./common */ 206);
- var animationSettings = commonModule.utils.animationSettings;
- var emptySliderMarkerText = commonModule.consts.emptySliderMarkerText;
- var Slider = __webpack_require__( /*! ./slider */ 806);
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var isNumeric = typeUtils.isNumeric;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
- function buildRectPoints(left, top, right, bottom) {
- return [left, top, right, top, right, bottom, left, bottom]
- }
- function valueOf(value) {
- return value && value.valueOf()
- }
- function isLess(a, b) {
- return a < b
- }
- function isGreater(a, b) {
- return a > b
- }
- function selectClosestValue(target, values) {
- var start = 0;
- var end = values ? values.length - 1 : 0;
- var val = target;
- while (end - start > 1) {
- var middle = start + end >> 1;
- val = values[middle];
- if (val === target) {
- return target
- } else {
- if (target < val) {
- end = middle
- } else {
- start = middle
- }
- }
- }
- if (values) {
- val = values[target - values[start] <= values[end] - target ? start : end]
- }
- return val
- }
- function dummyProcessSelectionChanged() {
- this._lastSelectedRange = this.getSelectedRange();
- delete this._processSelectionChanged
- }
- function suppressSetSelectedRange(controller) {
- controller.setSelectedRange = noop;
- if (controller._processSelectionChanged === dummyProcessSelectionChanged) {
- controller._processSelectionChanged()
- }
- }
- function restoreSetSelectedRange(controller) {
- delete controller.setSelectedRange
- }
- function SlidersController(params) {
- var that = this;
- var sliderParams = {
- renderer: params.renderer,
- root: params.root,
- trackersGroup: params.trackersGroup,
- translator: params.translator
- };
- that._params = params;
- that._areaTracker = params.renderer.path(null, "area").attr({
- "class": "area-tracker",
- fill: "#000000",
- opacity: 1e-4
- }).append(params.trackersGroup);
- that._selectedAreaTracker = params.renderer.path(null, "area").attr({
- "class": "selected-area-tracker",
- fill: "#000000",
- opacity: 1e-4
- }).append(params.trackersGroup);
- that._shutter = params.renderer.path(null, "area").append(params.root);
- that._sliders = [new Slider(sliderParams, 0), new Slider(sliderParams, 1)];
- that._processSelectionChanged = dummyProcessSelectionChanged
- }
- SlidersController.prototype = {
- constructor: SlidersController,
- dispose: function() {
- this._sliders[0].dispose();
- this._sliders[1].dispose()
- },
- getTrackerTargets: function() {
- return {
- area: this._areaTracker,
- selectedArea: this._selectedAreaTracker,
- sliders: this._sliders
- }
- },
- _processSelectionChanged: function(e) {
- var that = this;
- var selectedRange = that.getSelectedRange();
- if (valueOf(selectedRange.startValue) !== valueOf(that._lastSelectedRange.startValue) || valueOf(selectedRange.endValue) !== valueOf(that._lastSelectedRange.endValue)) {
- that._params.updateSelectedRange(selectedRange, that._lastSelectedRange, e);
- that._lastSelectedRange = selectedRange
- }
- },
- update: function(verticalRange, behavior, isCompactMode, sliderHandleOptions, sliderMarkerOptions, shutterOptions, rangeBounds, fullTicks, selectedRangeColor) {
- var that = this;
- var screenRange = that._params.translator.getScreenRange();
- that._verticalRange = verticalRange;
- that._minRange = rangeBounds.minRange;
- that._maxRange = rangeBounds.maxRange;
- that._animationEnabled = behavior.animationEnabled && that._params.renderer.animationEnabled();
- that._allowSlidersSwap = behavior.allowSlidersSwap;
- that._sliders[0].update(verticalRange, sliderHandleOptions, sliderMarkerOptions);
- that._sliders[1].update(verticalRange, sliderHandleOptions, sliderMarkerOptions);
- that._sliders[0]._position = that._sliders[1]._position = screenRange[0];
- that._values = !that._params.translator.isValueProlonged && behavior.snapToTicks ? fullTicks : null;
- that._areaTracker.attr({
- points: buildRectPoints(screenRange[0], verticalRange[0], screenRange[1], verticalRange[1])
- });
- that._isCompactMode = isCompactMode;
- that._shutterOffset = sliderHandleOptions.width / 2;
- that._updateSelectedView(shutterOptions, selectedRangeColor);
- that._isOnMoving = "onmoving" === _normalizeEnum(behavior.callValueChanged);
- that._updateSelectedRange();
- that._applyTotalPosition(false)
- },
- _updateSelectedView: function(shutterOptions, selectedRangeColor) {
- var settings = {
- fill: null,
- "fill-opacity": null,
- stroke: null,
- "stroke-width": null
- };
- if (this._isCompactMode) {
- settings.stroke = selectedRangeColor;
- settings["stroke-width"] = 3;
- settings.sharp = "v"
- } else {
- settings.fill = shutterOptions.color;
- settings["fill-opacity"] = shutterOptions.opacity
- }
- this._shutter.attr(settings)
- },
- _updateSelectedRange: function() {
- var that = this;
- var sliders = that._sliders;
- sliders[0].cancelAnimation();
- sliders[1].cancelAnimation();
- that._shutter.stopAnimation();
- if (that._params.translator.getBusinessRange().isEmpty()) {
- sliders[0]._setText(emptySliderMarkerText);
- sliders[1]._setText(emptySliderMarkerText);
- sliders[0]._value = sliders[1]._value = void 0;
- sliders[0]._position = that._params.translator.getScreenRange()[0];
- sliders[1]._position = that._params.translator.getScreenRange()[1];
- that._applyTotalPosition(false);
- suppressSetSelectedRange(that)
- } else {
- restoreSetSelectedRange(that)
- }
- },
- _applyTotalPosition: function(isAnimated) {
- var sliders = this._sliders;
- isAnimated = this._animationEnabled && isAnimated;
- sliders[0].applyPosition(isAnimated);
- sliders[1].applyPosition(isAnimated);
- var areOverlapped = sliders[0].getCloudBorder() > sliders[1].getCloudBorder();
- sliders[0].setOverlapped(areOverlapped);
- sliders[1].setOverlapped(areOverlapped);
- this._applyAreaTrackersPosition();
- this._applySelectedRangePosition(isAnimated)
- },
- _applyAreaTrackersPosition: function() {
- var that = this;
- var position1 = that._sliders[0].getPosition();
- var position2 = that._sliders[1].getPosition();
- that._selectedAreaTracker.attr({
- points: buildRectPoints(position1, that._verticalRange[0], position2, that._verticalRange[1])
- }).css({
- cursor: Math.abs(that._params.translator.getScreenRange()[1] - that._params.translator.getScreenRange()[0] - position2 + position1) < .001 ? "default" : "pointer"
- })
- },
- _applySelectedRangePosition: function(isAnimated) {
- var that = this;
- var verticalRange = that._verticalRange;
- var pos1 = that._sliders[0].getPosition();
- var pos2 = that._sliders[1].getPosition();
- var points;
- if (that._isCompactMode) {
- points = [pos1 + Math.ceil(that._shutterOffset), (verticalRange[0] + verticalRange[1]) / 2, pos2 - Math.floor(that._shutterOffset), (verticalRange[0] + verticalRange[1]) / 2]
- } else {
- var screenRange = that._params.axis.getVisibleArea();
- points = [buildRectPoints(screenRange[0], verticalRange[0], Math.max(pos1 - Math.floor(that._shutterOffset), screenRange[0]), verticalRange[1]), buildRectPoints(screenRange[1], verticalRange[0], Math.min(pos2 + Math.ceil(that._shutterOffset), screenRange[1]), verticalRange[1])]
- }
- if (isAnimated) {
- that._shutter.animate({
- points: points
- }, animationSettings)
- } else {
- that._shutter.attr({
- points: points
- })
- }
- },
- getSelectedRange: function() {
- return {
- startValue: this._sliders[0].getValue(),
- endValue: this._sliders[1].getValue()
- }
- },
- setSelectedRange: function(visualRange, e) {
- visualRange = visualRange || {};
- var that = this;
- var translator = that._params.translator;
- var businessRange = translator.getBusinessRange();
- var compare = "discrete" === businessRange.axisType ? function(a, b) {
- return a < b
- } : function(a, b) {
- return a <= b
- };
- var _vizUtils$adjustVisua = vizUtils.adjustVisualRange({
- dataType: businessRange.dataType,
- axisType: businessRange.axisType,
- base: businessRange.base
- }, {
- startValue: translator.isValid(visualRange.startValue) ? translator.getCorrectValue(visualRange.startValue, 1) : void 0,
- endValue: translator.isValid(visualRange.endValue) ? translator.getCorrectValue(visualRange.endValue, -1) : void 0,
- length: visualRange.length
- }, {
- min: businessRange.minVisible,
- max: businessRange.maxVisible,
- categories: businessRange.categories
- }),
- startValue = _vizUtils$adjustVisua.startValue,
- endValue = _vizUtils$adjustVisua.endValue;
- startValue = isNumeric(startValue) ? adjust(startValue) : startValue;
- endValue = isNumeric(endValue) ? adjust(endValue) : endValue;
- var values = compare(translator.to(startValue, -1), translator.to(endValue, 1)) ? [startValue, endValue] : [endValue, startValue];
- that._sliders[0].setDisplayValue(values[0]);
- that._sliders[1].setDisplayValue(values[1]);
- that._sliders[0]._position = translator.to(values[0], -1);
- that._sliders[1]._position = translator.to(values[1], 1);
- that._applyTotalPosition(true);
- that._processSelectionChanged(e)
- },
- beginSelectedAreaMoving: function(initialPosition) {
- var that = this;
- var sliders = that._sliders;
- var offset = (sliders[0].getPosition() + sliders[1].getPosition()) / 2 - initialPosition;
- var currentPosition = initialPosition;
- move.complete = function(e) {
- that._dockSelectedArea(e)
- };
- return move;
- function move(position, e) {
- if (position !== currentPosition && position > currentPosition === position > (sliders[0].getPosition() + sliders[1].getPosition()) / 2 - offset) {
- that._moveSelectedArea(position + offset, false, e)
- }
- currentPosition = position
- }
- },
- _dockSelectedArea: function(e) {
- var translator = this._params.translator;
- var sliders = this._sliders;
- sliders[0]._position = translator.to(sliders[0].getValue(), -1);
- sliders[1]._position = translator.to(sliders[1].getValue(), 1);
- this._applyTotalPosition(true);
- this._processSelectionChanged(e)
- },
- moveSelectedArea: function(screenPosition, e) {
- this._moveSelectedArea(screenPosition, true, e);
- this._dockSelectedArea(e)
- },
- _moveSelectedArea: function(screenPosition, isAnimated, e) {
- var that = this;
- var translator = that._params.translator;
- var sliders = that._sliders;
- var interval = sliders[1].getPosition() - sliders[0].getPosition();
- var startPosition = screenPosition - interval / 2;
- var endPosition = screenPosition + interval / 2;
- if (startPosition < translator.getScreenRange()[0]) {
- startPosition = translator.getScreenRange()[0];
- endPosition = startPosition + interval
- }
- if (endPosition > translator.getScreenRange()[1]) {
- endPosition = translator.getScreenRange()[1];
- startPosition = endPosition - interval
- }
- var startValue = selectClosestValue(translator.from(startPosition, -1), that._values);
- sliders[0].setDisplayValue(startValue);
- sliders[1].setDisplayValue(selectClosestValue(translator.from(translator.to(startValue, -1) + interval, 1), that._values));
- sliders[0]._position = startPosition;
- sliders[1]._position = endPosition;
- that._applyTotalPosition(isAnimated);
- if (that._isOnMoving) {
- that._processSelectionChanged(e)
- }
- },
- placeSliderAndBeginMoving: function(firstPosition, secondPosition, e) {
- var that = this;
- var translator = that._params.translator;
- var sliders = that._sliders;
- var index = firstPosition < secondPosition ? 0 : 1;
- var dir = index > 0 ? 1 : -1;
- var compare = index > 0 ? isGreater : isLess;
- var antiCompare = index > 0 ? isLess : isGreater;
- var thresholdPosition;
- var positions = [];
- var values = [];
- values[index] = translator.from(firstPosition, dir);
- values[1 - index] = translator.from(secondPosition, -dir);
- positions[1 - index] = secondPosition;
- if (translator.isValueProlonged) {
- if (compare(firstPosition, translator.to(values[index], dir))) {
- values[index] = translator.from(firstPosition, -dir)
- }
- if (compare(secondPosition, translator.to(values[index], -dir))) {
- values[1 - index] = values[index]
- }
- }
- if (that._minRange) {
- thresholdPosition = translator.to(translator.add(selectClosestValue(values[index], that._values), that._minRange, -dir), -dir);
- if (compare(secondPosition, thresholdPosition)) {
- values[1 - index] = translator.add(values[index], that._minRange, -dir)
- }
- thresholdPosition = translator.to(translator.add(translator.getRange()[1 - index], that._minRange, dir), -dir);
- if (antiCompare(firstPosition, thresholdPosition)) {
- values[1 - index] = translator.getRange()[1 - index];
- values[index] = translator.add(values[1 - index], that._minRange, dir);
- positions[1 - index] = firstPosition
- }
- }
- values[0] = selectClosestValue(values[0], that._values);
- values[1] = selectClosestValue(values[1], that._values);
- positions[index] = translator.to(values[index], dir);
- sliders[0].setDisplayValue(values[0]);
- sliders[1].setDisplayValue(values[1]);
- sliders[0]._position = positions[0];
- sliders[1]._position = positions[1];
- that._applyTotalPosition(true);
- if (that._isOnMoving) {
- that._processSelectionChanged(e)
- }
- var handler = that.beginSliderMoving(1 - index, secondPosition);
- sliders[1 - index]._sliderGroup.stopAnimation();
- that._shutter.stopAnimation();
- handler(secondPosition);
- return handler
- },
- beginSliderMoving: function(initialIndex, initialPosition) {
- var that = this;
- var translator = that._params.translator;
- var sliders = that._sliders;
- var minPosition = translator.getScreenRange()[0];
- var maxPosition = translator.getScreenRange()[1];
- var index = initialIndex;
- var staticPosition = sliders[1 - index].getPosition();
- var currentPosition = initialPosition;
- var dir = index > 0 ? 1 : -1;
- var compareMin = index > 0 ? isLess : isGreater;
- var compareMax = index > 0 ? isGreater : isLess;
- var moveOffset = sliders[index].getPosition() - initialPosition;
- var swapOffset = compareMin(sliders[index].getPosition(), initialPosition) ? -moveOffset : moveOffset;
- move.complete = function(e) {
- sliders[index]._setValid(true);
- that._dockSelectedArea(e)
- };
- return move;
- function move(position, e) {
- var isValid;
- if (position !== currentPosition) {
- if (compareMin(position + swapOffset, staticPosition)) {
- isValid = that._allowSlidersSwap;
- if (isValid && !translator.isValueProlonged && that._minRange) {
- isValid = translator.isValid(translator.add(sliders[1 - index].getValue(), that._minRange, -dir))
- }
- if (isValid) {
- that._changeMovingSlider(index);
- index = 1 - index;
- dir = -dir;
- var temp = compareMin;
- compareMin = compareMax;
- compareMax = temp;
- moveOffset = -dir * Math.abs(moveOffset);
- swapOffset = -moveOffset
- }
- }
- if (compareMax(position + moveOffset, staticPosition)) {
- isValid = true;
- var slider = sliders[index];
- var value = sliders[1 - index].getValue();
- var pos = Math.max(Math.min(position + moveOffset, maxPosition), minPosition);
- if (isValid && translator.isValueProlonged) {
- isValid = !compareMin(pos, translator.to(value, dir))
- }
- if (isValid && that._minRange) {
- isValid = !compareMin(pos, translator.to(translator.add(value, that._minRange, dir), dir))
- }
- if (isValid && that._maxRange) {
- isValid = !compareMax(pos, translator.to(translator.add(value, that._maxRange, dir), dir))
- }
- slider._setValid(isValid);
- slider.setDisplayValue(isValid ? selectClosestValue(translator.from(pos, dir), that._values) : slider.getValue());
- slider._position = pos;
- that._applyTotalPosition(false);
- slider.toForeground();
- if (that._isOnMoving) {
- that._processSelectionChanged(e)
- }
- }
- }
- currentPosition = position
- }
- },
- _changeMovingSlider: function(index) {
- var that = this;
- var translator = that._params.translator;
- var sliders = that._sliders;
- var position = sliders[1 - index].getPosition();
- var dir = index > 0 ? 1 : -1;
- var newValue;
- sliders[index].setDisplayValue(selectClosestValue(translator.from(position, dir), that._values));
- newValue = translator.from(position, -dir);
- if (translator.isValueProlonged) {
- newValue = translator.from(position, dir)
- } else {
- if (that._minRange) {
- newValue = translator.add(newValue, that._minRange, -dir)
- }
- }
- sliders[1 - index].setDisplayValue(selectClosestValue(newValue, that._values));
- sliders[index]._setValid(true);
- sliders[index]._marker._update();
- sliders[0]._position = sliders[1]._position = position
- },
- foregroundSlider: function(index) {
- this._sliders[index].toForeground()
- }
- };
- exports.SlidersController = SlidersController
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/slider.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var commonModule = __webpack_require__( /*! ./common */ 206);
- var animationSettings = commonModule.utils.animationSettings;
- var formatValue = commonModule.formatValue;
- var SliderMarker = __webpack_require__( /*! ./slider_marker */ 807);
- var support = __webpack_require__( /*! ../../core/utils/support */ 43);
- var SPLITTER_WIDTH = 8;
- var TOUCH_SPLITTER_WIDTH = 20;
- function getSliderTrackerWidth(sliderHandleWidth) {
- return support.touchEvents || support.pointer ? TOUCH_SPLITTER_WIDTH : SPLITTER_WIDTH < sliderHandleWidth ? sliderHandleWidth : SPLITTER_WIDTH
- }
- function Slider(params, index) {
- var that = this;
- that._translator = params.translator;
- that._sliderGroup = params.renderer.g().attr({
- "class": "slider"
- }).append(params.root);
- that._line = params.renderer.path(null, "line").append(that._sliderGroup);
- that._marker = new SliderMarker(params.renderer, that._sliderGroup, 1 === index);
- that._tracker = params.renderer.rect().attr({
- "class": "slider-tracker",
- fill: "#000000",
- opacity: 1e-4
- }).css({
- cursor: "w-resize"
- }).append(params.trackersGroup)
- }
- Slider.prototype = {
- constructor: Slider,
- cancelAnimation: function() {
- this._sliderGroup.stopAnimation();
- this._tracker.stopAnimation()
- },
- applyPosition: function(isAnimated) {
- var that = this;
- var slider = that._sliderGroup;
- var tracker = that._tracker;
- var attrs = {
- translateX: that._position
- };
- that._marker.setPosition(that._position);
- if (isAnimated) {
- slider.animate(attrs, animationSettings);
- tracker.animate(attrs, animationSettings)
- } else {
- slider.attr(attrs);
- tracker.attr(attrs)
- }
- },
- _setValid: function(isValid) {
- this._marker.setValid(isValid);
- this._line.attr({
- stroke: this._colors[Number(isValid)]
- })
- },
- _setText: function(text) {
- this._marker.setText(text)
- },
- update: function(verticalRange, sliderHandleOptions, sliderMarkerOptions) {
- var that = this;
- that._formatOptions = {
- format: sliderMarkerOptions.format,
- customizeText: sliderMarkerOptions.customizeText
- };
- that._marker.applyOptions(sliderMarkerOptions, that._translator.getScreenRange());
- that._colors = [sliderMarkerOptions.invalidRangeColor, sliderHandleOptions.color];
- that._sliderGroup.attr({
- translateY: verticalRange[0]
- });
- that._line.attr({
- "stroke-width": sliderHandleOptions.width,
- stroke: sliderHandleOptions.color,
- "stroke-opacity": sliderHandleOptions.opacity,
- sharp: "h",
- points: [0, 0, 0, verticalRange[1] - verticalRange[0]]
- });
- var trackerWidth = getSliderTrackerWidth(sliderHandleOptions.width);
- that._tracker.attr({
- x: -trackerWidth / 2,
- y: 0,
- width: trackerWidth,
- height: verticalRange[1] - verticalRange[0],
- translateY: verticalRange[0]
- })
- },
- toForeground: function() {
- this._sliderGroup.toForeground()
- },
- getSliderTracker: function() {
- return this._tracker
- },
- getPosition: function() {
- return this._position
- },
- setDisplayValue: function(value) {
- this._value = value;
- this._setText(formatValue(value, this._formatOptions))
- },
- setOverlapped: function(isOverlapped) {
- this._marker.setOverlapped(isOverlapped)
- },
- getValue: function() {
- return this._value
- },
- on: function(event, handler) {
- this._tracker.on(event, handler);
- this._marker.getTracker().on(event, handler)
- },
- getCloudBorder: function() {
- return this._marker.getBorderPosition()
- },
- dispose: function() {
- this._marker.dispose()
- }
- };
- module.exports = Slider
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/slider_marker.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
- var SLIDER_MARKER_UPDATE_DELAY = 75;
- var POINTER_SIZE = __webpack_require__( /*! ./common */ 206).consts.pointerSize;
- function SliderMarker(renderer, root, isLeftPointer) {
- var that = this;
- that._isLeftPointer = isLeftPointer;
- that._isOverlapped = false;
- that._group = renderer.g().attr({
- "class": "slider-marker"
- }).append(root);
- that._area = renderer.path(null, "area").append(that._group);
- that._label = renderer.text().attr({
- align: "left"
- }).append(that._group);
- that._tracker = renderer.rect().attr({
- "class": "slider-marker-tracker",
- fill: "#000000",
- opacity: 1e-4
- }).css({
- cursor: "pointer"
- }).append(that._group);
- that._border = renderer.rect(0, 0, 1, 0)
- }
- SliderMarker.prototype = {
- constructor: SliderMarker,
- _getRectSize: function(textSize) {
- return {
- width: Math.round(2 * this._paddingLeftRight + textSize.width),
- height: Math.round(2 * this._paddingTopBottom + textSize.height)
- }
- },
- _getTextSize: function() {
- var textSize = this._label.getBBox();
- if (!this._textHeight && isFinite(textSize.height)) {
- this._textHeight = textSize.height
- }
- return {
- width: textSize.width,
- height: this._textHeight,
- y: textSize.y
- }
- },
- _getAreaPointsInfo: function(textSize) {
- var that = this;
- var rectSize = that._getRectSize(textSize);
- var rectWidth = rectSize.width;
- var rectHeight = rectSize.height;
- var rectLeftBorder = -rectWidth;
- var rectRightBorder = 0;
- var pointerRightPoint = POINTER_SIZE;
- var pointerCenterPoint = 0;
- var pointerLeftPoint = -POINTER_SIZE;
- var position = that._position;
- var isLeft = that._isLeftPointer;
- var correctCloudBorders = function() {
- rectLeftBorder++;
- rectRightBorder++;
- pointerRightPoint++;
- pointerCenterPoint++;
- pointerLeftPoint++
- };
- var checkPointerBorders = function() {
- if (pointerRightPoint > rectRightBorder) {
- pointerRightPoint = rectRightBorder
- } else {
- if (pointerLeftPoint < rectLeftBorder) {
- pointerLeftPoint = rectLeftBorder
- }
- }
- isLeft && correctCloudBorders()
- };
- var borderPosition = position;
- if (isLeft) {
- if (position > that._range[1] - rectWidth) {
- rectRightBorder = -position + that._range[1];
- rectLeftBorder = rectRightBorder - rectWidth;
- checkPointerBorders();
- borderPosition += rectLeftBorder
- } else {
- rectLeftBorder = pointerLeftPoint = 0;
- rectRightBorder = rectWidth
- }
- } else {
- if (position - that._range[0] < rectWidth) {
- rectLeftBorder = -(position - that._range[0]);
- rectRightBorder = rectLeftBorder + rectWidth;
- checkPointerBorders();
- borderPosition += rectRightBorder
- } else {
- pointerRightPoint = 0;
- correctCloudBorders()
- }
- }
- that._borderPosition = borderPosition;
- return {
- offset: rectLeftBorder,
- isCut: (!isLeft || pointerCenterPoint !== pointerLeftPoint) && (isLeft || pointerCenterPoint !== pointerRightPoint),
- points: [rectLeftBorder, 0, rectRightBorder, 0, rectRightBorder, rectHeight, pointerRightPoint, rectHeight, pointerCenterPoint, rectHeight + POINTER_SIZE, pointerLeftPoint, rectHeight, rectLeftBorder, rectHeight]
- }
- },
- _update: function() {
- var that = this;
- var textSize;
- clearTimeout(that._timeout);
- that._label.attr({
- text: that._text || ""
- });
- var currentTextSize = that._getTextSize();
- var rectSize = that._getRectSize(currentTextSize);
- textSize = that._textSize || currentTextSize;
- textSize = that._textSize = currentTextSize.width > textSize.width || currentTextSize.height > textSize.height ? currentTextSize : textSize;
- that._timeout = setTimeout(function() {
- updateSliderMarker(currentTextSize, rectSize);
- that._textSize = currentTextSize
- }, SLIDER_MARKER_UPDATE_DELAY);
- function updateSliderMarker(size, rectSize) {
- rectSize = rectSize || that._getRectSize(size);
- that._group.attr({
- translateY: -(rectSize.height + POINTER_SIZE)
- });
- var pointsData = that._getAreaPointsInfo(size);
- var points = pointsData.points;
- var offset = pointsData.offset;
- that._area.attr({
- points: points
- });
- that._border.attr({
- x: that._isLeftPointer ? points[0] - 1 : points[2],
- height: pointsData.isCut ? rectSize.height : rectSize.height + POINTER_SIZE
- });
- that._tracker.attr({
- translateX: offset,
- width: rectSize.width,
- height: rectSize.height + POINTER_SIZE
- });
- that._label.attr({
- translateX: that._paddingLeftRight + offset,
- translateY: rectSize.height / 2 - (size.y + size.height / 2)
- })
- }
- updateSliderMarker(textSize)
- },
- setText: function(value) {
- this._text = value
- },
- setPosition: function(position) {
- this._position = position;
- this._update()
- },
- applyOptions: function(options, screenRange) {
- var that = this;
- that._range = screenRange;
- that._paddingLeftRight = options.paddingLeftRight;
- that._paddingTopBottom = options.paddingTopBottom;
- that._textHeight = null;
- that._colors = [options.invalidRangeColor, options.color];
- that._area.attr({
- fill: options.color
- });
- that._border.attr({
- fill: options.borderColor
- });
- that._label.css(patchFontOptions(options.font));
- that._update()
- },
- getTracker: function() {
- return this._tracker
- },
- setValid: function(isValid) {
- this._area.attr({
- fill: this._colors[Number(isValid)]
- })
- },
- setColor: function(color) {
- this._area.attr({
- fill: color
- })
- },
- dispose: function() {
- clearTimeout(this._timeout)
- },
- setOverlapped: function(isOverlapped) {
- var that = this;
- if (that._isOverlapped !== isOverlapped) {
- if (isOverlapped) {
- that._border.append(that._group)
- } else {
- that._isOverlapped && that._border.remove()
- }
- that._isOverlapped = isOverlapped
- }
- },
- getBorderPosition: function() {
- return this._borderPosition
- }
- };
- module.exports = SliderMarker
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/tracker.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.Tracker = Tracker;
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
- var _pointer2 = _interopRequireDefault(_pointer);
- var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
- var _support = __webpack_require__( /*! ../../core/utils/support */ 43);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- var MIN_MANUAL_SELECTING_WIDTH = 10;
- var window = _window2.default.getWindow();
- function isLeftButtonPressed(event) {
- var e = event || window.event;
- var originalEvent = e.originalEvent;
- var touches = e.touches;
- var pointerType = originalEvent ? originalEvent.pointerType : false;
- var eventTouches = originalEvent ? originalEvent.touches : false;
- var isMSPointerLeftClick = originalEvent && void 0 !== pointerType && (pointerType === (originalEvent.MSPOINTER_TYPE_TOUCH || "touch") || pointerType === (originalEvent.MSPOINTER_TYPE_MOUSE || "mouse") && 1 === originalEvent.buttons);
- var isTouches = touches && touches.length > 0 || eventTouches && eventTouches.length > 0;
- return 1 === e.which || isMSPointerLeftClick || isTouches
- }
- function isMultiTouches(event) {
- var originalEvent = event.originalEvent;
- var touches = event.touches;
- var eventTouches = originalEvent && originalEvent.touches;
- return touches && touches.length > 1 || eventTouches && eventTouches.length > 1 || null
- }
- function preventDefault(e) {
- if (!isMultiTouches(e)) {
- e.preventDefault()
- }
- }
- function stopPropagationAndPreventDefault(e) {
- if (!isMultiTouches(e)) {
- e.stopPropagation();
- e.preventDefault()
- }
- }
- function isTouchEventArgs(e) {
- return e && e.type && 0 === e.type.indexOf("touch")
- }
- function getEventPageX(event) {
- var originalEvent = event.originalEvent;
- var result = 0;
- if (event.pageX) {
- result = event.pageX
- } else {
- if (originalEvent && originalEvent.pageX) {
- result = originalEvent.pageX
- }
- }
- if (originalEvent && originalEvent.touches) {
- if (originalEvent.touches.length > 0) {
- result = originalEvent.touches[0].pageX
- } else {
- if (originalEvent.changedTouches.length > 0) {
- result = originalEvent.changedTouches[0].pageX
- }
- }
- }
- return result
- }
- function initializeAreaEvents(controller, area, state, getRootOffsetLeft) {
- var _docEvents;
- var isTouchEvent;
- var isActive = false;
- var initialPosition;
- var movingHandler = null;
- var docEvents = (_docEvents = {}, _defineProperty(_docEvents, _pointer2.default.move, function(e) {
- var position;
- var offset;
- if (isTouchEvent !== isTouchEventArgs(e)) {
- return
- }
- if (!isLeftButtonPressed(e)) {
- cancel(e)
- }
- if (isActive) {
- position = getEventPageX(e);
- offset = getRootOffsetLeft();
- if (movingHandler) {
- movingHandler(position - offset, e)
- } else {
- if (state.manualRangeSelectionEnabled && Math.abs(initialPosition - position) >= MIN_MANUAL_SELECTING_WIDTH) {
- movingHandler = controller.placeSliderAndBeginMoving(initialPosition - offset, position - offset, e)
- }
- }
- }
- }), _defineProperty(_docEvents, _pointer2.default.up, function(e) {
- var position;
- if (isActive) {
- position = getEventPageX(e);
- if (!movingHandler && state.moveSelectedRangeByClick && Math.abs(initialPosition - position) < MIN_MANUAL_SELECTING_WIDTH) {
- controller.moveSelectedArea(position - getRootOffsetLeft(), e)
- }
- cancel(e)
- }
- }), _docEvents);
- function cancel(e) {
- if (isActive) {
- isActive = false;
- if (movingHandler) {
- movingHandler.complete(e);
- movingHandler = null
- }
- }
- }
- area.on(_pointer2.default.down, function(e) {
- if (!state.enabled || !isLeftButtonPressed(e) || isActive) {
- return
- }
- isActive = true;
- isTouchEvent = isTouchEventArgs(e);
- initialPosition = getEventPageX(e)
- });
- return docEvents
- }
- function initializeSelectedAreaEvents(controller, area, state, getRootOffsetLeft) {
- var _docEvents2;
- var isTouchEvent;
- var isActive = false;
- var movingHandler = null;
- var docEvents = (_docEvents2 = {}, _defineProperty(_docEvents2, _pointer2.default.move, function(e) {
- if (isTouchEvent !== isTouchEventArgs(e)) {
- return
- }
- if (!isLeftButtonPressed(e)) {
- cancel(e)
- }
- if (isActive) {
- preventDefault(e);
- movingHandler(getEventPageX(e) - getRootOffsetLeft(), e)
- }
- }), _defineProperty(_docEvents2, _pointer2.default.up, cancel), _docEvents2);
- function cancel(e) {
- if (isActive) {
- isActive = false;
- movingHandler.complete(e);
- movingHandler = null
- }
- }
- area.on(_pointer2.default.down, function(e) {
- if (!state.enabled || !isLeftButtonPressed(e) || isActive) {
- return
- }
- isActive = true;
- isTouchEvent = isTouchEventArgs(e);
- movingHandler = controller.beginSelectedAreaMoving(getEventPageX(e) - getRootOffsetLeft());
- stopPropagationAndPreventDefault(e)
- });
- return docEvents
- }
- function initializeSliderEvents(controller, sliders, state, getRootOffsetLeft) {
- var _docEvents3;
- var isTouchEvent;
- var isActive = false;
- var movingHandler = null;
- var docEvents = (_docEvents3 = {}, _defineProperty(_docEvents3, _pointer2.default.move, function(e) {
- if (isTouchEvent !== isTouchEventArgs(e)) {
- return
- }
- if (!isLeftButtonPressed(e)) {
- cancel(e)
- }
- if (isActive) {
- preventDefault(e);
- movingHandler(getEventPageX(e) - getRootOffsetLeft(), e)
- }
- }), _defineProperty(_docEvents3, _pointer2.default.up, cancel), _docEvents3);
- (0, _iterator.each)(sliders, function(i, slider) {
- var _slider$on;
- slider.on((_slider$on = {}, _defineProperty(_slider$on, _pointer2.default.down, function(e) {
- if (!state.enabled || !isLeftButtonPressed(e) || isActive) {
- return
- }
- isActive = true;
- isTouchEvent = isTouchEventArgs(e);
- movingHandler = controller.beginSliderMoving(i, getEventPageX(e) - getRootOffsetLeft());
- stopPropagationAndPreventDefault(e)
- }), _defineProperty(_slider$on, _pointer2.default.move, function() {
- if (!movingHandler) {
- controller.foregroundSlider(i)
- }
- }), _slider$on))
- });
- function cancel(e) {
- if (isActive) {
- isActive = false;
- movingHandler.complete(e);
- movingHandler = null
- }
- }
- return docEvents
- }
- function Tracker(params) {
- var state = this._state = {};
- var targets = params.controller.getTrackerTargets();
- if (_support.pointer) {
- params.renderer.root.css({
- msTouchAction: "pinch-zoom"
- })
- }
- this._docEvents = [initializeSelectedAreaEvents(params.controller, targets.selectedArea, state, getRootOffsetLeft), initializeAreaEvents(params.controller, targets.area, state, getRootOffsetLeft), initializeSliderEvents(params.controller, targets.sliders, state, getRootOffsetLeft)];
- (0, _iterator.each)(this._docEvents, function(_, events) {
- _events_engine2.default.on(_dom_adapter2.default.getDocument(), events)
- });
- function getRootOffsetLeft() {
- return params.renderer.getRootOffset().left
- }
- }
- Tracker.prototype = {
- constructor: Tracker,
- dispose: function() {
- (0, _iterator.each)(this._docEvents, function(_, events) {
- _events_engine2.default.off(_dom_adapter2.default.getDocument(), events)
- })
- },
- update: function(enabled, behavior) {
- var state = this._state;
- state.enabled = enabled;
- state.moveSelectedRangeByClick = behavior.moveSelectedRangeByClick;
- state.manualRangeSelectionEnabled = behavior.manualRangeSelectionEnabled
- }
- }
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/range_view.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- function drawSeriesView(root, seriesDataSource, canvas, isAnimationEnabled) {
- var seriesList = seriesDataSource.getSeries();
- if (!seriesList.length) {
- return
- }
- var valueAxis = seriesList[0].getValueAxis();
- valueAxis.updateCanvas({
- top: canvas.top,
- bottom: 0,
- height: canvas.height + canvas.top
- });
- seriesDataSource.adjustSeriesDimensions();
- var valueRange = seriesDataSource.getBoundRange().val;
- valueRange.sortCategories(valueAxis.getCategoriesSorter());
- valueAxis.setBusinessRange(valueRange);
- seriesList.forEach(function(series) {
- series._extGroups.seriesGroup = series._extGroups.labelsGroup = root;
- series.draw(isAnimationEnabled)
- })
- }
- function merge(a, b) {
- return void 0 !== a ? a : b
- }
- function RangeView(params) {
- this._params = params;
- this._clipRect = params.renderer.clipRect();
- params.root.attr({
- "clip-path": this._clipRect.id
- })
- }
- RangeView.prototype = {
- constructor: RangeView,
- update: function(backgroundOption, backgroundTheme, canvas, isCompactMode, isAnimationEnabled, seriesDataSource) {
- var renderer = this._params.renderer;
- var root = this._params.root;
- var canvasWidth = canvas.width - canvas.left;
- var seriesGroup;
- backgroundOption = backgroundOption || {};
- root.clear();
- this._clipRect.attr({
- x: canvas.left,
- y: canvas.top,
- width: canvasWidth,
- height: canvas.height
- });
- if (!isCompactMode) {
- if (merge(backgroundOption.visible, backgroundTheme.visible)) {
- if (backgroundOption.color) {
- renderer.rect(canvas.left, canvas.top, canvasWidth + 1, canvas.height).attr({
- fill: merge(backgroundOption.color, backgroundTheme.color),
- "class": "dx-range-selector-background"
- }).append(root)
- }
- if (backgroundOption.image && backgroundOption.image.url) {
- renderer.image(canvas.left, canvas.top, canvasWidth + 1, canvas.height, backgroundOption.image.url, merge(backgroundOption.image.location, backgroundTheme.image.location)).append(root)
- }
- }
- if (seriesDataSource && seriesDataSource.isShowChart()) {
- seriesGroup = renderer.g().attr({
- "class": "dxrs-series-group"
- }).append(root);
- drawSeriesView(seriesGroup, seriesDataSource, canvas, isAnimationEnabled)
- }
- }
- }
- };
- exports.RangeView = RangeView
- },
- /*!***********************************************************************!*\
- !*** ./artifacts/transpiled/viz/range_selector/series_data_source.js ***!
- \***********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var seriesModule = __webpack_require__( /*! ../series/base_series */ 245);
- var seriesFamilyModule = __webpack_require__( /*! ../core/series_family */ 409);
- var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var rangeModule = __webpack_require__( /*! ../translators/range */ 108);
- var dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 243);
- var ChartThemeManager = __webpack_require__( /*! ../components/chart_theme_manager */ 401).ThemeManager;
- var createThemeManager = function(chartOptions) {
- return new ChartThemeManager({
- options: chartOptions,
- themeSection: "rangeSelector.chart",
- fontFields: ["commonSeriesSettings.label.font"]
- })
- };
- var processSeriesFamilies = function(series, equalBarWidth, minBubbleSize, maxBubbleSize, barOptions, negativesAsZeroes) {
- var families = [];
- var types = [];
- each(series, function(i, item) {
- if (inArray(item.type, types) === -1) {
- types.push(item.type)
- }
- });
- each(types, function(_, type) {
- var family = new seriesFamilyModule.SeriesFamily({
- type: type,
- equalBarWidth: equalBarWidth,
- minBubbleSize: minBubbleSize,
- maxBubbleSize: maxBubbleSize,
- barWidth: barOptions.barWidth,
- barGroupPadding: barOptions.barGroupPadding,
- barGroupWidth: barOptions.barGroupWidth,
- negativesAsZeroes: negativesAsZeroes
- });
- family.add(series);
- family.adjustSeriesValues();
- families.push(family)
- });
- return families
- };
- var SeriesDataSource = function(options) {
- var that = this;
- var themeManager = that._themeManager = createThemeManager(options.chart);
- themeManager.setTheme(options.chart.theme);
- var topIndent = themeManager.getOptions("topIndent");
- var bottomIndent = themeManager.getOptions("bottomIndent");
- that._indent = {
- top: topIndent >= 0 && topIndent < 1 ? topIndent : 0,
- bottom: bottomIndent >= 0 && bottomIndent < 1 ? bottomIndent : 0
- };
- that._valueAxis = themeManager.getOptions("valueAxisRangeSelector") || {};
- that._hideChart = false;
- that._series = that._calculateSeries(options);
- that._seriesFamilies = []
- };
- SeriesDataSource.prototype = {
- constructor: SeriesDataSource,
- _calculateSeries: function(options) {
- var that = this;
- var series = [];
- var data = options.dataSource || [];
- var chartThemeManager = that._themeManager;
- var seriesTemplate = chartThemeManager.getOptions("seriesTemplate");
- var allSeriesOptions = seriesTemplate ? vizUtils.processSeriesTemplate(seriesTemplate, data) : options.chart.series;
- var dataSourceField;
- var valueAxis = that._valueAxis;
- var i;
- if (options.dataSource && !allSeriesOptions) {
- dataSourceField = options.dataSourceField || "arg";
- allSeriesOptions = {
- argumentField: dataSourceField,
- valueField: dataSourceField
- };
- that._hideChart = true
- }
- allSeriesOptions = Array.isArray(allSeriesOptions) ? allSeriesOptions : allSeriesOptions ? [allSeriesOptions] : [];
- for (i = 0; i < allSeriesOptions.length; i++) {
- var particularSeriesOptions = extend(true, {}, allSeriesOptions[i]);
- particularSeriesOptions.rotated = false;
- var seriesTheme = chartThemeManager.getOptions("series", particularSeriesOptions, allSeriesOptions.length);
- seriesTheme.argumentField = seriesTheme.argumentField || options.dataSourceField;
- if (!seriesTheme.name) {
- seriesTheme.name = "Series " + (i + 1).toString()
- }
- if (data && data.length > 0) {
- var newSeries = new seriesModule.Series({
- renderer: options.renderer,
- argumentAxis: options.argumentAxis,
- valueAxis: options.valueAxis,
- incidentOccurred: options.incidentOccurred
- }, seriesTheme);
- series.push(newSeries)
- }
- }
- if (series.length) {
- var groupsData = {
- groups: [{
- series: series,
- valueAxis: options.valueAxis,
- valueOptions: {
- type: valueAxis.type,
- valueType: dataSourceField ? options.valueType : valueAxis.valueType
- }
- }],
- argumentOptions: {
- categories: options.categories,
- argumentType: options.valueType,
- type: options.axisType
- }
- };
- var parsedData = dataValidatorModule.validateData(data, groupsData, options.incidentOccurred, chartThemeManager.getOptions("dataPrepareSettings"));
- that.argCategories = groupsData.categories;
- for (i = 0; i < series.length; i++) {
- series[i].updateData(parsedData[series[i].getArgumentField()])
- }
- }
- return series
- },
- createPoints: function() {
- if (0 === this._series.length) {
- return
- }
- var series = this._series;
- var viewport = new rangeModule.Range;
- var axis = series[0].getArgumentAxis();
- var themeManager = this._themeManager;
- var negativesAsZeroes = themeManager.getOptions("negativesAsZeroes");
- var negativesAsZeros = themeManager.getOptions("negativesAsZeros");
- series.forEach(function(s) {
- viewport.addRange(s.getArgumentRange())
- });
- axis.getTranslator().updateBusinessRange(viewport);
- series.forEach(function(s) {
- s.createPoints()
- });
- this._seriesFamilies = processSeriesFamilies(series, themeManager.getOptions("equalBarWidth"), themeManager.getOptions("minBubbleSize"), themeManager.getOptions("maxBubbleSize"), {
- barWidth: themeManager.getOptions("barWidth"),
- barGroupPadding: themeManager.getOptions("barGroupPadding"),
- barGroupWidth: themeManager.getOptions("barGroupWidth")
- }, typeUtils.isDefined(negativesAsZeroes) ? negativesAsZeroes : negativesAsZeros)
- },
- adjustSeriesDimensions: function() {
- each(this._seriesFamilies, function(_, family) {
- family.adjustSeriesDimensions()
- })
- },
- getBoundRange: function() {
- var that = this;
- var valueAxis = that._valueAxis;
- var valRange = new rangeModule.Range({
- min: valueAxis.min,
- minVisible: valueAxis.min,
- max: valueAxis.max,
- maxVisible: valueAxis.max,
- axisType: valueAxis.type,
- base: valueAxis.logarithmBase
- });
- var argRange = new rangeModule.Range({});
- each(that._series, function(_, series) {
- var rangeData = series.getRangeData();
- valRange.addRange(rangeData.val);
- argRange.addRange(rangeData.arg)
- });
- if (!valRange.isEmpty() && !argRange.isEmpty()) {
- var minIndent = valueAxis.inverted ? that._indent.top : that._indent.bottom;
- var maxIndent = valueAxis.inverted ? that._indent.bottom : that._indent.top;
- var rangeYSize = valRange.max - valRange.min;
- var rangeVisibleSizeY = (typeUtils.isNumeric(valRange.maxVisible) ? valRange.maxVisible : valRange.max) - (typeUtils.isNumeric(valRange.minVisible) ? valRange.minVisible : valRange.min);
- if (typeUtils.isDate(valRange.min)) {
- valRange.min = new Date(valRange.min.valueOf() - rangeYSize * minIndent)
- } else {
- valRange.min -= rangeYSize * minIndent
- }
- if (typeUtils.isDate(valRange.max)) {
- valRange.max = new Date(valRange.max.valueOf() + rangeYSize * maxIndent)
- } else {
- valRange.max += rangeYSize * maxIndent
- }
- if (typeUtils.isNumeric(rangeVisibleSizeY)) {
- valRange.maxVisible = valRange.maxVisible ? valRange.maxVisible + rangeVisibleSizeY * maxIndent : void 0;
- valRange.minVisible = valRange.minVisible ? valRange.minVisible - rangeVisibleSizeY * minIndent : void 0
- }
- valRange.invert = valueAxis.inverted
- }
- return {
- arg: argRange,
- val: valRange
- }
- },
- getMarginOptions: function(canvas) {
- var bubbleSize = Math.min(canvas.width, canvas.height) * this._themeManager.getOptions("maxBubbleSize");
- return this._series.reduce(function(marginOptions, series) {
- var seriesOptions = series.getMarginOptions();
- if (true === seriesOptions.processBubbleSize) {
- seriesOptions.size = bubbleSize
- }
- return vizUtils.mergeMarginOptions(marginOptions, seriesOptions)
- }, {})
- },
- getSeries: function() {
- return this._series
- },
- isEmpty: function() {
- return 0 === this.getSeries().length
- },
- isShowChart: function() {
- return !this._hideChart
- },
- getCalculatedValueType: function() {
- var series = this._series[0];
- return series && series.argumentType
- },
- getThemeManager: function() {
- return this._themeManager
- }
- };
- exports.SeriesDataSource = SeriesDataSource
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./vector_map/vector_map */ 812)
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/vector_map.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _parseScalar = __webpack_require__( /*! ../core/utils */ 10).parseScalar;
- var projectionModule = __webpack_require__( /*! ./projection.main */ 415);
- var controlBarModule = __webpack_require__( /*! ./control_bar */ 813);
- var gestureHandlerModule = __webpack_require__( /*! ./gesture_handler */ 814);
- var trackerModule = __webpack_require__( /*! ./tracker */ 815);
- var dataExchangerModule = __webpack_require__( /*! ./data_exchanger */ 816);
- var legendModule = __webpack_require__( /*! ./legend */ 817);
- var layoutModule = __webpack_require__( /*! ./layout */ 818);
- var mapLayerModule = __webpack_require__( /*! ./map_layer */ 819);
- var tooltipViewerModule = __webpack_require__( /*! ./tooltip_viewer */ 820);
- var DEFAULT_WIDTH = 800;
- var DEFAULT_HEIGHT = 400;
- var nextDataKey = 1;
- var RE_STARTS_LAYERS = /^layers/;
- var RE_ENDS_DATA_SOURCE = /\.dataSource$/;
- __webpack_require__( /*! ./projection */ 417);
- function generateDataKey() {
- return "vectormap-data-" + nextDataKey++
- }
- var dxVectorMap = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
- _eventsMap: {
- onClick: {
- name: "click"
- },
- onCenterChanged: {
- name: "centerChanged"
- },
- onZoomFactorChanged: {
- name: "zoomFactorChanged"
- },
- onHoverChanged: {
- name: "hoverChanged"
- },
- onSelectionChanged: {
- name: "selectionChanged"
- }
- },
- _rootClassPrefix: "dxm",
- _rootClass: "dxm-vector-map",
- _themeSection: "map",
- _fontFields: ["layer:area.label.font", "layer:marker:dot.label.font", "layer:marker:bubble.label.font", "layer:marker:pie.label.font", "layer:marker:image.label.font", "legend.font", "legend.title.font", "legend.title.subtitle.font"],
- _initLayerCollection: function(dataKey) {
- var that = this;
- that._layerCollection = new mapLayerModule.MapLayerCollection({
- renderer: that._renderer,
- projection: that._projection,
- themeManager: that._themeManager,
- tracker: that._tracker,
- dataKey: dataKey,
- eventTrigger: that._eventTrigger,
- dataExchanger: that._dataExchanger,
- tooltip: that._tooltip,
- notifyDirty: that._notifyDirty,
- notifyReady: that._notifyReady
- })
- },
- _initLegendsControl: function() {
- var that = this;
- that._legendsControl = new legendModule.LegendsControl({
- renderer: that._renderer,
- container: that._root,
- layoutControl: that._layoutControl,
- themeManager: that._themeManager,
- dataExchanger: that._dataExchanger,
- notifyDirty: that._notifyDirty,
- notifyReady: that._notifyReady
- })
- },
- _initControlBar: function(dataKey) {
- var that = this;
- that._controlBar = new controlBarModule.ControlBar({
- renderer: that._renderer,
- container: that._root,
- layoutControl: that._layoutControl,
- projection: that._projection,
- tracker: that._tracker,
- dataKey: dataKey
- })
- },
- _initElements: function() {
- var that = this;
- var dataKey = generateDataKey();
- var notifyCounter = 0;
- var preventProjectionEvents = true;
- that._notifyDirty = function() {
- that._resetIsReady();
- ++notifyCounter
- };
- that._notifyReady = function() {
- preventProjectionEvents = false;
- if (0 === --notifyCounter) {
- that._drawn()
- }
- };
- that._dataExchanger = new dataExchangerModule.DataExchanger;
- that._projection = new projectionModule.Projection({
- centerChanged: function(value) {
- if (!preventProjectionEvents) {
- that._eventTrigger("centerChanged", {
- center: value
- })
- }
- },
- zoomChanged: function(value) {
- if (!preventProjectionEvents) {
- that._eventTrigger("zoomFactorChanged", {
- zoomFactor: value
- })
- }
- }
- });
- that._tracker = new trackerModule.Tracker({
- root: that._root,
- projection: that._projection,
- dataKey: dataKey
- });
- that._gestureHandler = new gestureHandlerModule.GestureHandler({
- projection: that._projection,
- renderer: that._renderer,
- tracker: that._tracker
- });
- that._layoutControl = new layoutModule.LayoutControl;
- that._layoutControl.suspend();
- that._initLayerCollection(dataKey);
- that._initControlBar(dataKey);
- that._initLegendsControl();
- that._tooltipViewer = new tooltipViewerModule.TooltipViewer({
- tracker: that._tracker,
- tooltip: that._tooltip,
- layerCollection: that._layerCollection
- })
- },
- _change_RESUME_LAYOUT: function() {
- this._layoutControl.resume()
- },
- _initialChanges: ["PROJECTION", "RESUME_LAYOUT", "LAYOUT_INIT", "BOUNDS", "MAX_ZOOM_FACTOR", "ZOOM_FACTOR", "CENTER"],
- _layoutChangesOrder: ["RESUME_LAYOUT", "LAYERS"],
- _initCore: function() {
- this._root = this._renderer.root.attr({
- align: "center",
- cursor: "default"
- });
- this._initElements()
- },
- _disposeCore: function() {
- var that = this;
- that._controlBar.dispose();
- that._gestureHandler.dispose();
- that._tracker.dispose();
- that._legendsControl.dispose();
- that._layerCollection.dispose();
- that._layoutControl.dispose();
- that._tooltipViewer.dispose();
- that._dataExchanger.dispose();
- that._projection.dispose();
- that._dataExchanger = that._gestureHandler = that._projection = that._tracker = that._layoutControl = that._root = that._layerCollection = that._controlBar = that._legendsControl = null
- },
- _setupInteraction: function() {
- var options = {
- centeringEnabled: !!_parseScalar(this._getOption("panningEnabled", true), true),
- zoomingEnabled: !!_parseScalar(this._getOption("zoomingEnabled", true), true)
- };
- this._gestureHandler.setInteraction(options);
- this._controlBar.setInteraction(options)
- },
- _getDefaultSize: function() {
- return {
- width: DEFAULT_WIDTH,
- height: DEFAULT_HEIGHT
- }
- },
- _applySize: function(rect) {
- var layout = {
- left: rect[0],
- top: rect[1],
- width: rect[2] - rect[0],
- height: rect[3] - rect[1],
- right: 0,
- bottom: 0
- };
- this._projection.setSize(layout);
- this._layoutControl.setSize(layout);
- this._layerCollection.setRect([layout.left, layout.top, layout.width, layout.height])
- },
- _optionChanging: function(name, currentValue, nextValue) {
- if (currentValue && nextValue) {
- if (RE_STARTS_LAYERS.test(name)) {
- if (currentValue.dataSource && nextValue.dataSource && currentValue !== nextValue) {
- currentValue.dataSource = null
- } else {
- if (RE_ENDS_DATA_SOURCE.test(name)) {
- this.option(name, null)
- }
- }
- }
- }
- },
- _applyChanges: function() {
- this._notifyDirty();
- this.callBase.apply(this, arguments);
- this._notifyReady()
- },
- _optionChangesMap: {
- background: "BACKGROUND",
- layers: "LAYERS",
- controlBar: "CONTROL_BAR",
- legends: "LEGENDS",
- touchEnabled: "TRACKER",
- wheelEnabled: "TRACKER",
- panningEnabled: "INTERACTION",
- zoomingEnabled: "INTERACTION",
- projection: "PROJECTION",
- bounds: "BOUNDS",
- maxZoomFactor: "MAX_ZOOM_FACTOR",
- zoomFactor: "ZOOM_FACTOR",
- center: "CENTER"
- },
- _optionChangesOrder: ["PROJECTION", "BOUNDS", "MAX_ZOOM_FACTOR", "ZOOM_FACTOR", "CENTER", "BACKGROUND", "CONTROL_BAR", "LEGENDS", "TRACKER", "INTERACTION"],
- _change_PROJECTION: function() {
- this._setProjection()
- },
- _change_BOUNDS: function() {
- this._setBounds()
- },
- _change_MAX_ZOOM_FACTOR: function() {
- this._setMaxZoom()
- },
- _change_ZOOM_FACTOR: function() {
- this._setZoom()
- },
- _change_CENTER: function() {
- this._setCenter()
- },
- _change_BACKGROUND: function() {
- this._setBackgroundOptions()
- },
- _change_LAYERS: function() {
- this._setLayerCollectionOptions()
- },
- _change_CONTROL_BAR: function() {
- this._setControlBarOptions()
- },
- _change_LEGENDS: function() {
- this._setLegendsOptions()
- },
- _change_TRACKER: function() {
- this._setTrackerOptions()
- },
- _change_INTERACTION: function() {
- this._setupInteraction()
- },
- _themeDependentChanges: ["BACKGROUND", "LAYERS", "CONTROL_BAR", "LEGENDS", "TRACKER", "INTERACTION"],
- _setProjection: function() {
- this._projection.setEngine(this.option("projection"))
- },
- _setBounds: function() {
- this._projection.setBounds(this.option("bounds"))
- },
- _setMaxZoom: function() {
- this._projection.setMaxZoom(this.option("maxZoomFactor"))
- },
- _setZoom: function() {
- this._projection.setZoom(this.option("zoomFactor"))
- },
- _setCenter: function() {
- this._projection.setCenter(this.option("center"))
- },
- _setBackgroundOptions: function() {
- this._layerCollection.setBackgroundOptions(this._getOption("background"))
- },
- _setLayerCollectionOptions: function() {
- this._layerCollection.setOptions(this.option("layers"))
- },
- _setControlBarOptions: function() {
- this._controlBar.setOptions(this._getOption("controlBar"))
- },
- _setLegendsOptions: function() {
- this._legendsControl.setOptions(this.option("legends"))
- },
- _setTrackerOptions: function() {
- this._tracker.setOptions({
- touchEnabled: this._getOption("touchEnabled", true),
- wheelEnabled: this._getOption("wheelEnabled", true)
- })
- },
- getLayers: function() {
- var layers = this._layerCollection.items();
- var list = [];
- var i;
- var ii = list.length = layers.length;
- for (i = 0; i < ii; ++i) {
- list[i] = layers[i].proxy
- }
- return list
- },
- getLayerByIndex: function(index) {
- var layer = this._layerCollection.byIndex(index);
- return layer ? layer.proxy : null
- },
- getLayerByName: function(name) {
- var layer = this._layerCollection.byName(name);
- return layer ? layer.proxy : null
- },
- clearSelection: function(_noEvent) {
- var layers = this._layerCollection.items();
- var i;
- var ii = layers.length;
- for (i = 0; i < ii; ++i) {
- layers[i].clearSelection(_noEvent)
- }
- return this
- },
- center: function(value) {
- var that = this;
- if (void 0 === value) {
- return that._projection.getCenter()
- } else {
- that._projection.setCenter(value);
- return that
- }
- },
- zoomFactor: function(value) {
- var that = this;
- if (void 0 === value) {
- return that._projection.getZoom()
- } else {
- that._projection.setZoom(value);
- return that
- }
- },
- viewport: function(value) {
- var that = this;
- if (void 0 === value) {
- return that._projection.getViewport()
- } else {
- that._projection.setViewport(value);
- return that
- }
- },
- convertCoordinates: function(coordinates) {
- coordinates = coordinates && coordinates.length ? coordinates : [arguments[0], arguments[1]];
- return this._projection.fromScreenPoint(coordinates)
- }
- });
- __webpack_require__( /*! ../../core/component_registrator */ 9)("dxVectorMap", dxVectorMap);
- module.exports = dxVectorMap;
- module.exports._TESTS_resetDataKey = function() {
- nextDataKey = 1
- };
- dxVectorMap.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
- dxVectorMap.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
- dxVectorMap.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
- dxVectorMap.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin)
- },
- /*!************************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/control_bar.js ***!
- \************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _math = Math;
- var _min = _math.min;
- var _max = _math.max;
- var _round = _math.round;
- var _floor = _math.floor;
- var _sqrt = _math.sqrt;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _parseScalar = vizUtils.parseScalar;
- var parseHorizontalAlignment = vizUtils.enumParser(["left", "center", "right"]);
- var parseVerticalAlignment = vizUtils.enumParser(["top", "bottom"]);
- var COMMAND_RESET = "command-reset";
- var COMMAND_MOVE_UP = "command-move-up";
- var COMMAND_MOVE_RIGHT = "command-move-right";
- var COMMAND_MOVE_DOWN = "command-move-down";
- var COMMAND_MOVE_LEFT = "command-move-left";
- var COMMAND_ZOOM_IN = "command-zoom-in";
- var COMMAND_ZOOM_OUT = "command-zoom-out";
- var COMMAND_ZOOM_DRAG_LINE = "command-zoom-drag-line";
- var COMMAND_ZOOM_DRAG = "command-zoom-drag";
- var EVENT_TARGET_TYPE = "control-bar";
- var FLAG_CENTERING = 1;
- var FLAG_ZOOMING = 2;
- var SIZE_OPTIONS = {
- bigCircleSize: 58,
- smallCircleSize: 28,
- buttonSize: 10,
- arrowButtonOffset: 20,
- incDecButtonSize: 11,
- incButtonOffset: 66,
- decButtonOffset: 227,
- sliderLineStartOffset: 88.5,
- sliderLineEndOffset: 205.5,
- sliderLength: 20,
- sliderWidth: 8,
- trackerGap: 4
- };
- var OFFSET_X = 30.5;
- var OFFSET_Y = 30.5;
- var TOTAL_WIDTH = 61;
- var TOTAL_HEIGHT = 274;
- var COMMAND_TO_TYPE_MAP = {};
- COMMAND_TO_TYPE_MAP[COMMAND_RESET] = ResetCommand;
- COMMAND_TO_TYPE_MAP[COMMAND_MOVE_UP] = COMMAND_TO_TYPE_MAP[COMMAND_MOVE_RIGHT] = COMMAND_TO_TYPE_MAP[COMMAND_MOVE_DOWN] = COMMAND_TO_TYPE_MAP[COMMAND_MOVE_LEFT] = MoveCommand;
- COMMAND_TO_TYPE_MAP[COMMAND_ZOOM_IN] = COMMAND_TO_TYPE_MAP[COMMAND_ZOOM_OUT] = ZoomCommand;
- COMMAND_TO_TYPE_MAP[COMMAND_ZOOM_DRAG] = ZoomDragCommand;
- function ControlBar(parameters) {
- var that = this;
- that._params = parameters;
- that._createElements(parameters.renderer, parameters.container, parameters.dataKey);
- parameters.layoutControl.addItem(that);
- that._subscribeToProjection(parameters.projection);
- that._subscribeToTracker(parameters.tracker);
- that._createCallbacks(parameters.projection)
- }
- ControlBar.prototype = {
- constructor: ControlBar,
- _flags: 0,
- dispose: function() {
- var that = this;
- that._params.layoutControl.removeItem(that);
- that._root.linkRemove().linkOff();
- that._offProjection();
- that._offTracker();
- that._params = that._root = that._offProjection = that._offTracker = that._callbacks = null
- },
- _subscribeToProjection: function(projection) {
- var that = this;
- that._offProjection = projection.on({
- engine: function() {
- that._update()
- },
- zoom: updateZoom,
- "max-zoom": function() {
- that._zoomPartition = projection.getZoomScalePartition();
- that._sliderUnitLength = that._sliderLineLength / that._zoomPartition;
- updateZoom()
- }
- });
- function updateZoom() {
- that._adjustZoom(projection.getScaledZoom())
- }
- },
- _subscribeToTracker: function(tracker) {
- var that = this;
- var isActive = false;
- that._offTracker = tracker.on({
- start: function(arg) {
- isActive = arg.data.name === EVENT_TARGET_TYPE;
- if (isActive) {
- that._processStart(arg.data.index, arg)
- }
- },
- move: function(arg) {
- if (isActive) {
- that._processMove(arg.data.index, arg)
- }
- },
- end: function() {
- if (isActive) {
- that._processEnd();
- isActive = false
- }
- }
- })
- },
- _createCallbacks: function(projection) {
- var that = this;
- that._callbacks = {
- reset: function(isCenter, isZoom) {
- if (isCenter) {
- projection.setCenter(null)
- }
- if (isZoom) {
- projection.setZoom(null)
- }
- },
- beginMove: function() {
- projection.beginMoveCenter()
- },
- endMove: function() {
- projection.endMoveCenter()
- },
- move: function(shift) {
- projection.moveCenter(shift)
- },
- zoom: function(_zoom) {
- projection.setScaledZoom(_zoom)
- }
- }
- },
- _createElements: function(renderer, container, dataKey) {
- var that = this;
- that._root = renderer.g().attr({
- "class": "dxm-control-bar"
- }).linkOn(container, "control-bar");
- var buttonsGroups = that._buttonsGroup = renderer.g().attr({
- "class": "dxm-control-buttons"
- }).append(that._root);
- var trackersGroup = renderer.g().attr({
- stroke: "none",
- "stroke-width": 0,
- fill: "#000000",
- opacity: 1e-4
- }).css({
- cursor: "pointer"
- }).append(that._root);
- that._createButtons(renderer, dataKey, buttonsGroups);
- that._createTrackers(renderer, dataKey, trackersGroup)
- },
- _createButtons: function(renderer, dataKey, group) {
- var that = this;
- var options = SIZE_OPTIONS;
- var size = options.buttonSize / 2;
- var offset1 = options.arrowButtonOffset - size;
- var offset2 = options.arrowButtonOffset;
- var incDecButtonSize = options.incDecButtonSize / 2;
- var directionOptions = {
- "stroke-linecap": "square",
- fill: "none"
- };
- var line = "line";
- renderer.circle(0, 0, options.bigCircleSize / 2).append(group);
- renderer.circle(0, 0, size).attr({
- fill: "none"
- }).append(group);
- renderer.path([-size, -offset1, 0, -offset2, size, -offset1], line).attr(directionOptions).append(group);
- renderer.path([offset1, -size, offset2, 0, offset1, size], line).attr(directionOptions).append(group);
- renderer.path([size, offset1, 0, offset2, -size, offset1], line).attr(directionOptions).append(group);
- renderer.path([-offset1, size, -offset2, 0, -offset1, -size], line).attr(directionOptions).append(group);
- renderer.circle(0, options.incButtonOffset, options.smallCircleSize / 2).append(group);
- renderer.path([
- [-incDecButtonSize, options.incButtonOffset, incDecButtonSize, options.incButtonOffset],
- [0, options.incButtonOffset - incDecButtonSize, 0, options.incButtonOffset + incDecButtonSize]
- ], "area").append(group);
- renderer.circle(0, options.decButtonOffset, options.smallCircleSize / 2).append(group);
- renderer.path([-incDecButtonSize, options.decButtonOffset, incDecButtonSize, options.decButtonOffset], "area").append(group);
- that._zoomLine = renderer.path([], "line").append(group);
- that._zoomDrag = renderer.rect(_floor(-options.sliderLength / 2), _floor(options.sliderLineEndOffset - options.sliderWidth / 2), options.sliderLength, options.sliderWidth).append(group);
- that._sliderLineLength = options.sliderLineEndOffset - options.sliderLineStartOffset
- },
- _createTrackers: function(renderer, dataKey, group) {
- var options = SIZE_OPTIONS;
- var size = _round((options.arrowButtonOffset - options.trackerGap) / 2);
- var offset1 = options.arrowButtonOffset - size;
- var offset2 = _round(_sqrt(options.bigCircleSize * options.bigCircleSize / 4 - size * size));
- var size2 = offset2 - offset1;
- renderer.rect(-size, -size, 2 * size, 2 * size).data(dataKey, {
- index: COMMAND_RESET,
- name: EVENT_TARGET_TYPE
- }).append(group);
- renderer.rect(-size, -offset2, 2 * size, size2).data(dataKey, {
- index: COMMAND_MOVE_UP,
- name: EVENT_TARGET_TYPE
- }).append(group);
- renderer.rect(offset1, -size, size2, 2 * size).data(dataKey, {
- index: COMMAND_MOVE_RIGHT,
- name: EVENT_TARGET_TYPE
- }).append(group);
- renderer.rect(-size, offset1, 2 * size, size2).data(dataKey, {
- index: COMMAND_MOVE_DOWN,
- name: EVENT_TARGET_TYPE
- }).append(group);
- renderer.rect(-offset2, -size, size2, 2 * size).data(dataKey, {
- index: COMMAND_MOVE_LEFT,
- name: EVENT_TARGET_TYPE
- }).append(group);
- renderer.circle(0, options.incButtonOffset, options.smallCircleSize / 2).data(dataKey, {
- index: COMMAND_ZOOM_IN,
- name: EVENT_TARGET_TYPE
- }).append(group);
- renderer.circle(0, options.decButtonOffset, options.smallCircleSize / 2).data(dataKey, {
- index: COMMAND_ZOOM_OUT,
- name: EVENT_TARGET_TYPE
- }).append(group);
- renderer.rect(-2, options.sliderLineStartOffset - 2, 4, options.sliderLineEndOffset - options.sliderLineStartOffset + 4).css({
- cursor: "default"
- }).data(dataKey, {
- index: COMMAND_ZOOM_DRAG_LINE,
- name: EVENT_TARGET_TYPE
- }).append(group);
- this._zoomDragTracker = renderer.rect(-options.sliderLength / 2, options.sliderLineEndOffset - options.sliderWidth / 2, options.sliderLength, options.sliderWidth).data(dataKey, {
- index: COMMAND_ZOOM_DRAG,
- name: EVENT_TARGET_TYPE
- }).append(group)
- },
- resize: function(size) {
- if (this._isActive) {
- this._root.attr({
- visibility: null !== size ? null : "hidden"
- })
- }
- },
- getLayoutOptions: function() {
- return this._isActive ? this._layoutOptions : null
- },
- locate: function(x, y) {
- this._root.attr({
- translateX: x + this._margin + OFFSET_X,
- translateY: y + this._margin + OFFSET_Y
- })
- },
- _update: function() {
- var that = this;
- that._isActive = that._isEnabled && that._flags && that._params.projection.isInvertible();
- if (that._isActive) {
- that._root.linkAppend()
- } else {
- that._root.linkRemove()
- }
- that._processEnd();
- that.updateLayout()
- },
- setInteraction: function(interaction) {
- var that = this;
- if (_parseScalar(interaction.centeringEnabled, true)) {
- that._flags |= FLAG_CENTERING
- } else {
- that._flags &= ~FLAG_CENTERING
- }
- if (_parseScalar(interaction.zoomingEnabled, true)) {
- that._flags |= FLAG_ZOOMING
- } else {
- that._flags &= ~FLAG_ZOOMING
- }
- that._update()
- },
- setOptions: function(options) {
- var that = this;
- that._isEnabled = !!_parseScalar(options.enabled, true);
- that._margin = options.margin || 0;
- that._layoutOptions = {
- width: 2 * that._margin + TOTAL_WIDTH,
- height: 2 * that._margin + TOTAL_HEIGHT,
- horizontalAlignment: parseHorizontalAlignment(options.horizontalAlignment, "left"),
- verticalAlignment: parseVerticalAlignment(options.verticalAlignment, "top")
- };
- that._buttonsGroup.attr({
- "stroke-width": options.borderWidth,
- stroke: options.borderColor,
- fill: options.color,
- "fill-opacity": options.opacity
- });
- that._update()
- },
- _adjustZoom: function(zoom) {
- var that = this;
- var start = SIZE_OPTIONS.sliderLineStartOffset;
- var end = SIZE_OPTIONS.sliderLineEndOffset;
- var h = SIZE_OPTIONS.sliderWidth;
- that._zoomFactor = _max(_min(_round(zoom), that._zoomPartition), 0);
- var transform = {
- translateY: -_round(that._zoomFactor * that._sliderUnitLength)
- };
- var y = end - h / 2 + transform.translateY;
- that._zoomLine.attr({
- points: [
- [0, start, 0, _max(start, y)],
- [0, _min(end, y + h), 0, end]
- ]
- });
- that._zoomDrag.attr(transform);
- that._zoomDragTracker.attr(transform)
- },
- _applyZoom: function() {
- this._callbacks.zoom(this._zoomFactor)
- },
- _processStart: function(command, arg) {
- var commandType;
- if (this._isActive) {
- commandType = COMMAND_TO_TYPE_MAP[command];
- this._command = commandType && commandType.flags & this._flags ? new commandType(this, command, arg) : null
- }
- },
- _processMove: function(command, arg) {
- this._command && this._command.update(command, arg)
- },
- _processEnd: function() {
- this._command && this._command.finish();
- this._command = null
- }
- };
- function disposeCommand(command) {
- delete command._owner;
- command.update = function() {};
- command.finish = function() {}
- }
- function ResetCommand(owner, command) {
- this._owner = owner;
- this._command = command
- }
- ResetCommand.flags = FLAG_CENTERING | FLAG_ZOOMING;
- ResetCommand.prototype.update = function(command) {
- command !== this._command && disposeCommand(this)
- };
- ResetCommand.prototype.finish = function() {
- var flags = this._owner._flags;
- this._owner._callbacks.reset(!!(flags & FLAG_CENTERING), !!(flags & FLAG_ZOOMING));
- disposeCommand(this)
- };
- function MoveCommand(owner, command, arg) {
- this._command = command;
- var timeout = null;
- var interval = 100;
- var dx = 0;
- var dy = 0;
- switch (this._command) {
- case COMMAND_MOVE_UP:
- dy = -10;
- break;
- case COMMAND_MOVE_RIGHT:
- dx = 10;
- break;
- case COMMAND_MOVE_DOWN:
- dy = 10;
- break;
- case COMMAND_MOVE_LEFT:
- dx = -10
- }
- function callback() {
- owner._callbacks.move([dx, dy]);
- timeout = setTimeout(callback, interval)
- }
- this._stop = function() {
- clearTimeout(timeout);
- owner._callbacks.endMove();
- this._stop = owner = null;
- return this
- };
- arg = null;
- owner._callbacks.beginMove();
- callback()
- }
- MoveCommand.flags = FLAG_CENTERING;
- MoveCommand.prototype.update = function(command) {
- this._command !== command && this.finish()
- };
- MoveCommand.prototype.finish = function() {
- disposeCommand(this._stop())
- };
- function ZoomCommand(owner, command) {
- this._owner = owner;
- this._command = command;
- var timeout = null;
- var interval = 150;
- var dZoom = this._command === COMMAND_ZOOM_IN ? 1 : -1;
- function callback() {
- owner._adjustZoom(owner._zoomFactor + dZoom);
- timeout = setTimeout(callback, interval)
- }
- this._stop = function() {
- clearTimeout(timeout);
- this._stop = owner = null;
- return this
- };
- callback()
- }
- ZoomCommand.flags = FLAG_ZOOMING;
- ZoomCommand.prototype.update = function(command) {
- this._command !== command && this.finish()
- };
- ZoomCommand.prototype.finish = function() {
- this._owner._applyZoom();
- disposeCommand(this._stop())
- };
- function ZoomDragCommand(owner, command, arg) {
- this._owner = owner;
- this._zoomFactor = owner._zoomFactor;
- this._pos = arg.y
- }
- ZoomDragCommand.flags = FLAG_ZOOMING;
- ZoomDragCommand.prototype.update = function(command, arg) {
- var owner = this._owner;
- owner._adjustZoom(this._zoomFactor + owner._zoomPartition * (this._pos - arg.y) / owner._sliderLineLength)
- };
- ZoomDragCommand.prototype.finish = function() {
- this._owner._applyZoom();
- disposeCommand(this)
- };
- exports.ControlBar = ControlBar;
- var COMMAND_TO_TYPE_MAP__ORIGINAL = COMMAND_TO_TYPE_MAP;
- exports._TESTS_stubCommandToTypeMap = function(map) {
- COMMAND_TO_TYPE_MAP = map
- };
- exports._TESTS_restoreCommandToTypeMap = function() {
- COMMAND_TO_TYPE_MAP = COMMAND_TO_TYPE_MAP__ORIGINAL
- }
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/gesture_handler.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _ln = Math.log;
- var _LN2 = Math.LN2;
- function GestureHandler(params) {
- var that = this;
- that._projection = params.projection;
- that._renderer = params.renderer;
- that._x = that._y = 0;
- that._subscribeToTracker(params.tracker)
- }
- GestureHandler.prototype = {
- constructor: GestureHandler,
- dispose: function() {
- this._offTracker();
- this._offTracker = null
- },
- _subscribeToTracker: function(tracker) {
- var that = this;
- var isActive = false;
- that._offTracker = tracker.on({
- start: function(arg) {
- isActive = "control-bar" !== arg.data.name;
- if (isActive) {
- that._processStart(arg)
- }
- },
- move: function(arg) {
- if (isActive) {
- that._processMove(arg)
- }
- },
- end: function() {
- if (isActive) {
- that._processEnd()
- }
- },
- zoom: function(arg) {
- that._processZoom(arg)
- }
- })
- },
- setInteraction: function(options) {
- this._processEnd();
- this._centeringEnabled = options.centeringEnabled;
- this._zoomingEnabled = options.zoomingEnabled
- },
- _processStart: function(arg) {
- if (this._centeringEnabled) {
- this._x = arg.x;
- this._y = arg.y;
- this._projection.beginMoveCenter()
- }
- },
- _processMove: function(arg) {
- var that = this;
- if (that._centeringEnabled) {
- that._renderer.root.attr({
- cursor: "move"
- });
- that._projection.moveCenter([that._x - arg.x, that._y - arg.y]);
- that._x = arg.x;
- that._y = arg.y
- }
- },
- _processEnd: function() {
- if (this._centeringEnabled) {
- this._renderer.root.attr({
- cursor: "default"
- });
- this._projection.endMoveCenter()
- }
- },
- _processZoom: function(arg) {
- var that = this;
- var delta;
- var screenPosition;
- var coords;
- if (that._zoomingEnabled) {
- if (arg.delta) {
- delta = arg.delta
- } else {
- if (arg.ratio) {
- delta = _ln(arg.ratio) / _LN2
- }
- }
- if (that._centeringEnabled) {
- screenPosition = that._renderer.getRootOffset();
- screenPosition = [arg.x - screenPosition.left, arg.y - screenPosition.top];
- coords = that._projection.fromScreenPoint(screenPosition)
- }
- that._projection.changeScaledZoom(delta);
- if (that._centeringEnabled) {
- that._projection.setCenterByPoint(coords, screenPosition)
- }
- }
- }
- };
- exports.GestureHandler = GestureHandler
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/tracker.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
- var _events_engine2 = _interopRequireDefault(_events_engine);
- var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
- var _window2 = _interopRequireDefault(_window);
- var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
- var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
- var _event_emitter = __webpack_require__( /*! ./event_emitter */ 416);
- var _event_emitter2 = _interopRequireDefault(_event_emitter);
- var _utils = __webpack_require__( /*! ../../events/utils */ 8);
- var _utils2 = _interopRequireDefault(_utils);
- var _wheel = __webpack_require__( /*! ../../events/core/wheel */ 124);
- var _utils3 = __webpack_require__( /*! ../core/utils */ 10);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- var navigator = _window2.default.getNavigator();
- var _math = Math;
- var _abs = _math.abs;
- var _sqrt = _math.sqrt;
- var _round = _math.round;
- var _addNamespace = _utils2.default.addNamespace;
- var _now = Date.now;
- var _NAME = "dxVectorMap";
- var EVENT_START = "start";
- var EVENT_MOVE = "move";
- var EVENT_END = "end";
- var EVENT_ZOOM = "zoom";
- var EVENT_HOVER_ON = "hover-on";
- var EVENT_HOVER_OFF = "hover-off";
- var EVENT_CLICK = "click";
- var EVENT_FOCUS_ON = "focus-on";
- var EVENT_FOCUS_MOVE = "focus-move";
- var EVENT_FOCUS_OFF = "focus-off";
- var CLICK_TIME_THRESHOLD = 500;
- var CLICK_COORD_THRESHOLD_MOUSE = 5;
- var CLICK_COORD_THRESHOLD_TOUCH = 20;
- var DRAG_COORD_THRESHOLD_MOUSE = 5;
- var DRAG_COORD_THRESHOLD_TOUCH = 10;
- var FOCUS_OFF_DELAY = 100;
- var WHEEL_COOLDOWN = 50;
- var WHEEL_DIRECTION_COOLDOWN = 300;
- var EVENTS;
- setupEvents();
- function Tracker(parameters) {
- var that = this;
- that._root = parameters.root;
- that._createEventHandlers(parameters.dataKey);
- that._createProjectionHandlers(parameters.projection);
- that._initEvents();
- that._focus = new Focus(function(name, arg) {
- that._fire(name, arg)
- });
- that._attachHandlers()
- }
- Tracker.prototype = {
- constructor: Tracker,
- dispose: function() {
- var that = this;
- that._detachHandlers();
- that._disposeEvents();
- that._focus.dispose();
- that._root = that._focus = that._docHandlers = that._rootHandlers = null
- },
- _eventNames: [EVENT_START, EVENT_MOVE, EVENT_END, EVENT_ZOOM, EVENT_CLICK, EVENT_HOVER_ON, EVENT_HOVER_OFF, EVENT_FOCUS_ON, EVENT_FOCUS_OFF, EVENT_FOCUS_MOVE],
- _startClick: function(event, data) {
- if (!data) {
- return
- }
- var coords = getEventCoords(event);
- this._clickState = {
- x: coords.x,
- y: coords.y,
- threshold: isTouchEvent(event) ? CLICK_COORD_THRESHOLD_TOUCH : CLICK_COORD_THRESHOLD_MOUSE,
- time: _now()
- }
- },
- _endClick: function(event, data) {
- var state = this._clickState;
- if (!state) {
- return
- }
- if (data && _now() - state.time <= CLICK_TIME_THRESHOLD) {
- var threshold = state.threshold;
- var coords = getEventCoords(event);
- if (_abs(coords.x - state.x) <= threshold && _abs(coords.y - state.y) <= threshold) {
- this._fire(EVENT_CLICK, {
- data: data,
- x: coords.x,
- y: coords.y,
- $event: event
- })
- }
- }
- this._clickState = null
- },
- _startDrag: function(event, data) {
- if (!data) {
- return
- }
- var coords = getEventCoords(event);
- var state = this._dragState = {
- x: coords.x,
- y: coords.y,
- data: data
- };
- this._fire(EVENT_START, {
- x: state.x,
- y: state.y,
- data: state.data
- })
- },
- _moveDrag: function(event, data) {
- var state = this._dragState;
- if (!state) {
- return
- }
- var coords = getEventCoords(event);
- var threshold = isTouchEvent(event) ? DRAG_COORD_THRESHOLD_TOUCH : DRAG_COORD_THRESHOLD_MOUSE;
- if (state.active || _abs(coords.x - state.x) > threshold || _abs(coords.y - state.y) > threshold) {
- state.x = coords.x;
- state.y = coords.y;
- state.active = true;
- state.data = data || {};
- this._fire(EVENT_MOVE, {
- x: state.x,
- y: state.y,
- data: state.data
- })
- }
- },
- _endDrag: function() {
- var state = this._dragState;
- if (!state) {
- return
- }
- this._dragState = null;
- this._fire(EVENT_END, {
- x: state.x,
- y: state.y,
- data: state.data
- })
- },
- _wheelZoom: function(event, data) {
- if (!data) {
- return
- }
- var that = this;
- var lock = that._wheelLock;
- var time = _now();
- if (time - lock.time <= WHEEL_COOLDOWN) {
- return
- }
- if (time - lock.dirTime > WHEEL_DIRECTION_COOLDOWN) {
- lock.dir = 0
- }
- var delta = adjustWheelDelta(event.delta / 120 || 0, lock);
- if (0 === delta) {
- return
- }
- var coords = getEventCoords(event);
- that._fire(EVENT_ZOOM, {
- delta: delta,
- x: coords.x,
- y: coords.y
- });
- lock.time = lock.dirTime = time
- },
- _startZoom: function(event, data) {
- if (!isTouchEvent(event) || !data) {
- return
- }
- var state = this._zoomState = this._zoomState || {};
- var coords;
- var pointer2;
- if (state.pointer1 && state.pointer2) {
- return
- }
- if (void 0 === state.pointer1) {
- state.pointer1 = getPointerId(event) || 0;
- coords = getMultitouchEventCoords(event, state.pointer1);
- state.x1 = state.x1_0 = coords.x;
- state.y1 = state.y1_0 = coords.y
- }
- if (void 0 === state.pointer2) {
- pointer2 = getPointerId(event) || 1;
- if (pointer2 !== state.pointer1) {
- coords = getMultitouchEventCoords(event, pointer2);
- if (coords) {
- state.x2 = state.x2_0 = coords.x;
- state.y2 = state.y2_0 = coords.y;
- state.pointer2 = pointer2;
- state.ready = true;
- this._endDrag()
- }
- }
- }
- },
- _moveZoom: function(event) {
- var state = this._zoomState;
- var coords;
- if (!state || !isTouchEvent(event)) {
- return
- }
- if (void 0 !== state.pointer1) {
- coords = getMultitouchEventCoords(event, state.pointer1);
- if (coords) {
- state.x1 = coords.x;
- state.y1 = coords.y
- }
- }
- if (void 0 !== state.pointer2) {
- coords = getMultitouchEventCoords(event, state.pointer2);
- if (coords) {
- state.x2 = coords.x;
- state.y2 = coords.y
- }
- }
- },
- _endZoom: function(event) {
- var state = this._zoomState;
- if (!state || !isTouchEvent(event)) {
- return
- }
- if (state.ready) {
- var startDistance = getDistance(state.x1_0, state.y1_0, state.x2_0, state.y2_0);
- var currentDistance = getDistance(state.x1, state.y1, state.x2, state.y2);
- this._fire(EVENT_ZOOM, {
- ratio: currentDistance / startDistance,
- x: (state.x1_0 + state.x2_0) / 2,
- y: (state.y1_0 + state.y2_0) / 2
- })
- }
- this._zoomState = null
- },
- _startHover: function(event, data) {
- this._doHover(event, data, true)
- },
- _moveHover: function(event, data) {
- this._doHover(event, data, false)
- },
- _doHover: function(event, data, isTouch) {
- var that = this;
- if (that._dragState && that._dragState.active || that._zoomState && that._zoomState.ready) {
- that._cancelHover();
- return
- }
- if (isTouchEvent(event) !== isTouch || that._hoverTarget === event.target || that._hoverState && that._hoverState.data === data) {
- return
- }
- that._cancelHover();
- if (data) {
- that._hoverState = {
- data: data
- };
- that._fire(EVENT_HOVER_ON, {
- data: data
- })
- }
- that._hoverTarget = event.target
- },
- _cancelHover: function() {
- var state = this._hoverState;
- this._hoverState = this._hoverTarget = null;
- if (state) {
- this._fire(EVENT_HOVER_OFF, {
- data: state.data
- })
- }
- },
- _startFocus: function(event, data) {
- this._doFocus(event, data, true)
- },
- _moveFocus: function(event, data) {
- this._doFocus(event, data, false)
- },
- _doFocus: function(event, data, isTouch) {
- var that = this;
- if (that._dragState && that._dragState.active || that._zoomState && that._zoomState.ready) {
- that._cancelFocus();
- return
- }
- if (isTouchEvent(event) !== isTouch) {
- return
- }
- that._focus.turnOff();
- data && that._focus.turnOn(data, getEventCoords(event))
- },
- _cancelFocus: function() {
- this._focus.cancel()
- },
- _createEventHandlers: function(DATA_KEY) {
- var that = this;
- that._docHandlers = {};
- that._rootHandlers = {};
- that._rootHandlers[EVENTS.start] = that._docHandlers[EVENTS.start] = function(event) {
- var isTouch = isTouchEvent(event);
- var data = getData(event);
- if (isTouch && !that._isTouchEnabled) {
- return
- }
- if (data) {
- event.preventDefault();
- event.stopPropagation()
- }
- that._startClick(event, data);
- that._startDrag(event, data);
- that._startZoom(event, data);
- that._startHover(event, data);
- that._startFocus(event, data)
- };
- that._docHandlers[EVENTS.move] = function(event) {
- var isTouch = isTouchEvent(event);
- var data = getData(event);
- if (isTouch && !that._isTouchEnabled) {
- return
- }
- that._moveDrag(event, data);
- that._moveZoom(event, data);
- that._moveHover(event, data);
- that._moveFocus(event, data)
- };
- that._docHandlers[EVENTS.end] = function(event) {
- var isTouch = isTouchEvent(event);
- var data = getData(event);
- if (isTouch && !that._isTouchEnabled) {
- return
- }
- that._endClick(event, data);
- that._endDrag(event, data);
- that._endZoom(event, data)
- };
- that._rootHandlers[EVENTS.wheel] = function(event) {
- that._cancelFocus();
- if (!that._isWheelEnabled) {
- return
- }
- var data = getData(event);
- if (data) {
- event.preventDefault();
- event.stopPropagation();
- that._wheelZoom(event, data)
- }
- };
- that._wheelLock = {
- dir: 0
- };
- function getData(event) {
- var target = event.target;
- return ("tspan" === target.tagName ? target.parentNode : target)[DATA_KEY]
- }
- },
- _createProjectionHandlers: function(projection) {
- var that = this;
- projection.on({
- center: handler,
- zoom: handler
- });
- function handler() {
- that._cancelFocus()
- }
- },
- reset: function() {
- var that = this;
- that._clickState = null;
- that._endDrag();
- that._cancelHover();
- that._cancelFocus()
- },
- setOptions: function(options) {
- var that = this;
- that.reset();
- that._detachHandlers();
- that._isTouchEnabled = !!(0, _utils3.parseScalar)(options.touchEnabled, true);
- that._isWheelEnabled = !!(0, _utils3.parseScalar)(options.wheelEnabled, true);
- that._attachHandlers()
- },
- _detachHandlers: function() {
- var that = this;
- if (that._isTouchEnabled) {
- that._root.css({
- "touch-action": "",
- "-webkit-user-select": ""
- }).off(_addNamespace("MSHoldVisual", _NAME)).off(_addNamespace("contextmenu", _NAME))
- }
- _events_engine2.default.off(_dom_adapter2.default.getDocument(), that._docHandlers);
- that._root.off(that._rootHandlers)
- },
- _attachHandlers: function() {
- var that = this;
- if (that._isTouchEnabled) {
- that._root.css({
- "touch-action": "none",
- "-webkit-user-select": "none"
- }).on(_addNamespace("MSHoldVisual", _NAME), function(event) {
- event.preventDefault()
- }).on(_addNamespace("contextmenu", _NAME), function(event) {
- isTouchEvent(event) && event.preventDefault()
- })
- }
- _events_engine2.default.on(_dom_adapter2.default.getDocument(), that._docHandlers);
- that._root.on(that._rootHandlers)
- }
- };
- var Focus = function(fire) {
- var that = this;
- var _activeData = null;
- var _data = null;
- var _disabled = false;
- var _offTimer = null;
- var _x;
- var _y;
- that.dispose = function() {
- clearTimeout(_offTimer);
- that.turnOn = that.turnOff = that.cancel = that.dispose = that = fire = _activeData = _data = _offTimer = null
- };
- that.turnOn = function(data, coords) {
- if (data === _data && _disabled) {
- return
- }
- _disabled = false;
- _data = data;
- if (_activeData) {
- _x = coords.x;
- _y = coords.y;
- if (_data === _activeData) {
- fire(EVENT_FOCUS_MOVE, {
- data: _data,
- x: _x,
- y: _y
- });
- onCheck(true)
- } else {
- fire(EVENT_FOCUS_ON, {
- data: _data,
- x: _x,
- y: _y,
- done: onCheck
- })
- }
- } else {
- _x = coords.x;
- _y = coords.y;
- fire(EVENT_FOCUS_ON, {
- data: _data,
- x: _x,
- y: _y,
- done: onCheck
- })
- }
- function onCheck(result) {
- _disabled = !result;
- if (result) {
- _activeData = _data;
- clearTimeout(_offTimer);
- _offTimer = null
- }
- }
- };
- that.turnOff = function() {
- _data = null;
- if (_activeData && !_disabled) {
- _offTimer = _offTimer || setTimeout(function() {
- _offTimer = null;
- fire(EVENT_FOCUS_OFF, {
- data: _activeData
- });
- _activeData = null
- }, FOCUS_OFF_DELAY)
- }
- };
- that.cancel = function() {
- clearTimeout(_offTimer);
- if (_activeData) {
- fire(EVENT_FOCUS_OFF, {
- data: _activeData
- })
- }
- _activeData = _data = _offTimer = null
- }
- };
- _event_emitter2.default.makeEventEmitter(Tracker);
- exports.Tracker = Tracker;
- var originFocus = Focus;
- exports._DEBUG_forceEventMode = function(mode) {
- setupEvents(mode)
- };
- exports.Focus = Focus;
- exports._DEBUG_stubFocusType = function(focusType) {
- Focus = focusType
- };
- exports._DEBUG_restoreFocusType = function() {
- Focus = originFocus
- };
- function getDistance(x1, y1, x2, y2) {
- return _sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
- }
- function isTouchEvent(event) {
- var type = event.originalEvent.type;
- var pointerType = event.originalEvent.pointerType;
- return /^touch/.test(type) || /^MSPointer/.test(type) && 4 !== pointerType || /^pointer/.test(type) && "mouse" !== pointerType
- }
- function selectItem(flags, items) {
- var i = 0;
- var ii = flags.length;
- var item;
- for (; i < ii; ++i) {
- if (flags[i]) {
- item = items[i];
- break
- }
- }
- return _addNamespace(item || items[i], _NAME)
- }
- function setupEvents() {
- var flags = [navigator.pointerEnabled, navigator.msPointerEnabled, _window2.default.hasProperty("ontouchstart")];
- if (arguments.length) {
- flags = ["pointer" === arguments[0], "MSPointer" === arguments[0], "touch" === arguments[0]]
- }
- EVENTS = {
- start: selectItem(flags, ["pointerdown", "MSPointerDown", "touchstart mousedown", "mousedown"]),
- move: selectItem(flags, ["pointermove", "MSPointerMove", "touchmove mousemove", "mousemove"]),
- end: selectItem(flags, ["pointerup", "MSPointerUp", "touchend mouseup", "mouseup"]),
- wheel: _addNamespace(_wheel.name, _NAME)
- }
- }
- function getEventCoords(event) {
- var originalEvent = event.originalEvent;
- var touch = originalEvent.touches && originalEvent.touches[0] || {};
- return {
- x: touch.pageX || originalEvent.pageX || event.pageX,
- y: touch.pageY || originalEvent.pageY || event.pageY
- }
- }
- function getPointerId(event) {
- return event.originalEvent.pointerId
- }
- function getMultitouchEventCoords(event, pointerId) {
- var originalEvent = event.originalEvent;
- if (void 0 !== originalEvent.pointerId) {
- originalEvent = originalEvent.pointerId === pointerId ? originalEvent : null
- } else {
- originalEvent = originalEvent.touches[pointerId]
- }
- return originalEvent ? {
- x: originalEvent.pageX || event.pageX,
- y: originalEvent.pageY || event.pageY
- } : null
- }
- function adjustWheelDelta(delta, lock) {
- if (0 === delta) {
- return 0
- }
- var _delta = _abs(delta);
- var sign = _round(delta / _delta);
- if (lock.dir && sign !== lock.dir) {
- return 0
- }
- lock.dir = sign;
- if (_delta < .1) {
- _delta = 0
- } else {
- if (_delta < 1) {
- _delta = 1
- } else {
- if (_delta > 4) {
- _delta = 4
- } else {
- _delta = _round(_delta)
- }
- }
- }
- return sign * _delta
- }
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/data_exchanger.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
- function DataExchanger() {
- this._store = {}
- }
- DataExchanger.prototype = {
- constructor: DataExchanger,
- dispose: function() {
- this._store = null;
- return this
- },
- _get: function(category, name) {
- var store = this._store[category] || (this._store[category] = {});
- return store[name] || (store[name] = {
- callbacks: Callbacks()
- })
- },
- set: function(category, name, data) {
- var item = this._get(category, name);
- item.data = data;
- item.callbacks.fire(data);
- return this
- },
- bind: function(category, name, callback) {
- var item = this._get(category, name);
- item.callbacks.add(callback);
- item.data && callback(item.data);
- return this
- },
- unbind: function(category, name, callback) {
- var item = this._get(category, name);
- item.callbacks.remove(callback);
- return this
- }
- };
- exports.DataExchanger = DataExchanger
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/legend.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var _extend = extend;
- var _each = each;
- var legendModule = __webpack_require__( /*! ../components/legend */ 201);
- var _BaseLegend = legendModule.Legend;
- var unknownSource = {
- category: "UNKNOWN",
- name: "UNKNOWN"
- };
- function buildData(partition, values, field) {
- var i;
- var ii = values.length;
- var list = [];
- var item;
- for (i = 0; i < ii; ++i) {
- list[i] = item = {
- start: partition[i],
- end: partition[i + 1],
- index: i
- };
- item[field] = values[i];
- item.states = {
- normal: {
- fill: item.color
- }
- };
- item.visible = true
- }
- return list
- }
- var Legend = function(parameters) {
- var that = this;
- that._params = parameters;
- that._root = parameters.renderer.g().attr({
- "class": "dxm-legend"
- }).linkOn(parameters.container, {
- name: "legend",
- after: "legend-base"
- }).enableLinks().linkAppend();
- parameters.layoutControl.addItem(that);
- _BaseLegend.call(that, {
- renderer: parameters.renderer,
- group: that._root,
- backgroundClass: null,
- itemsGroupClass: null,
- textField: "text",
- getFormatObject: function(data) {
- return data
- }
- });
- that._onDataChanged = function(data) {
- that._updateData(data)
- }
- };
- Legend.prototype = _extend(__webpack_require__( /*! ../../core/utils/object */ 47).clone(_BaseLegend.prototype), {
- constructor: Legend,
- dispose: function() {
- var that = this;
- that._params.layoutControl.removeItem(that);
- that._unbindData();
- that._root.linkRemove().linkOff();
- that._params = that._root = that._onDataChanged = null;
- return _BaseLegend.prototype.dispose.apply(that, arguments)
- },
- resize: function(size) {
- this._params.notifyDirty();
- if (null === size) {
- this.erase()
- } else {
- this.draw(size.width, size.height)
- }
- this._params.notifyReady()
- },
- locate: _BaseLegend.prototype.shift,
- _updateData: function(data) {
- this._options.defaultColor = data && data.defaultColor;
- this.update(data ? buildData(data.partition, data.values, this._dataName) : [], this._options, this._params.themeManager.theme("legend").title);
- this.updateLayout()
- },
- _unbindData: function() {
- if (this._dataCategory) {
- this._params.dataExchanger.unbind(this._dataCategory, this._dataName, this._onDataChanged)
- }
- },
- _bindData: function(arg) {
- this._params.dataExchanger.bind(this._dataCategory = arg.category, this._dataName = arg.name, this._onDataChanged)
- },
- setOptions: function(options) {
- var that = this;
- that.update(that._data, options, this._params.themeManager.theme("legend").title);
- that._unbindData();
- var source = options.source;
- that._bindData(source ? {
- category: source.layer,
- name: source.grouping
- } : unknownSource);
- that.updateLayout();
- return that
- }
- });
- function LegendsControl(parameters) {
- this._params = parameters;
- this._items = [];
- parameters.container.virtualLink("legend-base")
- }
- LegendsControl.prototype = {
- constructor: LegendsControl,
- dispose: function() {
- _each(this._items, function(_, item) {
- item.dispose()
- });
- this._params = this._items = null
- },
- setOptions: function(options) {
- var optionList = options && options.length ? options : [];
- var items = this._items;
- var i;
- var ii = optionList.length;
- var params = this._params;
- var theme = params.themeManager.theme("legend");
- for (i = items.length; i < ii; ++i) {
- items[i] = new Legend(params)
- }
- for (i = items.length - 1; i >= ii; --i) {
- items[i].dispose();
- items.splice(i, 1)
- }
- params.layoutControl.suspend();
- for (i = 0; i < ii; ++i) {
- items[i].setOptions(_extend(true, {}, theme, optionList[i]))
- }
- params.layoutControl.resume()
- }
- };
- exports.LegendsControl = LegendsControl;
- var originalLegend = Legend;
- exports._TESTS_Legend = Legend;
- exports._TESTS_stubLegendType = function(stub) {
- Legend = stub
- };
- exports._TESTS_restoreLegendType = function() {
- Legend = originalLegend
- }
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/layout.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var _round = Math.round;
- var _min = Math.min;
- var _max = Math.max;
- var _each = each;
- var _inArray = inArray;
- var horizontalAlignmentMap = {
- left: 0,
- center: 1,
- right: 2
- };
- var verticalAlignmentMap = {
- top: 0,
- bottom: 1
- };
- function getCellIndex(options) {
- return 3 * verticalAlignmentMap[options.verticalAlignment] + horizontalAlignmentMap[options.horizontalAlignment]
- }
- function createCells(canvas, items) {
- var hStep = (canvas.right - canvas.left) / 3;
- var vStep = (canvas.bottom - canvas.top) / 2;
- var h1 = canvas.left;
- var h2 = _round(h1 + hStep);
- var h3 = _round(h1 + hStep + hStep);
- var h4 = canvas.right;
- var v1 = canvas.top;
- var v2 = _round(v1 + vStep);
- var v3 = canvas.bottom;
- var cells = [{
- rect: [h1, v1, h2, v2]
- }, {
- rect: [h2, v1, h3, v2],
- center: true
- }, {
- rect: [h3, v1, h4, v2],
- horInversion: true
- }, {
- rect: [h1, v2, h2, v3],
- verInversion: true
- }, {
- rect: [h2, v2, h3, v3],
- center: true,
- verInversion: true
- }, {
- rect: [h3, v2, h4, v3],
- horInversion: true,
- verInversion: true
- }];
- var itemsList = [
- [],
- [],
- [],
- [],
- [],
- []
- ];
- _each(items, function(_, item) {
- var options = item.getLayoutOptions();
- if (options) {
- itemsList[getCellIndex(options)].push({
- item: item,
- width: options.width,
- height: options.height
- })
- }
- });
- _each(cells, function(i, cell) {
- if (itemsList[i].length) {
- cell.items = itemsList[i]
- } else {
- if (cell.center) {
- cell.rect[0] = cell.rect[2] = (cell.rect[0] + cell.rect[2]) / 2
- } else {
- cell.rect[cell.horInversion ? 0 : 2] = cell.rect[cell.horInversion ? 2 : 0]
- }
- cell.rect[cell.verInversion ? 1 : 3] = cell.rect[cell.verInversion ? 3 : 1]
- }
- });
- return cells
- }
- function adjustCellSizes(cells) {
- _each([0, 1, 2, 3, 4, 5], function(_, index) {
- var cell = cells[index];
- var otherCell = cells[(index + 3) % 6];
- if (cell.items) {
- if (!otherCell.items) {
- cell.rect[1] = _min(cell.rect[1], otherCell.rect[3]);
- cell.rect[3] = _max(cell.rect[3], otherCell.rect[1])
- }
- }
- });
- _each([1, 4], function(_, index) {
- var cell = cells[index];
- var otherCell1 = cells[index - 1];
- var otherCell2 = cells[index + 1];
- var size1;
- var size2;
- if (cell.items) {
- if (!otherCell1.items && !otherCell2.items) {
- size1 = cell.rect[0] - otherCell1.rect[2];
- size2 = otherCell2.rect[0] - cell.rect[2];
- if (size1 > size2) {
- if (size1 / size2 >= 2) {
- cell.rect[0] -= size1;
- cell.right = true
- } else {
- cell.rect[0] -= size2;
- cell.rect[2] += size2
- }
- } else {
- if (size2 / size1 >= 2) {
- cell.rect[2] += size2;
- cell.center = null
- } else {
- cell.rect[0] -= size1;
- cell.rect[2] += size1
- }
- }
- }
- } else {
- if (otherCell1.items) {
- otherCell1.rect[2] = (cell.rect[0] + cell.rect[2]) / 2
- }
- if (otherCell2.items) {
- otherCell2.rect[0] = (cell.rect[0] + cell.rect[2]) / 2
- }
- }
- })
- }
- function adjustCellsAndApplyLayout(cells, forceMode) {
- var hasHiddenItems = false;
- adjustCellSizes(cells);
- _each(cells, function(_, cell) {
- if (cell.items) {
- hasHiddenItems = applyCellLayout(cell, forceMode) || hasHiddenItems
- }
- });
- return hasHiddenItems
- }
- function applyCellLayout(cell, forceMode) {
- var cellRect = cell.rect;
- var cellWidth = cellRect[2] - cellRect[0];
- var cellHeight = cellRect[3] - cellRect[1];
- var xOffset = 0;
- var yOffset = 0;
- var currentHeight = 0;
- var totalL = cellRect[2];
- var totalT = cellRect[3];
- var totalR = cellRect[0];
- var totalB = cellRect[1];
- var moves = [];
- var hasHiddenItems = false;
- _each(cell.items, function(_, item) {
- if (item.width > cellWidth || item.height > cellHeight) {
- moves.push(null);
- hasHiddenItems = true;
- return forceMode || false
- }
- if (xOffset + item.width > cellWidth) {
- yOffset += currentHeight;
- xOffset = currentHeight = 0
- }
- if (yOffset + item.height > cellHeight) {
- moves.push(null);
- hasHiddenItems = true;
- return forceMode || false
- }
- currentHeight = _max(currentHeight, item.height);
- var dx = cell.horInversion ? cellRect[2] - item.width - xOffset : cellRect[0] + xOffset;
- var dy = cell.verInversion ? cellRect[3] - item.height - yOffset : cellRect[1] + yOffset;
- xOffset += item.width;
- totalL = _min(totalL, dx);
- totalT = _min(totalT, dy);
- totalR = _max(totalR, dx + item.width);
- totalB = _max(totalB, dy + item.height);
- moves.push([dx, dy])
- });
- if (forceMode || !hasHiddenItems) {
- xOffset = 0;
- if (cell.right) {
- xOffset = cellRect[2] - cellRect[0] - totalR + totalL
- } else {
- if (cell.center) {
- xOffset = _round((cellRect[2] - cellRect[0] - totalR + totalL) / 2)
- }
- }
- _each(cell.items, function(i, item) {
- var move = moves[i];
- if (move) {
- item.item.locate(move[0] + xOffset, move[1])
- } else {
- item.item.resize(null)
- }
- });
- cell.rect = [totalL, totalT, totalR, totalB];
- cell.items = null
- }
- return hasHiddenItems
- }
- function applyLayout(canvas, items) {
- var cells = createCells(canvas, items);
- if (adjustCellsAndApplyLayout(cells)) {
- adjustCellsAndApplyLayout(cells, true)
- }
- }
- function LayoutControl() {
- var that = this;
- that._items = [];
- that._suspended = 0;
- that._updateLayout = function() {
- that._update()
- }
- }
- LayoutControl.prototype = {
- constructor: LayoutControl,
- dispose: function() {
- this._items = this._updateLayout = null
- },
- setSize: function(canvas) {
- this._canvas = canvas;
- this._update()
- },
- suspend: function() {
- ++this._suspended
- },
- resume: function() {
- if (0 === --this._suspended) {
- this._update()
- }
- },
- addItem: function(item) {
- this._items.push(item);
- item.updateLayout = this._updateLayout
- },
- removeItem: function(item) {
- this._items.splice(_inArray(item, this._items), 1);
- item.updateLayout = null
- },
- _update: function() {
- var canvas;
- if (0 === this._suspended) {
- canvas = this._canvas;
- _each(this._items, function(_, item) {
- item.resize(canvas)
- });
- applyLayout({
- left: canvas.left,
- top: canvas.top,
- right: canvas.width + canvas.left,
- bottom: canvas.height + canvas.top
- }, this._items)
- }
- }
- };
- exports.LayoutControl = LayoutControl
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/map_layer.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var _Number = Number;
- var _String = String;
- var _abs = Math.abs;
- var _round = Math.round;
- var _min = Math.min;
- var _max = Math.max;
- var _sqrt = Math.sqrt;
- var DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 84);
- var _isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
- var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var _isArray = Array.isArray;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _parseScalar = vizUtils.parseScalar;
- var _patchFontOptions = vizUtils.patchFontOptions;
- var _normalizeEnum = vizUtils.normalizeEnum;
- var _noop = noop;
- var _extend = extend;
- var _each = each;
- var _concat = Array.prototype.concat;
- var TYPE_AREA = "area";
- var TYPE_LINE = "line";
- var TYPE_MARKER = "marker";
- var STATE_DEFAULT = 0;
- var STATE_HOVERED = 1;
- var STATE_SELECTED = 2;
- var STATE_TO_INDEX = [0, 1, 2, 2];
- var TOLERANCE = 1;
- var SELECTIONS = {
- none: null,
- single: -1,
- multiple: NaN
- };
- function getSelection(selectionMode) {
- var selection = _normalizeEnum(selectionMode);
- selection = selection in SELECTIONS ? SELECTIONS[selection] : SELECTIONS.single;
- if (null !== selection) {
- selection = {
- state: {},
- single: selection
- }
- }
- return selection
- }
- function getName(opt, index) {
- return (opt[index] || {}).name
- }
- function EmptySource() {}
- EmptySource.prototype.count = function() {
- return 0
- };
- function ArraySource(raw) {
- this.raw = raw
- }
- ArraySource.prototype = {
- constructor: ArraySource,
- count: function() {
- return this.raw.length
- },
- item: function(index) {
- return this.raw[index]
- },
- geometry: function(item) {
- return {
- coordinates: item.coordinates
- }
- },
- attributes: function(item) {
- return item.attributes
- }
- };
- function GeoJsonSource(raw) {
- this.raw = raw
- }
- GeoJsonSource.prototype = {
- constructor: GeoJsonSource,
- count: function() {
- return this.raw.features.length
- },
- item: function(index) {
- return this.raw.features[index]
- },
- geometry: function(item) {
- return item.geometry
- },
- attributes: function(item) {
- return item.properties
- }
- };
- function isGeoJsonObject(obj) {
- return _isArray(obj.features)
- }
- function unwrapFromDataSource(source) {
- var sourceType;
- if (source) {
- if (isGeoJsonObject(source)) {
- sourceType = GeoJsonSource
- } else {
- if (1 === source.length && source[0] && isGeoJsonObject(source[0])) {
- sourceType = GeoJsonSource;
- source = source[0]
- } else {
- if (_isArray(source)) {
- sourceType = ArraySource
- }
- }
- }
- }
- sourceType = sourceType || EmptySource;
- return new sourceType(source)
- }
- function wrapToDataSource(option) {
- return option ? isGeoJsonObject(option) ? [option] : option : []
- }
- function customizeHandles(proxies, callback, widget) {
- callback.call(widget, proxies)
- }
- function setAreaLabelVisibility(label) {
- label.text.attr({
- visibility: label.size[0] / label.spaceSize[0] < TOLERANCE && label.size[1] / label.spaceSize[1] < TOLERANCE ? null : "hidden"
- })
- }
- function setLineLabelVisibility(label) {
- label.text.attr({
- visibility: label.size[0] / label.spaceSize[0] < TOLERANCE || label.size[1] / label.spaceSize[1] < TOLERANCE ? null : "hidden"
- })
- }
- function getDataValue(proxy, dataField) {
- return proxy.attribute(dataField)
- }
- var TYPE_TO_TYPE_MAP = {
- Point: TYPE_MARKER,
- MultiPoint: TYPE_LINE,
- LineString: TYPE_LINE,
- MultiLineString: TYPE_LINE,
- Polygon: TYPE_AREA,
- MultiPolygon: TYPE_AREA
- };
- function pick(a, b) {
- return void 0 !== a ? a : b
- }
- function guessTypeByData(sample) {
- var type = TYPE_TO_TYPE_MAP[sample.type];
- var coordinates = sample.coordinates;
- if (!type) {
- if ("number" === typeof coordinates[0]) {
- type = TYPE_MARKER
- } else {
- if ("number" === typeof coordinates[0][0]) {
- type = TYPE_LINE
- } else {
- type = TYPE_AREA
- }
- }
- }
- return type
- }
- var selectStrategy = function(options, data) {
- var type = _normalizeEnum(options.type);
- var elementType = _normalizeEnum(options.elementType);
- var strategy = _extend({}, emptyStrategy);
- if (data.count() > 0) {
- var sample = data.geometry(data.item(0));
- type = strategiesByType[type] ? type : guessTypeByData(sample);
- _extend(strategy, strategiesByType[type]);
- strategy.fullType = strategy.type = type;
- if (strategiesByGeometry[type]) {
- _extend(strategy, strategiesByGeometry[type](sample))
- }
- if (strategiesByElementType[type]) {
- elementType = strategiesByElementType[type][elementType] ? elementType : strategiesByElementType[type]._default;
- _extend(strategy, strategiesByElementType[type][elementType]);
- strategy.elementType = elementType;
- strategy.fullType += ":" + elementType
- }
- }
- return strategy
- };
- function applyElementState(figure, styles, state, field) {
- figure[field].attr(styles[field][state])
- }
- var emptyStrategy = {
- setup: _noop,
- reset: _noop,
- arrange: _noop,
- updateGrouping: _noop,
- getDefaultColor: _noop
- };
- var strategiesByType = {};
- strategiesByType[TYPE_AREA] = {
- projectLabel: projectAreaLabel,
- transform: transformPointList,
- transformLabel: transformAreaLabel,
- draw: function(context, figure, data) {
- figure.root = context.renderer.path([], "area").data(context.dataKey, data)
- },
- refresh: _noop,
- getLabelOffset: function(label) {
- setAreaLabelVisibility(label);
- return [0, 0]
- },
- getStyles: function(settings) {
- var color = settings.color || null;
- var borderColor = settings.borderColor || null;
- var borderWidth = pick(settings.borderWidth, null);
- var opacity = pick(settings.opacity, null);
- return {
- root: [{
- "class": "dxm-area",
- stroke: borderColor,
- "stroke-width": borderWidth,
- fill: color,
- opacity: opacity
- }, {
- "class": "dxm-area dxm-area-hovered",
- stroke: settings.hoveredBorderColor || borderColor,
- "stroke-width": pick(settings.hoveredBorderWidth, borderWidth),
- fill: settings.hoveredColor || color,
- opacity: pick(settings.hoveredOpacity, opacity)
- }, {
- "class": "dxm-area dxm-area-selected",
- stroke: settings.selectedBorderColor || borderColor,
- "stroke-width": pick(settings.selectedBorderWidth, borderWidth),
- fill: settings.selectedColor || color,
- opacity: pick(settings.selectedOpacity, opacity)
- }]
- }
- },
- setState: function(figure, styles, state) {
- applyElementState(figure, styles, state, "root")
- },
- hasLabelsGroup: true,
- updateGrouping: function(context) {
- groupByColor(context)
- },
- getDefaultColor: _noop
- };
- strategiesByType[TYPE_LINE] = {
- projectLabel: projectLineLabel,
- transform: transformPointList,
- transformLabel: transformLineLabel,
- draw: function(context, figure, data) {
- figure.root = context.renderer.path([], "line").data(context.dataKey, data)
- },
- refresh: _noop,
- getLabelOffset: function(label) {
- setLineLabelVisibility(label);
- return [0, 0]
- },
- getStyles: function(settings) {
- var color = settings.color || settings.borderColor || null;
- var width = pick(settings.borderWidth, null);
- var opacity = pick(settings.opacity, null);
- return {
- root: [{
- "class": "dxm-line",
- stroke: color,
- "stroke-width": width,
- opacity: opacity
- }, {
- "class": "dxm-line dxm-line-hovered",
- stroke: settings.hoveredColor || settings.hoveredBorderColor || color,
- "stroke-width": pick(settings.hoveredBorderWidth, width),
- opacity: pick(settings.hoveredOpacity, opacity)
- }, {
- "class": "dxm-line dxm-line-selected",
- stroke: settings.selectedColor || settings.selectedBorderColor || color,
- "stroke-width": pick(settings.selectedBorderWidth, width),
- opacity: pick(settings.selectedOpacity, opacity)
- }]
- }
- },
- setState: function(figure, styles, state) {
- applyElementState(figure, styles, state, "root")
- },
- hasLabelsGroup: true,
- updateGrouping: function(context) {
- groupByColor(context)
- },
- getDefaultColor: _noop
- };
- strategiesByType[TYPE_MARKER] = {
- project: projectPoint,
- transform: transformPoint,
- draw: function(context, figure, data) {
- figure.root = context.renderer.g();
- this._draw(context, figure, data)
- },
- refresh: _noop,
- hasLabelsGroup: false,
- getLabelOffset: function(label, settings) {
- return [_round((label.size[0] + _max(settings.size || 0, 0)) / 2) + 2, 0]
- },
- getStyles: function(settings) {
- var styles = {
- root: [{
- "class": "dxm-marker"
- }, {
- "class": "dxm-marker dxm-marker-hovered"
- }, {
- "class": "dxm-marker dxm-marker-selected"
- }]
- };
- this._getStyles(styles, settings);
- return styles
- },
- setState: function(figure, styles, state) {
- applyElementState(figure, styles, state, "root");
- this._setState(figure, styles, state)
- },
- updateGrouping: function(context) {
- groupByColor(context);
- groupBySize(context)
- },
- getDefaultColor: function(ctx, palette) {
- return ctx.params.themeManager.getAccentColor(palette)
- }
- };
- var strategiesByGeometry = {};
- strategiesByGeometry[TYPE_AREA] = function(sample) {
- var coordinates = sample.coordinates;
- return {
- project: coordinates[0] && coordinates[0][0] && coordinates[0][0][0] && "number" === typeof coordinates[0][0][0][0] ? projectMultiPolygon : projectPolygon
- }
- };
- strategiesByGeometry[TYPE_LINE] = function(sample) {
- var coordinates = sample.coordinates;
- return {
- project: coordinates[0] && coordinates[0][0] && "number" === typeof coordinates[0][0][0] ? projectPolygon : projectLineString
- }
- };
- var strategiesByElementType = {};
- strategiesByElementType[TYPE_MARKER] = {
- _default: "dot",
- dot: {
- setup: function(context) {
- context.filter = context.renderer.shadowFilter("-40%", "-40%", "180%", "200%", 0, 1, 1, "#000000", .2)
- },
- reset: function(context) {
- context.filter.dispose();
- context.filter = null
- },
- _draw: function(ctx, figure, data) {
- figure.back = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root);
- figure.dot = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root)
- },
- refresh: function(ctx, figure, data, proxy, settings) {
- figure.dot.attr({
- filter: settings.shadow ? ctx.filter.id : null
- })
- },
- _getStyles: function(styles, style) {
- var size = style.size > 0 ? _Number(style.size) : 0;
- var hoveredSize = size;
- var selectedSize = size + (style.selectedStep > 0 ? _Number(style.selectedStep) : 0);
- var hoveredBackSize = hoveredSize + (style.backStep > 0 ? _Number(style.backStep) : 0);
- var selectedBackSize = selectedSize + (style.backStep > 0 ? _Number(style.backStep) : 0);
- var color = style.color || null;
- var borderColor = style.borderColor || null;
- var borderWidth = pick(style.borderWidth, null);
- var opacity = pick(style.opacity, null);
- var backColor = style.backColor || null;
- var backOpacity = pick(style.backOpacity, null);
- styles.dot = [{
- r: size / 2,
- stroke: borderColor,
- "stroke-width": borderWidth,
- fill: color,
- opacity: opacity
- }, {
- r: hoveredSize / 2,
- stroke: style.hoveredBorderColor || borderColor,
- "stroke-width": pick(style.hoveredBorderWidth, borderWidth),
- fill: style.hoveredColor || color,
- opacity: pick(style.hoveredOpacity, opacity)
- }, {
- r: selectedSize / 2,
- stroke: style.selectedBorderColor || borderColor,
- "stroke-width": pick(style.selectedBorderWidth, borderWidth),
- fill: style.selectedColor || color,
- opacity: pick(style.selectedOpacity, opacity)
- }];
- styles.back = [{
- r: size / 2,
- stroke: "none",
- "stroke-width": 0,
- fill: backColor,
- opacity: backOpacity
- }, {
- r: hoveredBackSize / 2,
- stroke: "none",
- "stroke-width": 0,
- fill: backColor,
- opacity: backOpacity
- }, {
- r: selectedBackSize / 2,
- stroke: "none",
- "stroke-width": 0,
- fill: backColor,
- opacity: backOpacity
- }]
- },
- _setState: function(figure, styles, state) {
- applyElementState(figure, styles, state, "dot");
- applyElementState(figure, styles, state, "back")
- }
- },
- bubble: {
- _draw: function(ctx, figure, data) {
- figure.bubble = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root)
- },
- refresh: function(ctx, figure, data, proxy, settings) {
- figure.bubble.attr({
- r: settings.size / 2
- })
- },
- _getStyles: function(styles, style) {
- var color = style.color || null;
- var borderColor = style.borderColor || null;
- var borderWidth = pick(style.borderWidth, null);
- var opacity = pick(style.opacity, null);
- styles.bubble = [{
- stroke: borderColor,
- "stroke-width": borderWidth,
- fill: color,
- opacity: opacity
- }, {
- stroke: style.hoveredBorderColor || borderColor,
- "stroke-width": pick(style.hoveredBorderWidth, borderWidth),
- fill: style.hoveredColor || style.color,
- opacity: pick(style.hoveredOpacity, opacity)
- }, {
- stroke: style.selectedBorderColor || borderColor,
- "stroke-width": pick(style.selectedBorderWidth, borderWidth),
- fill: style.selectedColor || style.color,
- opacity: pick(style.selectedOpacity, opacity)
- }]
- },
- _setState: function(figure, styles, state) {
- applyElementState(figure, styles, state, "bubble")
- },
- arrange: function(context, handles) {
- var values = [];
- var i;
- var ii = values.length = handles.length;
- var settings = context.settings;
- var dataField = settings.dataField;
- var minSize = settings.minSize > 0 ? _Number(settings.minSize) : 0;
- var maxSize = settings.maxSize > minSize ? _Number(settings.maxSize) : minSize;
- if (settings.sizeGroups) {
- return
- }
- for (i = 0; i < ii; ++i) {
- values[i] = _max(getDataValue(handles[i].proxy, dataField) || 0, 0)
- }
- var minValue = _min.apply(null, values);
- var maxValue = _max.apply(null, values);
- var deltaValue = maxValue - minValue || 1;
- var deltaSize = maxSize - minSize;
- for (i = 0; i < ii; ++i) {
- handles[i]._settings.size = minSize + deltaSize * (values[i] - minValue) / deltaValue
- }
- },
- updateGrouping: function(context) {
- var dataField = context.settings.dataField;
- strategiesByType[TYPE_MARKER].updateGrouping(context);
- groupBySize(context, function(proxy) {
- return getDataValue(proxy, dataField)
- })
- }
- },
- pie: {
- _draw: function(ctx, figure, data) {
- figure.pie = ctx.renderer.g().append(figure.root);
- figure.border = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root)
- },
- refresh: function(ctx, figure, data, proxy, settings) {
- var values = getDataValue(proxy, ctx.settings.dataField) || [];
- var colors = settings._colors;
- var sum = 0;
- var pie = figure.pie;
- var renderer = ctx.renderer;
- var dataKey = ctx.dataKey;
- var r = (settings.size > 0 ? _Number(settings.size) : 0) / 2;
- var start = 90;
- var end = start;
- var zeroSum = false;
- sum = values.reduce(function(total, item) {
- return total + (item || 0)
- }, 0);
- if (0 === sum) {
- zeroSum = true;
- sum = 360 / values.length
- }
- values.forEach(function(item, i) {
- start = end;
- end += zeroSum ? sum : (item || 0) / sum * 360;
- renderer.arc(0, 0, 0, r, start, end).attr({
- "stroke-linejoin": "round",
- fill: colors[i]
- }).data(dataKey, data).append(pie)
- });
- figure.border.attr({
- r: r
- })
- },
- _getStyles: function(styles, style) {
- var opacity = pick(style.opacity, null);
- var borderColor = style.borderColor || null;
- var borderWidth = pick(style.borderWidth, null);
- styles.pie = [{
- opacity: opacity
- }, {
- opacity: pick(style.hoveredOpacity, opacity)
- }, {
- opacity: pick(style.selectedOpacity, opacity)
- }];
- styles.border = [{
- stroke: borderColor,
- "stroke-width": borderWidth
- }, {
- stroke: style.hoveredBorderColor || borderColor,
- "stroke-width": pick(style.hoveredBorderWidth, borderWidth)
- }, {
- stroke: style.selectedBorderColor || borderColor,
- "stroke-width": pick(style.selectedBorderWidth, borderWidth)
- }]
- },
- _setState: function(figure, styles, state) {
- applyElementState(figure, styles, state, "pie");
- applyElementState(figure, styles, state, "border")
- },
- arrange: function(context, handles) {
- var i;
- var ii = handles.length;
- var dataField = context.settings.dataField;
- var values;
- var count = 0;
- for (i = 0; i < ii; ++i) {
- values = getDataValue(handles[i].proxy, dataField);
- if (values && values.length > count) {
- count = values.length
- }
- }
- if (count > 0) {
- var palette = context.params.themeManager.createPalette(context.settings.palette, {
- useHighlight: true,
- extensionMode: "alternate"
- });
- values = palette.generateColors(count);
- context.settings._colors = values;
- context.grouping.color = {
- callback: _noop,
- field: "",
- partition: [],
- values: []
- };
- context.params.dataExchanger.set(context.name, "color", {
- partition: [],
- values: values
- })
- }
- }
- },
- image: {
- _draw: function(ctx, figure, data) {
- figure.image = ctx.renderer.image(null, null, null, null, null, "center").attr({
- "pointer-events": "visible"
- }).data(ctx.dataKey, data).append(figure.root)
- },
- refresh: function(ctx, figure, data, proxy) {
- figure.image.attr({
- href: getDataValue(proxy, ctx.settings.dataField)
- })
- },
- _getStyles: function(styles, style) {
- var size = style.size > 0 ? _Number(style.size) : 0;
- var hoveredSize = size + (style.hoveredStep > 0 ? _Number(style.hoveredStep) : 0);
- var selectedSize = size + (style.selectedStep > 0 ? _Number(style.selectedStep) : 0);
- var opacity = pick(style.opacity, null);
- styles.image = [{
- x: -size / 2,
- y: -size / 2,
- width: size,
- height: size,
- opacity: opacity
- }, {
- x: -hoveredSize / 2,
- y: -hoveredSize / 2,
- width: hoveredSize,
- height: hoveredSize,
- opacity: pick(style.hoveredOpacity, opacity)
- }, {
- x: -selectedSize / 2,
- y: -selectedSize / 2,
- width: selectedSize,
- height: selectedSize,
- opacity: pick(style.selectedOpacity, opacity)
- }]
- },
- _setState: function(figure, styles, state) {
- applyElementState(figure, styles, state, "image")
- }
- }
- };
- function projectPoint(projection, coordinates) {
- return projection.project(coordinates)
- }
- function projectPointList(projection, coordinates) {
- var output = [];
- var i;
- var ii = output.length = coordinates.length;
- for (i = 0; i < ii; ++i) {
- output[i] = projection.project(coordinates[i])
- }
- return output
- }
- function projectLineString(projection, coordinates) {
- return [projectPointList(projection, coordinates)]
- }
- function projectPolygon(projection, coordinates) {
- var output = [];
- var i;
- var ii = output.length = coordinates.length;
- for (i = 0; i < ii; ++i) {
- output[i] = projectPointList(projection, coordinates[i])
- }
- return output
- }
- function projectMultiPolygon(projection, coordinates) {
- var output = [];
- var i;
- var ii = output.length = coordinates.length;
- for (i = 0; i < ii; ++i) {
- output[i] = projectPolygon(projection, coordinates[i])
- }
- return _concat.apply([], output)
- }
- function transformPoint(content, projection, coordinates) {
- var data = projection.transform(coordinates);
- content.root.attr({
- translateX: data[0],
- translateY: data[1]
- })
- }
- function transformList(projection, coordinates) {
- var output = [];
- var i;
- var ii = coordinates.length;
- var k = 0;
- output.length = 2 * ii;
- for (i = 0; i < ii; ++i) {
- var item = projection.transform(coordinates[i]);
- output[k++] = item[0];
- output[k++] = item[1]
- }
- return output
- }
- function transformPointList(content, projection, coordinates) {
- var output = [];
- var i;
- var ii = output.length = coordinates.length;
- for (i = 0; i < ii; ++i) {
- output[i] = transformList(projection, coordinates[i])
- }
- content.root.attr({
- points: output
- })
- }
- function transformAreaLabel(label, projection, coordinates) {
- var data = projection.transform(coordinates[0]);
- label.spaceSize = projection.getSquareSize(coordinates[1]);
- label.text.attr({
- translateX: data[0],
- translateY: data[1]
- });
- setAreaLabelVisibility(label)
- }
- function transformLineLabel(label, projection, coordinates) {
- var data = projection.transform(coordinates[0]);
- label.spaceSize = projection.getSquareSize(coordinates[1]);
- label.text.attr({
- translateX: data[0],
- translateY: data[1]
- });
- setLineLabelVisibility(label)
- }
- function getItemSettings(context, proxy, settings) {
- var result = combineSettings(context.settings, settings);
- applyGrouping(context.grouping, proxy, result);
- if (void 0 === settings.color && settings.paletteIndex >= 0) {
- result.color = result._colors[settings.paletteIndex]
- }
- return result
- }
- function applyGrouping(grouping, proxy, settings) {
- _each(grouping, function(name, data) {
- var index = findGroupingIndex(data.callback(proxy, data.field), data.partition);
- if (index >= 0) {
- settings[name] = data.values[index]
- }
- })
- }
- function findGroupingIndex(value, partition) {
- var start = 0;
- var end = partition.length - 1;
- var index = -1;
- if (partition[start] <= value && value <= partition[end]) {
- if (value === partition[end]) {
- index = end - 1
- } else {
- while (end - start > 1) {
- var middle = start + end >> 1;
- if (value < partition[middle]) {
- end = middle
- } else {
- start = middle
- }
- }
- index = start
- }
- }
- return index
- }
- function raiseChanged(context, handle, state, name) {
- context.params.eventTrigger(name, {
- target: handle.proxy,
- state: state
- })
- }
- function combineSettings(common, partial) {
- var obj = _extend({}, common, partial);
- obj.label = _extend({}, common.label, obj.label);
- obj.label.font = _extend({}, common.label.font, obj.label.font);
- return obj
- }
- function processCommonSettings(context, options) {
- var themeManager = context.params.themeManager;
- var strategy = context.str;
- var settings = combineSettings(_extend({
- label: {},
- color: strategy.getDefaultColor(context, options.palette)
- }, themeManager.theme("layer:" + strategy.fullType)), options);
- var colors;
- var i;
- if (settings.paletteSize > 0) {
- var palette = themeManager.createDiscretePalette(settings.palette, settings.paletteSize);
- for (i = 0, colors = []; i < settings.paletteSize; ++i) {
- colors.push(palette.getColor(i))
- }
- settings._colors = colors
- }
- return settings
- }
- function valueCallback(proxy, dataField) {
- return proxy.attribute(dataField)
- }
- var performGrouping = function(context, partition, settingField, dataField, valuesCallback) {
- if (dataField && partition && partition.length > 1) {
- var values = valuesCallback(partition.length - 1);
- context.grouping[settingField] = {
- callback: _isFunction(dataField) ? dataField : valueCallback,
- field: dataField,
- partition: partition,
- values: values
- };
- context.params.dataExchanger.set(context.name, settingField, {
- partition: partition,
- values: values,
- defaultColor: context.settings.color
- })
- }
- };
- function dropGrouping(context) {
- var name = context.name;
- var dataExchanger = context.params.dataExchanger;
- _each(context.grouping, function(field) {
- dataExchanger.set(name, field, null)
- });
- context.grouping = {}
- }
- var groupByColor = function(context) {
- performGrouping(context, context.settings.colorGroups, "color", context.settings.colorGroupingField, function(count) {
- var _palette = context.params.themeManager.createDiscretePalette(context.settings.palette, count);
- var list = [];
- for (var i = 0; i < count; ++i) {
- list.push(_palette.getColor(i))
- }
- return list
- })
- };
- var groupBySize = function(context, valueCallback) {
- var settings = context.settings;
- performGrouping(context, settings.sizeGroups, "size", valueCallback || settings.sizeGroupingField, function(count) {
- var minSize = settings.minSize > 0 ? _Number(settings.minSize) : 0;
- var maxSize = settings.maxSize >= minSize ? _Number(settings.maxSize) : 0;
- var i = 0;
- var sizes = [];
- if (count > 1) {
- for (i = 0; i < count; ++i) {
- sizes.push((minSize * (count - i - 1) + maxSize * i) / (count - 1))
- }
- } else {
- if (1 === count) {
- sizes.push((minSize + maxSize) / 2)
- }
- }
- return sizes
- })
- };
- function setFlag(flags, flag, state) {
- if (state) {
- flags |= flag
- } else {
- flags &= ~flag
- }
- return flags
- }
- function hasFlag(flags, flag) {
- return !!(flags & flag)
- }
- function createLayerProxy(layer, name, index) {
- var proxy = {
- index: index,
- name: name,
- getElements: function() {
- return layer.getProxies()
- },
- clearSelection: function(_noEvent) {
- layer.clearSelection(_noEvent);
- return proxy
- },
- getDataSource: function() {
- return layer.getDataSource()
- }
- };
- return proxy
- }
- var MapLayer = function(params, container, name, index) {
- var that = this;
- that._params = params;
- that._onProjection();
- that.proxy = createLayerProxy(that, name, index);
- that._context = {
- name: name,
- layer: that.proxy,
- renderer: params.renderer,
- projection: params.projection,
- params: params,
- dataKey: params.dataKey,
- str: emptyStrategy,
- hover: false,
- selection: null,
- grouping: {},
- root: params.renderer.g().attr({
- "class": "dxm-layer"
- }).linkOn(container, name).linkAppend()
- };
- that._container = container;
- that._options = {};
- that._handles = [];
- that._data = new EmptySource
- };
- MapLayer.prototype = _extend({
- constructor: MapLayer,
- _onProjection: function() {
- var that = this;
- that._removeHandlers = that._params.projection.on({
- engine: function() {
- that._project()
- },
- screen: function() {
- that._transform()
- },
- center: function() {
- that._transformCore()
- },
- zoom: function() {
- that._transform()
- }
- })
- },
- _dataSourceLoadErrorHandler: function() {
- this._dataSourceChangedHandler()
- },
- _dataSourceChangedHandler: function() {
- var that = this;
- that._data = unwrapFromDataSource(that._dataSource && that._dataSource.items());
- that._update(true)
- },
- _dataSourceOptions: function() {
- return {
- paginate: false
- }
- },
- _getSpecificDataSourceOption: function() {
- return this._specificDataSourceOption
- },
- _offProjection: function() {
- this._removeHandlers();
- this._removeHandlers = null
- },
- dispose: function() {
- var that = this;
- that._disposeDataSource();
- that._destroyHandles();
- dropGrouping(that._context);
- that._context.root.linkRemove().linkOff();
- that._context.labelRoot && that._context.labelRoot.linkRemove().linkOff();
- that._context.str.reset(that._context);
- that._offProjection();
- that._params = that._container = that._context = that.proxy = null;
- return that
- },
- TESTS_getContext: function() {
- return this._context
- },
- setOptions: function(options) {
- var that = this;
- options = that._options = options || {};
- if ("dataSource" in options && options.dataSource !== that._options_dataSource) {
- that._options_dataSource = options.dataSource;
- that._params.notifyDirty();
- that._specificDataSourceOption = wrapToDataSource(options.dataSource);
- that._refreshDataSource()
- } else {
- if (that._data.count() > 0) {
- that._params.notifyDirty();
- that._update(void 0 !== options.type && options.type !== that._context.str.type || void 0 !== options.elementType && options.elementType !== that._context.str.elementType)
- }
- }
- that._transformCore()
- },
- _update: function(isContextChanged) {
- var that = this;
- var context = that._context;
- if (isContextChanged) {
- context.str.reset(context);
- context.root.clear();
- context.labelRoot && context.labelRoot.clear();
- that._params.tracker.reset();
- that._destroyHandles();
- context.str = selectStrategy(that._options, that._data);
- context.str.setup(context);
- that.proxy.type = context.str.type;
- that.proxy.elementType = context.str.elementType
- }
- context.settings = processCommonSettings(context, that._options);
- context.hasSeparateLabel = !!(context.settings.label.enabled && context.str.hasLabelsGroup);
- context.hover = !!_parseScalar(context.settings.hoverEnabled, true);
- if (context.selection) {
- _each(context.selection.state, function(_, handle) {
- handle && handle.resetSelected()
- })
- }
- context.selection = getSelection(context.settings.selectionMode);
- if (context.hasSeparateLabel) {
- if (!context.labelRoot) {
- context.labelRoot = context.renderer.g().attr({
- "class": "dxm-layer-labels"
- }).linkOn(that._container, {
- name: context.name + "-labels",
- after: context.name
- }).linkAppend();
- that._transformCore()
- }
- } else {
- if (context.labelRoot) {
- context.labelRoot.linkRemove().linkOff();
- context.labelRoot = null
- }
- }
- if (isContextChanged) {
- that._createHandles()
- }
- dropGrouping(context);
- context.str.arrange(context, that._handles);
- context.str.updateGrouping(context);
- that._updateHandles();
- that._params.notifyReady()
- },
- _destroyHandles: function() {
- var handles = this._handles;
- var i;
- var ii = handles.length;
- for (i = 0; i < ii; ++i) {
- handles[i].dispose()
- }
- if (this._context.selection) {
- this._context.selection.state = {}
- }
- this._handles = []
- },
- _createHandles: function() {
- var that = this;
- var handles = that._handles = [];
- var data = that._data;
- var i;
- var ii = handles.length = data.count();
- var context = that._context;
- var geometry = data.geometry;
- var attributes = data.attributes;
- var handle;
- for (i = 0; i < ii; ++i) {
- var dataItem = data.item(i);
- handles[i] = new MapLayerElement(context, i, geometry(dataItem), attributes(dataItem))
- }
- _isFunction(that._options.customize) && customizeHandles(that.getProxies(), that._options.customize, that._params.widget);
- for (i = 0; i < ii; ++i) {
- handle = handles[i];
- handle.project();
- handle.draw();
- handle.transform()
- }
- if (context.selection) {
- _each(context.selection.state, function(_, handle) {
- handle && handle.restoreSelected()
- })
- }
- },
- _updateHandles: function() {
- var handles = this._handles;
- var i;
- var ii = handles.length;
- for (i = 0; i < ii; ++i) {
- handles[i].refresh()
- }
- if (this._context.settings.label.enabled) {
- for (i = 0; i < ii; ++i) {
- handles[i].measureLabel()
- }
- for (i = 0; i < ii; ++i) {
- handles[i].adjustLabel()
- }
- }
- },
- _transformCore: function() {
- var transform = this._params.projection.getTransform();
- this._context.root.attr(transform);
- this._context.labelRoot && this._context.labelRoot.attr(transform)
- },
- _project: function() {
- var handles = this._handles;
- var i;
- var ii = handles.length;
- for (i = 0; i < ii; ++i) {
- handles[i].project()
- }
- },
- _transform: function() {
- var handles = this._handles;
- var i;
- var ii = handles.length;
- this._transformCore();
- for (i = 0; i < ii; ++i) {
- handles[i].transform()
- }
- },
- getProxies: function() {
- var handles = this._handles;
- var proxies = [];
- var i;
- var ii = proxies.length = handles.length;
- for (i = 0; i < ii; ++i) {
- proxies[i] = handles[i].proxy
- }
- return proxies
- },
- getProxy: function(index) {
- return this._handles[index].proxy
- },
- raiseClick: function(i, dxEvent) {
- this._params.eventTrigger("click", {
- target: this._handles[i].proxy,
- event: dxEvent
- })
- },
- hoverItem: function(i, state) {
- this._handles[i].setHovered(state)
- },
- selectItem: function(i, state, _noEvent) {
- this._handles[i].setSelected(state, _noEvent)
- },
- clearSelection: function() {
- var selection = this._context.selection;
- if (selection) {
- _each(selection.state, function(_, handle) {
- handle && handle.setSelected(false)
- });
- selection.state = {}
- }
- }
- }, DataHelperMixin);
- function createProxy(handle, coords, attrs) {
- var proxy = {
- coordinates: function() {
- return coords
- },
- attribute: function(name, value) {
- if (arguments.length > 1) {
- attrs[name] = value;
- return proxy
- } else {
- return arguments.length > 0 ? attrs[name] : attrs
- }
- },
- selected: function(state, _noEvent) {
- if (arguments.length > 0) {
- handle.setSelected(state, _noEvent);
- return proxy
- } else {
- return handle.isSelected()
- }
- },
- applySettings: function(settings) {
- handle.update(settings);
- return proxy
- }
- };
- return proxy
- }
- var MapLayerElement = function(context, index, geometry, attributes) {
- var that = this;
- var proxy = that.proxy = createProxy(that, geometry.coordinates, _extend({}, attributes));
- that._ctx = context;
- that._index = index;
- that._fig = that._label = null;
- that._state = STATE_DEFAULT;
- that._coordinates = geometry.coordinates;
- that._settings = {
- label: {}
- };
- proxy.index = index;
- proxy.layer = context.layer;
- that._data = {
- name: context.name,
- index: index
- }
- };
- MapLayerElement.prototype = {
- constructor: MapLayerElement,
- dispose: function() {
- var that = this;
- that._ctx = that.proxy = that._settings = that._fig = that._label = that.data = null;
- return that
- },
- project: function() {
- var context = this._ctx;
- this._projection = context.str.project(context.projection, this._coordinates);
- if (context.hasSeparateLabel && this._label) {
- this._projectLabel()
- }
- },
- _projectLabel: function() {
- this._labelProjection = this._ctx.str.projectLabel(this._projection)
- },
- draw: function() {
- var that = this;
- var context = this._ctx;
- context.str.draw(context, that._fig = {}, that._data);
- that._fig.root.append(context.root)
- },
- transform: function() {
- var that = this;
- var context = that._ctx;
- context.str.transform(that._fig, context.projection, that._projection);
- if (context.hasSeparateLabel && that._label) {
- that._transformLabel()
- }
- },
- _transformLabel: function() {
- this._ctx.str.transformLabel(this._label, this._ctx.projection, this._labelProjection)
- },
- refresh: function() {
- var that = this;
- var strategy = that._ctx.str;
- var settings = getItemSettings(that._ctx, that.proxy, that._settings);
- that._styles = strategy.getStyles(settings);
- strategy.refresh(that._ctx, that._fig, that._data, that.proxy, settings);
- that._refreshLabel(settings);
- that._setState()
- },
- _refreshLabel: function(settings) {
- var that = this;
- var context = that._ctx;
- var labelSettings = settings.label;
- var label = that._label;
- if (context.settings.label.enabled) {
- if (!label) {
- label = that._label = {
- root: context.labelRoot || that._fig.root,
- text: context.renderer.text().attr({
- "class": "dxm-label"
- }),
- size: [0, 0]
- };
- if (context.hasSeparateLabel) {
- that._projectLabel();
- that._transformLabel()
- }
- }
- label.value = _String(that.proxy.text || that.proxy.attribute(labelSettings.dataField) || "");
- if (label.value) {
- label.text.attr({
- text: label.value,
- x: 0,
- y: 0
- }).css(_patchFontOptions(labelSettings.font)).attr({
- align: "center",
- stroke: labelSettings.stroke,
- "stroke-width": labelSettings["stroke-width"],
- "stroke-opacity": labelSettings["stroke-opacity"]
- }).data(context.dataKey, that._data).append(label.root);
- label.settings = settings
- }
- } else {
- if (label) {
- label.text.remove();
- that._label = null
- }
- }
- },
- measureLabel: function() {
- var label = this._label;
- if (label.value) {
- var bBox = label.text.getBBox();
- label.size = [bBox.width, bBox.height, -bBox.y - bBox.height / 2]
- }
- },
- adjustLabel: function() {
- var label = this._label;
- if (label.value) {
- var offset = this._ctx.str.getLabelOffset(label, label.settings);
- label.settings = null;
- label.text.attr({
- x: offset[0],
- y: offset[1] + label.size[2]
- })
- }
- },
- update: function(settings) {
- var that = this;
- that._settings = combineSettings(that._settings, settings);
- if (that._fig) {
- that.refresh();
- if (that._label && that._label.value) {
- that.measureLabel();
- that.adjustLabel()
- }
- }
- },
- _setState: function() {
- this._ctx.str.setState(this._fig, this._styles, STATE_TO_INDEX[this._state])
- },
- _setForeground: function() {
- var root = this._fig.root;
- this._state ? root.toForeground() : root.toBackground()
- },
- setHovered: function(state) {
- var that = this;
- var currentState = hasFlag(that._state, STATE_HOVERED);
- var newState = !!state;
- if (that._ctx.hover && currentState !== newState) {
- that._state = setFlag(that._state, STATE_HOVERED, newState);
- that._setState();
- that._setForeground();
- raiseChanged(that._ctx, that, newState, "hoverChanged")
- }
- return that
- },
- setSelected: function(state, _noEvent) {
- var that = this;
- var currentState = hasFlag(that._state, STATE_SELECTED);
- var newState = !!state;
- var selection = that._ctx.selection;
- if (selection && currentState !== newState) {
- that._state = setFlag(that._state, STATE_SELECTED, newState);
- var tmp = selection.state[selection.single];
- selection.state[selection.single] = null;
- if (tmp) {
- tmp.setSelected(false)
- }
- selection.state[selection.single || that._index] = state ? that : null;
- if (that._fig) {
- that._setState();
- that._setForeground();
- if (!_noEvent) {
- raiseChanged(that._ctx, that, newState, "selectionChanged")
- }
- }
- }
- },
- isSelected: function() {
- return hasFlag(this._state, STATE_SELECTED)
- },
- resetSelected: function() {
- this._state = setFlag(this._state, STATE_SELECTED, false)
- },
- restoreSelected: function() {
- this._fig.root.toForeground()
- }
- };
- function calculatePolygonCentroid(coordinates) {
- var length = coordinates.length;
- var v2 = coordinates[length - 1];
- var cx = 0;
- var cy = 0;
- var area = 0;
- var minX = 1 / 0;
- var maxX = -(1 / 0);
- var minY = 1 / 0;
- var maxY = -(1 / 0);
- for (var i = 0; i < length; ++i) {
- var v1 = v2;
- v2 = coordinates[i];
- var cross = v1[0] * v2[1] - v2[0] * v1[1];
- area += cross;
- cx += (v1[0] + v2[0]) * cross;
- cy += (v1[1] + v2[1]) * cross;
- minX = _min(minX, v2[0]);
- maxX = _max(maxX, v2[0]);
- minY = _min(minY, v2[1]);
- maxY = _max(maxY, v2[1])
- }
- return {
- area: _abs(area) / 2,
- center: [2 * cx / 3 / area - (minX + maxX) / 2, 2 * cy / 3 / area - (minY + maxY) / 2]
- }
- }
- function calculateLineStringData(coordinates) {
- var i;
- var ii = coordinates.length;
- var v1;
- var v2 = coordinates[0] || [];
- var totalLength = 0;
- var items = [0];
- var min0 = v2[0];
- var max0 = v2[0];
- var min1 = v2[1];
- var max1 = v2[1];
- for (i = 1; i < ii; ++i) {
- v1 = v2;
- v2 = coordinates[i];
- totalLength += _sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
- items[i] = totalLength;
- min0 = _min(min0, v2[0]);
- max0 = _max(max0, v2[0]);
- min1 = _min(min1, v2[1]);
- max1 = _max(max1, v2[1])
- }
- i = findGroupingIndex(totalLength / 2, items);
- v1 = coordinates[i];
- v2 = coordinates[i + 1];
- var t = (totalLength / 2 - items[i]) / (items[i + 1] - items[i]);
- return ii ? [
- [v1[0] * (1 - t) + v2[0] * t, v1[1] * (1 - t) + v2[1] * t],
- [max0 - min0, max1 - min1], totalLength
- ] : []
- }
- function projectAreaLabel(coordinates) {
- var i;
- var ii = coordinates.length;
- var resultCentroid;
- var maxArea = 0;
- for (i = 0; i < ii; ++i) {
- var centroid = calculatePolygonCentroid(coordinates[i]);
- if (centroid.area > maxArea) {
- maxArea = centroid.area;
- resultCentroid = centroid
- }
- }
- return resultCentroid ? [resultCentroid.center, [_sqrt(resultCentroid.area), _sqrt(resultCentroid.area)]] : [
- [],
- []
- ]
- }
- function projectLineLabel(coordinates) {
- var i;
- var ii = coordinates.length;
- var maxLength = 0;
- var resultData;
- for (i = 0; i < ii; ++i) {
- var data = calculateLineStringData(coordinates[i]);
- if (data[2] > maxLength) {
- maxLength = data[2];
- resultData = data
- }
- }
- return resultData || [
- [],
- []
- ]
- }
- function MapLayerCollection(params) {
- var that = this;
- var renderer = params.renderer;
- that._params = params;
- that._layers = [];
- that._layerByName = {};
- that._rect = [0, 0, 0, 0];
- that._clip = renderer.clipRect();
- that._background = renderer.rect().attr({
- "class": "dxm-background"
- }).data(params.dataKey, {
- name: "background"
- }).append(renderer.root);
- that._container = renderer.g().attr({
- "class": "dxm-layers",
- "clip-path": that._clip.id
- }).append(renderer.root).enableLinks();
- that._subscribeToTracker(params.tracker, renderer, params.eventTrigger)
- }
- MapLayerCollection.prototype = {
- constructor: MapLayerCollection,
- dispose: function() {
- var that = this;
- that._clip.dispose();
- that._layers.forEach(function(l) {
- return l.dispose()
- });
- that._offTracker();
- that._params = that._offTracker = that._layers = that._layerByName = that._clip = that._background = that._container = null
- },
- _subscribeToTracker: function(tracker, renderer, eventTrigger) {
- var that = this;
- that._offTracker = tracker.on({
- click: function(arg) {
- var offset = renderer.getRootOffset();
- var layer = that.byName(arg.data.name);
- arg.$event.x = arg.x - offset.left;
- arg.$event.y = arg.y - offset.top;
- if (layer) {
- layer.raiseClick(arg.data.index, arg.$event)
- } else {
- if ("background" === arg.data.name) {
- eventTrigger("click", {
- event: arg.$event
- })
- }
- }
- },
- "hover-on": function(arg) {
- var layer = that.byName(arg.data.name);
- if (layer) {
- layer.hoverItem(arg.data.index, true)
- }
- },
- "hover-off": function(arg) {
- var layer = that.byName(arg.data.name);
- if (layer) {
- layer.hoverItem(arg.data.index, false)
- }
- }
- })
- },
- setOptions: function(options) {
- var that = this;
- var optionList = options ? _isArray(options) ? options : [options] : [];
- var layerByName = that._layerByName;
- var layers = that._layers;
- var needToCreateLayers = optionList.length !== layers.length || layers.some(function(l, i) {
- var name = getName(optionList, i);
- return _isDefined(name) && name !== l.proxy.name
- });
- if (needToCreateLayers) {
- that._params.tracker.reset();
- that._layers.forEach(function(l) {
- return l.dispose()
- });
- that._layerByName = layerByName = {};
- that._layers = layers = [];
- for (var i = 0, ii = optionList.length; i < ii; ++i) {
- var name = getName(optionList, i) || "map-layer-" + i;
- var layer = layers[i] = new MapLayer(that._params, that._container, name, i);
- layerByName[name] = layer
- }
- }
- layers.forEach(function(l, i) {
- l.setOptions(optionList[i])
- })
- },
- _updateClip: function() {
- var rect = this._rect;
- var bw = this._borderWidth;
- this._clip.attr({
- x: rect[0] + bw,
- y: rect[1] + bw,
- width: _max(rect[2] - 2 * bw, 0),
- height: _max(rect[3] - 2 * bw, 0)
- })
- },
- setBackgroundOptions: function(options) {
- this._background.attr({
- stroke: options.borderColor,
- "stroke-width": options.borderWidth,
- fill: options.color
- });
- this._borderWidth = _max(options.borderWidth, 0);
- this._updateClip()
- },
- setRect: function(rect) {
- this._rect = rect;
- this._background.attr({
- x: rect[0],
- y: rect[1],
- width: rect[2],
- height: rect[3]
- });
- this._updateClip()
- },
- byIndex: function(index) {
- return this._layers[index]
- },
- byName: function(name) {
- return this._layerByName[name]
- },
- items: function() {
- return this._layers
- }
- };
- exports.MapLayerCollection = MapLayerCollection;
- exports._TESTS_MapLayer = MapLayer;
- exports._TESTS_stub_MapLayer = function(stub) {
- MapLayer = stub
- };
- exports._TESTS_selectStrategy = selectStrategy;
- exports._TESTS_stub_selectStrategy = function(stub) {
- selectStrategy = stub
- };
- exports._TESTS_MapLayerElement = MapLayerElement;
- exports._TESTS_stub_MapLayerElement = function(stub) {
- MapLayerElement = stub
- };
- exports._TESTS_createProxy = createProxy;
- exports._TESTS_stub_performGrouping = function(stub) {
- performGrouping = stub
- };
- exports._TESTS_performGrouping = performGrouping;
- exports._TESTS_stub_groupByColor = function(stub) {
- groupByColor = stub
- };
- exports._TESTS_groupByColor = groupByColor;
- exports._TESTS_stub_groupBySize = function(stub) {
- groupBySize = stub
- };
- exports._TESTS_groupBySize = groupBySize;
- exports._TESTS_findGroupingIndex = findGroupingIndex
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/vector_map/tooltip_viewer.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var TOOLTIP_OFFSET = 12;
- function TooltipViewer(params) {
- this._subscribeToTracker(params.tracker, params.tooltip, params.layerCollection)
- }
- TooltipViewer.prototype = {
- constructor: TooltipViewer,
- dispose: function() {
- this._offTracker();
- this._offTracker = null
- },
- _subscribeToTracker: function(tracker, tooltip, layerCollection) {
- this._offTracker = tracker.on({
- "focus-on": function(arg) {
- var result = false;
- var layer;
- var proxy;
- if (tooltip.isEnabled()) {
- layer = layerCollection.byName(arg.data.name);
- proxy = layer && layer.getProxy(arg.data.index);
- if (proxy && tooltip.show(proxy, {
- x: 0,
- y: 0,
- offset: 0
- }, {
- target: proxy
- })) {
- tooltip.move(arg.x, arg.y, TOOLTIP_OFFSET);
- result = true
- }
- }
- arg.done(result)
- },
- "focus-move": function(arg) {
- tooltip.move(arg.x, arg.y, TOOLTIP_OFFSET)
- },
- "focus-off": function() {
- tooltip.hide()
- }
- })
- }
- };
- exports.TooltipViewer = TooltipViewer
- },
- /*!***********************************************!*\
- !*** ./artifacts/transpiled/viz/sparkline.js ***!
- \***********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./sparklines/sparkline */ 822)
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/sparklines/sparkline.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var BaseSparkline = __webpack_require__( /*! ./base_sparkline */ 418);
- var dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 243);
- var seriesModule = __webpack_require__( /*! ../series/base_series */ 245);
- var MIN_BAR_WIDTH = 1;
- var MAX_BAR_WIDTH = 50;
- var DEFAULT_BAR_INTERVAL = 4;
- var DEFAULT_CANVAS_WIDTH = 250;
- var DEFAULT_CANVAS_HEIGHT = 30;
- var DEFAULT_POINT_BORDER = 2;
- var ALLOWED_TYPES = {
- line: true,
- spline: true,
- stepline: true,
- area: true,
- steparea: true,
- splinearea: true,
- bar: true,
- winloss: true
- };
- var _math = Math;
- var _abs = _math.abs;
- var _round = _math.round;
- var _max = _math.max;
- var _min = _math.min;
- var _isFinite = isFinite;
- var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
- var _map = vizUtils.map;
- var _normalizeEnum = vizUtils.normalizeEnum;
- var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var _Number = Number;
- var _String = String;
- function findMinMax(data, valField) {
- var firstItem = data[0] || {};
- var firstValue = firstItem[valField] || 0;
- var min = firstValue;
- var max = firstValue;
- var minIndexes = [0];
- var maxIndexes = [0];
- var dataLength = data.length;
- var value;
- var i;
- for (i = 1; i < dataLength; i++) {
- value = data[i][valField];
- if (value < min) {
- min = value;
- minIndexes = [i]
- } else {
- if (value === min) {
- minIndexes.push(i)
- }
- }
- if (value > max) {
- max = value;
- maxIndexes = [i]
- } else {
- if (value === max) {
- maxIndexes.push(i)
- }
- }
- }
- if (max === min) {
- minIndexes = maxIndexes = []
- }
- return {
- minIndexes: minIndexes,
- maxIndexes: maxIndexes
- }
- }
- function parseNumericDataSource(data, argField, valField, ignoreEmptyPoints) {
- return _map(data, function(dataItem, index) {
- var item = null;
- var isDataNumber;
- var value;
- if (void 0 !== dataItem) {
- item = {};
- isDataNumber = _isFinite(dataItem);
- item[argField] = isDataNumber ? _String(index) : dataItem[argField];
- value = isDataNumber ? dataItem : dataItem[valField];
- item[valField] = null === value ? ignoreEmptyPoints ? void 0 : value : _Number(value);
- item = void 0 !== item[argField] && void 0 !== item[valField] ? item : null
- }
- return item
- })
- }
- function parseWinlossDataSource(data, argField, valField, target) {
- var lowBarValue = -1;
- var zeroBarValue = 0;
- var highBarValue = 1;
- var delta = 1e-4;
- return _map(data, function(dataItem) {
- var item = {};
- item[argField] = dataItem[argField];
- if (_abs(dataItem[valField] - target) < delta) {
- item[valField] = zeroBarValue
- } else {
- if (dataItem[valField] > target) {
- item[valField] = highBarValue
- } else {
- item[valField] = lowBarValue
- }
- }
- return item
- })
- }
- function selectPointColor(color, options, index, pointIndexes) {
- if (index === pointIndexes.first || index === pointIndexes.last) {
- color = options.firstLastColor
- }
- if ((pointIndexes.min || []).indexOf(index) >= 0) {
- color = options.minColor
- }
- if ((pointIndexes.max || []).indexOf(index) >= 0) {
- color = options.maxColor
- }
- return color
- }
- function createLineCustomizeFunction(pointIndexes, options) {
- return function() {
- var color = selectPointColor(void 0, options, this.index, pointIndexes);
- return color ? {
- visible: true,
- border: {
- color: color
- }
- } : {}
- }
- }
- function createBarCustomizeFunction(pointIndexes, options, winlossData) {
- return function() {
- var index = this.index;
- var isWinloss = "winloss" === options.type;
- var target = isWinloss ? options.winlossThreshold : 0;
- var value = isWinloss ? winlossData[index][options.valueField] : this.value;
- var positiveColor = isWinloss ? options.winColor : options.barPositiveColor;
- var negativeColor = isWinloss ? options.lossColor : options.barNegativeColor;
- return {
- color: selectPointColor(value >= target ? positiveColor : negativeColor, options, index, pointIndexes)
- }
- }
- }
- var dxSparkline = BaseSparkline.inherit({
- _rootClassPrefix: "dxsl",
- _rootClass: "dxsl-sparkline",
- _themeSection: "sparkline",
- _defaultSize: {
- width: DEFAULT_CANVAS_WIDTH,
- height: DEFAULT_CANVAS_HEIGHT
- },
- _initCore: function() {
- this.callBase();
- this._createSeries()
- },
- _initialChanges: ["DATA_SOURCE"],
- _dataSourceChangedHandler: function() {
- this._requestChange(["UPDATE"])
- },
- _updateWidgetElements: function() {
- this._updateSeries();
- this.callBase()
- },
- _disposeWidgetElements: function() {
- var that = this;
- that._series && that._series.dispose();
- that._series = that._seriesGroup = that._seriesLabelGroup = null
- },
- _cleanWidgetElements: function() {
- this._seriesGroup.remove();
- this._seriesLabelGroup.remove();
- this._seriesGroup.clear();
- this._seriesLabelGroup.clear()
- },
- _drawWidgetElements: function() {
- if (this._dataIsLoaded()) {
- this._drawSeries();
- this._drawn()
- }
- },
- _getCorrectCanvas: function() {
- var options = this._allOptions;
- var canvas = this._canvas;
- var halfPointSize = options.pointSize && Math.ceil(options.pointSize / 2) + DEFAULT_POINT_BORDER;
- var type = options.type;
- if ("bar" !== type && "winloss" !== type && (options.showFirstLast || options.showMinMax)) {
- return {
- width: canvas.width,
- height: canvas.height,
- left: canvas.left + halfPointSize,
- right: canvas.right + halfPointSize,
- top: canvas.top + halfPointSize,
- bottom: canvas.bottom + halfPointSize
- }
- }
- return canvas
- },
- _prepareOptions: function() {
- var that = this;
- that._allOptions = that.callBase();
- that._allOptions.type = _normalizeEnum(that._allOptions.type);
- if (!ALLOWED_TYPES[that._allOptions.type]) {
- that._allOptions.type = "line"
- }
- },
- _createHtmlElements: function() {
- this._seriesGroup = this._renderer.g().attr({
- "class": "dxsl-series"
- });
- this._seriesLabelGroup = this._renderer.g().attr({
- "class": "dxsl-series-labels"
- })
- },
- _createSeries: function() {
- this._series = new seriesModule.Series({
- renderer: this._renderer,
- seriesGroup: this._seriesGroup,
- labelsGroup: this._seriesLabelGroup,
- argumentAxis: this._argumentAxis,
- valueAxis: this._valueAxis
- }, {
- widgetType: "chart",
- type: "line"
- })
- },
- getSeriesOptions: function() {
- return this._series.getOptions()
- },
- _updateSeries: function() {
- var that = this;
- var singleSeries = that._series;
- that._prepareDataSource();
- var seriesOptions = that._prepareSeriesOptions();
- singleSeries.updateOptions(seriesOptions);
- var groupsData = {
- groups: [{
- series: [singleSeries]
- }]
- };
- groupsData.argumentOptions = {
- type: "bar" === seriesOptions.type ? "discrete" : void 0
- };
- that._simpleDataSource = dataValidatorModule.validateData(that._simpleDataSource, groupsData, that._incidentOccurred, {
- checkTypeForAllData: false,
- convertToAxisDataType: true,
- sortingMethod: true
- })[singleSeries.getArgumentField()];
- seriesOptions.customizePoint = that._getCustomizeFunction();
- singleSeries.updateData(that._simpleDataSource);
- singleSeries.createPoints();
- that._groupsDataCategories = groupsData.categories
- },
- _optionChangesMap: {
- dataSource: "DATA_SOURCE"
- },
- _optionChangesOrder: ["DATA_SOURCE"],
- _change_DATA_SOURCE: function() {
- this._updateDataSource()
- },
- _prepareDataSource: function() {
- var that = this;
- var options = that._allOptions;
- var argField = options.argumentField;
- var valField = options.valueField;
- var dataSource = that._dataSourceItems() || [];
- var data = parseNumericDataSource(dataSource, argField, valField, that.option("ignoreEmptyPoints"));
- if ("winloss" === options.type) {
- that._winlossDataSource = data;
- that._simpleDataSource = parseWinlossDataSource(data, argField, valField, options.winlossThreshold)
- } else {
- that._simpleDataSource = data
- }
- },
- _prepareSeriesOptions: function() {
- var that = this;
- var options = that._allOptions;
- var type = "winloss" === options.type ? "bar" : options.type;
- return {
- visible: true,
- argumentField: options.argumentField,
- valueField: options.valueField,
- color: options.lineColor,
- width: options.lineWidth,
- widgetType: "chart",
- type: type,
- opacity: type.indexOf("area") !== -1 ? that._allOptions.areaOpacity : void 0,
- point: {
- size: options.pointSize,
- symbol: options.pointSymbol,
- border: {
- visible: true,
- width: DEFAULT_POINT_BORDER
- },
- color: options.pointColor,
- visible: false,
- hoverStyle: {
- border: {}
- },
- selectionStyle: {
- border: {}
- }
- },
- border: {
- color: options.lineColor,
- width: options.lineWidth,
- visible: "bar" !== type
- }
- }
- },
- _getCustomizeFunction: function() {
- var that = this;
- var options = that._allOptions;
- var dataSource = that._winlossDataSource || that._simpleDataSource;
- var drawnPointIndexes = that._getExtremumPointsIndexes(dataSource);
- var customizeFunction;
- if ("winloss" === options.type || "bar" === options.type) {
- customizeFunction = createBarCustomizeFunction(drawnPointIndexes, options, that._winlossDataSource)
- } else {
- customizeFunction = createLineCustomizeFunction(drawnPointIndexes, options)
- }
- return customizeFunction
- },
- _getExtremumPointsIndexes: function(data) {
- var that = this;
- var options = that._allOptions;
- var lastIndex = data.length - 1;
- var indexes = {};
- that._minMaxIndexes = findMinMax(data, options.valueField);
- if (options.showFirstLast) {
- indexes.first = 0;
- indexes.last = lastIndex
- }
- if (options.showMinMax) {
- indexes.min = that._minMaxIndexes.minIndexes;
- indexes.max = that._minMaxIndexes.maxIndexes
- }
- return indexes
- },
- _getStick: function() {
- return {
- stick: "bar" !== this._series.type
- }
- },
- _updateRange: function() {
- var that = this;
- var series = that._series;
- var type = series.type;
- var isBarType = "bar" === type;
- var isWinlossType = "winloss" === type;
- var DEFAULT_VALUE_RANGE_MARGIN = .15;
- var DEFAULT_ARGUMENT_RANGE_MARGIN = .1;
- var WINLOSS_MAX_RANGE = 1;
- var WINLOSS_MIN_RANGE = -1;
- var rangeData = series.getRangeData();
- var minValue = that._allOptions.minValue;
- var hasMinY = _isDefined(minValue) && _isFinite(minValue);
- var maxValue = that._allOptions.maxValue;
- var hasMaxY = _isDefined(maxValue) && _isFinite(maxValue);
- var argCoef;
- var valCoef = (rangeData.val.max - rangeData.val.min) * DEFAULT_VALUE_RANGE_MARGIN;
- if (isBarType || isWinlossType || "area" === type) {
- if (0 !== rangeData.val.min) {
- rangeData.val.min -= valCoef
- }
- if (0 !== rangeData.val.max) {
- rangeData.val.max += valCoef
- }
- } else {
- rangeData.val.min -= valCoef;
- rangeData.val.max += valCoef
- }
- if (hasMinY || hasMaxY) {
- if (hasMinY && hasMaxY) {
- rangeData.val.minVisible = _min(minValue, maxValue);
- rangeData.val.maxVisible = _max(minValue, maxValue)
- } else {
- rangeData.val.minVisible = hasMinY ? _Number(minValue) : void 0;
- rangeData.val.maxVisible = hasMaxY ? _Number(maxValue) : void 0
- }
- if (isWinlossType) {
- rangeData.val.minVisible = hasMinY ? _max(rangeData.val.minVisible, WINLOSS_MIN_RANGE) : void 0;
- rangeData.val.maxVisible = hasMaxY ? _min(rangeData.val.maxVisible, WINLOSS_MAX_RANGE) : void 0
- }
- }
- if (series.getPoints().length > 1) {
- if (isBarType) {
- argCoef = (rangeData.arg.max - rangeData.arg.min) * DEFAULT_ARGUMENT_RANGE_MARGIN;
- rangeData.arg.min = rangeData.arg.min - argCoef;
- rangeData.arg.max = rangeData.arg.max + argCoef
- }
- }
- rangeData.arg.categories = that._groupsDataCategories;
- that._ranges = rangeData
- },
- _getBarWidth: function(pointsCount) {
- var that = this;
- var canvas = that._canvas;
- var intervalWidth = pointsCount * DEFAULT_BAR_INTERVAL;
- var rangeWidth = canvas.width - canvas.left - canvas.right - intervalWidth;
- var width = _round(rangeWidth / pointsCount);
- if (width < MIN_BAR_WIDTH) {
- width = MIN_BAR_WIDTH
- }
- if (width > MAX_BAR_WIDTH) {
- width = MAX_BAR_WIDTH
- }
- return width
- },
- _correctPoints: function() {
- var that = this;
- var seriesType = that._allOptions.type;
- var seriesPoints = that._series.getPoints();
- var pointsLength = seriesPoints.length;
- var barWidth;
- var i;
- if ("bar" === seriesType || "winloss" === seriesType) {
- barWidth = that._getBarWidth(pointsLength);
- for (i = 0; i < pointsLength; i++) {
- seriesPoints[i].correctCoordinates({
- width: barWidth,
- offset: 0
- })
- }
- }
- },
- _drawSeries: function() {
- var that = this;
- if (that._simpleDataSource.length > 0) {
- that._correctPoints();
- that._series.draw();
- that._seriesGroup.append(that._renderer.root)
- }
- },
- _isTooltipEnabled: function() {
- return !!this._simpleDataSource.length
- },
- _getTooltipData: function() {
- var that = this;
- var options = that._allOptions;
- var dataSource = that._winlossDataSource || that._simpleDataSource;
- var tooltip = that._tooltip;
- if (0 === dataSource.length) {
- return {}
- }
- var minMax = that._minMaxIndexes;
- var valueField = options.valueField;
- var first = dataSource[0][valueField];
- var last = dataSource[dataSource.length - 1][valueField];
- var min = _isDefined(minMax.minIndexes[0]) ? dataSource[minMax.minIndexes[0]][valueField] : first;
- var max = _isDefined(minMax.maxIndexes[0]) ? dataSource[minMax.maxIndexes[0]][valueField] : first;
- var formattedFirst = tooltip.formatValue(first);
- var formattedLast = tooltip.formatValue(last);
- var formattedMin = tooltip.formatValue(min);
- var formattedMax = tooltip.formatValue(max);
- var customizeObject = {
- firstValue: formattedFirst,
- lastValue: formattedLast,
- minValue: formattedMin,
- maxValue: formattedMax,
- originalFirstValue: first,
- originalLastValue: last,
- originalMinValue: min,
- originalMaxValue: max,
- valueText: ["Start:", formattedFirst, "End:", formattedLast, "Min:", formattedMin, "Max:", formattedMax]
- };
- if ("winloss" === options.type) {
- customizeObject.originalThresholdValue = options.winlossThreshold;
- customizeObject.thresholdValue = tooltip.formatValue(options.winlossThreshold)
- }
- return customizeObject
- }
- });
- _map(["lineColor", "lineWidth", "areaOpacity", "minColor", "maxColor", "barPositiveColor", "barNegativeColor", "winColor", "lessColor", "firstLastColor", "pointSymbol", "pointColor", "pointSize", "type", "argumentField", "valueField", "winlossThreshold", "showFirstLast", "showMinMax", "ignoreEmptyPoints", "minValue", "maxValue"], function(name) {
- dxSparkline.prototype._optionChangesMap[name] = "OPTIONS"
- });
- __webpack_require__( /*! ../../core/component_registrator */ 9)("dxSparkline", dxSparkline);
- module.exports = dxSparkline;
- dxSparkline.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/viz/bullet.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./sparklines/bullet */ 824)
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/sparklines/bullet.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
- var BaseSparkline = __webpack_require__( /*! ./base_sparkline */ 418);
- var TARGET_MIN_Y = .02;
- var TARGET_MAX_Y = .98;
- var BAR_VALUE_MIN_Y = .1;
- var BAR_VALUE_MAX_Y = .9;
- var DEFAULT_CANVAS_WIDTH = 300;
- var DEFAULT_CANVAS_HEIGHT = 30;
- var DEFAULT_HORIZONTAL_MARGIN = 1;
- var DEFAULT_VERTICAL_MARGIN = 2;
- var _Number = Number;
- var _isFinite = isFinite;
- var dxBullet = BaseSparkline.inherit({
- _rootClassPrefix: "dxb",
- _rootClass: "dxb-bullet",
- _themeSection: "bullet",
- _defaultSize: {
- width: DEFAULT_CANVAS_WIDTH,
- height: DEFAULT_CANVAS_HEIGHT,
- left: DEFAULT_HORIZONTAL_MARGIN,
- right: DEFAULT_HORIZONTAL_MARGIN,
- top: DEFAULT_VERTICAL_MARGIN,
- bottom: DEFAULT_VERTICAL_MARGIN
- },
- _disposeWidgetElements: function() {
- delete this._zeroLevelPath;
- delete this._targetPath;
- delete this._barValuePath
- },
- _cleanWidgetElements: function() {
- this._zeroLevelPath.remove();
- this._targetPath.remove();
- this._barValuePath.remove()
- },
- _drawWidgetElements: function() {
- this._drawBullet();
- this._drawn()
- },
- _createHtmlElements: function() {
- var renderer = this._renderer;
- this._zeroLevelPath = renderer.path(void 0, "line").attr({
- "class": "dxb-zero-level",
- "stroke-linecap": "square"
- });
- this._targetPath = renderer.path(void 0, "line").attr({
- "class": "dxb-target",
- "stroke-linecap": "square"
- });
- this._barValuePath = renderer.path(void 0, "line").attr({
- "class": "dxb-bar-value",
- "stroke-linecap": "square"
- })
- },
- _prepareOptions: function() {
- var that = this;
- var options;
- var startScaleValue;
- var endScaleValue;
- var level;
- var value;
- var target;
- that._allOptions = options = that.callBase();
- var isValueUndefined = void 0 === that._allOptions.value;
- var isTargetUndefined = void 0 === that._allOptions.target;
- that._tooltipEnabled = !(isValueUndefined && isTargetUndefined);
- if (isValueUndefined) {
- that._allOptions.value = 0
- }
- if (isTargetUndefined) {
- that._allOptions.target = 0
- }
- options.value = value = _Number(options.value);
- options.target = target = _Number(options.target);
- if (void 0 === that._allOptions.startScaleValue) {
- that._allOptions.startScaleValue = target < value ? target : value;
- that._allOptions.startScaleValue = that._allOptions.startScaleValue < 0 ? that._allOptions.startScaleValue : 0
- }
- if (void 0 === that._allOptions.endScaleValue) {
- that._allOptions.endScaleValue = target > value ? target : value
- }
- options.startScaleValue = startScaleValue = _Number(options.startScaleValue);
- options.endScaleValue = endScaleValue = _Number(options.endScaleValue);
- if (endScaleValue < startScaleValue) {
- level = endScaleValue;
- that._allOptions.endScaleValue = startScaleValue;
- that._allOptions.startScaleValue = level;
- that._allOptions.inverted = true
- }
- },
- _updateRange: function() {
- var that = this;
- var options = that._allOptions;
- that._ranges = {
- arg: {
- invert: options.inverted,
- min: options.startScaleValue,
- max: options.endScaleValue,
- axisType: "continuous",
- dataType: "numeric"
- },
- val: {
- min: 0,
- max: 1,
- axisType: "continuous",
- dataType: "numeric"
- }
- }
- },
- _drawBullet: function() {
- var that = this;
- var options = that._allOptions;
- var isValidBounds = options.startScaleValue !== options.endScaleValue;
- var isValidMin = _isFinite(options.startScaleValue);
- var isValidMax = _isFinite(options.endScaleValue);
- var isValidValue = _isFinite(options.value);
- var isValidTarget = _isFinite(options.target);
- if (isValidBounds && isValidMax && isValidMin && isValidTarget && isValidValue) {
- this._drawBarValue();
- this._drawTarget();
- this._drawZeroLevel()
- }
- },
- _getTargetParams: function() {
- var that = this;
- var options = that._allOptions;
- var translatorY = that._valueAxis.getTranslator();
- var x = that._argumentAxis.getTranslator().translate(options.target);
- return {
- points: [x, translatorY.translate(TARGET_MIN_Y), x, translatorY.translate(TARGET_MAX_Y)],
- stroke: options.targetColor,
- "stroke-width": options.targetWidth
- }
- },
- _getBarValueParams: function() {
- var that = this;
- var options = that._allOptions;
- var translatorX = that._argumentAxis.getTranslator();
- var translatorY = that._valueAxis.getTranslator();
- var startLevel = options.startScaleValue;
- var endLevel = options.endScaleValue;
- var value = options.value;
- var y2 = translatorY.translate(BAR_VALUE_MIN_Y);
- var y1 = translatorY.translate(BAR_VALUE_MAX_Y);
- var x1;
- var x2;
- if (value > 0) {
- x1 = startLevel <= 0 ? 0 : startLevel;
- x2 = value >= endLevel ? endLevel : value < x1 ? x1 : value
- } else {
- x1 = endLevel >= 0 ? 0 : endLevel;
- x2 = value < startLevel ? startLevel : value > x1 ? x1 : value
- }
- x1 = translatorX.translate(x1);
- x2 = translatorX.translate(x2);
- return {
- points: [x1, y1, x2, y1, x2, y2, x1, y2],
- fill: options.color
- }
- },
- _getCorrectCanvas: function() {
- return this._canvas
- },
- _getZeroLevelParams: function() {
- var that = this;
- var translatorY = that._valueAxis.getTranslator();
- var x = that._argumentAxis.getTranslator().translate(0);
- return {
- points: [x, translatorY.translate(TARGET_MIN_Y), x, translatorY.translate(TARGET_MAX_Y)],
- stroke: that._allOptions.targetColor,
- "stroke-width": 1
- }
- },
- _drawZeroLevel: function() {
- var that = this;
- var options = that._allOptions;
- if (0 > options.endScaleValue || 0 < options.startScaleValue || !options.showZeroLevel) {
- return
- }
- that._zeroLevelPath.attr(that._getZeroLevelParams()).sharp().append(that._renderer.root)
- },
- _drawTarget: function() {
- var that = this;
- var options = that._allOptions;
- var target = options.target;
- if (target > options.endScaleValue || target < options.startScaleValue || !options.showTarget) {
- return
- }
- that._targetPath.attr(that._getTargetParams()).sharp().append(that._renderer.root)
- },
- _drawBarValue: function() {
- this._barValuePath.attr(this._getBarValueParams()).append(this._renderer.root)
- },
- _getTooltipCoords: function() {
- var canvas = this._canvas;
- var rootOffset = this._renderer.getRootOffset();
- var bBox = this._barValuePath.getBBox();
- return {
- x: bBox.x + bBox.width / 2 + rootOffset.left,
- y: canvas.height / 2 + rootOffset.top
- }
- },
- _getTooltipData: function() {
- var that = this;
- var tooltip = that._tooltip;
- var options = that._allOptions;
- var value = options.value;
- var target = options.target;
- var valueText = tooltip.formatValue(value);
- var targetText = tooltip.formatValue(target);
- return {
- originalValue: value,
- originalTarget: target,
- value: valueText,
- target: targetText,
- valueText: ["Actual Value:", valueText, "Target Value:", targetText]
- }
- },
- _isTooltipEnabled: function() {
- return this._tooltipEnabled
- }
- });
- each(["color", "targetColor", "targetWidth", "showTarget", "showZeroLevel", "value", "target", "startScaleValue", "endScaleValue"], function(_, name) {
- dxBullet.prototype._optionChangesMap[name] = "OPTIONS"
- });
- __webpack_require__( /*! ../../core/component_registrator */ 9)("dxBullet", dxBullet);
- module.exports = dxBullet
- },
- /*!**********************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map.js ***!
- \**********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! ./tree_map/tree_map */ 826)
- },
- /*!*******************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tree_map.js ***!
- \*******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dxTreeMap = module.exports = __webpack_require__( /*! ./tree_map.base */ 70);
- __webpack_require__( /*! ./tiling.squarified */ 419);
- __webpack_require__( /*! ./tiling.strip */ 827);
- __webpack_require__( /*! ./tiling.slice_and_dice */ 828);
- __webpack_require__( /*! ./tiling.rotated_slice_and_dice */ 829);
- __webpack_require__( /*! ./colorizing.discrete */ 421);
- __webpack_require__( /*! ./colorizing.gradient */ 830);
- __webpack_require__( /*! ./colorizing.range */ 831);
- __webpack_require__( /*! ./api */ 146);
- __webpack_require__( /*! ./hover */ 422);
- __webpack_require__( /*! ./selection */ 832);
- __webpack_require__( /*! ./tooltip */ 424);
- __webpack_require__( /*! ./tracker */ 833);
- __webpack_require__( /*! ./drilldown */ 834);
- __webpack_require__( /*! ./plain_data_source */ 835);
- dxTreeMap.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
- dxTreeMap.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
- dxTreeMap.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin)
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tiling.strip.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _squarify = __webpack_require__( /*! ./tiling.squarified.base */ 420);
- function accumulate(total, current, count) {
- return ((count - 1) * total + current) / count
- }
- function strip(data) {
- return _squarify(data, accumulate, true)
- }
- __webpack_require__( /*! ./tiling */ 120).addAlgorithm("strip", strip);
- module.exports = strip
- },
- /*!********************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tiling.slice_and_dice.js ***!
- \********************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var tiling = __webpack_require__( /*! ./tiling */ 120);
- function sliceAndDice(data) {
- var items = data.items;
- var sidesData = tiling.buildSidesData(data.rect, data.directions, data.isRotated ? 1 : 0);
- tiling.calculateRectangles(items, 0, data.rect, sidesData, {
- sum: data.sum,
- count: items.length,
- side: sidesData.variedSide
- })
- }
- tiling.addAlgorithm("sliceanddice", sliceAndDice);
- module.exports = sliceAndDice
- },
- /*!****************************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tiling.rotated_slice_and_dice.js ***!
- \****************************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var tiling = __webpack_require__( /*! ./tiling */ 120);
- var sliceAndDiceAlgorithm = tiling.getAlgorithm("sliceanddice");
- function rotatedSliceAndDice(data) {
- data.isRotated = !data.isRotated;
- return sliceAndDiceAlgorithm.call(this, data)
- }
- tiling.addAlgorithm("rotatedsliceanddice", rotatedSliceAndDice)
- },
- /*!******************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/colorizing.gradient.js ***!
- \******************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _createColorCodeGetter = __webpack_require__( /*! ./colorizing */ 121).createColorCodeGetter;
- var _min = Math.min;
- var _max = Math.max;
- function createSimpleColorizer(getColor, range) {
- return function(node) {
- return getColor(node, range)
- }
- }
- function getRangeData(range) {
- return [Number(range[0]) || 0, range[1] - range[0] || 1]
- }
- function calculateRange(nodes, getValue) {
- var i;
- var ii = nodes.length;
- var codes = [];
- var code;
- for (i = 0; i < ii; ++i) {
- code = getValue(nodes[i]);
- if (isFinite(code)) {
- codes.push(code)
- }
- }
- return getRangeData([_min.apply(null, codes), _max.apply(null, codes)])
- }
- function createGuessingColorizer(getColor, getValue) {
- var ranges = {};
- return function(node) {
- var parent = node.parent;
- return getColor(node, ranges[parent._id] || (ranges[parent._id] = calculateRange(parent.nodes, getValue)))
- }
- }
- function gradientColorizer(options, themeManager) {
- var palette = themeManager.createGradientPalette(options.palette);
- var getValue = _createColorCodeGetter(options);
- return "range" in options ? createSimpleColorizer(getColor, getRangeData(options.range || [])) : createGuessingColorizer(getColor, getValue);
- function getColor(node, arg) {
- return palette.getColor((getValue(node) - arg[0]) / arg[1])
- }
- }
- __webpack_require__( /*! ./colorizing */ 121).addColorizer("gradient", gradientColorizer);
- module.exports = gradientColorizer
- },
- /*!***************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/colorizing.range.js ***!
- \***************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _createColorCodeGetter = __webpack_require__( /*! ./colorizing */ 121).createColorCodeGetter;
- function getPaletteIndex(value, items) {
- var start = 0;
- var end = items.length - 1;
- var index = -1;
- var middle;
- if (items[start] <= value && value <= items[end]) {
- if (value === items[end]) {
- index = end - 1
- } else {
- while (end - start > 1) {
- middle = start + end >> 1;
- if (value < items[middle]) {
- end = middle
- } else {
- start = middle
- }
- }
- index = start
- }
- }
- return index
- }
- function rangeColorizer(options, themeManager) {
- var range = options.range || [];
- var palette = themeManager.createDiscretePalette(options.palette, range.length - 1);
- var getValue = _createColorCodeGetter(options);
- return function(node) {
- return palette.getColor(getPaletteIndex(getValue(node), range))
- }
- }
- __webpack_require__( /*! ./colorizing */ 121).addColorizer("range", rangeColorizer);
- module.exports = rangeColorizer
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/selection.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
- var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
- var common = __webpack_require__( /*! ./common */ 251);
- var _buildRectAppearance = common.buildRectAppearance;
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var _inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
- var MODE_NONE = 0;
- var MODE_SINGLE = 1;
- var MODE_MULTIPLE = 2;
- var STATE_CODE = 2;
- __webpack_require__( /*! ./api */ 146);
- __webpack_require__( /*! ./states */ 423);
- proto._eventsMap.onSelectionChanged = {
- name: "selectionChanged"
- };
- expand(proto._handlers, "calculateAdditionalStates", function(states, options) {
- states[2] = options.selectionStyle ? _buildRectAppearance(options.selectionStyle) : {}
- });
- nodeProto.statesMap[2] = nodeProto.statesMap[3] = STATE_CODE;
- nodeProto.additionalStates.push(2);
- expand(proto, "_onNodesCreated", function() {
- this._selectionList.length = 0
- });
- expand(proto, "_extendProxyType", function(proto) {
- var that = this;
- proto.select = function(state) {
- that._selectNode(this._id, !!state)
- };
- proto.isSelected = function() {
- return _inArray(this._id, that._selectionList) >= 0
- };
- that._selectionList = []
- });
- __webpack_require__( /*! ./tree_map.base */ 70).addChange({
- code: "SELECTION_MODE",
- handler: function() {
- var that = this;
- var option = _normalizeEnum(that._getOption("selectionMode", true));
- var selectionList = that._selectionList;
- var mode = "none" === option ? MODE_NONE : "multiple" === option ? MODE_MULTIPLE : MODE_SINGLE;
- if (mode === MODE_SINGLE && selectionList.length > 1) {
- var tmp = selectionList.pop();
- that.clearSelection();
- selectionList.push(tmp)
- } else {
- if (mode === MODE_NONE) {
- that.clearSelection()
- }
- }
- that._selectionMode = mode
- },
- isThemeDependent: true,
- isOptionChange: true,
- option: "selectionMode"
- });
- expand(proto, "_applyTilesAppearance", function() {
- if (this._selectionList.length) {
- bringSelectedTilesToForeground(this._nodes, this._selectionList)
- }
- });
- function bringSelectedTilesToForeground(nodes, selectionList) {
- var i;
- var ii = selectionList.length;
- for (i = 0; i < ii; ++i) {
- var node = nodes[selectionList[i]];
- tileToFront[Number(node.isNode())](node.tile)
- }
- }
- var tileToFront = [leafToFront, groupToFront];
- function leafToFront(content) {
- content.toForeground()
- }
- function groupToFront(content) {
- content.outer.toForeground();
- content.inner.toForeground()
- }
- proto._applySelectionState = function(index, state) {
- var node = this._nodes[index];
- node.setState(STATE_CODE, state);
- this._eventTrigger("selectionChanged", {
- node: node.proxy
- })
- };
- proto._selectNode = function(index, state) {
- var that = this;
- if (that._selectionMode !== MODE_NONE) {
- that._context.suspend();
- var selectionList = that._selectionList;
- var k = _inArray(index, selectionList);
- if (state && k === -1) {
- if (that._selectionMode === MODE_SINGLE) {
- if (selectionList.length) {
- var tmp = selectionList.pop();
- that._applySelectionState(tmp, false)
- }
- }
- selectionList.push(index);
- that._applySelectionState(index, true)
- } else {
- if (!state && k >= 0) {
- selectionList.splice(k, 1);
- that._applySelectionState(index, false)
- }
- }
- that._context.resume()
- }
- };
- proto.clearSelection = function() {
- var that = this;
- var selectionList = that._selectionList;
- var i;
- var ii = selectionList.length;
- if (that._selectionMode !== MODE_NONE) {
- that._context.suspend();
- for (i = 0; i < ii; ++i) {
- that._applySelectionState(selectionList[i], false)
- }
- selectionList.length = 0;
- that._context.resume()
- }
- }
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/tracker.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- var Tracker = __webpack_require__( /*! ../components/tracker */ 252).Tracker;
- var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
- var _parseScalar = __webpack_require__( /*! ../core/utils */ 10).parseScalar;
- var DATA_KEY_BASE = "__treemap_data_";
- var dataKeyModifier = 0;
- __webpack_require__( /*! ./api */ 146);
- __webpack_require__( /*! ./hover */ 422);
- __webpack_require__( /*! ./tooltip */ 424);
- proto._eventsMap.onClick = {
- name: "click"
- };
- expand(proto, "_initCore", function() {
- var that = this;
- var dataKey = DATA_KEY_BASE + dataKeyModifier++;
- var getProxy = function(index) {
- return that._nodes[index].proxy
- };
- that._tracker = new Tracker({
- widget: that,
- root: that._renderer.root,
- getNode: function(id) {
- var proxy = getProxy(id);
- var interactWithGroup = _parseScalar(that._getOption("interactWithGroup", true));
- return interactWithGroup && proxy.isLeaf() && proxy.getParent().isActive() ? proxy.getParent() : proxy
- },
- getData: function(e) {
- var target = e.target;
- return ("tspan" === target.tagName ? target.parentNode : target)[dataKey]
- },
- getProxy: getProxy,
- click: function(e) {
- that._eventTrigger("click", e)
- }
- });
- that._handlers.setTrackerData = function(node, element) {
- element.data(dataKey, node._id)
- };
- exports._TESTS_dataKey = dataKey
- });
- expand(proto, "_disposeCore", function() {
- this._tracker.dispose()
- })
- },
- /*!********************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/drilldown.js ***!
- \********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- var _expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
- __webpack_require__( /*! ./api */ 146);
- proto._eventsMap.onDrill = {
- name: "drill"
- };
- _expand(proto, "_extendProxyType", function(proto) {
- var that = this;
- proto.drillDown = function() {
- that._drillToNode(this._id)
- }
- });
- _expand(proto, "_onNodesCreated", function() {
- this._drilldownIndex = -1
- });
- proto._drillToNode = function(index) {
- var that = this;
- var node;
- if (that._drilldownIndex !== index) {
- node = that._nodes[index] || that._root;
- if (node.nodes) {
- that._drilldownIndex = index;
- that._topNode = node;
- that._context.suspend();
- that._context.change(["MAX_DEPTH", "NODES_RESET"]);
- that._context.resume();
- that._eventTrigger("drill", {
- node: node.proxy
- })
- }
- }
- };
- proto.resetDrillDown = function() {
- this._drillToNode(-1);
- return this
- };
- proto.drillUp = function() {
- this._drillToNode(this._topNode.parent._id || -1);
- return this
- };
- proto.getCurrentNode = function() {
- return this._topNode.proxy
- }
- },
- /*!****************************************************************!*\
- !*** ./artifacts/transpiled/viz/tree_map/plain_data_source.js ***!
- \****************************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
- proto._optionChangesMap.idField = proto._optionChangesMap.parentField = "NODES_CREATE";
- proto._processDataSourceItems = function(items) {
- var i;
- var struct = {};
- var currentItem;
- var idField = this._getOption("idField", true);
- var parentField = this._getOption("parentField", true);
- var parentId;
- var rootNodes = [];
- var tmpItems;
- var item;
- if (!idField || !parentField || 0 === items.length) {
- return {
- items: items,
- isPlain: true
- }
- }
- for (i = 0; i < items.length; i++) {
- currentItem = items[i];
- parentId = currentItem[parentField];
- if (parentId) {
- struct[parentId] = struct[parentId] || {
- items: []
- };
- tmpItems = struct[parentId].items
- } else {
- tmpItems = rootNodes
- }
- tmpItems.push(currentItem)
- }
- treeFiller({
- struct: struct,
- idField: idField
- }, rootNodes);
- for (item in struct) {
- struct[item] && rootNodes.push(struct[item])
- }
- return {
- items: rootNodes,
- isPlain: true
- }
- };
- function treeFiller(context, items) {
- var currentItem;
- var i;
- var struct = context.struct;
- var id;
- for (i = 0; i < items.length; i++) {
- currentItem = items[i];
- id = currentItem[context.idField];
- if (struct[id]) {
- currentItem.items = struct[id].items;
- struct[id] = null;
- treeFiller(context, currentItem.items)
- }
- }
- }
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/viz/funnel.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dxFunnel = __webpack_require__( /*! ./funnel/funnel */ 425);
- dxFunnel.addPlugin(__webpack_require__( /*! ./funnel/label */ 841).plugin);
- dxFunnel.addPlugin(__webpack_require__( /*! ./core/export */ 93).plugin);
- dxFunnel.addPlugin(__webpack_require__( /*! ./core/title */ 105).plugin);
- dxFunnel.addPlugin(__webpack_require__( /*! ./components/legend */ 201).plugin);
- dxFunnel.addPlugin(__webpack_require__( /*! ./funnel/tracker */ 842).plugin);
- dxFunnel.addPlugin(__webpack_require__( /*! ./funnel/tooltip */ 843).plugin);
- dxFunnel.addPlugin(__webpack_require__( /*! ./core/loading_indicator */ 119).plugin);
- module.exports = dxFunnel
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/tiling.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
- var algorithms = {};
- var defaultAlgorithm;
- exports.getAlgorithm = function(name) {
- return algorithms[_normalizeEnum(name)] || defaultAlgorithm
- };
- exports.addAlgorithm = function(name, callback, setDefault) {
- algorithms[name] = callback;
- if (setDefault) {
- defaultAlgorithm = algorithms[name]
- }
- }
- },
- /*!**********************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/tiling.funnel.js ***!
- \**********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var CENTER = .5;
- module.exports = {
- getFigures: function(data) {
- var height = 1 / data.length;
- return data.map(function(value, index, array) {
- var nextValue = array[index + 1] ? array[index + 1] : array[index];
- return [CENTER - value / 2, height * index, CENTER + value / 2, height * index, CENTER + nextValue / 2, height * (index + 1), CENTER - nextValue / 2, height * (index + 1)]
- })
- },
- normalizeValues: function(items) {
- var max = items.reduce(function(max, item) {
- return Math.max(item.value, max)
- }, items[0] && items[0].value || 0);
- return items.map(function(item) {
- return item.value / max
- })
- }
- }
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/tiling.pyramid.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var CENTER = .5;
- var LEFTCORNER = 0;
- var RIGHTCORNER = 1;
- module.exports = {
- getFigures: function(data, neckWidth, neckHeight) {
- var height = 0;
- var y = 0;
- var x = 0;
- var offsetX = 0;
- var halfNeckWidth = neckWidth / 2;
- var offsetFromCorner = CENTER - halfNeckWidth;
- var funnelHeight = 1 - neckHeight;
- var neckLeftCorner = CENTER - halfNeckWidth;
- var neckRightCorner = CENTER + halfNeckWidth;
- return data.map(function(value) {
- x = offsetX;
- y = height;
- height += value;
- offsetX = offsetFromCorner * height / funnelHeight;
- if (y <= funnelHeight && height <= funnelHeight) {
- return [x, y, RIGHTCORNER - x, y, RIGHTCORNER - offsetX, height, LEFTCORNER + offsetX, height]
- } else {
- if (y <= funnelHeight && height > funnelHeight) {
- return [x, y, RIGHTCORNER - x, y, neckRightCorner, funnelHeight, neckRightCorner, height, neckLeftCorner, height, neckLeftCorner, funnelHeight]
- } else {
- return [neckLeftCorner, y, neckRightCorner, y, neckRightCorner, height, neckLeftCorner, height]
- }
- }
- })
- },
- normalizeValues: function(items) {
- var sum = items.reduce(function(sum, item) {
- return sum + item.value
- }, 0);
- return items.map(function(item) {
- return item.value / sum
- })
- }
- }
- },
- /*!*************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/item.js ***!
- \*************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var states = ["normal", "hover", "selection", "selection"];
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- function parseStyles(color, style, baseStyle) {
- var border = style.border;
- var baseBorder = baseStyle.border;
- var borderVisible = isDefined(border.visible) ? border.visible : baseBorder.visible;
- var borderWidth = isDefined(border.width) ? border.width : baseBorder.width;
- return {
- fill: color,
- hatching: style.hatching,
- stroke: border.color || baseBorder.color,
- "stroke-width": borderVisible ? borderWidth : 0
- }
- }
- function Item(widget, options) {
- var that = this;
- var data = options.data;
- that.code = 0;
- that.widget = widget;
- that.figure = options.figure;
- that.argument = data.argument;
- that.value = data.value;
- that.data = data.dataItem;
- that.percent = options.percent;
- that.id = options.id;
- that.color = options.color;
- that.states = {
- normal: parseStyles(options.color, options.itemOptions, options.itemOptions),
- hover: parseStyles(options.color, options.itemOptions.hoverStyle, options.itemOptions),
- selection: parseStyles(options.color, options.itemOptions.selectionStyle, options.itemOptions)
- }
- }
- Item.prototype = {
- getState: function() {
- return states[this.code]
- },
- getNormalStyle: function() {
- return this.states.normal
- },
- setHover: function() {
- this.hover(true)
- },
- hover: function(state) {
- if (!this.widget._getOption("hoverEnabled", true) || state === this.isHovered()) {
- return
- }
- this.widget._suspend();
- state && this.widget.clearHover();
- this.setState(1, state);
- this.widget._eventTrigger("hoverChanged", {
- item: this
- });
- this.widget._resume()
- },
- setState: function(code, state) {
- if (state) {
- this.code |= code
- } else {
- this.code &= ~code
- }
- this.widget._applyTilesAppearance()
- },
- select: function(state) {
- var mode = this.widget._getOption("selectionMode", true);
- if ("none" === mode || state === this.isSelected()) {
- return
- }
- this.widget._suspend();
- if (state && "multiple" !== mode) {
- this.widget.clearSelection()
- }
- this.setState(2, state);
- this.widget._eventTrigger("selectionChanged", {
- item: this
- });
- this.widget._resume()
- },
- showTooltip: function(coords) {
- this.widget._showTooltip(this.id, coords)
- },
- getColor: function() {
- return this.color
- },
- isHovered: function() {
- return !!(1 & this.code)
- },
- isSelected: function() {
- return !!(2 & this.code)
- }
- };
- module.exports = Item
- },
- /*!**************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/label.js ***!
- \**************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _label = __webpack_require__( /*! ../series/points/label */ 246);
- var _label2 = _interopRequireDefault(_label);
- var _utils = __webpack_require__( /*! ../core/utils */ 10);
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
- var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- }
- }
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _iterableToArrayLimit(arr, i) {
- var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
- if (null == _i) {
- return
- }
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s, _e;
- try {
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) {
- break
- }
- }
- } catch (err) {
- _d = true;
- _e = err
- } finally {
- try {
- if (!_n && null != _i.return) {
- _i.return()
- }
- } finally {
- if (_d) {
- throw _e
- }
- }
- }
- return _arr
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) {
- return arr
- }
- }
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
- }
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return
- }
- if ("string" === typeof o) {
- return _arrayLikeToArray(o, minLen)
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if ("Object" === n && o.constructor) {
- n = o.constructor.name
- }
- if ("Map" === n || "Set" === n) {
- return Array.from(o)
- }
- if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen)
- }
- }
- function _iterableToArray(iter) {
- if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
- return Array.from(iter)
- }
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- return _arrayLikeToArray(arr)
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (null == len || len > arr.length) {
- len = arr.length
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- var OUTSIDE_POSITION = "outside";
- var INSIDE_POSITION = "inside";
- var OUTSIDE_LABEL_INDENT = 5;
- var COLUMNS_LABEL_INDENT = 20;
- var CONNECTOR_INDENT = 4;
- var PREVENT_EMPTY_PIXEL_OFFSET = 1;
- function getLabelIndent(pos) {
- pos = (0, _utils.normalizeEnum)(pos);
- if (pos === OUTSIDE_POSITION) {
- return OUTSIDE_LABEL_INDENT
- } else {
- if (pos === INSIDE_POSITION) {
- return 0
- }
- }
- return COLUMNS_LABEL_INDENT
- }
- function isOutsidePosition(pos) {
- pos = (0, _utils.normalizeEnum)(pos);
- return pos === OUTSIDE_POSITION || pos !== INSIDE_POSITION
- }
- function correctYForInverted(y, bBox, inverted) {
- return inverted ? y - bBox.height : y
- }
- function getOutsideRightLabelPosition(coords, bBox, options, inverted) {
- return {
- x: coords[2] + options.horizontalOffset + OUTSIDE_LABEL_INDENT,
- y: correctYForInverted(coords[3] + options.verticalOffset, bBox, inverted)
- }
- }
- function getOutsideLeftLabelPosition(coords, bBox, options, inverted) {
- return {
- x: coords[0] - bBox.width - options.horizontalOffset - OUTSIDE_LABEL_INDENT,
- y: correctYForInverted(coords[1] + options.verticalOffset, bBox, inverted)
- }
- }
- function getInsideLabelPosition(coords, bBox, options) {
- var width = coords[2] - coords[0];
- var height = coords[7] - coords[1];
- return {
- x: coords[0] + width / 2 + options.horizontalOffset - bBox.width / 2,
- y: coords[1] + options.verticalOffset + height / 2 - bBox.height / 2
- }
- }
- function getColumnLabelRightPosition(labelRect, rect, textAlignment) {
- return function(coords, bBox, options, inverted) {
- return {
- x: "left" === textAlignment ? rect[2] + options.horizontalOffset + COLUMNS_LABEL_INDENT : labelRect[2] - bBox.width,
- y: correctYForInverted(coords[3] + options.verticalOffset, bBox, inverted)
- }
- }
- }
- function getColumnLabelLeftPosition(labelRect, rect, textAlignment) {
- return function(coords, bBox, options, inverted) {
- return {
- x: "left" === textAlignment ? labelRect[0] : rect[0] - bBox.width - options.horizontalOffset - COLUMNS_LABEL_INDENT,
- y: correctYForInverted(coords[3] + options.verticalOffset, bBox, inverted)
- }
- }
- }
- function getConnectorStrategy(options, inverted) {
- var isLeftPos = "left" === options.horizontalAlignment;
- var connectorIndent = isLeftPos ? CONNECTOR_INDENT : -CONNECTOR_INDENT;
- var verticalCorrection = inverted ? -PREVENT_EMPTY_PIXEL_OFFSET : 0;
- function getFigureCenter(figure) {
- return isLeftPos ? [figure[0] + PREVENT_EMPTY_PIXEL_OFFSET, figure[1] + verticalCorrection] : [figure[2] - PREVENT_EMPTY_PIXEL_OFFSET, figure[3] + verticalCorrection]
- }
- return {
- isLabelInside: function() {
- return !isOutsidePosition(options.position)
- },
- getFigureCenter: getFigureCenter,
- prepareLabelPoints: function(bBox) {
- var x = bBox.x + connectorIndent;
- var y = bBox.y;
- var x1 = x + bBox.width;
- return _toConsumableArray(Array(bBox.height + 1)).map(function(_, i) {
- return [x, y + i]
- }).concat(_toConsumableArray(Array(bBox.height + 1)).map(function(_, i) {
- return [x1, y + i]
- }))
- },
- isHorizontal: function() {
- return true
- },
- findFigurePoint: function(figure) {
- return getFigureCenter(figure)
- },
- adjustPoints: function(points) {
- return points.map(Math.round)
- }
- }
- }
- function getLabelOptions(labelOptions, defaultColor, defaultTextAlignment) {
- var opt = labelOptions || {};
- var labelFont = (0, _extend.extend)({}, opt.font) || {};
- var labelBorder = opt.border || {};
- var labelConnector = opt.connector || {};
- var backgroundAttr = {
- fill: opt.backgroundColor || defaultColor,
- "stroke-width": labelBorder.visible ? labelBorder.width || 0 : 0,
- stroke: labelBorder.visible && labelBorder.width ? labelBorder.color : "none",
- dashStyle: labelBorder.dashStyle
- };
- var connectorAttr = {
- stroke: labelConnector.visible && labelConnector.width ? labelConnector.color || defaultColor : "none",
- "stroke-width": labelConnector.visible ? labelConnector.width || 0 : 0,
- opacity: labelConnector.opacity
- };
- labelFont.color = "none" === opt.backgroundColor && "#ffffff" === (0, _utils.normalizeEnum)(labelFont.color) && "inside" !== opt.position ? defaultColor : labelFont.color;
- return {
- format: opt.format,
- textAlignment: opt.textAlignment || (isOutsidePosition(opt.position) ? defaultTextAlignment : "center"),
- customizeText: opt.customizeText,
- attributes: {
- font: labelFont
- },
- visible: 0 !== labelFont.size ? opt.visible : false,
- showForZeroValues: opt.showForZeroValues,
- horizontalOffset: opt.horizontalOffset,
- verticalOffset: opt.verticalOffset,
- background: backgroundAttr,
- connector: connectorAttr,
- wordWrap: labelOptions.wordWrap,
- textOverflow: labelOptions.textOverflow
- }
- }
- function correctLabelPosition(pos, bBox, rect) {
- if (pos.x < rect[0]) {
- pos.x = rect[0]
- }
- if (pos.x + bBox.width > rect[2]) {
- pos.x = rect[2] - bBox.width
- }
- if (pos.y < rect[1]) {
- pos.y = rect[1]
- }
- if (pos.y + bBox.height > rect[3]) {
- pos.y = rect[3] - bBox.height
- }
- return pos
- }
- function removeEmptySpace(labels, requiredSpace, startPoint) {
- labels.reduce(function(requiredSpace, label, index, labels) {
- var prevLabel = labels[index + 1];
- if (requiredSpace > 0) {
- var bBox = label.getBoundingRect();
- var point = prevLabel ? prevLabel.getBoundingRect().y + prevLabel.getBoundingRect().height : startPoint;
- var emptySpace = bBox.y - point;
- var shift = Math.min(emptySpace, requiredSpace);
- labels.slice(0, index + 1).forEach(function(label) {
- var bBox = label.getBoundingRect();
- label.shift(bBox.x, bBox.y - shift)
- });
- requiredSpace -= shift
- }
- return requiredSpace
- }, requiredSpace)
- }
- exports.plugin = {
- name: "lables",
- init: _common.noop,
- dispose: _common.noop,
- extenders: {
- _initCore: function() {
- this._labelsGroup = this._renderer.g().attr({
- "class": this._rootClassPrefix + "-labels"
- }).append(this._renderer.root);
- this._labels = []
- },
- _applySize: function() {
- var options = this._getOption("label");
- var adaptiveLayout = this._getOption("adaptiveLayout");
- var rect = this._rect;
- var labelWidth = 0;
- var width = rect[2] - rect[0];
- this._labelRect = rect.slice();
- if (!this._labels.length || !isOutsidePosition(options.position)) {
- if ((0, _utils.normalizeEnum)("none" !== this._getOption("resolveLabelOverlapping", true))) {
- this._labels.forEach(function(l) {
- return !l.isVisible() && l.draw(true)
- })
- }
- return
- }
- var groupWidth = this._labels.map(function(label) {
- label.resetEllipsis();
- return label.getBoundingRect().width
- }).reduce(function(max, width) {
- return Math.max(max, width)
- }, 0);
- labelWidth = groupWidth + options.horizontalOffset + getLabelIndent(options.position);
- if (!adaptiveLayout.keepLabels && width - labelWidth < adaptiveLayout.width) {
- this._labels.forEach(function(label) {
- label.draw(false)
- });
- return
- } else {
- if (width - labelWidth < adaptiveLayout.width) {
- labelWidth = width - adaptiveLayout.width;
- labelWidth = labelWidth > 0 ? labelWidth : 0
- }
- this._labels.forEach(function(label) {
- label.draw(true)
- })
- }
- if ("left" === options.horizontalAlignment) {
- rect[0] += labelWidth
- } else {
- rect[2] -= labelWidth
- }
- },
- _buildNodes: function() {
- this._createLabels()
- },
- _change_TILING: function() {
- var that = this;
- var options = that._getOption("label");
- var getCoords = getInsideLabelPosition;
- var inverted = that._getOption("inverted", true);
- var textAlignment;
- if (isOutsidePosition(options.position)) {
- if ((0, _utils.normalizeEnum)(options.position) === OUTSIDE_POSITION) {
- getCoords = "left" === options.horizontalAlignment ? getOutsideLeftLabelPosition : getOutsideRightLabelPosition
- } else {
- textAlignment = this._defaultLabelTextAlignment();
- getCoords = "left" === options.horizontalAlignment ? getColumnLabelLeftPosition(this._labelRect, this._rect, textAlignment) : getColumnLabelRightPosition(this._labelRect, this._rect, textAlignment)
- }
- }
- that._labels.forEach(function(label, index) {
- var item = that._items[index];
- var borderWidth = item.getNormalStyle()["stroke-width"];
- var halfBorderWidth = inverted ? borderWidth / 2 : -borderWidth / 2;
- var coords = halfBorderWidth ? item.coords.map(function(coord, index) {
- if (1 === index || 3 === index) {
- return coord - halfBorderWidth
- } else {
- if (2 === index) {
- return coord - borderWidth
- } else {
- if (0 === index) {
- return coord + borderWidth
- }
- }
- }
- return coord
- }) : item.coords;
- if (!options.showForZeroValues && 0 === item.value) {
- label.draw(false);
- return
- }
- if (isOutsidePosition(options.position)) {
- that._correctLabelWidth(label, item.coords, options)
- }
- var bBox = label.getBoundingRect();
- var pos = correctLabelPosition(getCoords(coords, bBox, options, inverted), bBox, that._labelRect);
- label.setFigureToDrawConnector(coords);
- label.shift(pos.x, pos.y)
- });
- that._resolveLabelOverlapping()
- }
- },
- members: {
- _resolveLabelOverlapping: function() {
- var that = this;
- var resolveLabelOverlapping = (0, _utils.normalizeEnum)(that._getOption("resolveLabelOverlapping", true));
- var labels = this._getOption("inverted", true) ? that._labels.slice().reverse() : that._labels;
- if ("hide" === resolveLabelOverlapping) {
- labels.reduce(function(height, label) {
- if (label.getBoundingRect().y < height) {
- label.hide()
- } else {
- height = label.getBoundingRect().y + label.getBoundingRect().height
- }
- return height
- }, 0)
- } else {
- if ("shift" === resolveLabelOverlapping) {
- var maxHeight = this._labelRect[3];
- labels.reduce(function(_ref, label, index, labels) {
- var _ref2 = _slicedToArray(_ref, 2),
- height = _ref2[0],
- emptySpace = _ref2[1];
- var bBox = label.getBoundingRect();
- var y = bBox.y;
- if (bBox.y < height) {
- label.shift(bBox.x, height);
- y = height
- }
- if (y - height > 0) {
- emptySpace += y - height
- }
- if (y + bBox.height > maxHeight) {
- if (emptySpace && emptySpace > y + bBox.height - maxHeight) {
- removeEmptySpace(labels.slice(0, index).reverse(), y + bBox.height - maxHeight, that._labelRect[1]);
- emptySpace -= y + bBox.height - maxHeight;
- label.shift(bBox.x, y - (y + bBox.height - maxHeight));
- height = y - (y + bBox.height - maxHeight) + bBox.height
- } else {
- label.hide()
- }
- } else {
- height = y + bBox.height
- }
- return [height, emptySpace]
- }, [this._labelRect[1], 0])
- }
- }
- },
- _defaultLabelTextAlignment: function() {
- return this._getOption("rtlEnabled", true) ? "right" : "left"
- },
- _correctLabelWidth: function(label, item, options) {
- var isLeftPos = "left" === options.horizontalAlignment;
- var minX = isLeftPos ? this._labelRect[0] : item[2];
- var maxX = isLeftPos ? item[0] : this._labelRect[2];
- var maxWidth = maxX - minX;
- if (label.getBoundingRect().width > maxWidth) {
- label.fit(maxWidth)
- }
- },
- _createLabels: function() {
- var that = this;
- var labelOptions = that._getOption("label");
- var connectorStrategy = getConnectorStrategy(labelOptions, that._getOption("inverted", true));
- this._labelsGroup.clear();
- if (!labelOptions.visible) {
- return
- }
- this._labels = that._items.map(function(item) {
- var label = new _label2.default.Label({
- renderer: that._renderer,
- labelsGroup: that._labelsGroup,
- strategy: connectorStrategy
- });
- label.setOptions(getLabelOptions(labelOptions, item.color, that._defaultLabelTextAlignment()));
- label.setData({
- item: item,
- value: item.value,
- percent: item.percent
- });
- label.draw(true);
- return label
- });
- if (this._labels.length && isOutsidePosition(labelOptions.position)) {
- this._requestChange(["LAYOUT"])
- }
- }
- },
- customize: function(constructor) {
- constructor.prototype._proxyData.push(function(x, y) {
- var that = this;
- var data;
- that._labels.forEach(function(label, index) {
- var rect = label.getBoundingRect();
- if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
- var pos = isOutsidePosition(that._getOption("label").position) ? "outside" : "inside";
- data = {
- id: index,
- type: pos + "-label"
- };
- return true
- }
- });
- return data
- });
- ["label", "resolveLabelOverlapping"].forEach(function(optionName) {
- constructor.addChange({
- code: optionName.toUpperCase(),
- handler: function() {
- this._createLabels();
- this._requestChange(["LAYOUT"])
- },
- isThemeDependent: true,
- isOptionChange: true,
- option: optionName
- })
- })
- },
- fontFields: ["label.font"]
- }
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/tracker.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./funnel */ 425).prototype;
- var Tracker = __webpack_require__( /*! ../components/tracker */ 252).Tracker;
- var DATA_KEY_BASE = "__funnel_data_";
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- var dataKeyModifier = 0;
- proto._eventsMap.onItemClick = {
- name: "itemClick"
- };
- proto._eventsMap.onLegendClick = {
- name: "legendClick"
- };
- exports.plugin = {
- name: "tracker",
- init: function() {
- var that = this;
- var dataKey = DATA_KEY_BASE + dataKeyModifier++;
- var getProxyData = function(e) {
- var rootOffset = that._renderer.getRootOffset();
- var x = Math.floor(e.pageX - rootOffset.left);
- var y = Math.floor(e.pageY - rootOffset.top);
- return that._hitTestTargets(x, y)
- };
- that._tracker = new Tracker({
- widget: that,
- root: that._renderer.root,
- getData: function(e, tooltipData) {
- var target = e.target;
- var data = target[dataKey];
- if (isDefined(data)) {
- return data
- }
- var proxyData = getProxyData(e);
- if (tooltipData && proxyData && "inside-label" !== proxyData.type) {
- return
- }
- return proxyData && proxyData.id
- },
- getNode: function(index) {
- return that._items[index]
- },
- click: function(e) {
- var proxyData = getProxyData(e.event);
- var dataType = proxyData && proxyData.type;
- var event = "legend" === dataType ? "legendClick" : "itemClick";
- that._eventTrigger(event, {
- item: e.node,
- event: e.event
- })
- }
- });
- exports._TESTS_dataKey = dataKey;
- this._dataKey = dataKey
- },
- dispose: function() {
- this._tracker.dispose()
- },
- extenders: {
- _change_TILING: function() {
- var dataKey = this._dataKey;
- this._items.forEach(function(item, index) {
- item.element.data(dataKey, index)
- })
- }
- }
- }
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/funnel/tooltip.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
- function getCoords(figureCoords, renderer) {
- var offset = renderer.getRootOffset();
- return [(figureCoords[0] + figureCoords[2]) / 2 + offset.left, (figureCoords[1] + figureCoords[5]) / 2 + offset.top]
- }
- exports.plugin = {
- name: "funnel-tooltip",
- init: noop,
- dispose: noop,
- extenders: {
- _buildNodes: function() {
- this.hideTooltip()
- },
- _change_TILING: function() {
- if (this._tooltipIndex >= 0) {
- this._moveTooltip(this._items[this._tooltipIndex])
- }
- }
- },
- members: {
- hideTooltip: function() {
- if (this._tooltipIndex >= 0) {
- this._tooltipIndex = -1;
- this._tooltip.hide()
- }
- },
- _moveTooltip: function(item, coords) {
- var xy = coords || item.coords && getCoords(item.coords, this._renderer) || [-1e3, -1e3];
- this._tooltip.move(xy[0], xy[1], 0)
- },
- _showTooltip: function(index, coords) {
- var that = this;
- var tooltip = that._tooltip;
- var item = that._items[index];
- var state = that._tooltipIndex === index || tooltip.show({
- value: item.value,
- valueText: tooltip.formatValue(item.value),
- percentText: tooltip.formatValue(item.percent, "percent"),
- percent: item.percent,
- item: item
- }, {
- x: 0,
- y: 0,
- offset: 0
- }, {
- item: item
- });
- if (state) {
- that._moveTooltip(item, coords)
- } else {
- tooltip.hide()
- }
- that._tooltipIndex = state ? index : -1
- }
- },
- customize: function(constructor) {
- constructor.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin)
- }
- }
- },
- /*!********************************************!*\
- !*** ./artifacts/transpiled/viz/sankey.js ***!
- \********************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var dxSankey = __webpack_require__( /*! ./sankey/sankey */ 426);
- var setTooltipCustomOptions = __webpack_require__( /*! ./sankey/tooltip */ 849).setTooltipCustomOptions;
- dxSankey.addPlugin(__webpack_require__( /*! ./core/export */ 93).plugin);
- dxSankey.addPlugin(__webpack_require__( /*! ./core/title */ 105).plugin);
- dxSankey.addPlugin(__webpack_require__( /*! ./sankey/tracker */ 850).plugin);
- dxSankey.addPlugin(__webpack_require__( /*! ./core/loading_indicator */ 119).plugin);
- dxSankey.addPlugin(__webpack_require__( /*! ./core/tooltip */ 107).plugin);
- setTooltipCustomOptions(dxSankey);
- module.exports = dxSankey
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/node_item.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var states = ["normal", "hover"];
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- function _compileAttrs(color, itemOptions, itemBaseOptions) {
- var border = itemOptions.border;
- var baseBorder = itemBaseOptions.border;
- var borderVisible = isDefined(border.visible) ? border.visible : baseBorder.visible;
- var borderWidth = isDefined(border.width) ? border.width : baseBorder.width;
- var borderOpacity = isDefined(border.opacity) ? border.opacity : isDefined(baseBorder.opacity) ? baseBorder.opacity : 1;
- var opacity = isDefined(itemOptions.opacity) ? itemOptions.opacity : isDefined(itemBaseOptions.opacity) ? itemBaseOptions.opacity : 1;
- return {
- fill: itemOptions.color || color,
- "stroke-width": borderVisible ? borderWidth : 0,
- stroke: itemOptions.border.color || itemBaseOptions.border.color,
- "stroke-opacity": borderOpacity,
- opacity: opacity,
- hatching: itemOptions.hatching
- }
- }
- function compileLabelAttrs(labelOptions, filter, node) {
- var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
- if (labelOptions.useNodeColors) {
- labelOptions.font.color = node.color
- }
- var borderVisible = isDefined(labelOptions.border.visible) ? labelOptions.border.visible : false;
- var borderWidth = isDefined(labelOptions.border.width) ? labelOptions.border.width : 0;
- var borderColor = isDefined(labelOptions.border.color) ? labelOptions.border.color : labelOptions.font.color;
- var borderOpacity = isDefined(labelOptions.border.opacity) ? labelOptions.border.opacity : 1;
- var attr = {
- filter: filter
- };
- if (borderVisible && borderWidth) {
- attr.stroke = borderColor;
- attr["stroke-width"] = borderVisible ? borderWidth : 0;
- attr["stroke-opacity"] = borderOpacity
- }
- return {
- attr: attr,
- css: _patchFontOptions(labelOptions.font)
- }
- }
- function Node(widget, params) {
- var that = this;
- var widgetOffset = widget._renderer.getRootOffset();
- that.code = 0;
- that.widget = widget;
- that.color = params.color;
- that.options = params.options;
- that.rect = params.rect;
- that.title = params.rect._name;
- that.coords = {
- x: params.rect.x + params.rect.width / 2 + widgetOffset.left,
- y: params.rect.y + params.rect.height / 2 + widgetOffset.top
- };
- that.id = params.id;
- that.linksIn = params.linksIn;
- that.linksOut = params.linksOut;
- this.states = {
- normal: _compileAttrs(this.color, that.options, that.options),
- hover: _compileAttrs(this.color, that.options.hoverStyle, that.options)
- }
- }
- Node.prototype = {
- compileAttrs: function() {
- return _compileAttrs(this.color, this.options)
- },
- getState: function() {
- return states[this.code]
- },
- isHovered: function() {
- return !!(1 & this.code)
- },
- setState: function(code, state) {
- var _this = this;
- if (state) {
- this.code |= code
- } else {
- this.code &= ~code
- }
- if (state) {
- this.linksIn.concat(this.linksOut).forEach(function(adjacentLink) {
- _this.widget._links[adjacentLink.index].setAdjacentNodeHover(true)
- })
- } else {
- this.widget._links.forEach(function(link) {
- link.isAdjacentNodeHovered() && link.adjacentNodeHover(false)
- });
- this.hideTooltip()
- }
- this.widget._applyNodesAppearance();
- this.widget._applyLinksAppearance()
- },
- hover: function(state) {
- if (!this.widget._getOption("hoverEnabled", true) || state === this.isHovered()) {
- return
- }
- this.widget._suspend();
- state && this.widget.clearHover();
- this.setState(1, state);
- this.widget._eventTrigger("nodeHoverChanged", {
- target: this
- });
- this.widget._resume()
- },
- setHover: function() {
- this.hover(true)
- },
- showTooltip: function(coords) {
- this.widget._getOption("hoverEnabled", true) && this.widget._tooltip && this.widget._tooltip.show({
- type: "node",
- info: {
- title: this.title,
- weightIn: this.linksIn.reduce(function(previousValue, currentValue) {
- return previousValue + currentValue.weight
- }, 0),
- weightOut: this.linksOut.reduce(function(previousValue, currentValue) {
- return previousValue + currentValue.weight
- }, 0)
- }
- }, "undefined" !== typeof coords ? {
- x: coords[0],
- y: coords[1]
- } : this.coords)
- },
- hideTooltip: function() {
- this.widget._tooltip && this.widget._tooltip.hide()
- },
- getLabelAttributes: function(labelSettings, filter) {
- return compileLabelAttrs(labelSettings, filter, this)
- }
- };
- module.exports = Node
- },
- /*!******************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/link_item.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _constants = __webpack_require__( /*! ./constants */ 427);
- var states = ["normal", "adjacentNodeHover", "hover"];
- var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
- function compileAttrs(color, itemOptions, itemBaseOptions, gradient) {
- var border = itemOptions.border;
- var baseBorder = itemBaseOptions.border;
- var borderVisible = isDefined(border.visible) ? border.visible : baseBorder.visible;
- var borderWidth = isDefined(border.width) ? border.width : baseBorder.width;
- var borderOpacity = isDefined(border.opacity) ? border.opacity : isDefined(baseBorder.opacity) ? baseBorder.opacity : 1;
- var opacity = isDefined(itemOptions.opacity) ? itemOptions.opacity : isDefined(itemBaseOptions.opacity) ? itemBaseOptions.opacity : 1;
- var fill = itemOptions.color || color;
- if (itemBaseOptions.colorMode === _constants.COLOR_MODE_TARGET || itemBaseOptions.colorMode === _constants.COLOR_MODE_SOURCE) {
- fill = color
- } else {
- if (itemBaseOptions.colorMode === _constants.COLOR_MODE_GRADIENT && gradient && isDefined(gradient.id)) {
- fill = gradient.id
- }
- }
- return {
- fill: fill,
- "stroke-width": borderVisible ? borderWidth : 0,
- stroke: itemOptions.border.color || itemBaseOptions.border.color,
- "stroke-opacity": borderOpacity,
- opacity: opacity,
- hatching: itemOptions.hatching
- }
- }
- function Link(widget, params) {
- var that = this;
- var widgetOffset = widget._renderer.getRootOffset();
- that.code = 0;
- that.widget = widget;
- that.color = params.color;
- that.connection = params.connection;
- that.d = params.d;
- that.options = params.options;
- that.boundingRect = params.boundingRect, that.coords = {
- x: params.boundingRect.x + params.boundingRect.width / 2 + widgetOffset.left,
- y: params.boundingRect.y + params.boundingRect.height / 2 + widgetOffset.top
- };
- that.states = {
- normal: compileAttrs(that.color, that.options, that.options, params.gradient),
- adjacentNodeHover: compileAttrs(that.color, {
- opacity: 0,
- border: {}
- }, that.options, params.gradient),
- hover: compileAttrs(that.color, {
- opacity: 0,
- border: {}
- }, that.options, params.gradient)
- };
- that.overlayStates = {
- normal: compileAttrs(that.color, {
- opacity: 0,
- border: {}
- }, that.options),
- adjacentNodeHover: compileAttrs(that.color, that.options.hoverStyle, that.options),
- hover: compileAttrs(that.color, that.options.hoverStyle, that.options)
- }
- }
- Link.prototype = {
- getState: function() {
- return states[this.code]
- },
- isHovered: function() {
- return 2 === this.code
- },
- isAdjacentNodeHovered: function() {
- return 1 === this.code
- },
- setState: function(code, state) {
- if (state) {
- this.code = code
- } else {
- this.code = 0;
- this.hideTooltip()
- }
- this.widget._applyLinksAppearance()
- },
- setHover: function() {
- this.hover(true)
- },
- hover: function(state) {
- if (!this.widget._getOption("hoverEnabled", true) || state === this.isHovered()) {
- return
- }
- this.widget._suspend();
- state && this.widget.clearHover();
- this.setState(2, state);
- this.widget._eventTrigger("linkHoverChanged", {
- target: this
- });
- this.widget._resume()
- },
- adjacentNodeHover: function(state) {
- if (!this.widget._getOption("hoverEnabled", true) || state === this.isAdjacentNodeHovered()) {
- return
- }
- this.widget._suspend();
- this.setState(1, state);
- this.widget._resume()
- },
- setAdjacentNodeHover: function() {
- this.adjacentNodeHover(true)
- },
- showTooltip: function(coords) {
- this.widget._getOption("hoverEnabled", true) && this.widget._tooltip && this.widget._tooltip.show({
- type: "link",
- info: {
- source: this.connection.source,
- target: this.connection.target,
- weight: this.connection.weight
- }
- }, "undefined" !== typeof coords ? {
- x: coords[0],
- y: coords[1]
- } : this.coords)
- },
- hideTooltip: function() {
- this.widget._tooltip && this.widget._tooltip.hide()
- }
- };
- module.exports = Link
- },
- /*!***************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/layout.js ***!
- \***************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var _SPLINE_TENSION = .3;
- var _ALIGNMENT_CENTER = "center";
- var _ALIGNMENT_BOTTOM = "bottom";
- var _ALIGNMENT_DEFAULT = _ALIGNMENT_CENTER;
- var graphModule = __webpack_require__( /*! ./graph */ 428);
- var validatorModule = __webpack_require__( /*! ./data_validator */ 848);
- var layout = {
- _weightPerPixel: null,
- _getCascadeIdx: function(nodeTitle, cascadesConfig) {
- var nodeInfo = cascadesConfig.filter(function(c) {
- return c.name === nodeTitle
- })[0];
- if (nodeInfo.outgoing.length > 0) {
- return nodeInfo.lp
- } else {
- return graphModule.routines.maxOfArray(cascadesConfig.map(function(c) {
- return c.lp
- }))
- }
- },
- _getInWeightForNode: function(nodeTitle, links) {
- var w = 0;
- links.forEach(function(link) {
- if (link[1] === nodeTitle) {
- w += link[2]
- }
- });
- return w
- },
- _getOutWeightForNode: function(nodeTitle, links) {
- var w = 0;
- links.forEach(function(link) {
- if (link[0] === nodeTitle) {
- w += link[2]
- }
- });
- return w
- },
- _computeCascades: function(links) {
- var _this = this;
- var cascadesConfig = graphModule.struct.computeLongestPaths(links);
- var maxCascade = graphModule.routines.maxOfArray(cascadesConfig.map(function(c) {
- return c.lp
- }));
- var cascades = [];
- for (var i = 0; i < maxCascade + 1; i++) {
- cascades.push({})
- }
- links.forEach(function(link) {
- var cascade = cascades[_this._getCascadeIdx(link[0], cascadesConfig)];
- if (!cascade[link[0]]) {
- cascade[link[0]] = {
- nodeTitle: link[0]
- }
- }
- cascade = cascades[_this._getCascadeIdx(link[1], cascadesConfig)];
- if (!cascade[link[1]]) {
- cascade[link[1]] = {
- nodeTitle: link[1]
- }
- }
- });
- cascades.forEach(function(cascade) {
- Object.keys(cascade).forEach(function(nodeTitle) {
- var node = cascade[nodeTitle];
- node.inWeight = _this._getInWeightForNode(node.nodeTitle, links);
- node.outWeight = _this._getOutWeightForNode(node.nodeTitle, links);
- node.maxWeight = Math.max(node.inWeight, node.outWeight)
- })
- });
- return cascades
- },
- _getWeightForCascade: function(cascades, cascadeIdx) {
- var wMax = 0;
- var cascade = cascades[cascadeIdx];
- Object.keys(cascade).forEach(function(nodeTitle) {
- wMax += Math.max(cascade[nodeTitle].inWeight, cascade[nodeTitle].outWeight)
- });
- return wMax
- },
- _getMaxWeightThroughCascades: function(cascades) {
- var max = [];
- cascades.forEach(function(cascade) {
- var mW = 0;
- Object.keys(cascade).forEach(function(nodeTitle) {
- var node = cascade[nodeTitle];
- mW += Math.max(node.inWeight, node.outWeight)
- });
- max.push(mW)
- });
- return graphModule.routines.maxOfArray(max)
- },
- _computeNodes: function(cascades, options) {
- var _this2 = this;
- var rects = [];
- var maxWeight = this._getMaxWeightThroughCascades(cascades);
- var maxNodeNum = graphModule.routines.maxOfArray(cascades.map(function(nodesInCascade) {
- return Object.keys(nodesInCascade).length
- }));
- var nodePadding = options.nodePadding;
- var heightAvailable = options.height - nodePadding * (maxNodeNum - 1);
- if (heightAvailable < 0) {
- nodePadding = 0;
- heightAvailable = options.height - nodePadding * (maxNodeNum - 1)
- }
- this._weightPerPixel = maxWeight / heightAvailable;
- var cascadeIdx = 0;
- cascades.forEach(function(cascade) {
- var cascadeRects = [];
- var y = 0;
- var nodesInCascade = Object.keys(cascade).length;
- var cascadeHeight = _this2._getWeightForCascade(cascades, cascadeIdx) / _this2._weightPerPixel + nodePadding * (nodesInCascade - 1);
- var cascadeAlign = _ALIGNMENT_DEFAULT;
- if (Array.isArray(options.nodeAlign)) {
- cascadeAlign = cascadeIdx < options.nodeAlign.length ? options.nodeAlign[cascadeIdx] : _ALIGNMENT_DEFAULT
- } else {
- cascadeAlign = options.nodeAlign
- }
- if (cascadeAlign === _ALIGNMENT_BOTTOM) {
- y = options.height - cascadeHeight
- } else {
- if (cascadeAlign === _ALIGNMENT_CENTER) {
- y = .5 * (options.height - cascadeHeight)
- }
- }
- y = Math.round(y);
- Object.keys(cascade).forEach(function(nodeTitle) {
- cascade[nodeTitle].sort = _this2._sort && Object.prototype.hasOwnProperty.call(_this2._sort, nodeTitle) ? _this2._sort[nodeTitle] : 1
- });
- Object.keys(cascade).sort(function(a, b) {
- return cascade[a].sort - cascade[b].sort
- }).forEach(function(nodeTitle) {
- var node = cascade[nodeTitle];
- var height = Math.floor(heightAvailable * node.maxWeight / maxWeight);
- var x = Math.round(cascadeIdx * options.width / (cascades.length - 1)) - (0 === cascadeIdx ? 0 : options.nodeWidth);
- var rect = {};
- rect._name = nodeTitle;
- rect.width = options.nodeWidth;
- rect.height = height;
- rect.x = x + options.x;
- rect.y = y + options.y;
- y += height + nodePadding;
- cascadeRects.push(rect)
- });
- cascadeIdx++;
- rects.push(cascadeRects)
- });
- return rects
- },
- _findRectByName: function(rects, name) {
- for (var c = 0; c < rects.length; c++) {
- for (var r = 0; r < rects[c].length; r++) {
- if (name === rects[c][r]._name) {
- return rects[c][r]
- }
- }
- }
- return null
- },
- _findIndexByName: function(rects, nodeTitle) {
- var index = 0;
- for (var c = 0; c < rects.length; c++) {
- for (var r = 0; r < rects[c].length; r++) {
- if (nodeTitle === rects[c][r]._name) {
- return index
- }
- index++
- }
- }
- return null
- },
- _computeLinks: function(links, rects, cascades) {
- var _this3 = this;
- var yOffsets = {};
- var paths = [];
- var result = [];
- cascades.forEach(function(cascade) {
- Object.keys(cascade).forEach(function(nodeTitle) {
- yOffsets[nodeTitle] = {
- "in": 0,
- out: 0
- }
- })
- });
- rects.forEach(function(rectsOfCascade) {
- rectsOfCascade.forEach(function(nodeRect) {
- var nodeTitle = nodeRect._name;
- var rectFrom = _this3._findRectByName(rects, nodeTitle);
- var linksFromNode = links.filter(function(link) {
- return link[0] === nodeTitle
- });
- linksFromNode.forEach(function(link) {
- link.sort = _this3._findIndexByName(rects, link[1])
- });
- linksFromNode.sort(function(a, b) {
- return a.sort - b.sort
- }).forEach(function(link) {
- var rectTo = _this3._findRectByName(rects, link[1]);
- var height = Math.round(link[2] / _this3._weightPerPixel);
- var yOffsetFrom = yOffsets[link[0]].out;
- var yOffsetTo = yOffsets[link[1]].in;
- var heightFrom = yOffsets[link[0]].out + height > rectFrom.height ? rectFrom.height - yOffsets[link[0]].out : height;
- var heightTo = yOffsets[link[1]].in + height > rectTo.height ? rectTo.height - yOffsets[link[1]].in : height;
- paths.push({
- from: {
- x: rectFrom.x,
- y: rectFrom.y + yOffsetFrom,
- width: rectFrom.width,
- height: heightFrom,
- node: rectFrom,
- weight: link[2]
- },
- to: {
- x: rectTo.x,
- y: rectTo.y + yOffsetTo,
- width: rectTo.width,
- height: heightTo,
- node: rectTo
- }
- });
- yOffsets[link[0]].out += height;
- yOffsets[link[1]].in += height
- })
- })
- });
- paths.forEach(function(link) {
- var path = {
- d: _this3._spline(link.from, link.to),
- _boundingRect: {
- x: link.from.x + link.from.width,
- y: Math.min(link.from.y, link.to.y),
- width: link.to.x - (link.from.x + link.from.width),
- height: Math.max(link.from.x + link.from.height, link.to.y + link.to.height) - Math.min(link.from.y, link.to.y)
- },
- _weight: link.from.weight,
- _from: link.from.node,
- _to: link.to.node
- };
- result.push(path)
- });
- this._fitAllNodesHeight(rects, paths);
- return result
- },
- _fitNodeHeight: function(nodeName, nodeRects, paths) {
- var targetRect = this._findRectByName(nodeRects, nodeName);
- var heightOfLinksSummaryIn = 0;
- var heightOfLinksSummaryOut = 0;
- paths.forEach(function(path) {
- if (path.from.node._name === nodeName) {
- heightOfLinksSummaryOut += path.from.height
- }
- if (path.to.node._name === nodeName) {
- heightOfLinksSummaryIn += path.to.height
- }
- });
- targetRect.height = Math.max(heightOfLinksSummaryIn, heightOfLinksSummaryOut)
- },
- _fitAllNodesHeight: function(nodeRects, paths) {
- for (var c = 0; c < nodeRects.length; c++) {
- for (var r = 0; r < nodeRects[c].length; r++) {
- this._fitNodeHeight(nodeRects[c][r]._name, nodeRects, paths)
- }
- }
- },
- _spline: function(rectLeft, rectRight) {
- var p_UpLeft = {
- x: rectLeft.x + rectLeft.width,
- y: rectLeft.y
- };
- var p_DownLeft = {
- x: rectLeft.x + rectLeft.width,
- y: rectLeft.y + rectLeft.height
- };
- var p_UpRight = {
- x: rectRight.x,
- y: rectRight.y
- };
- var p_DownRight = {
- x: rectRight.x,
- y: rectRight.y + rectRight.height
- };
- var curve_width = _SPLINE_TENSION * (p_UpRight.x - p_UpLeft.x);
- var result = "M ".concat(p_UpLeft.x, " ").concat(p_UpLeft.y, " C ").concat(p_UpLeft.x + curve_width, " ").concat(p_UpLeft.y, " ").concat(p_UpRight.x - curve_width, " ").concat(p_UpRight.y, " ").concat(p_UpRight.x, " ").concat(p_UpRight.y, " L ").concat(p_DownRight.x, " ").concat(p_DownRight.y, " C ").concat(p_DownRight.x - curve_width, " ").concat(p_DownRight.y, " ").concat(p_DownLeft.x + curve_width, " ").concat(p_DownLeft.y, " ").concat(p_DownLeft.x, " ").concat(p_DownLeft.y, " Z");
- return result
- },
- computeLayout: function(linksData, sortData, options, incidentOccurred) {
- this._sort = sortData;
- var result = {};
- var validateResult = validatorModule.validate(linksData, incidentOccurred);
- if (!validateResult) {
- result.cascades = this._computeCascades(linksData);
- result.nodes = this._computeNodes(result.cascades, {
- width: options.availableRect.width,
- height: options.availableRect.height,
- x: options.availableRect.x,
- y: options.availableRect.y,
- nodePadding: options.nodePadding,
- nodeWidth: options.nodeWidth,
- nodeAlign: options.nodeAlign
- });
- result.links = this._computeLinks(linksData, result.nodes, result.cascades)
- } else {
- result.error = validateResult
- }
- return result
- },
- overlap: function(box1, box2) {
- return !(box2.x > box1.x + box1.width || box2.x + box2.width < box1.x || box2.y >= box1.y + box1.height || box2.y + box2.height <= box1.y)
- }
- };
- module.exports = layout
- },
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/data_validator.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var graphModule = __webpack_require__( /*! ./graph */ 428);
- var validator = {
- validate: function(data, incidentOccurred) {
- var result = null;
- if (this._hasCycle(data)) {
- result = "E2006";
- incidentOccurred("E2006")
- }
- return result
- },
- _hasCycle: function(data) {
- return graphModule.struct.hasCycle(data)
- }
- };
- module.exports = validator
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/tooltip.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.setTooltipCustomOptions = setTooltipCustomOptions;
- var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
- var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
- var defaultCustomizeLinkTooltip = function(info) {
- return {
- html: "<strong>".concat(info.source, " > ").concat(info.target, "</strong><br/>Weight: ").concat(info.weight)
- }
- };
- var defaultCustomizeNodeTooltip = function(info) {
- return {
- html: "<strong>".concat(info.title, "</strong><br/>Incoming weight: ").concat(info.weightIn, "<br/>Outgoing weight: ").concat(info.weightOut)
- }
- };
- var generateCustomCallback = function(customCallback, defaultCallback) {
- return function(objectInfo) {
- var res = isFunction(customCallback) ? customCallback.call(objectInfo, objectInfo) : {};
- var hasOwnProperty = Object.prototype.hasOwnProperty.bind(res);
- if (!hasOwnProperty("html") && !hasOwnProperty("text")) {
- res = _extend(res, defaultCallback.call(objectInfo, objectInfo))
- }
- return res
- }
- };
- function setTooltipCustomOptions(sankey) {
- sankey.prototype._setTooltipOptions = function() {
- var tooltip = this._tooltip;
- var options = tooltip && this._getOption("tooltip");
- tooltip && tooltip.update(_extend({}, options, {
- customizeTooltip: function(args) {
- if ("node" === args.type) {
- return generateCustomCallback(options.customizeNodeTooltip, defaultCustomizeNodeTooltip)(args.info)
- } else {
- if ("link" === args.type) {
- return generateCustomCallback(options.customizeLinkTooltip, defaultCustomizeLinkTooltip)(args.info)
- }
- }
- return {}
- },
- enabled: options.enabled
- }))
- };
- sankey.prototype.hideTooltip = function() {
- this._tooltip && this._tooltip.hide()
- }
- }
- },
- /*!****************************************************!*\
- !*** ./artifacts/transpiled/viz/sankey/tracker.js ***!
- \****************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var proto = __webpack_require__( /*! ./sankey */ 426).prototype;
- var Tracker = __webpack_require__( /*! ../components/tracker */ 252).Tracker;
- var DATA_KEY_BASE = "__sankey_data_";
- var dataKeyModifier = 0;
- proto._eventsMap.onNodeClick = {
- name: "nodeClick"
- };
- proto._eventsMap.onLinkClick = {
- name: "linkClick"
- };
- exports.plugin = {
- name: "tracker",
- init: function() {
- var that = this;
- var dataKey = DATA_KEY_BASE + dataKeyModifier++;
- that._tracker = new Tracker({
- widget: that,
- root: that._renderer.root,
- getData: function(e) {
- var target = e.target;
- return target[dataKey]
- },
- getNode: function(index) {
- if (index < that._nodes.length) {
- return that._nodes[index]
- } else {
- return that._links[index - that._nodes.length]
- }
- },
- click: function(e) {
- var eventName = this.getData(e.event) < that._nodes.length ? "nodeClick" : "linkClick";
- that._eventTrigger(eventName, {
- target: e.node,
- event: e.event
- })
- }
- });
- exports._TESTS_dataKey = dataKey;
- this._dataKey = dataKey
- },
- dispose: function() {
- this._tracker.dispose()
- },
- extenders: {
- _change_LINKS_DRAW: function() {
- var dataKey = this._dataKey;
- this._nodes.concat(this._links).forEach(function(item, index) {
- item.element.data(dataKey, index)
- })
- }
- }
- }
- }, , , , , ,
- /*!***********************************************************!*\
- !*** ./artifacts/transpiled/bundles/modules/parts/viz.js ***!
- \***********************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- var DevExpress = __webpack_require__( /*! ./core */ 212);
- __webpack_require__( /*! ./data */ 288);
- var viz = DevExpress.viz = __webpack_require__( /*! ../../../bundles/modules/viz */ 752);
- viz.currentTheme = __webpack_require__( /*! ../../../viz/themes */ 50).currentTheme;
- viz.registerTheme = __webpack_require__( /*! ../../../viz/themes */ 50).registerTheme;
- viz.exportFromMarkup = __webpack_require__( /*! ../../../viz/export */ 239).exportFromMarkup;
- viz.getMarkup = __webpack_require__( /*! ../../../viz/export */ 239).getMarkup;
- viz.exportWidgets = __webpack_require__( /*! ../../../viz/export */ 239).exportWidgets;
- viz.currentPalette = __webpack_require__( /*! ../../../viz/palette */ 164).currentPalette;
- viz.getPalette = __webpack_require__( /*! ../../../viz/palette */ 164).getPalette;
- viz.generateColors = __webpack_require__( /*! ../../../viz/palette */ 164).generateColors;
- viz.registerPalette = __webpack_require__( /*! ../../../viz/palette */ 164).registerPalette;
- viz.refreshTheme = __webpack_require__( /*! ../../../viz/themes */ 50).refreshTheme;
- viz.dxChart = __webpack_require__( /*! ../../../viz/chart */ 753);
- viz.dxPieChart = __webpack_require__( /*! ../../../viz/pie_chart */ 790);
- viz.dxPolarChart = __webpack_require__( /*! ../../../viz/polar_chart */ 791);
- viz.dxLinearGauge = __webpack_require__( /*! ../../../viz/linear_gauge */ 792);
- viz.dxCircularGauge = __webpack_require__( /*! ../../../viz/circular_gauge */ 798);
- viz.dxBarGauge = __webpack_require__( /*! ../../../viz/bar_gauge */ 801);
- viz.dxRangeSelector = __webpack_require__( /*! ../../../viz/range_selector */ 803);
- viz.dxVectorMap = __webpack_require__( /*! ../../../viz/vector_map */ 811);
- viz.map = {};
- viz.map.sources = {};
- viz.map.projection = __webpack_require__( /*! ../../../viz/vector_map/projection */ 417).projection;
- viz.dxSparkline = __webpack_require__( /*! ../../../viz/sparkline */ 821);
- viz.dxBullet = __webpack_require__( /*! ../../../viz/bullet */ 823);
- viz.dxTreeMap = __webpack_require__( /*! ../../../viz/tree_map */ 825);
- viz.dxFunnel = __webpack_require__( /*! ../../../viz/funnel */ 836);
- viz.dxSankey = __webpack_require__( /*! ../../../viz/sankey */ 844);
- viz.BaseWidget = __webpack_require__( /*! ../../../viz/core/base_widget */ 96);
- viz.getTheme = __webpack_require__( /*! ../../../viz/themes */ 50).getTheme;
- viz.findTheme = __webpack_require__( /*! ../../../viz/themes */ 50).getTheme;
- viz.refreshAll = __webpack_require__( /*! ../../../viz/themes */ 50).refreshTheme;
- viz.refreshPaths = __webpack_require__( /*! ../../../viz/utils */ 857).refreshPaths;
- viz.gauges = {
- __internals: {}
- };
- viz._dashboard = {};
- viz._dashboard.Renderer = __webpack_require__( /*! ../../../viz/core/renderers/renderer */ 175).Renderer;
- viz._dashboard.SvgElement = __webpack_require__( /*! ../../../viz/core/renderers/renderer */ 175).SvgElement;
- viz._dashboard.patchFontOptions = __webpack_require__( /*! ../../../viz/core/utils */ 10).patchFontOptions;
- module.exports = viz
- },
- /*!*******************************************!*\
- !*** ./artifacts/transpiled/viz/utils.js ***!
- \*******************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- exports.refreshPaths = __webpack_require__( /*! ./core/renderers/renderer */ 175).refreshPaths
- }, , , , , , , ,
- /*!******************************************************!*\
- !*** multi ./artifacts/transpiled/bundles/dx.viz.js ***!
- \******************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__( /*! c:\Projects\DevExtreme\19.1\BuildLabel\Temp\DevExtreme.v19.1\repo\GitHub\artifacts\transpiled\bundles\dx.viz.js */ 866)
- },
- /*!************************************************!*\
- !*** ./artifacts/transpiled/bundles/dx.viz.js ***!
- \************************************************/
- /*! dynamic exports provided */
- /*! all exports used */
- function(module, exports, __webpack_require__) {
- __webpack_require__( /*! ./modules/parts/viz */ 856)
- }
- ]);
|