12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665 |
- ;(function(root, factory) {
- if (typeof define === 'function' && define.amd) {
- define(['rave', 'rave-library', 'rave-utilities', 'rave-legends', 'mapboxgl'], factory);
- } else if (typeof exports === 'object') {
- module.exports = factory(require('rave'), require('rave-library'), require('rave-utilities'), require('rave-legends'), require('mapboxgl'));
- } else {
- root.raveLibraryTiledmapV2 = factory(root.rave, root.raveLibrary, root.raveUtilities, root.raveLegends, root.mapboxgl);
- }
- }(this, function(rave, raveLibrary, raveUtilities, raveLegends, mapboxgl) {
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
- module.exports=[{"previews":{"image":[{"file":"resources\/preview_map_small.png","tags":["small","notext"]}],"svg":[{"file":"resources\/preview_map_small.svg","tags":["small","notext"]}]},"genericMeta":{"copyright":"IBM 2017","author":"IBM","description":"tiledmap.description","id":"rave-library-tiledmapV2","label":"tiledmap.label","version":"1.0.0","tags":["map"]}},{"datamodels":[{"description":"datamodel.multitable.map.description","id":"multiTable","label":"datamodel.multitable.map.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.region.dataslot.featureLvl1.description","id":"featureLvl1","label":"data.region.dataslot.featureLvl1.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["subtype:location","useMapbox","refinement:featureLvl3,featureLvl2"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.region.dataslot.featureLvl2.description","id":"featureLvl2","label":"data.region.dataslot.featureLvl2.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["useMapbox"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.region.dataslot.featureLvl3.description","id":"featureLvl3","label":"data.region.dataslot.featureLvl3.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["useMapbox"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/region_color_by_32.svg"},"description":"data.region.dataslot.fill.description","id":"fill","label":"data.region.dataslot.fill.label","cardinality":"0..1","datatypes":["numeric"]}],"description":"dataset.tabular.map.regions.description","id":"data.region","label":"dataset.regions.label","type":"tabular","cardinality":"0..1"},{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.point.dataslot.featureLvl1.description","id":"featureLvl1","label":"data.point.dataslot.featureLvl1.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["subtype:location","useMapbox","refinement:featureLvl3,featureLvl2"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.point.dataslot.featureLvl2.description","id":"featureLvl2","label":"data.point.dataslot.featureLvl2.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["useMapbox"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.point.dataslot.featureLvl3.description","id":"featureLvl3","label":"data.point.dataslot.featureLvl3.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["useMapbox"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/size_32.svg"},"description":"data.point.dataslot.pointSize.description","id":"pointSize","label":"data.point.dataslot.pointSize.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/point_color_by_32.svg"},"description":"data.point.dataslot.pointColor.description","id":"pointColor","label":"data.point.dataslot.pointColor.label","cardinality":"0..1","datatypes":["numeric"]}],"description":"dataset.tabular.map.points.description","id":"data.point","label":"dataset.points.label","type":"tabular","cardinality":"0..1"},{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.latlong.dataslot.latitude.description","id":"latitude","label":"data.latlong.dataslot.latitude.label","cardinality":"0..1","datatypes":["numeric","object"],"tags":["subtype:latitude","handling:numeric"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.latlong.dataslot.longitude.description","id":"longitude","label":"data.latlong.dataslot.longitude.label","cardinality":"0..1","datatypes":["numeric","object"],"tags":["subtype:longitude","handling:numeric"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"data.latlong.dataslot.label.description","id":"label","label":"data.latlong.dataslot.label.label","cardinality":"0..1","datatypes":["string","object"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/size_32.svg"},"description":"data.point.dataslot.pointSize.description","id":"latlongSize","label":"data.point.dataslot.pointSize.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/point_color_by_32.svg"},"description":"data.point.dataslot.pointColor.description","id":"latlongColor","label":"data.point.dataslot.pointColor.label","cardinality":"0..1","datatypes":["numeric"]}],"description":"dataset.tabular.map.latlong.description","id":"data.latlong","label":"dataset.latlong.label","type":"tabular","cardinality":"0..1"}],"tags":["tiled","map","multitable","ca.reporting"]},{"description":"datamodel.tabular.map.new.description","id":"tabular","label":"datamodel.tabular.map.new.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"dataslot.map.featureLvl1.description","id":"featureLvl1","label":"dataslot.map.featureLvl1.label","cardinality":"0..1","datatypes":["numeric","string","object"],"tags":["subtype:location","useMapbox","refinement:featureLvl2"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"dataslot.map.featureLvl2.description","id":"featureLvl2","label":"dataslot.map.featureLvl2.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["subtype:location","useMapbox","refinement:featureLvl3"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/map_32.svg"},"description":"dataslot.map.featureLvl3.description","id":"featureLvl3","label":"dataslot.map.featureLvl3.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":["subtype:location","useMapbox"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/region_color_by_32.svg"},"description":"dataslot.map.value.description","id":"value","label":"dataslot.map.value.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/size_32.svg"},"description":"dataslot.map.bubbleSize.description","id":"pointSize","label":"dataslot.map.bubbleSize.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/map_32.png","svg":"..\/rave-library\/resources\/point_color_by_32.svg"},"description":"dataslot.map.bubbleColor.description","id":"pointColor","label":"dataslot.map.bubbleColor.label","cardinality":"0..1","datatypes":["numeric"]}],"description":"dataset.tabular.map.new.description","id":"data","label":"dataset.tabular.label","type":"tabular","cardinality":"0..1"}],"tags":["tiled","map","tabular"]}]},{"properties":{"color":{"type":"object","properties":{"null":{"default":"silver","resetView":"layout","name":"color.null.name","description":"color.null.description","type":"color"},"palette":{"default":"rave2.colorpalette.blueContinuousSequential","resetView":"layout","name":"color.palette.name","options":["continuous"],"description":"color.palette.description","type":"palette"},"pointTransparency":{"default":20,"resetView":"layout","name":"color.pointTransparency.name","description":"color.pointTransparency.description","type":"numeric"}}},"tiledmap":{"type":"object","properties":{"geoJson":{"resetView":"data","name":"tiledmap.geoJson.name","description":"tiledmap.geoJson.description","type":"jsonobject"},"maxZoom":{"default":null,"resetView":"layout","name":"tiledmap.maxZoom.name","description":"tiledmap.maxZoom.description","type":"numeric"},"autoZoom":{"default":true,"resetView":"layout","name":"tiledmap.autoZoom.name","description":"tiledmap.autoZoom.description","type":"boolean"},"style":{"default":"mapbox:\/\/style\/mapbox\/light-v9","resetView":"layout","name":"tiledmap.style.name","options":[{"id":"tiledmap.style.options.streets","value":"mapbox:\/\/style\/mapbox\/streets-v9"},{"id":"tiledmap.style.options.basic","value":"mapbox:\/\/style\/mapbox\/basic-v9"},{"id":"tiledmap.style.options.bright","value":"mapbox:\/\/style\/mapbox\/bright-v9"},{"id":"tiledmap.style.options.outdoors","value":"mapbox:\/\/style\/mapbox\/outdoors-v9"},{"id":"tiledmap.style.options.light","value":"mapbox:\/\/style\/mapbox\/light-v9"},{"id":"tiledmap.style.options.dark","value":"mapbox:\/\/style\/mapbox\/dark-v9"},{"id":"tiledmap.style.options.satellite","value":"mapbox:\/\/style\/mapbox\/satellite-v9"}],"description":"tiledmap.style.description","type":"string"},"mapLocale":{"default":null,"resetView":"layout","name":"tiledmap.mapLocale.name","description":"tiledmap.mapLocale.description","type":"string"},"token":{"default":"","name":"tiledmap.token.name","description":"tiledmap.token.description","type":"string"}}},"legend":{"type":"object","properties":{"display":{"trueLabel":"legend.display.trueLabel","default":true,"falseLabel":"legend.display.falseLabel","resetView":"layout","name":"legend.display.name","description":"legend.display.description","type":"boolean"},"latlong":{"type":"object","properties":{"pointcolor":{"type":"object","properties":{"title":{"default":"","resetView":"layout","name":"legend.latlong.pointcolor.title.name","description":"legend.latlong.pointcolor.title.description","type":"string"}}},"pointsize":{"type":"object","properties":{"title":{"default":"","resetView":"layout","name":"legend.latlong.pointsize.title.name","description":"legend.latlong.pointsize.title.description","type":"string"}}}}},"entrystyle":{"type":"object","properties":{"font":{"name":"legend.entrystyle.font.name","description":"legend.entrystyle.font.description","type":"font"}}},"regioncolor":{"type":"object","properties":{"title":{"default":"","resetView":"layout","name":"legend.regioncolor.title.name","description":"legend.regioncolor.title.description","type":"string"}}},"position":{"default":"right","resetView":"layout","name":"legend.position.name","options":[{"id":"legend.position.options.top","value":"top"},{"id":"legend.position.options.bottom","value":"bottom"},{"id":"legend.position.options.right","value":"right"},{"id":"legend.position.options.left","value":"left"}],"description":"legend.position.description","type":"string"},"pointcolor":{"type":"object","properties":{"title":{"default":"","resetView":"layout","name":"legend.pointcolor.title.name","description":"legend.pointcolor.title.description","type":"string"}}},"titlestyle":{"type":"object","properties":{"fontfamily":{"default":null,"name":"legend.titlestyle.fontfamily.name","description":"legend.titlestyle.fontfamily.description","type":"string"},"fontsize":{"default":null,"resetView":"layout","name":"legend.titlestyle.fontsize.name","description":"legend.titlestyle.fontsize.description","type":"string"},"fill":{"default":null,"name":"legend.titlestyle.fill.name","description":"legend.titlestyle.fill.description","type":"color"},"font":{"resetView":"layout","name":"legend.titlestyle.font.name","description":"legend.titlestyle.font.description","type":"font"}}},"pointsize":{"type":"object","properties":{"title":{"default":"","resetView":"layout","name":"legend.pointsize.title.name","description":"legend.pointsize.title.description","type":"string"}}}}},"maxPointSize":{"default":"20","resetView":"layout","name":"max.point.size.name","description":"max.point.size.description","type":"length"},"latlong":{"type":"object","properties":{"defaultSize":{"resetView":"data","name":"default.latlong.point.size.name","description":"default.latlong.point.size.description","type":"length"},"transparency":{"default":20,"resetView":"layout","name":"color.latlongTransparency.name","description":"color.latlongTransparency.description","type":"numeric"},"palette":{"default":"rave2.colorpalette.blueContinuousSequential","resetView":"layout","name":"color.latlong.palette.name","options":["continuous"],"description":"color.latlong.palette.description","type":"palette"},"minSize":{"default":"5","resetView":"layout","name":"min.latlong.size.name","description":"min.latlong.size.description","type":"length"},"maxSize":{"default":"20","resetView":"layout","name":"max.latlong.size.name","description":"max.latlong.size.description","type":"length"},"staticZeroValueSize":{"default":"5","resetView":"data","name":"static.latlong.zero.value.size.name","description":"static.latlong.zero.value.size.description","type":"length"}}},"staticZeroValuePointSize":{"default":"5","resetView":"data","name":"static.zero.value.size.name","description":"static.zero.value.size.description","type":"length"},"region":{"type":"object","properties":{"mapData":{"resetView":"data","name":"mapData.name","description":"mapData.description","type":"array","items":{"name":"mapData.items","type":"jsonobject","required":false}},"transparency":{"default":20,"resetView":"layout","name":"color.fillTransparency.name","description":"color.fillTransparency.description","type":"numeric"},"custom":{"type":"object","properties":{"propertyName":{"default":"","resetView":"data","name":"custom.region.propertyName.name","description":"custom.region.propertyName.description","type":"string"},"mapId":{"default":"","resetView":"data","name":"custom.region.mapId.name","description":"custom.region.mapId.description","type":"string"},"layerName":{"default":"","resetView":"data","name":"custom.region.layerName.name","description":"custom.region.layerName.description","type":"string"}}},"palette":{"default":"rave2.colorpalette.blueContinuousSequential","resetView":"layout","name":"color.feature.palette.name","options":["continuous"],"description":"color.feature.palette.description","type":"palette"}}},"minPointSize":{"default":"5","resetView":"layout","name":"min.point.size.name","description":"min.point.size.description","type":"length"},"point":{"type":"object","properties":{"mapData":{"resetView":"data","name":"mapData.name","description":"mapData.description","type":"array","items":{"name":"mapData.items","type":"jsonobject","required":false}},"defaultSize":{"resetView":"data","name":"default.point.size.name","description":"default.point.size.description","type":"length"},"transparency":{"default":20,"resetView":"layout","name":"color.pointTransparency.name","description":"color.pointTransparency.description","type":"numeric"},"custom":{"type":"object","properties":{"propertyName":{"default":"","resetView":"data","name":"custom.point.propertyName.name","description":"custom.point.propertyName.description","type":"string"},"mapId":{"default":"","resetView":"data","name":"custom.point.mapId.name","description":"custom.point.mapId.description","type":"string"},"layerName":{"default":"","resetView":"data","name":"custom.point.layerName.name","description":"custom.point.layerName.description","type":"string"}}},"palette":{"default":"rave2.colorpalette.blueContinuousSequential","resetView":"layout","name":"color.point.palette.name","options":["continuous"],"description":"color.point.palette.description","type":"palette"},"minSize":{"default":"5","resetView":"layout","name":"min.point.size.name","description":"min.point.size.description","type":"length"},"maxSize":{"default":"20","resetView":"layout","name":"max.point.size.name","description":"max.point.size.description","type":"length"},"staticZeroValueSize":{"default":"5","resetView":"data","name":"static.zero.value.size.name","description":"static.zero.value.size.description","type":"length"}}}}},{"actions":[{"description":"actions.applyHighlight.description","id":"highlight","label":"actions.applyHighlight.label"},{"description":"actions.removeHighlight.description","id":"unhighlight","label":"actions.removeHighlight.label","tags":[]},{"description":"actions.applySelection.description","id":"select","label":"actions.applySelection.label","tags":[]},{"description":"actions.removeSelection.description","id":"deselect","label":"actions.removeSelection.label","tags":[]},{"description":"actions.removeAllSelect.description","id":"deselectAll","label":"actions.removeAllSelect.label","tags":[]},{"description":"actions.toggleSelect.description","id":"toggleSelect","label":"actions.toggleSelect.label","tags":[]},{"description":"actions.zoom.description","id":"zoom","label":"actions.zoom.label","tags":[]},{"description":"actions.locate.description","id":"locate","label":"actions.locate.label","tags":[]}]},{"properties":{"layout":{"type":"object","properties":{"padding":{"default":"10","resetView":"layout","name":"layout.padding.name","description":"layout.padding.description","type":"padding"},"legendsize":{"type":"object","properties":{"min":{"default":"0","resetView":"layout","name":"layout.legendsize.min.name","description":"layout.legendsize.min.description","type":"length"},"max":{"default":"20%","resetView":"layout","name":"layout.legendsize.max.name","description":"layout.legendsize.max.description","type":"length"},"preferred":{"default":"20%","resetView":"layout","name":"layout.legendsize.preferred.name","description":"layout.legendsize.preferred.description","type":"length"}}},"legendchart":{"type":"object","properties":{"gap":{"default":"10","resetView":"layout","name":"layout.legendchart.gap.name","description":"layout.legendchart.gap.description","type":"length"},"align":{"default":false,"resetView":"layout","name":"layout.legendchart.align.name","description":"layout.legendchart.align.description","type":"boolean"}}},"chart":{"type":"object","properties":{"padding":{"type":"object","properties":{"top":{"default":"0","resetView":"layout","name":"layout.chart.padding.top.name","description":"layout.chart.padding.top.description","type":"length"},"left":{"default":"0","resetView":"layout","name":"layout.chart.padding.left.name","description":"layout.chart.padding.left.description","type":"length"},"bottom":{"default":"0","resetView":"layout","name":"layout.chart.padding.bottom.name","description":"layout.chart.padding.bottom.description","type":"length"},"right":{"default":"0","resetView":"layout","name":"layout.chart.padding.right.name","description":"layout.chart.padding.right.description","type":"length"}}}}}}}}},{"propertyPresentations":[{"presentationItems":[{"propertyID":"tiledmap.token"},{"propertyID":"tiledmap.style"},{"propertyID":"color.palette"},{"propertyID":"legend.display"},{"propertyID":"legend.position"}],"icon":"","description":"propertyPresentation.simple.description","id":"simple","label":"propertyPresentation.simple.label","tags":["Tiledmap","Tiledmap Properties Presentation","Simple","ca.dashboard"]},{"presentationItems":[{"propertyGroup":{"presentationItems":[],"icon":"","description":"propertyPresentation.advanced.commonProperties.description","id":"commonProperties","label":"propertyPresentation.advanced.commonProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"tiledmap.style"},{"propertyID":"tiledmap.token"}],"icon":"","description":"map.propertyPresentation.advanced.mapSpecificProperties.description","id":"mapSpecificProperties","label":"map.propertyPresentation.advanced.mapSpecificProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"region.palette"},{"propertyID":"region.transparency"},{"propertyID":"region.custom.mapId"},{"propertyID":"region.custom.layerName"},{"propertyID":"region.custom.propertyName"}],"icon":"","description":"map.propertyPresentation.advanced.regionProperties.description","id":"regionProperties","label":"map.propertyPresentation.advanced.regionProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"point.palette"},{"propertyID":"point.transparency"},{"propertyID":"point.minSize"},{"propertyID":"point.maxSize"},{"propertyID":"point.defaultSize"},{"propertyID":"point.custom.mapId"},{"propertyID":"point.custom.layerName"},{"propertyID":"point.custom.propertyName"}],"icon":"","description":"map.propertyPresentation.advanced.pointProperties.description","id":"pointProperties","label":"map.propertyPresentation.advanced.pointProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"latlong.palette"},{"propertyID":"latlong.transparency"},{"propertyID":"latlong.minSize"},{"propertyID":"latlong.maxSize"},{"propertyID":"latlong.defaultSize"}],"icon":"","description":"map.propertyPresentation.advanced.latlongProperties.description","id":"latlongProperties","label":"map.propertyPresentation.advanced.latlongProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"legend.display"},{"propertyID":"legend.position"},{"propertyID":"legend.regioncolor.title"},{"propertyID":"legend.pointsize.title"},{"propertyID":"legend.pointcolor.title"},{"propertyID":"legend.latlong.pointsize.title"},{"propertyID":"legend.latlong.pointcolor.title"},{"propertyID":"legend.titlestyle.font"},{"propertyID":"legend.entrystyle.font"}],"icon":"","description":"propertyPresentation.advanced.legendProperties.description","id":"legendProperties","label":"propertyPresentation.advanced.legendProperties.label","tags":[]}}],"icon":"","description":"propertyPresentation.advanced.description","id":"advanced","label":"propertyPresentation.advanced.label","tags":["Tiledmap","Tiledmap Properties Presentation","advanced","ca.reporting"]},{"presentationItems":[{"propertyGroup":{"presentationItems":[{"propertyID":"color.null"},{"propertyID":"tiledmap.style"},{"propertyID":"tiledmap.token"},{"propertyID":"tiledmap.autoZoom"},{"propertyID":"tiledmap.maxZoom"},{"propertyID":"tiledmap.mapLocale"}],"description":"propertyPresentation.sample.global.description","id":"global","label":"propertyPresentation.sample.global.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"region.mapData"},{"propertyID":"region.palette"},{"propertyID":"region.transparency"},{"propertyID":"region.custom.mapId"},{"propertyID":"region.custom.layerName"},{"propertyID":"region.custom.propertyName"}],"description":"propertyPresentation.sample.region.description","id":"region","label":"propertyPresentation.sample.region.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"point.mapData"},{"propertyID":"point.palette"},{"propertyID":"point.transparency"},{"propertyID":"point.minSize"},{"propertyID":"point.maxSize"},{"propertyID":"point.defaultSize"},{"propertyID":"point.staticZeroValueSize"},{"propertyID":"point.custom.mapId"},{"propertyID":"point.custom.layerName"},{"propertyID":"point.custom.propertyName"}],"description":"propertyPresentation.sample.point.description","id":"point","label":"propertyPresentation.sample.point.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"latlong.palette"},{"propertyID":"latlong.transparency"},{"propertyID":"latlong.minSize"},{"propertyID":"latlong.maxSize"},{"propertyID":"latlong.defaultSize"},{"propertyID":"latlong.staticZeroValueSize"}],"description":"propertyPresentation.sample.latlong.description","id":"latlong","label":"propertyPresentation.sample.latlong.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"layout.padding"},{"propertyID":"layout.legendsize.min"},{"propertyID":"layout.legendsize.max"},{"propertyID":"layout.legendsize.preferred"},{"propertyID":"layout.legendchart.gap"},{"propertyID":"layout.legendchart.align"},{"propertyID":"layout.chart.padding.top"},{"propertyID":"layout.chart.padding.left"},{"propertyID":"layout.chart.padding.bottom"},{"propertyID":"layout.chart.padding.right"}],"description":"propertyPresentation.sample.layout.description","id":"layout","label":"propertyPresentation.sample.layout.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"legend.display"},{"propertyID":"legend.entrystyle.font"},{"propertyID":"legend.position"},{"propertyID":"legend.titlestyle.fontfamily"},{"propertyID":"legend.titlestyle.fontsize"},{"propertyID":"legend.titlestyle.fill"},{"propertyID":"legend.titlestyle.font"},{"propertyID":"legend.pointsize.title"},{"propertyID":"legend.pointcolor.title"},{"propertyID":"legend.latlong.pointsize.title"},{"propertyID":"legend.latlong.pointcolor.title"},{"propertyID":"legend.regioncolor.title"}],"description":"propertyPresentation.sample.legend.description","id":"legend","label":"propertyPresentation.sample.legend.label","tags":[]}}],"icon":"","description":"propertyPresentation.sample.description","id":"sample","label":"propertyPresentation.sample.label","tags":["Tiledmap","Tiledmap Properties Presentation"]}]},{"configurations":[{"dataSlots":[{"dataModelId":"multiTable","dataSetId":"data.region","dataSlotId":"featureLvl1","tags":["ca.reporting.edgeId:featureId","ca.reporting.edgePosition:3"]},{"dataModelId":"multiTable","dataSetId":"data.region","dataSlotId":"featureLvl2","tags":["ca.reporting.edgeId:featureId","ca.reporting.edgePosition:2"]},{"dataModelId":"multiTable","dataSetId":"data.region","dataSlotId":"featureLvl3","tags":["ca.reporting.edgeId:featureId","ca.reporting.edgePosition:1"]},{"dataModelId":"multiTable","dataSetId":"data.point","dataSlotId":"featureLvl1","tags":["ca.reporting.edgeId:featureId","ca.reporting.edgePosition:3"]},{"dataModelId":"multiTable","dataSetId":"data.point","dataSlotId":"featureLvl2","tags":["ca.reporting.edgeId:featureId","ca.reporting.edgePosition:2"]},{"dataModelId":"multiTable","dataSetId":"data.point","dataSlotId":"featureLvl3","tags":["ca.reporting.edgeId:featureId","ca.reporting.edgePosition:1"]},{"dataModelId":"multiTable","dataSetId":"data.latlong","dataSlotId":"latitude","tags":["ca.reporting.edgeId:latLong","ca.reporting.edgePosition:1","ca.reporting.categorical"]},{"dataModelId":"multiTable","dataSetId":"data.latlong","dataSlotId":"longitude","tags":["ca.reporting.edgeId:latLong","ca.reporting.edgePosition:2","ca.reporting.categorical"]},{"dataModelId":"multiTable","dataSetId":"data.latlong","dataSlotId":"label","tags":["ca.reporting.edgeId:latLong","ca.reporting.edgePosition:3"]}],"previews":{"image":[{"file":"resources\/preview_map_small.png","tags":["small","notext"]}],"svg":[{"file":"resources\/map_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/map_preview_320.svg","tags":["medium","color"]},{"file":"resources\/map_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"tiledmap.config.tiledmap.description","id":"tiledmapV2","label":"tiledmap.config.tiledmap.label","tags":["ca.reporting","ca.reporting.palettes=continuous"]},"datamodels":[{"id":"multiTable"},{"hidden":"true","id":"tabular"}]}]},{"build":"development","name":"rave-library-tiledmap","description":"This is the IBM Rave map bundle.","ignore":["bower.json"],"main":"bundle.js","version":"0.0.0","dependencies":{"rave-legends":"<2.0.0","mapboxgl":"<0.32.0","rave-library":"<2.0.0","rave":"<3.0.0","rave-utilities":"<2.0.0"}}]
- },{}],2:[function(require,module,exports){
- module.exports={
- "actions.applyHighlight.description": "Highlights a node.",
- "actions.applyHighlight.label": "Apply highlight action",
- "actions.applySelection.description": "Selects a node.",
- "actions.applySelection.label": "Apply selection action",
- "actions.args.attributes.description": "Optional map of attribute to value that is applied during the action.",
- "actions.args.attributes.label": "Optional attributes function argument",
- "actions.args.primaryAttributes.description": "Optional map of primary attributes that are applied during the action.",
- "actions.args.primaryAttributes.label": "Optional primary attributes function argument",
- "actions.args.primarySelector.description": "Primary selector for the nodes that the action is to apply to.",
- "actions.args.primarySelector.label": "Primary selector function argument",
- "actions.args.secondaryAttributes.description": "Optional map of secondary attributes that are applied during the action.",
- "actions.args.secondaryAttributes.label": "Optional secondary attributes function argument",
- "actions.args.secondarySelector.description": "Secondary selector for the nodes that the action is to apply to.",
- "actions.args.secondarySelector.label": "Secondary selector function argument",
- "actions.args.selector.description": "Selector of the node that the action will apply to.",
- "actions.args.selector.label": "Selector function argument",
- "actions.breadCrumb.description": "Navigates up and down in detail through a bread crumb.",
- "actions.breadCrumb.label": "Bread crumb navigation action",
- "actions.chord.selector.description": "Selector for the chords that the action will apply to.",
- "actions.chord.selector.label": "Selector function argument for chords",
- "actions.chord.toggleSelect.description": "Toggles selection on a chord.",
- "actions.chord.toggleSelect.label": "Toggle select on chord action",
- "actions.chordGroup.highlight.description": "Highlights a chord group and everything that is connected to it.",
- "actions.chordGroup.highlight.label": "Chord group highlight action",
- "actions.chordGroup.removeHighlight.description": "Removes highlights from a chord group and everything connected to it.",
- "actions.chordGroup.removeHighlight.label": "Chord group remove highlight action",
- "actions.chordGroup.selector.description": "Selector for the chord groups that the action will apply to.",
- "actions.chordGroup.selector.label": "Selector function argument for chord groups",
- "actions.drillDown.description": "Drills down to the next level of detail.",
- "actions.drillDown.label": "Drill down action",
- "actions.locate.description": "Locate action",
- "actions.locate.label": "Locate action",
- "actions.removeAllSelect.description": "Removes all selections from all nodes.",
- "actions.removeAllSelect.label": "Remove all selections action",
- "actions.removeHighlight.description": "Removes a highlight from a node.",
- "actions.removeHighlight.label": "Remove highlight action",
- "actions.removeSelection.description": "Removes a selection from a node.",
- "actions.removeSelection.label": "Remove selection action",
- "actions.toggleSelect.description": "Toggles the selection on a node.",
- "actions.toggleSelect.label": "Toggle selection action",
- "actions.zoom.args.panX.description": "The amount to pan in the x direction.",
- "actions.zoom.args.panX.label": "Zoom x pan amount function argument",
- "actions.zoom.args.panY.description": "The amount to pan in the y direction.",
- "actions.zoom.args.panY.label": "Zoom y pan amount function argument",
- "actions.zoom.args.scale.description": "The scale amount for the zoom action.",
- "actions.zoom.args.scale.label": "Zoom scale function argument",
- "actions.zoom.description": "Zoom action",
- "actions.zoom.label": "Zoom action",
- "actions.zoomPackedBubble.description": "Zoom for a packed bubble.",
- "actions.zoomPackedBubble.label": "Zoom packed bubble action",
- "background.chart.color.description": "The background color of the chart.",
- "background.chart.color.name": "Background color",
- "background.color.description": "The background color behind the elements of the chart.",
- "background.elements.color.description": "The background color behind the elements of the chart.",
- "background.elements.color.name": "Elements background color",
- "border.color.description": "The color of the borders between features.",
- "border.color.name": "Border color",
- "border.width.description": "The width of the border.",
- "border.width.name": "Border width",
- "bubble.animation.description": "The effect that is used to animate the initial bubble.",
- "bubble.animation.duration.description": "The duration of the initial bubble animation in ms.",
- "bubble.animation.duration.name": "Bubble animation duration",
- "bubble.animation.name": "Bubble animation",
- "bubble.animation.options.none": "None",
- "bubble.animation.options.transition": "Transition",
- "bubble.size.description": "The radius of bubbles, in pixels, when bubbles are not sized by data.",
- "bubble.size.name": "Bubble size",
- "bubbleBorder.color.description": "The color of the bubble borders.",
- "bubbleBorder.color.name": "Bubble border color",
- "bubbleBorder.width.description": "The width of the bubble borders.",
- "bubbleBorder.width.name": "Bubble border width",
- "color.feature.palette.description": "The color palette that is used to color regions in the map.",
- "color.feature.palette.name": "Color palette",
- "color.featureDynamicPalette.max.description": "The color that is used for the maximum value of a region dynamic palette.",
- "color.featureDynamicPalette.max.name": "Region maximum value color",
- "color.featureDynamicPalette.mid.description": "The color that is used for the middle value of a region dynamic palette.",
- "color.featureDynamicPalette.mid.name": "Region middle value color",
- "color.featureDynamicPalette.min.description": "The color that is used for the minimum value of a region dynamic palette.",
- "color.featureDynamicPalette.min.name": "Region minimum value color",
- "color.fillTransparency.description": "Transparency, in percentage, that is added to the palette entry for the region fill color.",
- "color.fillTransparency.name": "Fill transparency percentage",
- "color.latlong.palette.description": "The color palette that is used to color latitude/longitude points in the map.",
- "color.latlong.palette.name": "Color palette",
- "color.latlongTransparency.description": "Transparency, in percentage, that is added to the palette entry for the point fill color.",
- "color.latlongTransparency.name": "Fill transparency percentage",
- "color.null.description": "The color that is applied to null values.",
- "color.null.name": "Null value color",
- "color.palette.description": "Color palette to use with the tiled map.",
- "color.palette.name": "Color palette",
- "color.point.palette.description": "The color palette that is used to color points in the map.",
- "color.point.palette.name": "Color palette",
- "color.pointDynamicPalette.max.description": "The color that is used for the maximum value of a point dynamic palette.",
- "color.pointDynamicPalette.max.name": "Point maximum value color",
- "color.pointDynamicPalette.mid.description": "The color that is used for the middle value of a point dynamic palette.",
- "color.pointDynamicPalette.mid.name": "Point middle value color",
- "color.pointDynamicPalette.min.description": "The color that is used for the minimum value of a point dynamic palette.",
- "color.pointDynamicPalette.min.name": "Point minimum value color",
- "color.pointTransparency.description": "Transparency, in percentage, that is added to the palette entry for the point fill color.",
- "color.pointTransparency.name": "Fill transparency percentage",
- "custom.point.layerName.description": "The layer name of the custom polygon layer which should be used for the point.",
- "custom.point.layerName.name": "Point custom layer name",
- "custom.point.mapId.description": "The map ID of the custom polygon layer which should be used for the point.",
- "custom.point.mapId.name": "Point custom map ID",
- "custom.point.propertyName.description": "The property name of the custom polygon layer which should be used for the point.",
- "custom.point.propertyName.name": "Point custom property name",
- "custom.region.layerName.description": "The layer name of the custom polygon layer which should be used for the region.",
- "custom.region.layerName.name": "Region custom layer name",
- "custom.region.mapId.description": "The map ID of the custom polygon layer which should be used for the region.",
- "custom.region.mapId.name": "Region custom map ID",
- "custom.region.propertyName.description": "The property name of the custom polygon layer which should be used for the region.",
- "custom.region.propertyName.name": "Region custom property name",
- "customPolygonPropertyConversionFailure": "Converting your custom layer data to the required data type failed. Please use numerical data for this custom layer property.",
- "data.handling.description": "The configuration that is used to plot the data.",
- "data.handling.name": "Configuration",
- "data.latlong.dataslot.label.description": "Specify the label attached to the location to render on a map",
- "data.latlong.dataslot.label.label": "Label",
- "data.latlong.dataslot.latitude.description": "Specify the latitude of the location to render on a map",
- "data.latlong.dataslot.latitude.label": "Latitude",
- "data.latlong.dataslot.longitude.description": "Specify the longitude of the location to render on a map",
- "data.latlong.dataslot.longitude.label": "Longitude",
- "data.point.dataslot.featureLvl1.description": "Specify the location to render on a map; you can clarify it with additional data items, e.g. City, State, Country",
- "data.point.dataslot.featureLvl1.label": "Location",
- "data.point.dataslot.featureLvl2.description": "First clarification item",
- "data.point.dataslot.featureLvl2.label": "Refine location",
- "data.point.dataslot.featureLvl3.description": "Second clarification item",
- "data.point.dataslot.featureLvl3.label": "Further refine location",
- "data.point.dataslot.pointColor.description": "Determines the color of the shape, based it's numeric value and choosen palette",
- "data.point.dataslot.pointColor.label": "Color",
- "data.point.dataslot.pointSize.description": "Determines the size of the shape, based it's numeric value",
- "data.point.dataslot.pointSize.label": "Size",
- "data.region.dataslot.featureLvl1.description": "Specify the location to render on a map; you can clarify it with additional data items, e.g. City, State, Country.",
- "data.region.dataslot.featureLvl1.label": "Location",
- "data.region.dataslot.featureLvl2.description": "Clarification item, e.g. For Postal/Zip Codes, use Country. For Cities, use Province/State. For Province/State, use Country.",
- "data.region.dataslot.featureLvl2.label": "Refine location",
- "data.region.dataslot.featureLvl3.description": "Further clarification item, e.g. For Cities, use Country.",
- "data.region.dataslot.featureLvl3.label": "Further refine location",
- "data.region.dataslot.fill.description": "This value determines the fill color of the region based on the choosen palette.",
- "data.region.dataslot.fill.label": "Color",
- "datamodel.hierarchial.label": "Hierarchical data model",
- "datamodel.multitable.map.description": "The data model uses two separate data sets for coloring regions and ovelaying bubbles",
- "datamodel.multitable.map.label": "Multi table regions and bubbles",
- "datamodel.tabular.label": "Tabular data model",
- "datamodel.tabular.map.description": "The simple map model, providing feature name, color, label, and point data with x and y, size, and label.",
- "datamodel.tabular.map.new.description": "The data model that uses feature matching to color each region and overlay a bubble.",
- "datamodel.tabular.map.new.label": "Tabular regions and bubbles",
- "dataset.hierarchial.label": "Hierarchical data set",
- "dataset.latlong.label": "Latitude/Longitude",
- "dataset.points.label": "Points",
- "dataset.regions.label": "Regions",
- "dataset.tabular.description": "The tabular data set of rows and columns.",
- "dataset.tabular.label": "Tabular data set",
- "dataset.tabular.link.description": "Determines the links between the nodes.",
- "dataset.tabular.link.label": "Tabular links data set",
- "dataset.tabular.map.description": "The tabular map data that is used with the GeoJSON features (feature ID data to GeoJSON ID lookup property).",
- "dataset.tabular.map.latlong.description": "Tabular data set for mapping bubbles to latitude/longitude coordinates",
- "dataset.tabular.map.new.description": "The data set that uses feature matching to color each region and overlay a bubble.",
- "dataset.tabular.map.point.description": "The tabular data for points plotted on top of the map data.",
- "dataset.tabular.map.points.description": "Tabular data set for mapping the bubbles to locations",
- "dataset.tabular.map.regions.description": "Tabual data set for mapping the color to regions",
- "dataset.tabular.node.description": "The tabular data set that defines the nodes.",
- "dataset.tabular.node.label": "Tabular node data set",
- "dataset.tabular.points.label": "Tabular data set points",
- "dataset.tabular.regions.label": "Tabular data set regions",
- "dataslot.categories.label": "Categories",
- "dataslot.category.label": "Category",
- "dataslot.children.description": "When applied to a tree node, returns the children of that node as an array-list.",
- "dataslot.children.label": "Children",
- "dataslot.color.description": "Determines the color of the shape.",
- "dataslot.color.label": "Color",
- "dataslot.key.description": "Called for each row to match elements. Primarily used for transitions.",
- "dataslot.key.label": "Key",
- "dataslot.label.description": "Determines the label of the shape.",
- "dataslot.label.label": "Label",
- "dataslot.label.map.description": "The label of the map feature. This value is optional. If the value is not provided, the feature name is used.",
- "dataslot.map.bubbleColor.description": "If set, bubbles will be drawn for each feature. Numeric values are used to determine the color of each bubble.",
- "dataslot.map.bubbleColor.label": "Point color",
- "dataslot.map.bubbleSize.description": "If set, bubbles will be drawn for each feature. Numeric values are used to determine the size of each bubble.",
- "dataslot.map.bubbleSize.label": "Point size",
- "dataslot.map.featureColor.description": "The color of the map feature.",
- "dataslot.map.featureColor.label": "Feature value",
- "dataslot.map.featureLabel.description": "The label to associate with each feature. If not specified, the feature ID is used.",
- "dataslot.map.featureLabel.label": "Feature label",
- "dataslot.map.featureLvl1.description": "Specify the location to render on a map; you can clarify it with additional data items, e.g. City, State, Country",
- "dataslot.map.featureLvl1.label": "Location",
- "dataslot.map.featureLvl2.description": "First clarification item",
- "dataslot.map.featureLvl2.label": "Refine location",
- "dataslot.map.featureLvl3.description": "Second clarification item",
- "dataslot.map.featureLvl3.label": "Further refine location",
- "dataslot.map.pointIdentifier.description": "pointIdentifier.description",
- "dataslot.map.pointIdentifier.label": "pointIdentifier.label",
- "dataslot.map.pointIdentifierRefinement.description": "pointIdentifierRefinement.description",
- "dataslot.map.pointIdentifierRefinement.label": "pointIdentifierRefinement.label",
- "dataslot.map.value.description": "This is the value to be attached as a property per feature id.",
- "dataslot.map.value.label": "Region color",
- "dataslot.maximumValue.label": "Maximum value",
- "dataslot.source.label": "Source",
- "dataslot.sourceValue.label": "Source value",
- "dataslot.tabular.id.description": "The identifier for the nodes.",
- "dataslot.tabular.id.label": "Identifier",
- "dataslot.tabular.size.description": "Determines the size of the shape.",
- "dataslot.tabular.size.label": "Size",
- "dataslot.target.label": "Target",
- "dataslot.targetValue.label": "Target value",
- "dataslot.value.label": "Value",
- "dataslot.x.label": "X axis",
- "dataslot.x.map.point.description": "The numeric x (longitude) position, in the same coordinates as the GeoJSON.",
- "dataslot.y.label": "Y axis",
- "dataslot.y.map.point.description": "The numeric y (latitude) position, in the same coordinates as the GeoJSON.",
- "default.latlong.point.size.description": "Point radius when no size attribute is specified.",
- "default.latlong.point.size.name": "Default point size",
- "default.pan.zoom.description": "When set to Yes, the visualization uses the built-in pan-zoom behavior. Set to No to allow for custom pan and zoom actions.",
- "default.pan.zoom.name": "Default pan-zoom behavior",
- "default.point.size.description": "Point radius when no size attribute is specified.",
- "default.point.size.name": "Default point size",
- "defaultPalette.description": "Rave2 default description",
- "defaultPalette.label": "Rave2 default",
- "display.graticule.description": "Shows or hides the graticule.",
- "display.graticule.name": "Show graticule",
- "drop.labels.description": "Keeps or drops overlapping labels.",
- "drop.labels.name": "Drop overlapping labels",
- "effect.duration.description": "The animation duration, in ms.",
- "effect.duration.name": "Animation duration (ms)",
- "effect.name.description": "The effect that is used when the chart is drawn.",
- "effect.name.name": "Animation",
- "feature.label.color.description": "The color of the feature labels.",
- "feature.label.color.name": "Feature label color",
- "feature.label.font.description": "The font of the feature labels.",
- "feature.label.font.name": "Feature label font",
- "feature.label.size.description": "The size of the feature labels.",
- "feature.label.size.name": "Feature label size",
- "flash.description": "Specifies whether to flash regions.",
- "flash.duration.description": "The duration of flashing regions and bubbles in ms.",
- "flash.duration.name": "Flash duration",
- "flash.name": "Flash",
- "geodata.index.description": "The index of the GeoJSON that the data corresponds to.",
- "geodata.index.name": "GeoJSON data index",
- "geojson.object.description": "The JSONObject that is loaded for the GeoJSON.",
- "geojson.object.name": "GeoJSON JSONObject",
- "geojson.url.description": "The URL of the GeoJSON file.",
- "geojson.url.name": "GeoJSON URL",
- "graticule.color.description": "The color of the graticule.",
- "graticule.color.name": "Graticule color",
- "graticule.stroke.thickness.description": "The stroke thickness for the graticule.",
- "graticule.stroke.thickness.name": "Graticule stroke thickness",
- "grid.color.description": "The color of the grid lines.",
- "grid.color.name": "Grid lines color",
- "grid.display.description": "Show or hide the grid lines.",
- "grid.display.name": "Show grid lines",
- "id.lookup.description": "The dot separated field names for feature ids.",
- "id.lookup.name": "ID lookup",
- "invalidLayerName": "Invalid layer name specified: ",
- "invalidMapId": "Invalid map id specified: ",
- "invalidPropertyName": "Invalid property name specified: ",
- "labelResolution.description": "The method that is used to resolve labels.",
- "labelResolution.name": "Label resolution",
- "labelResolution.options.DropLabels": "Drop labels",
- "labelResolution.options.MoveLabels": "Move labels",
- "labelResolution.options.none": "None",
- "layout.axissize.bottom.max.description": "The maximum size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.max.name": "Bottom axis maximum size",
- "layout.axissize.bottom.min.description": "The minimum size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.min.name": "Bottom axis minimum size",
- "layout.axissize.bottom.preferred.description": "The preferred size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.preferred.name": "Bottom axis preferred size",
- "layout.axissize.left.max.description": "The maximum size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.max.name": "Left axis maximum size",
- "layout.axissize.left.min.description": "The minimum size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.min.name": "Left axis minimum size",
- "layout.axissize.left.preferred.description": "The preferred size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.preferred.name": "Left axis preferred size",
- "layout.axissize.right.max.description": "The maximum size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.max.name": "Right axis maximum size",
- "layout.axissize.right.min.description": "The minimum size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.min.name": "Right axis minimum size",
- "layout.axissize.right.preferred.description": "The preferred size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.preferred.name": "Right axis preferred size",
- "layout.axissize.top.max.description": "The maximum size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.max.name": "Top axis maximum size",
- "layout.axissize.top.min.description": "The minimum size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.min.name": "Top axis minimum size",
- "layout.axissize.top.preferred.description": "The preferred size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.preferred.name": "Top axis preferred size",
- "layout.chart.padding.bottom.description": "The bottom padding for the chart.",
- "layout.chart.padding.bottom.name": "Bottom padding",
- "layout.chart.padding.left.description": "The left padding for the chart.",
- "layout.chart.padding.left.name": "Left padding",
- "layout.chart.padding.right.description": "Right padding for the chart.",
- "layout.chart.padding.right.name": "Right padding",
- "layout.chart.padding.top.description": "The top padding for the chart.",
- "layout.chart.padding.top.name": "Top padding",
- "layout.legendchart.align.description": "Whether to align the legend to the interior of the chart.",
- "layout.legendchart.align.name": "Align legend to chart",
- "layout.legendchart.gap.description": "Space between the chart and the legend, as a CSS size or percentage.",
- "layout.legendchart.gap.name": "Space between legend and chart",
- "layout.legendsize.max.description": "The maximum size of the legend, as a CSS size or percentage.",
- "layout.legendsize.max.name": "Maximum size",
- "layout.legendsize.min.description": "The minimum size of the legend, as a CSS size or percentage.",
- "layout.legendsize.min.name": "Minimum size",
- "layout.legendsize.preferred.description": "The preferred size of the legend, as a CSS size or percentage.",
- "layout.legendsize.preferred.name": "Preferred size",
- "layout.padding.description": "The padding around the chart and legend.",
- "layout.padding.name": "Padding",
- "legend.animation.description": "The effect that is used to animate the legend.",
- "legend.animation.duration.description": "The duration of the legend animation in ms.",
- "legend.animation.duration.name": "Legend animation duration",
- "legend.animation.name": "Legend animation",
- "legend.animation.options.none": "None",
- "legend.animation.options.transition": "Transition",
- "legend.display.description": "Shows or hides the legend.",
- "legend.display.falseLabel": "Hide",
- "legend.display.name": "Show legend",
- "legend.display.trueLabel": "Show",
- "legend.entrystyle.font.description": "The font properties of the legend entry.",
- "legend.entrystyle.font.name": "Entry font",
- "legend.latlong.pointcolor.title.description": "The title of the legend for latitude/longitude point color",
- "legend.latlong.pointcolor.title.name": "Latitude/Longitude color legend title",
- "legend.latlong.pointsize.title.description": "The title of the legend for latitude/longitude point size",
- "legend.latlong.pointsize.title.name": "Latitude/Longitude size legend title",
- "legend.map.display.description": "Shows or hides the map legend.",
- "legend.map.display.name": "Show map legend",
- "legend.map.title.description": "The title of the map legend.",
- "legend.map.title.name": "Map legend title",
- "legend.map.titlestyle.fill.description": "The color of the map legend title.",
- "legend.map.titlestyle.fill.name": "Map legend title color",
- "legend.map.titlestyle.fontfamily.description": "The font family of the map legend title.",
- "legend.map.titlestyle.fontfamily.name": "Map legend title font family",
- "legend.map.titlestyle.fontsize.description": "The font size of the map legend title.",
- "legend.map.titlestyle.fontsize.name": "Map legend title font size",
- "legend.pointcolor.title.description": "The title of the legend for point color",
- "legend.pointcolor.title.name": "Point color legend title",
- "legend.pointsize.title.description": "The title of the legend for point size",
- "legend.pointsize.title.name": "Point size legend title",
- "legend.position.description": "The position of the legend in the chart.",
- "legend.position.name": "Legend position",
- "legend.position.options.bottom": "Bottom",
- "legend.position.options.left": "Left",
- "legend.position.options.right": "Right",
- "legend.position.options.top": "Top",
- "legend.regioncolor.title.description": "The title of the legend for region color",
- "legend.regioncolor.title.name": "Region color legend title",
- "legend.size.display.description": "Shows or hides the bubble size legend.",
- "legend.size.display.name": "Show bubble size legend",
- "legend.size.title.description": "The title of the bubble size legend.",
- "legend.size.title.name": "Bubble size legend title",
- "legend.size.titlestyle.fill.description": "The color of the bubble size legend title.",
- "legend.size.titlestyle.fill.name": "Bubble size legend title color",
- "legend.size.titlestyle.fontfamily.description": "The font family of the bubble size legend title.",
- "legend.size.titlestyle.fontfamily.name": "Bubble size legend title font family",
- "legend.size.titlestyle.fontsize.description": "The font size of the bubble size legend title.",
- "legend.size.titlestyle.fontsize.name": "Bubble size legend title font size",
- "legend.title.description": "The title of the legend.",
- "legend.title.name": "Title",
- "legend.titlestyle.fill.description": "The color of the legend title.",
- "legend.titlestyle.fill.name": "Title color",
- "legend.titlestyle.font.description": "The font properties of the legend title.",
- "legend.titlestyle.font.name": "Title font",
- "legend.titlestyle.fontfamily.description": "The font family of the legend title.",
- "legend.titlestyle.fontfamily.name": "Title font family",
- "legend.titlestyle.fontsize.description": "The font size of the legend title.",
- "legend.titlestyle.fontsize.name": "Title font size",
- "map.description": "Map charts use a map to show data.",
- "map.falseLabe.dropLabels": "Keep",
- "map.falseLabel.bubbleLegend": "Hide",
- "map.falseLabel.display": "Hide",
- "map.falseLabel.flash": "No flash",
- "map.falseLabel.labels": "Hide",
- "map.falseLabel.sizeLegend": "Hide",
- "map.label": "Map",
- "map.projection.description": "The Map projection type.",
- "map.projection.name": "Map projection",
- "map.projection.options.albers": "Albers",
- "map.projection.options.albersUsa": "Albers Usa",
- "map.projection.options.equirectangular": "Equirectangular",
- "map.projection.options.mercator": "Mercator",
- "map.projection.options.stereoGraphic": "stereoGraphic",
- "map.projection.options.winkelTriple": "winkelTriple",
- "map.propertyPresentation.advanced.latlongProperties.description": "Latitude/Longitude layer properties",
- "map.propertyPresentation.advanced.latlongProperties.label": "Latitude/Longitude",
- "map.propertyPresentation.advanced.mapSpecificProperties.description": "Map-specific properties",
- "map.propertyPresentation.advanced.mapSpecificProperties.label": "Map",
- "map.propertyPresentation.advanced.pointProperties.description": "Point layer properties",
- "map.propertyPresentation.advanced.pointProperties.label": "Points",
- "map.propertyPresentation.advanced.regionProperties.description": "Region layer properties",
- "map.propertyPresentation.advanced.regionProperties.label": "Regions",
- "map.trueLabel.bubbleLegend": "Show",
- "map.trueLabel.display": "Show",
- "map.trueLabel.dropLabels": "Drop",
- "map.trueLabel.flash": "Flash",
- "map.trueLabel.labels": "Show",
- "map.trueLabel.sizeLegend": "Show",
- "mapData.description": "The map data which should be used mapping data to geo",
- "mapData.items": "The smartermap items",
- "mapData.name": "Map data",
- "max.bubble.size.descirption": "The maximum radius of a bubble, in pixels.",
- "max.bubble.size.description": "The maximum size of the bubble.",
- "max.bubble.size.name": "Maximum bubble size",
- "max.latlong.size.description": "Maximum radius for points drawn on the tiled map. CSS length. Percentages based on the chart width.",
- "max.latlong.size.name": "Maximum point size",
- "max.point.size.description": "Maximum radius for points drawn on the tiled map. CSS length. Percentages based on the chart width.",
- "max.point.size.name": "Maximum point size",
- "max.zoom.description": "The maximum level of zoom that is allowed.",
- "max.zoom.name": "Maximum zoom level",
- "min.bubble.size.descirption": "The minimum radius of a bubble, in pixels.",
- "min.bubble.size.description": "The minimum size of the bubble.",
- "min.bubble.size.name": "Minimum bubble size",
- "min.latlong.size.description": "Minimum radius for points drawn on the tiled map. CSS length. Percentages based on the chart width.",
- "min.latlong.size.name": "Minimum point size",
- "min.point.size.description": "Minimum radius for points drawn on the tiled map. CSS length. Percentages based on the chart width.",
- "min.point.size.name": "Minimum point size",
- "pan.x.description": "When set to Yes, pans along the X-axis. When set to No, a Euler rotation is performed along the X-axis.",
- "pan.x.name": "Pan along the X-axis",
- "pan.y.description": "When set to Yes, pans along the Y-axis. When set to No, a Euler rotation is performed along the Y-axis.",
- "pan.y.name": "Pan along the Y-axis",
- "point.label.color.description": "The color of the point labels.",
- "point.label.color.name": "Point label color",
- "point.label.font.description": "The font of the point labels.",
- "point.label.font.name": "Point label font",
- "point.label.size.description": "The size of the point labels.",
- "point.label.size.name": "Point label size",
- "propertyPresentation.advanced.axisSizeProperties.description": "Axis size properties.",
- "propertyPresentation.advanced.axisSizeProperties.label": "Axis size",
- "propertyPresentation.advanced.clientBehaviorProperties.description": "Client side properties.",
- "propertyPresentation.advanced.clientBehaviorProperties.label": "Client behavior",
- "propertyPresentation.advanced.commonProperties.description": "Common properties.",
- "propertyPresentation.advanced.commonProperties.label": "Common",
- "propertyPresentation.advanced.description": "Advanced list of all properties in a grouped structure.",
- "propertyPresentation.advanced.label": "Advanced",
- "propertyPresentation.advanced.labelProperties.description": "Label properties",
- "propertyPresentation.advanced.labelProperties.label": "Label",
- "propertyPresentation.advanced.legendProperties.description": "Legend properties.",
- "propertyPresentation.advanced.legendProperties.label": "Legend",
- "propertyPresentation.advanced.xAxisProperties.description": "X-axis properties.",
- "propertyPresentation.advanced.xAxisProperties.label": "X-axis",
- "propertyPresentation.advanced.yAxisProperties.description": "Y-axis properties.",
- "propertyPresentation.advanced.yAxisProperties.label": "Y-axis",
- "propertyPresentation.sample.description": "Properties, logically organised by their relevance, for use on the sample page.",
- "propertyPresentation.sample.global.description": "Global properties.",
- "propertyPresentation.sample.global.label": "Global",
- "propertyPresentation.sample.label": "Sample properties",
- "propertyPresentation.sample.latlong.description": "Latitude/Longitude related properties",
- "propertyPresentation.sample.latlong.label": "Latitude/Longitude",
- "propertyPresentation.sample.layout.description": "Layout related properties",
- "propertyPresentation.sample.layout.label": "Layout",
- "propertyPresentation.sample.legend.description": "Layout related properties",
- "propertyPresentation.sample.legend.label": "Legend",
- "propertyPresentation.sample.point.description": "Point related properties",
- "propertyPresentation.sample.point.label": "Point",
- "propertyPresentation.sample.region.description": "Region related properties",
- "propertyPresentation.sample.region.label": "Region",
- "propertyPresentation.simple.description": "Simple list of the most common properties.",
- "propertyPresentation.simple.label": "Simple",
- "rave2.colorpalette.blueContinuousSequential.description": "Blue continuous sequential description",
- "rave2.colorpalette.blueContinuousSequential.label": "Blue continuous sequential",
- "rave2.colorpalette.blueDiscreteSequential.description": "Blue discrete sequential description",
- "rave2.colorpalette.blueDiscreteSequential.label": "Blue discrete sequential",
- "rave2.colorpalette.blueGreenContinuousDivergent.description": "Blue green continuous divergent description",
- "rave2.colorpalette.blueGreenContinuousDivergent.label": "Blue green continuous divergent",
- "rave2.colorpalette.blueGreenDiscreteDivergent.description": "Blue green discrete divergent description",
- "rave2.colorpalette.blueGreenDiscreteDivergent.label": "Blue green discrete divergent",
- "rave2.colorpalette.dark.description": "Dark description",
- "rave2.colorpalette.dark.label": "Dark",
- "rave2.colorpalette.financial.description": "Financial description",
- "rave2.colorpalette.financial.label": "Financial",
- "rave2.colorpalette.greenContinuousSequential.description": "Green continuous sequential description",
- "rave2.colorpalette.greenContinuousSequential.label": "Green continuous sequential",
- "rave2.colorpalette.greenDiscreteSequential.description": "Green discrete sequential description",
- "rave2.colorpalette.greenDiscreteSequential.label": "Green discrete sequential",
- "rave2.colorpalette.light.description": "Light description",
- "rave2.colorpalette.light.label": "Light",
- "rave2.colorpalette.medical.description": "Medical description",
- "rave2.colorpalette.medical.label": "Medical",
- "rave2.colorpalette.orangeContinuousSequential.description": "Orange continuous sequential description",
- "rave2.colorpalette.orangeContinuousSequential.label": "Orange continuous sequential",
- "rave2.colorpalette.orangeDiscreteSequential.description": "Orange discrete sequential description",
- "rave2.colorpalette.orangeDiscreteSequential.label": " Orange discrete sequential",
- "rave2.colorpalette.purpleContinuousSequential.description": "Purple continuous sequential description",
- "rave2.colorpalette.purpleContinuousSequential.label": "Purple continuous sequential",
- "rave2.colorpalette.purpleDiscreteSequential.description": "Purple discrete sequential description",
- "rave2.colorpalette.purpleDiscreteSequential.label": "Purple discrete sequential",
- "rave2.colorpalette.redBlueContinuousDivergent.description": "Red blue continuous divergent description",
- "rave2.colorpalette.redBlueContinuousDivergent.label": "Red blue continuous divergent",
- "rave2.colorpalette.redBlueDiscreteDivergent.description": "Red blue discrete divergent description",
- "rave2.colorpalette.redBlueDiscreteDivergent.label": "Red blue discrete divergent",
- "rave2.colorpalette.redBlueInverseContinuousDivergent.description": "Red blue inverse continuous divergent description",
- "rave2.colorpalette.redBlueInverseContinuousDivergent.label": "Red blue inverse continuous divergent",
- "rave2.colorpalette.redBlueInverseDiscreteDivergent.description": "Red blue inverse discrete divergent description",
- "rave2.colorpalette.redBlueInverseDiscreteDivergent.label": "Red blue inverse discrete divergent",
- "rave2.colorpalette.redContinuousSequential.description": "Red continuous sequential description",
- "rave2.colorpalette.redContinuousSequential.label": "Red continuous sequential",
- "rave2.colorpalette.redDiscreteSequential.description": "Red discrete sequential description",
- "rave2.colorpalette.redDiscreteSequential.label": " Red discrete sequential",
- "rave2.colorpalette.redGreenContinuousDivergent.description": "Red green continuous divergent description",
- "rave2.colorpalette.redGreenContinuousDivergent.label": "Red green continuous divergent",
- "rave2.colorpalette.redGreenDiscreteDivergent.description": "Red green discrete divergent description",
- "rave2.colorpalette.redGreenDiscreteDivergent.label": "Red green discrete divergent",
- "rave2.colorpalette.redGreenInverseContinuousDivergent.description": "Red green inverse continuous divergent description",
- "rave2.colorpalette.redGreenInverseContinuousDivergent.label": "Red green inverse continuous divergent",
- "rave2.colorpalette.redGreenInverseDiscreteDivergent.description": "Red green inverse discrete divergent description",
- "rave2.colorpalette.redGreenInverseDiscreteDivergent.label": "Red green inverse discrete divergent",
- "rave2.colorpalette.tealContinuousSequential.description": "Teal continuous sequential description",
- "rave2.colorpalette.tealContinuousSequential.label": "Teal continuous sequential",
- "rave2.colorpalette.tealDiscreteSequential.description": "Teal discrete sequential description",
- "rave2.colorpalette.tealDiscreteSequential.label": "Teal discrete sequential",
- "rave2.colorpalette.tealPurpleContinuousDivergent.description": "Teal purple continuous divergent description",
- "rave2.colorpalette.tealPurpleContinuousDivergent.label": "Teal purple continuous divergent",
- "rave2.colorpalette.tealPurpleDiscreteDivergent.description": "Teal purple discrete divergent description",
- "rave2.colorpalette.tealPurpleDiscreteDivergent.label": "Teal purple discrete divergent",
- "rave2.colorpalette.violetContinuousSequential.description": "Violet continuous sequential description",
- "rave2.colorpalette.violetContinuousSequential.label": "Violet continuous sequential",
- "rave2.colorpalette.violetDiscreteSequential.description": "Violet discrete sequential description",
- "rave2.colorpalette.violetDiscreteSequential.label": "Violet discrete sequential",
- "rave2.colorpalette.yellowContinuousSequential.description": "Yellow continuous sequential description",
- "rave2.colorpalette.yellowContinuousSequential.label": "Yellow continuous sequential",
- "rave2.colorpalette.yellowDiscreteSequential.description": "Yellow discrete sequential description",
- "rave2.colorpalette.yellowDiscreteSequential.label": "Yellow discrete sequential",
- "region.animation.description": "The effect that is used to animate the initial region.",
- "region.animation.duration.description": "The duration of the initial region animation in ms.",
- "region.animation.duration.name": "Region animation duration",
- "region.animation.name": "Region animation",
- "region.animation.options.none": "None",
- "region.animation.options.transition": "Transition",
- "scale.description": "The default scale that is applied to the projection. The scale can have a null value. If null, the map automatically scales.",
- "scale.name": "Map base scale",
- "show.labels.description": "Shows or hides labels.",
- "show.labels.name": "Show labels",
- "static.latlong.zero.value.size.description": "Show zero values as points with a static radius instead of their logical scale.",
- "static.latlong.zero.value.size.name": "Static zero values point radius",
- "static.zero.value.size.description": "Show zero values as points with a static radius instead of their logical scale.",
- "static.zero.value.size.name": "Static zero values point radius",
- "tiledmap.autoZoom.description": "Indicates if the map should automatically zoom in to fit the specified data points.",
- "tiledmap.autoZoom.name": "Auto zoom",
- "tiledmap.config.tiledmap.description": "Interactive map for geospatial analytics. Use this visualization to perform geospatial analysis with fill and point maps.",
- "tiledmap.config.tiledmap.label": "Map",
- "tiledmap.description": "Interactive map for geospatial analytics. Use this visualization to perform geospatial analysis with fill and point maps.",
- "tiledmap.geoJson.description": "This geo json object will be used as the layer to be matched with any incoming location data.",
- "tiledmap.geoJson.name": "Geo Json Layer",
- "tiledmap.label": "Map",
- "tiledmap.mapLocale.description": "The locale used for rendering the labels on the map.",
- "tiledmap.mapLocale.name": "Map Locale",
- "tiledmap.maxZoom.description": "The maximum depth a map can be zoomed in to.",
- "tiledmap.maxZoom.name": "Maximum zoom depth",
- "tiledmap.style.description": "The visual appearance of the map",
- "tiledmap.style.name": "Style",
- "tiledmap.style.options.basic": "Basic",
- "tiledmap.style.options.bright": "Bright",
- "tiledmap.style.options.dark": "Dark",
- "tiledmap.style.options.light": "Light",
- "tiledmap.style.options.outdoors": "Outdoors",
- "tiledmap.style.options.satellite": "Satellite",
- "tiledmap.style.options.streets": "Streets",
- "tiledmap.token.description": "Access token to use any of Mapbox's tools, APIs, or SDKs",
- "tiledmap.token.name": "Access token",
- "transpose.description": "When set to Yes, the Y-axis shows the independent scale and the X-axis shows the dependent scale.",
- "transpose.name": "Switch X and Y axes"
- }
- },{}],3:[function(require,module,exports){
- var css = ".mapboxgl-map {\n font: 12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n.mapboxgl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n.mapboxgl-map:-webkit-full-screen {\n width: 100%;\n height: 100%;\n}\n.mapboxgl-canary {\n background-color: salmon;\n}\n.mapboxgl-canvas-container.mapboxgl-interactive,\n.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass {\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer {\n cursor: pointer;\n}\n.mapboxgl-canvas-container.mapboxgl-interactive:active,\n.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,\n.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas {\n touch-action: pan-x pan-y;\n}\n.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,\n.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas {\n touch-action: pinch-zoom;\n}\n.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,\n.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas {\n touch-action: none;\n}\n.mapboxgl-ctrl-bottom-left,\n.mapboxgl-ctrl-bottom-right,\n.mapboxgl-ctrl-top-left,\n.mapboxgl-ctrl-top-right {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n}\n.mapboxgl-ctrl-top-left {\n top: 0;\n left: 0;\n}\n.mapboxgl-ctrl-top-right {\n top: 0;\n right: 0;\n}\n.mapboxgl-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n}\n.mapboxgl-ctrl-bottom-right {\n right: 0;\n bottom: 0;\n}\n.mapboxgl-ctrl {\n clear: both;\n pointer-events: auto;\n transform: translate(0);\n}\n.mapboxgl-ctrl-top-left .mapboxgl-ctrl {\n margin: 10px 0 0 10px;\n float: left;\n}\n.mapboxgl-ctrl-top-right .mapboxgl-ctrl {\n margin: 10px 10px 0 0;\n float: right;\n}\n.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl {\n margin: 0 0 10px 10px;\n float: left;\n}\n.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl {\n margin: 0 10px 10px 0;\n float: right;\n}\n.mapboxgl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n.mapboxgl-ctrl-group:not(:empty) {\n -moz-box-shadow: 0 0 2px rgba(0,0,0,.1);\n -webkit-box-shadow: 0 0 2px rgba(0,0,0,.1);\n box-shadow: 0 0 0 2px rgba(0,0,0,.1);\n}\n@media (-ms-high-contrast:active) {\n .mapboxgl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n.mapboxgl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n.mapboxgl-ctrl-group button+button {\n border-top: 1px solid #ddd;\n}\n.mapboxgl-ctrl button .mapboxgl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: 50%;\n}\n@media (-ms-high-contrast:active) {\n .mapboxgl-ctrl-icon {\n background-color: transparent;\n }\n\n .mapboxgl-ctrl-group button+button {\n border-top: 1px solid ButtonText;\n }\n}\n.mapboxgl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n.mapboxgl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px #0096ff;\n}\n.mapboxgl-ctrl button:disabled {\n cursor: not-allowed;\n}\n.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon {\n opacity: .25;\n}\n.mapboxgl-ctrl button:not(:disabled):hover {\n background-color: rgba(0,0,0,.05);\n}\n.mapboxgl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px #0096ff;\n}\n.mapboxgl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n.mapboxgl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n.mapboxgl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n.mapboxgl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\");\n}\n@media (-ms-high-contrast:active) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\");\n }\n}\n@media (-ms-high-contrast:black-on-white) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E\");\n }\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\");\n}\n@media (-ms-high-contrast:active) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\");\n }\n}\n@media (-ms-high-contrast:black-on-white) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E\");\n }\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\");\n}\n@media (-ms-high-contrast:active) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E\");\n }\n}\n@media (-ms-high-contrast:black-on-white) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\");\n }\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\");\n}\n.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon {\n -webkit-animation: mapboxgl-spin 2s linear infinite;\n -moz-animation: mapboxgl-spin 2s infinite linear;\n -o-animation: mapboxgl-spin 2s infinite linear;\n -ms-animation: mapboxgl-spin 2s infinite linear;\n animation: mapboxgl-spin 2s linear infinite;\n}\n@media (-ms-high-contrast:active) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E\");\n }\n}\n@media (-ms-high-contrast:black-on-white) {\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\");\n }\n\n .mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon {\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E\");\n }\n}\n@-webkit-keyframes mapboxgl-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n\n to {\n -webkit-transform: rotate(1turn);\n }\n}\n@-moz-keyframes mapboxgl-spin {\n 0% {\n -moz-transform: rotate(0deg);\n }\n\n to {\n -moz-transform: rotate(1turn);\n }\n}\n@-o-keyframes mapboxgl-spin {\n 0% {\n -o-transform: rotate(0deg);\n }\n\n to {\n -o-transform: rotate(1turn);\n }\n}\n@-ms-keyframes mapboxgl-spin {\n 0% {\n -ms-transform: rotate(0deg);\n }\n\n to {\n -ms-transform: rotate(1turn);\n }\n}\n@keyframes mapboxgl-spin {\n 0% {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(1turn);\n }\n}\na.mapboxgl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E\")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:0;margin:10px;position:relative;background-color:#fff;border-radius:3px 12px 12px 3px}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 24px 2px 4px;visibility:visible;margin-top:6px}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 4px 2px 24px;border-radius:12px 3px 3px 12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact:after{content:\"\";cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgba(0,0,0,.35);\n}\n@-webkit-keyframes mapboxgl-user-location-dot-pulse {\n 0% {\n -webkit-transform: scale(1);\n opacity: 1;\n }\n\n 70% {\n -webkit-transform: scale(3);\n opacity: 0;\n }\n\n to {\n -webkit-transform: scale(1);\n opacity: 0;\n }\n}\n@-ms-keyframes mapboxgl-user-location-dot-pulse {\n 0% {\n -ms-transform: scale(1);\n opacity: 1;\n }\n\n 70% {\n -ms-transform: scale(3);\n opacity: 0;\n }\n\n to {\n -ms-transform: scale(1);\n opacity: 0;\n }\n}\n@keyframes mapboxgl-user-location-dot-pulse {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n\n 70% {\n transform: scale(3);\n opacity: 0;\n }\n\n to {\n transform: scale(1);\n opacity: 0;\n }\n}\n.mapboxgl-user-location-dot-stale {\n background-color: #aaa;\n}\n.mapboxgl-user-location-dot-stale:after {\n display: none;\n}\n.mapboxgl-user-location-accuracy-circle {\n background-color: rgba(29,161,242,.2);\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n.mapboxgl-crosshair,\n.mapboxgl-crosshair .mapboxgl-interactive,\n.mapboxgl-crosshair .mapboxgl-interactive:active {\n cursor: crosshair;\n}\n.mapboxgl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: .5;\n}\n@media print {\n .mapbox-improve-map {\n display: none;\n }\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-tiledmapV2/node/rave-library-tiledmapV2/mapbox-gl.css"})); module.exports = css;
- },{"browserify-css":7}],4:[function(require,module,exports){
- (function() {
- var $ = {};
- // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModuleHeader
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2015
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- var com_ibm_rave_library_Library = rave["library"];
- rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
- rave["internal"]["CSSUtil"]= rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
- // $source: com/ibm/rave/bundles/RaveBundle
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader (runtime) // new
- /**
- * A RaveBundle extends the regular Bundle abstract class but includes common functionality for Rave-made bundles that aren't for general use.
- */
- var com_ibm_rave_bundles_RaveBundle = rave['internal']['Declare'](rave['library']['internal']['Bundle'], {
- /** @expose */
- loader : null,
- /** @expose */
- constructor : function() {
- ;
- ;
- ;
- ;
- ;
- ;
- this.loader = new com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader("/com/ibm/rave/bundles/" + this.getName());
- },
- /**
- * Load extra resources required for this bundle. Currently the compiled configuration.json file. And .css.
- */
- /** @expose */
- loadResources : function() {
- this.setMessageCatalog(rave['library']['internal']['Bundle'].DEFAULT_LOCALE, require("./i18n/messages_en.json"));
- var array = require("./configuration/configuration.json");
- if (array) {
- for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var artifact = __exp_enFor0[__i_enFor0];
- this.initialize(artifact);
- }
- }
- require("./vizlibrary.css");
- }
- });
- //com_ibm_rave_bundles_RaveBundle.CONFIGURATION_FILE = "./configuration/configuration.json";
- // $source: com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader
- // Intentionally empty - everything in this file is inlined
- var com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader = function(){};
- // $source: com/ibm/rave/bundles/views/BundleView
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BackgroundComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/ChartLayoutComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/LegendsManager (runtime) // new
- //@import com/ibm/rave/bundles/components/AxesManager (runtime) // new
- //@import com/ibm/rave/library/Library (runtime) // Library
- //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities
- //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
- //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
- //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
- var com_ibm_rave_bundles_views_BundleView = rave['internal']['Declare'](rave['library']['internal']['AbstractView'], {
- /**
- * Background component
- */
- /** @expose */
- _backgroundComponent : null,
- /**
- * Layout component
- */
- /** @expose */
- _layoutComponent : null,
- /**
- * Clip component
- */
- /** @expose */
- _clip : null,
- /**
- * Axes manager
- */
- /** @expose */
- _axes : null,
- /**
- * Legends manager
- */
- /** @expose */
- _legends : null,
- //_groupStructure : null,
- /** @expose */
- _chart : null,
- /** @expose */
- dataModel : null,
- /** @expose */
- _zoomP : null,
- /** @expose */
- _zoomS : null,
- /** @expose */
- constructor : function(context) {
- },
- /** @expose */
- getGroupStructure : function() {},
- /** @expose */
- setup : function() {
- rave['library']['internal']['AbstractView'].prototype.setup.call(this);
- this._backgroundComponent = new com_ibm_rave_bundles_components_BackgroundComponentImpl();
- this._layoutComponent = new com_ibm_rave_bundles_components_ChartLayoutComponentImpl();
- this._clip = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this.context.instanceId() + "clipViewport");
- if (this.isZoomSupported()) {
- this.resetZoom();
- }
- this._legends = new com_ibm_rave_bundles_components_LegendsManager(this.context, this.getLegendCount());
- if (this.isAxesManagerRequired()) {
- this._axes = new com_ibm_rave_bundles_components_AxesManager(this.context);
- }
- this._groupStructure = this.getGroupStructure();
- },
- /** @expose */
- preDraw : function(chartId) {
- this.cancelTransitions();
- rave['library']['internal']['AbstractView'].createGroupStructure(this.context.node, this._groupStructure);
- this._chart = this.context.node.selectAll(chartId);
- },
- /** @expose */
- resetZoom : function() {
- this._zoomP = [0, 0, 0, 0];
- this._zoomS = [1, 1, 1, 1];
- },
- /** @expose */
- validateDataModel : function(elementsToRemove) {
- if (elementsToRemove !== null || arguments.length > 1){
- elementsToRemove = Array.prototype.slice.call(arguments);
- }
- {
- this.dataModel = this.context.dataModel();
- if (!(this.dataValid())) {
- for (var __i_enFor0 = 0, __len_enFor0 = elementsToRemove.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var e = elementsToRemove[__i_enFor0];
- this._chart.selectAll(e).selectAll("*").remove();
- }
- this._legends.visible(false).draw();
- return false;
- }
- return true;
- }
- },
- /** @expose */
- dataValid : function() {
- return this.dataModel.validate();
- },
- /** @expose */
- getLegendCount : function() {
- return 1;
- },
- /** @expose */
- isAxesManagerRequired : function() {
- return false;
- },
- /** @expose */
- isZoomSupported : function() {
- return true;
- },
- /** @expose */
- getProperty : function(s) {
- return this.context.getPropertyValue(s);
- },
- /** @expose */
- getPropertyDefault : function(s) {
- return this.context.getPropertyDefault(s);
- },
- /** @expose */
- getBooleanProperty : function(s) {
- var obj = this.getProperty(s);
- return (obj);
- },
- /** @expose */
- getDoubleProperty : function(s) {
- var obj = this.getProperty(s);
- return + (obj);
- },
- /** @expose */
- getIntProperty : function(s) {
- var obj = this.getProperty(s);
- return ~~ (obj);
- },
- /**
- * @param (String) id Property ID
- * @return (String) Property value as a string
- */
- /** @expose */
- getStringProperty : function(id) {
- var obj = this.getProperty(id);
- return (obj == null) ? null : ""+(obj);
- },
- /**
- * @param (String) id Property ID
- * @return (String) Property value as a string, returning null for the empty string
- */
- /** @expose */
- getStringPropertyEmptyAsNull : function(id) {
- var s = this.getStringProperty(id);
- return (s == null || s.length == 0) ? null : s;
- },
- /**
- * @param (String) id Property ID
- * @return (Number) Property value as a string, containing size as the number of pixels
- */
- /** @expose */
- getCSSSizeToPixelNumber : function(id) {
- var cssSize = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.context.getPropertyValue(id), 100.0, 10.0);
- return (cssSize == null) ? 0.0 : cssSize;
- },
- /**
- * Based on effect duration and effect property, determine the effect duration in ms.
- * @param (String) effect Effect name, one of the options available from EFFECT_OPTIONS.
- * @return (int) Effect duration in ms.
- */
- /** @expose */
- getEffectDuration : function(effect) {
- var duration = this.getIntProperty("effect.duration");
- if ((duration < 0) || (effect == null) || "none" == effect) {
- duration = 0;
- }
- return duration;
- },
- /** @expose */
- getTopPadding : function() {
- return this.getProperty("layout.chart.padding.top");
- },
- /** @expose */
- getLeftPadding : function() {
- return this.getProperty("layout.chart.padding.left");
- },
- /** @expose */
- getBottomPadding : function() {
- return this.getProperty("layout.chart.padding.bottom");
- },
- /** @expose */
- getRightPadding : function() {
- return this.getProperty("layout.chart.padding.right");
- },
- /** @expose */
- getLayoutPadding : function() {
- return this.getProperty("layout.padding");
- },
- /** @expose */
- getLegendChartGap : function() {
- return this.getProperty("layout.legendchart.gap");
- },
- /** @expose */
- getLegendChartAlign : function() {
- return this.getBooleanProperty("layout.legendchart.align");
- },
- /** @expose */
- getLegendPosition : function() {
- return this.getStringProperty("legend.position");
- },
- getPalette$0 : function() {
- return this.getPalette$1("color.palette");
- },
- getPalette$1 : function(paletteID) {
- var id = this.getStringProperty(paletteID);
- var colorPalette = com_ibm_rave_library_Library.palettes.getPalette(id);
- return (!colorPalette) ? com_ibm_rave_library_Library.palettes.getDefaultPalette() : colorPalette;
- },
- getDynamicPalette$0 : function() {
- return this.getDynamicPalette$1("color.palette", "color.dynamicPalette.min", "color.dynamicPalette.mid", "color.dynamicPalette.max");
- },
- /**
- * Get a palette. If the fills array is non-null, has at least two entries, and all entries are non-null and non-"", a continuous normalized palette will be created using the fill values as stops. For example if the fills array is ["red","white","green"], the palette will have stops at 0.0 red, 0.5 white, 1.0 green. Otherwise the paletteID is looked up in Library.palettes and returned. If the paletteID is not found, the default palette is returned.
- * @param (String) paletteID The palette ID
- * @return (rave['library']['internal']['Palette']) Palette
- */
- getDynamicPalette$1 : function(paletteID, minId, midId, maxId) {
- var colorPalette;
- var min = this.getStringProperty(minId);
- if (min != null) {
- var mid = this.getStringProperty(midId);
- if (mid != null) {
- var max = this.getStringProperty(maxId);
- if (max != null) {
- var fills = [min, mid, max];
- colorPalette = rave['library']['internal']['AbstractView'].getFillPalette(fills);
- }
- }
- }
- return (!colorPalette) ? this.getPalette(paletteID) : colorPalette;
- },
- /** @expose */
- prepareLayoutComponent : function() {
- this._layoutComponent.setPreExecute(this.context.getPreExecute()).overall(new rave['internal']['RectStruct'](0, 0, this.context.size.w, this.context.size.h)).legendPosition(this.getLegendPosition()).padding(this.getLayoutPadding()).chartPadding(this.getTopPadding(), this.getLeftPadding(), this.getBottomPadding(), this.getRightPadding()).legendChartGap(this.getLegendChartGap()).legendChartAlign(this.getLegendChartAlign());
- },
- /** @expose */
- prepareLayoutSizables : function(layoutComponent, useX2, useY1, useX1, useY2, useLegend) {
- layoutComponent.removeAxisSizables();
- if (useX1) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(0));
- }
- if (useY1) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(2));
- }
- if (useX2) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(1));
- }
- if (useY2) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(3));
- }
- layoutComponent.legendSize(useLegend ? this._legends : null);
- },
- /** @expose */
- resetUpdate : function() {
- this.updateType = 4;
- },
- /** @expose */
- isUpdateNothing : function() {
- return this.updateType == 4;
- },
- /** @expose */
- isShowLegend : function() {
- return this.getBooleanProperty("legend.display");
- },
- cancelTransitions : function() {
- this.context.node.selectAll("*").interrupt();
- },
- /** @expose */
- setBackgroundProperties : function(elementRect, duration) {
- this._backgroundComponent.setPreExecute(this.context.getPreExecute()).size(this.context.size).backgroundColor(this.getStringProperty("background.chart.color"));
- this.context.node.selectAll("rect.background.chart").transition().duration(duration).call(this._backgroundComponent);
- this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(elementRect).backgroundColor(this.getStringProperty("background.elements.color"));
- this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
- },
- /** @expose */
- isShowDataLabels : function() {
- return this.getBooleanProperty("data.label.display");
- },
- /** @expose */
- isShowDataLabelsAsPercentageOfColor : function() {
- var dataLabel = this.getStringProperty("data.label.type");
- return "PercentOfColor" == dataLabel;
- },
- /** @expose */
- isShowDataLabelsAsPercentageOfCategory : function() {
- var dataLabel = this.getStringProperty("data.label.type");
- return "PercentOfCategory" == dataLabel;
- },
- /** @expose */
- getlDataLabelAccessor : function(dataSet, slot, isInterval) {
- var labelAccessor;
- var labelEntry = dataSet.slot(slot).entry();
- if (!labelEntry) {
- if (this.isShowDataLabelsAsPercentageOfCategory()) {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR;
- } else if (this.isShowDataLabelsAsPercentageOfColor()) {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR;
- } else {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR;
- }
- } else {
- labelAccessor = rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelEntry));
- }
- return labelAccessor;
- },
- /** @expose */
- getEntryForDataLabelFormatter : function(dataSet, labelSlot, defaultSlot) {
- var labelEntry = dataSet.slot(labelSlot).entry();
- return labelEntry ? labelEntry : dataSet.slot(defaultSlot).entry();
- },
- /** @expose */
- getBackgroundConstrastLabelStyle : function() {
- var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
- if (this.getBooleanProperty("contrast.label.color") == false) {
- return labelFontStyle;
- }
- var defaultFillColor;
- if (labelFontStyle) {
- defaultFillColor = labelFontStyle["fill"];
- if (defaultFillColor == null) {
- defaultFillColor = labelFontStyle["color"];
- }
- } else {
- labelFontStyle = {};
- }
- if (defaultFillColor == null) {
- defaultFillColor = "#000000";
- }
- labelFontStyle["fill"] = com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(this.getStringProperty("background.elements.color"), defaultFillColor);
- return labelFontStyle;
- },
- /** @expose */
- getPalette : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.getPalette$0();
- }
- if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
- return this.getPalette$1(a0);
- }
- return rave['library']['internal']['AbstractView'].prototype.getPalette.apply(this, args);
- },
- /** @expose */
- getDynamicPalette : function(a0, a1, a2, a3) {
- var args = arguments;
- if (args.length == 0) {
- return this.getDynamicPalette$0();
- }
- return this.getDynamicPalette$1(a0, a1, a2, a3);
- }
- });
- // $source: com/ibm/rave/bundles/components/BundleComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_components_BundleComponentImpl = rave['internal']['Declare']({
- /**
- * The pre-execution callback.
- */
- //_preExecuteCallback : null,
- /**
- * The render callback.
- */
- /** @expose */
- _renderCallback : null,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var self = _$self;
- this.each(function(data, index, groupIndex) {
- self.execute(rave.select(this));
- });
- return null;
- }
- };
- return _$self;
- },
- /**
- * Execute the component logic. In general, the execute function will append, modify, and/or remove items contained in the provided selector (g). There are no set rules regarding what the execute function can or can not do. However, it is extremely bad form if a component modifies and/or removes items created by another component.
- * @param (rave['internal']['Selector']) g <g> node that this component will be applied to.
- */
- /** @expose */
- execute : function(g) {},
- /**
- * Set the pre-execute callback for this component.
- * @param (rave['library']['internal']['ComponentCallback']) callback The callback
- */
- /** @expose */
- setPreExecute : function(callback) {
- this._preExecuteCallback = callback;
- return this;
- },
- /**
- * If the pre-execute component is non-null, call it with this object. Note that this object must also implement BundleComponent.
- */
- /** @expose */
- preExecute : function() {
- if (this._preExecuteCallback) {
- this._preExecuteCallback(this);
- }
- },
- /**
- * Set the render callback for this component.
- * @param (rave['internal']['RunFunction']) callback The callback
- */
- /** @expose */
- setRenderCallback : function(callback) {
- this._renderCallback = callback;
- return this;
- },
- /**
- * Abstract method for Swift translation purposes. Swift does not support abstract classes, so translator generates a non-abstract class. By adding the following 'abstract' method, Swift class will satisfy interface requirements.
- */
- /** @expose */
- type : function() {},
- /** @expose */
- updateBorder : function(s, borderWidth, borderColor) {
- if (borderWidth != null) {
- s.each(function(data, index, groupIndex) {
- if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
- this.rave_setStyle("stroke-width", borderWidth, "");
- }
- });
- }
- if (borderColor != null) {
- s.each(function(data, index, groupIndex) {
- if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
- this.rave_setStyle("stroke", borderColor, "");
- }
- });
- }
- },
- /** @expose */
- getDefaultLabelColor : function(_labelStyle) {
- if (!_labelStyle) {
- return "#000000";
- }
- var defaultFillColor;
- if (_labelStyle) {
- defaultFillColor = _labelStyle["fill"];
- if (defaultFillColor == null) {
- defaultFillColor = _labelStyle["color"];
- }
- }
- if (defaultFillColor == null) {
- defaultFillColor = "#000000";
- }
- return defaultFillColor.toString();
- }
- });
- // $source: com/ibm/rave/bundles/component/BackgroundComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders the background to the chart. The {@link #this.type()} method returns "BackgroundComponent". </p>
- */
- var com_ibm_rave_bundles_component_BackgroundComponent = rave['internal']['Declare'].implement(
- /**
- * Get the background color.
- * @return (String) The background color
- */
- //backgroundColor : function() {},
- /**
- * Set the background color. If the color is null, white is used.
- * @param (String) backgroundColor The new background color
- * @return (com.ibm.rave.bundles.component.BackgroundComponent) This object
- */
- //backgroundColor : function(backgroundColor) {}
- );
- /**
- * The string returned by {@link #this.type()} is "BackgroundComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE = "BackgroundComponent";
- // $source: com/ibm/rave/bundles/component/ChartLayoutComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that does the layout for a bundle chart. The {@link #this.type()} method returned "ChartLayoutComponent". </p> <h3>Layout Properties</h3> <p> Chart layout is controlled by the following properties: </p> <ul> <li>The padding: a string containing up to 4 CSS sizes for left, top, right, bottom padding (eg. "padding-left:10px;padding-top:10%").</li> <li>The legend chart gap: a single CSS size.</li> <li>The legends position: a string, one of "top", "bottom", "left", or "right".</li> <li>The legends size: a {@link (com.ibm.rave.bundles.component.ChartLayoutSizable) ChartLayoutSizable} .</li> <li>The four axis sizes for top, bottom, left, and right: each a {@link (com.ibm.rave.bundles.component.ChartLayoutSizable) ChartLayoutSizable} .</li> </ul>
- */
- var com_ibm_rave_bundles_component_ChartLayoutComponent = rave['internal']['Declare'].implement(
- //padding : function() {},
- //topPadding : function() {},
- //leftPadding : function() {},
- //bottomPadding : function() {},
- //rightPadding : function() {},
- //legendChartAlign : function() {},
- //legendPosition : function() {},
- //legendChartGap : function() {},
- //legendPosition : function(position) {},
- //topPadding : function(value) {},
- //leftPadding : function(value) {},
- //bottomPadding : function(value) {},
- //rightPadding : function(value) {},
- /**
- * Sets the padding around the outside of the chart/legend.
- * @param (Object) value a string containing up to 4 CSS sizes for left, top, right, bottom padding (eg. "padding-left:10px;padding-top:10%"). Null is treated as 0.
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //padding : function(value) {},
- /**
- * Sets all chart paddings. Null values are treated as 0.
- * @param (Object) top New top padding
- * @param (Object) left New left padding
- * @param (Object) bottom New bottom padding
- * @param (Object) right New right padding
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- * @deprecated Please use {@link #this.padding(Object)} and {@link #this.legendChartGap(Object)}
- */
- //chartPadding : function(top, left, bottom, right) {},
- /**
- * Sets whether the legend should align with the chart "body".
- * @param (boolean) legendChartAlign the boolean state
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //legendChartAlign : function(legendChartAlign) {},
- /**
- * Set the space for the gap between chart and legend
- * @param (Object) value the gap distance (css length)
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //legendChartGap : function(value) {},
- /**
- * Set the size information for the legend. Null value is treated as no visible legend.
- * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //legendSize : function(sizable) {},
- /**
- * Reset list of axis sizables to 0
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //removeAxisSizables : function() {},
- /**
- * Add an axis to be considered in layout operation.
- * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //addAxisSizable : function(sizable) {}
- );
- /**
- * The string returned by {@link #this.type()} is "ChartLayoutComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE = "ChartLayoutComponent";
- // $source: com/ibm/rave/bundles/components/LegendsManager
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/LegendComponentImpl (runtime) // new, orientationOf
- /**
- * <p> Manages one or more legend components for a bundle. The number of legends N is fixed and declared in the constructor, and legends are identified by an array index number between 0 and N-1. (For now we don't need a dynamic collection, especially since we're generating the chart structure statically and each legend gets its own <g&;gt; node. If a chart sometimes needs one legend and sometimes two, it will create two nodes and construct the manager for two legends.) </p> <p> The manager has the following properties: </p> <ul> <li> A global visibility flag. If false, the legends are not drawn (all shapes are cleared from the groups). </li> <li> A rectangle in which the legends are positioned. If a bundle wants (for example) some legends on the left and some on the right of a chart, it should create two LegendsManagers. </li> <li> An orientation, either "horizontal" or "vertical" (the default). </li> <li> Whether to use a transition, and if so the transition duration. </li> <li> The pre-execute component callback. </li> </ul> <p> Each legend has the following properties: </p> <ul> <li> A group (<g> node) selector into which it draws. For correct behavior this should always be non-null and select the same chart group, since the legend is responsible for removing shapes when it is not shown. This should be an ordinary selector, not a transition. </li> <li> A color palette. If the palette is null the legend is not visible. </li> <li> A swatch shape. If null, square is used. This only applies to swatch legends. </li> <li> A title. If null the legend has no title. </li> <li> A custom formatter for the labels. If null the default format is used. </li> </ul> <p> The general pattern of use is to create the LegendsManager in the view's constructor or setup method, allocating the maximum number of legends that will ever be needed. The chart structure will have corresponding <g> nodes, and in the view's draw method all the legend selectors are set to the corresponding group. The legend palettes, titles, and formatters will usually be set next, making sure to set the palettes of any unused legends to null, and {@link #this.anyVisible()} used to find if any rectangles need to be drawn so the overall chart may be laid out. The rectangle, orientation, and transition information can then be set and {@link #this.draw()} called. </p> <p> The visible legends (those with palettes) divide the rectangle equally along the orientation. For example if there are three legends in horizontal orientation and two are visible, they will split the rectangle vertically in half. Legends are drawn left-to-right for horizontal orientation, and top-to-bottom for vertical orientation, in index order. </p> <p> If a transition is requested and the duration is non-negative, a transition is created from the legend's selector; otherwise the selector is used. However, in order to give a somewhat better appearance, a transition is <I>not</I> used if the legend was not visible (no shapes rendered) the last time it was drawn. </p>
- */
- var com_ibm_rave_bundles_components_LegendsManager = rave['internal']['Declare']({
- /**
- * Bundle context
- */
- //_context : null,
- /**
- * Component used to draw all legends
- */
- //_comp : null,
- /**
- * Global visibility; if false no legends are drawn
- */
- //_visible : null,
- /**
- * Rectangle containing all legends
- */
- //_rectangle : null,
- /**
- * Legend orientation
- */
- //_orient : null,
- /**
- * Pre-execute component callback
- */
- //_preExecute : null,
- /**
- * Selectors for each legend
- */
- //_selectors : null,
- /**
- * Palettes for each legend
- */
- //_palettes : null,
- /**
- * Scale size functions for each legend
- */
- //_scale : null,
- /**
- * Swatch size functions for each legend
- */
- //_swatchSizes : null,
- /**
- * Shapes for each legend
- */
- //_shapes : null,
- /**
- * Titles for each legend
- */
- //_titles : null,
- /**
- * Title fonts for each legend
- */
- //_titleFonts : null,
- /**
- * Title fills for each legend
- */
- //_titleFills : null,
- /**
- * Title font sizes for each legend
- */
- //_titleFontSizes : null,
- /**
- * Title font families for each legend
- */
- //_titleFontFamilies : null,
- /**
- * Entry fonts for each legend
- */
- //_entryFonts : null,
- /**
- * Custom formatters for each legend, created from the registered custom formatters
- */
- //_formatters : null,
- /**
- * Whether each legend was visible in the last draw
- */
- //_lastVisible : null,
- //_dataSlotEntries : null,
- /**
- * Number of legends
- */
- _numLegends : 0,
- /**
- * Whether to use a transition.
- */
- _doTransition : false,
- /**
- * Duration of the transition.
- */
- _duration : 0,
- _spaceUsed : 0,
- /**
- * Construct the manager.
- * @param (int) numLegends Number of legends, must be positive
- */
- /** @expose */
- constructor : function(context, numLegends) {
- this._context = context;
- this._numLegends = numLegends;
- this._comp = new com_ibm_rave_bundles_components_LegendComponentImpl();
- this._rectangle = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._orient = "vertical";
- this._preExecute = null;
- this._selectors = [];
- this._palettes = [];
- this._scale = [];
- this._swatchSizes = [];
- this._shapes = [];
- this._titles = [];
- this._titleFonts = [];
- this._titleFills = [];
- this._titleFontSizes = [];
- this._titleFontFamilies = [];
- this._entryFonts = [];
- this._formatters = [];
- this._lastVisible = [];
- this._visible = [];
- this._dataSlotEntries = [];
- for (var i = 0; i < this._numLegends; ++i) {
- this._selectors[i] = null;
- this._palettes[i] = null;
- this._swatchSizes[i] = null;
- this._shapes[i] = null;
- this._titles[i] = null;
- this._formatters[i] = null;
- this._lastVisible[i] = false;
- this._visible[i] = true;
- }
- },
- /**
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) The legend component used by this manager; for unit tests
- */
- getLegendComponent : function() {
- return this._comp;
- },
- /**
- * Set a specific legend visible
- * @param (int) legendIndex The index of the legend
- * @param (boolean) visible New value of visible flag
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- visible$0 : function(legendIndex, visible) {
- if (legendIndex < this._visible.length) {
- this._visible[legendIndex] = visible;
- }
- return this;
- },
- /**
- * Set all legend visible
- * @param (boolean) visible New value of visible flag
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- visible$1 : function(visible) {
- for (var i = 0; i < this._visible.length; ++i) {
- this._visible[i] = visible;
- }
- return this;
- },
- /**
- * Set the layout rectangle. The rectangle is copied. If it is null, the layout rectangle is unchanged.
- * @param (rave['internal']['RectStruct']) rect New layout rectangle
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- rectangle : function(rect) {
- if (rect) {
- this._rectangle = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
- }
- return this;
- },
- /**
- * Set the orient property. If the argument is not "horizontal" or "vertical", the orient property is not changed.
- * @param (String) orient New orient
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- orient : function(orient) {
- if ("horizontal" == orient || "vertical" == orient) {
- this._orient = orient;
- }
- return this;
- },
- /**
- * Set the orient property from a legend position. If the argument is "top" or "bottom", the orient is set to "horizontal". Otherwise it is set to "vertical".
- * @param (String) position Legend position
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- position : function(position) {
- return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
- },
- /**
- * Set the transition information. If the duration is negative, 0 is used.
- * @param (boolean) doTransition Whether to do a transition
- * @param (int) duration Duration of the transition when used
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- transition : function(doTransition, duration) {
- this._doTransition = doTransition;
- this._duration = (duration >= 0) ? duration : 0;
- return this;
- },
- /**
- * Set the pre-execute callback for all legends. The callback may be null.
- * @param (rave['library']['internal']['ComponentCallback']) callback The callback
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- setPreExecute : function(callback) {
- this._preExecute = callback;
- return this;
- },
- /**
- * Set the selector to be used when rendering a legend. If the index is out of range no selectors change.
- * @param (int) index Legend array index
- * @param (rave['internal']['Selector']) selector Selector, may be null (but this is not advisable)
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- selector : function(index, selector) {
- if (index >= 0 && index < this._numLegends) {
- this._selectors[index] = selector;
- }
- return this;
- },
- /**
- * Set the palette of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (rave['library']['internal']['Palette']) palette Palette, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- palette : function(index, palette) {
- if (index >= 0 && index < this._numLegends) {
- this._palettes[index] = palette;
- }
- return this;
- },
- /**
- * Set the shape of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) shape Shape, may be null (defaulting to square)
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- shape : function(index, shape) {
- if (index >= 0 && index < this._numLegends) {
- this._shapes[index] = shape;
- }
- return this;
- },
- /**
- * Set the title of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) title Title, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- title : function(index, title) {
- if (index >= 0 && index < this._numLegends) {
- this._titles[index] = title;
- }
- return this;
- },
- /**
- * Set the title font style of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFont Title font string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFont : function(index, titleFont) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFonts[index] = titleFont;
- }
- return this;
- },
- /**
- * Set the entry font style of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) entryFont Entry font string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- entryFont : function(index, entryFont) {
- if (index >= 0 && index < this._numLegends) {
- this._entryFonts[index] = entryFont;
- }
- return this;
- },
- /**
- * Set the title fill of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFill Fill color string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFill : function(index, titleFill) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFills[index] = titleFill;
- }
- return this;
- },
- /**
- * Set the title font size of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFontSize Font size string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFontSize : function(index, titleFontSize) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFontSizes[index] = titleFontSize;
- }
- return this;
- },
- /**
- * Set the title font family of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFontFamily Font family string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFontFamily : function(index, titleFontFamily) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFontFamilies[index] = titleFontFamily;
- }
- return this;
- },
- /**
- * Set the scale of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (rave['internal']['AbstractScale']) scale Scale, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- scale : function(index, scale) {
- if (index >= 0 && index < this._numLegends) {
- this._scale[index] = scale;
- }
- return this;
- },
- /**
- * Set the swatch size function of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (rave['internal']['ValueFunction']) swatchSize Swatch size function, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- swatchSize : function(index, swatchSize) {
- if (index >= 0 && index < this._numLegends) {
- this._swatchSizes[index] = swatchSize;
- }
- return this;
- },
- /**
- * Set the formatter for a legend. If the index is out of range no information is changed. The custom formatter is found using {@link this.BundleContext#this.getCustomFormatterWithFlag(, rave['library']['internal']['CustomFormatInfo'], rave['internal']['ValueFunction'], )} , searching for formatters in the order LEGEND and ALL, and using the given ValueFunction as the default if none are provided. The returned value function is set as the legend's formatter.
- * @param (int) index Legend array index
- * @param (Array) entries List of data slot entries, if null an empty list is used
- * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
- * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- formatterList : function(index, entries, format, defaultFunction) {
- if (index >= 0 && index < this._numLegends) {
- this._formatters[index] = this._context.getCustomFormatterWithFlag(["legend", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("legend-label", "ROLE_NONE", format, entries), defaultFunction, false);
- }
- return this;
- },
- /**
- * Utility for the common case where there is only one data slot entry, using no special format or default function. Makes a list with the entry and calls {@link #this.formatterList(, Array, String, rave['internal']['ValueFunction'])} with FORMAT_NONE and a null default function.
- * @param (int) index Legend array index
- * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- formatter : function(index, entry) {
- var entries = [];
- if (entry) {
- entries.push(entry);
- }
- return this.formatterList(index, entries, "none", null);
- },
- /**
- * Test if any legends are visible. The global visible flag must be true, and at least one legend must have a palette. This is intended to help with layout of the whole chart; first set all the legend properties, then allocate space if any are visible.
- * @return (boolean) Whether any legend are visible (will be drawn)
- */
- /** @expose */
- anyVisible : function() {
- for (var i = 0; i < this._numLegends; ++i) {
- if (this._visible[i] == true && (this._palettes[i] || this._swatchSizes[i])) {
- return true;
- }
- }
- return false;
- },
- /**
- * Supply a data slot entry to be associated with the specified legend index. Note this method will call {@link #this.formatter(, rave['library']['internal']['DataSlotEntry'])} , which will handle a default formatter. For more info, see {@link #this.formatterList(, Array, String, rave['internal']['ValueFunction'])} .
- * @param (int) index Legend array index
- * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
- * @return (com.ibm.rave.bundles.components.LegendsManager) This LegendsManager
- */
- /** @expose */
- setDataSlot : function(index, entry) {
- if (index >= 0 && index < this._numLegends) {
- this._dataSlotEntries[index] = entry;
- }
- return this.formatter(index, entry);
- },
- preLayout$0 : function(layoutComponent) {
- this.preLayout$1(layoutComponent, true);
- return this;
- },
- preLayout$1 : function(layoutComponent, axesBeforeLegend) {
- var layoutTransition = this._doTransition;
- var layoutDuration = this._duration;
- this._doTransition = false;
- this._duration = 0;
- var children = [];
- for (var i = 0; i < this._numLegends; ++i) {
- children[i] = "g.layoutLegend-" + i;
- }
- rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.legends-layout"), children);
- var layoutSelectors = [];
- var layoutLastVisible = [];
- for (var i = 0; i < this._numLegends; ++i) {
- layoutSelectors[i] = this._selectors[i];
- layoutLastVisible[i] = this._lastVisible[i];
- this._lastVisible[i] = false;
- if (this._selectors[i]) {
- this._selectors[i] = this._context.node.select("g.layoutLegend-" + i);
- }
- }
- layoutComponent.preLayout(true, !axesBeforeLegend);
- this.rectangle(layoutComponent.legendRect());
- this.draw();
- this._doTransition = layoutTransition;
- this._duration = layoutDuration;
- this._context.node.select("g.legends-layout").selectAll("*").remove();
- for (var i = 0; i < this._numLegends; ++i) {
- this._lastVisible[i] = layoutLastVisible[i];
- this._selectors[i] = layoutSelectors[i];
- }
- return this;
- },
- /**
- * Render the legends using the current global and per-legend settings.
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- draw : function() {
- var nVisible = 0;
- for (var i = 0; i < this._numLegends; ++i) {
- if ((this._swatchSizes[i] || this._palettes[i]) && this._visible[i]) {
- nVisible++;
- }
- }
- var x = this._rectangle.x;
- var y = this._rectangle.y;
- var dx;
- var dy;
- var size;
- if (nVisible == 0) {
- dx = 0;
- dy = 0;
- size = [this._rectangle.width, this._rectangle.height];
- } else if ("horizontal" == this._orient) {
- dx = this._rectangle.width / nVisible;
- dy = 0;
- size = [dx, this._rectangle.height];
- } else {
- dx = 0;
- dy = this._rectangle.height / nVisible;
- size = [this._rectangle.width, dy];
- }
- this._comp.orient(this._orient).size(size);
- this._spaceUsed = 0;
- for (var i = 0; i < this._numLegends; ++i) {
- if (this._selectors[i]) {
- var visible = this._visible[i] && (this._palettes[i] || this._swatchSizes[i]);
- this._comp.visible(visible).colorPalette(this._palettes[i]).orient(this._orient).setPreExecute(this._preExecute).shape(this._shapes[i] != null ? this._shapes[i] : "square").title(this._titles[i]).titleFill(this._titleFills[i]).titleFontSize(this._titleFontSizes[i]).titleFontFamily(this._titleFontFamilies[i]).labelFormat(this._formatters[i]).swatchSize(this._swatchSizes[i]).scale(this._scale[i]);
- var fontStyle = this._context.getPropertyValue("legend.titlestyle.font");
- if (this._titleFonts[i] != null && !(this._titleFonts[i] == "")) {
- this._comp.titleFont(this._titleFonts[i]);
- } else if (fontStyle != null && !(fontStyle == "")) {
- this._comp.titleFont(this._context.getPropertyValue("legend.titlestyle.font"));
- }
- fontStyle = this._context.getPropertyValue("legend.entrystyle.font");
- if (this._entryFonts[i] != null) {
- this._comp.entryFont(this._entryFonts[i]);
- } else if (fontStyle != null && !(fontStyle == "")) {
- this._comp.entryFont(this._context.getPropertyValue("legend.entrystyle.font"));
- }
- var s = (this._doTransition && this._lastVisible[i]) ? this._selectors[i].transition("transition").duration(this._duration) : this._selectors[i];
- s.attr("transform", "translate(" + x + "," + y + ")").call(this._comp);
- var dataSlotEntries = [];
- if (this._dataSlotEntries[i]) {
- dataSlotEntries.push(this._dataSlotEntries[i]);
- }
- this._selectors[i].selectAll(".legendTitle").property("dataSlots", dataSlotEntries);
- if (visible) {
- x += dx;
- y += dy;
- if (this._comp.getSpaceUsed() > this._spaceUsed) {
- this._spaceUsed = this._comp.getSpaceUsed();
- }
- }
- this._lastVisible[i] = visible;
- } else {
- this._lastVisible[i] = false;
- }
- }
- return this;
- },
- /** @expose */
- getSizableType : function() {
- return 2;
- },
- /** @expose */
- getSizableOrientation : function() {
- return this._orient;
- },
- /** @expose */
- getPreferredSize : function() {
- return this._spaceUsed;
- },
- /** @expose */
- getSpillOverSize : function() {
- return 0;
- },
- /** @expose */
- visible : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.visible$1(a0);
- }
- return this.visible$0(a0, a1);
- },
- /** @expose */
- preLayout : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.preLayout$0(a0);
- }
- return this.preLayout$1(a0, a1);
- }
- });
- // $source: com/ibm/rave/bundles/utilities/FontPropertyParser
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_utilities_FontPropertyParser = rave['internal']['Declare']({
- });
- /**
- * Method to parse the css font styles and return a style map.
- * @param (String) fontStyle CSS string (eg. "font-family: courier; font-size: 22; fill: red")
- * @return (Object) Font Style Map
- */
- /** @expose */
- com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont = function(fontStyle) {
- if (fontStyle != null && fontStyle.length > 0) {
- var properties = fontStyle.split(new RegExp(";"));
- var fontStyles = {};
- for (var __i_enFor0 = 0, __len_enFor0 = properties.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var property = properties[__i_enFor0];
- var fontMap = property.split(new RegExp(":"));
- if (fontMap.length == 2) {
- var key = fontMap[0].trim();
- fontStyles[key == "color" ? "fill" : key] = fontMap[1].trim();
- }
- }
- return fontStyles;
- }
- return null;
- };
- // $source: com/ibm/rave/bundles/components/AxesManager
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/AxisComponentImpl (runtime) // new, getTranslation
- //@import com/ibm/rave/bundles/components/GridComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
- /**
- * <p> Managers the axes and gridlines for a bundle. The manager handles rectangular axes, where the axes are drawn to the top, bottom, left, and/or right of a central chart. The manager does not do the layout of axes or the setup of scales. Bundle views will normally create an instance in the setup method, then set properties in their draw method and call {@link #this.draw()} to render all the axes and gridlines (including setting the transforms and clip paths on the groups). </p> <p> The manager has four axes and four gridlines, identified by the logical roles X1, X2, Y1, Y2. These corresponding to the constants in the {@link (com.ibm.rave.bundles.component.AxisComponent) AxisComponent} API. The X roles are the independent axes and the Y roles are the dependent axes. The manager will create an instance of the {@link (com.ibm.rave.bundles.components.AxisComponentImpl) AxisComponentImpl} or {@link (com.ibm.rave.bundles.components.GridComponentImpl) GridComponentImpl} for each role as it is required. </p> <p> The manager has four group (<g>) selectors for axes and four for gridlines, identified by their geometric positions top, bottom, left, and right. In bundles the group structure is created when the bundle first runs, so these selectors can in theory be set just once. </p> <p> Note that the axes and grids are identified logically, while the groups are identified geometrically. By default X1 is the bottom group, X2 the top, Y1 the left, and Y2 the right. This association is controlled by properties which transpose and/or flip the assignments. This is in part a RAVE/D3 requirement, since the core Axis examines the shapes in the group to generate transitions. </p> <p> The group selectors should be ordinary selectors. If a transition is requested and the transition duration is non-negative, the manager creates transitions from the selectors. However in order to give a somewhat better appearance, the manager keeps track of whether shapes were drawn into the group on the previous execution, and a transition is not used if the group was not used. </p> <h3>Properties</h3> <p> The manager has the following overall properties: </p> <ul> <li> The bundle context, set by the constructor. This is used to get the pre-execution callbacks and the custom formatters. </li> <li> A global visibility flag. If false, the axes and grids are not drawn (all shapes are cleared from all groups). </li> <li> Whether to use a transition and the transition duration. </li> <li> A selector for the definitions node used to create clip paths. </li> <li> The elements rectangle. This is the rectangle for the center area surrounded by the axis rectangles. </li> </ul> <p> The manager has the following per-<I>role</I> (X1, X2, Y1, Y2) properties: </p> <ul> <li> The scale for that role. If null, neither the axis nor the grid can be drawn and any shapes in the groups will be removed. </li> <li> Whether to suppress (not draw) labels for that role when redrawing during a pan. By default this is false for all axes. TODO: change defaults depending on story 24882. </li> <li> An {@link (com.ibm.rave.bundles.components.AxisComponentImpl) AxisComponentImpl} for the role. Views use this component to set the axis drawing properties (see below). This is created on-demand, generally when a view first requests it, and the same component will be reused for that role thereafter. </li> <li> An {@link (com.ibm.rave.bundles.components.GridComponentImpl) GridComponentImpl} for the role. Views use this component to set the grid drawing properties (see below). This is created on-demand, generally when a view first requests it, and the same component will be reused for that role thereafter. </li> </ul> <p> The manager has the following per-<I>position</I> (bottom, top, left, right) properties: </p> <li> A group (<g> node) selector for the axis. If null, neither the axis nor the corresponding grid are drawn. </li> <li> The bounds rectangle for the axis. </li> <li> A group (<g> node) selector for the grid. If null, the corresponding grid is not drawn. </li> </ul> <h3>Components</h3> <p> An {@link (com.ibm.rave.bundles.components.AxisComponentImpl) AxisComponentImpl} and {@link (com.ibm.rave.bundles.components.GridComponentImpl) GridComponentImpl} can be obtained for each role. These instances are created on demand, usually when a view requests the instance, but also if the manager is drawing and detects that the instance is needed. Once created the instance will be used by the manager thereafter. </p> <p> Views should use these instances to configure the appearance properties of the axes and grids. </p> <p> All other properties (such as scale, bounds, orient, role, and pre-execution callback) are set by the AxesManager. Views can set these properties but the manager's {@link #this.draw()} method will change the settings. Values for some of these properties (e.g. scale and bounds) are set in the manager by the view, and the others are found automatically by the manager. </p>
- */
- var com_ibm_rave_bundles_components_AxesManager = rave['internal']['Declare']({
- /**
- * Bundle context
- */
- //_context : null,
- /**
- * Selector for the bundle defs node. If null, no clip paths will be defined.
- */
- //_defs : null,
- /**
- * Scales for the axes, indexed by X1, X2, Y1, Y2
- */
- //_scales : null,
- /**
- * Whether to suppress labels when panning, indexed by X1, X2, Y1, Y2.
- */
- //_suppressPanLabels : null,
- /**
- * Value of the axis drawAxisLabels, set when axis is drawn, indexed by X1, X2, Y1, Y2.
- */
- //_drawAxisLabels : null,
- /**
- * Axis components created on demand, indexed by X1, X2, Y1, Y2
- */
- //_axisComponents : null,
- /**
- * When last drawn, the selector used for each axis role, indexed by X1, X2, Y1, Y2; used for redraws.
- */
- //_lastAxisDrawSelectors : null,
- /**
- * Grid components created on demand, indexed by X1, X2, Y1, Y2
- */
- //_gridComponents : null,
- /**
- * When last drawn, the selector used for each grid role, indexed by X1, X2, Y1, Y2; used for redraws.
- */
- //_lastGridDrawSelectors : null,
- /**
- * For clearing axis
- */
- //_clearAxis : null,
- /**
- * For clearing grid
- */
- //_clearGrid : null,
- /**
- * Selectors for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_axisSelectors : null,
- /**
- * Selectors for the grid groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_gridSelectors : null,
- /**
- * Bounding rectangles for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_axisRects : null,
- /**
- * Center elements bounds, also the grid bounds.
- */
- //_elementRect : null,
- /**
- * Whether anything was drawn into the axis group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_lastAxisDrew : null,
- /**
- * Whether anything was drawn into the grid group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_lastGridDrew : null,
- //_dataSlotEntries : null,
- //_layoutAxisOrder : null,
- /**
- * On the first draw, no transitions are used.
- */
- _firstDraw : false,
- /**
- * Whether to draw the axes and grids.
- */
- _visible : true,
- /**
- * Transition duration, ms
- */
- _duration : 0,
- /**
- * Transpose the axes (assign X to left/right and Y to top/bottom)
- */
- _transpose : false,
- /**
- * Switch the independent (X) axes, drawing X1 where X2 normally goes and vice-versa
- */
- _swapX : false,
- /**
- * Switch the dependent (Y) axes, drawing Y1 where Y2 normally goes and vice-versa
- */
- _swapY : false,
- _layoutInProgress : false,
- _layoutMaxWidth : 0,
- _layoutMaxHeight : 0,
- _xPadding : 0, _xOuterPadding : 0, _yPadding : 0, _yOuterPadding : 0,
- _xPixelPad : 0, _yPixelPad : 0,
- /**
- * Hack to allow heatmap in "unit cell" mode to disable stagger because of the post scaling that messes up axis layout
- */
- _preventStaggerRotate45 : false,
- constructor : function(context) {
- this._scales = [];
- this._suppressPanLabels = [];
- this._drawAxisLabels = [];
- this._axisComponents = [];
- this._lastAxisDrawSelectors = [];
- this._gridComponents = [];
- this._lastGridDrawSelectors = [];
- this._clearAxis = new com_ibm_rave_bundles_components_AxisComponentImpl();
- this._clearGrid = new com_ibm_rave_bundles_components_GridComponentImpl();
- this._axisSelectors = [];
- this._gridSelectors = [];
- this._axisRects = [];
- this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._lastAxisDrew = [];
- this._lastGridDrew = [];
- this._dataSlotEntries = [];
- this._layoutAxisOrder = [];
- /**
- * Construct and initialize. No axis scales or selector groups are defined.
- * @param (rave['library']['internal']['BundleContext']) context The bundle context
- */
- {
- this._context = context;
- for (var i = 0; i < 4; ++i) {
- this._scales[i] = null;
- this._suppressPanLabels[i] = false;
- this._axisComponents[i] = null;
- this._lastAxisDrawSelectors[i] = null;
- this._gridComponents[i] = null;
- this._lastGridDrawSelectors[i] = null;
- this._axisSelectors[i] = null;
- this._gridSelectors[i] = null;
- this._axisRects[i] = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._lastAxisDrew[i] = false;
- this._lastGridDrew[i] = false;
- this._dataSlotEntries[i] = [];
- }
- }
- },
- /** @expose */
- preLayout : function(layoutComponent, axesBeforeLegend, xPadding, xOuterPadding, xPixelPad, yPadding, yOuterPadding, yPixelPad) {
- this._xPadding = xPadding;
- this._xOuterPadding = xOuterPadding;
- this._xPixelPad = xPixelPad;
- this._yPadding = yPadding;
- this._yOuterPadding = yOuterPadding;
- this._yPixelPad = yPixelPad;
- this._layoutInProgress = true;
- var layoutDuration = this._duration;
- this._duration = 0;
- var children = ["g.layoutAxis-bottom", "g.layoutAxis-top", "g.layoutAxis-left", "g.layoutAxis-right", "g.layoutGrid-bottom", "g.layoutGrid-top", "g.layoutGrid-left", "g.layoutGrid-right"];
- rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.axes-layout"), children);
- var layoutAxisSelectors = [];
- var layoutGridSelectors = [];
- var layoutLastAxisDrew = [];
- for (var position = 0; position < 4; ++position) {
- if (this._axisComponents[position]) {
- this._axisComponents[position].preLayout();
- }
- layoutAxisSelectors[position] = this._axisSelectors[position];
- layoutGridSelectors[position] = this._gridSelectors[position];
- layoutLastAxisDrew[position] = this._lastAxisDrew[position];
- if (this._axisSelectors[position]) {
- this.axisSelector(position, this._context.node.select("g.layoutAxis-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
- }
- if (this._gridSelectors[position]) {
- this.gridSelector(position, this._context.node.select("g.layoutGrid-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
- }
- }
- layoutComponent.preLayout(axesBeforeLegend, true);
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutComponent.elementRect());
- var countHorz = 0;
- var countVert = 0;
- var axes = [];
- for (var position = 0; position < 4; ++position) {
- var role = this.positionToRole(position);
- var isHorz = position == 1 || position == 0;
- if (this._axisSelectors[position] && this._scales[role]) {
- if (isHorz) {
- countHorz++;
- } else {
- countVert++;
- }
- if (this._scales[role].isOrdinal() || this._scales[role].isClustered()) {
- var score = isHorz ? 4 : 2;
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
- } else {
- var score = isHorz ? 3 : 1;
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
- }
- } else {
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, 5));
- }
- }
- axes.sort(function(a1, a2) {
- var a1value = a1.score;
- var a2value = a2.score;
- return a1value < a2value ? -1 : a1value > a2value ? 1 : 0;
- });
- this._layoutAxisOrder = [];
- for (var i = 0; i < 4; ++i) {
- this._layoutAxisOrder[i] = axes[i].position;
- }
- this._layoutMaxWidth = this._elementRect.width * (countVert > 1 ? 0.5 : 0.4);
- this._layoutMaxHeight = this._elementRect.height * (countHorz > 1 ? 0.5 : 0.4);
- for (var index = 0; index < 4; ++index) {
- var position = this._layoutAxisOrder[index];
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], this._elementRect);
- }
- this.draw();
- this._duration = layoutDuration;
- this._context.node.select("g.axes-layout").selectAll("*").remove();
- for (var position = 0; position < 4; ++position) {
- this._lastAxisDrew[position] = layoutLastAxisDrew[position];
- this._axisSelectors[position] = layoutAxisSelectors[position];
- this._gridSelectors[position] = layoutGridSelectors[position];
- }
- this._layoutInProgress = false;
- return this;
- },
- getPositionToDraw : function(index) {
- return this._layoutInProgress ? this._layoutAxisOrder[index] : index;
- },
- preDrawAxis : function(index) {
- if (this._layoutInProgress) {
- var position = this._layoutAxisOrder[index];
- var role = this.positionToRole(position);
- if (role == 0 || role == 1) {
- this.setScaleRangePadded(this._scales[role], false, this._xPadding, this._xOuterPadding, this._xPixelPad);
- } else {
- this.setScaleRangePadded(this._scales[role], true, this._yPadding, this._yOuterPadding, this._yPixelPad);
- }
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(true);
- }
- },
- postDrawAxis : function(index) {
- if (this._layoutInProgress) {
- var position = this._layoutAxisOrder[index];
- var role = this.positionToRole(position);
- var axis = this._axisComponents[role];
- var size = axis.getPreferredSize();
- if (position == 1 || position == 0) {
- if (size > this._layoutMaxHeight) {
- size = this._layoutMaxHeight;
- }
- this._elementRect.height -= size;
- if (position == 1) {
- this._elementRect.y += size;
- }
- } else {
- if (size > this._layoutMaxWidth) {
- size = this._layoutMaxWidth;
- }
- this._elementRect.width -= size;
- if (position == 2) {
- this._elementRect.x += size;
- }
- }
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
- }
- },
- /**
- * Draw the axes and grids. This will set all the properties of the axes and grids, including the transforms and clip paths, then draw the shapes using a transition if required. Use {@link #this.redraw()} to simply re-render the shapes, for example when zooming.
- */
- /** @expose */
- draw : function() {
- for (var role = 0; role < 4; ++role) {
- this._lastAxisDrawSelectors[role] = null;
- this._lastGridDrawSelectors[role] = null;
- }
- for (var index = 0; index < 4; ++index) {
- var position = this.getPositionToDraw(index);
- var role = this.positionToRole(position);
- if (!this._visible || !this._axisSelectors[position] || !this._scales[role]) {
- this.clearAxis(position);
- this.clearGrid(position);
- } else {
- this.preDrawAxis(index);
- this.drawAxis(position, role);
- this.postDrawAxis(index);
- if (this._gridSelectors[position]) {
- this.drawGrid(position, role);
- }
- }
- }
- this._firstDraw = false;
- },
- /**
- * @return (boolean) true if we are hiding any labels during pan-zoom.
- */
- /** @expose */
- hideAnyPanZoom : function() {
- return (this._suppressPanLabels[0] || this._suppressPanLabels[1] || this._suppressPanLabels[2] || this._suppressPanLabels[3]);
- },
- /**
- * Redraw all the axes and grids used in the last call to {@link #this.draw()} , rendering the shapes into the same selector groups as used then. The component properties, transforms, and clip paths are not reset, and no transitions are used. This should be used for pan-zoom and may be used for other redraw events.
- * @param (boolean) panning Whether this is a pan in-progress; use false otherwise including when pan-zoom ends.
- */
- /** @expose */
- redraw : function(panning) {
- for (var role = 0; role < 4; ++role) {
- if (this._axisComponents[role] && this._lastAxisDrawSelectors[role]) {
- this._axisComponents[role].displayTickLabels(this._drawAxisLabels[role]);
- this._axisComponents[role].showPanZoomTickLabels(!panning || !this._suppressPanLabels[role]);
- var isAllow = this._axisComponents[role].isAllowAutomaticAxisLayoutToChangeOrientation();
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
- this._lastAxisDrawSelectors[role].call(this._axisComponents[role]);
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(isAllow);
- }
- if (this._gridComponents[role] && this._lastGridDrawSelectors[role]) {
- this._lastGridDrawSelectors[role].call(this._gridComponents[role]);
- }
- }
- },
- /** @expose */
- preventStaggerRotate45 : function(preventStaggerRotate45) {
- this._preventStaggerRotate45 = preventStaggerRotate45;
- },
- /**
- * Draw the axis for the given role into the axis group for the given position. When called, the selector for the position and the scale for the role are non-null. This also sets the transform for the group and defines and sets the clip path for the axis.
- * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
- * @param (int) role The axis role, X1, X2, Y1, or Y2
- */
- drawAxis : function(position, role) {
- var axisGroup = this._axisSelectors[position];
- this._lastAxisDrawSelectors[role] = axisGroup;
- var comp = this.axisComponent(role);
- var layoutModeID = role == 2 ? "axis.y.labels.layoutMode" : role == 3 ? "axis.y2.labels.layoutMode" : "axis.x.labels.layoutMode";
- var allowStaggerID = role == 2 ? "axis.y.labels.allowStagger" : role == 3 ? "axis.y2.labels.allowStagger" : "axis.x.labels.allowStagger";
- var allowRotate45ID = role == 2 ? "axis.y.labels.allowRotate45" : role == 3 ? "axis.y2.labels.allowRotate45" : "axis.x.labels.allowRotate45";
- var allowRotate90ID = role == 2 ? "axis.y.labels.allowRotate90" : role == 3 ? "axis.y2.labels.allowRotate90" : "axis.x.labels.allowRotate90";
- var layoutMode = ""+(this._context.getPropertyValue(layoutModeID));
- var allowStagger = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowStaggerID));
- var allowRotate45 = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowRotate45ID));
- var allowRotate90 = (this._context.getPropertyValue(allowRotate90ID));
- var textTruncateIndicator = (this._context.getPropertyValue("axis.labels.truncationText"));
- var axisBounds = this._axisRects[position];
- var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
- var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
- var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
- comp.scale(this._scales[role]).setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).bounds(axisBounds).elementRect(this._elementRect).orient(orient).layoutMode(layoutMode).allowStagger(allowStagger).allowRotate45(allowRotate45).allowRotate90(allowRotate90).setPreExecute(this._context.getPreExecute()).textTruncateIndicator(textTruncateIndicator);
- this._drawAxisLabels[role] = comp._displayTickLabels;
- var axisGroupUpdate = axisGroup;
- if (this._duration > 0 && !this._firstDraw && this._lastAxisDrew[position]) {
- axisGroupUpdate = axisGroup.transition().duration(this._duration);
- }
- axisGroupUpdate.attr("transform", axisTransform);
- axisGroupUpdate.call(comp);
- var dataSlotEntryList = this._dataSlotEntries[role];
- axisGroup.selectAll(".axis-title").property("dataSlots", dataSlotEntryList);
- this._lastAxisDrew[position] = comp.renderedShapes();
- if (this._defs) {
- var clipAxis = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this._context.instanceId() + "clip" + orient);
- var text = axisGroup.append("text").text("000,000");
- var bbox = text.node().getBBox();
- var w = bbox.width;
- var h = bbox.height;
- text.remove();
- var clipRect;
- if (position == 0 || position == 1) {
- var leftEdge = axisBounds.x + transform[0] * -1;
- var rightEdge = leftEdge + axisBounds.width;
- if (!(this._scales[role].isOrdinal()) && !(this._scales[role].isClustered())) {
- var numericLeftEdge = this._elementRect.x - w + transform[0] * -1;
- var numericRightEdge = numericLeftEdge + this._elementRect.width + w * 2;
- if (numericLeftEdge < leftEdge) {
- leftEdge = numericLeftEdge;
- }
- if (numericRightEdge > rightEdge) {
- rightEdge = numericRightEdge;
- }
- }
- clipRect = new rave['internal']['RectStruct'](leftEdge, axisBounds.y + transform[1] * -1, rightEdge - leftEdge, axisBounds.height);
- } else {
- clipRect = new rave['internal']['RectStruct'](axisBounds.x + transform[0] * -1, this._elementRect.y - h / 2 + transform[1] * -1, axisBounds.width, this._elementRect.height + h);
- }
- clipAxis.clipRect(clipRect).applyTo(axisGroup.select(".axis." + orient)).call(this._defs);
- }
- },
- /**
- * If the axis selector for the position is defined, clear the shapes from the axis group.
- * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
- */
- clearAxis : function(position) {
- if (this._axisSelectors[position]) {
- this._clearAxis.scale(null);
- this._axisSelectors[position].call(this._clearAxis);
- }
- this._lastAxisDrew[position] = false;
- },
- /**
- * Draw the grid for the given role into the axis group for the given position. When called, the selector for the role is non-null, and axis component has just been used to draw the axis shapes. This also sets the transform for the group.
- * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
- * @param (int) role The axis role, X1, X2, Y1, or Y2
- */
- drawGrid : function(position, role) {
- var gridGroup = this._gridSelectors[position];
- this._lastGridDrawSelectors[role] = gridGroup;
- var comp = this.gridComponent(role);
- var axisBounds = this._axisRects[position];
- var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
- var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
- var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
- comp.setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).orient(orient).setPreExecute(this._context.getPreExecute()).bounds(this._elementRect).axis(this._axisComponents[role].axis());
- if (this._duration <= 0 || this._firstDraw || !this._lastAxisDrew[position]) {
- gridGroup.attr("transform", axisTransform).call(comp);
- } else {
- gridGroup.transition().duration(this._duration).attr("transform", axisTransform).call(comp);
- }
- this._lastGridDrew[position] = comp.renderedShapes();
- },
- /**
- * If the grid selector for the position is defined, clear the shapes from the grid group.
- * @param (int) position The grid position, BOTTOM, TOP, LEFT, RIGHT
- */
- clearGrid : function(position) {
- if (this._gridSelectors[position]) {
- this._clearGrid.axis(null);
- this._gridSelectors[position].call(this._clearGrid);
- }
- this._lastGridDrew[position] = false;
- },
- /**
- * @param (boolean) visible Whether the manager should draw axes
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- visible : function(visible) {
- this._visible = visible;
- return this;
- },
- /**
- * @param (int) duration The transition duration; if <= 0, no transition is used.
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- duration : function(duration) {
- this._duration = duration;
- return this;
- },
- /**
- * @param (boolean) transpose Whether to transpose the chart (switch the positions of the X and Y axis)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- transpose : function(transpose) {
- this._transpose = transpose;
- return this;
- },
- /**
- * @param (boolean) swapX Whether to switch the postitions of the X1 and X2 axes
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- swapX : function(swapX) {
- this._swapX = swapX;
- return this;
- },
- /**
- * @param (boolean) swapY Whether to switch the postitions of the Y1 and Y2 axes
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- swapY : function(swapY) {
- this._swapY = swapY;
- return this;
- },
- /**
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The coordinate scale for that role, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- scale : function(role, scale) {
- this._scales[role] = scale;
- return this;
- },
- /**
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (boolean) suppressLabels Whether to suppress the labels when panning the axis
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- suppressPanLabels : function(role, suppressLabels) {
- this._suppressPanLabels[role] = suppressLabels;
- return this;
- },
- /**
- * Get the AxisComponentImpl used to render a role. Views should use this to set the appearance properties of the axis. Other properties are handled by the manager.
- * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @return (com.ibm.rave.bundles.components.AxisComponentImpl) The component for the role
- */
- /** @expose */
- axisComponent : function(role) {
- if (!this._axisComponents[role]) {
- this._axisComponents[role] = new com_ibm_rave_bundles_components_AxisComponentImpl();
- }
- return this._axisComponents[role];
- },
- /**
- * Get the GridComponentImpl used to render a role. Views should use this to set the appearance properties of the grid. Other properties are handled by the manager.
- * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @return (com.ibm.rave.bundles.components.GridComponentImpl) The component for the role
- */
- /** @expose */
- gridComponent : function(role) {
- if (!this._gridComponents[role]) {
- this._gridComponents[role] = new com_ibm_rave_bundles_components_GridComponentImpl();
- }
- return this._gridComponents[role];
- },
- /**
- * Set the bundle <defs> node. Clip paths will be defined in this node.
- * @param (rave['internal']['Selector']) defs The defs node
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- defsSelector : function(defs) {
- this._defs = com_ibm_rave_bundles_components_AxesManager.checkSelector(defs);
- return this;
- },
- /**
- * Set the selector for an axis group node.
- * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
- * @param (rave['internal']['Selector']) axisGroup The axis group node, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- axisSelector : function(position, axisGroup) {
- this._axisSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(axisGroup);
- return this;
- },
- /**
- * Set the selector for a grid group node.
- * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
- * @param (rave['internal']['Selector']) gridGroup The grid group node, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- gridSelector : function(position, gridGroup) {
- this._gridSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(gridGroup);
- return this;
- },
- /**
- * Set the element (grid) bounds rectangle to a copy of the given rectangle.
- * @param (rave['internal']['RectStruct']) elementRect The rectangle, if null the bounds are set to 0,0,0,0
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- elementRect : function(elementRect) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, elementRect);
- return this;
- },
- /**
- * Set an axis bounds rectangle to a copy of the given rectangle.
- * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
- * @param (rave['internal']['RectStruct']) axisRect The axis bounds, if null the bounds are set to 0,0,0,0
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- axisRect : function(position, axisRect) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], axisRect);
- return this;
- },
- /**
- * Convenience method. Set all the selectors using context.node as the root of a selection, and assuming the default chart structure: the defs node is the "defs" selection, the left axis is "g.axis.left", and so on.
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultSelectors : function() {
- this.defsSelector(this._context.node.select("defs"));
- this.axisSelector(0, this._context.node.select("g.axisTransform.bottom"));
- this.axisSelector(1, this._context.node.select("g.axisTransform.top"));
- this.axisSelector(2, this._context.node.select("g.axisTransform.left"));
- this.axisSelector(3, this._context.node.select("g.axisTransform.right"));
- this.gridSelector(0, this._context.node.select("g.grid.bottom"));
- this.gridSelector(1, this._context.node.select("g.grid.top"));
- this.gridSelector(2, this._context.node.select("g.grid.left"));
- this.gridSelector(3, this._context.node.select("g.grid.right"));
- return this;
- },
- /**
- * Convenience method: Set the element rectangle and axis rectangles from the rectangles in the layout.
- * @param (com.ibm.rave.bundles.components.ChartLayoutComponentImpl) layoutInfo Layout information
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useBoundsFromLayout : function(layoutInfo) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutInfo.elementRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[0], layoutInfo.bottomRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[1], layoutInfo.topRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[2], layoutInfo.leftRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[3], layoutInfo.rightRect());
- return this;
- },
- /**
- * Convenience method: Set the X1 axis and grid appearance properties from the context, using the usual {@link (rave['library']['internal']['CommonPropertyIDs']) CommonPropertyIDs} . Sets the the padding to the default 16. This does not set the tick format.
- * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultX1Properties : function(setGridParameters) {
- this.axisComponent(0).padding(16).displayAxisTitle(((this._context.getPropertyValue("axis.x.title.display")))).axisTitle(this._context.getDataSlotLabel("axis.x.title.text", this._dataSlotEntries[0])).displayAxisLine(((this._context.getPropertyValue("axis.x.line.display")))).lineColor((this._context.getPropertyValue("axis.x.line.style.stroke"))).displayTicks(((this._context.getPropertyValue("axis.x.ticks.display")))).tickColor((this._context.getPropertyValue("axis.x.ticks.style.stroke"))).displayTickLabels(((this._context.getPropertyValue("axis.x.labels.display"))));
- var titleFontStyle = (this._context.getPropertyValue("axis.x.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.x.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(0).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(0).labelStyle((this._context.getPropertyValue("axis.x.labels.style.fill")), (this._context.getPropertyValue("axis.x.labels.style.font-size")), (this._context.getPropertyValue("axis.x.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(0).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(0).titleStyle((this._context.getPropertyValue("axis.x.title.style.fill")), (this._context.getPropertyValue("axis.x.title.style.font-size")), (this._context.getPropertyValue("axis.x.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(0).displayGridlines(((this._context.getPropertyValue("axis.x.gridlines.display")))).gridlineStyle((this._context.getPropertyValue("axis.x.gridlines.style.stroke")), (this._context.getPropertyValue("axis.x.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(0, (this._context.getPropertyValue("axis.x.labels.zoomPan")));
- return this;
- },
- /**
- * Convenience method: Set the Y1 axis and grid appearance properties from the context, using the usual {@link (rave['library']['internal']['CommonPropertyIDs']) CommonPropertyIDs} . Sets the the padding to the default 16. This does not set the tick format.
- * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultY1Properties : function(setGridParameters) {
- this.axisComponent(2).padding(16).displayAxisTitle((this._context.getPropertyValue("axis.y.title.display"))).axisTitle(this._context.getDataSlotLabel("axis.y.title.text", this._dataSlotEntries[2])).displayAxisLine((this._context.getPropertyValue("axis.y.line.display"))).lineColor((this._context.getPropertyValue("axis.y.line.style.stroke"))).displayTicks((this._context.getPropertyValue("axis.y.ticks.display"))).tickColor((this._context.getPropertyValue("axis.y.ticks.style.stroke"))).displayTickLabels((this._context.getPropertyValue("axis.y.labels.display")));
- var titleFontStyle = (this._context.getPropertyValue("axis.y.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.y.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(2).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(2).labelStyle((this._context.getPropertyValue("axis.y.labels.style.fill")), (this._context.getPropertyValue("axis.y.labels.style.font-size")), (this._context.getPropertyValue("axis.y.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(2).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(2).titleStyle((this._context.getPropertyValue("axis.y.title.style.fill")), (this._context.getPropertyValue("axis.y.title.style.font-size")), (this._context.getPropertyValue("axis.y.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(2).displayGridlines((this._context.getPropertyValue("axis.y.gridlines.display"))).gridlineStyle((this._context.getPropertyValue("axis.y.gridlines.style.stroke")), (this._context.getPropertyValue("axis.y.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(2, (this._context.getPropertyValue("axis.y.labels.zoomPan")));
- return this;
- },
- /**
- * Convenience method: Set the Y2 axis and grid appearance properties from the context, using the usual {@link (rave['library']['internal']['CommonPropertyIDs']) CommonPropertyIDs} . Sets the the padding to the default 16. This does not set the tick format.
- * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultY2Properties : function(setGridParameters) {
- this.axisComponent(3).padding(16).displayAxisTitle((this._context.getPropertyValue("axis.y2.title.display"))).axisTitle(this._context.getDataSlotLabel("axis.y2.title.text", this._dataSlotEntries[3])).displayAxisLine((this._context.getPropertyValue("axis.y2.line.display"))).lineColor((this._context.getPropertyValue("axis.y2.line.style.stroke"))).displayTicks((this._context.getPropertyValue("axis.y2.ticks.display"))).tickColor((this._context.getPropertyValue("axis.y2.ticks.style.stroke"))).displayTickLabels((this._context.getPropertyValue("axis.y2.labels.display")));
- var titleFontStyle = (this._context.getPropertyValue("axis.y2.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.y2.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(3).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(3).labelStyle((this._context.getPropertyValue("axis.y2.labels.style.fill")), (this._context.getPropertyValue("axis.y2.labels.style.font-size")), (this._context.getPropertyValue("axis.y2.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(3).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(3).titleStyle((this._context.getPropertyValue("axis.y2.title.style.fill")), (this._context.getPropertyValue("axis.y2.title.style.font-size")), (this._context.getPropertyValue("axis.y2.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(3).displayGridlines((this._context.getPropertyValue("axis.y2.gridlines.display"))).gridlineStyle((this._context.getPropertyValue("axis.y2.gridlines.style.stroke")), (this._context.getPropertyValue("axis.y2.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(3, (this._context.getPropertyValue("axis.y2.labels.zoomPan")));
- return this;
- },
- /**
- * Set the tick formatting function for the given axis role. The custom formatter is found using {@link this.BundleContext#this.getCustomFormatterWithFlag(, rave['library']['internal']['CustomFormatInfo'], rave['internal']['ValueFunction'], )} , searching for formatters in the order role, position of role, AXIS, and ALL, and using the given ValueFunction as the default if none are provided. The returned value function is set as the axis component's tick format. This must be called after setting the transpose, swapX, and swapY properties, since the position of the role depends on those properties.
- * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (Array) entries Non-null list of data slot entries
- * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
- * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined for the axis, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setTickFormatterList : function(role, entries, format, defaultFunction) {
- var fmtRole;
- switch (role) {
- case 2:
- fmtRole = "ROLE_Y1";
- break;
- case 1:
- fmtRole = "ROLE_X2";
- break;
- case 3:
- fmtRole = "ROLE_Y2";
- break;
- case 0:
- default:
- fmtRole = "ROLE_X1";
- break;
- }
- var fmt = this._context.getCustomFormatterWithFlag([com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS[role], com_ibm_rave_bundles_components_AxesManager.FORMATTERS[this.roleToPosition(role)], "axis", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("axis-label", fmtRole, format, entries), defaultFunction, false);
- this.axisComponent(role).tickFormat(fmt);
- var simplefmt = this._context.getCustomFormatterWithFlag([com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS[role], com_ibm_rave_bundles_components_AxesManager.FORMATTERS[this.roleToPosition(role)], "axis", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("axis-label", fmtRole, format, entries), defaultFunction, true);
- this.axisComponent(role).simplifiedTickFormat(simplefmt);
- return this;
- },
- /**
- * Utility for the common case where there is only one data slot entry and no special formatting or default. Makes a list of the entry and calls {@link #this.setTickFormatterList(, Array, String, rave['internal']['ValueFunction'])} with the "none" format and a null default function.
- * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setTickFormatter : function(role, entry) {
- var entries = [];
- if (entry) {
- entries.push(entry);
- }
- return this.setTickFormatterList(role, entries, "none", null);
- },
- /**
- * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined scale.
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setIndependentScaleRanges(padding, outerPadding, pixelPad);
- this.setDependentScaleRanges(padding, outerPadding, pixelPad);
- return this;
- },
- /**
- * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setIndependentScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setScaleRangePadded(this._scales[0], false, padding, outerPadding, pixelPad);
- this.setScaleRangePadded(this._scales[1], false, padding, outerPadding, pixelPad);
- return this;
- },
- /**
- * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setDependentScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setScaleRangePadded(this._scales[2], true, padding, outerPadding, pixelPad);
- this.setScaleRangePadded(this._scales[3], true, padding, outerPadding, pixelPad);
- return this;
- },
- /**
- * Set a data slot entry that will be associated with the specified axis role. <br /><br /> To associate multiple data slots with an axis role, see {@link #this.setDataSlot(, Array)} .
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (rave['library']['internal']['DataSlotEntry']) slot DataSlotEntry to be associated with the axis role.
- */
- setDataSlot$0 : function(role, slot) {
- this.setDataSlot$1(role, [slot]);
- return this;
- },
- /**
- * Set a list of data slot entries that will be associated with the specified axis role.
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (Array) slots List of DataSlotEntry to be associated with the axis role.
- */
- setDataSlot$1 : function(role, slots) {
- if (role < 4 && role >= 0) {
- this._dataSlotEntries[role].length = 0;
- if (slots) {
- for (var __i_enFor0 = 0, __exp_enFor0 = slots, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var slot = __exp_enFor0[__i_enFor0];
- this._dataSlotEntries[role].push(slot);
- }
- }
- }
- return this;
- },
- /**
- * </p> Set the coordinate range of a scale. This should be used only after the transpose and center rectangle have been set. Transpose and dependent are used to choose either the X or Y extent of the center rectangle. The extent is padded by pixelPad pixels at each end, so the smallest value of the domain will map to the extent's start+pixelPadding, and the largest value of the domain to the extent's end-pixelPadding. </p> TODO: This would be a good place for scale reverse.
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale Bundle independent scale
- * @param (boolean) dependent Whether this is the dependent scale
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- */
- setScaleRangePadded : function(scale, dependent, padding, outerPadding, pixelPad) {
- if (scale) {
- var min, max;
- if (dependent == this._transpose) {
- min = this._elementRect.x + pixelPad;
- max = this._elementRect.x + this._elementRect.width - pixelPad;
- } else {
- if (scale.isContinuous()) {
- min = this._elementRect.y + this._elementRect.height - pixelPad;
- max = this._elementRect.y + pixelPad;
- } else {
- min = this._elementRect.y + pixelPad;
- max = this._elementRect.y + this._elementRect.height - pixelPad;
- }
- }
- scale.range(min, max, padding, outerPadding);
- }
- },
- /**
- * Given a geometric position BOTTOM, TOP, LEFT, or RIGHT, return the role X1, X2, Y1, or Y2 used by that role.
- * @param (int) position The position index
- * @return (int) The role index
- */
- positionToRole : function(position) {
- var r = position;
- if (this._transpose) {
- r = (r + 2) % 4;
- }
- if (this._swapX && r < 2) {
- r = 1 - r;
- }
- if (this._swapY && r > 1) {
- r = 5 - r;
- }
- return r;
- },
- /**
- * Given a role X1, X2, Y1, or Y2, return the geometric position BOTTOM, TOP, LEFT, or RIGHT for that role.
- * @param (int) role The role index
- * @return (int) The position index
- */
- roleToPosition : function(role) {
- var p = role;
- if (this._swapX && role < 2) {
- p = 1 - p;
- }
- if (this._swapY && p > 1) {
- p = 5 - p;
- }
- if (this._transpose) {
- p = (p + 2) % 4;
- }
- return p;
- },
- /**
- * Sets the magnitude for the tick interval.
- * @param (int) role role index of the axis
- * @param (Number) tickMagnitude power of 10
- * @return (com.ibm.rave.bundles.components.AxesManager) this
- */
- /** @expose */
- scaleTickMagnitude : function(role, tickMagnitude) {
- this.axisComponent(role).scaleTickMagnitude(tickMagnitude);
- return this;
- },
- /** @expose */
- setDataSlot : function(a0, a1) {
- var args = arguments;
- if (args.length == 2 && typeof a1 === "function") {
- return this.setDataSlot$0(a0, a1);
- }
- return this.setDataSlot$1(a0, a1);
- }
- });
- /**
- * @param (rave['internal']['Selector']) s A selector
- * @return (rave['internal']['Selector']) s if it is non-null and has at least one node, null otherwise
- */
- com_ibm_rave_bundles_components_AxesManager.checkSelector = function(s) {
- return s && !(s.empty()) ? s : null;
- };
- /**
- * Set a rectangle to a copy of another. If the source is null, the target is set to 0,0,0,0
- * @param (rave['internal']['RectStruct']) target A non-null rectangle
- * @param (rave['internal']['RectStruct']) source A possibly-null rectnalge
- */
- com_ibm_rave_bundles_components_AxesManager.setRect = function(target, source) {
- if (source) {
- target.x = source.x;
- target.y = source.y;
- target.width = source.width;
- target.height = source.height;
- } else {
- target.x = 0;
- target.y = 0;
- target.width = 0;
- target.height = 0;
- }
- };
- /**
- * A ValueFunction that appends '%' to the value.
- * @param (int) n Number of digits
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.percentFormat = function(n) {
- var digits = "." + n + "f";
- var format = rave.format(digits);
- return function(value, ix, gix) {
- return format.call(null, value, 0, 0) + "%";
- };
- };
- /**
- * Called prior to chart layout. Axes are configured with no real bounding constraints to calculate their preferred size.
- */
- com_ibm_rave_bundles_components_AxesManager.AxisLayout = rave['internal']['Declare']({
- /** @expose */
- position : 0,
- /** @expose */
- score : 0,
- constructor : function(position, score) {
- this.position = position;
- this.score = score;
- }
- });
- /**
- * Logical first X (independent) axis, default position bottom
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.X1 = 0;
- /**
- * Logical second X (independent) axis, default position top
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.X2 = 1;
- /**
- * Logical first Y (dependent) axis, default position left
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.Y1 = 2;
- /**
- * Logical first Y (dependent) axis, default position right
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.Y2 = 3;
- /**
- * Geometric group on bottom
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.BOTTOM = 0;
- /**
- * Geometric group on top
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.TOP = 1;
- /**
- * Geometric group on left
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.LEFT = 2;
- /**
- * Geometric group on right
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.RIGHT = 3;
- /**
- * Maps the role indexes to the role strings used by the components API
- */
- com_ibm_rave_bundles_components_AxesManager.ROLES = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
- /**
- * Maps the role indexes to the role strings used by the custom formatter API. TODO: Unify the strings
- */
- com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
- /**
- * Maps the position indexes to the orient strings used by D3
- */
- com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS = ["bottom", "top", "left", "right"];
- /**
- * Maps the position indexes to the custom formatter strings
- */
- com_ibm_rave_bundles_components_AxesManager.FORMATTERS = ["bottom", "top", "left", "right"];
- // $source: com/ibm/rave/bundles/component/AxisComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders an axis (RAVE core Axis) with an optional title in an XY axis chart. The {@link #this.type()} method returns "AxisComponent". </p> <p> The {@link #this.role()} method is used to identify the axis. Most charts with axes will use only the {@link #"ROLE_X1"} and {@link #"ROLE_Y1"} roles. The composite bundle also uses {@link #"ROLE_Y2"} . {@link #"ROLE_X2"} is not currently used by any chart. </p> <p> The axis component uses a RAVE capability axis, available with {@link #this.axis()} . When used with a pre-execution callback, the axis is only valid for the duration of the callback (do not use the reference outside the callback). Properties of the capability axis may be set by the pre-execution callback, but note that many properties are set by the AxisComponent after the callback. To change those properties, use the methods of this class to change the AxisComponent, which will then set the capability axis properties. </p>
- */
- var com_ibm_rave_bundles_component_AxisComponent = rave['internal']['Declare'].implement(
- /**
- * @return (String) The role of the axis in the chart
- */
- //role : function() {},
- /**
- * @return (rave['internal']['Axis']) The capability Axis used by this AxisComponent
- */
- //axis : function() {},
- /**
- * The tickFormat is applied to the values of the ticks to create the string that is displayed.
- * @param (rave['internal']['ValueFunction']) tickFormat The new tickFormat
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //tickFormat : function(tickFormat) {},
- /**
- * Get the tickFormat function used by this component. May be null.
- * @return (rave['internal']['ValueFunction']) Format function, or null
- */
- //tickFormat : function() {},
- /**
- * Set the indicator to be used for truncated text ex: indicator set to "..." , results in helloworld - > hello...
- * @param (String) indicator the string to be placed to indicated truncated text
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //textTruncateIndicator : function(indicator) {},
- /**
- * Whether to display the axis title.
- * @param (boolean) displayAxisTitle true to display the axis title, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayAxisTitle : function(displayAxisTitle) {},
- /**
- * Whether to display the axis line.
- * @param (boolean) displayAxisLine true to display the axis line, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayAxisLine : function(displayAxisLine) {},
- /**
- * Whether to display the axis tick marks.
- * @param (boolean) displayTicks true to display the axis ticks, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayTicks : function(displayTicks) {},
- /**
- * Whether to display the axis labels, as set by the show axis labels property
- * @param (boolean) displayTickLabels true to display the axis tick labels, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayTickLabels : function(displayTickLabels) {},
- /**
- * Whether to display the axis labels, as set by the hide pan-zoom labels property
- * @param (boolean) showPanZoomTickLabels true to display the axis tick labels, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //showPanZoomTickLabels : function(showPanZoomTickLabels) {},
- /**
- * @param (String) axisTitle The new axisTitle
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //axisTitle : function(axisTitle) {},
- /**
- * The color used to draw the axis line and ticks. This is equivalent to calling both {@link #this.lineColor(String)} and {@link #this.tickColor(String)} .
- * @param (String) axisColor The new line and tick color
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //axisColor : function(axisColor) {},
- /**
- * The color used to draw the axis line.
- * @param (String) lineColor The new lineColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //lineColor : function(lineColor) {},
- /**
- * The color used to draw the axis ticks.
- * @param (String) tickColor The new tickColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //tickColor : function(tickColor) {},
- /**
- * The color used to draw the axis labels.
- * @param (String) labelColor The new labelColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //labelColor : function(labelColor) {},
- /**
- * The style for the axis labels.
- * @param (String) fontStyle CSS string of font properties
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //labelStyle : function(fontStyle) {},
- /**
- * The style for the axis labels.
- * @param (String) fill The color used to draw the labels
- * @param (String) fontSize CSS font size
- * @param (String) fontFamily CSS font-families list
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //labelStyle : function(fill, fontSize, fontFamily) {},
- /**
- * The color used to draw the axis title.
- * @param (String) titleColor The new titleColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //titleColor : function(titleColor) {},
- /**
- * The style for the axis title.
- * @param (String) fontStyle CSS string of font properties
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //titleStyle : function(fontStyle) {},
- /**
- * The style for the axis title.
- * @param (String) fill The color used to draw the title
- * @param (String) fontSize CSS font size
- * @param (String) fontFamily CSS font-families list
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //titleStyle : function(fill, fontSize, fontFamily) {}
- );
- /**
- * The string returned by {@link #this.type()} is "AxisComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE = "AxisComponent";
- /**
- * Returned by {@link #this.role()} for the first independent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_X1 = "ROLE_X1";
- /**
- * Returned by {@link #this.role()} for the first dependent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_Y1 = "ROLE_Y1";
- /**
- * Returned by {@link #this.role()} for the second independent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_X2 = "ROLE_X2";
- /**
- * Returned by {@link #this.role()} for the second dependent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_Y2 = "ROLE_Y2";
- // $source: com/ibm/rave/bundles/utilities/TextCrossfader
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> Utility class for setting up a cross-fade of a single text node. This could be extended to a multiple-node selection (e.g. using value functions to return the text strings for each node in the selection), but that is not yet needed in the bundles. However use this with care, since if the transition does select multiple texts, they will all change to the new text string. </p> <p> Any other text properties that are changing, for example the color or position, can be set up in the transition either before or after calling the utility method. </p>
- */
- var com_ibm_rave_bundles_utilities_TextCrossfader = rave['internal']['Declare']({
- });
- /**
- * <p> Perform a text cross fade for a single text node. The selection holds that node. If it is not a transition, the new text is set; otherwise the cross-fade transition is done using tweeners on the "text" and "fill-opacity" attributes. </p> <p> The "text" attribute tweener uses the oldText before transition time 0.5, and the new text thereafter. (Note this assumes that the old text is in fact the node's text; if not, the displayed text will change to the "old" text when the transition begins, then to the new text halfway through the transition.) </p> <p> The text is optionally faded out and back in, disappearing completely at time 0.5, by setting the "fill-opacity" style attribute. The fading is controlled by the delay argument, which is clamped to the range [0.0, 0.5]. If the clamped delay is 0.5, or if the text does not actually change, no crossfade is used. Otherwise the opacity is full for transition times less than the delay or greater than 1-delay, fading to 0.0 at time 0.5. For example if the delay is 0.2, the opacity will be full from transition time 0.0 to 0.2, fade out linearly to 0 at time 0.5, fade in linearly to full at time 0.8, and be full from time 0.8 to 1.0. </p> <p> The old and new texts and the full opacity are all passed as arguments, because it is generally not safe to try to find the values when the method runs. In particular, if we run this method while a transition (such as a previous cross-fade) is already in progress, we may pick up an intermediate fill-opacity value, perhaps even 0.0, and set the text opacity to that value!
- * @param (rave['internal']['Selection']) selection Selection containing the single text node, may be a transition
- * @param (String) oldText Old value of the text string, may be null
- * @param (String) newText New value of the text string, may be null
- * @param (Object) fillOpacity Fill opacity, may be null (in which case 1.0 is assumed)
- * @param (double) delay Number between 0 and 0.5 controlling the timing of the fade
- * @return (rave['internal']['Selection']) The selection, modified by the new text and fill-opacity
- */
- /** @expose */
- com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade = function(selection, oldText, newText, fillOpacity, delay) {
- if (!(selection.isTransition())) {
- return selection.text(newText);
- }
- var _t = (selection).tween("text", function(data, index, groupIndex) {
- return function(t) {
- this.rave_setText(t < 0.5 ? oldText : newText);
- };
- });
- var t0 = Math.max(0.0, Math.min(0.5, delay));
- if (t0 == 0.5 || (oldText == null && newText == null) || (oldText != null && oldText == newText)) {
- return selection;
- }
- var opacity = fillOpacity == null ? 1.0 : + (fillOpacity);
- var tf = 1.0 / (0.5 - t0);
- return _t.tween("fill-opacity", function(data, index, groupIndex) {
- return function(t) {
- if (t <= t0 || t >= (1.0 - t0)) {
- this.rave_setStyle("fill-opacity", fillOpacity);
- } else {
- this.rave_setStyle("fill-opacity", opacity * Math.abs(t - 0.5) * tf);
- }
- };
- });
- };
- // $source: com/ibm/rave/bundles/utilities/BundleLabelDropper
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_utilities_BundleLabelDropper = rave['internal']['Declare']({
- //_dropOverlap : null,
- labelCount : 0,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- _$self.drop(args[0], ((args[1])));
- return null;
- }
- };
- return _$self;
- },
- /** @expose */
- constructor : function() {
- this._dropOverlap = (rave.capabilities.extension("position")).drop().remove(false);
- this._dropOverlap.setOverlapGap(4.0);
- },
- /**
- * Drop the overlapping labels or reset the overlap.
- * @param (rave['internal']['Selection']) labels The selector for the labels
- * @param (boolean) removeOverlap true to remove the overlapping labels, false to reset
- */
- /** @expose */
- drop : function(labels, removeOverlap) {
- if (!(labels.isTransition())) {
- this.applyLabelDrop(labels, removeOverlap);
- } else {
- var steps = [0, 25, 75];
- var self = this;
- (labels).tween("__pointLabelDrop__", function(data, index, groupIndex) {
- if (index == 0) {
- return function(t) {
- var currentStep = Math.floor(t * 100);
- if (steps.length > 0 && currentStep < 100 && currentStep >= steps[0]) {
- steps.splice(0, 1);
- self.applyLabelDrop(labels, removeOverlap);
- }
- };
- }
- return null;
- });
- this.labelCount = 0;
- (labels).each(function(data, index, groupIndex) {
- ++self.labelCount;
- }).each("end", function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- if (--self.labelCount == 0) {
- self.applyLabelDrop(labels, removeOverlap);
- }
- return null;
- }
- });
- }
- },
- applyLabelDrop : function(labels, removeOverlap) {
- if (removeOverlap) {
- labels.call(this._dropOverlap);
- } else {
- this._dropOverlap.reset(labels);
- }
- },
- /** @expose */
- configureForDataLabels : function(rect) {
- if (rect) {
- var ex = [[rect.x, rect.y], [rect.x + rect.width, rect.y + rect.height]];
- this._dropOverlap.extent(ex);
- }
- this._dropOverlap.noClipping();
- }
- });
- /**
- * Drop overlap extension
- */
- //com_ibm_rave_bundles_utilities_BundleLabelDropper.POSITION_EXTENSION = "position";
- /**
- * space between labels during overlap testing
- */
- com_ibm_rave_bundles_utilities_BundleLabelDropper.OVERLAP_GAP = 4;
- // $source: com/ibm/rave/bundles/components/StyleStructs
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * Struct classes to hold style properties.
- */
- var com_ibm_rave_bundles_components_StyleStructs = rave['internal']['Declare']({
- });
- /**
- * Filled shape style properties.
- */
- com_ibm_rave_bundles_components_StyleStructs.ShapeStyle = function() {
- this._fill = null;
- this._stroke = null;
- this._strokeWidth = null;
- };
- /**
- * Line style properties.
- */
- com_ibm_rave_bundles_components_StyleStructs.LineStyle = function() {
- this._stroke = null;
- this._strokeWidth = null;
- this._dashArray = null;
- };
- // $source: com/ibm/rave/bundles/component/GridComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders gridlines in an XY axis chart. The {@link #this.type()} method returns "GridComponent". </p> <p> The {@link #this.role()} method is used to identify the grid. The return values are defined in {@link (com.ibm.rave.bundles.component.AxisComponent) AxisComponent} : {@link this.AxisComponent#"ROLE_X1"} , {@link this.AxisComponent#"ROLE_Y1"} , and so on. </p>
- */
- var com_ibm_rave_bundles_component_GridComponent = rave['internal']['Declare'].implement(
- /**
- * @return (String) The role of the grid in the chart
- */
- //role : function() {},
- /**
- * Whether to display the gridlines.
- * @param (boolean) displayGridlines The new displayGridlines
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //displayGridlines : function(displayGridlines) {},
- /**
- * Set the line styling. Equivalent to calling {@link #this.gridlineColor(String)} and {@link #this.dashArray(String)} .
- * @param (String) stroke The stroke color
- * @param (String) dashArray The stroke-dasharray
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //gridlineStyle : function(stroke, dashArray) {},
- /**
- * The color used to draw the gridlines.
- * @param (String) gridlineColor The new stroke color
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //gridlineColor : function(gridlineColor) {},
- /**
- * The dashing used to draw the gridlines. The argument is a string, giving a comma-separated list of numbers as used with the SVG "stroke-dasharray" style.
- * @param (String) dashArray The new dash array
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //dashArray : function(dashArray) {}
- );
- /**
- * The string returned by {@link #this.type()} is "GridComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE = "GridComponent";
- // $source: com/ibm/rave/bundles/components/IntervalDataUtilities
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * A structure for holding interval data (IntervalData}, and utilities for building an array of the data from the tabular data and accessors objects. The array has one entry per entry in the tabular data, and the array entries are in the same order as the datum rows for joining by selectors.
- */
- var com_ibm_rave_bundles_components_IntervalDataUtilities = rave['internal']['Declare']({
- });
- /**
- * <p> Create intervals for a simple bar chart. The intervals come directly from the data, with the independent interval the independent value (for both ends) and the dependent interval 0.0 to the dependent value. The group and label are copied from the datum. The callout independent is the independent value, and the callout dependent is the dependent value (the bar extent). </p> <p> If the xScale is non-null and returns null for an independent (X) value, the data is skipped. </p>
- * @param (Array) data Data array
- * @param (rave['internal']['SingleValueFunction']) x X accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) xScale Function to check if the X value is valid
- * @param (rave['internal']['SingleValueFunction']) y Y accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
- * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
- * @return (Array) Array of intervals for the data
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars = function(data, x, xScale, y, yStart, color, label) {
- var result = [];
- if (!data || data.length == 0 || !x || !y) {
- return result;
- }
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- var yvStart = !yStart ? 0 : yStart(d);
- if (yv != null && yvStart != null) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = r.ind1;
- r.cind = r.ind1;
- r.dep1 = yvStart;
- r.dep2 = yv;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = r.dep2;
- r._originalData = d;
- r.valueAsPercentOfCategory = 100;
- result.push(r);
- }
- }
- return null;
- });
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- if (sum != 0) {
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- return result;
- };
- /**
- * Create intervals for bars in a clustered chart. This is similar to the simple bars, except the independent values are an array of accessors.
- * @param (Array) data Data array
- * @param (Array) x Independent accessor array, should not be null and no entries should be null
- * @param (Array) xScale Array of possibly-null functions to check if X values are in domain; array should not be null, and should be same length as x
- * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
- * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
- * @return (Array) Array of intervals for the data
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars = function(data, x, xScale, y, yStart, color, label) {
- var result = [];
- if (!data || data.length == 0 || !x || x.length == 0 || !y) {
- return result;
- }
- var len = x.length;
- var categories = {};
- var colors = {};
- data.forEach(function(d, ix, list) {
- var OK = true;
- var ind = [];
- for (var i = 0; i < len; ++i) {
- var xv = x[i](d);
- if (xv == null || (xScale[i] && xScale[i](xv) == null)) {
- OK = false;
- break;
- }
- ind.push(xv);
- if (i == 0) {
- if (!(categories.hasOwnProperty(xv))) {
- categories[""+(xv)] = 1;
- }
- } else if (!(colors.hasOwnProperty(xv))) {
- colors[""+(xv)] = 1;
- }
- }
- var dep = y(d);
- var depStart = !yStart ? 0 : yStart(d);
- if (OK && dep != null && depStart != null) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = ind;
- r.ind2 = ind;
- r.cind = ind;
- r.dep1 = depStart;
- r.dep2 = dep;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = r.dep2;
- r._originalData = d;
- result.push(r);
- }
- return null;
- });
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == (iData.ind1)[0]) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == (iData.ind1)[0]) {
- var value = + (iData.value);
- iData.valueAsPercentOfCategory = value / sum * 100;
- }
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- }
- return result;
- };
- /**
- * Create intervals for an stacked bar chart. The data is formed into stacks by the unique values of the independent data. The independent interval is the independent value (for both ends), and the dependent interval is from the stacking with the extent equal to the dependent value. The callout independent is the independent value, and the callout dependent is the dependent value (the bar extent). If percent is true, the bars are rescaled so the total height of each stack is 1.0. If xScale is non-null and returns null for an x value, that bar is skipped.
- * @param (Array) data Data array
- * @param (rave['internal']['SingleValueFunction']) x Independent accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) xScale Possibly-null function to check if X values are in domain
- * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
- * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
- * @param (boolean) percent If true, create percent bars
- * @return (Array) Array of intervals for the data
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars = function(data, x, xScale, y, color, label, percent) {
- var result = [];
- if (!data || data.length == 0 || !x || !y) {
- return result;
- }
- var stacks = {};
- var categories = {};
- var colors = {};
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- if (yv != null) {
- var stack = stacks[xv];
- if (!stack) {
- stack = new com_ibm_rave_bundles_components_IntervalDataUtilities.Stack();
- stacks[xv] = stack;
- }
- var dVal = + (yv);
- if (!percent) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = xv;
- r.cind = xv;
- var sum = dVal < 0.0 ? stack.negativeSum : stack.positiveSum;
- r.dep1 = sum;
- r.dep2 = sum + dVal;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = dVal;
- r._originalData = d;
- result.push(r);
- }
- if (dVal < 0.0) {
- stack.negativeSum += dVal;
- } else {
- stack.positiveCount++;
- stack.positiveSum += dVal;
- }
- if (!(categories.hasOwnProperty(xv))) {
- categories[""+(xv)] = 1;
- }
- if (color) {
- var o = color(d);
- if ((o != null) && !(colors.hasOwnProperty(o))) {
- colors[""+(o)] = 1;
- }
- }
- }
- }
- return null;
- });
- if (percent) {
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- if (yv != null) {
- var stack = stacks[xv];
- var dVal = + (yv);
- var percent;
- if (dVal < 0.0) {
- percent = -100.0 * dVal / stack.negativeSum;
- } else if (stack.positiveSum > 0) {
- percent = 100.0 * dVal / stack.positiveSum;
- } else {
- percent = 100.0 / stack.positiveCount;
- }
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = xv;
- r.cind = xv;
- var sum = dVal < 0.0 ? stack.negativePercent : stack.positivePercent;
- r.dep1 = sum;
- r.dep2 = sum + percent;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = dVal;
- r.valueAsPercentOfCategory = percent;
- r._originalData = d;
- result.push(r);
- if (dVal < 0.0) {
- stack.negativePercent += percent;
- } else {
- stack.positivePercent += percent;
- }
- }
- }
- return null;
- });
- } else {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.ind1) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.ind1) {
- var value = + (iData.value);
- iData.valueAsPercentOfCategory = value / sum * 100;
- }
- }
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- }
- return result;
- };
- /**
- * Structure class holding interval information.
- */
- com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData = rave['internal']['Declare']({
- /**
- * Key value; for now this is the data index
- */
- /** @expose */
- key : null,
- /**
- * First independent value
- */
- /** @expose */
- ind1 : null,
- /**
- * Second independent value (in all current uses, same as ind1)
- */
- /** @expose */
- ind2 : null,
- /**
- * First dependent value
- */
- /** @expose */
- dep1 : null,
- /**
- * Second dependent value
- */
- /** @expose */
- dep2 : null,
- /**
- * The data value that the interval represents. Not the pixel value. Used in stacked chart
- */
- /** @expose */
- value : null,
- /**
- * Color value
- */
- /** @expose */
- color : null,
- /**
- * Label value
- */
- /** @expose */
- label : null,
- /**
- * Callout independent value (in all current uses, same as ind1)
- */
- /** @expose */
- cind : null,
- /**
- * Callout dependent value (dependent extent)
- */
- /** @expose */
- cdep : null,
- /** @expose */
- _originalData : null,
- /**
- * The data value (in percentage) for specific category
- */
- /** @expose */
- valueAsPercentOfCategory : NaN,
- /**
- * The data value (in percentage) across all categories
- */
- /** @expose */
- valueAsPercentOfColor : NaN,
- /** @expose */
- originalData : function() {
- return this._originalData;
- },
- /** @expose */
- originalDataList : function() {
- var list = [];
- list.push(this._originalData);
- return list;
- }
- });
- com_ibm_rave_bundles_components_IntervalDataUtilities.Stack = function() {
- this.positiveCount = 0;
- this.positiveSum = 0;
- this.negativeSum = 0;
- this.positivePercent = 0;
- this.negativePercent = 0;
- };
- /**
- * Accessor for the callout dependent value
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_DEPENDENT_ACCESSOR = function(data) {
- return (data).cdep;
- };
- /**
- * Accessor for the callout independent value
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_INDEPENDENT_ACCESSOR = function(data) {
- return (data).cind;
- };
- /**
- * Accessor for the data value
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR = function(data) {
- return (data).value;
- };
- /**
- * Accessor for data value as percent of category
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(data) {
- var percent = (data).valueAsPercentOfCategory;
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- /**
- * Accessor for data value as percent of color (series)
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(data) {
- var percent = (data).valueAsPercentOfColor;
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- // $source: com/ibm/rave/bundles/data/PointDataUtilities
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * Utility class for building arrays of point datum objects from tabular data.
- */
- var com_ibm_rave_bundles_data_PointDataUtilities = rave['internal']['Declare']({
- });
- /**
- * <p> Filter the input data list-array and return a list-array of PointData objects in the same order. If the data is null, an empty list is returned. Any null object in the data is skipped. </p> <p> If an accessor is null, the X or Y value in the returned PointData objects is always null. If the accessor is non-null, points for which the accessor returns null are not included in the result; if the scale is also non-null, points for which the scale applied to the value returns null are not included in the result. </p> <p> The returned PointDatum objects have the X accessor and Y accessor values (so may be null), and the original datum set to the object from the data. </p>
- * @param (Array) data Input data, list of arbitrary objects
- * @param (rave['internal']['SingleValueFunction']) xAccessor X accessor function, may be null
- * @param (rave['internal']['SingleValueFunction']) xScale Scale to test if the X value should be included, may be null
- * @param (rave['internal']['SingleValueFunction']) yAccessor Y accessor function, may be null
- * @param (rave['internal']['SingleValueFunction']) yScale Scale to test if the Y value should be included, may be null
- * @return (Array) List of PointData objects
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.buildPoints = function(data, xAccessor, xScale, yAccessor, yScale) {
- var result = [];
- if (data) {
- for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- if (o != null) {
- var xv = null;
- if (xAccessor) {
- xv = xAccessor(o);
- if (xv == null || (xScale && xScale(xv) == null)) {
- continue;
- }
- }
- var yv = null;
- if (yAccessor) {
- yv = yAccessor(o);
- if (yv == null || (yScale && yScale(yv) == null)) {
- continue;
- }
- }
- var datum = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
- datum._x = xv;
- datum._y = yv;
- datum._originalData = o;
- result.push(datum);
- }
- }
- }
- return result;
- };
- /**
- * Datum object representing a point with X and Y values. Either X or Y may be null, depending on how the point is used, for example in a scatterplot.
- */
- com_ibm_rave_bundles_data_PointDataUtilities.PointDatum = rave['internal']['Declare']({
- /**
- * The X value
- */
- /** @expose */
- _x : null,
- /**
- * The Y value
- */
- /** @expose */
- _y : null,
- /**
- * The data value (in percentage) that the point represents
- */
- /** @expose */
- _yAsPercentOfCategory : null,
- /**
- * The data value (in percentage) that the point represents
- */
- /** @expose */
- _yAsPercentOfColor : null,
- /**
- * The original data
- */
- /** @expose */
- _originalData : null,
- /** @expose */
- originalData : function() {
- return this._originalData;
- },
- /** @expose */
- originalDataList : function() {
- var list = [];
- list.push(this._originalData);
- return list;
- }
- });
- /**
- * Accessor returning the _x property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR = function(d) {
- return (d)._x;
- };
- /**
- * Accessor returning the _y property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR = function(d) {
- return (d)._y;
- };
- /**
- * Accessor returning the _yAsPercentOfCategory property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(d) {
- var percent = + ((d)._yAsPercentOfCategory);
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- /**
- * Accessor returning the _yAsPercentOfColor property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(d) {
- var percent = + ((d)._yAsPercentOfColor);
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- // $source: com/ibm/rave/bundles/utilities/ColorUtil
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_utilities_ColorUtil = rave['internal']['Declare']({
- });
- /**
- * It is used to get a foreground color which has atleast a 4.5 contrast ratio with the background color.
- * @param (Object) bg bakground color
- * @param (Object) fg foreground color
- * @return (Object) a color ( darker/ligher/same fg color ) which contrast with background.
- */
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0 = function(bg, fg) {
- var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(bg, fg);
- if (contrastRatio < 4.5) {
- var bgHSL = rave.hsl(bg);
- var fgHSL = rave.hsl(fg);
- var brightness = 0.33 * (rave.rgb(bg).getR() / 255.0) + 0.5 * (rave.rgb(bg).getG() / 255.0) + 0.16 * (rave.rgb(bg).getB() / 255.0);
- if (brightness > 0.5) {
- if (bgHSL.getL() > 0.5) {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), bgHSL.getL() - 0.4));
- } else {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), 0.1));
- }
- } else {
- if (bgHSL.getL() < 0.5) {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), bgHSL.getL() + 0.4));
- } else {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), 0.9));
- }
- }
- }
- return fg;
- };
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1 = function(labelColor) {
- var labelRGB = rave.rgb(labelColor);
- return labelRGB.contrastShift(21);
- };
- /** @expose */
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio = function(colorA, colorB) {
- var foregroundLuminance = rave.rgb(colorA).getLuminance();
- var backgroundLuminance = rave.rgb(colorB).getLuminance();
- var contrastRatio = (foregroundLuminance >= backgroundLuminance) ? (foregroundLuminance + 0.05) / (backgroundLuminance + 0.05) : (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
- return contrastRatio;
- };
- /** @expose */
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor = function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1(a0);
- }
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0(a0, a1);
- };
- // $source: com/ibm/rave/bundles/nativeImpl/components/TiledmapV2DataLayerImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- var com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl = (function() {
- //Constructor
- function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl( _type ) {
- this._type = _type;
- this.data = null;
- this.mapData = null;
- this.combined = false;
- this.featureAccessors = null;
- this.typeData = rave.map();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.getType = function()
- {
- return this._type;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setData = function( _data )
- {
- this.data = _data;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setMapData = function( _mapData )
- {
- this.mapData = _mapData;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setCombined = function( _combined )
- {
- this.combined = _combined;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setFeatureAccessors = function( _accessors )
- {
- this.featureAccessors = _accessors;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setTypeData = function( _type, _data )
- {
- this.typeData.set( _type, _data );
- }
- return com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl;
- }());
- // $source: com/ibm/rave/bundles/nativeImpl/components/TiledmapV2FeatureDataMap
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018, 2019
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- var com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap = ( function()
- {
- // setup guid function
- var guid = ( function()
- {
- // Buffer to hold the random numbers
- var buf = typeof Uint8Array === "undefined" ? new Array( 16 ) : new Uint8Array( 16 );
- // Look up table to translate values to hex string (faster than toString( 16 ))
- var lut = new Array( 256 );
- for ( var i = 0; i < 256; ++i )
- lut[i] = ( i < 16 ? "0" : "" ) + i.toString( 16 );
- // setup random values function
- var getRandomValues = ( function( crypto )
- {
- if ( crypto )
- {
- return function( _target )
- {
- return crypto.getRandomValues( _target );
- };
- }
- else
- {
- /**
- * Randomize the array with 8bit unsigned values (using Math.random()).
- * @param _target {Array} The array to randomize.
- * @returns _target {Array} the modified _target array.
- */
- return function( _target )
- {
- for ( var r, i = 0, l = _target.length; i < l; i+=4 )
- {
- r = ( Math.random() * 0xffffffff ) | 0;
- switch ( l - i )
- {
- default: _target[i+3] = ( r >>> 24 ) & 0xff; /*falls through*/
- case 3: _target[i+2] = ( r >>> 16 ) & 0xff; /*falls through*/
- case 2: _target[i+1] = ( r >>> 8 ) & 0xff; /*falls through*/
- case 1: _target[i] = r & 0xff;
- }
- }
- return _target;
- };
- }
- }( typeof crypto !== "undefined" ? crypto : ( typeof msCrypto !== "undefined" ? msCrypto : null ) ) );
- // guid generation function
- return function()
- {
- // Grab new random values
- getRandomValues( buf );
- // Instead of writing a loop the whole concatenation is written out. The number of values is
- // fixed, and this is significantly faster than looping over the array.
- return lut[buf[ 0]] + lut[buf[ 1]] +
- lut[buf[ 2]] + lut[buf[ 3]] +
- lut[buf[ 4]] + lut[buf[ 5]] +
- lut[buf[ 6]|0x40] + lut[buf[ 7]] +
- lut[buf[ 8]|0x80] + lut[buf[ 9]] +
- lut[buf[10]] + lut[buf[11]] +
- lut[buf[12]] + lut[buf[13]] +
- lut[buf[14]] + lut[buf[15]];
- };
- }() );
- // sort point size stops by descending size (the second parameter in the stop array)
- function _sortByPointSizeDesc( _itemA, _itemB )
- {
- var sizeA = _itemA.properties.pointSize ? _itemA.properties.pointSize : null;
- var sizeB = _itemB.properties.pointSize ? _itemB.properties.pointSize : null;
- // handle nulls
- if ( ( sizeA === null ) && ( sizeB === null ) )
- return 0;
- if ( sizeA === null )
- return 1;
- if ( sizeB === null )
- return -1;
- return sizeB - sizeA;
- }
- function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap()
- {
- this._itemMapById = rave.map();
- this._itemMapByKey = rave.map();
- this._itemMap = rave.map();
- this._featuresByTileSet = rave.map();
- this._featureById = rave.map();
- this._fidIdx = 0;
- this._tileSets = rave.map();
- this._combinedLayers = false;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._itemMapById = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._itemMapByKey = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._itemMap = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._fidIdx = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._tileSets = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._featuresByTileSet = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._featureById = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._combinedLayers = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.setCombinedLayers = function( _combinedLayers )
- {
- this._combinedLayers = _combinedLayers;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.add = function( _dataLayer, _data, _key, _feature )
- {
- var item = {
- id: guid(),
- data: {},
- dataSet: {},
- layerIds: {},
- tileSets: {},
- key: _key,
- hasValueAccessor: false,
- hasPointColorAccessor: false,
- hasPointSizeAccessor: false
- };
- var feature;
- if ( _feature )
- {
- // set feature
- feature = _feature;
- // From version 170513 the type of the pk key changed from number to string.
- // To be able to support multiple atlas services, we need to support multiple
- // key types as well.
- if ( feature.pk )
- {
- var pkNumber = false;
- var version = +( feature.mapid.substr( feature.mapid.length - 6,6 ) );
- // check map version, from this version the pk type changed to string
- if ( version >= 170513 )
- item.pk = feature.pk;
- else
- item.pk = +feature.pk;
- }
- if ( feature.location )
- item.fid = "f" + this._nextFid();
- if ( feature.bbox )
- item.bbox = feature.bbox;
- // this is a normal feature
- if ( feature.mapid )
- feature.mapid = "ibmrave." + feature.mapid;
- }
- else if ( !this._combinedLayers && this._hasCustomPolygonData( _dataLayer ) )
- {
- feature = this._getCustomPolygonFeature( _dataLayer );
- var featureId = this._getFeatureId( _dataLayer, _data );
- item[ feature.property ] = featureId;
- }
- else
- {
- item.fid = "f" + this._nextFid();
- // build an adhoc feature from the geoData
- feature = this._buildFeatureFromGeoData( _dataLayer, _data );
- if ( !feature )
- return;
- }
- // setup datalayer and data
- this._setupData( item, _dataLayer, feature, _data );
- // setup lookups
- this._itemMapById.set( item.id, item );
- if ( item.key )
- this._itemMapByKey.set( item.key, item );
- if ( item.fid )
- this._createGeoJSON( _dataLayer, item );
- if ( item.bbox )
- this._addGeoJSONBBox( _dataLayer, item );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.update = function( _dataLayer, _data, _key, _feature )
- {
- var item = this._itemMapByKey.get( _key );
- if ( !item )
- return;
- // setup datalayer and data
- this._setupData( item, _dataLayer, _feature, _data );
- if ( item.fid )
- this._createGeoJSON( _dataLayer, item );
- if ( item.bbox )
- this._addGeoJSONBBox( _dataLayer, item );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.hasFeature = function( _featureKey )
- {
- return this._itemMapByKey.has( _featureKey );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getById = function( _id )
- {
- return this._itemMapById.get( _id );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getByKey = function( _key )
- {
- return this._itemMapByKey.get( _key );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getItem = function( _tileSetId, _layerId, _properties )
- {
- var tileSets = this.getTileSets( { id: _tileSetId } );
- var tileSet = null;
- var key = null;
- if ( !tileSets.length )
- return null;
- // find the tileSet with the correct layer
- tileSets.some( function( _tileSet )
- {
- // verify the tileSet layer
- if ( _tileSet[ _tileSet.layer ] === _layerId )
- {
- tileSet = _tileSet;
- return true;
- }
- return false;
- } );
- if ( !tileSet )
- return null;
- // If we're using a combined layers, the tileset property will be the same for all tilesets.
- // Otherwise, the key should be separate per tileset.
- if ( this._combinedLayers )
- key = tileSet.property + "-" + _properties[ tileSet.property ];
- else
- key = tileSet.id + "-" + tileSet[ tileSet.layer ] + "-" + tileSet.property + "-" + _properties[ tileSet.property ];
- return this._itemMap.get( key );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getMapFilter = function( _tileSet )
- {
- var expression = [ "in", _tileSet.property ];
- var keysForTileSet = this._itemMapById.values().filter( function( _item )
- {
- return _item.tileSets[ _tileSet.type ] && _item.tileSets[ _tileSet.type ].id === _tileSet.id;
- } ).forEach( function( _item )
- {
- // loop the pk's and add them to the expression
- expression.push( _item[_tileSet.property] );
- } );
- return expression;
- },
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getFeatures = function( _tileSetId )
- {
- var featuresInfo = this._featuresByTileSet.get( _tileSetId );
- if ( featuresInfo )
- {
- // Check if the features need to be sorted.
- // We want to sort the features by size, so that small points show before bigger ones.
- // The order of the features depends on the way they're added to the GeoJSON
- if ( !featuresInfo.sorted )
- {
- featuresInfo.features.sort( _sortByPointSizeDesc );
- featuresInfo.sorted = true;
- }
- return featuresInfo.features;
- }
- return [];
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getTileSets = function( _filter )
- {
- var tileSets = [];
- var keys = _filter ? Object.keys( _filter ) : null;
- this._tileSets.forEach( function( _tileSetKey, _tileSet )
- {
- if ( !keys || keys.every( function( _key ) { return _filter[_key] === _tileSet[_key] } ) )
- tileSets.push( _tileSet );
- } );
- return tileSets;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.size = function()
- {
- return this._itemMapById.size();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.clear = function()
- {
- this._itemMapById = rave.map();
- this._itemMapByKey = rave.map();
- this._itemMap = rave.map();
- this._fidIdx = 0;
- this._tileSets = rave.map();
- this._featuresByTileSet = rave.map();
- this._featureById = rave.map();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.updateDataLayerProperties = function( _dataLayer )
- {
- var self = this;
- this._itemMapById.forEach( function( _id, _item )
- {
- var dataSetId = _dataLayer.getType();
- _dataLayer.typeData.forEach( function( _type, _typeData )
- {
- var tileSet = _item.tileSets[ _type ];
- // check for vector tileSet or geoJson tileSet with same ID
- if ( tileSet && ( ( tileSet.tileType === "vector" ) || ( tileSet.id === self._getAdhocTileId( _type, dataSetId ) ) ) )
- self._updateTypeDataProperties( _type, _typeData, _item );
- } );
- } );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.filter = function( _filter, _sortBy )
- {
- // TODO: make this more generic
- if ( _sortBy )
- {
- // use a rave map for sorting, when requesting the values() they are sorted by key
- var sorted = rave.map();
- this._itemMapById.values().forEach( function( _item )
- {
- if ( _item.tileSets[ _filter.type ] && ( _item.tileSets[ _filter.type ].id === _filter.tileSet ) && _item.layerIds[ _filter.type ] && ( _item.layerIds[ _filter.type ] === _filter.layer ) )
- sorted.set( _item[ _sortBy ], _item );
- } );
- return sorted.values();
- }
- else
- {
- return this._itemMapById.values().filter( function( _item )
- {
- return _item.tileSets[ _filter.type ] && ( _item.tileSets[ _filter.type ].id === _filter.tileSet ) && _item[ _filter.property ];
- } );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._addItem = function( _tileSet, _item )
- {
- var key;
- // If we're using a combined layers, the tileset property will be the same for all tilesets.
- // Otherwise, the key should be separate per tileset.
- if ( this._combinedLayers )
- key = _tileSet.property + "-" + _item[ _tileSet.property ];
- else
- key = _tileSet.id + "-" + _tileSet[ _tileSet.layer ] + "-" + _tileSet.property + "-" + _item[ _tileSet.property ];
- this._itemMap.set( key, _item );
- },
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._hasCustomPolygonData = function( _dataLayer )
- {
- var hasCustomPolygonData = false;
- // since custom polygon data is not available for combined layers we can safely loop the dataLayers (which will be just 1)
- _dataLayer.typeData.forEach( function( _type, _typeData )
- {
- hasCustomPolygonData = hasCustomPolygonData || _typeData.hasOwnProperty( "customPolygon" ) && ( _typeData.customPolygon !== null ) && ( typeof _typeData.customPolygon !== "undefined" );
- } );
- return hasCustomPolygonData;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getCustomPolygonFeature = function( _dataLayer )
- {
- var feature = {
- mapid: null,
- polyLayer: null,
- pointLayer: null,
- property: null,
- customPolygon: true
- };
- // since custom polygon data is not available for combined layers we can safely loop the dataLayers (which will be just 1)
- _dataLayer.typeData.forEach( function( _type, _typeData )
- {
- feature.mapid = _typeData.customPolygon.mapId;
- if ( _type === "region" )
- feature.polyLayer = _typeData.customPolygon.layerName;
- else
- feature.pointLayer = _typeData.customPolygon.layerName;
- feature.property = _typeData.customPolygon.propertyName;
- } );
- return feature;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getFeatureId = function( _dataLayer, _data )
- {
- var featureAccessor = _dataLayer.featureAccessors[ 0 ];
- if ( featureAccessor )
- {
- var geoData = featureAccessor( _data );
- if ( ( typeof geoData === "object" ) && ( geoData.featureId !== null ) )
- return geoData.featureId;
- }
- return null;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._setupData = function( _item, _dataLayer, _feature, _data )
- {
- var dataSetId = _dataLayer.getType();
- var self = this;
- var nullColor = null;
- _dataLayer.typeData.forEach( function( _type, _typeData )
- {
- if ( _type === "region" )
- {
- self._setupRegionData( _item, _feature, _data, dataSetId, _type, _typeData );
- nullColor = _typeData.nullColor;
- }
- else
- {
- self._setupPointData( _item, _feature, _data, dataSetId, _type, _typeData );
- }
- } );
- // special case for combined layer
- // add a null value is there are no accessors
- if ( this._combinedLayers && !_item.hasValueAccessor && !_item.hasPointColorAccessor && !_item.hasPointSizeAccessor )
- _item.fillColor = nullColor;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._setupRegionData = function( _item, _feature, _data, _dataSetId, _type, _typeData )
- {
- if ( ( _feature.mapid && _feature.polyLayer ) || ( _feature.location ) )
- {
- var tileSet;
- // add tileset info, favor the mapid/polylayer over the location
- if ( _feature.mapid && _feature.polyLayer )
- {
- tileSet = { type: _type, id: _feature.mapid, tileType: "vector", layer: "polyLayer", polyLayer: _type + "-" + _feature.polyLayer, sourceLayer: _feature.polyLayer, opacityProp: "fill-opacity", transparency: _typeData.transparency };
- tileSet.property = ( _feature.property ) ? _feature.property : "pk";
- }
- else
- {
- tileSet = { type: _type, id: this._getAdhocTileId( _type, _dataSetId ), tileType: "geojson", layer: "polyLayer", polyLayer: this._getAdhocLayerId( _dataSetId, "geopoly" ), opacityProp: "circle-opacity", property: "fid", transparency: _typeData.transparency };
- // remember point location
- if ( _feature.location )
- _item[ _type ] = _feature.location;
- }
- tileSet.customPolygon = _feature.customPolygon || false;
- tileSet.propertyType = tileSet.customPolygon ? null : typeof _item[ tileSet.property ];
- _item.tileSets[ _type ] = tileSet;
- this._addTileSet( tileSet );
- layerId = tileSet.polyLayer;
- // set layerId
- _item.layerIds[ _type ] = layerId;
- // set data
- _item.data[ layerId ] = _data;
- _item.dataSet[ layerId ] = _dataSetId;
- // type data
- if ( _typeData.valueAccessor )
- {
- _item.value = _typeData.valueAccessor( _data );
- _item.hasValueAccessor = true;
- }
- else if ( !this._combinedLayers )
- {
- _item.value = null;
- }
- // add item
- this._addItem( tileSet, _item );
- // update type data properties
- this._updateTypeDataProperties( _type, _typeData, _item );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._setupPointData = function( _item, _feature, _data, _dataSetId, _type, _typeData )
- {
- var tileSet;
- // add tileset info
- if ( _feature.location )
- {
- tileSet = { type: _type, id: this._getAdhocTileId( _type, _dataSetId ), tileType: "geojson", layer: "pointLayer", pointLayer: this._getAdhocLayerId( _dataSetId, "geopoint" ), property: "fid", transparency: _typeData.transparency };
- }
- else
- {
- tileSet = { type: _type, id: _feature.mapid, tileType: "vector", layer: "pointLayer", pointLayer: _type + "-" + _feature.pointLayer, sourceLayer: _feature.pointLayer, transparency: _typeData.transparency };
- tileSet.property = ( _feature.property ) ? _feature.property : "pk";
- }
- tileSet.customPolygon = _feature.customPolygon || false;
- tileSet.propertyType = tileSet.customPolygon ? null : typeof _item[ tileSet.property ];
- _item.tileSets[ _type ] = tileSet;
- this._addTileSet( tileSet );
- layerId = tileSet.pointLayer;
- // set layerId
- _item.layerIds[ _type ] = layerId;
- // set data
- _item.data[ layerId ] = _data;
- _item.dataSet[ layerId ] = _dataSetId;
- // remember point location
- if ( _feature.location )
- _item[ _type ] = _feature.location;
- if ( _typeData.pointColorAccessor || _typeData.pointSizeAccessor )
- {
- if ( _typeData.pointColorAccessor )
- {
- _item.pointColorValue = _typeData.pointColorAccessor( _data );
- _item.hasPointColorAccessor = true;
- }
- else
- {
- _item.pointColorValue = null;
- }
- if ( _typeData.pointSizeAccessor )
- {
- _item.pointSizeValue = _typeData.pointSizeAccessor( _data )
- _item.hasPointSizeAccessor = true;
- }
- else
- {
- _item.pointSizeValue = null;
- }
- }
- // draw defaultSized points when there are no accessors mapped
- else if ( !this._combinedLayers )
- {
- _item.pointColor = _typeData.nullColor;
- _item.pointSize = _typeData.defaultPointSize;
- }
- // add item
- this._addItem( tileSet, _item );
- // update type data properties
- this._updateTypeDataProperties( _type, _typeData, _item );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getAdhocTileId = function( _type, _dataLayerId )
- {
- return _type + "." + _dataLayerId + ".adhocGeo";
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getAdhocLayerId = function( _dataLayerId, _layer )
- {
- return _dataLayerId + "." + _layer;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._createGeoJSON = function( _dataLayer, _item )
- {
- // build GeoJSON objects for each type of data
- var keys = _dataLayer.typeData.keys();
- for ( var idx = 0, size = keys.length; idx < size; ++idx )
- {
- var type = keys[ idx ];
- // check if there's location data
- if ( _item[ type ] )
- this._addGeoJSONPoint( this._getAdhocTileId( type, _dataLayer.getType() ), _item, type );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._addGeoJSONPoint = function( _tileSetId, _item, _coordinatesField )
- {
- // get features info for tileSet
- var featuresInfo = this._featuresByTileSet.get( _tileSetId );
- if ( !featuresInfo )
- {
- featuresInfo = {
- features: [],
- sorted: false
- };
- this._featuresByTileSet.set( _tileSetId, featuresInfo );
- }
- // reset sorted, since adding features requires re-sort
- featuresInfo.sorted = false;
- // build GeoJSON feature
- var feature = this._featureById.get( _item.fid );
- if ( !feature )
- {
- feature = {
- type: "Feature",
- geometry: {
- type: "Point",
- coordinates: _item[ _coordinatesField ]
- },
- properties: {
- fid: _item.fid
- }
- };
- this._featureById.set( _item.fid, feature )
- }
- if ( _item.pointSize )
- feature.properties.pointSize = _item.pointSize;
- // add feature
- featuresInfo.features.push( feature );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._addGeoJSONBBox = function( _dataLayer, _item )
- {
- // bbox will only be available on regions
- var tileSet = _item.tileSets[ "region" ];
- if ( _dataLayer.typeData.has( "region" ) && tileSet )
- {
- var tileSetId = tileSet.id;
- var featuresInfo = this._featuresByTileSet.get( tileSetId );
- if ( !featuresInfo )
- {
- featuresInfo = {
- features: [],
- sorted: true
- };
- this._featuresByTileSet.set( tileSetId, featuresInfo );
- }
- // build GeoJSON feature
- var rect = _item.bbox;
- var feature = {
- type: "Feature",
- geometry: {
- type: "Polygon",
- coordinates: [ [
- [ rect[ 0 ], rect[ 1 ] ],
- [ rect[ 2 ], rect[ 1 ] ],
- [ rect[ 2 ], rect[ 3 ] ],
- [ rect[ 0 ], rect[ 3 ] ],
- [ rect[ 0 ], rect[ 1 ] ] ] ]
- }
- };
- // add feature
- featuresInfo.features.push( feature );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._nextFid = function()
- {
- return ++this._fidIdx;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._addTileSet = function( _tileSet )
- {
- var key = this._buildKey( _tileSet );
- if ( !this._tileSets.has( key ) )
- this._tileSets.set( key, _tileSet );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._buildKey = function( _tileSet )
- {
- return Object.keys( _tileSet ).map( function( _key )
- {
- return _tileSet[ _key ];
- } ).join( "|" );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._updateTypeDataProperties = function( _type, _typeData, _item )
- {
- switch( _type )
- {
- case "region":
- // set value and color
- if ( _item.hasOwnProperty( "value" ) )
- {
- var color = _typeData.nullColor;
- if ( _item.value !== null )
- color = _typeData.palette( _item.value );
- _item.fillColor = color ? color : _typeData.nullColor;
- }
- break;
- case "point":
- // set point color
- if ( _item.hasOwnProperty( "pointColorValue" ) )
- {
- if ( _item.pointColorValue !== null )
- {
- var color = _typeData.palette( _item.pointColorValue );
- _item.pointColor = color ? color : _typeData.nullColor;
- }
- else
- {
- _item.pointColor = _typeData.nullColor;
- }
- }
- // set point size
- if ( _item.hasOwnProperty( "pointSizeValue" ) )
- {
- var pointSize = _item.pointSizeValue;
- if ( pointSize != null )
- {
- if ( ( pointSize === 0 ) && ( _typeData.staticZeroValuePointSize !== null ) )
- {
- _item.pointSize = _typeData.staticZeroValuePointSize;
- _item.hasStaticZeroValuePointSize = true;
- }
- else
- {
- _item.pointSize = _typeData.pointSizeScale( pointSize );
- }
- }
- else
- {
- _item.pointSize = _typeData.defaultPointSize;
- }
- }
- break;
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._buildFeatureFromGeoData = function( _dataLayer, _data )
- {
- var feature = null;
- var featureAccessor = _dataLayer.featureAccessors[ 0 ];
- if ( featureAccessor )
- {
- var geoData = featureAccessor( _data );
- if ( typeof geoData === "object" )
- {
- feature = {};
- if ( geoData.hasOwnProperty( "latitude" ) && geoData.hasOwnProperty( "longitude" ) )
- // mapbox uses a longitude, latitude notation
- feature.location = [ geoData.longitude, geoData.latitude ];
- }
- }
- return feature;
- }
- return com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap;
- }());
- // $source: com/ibm/rave/bundles/nativeImpl/components/TiledmapV2MapDataCache
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- var com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache = ( function()
- {
- function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache()
- {
- this.version = 0;
- this._itemMap = rave.map();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.version = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype._itemMap = null;
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.refreshCache = function( _dataLayers )
- {
- var cacheUpdated = false;
- // get current keys
- var curKeys = rave.set( this._itemMap.keys() );
- var touchedKeys = rave.set();
- // iterate data layers
- for ( var layerIdx = 0, layerSize = _dataLayers.length; layerIdx < layerSize; ++layerIdx )
- {
- var layer = _dataLayers[ layerIdx ];
-
- // extract mapData
- if ( layer.mapData )
- {
- for ( var itemIdx = 0, itemSize = layer.mapData.length; itemIdx < itemSize; ++itemIdx )
- {
- var item = layer.mapData[ itemIdx ];
- var key = this._buildKey( layer.getType(), this._extractNames( item ) );
- if ( curKeys.has( key ) )
- {
- // compare PKs to check if it's the same item
- var cacheItem = this._itemMap.set( key, item );
- if ( cacheItem.pk === item.pk )
- {
- touchedKeys.add( key );
- curKeys.remove( key );
- }
- }
- else if ( !touchedKeys.has( key ) )
- {
- this._itemMap.set( key, item );
- touchedKeys.add( key );
- cacheUpdated = true;
- }
- }
- }
- }
- // check if there are item which need to be dropped from the cache
- if ( curKeys.size() > 0 )
- {
- var self = this;
- curKeys.forEach( function( _key )
- {
- self._itemMap.remove( _key );
- } );
- cacheUpdated = true;
- }
-
- // update version when data was updated
- if ( cacheUpdated )
- this.version++;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.get = function( _key )
- {
- return this._itemMap.get( _key );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.size = function()
- {
- return this._itemMap.size();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.clear = function()
- {
- this._itemMap = rave.map();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.getKey = function( _layerType, _arrKeys )
- {
- return this._buildKey( _layerType, _arrKeys );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype._buildKey = function( _layerType, _arrKeys )
- {
- return _layerType + "|" + _arrKeys.join( "|" );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype._extractNames = function( _item/*, _names */ )
- {
- var names = arguments.length > 1 ? arguments[ 1 ] : [];
- names.push( _item.name );
- if ( _item.refine )
- {
- for ( var idx = 0, size = _item.refine.length; idx < size; ++idx )
- names.push( _item.refine[ idx ] );
- }
- return names;
- }
-
- return com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache;
- }());
- // $source: com/ibm/rave/bundles/nativeImpl/components/TiledmapV2RegionTypeDataImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017,2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- var com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl = (function() {
- //Constructor
- function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl() {
- this.paletteDef = null;
- this.palette = null;
- this.nullColor = null;
- this.transparency = null;
- this.valueAccessor = null;
- this.minValue = null;
- this.maxValue = null;
- this.hasGeoData = false;
- this.customPolygon = null;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.setPaletteDef = function( _paletteDef )
- {
- this.paletteDef = _paletteDef;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.setPalette = function( _palette )
- {
- this.palette = _palette;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.setNullColor = function( _nullColor )
- {
- this.nullColor = _nullColor;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.setTransparency = function( _transparency )
- {
- this.transparency = _transparency;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.setHasGeoData = function( _hasGeoData )
- {
- this.hasGeoData = _hasGeoData;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.setValueAccessor = function( _accessor )
- {
- this.valueAccessor = _accessor;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.minimumValue = function( _minValue )
- {
- this.minValue = _minValue;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.maximumValue = function( _maxValue )
- {
- this.maxValue = _maxValue;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl.prototype.setCustomPolygon = function( _mapId, _layerName, _propertyName )
- {
- if ( _mapId && _layerName && _propertyName )
- {
- this.customPolygon = {
- mapId: _mapId,
- layerName: _layerName,
- propertyName: _propertyName
- };
- }
- }
- return com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl;
- }());
- // $source: com/ibm/rave/bundles/nativeImpl/components/TiledmapV2PointTypeDataImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017,2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- var com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl = (function() {
- //Constructor
- function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl() {
- this.paletteDef = null;
- this.palette = null;
- this.nullColor = null;
- this.transparency = null;
- this.pointColorAccessor = null;
- this.pointSizeAccessor = null;
- this.pointSizeScale = null;
- this.defaultPointSize = null;
- this.staticZeroValuePointSize = null;
- this.hasGeoData = false;
- this.customPolygon = null;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setPaletteDef = function( _paletteDef )
- {
- this.paletteDef = _paletteDef;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setPalette = function( _palette )
- {
- this.palette = _palette;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setNullColor = function( _nullColor )
- {
- this.nullColor = _nullColor;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setTransparency = function( _transparency )
- {
- this.transparency = _transparency;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setHasGeoData = function( _hasGeoData )
- {
- this.hasGeoData = _hasGeoData;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setPointColorAccessor = function( _accessor )
- {
- this.pointColorAccessor = _accessor;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setPointSizeAccessor = function( _accessor )
- {
- this.pointSizeAccessor = _accessor;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setPointSizeScale = function( _scale )
- {
- this.pointSizeScale = _scale;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setDefaultPointSize = function( _size )
- {
- this.defaultPointSize = _size;
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setStaticZeroValuePointSize = function( _size )
- {
- this.staticZeroValuePointSize = _size;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl.prototype.setCustomPolygon = function( _mapId, _layerName, _propertyName )
- {
- if ( _mapId && _layerName && _propertyName )
- {
- this.customPolygon = {
- mapId: _mapId,
- layerName: _layerName,
- propertyName: _propertyName
- };
- }
- }
- return com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl;
- }());
- // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModule
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2015
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // Must be the first import
- // @import ./BundleModuleHeader
- // expose DataFormatter to the global variable rave
- //rave["library"]["CustomFormatter"]=com_ibm_rave_library_framework_CustomFormatter;
- // $source: com/ibm/rave/bundles/tiledmapV2Bundle/TiledmapV2Bundle
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/library/Library (static) // Library
- //@import com/ibm/rave/bundles/RaveBundle (loadtime) // superclass
- //@import com/ibm/rave/bundles/tiledmapV2Bundle/TiledmapV2View (runtime) // new
- var com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle = rave['internal']['Declare'](com_ibm_rave_bundles_RaveBundle, {
- //mapboxSecretToken : null,
- //mapboxAccoutName : null,
- mapboxtoken : "",
- /** @expose */
- getName : function() {
- return com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.BUNDLE_NAME;
- },
- /** @expose */
- createView : function(ctx) {
- ctx.properties.property("tiledmap.token").value(this.mapboxtoken);
- return new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View(ctx);
- },
- /** @expose */
- _doConfigure : function(configurations, userCallback, bundle) {
- if (configurations) {
- this.mapboxSecretToken = configurations["Mapbox.secretToken"];
- this.mapboxAccoutName = configurations["Mapbox.accountName"];
- this.mapboxtoken = configurations["Mapbox.token"];
- }
- if ((this.mapboxSecretToken != null) && (this.mapboxAccoutName != null)) {
- var requestURL = "https://api.mapbox.com/styles/v1/" + this.mapboxAccoutName + "?access_token=" + this.mapboxSecretToken;
- var self = this;
- rave.json(requestURL, function(error, response) {
- if (response) {
- var properties = bundle.info().properties();
- properties.forEach(function(currentValue, index, array) {
- if (currentValue.simpleId() == "style") {
- var responseArray = response;
- for (var __i_enFor0 = 0, __exp_enFor0 = responseArray, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var obj = __exp_enFor0[__i_enFor0];
- var style = obj;
- var styleID = ""+(style["id"]);
- var styleName = ""+(style["name"]);
- var value = "mapbox://style/" + self.mapboxAccoutName + "/" + styleID;
- var catalogEntry = {};
- var messages = new rave['library']['internal']['MessagesRegistry']();
- var catalog = null;
- var newOption = null;
- catalogEntry[styleID] = styleName;
- catalog = rave['library']['internal']['Messages'].createFromCatalog(catalogEntry, bundle.locale());
- messages.add(bundle.locale(), catalog);
- newOption = new rave['library']['internal']['StringPropertyOption'](value, ""+(style["id"]), messages);
- currentValue.options().push(newOption);
- if (styleName == "Default") {
- currentValue.setDefaultValue(value);
- }
- }
- }
- return currentValue;
- });
- }
- if (userCallback) {
- userCallback();
- }
- });
- } else if (userCallback) {
- userCallback();
- }
- }
- //constructor : function() {}
- });
- /**
- * Register the bundle factory with the library. The bundle will not be made available if this method is not called.
- */
- /** @expose */
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.init = function() {
- if (!(com_ibm_rave_library_Library.bundle.isRegistered(com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.BUNDLE_NAME))) {
- var bundle;
- com_ibm_rave_library_Library.bundle.extension(com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.BUNDLE_NAME, function() {
- if (!bundle) {
- bundle = new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle();
- bundle.loadResources();
- require("./mapbox-gl.css");
- require("./vizlibrary-tiledmap.css");
- }
- return bundle;
- });
- }
- return com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.BUNDLE_NAME;
- };
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.BUNDLE_NAME = "tiledmapV2Bundle";
- // Auto initialization
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.init();
- if (!com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.BUNDLE_NAME]) {
- com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle.BUNDLE_NAME] = function() {
- if (!bundle) {
- bundle = new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2Bundle();
- bundle.loadResources();
- require("./mapbox-gl.css");
- require("./vizlibrary-tiledmap.css");
- }
- return bundle;
- };
- } else {
- console.log("Could not register extension: TiledmapV2Bundle");
- }
- // $source: com/ibm/rave/bundles/tiledmapV2Bundle/TiledmapV2View
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2019
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/views/BundleView (loadtime) // superclass
- //@import com/ibm/rave/bundles/nativeImpl/components/TiledmapV2DataLayerImpl (runtime) // new
- //@import com/ibm/rave/bundles/nativeImpl/components/TiledmapV2NativeSubComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/nativeImpl/components/TiledmapV2RegionTypeDataImpl (runtime) // new
- //@import com/ibm/rave/library/Library (runtime) // Library
- //@import com/ibm/rave/bundles/nativeImpl/components/TiledmapV2PointTypeDataImpl (runtime) // new
- /**
- * <p> A map chart view. For this example, additional files are required to be loaded in addition to the usual data schema, data file, properties, etc. We must also load at least one GeoJSON file, and a palette file as well. </p> <p> The input data properties are the feature name (which could be used to find features in the GeoJSON, if the features there have some kind of id), Standard Color (a numeric referencing a standard palette), Continuous Color (a numeric referencing a continuous palette), and the label that appears on the feature if the features are to be labelled. </p> <p> Properties required for maps are: GeoJSON: A string for one or more GeoJSON URL's required for this map. scale: A default scale for the map missingFeatureColor: The default color assigned to a feature we do not have a color for. borderColor: Color of the borders between features borderThickness: The border thickness. showLabels: If true, display labels. featureLabelFont: The font of the feature labels. featureLabelColor: The color for the feature labels. featureLabelSize: The size for the feature labels. mapProjection: Map Projection Type-- default is mercator; legendDisplay: boolean, to show or hide the legend. legendPosition: The legend position in the chart. </p>
- */
- var com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View = rave['internal']['Declare'](com_ibm_rave_bundles_views_BundleView, {
- //_mapComponent : null,
- //_mapInitializedCallback : null,
- //_maxZoom : null,
- //_mapLocale : null,
- //_mapStyle : null,
- //_registeredEventHandlers : null,
- //_lastChartRect : null,
- //_combinedLayerMapping : null,
- //_regionLayerMapping : null,
- //_pointLayerMapping : null,
- //_latlongLayerMapping : null,
- //_combinedLegendMapping : null,
- //_pointLegendMapping : null,
- //_latlongLegendMapping : null,
- //_delayedInit : null,
- _mapInitialized : false,
- /** @expose */
- constructor : function(context) {
- },
- /** @expose */
- setup : function() {
- com_ibm_rave_bundles_views_BundleView.prototype.setup.call(this);
- var self = this;
- var action = this.context.actions.action("highlight");
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (self._mapComponent) {
- self._mapComponent.highlightAction(args[0]);
- }
- }
- };
- return _$self;
- }
- }))());
- action = this.context.actions.action("select");
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (self._mapComponent) {
- self._mapComponent.selectAction(args[0]);
- }
- }
- };
- return _$self;
- }
- }))());
- action = this.context.actions.action("deselect");
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (self._mapComponent) {
- self._mapComponent.deselectAction(args[0]);
- }
- }
- };
- return _$self;
- }
- }))());
- action = this.context.actions.action("deselectAll");
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (self._mapComponent) {
- self._mapComponent.deselectAllAction();
- }
- }
- };
- return _$self;
- }
- }))());
- action = this.context.actions.action("locate");
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {};
- return _$self;
- },
- get : function(_id) {
- if (_id == "locator") {
- return new (rave['internal']['Declare']({
- getItemsAtPoint : function(_point) {
- if (self._mapComponent) {
- return self._mapComponent.getItemsAtPoint(_point);
- }
- return [];
- },
- getItemsInRect : function(_points) {
- if (self._mapComponent) {
- return self._mapComponent.getItemsInRect(_points);
- }
- return [];
- }
- }))();
- }
- return null;
- }
- }))());
- action = this.context.actions.action("zoom");
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {};
- return _$self;
- },
- get : function(_id) {
- if (_id == "state") {
- return new (rave['internal']['Declare']({
- getBoundingBox : function() {
- if (self._mapComponent) {
- return self._mapComponent.getBoundingBox();
- }
- return null;
- },
- setBoundingBox : function(_bbox) {
- if (self._mapComponent) {
- self._mapComponent.setBoundingBox(_bbox);
- }
- }
- }))();
- }
- return null;
- }
- }))());
- this._combinedLayerMapping = {};
- this._combinedLayerMapping["featureLvl1"] = "featureLvl1";
- this._combinedLayerMapping["featureLvl2"] = "featureLvl2";
- this._combinedLayerMapping["featureLvl3"] = "featureLvl3";
- this._combinedLayerMapping["fill"] = "value";
- this._combinedLayerMapping["pointSize"] = "pointSize";
- this._combinedLayerMapping["pointColor"] = "pointColor";
- this._combinedLayerMapping["region.palette"] = "color.palette";
- this._combinedLayerMapping["region.alt.palette"] = "region.palette";
- this._combinedLayerMapping["region.transparency"] = "color.fillTransparency";
- this._combinedLayerMapping["region.mapData"] = "region.mapData";
- this._combinedLayerMapping["region.custom.mapId"] = "region.custom.mapId";
- this._combinedLayerMapping["region.custom.layerName"] = "region.custom.layerName";
- this._combinedLayerMapping["region.custom.propertyName"] = "region.custom.propertyName";
- this._combinedLayerMapping["point.palette"] = "color.palette";
- this._combinedLayerMapping["point.alt.palette"] = "point.palette";
- this._combinedLayerMapping["point.transparency"] = "color.pointTransparency";
- this._combinedLayerMapping["point.mapData"] = "point.mapData";
- this._combinedLayerMapping["point.minSize"] = "minPointSize";
- this._combinedLayerMapping["point.maxSize"] = "maxPointSize";
- this._combinedLayerMapping["point.defaultSize"] = "point.defaultSize";
- this._combinedLayerMapping["point.staticZeroValueSize"] = "staticZeroValuePointSize";
- this._combinedLayerMapping["point.custom.mapId"] = "point.custom.mapId";
- this._combinedLayerMapping["point.custom.layerName"] = "point.custom.layerName";
- this._combinedLayerMapping["point.custom.propertyName"] = "point.custom.propertyName";
- this._combinedLayerMapping["legend.pointsize.title"] = "legend.pointsize.title";
- this._combinedLayerMapping["legend.pointcolor.title"] = "legend.pointcolor.title";
- this._combinedLegendMapping = {};
- this._combinedLegendMapping["pointSize"] = 0;
- this._combinedLegendMapping["pointColor"] = 1;
- this._regionLayerMapping = {};
- this._regionLayerMapping["featureLvl1"] = "featureLvl1";
- this._regionLayerMapping["featureLvl2"] = "featureLvl2";
- this._regionLayerMapping["featureLvl3"] = "featureLvl3";
- this._regionLayerMapping["fill"] = "fill";
- this._regionLayerMapping["region.palette"] = "region.palette";
- this._regionLayerMapping["region.alt.palette"] = "region.palette";
- this._regionLayerMapping["region.transparency"] = "region.transparency";
- this._regionLayerMapping["region.mapData"] = "region.mapData";
- this._regionLayerMapping["region.custom.mapId"] = "region.custom.mapId";
- this._regionLayerMapping["region.custom.layerName"] = "region.custom.layerName";
- this._regionLayerMapping["region.custom.propertyName"] = "region.custom.propertyName";
- this._pointLayerMapping = {};
- this._pointLayerMapping["featureLvl1"] = "featureLvl1";
- this._pointLayerMapping["featureLvl2"] = "featureLvl2";
- this._pointLayerMapping["featureLvl3"] = "featureLvl3";
- this._pointLayerMapping["pointSize"] = "pointSize";
- this._pointLayerMapping["pointColor"] = "pointColor";
- this._pointLayerMapping["point.palette"] = "point.palette";
- this._pointLayerMapping["point.alt.palette"] = "point.palette";
- this._pointLayerMapping["point.transparency"] = "point.transparency";
- this._pointLayerMapping["point.mapData"] = "point.mapData";
- this._pointLayerMapping["point.minSize"] = "point.minSize";
- this._pointLayerMapping["point.maxSize"] = "point.maxSize";
- this._pointLayerMapping["point.defaultSize"] = "point.defaultSize";
- this._pointLayerMapping["point.staticZeroValueSize"] = "point.staticZeroValueSize";
- this._pointLayerMapping["point.custom.mapId"] = "point.custom.mapId";
- this._pointLayerMapping["point.custom.layerName"] = "point.custom.layerName";
- this._pointLayerMapping["point.custom.propertyName"] = "point.custom.propertyName";
- this._pointLayerMapping["legend.pointsize.title"] = "legend.pointsize.title";
- this._pointLayerMapping["legend.pointcolor.title"] = "legend.pointcolor.title";
- this._pointLayerMapping["sizeLegend"] = "g.legend.size";
- this._pointLayerMapping["colorLegend"] = "g.legend.point";
- this._pointLegendMapping = {};
- this._pointLegendMapping["pointSize"] = 0;
- this._pointLegendMapping["pointColor"] = 1;
- this._latlongLayerMapping = {};
- this._latlongLayerMapping["pointSize"] = "latlongSize";
- this._latlongLayerMapping["pointColor"] = "latlongColor";
- this._latlongLayerMapping["point.palette"] = "latlong.palette";
- this._latlongLayerMapping["point.alt.palette"] = "latlong.palette";
- this._latlongLayerMapping["point.transparency"] = "latlong.transparency";
- this._latlongLayerMapping["point.minSize"] = "latlong.minSize";
- this._latlongLayerMapping["point.maxSize"] = "latlong.maxSize";
- this._latlongLayerMapping["point.defaultSize"] = "latlong.defaultSize";
- this._latlongLayerMapping["point.staticZeroValueSize"] = "latlong.staticZeroValueSize";
- this._latlongLayerMapping["legend.pointsize.title"] = "legend.latlong.pointsize.title";
- this._latlongLayerMapping["legend.pointcolor.title"] = "legend.latlong.pointcolor.title";
- this._latlongLayerMapping["sizeLegend"] = "g.legend.latlongSize";
- this._latlongLayerMapping["colorLegend"] = "g.legend.latlongPoint";
- this._latlongLegendMapping = {};
- this._latlongLegendMapping["pointSize"] = 2;
- this._latlongLegendMapping["pointColor"] = 3;
- this._registeredEventHandlers = [];
- this._delayedInit = null;
- },
- /** @expose */
- dispose : function() {
- if (this._mapComponent) {
- this._mapComponent.dispose();
- }
- },
- /** @expose */
- on : function(_eventName, _callback) {
- rave['library']['internal']['AbstractView'].prototype.on.call(this, _eventName, _callback);
- if (this._mapComponent) {
- this._mapComponent.on(_eventName, function(_e) {
- _callback(_e);
- });
- }
- this._registeredEventHandlers.push(new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.EventHandler(_eventName, _callback));
- },
- /** @expose */
- draw : function() {
- var accessToken = this.getStringProperty("tiledmap.token");
- if ((accessToken == null) || accessToken == "") {
- return;
- }
- var self = this;
- this.preDraw("g.vizlibrary-tiledmap");
- this.context.node.selectAll("g.legends").style("pointer-events", "all");
- if (!(this.validateDataModel("*"))) {
- return;
- }
- var legendPosition = this.getLegendPosition();
- var showLegend = this.isShowLegend();
- this._legends.visible(showLegend).position(legendPosition).transition(false, 0).setPreExecute(this.context.getPreExecute());
- var maxZoom = this.getProperty("tiledmap.maxZoom");
- var mapLocale = this.getStringPropertyEmptyAsNull("tiledmap.mapLocale");
- if (mapLocale == null) {
- mapLocale = this.context.locale();
- }
- var mapStyle = this.getStringProperty("tiledmap.style");
- var combinedLayers = false;
- var dataLayers = [];
- if (this.dataModel.getDescriptor().id() == "tabular") {
- combinedLayers = true;
- var combinedDataSet = this.dataModel.dataset("data");
- var data = (combinedDataSet.data());
- var geoJson = this.getProperty("tiledmap.geoJson");
- var mapData = null;
- if (geoJson != null) {
- if ((typeof geoJson === "array" || geoJson instanceof Array)) {
- mapData = geoJson;
- } else {
- mapData = (geoJson)["mapboxData"];
- }
- }
- var dataLayer = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data");
- dataLayers.push(dataLayer);
- dataLayer.setData(data);
- dataLayer.setMapData(mapData);
- var dseFeatureLvl1 = combinedDataSet.slot(this._combinedLayerMapping["featureLvl1"]).entry();
- var dseFeatureLvl2 = combinedDataSet.slot(this._combinedLayerMapping["featureLvl2"]).entry();
- var dseFeatureLvl3 = combinedDataSet.slot(this._combinedLayerMapping["featureLvl3"]).entry();
- var dsePointSize = combinedDataSet.slot(this._combinedLayerMapping["pointSize"]).entry();
- var dsePointColor = combinedDataSet.slot(this._combinedLayerMapping["pointColor"]).entry();
- var featureAccessors = [];
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl1));
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl2));
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl3));
- dataLayer.setFeatureAccessors(featureAccessors);
- if (dseFeatureLvl1) {
- this._setupRegionDataLayer(dataLayer, combinedDataSet, data, this._combinedLayerMapping, false, showLegend);
- } else {
- this._legends.visible(4, false);
- }
- if ((dseFeatureLvl1) && ((dsePointSize) || (dsePointColor))) {
- this._setupPointDataLayer(dataLayer, combinedDataSet, data, this._combinedLayerMapping, this._pointLegendMapping, false, showLegend);
- } else {
- this._legends.visible(0, false);
- this._legends.visible(1, false);
- }
- this._legends.visible(2, false);
- this._legends.visible(3, false);
- } else if (this.dataModel.getDescriptor().id() == "multiTable") {
- var regionDataSet = this.dataModel.dataset("data.region");
- var pointDataSet = this.dataModel.dataset("data.point");
- var latlongDataSet = this.dataModel.dataset("data.latlong");
- if (regionDataSet.data() != null) {
- var data = (regionDataSet.data());
- var regionLayer = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data.region");
- dataLayers.push(regionLayer);
- regionLayer.setData(data);
- regionLayer.setMapData(this.getProperty(this._regionLayerMapping["region.mapData"]));
- var dseFeatureLvl1 = regionDataSet.slot(this._regionLayerMapping["featureLvl1"]).entry();
- var dseFeatureLvl2 = regionDataSet.slot(this._regionLayerMapping["featureLvl2"]).entry();
- var dseFeatureLvl3 = regionDataSet.slot(this._regionLayerMapping["featureLvl3"]).entry();
- var hasGeo = ((dseFeatureLvl1) && (this.getStringProperty(this._regionLayerMapping["region.custom.mapId"]).length > 0) && (this.getStringProperty(this._regionLayerMapping["region.custom.layerName"]).length > 0) && (this.getStringProperty(this._regionLayerMapping["region.custom.propertyName"]).length > 0));
- var featureAccessors = [];
- if (hasGeo) {
- featureAccessors.push(this._createGeoDataAccessor(null, null, null, dseFeatureLvl1));
- } else {
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl1));
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl2));
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl3));
- }
- regionLayer.setFeatureAccessors(featureAccessors);
- this._setupRegionDataLayer(regionLayer, regionDataSet, data, this._regionLayerMapping, hasGeo, showLegend);
- } else {
- this._legends.visible(4, false);
- }
- if (pointDataSet.data() != null) {
- var data = (pointDataSet.data());
- var pointLayer = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data.point");
- dataLayers.push(pointLayer);
- pointLayer.setData(data);
- pointLayer.setMapData(this.getProperty(this._pointLayerMapping["point.mapData"]));
- var dseFeatureLvl1 = pointDataSet.slot(this._pointLayerMapping["featureLvl1"]).entry();
- var dseFeatureLvl2 = pointDataSet.slot(this._pointLayerMapping["featureLvl2"]).entry();
- var dseFeatureLvl3 = pointDataSet.slot(this._pointLayerMapping["featureLvl3"]).entry();
- var hasGeo = ((dseFeatureLvl1) && (this.getStringProperty(this._pointLayerMapping["point.custom.mapId"]).length > 0) && (this.getStringProperty(this._pointLayerMapping["point.custom.layerName"]).length > 0) && (this.getStringProperty(this._pointLayerMapping["point.custom.propertyName"]).length > 0));
- var featureAccessors = [];
- if (hasGeo) {
- featureAccessors.push(this._createGeoDataAccessor(null, null, null, dseFeatureLvl1));
- } else {
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl1));
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl2));
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseFeatureLvl3));
- }
- pointLayer.setFeatureAccessors(featureAccessors);
- this._setupPointDataLayer(pointLayer, pointDataSet, data, this._pointLayerMapping, this._pointLegendMapping, hasGeo, showLegend);
- } else {
- this._legends.visible(0, false);
- this._legends.visible(1, false);
- }
- if (latlongDataSet.data() != null) {
- var dseLatitude = latlongDataSet.slot("latitude").entry();
- var dseLongitude = latlongDataSet.slot("longitude").entry();
- var dseLabel = latlongDataSet.slot("label").entry();
- var hasGeo = ((dseLatitude) || (dseLongitude));
- if (hasGeo) {
- var featureAccessors = [];
- if ((dseLatitude) && (dseLatitude.type() == "object")) {
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseLatitude));
- } else if ((dseLongitude) && (dseLongitude.type() == "object")) {
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseLongitude));
- } else if ((dseLabel) && (dseLabel.type() == "object")) {
- featureAccessors.push(rave['library']['internal']['AbstractView'].accessorOf(dseLabel));
- } else if ((dseLatitude) && (dseLongitude)) {
- featureAccessors.push(this._createGeoDataAccessor(dseLabel, dseLatitude, dseLongitude, null));
- }
- if (featureAccessors.length > 0) {
- var data = (latlongDataSet.data());
- var latlongLayer = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data.latlong");
- dataLayers.push(latlongLayer);
- latlongLayer.setData(data);
- latlongLayer.setFeatureAccessors(featureAccessors);
- this._setupPointDataLayer(latlongLayer, latlongDataSet, data, this._latlongLayerMapping, this._latlongLegendMapping, hasGeo, showLegend);
- }
- }
- } else {
- this._legends.visible(2, false);
- this._legends.visible(3, false);
- }
- }
- if (this.updateType <= 1) {
- this.prepareLayoutComponent();
- this.prepareLayoutSizables(this._layoutComponent, false, false, false, false, this._legends.anyVisible());
- this._legends.preLayout(this._layoutComponent);
- this._layoutComponent.layout();
- }
- var chartRect = this._layoutComponent.elementRect();
- this._legends.rectangle(this._layoutComponent.legendRect());
- this._legends.draw();
- var maxPointSize = this.evaluateSize(this.getStringProperty("point.maxSize"), chartRect.width, 10);
- var autoZoom = this.getBooleanProperty("tiledmap.autoZoom");
- if (!this._mapComponent) {
- this._mapComponent = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl();
- this._mapComponent.accessToken(accessToken);
- this._mapComponent.setContainerRect(chartRect);
- this._mapComponent.setup(this.context.node, this.getNLS());
- this._mapComponent.setDataLayers(dataLayers, true, combinedLayers);
- this._mapComponent.draw(this.context.node);
- this._mapComponent.mapStyle(mapStyle);
- this._mapComponent.setMaxBounds(com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.BASE_BOUNDS);
- if (maxZoom != this._maxZoom) {
- this._mapComponent.setMaxZoom(maxZoom);
- }
- this._mapComponent.setMapLocale(mapLocale);
- this._mapComponent.setMaxPointSize(maxPointSize);
- this._mapComponent.setAutoZoom(autoZoom);
- if (this._registeredEventHandlers.length > 0) {
- for (var idx = 0, size = this._registeredEventHandlers.length; idx < size; ++idx) {
- var evt = this._registeredEventHandlers[idx];
- this._mapComponent.on(evt.eventName, new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.EventCallback(evt.callback));
- }
- }
- this._mapInitializedCallback = function(e) {
- self._mapInitialized = true;
- if (self._delayedInit) {
- if (self._delayedInit.chartRect) {
- self._mapComponent.setContainerRect(self._delayedInit.chartRect);
- }
- self._mapComponent.setDataLayers(self._delayedInit.dataLayers, self._delayedInit.resetData, self._delayedInit.combinedLayers);
- if (self._delayedInit.maxZoom != null) {
- self._mapComponent.setMaxZoom(self._delayedInit.maxZoom);
- }
- if (self._delayedInit.mapLocale != null) {
- self._mapComponent.setMapLocale(self._delayedInit.mapLocale);
- }
- if (self._delayedInit.mapStyle != null) {
- self._mapComponent.mapStyle(self._delayedInit.mapStyle);
- }
- if (self._delayedInit.maxPointSize != null) {
- self._mapComponent.setMaxPointSize(self._delayedInit.maxPointSize);
- }
- self._mapComponent.setAutoZoom(self._delayedInit.autoZoom);
- }
- self._mapComponent.off("style.load", self._mapInitializedCallback);
- };
- this._mapComponent.on("style.load", this._mapInitializedCallback);
- } else if (this._mapInitialized) {
- var resetData = (this.updateType == 0);
- if (!(this._isRectEqual(this._lastChartRect, chartRect))) {
- this._mapComponent.setContainerRect(chartRect);
- }
- this._mapComponent.setDataLayers(dataLayers, resetData, combinedLayers);
- if (this.updateType <= 1) {
- if (maxZoom != this._maxZoom) {
- this._mapComponent.setMaxZoom(maxZoom);
- }
- if (!(mapLocale == this._mapLocale)) {
- this._mapComponent.setMapLocale(mapLocale);
- }
- if (!(mapStyle == this._mapStyle)) {
- this._mapComponent.mapStyle(mapStyle);
- }
- this._mapComponent.setMaxPointSize(maxPointSize);
- this._mapComponent.setAutoZoom(autoZoom);
- }
- if (resetData || ((this.updateType <= 1) && mapStyle == this._mapStyle)) {
- this._mapComponent.fire("style.load");
- }
- } else {
- var resetData = (this.updateType == 0);
- if (!this._delayedInit) {
- this._delayedInit = new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DelayedInit();
- }
- if (!(this._isRectEqual(this._lastChartRect, chartRect))) {
- this._delayedInit.setChartRect(chartRect);
- }
- this._delayedInit.setDataLayers(dataLayers, resetData, combinedLayers);
- if (maxZoom != this._maxZoom) {
- this._delayedInit.setMaxZoom(maxZoom);
- }
- if (!(mapLocale == this._mapLocale)) {
- this._delayedInit.setMapLocale(mapLocale);
- }
- if (!(mapStyle == this._mapStyle)) {
- this._delayedInit.setMapStyle(mapStyle);
- }
- this._delayedInit.setMaxPointSize(maxPointSize);
- this._delayedInit.setAutoZoom(autoZoom);
- }
- this._maxZoom = maxZoom;
- this._mapLocale = mapLocale;
- this._mapStyle = mapStyle;
- this._lastChartRect = this._cloneRect(chartRect);
- this.resetUpdate();
- },
- _createGeoDataAccessor : function(_captionEntry, _latEntry, _longEntry, _featureIdEntry) {
- return (new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.GeoDataAccessor(rave['library']['internal']['AbstractView'].accessorOf(_captionEntry), rave['library']['internal']['AbstractView'].accessorOf(_latEntry), rave['library']['internal']['AbstractView'].accessorOf(_longEntry), rave['library']['internal']['AbstractView'].accessorOf(_featureIdEntry))).getAccessor();
- },
- evaluateSize : function(value, extent, defValue) {
- var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10);
- var d = v != null ? v : defValue;
- return Math.max(0, Math.min(d, extent));
- },
- /** @expose */
- getLegendCount : function() {
- return 5;
- },
- /** @expose */
- getGroupStructure : function() {
- return ["defs", "g.vizlibrary vizlibrary-tiledmap", "(", "rect.background chart", "g.chart", "g.legends", "(", "g.legends-layout", "g.legend size", "g.legend point", "g.legend latlongSize", "g.legend latlongPoint", "g.legend region", ")", ")"];
- },
- _setupRegionDataLayer : function(_dataLayer, _dataSet, _data, _layerMap, _geoData, _showLegend) {
- var regionTypeData = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2RegionTypeDataImpl();
- var nullColor = this.getStringProperty("color.null");
- var nullColorDefault = ""+(this.getPropertyDefault("color.null"));
- var currentPaletteId = this.getStringProperty(_layerMap["region.alt.palette"]);
- if (""+(this.getPropertyDefault(_layerMap["region.alt.palette"])) == currentPaletteId) {
- currentPaletteId = this.getStringProperty(_layerMap["region.palette"]);
- }
- var jsonPalette = com_ibm_rave_library_Library.palettes.getJSONPalette(currentPaletteId);
- var dseValue = _dataSet.slot(_layerMap["fill"]).entry();
- regionTypeData.setValueAccessor(rave['library']['internal']['AbstractView'].accessorOf(dseValue));
- var valueExtent = [0, 0];
- if (dseValue) {
- if (dseValue.domain()) {
- valueExtent = dseValue.domain();
- } else {
- rave.extent(_data, function(data, index, groupIndex) {
- return dseValue(data);
- });
- }
- }
- regionTypeData.minimumValue(+ (valueExtent[0]));
- regionTypeData.maximumValue(+ (valueExtent[1]));
- var featurePalette = com_ibm_rave_library_Library.palettes.getPalette(currentPaletteId);
- featurePalette.setData(_dataSet, _layerMap["fill"]);
- regionTypeData.setPaletteDef(jsonPalette);
- regionTypeData.setPalette(featurePalette);
- regionTypeData.setNullColor(nullColor == "" ? nullColorDefault : nullColor);
- regionTypeData.setHasGeoData(_geoData);
- regionTypeData.setTransparency(this.getIntProperty(_layerMap["region.transparency"]));
- regionTypeData.setCustomPolygon(this.getStringProperty(_layerMap["region.custom.mapId"]), this.getStringProperty(_layerMap["region.custom.layerName"]), this.getStringProperty(_layerMap["region.custom.propertyName"]));
- _dataLayer.setTypeData("region", regionTypeData);
- if (_showLegend) {
- this._legends.visible(4, !!((dseValue))).selector(4, this.context.node.selectAll("g.legend.region")).palette(4, featurePalette).shape(4, "square").title(4, this.context.getDataSlotLabel("legend.regioncolor.title", dseValue)).titleFill(4, (this.context.getPropertyValue("legend.titlestyle.fill"))).titleFontSize(4, (this.context.getPropertyValue("legend.titlestyle.fontsize"))).titleFontFamily(4, (this.context.getPropertyValue("legend.titlestyle.fontfamily"))).setDataSlot(4, dseValue);
- }
- },
- _setupPointDataLayer : function(_dataLayer, _dataSet, _data, _layerMap, _legendMap, _geoData, _showLegend) {
- var pointTypeData = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2PointTypeDataImpl();
- var nullColor = this.getStringProperty("color.null");
- var nullColorDefault = ""+(this.getPropertyDefault("color.null"));
- var currentPaletteId = this.getStringProperty(_layerMap["point.alt.palette"]);
- if (""+(this.getPropertyDefault(_layerMap["point.alt.palette"])) == currentPaletteId) {
- currentPaletteId = this.getStringProperty(_layerMap["point.palette"]);
- }
- var dsePointColor = _dataSet.slot(_layerMap["pointColor"]).entry();
- var dsePointSize = _dataSet.slot(_layerMap["pointSize"]).entry();
- pointTypeData.setPointColorAccessor(rave['library']['internal']['AbstractView'].accessorOf(dsePointColor));
- pointTypeData.setPointSizeAccessor(rave['library']['internal']['AbstractView'].accessorOf(dsePointSize));
- pointTypeData.setHasGeoData(_geoData);
- pointTypeData.setCustomPolygon(this.getStringProperty(_layerMap["point.custom.mapId"]), this.getStringProperty(_layerMap["point.custom.layerName"]), this.getStringProperty(_layerMap["point.custom.propertyName"]));
- var pointSizeDomain = [0, 0];
- if (dsePointSize) {
- if (dsePointSize.domain()) {
- pointSizeDomain = dsePointSize.domain();
- } else {
- pointSizeDomain = rave.extent(_data, function(data, index, groupIndex) {
- return dsePointSize(data);
- });
- }
- }
- var pointPalette = com_ibm_rave_library_Library.palettes.getPalette(currentPaletteId);
- pointPalette.setData(_dataSet, _layerMap["pointColor"]);
- pointTypeData.setPalette(pointPalette);
- var bb = this._chart.node().rave_getParentNode().rave_getParentNode().getBoundingClientRect();
- var min = this.evaluateSize(this.getStringProperty(_layerMap["point.minSize"]), bb.width, 10);
- var max = this.evaluateSize(this.getStringProperty(_layerMap["point.maxSize"]), bb.width, 10);
- var defaultSize = this.evaluateSize(this.getStringProperty(_layerMap["point.defaultSize"]), bb.width, min + max / 2);
- var pointSizeScale = rave.scale.linear().domain(pointSizeDomain).range([min, max]);
- pointTypeData.setPointSizeScale(pointSizeScale);
- pointTypeData.setDefaultPointSize(defaultSize);
- var nullColorPalette;
- if (pointSizeScale) {
- var minValue = pointSizeScale.domain()[0];
- var maxValue = pointSizeScale.domain()[1];
- nullColorPalette = rave.scale.ordinal().domain([minValue, maxValue]).range([nullColor]);
- }
- pointTypeData.setNullColor(nullColor == "" ? nullColorDefault : nullColor);
- pointTypeData.setTransparency(this.getIntProperty(_layerMap["point.transparency"]));
- var staticZeroValueSize = this.getStringProperty(_layerMap["point.staticZeroValueSize"]);
- if ((staticZeroValueSize == null) || (staticZeroValueSize.length == 0)) {
- pointTypeData.setStaticZeroValuePointSize(null);
- } else {
- pointTypeData.setStaticZeroValuePointSize(this.evaluateSize(staticZeroValueSize, bb.width, 10));
- }
- _dataLayer.setTypeData("point", pointTypeData);
- if (_showLegend) {
- var legendIndex = _legendMap["pointSize"];
- this._legends.visible(legendIndex, !!((dsePointSize))).selector(legendIndex, this.context.node.selectAll(_layerMap["sizeLegend"])).scale(legendIndex, nullColorPalette).shape(legendIndex, "circle").swatchSize(legendIndex, function(_data, index, groupIndex) {
- return Math.PI * Math.pow(+ (+ (pointSizeScale.call(null, _data, index, groupIndex))), 2);
- }).title(legendIndex, this.context.getDataSlotLabel(_layerMap["legend.pointsize.title"], dsePointSize)).titleFill(legendIndex, (this.context.getPropertyValue("legend.titlestyle.fill"))).titleFontSize(legendIndex, (this.context.getPropertyValue("legend.titlestyle.fontsize"))).titleFontFamily(legendIndex, (this.context.getPropertyValue("legend.titlestyle.fontfamily"))).setDataSlot(legendIndex, dsePointSize);
- legendIndex = _legendMap["pointColor"];
- this._legends.visible(legendIndex, !!((dsePointColor))).selector(legendIndex, this.context.node.selectAll(_layerMap["colorLegend"])).palette(legendIndex, pointPalette).shape(legendIndex, "square").title(legendIndex, this.context.getDataSlotLabel(_layerMap["legend.pointcolor.title"], dsePointColor)).titleFill(legendIndex, (this.context.getPropertyValue("legend.titlestyle.fill"))).titleFontSize(legendIndex, (this.context.getPropertyValue("legend.titlestyle.fontsize"))).titleFontFamily(legendIndex, (this.context.getPropertyValue("legend.titlestyle.fontfamily"))).setDataSlot(legendIndex, dsePointColor);
- }
- },
- _cloneRect : function(_rect) {
- return new rave['internal']['RectStruct'](_rect.x, _rect.y, _rect.width, _rect.height);
- },
- _isRectEqual : function(_rectA, _rectB) {
- return ((_rectA.x == _rectB.x) && (_rectA.y == _rectB.y) && (_rectA.width == _rectB.width) && (_rectA.height == _rectB.height));
- },
- getNLS : function() {
- var self = this;
- return function(_key) {
- return self.message(_key, null);
- };
- }
- });
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.EventHandler = rave['internal']['Declare']({
- /** @expose */
- eventName : null,
- /** @expose */
- callback : null,
- /** @expose */
- constructor : function(_eventName, _callback) {
- this.eventName = _eventName;
- this.callback = _callback;
- }
- });
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DelayedInit = rave['internal']['Declare']({
- /** @expose */
- chartRect : null,
- /** @expose */
- dataLayers : null,
- /** @expose */
- maxZoom : null,
- /** @expose */
- mapLocale : null,
- /** @expose */
- mapStyle : null,
- /** @expose */
- maxPointSize : null,
- /** @expose */
- resetData : false,
- /** @expose */
- combinedLayers : false,
- /** @expose */
- autoZoom : false,
- /** @expose */
- constructor : function() {
- this.chartRect = null;
- this.dataLayers = null;
- this.maxZoom = null;
- this.mapLocale = null;
- this.mapStyle = null;
- this.maxPointSize = null;
- },
- /** @expose */
- setChartRect : function(_chartRect) {
- this.chartRect = _chartRect;
- },
- /** @expose */
- setDataLayers : function(_dataLayers, _resetData, _combinedLayers) {
- this.dataLayers = _dataLayers;
- this.resetData = _resetData;
- this.combinedLayers = _combinedLayers;
- },
- /** @expose */
- setMaxZoom : function(_maxZoom) {
- this.maxZoom = _maxZoom;
- },
- /** @expose */
- setMapLocale : function(_mapLocale) {
- this.mapLocale = _mapLocale;
- },
- /** @expose */
- setMapStyle : function(_mapStyle) {
- this.mapStyle = _mapStyle;
- },
- /** @expose */
- setMaxPointSize : function(_size) {
- this.maxPointSize = _size;
- },
- /** @expose */
- setAutoZoom : function(_autoZoom) {
- this.autoZoom = _autoZoom;
- }
- });
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.EventCallback = rave['internal']['Declare']({
- //callback : null,
- _$functionClassMethod : function() {
- var _$self = function(_e) {
- _$self.callback(_e);
- };
- return _$self;
- },
- /** @expose */
- constructor : function(_callback) {
- this.callback = _callback;
- }
- });
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.GeoData = rave['internal']['Declare']({
- /** @expose */
- caption : null,
- /** @expose */
- featureId : null,
- /** @expose */
- latitude : 0,
- /** @expose */
- longitude : 0,
- /** @expose */
- invalidLatLong : false,
- /** @expose */
- constructor : function(_caption, _latitude, _longitude, _featureId) {
- this.caption = _caption;
- if (this.isValidLatLong(_latitude, _longitude)) {
- this.latitude = _latitude;
- this.longitude = this.normalizeLongitude(_longitude);
- this.invalidLatLong = false;
- } else {
- this.latitude = 0;
- this.longitude = 0;
- this.invalidLatLong = true;
- }
- this.featureId = _featureId;
- },
- isValidLatLong : function(_latitude, _longitude) {
- if ((_latitude == null) || (_latitude >= 90) || (_latitude <= -90)) {
- return false;
- }
- return (_longitude != null);
- },
- normalizeLongitude : function(_longitude) {
- var longitude = _longitude;
- var correction = (_longitude < 0) ? 360 : -360;
- while ((longitude < -180) || (longitude > 180)) {
- longitude += correction;
- }
- return longitude;
- }
- });
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.GeoDataAccessor = rave['internal']['Declare']({
- //captionAccessor : null,
- //latitudeAccessor : null,
- //longitudeAccessor : null,
- //featureIdAccessor : null,
- /** @expose */
- constructor : function(_caption, _latitude, _longitude, _featureId) {
- this.captionAccessor = _caption;
- this.latitudeAccessor = _latitude;
- this.longitudeAccessor = _longitude;
- this.featureIdAccessor = _featureId;
- },
- /** @expose */
- getAccessor : function() {
- var self = this;
- return function(_data) {
- return new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.GeoData((self.captionAccessor) ? self.captionAccessor(_data) : null, (self.latitudeAccessor) ? self.latitudeAccessor(_data) : 0, (self.longitudeAccessor) ? self.longitudeAccessor(_data) : 0, (self.featureIdAccessor) ? self.featureIdAccessor(_data) : null);
- };
- }
- });
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASET_DATA = "data";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASET_DATA_REGION = "data.region";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASET_DATA_POINT = "data.point";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASET_DATA_LATLONG = "data.latlong";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TILEDMAP_TOKEN = "tiledmap.token";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TILEDMAP_STYLE = "tiledmap.style";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TILEDMAP_GEOJSON = "tiledmap.geoJson";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TILEDMAP_MAXZOOM = "tiledmap.maxZoom";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TILEDMAP_MAPLOCALE = "tiledmap.mapLocale";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TILEDMAP_AUTOZOOM = "tiledmap.autoZoom";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_FEATURE_LVL1 = "featureLvl1";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_FEATURE_LVL2 = "featureLvl2";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_FEATURE_LVL3 = "featureLvl3";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_LATITUDE = "latitude";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_LONGITUDE = "longitude";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_LABEL = "label";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_VALUE = "value";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_FILL = "fill";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_POINTSIZE = "pointSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_POINTCOLOR = "pointColor";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_LATLONG_POINTSIZE = "latlongSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.DATASLOT_LATLONG_POINTCOLOR = "latlongColor";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_MINSIZE = "minPointSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_MAXSIZE = "maxPointSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_STATICZEROVALUEPOINTSIZE = "staticZeroValuePointSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_FILLTRANS = "color.fillTransparency";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINTTRANS = "color.pointTransparency";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_REGION_PALETTE = "region.palette";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_REGION_TRANSPARENCY = "region.transparency";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_REGION_MAPDATA = "region.mapData";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_REGION_CUSTOM_MAPID = "region.custom.mapId";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_REGION_CUSTOM_LAYERNAME = "region.custom.layerName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_REGION_CUSTOM_PROPERTYNAME = "region.custom.propertyName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_PALETTE = "point.palette";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_TRANSPARENCY = "point.transparency";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_MAPDATA = "point.mapData";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_MINSIZE = "point.minSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_MAXSIZE = "point.maxSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_DEFAULTSIZE = "point.defaultSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_STATICZEROVALUESIZE = "point.staticZeroValueSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_CUSTOM_MAPID = "point.custom.mapId";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_CUSTOM_LAYERNAME = "point.custom.layerName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_CUSTOM_PROPERTYNAME = "point.custom.propertyName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_LEGEND_SIZE_TITLE = "legend.pointsize.title";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_POINT_LEGEND_COLOR_TITLE = "legend.pointcolor.title";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.SELECTOR_POINTSIZE_LEGEND = "g.legend.size";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.SELECTOR_POINTCOLOR_LEGEND = "g.legend.point";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_PALETTE = "latlong.palette";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_TRANSPARENCY = "latlong.transparency";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_MINSIZE = "latlong.minSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_MAXSIZE = "latlong.maxSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_DEFAULTSIZE = "latlong.defaultSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_STATICZEROVALUESIZE = "latlong.staticZeroValueSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_LEGEND_SIZE_TITLE = "legend.latlong.pointsize.title";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.PROP_LATLONG_LEGEND_COLOR_TITLE = "legend.latlong.pointcolor.title";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.SELECTOR_LATLONG_POINTSIZE_LEGEND = "g.legend.latlongSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.SELECTOR_LATLONG_POINTCOLOR_LEGEND = "g.legend.latlongPoint";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_DATASLOT_FEATURE_LVL1 = "featureLvl1";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_DATASLOT_FEATURE_LVL2 = "featureLvl2";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_DATASLOT_FEATURE_LVL3 = "featureLvl3";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_DATASLOT_FILL = "fill";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_DATASLOT_POINTSIZE = "pointSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_DATASLOT_POINTCOLOR = "pointColor";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_REGION_PALETTE = "region.palette";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_REGION_ALT_PALETTE = "region.alt.palette";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_REGION_TRANSPARENCY = "region.transparency";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_REGION_MAPDATA = "region.mapData";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_REGION_CUSTOM_MAPID = "region.custom.mapId";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_REGION_CUSTOM_LAYERNAME = "region.custom.layerName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_REGION_CUSTOM_PROPERTYNAME = "region.custom.propertyName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_PALETTE = "point.palette";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_ALT_PALETTE = "point.alt.palette";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_TRANSPARENCY = "point.transparency";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_MAPDATA = "point.mapData";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_MINSIZE = "point.minSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_MAXSIZE = "point.maxSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_DEFAULTSIZE = "point.defaultSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_STATICZEROVALUESIZE = "point.staticZeroValueSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_CUSTOM_MAPID = "point.custom.mapId";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_CUSTOM_LAYERNAME = "point.custom.layerName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_POINT_CUSTOM_PROPERTYNAME = "point.custom.propertyName";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_LEGEND_SIZE_TITLE = "legend.pointsize.title";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_PROP_LEGEND_COLOR_TITLE = "legend.pointcolor.title";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_LEGEND_POINTSIZE = "pointSize";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_LEGEND_POINTCOLOR = "pointColor";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_SELECTOR_POINTSIZE_LEGEND = "sizeLegend";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.NORM_SELECTOR_POINTCOLOR_LEGEND = "colorLegend";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TYPE_REGION = "region";
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.TYPE_POINT = "point";
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_POINTSIZE = 0;
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_POINTCOLOR = 1;
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_LATLONG_POINTSIZE = 2;
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_LATLONG_POINTCOLOR = 3;
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_REGIONCOLOR = 4;
- //com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.ELEMENT_SHAPE_SELECTOR = "." + "element-shape";
- com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.BASE_BOUNDS = [[-180, -85.05112], [180, 85.05112]];
- // $source: com/ibm/rave/bundles/components/BackgroundComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/BackgroundComponent (runtime) // BackgroundComponent
- /**
- * <p> Component to set the background color of a bundle. The component properties are: </p> <ul> <li> <b>backgroundColor</b>: The background color, null by default. </li> <li> <b>size</b>: The size of the bundle, from the context node, null by default. </li> </ul> <p> The component assumes that the selector on which it is executed is a "rect" shape which lies below the chart. If the size property is non-null, it sets the geometry of this rectangle to be the given size, with upper-left corner at 0,0. If the size is null, the rectangle is not resized. </p> <p> The rectangle fill is set to the backgroundColor property. If the property is null, white (#FFFFFF) is used. TODO. Should we set it to null, so the CSS style can also be used to set the background? </p>
- */
- var com_ibm_rave_bundles_components_BackgroundComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //_backgroundColor : null,
- //_rect : null,
- /** @expose */
- constructor : function() {
- this._rect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- g.style("fill", this._backgroundColor != null ? this._backgroundColor : "#FFFFFF").style("fill-opacity", 1.0);
- g.attr("x", this._rect.x).attr("y", this._rect.y).attr("width", this._rect.width).attr("height", this._rect.height);
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE;
- },
- backgroundColor$0 : function() {
- return this._backgroundColor;
- },
- backgroundColor$1 : function(backgroundColor) {
- this._backgroundColor = backgroundColor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['ContextSize']) size New value of size property
- * @return (com.ibm.rave.bundles.components.BackgroundComponentImpl) This component
- */
- /** @expose */
- size : function(size) {
- this._rect.x = 0;
- this._rect.y = 0;
- this._rect.width = size.w;
- this._rect.height = size.h;
- return this;
- },
- /** @expose */
- rect : function(rect) {
- var r = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
- this._rect = r;
- return this;
- },
- /** @expose */
- backgroundColor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.backgroundColor$0();
- }
- return this.backgroundColor$1(a0);
- }
- });
- // $source: com/ibm/rave/bundles/components/ChartLayoutComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/ChartLayoutComponent (runtime) // ChartLayoutComponent
- /**
- * <p> Implementation of the chart layout component API. General sequence in a bundle view: </p> <ul> <li> Configure the layout component by setting component properties from bundle properties and/or using the utility methods. </li> <li> Run the layout either by calling {@link #this.layout()} , or using a selector to call the layout. The selector is irrelevant, and {@link #this.execute(rave['internal']['Selector'])} ignores its argument and simply calls {@link #this.layout()} . Running the layout makes the pre-execute callback, allowing the integrator to change layout properties. </li> <li> On return, use the rectangles to position other components. Note that the integrator can change the properties, so the view should update its values; in particular the legendPosition could be changed, so the legend component should use the position after running the layout. </li> </ul>
- */
- var com_ibm_rave_bundles_components_ChartLayoutComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //_padding : null,
- //_legendChartGap : null,
- //_topChartPadding : null,
- //_leftChartPadding : null,
- //_bottomChartPadding : null,
- //_rightChartPadding : null,
- //_legendPosition : null,
- //_legendSizable : null,
- //_axisSizables : null,
- //_overallRect : null,
- //_legendRect : null,
- //_chartRect : null,
- //_topRect : null,
- //_leftRect : null,
- //_bottomRect : null,
- //_rightRect : null,
- //_elementRect : null,
- _leftPadding : 0, _topPadding : 0, _rightPadding : 0, _bottomPadding : 0,
- _legendChartAlign : false,
- _preLegendAtMax : false,
- _preAxesAtZero : false,
- constructor : function() {
- this._axisSizables = [];
- /**
- * Construct. All padding is 0, legendPosition is "right", all slices have a size of 0 (value of null).
- */
- {
- this._padding = 0.0;
- this._topPadding = 0;
- this._leftPadding = 0;
- this._bottomPadding = 0;
- this._rightPadding = 0;
- this._topChartPadding = 0.0;
- this._leftChartPadding = 0.0;
- this._bottomChartPadding = 0.0;
- this._rightChartPadding = 0.0;
- this._legendChartGap = 0.0;
- this._legendPosition = "right";
- this._overallRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._legendRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._chartRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._topRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._leftRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._bottomRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._rightRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._legendChartAlign = true;
- }
- },
- /** @expose */
- execute : function(g) {
- this.layout();
- },
- /**
- * Calculates rectangles during preliminary layout
- * @param (boolean) legendAtMax true if legend is given max size; false if legend is asked for its preferred size
- * @param (boolean) axesAtZero true if axes are given a size of 0; false if axes are asked for their preferred size
- */
- /** @expose */
- preLayout : function(legendAtMax, axesAtZero) {
- this._preLegendAtMax = legendAtMax;
- this._preAxesAtZero = axesAtZero;
- this.layout();
- this._preLegendAtMax = false;
- this._preAxesAtZero = false;
- },
- /**
- * Calls preExecute, then does the layout with the property values, updating the chart, legend, axis, and elements rectangles.
- */
- /** @expose */
- layout : function() {
- this.preExecute();
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._chartRect, this._overallRect);
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._legendRect, this._overallRect);
- var x = this._overallRect.x;
- var y = this._overallRect.y;
- var w = this._overallRect.width;
- var h = this._overallRect.height;
- var maxWH = Math.max(w, h);
- var tbLegend = "top" == this._legendPosition || "bottom" == this._legendPosition;
- var legendPercent = this._axisSizables.length == 0 ? 0.5 : 0.3;
- var legendMaxSize = (tbLegend ? this._legendRect.height : this._legendRect.width) * legendPercent;
- var legendDynamicSize = this._legendSizable ? (this._preLegendAtMax ? maxWH : this._legendSizable.getPreferredSize()) : 0;
- if (legendDynamicSize > legendMaxSize) {
- legendDynamicSize = legendMaxSize;
- }
- var isLegendTop = false;
- var isLegendBottom = false;
- var isLegendLeft = false;
- var isLegendRight = false;
- if ("top" == this._legendPosition) {
- this._legendRect.height = legendDynamicSize;
- this._chartRect.height -= this._legendRect.height;
- this._chartRect.y += this._legendRect.height;
- isLegendTop = true;
- } else if ("bottom" == this._legendPosition) {
- this._legendRect.height = legendDynamicSize;
- this._chartRect.height -= this._legendRect.height;
- this._legendRect.y = y + h - this._legendRect.height;
- isLegendBottom = true;
- } else if ("left" == this._legendPosition) {
- this._legendRect.width = legendDynamicSize;
- this._chartRect.width -= this._legendRect.width;
- this._chartRect.x += this._legendRect.width;
- isLegendLeft = true;
- } else {
- this._legendRect.width = legendDynamicSize;
- this._chartRect.width -= this._legendRect.width;
- this._legendRect.x = x + w - this._legendRect.width;
- isLegendRight = true;
- }
- if (this.evaluatePadding(this._padding, w, h)) {
- var lrgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, w);
- var tbgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, h);
- var chartTop = isLegendTop && this._legendSizable ? tbgap : this._topPadding;
- var chartLeft = isLegendLeft && this._legendSizable ? lrgap : this._leftPadding;
- var chartBottom = isLegendBottom && this._legendSizable ? tbgap : this._bottomPadding;
- var chartRight = isLegendRight && this._legendSizable ? lrgap : this._rightPadding;
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
- } else {
- var lrpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, w);
- var tbpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, h);
- var chartTop = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);
- var chartLeft = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding, w);
- var chartBottom = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding, h);
- var chartRight = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._rightChartPadding, w);
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
- this._topPadding = tbpadding;
- this._leftPadding = lrpadding;
- this._bottomPadding = tbpadding;
- this._rightPadding = lrpadding;
- }
- if (this._legendSizable) {
- if (isLegendRight) {
- this._legendRect.x -= this._rightPadding;
- this._chartRect.width -= this._rightPadding;
- this._legendRect.y += this._topPadding;
- this._legendRect.height -= (this._topPadding + this._bottomPadding);
- } else if (isLegendLeft) {
- this._legendRect.x += this._leftPadding;
- this._chartRect.x += this._leftPadding;
- this._chartRect.width -= this._leftPadding;
- this._legendRect.y += this._topPadding;
- this._legendRect.height -= (this._topPadding + this._bottomPadding);
- } else if (isLegendTop) {
- this._legendRect.y += this._topPadding;
- this._chartRect.y += this._topPadding;
- this._chartRect.height -= this._topPadding;
- this._legendRect.x += this._leftPadding;
- this._legendRect.width -= (this._leftPadding + this._rightPadding);
- } else {
- this._legendRect.y -= this._bottomPadding;
- this._chartRect.height -= this._bottomPadding;
- this._legendRect.x += this._leftPadding;
- this._legendRect.width -= (this._leftPadding + this._rightPadding);
- }
- }
- x = this._chartRect.x;
- y = this._chartRect.y;
- w = this._chartRect.width;
- h = this._chartRect.height;
- var bottomH = 0;
- var topH = 0;
- var leftW = 0;
- var rightW = 0;
- var tbSO = 0;
- var lrSO = 0;
- if (!this._preAxesAtZero) {
- var countHorz = 0;
- var countVert = 0;
- for (var i = 0; i < this._axisSizables.length; ++i) {
- var sizable = this._axisSizables[i];
- if (sizable) {
- var orientation = sizable.getSizableOrientation();
- if ("top" == orientation || "bottom" == orientation) {
- countHorz++;
- } else {
- countVert++;
- }
- }
- }
- for (var i = 0; i < this._axisSizables.length; ++i) {
- var sizable = this._axisSizables[i];
- if (sizable) {
- var orientation = sizable.getSizableOrientation();
- var tbAxis = "top" == orientation || "bottom" == orientation;
- var axisDynamicSize = sizable.getPreferredSize();
- var spillOver = sizable.getSpillOverSize();
- if (tbAxis) {
- var axisPercent = countHorz > 1 ? 0.4 : 0.5;
- if (axisDynamicSize > this._chartRect.height * axisPercent) {
- axisDynamicSize = this._chartRect.height * axisPercent;
- }
- if ("top" == orientation) {
- topH = axisDynamicSize;
- } else {
- bottomH = axisDynamicSize;
- }
- if (spillOver > lrSO) {
- lrSO = spillOver;
- }
- } else {
- var axisPercent = countVert > 1 ? 0.4 : 0.5;
- if (axisDynamicSize > this._chartRect.width * axisPercent) {
- axisDynamicSize = this._chartRect.width * axisPercent;
- }
- if ("left" == orientation) {
- leftW = axisDynamicSize;
- } else {
- rightW = axisDynamicSize;
- }
- if (spillOver > tbSO) {
- tbSO = spillOver;
- }
- }
- }
- }
- }
- if (lrSO > leftW) {
- leftW = lrSO;
- }
- if (lrSO > rightW) {
- rightW = lrSO;
- }
- if (tbSO > topH) {
- topH = tbSO;
- }
- if (tbSO > bottomH) {
- bottomH = tbSO;
- }
- this._leftRect.x = x;
- this._leftRect.width = leftW;
- this._leftRect.y = y;
- this._leftRect.height = h;
- this._rightRect.x = x + w - rightW;
- this._rightRect.width = rightW;
- this._rightRect.y = y;
- this._rightRect.height = h;
- this._topRect.y = y;
- this._topRect.height = topH;
- this._topRect.x = x;
- this._topRect.width = w;
- this._bottomRect.y = y + h - bottomH;
- this._bottomRect.height = bottomH;
- this._bottomRect.x = x;
- this._bottomRect.width = w;
- this._elementRect.x = x + leftW;
- this._elementRect.y = y + topH;
- this._elementRect.width = w - (leftW + rightW);
- this._elementRect.height = h - (topH + bottomH);
- if (this._legendSizable && this._legendChartAlign) {
- if (tbLegend) {
- this._legendRect.x = this._elementRect.x;
- this._legendRect.width = this._elementRect.width;
- } else {
- this._legendRect.y = this._elementRect.y;
- this._legendRect.height = this._elementRect.height;
- }
- }
- },
- evaluatePadding : function(padding, horizontalExtent, verticalExtent) {
- if (padding == null) {
- return false;
- }
- var paddingString = (padding) + "";
- if (paddingString.length == 0) {
- return false;
- }
- this._topPadding = 0;
- this._leftPadding = 0;
- this._bottomPadding = 0;
- this._rightPadding = 0;
- var items = paddingString.split(new RegExp(";"));
- for (var __i_enFor0 = 0, __len_enFor0 = items.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var item = items[__i_enFor0];
- var parts = item.split(new RegExp(":"));
- if (items.length == 1 && parts.length != 2) {
- return false;
- }
- if (parts.length == 2) {
- if (0 <= parts[0].indexOf("top")) {
- this._topPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
- } else if (0 <= parts[0].indexOf("left")) {
- this._leftPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
- } else if (0 <= parts[0].indexOf("bottom")) {
- this._bottomPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
- } else if (0 <= parts[0].indexOf("right")) {
- this._rightPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
- }
- }
- }
- return true;
- },
- /**
- * @return (rave['internal']['RectStruct']) Legend rectangle
- */
- /** @expose */
- legendRect : function() {
- return this._legendRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Chart (elements plus axes) rectangle
- */
- /** @expose */
- chartRect : function() {
- return this._chartRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Top axis rectangle
- */
- /** @expose */
- topRect : function() {
- return this._topRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Left axis rectangle
- */
- /** @expose */
- leftRect : function() {
- return this._leftRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Bottom axis rectangle
- */
- /** @expose */
- bottomRect : function() {
- return this._bottomRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Right axis rectangle
- */
- /** @expose */
- rightRect : function() {
- return this._rightRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Legend rectangle
- */
- /** @expose */
- elementRect : function() {
- return this._elementRect;
- },
- /**
- * Set the overall rectangle. This should be called before doing the layout.
- * @param (rave['internal']['RectStruct']) overall The overall rectangle
- */
- /** @expose */
- overall : function(overall) {
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._overallRect, overall);
- return this;
- },
- padding$0 : function() {
- return this._padding;
- },
- legendChartAlign$0 : function() {
- return this._legendChartAlign;
- },
- legendChartGap$0 : function() {
- return this._legendChartGap;
- },
- topPadding$0 : function() {
- return this._topChartPadding;
- },
- leftPadding$0 : function() {
- return this._leftChartPadding;
- },
- bottomPadding$0 : function() {
- return this._bottomChartPadding;
- },
- rightPadding$0 : function() {
- return this._rightChartPadding;
- },
- legendPosition$0 : function() {
- return this._legendPosition;
- },
- topPadding$1 : function(padding) {
- this._topChartPadding = padding;
- return this;
- },
- leftPadding$1 : function(padding) {
- this._leftChartPadding = padding;
- return this;
- },
- bottomPadding$1 : function(padding) {
- this._bottomChartPadding = padding;
- return this;
- },
- rightPadding$1 : function(padding) {
- this._rightChartPadding = padding;
- return this;
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE;
- },
- padding$1 : function(value) {
- this._padding = value;
- return this;
- },
- /** @expose */
- chartPadding : function(top, left, bottom, right) {
- this._topChartPadding = top;
- this._leftChartPadding = left;
- this._bottomChartPadding = bottom;
- this._rightChartPadding = right;
- return this;
- },
- legendChartAlign$1 : function(legendChartAlign) {
- this._legendChartAlign = legendChartAlign;
- return this;
- },
- legendChartGap$1 : function(value) {
- this._legendChartGap = value;
- return this;
- },
- legendPosition$1 : function(position) {
- if ("top" == position || "bottom" == position || "left" == position || "right" == position) {
- this._legendPosition = position;
- }
- return this;
- },
- /** @expose */
- legendSize : function(sizable) {
- this._legendSizable = sizable;
- return this;
- },
- /** @expose */
- removeAxisSizables : function() {
- this._axisSizables.length = 0;
- return this;
- },
- /** @expose */
- addAxisSizable : function(sizable) {
- this._axisSizables.push(sizable);
- return this;
- },
- /** @expose */
- padding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.padding$0();
- }
- return this.padding$1(a0);
- },
- /** @expose */
- legendChartAlign : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendChartAlign$0();
- }
- return this.legendChartAlign$1(a0);
- },
- /** @expose */
- legendChartGap : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendChartGap$0();
- }
- return this.legendChartGap$1(a0);
- },
- /** @expose */
- topPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.topPadding$0();
- }
- return this.topPadding$1(a0);
- },
- /** @expose */
- leftPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.leftPadding$0();
- }
- return this.leftPadding$1(a0);
- },
- /** @expose */
- bottomPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.bottomPadding$0();
- }
- return this.bottomPadding$1(a0);
- },
- /** @expose */
- rightPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.rightPadding$0();
- }
- return this.rightPadding$1(a0);
- },
- /** @expose */
- legendPosition : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendPosition$0();
- }
- return this.legendPosition$1(a0);
- }
- });
- /**
- * Set preferred rectangle to the same position and size as the source rectangle.
- * @param (rave['internal']['RectStruct']) t preferred rectangle
- * @param (rave['internal']['RectStruct']) s Source rectangle
- * @return (rave['internal']['RectStruct']) preferred rectangle
- */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect = function(t, s) {
- t.x = s.x;
- t.y = s.y;
- t.width = s.width;
- t.height = s.height;
- return t;
- };
- /**
- * Inset a rectangle, modifying its x,y,width,height. If that would reduce the rectangle to less than 0 in a dimension, it is not inset in that dimension. If the requested inset is <= 0, 0 is used.
- * @param (rave['internal']['RectStruct']) r Rectangle
- * @param (double) top Top inset in pixels
- * @param (double) left Left inset in pixels
- * @param (double) bottom Bottom inset in pixels
- * @param (double) right Right inset in pixels
- * @return (rave['internal']['RectStruct']) The rectangle
- */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset = function(r, top, left, bottom, right) {
- var ileft = Math.max(0.0, left);
- var iright = Math.max(0.0, right);
- if (ileft + iright <= r.width) {
- r.x += ileft;
- r.width -= ileft + iright;
- }
- var itop = Math.max(0.0, top);
- var ibottom = Math.max(0.0, bottom);
- if (itop + ibottom <= r.height) {
- r.y += itop;
- r.height -= itop + ibottom;
- }
- return r;
- };
- /**
- * Evaluate a size, which may be a number, CSS size, or pecentage, and return the size in pixels. If the size is null or can't be parsed, returns defValue. The value is clamped to the range 0 to extent.
- * @param (Object) value The size
- * @param (double) extent The extent in the dimension
- * @param defValue The default to use if not parsable
- * @return (double) Size in pixels
- */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize = function(value, extent) {
- var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10.0);
- var d = v != null ? v : 0;
- return Math.max(0.0, Math.min(d, extent));
- };
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT = 0.4;
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT_SINGLE_PER_ORIENTATION = 0.5;
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT = 0.3;
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT_NO_AXIS = 0.5;
- // $source: com/ibm/rave/bundles/components/ClipPathComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- /**
- * ClipPathComponent This component handles creation of a clipPath element, as well as applying that clip path to a given selection. There is a one-to-one relationship between a ClipPathComponent and a clipPath element that is appended to the document. To create multiple clipPath elements, you must create multiple ClipPathComponent instances. Example usage: <pre> _clip.clipRect(new RectStruct(50, 50, 200, 200)) // Set the clipping rectangle .applyTo(chart.select(".content")) // Apply the clip-path attribute to a graphical element. This can be called repeatedly on different selections. .applyTo(chart.select(".otherContent")) .run(context.node.select("defs")); // ClipPathComponent creates a clipPath element within the provided node. This component should be executed on a single "defs" node, however there is no restriction. </pre>
- */
- var com_ibm_rave_bundles_components_ClipPathComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //_id : null,
- //_clipRect : null,
- constructor : function(id) {
- this._clipRect = new rave['internal']['RectStruct'](0, 0, 100, 100);
- /**
- * Initializes the component. The provided id will be used as the "id" attribute for the clipPath element created by this component. Recall that an "id" in an SVG/HTML document must be <em>unique across the entire document</em>. If you create multiple clipPath elements with the same id, then all elements referencing one of these clip paths will not be resolved as you expected.
- * @param (String) id String ID that is unique <em>across the document</em>.
- */
- {
- this._id = id;
- }
- },
- /** @expose */
- type : function() {
- return "ClipPathComponent";
- },
- /**
- * Set the rectangular clipping area. Make the _clipRect one pixel larger than requested to avoid the cut-off at bounds. TODO: why?!?
- * @param (rave['internal']['RectStruct']) rect The rectangular bounds of the clipping area.
- * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
- */
- /** @expose */
- clipRect : function(rect) {
- this._clipRect = new rave['internal']['RectStruct'](rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2);
- return this;
- },
- /**
- * Set the clip-path attribute on the provided selection.
- * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
- */
- /** @expose */
- applyTo : function(s) {
- s.attr("clip-path", "url(" + this.url() + ")");
- return this;
- },
- /**
- * Retrieve the id assigned to this clip path.
- */
- /** @expose */
- id : function() {
- return this._id;
- },
- /**
- * Retrieve the URL that can be used to reference this clip path.
- */
- /** @expose */
- url : function() {
- return "#" + this._id;
- },
- /** @expose */
- execute : function(g) {
- var clipPath = g.selectAll("#" + this._id).data([0]);
- clipPath.enter().append("clipPath").attr("id", this._id).append("rect");
- rave.transition(clipPath.select("rect")).attr("x", this._clipRect.x).attr("y", this._clipRect.y).attr("width", this._clipRect.width).attr("height", this._clipRect.height);
- }
- });
- // $source: com/ibm/rave/bundles/components/LegendComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
- /**
- * <p> A component to draw a legend, using a RAVE capability swatch legend. In JavaScript the RAVE legend and layout extensions must be loaded. The legend puts its shapes into the selector passed to its execute method, so that selector should choose a group node. </p> <p> Most of the component properties are passed directly to the RAVE legend. The properties are: </p> <p> <b>visible</b>: If true, the legend is drawn; otherwise it is cleared (all shapes are removed from the legend). The default is true. </p> <p> <b>size</b>: A Dim with the size of the legend in the chart coordinate system. If null or zero-sized, the legend is cleared. This is passed to the swatch legend. </p> <p> <b>colorScale</b>: A scale (OrdinalScale) used as the RAVE legend scale. If null, the legend is cleared. The legend currently only supports a single ordinal color scale. </p> <p> <b>orient</b>: The RAVE legend orient, either "horizontal" or "vertical". The default is "vertical". </p> <p> <b>swatchSize</b>: The RAVE legend size. Note that this is in square pixels. The default is 20*20. </p> <p> <b>shape</b>: The RAVE legend shape. The default is "square". </p> <p> <b>title</b>: The RAVE legend title. The default is null. </p> <p> <b>titleFill</b>: The legend title color. The default is null. </p> <p> <b>titleFontSize</b>: The legend title font size. The default is null. </p> <p> <b>titleFontFamily</b>: The legend title font family. The default is null. </p> <p> <b>borderColor</b>: The RAVE legend borderColor. The default is "black". </p> <p> <b>labelFormat</b>: The RAVE legend labelFormat. The default is null. </p>
- */
- var com_ibm_rave_bundles_components_LegendComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- /**
- * Legend size property
- */
- //_size : null,
- /**
- * Color scale
- */
- //_colorPalette : null,
- /**
- * Orient, "horizontal" or "vertical"
- */
- //_orient : null,
- /**
- * Swatch size function
- */
- //_swatchSizeFunc : null,
- /**
- * Scale
- */
- //_scale : null,
- /**
- * Swatch symbol
- */
- //_shape : null,
- /**
- * Legend title
- */
- //_title : null,
- /**
- * Legend title styling
- */
- //_titleStyle : null,
- /**
- * Legend entry styling
- */
- //_entryStyle : null,
- /**
- * Custom formatter
- */
- //_labelFormat : null,
- /**
- * The swatch legend, created on demand
- */
- //_swatchLegend : null,
- /**
- * The continuous legend, created on demand
- */
- //_continuousLegend : null,
- /**
- * The legend type, either "SwatchLegend" or "ContinuousLegend"
- */
- //_legendType : null,
- /**
- * Is the legend visible
- */
- _visible : false,
- /**
- * Swatch size in square pixels
- */
- _swatchSize : 0,
- /**
- * Constructor; sets bound and, colorScale to null, all other properties to their default values.
- */
- /** @expose */
- constructor : function() {
- this._visible = true;
- this._size = null;
- this._colorPalette = null;
- this._orient = "horizontal";
- this._swatchSize = 16.0 * 16.0;
- this._swatchSizeFunc = null;
- this._scale = null;
- this._shape = "square";
- this._title = null;
- this._titleStyle = {};
- this._entryStyle = {};
- this._labelFormat = null;
- this._swatchLegend = null;
- this._continuousLegend = null;
- this._legendType = null;
- },
- /** @expose */
- type : function() {
- return "LegendComponent";
- },
- /** @expose */
- execute : function(g) {
- if (this._colorPalette) {
- if ("continuous" == this._colorPalette.getType()) {
- if (!this._continuousLegend) {
- this._continuousLegend = (rave.capabilities.extension("legend")).continuous();
- }
- this._legendType = "ContinuousLegend";
- } else {
- if (!this._swatchLegend) {
- this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
- }
- this._legendType = "SwatchLegend";
- }
- } else if (this._swatchSizeFunc) {
- if (!this._swatchLegend) {
- this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
- }
- this._legendType = "SwatchLegend";
- } else {
- this._legendType = null;
- }
- this.preExecute();
- if (!this._visible || (!this._colorPalette && !this._swatchSizeFunc) || !this._size || this._size[0] <= 0 || this._size[1] <= 0) {
- g.selectAll("*").remove();
- return;
- }
- var fontChecker = rave.capabilities.extension("fontchecker");
- if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
- this._continuousLegend.shapeRectSize("horizontal" == this._orient ? [-1.0, 16.0] : [16.0, -1.0]).size(this._size).scale(this._colorPalette.getScale()).orient(this._orient).title(this._title).titleFill(this._titleStyle["fill"]).titleFontSize(this._titleStyle["font-size"]).titleFontFamily(this._titleStyle["font-Family"]).titleAlignment("start").labelFormat(this._labelFormat);
- var legend = g.call(this._continuousLegend);
- if (this._entryStyle) {
- legend.selectAll(".legendLabel").style(this._entryStyle);
- }
- if (this._titleStyle) {
- legend.selectAll(".legendTitle").style(this._titleStyle);
- }
- if (fontChecker) {
- legend.selectAll(".legendLabel").call(fontChecker);
- legend.selectAll(".legendTitle").call(fontChecker);
- }
- } else {
- var insets = {};
- insets["bottom"] = 5;
- var swatchSize = this._swatchSize;
- var scale = null;
- var labelFormatter = this._labelFormat;
- if (this._swatchSizeFunc && this._scale) {
- swatchSize = this._swatchSizeFunc;
- scale = this._scale;
- }
- if (this._colorPalette) {
- scale = this._colorPalette.getScale();
- var originalDomain = this._colorPalette.originalDomain();
- if (originalDomain) {
- scale.domain(originalDomain);
- var f = this._colorPalette.originalDomainLabelAccessor();
- if (this._labelFormat) {
- var self = this;
- labelFormatter = function(data, index, groupIndex) {
- return self._labelFormat.call(this, f.call(this, data, index, groupIndex), index, groupIndex);
- };
- } else {
- labelFormatter = f;
- }
- }
- }
- this._swatchLegend.labelPadding(8).size(this._size).scale(scale).orient(this._orient).swatchSize(swatchSize).shape(this._shape).title(this._title).titleFill(this._titleStyle["fill"]).titleFontSize(this._titleStyle["font-size"]).titleFontFamily(this._titleStyle["font-family"]).titleAlignment("start").labelFormat(labelFormatter).titleInsets(insets);
- var legend = g.call(this._swatchLegend);
- if (this._entryStyle) {
- legend.selectAll(".legendLabel").style(this._entryStyle);
- }
- if (this._titleStyle) {
- legend.selectAll(".legendTitle").style(this._titleStyle);
- }
- if (fontChecker) {
- legend.selectAll(".legendLabel").call(fontChecker);
- legend.selectAll(".legendTitle").call(fontChecker);
- }
- }
- },
- /** @expose */
- legend : function() {
- if ("ContinuousLegend" == this._legendType) {
- return this._continuousLegend;
- }
- if ("SwatchLegend" == this._legendType) {
- return this._swatchLegend;
- }
- return null;
- },
- /** @expose */
- legendType : function() {
- return this._legendType;
- },
- /**
- * Set the visible property.
- * @param (boolean) visible New visible
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- visible : function(visible) {
- this._visible = visible;
- return this;
- },
- /**
- * see if the legend is visible
- * @return (boolean) if its visible
- */
- /** @expose */
- isVisible : function() {
- return this._visible;
- },
- /**
- * Set the size property.
- * @param (Array) size New size
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- size : function(size) {
- this._size = size;
- return this;
- },
- /**
- * Set the color scale property.
- * @param (rave['library']['internal']['Palette']) colorPalette New color scale
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- colorPalette : function(colorPalette) {
- this._colorPalette = colorPalette;
- return this;
- },
- /**
- * Set the orient property. If the argument is not "horizontal" or "vertical", it is ignored and the orient property is not changed.
- * @param (String) orient New orient
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- orient : function(orient) {
- if ("horizontal" == orient || "vertical" == orient) {
- this._orient = orient;
- }
- return this;
- },
- /**
- * Set the orient property from a legend position. If the argument is "top" or "bottom", the orient is set to "horizontal". Otherwise it is set to "vertical".
- * @param (String) position Legend position
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- position : function(position) {
- return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
- },
- swatchSize$0 : function(swatchSize) {
- if (swatchSize >= 0.0 && swatchSize != null) {
- this._swatchSize = swatchSize;
- }
- return this;
- },
- /** @expose */
- scale : function(scale) {
- this._scale = scale;
- return this;
- },
- swatchSize$1 : function(swatchSize) {
- if (swatchSize) {
- this._swatchSizeFunc = swatchSize;
- }
- return this;
- },
- /** @expose */
- shape : function(shape) {
- this._shape = shape;
- return this;
- },
- /** @expose */
- title : function(title) {
- this._title = (title != null && title.length > 0) ? title : null;
- return this;
- },
- /** @expose */
- titleFill : function(titleFill) {
- this._titleStyle["fill"] = titleFill;
- return this;
- },
- /** @expose */
- titleFontSize : function(titleFontSize) {
- this._titleStyle["font-size"] = titleFontSize;
- return this;
- },
- /** @expose */
- titleFontFamily : function(titleFontFamily) {
- this._titleStyle["font-family"] = titleFontFamily;
- return this;
- },
- /** @expose */
- labelFormat : function(labelFormat) {
- this._labelFormat = labelFormat;
- return this;
- },
- /** @expose */
- titleFont : function(titleFontStyle) {
- this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(titleFontStyle);
- return this;
- },
- /** @expose */
- entryFont : function(entryFontStyle) {
- this._entryStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(entryFontStyle);
- return this;
- },
- /** @expose */
- getSpaceUsed : function() {
- if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
- return this._continuousLegend.getUsedSize() + 2;
- } else {
- return this._swatchLegend.getUsedSize() + 2;
- }
- },
- /** @expose */
- swatchSize : function(a0) {
- var args = arguments;
- if (args.length == 1 && typeof a0 === "function") {
- return this.swatchSize$1(a0);
- }
- return this.swatchSize$0(a0);
- }
- });
- /**
- * Get the orient for a position. "top" and "bottom" return "horizontal", anything else ("left", "right", or unknown/null) is "vertical".
- * @param (String) position A position
- * @return (String) "horizontal" or "vertical"
- */
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf = function(position) {
- if ("top" == position || "bottom" == position) {
- return "horizontal";
- }
- return "vertical";
- };
- //com_ibm_rave_bundles_components_LegendComponentImpl.HORIZONTAL = "horizontal";
- //com_ibm_rave_bundles_components_LegendComponentImpl.VERTICAL = "vertical";
- com_ibm_rave_bundles_components_LegendComponentImpl.BAR_THINKNESS = 16;
- com_ibm_rave_bundles_components_LegendComponentImpl.SWATCH_SIZE = 16;
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.TOP = "top";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.BOTTOM = "bottom";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.LEFT = "left";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.RIGHT = "right";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.ADJUSTABLE = -1;
- // $source: com/ibm/rave/bundles/components/AxisComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/AxisComponent (runtime) // AxisComponent
- //@import com/ibm/rave/bundles/utilities/TextCrossfader (runtime) // textCrossFade
- //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
- //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
- /**
- * <p> Component to draw an axis and title. The component is drawn into a Selector group, and the user of the component must translate the group to the axis position and set up the axis scale for the correct number of pixels. </p> <p> The component uses a RAVE core Axis for drawing the axis. Most component properties are passed to the axis. The component properties are: </p> <p> <b>scale</b>: The axis scale. This must be set up with the domain and range (pixels) of the axis. If null the axis does not render, and removes all axis shapes from the selector. Default null. </p> <p> <b>orient</b>: The axis orient, "top", "bottom", "left", or "right". Default "bottom". </p> <p> <b>bounds</b>: The bounding box for the axis, used to position the title and to wrap/truncate axis labels. If null the title is placed 50 pixels from the axis line and text is not wrapped. </p> <p> <b>tickFormat</b>: A value function passed to the axis to format tick labels. Default null, meaning the RAVE default formatting is used. </p> <p> <b>displayAxisTitle</b>: Whether to display the axis title. Default true. </p> <p> <b>axisTitle</b>: The title to display on the axis. It is centered on the axis range, and the size property is used to find the distance from the axis. Default null. </p> <p> <b>axisColor</b>: A color-string for the axis line. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>tickColor</b>: A color-string for the axis ticks. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>labelColor</b>: A color-string for the axis tick labels. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>titleColor</b>: A color-string for the axis title. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>displayAxisLine</b>: Whether to display the axis line. Default true. </p> <p> <b>displayAxisTicks</b>: Whether to display the axis ticks. Default true. </p> <p> <b>displayAxisTickLabels</b>: Whether to display the axis tick labels. Default true. </p>
- */
- var com_ibm_rave_bundles_components_AxisComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- /**
- * Axis - created on demand
- */
- //_axis : null,
- /**
- * Role, from the AxisComponent API
- */
- //_role : null,
- /**
- * CoordinateScale
- */
- //_scale : null,
- /**
- * Orient, always one of the four legal values
- */
- //_orient : null,
- /**
- * Size
- */
- //_bounds : null,
- //_elementRect : null,
- /**
- * The title text; default null (nothing visible)
- */
- /** @expose */
- _axisTitle : null,
- /**
- * The title style; defaults null (use the CSS styling)
- */
- /** @expose */
- _titleStyle : null,
- /**
- * Axis line color; default null (use the CSS styling)
- */
- /** @expose */
- _lineColor : null,
- /**
- * Axis tick color; default null (use the CSS styling)
- */
- /** @expose */
- _tickColor : null,
- /**
- * Axis tick label style; defaults null (use the CSS styling)
- */
- /** @expose */
- _labelStyle : null,
- //_staggerRotate45Nodes : null,
- //_staggerFirstNode : null,
- //_staggerLastNode : null,
- /**
- * Axis tick label formatting
- */
- //_tickFormat : null,
- //_dropOverlap : null,
- /**
- * Used to get the extension to enable axis label wrapping
- */
- //_textFlow : null,
- /**
- * Used to check the fonts on each label to make sure all characters are covered
- */
- //_fontChecker : null,
- /**
- * Run function that applies the properties to the axis line
- */
- //_axisLineProperties : null,
- /**
- * Run function that applies the properties to the axis ticks
- */
- //_axisTickProperties : null,
- /**
- * Run function that applies the properties to the axis tick labels
- */
- //_axisTickLabelProperties : null,
- /**
- * Run function that hides or displays the axis tick labels
- */
- //_displayHideLabels : null,
- /**
- * Run function that hides or displays the axis tick labels
- */
- //_panZoomLabels : null,
- /**
- * The tick handler registered with the axis; will get called during axis transition
- */
- //_tickHandler : null,
- //_textTruncationIndicator : null,
- /**
- * Used when dealing with numeric scale on the vertical axis and the numbers don't fit
- */
- //_simplifiedTickFormat : null,
- //_tickMagnitude : null,
- /**
- * Whether to display the axis title; default true
- */
- /** @expose */
- _displayAxisTitle : false,
- /**
- * Whether to display the axis line; default true
- */
- /** @expose */
- _displayAxisLine : false,
- /**
- * Whether to display the axis ticks; default true
- */
- /** @expose */
- _displayTicks : false,
- /**
- * Whether to display the axis tick labels (conditional on show labels property); default true
- */
- /** @expose */
- _displayTickLabels : false,
- /**
- * Whether to display the axis tick labels (conditional on pan-zoom hide property); default true
- */
- /** @expose */
- _showPanZoomTickLabels : false,
- /**
- * Whether to rotate the axis tick labels; default false
- */
- _rotateLabels : false,
- _staggerCellWidth : 0,
- _staggerAlignFirstAtStart : false,
- _staggerAlignLastAtEnd : false,
- _layoutTimerId : 0,
- _layoutTitleSize : 0,
- _layoutLabelSize : 0,
- _layoutLabelHeight : 0,
- _layoutAverageDigitWidth : 0,
- _layoutSpillOver : 0,
- /**
- * Whether to hide overlapping labels; default true
- */
- /** @expose */
- _hideOverlappingLabels : false,
- /**
- * When true, don't start a new timer
- */
- _pendingLabelTimer : false,
- /**
- * The padding in px between tick axis line and tick label, and also between tick label and title. Default 16px.
- */
- _padding : 0,
- /**
- * After calling the component, this is true if shapes were rendered, false if they were cleared.
- */
- _renderedShapes : false,
- _layoutMode : -1,
- _allowAutoAxisLayoutToChangeOrientaiton : true,
- _lastAutomaticAxisLayoutOrientation : -1,
- _allowStagger : false,
- _allowRotate45 : false,
- _allowRotate90 : false,
- constructor : function() {
- {
- var self = this;
- this._axisLineProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var line = this.selectAll("path.domain");
- if (self._lineColor != null) {
- line.style("stroke", self._lineColor);
- }
- if (self._displayAxisLine) {
- line.attr("visibility", null);
- } else {
- line.attr("visibility", "hidden");
- }
- return null;
- }
- };
- this._axisTickProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var tickLines = this.selectAll("line");
- if (self._displayTicks) {
- tickLines.attr("visibility", null);
- } else {
- tickLines.attr("visibility", "hidden");
- }
- if (self._lineColor != null) {
- tickLines.style("stroke", self._tickColor);
- }
- return null;
- }
- };
- this._axisTickLabelProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var labels = this.selectAll("text");
- labels.each(self._displayHideLabels);
- labels.each(self._panZoomLabels);
- labels.style(self._labelStyle);
- self._axis.ticksHandler(null);
- return null;
- }
- };
- this._displayHideLabels = function(obj, group, index) {
- if (self._displayTickLabels) {
- if (this.rave_hasProperty("__tickLabelHidden__")) {
- this.rave_removeProperty("__tickLabelHidden__");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- if (count <= 1) {
- this.rave_removeProperty("__hiddenCount__");
- this.removeAttribute("visibility");
- } else {
- this.rave_setProperty("__hiddenCount__", count - 1);
- }
- }
- } else {
- if (!(this.rave_hasProperty("__tickLabelHidden__"))) {
- this.setAttribute("visibility", "hidden");
- this.rave_setProperty("__tickLabelHidden__", "hidden");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- this.rave_setProperty("__hiddenCount__", count + 1);
- }
- }
- };
- this._panZoomLabels = function(obj, group, index) {
- if (self._showPanZoomTickLabels) {
- if (this.rave_hasProperty("__panZoomHidden__")) {
- this.rave_removeProperty("__panZoomHidden__");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- if (count <= 1) {
- this.rave_removeProperty("__hiddenCount__");
- this.removeAttribute("visibility");
- } else {
- this.rave_setProperty("__hiddenCount__", count - 1);
- }
- }
- } else {
- if (!(this.rave_hasProperty("__panZoomHidden__"))) {
- this.setAttribute("visibility", "hidden");
- this.rave_setProperty("__panZoomHidden__", "hidden");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- this.rave_setProperty("__hiddenCount__", count + 1);
- }
- }
- };
- }
- this._tickHandler = new com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler(this._axisTickLabelProperties, this._axisTickProperties);
- /**
- * Initialize properties to defaults
- */
- {
- this._axis = null;
- this._role = null;
- this._scale = null;
- this._orient = "bottom";
- this._bounds = null;
- this._displayAxisTitle = true;
- this._axisTitle = null;
- this._titleStyle = {};
- this._displayAxisLine = true;
- this._lineColor = null;
- this._displayTicks = true;
- this._tickColor = null;
- this._displayTickLabels = true;
- this._labelStyle = {};
- this._rotateLabels = false;
- this._hideOverlappingLabels = true;
- this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
- this._tickFormat = null;
- this._showPanZoomTickLabels = true;
- this._pendingLabelTimer = false;
- this._padding = 16;
- this._textFlow = rave.capabilities.extension("textflow");
- this._fontChecker = rave.capabilities.extension("fontchecker");
- this._renderedShapes = false;
- }
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE;
- },
- /** @expose */
- role : function() {
- return this._role;
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- if (!this._scale) {
- g.selectAll("*").remove();
- this._renderedShapes = false;
- return;
- }
- this._renderedShapes = true;
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- this._hideOverlappingLabels = false;
- this._rotateLabels = true;
- } else {
- this._hideOverlappingLabels = true;
- this._rotateLabels = true;
- }
- this.drawTitle(g);
- this.drawAxis(g);
- this.handleAxisText(g);
- this.drawTitle(g);
- },
- /**
- * This is one place where all the calls that affect the axis text happen in case of allowAutomaticAxisLayout the new behavior applies here
- * @param (rave['internal']['Selector']) g
- */
- handleAxisText : function(g) {
- this.stopLabelDroppingUpdate();
- var duration = 0, delay = 0;
- var g2 = rave.transition(g);
- if (g2.isTransition()) {
- var t2 = (g2);
- duration = t2.duration();
- delay = t2.delay();
- }
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("g.tick").filter(rave['library']['internal']['BundleUtils'].notExit).selectAll("text");
- var fontChecker = rave.capabilities.extension("fontchecker");
- labels.style(this._labelStyle);
- if (fontChecker) {
- labels.call(fontChecker);
- }
- var mode = this._allowAutoAxisLayoutToChangeOrientaiton ? this.determineWhichAutoMode(g) : this._lastAutomaticAxisLayoutOrientation;
- this.configureStaggerData(g, mode);
- this.handleLabelsRotationAndPosition(g, labels, mode);
- this.hashingNumericScales(labels, this.labelExtent(g), mode);
- if (duration == 0) {
- this.doLabelWrapping(g, mode);
- this.handleLabelsRotationAndPosition(g, labels, mode);
- }
- this._lastAutomaticAxisLayoutOrientation = mode;
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var tick = axisSelector.append("g").classed("tick", true);
- var tickText = tick.append("text");
- if (labels.size() == 0) {
- var singleValue = this._scale.scale().domain()[0];
- var formatter = this._tickFormat;
- if (!formatter) {
- var tickFunc = this._scale.scale().tickFormat;
- if (tickFunc) {
- formatter = tickFunc.apply(tickFunc, [singleValue]);
- }
- }
- var node = tickText[0][0];
- var stringValue = formatter ? formatter.call(node, singleValue, 0, 0) : ""+(singleValue);
- tickText.text(stringValue);
- var dim = node.getBBox();
- this._layoutLabelSize = isHorizontal ? dim.height : dim.width;
- if (!isHorizontal || mode != 0) {
- tickText.text(".0");
- this._layoutLabelSize += node.getBBox().width;
- }
- }
- if (!isHorizontal || mode != 0) {
- tickText.text(".0");
- var node = tickText[0][0];
- var dim = node.getBBox();
- this._layoutAverageDigitWidth = dim.width;
- }
- tick.remove();
- }
- if (this._hideOverlappingLabels && duration > 0) {
- this.updateLabelDropping(labels, duration, delay);
- }
- if (duration > 0) {
- this.doLabelWrappingAfterAnimation(g, labels, mode, duration, delay);
- }
- if (!this._displayTickLabels) {
- this._layoutLabelSize = 0;
- this._layoutAverageDigitWidth = 0;
- }
- },
- /**
- * Rotates the text and shifts it to compensate for the rotation Needs to be called twice once before wrapping in order to have text in correct position for wrap then after to know the correct height of wrapped text in order to shift it correct TODO: find a better way to do this
- * @param (rave['internal']['Selector']) g selector
- * @param (rave['internal']['Selector']) labels labels selector
- * @param (int) mode one of HORIZONTAL, STAGGER, ROTATE90
- */
- handleLabelsRotationAndPosition : function(g, labels, mode) {
- if (mode == 2 || mode == 1) {
- if (this._orient == "bottom") {
- this.rotateLabels(g, labels, "end", mode);
- } else if (this._orient == "top") {
- this.rotateLabels(g, labels, "start", mode);
- } else {
- this.rotateLabels(g, labels, "middle", mode);
- }
- } else {
- if (this._orient == "bottom" || this._orient == "top") {
- this.rotateLabels(g, labels, "middle", mode);
- } else if (this._orient == "right") {
- this.rotateLabels(g, labels, "start", mode);
- } else {
- this.rotateLabels(g, labels, "end", mode);
- }
- }
- },
- /**
- * <p> Numeric scales cannot be truncated or wrapped, if a number doesn't fit the allowed space the number should be hashed</p> <p> ex: 12345 -> ##### </p> <p>This method should be called before {@link #this.doLabelWrapping(rave['internal']['Selector'])} , truncation must be set to off in case of numeric scale</p>
- * @param (rave['internal']['Selector']) labels
- */
- hashingNumericScales : function(labels, extent, mode) {
- if (!labels || !extent) {
- return;
- }
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var tickSpace = mode == 1 ? extent[1] : extent[0];
- this._textTruncationIndicator = "";
- this._layoutLabelSize = 0;
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[i][0];
- var dim = node.getBBox();
- var width = dim.width;
- var height = dim.height;
- var size = !isHorizontal || mode == 1 ? width : height;
- if (size > this._layoutLabelSize) {
- this._layoutLabelSize = size;
- }
- if (width >= tickSpace) {
- if (this._simplifiedTickFormat) {
- var newText = this._simplifiedTickFormat.call(null, node.rave_getData(), 0, 0);
- if (newText != null) {
- node.rave_setText(newText);
- }
- if (node.getBBox().width >= tickSpace) {
- node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
- }
- } else {
- node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
- }
- }
- }
- }
- },
- /**
- * @param (int) size The desired size of the string
- * @param (String) ch The character to be repeated in the string
- * @return (String) A string of the specified size containing repetition of the specified character
- */
- stringOfSize : function(size, ch) {
- var returnString = "";
- for (var i = 0; i < size; ++i) {
- returnString += ch;
- }
- return returnString;
- },
- configureStaggerData : function(g, mode) {
- if (mode == 3 || mode == 2) {
- var horizontalDimensions = this.labelExtent(g);
- var cellWidth = horizontalDimensions[0];
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("text");
- var domain = this._scale.scale().domain();
- var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
- this._staggerRotate45Nodes = [];
- this._staggerFirstNode = null;
- this._staggerLastNode = null;
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[0][i];
- if (this.isValid(node.rave_getData())) {
- var domainIndex = -1;
- if (mode == 3) {
- var domainLabel = !this._tickFormat ? node.rave_getText() : originalDataLabelAccessor.call(node, node.rave_getData(), 0, 0);
- for (var index = 0; index < domain.length; ++index) {
- if (domain[index].toString() == domainLabel) {
- domainIndex = index;
- break;
- }
- }
- }
- this._staggerRotate45Nodes.push(new com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex(node, domainIndex));
- if (domainIndex == 0) {
- this._staggerFirstNode = node;
- }
- if (domainIndex == domain.length - 1) {
- this._staggerLastNode = node;
- }
- }
- }
- this._staggerCellWidth = cellWidth * 2;
- this._staggerAlignFirstAtStart = this._staggerFirstNode ? this._staggerFirstNode.getBBox().width > cellWidth : false;
- this._staggerAlignLastAtEnd = this._staggerLastNode ? this._staggerLastNode.getBBox().width > cellWidth : false;
- }
- },
- getStaggerIndex : function(node) {
- for (var index = 0; index < this._staggerRotate45Nodes.length; ++index) {
- if (this._staggerRotate45Nodes[index].contains(node)) {
- var domainIndex = this._staggerRotate45Nodes[index].getIndex();
- return domainIndex == -1 ? 0 : domainIndex;
- }
- }
- return -1;
- },
- getStaggerCount : function() {
- var domain = this._scale.scale().domain();
- return domain.length;
- },
- /**
- * <p> The method is responsible for determining which mode to be used with the label positioning if {@link com_ibm_rave_bundles_components_AxisComponentImpl._allowAutomaticLayout} flag is enabled </p>
- * @param (rave['internal']['Selector']) g
- */
- determineWhichAutoMode : function(g) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("text");
- var dim = this.labelExtent(g);
- var cellWidth = dim[0];
- var cellWidth90 = dim[1];
- var layoutLabelHeight = 0;
- var layoutLabelWidth = 0;
- var horizontalScore = 0;
- var staggerScore = 0;
- var rotate45Score = 0;
- var rotate90Score = 0;
- var validNodes = [];
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[0][i];
- if (this.isValid(node.rave_getData())) {
- validNodes.push(node);
- }
- }
- var labelCount = validNodes.length;
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var mode = 0;
- if (isHorizontal) {
- mode = this._layoutMode == 1 ? 1 : 0;
- var tick = axisSelector.append("g").classed("tick", true);
- var tickText = tick.append("text");
- tickText.style(this._labelStyle);
- tickText.text(",0");
- var node = tickText[0][0];
- var zeroWidth = node.getBBox().width;
- tick.remove();
- var widestLabel = 0;
- for (var i = 0; i < labelCount; ++i) {
- node = validNodes[i];
- var nodeRect = node.getBBox();
- if (nodeRect.width > widestLabel) {
- widestLabel = nodeRect.width;
- }
- if (nodeRect.height > this._layoutLabelHeight) {
- this._layoutLabelHeight = nodeRect.height;
- }
- }
- widestLabel += zeroWidth;
- this._layoutSpillOver = mode == 1 ? this._layoutLabelHeight / 2 : widestLabel / 2 + 2;
- } else {
- for (var i = 0; i < labelCount; ++i) {
- var node = validNodes[i];
- var nodeRect = node.getBBox();
- if (nodeRect.height > this._layoutLabelHeight) {
- this._layoutLabelHeight = nodeRect.height;
- }
- }
- this._layoutSpillOver = this._layoutLabelHeight / 2;
- }
- return mode;
- }
- var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
- var staggerStringsWontMatch = this._tickFormat && !originalDataLabelAccessor;
- var calcStagger = ((this._allowStagger && this._layoutMode == -1) || this._layoutMode == 3) && !staggerStringsWontMatch;
- var calcRotate45 = (this._allowRotate45 && this._layoutMode == -1) || this._layoutMode == 2;
- var calcRotate90 = (this._allowRotate90 && this._layoutMode == -1) || this._layoutMode == 1;
- var spaceFor45Label = 0;
- for (var i = 0; i < labelCount; ++i) {
- var node = validNodes[i];
- var nodeRect = node.getBBox();
- layoutLabelHeight = nodeRect.height;
- var labelWidth = nodeRect.width;
- if (labelWidth > layoutLabelWidth) {
- layoutLabelWidth = labelWidth;
- }
- horizontalScore += (labelWidth <= cellWidth ? 1 : cellWidth / labelWidth);
- if (isHorizontal) {
- if (calcStagger) {
- var spaceForLabel = cellWidth * 2;
- if (i == 0 && i == labelCount - 1) {
- spaceForLabel *= 0.5;
- } else if (i == 0 || i == labelCount - 1) {
- spaceForLabel *= 0.75;
- }
- staggerScore += (labelWidth <= spaceForLabel ? 1 : spaceForLabel / labelWidth);
- }
- if (calcRotate45) {
- if (spaceFor45Label == 0) {
- spaceFor45Label = cellWidth90 / 0.7071 - layoutLabelHeight;
- }
- var space = this.calculate45DegreeSpace(node, spaceFor45Label);
- rotate45Score += (labelWidth <= space ? 1 : space / labelWidth);
- }
- if (calcRotate90) {
- rotate90Score += (labelWidth <= cellWidth90 ? 1 : cellWidth90 / labelWidth);
- }
- }
- }
- var mode = 0;
- if (this._layoutMode == -1) {
- if (isHorizontal && this._allowStagger) {
- horizontalScore *= 1.1;
- staggerScore *= 1.1;
- }
- if ((staggerScore > horizontalScore) && (staggerScore >= rotate45Score) && (staggerScore >= rotate90Score)) {
- mode = 3;
- } else if ((rotate45Score > horizontalScore) && (rotate45Score >= rotate90Score)) {
- mode = 2;
- } else if (rotate90Score > horizontalScore) {
- mode = 1;
- }
- } else {
- if ((this._layoutMode == 3 && staggerStringsWontMatch) || !isHorizontal) {
- mode = 0;
- } else {
- mode = this._layoutMode;
- }
- }
- if (isHorizontal) {
- switch (mode) {
- case 3:
- this._layoutLabelSize = layoutLabelHeight * 2;
- break;
- case 2:
- this._layoutLabelSize = (layoutLabelWidth + layoutLabelHeight) * 0.7071;
- break;
- case 1:
- this._layoutLabelSize = layoutLabelWidth;
- break;
- case 0:
- default:
- this._layoutLabelSize = layoutLabelHeight;
- break;
- }
- } else {
- this._layoutLabelSize = layoutLabelWidth;
- }
- this._layoutLabelHeight = layoutLabelHeight;
- return mode;
- },
- calculate45DegreeSpace : function(node, maxWidth) {
- var width = maxWidth;
- var tfm = node.rave_getParentNode().getAttribute("transform");
- if (tfm != null) {
- var tfmString = tfm.toString();
- var indexOfTrans = tfmString.indexOf("translate(");
- if (indexOfTrans != -1) {
- indexOfTrans += 10;
- var indexOfComma = tfmString.indexOf(",", indexOfTrans);
- if (indexOfComma != -1) {
- var xAmount = tfmString.substring(indexOfTrans, indexOfComma);
- var xLabelPos = + (xAmount);
- var width45Degrees = node.getBBox().width;
- var xLabelWidth = width45Degrees * 0.7071;
- var isBottom = this._orient == "bottom";
- if (isBottom) {
- xLabelPos -= node.getBBox().height / 4;
- if (xLabelPos - xLabelWidth < this._bounds.x) {
- xLabelWidth = xLabelPos - this._bounds.x;
- width = xLabelWidth / 0.7071;
- }
- } else {
- if (xLabelPos + xLabelWidth > this._bounds.x + this._bounds.width) {
- xLabelWidth = (this._bounds.x + this._bounds.width) - xLabelPos;
- width = xLabelWidth / 0.7071;
- }
- }
- if (width > maxWidth) {
- width = maxWidth;
- }
- }
- }
- }
- return width;
- },
- /**
- * @param (rave['internal']['Selector']) labels selector with all labels to be rotated
- * @param (rave['internal']['Selector']) g The parent selector of labels
- * @param (String) textAnchor The position of the anchor
- * @param alignmentMode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
- */
- rotateLabels : function(g, labels, textAnchor, mode) {
- if (this._rotateLabels) {
- var self = this;
- var positioning = function(data, index, groupIndex) {
- var x = 0;
- var y = 0;
- var rotation_cy = 0;
- var isBottom = self._orient == "bottom";
- if (mode == 3) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- if (cellIndex % 2 == 1) {
- var staggerDirection = isBottom ? 1 : -1;
- y += (self._layoutLabelHeight * staggerDirection);
- }
- if (cellIndex == 0 && self._staggerAlignFirstAtStart) {
- x -= self._staggerCellWidth / 4;
- } else if (cellIndex == self.getStaggerCount() - 1 && self._staggerAlignLastAtEnd) {
- x += self._staggerCellWidth / 4;
- }
- }
- } else if (mode == 2) {
- if (isBottom) {
- x -= self._layoutLabelHeight;
- } else {
- x += self._layoutLabelHeight / 2;
- }
- } else if (mode == 1) {
- if (isBottom) {
- x -= (this.getBBox().height / 2 + self._layoutLabelHeight / 4);
- rotation_cy = ~~(self._padding / 4 + self._axis.tickSize());
- } else {
- x -= (this.getBBox().height / 2 - self._layoutLabelHeight);
- rotation_cy = ~~-(self._padding / 4 + self._axis.tickSize());
- }
- }
- var rotationDegrees = mode == 1 ? -90 : mode == 2 ? -45 : 0;
- return "translate(" + x + "," + y + ") rotate(" + rotationDegrees + ",0," + rotation_cy + ")";
- };
- labels.attr("transform", positioning).style("text-anchor", textAnchor);
- if (mode == 3) {
- if (this._staggerAlignFirstAtStart) {
- this._staggerFirstNode.rave_setStyle("text-anchor", "start");
- }
- if (this._staggerAlignLastAtEnd) {
- this._staggerLastNode.rave_setStyle("text-anchor", "end");
- }
- }
- }
- },
- /** @expose */
- axis : function() {
- return this._axis;
- },
- /**
- * Draw the axis. The scale is non-null.
- * @param (rave['internal']['Selector']) g Selector group into which the axis is drawn.
- */
- drawAxis : function(g) {
- var axisSelector = g.selectAll("g.axis").data([0]);
- axisSelector.enter().append("g").classed("axis", true).classed(this._orient, true);
- if (!this._axis) {
- this._axis = new rave['internal']['Axis']();
- }
- if (this._hideOverlappingLabels) {
- this._textFlow.valignment("top").dropTextOnFail(false);
- }
- this._axis.ticksHandler(this._tickHandler);
- this._axis.orient(this._orient);
- this._axis.tickFormat(this._tickFormat);
- this._axis.tickPadding(10.0);
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- var labelHeight = 20.0;
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- if (isHorizontal) {
- labelHeight /= 0.7071;
- }
- var range = this._scale.scale().rangeExtent();
- var extent = + (range[1]) - + (range[0]);
- this._axis.ticks(extent / labelHeight);
- } else {
- if (this._tickMagnitude == null) {
- this._axis.ticks(10.0);
- } else {
- this._axis.ticks.apply(this._axis, [10.0, this._scale.scale().getTickFormat(), this._tickMagnitude]);
- }
- }
- var s = this._scale.scale();
- if (this._scale.originalDomain()) {
- var sOrdinal = s.copy();
- sOrdinal.domain(this._scale.originalDomain());
- s = sOrdinal;
- var self = this;
- var originalDataLabelAccessor = (self._scale).originalDomainLabelAccessor();
- var tickFormatter;
- if (originalDataLabelAccessor) {
- if (this._tickFormat) {
- tickFormatter = function(data, index, groupIndex) {
- return self._tickFormat.call(this, originalDataLabelAccessor.call(this, data, index, groupIndex), index, groupIndex);
- };
- } else {
- tickFormatter = originalDataLabelAccessor;
- }
- } else {
- tickFormatter = this._tickFormat;
- }
- this._axis.tickFormat(tickFormatter);
- }
- this._axis.scale(s);
- axisSelector.call(this._axis);
- var g2 = rave.transition(axisSelector);
- if (!(g2.isTransition())) {
- axisSelector.selectAll("text").call(this._dropOverlap, this._hideOverlappingLabels);
- }
- axisSelector.selectAll("path.domain").classed("axis-line", true);
- axisSelector.selectAll("g.tick line").classed("axis-tick", true);
- if (this._fontChecker) {
- axisSelector.selectAll("g.tick text").classed("axis-label", true).call(this._fontChecker);
- } else {
- axisSelector.selectAll("g.tick text").classed("axis-label", true);
- }
- axisSelector.call(this._axisLineProperties);
- },
- /**
- * Draw the axis title.
- * @param (rave['internal']['Selector']) g Selector group into which the title is drawn.
- */
- drawTitle : function(g) {
- if (!this._displayAxisTitle || this._axisTitle == null || this._axisTitle.trim().length == 0 || !this._bounds) {
- g.selectAll("text.axis-title." + this._orient).remove();
- return;
- }
- var x = 0;
- var y = 0;
- var dy = "";
- var transform;
- if ("top" == this._orient) {
- x = this._elementRect.x + this._elementRect.width / 2;
- y = -this._bounds.height + this._padding / 4;
- dy = "0.75em";
- } else if ("bottom" == this._orient) {
- x = this._elementRect.x + this._elementRect.width / 2;
- y = this._bounds.height - this._padding / 4;
- dy = "-0.25em";
- } else if ("left" == this._orient) {
- x = -this._elementRect.y - this._elementRect.height / 2;
- y = -this._bounds.width + this._padding / 4;
- dy = "0.75em";
- transform = "rotate(-90)";
- } else {
- x = this._elementRect.y + this._elementRect.height / 2;
- y = -this._bounds.width + this._padding / 4;
- dy = "0.75em";
- transform = "rotate(90)";
- }
- var fillOpacity;
- {
- var tmp = g.append("text").attr("class", "axis-title " + this._orient);
- fillOpacity = tmp.style("fill-opacity");
- tmp.remove();
- } var label = g.selectAll("text.axis-title." + this._orient);
- if (label.size() == 0) {
- label.data([0]).enter().append("text").attr("class", "axis-title " + this._orient).style("text-anchor", "middle").attr("x", x).attr("y", y).attr("transform", transform).attr("dy", dy).style(this._titleStyle).text(this._axisTitle);
- if (this._fontChecker) {
- g.selectAll("text.axis-title." + this._orient).call(this._fontChecker);
- }
- }
- com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade(rave.transition(label), label.text(), this._axisTitle, fillOpacity, 0.25).style("text-anchor", "middle").attr("x", x).attr("y", y).attr("transform", transform).attr("dy", dy).style(this._titleStyle);
- },
- getUnZoomedScale : function(scale) {
- var s = scale.copy();
- if (s.getZoomTransform()) {
- s.getZoomTransform()(1, 0);
- }
- return s;
- },
- isValid : function(data) {
- var s = this.getUnZoomedScale(this._axis.scale());
- var v = + (s.call(null, data, 0, 0));
- var range = this._axis.scale().range();
- if (this._axis.scale().range().indexOf(v)> -1) {
- return true;
- }
- if (range[0] < v && v < range[1]) {
- return true;
- }
- if (range[0] > v && v > range[1]) {
- return true;
- }
- return false;
- },
- /**
- * Apply label wrapping if requested.
- * @param (rave['internal']['Selector']) g
- * @param (int) mode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
- */
- doLabelWrapping : function(g, mode) {
- if (this._displayTickLabels) {
- this._textFlow.valignment("top");
- if (!this._hideOverlappingLabels) {
- this._textFlow.dropTextOnFail(true);
- }
- var d = this.labelExtent(g);
- if (!d || d[0] < 0 || d[1] < 0) {
- return;
- }
- var w = ~~ (d[0]);
- var h = ~~ (d[1]);
- if (mode == 2) {
- w = ~~(d[1] / 0.7071 - this._layoutLabelHeight);
- h = ~~(this._layoutLabelHeight / 0.7071);
- } else if (mode == 1) {
- var tmp = w;
- w = h;
- h = tmp;
- }
- var allowWrap = mode == 1;
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- var hActual = ~~ (this._layoutLabelHeight * 1.2);
- if (hActual > h) {
- h = hActual;
- }
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- if (mode == 0 && !isHorizontal) {
- allowWrap = true;
- }
- }
- var self = this;
- var cellWidth = w;
- var cellHeight = h;
- this._textFlow.wrap(allowWrap).truncate(true).textTruncateIndicator(this._textTruncationIndicator != null ? this._textTruncationIndicator : "...").spacing(1.2).extent(function(data, index, groupIndex) {
- var width = cellWidth;
- var height = cellHeight;
- if (mode == 2) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- width = ~~self.calculate45DegreeSpace(this, cellWidth);
- }
- } else if (mode == 3) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- if (cellIndex == 0 && cellIndex == self.getStaggerCount() - 1) {
- width = cellWidth;
- } else if (cellIndex == 0 || cellIndex == self.getStaggerCount() - 1) {
- width = cellWidth * 3 / 2;
- } else {
- width = cellWidth * 2;
- }
- height = cellHeight / 2;
- }
- }
- return [width, height];
- });
- g.selectAll("g.tick > text").call(this._textFlow);
- }
- },
- /**
- * <p> Get the extent of the axis label bounds. If the axis bounds are non-null they are used as the axis bounds; otherwise the scale range and AXIS_LABEL_EXTENT_CONSTANT are used as the bounds. </p> <p> If the axis scale has range bands, the label bounds are the size of the range bands in the dimension parallel to the axis and the size of the axis bounds in the other dimension. Otherwise the label bounds are the axis bounds. </p> <p> If a title with non-empty text was created, the label bounds are reduced by the title font height in the dimension perpendicular to the axis (since the title is always placed at the edge of the bounds). </p>
- * @param (rave['internal']['Selector']) g Selector group for axis
- * @return (Array) The extent of the axis label bounds
- */
- /** @expose */
- labelExtent : function(g) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var w = this._bounds.width;
- var h = this._bounds.height;
- if (this._scale.scale().rangeBand) {
- var rangeBandValue = + (this._scale.scale().rangeBand());
- if (isHorizontal) {
- w = rangeBandValue;
- } else {
- h = rangeBandValue;
- }
- }
- this.calcTitleExtent(g);
- if (isHorizontal) {
- h -= this._axis.tickSize();
- h -= this._padding / 2;
- if (this._layoutTitleSize != 0) {
- h -= this._layoutTitleSize;
- h -= this._padding / 2;
- }
- } else {
- w -= this._axis.tickSize();
- w -= this._padding / 2;
- if (this._layoutTitleSize != 0) {
- w -= this._layoutTitleSize;
- w -= this._padding / 2;
- }
- }
- return [w, h];
- },
- calcTitleExtent : function(g) {
- this._layoutTitleSize = 0;
- var title = g.selectAll("text.axis-title");
- if (title.size() > 0) {
- var textHeight = title[0][0].getBBox().height;
- this._layoutTitleSize = textHeight;
- }
- },
- /**
- * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
- * @param (String) role The new role
- * @return (com.ibm.rave.bundles.components.AxisComponentImpl) This object
- */
- /** @expose */
- setRole : function(role) {
- this._role = role;
- return this;
- },
- /**
- * Set the ticks interval on the scale based on the magnitude. tickMagnitude represents power of 10. null value gives the default scale ticks.
- * @param (Number) tickMagnitude
- * @return (com.ibm.rave.bundles.component.AxisComponent) this
- */
- /** @expose */
- scaleTickMagnitude : function(tickMagnitude) {
- this._tickMagnitude = tickMagnitude;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The new scale
- */
- /** @expose */
- scale : function(scale) {
- this._scale = scale ? scale : null;
- return this;
- },
- /**
- * Only legal values are accepted, otherwise the orient is unchanged.
- * @param (String) orient The new orient
- */
- orient$0 : function(orient) {
- if ("left" == orient || "bottom" == orient || "right" == orient || "top" == orient) {
- this._orient = orient;
- if (this._role == null) {
- if ("left" == orient) {
- this._role = "ROLE_Y1";
- } else if ("bottom" == orient) {
- this._role = "ROLE_X1";
- } else if ("right" == orient) {
- this._role = "ROLE_Y2";
- } else {
- this._role = "ROLE_X2";
- }
- }
- }
- return this;
- },
- /**
- * Returns the current orientation string return The current orient
- */
- orient$1 : function() {
- return this._orient;
- },
- /**
- * @param (rave['internal']['RectStruct']) bounds The new bounds
- */
- /** @expose */
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- /** @expose */
- elementRect : function(elementRect) {
- this._elementRect = elementRect;
- return this;
- },
- tickFormat$0 : function(tickFormat) {
- this._tickFormat = tickFormat;
- return this;
- },
- tickFormat$1 : function() {
- return this._tickFormat;
- },
- simplifiedTickFormat$0 : function(tickFormat) {
- this._simplifiedTickFormat = tickFormat;
- return this;
- },
- simplifiedTickFormat$1 : function() {
- return this._simplifiedTickFormat;
- },
- /** @expose */
- displayAxisTitle : function(displayAxisTitle) {
- this._displayAxisTitle = displayAxisTitle;
- return this;
- },
- /** @expose */
- displayAxisLine : function(displayAxisLine) {
- this._displayAxisLine = displayAxisLine;
- return this;
- },
- /** @expose */
- displayTicks : function(displayTicks) {
- this._displayTicks = displayTicks;
- return this;
- },
- /** @expose */
- displayTickLabels : function(displayTickLabels) {
- this._displayTickLabels = displayTickLabels;
- return this;
- },
- /** @expose */
- allowAutomaticAxisLayoutToChangeOrientation : function(state) {
- this._allowAutoAxisLayoutToChangeOrientaiton = state;
- return this;
- },
- /** @expose */
- isAllowAutomaticAxisLayoutToChangeOrientation : function() {
- return this._allowAutoAxisLayoutToChangeOrientaiton;
- },
- /** @expose */
- showPanZoomTickLabels : function(showPanZoomTickLabels) {
- this._showPanZoomTickLabels = showPanZoomTickLabels;
- return this;
- },
- /** @expose */
- axisTitle : function(axisTitle) {
- this._axisTitle = axisTitle;
- return this;
- },
- /** @expose */
- axisColor : function(axisColor) {
- this._lineColor = axisColor;
- this._tickColor = axisColor;
- return this;
- },
- /** @expose */
- lineColor : function(lineColor) {
- this._lineColor = lineColor;
- return this;
- },
- /** @expose */
- tickColor : function(tickColor) {
- this._tickColor = tickColor;
- return this;
- },
- /** @expose */
- labelColor : function(labelColor) {
- this._labelStyle["fill"] = labelColor;
- return this;
- },
- labelStyle$0 : function(fill, fontSize, fontFamily) {
- this._labelStyle["fill"] = fill;
- this._labelStyle["font-size"] = fontSize;
- this._labelStyle["font-family"] = fontFamily;
- return this;
- },
- /** @expose */
- titleColor : function(titleColor) {
- this._titleStyle["fill"] = titleColor;
- return this;
- },
- titleStyle$0 : function(fill, fontSize, fontFamily) {
- this._titleStyle["fill"] = fill;
- this._titleStyle["font-size"] = fontSize;
- this._titleStyle["font-family"] = fontFamily;
- return this;
- },
- /**
- * @param (int) padding The new padding
- */
- /** @expose */
- padding : function(padding) {
- this._padding = padding;
- return this;
- },
- /**
- * @param mode LayoutMode for axis, one of: null (numeric axis), automatic, horizontal, stagger, rotate45, rotate90
- */
- /** @expose */
- layoutMode : function(layoutMode) {
- this._layoutMode = -1;
- if (layoutMode != null) {
- if (layoutMode == "horizontal") {
- this._layoutMode = 0;
- } else if (layoutMode == "stagger") {
- this._layoutMode = 3;
- } else if (layoutMode == "rotate45") {
- this._layoutMode = 2;
- } else if (layoutMode == "rotate90") {
- this._layoutMode = 1;
- }
- }
- return this;
- },
- /**
- * @param (boolean) allow Enable Stagger to be considered in the automatic layout algorithm
- */
- /** @expose */
- allowStagger : function(allow) {
- this._allowStagger = allow;
- return this;
- },
- /**
- * @param (boolean) allow Enable Rotate 45 to be considered in the automatic layout algorithm
- */
- /** @expose */
- allowRotate45 : function(allow) {
- this._allowRotate45 = allow;
- return this;
- },
- /**
- * @param (boolean) allow Enable Rotate 90 to be considered in the automatic layout algorithm
- */
- /** @expose */
- allowRotate90 : function(allow) {
- this._allowRotate90 = allow;
- return this;
- },
- /**
- * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
- */
- renderedShapes : function() {
- return this._renderedShapes;
- },
- labelStyle$1 : function(fontStyle) {
- this._labelStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
- return this;
- },
- titleStyle$1 : function(fontStyle) {
- this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
- return this;
- },
- /**
- * Determines whether the axis is swapped.
- * @return (boolean) True if axis is swapped
- */
- isAxisSwapped : function() {
- return (((this._role == "ROLE_Y1" || this._role == "ROLE_Y2") && (this._orient == "top" || this._orient == "bottom")) || ((this._role == "ROLE_X1" || this._role == "ROLE_X2") && (this._orient == "right" || this._orient == "left")));
- },
- /**
- * <p> Set the indicator to be used for truncated text </p> <p> ex: indicator set to "..." , results in helloworld - > hello... </p> <p> If the indicator is not set the default indicator "..." is used </p>
- * @param (String) indicator the string to be placed to indicated truncated text
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- /** @expose */
- textTruncateIndicator : function(indicator) {
- this._textTruncationIndicator = indicator;
- return this;
- },
- /**
- * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
- */
- stopLabelDroppingUpdate : function() {
- this._pendingLabelTimer = false;
- },
- /**
- * Start Rave timers with a delay of half the transition duration and the full transition duration. This will fire the label dropping at the halfway mark and at the end.
- * @param (rave['internal']['Selector']) labels the selection of valid labels for the end of the transition
- * @param (double) duration of the transition. If 0, we don't do anything.
- * @param (double) delay of the transition. Added to the duration to delay the updates.
- */
- updateLabelDropping : function(labels, duration, delay) {
- var self = this;
- var start = delay + duration;
- var labelCollideCallback = function(elapsed) {
- if (!self._pendingLabelTimer) {
- return true;
- }
- labels.call(self._dropOverlap, self._hideOverlappingLabels);
- if (elapsed >= start) {
- self._pendingLabelTimer = false;
- return true;
- }
- return false;
- };
- if (duration > 0) {
- this._pendingLabelTimer = true;
- rave.timer(labelCollideCallback, start);
- }
- },
- doLabelWrappingAfterAnimation : function(g, labels, mode, duration, delay) {
- this._layoutTimerId++;
- var timerId = this._layoutTimerId;
- var self = this;
- var wrapCallback = function(elapsed) {
- if (self._layoutTimerId == timerId) {
- self.doLabelWrapping(g, mode);
- self.handleLabelsRotationAndPosition(g, labels, mode);
- }
- return true;
- };
- rave.timer(wrapCallback, delay + duration);
- },
- /** @expose */
- preLayout : function() {
- this._layoutTitleSize = 0;
- this._layoutLabelSize = 0;
- this._layoutLabelHeight = 0;
- this._layoutAverageDigitWidth = 0;
- this._layoutSpillOver = 0;
- },
- /** @expose */
- getSizableType : function() {
- return this._scale.isOrdinal() || this._scale.isClustered() ? 1 : 0;
- },
- /** @expose */
- getSizableOrientation : function() {
- return this._orient;
- },
- /** @expose */
- getPreferredSize : function() {
- var layoutPaddingSize = 0;
- if (this._axis) {
- layoutPaddingSize = this._axis.tickSize();
- if (this._layoutLabelSize != 0) {
- layoutPaddingSize += this._padding / 2;
- }
- if (this._layoutTitleSize != 0) {
- layoutPaddingSize += this._padding / 2;
- }
- }
- return this._layoutLabelSize + this._layoutAverageDigitWidth + this._layoutTitleSize + layoutPaddingSize + 2;
- },
- /** @expose */
- getSpillOverSize : function() {
- return this._layoutSpillOver;
- },
- /** @expose */
- orient : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.orient$1();
- }
- return this.orient$0(a0);
- },
- /** @expose */
- tickFormat : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.tickFormat$1();
- }
- return this.tickFormat$0(a0);
- },
- /** @expose */
- simplifiedTickFormat : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.simplifiedTickFormat$1();
- }
- return this.simplifiedTickFormat$0(a0);
- },
- /** @expose */
- labelStyle : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.labelStyle$1(a0);
- }
- return this.labelStyle$0(a0, a1, a2);
- },
- /** @expose */
- titleStyle : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.titleStyle$1(a0);
- }
- return this.titleStyle$0(a0, a1, a2);
- }
- });
- /**
- * Given the bounds for the axis and the orientation, return the [x,y] translation for the group containing the axis. These are the usual settings for d3 (RAVE core) axes, where the axis range (pixels) is in the global coordinates, then the axis is moved perpendicular to that to place it next to the chart.
- * @param (rave['internal']['RectStruct']) bounds Rectangle of the axis bounds
- * @param (String) orient Orient, "top", "bottom", "left", "right"; if not valid, "bottom" used
- * @return (double[]) Translation [x,y]
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation = function(bounds, orient) {
- if ("left" == orient) {
- return [bounds.x + bounds.width, 0.0];
- }
- if ("right" == orient) {
- return [bounds.x, 0.0];
- }
- if ("top" == orient) {
- return [0.0, bounds.y + bounds.height];
- }
- return [0.0, bounds.y];
- };
- com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex = rave['internal']['Declare']({
- //_node : null,
- _domainIndex : 0,
- /** @expose */
- constructor : function(node, domainIndex) {
- this._node = node;
- this._domainIndex = domainIndex;
- },
- /** @expose */
- contains : function(node) {
- return node == this._node;
- },
- /** @expose */
- getIndex : function() {
- return this._domainIndex;
- }
- });
- /**
- * Tick Handler for the axis. This will get called as the core axis is transitioned.
- */
- com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler = rave['internal']['Declare'](rave['internal']['AbstractTickHandler'], {
- //_label : null,
- //_tick : null,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- _$self.handle(args[0]);
- return null;
- }
- };
- return _$self;
- },
- constructor : function(label, tick) {
- this._label = label;
- this._tick = tick;
- },
- /** @expose */
- handle : function(ticks) {
- ticks.call(this._tick);
- ticks.call(this._label);
- }
- });
- //com_ibm_rave_bundles_components_AxisComponentImpl.VISIBILITY = "visibility";
- //com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN = "hidden";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.LABEL_HIDDEN_FLAG = "__tickLabelHidden__";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.PANZOOM_HIDDEN_FLAG = "__panZoomHidden__";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN_COUNT = "__hiddenCount__";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_SPACE_PER_TICK = 20;
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_TICK_COUNT = 10;
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.TICK_PADDING = 10;
- //com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL_WEIGHT = 1.1;
- com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL = 0;
- com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE90 = 1;
- com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE45 = 2;
- com_ibm_rave_bundles_components_AxisComponentImpl.STAGGER = 3;
- /**
- * Constant used for text flow spacing
- */
- com_ibm_rave_bundles_components_AxisComponentImpl.TEXTFLOW_SPACING = 1.2;
- /**
- * Bottom axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.BOTTOM_ORIENTATION = "bottom";
- /**
- * Top axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.TOP_ORIENTATION = "top";
- /**
- * Left axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.LEFT_ORIENTATION = "left";
- /**
- * Right axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.RIGHT_ORIENTATION = "right";
- com_ibm_rave_bundles_components_AxisComponentImpl.AUTOMODE = -1;
- // $source: com/ibm/rave/bundles/components/GridComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/components/StyleStructs (runtime) // new
- //@import com/ibm/rave/bundles/component/GridComponent (runtime) // GridComponent
- /**
- * <p> Component to draw gridlines for an axis. The component is drawn into a Selector group, and the user of the component must translate the group to the axis position. Gridlines are created using the axis, setting the tick size to the dimension of the gridline space. For correct behavior the gridline component should be called after the axis has been called. </p> <p> The properties are: </p> <p> <b>axis</b>: The axis to use. If null, no gridlines are drawn. Default null. </p> <p> <b>orient</b>: The axis orientation, one of "top", "bottom", "left", "right". Default "bottom". </p> <p> <b>bounds</b>: A rectangle bounding the gridline area, used to find the line length. If null, no gridlines are drawn. Default null. </p> <p> <b>displayGridlines</b>: Whether to draw the gridlines. Default false. </p> <p> <b>gridlineColor</b>: A color-string for the grid lines. If null, no color is applied and the CSS defaults are used. Default null. </p>
- */
- var com_ibm_rave_bundles_components_GridComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- /**
- * The axis property
- */
- //_axis : null,
- /**
- * Role, from the AxisComponent API
- */
- //_role : null,
- /**
- * The orientation
- */
- //_orient : null,
- /**
- * The bounds
- */
- //_bounds : null,
- /**
- * Style of gridlines
- */
- //_gridlineStyle : null,
- /**
- * Whether to display gridlines
- */
- _displayGridlines : false,
- /**
- * After calling the component, this is true if shapes were rendered, false if they were cleared.
- */
- _renderedShapes : false,
- /**
- * Construct, with all properties the defaults.
- */
- /** @expose */
- constructor : function() {
- this._axis = null;
- this._role = null;
- this._orient = "bottom";
- this._bounds = null;
- this._displayGridlines = true;
- this._gridlineStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
- this._renderedShapes = false;
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE;
- },
- /** @expose */
- role : function() {
- return this._role;
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- if (!this._displayGridlines || !this._axis || !this._bounds) {
- g.selectAll("*").remove();
- this._renderedShapes = false;
- return;
- }
- this._renderedShapes = true;
- var size = ("bottom" == this._orient || "top" == this._orient) ? this._bounds.height : this._bounds.width;
- var ticksHandler = this._axis.ticksHandler();
- var tickSize = this._axis.tickSize();
- var outerTickSize = this._axis.outerTickSize();
- var tickFormat = this._axis.tickFormat();
- var ax = this._axis.tickSize(-size, 0).tickFormat("").ticksHandler(null);
- g.call(ax);
- this._axis.tickSize(tickSize, outerTickSize).tickFormat(tickFormat).ticksHandler(ticksHandler);
- g.selectAll("g.tick line").classed("grid-tick", true);
- g.selectAll(".grid-tick").style("stroke", this._gridlineStyle._stroke).style("stroke-dasharray", (this._gridlineStyle._dashArray));
- g.selectAll("path.domain").remove();
- },
- /**
- * @param (rave['internal']['Axis']) axis The new axis
- */
- /** @expose */
- axis : function(axis) {
- this._axis = axis;
- return this;
- },
- /**
- * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
- * @param (String) role The new role
- * @return (com.ibm.rave.bundles.components.GridComponentImpl) This object
- */
- /** @expose */
- setRole : function(role) {
- this._role = role;
- return this;
- },
- /**
- * Only legal values are accepted, otherwise the orient is unchanged.
- * @param (String) orient The new orient
- */
- orient$0 : function(orient) {
- if ("left" == orient || "right" == orient || "bottom" == orient || "top" == orient) {
- this._orient = orient;
- }
- return this;
- },
- /**
- * @param (rave['internal']['RectStruct']) bounds The new bounds
- */
- /** @expose */
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- displayGridlines$0 : function(displayGridlines) {
- this._displayGridlines = displayGridlines;
- return this;
- },
- /** @expose */
- gridlineStyle : function(gridlineColor, dashArray) {
- this.gridlineColor(gridlineColor);
- this.dashArray(dashArray);
- return this;
- },
- gridlineColor$0 : function(gridlineColor) {
- this._gridlineStyle._stroke = (gridlineColor != null && gridlineColor.length > 0) ? gridlineColor : null;
- return this;
- },
- dashArray$0 : function(dashArray) {
- this._gridlineStyle._dashArray = (dashArray != null && dashArray.length > 0) ? dashArray : null;
- return this;
- },
- /**
- * @return (String) The orientation of the gridline.
- */
- orient$1 : function() {
- return this._orient;
- },
- displayGridlines$1 : function() {
- return this._displayGridlines;
- },
- gridlineColor$1 : function() {
- return this._gridlineStyle._stroke;
- },
- dashArray$1 : function() {
- return this._gridlineStyle._dashArray;
- },
- /**
- * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
- */
- renderedShapes : function() {
- return this._renderedShapes;
- },
- /** @expose */
- orient : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.orient$1();
- }
- return this.orient$0(a0);
- },
- /** @expose */
- displayGridlines : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.displayGridlines$1();
- }
- return this.displayGridlines$0(a0);
- },
- /** @expose */
- gridlineColor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.gridlineColor$1();
- }
- return this.gridlineColor$0(a0);
- },
- /** @expose */
- dashArray : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.dashArray$1();
- }
- return this.dashArray$0(a0);
- }
- });
- // $source: com/ibm/rave/bundles/nativeImpl/components/TiledmapV2NativeSubComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017,2020
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // Add javascript dependencies
- // @import ./TiledmapV2FeatureDataMap
- // @import ./TiledmapV2MapDataCache
- var com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl = ( function()
- {
- var reLayerError = /source layer "([^"]+)".*on source "([^"]+)".*style layer "([^"]+)"/i;
- var reNameField = /^\{name/;
- var FILTER_NONE = false;
- /**
- * Returns the optimized bounding box of a geoJSON object.
- * It balances returning the minimal bounding box containing all coordinates of the passed geoJSON object
- * with keeping the map oriented on the Atlantic ocean if the bounding box stretches more then 3/4 of the world.
- * @param {Object} _geo geoJSON object.
- * @param {Array} _bbox (optional) existing bounding box.
- * @returns {Array} The bounding box of the _geo object. If an existing
- * bounding box was specified in _bbox, then this object is modified and
- * returned. This allows chaining the function for multiple objects.
- */
- function getBalancedBoundingBox( _geo, _bbox )
- {
- var coords = flattenCoords( _geo );
- var minbbox = _bbox ? [ _bbox[0], _bbox[1], _bbox[2], _bbox[3] ] : [ Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY ];
- var bbox = _bbox ? [ _bbox[0], _bbox[1], _bbox[2], _bbox[3] ] : [ Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY ];
- // Calculate both the minimal bounding box and a regular bounding box
- for ( var i = coords.length - 1; i >= 0; --i )
- {
- var coord = coords[ i ];
- var coord0 = coord[ 0 ];
- if ( coord0 - minbbox[ 0 ] < 0 )
- {
- // Coordinate is on the left side of the bounding box.
- if ( coord0 + 360 - minbbox[ 2 ] < minbbox[ 0 ] - coord0 )
- coord0 += 360; // adjust x-coordinate
- }
- else if ( coord0 - minbbox[ 2 ] > 0 )
- {
- // Coordinate is on the right side of the bounding box.
- if ( minbbox[ 0 ] - coord0 + 360 < coord0 - minbbox[ 2 ] )
- coord0 -= 360; // adjust x-coordinate
- }
- // Update horizontal for minimal bounding box
- minbbox[ 0 ] = Math.min( coord0, minbbox[ 0 ] );
- minbbox[ 2 ] = Math.max( coord0, minbbox[ 2 ] );
- // Update vertical for minimal bounding box
- minbbox[ 1 ] = Math.min( coord[ 1 ], minbbox[ 1 ] );
- minbbox[ 3 ] = Math.max( coord[ 1 ], minbbox[ 3 ] );
- // Update regular bounding box
- bbox[ 0 ] = Math.min( coord[ 0 ], bbox[ 0 ] );
- bbox[ 1 ] = Math.min( coord[ 1 ], bbox[ 1 ] );
- bbox[ 2 ] = Math.max( coord[ 0 ], bbox[ 2 ] );
- bbox[ 3 ] = Math.max( coord[ 1 ], bbox[ 3 ] );
- }
- // RTC 190107 demands favoring the Atlantic ocean, when showing the map
- // The minbbox determines the minimal bounding box of the passed coordinates.
- // The mechanism used to determine the minbbox has the disadvantage that the minbbox might move
- // the center of the coordinates with wide selections (spanning a large part of the world).
- // In general an orientation over Greenwich is preferred.
- // Check if the bounding box stretches more then 3/4 of the world, in that case, use the regular bbox
- // (which seems to resort to the world view farily quickly)
- var bbExtend = minbbox[ 2 ] - minbbox[ 0 ];
- if ( bbExtend > 270 )
- return bbox;
- // If our minimal bounding box stretches 2/3 of the world and is completely left or right of Greenwich (Longitude = 0),
- // use the regular bbox
- if ( ( bbExtend > 240 ) &&
- ( ( ( minbbox[ 0 ] < -180 ) && ( minbbox[ 2 ] < 0 ) ) || ( ( minbbox[ 2 ] > 180 ) && ( minbbox[ 0 ] > 0 ) ) ) )
- return bbox;
- return minbbox;
- }
- /**
- * Returns a flat list of coordinates contained within a geoJSON object.
- * @param {Object} _geo geoJSON object.
- * @returns {Array} A flat array of coordinates.
- */
- function flattenCoords( _geo )
- {
- var src, src2, dest;
- var i, j, len;
- switch ( _geo.type.toLowerCase() )
- {
- case "point":
- return [ _geo.coordinates ];
- case "linestring":
- case "multipoint":
- return _geo.coordinates;
- case "polygon":
- case "multilinestring":
- src = _geo.coordinates;
- for ( dest = [], i = 0, len = src.length; i < len; ++i )
- dest.push.apply( dest, src[ i ] );
- return dest;
- case "multipolygon":
- src = _geo.coordinates;
- for ( dest = [], i = 0, len = src.length; i < len; ++i )
- for ( src2 = src[ i ], j = 0; j < src2.length; ++j )
- dest.push.apply( dest, src2[ j ] );
- return dest;
- case "feature":
- return flattenCoords( _geo.geometry );
- case "geometrycollection":
- src = _geo.geometries;
- for ( dest = [], i = 0, len = src.length; i < len; ++i )
- dest.push.apply( dest, flattenCoords( src[ i ] ) );
- return dest;
- case "featurecollection":
- src = _geo.features;
- for ( dest = [], i = 0, len = src.length; i < len; ++i )
- dest.push.apply( dest, flattenCoords( src[ i ] ) );
- return dest;
- default:
- return [];
- }
- }
- function setMaxTileCacheSize( _mapOptions )
- {
- var ua = typeof navigator !== "undefined" ? navigator.userAgent : "";
- // IE <= 10 || IE 11
- var isIE = ua.indexOf( 'MSIE ' ) >= 0 || ua.indexOf( 'Trident/' ) >= 0;
-
- if ( isIE )
- {
- _mapOptions.maxTileCacheSize = 6;
- }
- }
-
- function easing( _t )
- {
- return _t * (2 - _t);
- }
- //Constructor
- function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl(node)
- {
- this._featureDataMap = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap();
- this._mapCache = new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache();
- this._mapCacheVersion = this._mapCache.version;
- this._map = null;
- this._nls = null;
- this._mapLoaded = false;
- this._mapboxToken = "";
- this._mapboxStyle = "mapbox://style/mapbox/streets-v9";
- this._mapboxStyleDirty = true;
- this._mapboxDataDirty = true;
- this._mapBBox = null;
- this._containerRect = { // Default rect struct. The width and height are based on the defaults for the D3/Rave Core mercator projection size.
- x: 0,
- y: 0,
- width: 960,
- height: 500
- };
- this._svg = null;
- this._mapContainer = null;
- this._selectedItems = rave.set(); // list of polygons that are currently selected
- this._addedResources = rave.map(); // List added sources and layers
- this._highlights = { items: [] }; // list of polygons that are currently highlighted
- this._dataLayers = [];
- this._mapLocale = "en";
- this._styleDataCache = rave.map();
- this._maxPointSize = null;
- // maxZoom handling
- this._maxZoom = null;
- this._zoomStart = null;
- this._zoomStartHandler = null;
- this._zoomEndHandler = null;
- this._maxZoomCallbacks = [];
- this._mappingErrorCallbacks = [];
- this._autoZoom = true;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.draw = function( _svg )
- {
- // console.debug( "TiledMap::draw" );
- //
- // integrators current pass RAVE an svg element for rendering
- // mapbox renders inside a div
- // we still need the svg element for rendering the legend
- // the strategy here is to create a sibling div to the svg element and let mapbox draw there
- var self = this;
- // set the mapbox access token
- mapboxgl.accessToken = this._mapboxToken; // TODO: Could go in the constructor?
- // get access to the root SVG element
- this._svg = _svg;
- var svgOwner = rave.select( this._svg.node().parentNode );
- // add a new container for both mapbox canvas and chart (legend) SVG
- var containerNode = svgOwner.append( "div" )
- .classed( "vizlibrary-tiledmap", true )
- .classed( "tiledmap-container", true )
- .style( "position", "relative" )
- .style( "width", "100%" )
- .style( "height", "100%" );
- // create mapContainer
- this._mapContainer = containerNode.append( "div" )
- .style( "position", "absolute" )
- .style( "text-align", "left" ) // dashboards needs this for now
- .style( "left", this._containerRect.x + "px" )
- .style( "top", this._containerRect.y + "px" )
- .style( "width", this._containerRect.width + "px" )
- .style( "height", this._containerRect.height + "px" );
- // re-parent and style the svg
- containerNode.node().appendChild( this._svg.node() );
- this._svg.style( "position", "absolute" )
- .style( "top","0px" )
- .style( "left","0px" )
- .style( "pointer-events", "none" ); // Prevent pointer events on the svg container itself. The child svg nodes can have events enabled if needed.
- var options = {
- container: this._mapContainer.node(),
- attributionControl: false,
- style: this._mapboxStyle
- };
- setMaxTileCacheSize( options );
-
- // create the mapbox control
- this._map = new mapboxgl.Map( options );
- // Currently not supporting mapbox rotation.
- this._map.dragRotate.disable();
- this._map.addControl(new mapboxgl.NavigationControl());
- // add attribution control
- this._map.addControl( new mapboxgl.AttributionControl( {
- compact: true
- } ), "bottom-right" );
- var onStyleLoaded = function()
- {
- self._applyMapLocale();
- // a style load causes all layers to be reset as well, reset loaded tilesets
- if ( self._mapboxStyleDirty )
- self._addedResources = rave.map();
- else
- self._clearAddedResources();
- self._mapboxStyleDirty = false;
- self._loadLayers();
- // reset zoom when data was dropped
- if ( self._autoZoom && self._mapboxDataDirty && ( self._featureDataMap.size() === 0 ) )
- self._map.setZoom(0);
- // check delayed bounding box
- if ( self._mapBBox )
- {
- self._fitBounds( self._mapBBox );
- self._mapBBox = null;
- }
- // re-apply selections and highlights
- if ( self._selectedItems.size() )
- self._updateSelectedItemFilters();
- if ( self._highlights.items.length )
- self.highlightAction( self._highlights );
- self._mapboxDataDirty = false;
- }
- this._map.on( "style.load", function()
- {
- // if the map hasn't loaded yet, postpone style.load handling
- if ( self._mapLoaded )
- onStyleLoaded();
- else
- self._map.once( "load", onStyleLoaded );
- } );
- this._map.on( "load", function()
- {
- // mark map loaded
- self._mapLoaded = true;
- } );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.fire = function( _type )
- {
- // console.debug( "TiledMap::fire - " + _type );
- this._map.fire( _type );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._loadLayers = function()
- {
- // console.debug( "TiledMap::_loadLayers" );
- var self = this;
- var styleData = this._styleDataCache.get( this._mapboxStyle );
- var filter;
- if ( !styleData || ( this._featureDataMap.size() === 0 ) )
- return;
- // to make sure the layers are added in the correct order
- [ "region", "point" ].forEach( function( _type )
- {
- // iterate tilesets
- self._featureDataMap.getTileSets( { type: _type } ).forEach( function( _tileSet )
- {
- // add tileset source
- if ( !self._map.getSource( _tileSet.id ) )
- {
- var source = { type: _tileSet.tileType };
- var actionSourceId = null;
- switch ( _tileSet.tileType )
- {
- case "vector":
- filter = self._featureDataMap.getMapFilter( _tileSet );
- source.url = "mapbox://" + _tileSet.id;
- self._map.addSource( _tileSet.id, source );
- self._addResource( { type: "source", tileType: _tileSet.tileType, id: _tileSet.id } );
- // vector layers get an additional source for hover/select/focus actions
- actionSourceId = _tileSet.id + "Action";
- self._map.addSource( actionSourceId, source );
- self._addResource( { type: "source", tileType: _tileSet.tileType, id: actionSourceId } );
- break;
- case "geojson":
- source.data = {
- type: "FeatureCollection",
- features: self._featureDataMap.getFeatures( _tileSet.id )
- };
- self._map.addSource( _tileSet.id, source );
- self._addResource( { type: "source", tileType: _tileSet.tileType, id: _tileSet.id } );
- break;
- }
- }
- // check for region
- if ( _tileSet.polyLayer )
- {
- var polyLayerId = _tileSet.polyLayer;
- if ( _tileSet.tileType === "vector" )
- {
- // setup fill layer
- if ( !self._map.getLayer( polyLayerId ) )
- {
- // console.debug( "- addLayer: " + polyLayerId );
- self._map.addLayer( {
- "id": polyLayerId,
- "type": "fill",
- "source": _tileSet.id,
- "source-layer": _tileSet.sourceLayer,
- "paint": {
- "fill-opacity": 1 - ( _tileSet.transparency / 100.0 )
- }
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: _tileSet.id, tileType: _tileSet.tileType, id: polyLayerId } );
- if ( filter )
- {
- self._map.setFilter( polyLayerId, filter );
- }
- }
- // setup focus layer
- layerId = polyLayerId + "Focus";
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + layerId );
- self._map.addLayer( {
- "id": layerId,
- "type": "fill",
- "source": actionSourceId,
- "source-layer": _tileSet.sourceLayer,
- "paint": {
- "fill-opacity": 1
- },
- "filter": [ "==", _tileSet.property, FILTER_NONE ]
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: actionSourceId, tileType: _tileSet.tileType, id: layerId } );
- }
- // setup select layer
- layerId = polyLayerId + "Select";
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + layerId );
- self._map.addLayer( {
- "id": layerId,
- "type": "line",
- "source": actionSourceId,
- "source-layer": _tileSet.sourceLayer,
- "paint": {
- "line-width": 2,
- "line-opacity": 1
- },
- "filter": [ "==", _tileSet.property, FILTER_NONE ]
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: actionSourceId, tileType: _tileSet.tileType, id: layerId } );
- }
- // setup hover layer
- layerId = polyLayerId + "Hover";
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + layerId );
- self._map.addLayer( {
- "id": layerId,
- "type": "line",
- "source": actionSourceId,
- "source-layer": _tileSet.sourceLayer,
- "paint": {
- "line-width": 2,
- "line-opacity": 1
- },
- "filter": [ "==", _tileSet.property, FILTER_NONE ]
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: actionSourceId, tileType: _tileSet.tileType, id: layerId } );
- }
- }
- else if ( _tileSet.tileType === "geojson" )
- {
- // add placeholder layer (regions with only location information)
- layerId = polyLayerId;
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + pointLayerId );
- self._map.addLayer( {
- "id": layerId,
- "type": "circle",
- "source": _tileSet.id,
- "paint": {
- "circle-opacity": 1 - ( _tileSet.transparency / 100.0 ),
- "circle-radius": 10,
- "circle-stroke-width": 0
- }
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: _tileSet.id, tileType: _tileSet.tileType, id: layerId } );
- }
- // setup focus layer
- layerId = polyLayerId + "Focus";
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + pointLayerId );
- self._map.addLayer( {
- "id": layerId,
- "type": "circle",
- "source": _tileSet.id,
- "paint": {
- "circle-opacity": 1 - ( _tileSet.transparency / 100.0 ),
- "circle-radius": 10,
- "circle-stroke-width": 0
- }
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: _tileSet.id, tileType: _tileSet.tileType, id: layerId } );
- }
- // setup select layer
- layerId = polyLayerId + "Select";
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + layerId );
- self._map.addLayer( {
- "id": layerId,
- "type": "circle",
- "source": _tileSet.id,
- "paint": {
- "circle-opacity": 0,
- "circle-radius": 10,
- "circle-stroke-width": 2
- },
- "filter": [ "==", _tileSet.property, FILTER_NONE ]
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: _tileSet.id, tileType: _tileSet.tileType, id: layerId } );
- }
- // setup hover layer
- layerId = polyLayerId + "Hover";
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + layerId );
- self._map.addLayer( {
- "id": layerId,
- "type": "circle",
- "source": _tileSet.id,
- "paint": {
- "circle-opacity": 0,
- "circle-radius": 10,
- "circle-stroke-width": 2
- },
- "filter": [ "==", _tileSet.property, FILTER_NONE ]
- }, styleData.baseLayer );
- self._addResource( { type: "layer", source: _tileSet.id, tileType: _tileSet.tileType, id: layerId } );
- }
- }
- }
- // check for point
- if ( _tileSet.pointLayer )
- {
- var pointLayerId = _tileSet.pointLayer;
- var layerDef;
- // add pointlayer
- if ( !self._map.getLayer( pointLayerId ) )
- {
- // console.debug( "- addLayer: " + pointLayerId );
- layerDef = {
- "id": pointLayerId,
- "type": "circle",
- "source": _tileSet.id,
- "paint": {
- "circle-opacity": 1 - ( _tileSet.transparency / 100.0 ),
- "circle-radius": 10,
- "circle-stroke-width": 2
- }
- };
- if ( _tileSet.sourceLayer )
- layerDef[ "source-layer" ] = _tileSet.sourceLayer;
- self._map.addLayer( layerDef, styleData.baseLayer );
- self._addResource( { type: "layer", source: _tileSet.id, tileType: _tileSet.tileType, id: pointLayerId } );
- }
- // setup hover layer
- layerId = pointLayerId + "Hover";
- if ( !self._map.getLayer( layerId ) )
- {
- // console.debug( "- addLayer: " + layerId );
- layerDef = {
- "id": layerId,
- "type": "circle",
- "source": _tileSet.id,
- "paint": {
- "circle-opacity": 0,
- "circle-radius": 10,
- "circle-stroke-width": 2
- },
- "filter": [ "==", _tileSet.property, FILTER_NONE ]
- };
- if ( actionSourceId )
- layerDef[ "source" ] = actionSourceId;
- else
- layerDef[ "source" ] = _tileSet.id;
- if ( _tileSet.sourceLayer )
- layerDef[ "source-layer" ] = _tileSet.sourceLayer;
- self._map.addLayer( layerDef, styleData.baseLayer );
- self._addResource( { type: "layer", source: layerDef[ "source" ], tileType: _tileSet.tileType, id: layerId } );
- }
- }
- } );
- } );
- // setup the layer stops
- self._setupLayerStops();
- // set the bounding box, only when the data (DataPoints and MapBox data) has changed and autoZoom is enabled
- // otherwise maintain the current zoom state.
- if ( this._autoZoom && this._mapboxDataDirty )
- self._setBbox();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setBbox = function()
- {
- // console.debug( "TiledMap::_setBbox" );
- var self = this;
- // determine if all tileSets have coordinates
- var allTileSetsHaveCoordinates = this._featureDataMap.getTileSets().every( function( _tileSet )
- {
- if ( ( _tileSet.tileType === "geojson" ) || ( self._featureDataMap.getFeatures( _tileSet.id ).length > 0 ) )
- return true;
- return false;
- } );
- // zoom to world when there are features without coordinates
- if ( !allTileSetsHaveCoordinates )
- this._map.setZoom(0);
- this._map.on('render',afterChangeComplete);
- function afterChangeComplete()
- {
- if( !self._map.loaded() )
- return; // still not loaded
- // safe to query for features
- self._setBboxFeatures();
- self._map.off( "render", afterChangeComplete ); // remove the handler we don't need it anymore
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setBboxFeatures = function()
- {
- // console.debug( "TiledMap::_setBboxFeatures" );
- var featureSet = [];
- var self = this;
- this._featureDataMap.getTileSets().forEach( function( _tileSet )
- {
- // use the features of the geojson type tilesets directly, query mapbox for vector type tilesets
- var features = self._featureDataMap.getFeatures( _tileSet.id );
- if ( _tileSet.tileType === "geojson" )
- {
- featureSet = featureSet.concat( features );
- }
- else
- {
- // if we have features, use them, otherwise query MapBox
- if ( features.length > 0 )
- {
- featureSet = featureSet.concat( features );
- }
- else
- {
- var ids = [];
- self._featureDataMap.filter( { type: _tileSet.type, tileSet: _tileSet.id, property: _tileSet.property } ).forEach( function( _item )
- {
- if ( _item[ _tileSet.property ] !== null )
- ids.push( _item[ _tileSet.property ] );
- } );
- if ( ids.length > 0 )
- {
- var queriedFeatures = self._map.querySourceFeatures( _tileSet.id, {
- sourceLayer: _tileSet.sourceLayer,
- filter: [ "all", ["in", _tileSet.property].concat( ids ) ]
- } );
- featureSet = featureSet.concat( queriedFeatures );
- }
- }
- }
- } );
- // quit when there are no featureSets
- if ( !featureSet.length )
- return;
- // collect the geometry for all features
- var allFeatures = {
- "type": "FeatureCollection",
- "features": []
- };
- featureSet.forEach( function( f )
- {
- allFeatures.features.push({
- "type": "feature",
- "geometry": f.geometry
- } );
- } );
- // calculate the bounding box for all the features
- var bbox = getBalancedBoundingBox( allFeatures );
- var mapBbox = [
- [ bbox[0], bbox[1] ],
- [ bbox[2], bbox[3] ]
- ]
- this._fitBounds( mapBbox );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._addStop = function(
- _stopContainer,
- _stopKey,
- _stopValue )
- {
- if ( !_stopContainer.has( _stopValue ) )
- {
- _stopContainer.set( _stopValue, _stopKey );
- }
- else
- {
- var currValue = _stopContainer.get( _stopValue );
- if ( !Array.isArray( currValue ) )
- _stopContainer.set( _stopValue, [ currValue, _stopKey ] );
- else
- _stopContainer.get( _stopValue ).push( _stopKey );
- }
- },
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._buildStopsExpression = function(
- _property,
- _stops,
- _default )
- {
- if ( !_stops || _stops.size() === 0 )
- {
- return _default;
- }
- var expression = [ "match", [ "to-string", [ "get", _property ] ] ];
- // expression uses this syntax - https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-match
- // where label is either a single item or an array.
- _stops.forEach( function( _key, _value )
- {
- expression.push( _value );
- expression.push( _key );
- } );
- // add default
- expression.push( _default );
- return expression;
- },
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setupLayerStops = function()
- {
- // console.debug( "TiledMap::_setupLayerStops" );
- var self = this;
- if ( this._featureDataMap.size() )
- {
- // loop the tilesets
- self._featureDataMap.getTileSets().forEach( function( _tileSet )
- {
- var fillStops = rave.map(); // Default colour used in the absence of a value. Should this be the "null" color?
- var fillDarkStops = rave.map();
- var circleColorStops = rave.map();
- var circleDarkColorStops = rave.map();
- var circleHighlightStops = rave.map();
- var circleSizeStops = rave.map();
- var layerId = _tileSet[_tileSet.layer];
- var property = _tileSet.property;
- // only add generate stops for tileSets with a propertyType
- if ( _tileSet.propertyType )
- {
- // setup the stops for the data values of this
- var featureDataItems = self._featureDataMap.filter( { tileSet: _tileSet.id, type: _tileSet.type, layer: layerId }, property );
- for ( var idx = 0, size = featureDataItems.length; idx < size; ++idx )
- {
- var featureData = featureDataItems[ idx ];
- var propertyVal = self._resolveProperty( featureData[ property ], featureData.propertyType );
- // set region color stops
- if ( featureData.hasOwnProperty( "fillColor" ) )
- {
- self._addStop( fillStops, propertyVal, featureData.fillColor );
- self._addStop( fillDarkStops, propertyVal, "" + rave.rgb( featureData.fillColor ).darker() );
- }
- // set point color and size
- if ( featureData.hasOwnProperty( "pointSize" ) )
- {
- self._addStop( circleColorStops, propertyVal, featureData.pointColor );
- var darker = rave.rgb( featureData.pointColor ).darker();
- // skip dark color stop for points with staticZeroValuePointSize applied
- if ( !featureData.hasStaticZeroValuePointSize )
- self._addStop( circleDarkColorStops, propertyVal, "" + darker );
- self._addStop( circleHighlightStops, propertyVal, "" + darker.darker() );
- self._addStop( circleSizeStops, propertyVal, featureData.pointSize );
- }
- }
- }
- var fillStopsExpression = self._buildStopsExpression( property, fillStops, "transparent" );
- var fillDarkStopsExpression = self._buildStopsExpression( property, fillDarkStops, "transparent" );
- var circleColorStopsExpression = self._buildStopsExpression( property, circleColorStops, "transparent" );
- var circleDarkColorStopsExpression = self._buildStopsExpression( property, circleDarkColorStops, "transparent" );
- var circleHighlightStopsExpression = self._buildStopsExpression( property, circleHighlightStops, "transparent" );
- var circleSizeStopsExpression = self._buildStopsExpression( property, circleSizeStops, 0 );
- switch( _tileSet.type )
- {
- case "region":
- if ( _tileSet.tileType === "vector" )
- {
- // set stops for fill layer
- self._map.setPaintProperty( layerId, "fill-color", fillStopsExpression );
- // set focus layer stops
- self._map.setPaintProperty( layerId + "Focus", "fill-color", fillStopsExpression );
- // set stops for select layer
- self._map.setPaintProperty( layerId + "Select", "line-color", fillDarkStopsExpression );
- // set stops for hover layer
- self._map.setPaintProperty( layerId + "Hover", "line-color", fillDarkStopsExpression );
- }
- else if ( _tileSet.tileType === "geojson" )
- {
- // set stops for point color
- self._map.setPaintProperty( layerId, "circle-color", fillStopsExpression);
- self._map.setPaintProperty( layerId, "circle-opacity", 1 - (_tileSet.transparency / 100.0) );
- // set stops for point color
- self._map.setPaintProperty( layerId + "Focus", "circle-color", fillStopsExpression );
- self._map.setPaintProperty( layerId + "Focus", "circle-opacity", 1 - (_tileSet.transparency / 100.0) );
- // set stops for hover layer
- self._map.setPaintProperty( layerId + "Hover", "circle-stroke-color", fillDarkStopsExpression );
- // set stops for select layer
- self._map.setPaintProperty( layerId + "Select", "circle-stroke-color", fillDarkStopsExpression );
- }
- break;
- case "point":
- // set stops for point color
- self._map.setPaintProperty( layerId, "circle-color", circleColorStopsExpression );
- self._map.setPaintProperty( layerId, "circle-opacity", 1 - (_tileSet.transparency / 100.0) );
- // set stops for point border
- self._map.setPaintProperty( layerId, "circle-stroke-color", circleDarkColorStopsExpression );
- // set stops for point size
- self._map.setPaintProperty( layerId, "circle-radius", circleSizeStopsExpression );
- // set stops for hover layer
- self._map.setPaintProperty( layerId + "Hover", "circle-stroke-color", circleHighlightStopsExpression );
- self._map.setPaintProperty( layerId + "Hover", "circle-radius", circleSizeStopsExpression );
- break;
- }
- } );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._resolveProperty = function( _value, _type )
- {
- if ( ( _value === null ) || ( typeof _value === "undefined" ) )
- return _value;
- if ( _type === "string" )
- return String( _value );
- if ( _type === "numeric" )
- return Number( _value );
- return _value;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._clearMapsCache = function()
- {
- // console.debug( "TiledMap::_clearMapsCache" );
- this._clearAddedResources();
- this._featureDataMap.clear();
- this._selectedItems = rave.set();
- this._highlights = { items: [] };
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.accessToken = function(accessToken)
- {
- // console.debug( "TiledMap::accessToken" );
- if (accessToken != this._mapboxToken) {
- this._mapboxToken = accessToken;
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.mapStyle = function(style)
- {
- // console.debug( "TiledMap::mapStyle" );
- if ( style !== this._mapboxStyle )
- {
- var self = this;
- this._mapboxStyle = style;
- this._mapboxStyleDirty = true;
- this._map.setStyle( style );
- }
- else if ( !this._mapLoaded )
- {
- this._map.once( "load", this._updateMapLayout.bind( this ) );
- }
- else
- {
- this._updateMapLayout();
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._updateMapLayout = function()
- {
- // console.debug( "TiledMap::_updateMapLayout" );
- if ( this._addedResources.size() > 0 )
- this._setupLayerStops();
- else
- this._loadLayers();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.deselectAllAction = function()
- {
- // console.debug( "TiledMap::deselectAllAction" );
- if( !this._mapLoaded || !this._featureDataMap.size() )
- return;
- var self = this;
- var type = "region";
- this._featureDataMap.getTileSets( { type: type } ).forEach( function( _tileSet )
- {
- var filter = [ "in", _tileSet.property, FILTER_NONE ];
- self._map.setPaintProperty( _tileSet[_tileSet.layer], _tileSet.opacityProp, 1 - (_tileSet.transparency / 100.0) );
- self._map.setFilter( _tileSet[_tileSet.layer] + "Select", filter );
- self._map.setFilter( _tileSet[_tileSet.layer] + "Focus", filter );
- } );
- this._selectedItems = rave.set();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.deselectAction = function( _deselections )
- {
- // console.debug( "TiledMap::deselectAction" );
- if ( !this._mapLoaded )
- this._map.once( "load", this._toggleSelect.bind( this, _deselections, false ) );
- else
- this._toggleSelect( _deselections, false );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._updateSelectedItemFilters = function()
- {
- // console.debug( "TiledMap::_updateSelectedItemFilters" );
- var self = this;
- var type = "region";
- this._featureDataMap.getTileSets( { type: type } ).forEach( function( _tileSet )
- {
- var filter = [ "in", _tileSet.property ];
- self._selectedItems.forEach( function( _id )
- {
- var item = self._featureDataMap.getById( _id );
- if ( item && ( _tileSet.id === item.tileSets[_tileSet.type].id ) )
- filter.push( item[ _tileSet.property ] );
- } );
- if ( filter.length === 2 )
- filter.push( FILTER_NONE );
- self._map.setPaintProperty( _tileSet[_tileSet.layer], _tileSet.opacityProp, ( self._selectedItems.size() === 0 ) ? 1 - (_tileSet.transparency / 100.0) : 0.5 );
- self._map.setFilter( _tileSet[_tileSet.layer] + "Select", filter );
- self._map.setFilter( _tileSet[_tileSet.layer] + "Focus", filter );
- } );
- }
- //list of features to select or deselect
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._toggleSelect = function( _selections, _select )
- {
- // console.debug( "TiledMap::_toggleSelect" );
- if( !_selections || !_selections.items || !this._featureDataMap.size() )
- return;
- // determine item by layer
- var itemsByLayer = this._getItemsByLayer( _selections );
- if ( !itemsByLayer.size() )
- return;
- var self = this;
- // update selected items
- // (currently only regions support selection)
- this._featureDataMap.getTileSets( { type: "region" } ).forEach( function( _tileSet )
- {
- var itemList = itemsByLayer.get( _tileSet.type );
- // we might have caught points as well, skip them
- if ( itemList )
- {
- if ( _select )
- {
- itemList.forEach( function( _item )
- {
- if ( ( _tileSet.id === _item.tileSets[_tileSet.type].id ) && !self._selectedItems.has( _item.id ) )
- self._selectedItems.add( _item.id );
- } );
- }
- else
- {
- itemList.forEach( function( _item )
- {
- if ( ( _tileSet.id === _item.tileSets[_tileSet.type].id ) && self._selectedItems.has( _item.id ) )
- self._selectedItems.remove( _item.id );
- } );
- }
- }
- } );
- this._updateSelectedItemFilters();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.selectAction = function( _selections )
- {
- // console.debug( "TiledMap::selectAction" );
- if ( !this._mapLoaded )
- this._map.once( "load", this._toggleSelect.bind( this, _selections, true ) );
- else
- this._toggleSelect( _selections, true );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.highlightAction = function( _highlights )
- {
- // console.debug( "TiledMap::highlightAction" );
- if ( !this._mapLoaded || !_highlights || !this._featureDataMap.size() )
- return;
- var self = this;
- // determine items
- var itemsByLayer = this._getItemsByLayer( _highlights );
- if ( ( itemsByLayer.size() === 0 ) && ( this._highlights.items.length === 0 ) )
- return;
- // (un)highlight
- var baseFilter = [ "in" ];
- var filter;
- var itemList;
- this._featureDataMap.getTileSets().forEach( function( _tileSet )
- {
- filter = baseFilter.concat( _tileSet.property );
- itemList = [];
- if ( itemsByLayer.has( _tileSet.type ) )
- {
- itemsByLayer.get( _tileSet.type ).forEach( function( _item )
- {
- if ( _item.tileSets[ _tileSet.type ] && ( _item.tileSets[ _tileSet.type ].id === _tileSet.id ) && ( _item[ _tileSet.property ] !== null ) )
- {
- itemList.push( _item[ _tileSet.property ] );
- }
- } );
- }
- filter = filter.concat( itemList.length ? itemList : FILTER_NONE );
- self._map.setFilter( _tileSet[_tileSet.layer] + "Hover", filter );
- } );
- // remember highlighted items
- this._highlights = _highlights;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getItemsByLayer = function( _query )
- {
- var self = this;
- var itemsByLayer = rave.map();
- var itemList;
- if ( _query.items && _query.items.length )
- {
- _query.items.forEach( function( _item )
- {
- var dataLayer = self._getDataLayer( _item.dataSet );
- // if there's no data layer, we're done
- if ( !dataLayer )
- return;
- var layerType = dataLayer.getType();
- var featureData = null;
- // attempt an item resolve by id first
- if ( _item.id )
- featureData = self._featureDataMap.getById( _item.id );
- // if featureData couldn't be retrieved by id, try to resolve by dataSet id and datum
- if ( !featureData && _item.datum )
- featureData = self._featureDataMap.getByKey( self._getFeatureKeyFromAssignedSlots( dataLayer, _item.datum ) );
- if ( featureData )
- {
- dataLayer.typeData.forEach( function( _type, _typeData )
- {
- // check if there's a tile registered for this data layer
- if ( featureData.tileSets[ _type ] )
- {
- if ( itemsByLayer.has( _type ) )
- {
- itemList = itemsByLayer.get( _type );
- }
- else
- {
- itemList = [];
- itemsByLayer.set( _type, itemList )
- }
- itemList.push( featureData );
- }
- } );
- }
- } );
- }
- return itemsByLayer;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setup = function( _node, _nls )
- {
- // console.debug( "TiledMap::setup" );
- var self = this;
- this._nls = _nls;
- // TODO: "resizeVizContainer" (I suspect) is a Dashboards-specific event name. This should be handled the same way all other bundles are resized (i.e. bundle should call resize() on a new render() call.
- _node[0][0].addEventListener( "resizeVisContainer", function()
- {
- if (self._map) {
- window.setTimeout( function()
- {
- self._map.resize();
- }, 10 );
- }
- } );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.off = function( _eventName, _callback )
- {
- // console.debug( "TiledMap::off - " + eventName );
- // check eventName
- switch ( _eventName )
- {
- case "maxZoomReached":
- // remove callback from register
- var pos = this._maxZoomCallbacks.indexOf( _callback );
- if ( pos !== -1 )
- {
- this._maxZoomCallbacks.splice( pos, 1 );
- // clean up if this was the last
- if ( this._maxZoomCallbacks.length === 0 )
- {
- // unregister
- this._map.off( "zoomstart", this._zoomStartHandler );
- this._map.off( "zoomend", this._zoomEndHandler );
- this._zoomStartHandler = null;
- this._zoomEndHandler = null;
- }
- }
- break;
- case "mappingError":
- // remove callback from register
- var pos = this._mappingErrorCallbacks.indexOf( _callback );
- if ( pos !== -1 )
- this._mappingErrorCallbacks.splice( pos, 1 );
- // remove map listeners
- if ( this._mappingErrorCallbacks.length === 0 )
- {
- this._map.off( "error", this._onMapError );
- this._map.off( "data", this._onMapData );
- }
- break;
- default:
- this._map.off( _eventName, _callback );
- break;
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.on = function( _eventName, _callback )
- {
- // console.debug( "TiledMap::on - " + eventName );
- // this._map.on(eventName, callback);
- var self = this;
- // check eventName
- switch ( _eventName )
- {
- case "maxZoomReached":
- // setup zoom handlers if this is the first callback
- if ( !this._maxZoomCallbacks.length )
- {
- this._zoomStartHandler = function()
- {
- // mark zoom start
- self._zoomStart = self._map.getZoom();
- }
- this._zoomEndHandler = function()
- {
- var zoomEnd = self._map.getZoom();
- // invoke registered callbacks when maxZoom reached
- if ( ( zoomEnd === self._zoomStart ) && ( zoomEnd === self._maxZoom ) )
- self._maxZoomCallbacks.forEach( function( _clb ) { _clb(); } );
- self._zoomStart = null;
- }
- // register handlers
- this._map.on( "zoomstart", this._zoomStartHandler );
- this._map.on( "zoomend", this._zoomEndHandler );
- }
- // register callback
- if ( this._maxZoomCallbacks.indexOf( _callback ) === -1 )
- this._maxZoomCallbacks.push( _callback );
- break;
- case "mappingError":
- // register callback
- if ( this._mappingErrorCallbacks.indexOf( _callback ) === -1 )
- this._mappingErrorCallbacks.push( _callback );
- if ( this._mappingErrorCallbacks.length === 1 )
- {
- this._map.on( "error", this._onMapError.bind( this ) );
- this._map.on( "data", this._onMapData.bind( this ) );
- }
- break;
- case "load":
- case "style.load":
- this._map.on( _eventName, _callback );
- break;
- default:
- this._map.on( _eventName, function( _event )
- {
- var items = [];
- if ( self._mapLoaded )
- items = self._queryRenderedFeatures( _event.point );
- _callback( {
- items: items, // List of data/id combo's
- _mapboxEvent: _event, // The mapbox event (TODO: Will this be necessary for anything?)
- originalEvent: _event.originalEvent // The DOM event, useful for checking "if ctrl was held down", etc.
- });
- } );
- break;
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.emit = function( _eventName, _data )
- {
- // check eventName
- switch ( _eventName )
- {
- case "mappingError":
- // invoke registered callbacks
- this._mappingErrorCallbacks.forEach( function( _callback )
- {
- _callback( _data );
- } );
- break;
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setMaxBounds = function( _lnglat )
- {
- // console.debug( "TiledMap::setMaxBounds" );
- return; // this._map.setMaxBounds(lnglat);
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setContainerRect = function( _rect )
- {
- // console.debug( "TiledMap::setContainerRect - [x: " + rect.x + ", y: " + rect.y + ", width: " + rect.width + ", height: " + rect.height + "]" );
- this._containerRect = _rect;
- // Update container dimensions
- if (this._map) {
- var self = this;
- this._mapContainer
- .style("left", this._containerRect.x + "px")
- .style("top", this._containerRect.y + "px")
- .style("width", this._containerRect.width + "px")
- .style("height", this._containerRect.height + "px");
- window.setTimeout( function() {
- self._map.resize();
- }, 10);
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setMaxZoom = function( _maxZoom )
- {
- // console.debug( "TiledMap::setMaxZoom" );
- this._maxZoom = _maxZoom;
- this._map.setMaxZoom( _maxZoom );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setMaxPointSize = function( _maxPointSize )
- {
- // console.debug( "TiledMap::setMaxZoom" );
- this._maxPointSize = _maxPointSize;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setMapLocale = function( _mapLocale )
- {
- // console.debug( "TiledMap::setMapLocale" );
- if ( _mapLocale )
- {
- var mapLocale = _mapLocale.toLowerCase();
- var pos = mapLocale.indexOf( "-" );
- if ( pos > -1 )
- mapLocale = mapLocale.substr( 0, pos );
- switch ( mapLocale )
- {
- case "es":
- case "fr":
- case "de":
- case "pt":
- case "ru":
- case "zh":
- this._mapLocale = mapLocale;
- break
- case "en":
- default:
- this._mapLocale = "en";
- break;
- }
- }
- else
- {
- this._mapLocale = "en";
- }
- // set country labels
- if ( this._mapLoaded )
- this._applyMapLocale();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._applyMapLocale = function()
- {
- if ( this._map.style.stylesheet )
- {
- var self = this;
- var localizedField = "{name_" + this._mapLocale + "}";
- var styleData = this._styleDataCache.get( this._mapboxStyle );
- // collect style data
- if ( !styleData )
- {
- styleData = { baseLayer: "", symbolLayers: [] };
- this._map.style.stylesheet.layers.forEach( function( _layer )
- {
- if ( _layer.type === "symbol" )
- {
- // for baseLayer, we need the first symbol layer of the last consecutive symbol layers block.
- if ( !styleData.baseLayer.length )
- styleData.baseLayer = _layer.id;
- styleData.symbolLayers.push( _layer.id );
- self._setLocalizedField( _layer, localizedField );
- }
- else
- {
- // reset baseLayer, we've encountered a, none symbol layer after we set the baseLayer.
- if ( styleData.baseLayer.length )
- styleData.baseLayer = "";
- }
- } );
- this._styleDataCache.set( this._mapboxStyle, styleData );
- }
- else
- {
- this._map.style.stylesheet.layers.forEach( function( _layer )
- {
- if ( _layer.type === "symbol" )
- self._setLocalizedField( _layer, localizedField );
- } );
- }
- }
- }
- /**
- * Localize a text field in a map layer
- * @param {Object} _layer A serialized MapBox layer
- * @param {String} _localizedField The localized field
- */
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setLocalizedField = function( _layer, _localizedField )
- {
- var textField = ( _layer.layout && _layer.layout[ "text-field" ] ) || null;
- // quit when textField doesn't exist
- if ( !textField )
- return;
- // patch textfield
- if ( ( typeof textField === "string" ) && reNameField.test( textField ) )
- {
- this._map.setLayoutProperty( _layer.id, "text-field", _localizedField );
- }
- else if ( ( typeof textField === "object" ) && textField.hasOwnProperty( "stops" ) )
- {
- var replacedStops = false;
- var patchedStops = textField.stops.map( function( _stop )
- {
- if ( reNameField.test( _stop[1] ) )
- {
- replacedStops = true;
- _stop[1] = _localizedField;
- }
- return _stop;
- } );
- if ( replacedStops )
- {
- textField.stops = patchedStops;
- this._map.setLayoutProperty( _layer.id, "text-field", textField );
- }
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.bindHandlers = function(context)
- {
- // console.debug( "TiledMap::bindHandlers" );
- var self = this;
- function eventName(name) {
- return name + ".mapboxRebind"
- }
- var mouseEvents = [
- "click",
- "contextmenu",
- "dblclick",
- "mousedown",
- "mousemove",
- "mouseout",
- "mouseup"
- ];
- var touchEvents = [
- "touchcancel",
- "touchend",
- "touchmove",
- "touchstart"
- ];
- var wheelEvents = [
- "mousewheel",
- "wheel"
- ];
- for (var e=0; e<mouseEvents.length; e++) {
- context.on(eventName(mouseEvents[e]), function() {
- var e = dispatchMouseEvent(rave.event.type);
- });
- }
- for (var e=0; e<touchEvents.length; e++) {
- context.on(eventName(touchEvents[e]), function() {
- dispatchTouchEvent(rave.event.type);
- });
- }
- for (var e=0; e<wheelEvents.length; e++) {
- context.on(eventName(wheelEvents[e]), function() {
- rave.event.preventDefault(); // Stop the window from scrolling.
- dispatchWheelEvent(rave.event.type);
- });
- }
- // TODO: Keyboard events don't originate from SVG elements (D3 samples usually listen for keyboard events on the document, separate from the SVG).
- // self._svgOwner.on(eventName("keydown"), function() {
- // dispatchKeyboardEvent(rave.event.type);
- // });
- function dispatchMouseEvent(name) {
- var e;
- if (typeof MouseEvent === "object") { // Internet Explorer just has to be a pain...
- e = document.createEvent("MouseEvent");
- e.initMouseEvent(name, false, false, null, 0, 0, 0, rave.event.clientX, rave.event.clientY, rave.event.ctrlKey, rave.event.altKey, rave.event.shiftKey, rave.event.metaKey, 0, null);
- } else {
- e = new MouseEvent(name, {
- // bubbles
- // cancellable
- // view (don't know what this is...)
- // button
- // buttons
- // relatedTarget
- // region (don't know what this is...)
- // screenX
- // screenY
- "clientX": rave.event.clientX,
- "clientY": rave.event.clientY,
- "ctrlKey": rave.event.ctrlKey,
- "shiftKey": rave.event.shiftKey,
- "altKey": rave.event.altKey,
- "metaKey": rave.event.metaKey
- });
- }
- self._map.getCanvasContainer().dispatchEvent(e);
- }
- function dispatchTouchEvent(name) {
- if (typeof MouseEvent !== "object") { // Only dispatch touch events if we're not running in IE.
- var e = new TouchEvent(name, {
- // bubbles
- // cancellable
- // view (don't know what this is...)
- // button
- // buttons
- // relatedTarget
- // region (don't know what this is...)
- // screenX
- // screenY
- "touches": rave.event.touches,
- "targetTouches": rave.event.targetTouches,
- "changedTouches": rave.event.changedTouches,
- "ctrlKey": rave.event.ctrlKey,
- "shiftKey": rave.event.shiftKey,
- "altKey": rave.event.altKey,
- "metaKey": rave.event.metaKey
- });
- self._map.getCanvasContainer().dispatchEvent(e);
- }
- }
- function dispatchWheelEvent(name) {
- var e;
- if (typeof MouseEvent === "object") { // Internet Explorer just has to be a pain...
- e = document.createEvent("WheelEvent");
- var modifiers = ""; // TODO: Apparently this is supposed to be a space separated string of modifier keys (alt, ctrl, etc). Lets just not implement this until someone asks for it, or better yet, fix the actions framework to handle mapbox interactivity.
- e.initWheelEvent(name, false, false, null, 0, 0, 0, rave.event.clientX, rave.event.clientY, 0, null, modifiers, rave.event.deltaX, rave.event.deltaY, rave.event.deltaZ, rave.event.deltaMode);
- } else {
- e = new WheelEvent(name, {
- // bubbles
- // cancellable
- // view (don't know what this is...)
- // button
- // buttons
- // relatedTarget
- // region (don't know what this is...)
- // screenX
- // screenY
- "clientX": rave.event.clientX,
- "clientY": rave.event.clientY,
- "deltaX": rave.event.deltaX,
- "deltaY": rave.event.deltaY,
- "deltaZ": rave.event.deltaZ,
- "deltaMode": rave.event.deltaMode,
- "ctrlKey": rave.event.ctrlKey,
- "shiftKey": rave.event.shiftKey,
- "altKey": rave.event.altKey,
- "metaKey": rave.event.metaKey
- });
- }
- self._map.getCanvasContainer().dispatchEvent(e);
- }
- // function dispatchKeyboardEvent(name) {
- // var e = new KeyboardEvent(name, {
- // // bubbles
- // // cancellable
- // // view (don't know what this is...)
- // // button
- // // buttons
- // // relatedTarget
- // // region (don't know what this is...)
- // // screenX
- // // screenY
- // "key": rave.event.key,
- // "code": rave.event.code,
- // "location": rave.event.location,
- // "repeat": rave.event.repeat,
- // "isComposing": rave.event.isComposing,
- // "charCode": rave.event.charCode,
- // "keyCode": rave.event.keyCode,
- // "which": rave.event.which,
- // "ctrlKey": rave.event.ctrlKey,
- // "shiftKey": rave.event.shiftKey,
- // "altKey": rave.event.altKey,
- // "metaKey": rave.event.metaKey
- // });
- // self._map.getCanvasContainer().dispatchEvent(e);
- // return e;
- // }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._mapFeaturesToData = function( _dataDirty )
- {
- // console.debug( "TiledMap::_mapFeaturesToData" );
- var self = this;
- var lastData = null;
- // Skip mapping if layers are missing.
- if ( !( this._dataLayers && this._dataLayers.length ) )
- return;
- // refresh mapCache
- this._mapCache.refreshCache( this._dataLayers );
- // reset maps
- if ( _dataDirty || ( this._mapCacheVersion !== this._mapCache.version ) )
- {
- this._featureDataMap.clear();
- this._mapCacheVersion = this._mapCache.version;
- }
- // Skip mapping when the data doesn't contain geoData and there's no map data available
- if ( !this._hasGeoDataLayer() && !this._mapCache.size() )
- return;
- var rebuild = ( this._featureDataMap.size() === 0 );
- this._dataLayers.forEach( function( _dataLayer )
- {
- // check if layer has data && featureAccessors
- if ( _dataLayer.data && _dataLayer.data.length && ( _dataLayer.featureAccessors.length > 0 ) )
- {
- var curLayerHasGeoData = self._dataLayerHasGeoData( _dataLayer );
- // do we need to rebuild
- if ( rebuild )
- {
- // check if layer has geo data
- if ( curLayerHasGeoData )
- {
- // loop data
- _dataLayer.data.forEach( function( _data )
- {
- self._featureDataMap.add( _dataLayer, _data );
- } );
- }
- else
- {
- // loop data
- _dataLayer.data.forEach( function( _data )
- {
- // only holds 1 (top) item per key
- var featureKey = self._getFeatureKeyFromAssignedSlots( _dataLayer, _data );
- var feature = self._mapCache.get( featureKey );
- if ( feature )
- {
- if ( self._featureDataMap.hasFeature( featureKey ) )
- self._featureDataMap.update( _dataLayer, _data, featureKey, feature );
- else
- self._featureDataMap.add( _dataLayer, _data, featureKey, feature );
- }
- } );
- }
- }
- else
- {
- // update data layer properties
- self._featureDataMap.updateDataLayerProperties( _dataLayer );
- }
- }
- } );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setDataLayers = function( _dataLayers, _dataDirty, _combinedLayers )
- {
- // console.debug( "TiledMap::setDataLayers" );
- if ( _dataDirty )
- {
- this._mapboxDataDirty = _dataDirty;
- this._clearMapsCache();
- }
- this._featureDataMap.setCombinedLayers( _combinedLayers );
- this._dataLayers = _dataLayers;
- this._mapFeaturesToData( _dataDirty );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._sortBySize = function( _renderedFeatures )
- {
- var self = this;
- var featureA, featureB;
- if ( _renderedFeatures && _renderedFeatures.length > 1 )
- {
- _renderedFeatures.sort( function( a, b ) {
- featureA = self._featureDataMap.getById( a.id );
- featureB = self._featureDataMap.getById( b.id );
- if ( featureB && featureB.hasOwnProperty( "pointSize" ) && featureA
- && featureA.hasOwnProperty( "pointSize" ) )
- {
- return featureA.pointSize - featureB.pointSize;
- }
- else
- {
- return 0;
- }
- });
- }
- return _renderedFeatures;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.getItemsAtPoint = function( _point )
- {
- return this._queryRenderedFeatures( [ _point.x, _point.y ] );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.getItemsInRect = function( _points )
- {
- return this._queryRenderedFeatures( [ [ _points[0].x, _points[0].y ], [ _points[1].x, _points[1].y ] ] );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.getBoundingBox = function( _points )
- {
- var bounds = this._map.getBounds();
- // translating bounds to points [ [ West, South ], [ East, North ] ]
- return [ [ bounds._sw.lng, bounds._sw.lat ], [ bounds._ne.lng, bounds._ne.lat ] ];
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setBoundingBox = function( _points )
- {
- // translating points [ [ West, South ], [ East, North ] ] to bounds [ [ South, West ], [ North, East ] ]
- if ( _points && ( _points.length === 2 ) )
- {
- var bbox = [ { lng: _points[0][0], lat: _points[0][1] }, { lng: _points[1][0], lat: _points[1][1] } ]
- if ( this._mapLoaded )
- this._fitBounds( bbox );
- else
- this._mapBBox = bbox;
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setAutoZoom = function( _autoZoom )
- {
- this._autoZoom = _autoZoom;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.dispose = function()
- {
- if ( this._map )
- {
- this._map.remove();
- }
- }
-
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._queryRenderedFeatures = function( _geometry )
- {
- var self = this;
- var layersToQuery = [];
- var items = [];
- // collect query layers
- this._featureDataMap.getTileSets().forEach( function( _tileSet )
- {
- layersToQuery.push( _tileSet[ _tileSet.layer ] );
- } );
- // if we have layers, query mapbox
- if ( layersToQuery.length )
- {
- var features = _geometry ? this._map.queryRenderedFeatures( _geometry, { layers: layersToQuery } ) : [];
- var duplicates = rave.set();
- if ( features && features.length )
- {
- features.forEach( function( _feature )
- {
- var layerId = _feature.layer.id;
- var sourceId = _feature.layer.source;
- var featureData = null;
- // lookup feature data
- featureData = self._featureDataMap.getItem( sourceId, layerId, _feature.properties );
- // check if there's data for the feature's layer
- if ( featureData && featureData.data[ layerId ] )
- {
- items.push( {
- id: featureData.id,
- dataSet: featureData.dataSet[ layerId ],
- datum: featureData.data[ layerId ]
- } );
- }
- } );
- }
- }
- // return the items or null
- return this._sortBySize( items );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getFeatureKeyFromAssignedSlots = function( _dataLayer, _data )
- {
- if ( this._dataLayerHasGeoData( _dataLayer ) )
- {
- return this._getGeoFeatureKey( _dataLayer.getType(), this._getGeoData( _dataLayer, _data ) );
- }
- else
- {
- var keyParts = [];
- // loop FeatureAccessors
- _dataLayer.featureAccessors.forEach( function( _accessor )
- {
- if ( _accessor )
- {
- var value = _accessor( _data );
- if ( value )
- keyParts.push( _accessor( _data ) );
- }
- } );
- return this._mapCache.getKey( _dataLayer.getType(), keyParts );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getGeoData = function( _dataLayer, _data )
- {
- return _dataLayer.featureAccessors[ 0 ]( _data );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getGeoFeatureKey = function( _type, _geoData )
- {
- var keyParts = [ _type ];
- // The first featureAccessor holds the geoObject
- Object.keys( _geoData ).forEach( function ( _key )
- {
- var value = _geoData[ _key ];
- if ( value !== null )
- keyParts.push( value );
- } );
- return keyParts.join( "|" );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getDataLayer = function( _type )
- {
- var dataLayer = null;
- this._dataLayers.some( function( _dataLayer )
- {
- if ( _dataLayer.getType() === _type )
- {
- dataLayer = _dataLayer;
- return true;
- }
- return false;
- } );
- return dataLayer;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._addResource = function( _resource )
- {
- var resources = this._addedResources.get( _resource.type );
- if ( !resources )
- {
- resources = [];
- this._addedResources.set( _resource.type, resources );
- }
- resources.push( _resource );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._removeResource = function( _id, _type )
- {
- var resources = this._addedResources.get( _type );
- var resource;
- var idx;
- if ( resources )
- {
- // remove layers as well, when type was source
- if ( _type === "source" )
- {
- var layerResources = this._addedResources.get( "layer" );
- if ( layerResources )
- {
- for ( idx = layerResources.length - 1; idx >= 0; --idx )
- {
- resource = layerResources[ idx ];
- if ( resource.source === _id )
- {
- this._map.removeLayer( resource.id );
- layerResources.splice( idx, 1 );
- }
- }
- // remove type when this was the past one
- if ( layerResources.length === 0 )
- this._addedResources.remove( "layer" );
- }
- }
- // remove resource
- for ( idx = resources.length - 1; idx >= 0; --idx )
- {
- resource = resources[ idx ];
- if ( resource.id === _id )
- {
- if ( resource.type === "source" )
- this._map.removeSource( resource.id )
- else
- this._map.removeLayer( resource.id );
- resources.splice( idx, 1 );
- break;
- }
- }
- // remove type when this was the past one
- if ( resources.length === 0 )
- this._addedResources.remove( _type );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._clearAddedResources = function()
- {
- var self = this;
- if ( this._addedResources.has( "layer" ) )
- this._addedResources.get( "layer" ).forEach( function( _resouce ) { self._map.removeLayer( _resouce.id ); } );
- if ( this._addedResources.has( "source" ) )
- this._addedResources.get( "source" ).forEach( function( _resouce ) { self._map.removeSource( _resouce.id ) } );
- this._addedResources = rave.map();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._fitBounds = function( _bounds )
- {
- // ease in to fit the bounds
- try
- {
- var options = {
- linear: true,
- padding: this._maxPointSize + /*circle border*/2 + /*padding*/5,
- easing: easing
- };
- // limit zoom when bounds consist of 1 point [0,0]
- if ( ( _bounds[0][0] === 0 ) && ( _bounds[0][1] === 0 ) && ( _bounds[1][0] === 0 ) && ( _bounds[1][1] === 0 ) )
- options.maxZoom = 4;
- this._map.fitBounds( _bounds, options );
- }
- catch ( _err )
- {
- console.log( _err )
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._hasGeoDataLayer = function()
- {
- // check if there's a layer containing geodata
- var self = this;
- return this._dataLayers.some( function( _dataLayer )
- {
- return self._dataLayerHasGeoData( _dataLayer );
- } );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._dataLayerHasGeoData = function( _dataLayer )
- {
- // check if the data layer contains geodata
- return _dataLayer.typeData.values().some( function( _typeData )
- {
- return _typeData.hasGeoData;
- } );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._endsWith = function( _source, _part )
- {
- return _source.indexOf( _part ) === ( _source.length - _part.length );
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._onMapError = function( _event )
- {
- // check if it's an error
- if ( _event.type === "error" )
- {
- // check for invalid mapId's
- var skipLog = false;
- if ( _event.status && _event.sourceId && ( _event.status === 404 ) )
- {
- skipLog = true;
- if ( !this._endsWith( _event.sourceId, "Action" ) )
- {
- this.emit( "mappingError", this._getErrorDetails( _event.sourceId, null, null, null ) );
- // remove resources
- this._removeResource( _event.sourceId, "source" )
- this._removeResource( _event.sourceId + "Action", "source" )
- }
- }
- else if ( _event.error )
- {
- var match = reLayerError.exec( _event.error );
- if ( match )
- {
- // only notify <layerName>, skip <layerName>Select, <layerName>Focus and <layerName>Hover
- if ( ( ( "region-" + match[1] ) === match[3] ) || ( ( "point-" + match[1] ) === match[3] ) )
- {
- this.emit( "mappingError", this._getErrorDetails( match[2], match[1], null, null ) );
- this._removeResource( match[3], "layer" )
- skipLog = true;
- }
- else if ( this._endsWith( match[3], "Select" ) || this._endsWith( match[3], "Focus" ) || this._endsWith( match[3], "Hover" ) )
- {
- this._removeResource( match[3], "layer" )
- skipLog = true;
- }
- }
- // ignore tile errors, they are common errors just indicating a specific tile is not available
- // this is considered regular mapbox behavior, and can occur during scroll-zoom, fly/easeTo or
- // when selecting features on different 'admin-levels' making some too small to show,
- // eg. return a specific tile
- else if ( _event.tile && ( _event.tile.state === "errored" ) )
- {
- skipLog = true;
- }
- }
- // Mimic MapBox, and log error to console if it's not handled through the proper channels
- if ( !skipLog )
- console.error( ( _event && _event.error ) || _event || "Empty error event" );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._onMapData = function( _event )
- {
- var updateMap = false;
- // only check for our own sources
- if ( ( _event.dataType === "source" ) && ( _event.sourceId !== "mapbox" ) && ( _event.sourceDataType === "metadata" ) )
- {
- // loop tilesets and check if the specified property is available
- this._featureDataMap.getTileSets( { id: _event.sourceId } ).forEach( function( _tileSet )
- {
- if ( _tileSet.customPolygon )
- {
- var source = this._map.getSource( _event.sourceId );
- // type = "vector"
- if ( source && source.vectorLayers )
- {
- var layer;
- for ( var idx = 0, size = source.vectorLayers.length; idx < size; ++idx )
- {
- layer = source.vectorLayers[ idx ];
- if ( ( _tileSet.type + "-" + layer.id ) === _tileSet[ _tileSet.layer ] )
- break;
- layer = null;
- };
- if ( layer )
- {
- var fieldType = layer.fields[ _tileSet.property ];
- if ( fieldType )
- {
- fieldType = fieldType.toLowerCase();
- // validate numbers
- if ( fieldType === "number" )
- {
- if ( this._validateNumeric( _tileSet ) )
- {
- _tileSet.propertyType = fieldType;
- updateMap = true;
- }
- else
- {
- this.emit( "mappingError", this._getErrorDetails( _event.sourceId, layer.id, _tileSet.property, fieldType, _tileSet ) );
- }
- }
- else
- {
- this._ensureString( _tileSet )
- _tileSet.propertyType = fieldType;
- updateMap = true;
- }
- }
- else
- {
- this.emit( "mappingError", this._getErrorDetails( _event.sourceId, layer.id, _tileSet.property, null, _tileSet ) );
- }
- }
- }
- }
- }, this );
- }
- // update the map if we found a valid layer info
- if ( updateMap )
- this._setupLayerStops();
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._validateNumeric = function( _tileSet )
- {
- // validate if the item's property value can be converted to the specified type
- var featureDataItems = this._featureDataMap.filter( { tileSet: _tileSet.id, type: _tileSet.type, property: _tileSet.property } );
- for ( var idx = 0, size = featureDataItems.length; idx < size; ++idx )
- {
- var featureData = featureDataItems[ idx ];
- var propVal = featureData[ _tileSet.property ];
- if ( isNaN( propVal ) )
- return false;
- featureData[ _tileSet.property ] = +propVal;
- }
- return true;
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._ensureString = function( _tileSet )
- {
- // validate if the item's property value can be converted to the specified type
- var featureDataItems = this._featureDataMap.filter( { tileSet: _tileSet.id, type: _tileSet.type, property: _tileSet.property } );
- for ( var idx = 0, size = featureDataItems.length; idx < size; ++idx )
- {
- var featureData = featureDataItems[ idx ];
- var propVal = featureData[ _tileSet.property ];
- if ( propVal )
- featureData[ _tileSet.property ] = String( propVal );
- }
- }
- com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getErrorDetails = function( _sourceId, _layerName, _propertyName, _propertyType, _tileSet )
- {
- var errorDetails = {
- error: null,
- dataSet: null,
- property: null
- }
- // find the tileSet
- var filter = { customPolygon: true };
- if ( _sourceId )
- filter.id = _sourceId;
- var tileSets = _tileSet ? [ _tileSet ] : this._featureDataMap.getTileSets( filter );
- tileSets.forEach( function( _tileSet )
- {
- // bail out on incorrect layerName
- if ( _layerName && ( _tileSet.sourceLayer !== _layerName ) )
- return;
- if ( _tileSet.type === "region" )
- {
- errorDetails.dataSet = "data.region";
- if ( _propertyType )
- {
- errorDetails.error = this._nls( "customPolygonPropertyConversionFailure" );
- errorDetails.property = "region.custom.propertyName";
- }
- else if ( _propertyName )
- {
- errorDetails.error = this._nls( "invalidPropertyName" ) + _propertyName;
- errorDetails.property = "region.custom.propertyName";
- }
- else if ( _layerName )
- {
- errorDetails.error = this._nls( "invalidLayerName" ) + _layerName;
- errorDetails.property = "region.custom.layerName";
- }
- else
- {
- errorDetails.error = this._nls( "invalidMapId" ) + _sourceId;
- errorDetails.property = "region.custom.mapId";
- }
- }
- else
- {
- errorDetails.dataSet = "data.point";
- if ( _propertyType )
- {
- errorDetails.error = this._nls( "customPolygonPropertyConversionFailure" );
- errorDetails.property = "point.custom.propertyName";
- }
- else if ( _propertyName )
- {
- errorDetails.error = this._nls( "invalidPropertyName" ) + _propertyName;
- errorDetails.property = "point.custom.propertyName";
- }
- else if ( _layerName )
- {
- errorDetails.error = this._nls( "invalidLayerName" ) + _layerName;
- errorDetails.property = "point.custom.layerName";
- }
- else
- {
- errorDetails.error = this._nls( "invalidMapId" ) + _sourceId;
- errorDetails.property = "point.custom.mapId";
- }
- }
- }, this );
- return errorDetails;
- }
- return com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl;
- }());
- })();
- },{"./configuration/configuration.json":1,"./i18n/messages_en.json":2,"./mapbox-gl.css":3,"./vizlibrary-tiledmap.css":5,"./vizlibrary.css":6}],5:[function(require,module,exports){
- var css = ".vizlibrary-tiledmap .element-shape {\n stroke: white;\n stroke-width: 1;\n stroke-linejoin: round;\n fill-opacity: 1.0;\n}\n.vizlibrary-tiledmap .bubble {\n fill-opacity: 0.5;\n stroke: white;\n stroke-width: 1;\n pointer-events: none;\n}\n.vizlibrary-tiledmap .dark-label {\n fill: black;\n text-shadow: 1px 1px white;\n}\n.vizlibrary-tiledmap .light-label {\n fill: white;\n text-shadow: 1px 1px black;\n}\n.vizlibrary-tiledmap .label {\n font-size: 10pt;\n font-family: roboto, serif;\n pointer-events: none;\n}\n.vizlibrary-tiledmap path.flash {\n stroke: orange;\n}\n.vizlibrary-tiledmap .bubble.flash {\n stroke: orange;\n}\n.vizlibrary-tiledmap .mapboxgl-canvas-container .mapboxgl-canvas {\n left: 0px;\n top: 0px;\n}\n.vizlibrary-tiledmap.tiledmap-container .mapboxgl-ctrl-top-left,\n.vizlibrary-tiledmap.tiledmap-container .mapboxgl-ctrl-top-right,\n.vizlibrary-tiledmap.tiledmap-container .mapboxgl-ctrl-bottom-left,\n.vizlibrary-tiledmap.tiledmap-container .mapboxgl-ctrl-bottom-right {\n z-index: 0;\n}\n.vizlibrary-tiledmap .mapboxgl-ctrl-compass {\n display: none;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-tiledmapV2/node/rave-library-tiledmapV2/vizlibrary-tiledmap.css"})); module.exports = css;
- },{"browserify-css":7}],6:[function(require,module,exports){
- var css = ".vizlibrary {\n font-family: Arial, Tahoma, 'Arial Unicode MS', 'Andale WT', 'MS UI Gothic', Gulim, SimSun, PMingLiU, Raghu8, sans-serif;\n font-style: normal;\n}\n/*\n * Chart background rectangle, transparent\n */\n.vizlibrary rect.background.elements {\n fill-opacity: 0.0;\n}\n/*\n * Axes.\n */\n.vizlibrary .axis .tick text {\n font-weight: 300;\n font-size: 14px;\n fill: #3c4646;\n}\n.vizlibrary .axis .tick line {\n fill: none;\n stroke: #eee;\n}\n.vizlibrary .axis path {\n fill: none;\n stroke: #eee;\n}\n/*Axis title\n*/\n.vizlibrary .axis .axislabel {\n font-weight: 500;\n font-size: 14px;\n fill: #323c3c;\n}\n/*\n * Axis callout.\n */\n.vizlibrary .axis-callout {\n pointer-events: none;\n /* Prevent the callout lines from intercepting mouseover events on the element shapes */\n}\n.vizlibrary .callout line {\n stroke: #3c4646;\n stroke-dasharray: 5,5;\n}\n.vizlibrary .callout .label path {\n fill: #3c4646;\n stroke-width: 0px;\n}\n.vizlibrary .callout .label text {\n font-weight: 300;\n font-size: 14px;\n fill: white;\n}\n/*Grid lines*/\n.vizlibrary g.grid g.tick {\n stroke: #dfe9e9;\n stroke-width: 1px;\n}\n/*Legend title*/\n.vizlibrary .legendTitle {\n font-weight: 500;\n font-size: 18px;\n fill: #323c3c;\n}\n/*Legend label*/\n.vizlibrary .legendLabel {\n font-weight: 300;\n font-size: 14px;\n fill: #3c4646;\n}\n.vizlibrary .legendBBox {\n pointer-events: none;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-tiledmapV2/node/rave-library-tiledmapV2/vizlibrary.css"})); module.exports = css;
- },{"browserify-css":7}],7:[function(require,module,exports){
- 'use strict';
- // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
- module.exports = {
- // Create a <link> tag with optional data attributes
- createLink: function(href, attributes) {
- var head = document.head || document.getElementsByTagName('head')[0];
- var link = document.createElement('link');
- link.href = href;
- link.rel = 'stylesheet';
- for (var key in attributes) {
- if ( ! attributes.hasOwnProperty(key)) {
- continue;
- }
- var value = attributes[key];
- link.setAttribute('data-' + key, value);
- }
- head.appendChild(link);
- },
- // Create a <style> tag with optional data attributes
- createStyle: function(cssText, attributes) {
- var head = document.head || document.getElementsByTagName('head')[0],
- style = document.createElement('style');
- style.type = 'text/css';
- for (var key in attributes) {
- if ( ! attributes.hasOwnProperty(key)) {
- continue;
- }
- var value = attributes[key];
- style.setAttribute('data-' + key, value);
- }
-
- if (style.sheet) { // for jsdom and IE9+
- style.innerHTML = cssText;
- style.sheet.cssText = cssText;
- head.appendChild(style);
- } else if (style.styleSheet) { // for IE8 and below
- head.appendChild(style);
- style.styleSheet.cssText = cssText;
- } else { // for Chrome, Firefox, and Safari
- style.appendChild(document.createTextNode(cssText));
- head.appendChild(style);
- }
- }
- };
- },{}]},{},[4]);
- return rave.library.bundle.extension('tiledmapV2Bundle');
- }));
|