rave-library-bubble.js 420 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932
  1. ;(function(root, factory) {
  2. if (typeof define === 'function' && define.amd) {
  3. define(['rave', 'rave-library', 'rave-utilities', 'rave-layouts', 'rave-legends'], factory);
  4. } else if (typeof exports === 'object') {
  5. module.exports = factory(require('rave'), require('rave-library'), require('rave-utilities'), require('rave-layouts'), require('rave-legends'));
  6. } else {
  7. root.raveLibraryBubble = factory(root.rave, root.raveLibrary, root.raveUtilities, root.raveLayouts, root.raveLegends);
  8. }
  9. }(this, function(rave, raveLibrary, raveUtilities, raveLayouts, raveLegends) {
  10. (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){
  11. module.exports=[{"datamodels":[{"description":"datamodel.tabular.bubble.description","id":"tabular","label":"datamodel.tabular.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/label_32.png","svg":"..\/rave-library\/resources\/label_32.svg"},"description":"dataslot.label.bubble.description","id":"label","label":"dataslot.category.label","cardinality":"0..1","datatypes":["string"]},{"icon":{"image":"..\/rave-library\/resources\/size_32.png","svg":"..\/rave-library\/resources\/size_32.svg"},"description":"dataslot.tabular.size.description","id":"size","label":"dataslot.tabular.size.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/color_by_32.png","svg":"..\/rave-library\/resources\/color_by_32.svg"},"description":"dataslot.color.description","id":"color","label":"dataslot.color.label","cardinality":"0..1","datatypes":["numeric","string"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/x_axis_32.png","svg":"..\/rave-library\/resources\/x_axis_32.svg"},"description":"dataslot.x.bubble.description","id":"x","label":"dataslot.x.label","cardinality":"0..1","datatypes":["numeric","string","date"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/y_axis_32.png","svg":"..\/rave-library\/resources\/y_axis_32.svg"},"description":"dataslot.y.bubble.description","id":"y","label":"dataslot.y.label","cardinality":"0..1","datatypes":["numeric","string","date"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.key.description","id":"key","label":"dataslot.key.label","cardinality":"0..1","datatypes":["numeric","string","date"]}],"description":"dataset.tabular.description","id":"data","label":"dataset.tabular.label","type":"tabular","cardinality":"1","tags":["bubble","scatterplot","tabular"]}],"tags":["bubble","tabular","scatterplot"]},{"description":"datamodel.hierarchial.bubble.description","id":"hierarchical","label":"datamodel.hierarchial.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/children_32.png","svg":"..\/rave-library\/resources\/children_32.svg"},"description":"dataslot.children.description","id":"children","label":"dataslot.children.label","cardinality":"1","datatypes":["array","object"]},{"icon":{"image":"..\/rave-library\/resources\/size_32.png","svg":"..\/rave-library\/resources\/size_32.svg"},"description":"dataslot.tabular.size.description","id":"size","label":"dataslot.tabular.size.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/color_by_32.png","svg":"..\/rave-library\/resources\/color_by_32.svg"},"description":"dataslot.color.description","id":"color","label":"dataslot.color.label","cardinality":"0..1","datatypes":["numeric","string"]},{"icon":{"image":"..\/rave-library\/resources\/label_32.png","svg":"..\/rave-library\/resources\/label_32.svg"},"description":"dataslot.label.description","id":"label","label":"dataslot.label.label","cardinality":"0..1","datatypes":["string"]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.key.description","id":"key","label":"dataslot.key.label","cardinality":"0..1","datatypes":["numeric","string","date"]}],"description":"dataset.hierarchial.bubble.description","id":"data","label":"dataset.hierarchial.label","type":"hierarchy","cardinality":"1"}],"tags":["bubble","packed","hierarchical"]}]},{"properties":{"symbol":{"type":"object","properties":{"borderColor":{"default":"#cccccc","name":"symbol.borderColor.name","description":"symbol.borderColor.description","type":"color"},"borderWidth":{"default":"0px","name":"symbol.borderWidth.name","description":"symbol.borderWidth.description","type":"length"}}},"sizeScale":{"type":"object","properties":{"first":{"default":64,"min":0.0,"resetView":"layout","name":"sizescale.first.name","description":"sizescale.first.description","type":"numeric"},"second":{"default":900,"min":0.0,"resetView":"layout","name":"sizescale.second.name","description":"sizescale.second.description","type":"numeric"}}},"label.shadow":{"default":false,"resetView":"layout","name":"label.shadow.name","description":"label.shadow.description","type":"boolean"},"symbolShape":{"default":"circle","resetView":"layout","name":"symbolShape.name","options":[{"id":"symbolShape.options.circle","value":"circle"},{"id":"symbolShape.options.cross","value":"cross"},{"id":"symbolShape.options.diamond","value":"diamond"},{"id":"symbolShape.options.square","value":"square"},{"id":"symbolShape.options.triangle-down","value":"triangle-down"},{"id":"symbolShape.options.triangle-up","value":"triangle-up"},{"id":"symbolShape.options.horizontal-rectangle","value":"horizontal-rectangle"},{"id":"symbolShape.options.vertical-rectangle","value":"vertical-rectangle"},{"id":"symbolShape.options.triangle-left","value":"triangle-left"},{"id":"symbolShape.options.triangle-right","value":"triangle-right"},{"id":"symbolShape.options.star","value":"star"},{"id":"symbolShape.options.donut","value":"donut"},{"id":"symbolShape.options.donut-plus","value":"donutPlus"}],"description":"symbolShape.description","type":"string"},"itemColor":{"default":"1","name":"itemColor.name","options":[{"id":"itemColor.options.level1","value":"1"},{"id":"itemColor.options.level2","value":"2"},{"id":"itemColor.options.level3","value":"3"},{"id":"itemColor.options.level4","value":"4"},{"id":"itemColor.options.level5","value":"5"},{"id":"itemColor.options.level6","value":"6"}],"description":"itemColor.description","type":"string"},"shadow":{"type":"object","properties":{"display":{"default":false,"name":"shadow.display.name","description":"shadow.display.description","type":"boolean"},"style":{"default":"1px 1px 1px black","name":"shadow.style.name","description":"shadow.style.description","type":"shadow"}}},"color":{"type":"object","properties":{"null":{"default":"silver","name":"color.null.name","description":"color.null.description","type":"color"},"palette":{"name":"color.palette.name","options":["categorical","continuous"],"description":"color.palette.description","type":"palette"}}},"zoom":{"default":"all","resetView":"zoom","name":"zoom.name","options":[{"id":"zoom.options.both","value":"all"},{"id":"zoom.options.x","value":"x"},{"id":"zoom.options.y","value":"y"},{"id":"zoom.options.none","value":"none"}],"description":"zoom.description","type":"string"},"itemLabel":{"type":"object","properties":{"overlap":{"trueLabel":"bubble.trueLabel.overlap","default":true,"falseLabel":"bubble.falseLabel.overlap","name":"itemLabel.overlap.name","description":"itemLabel.overlap.description","type":"boolean"},"display":{"trueLabel":"bubble.trueLabel.itemLabel","default":true,"falseLabel":"bubble.falseLabel.itemLabel","name":"itemLabel.display.name","description":"itemLabel.display.description","type":"boolean"}}},"pack":{"default":"packlayout","resetView":"layout","name":"pack.name","options":[{"id":"pack.options.packlayout","value":"PackLayout"},{"id":"pack.options.bubblelayout","value":"BubbleLayout"}],"description":"pack.description","type":"string"},"labelstyle":{"type":"object","properties":{"font":{"default":null,"name":"labelstyle.font.name","description":"labelstyle.font.description","type":"font"}}},"effect":{"type":"object","properties":{"duration":{"default":1000,"min":0,"name":"effect.duration.name","description":"effect.duration.description","type":"numeric"},"name":{"default":"grow","name":"effect.name.name","options":[{"id":"effect.name.options.grow","value":"grow"},{"id":"effect.name.options.fromBase","value":"fromBase"},{"id":"effect.name.options.growfromBase","value":"growfromBase"},{"id":"effect.name.options.transition","value":"transition"},{"id":"effect.name.options.none","value":"none"}],"description":"effect.name.description","type":"string"}}},"contrast":{"type":"object","properties":{"label":{"type":"object","properties":{"color":{"default":false,"resetView":"layout","name":"contrast.label.color.name","description":"contrast.label.color.description","type":"boolean"}}}}},"packedBubbleNegativeValueDisplay":{"trueLabel":"bubble.trueLabel.negativeValueDisplay","default":false,"falseLabel":"bubble.falseLabel.negativeValueDisplay","name":"packedBubbleNegativeValueDisplay.name","description":"packedBubbleNegativeValueDisplay.description","type":"boolean"}}},{"properties":{"axis":{"type":"object","properties":{"labels":{"type":"object","properties":{"truncationText":{"default":"...","name":"axis.labels.truncationText.name","description":"axis.labels.truncationText.description","type":"string"}}}}}}},{"properties":{"layout":{"type":"object","properties":{"axissize":{"type":"object","properties":{"left":{"type":"object","properties":{"min":{"default":"65","resetView":"layout","name":"layout.axissize.left.min.name","description":"layout.axissize.left.min.description","type":"length"},"max":{"default":"65","resetView":"layout","name":"layout.axissize.left.max.name","description":"layout.axissize.left.max.description","type":"length"},"preferred":{"default":"65","resetView":"layout","name":"layout.axissize.left.preferred.name","description":"layout.axissize.left.preferred.description","type":"length"}}}}}}}}},{"properties":{"layout":{"type":"object","properties":{"axissize":{"type":"object","properties":{"bottom":{"type":"object","properties":{"min":{"default":"55","resetView":"layout","name":"layout.axissize.bottom.min.name","description":"layout.axissize.bottom.min.description","type":"length"},"max":{"default":"55","resetView":"layout","name":"layout.axissize.bottom.max.name","description":"layout.axissize.bottom.max.description","type":"length"},"preferred":{"default":"55","resetView":"layout","name":"layout.axissize.bottom.preferred.name","description":"layout.axissize.bottom.preferred.description","type":"length"}}}}}}}}},{"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"}}}}}}}}},{"properties":{"background":{"type":"object","properties":{"elements":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.elements.color.name","description":"background.elements.color.description","type":"color"}}},"chart":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.chart.color.name","description":"background.chart.color.description","type":"color"}}}}}}},{"properties":{"transpose":{"trueLabel":"transpose.trueLabel","default":false,"falseLabel":"transpose.falseLabel","resetView":"layout","name":"transpose.name","description":"transpose.description","type":"boolean"}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.x.ticks.display.trueLabel","default":false,"falseLabel":"axis.x.ticks.display.falseLabel","name":"axis.x.ticks.display.name","description":"axis.x.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.ticks.style.stroke.name","description":"axis.x.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.x.line.display.trueLabel","default":false,"falseLabel":"axis.x.line.display.falseLabel","name":"axis.x.line.display.name","description":"axis.x.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.line.style.stroke.name","description":"axis.x.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.x.labels.display.trueLabel","default":true,"falseLabel":"axis.x.labels.display.falseLabel","resetView":"layout","name":"axis.x.labels.display.name","description":"axis.x.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.labels.style.font-size.name","description":"axis.x.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.labels.style.font-family.name","description":"axis.x.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.x.labels.style.fill.name","description":"axis.x.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.labels.style.font.name","description":"axis.x.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.x.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.x.labels.zoomPan.falseLabel","name":"axis.x.labels.zoomPan.name","description":"axis.x.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.x.title.display.trueLabel","default":true,"falseLabel":"axis.x.title.display.falseLabel","resetView":"layout","name":"axis.x.title.display.name","description":"axis.x.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.title.style.font-size.name","description":"axis.x.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.title.style.font-family.name","description":"axis.x.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.x.title.style.fill.name","description":"axis.x.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.title.style.font.name","description":"axis.x.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.x.title.text.name","description":"axis.x.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.x.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.x.scale.includeZero.falseLabel","resetView":"layout","name":"axis.x.scale.includeZero.name","description":"axis.x.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.x.scale.nice.trueLabel","default":false,"falseLabel":"axis.x.scale.nice.falseLabel","resetView":"layout","name":"axis.x.scale.nice.name","description":"axis.x.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"labels":{"type":"object","properties":{"allowRotate90":{"trueLabel":"axis.x.labels.allowRotate90.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate90.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate90.name","description":"axis.x.labels.allowRotate90.description","type":"boolean"},"layoutMode":{"default":"automatic","resetView":"layout","name":"axis.x.labels.layoutMode.name","options":[{"id":"axis.x.labels.layoutMode.options.automatic","value":"automatic"},{"id":"axis.x.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.x.labels.layoutMode.options.stagger","value":"stagger"},{"id":"axis.x.labels.layoutMode.options.rotate45","value":"rotate45"},{"id":"axis.x.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.x.labels.layoutMode.description","type":"string"},"allowRotate45":{"trueLabel":"axis.x.labels.allowRotate45.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate45.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate45.name","description":"axis.x.labels.allowRotate45.description","type":"boolean"},"allowStagger":{"trueLabel":"axis.x.labels.allowStagger.trueLabel","default":true,"falseLabel":"axis.x.labels.allowStagger.falseLabel","resetView":"layout","name":"axis.x.labels.allowStagger.name","description":"axis.x.labels.allowStagger.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.x.gridlines.display.trueLabel","default":false,"falseLabel":"axis.x.gridlines.display.falseLabel","name":"axis.x.gridlines.display.name","description":"axis.x.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.x.gridlines.style.stroke-dasharray.name","description":"axis.x.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.x.gridlines.style.stroke.name","description":"axis.x.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.y.ticks.display.trueLabel","default":false,"falseLabel":"axis.y.ticks.display.falseLabel","name":"axis.y.ticks.display.name","description":"axis.y.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.ticks.style.stroke.name","description":"axis.y.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.y.line.display.trueLabel","default":false,"falseLabel":"axis.y.line.display.falseLabel","name":"axis.y.line.display.name","description":"axis.y.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.line.style.stroke.name","description":"axis.y.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.y.labels.display.trueLabel","default":true,"falseLabel":"axis.y.labels.display.falseLabel","resetView":"layout","name":"axis.y.labels.display.name","description":"axis.y.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.labels.style.font-size.name","description":"axis.y.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.labels.style.font-family.name","description":"axis.y.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.y.labels.style.fill.name","description":"axis.y.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.labels.style.font.name","description":"axis.y.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.y.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.y.labels.zoomPan.falseLabel","name":"axis.y.labels.zoomPan.name","description":"axis.y.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.y.title.display.trueLabel","default":true,"falseLabel":"axis.y.title.display.falseLabel","resetView":"layout","name":"axis.y.title.display.name","description":"axis.y.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.title.style.font-size.name","description":"axis.y.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.title.style.font-family.name","description":"axis.y.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.y.title.style.fill.name","description":"axis.y.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.title.style.font.name","description":"axis.y.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.y.title.text.name","description":"axis.y.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.y.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.y.scale.includeZero.falseLabel","resetView":"layout","name":"axis.y.scale.includeZero.name","description":"axis.y.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.y.scale.nice.trueLabel","default":false,"falseLabel":"axis.y.scale.nice.falseLabel","resetView":"layout","name":"axis.y.scale.nice.name","description":"axis.y.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"labels":{"type":"object","properties":{"layoutMode":{"default":"horizontal","resetView":"layout","name":"axis.y.labels.layoutMode.name","options":[{"id":"axis.y.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.y.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.y.labels.layoutMode.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.y.gridlines.display.trueLabel","default":true,"falseLabel":"axis.y.gridlines.display.falseLabel","name":"axis.y.gridlines.display.name","description":"axis.y.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.y.gridlines.style.stroke-dasharray.name","description":"axis.y.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.y.gridlines.style.stroke.name","description":"axis.y.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"properties":{"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"},"entrystyle":{"type":"object","properties":{"font":{"name":"legend.entrystyle.font.name","description":"legend.entrystyle.font.description","type":"font"}}},"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"},"title":{"default":"","resetView":"layout","name":"legend.title.name","description":"legend.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"}}}}}}},{"comment":"All the x1 (independent) axis properties except for the gridlines","properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"scale":{"type":"object","properties":{"nice":{"trueLabel":"axis.x.scale.nice.trueLabel","default":true,"falseLabel":"axis.x.scale.nice.falseLabel","resetView":"layout","name":"axis.x.scale.nice.name","description":"axis.x.scale.nice.description","type":"boolean"}}},"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.x.gridlines.display.trueLabel","default":true,"falseLabel":"axis.x.gridlines.display.falseLabel","name":"axis.x.gridlines.display.name","description":"axis.x.gridlines.display.description","type":"boolean"}}}}},"y":{"type":"object","properties":{"scale":{"type":"object","properties":{"nice":{"trueLabel":"axis.y.scale.nice.trueLabel","default":true,"falseLabel":"axis.y.scale.nice.falseLabel","resetView":"layout","name":"axis.y.scale.nice.name","description":"axis.y.scale.nice.description","type":"boolean"}}}}}}}}},{"previews":{"image":[{"file":"resources\/preview_bubble_small.png","tags":["small","notext"]}],"svg":[{"file":"resources\/preview_bubble_small.svg","tags":["small","notext"]}]},"genericMeta":{"copyright":"IBM 2015, 2016","author":"IBM","description":"bubbleBundle.metadata.description","id":"rave-library-bubble","label":"bubbleBundle.metadata.label","version":"1.0.0","tags":["bubble"]}},{"actions":[{"args":[{"icon":null,"description":"actions.args.selector.description","id":"selector","label":"actions.args.selector.label","type":"selector","tags":[]},{"icon":null,"description":"actions.args.attributes.description","id":"attrs","label":"actions.args.attributes.label","type":"attributeMap","tags":[]}],"icon":null,"options":[],"description":"actions.applyHighlight.description","binding":[{"event":"mouseover","target":".element-shape"}],"id":"highlight","label":"actions.applyHighlight.label","tags":[]},{"args":[{"icon":null,"description":"actions.args.selector.description","id":"selector","label":"actions.args.selector.label","type":"selector","tags":[]},{"icon":null,"description":"actions.args.attributes.description","id":"attrs","label":"actions.args.attributes.label","type":"attributeMap","tags":[]}],"icon":null,"options":[],"description":"actions.removeHighlight.description","binding":[{"event":"mouseout","target":".element-shape"}],"id":"unhighlight","label":"actions.removeHighlight.label","tags":[]},{"args":[{"icon":null,"description":"actions.args.selector.label","id":"selector","label":"actions.args.selector.label","type":"selector","tags":[]},{"icon":null,"description":"actions.args.attributes.description","id":"attrs","label":"actions.args.attributes.label","type":"attributeMap","tags":[]}],"icon":null,"options":[],"description":"actions.applySelection.description","binding":[{"event":"mouseover","target":".element-shape"}],"id":"select","label":"actions.applySelection.label","tags":[]},{"args":[{"icon":null,"description":"actions.args.selector.description","id":"selector","label":"actions.args.selector.label","type":"selector","tags":[]},{"icon":null,"description":"actions.args.attributes.description","id":"attrs","label":"actions.args.attributes.label","type":"attributeMap","tags":[]}],"icon":null,"options":[],"description":"actions.removeSelection.description","binding":[{"event":"mouseout","target":".element-shape"}],"id":"deselect","label":"actions.removeSelection.label","tags":[]},{"args":[{"icon":null,"description":"actions.args.selector.description","id":"selector","label":"actions.args.selector.label","type":"selector","tags":[]},{"icon":null,"description":"actions.args.attributes.description","id":"attrs","label":"actions.args.attributes.label","type":"attributeMap","tags":[]}],"icon":null,"options":[],"description":"actions.removeAllSelect.description","binding":[{"event":"click","target":".background"}],"id":"deselectAll","label":"actions.removeAllSelect.label","tags":[]},{"args":[{"icon":null,"description":"actions.args.primarySelector.description","id":"PrimarySelector","label":"actions.args.primarySelector.label","type":"selector","tags":[]},{"icon":null,"description":"actions.args.secondarySelector.description","id":"secondarySelector","label":"actions.args.secondarySelector.label","type":"selector","tags":[]},{"icon":null,"description":"actions.args.primaryAttributes.description","id":"PrimaryStyles","label":"actions.args.primaryAttributes.label","type":"attributeMap","tags":[]},{"icon":null,"description":"actions.args.secondaryAttributes.description","id":"SecondarySyles","label":"actions.args.secondaryAttributes.label","type":"attributeMap","tags":[]}],"icon":null,"options":[],"description":"actions.toggleSelect.description","binding":[{"event":"click","target":".element-shape"}],"id":"toggleSelect","label":"actions.toggleSelect.label","tags":[]},{"icon":null,"options":[],"description":"actions.zoom.description","binding":[],"id":"zoom","label":"actions.zoom.label","tags":[]},{"icon":null,"options":[],"description":"actions.zoomPackedBubble.description","binding":[{"event":"dblclick","target":".element"}],"id":"zoomPackedBubble","label":"actions.zoomPackedBubble.label","tags":[]}]},{"propertyPresentations":[{"presentationItems":[{"propertyID":"color.palette"},{"propertyID":"symbolShape"},{"propertyID":"axis.x.title.display"},{"propertyID":"axis.y.title.display"},{"propertyID":"itemLabel.display"},{"propertyID":"legend.display"},{"propertyID":"legend.position"}],"icon":"","description":"propertyPresentation.simple.description","id":"simple","label":"propertyPresentation.simple.label","tags":["Bubble","Bubble Properties Presentation","Simple","ca.dashboard"]},{"presentationItems":[{"propertyGroup":{"presentationItems":[{"propertyID":"background.chart.color"},{"propertyID":"background.elements.color"},{"propertyID":"color.palette"},{"propertyID":"layout.padding"}],"icon":"","description":"propertyPresentation.advanced.commonProperties.description","id":"commonProperties","label":"propertyPresentation.advanced.commonProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"itemLabel.display"},{"propertyID":"labelstyle.font"},{"propertyID":"packedBubbleNegativeValueDisplay"},{"propertyID":"sizeScale.first"},{"propertyID":"sizeScale.second"},{"propertyID":"symbol.borderColor"},{"propertyID":"symbol.borderWidth"},{"propertyID":"symbolShape"},{"propertyID":"transpose"}],"icon":"","description":"bubble.propertyPresentation.advanced.bubbleSpecificProperties.description","id":"bubbleSpecificProperties","label":"bubble.propertyPresentation.advanced.bubbleSpecificProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"axis.x.gridlines.display"},{"propertyID":"axis.x.gridlines.style.stroke"},{"propertyID":"axis.x.gridlines.style.stroke-dasharray"},{"propertyID":"axis.x.labels.display"},{"propertyID":"axis.x.labels.style.font"},{"propertyID":"axis.x.line.display"},{"propertyID":"axis.x.line.style.stroke"},{"propertyID":"axis.x.ticks.display"},{"propertyID":"axis.x.ticks.style.stroke"},{"propertyID":"axis.x.title.display"},{"propertyID":"axis.x.title.style.font"},{"propertyID":"axis.x.title.text"}],"icon":"","description":"propertyPresentation.advanced.xAxisProperties.description","id":"xAxisProperties","label":"propertyPresentation.advanced.xAxisProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"axis.y.gridlines.display"},{"propertyID":"axis.y.gridlines.style.stroke"},{"propertyID":"axis.y.gridlines.style.stroke-dasharray"},{"propertyID":"axis.y.labels.display"},{"propertyID":"axis.y.labels.style.font"},{"propertyID":"axis.y.line.display"},{"propertyID":"axis.y.line.style.stroke"},{"propertyID":"axis.y.ticks.display"},{"propertyID":"axis.y.ticks.style.stroke"},{"propertyID":"axis.y.title.display"},{"propertyID":"axis.y.title.style.font"},{"propertyID":"axis.y.title.text"}],"icon":"","description":"propertyPresentation.advanced.yAxisProperties.description","id":"yAxisProperties","label":"propertyPresentation.advanced.yAxisProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"legend.display"},{"propertyID":"legend.position"},{"propertyID":"layout.legendchart.gap"},{"propertyID":"layout.legendchart.align"},{"propertyID":"legend.title"},{"propertyID":"legend.titlestyle.font"},{"propertyID":"legend.entrystyle.font"},{"propertyID":"layout.legendsize.preferred"},{"propertyID":"layout.legendsize.min"},{"propertyID":"layout.legendsize.max"}],"icon":"","description":"propertyPresentation.advanced.legendProperties.description","id":"legendProperties","label":"propertyPresentation.advanced.legendProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"effect.duration"},{"propertyID":"effect.name"}],"icon":"","description":"propertyPresentation.advanced.clientBehaviorProperties.description","id":"clientBehaviorProperties","label":"propertyPresentation.advanced.clientBehaviorProperties.label","tags":["ca.chart.definition.outputType=interactive"]}}],"icon":"","description":"propertyPresentation.advanced.description","id":"advanced","label":"propertyPresentation.advanced.label","tags":["Bubble","Bubble Properties Presentation","advanced","ca.reporting"]}]},{"configurations":[{"dataSlots":[{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y","label":"dataslot.value.label","svgIcon":"..\/rave-library\/resources\/numeric_value_32.svg","tags":["ca.chart.definition.supportsRange=true"]},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"size"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/point_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/point_preview_320.png","tags":["medium","color"]},{"file":"resources\/point_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/point_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/point_preview_320.svg","tags":["medium","color"]},{"file":"resources\/point_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"bubble.config.point.description","id":"point","label":"bubble.config.point.label","tags":["ca.reporting","ca.dashboard"]},"datamodels":[{"hidden":true,"id":"hierarchical"}],"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"hidden":true,"id":"layout.axissize.bottom.min","value":"5"},{"hidden":true,"id":"layout.axissize.bottom.preferred","value":"30%"},{"hidden":true,"id":"layout.axissize.bottom.max","value":"200"},{"hidden":true,"id":"layout.axissize.left.min","value":"5"},{"hidden":true,"id":"layout.axissize.left.preferred","value":"30%"},{"hidden":true,"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"itemLabel.display","value":false},{"hidden":true,"id":"itemLabel.overlap"},{"hidden":true,"id":"layout.legendsize.preferred"},{"hidden":true,"id":"layout.legendsize.min"},{"hidden":true,"id":"layout.legendsize.max"},{"hidden":true,"id":"packedBubbleNegativeValueDisplay"},{"hidden":true,"id":"labelstyle.font"},{"id":"sizeScale.second","value":256}]},{"dataSlots":[{"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"color","svgIcon":"..\/rave-library\/resources\/bubbles_32.svg","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y","tags":["ca.chart.definition.supportsRange=true"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.supportsRange=true"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"size","tags":["ca.chart.definition.supportsRange=true"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/bubble_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/bubble_preview_320.png","tags":["medium","color"]},{"file":"resources\/bubble_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/bubble_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/bubble_preview_320.svg","tags":["medium","color"]},{"file":"resources\/bubble_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"bubble.config.bubble.description","id":"bubble","label":"bubble.config.bubble.label","tags":["ca.dashboard","ca.reporting"]},"datamodels":[{"hidden":true,"id":"hierarchical"}],"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"hidden":true,"id":"layout.axissize.bottom.min","value":"5"},{"hidden":true,"id":"layout.axissize.bottom.preferred","value":"30%"},{"hidden":true,"id":"layout.axissize.bottom.max","value":"200"},{"hidden":true,"id":"layout.axissize.left.min","value":"5"},{"hidden":true,"id":"layout.axissize.left.preferred","value":"30%"},{"hidden":true,"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"itemLabel.display","value":false},{"hidden":true,"id":"itemLabel.overlap"},{"hidden":true,"id":"layout.legendsize.preferred"},{"hidden":true,"id":"layout.legendsize.min"},{"hidden":true,"id":"layout.legendsize.max"},{"hidden":true,"id":"packedBubbleNegativeValueDisplay"},{"hidden":true,"id":"labelstyle.font"}]},{"dataSlots":[{"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"label","label":"dataslot.points.label","svgIcon":"..\/rave-library\/resources\/points_32.svg","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y","tags":["ca.chart.definition.supportsRange=true"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.supportsRange=true"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"size"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/scatter_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/scatter_preview_320.png","tags":["medium","color"]},{"file":"resources\/scatter_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/scatter_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/scatter_preview_320.svg","tags":["medium","color"]},{"file":"resources\/scatter_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"bubble.config.scatter.description","id":"scatter","label":"bubble.config.scatter.label","tags":["ca.dashboard","ca.reporting"]},"datamodels":[{"hidden":true,"id":"hierarchical"}],"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"hidden":true,"id":"layout.axissize.bottom.min","value":"5"},{"hidden":true,"id":"layout.axissize.bottom.preferred","value":"30%"},{"hidden":true,"id":"layout.axissize.bottom.max","value":"200"},{"hidden":true,"id":"layout.axissize.left.min","value":"5"},{"hidden":true,"id":"layout.axissize.left.preferred","value":"30%"},{"hidden":true,"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"itemLabel.display","value":false},{"hidden":true,"id":"itemLabel.overlap"},{"hidden":true,"id":"layout.legendsize.preferred"},{"hidden":true,"id":"layout.legendsize.min"},{"hidden":true,"id":"layout.legendsize.max"},{"hidden":true,"id":"packedBubbleNegativeValueDisplay"},{"hidden":true,"id":"labelstyle.font"}]},{"dataSlots":[{"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"label","label":"dataslot.categories.label","svgIcon":"..\/rave-library\/resources\/bubbles_32.svg","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"size","tags":["ca.chart.definition.supportsRange=true"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"y"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"x"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/packed_bubble_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/packed_bubble_preview_320.png","tags":["medium","color"]},{"file":"resources\/packed_bubble_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/packed_bubble_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/packed_bubble_preview_320.svg","tags":["medium","color"]},{"file":"resources\/packed_bubble_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"bubble.config.packedBubble.description","id":"packedBubble","label":"bubble.config.packedBubble.label","tags":["ca.dashboard","ca.reporting"]},"datamodels":[{"hidden":true,"id":"hierarchical"}],"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"hidden":true,"id":"symbolShape"},{"hidden":true,"id":"pack","value":"BubbleLayout"},{"hidden":true,"id":"axis.x.gridlines.display"},{"hidden":true,"id":"axis.x.gridlines.style.stroke"},{"hidden":true,"id":"axis.x.gridlines.style.stroke-dasharray"},{"hidden":true,"id":"axis.x.labels.display"},{"hidden":true,"id":"axis.x.labels.style.font"},{"hidden":true,"id":"axis.x.line.display"},{"hidden":true,"id":"axis.x.line.style.stroke"},{"hidden":true,"id":"axis.x.scale.nice"},{"hidden":true,"id":"axis.x.ticks.display"},{"hidden":true,"id":"axis.x.ticks.style.stroke"},{"hidden":true,"id":"axis.x.title.display"},{"hidden":true,"id":"axis.x.title.style.font"},{"hidden":true,"id":"axis.x.title.text"},{"hidden":true,"id":"axis.y.gridlines.display"},{"hidden":true,"id":"axis.y.gridlines.style.stroke"},{"hidden":true,"id":"axis.y.gridlines.style.stroke-dasharray"},{"hidden":true,"id":"axis.y.labels.display"},{"hidden":true,"id":"axis.y.labels.style.font"},{"hidden":true,"id":"axis.y.line.display"},{"hidden":true,"id":"axis.y.line.style.stroke"},{"hidden":true,"id":"axis.y.scale.nice"},{"hidden":true,"id":"axis.y.ticks.display"},{"hidden":true,"id":"axis.y.ticks.style.stroke"},{"hidden":true,"id":"axis.y.title.display"},{"hidden":true,"id":"axis.y.title.style.font"},{"hidden":true,"id":"axis.y.title.text"},{"hidden":true,"id":"layout.axissize.left.preferred"},{"hidden":true,"id":"layout.axissize.left.max"},{"hidden":true,"id":"layout.axissize.left.min"},{"hidden":true,"id":"layout.axissize.bottom.preferred"},{"hidden":true,"id":"layout.axissize.bottom.max"},{"hidden":true,"id":"layout.axissize.bottom.min"},{"hidden":true,"id":"transpose"},{"hidden":true,"id":"layout.legendsize.preferred"},{"hidden":true,"id":"layout.legendsize.min"},{"hidden":true,"id":"layout.legendsize.max"},{"hidden":true,"id":"sizeScale.first"},{"hidden":true,"id":"sizeScale.second"}]}]},{"build":"development","name":"rave-library-bubble","description":"This is the IBM Rave bubble bundle.","ignore":["bower.json"],"main":"bundle.js","version":"1.0.0","dependencies":{"rave-legends":"<2.0.0","rave-library":"<2.0.0","rave":"<3.0.0","rave-layouts":"<2.0.0","rave-utilities":"<2.0.0"}}]
  12. },{}],2:[function(require,module,exports){
  13. module.exports={
  14. "actions.applyHighlight.description": "Highlights a node.",
  15. "actions.applyHighlight.label": "Apply highlight action",
  16. "actions.applySelection.description": "Selects a node.",
  17. "actions.applySelection.label": "Apply selection action",
  18. "actions.args.attributes.description": "Optional map of attribute to value that is applied during the action.",
  19. "actions.args.attributes.label": "Optional attributes function argument",
  20. "actions.args.primaryAttributes.description": "Optional map of primary attributes that are applied during the action.",
  21. "actions.args.primaryAttributes.label": "Optional primary attributes function argument",
  22. "actions.args.primarySelector.description": "Primary selector for the nodes that the action is to apply to.",
  23. "actions.args.primarySelector.label": "Primary selector function argument",
  24. "actions.args.secondaryAttributes.description": "Optional map of secondary attributes that are applied during the action.",
  25. "actions.args.secondaryAttributes.label": "Optional secondary attributes function argument",
  26. "actions.args.secondarySelector.description": "Secondary selector for the nodes that the action is to apply to.",
  27. "actions.args.secondarySelector.label": "Secondary selector function argument",
  28. "actions.args.selector.description": "Selector of the node that the action will apply to.",
  29. "actions.args.selector.label": "Selector function argument",
  30. "actions.breadCrumb.description": "Navigates up and down in detail through a bread crumb.",
  31. "actions.breadCrumb.label": "Bread crumb navigation action",
  32. "actions.chord.selector.description": "Selector for the chords that the action will apply to.",
  33. "actions.chord.selector.label": "Selector function argument for chords",
  34. "actions.chord.toggleSelect.description": "Toggles selection on a chord.",
  35. "actions.chord.toggleSelect.label": "Toggle select on chord action",
  36. "actions.chordGroup.highlight.description": "Highlights a chord group and everything that is connected to it.",
  37. "actions.chordGroup.highlight.label": "Chord group highlight action",
  38. "actions.chordGroup.removeHighlight.description": "Removes highlights from a chord group and everything connected to it.",
  39. "actions.chordGroup.removeHighlight.label": "Chord group remove highlight action",
  40. "actions.chordGroup.selector.description": "Selector for the chord groups that the action will apply to.",
  41. "actions.chordGroup.selector.label": "Selector function argument for chord groups",
  42. "actions.drillDown.description": "Drills down to the next level of detail.",
  43. "actions.drillDown.label": "Drill down action",
  44. "actions.removeAllSelect.description": "Removes all selections from all nodes.",
  45. "actions.removeAllSelect.label": "Remove all selections action",
  46. "actions.removeHighlight.description": "Removes a highlight from a node.",
  47. "actions.removeHighlight.label": "Remove highlight action",
  48. "actions.removeSelection.description": "Removes a selection from a node.",
  49. "actions.removeSelection.label": "Remove selection action",
  50. "actions.toggleSelect.description": "Toggles the selection on a node.",
  51. "actions.toggleSelect.label": "Toggle selection action",
  52. "actions.zoom.args.panX.description": "The amount to pan in the x direction.",
  53. "actions.zoom.args.panX.label": "Zoom x pan amount function argument",
  54. "actions.zoom.args.panY.description": "The amount to pan in the y direction.",
  55. "actions.zoom.args.panY.label": "Zoom y pan amount function argument",
  56. "actions.zoom.args.scale.description": "The scale amount for the zoom action.",
  57. "actions.zoom.args.scale.label": "Zoom scale function argument",
  58. "actions.zoom.description": "Zoom action",
  59. "actions.zoom.label": "Zoom action",
  60. "actions.zoomPackedBubble.description": "Zoom for a packed bubble.",
  61. "actions.zoomPackedBubble.label": "Zoom packed bubble action",
  62. "axis.labels.truncationText.description": "The text that is placed at the end of labels to indicate truncation.",
  63. "axis.labels.truncationText.name": "Axis truncation text",
  64. "axis.x.gridlines.display.description": "Shows or hides the X-axis gridlines.",
  65. "axis.x.gridlines.display.falseLabel": "Hide",
  66. "axis.x.gridlines.display.name": "Show gridlines",
  67. "axis.x.gridlines.display.trueLabel": "Show",
  68. "axis.x.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the X-axis gridlines.",
  69. "axis.x.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
  70. "axis.x.gridlines.style.stroke.description": "The color of the X-axis gridline.",
  71. "axis.x.gridlines.style.stroke.name": "Gridline color",
  72. "axis.x.labels.allowRotate45.description": "Enables or disables the rotate45 option for labels automatic layout.",
  73. "axis.x.labels.allowRotate45.falseLabel": "Disable rotate45 option",
  74. "axis.x.labels.allowRotate45.name": "Allow rotate 45",
  75. "axis.x.labels.allowRotate45.trueLabel": "Enable rotate45 option",
  76. "axis.x.labels.allowRotate90.description": "Enables or disables the rotate90 option for labels automatic layout.",
  77. "axis.x.labels.allowRotate90.falseLabel": "Disable rotate90 option",
  78. "axis.x.labels.allowRotate90.name": "Allow rotate 90",
  79. "axis.x.labels.allowRotate90.trueLabel": "Enable rotate90 option",
  80. "axis.x.labels.allowStagger.description": "Allows the stagger option for labels automatic layout.",
  81. "axis.x.labels.allowStagger.falseLabel": "X-axis do not allow stagger",
  82. "axis.x.labels.allowStagger.name": "Allow stagger",
  83. "axis.x.labels.allowStagger.trueLabel": "X-axis allow stagger",
  84. "axis.x.labels.display.description": "Shows or hides the X-axis labels.",
  85. "axis.x.labels.display.falseLabel": "Hide",
  86. "axis.x.labels.display.name": "Show labels",
  87. "axis.x.labels.display.trueLabel": "Show",
  88. "axis.x.labels.layoutMode.description": "Configure the layout mode for the X-axis labels.",
  89. "axis.x.labels.layoutMode.name": "Layout Mode",
  90. "axis.x.labels.layoutMode.options.automatic": "Automatic",
  91. "axis.x.labels.layoutMode.options.horizontal": "Horizontal",
  92. "axis.x.labels.layoutMode.options.rotate45": "Rotated 45 degrees",
  93. "axis.x.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  94. "axis.x.labels.layoutMode.options.stagger": "Stagger",
  95. "axis.x.labels.style.fill.description": "The color of X-axis labels.",
  96. "axis.x.labels.style.fill.name": "Label color",
  97. "axis.x.labels.style.font-family.description": "The font families of the X-axis labels.",
  98. "axis.x.labels.style.font-family.name": "Label font families",
  99. "axis.x.labels.style.font-size.description": "The size of X-axis labels (CSS size).",
  100. "axis.x.labels.style.font-size.name": "Label font size",
  101. "axis.x.labels.style.font.description": "The font properties of X-axis labels (CSS styles).",
  102. "axis.x.labels.style.font.name": "Label font",
  103. "axis.x.labels.zoomPan.description": "Shows or hides X-axis labels when panning and zooming.",
  104. "axis.x.labels.zoomPan.falseLabel": "Show",
  105. "axis.x.labels.zoomPan.name": "Label pan-zoom",
  106. "axis.x.labels.zoomPan.trueLabel": "Hide",
  107. "axis.x.line.display.description": "Shows or hides the X-axis line.",
  108. "axis.x.line.display.falseLabel": "Hide",
  109. "axis.x.line.display.name": "Show line",
  110. "axis.x.line.display.trueLabel": "Show",
  111. "axis.x.line.style.stroke.description": "The color of the X-axis line.",
  112. "axis.x.line.style.stroke.name": "Line color",
  113. "axis.x.scale.includeZero.description": "When set to Yes, includes 0 on the X-axis.",
  114. "axis.x.scale.includeZero.falseLabel": "Do not include",
  115. "axis.x.scale.includeZero.name": "Includes zero",
  116. "axis.x.scale.includeZero.trueLabel": "Include",
  117. "axis.x.scale.max.description": "The maximum value that appears on the X-axis.",
  118. "axis.x.scale.max.name": "Maximum value",
  119. "axis.x.scale.min.description": "The minimum value that appears on the X-axis.",
  120. "axis.x.scale.min.name": "Minimum value",
  121. "axis.x.scale.nice.description": "When set to Yes, uses nice endpoint values on the X-axis.",
  122. "axis.x.scale.nice.falseLabel": "Do not nice",
  123. "axis.x.scale.nice.name": "Nicing",
  124. "axis.x.scale.nice.trueLabel": "Apply nicing",
  125. "axis.x.ticks.display.description": "Shows or hides the X-axis tick marks.",
  126. "axis.x.ticks.display.falseLabel": "Hide",
  127. "axis.x.ticks.display.name": "Show ticks",
  128. "axis.x.ticks.display.trueLabel": "Show",
  129. "axis.x.ticks.style.stroke.description": "The color of the X-axis ticks.",
  130. "axis.x.ticks.style.stroke.name": "Tick color",
  131. "axis.x.title.display.description": "Shows or hides the X-axis title.",
  132. "axis.x.title.display.falseLabel": "Hide",
  133. "axis.x.title.display.name": "Show title",
  134. "axis.x.title.display.trueLabel": "Show",
  135. "axis.x.title.style.fill.description": "The color of the X-axis title.",
  136. "axis.x.title.style.fill.name": "Title color",
  137. "axis.x.title.style.font-family.description": "The font family names of the X-axis title.",
  138. "axis.x.title.style.font-family.name": "Title font families",
  139. "axis.x.title.style.font-size.description": "The X-axis title font size (CSS size).",
  140. "axis.x.title.style.font-size.name": "Title font size",
  141. "axis.x.title.style.font.description": "The X-axis title font properties (CSS style).",
  142. "axis.x.title.style.font.name": "Title font",
  143. "axis.x.title.text.description": "The title of the X-axis.",
  144. "axis.x.title.text.name": "Title",
  145. "axis.y.gridlines.display.description": "Shows or hides the Y-axis gridlines.",
  146. "axis.y.gridlines.display.falseLabel": "Hide",
  147. "axis.y.gridlines.display.name": "Show gridlines",
  148. "axis.y.gridlines.display.trueLabel": "Show",
  149. "axis.y.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the Y-axis gridlines.",
  150. "axis.y.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
  151. "axis.y.gridlines.style.stroke.description": "The color of the Y-axis gridline.",
  152. "axis.y.gridlines.style.stroke.name": "Gridline color",
  153. "axis.y.labels.display.description": "Shows or hides the Y-axis labels.",
  154. "axis.y.labels.display.falseLabel": "Hide",
  155. "axis.y.labels.display.name": "Show labels",
  156. "axis.y.labels.display.trueLabel": "Show",
  157. "axis.y.labels.layoutMode.description": "Configure the layout mode for the Y-axis labels.",
  158. "axis.y.labels.layoutMode.name": "Layout Mode",
  159. "axis.y.labels.layoutMode.options.horizontal": "Horizontal",
  160. "axis.y.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  161. "axis.y.labels.style.fill.description": "The color of Y-axis labels.",
  162. "axis.y.labels.style.fill.name": "Label color",
  163. "axis.y.labels.style.font-family.description": "The font families of the Y-axis labels.",
  164. "axis.y.labels.style.font-family.name": "Label font families",
  165. "axis.y.labels.style.font-size.description": "The size of Y-axis labels (CSS size).",
  166. "axis.y.labels.style.font-size.name": "Label font size",
  167. "axis.y.labels.style.font.description": "The font properties of Y-axis labels (CSS styles).",
  168. "axis.y.labels.style.font.name": "Label font",
  169. "axis.y.labels.zoomPan.description": "Shows or hides Y-axis labels when panning and zooming.",
  170. "axis.y.labels.zoomPan.falseLabel": "Show",
  171. "axis.y.labels.zoomPan.name": "Label pan-zoom",
  172. "axis.y.labels.zoomPan.trueLabel": "Hide",
  173. "axis.y.line.display.description": "Shows or hides the Y-axis line.",
  174. "axis.y.line.display.falseLabel": "Hide",
  175. "axis.y.line.display.name": "Show line",
  176. "axis.y.line.display.trueLabel": "Show",
  177. "axis.y.line.style.stroke.description": "The color of the Y-axis line.",
  178. "axis.y.line.style.stroke.name": "Line color",
  179. "axis.y.scale.includeZero.description": "When set to Yes, includes 0 on the Y-axis.",
  180. "axis.y.scale.includeZero.falseLabel": "Do not include",
  181. "axis.y.scale.includeZero.name": "Includes zero",
  182. "axis.y.scale.includeZero.trueLabel": "Include",
  183. "axis.y.scale.max.description": "The maximum value that appears on the Y-axis.",
  184. "axis.y.scale.max.name": "Maximum value",
  185. "axis.y.scale.min.description": "The minimum value tha appears on the Y-axis.",
  186. "axis.y.scale.min.name": "Minimum value",
  187. "axis.y.scale.nice.description": "When set to Yes, uses nice endpoint values on the Y-axis.",
  188. "axis.y.scale.nice.falseLabel": "Do not nice",
  189. "axis.y.scale.nice.name": "Nicing",
  190. "axis.y.scale.nice.trueLabel": "Apply nicing",
  191. "axis.y.ticks.display.description": "Shows or hides the Y-axis tick marks.",
  192. "axis.y.ticks.display.falseLabel": "Hide",
  193. "axis.y.ticks.display.name": "Show ticks",
  194. "axis.y.ticks.display.trueLabel": "Show",
  195. "axis.y.ticks.style.stroke.description": "The color of the Y-axis ticks.",
  196. "axis.y.ticks.style.stroke.name": "Tick color",
  197. "axis.y.title.display.description": "Shows or hides the Y-axis title.",
  198. "axis.y.title.display.falseLabel": "Hide",
  199. "axis.y.title.display.name": "Show title",
  200. "axis.y.title.display.trueLabel": "Show",
  201. "axis.y.title.style.fill.description": "The color of the Y-axis title.",
  202. "axis.y.title.style.fill.name": "Title color",
  203. "axis.y.title.style.font-family.description": "The font family names of the Y-axis title.",
  204. "axis.y.title.style.font-family.name": "Title font families",
  205. "axis.y.title.style.font-size.description": "The size of the Y-axis title font (CSS size).",
  206. "axis.y.title.style.font-size.name": "Title font size",
  207. "axis.y.title.style.font.description": "The Y-axis title font properties (CSS styles).",
  208. "axis.y.title.style.font.name": "Title font",
  209. "axis.y.title.text.description": "The title of the Y-axis.",
  210. "axis.y.title.text.name": "Title",
  211. "background.chart.color.description": "The background color of the chart.",
  212. "background.chart.color.name": "Background color",
  213. "background.elements.color.description": "The background color behind the elements of the chart.",
  214. "background.elements.color.name": "Elements background color",
  215. "bubble.config.bubble.description": "Bubble charts use data points and bubbles to plot measures anywhere along a scale. One measure is plotted along each axis. The size of the bubble represents a third measure. You can use bubble charts to represent financial data or any data where measure values are related.",
  216. "bubble.config.bubble.label": "Bubble",
  217. "bubble.config.packedBubble.description": "A packed bubble chart contains bubbles that are tightly packed rather than spread over a grid. You can use packed bubble visualizations to display a large amount of data in a small space.",
  218. "bubble.config.packedBubble.label": "Packed bubble",
  219. "bubble.config.point.description": "A point chart is like a line chart without the connecting lines. Use point charts to show changes in a data series over time or to compare multiple items. Items are arranged horizontally, and data values are plotted vertically.",
  220. "bubble.config.point.label": "Point",
  221. "bubble.config.scatter.description": "Scatter visualizations use data points to plot two measures anywhere along a scale, not only at regular tick marks. You can use scatter visualizations to explore correlations between different measures.",
  222. "bubble.config.scatter.label": "Scatter plot",
  223. "bubble.falseLabel.itemLabel": "Hide",
  224. "bubble.falseLabel.negativeValueDisplay": "Hide",
  225. "bubble.falseLabel.overlap": "Do not hide",
  226. "bubble.propertyPresentation.advanced.bubbleSpecificProperties.description": "Bubble-specific properties",
  227. "bubble.propertyPresentation.advanced.bubbleSpecificProperties.label": "Bubble",
  228. "bubble.trueLabel.itemLabel": "Show",
  229. "bubble.trueLabel.negativeValueDisplay": "Show",
  230. "bubble.trueLabel.overlap": "Hide",
  231. "bubbleBundle.metadata.description": "Bubble charts use data points and bubbles to plot measures anywhere along a scale. One measure is plotted along each axis. The size of the bubble represents a third measure. You can use bubble charts to represent financial data or any data where measure values are related. Based on what data is provided, many different types of bubble charts can be rendered, including packed bubble, single axis point / bubble, scatter, bubble and heatmap.",
  232. "bubbleBundle.metadata.label": "Bubble",
  233. "bubbleBundle.metadata.tags.bubble": "Bubble",
  234. "bubbleBundle.metadata.tags.heatmap": "Heatmap",
  235. "bubbleBundle.metadata.tags.packed": "Packed bubble",
  236. "bubbleBundle.metadata.tags.scatter": "Scatter",
  237. "color.null.description": "The color that is applied to null values.",
  238. "color.null.name": "Null value color",
  239. "color.palette.description": "The color palette that controls the colors or patterns that are applied to data elements in the chart.",
  240. "color.palette.name": "Color palette",
  241. "contrast.label.color.description": "Adjust the label color to contrast with background.",
  242. "contrast.label.color.name": "Contrast label color with background",
  243. "data.handling.description": "The configuration that is used to plot the data.",
  244. "data.handling.name": "Configuration",
  245. "datamodel.hierarchial.bubble.description": "Hierarchical (tree) model with children, size, color, and label. The data is plotted as a packed bubble layout.",
  246. "datamodel.hierarchial.label": "Hierarchical data model",
  247. "datamodel.tabular.bubble.description": "Bubble chart tabular (array) model with x, y, size, color, and label. The data is plotted as a scatter plot, but if x and y are both undefined, the data is plotted as a packed bubble layout.",
  248. "datamodel.tabular.label": "Tabular data model",
  249. "dataset.hierarchial.bubble.description": "The root node of the hierarchical tree. The 'children' data slot is used to get each node's children.",
  250. "dataset.hierarchial.label": "Hierarchical data set",
  251. "dataset.tabular.description": "The tabular data set of rows and columns.",
  252. "dataset.tabular.label": "Tabular data set",
  253. "dataset.tabular.link.description": "Determines the links between the nodes.",
  254. "dataset.tabular.link.label": "Tabular links data set",
  255. "dataset.tabular.node.description": "The tabular data set that defines the nodes.",
  256. "dataset.tabular.node.label": "Tabular node data set",
  257. "dataslot.categories.label": "Categories",
  258. "dataslot.category.label": "Category",
  259. "dataslot.children.description": "When applied to a tree node, returns the children of that node as an array-list.",
  260. "dataslot.children.label": "Children",
  261. "dataslot.color.description": "Determines the color of the shape.",
  262. "dataslot.color.label": "Color",
  263. "dataslot.key.description": "Called for each row to match elements. Primarily used for transitions.",
  264. "dataslot.key.label": "Key",
  265. "dataslot.label.bubble.description": "If defined, the label of each bubble.",
  266. "dataslot.label.description": "Determines the label of the shape.",
  267. "dataslot.label.label": "Label",
  268. "dataslot.maximumValue.label": "Maximum value",
  269. "dataslot.points.label": "Points",
  270. "dataslot.source.label": "Source",
  271. "dataslot.sourceValue.label": "Source value",
  272. "dataslot.tabular.id.description": "The identifier for the nodes.",
  273. "dataslot.tabular.id.label": "Identifier",
  274. "dataslot.tabular.size.description": "Determines the size of the shape.",
  275. "dataslot.tabular.size.label": "Size",
  276. "dataslot.target.label": "Target",
  277. "dataslot.targetValue.label": "Target value",
  278. "dataslot.value.label": "Value",
  279. "dataslot.x.bubble.description": "The x coordinate of the bubble. The value can be a number, string, or date.",
  280. "dataslot.x.label": "X axis",
  281. "dataslot.y.bubble.description": "The y coordinate of the bubble. The value can be a number, string, or date.",
  282. "dataslot.y.label": "Y axis",
  283. "defaultPalette.description": "Rave2 default description",
  284. "defaultPalette.label": "Rave2 default",
  285. "effect.duration.description": "The animation duration, in ms.",
  286. "effect.duration.name": "Animation duration (ms)",
  287. "effect.name.description": "The effect that is used when the chart is drawn.",
  288. "effect.name.name": "Animation",
  289. "effect.name.options.fromBase": "From base",
  290. "effect.name.options.grow": "Grow",
  291. "effect.name.options.growfromBase": "Grow and From base",
  292. "effect.name.options.none": "None",
  293. "effect.name.options.transition": "Transition",
  294. "itemColor.description": "The level to use to color the bubbles in the chart.",
  295. "itemColor.name": "Level to color bubbles",
  296. "itemColor.options.level1": "Level 1",
  297. "itemColor.options.level2": "Level 2",
  298. "itemColor.options.level3": "Level 3",
  299. "itemColor.options.level4": "Level 4",
  300. "itemColor.options.level5": "Level 5",
  301. "itemColor.options.level6": "Level 6",
  302. "itemLabel.display.description": "Show or hide bubble labels.",
  303. "itemLabel.display.falseLabel": "Hide labels",
  304. "itemLabel.display.name": "Bubble label",
  305. "itemLabel.display.trueLabel": "Show labels",
  306. "itemLabel.overlap.description": "Show or hide labels that overlap.",
  307. "itemLabel.overlap.falseLabel": "Hide overlapping labels",
  308. "itemLabel.overlap.name": "Hide overlapping labels",
  309. "itemLabel.overlap.trueLabel": "Show overlapping labels",
  310. "label.shadow.description": "Show or hide shadow for labels.",
  311. "label.shadow.name": "Label shadow",
  312. "labelstyle.font.description": "Font styles for the item labels",
  313. "labelstyle.font.name": "Item label font",
  314. "layout.axissize.bottom.max.description": "The maximum size of the bottom axis, as a CSS size or percentage.",
  315. "layout.axissize.bottom.max.name": "Bottom axis maximum size",
  316. "layout.axissize.bottom.min.description": "The minimum size of the bottom axis, as a CSS size or percentage.",
  317. "layout.axissize.bottom.min.name": "Bottom axis minimum size",
  318. "layout.axissize.bottom.preferred.description": "The preferred size of the bottom axis, as a CSS size or percentage.",
  319. "layout.axissize.bottom.preferred.name": "Bottom axis preferred size",
  320. "layout.axissize.left.max.description": "The maximum size of the left axis, as a CSS size or percentage.",
  321. "layout.axissize.left.max.name": "Left axis maximum size",
  322. "layout.axissize.left.min.description": "The minimum size of the left axis, as a CSS size or percentage.",
  323. "layout.axissize.left.min.name": "Left axis minimum size",
  324. "layout.axissize.left.preferred.description": "The preferred size of the left axis, as a CSS size or percentage.",
  325. "layout.axissize.left.preferred.name": "Left axis preferred size",
  326. "layout.axissize.right.max.description": "The maximum size of the right axis, as a CSS size or percentage.",
  327. "layout.axissize.right.max.name": "Right axis maximum size",
  328. "layout.axissize.right.min.description": "The minimum size of the right axis, as a CSS size or percentage.",
  329. "layout.axissize.right.min.name": "Right axis minimum size",
  330. "layout.axissize.right.preferred.description": "The preferred size of the right axis, as a CSS size or percentage.",
  331. "layout.axissize.right.preferred.name": "Right axis preferred size",
  332. "layout.axissize.top.max.description": "The maximum size of the top axis, as a CSS size or percentage.",
  333. "layout.axissize.top.max.name": "Top axis maximum size",
  334. "layout.axissize.top.min.description": "The minimum size of the top axis, as a CSS size or percentage.",
  335. "layout.axissize.top.min.name": "Top axis minimum size",
  336. "layout.axissize.top.preferred.description": "The preferred size of the top axis, as a CSS size or percentage.",
  337. "layout.axissize.top.preferred.name": "Top axis preferred size",
  338. "layout.chart.padding.bottom.description": "The bottom padding for the chart.",
  339. "layout.chart.padding.bottom.name": "Bottom padding",
  340. "layout.chart.padding.left.description": "The left padding for the chart.",
  341. "layout.chart.padding.left.name": "Left padding",
  342. "layout.chart.padding.right.description": "Right padding for the chart.",
  343. "layout.chart.padding.right.name": "Right padding",
  344. "layout.chart.padding.top.description": "The top padding for the chart.",
  345. "layout.chart.padding.top.name": "Top padding",
  346. "layout.legendchart.align.description": "Whether to align the legend to the interior of the chart.",
  347. "layout.legendchart.align.name": "Align legend to chart",
  348. "layout.legendchart.gap.description": "Space between the chart and the legend, as a CSS size or percentage.",
  349. "layout.legendchart.gap.name": "Space between legend and chart",
  350. "layout.legendsize.max.description": "The maximum size of the legend, as a CSS size or percentage.",
  351. "layout.legendsize.max.name": "Maximum size",
  352. "layout.legendsize.min.description": "The minimum size of the legend, as a CSS size or percentage.",
  353. "layout.legendsize.min.name": "Minimum size",
  354. "layout.legendsize.preferred.description": "The preferred size of the legend, as a CSS size or percentage.",
  355. "layout.legendsize.preferred.name": "Preferred size",
  356. "layout.padding.description": "The padding around the chart and legend.",
  357. "layout.padding.name": "Padding",
  358. "legend.display.description": "Shows or hides the legend.",
  359. "legend.display.falseLabel": "Hide",
  360. "legend.display.name": "Show legend",
  361. "legend.display.trueLabel": "Show",
  362. "legend.entrystyle.font.description": "The font properties of the legend entry.",
  363. "legend.entrystyle.font.name": "Entry font",
  364. "legend.position.description": "The position of the legend in the chart.",
  365. "legend.position.name": "Legend position",
  366. "legend.position.options.bottom": "Bottom",
  367. "legend.position.options.left": "Left",
  368. "legend.position.options.right": "Right",
  369. "legend.position.options.top": "Top",
  370. "legend.title.description": "The title of the legend.",
  371. "legend.title.name": "Title",
  372. "legend.titlestyle.fill.description": "The color of the legend title.",
  373. "legend.titlestyle.fill.name": "Title color",
  374. "legend.titlestyle.font.description": "The font properties of the legend title.",
  375. "legend.titlestyle.font.name": "Title font",
  376. "legend.titlestyle.fontfamily.description": "The font family of the legend title.",
  377. "legend.titlestyle.fontfamily.name": "Title font family",
  378. "legend.titlestyle.fontsize.description": "The font size of the legend title.",
  379. "legend.titlestyle.fontsize.name": "Title font size",
  380. "pack.description": "Controls how bubbles are packed.",
  381. "pack.name": "Pack algorithm",
  382. "pack.options.bubblelayout": "Bubble layout",
  383. "pack.options.packlayout": "Pack layout",
  384. "packedBubbleNegativeValueDisplay.description": "Shows or hides pack bubbles that have negative values.",
  385. "packedBubbleNegativeValueDisplay.falseLabel": "Hide bubbles",
  386. "packedBubbleNegativeValueDisplay.name": "Show pack bubbles with negative values",
  387. "packedBubbleNegativeValueDisplay.trueLabel": "Show bubbles",
  388. "propertyPresentation.advanced.axisSizeProperties.description": "Axis size properties.",
  389. "propertyPresentation.advanced.axisSizeProperties.label": "Axis size",
  390. "propertyPresentation.advanced.clientBehaviorProperties.description": "Client side properties.",
  391. "propertyPresentation.advanced.clientBehaviorProperties.label": "Client behavior",
  392. "propertyPresentation.advanced.commonProperties.description": "Common properties.",
  393. "propertyPresentation.advanced.commonProperties.label": "Common",
  394. "propertyPresentation.advanced.description": "Advanced list of all properties in a grouped structure.",
  395. "propertyPresentation.advanced.label": "Advanced",
  396. "propertyPresentation.advanced.labelProperties.description": "Label properties",
  397. "propertyPresentation.advanced.labelProperties.label": "Label",
  398. "propertyPresentation.advanced.legendProperties.description": "Legend properties.",
  399. "propertyPresentation.advanced.legendProperties.label": "Legend",
  400. "propertyPresentation.advanced.xAxisProperties.description": "X-axis properties.",
  401. "propertyPresentation.advanced.xAxisProperties.label": "X-axis",
  402. "propertyPresentation.advanced.yAxisProperties.description": "Y-axis properties.",
  403. "propertyPresentation.advanced.yAxisProperties.label": "Y-axis",
  404. "propertyPresentation.simple.description": "Simple list of the most common properties.",
  405. "propertyPresentation.simple.label": "Simple",
  406. "rave2.colorpalette.blueContinuousSequential.description": "Blue continuous sequential description",
  407. "rave2.colorpalette.blueContinuousSequential.label": "Blue continuous sequential",
  408. "rave2.colorpalette.blueDiscreteSequential.description": "Blue discrete sequential description",
  409. "rave2.colorpalette.blueDiscreteSequential.label": "Blue discrete sequential",
  410. "rave2.colorpalette.blueGreenContinuousDivergent.description": "Blue green continuous divergent description",
  411. "rave2.colorpalette.blueGreenContinuousDivergent.label": "Blue green continuous divergent",
  412. "rave2.colorpalette.blueGreenDiscreteDivergent.description": "Blue green discrete divergent description",
  413. "rave2.colorpalette.blueGreenDiscreteDivergent.label": "Blue green discrete divergent",
  414. "rave2.colorpalette.dark.description": "Dark description",
  415. "rave2.colorpalette.dark.label": "Dark",
  416. "rave2.colorpalette.financial.description": "Financial description",
  417. "rave2.colorpalette.financial.label": "Financial",
  418. "rave2.colorpalette.greenContinuousSequential.description": "Green continuous sequential description",
  419. "rave2.colorpalette.greenContinuousSequential.label": "Green continuous sequential",
  420. "rave2.colorpalette.greenDiscreteSequential.description": "Green discrete sequential description",
  421. "rave2.colorpalette.greenDiscreteSequential.label": "Green discrete sequential",
  422. "rave2.colorpalette.light.description": "Light description",
  423. "rave2.colorpalette.light.label": "Light",
  424. "rave2.colorpalette.medical.description": "Medical description",
  425. "rave2.colorpalette.medical.label": "Medical",
  426. "rave2.colorpalette.orangeContinuousSequential.description": "Orange continuous sequential description",
  427. "rave2.colorpalette.orangeContinuousSequential.label": "Orange continuous sequential",
  428. "rave2.colorpalette.orangeDiscreteSequential.description": "Orange discrete sequential description",
  429. "rave2.colorpalette.orangeDiscreteSequential.label": " Orange discrete sequential",
  430. "rave2.colorpalette.purpleContinuousSequential.description": "Purple continuous sequential description",
  431. "rave2.colorpalette.purpleContinuousSequential.label": "Purple continuous sequential",
  432. "rave2.colorpalette.purpleDiscreteSequential.description": "Purple discrete sequential description",
  433. "rave2.colorpalette.purpleDiscreteSequential.label": "Purple discrete sequential",
  434. "rave2.colorpalette.redBlueContinuousDivergent.description": "Red blue continuous divergent description",
  435. "rave2.colorpalette.redBlueContinuousDivergent.label": "Red blue continuous divergent",
  436. "rave2.colorpalette.redBlueDiscreteDivergent.description": "Red blue discrete divergent description",
  437. "rave2.colorpalette.redBlueDiscreteDivergent.label": "Red blue discrete divergent",
  438. "rave2.colorpalette.redBlueInverseContinuousDivergent.description": "Red blue inverse continuous divergent description",
  439. "rave2.colorpalette.redBlueInverseContinuousDivergent.label": "Red blue inverse continuous divergent",
  440. "rave2.colorpalette.redBlueInverseDiscreteDivergent.description": "Red blue inverse discrete divergent description",
  441. "rave2.colorpalette.redBlueInverseDiscreteDivergent.label": "Red blue inverse discrete divergent",
  442. "rave2.colorpalette.redContinuousSequential.description": "Red continuous sequential description",
  443. "rave2.colorpalette.redContinuousSequential.label": "Red continuous sequential",
  444. "rave2.colorpalette.redDiscreteSequential.description": "Red discrete sequential description",
  445. "rave2.colorpalette.redDiscreteSequential.label": " Red discrete sequential",
  446. "rave2.colorpalette.redGreenContinuousDivergent.description": "Red green continuous divergent description",
  447. "rave2.colorpalette.redGreenContinuousDivergent.label": "Red green continuous divergent",
  448. "rave2.colorpalette.redGreenDiscreteDivergent.description": "Red green discrete divergent description",
  449. "rave2.colorpalette.redGreenDiscreteDivergent.label": "Red green discrete divergent",
  450. "rave2.colorpalette.redGreenInverseContinuousDivergent.description": "Red green inverse continuous divergent description",
  451. "rave2.colorpalette.redGreenInverseContinuousDivergent.label": "Red green inverse continuous divergent",
  452. "rave2.colorpalette.redGreenInverseDiscreteDivergent.description": "Red green inverse discrete divergent description",
  453. "rave2.colorpalette.redGreenInverseDiscreteDivergent.label": "Red green inverse discrete divergent",
  454. "rave2.colorpalette.tealContinuousSequential.description": "Teal continuous sequential description",
  455. "rave2.colorpalette.tealContinuousSequential.label": "Teal continuous sequential",
  456. "rave2.colorpalette.tealDiscreteSequential.description": "Teal discrete sequential description",
  457. "rave2.colorpalette.tealDiscreteSequential.label": "Teal discrete sequential",
  458. "rave2.colorpalette.tealPurpleContinuousDivergent.description": "Teal purple continuous divergent description",
  459. "rave2.colorpalette.tealPurpleContinuousDivergent.label": "Teal purple continuous divergent",
  460. "rave2.colorpalette.tealPurpleDiscreteDivergent.description": "Teal purple discrete divergent description",
  461. "rave2.colorpalette.tealPurpleDiscreteDivergent.label": "Teal purple discrete divergent",
  462. "rave2.colorpalette.violetContinuousSequential.description": "Violet continuous sequential description",
  463. "rave2.colorpalette.violetContinuousSequential.label": "Violet continuous sequential",
  464. "rave2.colorpalette.violetDiscreteSequential.description": "Violet discrete sequential description",
  465. "rave2.colorpalette.violetDiscreteSequential.label": "Violet discrete sequential",
  466. "rave2.colorpalette.yellowContinuousSequential.description": "Yellow continuous sequential description",
  467. "rave2.colorpalette.yellowContinuousSequential.label": "Yellow continuous sequential",
  468. "rave2.colorpalette.yellowDiscreteSequential.description": "Yellow discrete sequential description",
  469. "rave2.colorpalette.yellowDiscreteSequential.label": "Yellow discrete sequential",
  470. "shadow.display.description": "Displays a shadow for each bubble.",
  471. "shadow.display.name": "Shadow display",
  472. "shadow.style.description": "The shadow style to apply to the bubbles when the Shadow display property is set to Yes.",
  473. "shadow.style.name": "Shadow style",
  474. "sizescale.first.description": "The size (glyph area in square pixels) of the bubble that is used for the smallest data value. The size can be larger than the Biggest data value bubble size property. In this case, the scale is reversed.",
  475. "sizescale.first.name": "Smallest data value bubble size",
  476. "sizescale.second.description": "The size (glyph area in square pixels) of the bubble that is used for the biggest data value. The size can be smaller than the Smallest data value bubble size property. In this case, the scale is reversed.",
  477. "sizescale.second.name": "Biggest data value bubble size",
  478. "symbol.borderColor.description": "The color that is applied to the bubble borders.",
  479. "symbol.borderColor.name": "Bubble border color",
  480. "symbol.borderWidth.description": "The width of the bubble borders.",
  481. "symbol.borderWidth.name": "Bubble border width",
  482. "symbolShape.description": "The shape that is used for the bubbles.",
  483. "symbolShape.name": "Bubble shape",
  484. "symbolShape.options.circle": "Circle",
  485. "symbolShape.options.cross": "Cross",
  486. "symbolShape.options.diamond": "Diamond",
  487. "symbolShape.options.donut": "Donut",
  488. "symbolShape.options.donut-plus": "Donut-plus",
  489. "symbolShape.options.horizontal-rectangle": "Horizontal rectangle",
  490. "symbolShape.options.rectangle": "Rectangle",
  491. "symbolShape.options.square": "Square",
  492. "symbolShape.options.star": "Star",
  493. "symbolShape.options.triangle-down": "Triangle down",
  494. "symbolShape.options.triangle-left": "Triangle left",
  495. "symbolShape.options.triangle-right": "Triangle right",
  496. "symbolShape.options.triangle-up": "Triangle up",
  497. "symbolShape.options.vertical-rectangle": "Vertical rectangle",
  498. "transpose.description": "When set to Yes, the Y-axis shows the independent scale and the X-axis shows the dependent scale.",
  499. "transpose.falseLabel": "Do not transpose",
  500. "transpose.name": "Switch X and Y axes",
  501. "transpose.trueLabel": "Transpose",
  502. "zoom.description": "Zooms the chart in the X, Y, or both directions.",
  503. "zoom.name": "Zoom",
  504. "zoom.options.both": "Both",
  505. "zoom.options.none": "None",
  506. "zoom.options.x": "X",
  507. "zoom.options.y": "Y"
  508. }
  509. },{}],3:[function(require,module,exports){
  510. (function() {
  511. var $ = {};
  512. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModuleHeader
  513. /************************************************************************
  514. ** IBM Confidential
  515. **
  516. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  517. **
  518. ** (C) Copyright IBM Corp. 2015
  519. **
  520. ** The source code for this program is not published or otherwise divested of its trade secrets,
  521. ** irrespective of what has been deposited with the U.S. Copyright Office.
  522. ************************************************************************/
  523. var com_ibm_rave_library_Library = rave["library"];
  524. rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
  525. rave["internal"]["CSSUtil"]= rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
  526. // $source: com/ibm/rave/bundles/RaveBundle
  527. /************************************************************************
  528. ** IBM Confidential
  529. **
  530. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  531. **
  532. ** (C) Copyright IBM Corp. 2017
  533. **
  534. ** The source code for this program is not published or otherwise divested of its trade secrets,
  535. ** irrespective of what has been deposited with the U.S. Copyright Office.
  536. ************************************************************************/
  537. // GENERATED
  538. //@import com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader (runtime) // new
  539. /**
  540. * A RaveBundle extends the regular Bundle abstract class but includes common functionality for Rave-made bundles that aren't for general use.
  541. */
  542. var com_ibm_rave_bundles_RaveBundle = rave['internal']['Declare'](rave['library']['internal']['Bundle'], {
  543. /** @expose */
  544. loader : null,
  545. /** @expose */
  546. constructor : function() {
  547. ;
  548. ;
  549. ;
  550. ;
  551. ;
  552. ;
  553. this.loader = new com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader("/com/ibm/rave/bundles/" + this.getName());
  554. },
  555. /**
  556. * Load extra resources required for this bundle. Currently the compiled configuration.json file. And .css.
  557. */
  558. /** @expose */
  559. loadResources : function() {
  560. this.setMessageCatalog(rave['library']['internal']['Bundle'].DEFAULT_LOCALE, require("./i18n/messages_en.json"));
  561. var array = require("./configuration/configuration.json");
  562. if (array) {
  563. for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
  564. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  565. var artifact = __exp_enFor0[__i_enFor0];
  566. this.initialize(artifact);
  567. }
  568. }
  569. require("./vizlibrary.css");
  570. }
  571. });
  572. //com_ibm_rave_bundles_RaveBundle.CONFIGURATION_FILE = "./configuration/configuration.json";
  573. // $source: com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader
  574. // Intentionally empty - everything in this file is inlined
  575. var com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader = function(){};
  576. // $source: com/ibm/rave/bundles/views/BundleView
  577. /************************************************************************
  578. ** IBM Confidential
  579. **
  580. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  581. **
  582. ** (C) Copyright IBM Corp. 2017
  583. **
  584. ** The source code for this program is not published or otherwise divested of its trade secrets,
  585. ** irrespective of what has been deposited with the U.S. Copyright Office.
  586. ************************************************************************/
  587. // GENERATED
  588. //@import com/ibm/rave/bundles/components/BackgroundComponentImpl (runtime) // new
  589. //@import com/ibm/rave/bundles/components/ChartLayoutComponentImpl (runtime) // new
  590. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  591. //@import com/ibm/rave/bundles/components/LegendsManager (runtime) // new
  592. //@import com/ibm/rave/bundles/components/AxesManager (runtime) // new
  593. //@import com/ibm/rave/library/Library (runtime) // Library
  594. //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities
  595. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
  596. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  597. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  598. var com_ibm_rave_bundles_views_BundleView = rave['internal']['Declare'](rave['library']['internal']['AbstractView'], {
  599. /**
  600. * Background component
  601. */
  602. /** @expose */
  603. _backgroundComponent : null,
  604. /**
  605. * Layout component
  606. */
  607. /** @expose */
  608. _layoutComponent : null,
  609. /**
  610. * Clip component
  611. */
  612. /** @expose */
  613. _clip : null,
  614. /**
  615. * Axes manager
  616. */
  617. /** @expose */
  618. _axes : null,
  619. /**
  620. * Legends manager
  621. */
  622. /** @expose */
  623. _legends : null,
  624. //_groupStructure : null,
  625. /** @expose */
  626. _chart : null,
  627. /** @expose */
  628. dataModel : null,
  629. /** @expose */
  630. _zoomP : null,
  631. /** @expose */
  632. _zoomS : null,
  633. /** @expose */
  634. constructor : function(context) {
  635. },
  636. /** @expose */
  637. getGroupStructure : function() {},
  638. /** @expose */
  639. setup : function() {
  640. rave['library']['internal']['AbstractView'].prototype.setup.call(this);
  641. this._backgroundComponent = new com_ibm_rave_bundles_components_BackgroundComponentImpl();
  642. this._layoutComponent = new com_ibm_rave_bundles_components_ChartLayoutComponentImpl();
  643. this._clip = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this.context.instanceId() + "clipViewport");
  644. if (this.isZoomSupported()) {
  645. this.resetZoom();
  646. }
  647. this._legends = new com_ibm_rave_bundles_components_LegendsManager(this.context, this.getLegendCount());
  648. if (this.isAxesManagerRequired()) {
  649. this._axes = new com_ibm_rave_bundles_components_AxesManager(this.context);
  650. }
  651. this._groupStructure = this.getGroupStructure();
  652. },
  653. /** @expose */
  654. preDraw : function(chartId) {
  655. this.cancelTransitions();
  656. rave['library']['internal']['AbstractView'].createGroupStructure(this.context.node, this._groupStructure);
  657. this._chart = this.context.node.selectAll(chartId);
  658. },
  659. /** @expose */
  660. resetZoom : function() {
  661. this._zoomP = [0, 0, 0, 0];
  662. this._zoomS = [1, 1, 1, 1];
  663. },
  664. /** @expose */
  665. validateDataModel : function(elementsToRemove) {
  666. if (elementsToRemove !== null || arguments.length > 1){
  667. elementsToRemove = Array.prototype.slice.call(arguments);
  668. }
  669. {
  670. this.dataModel = this.context.dataModel();
  671. if (!(this.dataValid())) {
  672. for (var __i_enFor0 = 0, __len_enFor0 = elementsToRemove.length;
  673. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  674. var e = elementsToRemove[__i_enFor0];
  675. this._chart.selectAll(e).selectAll("*").remove();
  676. }
  677. this._legends.visible(false).draw();
  678. return false;
  679. }
  680. return true;
  681. }
  682. },
  683. /** @expose */
  684. dataValid : function() {
  685. return this.dataModel.validate();
  686. },
  687. /** @expose */
  688. getLegendCount : function() {
  689. return 1;
  690. },
  691. /** @expose */
  692. isAxesManagerRequired : function() {
  693. return false;
  694. },
  695. /** @expose */
  696. isZoomSupported : function() {
  697. return true;
  698. },
  699. /** @expose */
  700. getProperty : function(s) {
  701. return this.context.getPropertyValue(s);
  702. },
  703. /** @expose */
  704. getPropertyDefault : function(s) {
  705. return this.context.getPropertyDefault(s);
  706. },
  707. /** @expose */
  708. getBooleanProperty : function(s) {
  709. var obj = this.getProperty(s);
  710. return (obj);
  711. },
  712. /** @expose */
  713. getDoubleProperty : function(s) {
  714. var obj = this.getProperty(s);
  715. return + (obj);
  716. },
  717. /** @expose */
  718. getIntProperty : function(s) {
  719. var obj = this.getProperty(s);
  720. return ~~ (obj);
  721. },
  722. /**
  723. * @param (String) id Property ID
  724. * @return (String) Property value as a string
  725. */
  726. /** @expose */
  727. getStringProperty : function(id) {
  728. var obj = this.getProperty(id);
  729. return (obj == null) ? null : ""+(obj);
  730. },
  731. /**
  732. * @param (String) id Property ID
  733. * @return (String) Property value as a string, returning null for the empty string
  734. */
  735. /** @expose */
  736. getStringPropertyEmptyAsNull : function(id) {
  737. var s = this.getStringProperty(id);
  738. return (s == null || s.length == 0) ? null : s;
  739. },
  740. /**
  741. * @param (String) id Property ID
  742. * @return (Number) Property value as a string, containing size as the number of pixels
  743. */
  744. /** @expose */
  745. getCSSSizeToPixelNumber : function(id) {
  746. var cssSize = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.context.getPropertyValue(id), 100.0, 10.0);
  747. return (cssSize == null) ? 0.0 : cssSize;
  748. },
  749. /**
  750. * Based on effect duration and effect property, determine the effect duration in ms.
  751. * @param (String) effect Effect name, one of the options available from EFFECT_OPTIONS.
  752. * @return (int) Effect duration in ms.
  753. */
  754. /** @expose */
  755. getEffectDuration : function(effect) {
  756. var duration = this.getIntProperty("effect.duration");
  757. if ((duration < 0) || (effect == null) || "none" == effect) {
  758. duration = 0;
  759. }
  760. return duration;
  761. },
  762. /** @expose */
  763. getTopPadding : function() {
  764. return this.getProperty("layout.chart.padding.top");
  765. },
  766. /** @expose */
  767. getLeftPadding : function() {
  768. return this.getProperty("layout.chart.padding.left");
  769. },
  770. /** @expose */
  771. getBottomPadding : function() {
  772. return this.getProperty("layout.chart.padding.bottom");
  773. },
  774. /** @expose */
  775. getRightPadding : function() {
  776. return this.getProperty("layout.chart.padding.right");
  777. },
  778. /** @expose */
  779. getLayoutPadding : function() {
  780. return this.getProperty("layout.padding");
  781. },
  782. /** @expose */
  783. getLegendChartGap : function() {
  784. return this.getProperty("layout.legendchart.gap");
  785. },
  786. /** @expose */
  787. getLegendChartAlign : function() {
  788. return this.getBooleanProperty("layout.legendchart.align");
  789. },
  790. /** @expose */
  791. getLegendPosition : function() {
  792. return this.getStringProperty("legend.position");
  793. },
  794. getPalette$0 : function() {
  795. return this.getPalette$1("color.palette");
  796. },
  797. getPalette$1 : function(paletteID) {
  798. var id = this.getStringProperty(paletteID);
  799. var colorPalette = com_ibm_rave_library_Library.palettes.getPalette(id);
  800. return (!colorPalette) ? com_ibm_rave_library_Library.palettes.getDefaultPalette() : colorPalette;
  801. },
  802. getDynamicPalette$0 : function() {
  803. return this.getDynamicPalette$1("color.palette", "color.dynamicPalette.min", "color.dynamicPalette.mid", "color.dynamicPalette.max");
  804. },
  805. /**
  806. * 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.
  807. * @param (String) paletteID The palette ID
  808. * @return (rave['library']['internal']['Palette']) Palette
  809. */
  810. getDynamicPalette$1 : function(paletteID, minId, midId, maxId) {
  811. var colorPalette;
  812. var min = this.getStringProperty(minId);
  813. if (min != null) {
  814. var mid = this.getStringProperty(midId);
  815. if (mid != null) {
  816. var max = this.getStringProperty(maxId);
  817. if (max != null) {
  818. var fills = [min, mid, max];
  819. colorPalette = rave['library']['internal']['AbstractView'].getFillPalette(fills);
  820. }
  821. }
  822. }
  823. return (!colorPalette) ? this.getPalette(paletteID) : colorPalette;
  824. },
  825. /** @expose */
  826. prepareLayoutComponent : function() {
  827. 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());
  828. },
  829. /** @expose */
  830. prepareLayoutSizables : function(layoutComponent, useX2, useY1, useX1, useY2, useLegend) {
  831. layoutComponent.removeAxisSizables();
  832. if (useX1) {
  833. layoutComponent.addAxisSizable(this._axes.axisComponent(0));
  834. }
  835. if (useY1) {
  836. layoutComponent.addAxisSizable(this._axes.axisComponent(2));
  837. }
  838. if (useX2) {
  839. layoutComponent.addAxisSizable(this._axes.axisComponent(1));
  840. }
  841. if (useY2) {
  842. layoutComponent.addAxisSizable(this._axes.axisComponent(3));
  843. }
  844. layoutComponent.legendSize(useLegend ? this._legends : null);
  845. },
  846. /** @expose */
  847. resetUpdate : function() {
  848. this.updateType = 4;
  849. },
  850. /** @expose */
  851. isUpdateNothing : function() {
  852. return this.updateType == 4;
  853. },
  854. /** @expose */
  855. isShowLegend : function() {
  856. return this.getBooleanProperty("legend.display");
  857. },
  858. cancelTransitions : function() {
  859. this.context.node.selectAll("*").interrupt();
  860. },
  861. /** @expose */
  862. setBackgroundProperties : function(elementRect, duration) {
  863. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).size(this.context.size).backgroundColor(this.getStringProperty("background.chart.color"));
  864. this.context.node.selectAll("rect.background.chart").transition().duration(duration).call(this._backgroundComponent);
  865. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(elementRect).backgroundColor(this.getStringProperty("background.elements.color"));
  866. this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
  867. },
  868. /** @expose */
  869. isShowDataLabels : function() {
  870. return this.getBooleanProperty("data.label.display");
  871. },
  872. /** @expose */
  873. isShowDataLabelsAsPercentageOfColor : function() {
  874. var dataLabel = this.getStringProperty("data.label.type");
  875. return "PercentOfColor" == dataLabel;
  876. },
  877. /** @expose */
  878. isShowDataLabelsAsPercentageOfCategory : function() {
  879. var dataLabel = this.getStringProperty("data.label.type");
  880. return "PercentOfCategory" == dataLabel;
  881. },
  882. /** @expose */
  883. getlDataLabelAccessor : function(dataSet, slot, isInterval) {
  884. var labelAccessor;
  885. var labelEntry = dataSet.slot(slot).entry();
  886. if (!labelEntry) {
  887. if (this.isShowDataLabelsAsPercentageOfCategory()) {
  888. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR;
  889. } else if (this.isShowDataLabelsAsPercentageOfColor()) {
  890. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR;
  891. } else {
  892. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR;
  893. }
  894. } else {
  895. labelAccessor = rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelEntry));
  896. }
  897. return labelAccessor;
  898. },
  899. /** @expose */
  900. getEntryForDataLabelFormatter : function(dataSet, labelSlot, defaultSlot) {
  901. var labelEntry = dataSet.slot(labelSlot).entry();
  902. return labelEntry ? labelEntry : dataSet.slot(defaultSlot).entry();
  903. },
  904. /** @expose */
  905. getBackgroundConstrastLabelStyle : function() {
  906. var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
  907. if (this.getBooleanProperty("contrast.label.color") == false) {
  908. return labelFontStyle;
  909. }
  910. var defaultFillColor;
  911. if (labelFontStyle) {
  912. defaultFillColor = labelFontStyle["fill"];
  913. if (defaultFillColor == null) {
  914. defaultFillColor = labelFontStyle["color"];
  915. }
  916. } else {
  917. labelFontStyle = {};
  918. }
  919. if (defaultFillColor == null) {
  920. defaultFillColor = "#000000";
  921. }
  922. labelFontStyle["fill"] = com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(this.getStringProperty("background.elements.color"), defaultFillColor);
  923. return labelFontStyle;
  924. },
  925. /** @expose */
  926. getPalette : function(a0) {
  927. var args = arguments;
  928. if (args.length == 0) {
  929. return this.getPalette$0();
  930. }
  931. if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
  932. return this.getPalette$1(a0);
  933. }
  934. return rave['library']['internal']['AbstractView'].prototype.getPalette.apply(this, args);
  935. },
  936. /** @expose */
  937. getDynamicPalette : function(a0, a1, a2, a3) {
  938. var args = arguments;
  939. if (args.length == 0) {
  940. return this.getDynamicPalette$0();
  941. }
  942. return this.getDynamicPalette$1(a0, a1, a2, a3);
  943. }
  944. });
  945. // $source: com/ibm/rave/bundles/components/BundleComponentImpl
  946. /************************************************************************
  947. ** IBM Confidential
  948. **
  949. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  950. **
  951. ** (C) Copyright IBM Corp. 2017
  952. **
  953. ** The source code for this program is not published or otherwise divested of its trade secrets,
  954. ** irrespective of what has been deposited with the U.S. Copyright Office.
  955. ************************************************************************/
  956. // GENERATED
  957. var com_ibm_rave_bundles_components_BundleComponentImpl = rave['internal']['Declare']({
  958. /**
  959. * The pre-execution callback.
  960. */
  961. //_preExecuteCallback : null,
  962. /**
  963. * The render callback.
  964. */
  965. /** @expose */
  966. _renderCallback : null,
  967. _$functionClassMethod : function() {
  968. var _$self = function(args) {
  969. if (args !== null || arguments.length > 1){
  970. args = Array.prototype.slice.call(arguments, 0);
  971. }
  972. {
  973. var self = _$self;
  974. this.each(function(data, index, groupIndex) {
  975. self.execute(rave.select(this));
  976. });
  977. return null;
  978. }
  979. };
  980. return _$self;
  981. },
  982. /**
  983. * 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.
  984. * @param (rave['internal']['Selector']) g <g> node that this component will be applied to.
  985. */
  986. /** @expose */
  987. execute : function(g) {},
  988. /**
  989. * Set the pre-execute callback for this component.
  990. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  991. */
  992. /** @expose */
  993. setPreExecute : function(callback) {
  994. this._preExecuteCallback = callback;
  995. return this;
  996. },
  997. /**
  998. * If the pre-execute component is non-null, call it with this object. Note that this object must also implement BundleComponent.
  999. */
  1000. /** @expose */
  1001. preExecute : function() {
  1002. if (this._preExecuteCallback) {
  1003. this._preExecuteCallback(this);
  1004. }
  1005. },
  1006. /**
  1007. * Set the render callback for this component.
  1008. * @param (rave['internal']['RunFunction']) callback The callback
  1009. */
  1010. /** @expose */
  1011. setRenderCallback : function(callback) {
  1012. this._renderCallback = callback;
  1013. return this;
  1014. },
  1015. /**
  1016. * 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.
  1017. */
  1018. /** @expose */
  1019. type : function() {},
  1020. /** @expose */
  1021. updateBorder : function(s, borderWidth, borderColor) {
  1022. if (borderWidth != null) {
  1023. s.each(function(data, index, groupIndex) {
  1024. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  1025. this.rave_setStyle("stroke-width", borderWidth, "");
  1026. }
  1027. });
  1028. }
  1029. if (borderColor != null) {
  1030. s.each(function(data, index, groupIndex) {
  1031. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  1032. this.rave_setStyle("stroke", borderColor, "");
  1033. }
  1034. });
  1035. }
  1036. },
  1037. /** @expose */
  1038. getDefaultLabelColor : function(_labelStyle) {
  1039. if (!_labelStyle) {
  1040. return "#000000";
  1041. }
  1042. var defaultFillColor;
  1043. if (_labelStyle) {
  1044. defaultFillColor = _labelStyle["fill"];
  1045. if (defaultFillColor == null) {
  1046. defaultFillColor = _labelStyle["color"];
  1047. }
  1048. }
  1049. if (defaultFillColor == null) {
  1050. defaultFillColor = "#000000";
  1051. }
  1052. return defaultFillColor.toString();
  1053. }
  1054. });
  1055. // $source: com/ibm/rave/bundles/component/BackgroundComponent
  1056. /************************************************************************
  1057. ** IBM Confidential
  1058. **
  1059. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1060. **
  1061. ** (C) Copyright IBM Corp. 2017
  1062. **
  1063. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1064. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1065. ************************************************************************/
  1066. // GENERATED
  1067. /**
  1068. * <p> A component that renders the background to the chart. The {@link #this.type()} method returns "BackgroundComponent". </p>
  1069. */
  1070. var com_ibm_rave_bundles_component_BackgroundComponent = rave['internal']['Declare'].implement(
  1071. /**
  1072. * Get the background color.
  1073. * @return (String) The background color
  1074. */
  1075. //backgroundColor : function() {},
  1076. /**
  1077. * Set the background color. If the color is null, white is used.
  1078. * @param (String) backgroundColor The new background color
  1079. * @return (com.ibm.rave.bundles.component.BackgroundComponent) This object
  1080. */
  1081. //backgroundColor : function(backgroundColor) {}
  1082. );
  1083. /**
  1084. * The string returned by {@link #this.type()} is "BackgroundComponent".
  1085. */
  1086. /** @expose */
  1087. com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE = "BackgroundComponent";
  1088. // $source: com/ibm/rave/bundles/component/ChartLayoutComponent
  1089. /************************************************************************
  1090. ** IBM Confidential
  1091. **
  1092. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1093. **
  1094. ** (C) Copyright IBM Corp. 2017
  1095. **
  1096. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1097. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1098. ************************************************************************/
  1099. // GENERATED
  1100. /**
  1101. * <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>
  1102. */
  1103. var com_ibm_rave_bundles_component_ChartLayoutComponent = rave['internal']['Declare'].implement(
  1104. //padding : function() {},
  1105. //topPadding : function() {},
  1106. //leftPadding : function() {},
  1107. //bottomPadding : function() {},
  1108. //rightPadding : function() {},
  1109. //legendChartAlign : function() {},
  1110. //legendPosition : function() {},
  1111. //legendChartGap : function() {},
  1112. //legendPosition : function(position) {},
  1113. //topPadding : function(value) {},
  1114. //leftPadding : function(value) {},
  1115. //bottomPadding : function(value) {},
  1116. //rightPadding : function(value) {},
  1117. /**
  1118. * Sets the padding around the outside of the chart/legend.
  1119. * @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.
  1120. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1121. */
  1122. //padding : function(value) {},
  1123. /**
  1124. * Sets all chart paddings. Null values are treated as 0.
  1125. * @param (Object) top New top padding
  1126. * @param (Object) left New left padding
  1127. * @param (Object) bottom New bottom padding
  1128. * @param (Object) right New right padding
  1129. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1130. * @deprecated Please use {@link #this.padding(Object)} and {@link #this.legendChartGap(Object)}
  1131. */
  1132. //chartPadding : function(top, left, bottom, right) {},
  1133. /**
  1134. * Sets whether the legend should align with the chart "body".
  1135. * @param (boolean) legendChartAlign the boolean state
  1136. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1137. */
  1138. //legendChartAlign : function(legendChartAlign) {},
  1139. /**
  1140. * Set the space for the gap between chart and legend
  1141. * @param (Object) value the gap distance (css length)
  1142. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1143. */
  1144. //legendChartGap : function(value) {},
  1145. /**
  1146. * Set the size information for the legend. Null value is treated as no visible legend.
  1147. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1148. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1149. */
  1150. //legendSize : function(sizable) {},
  1151. /**
  1152. * Reset list of axis sizables to 0
  1153. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1154. */
  1155. //removeAxisSizables : function() {},
  1156. /**
  1157. * Add an axis to be considered in layout operation.
  1158. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1159. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1160. */
  1161. //addAxisSizable : function(sizable) {}
  1162. );
  1163. /**
  1164. * The string returned by {@link #this.type()} is "ChartLayoutComponent".
  1165. */
  1166. /** @expose */
  1167. com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE = "ChartLayoutComponent";
  1168. // $source: com/ibm/rave/bundles/components/LegendsManager
  1169. /************************************************************************
  1170. ** IBM Confidential
  1171. **
  1172. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1173. **
  1174. ** (C) Copyright IBM Corp. 2017
  1175. **
  1176. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1177. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1178. ************************************************************************/
  1179. // GENERATED
  1180. //@import com/ibm/rave/bundles/components/LegendComponentImpl (runtime) // new, orientationOf
  1181. /**
  1182. * <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 &lt;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 (&lt;g&gt; 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 &lt;g&gt; 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>
  1183. */
  1184. var com_ibm_rave_bundles_components_LegendsManager = rave['internal']['Declare']({
  1185. /**
  1186. * Bundle context
  1187. */
  1188. //_context : null,
  1189. /**
  1190. * Component used to draw all legends
  1191. */
  1192. //_comp : null,
  1193. /**
  1194. * Global visibility; if false no legends are drawn
  1195. */
  1196. //_visible : null,
  1197. /**
  1198. * Rectangle containing all legends
  1199. */
  1200. //_rectangle : null,
  1201. /**
  1202. * Legend orientation
  1203. */
  1204. //_orient : null,
  1205. /**
  1206. * Pre-execute component callback
  1207. */
  1208. //_preExecute : null,
  1209. /**
  1210. * Selectors for each legend
  1211. */
  1212. //_selectors : null,
  1213. /**
  1214. * Palettes for each legend
  1215. */
  1216. //_palettes : null,
  1217. /**
  1218. * Scale size functions for each legend
  1219. */
  1220. //_scale : null,
  1221. /**
  1222. * Swatch size functions for each legend
  1223. */
  1224. //_swatchSizes : null,
  1225. /**
  1226. * Shapes for each legend
  1227. */
  1228. //_shapes : null,
  1229. /**
  1230. * Titles for each legend
  1231. */
  1232. //_titles : null,
  1233. /**
  1234. * Title fonts for each legend
  1235. */
  1236. //_titleFonts : null,
  1237. /**
  1238. * Title fills for each legend
  1239. */
  1240. //_titleFills : null,
  1241. /**
  1242. * Title font sizes for each legend
  1243. */
  1244. //_titleFontSizes : null,
  1245. /**
  1246. * Title font families for each legend
  1247. */
  1248. //_titleFontFamilies : null,
  1249. /**
  1250. * Entry fonts for each legend
  1251. */
  1252. //_entryFonts : null,
  1253. /**
  1254. * Custom formatters for each legend, created from the registered custom formatters
  1255. */
  1256. //_formatters : null,
  1257. /**
  1258. * Whether each legend was visible in the last draw
  1259. */
  1260. //_lastVisible : null,
  1261. //_dataSlotEntries : null,
  1262. /**
  1263. * Number of legends
  1264. */
  1265. _numLegends : 0,
  1266. /**
  1267. * Whether to use a transition.
  1268. */
  1269. _doTransition : false,
  1270. /**
  1271. * Duration of the transition.
  1272. */
  1273. _duration : 0,
  1274. _spaceUsed : 0,
  1275. /**
  1276. * Construct the manager.
  1277. * @param (int) numLegends Number of legends, must be positive
  1278. */
  1279. /** @expose */
  1280. constructor : function(context, numLegends) {
  1281. this._context = context;
  1282. this._numLegends = numLegends;
  1283. this._comp = new com_ibm_rave_bundles_components_LegendComponentImpl();
  1284. this._rectangle = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1285. this._orient = "vertical";
  1286. this._preExecute = null;
  1287. this._selectors = [];
  1288. this._palettes = [];
  1289. this._scale = [];
  1290. this._swatchSizes = [];
  1291. this._shapes = [];
  1292. this._titles = [];
  1293. this._titleFonts = [];
  1294. this._titleFills = [];
  1295. this._titleFontSizes = [];
  1296. this._titleFontFamilies = [];
  1297. this._entryFonts = [];
  1298. this._formatters = [];
  1299. this._lastVisible = [];
  1300. this._visible = [];
  1301. this._dataSlotEntries = [];
  1302. for (var i = 0; i < this._numLegends; ++i) {
  1303. this._selectors[i] = null;
  1304. this._palettes[i] = null;
  1305. this._swatchSizes[i] = null;
  1306. this._shapes[i] = null;
  1307. this._titles[i] = null;
  1308. this._formatters[i] = null;
  1309. this._lastVisible[i] = false;
  1310. this._visible[i] = true;
  1311. }
  1312. },
  1313. /**
  1314. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) The legend component used by this manager; for unit tests
  1315. */
  1316. getLegendComponent : function() {
  1317. return this._comp;
  1318. },
  1319. /**
  1320. * Set a specific legend visible
  1321. * @param (int) legendIndex The index of the legend
  1322. * @param (boolean) visible New value of visible flag
  1323. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1324. */
  1325. visible$0 : function(legendIndex, visible) {
  1326. if (legendIndex < this._visible.length) {
  1327. this._visible[legendIndex] = visible;
  1328. }
  1329. return this;
  1330. },
  1331. /**
  1332. * Set all legend visible
  1333. * @param (boolean) visible New value of visible flag
  1334. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1335. */
  1336. visible$1 : function(visible) {
  1337. for (var i = 0; i < this._visible.length; ++i) {
  1338. this._visible[i] = visible;
  1339. }
  1340. return this;
  1341. },
  1342. /**
  1343. * Set the layout rectangle. The rectangle is copied. If it is null, the layout rectangle is unchanged.
  1344. * @param (rave['internal']['RectStruct']) rect New layout rectangle
  1345. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1346. */
  1347. /** @expose */
  1348. rectangle : function(rect) {
  1349. if (rect) {
  1350. this._rectangle = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  1351. }
  1352. return this;
  1353. },
  1354. /**
  1355. * Set the orient property. If the argument is not "horizontal" or "vertical", the orient property is not changed.
  1356. * @param (String) orient New orient
  1357. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1358. */
  1359. /** @expose */
  1360. orient : function(orient) {
  1361. if ("horizontal" == orient || "vertical" == orient) {
  1362. this._orient = orient;
  1363. }
  1364. return this;
  1365. },
  1366. /**
  1367. * 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".
  1368. * @param (String) position Legend position
  1369. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1370. */
  1371. /** @expose */
  1372. position : function(position) {
  1373. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  1374. },
  1375. /**
  1376. * Set the transition information. If the duration is negative, 0 is used.
  1377. * @param (boolean) doTransition Whether to do a transition
  1378. * @param (int) duration Duration of the transition when used
  1379. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1380. */
  1381. /** @expose */
  1382. transition : function(doTransition, duration) {
  1383. this._doTransition = doTransition;
  1384. this._duration = (duration >= 0) ? duration : 0;
  1385. return this;
  1386. },
  1387. /**
  1388. * Set the pre-execute callback for all legends. The callback may be null.
  1389. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  1390. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1391. */
  1392. /** @expose */
  1393. setPreExecute : function(callback) {
  1394. this._preExecute = callback;
  1395. return this;
  1396. },
  1397. /**
  1398. * Set the selector to be used when rendering a legend. If the index is out of range no selectors change.
  1399. * @param (int) index Legend array index
  1400. * @param (rave['internal']['Selector']) selector Selector, may be null (but this is not advisable)
  1401. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1402. */
  1403. /** @expose */
  1404. selector : function(index, selector) {
  1405. if (index >= 0 && index < this._numLegends) {
  1406. this._selectors[index] = selector;
  1407. }
  1408. return this;
  1409. },
  1410. /**
  1411. * Set the palette of a legend. If the index is out of range no information is changed.
  1412. * @param (int) index Legend array index
  1413. * @param (rave['library']['internal']['Palette']) palette Palette, may be null
  1414. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1415. */
  1416. /** @expose */
  1417. palette : function(index, palette) {
  1418. if (index >= 0 && index < this._numLegends) {
  1419. this._palettes[index] = palette;
  1420. }
  1421. return this;
  1422. },
  1423. /**
  1424. * Set the shape of a legend. If the index is out of range no information is changed.
  1425. * @param (int) index Legend array index
  1426. * @param (String) shape Shape, may be null (defaulting to square)
  1427. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1428. */
  1429. /** @expose */
  1430. shape : function(index, shape) {
  1431. if (index >= 0 && index < this._numLegends) {
  1432. this._shapes[index] = shape;
  1433. }
  1434. return this;
  1435. },
  1436. /**
  1437. * Set the title of a legend. If the index is out of range no information is changed.
  1438. * @param (int) index Legend array index
  1439. * @param (String) title Title, may be null
  1440. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1441. */
  1442. /** @expose */
  1443. title : function(index, title) {
  1444. if (index >= 0 && index < this._numLegends) {
  1445. this._titles[index] = title;
  1446. }
  1447. return this;
  1448. },
  1449. /**
  1450. * Set the title font style of a legend. If the index is out of range no information is changed.
  1451. * @param (int) index Legend array index
  1452. * @param (String) titleFont Title font string, may be null
  1453. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1454. */
  1455. /** @expose */
  1456. titleFont : function(index, titleFont) {
  1457. if (index >= 0 && index < this._numLegends) {
  1458. this._titleFonts[index] = titleFont;
  1459. }
  1460. return this;
  1461. },
  1462. /**
  1463. * Set the entry font style of a legend. If the index is out of range no information is changed.
  1464. * @param (int) index Legend array index
  1465. * @param (String) entryFont Entry font string, may be null
  1466. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1467. */
  1468. /** @expose */
  1469. entryFont : function(index, entryFont) {
  1470. if (index >= 0 && index < this._numLegends) {
  1471. this._entryFonts[index] = entryFont;
  1472. }
  1473. return this;
  1474. },
  1475. /**
  1476. * Set the title fill of a legend. If the index is out of range no information is changed.
  1477. * @param (int) index Legend array index
  1478. * @param (String) titleFill Fill color string, may be null
  1479. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1480. */
  1481. /** @expose */
  1482. titleFill : function(index, titleFill) {
  1483. if (index >= 0 && index < this._numLegends) {
  1484. this._titleFills[index] = titleFill;
  1485. }
  1486. return this;
  1487. },
  1488. /**
  1489. * Set the title font size of a legend. If the index is out of range no information is changed.
  1490. * @param (int) index Legend array index
  1491. * @param (String) titleFontSize Font size string, may be null
  1492. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1493. */
  1494. /** @expose */
  1495. titleFontSize : function(index, titleFontSize) {
  1496. if (index >= 0 && index < this._numLegends) {
  1497. this._titleFontSizes[index] = titleFontSize;
  1498. }
  1499. return this;
  1500. },
  1501. /**
  1502. * Set the title font family of a legend. If the index is out of range no information is changed.
  1503. * @param (int) index Legend array index
  1504. * @param (String) titleFontFamily Font family string, may be null
  1505. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1506. */
  1507. /** @expose */
  1508. titleFontFamily : function(index, titleFontFamily) {
  1509. if (index >= 0 && index < this._numLegends) {
  1510. this._titleFontFamilies[index] = titleFontFamily;
  1511. }
  1512. return this;
  1513. },
  1514. /**
  1515. * Set the scale of a legend. If the index is out of range no information is changed.
  1516. * @param (int) index Legend array index
  1517. * @param (rave['internal']['AbstractScale']) scale Scale, may be null
  1518. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1519. */
  1520. /** @expose */
  1521. scale : function(index, scale) {
  1522. if (index >= 0 && index < this._numLegends) {
  1523. this._scale[index] = scale;
  1524. }
  1525. return this;
  1526. },
  1527. /**
  1528. * Set the swatch size function of a legend. If the index is out of range no information is changed.
  1529. * @param (int) index Legend array index
  1530. * @param (rave['internal']['ValueFunction']) swatchSize Swatch size function, may be null
  1531. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1532. */
  1533. /** @expose */
  1534. swatchSize : function(index, swatchSize) {
  1535. if (index >= 0 && index < this._numLegends) {
  1536. this._swatchSizes[index] = swatchSize;
  1537. }
  1538. return this;
  1539. },
  1540. /**
  1541. * 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.
  1542. * @param (int) index Legend array index
  1543. * @param (Array) entries List of data slot entries, if null an empty list is used
  1544. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  1545. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined, may be null
  1546. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1547. */
  1548. /** @expose */
  1549. formatterList : function(index, entries, format, defaultFunction) {
  1550. if (index >= 0 && index < this._numLegends) {
  1551. this._formatters[index] = this._context.getCustomFormatterWithFlag(["legend", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("legend-label", "ROLE_NONE", format, entries), defaultFunction, false);
  1552. }
  1553. return this;
  1554. },
  1555. /**
  1556. * 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.
  1557. * @param (int) index Legend array index
  1558. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1559. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1560. */
  1561. /** @expose */
  1562. formatter : function(index, entry) {
  1563. var entries = [];
  1564. if (entry) {
  1565. entries.push(entry);
  1566. }
  1567. return this.formatterList(index, entries, "none", null);
  1568. },
  1569. /**
  1570. * 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.
  1571. * @return (boolean) Whether any legend are visible (will be drawn)
  1572. */
  1573. /** @expose */
  1574. anyVisible : function() {
  1575. for (var i = 0; i < this._numLegends; ++i) {
  1576. if (this._visible[i] == true && (this._palettes[i] || this._swatchSizes[i])) {
  1577. return true;
  1578. }
  1579. }
  1580. return false;
  1581. },
  1582. /**
  1583. * 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'])} .
  1584. * @param (int) index Legend array index
  1585. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1586. * @return (com.ibm.rave.bundles.components.LegendsManager) This LegendsManager
  1587. */
  1588. /** @expose */
  1589. setDataSlot : function(index, entry) {
  1590. if (index >= 0 && index < this._numLegends) {
  1591. this._dataSlotEntries[index] = entry;
  1592. }
  1593. return this.formatter(index, entry);
  1594. },
  1595. preLayout$0 : function(layoutComponent) {
  1596. this.preLayout$1(layoutComponent, true);
  1597. return this;
  1598. },
  1599. preLayout$1 : function(layoutComponent, axesBeforeLegend) {
  1600. var layoutTransition = this._doTransition;
  1601. var layoutDuration = this._duration;
  1602. this._doTransition = false;
  1603. this._duration = 0;
  1604. var children = [];
  1605. for (var i = 0; i < this._numLegends; ++i) {
  1606. children[i] = "g.layoutLegend-" + i;
  1607. }
  1608. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.legends-layout"), children);
  1609. var layoutSelectors = [];
  1610. var layoutLastVisible = [];
  1611. for (var i = 0; i < this._numLegends; ++i) {
  1612. layoutSelectors[i] = this._selectors[i];
  1613. layoutLastVisible[i] = this._lastVisible[i];
  1614. this._lastVisible[i] = false;
  1615. if (this._selectors[i]) {
  1616. this._selectors[i] = this._context.node.select("g.layoutLegend-" + i);
  1617. }
  1618. }
  1619. layoutComponent.preLayout(true, !axesBeforeLegend);
  1620. this.rectangle(layoutComponent.legendRect());
  1621. this.draw();
  1622. this._doTransition = layoutTransition;
  1623. this._duration = layoutDuration;
  1624. this._context.node.select("g.legends-layout").selectAll("*").remove();
  1625. for (var i = 0; i < this._numLegends; ++i) {
  1626. this._lastVisible[i] = layoutLastVisible[i];
  1627. this._selectors[i] = layoutSelectors[i];
  1628. }
  1629. return this;
  1630. },
  1631. /**
  1632. * Render the legends using the current global and per-legend settings.
  1633. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1634. */
  1635. /** @expose */
  1636. draw : function() {
  1637. var nVisible = 0;
  1638. for (var i = 0; i < this._numLegends; ++i) {
  1639. if ((this._swatchSizes[i] || this._palettes[i]) && this._visible[i]) {
  1640. nVisible++;
  1641. }
  1642. }
  1643. var x = this._rectangle.x;
  1644. var y = this._rectangle.y;
  1645. var dx;
  1646. var dy;
  1647. var size;
  1648. if (nVisible == 0) {
  1649. dx = 0;
  1650. dy = 0;
  1651. size = [this._rectangle.width, this._rectangle.height];
  1652. } else if ("horizontal" == this._orient) {
  1653. dx = this._rectangle.width / nVisible;
  1654. dy = 0;
  1655. size = [dx, this._rectangle.height];
  1656. } else {
  1657. dx = 0;
  1658. dy = this._rectangle.height / nVisible;
  1659. size = [this._rectangle.width, dy];
  1660. }
  1661. this._comp.orient(this._orient).size(size);
  1662. this._spaceUsed = 0;
  1663. for (var i = 0; i < this._numLegends; ++i) {
  1664. if (this._selectors[i]) {
  1665. var visible = this._visible[i] && (this._palettes[i] || this._swatchSizes[i]);
  1666. 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]);
  1667. var fontStyle = this._context.getPropertyValue("legend.titlestyle.font");
  1668. if (this._titleFonts[i] != null && !(this._titleFonts[i] == "")) {
  1669. this._comp.titleFont(this._titleFonts[i]);
  1670. } else if (fontStyle != null && !(fontStyle == "")) {
  1671. this._comp.titleFont(this._context.getPropertyValue("legend.titlestyle.font"));
  1672. }
  1673. fontStyle = this._context.getPropertyValue("legend.entrystyle.font");
  1674. if (this._entryFonts[i] != null) {
  1675. this._comp.entryFont(this._entryFonts[i]);
  1676. } else if (fontStyle != null && !(fontStyle == "")) {
  1677. this._comp.entryFont(this._context.getPropertyValue("legend.entrystyle.font"));
  1678. }
  1679. var s = (this._doTransition && this._lastVisible[i]) ? this._selectors[i].transition("transition").duration(this._duration) : this._selectors[i];
  1680. s.attr("transform", "translate(" + x + "," + y + ")").call(this._comp);
  1681. var dataSlotEntries = [];
  1682. if (this._dataSlotEntries[i]) {
  1683. dataSlotEntries.push(this._dataSlotEntries[i]);
  1684. }
  1685. this._selectors[i].selectAll(".legendTitle").property("dataSlots", dataSlotEntries);
  1686. if (visible) {
  1687. x += dx;
  1688. y += dy;
  1689. if (this._comp.getSpaceUsed() > this._spaceUsed) {
  1690. this._spaceUsed = this._comp.getSpaceUsed();
  1691. }
  1692. }
  1693. this._lastVisible[i] = visible;
  1694. } else {
  1695. this._lastVisible[i] = false;
  1696. }
  1697. }
  1698. return this;
  1699. },
  1700. /** @expose */
  1701. getSizableType : function() {
  1702. return 2;
  1703. },
  1704. /** @expose */
  1705. getSizableOrientation : function() {
  1706. return this._orient;
  1707. },
  1708. /** @expose */
  1709. getPreferredSize : function() {
  1710. return this._spaceUsed;
  1711. },
  1712. /** @expose */
  1713. getSpillOverSize : function() {
  1714. return 0;
  1715. },
  1716. /** @expose */
  1717. visible : function(a0, a1) {
  1718. var args = arguments;
  1719. if (args.length == 1) {
  1720. return this.visible$1(a0);
  1721. }
  1722. return this.visible$0(a0, a1);
  1723. },
  1724. /** @expose */
  1725. preLayout : function(a0, a1) {
  1726. var args = arguments;
  1727. if (args.length == 1) {
  1728. return this.preLayout$0(a0);
  1729. }
  1730. return this.preLayout$1(a0, a1);
  1731. }
  1732. });
  1733. // $source: com/ibm/rave/bundles/utilities/FontPropertyParser
  1734. /************************************************************************
  1735. ** IBM Confidential
  1736. **
  1737. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1738. **
  1739. ** (C) Copyright IBM Corp. 2017
  1740. **
  1741. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1742. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1743. ************************************************************************/
  1744. // GENERATED
  1745. var com_ibm_rave_bundles_utilities_FontPropertyParser = rave['internal']['Declare']({
  1746. });
  1747. /**
  1748. * Method to parse the css font styles and return a style map.
  1749. * @param (String) fontStyle CSS string (eg. "font-family: courier; font-size: 22; fill: red")
  1750. * @return (Object) Font Style Map
  1751. */
  1752. /** @expose */
  1753. com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont = function(fontStyle) {
  1754. if (fontStyle != null && fontStyle.length > 0) {
  1755. var properties = fontStyle.split(new RegExp(";"));
  1756. var fontStyles = {};
  1757. for (var __i_enFor0 = 0, __len_enFor0 = properties.length;
  1758. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  1759. var property = properties[__i_enFor0];
  1760. var fontMap = property.split(new RegExp(":"));
  1761. if (fontMap.length == 2) {
  1762. var key = fontMap[0].trim();
  1763. fontStyles[key == "color" ? "fill" : key] = fontMap[1].trim();
  1764. }
  1765. }
  1766. return fontStyles;
  1767. }
  1768. return null;
  1769. };
  1770. // $source: com/ibm/rave/bundles/components/AxesManager
  1771. /************************************************************************
  1772. ** IBM Confidential
  1773. **
  1774. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1775. **
  1776. ** (C) Copyright IBM Corp. 2018
  1777. **
  1778. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1779. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1780. ************************************************************************/
  1781. // GENERATED
  1782. //@import com/ibm/rave/bundles/components/AxisComponentImpl (runtime) // new, getTranslation
  1783. //@import com/ibm/rave/bundles/components/GridComponentImpl (runtime) // new
  1784. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  1785. /**
  1786. * <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 (&lt;g&gt;) 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 (&lt;g&gt; 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 (&lt;g&gt; 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>
  1787. */
  1788. var com_ibm_rave_bundles_components_AxesManager = rave['internal']['Declare']({
  1789. /**
  1790. * Bundle context
  1791. */
  1792. //_context : null,
  1793. /**
  1794. * Selector for the bundle defs node. If null, no clip paths will be defined.
  1795. */
  1796. //_defs : null,
  1797. /**
  1798. * Scales for the axes, indexed by X1, X2, Y1, Y2
  1799. */
  1800. //_scales : null,
  1801. /**
  1802. * Whether to suppress labels when panning, indexed by X1, X2, Y1, Y2.
  1803. */
  1804. //_suppressPanLabels : null,
  1805. /**
  1806. * Value of the axis drawAxisLabels, set when axis is drawn, indexed by X1, X2, Y1, Y2.
  1807. */
  1808. //_drawAxisLabels : null,
  1809. /**
  1810. * Axis components created on demand, indexed by X1, X2, Y1, Y2
  1811. */
  1812. //_axisComponents : null,
  1813. /**
  1814. * When last drawn, the selector used for each axis role, indexed by X1, X2, Y1, Y2; used for redraws.
  1815. */
  1816. //_lastAxisDrawSelectors : null,
  1817. /**
  1818. * Grid components created on demand, indexed by X1, X2, Y1, Y2
  1819. */
  1820. //_gridComponents : null,
  1821. /**
  1822. * When last drawn, the selector used for each grid role, indexed by X1, X2, Y1, Y2; used for redraws.
  1823. */
  1824. //_lastGridDrawSelectors : null,
  1825. /**
  1826. * For clearing axis
  1827. */
  1828. //_clearAxis : null,
  1829. /**
  1830. * For clearing grid
  1831. */
  1832. //_clearGrid : null,
  1833. /**
  1834. * Selectors for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1835. */
  1836. //_axisSelectors : null,
  1837. /**
  1838. * Selectors for the grid groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1839. */
  1840. //_gridSelectors : null,
  1841. /**
  1842. * Bounding rectangles for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1843. */
  1844. //_axisRects : null,
  1845. /**
  1846. * Center elements bounds, also the grid bounds.
  1847. */
  1848. //_elementRect : null,
  1849. /**
  1850. * Whether anything was drawn into the axis group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1851. */
  1852. //_lastAxisDrew : null,
  1853. /**
  1854. * Whether anything was drawn into the grid group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1855. */
  1856. //_lastGridDrew : null,
  1857. //_dataSlotEntries : null,
  1858. //_layoutAxisOrder : null,
  1859. /**
  1860. * On the first draw, no transitions are used.
  1861. */
  1862. _firstDraw : false,
  1863. /**
  1864. * Whether to draw the axes and grids.
  1865. */
  1866. _visible : true,
  1867. /**
  1868. * Transition duration, ms
  1869. */
  1870. _duration : 0,
  1871. /**
  1872. * Transpose the axes (assign X to left/right and Y to top/bottom)
  1873. */
  1874. _transpose : false,
  1875. /**
  1876. * Switch the independent (X) axes, drawing X1 where X2 normally goes and vice-versa
  1877. */
  1878. _swapX : false,
  1879. /**
  1880. * Switch the dependent (Y) axes, drawing Y1 where Y2 normally goes and vice-versa
  1881. */
  1882. _swapY : false,
  1883. _layoutInProgress : false,
  1884. _layoutMaxWidth : 0,
  1885. _layoutMaxHeight : 0,
  1886. _xPadding : 0, _xOuterPadding : 0, _yPadding : 0, _yOuterPadding : 0,
  1887. _xPixelPad : 0, _yPixelPad : 0,
  1888. /**
  1889. * Hack to allow heatmap in "unit cell" mode to disable stagger because of the post scaling that messes up axis layout
  1890. */
  1891. _preventStaggerRotate45 : false,
  1892. constructor : function(context) {
  1893. this._scales = [];
  1894. this._suppressPanLabels = [];
  1895. this._drawAxisLabels = [];
  1896. this._axisComponents = [];
  1897. this._lastAxisDrawSelectors = [];
  1898. this._gridComponents = [];
  1899. this._lastGridDrawSelectors = [];
  1900. this._clearAxis = new com_ibm_rave_bundles_components_AxisComponentImpl();
  1901. this._clearGrid = new com_ibm_rave_bundles_components_GridComponentImpl();
  1902. this._axisSelectors = [];
  1903. this._gridSelectors = [];
  1904. this._axisRects = [];
  1905. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1906. this._lastAxisDrew = [];
  1907. this._lastGridDrew = [];
  1908. this._dataSlotEntries = [];
  1909. this._layoutAxisOrder = [];
  1910. /**
  1911. * Construct and initialize. No axis scales or selector groups are defined.
  1912. * @param (rave['library']['internal']['BundleContext']) context The bundle context
  1913. */
  1914. {
  1915. this._context = context;
  1916. for (var i = 0; i < 4; ++i) {
  1917. this._scales[i] = null;
  1918. this._suppressPanLabels[i] = false;
  1919. this._axisComponents[i] = null;
  1920. this._lastAxisDrawSelectors[i] = null;
  1921. this._gridComponents[i] = null;
  1922. this._lastGridDrawSelectors[i] = null;
  1923. this._axisSelectors[i] = null;
  1924. this._gridSelectors[i] = null;
  1925. this._axisRects[i] = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1926. this._lastAxisDrew[i] = false;
  1927. this._lastGridDrew[i] = false;
  1928. this._dataSlotEntries[i] = [];
  1929. }
  1930. }
  1931. },
  1932. /** @expose */
  1933. preLayout : function(layoutComponent, axesBeforeLegend, xPadding, xOuterPadding, xPixelPad, yPadding, yOuterPadding, yPixelPad) {
  1934. this._xPadding = xPadding;
  1935. this._xOuterPadding = xOuterPadding;
  1936. this._xPixelPad = xPixelPad;
  1937. this._yPadding = yPadding;
  1938. this._yOuterPadding = yOuterPadding;
  1939. this._yPixelPad = yPixelPad;
  1940. this._layoutInProgress = true;
  1941. var layoutDuration = this._duration;
  1942. this._duration = 0;
  1943. 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"];
  1944. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.axes-layout"), children);
  1945. var layoutAxisSelectors = [];
  1946. var layoutGridSelectors = [];
  1947. var layoutLastAxisDrew = [];
  1948. for (var position = 0; position < 4; ++position) {
  1949. if (this._axisComponents[position]) {
  1950. this._axisComponents[position].preLayout();
  1951. }
  1952. layoutAxisSelectors[position] = this._axisSelectors[position];
  1953. layoutGridSelectors[position] = this._gridSelectors[position];
  1954. layoutLastAxisDrew[position] = this._lastAxisDrew[position];
  1955. if (this._axisSelectors[position]) {
  1956. this.axisSelector(position, this._context.node.select("g.layoutAxis-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  1957. }
  1958. if (this._gridSelectors[position]) {
  1959. this.gridSelector(position, this._context.node.select("g.layoutGrid-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  1960. }
  1961. }
  1962. layoutComponent.preLayout(axesBeforeLegend, true);
  1963. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutComponent.elementRect());
  1964. var countHorz = 0;
  1965. var countVert = 0;
  1966. var axes = [];
  1967. for (var position = 0; position < 4; ++position) {
  1968. var role = this.positionToRole(position);
  1969. var isHorz = position == 1 || position == 0;
  1970. if (this._axisSelectors[position] && this._scales[role]) {
  1971. if (isHorz) {
  1972. countHorz++;
  1973. } else {
  1974. countVert++;
  1975. }
  1976. if (this._scales[role].isOrdinal() || this._scales[role].isClustered()) {
  1977. var score = isHorz ? 4 : 2;
  1978. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  1979. } else {
  1980. var score = isHorz ? 3 : 1;
  1981. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  1982. }
  1983. } else {
  1984. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, 5));
  1985. }
  1986. }
  1987. axes.sort(function(a1, a2) {
  1988. var a1value = a1.score;
  1989. var a2value = a2.score;
  1990. return a1value < a2value ? -1 : a1value > a2value ? 1 : 0;
  1991. });
  1992. this._layoutAxisOrder = [];
  1993. for (var i = 0; i < 4; ++i) {
  1994. this._layoutAxisOrder[i] = axes[i].position;
  1995. }
  1996. this._layoutMaxWidth = this._elementRect.width * (countVert > 1 ? 0.5 : 0.4);
  1997. this._layoutMaxHeight = this._elementRect.height * (countHorz > 1 ? 0.5 : 0.4);
  1998. for (var index = 0; index < 4; ++index) {
  1999. var position = this._layoutAxisOrder[index];
  2000. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], this._elementRect);
  2001. }
  2002. this.draw();
  2003. this._duration = layoutDuration;
  2004. this._context.node.select("g.axes-layout").selectAll("*").remove();
  2005. for (var position = 0; position < 4; ++position) {
  2006. this._lastAxisDrew[position] = layoutLastAxisDrew[position];
  2007. this._axisSelectors[position] = layoutAxisSelectors[position];
  2008. this._gridSelectors[position] = layoutGridSelectors[position];
  2009. }
  2010. this._layoutInProgress = false;
  2011. return this;
  2012. },
  2013. getPositionToDraw : function(index) {
  2014. return this._layoutInProgress ? this._layoutAxisOrder[index] : index;
  2015. },
  2016. preDrawAxis : function(index) {
  2017. if (this._layoutInProgress) {
  2018. var position = this._layoutAxisOrder[index];
  2019. var role = this.positionToRole(position);
  2020. if (role == 0 || role == 1) {
  2021. this.setScaleRangePadded(this._scales[role], false, this._xPadding, this._xOuterPadding, this._xPixelPad);
  2022. } else {
  2023. this.setScaleRangePadded(this._scales[role], true, this._yPadding, this._yOuterPadding, this._yPixelPad);
  2024. }
  2025. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(true);
  2026. }
  2027. },
  2028. postDrawAxis : function(index) {
  2029. if (this._layoutInProgress) {
  2030. var position = this._layoutAxisOrder[index];
  2031. var role = this.positionToRole(position);
  2032. var axis = this._axisComponents[role];
  2033. var size = axis.getPreferredSize();
  2034. if (position == 1 || position == 0) {
  2035. if (size > this._layoutMaxHeight) {
  2036. size = this._layoutMaxHeight;
  2037. }
  2038. this._elementRect.height -= size;
  2039. if (position == 1) {
  2040. this._elementRect.y += size;
  2041. }
  2042. } else {
  2043. if (size > this._layoutMaxWidth) {
  2044. size = this._layoutMaxWidth;
  2045. }
  2046. this._elementRect.width -= size;
  2047. if (position == 2) {
  2048. this._elementRect.x += size;
  2049. }
  2050. }
  2051. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2052. }
  2053. },
  2054. /**
  2055. * 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.
  2056. */
  2057. /** @expose */
  2058. draw : function() {
  2059. for (var role = 0; role < 4; ++role) {
  2060. this._lastAxisDrawSelectors[role] = null;
  2061. this._lastGridDrawSelectors[role] = null;
  2062. }
  2063. for (var index = 0; index < 4; ++index) {
  2064. var position = this.getPositionToDraw(index);
  2065. var role = this.positionToRole(position);
  2066. if (!this._visible || !this._axisSelectors[position] || !this._scales[role]) {
  2067. this.clearAxis(position);
  2068. this.clearGrid(position);
  2069. } else {
  2070. this.preDrawAxis(index);
  2071. this.drawAxis(position, role);
  2072. this.postDrawAxis(index);
  2073. if (this._gridSelectors[position]) {
  2074. this.drawGrid(position, role);
  2075. }
  2076. }
  2077. }
  2078. this._firstDraw = false;
  2079. },
  2080. /**
  2081. * @return (boolean) true if we are hiding any labels during pan-zoom.
  2082. */
  2083. /** @expose */
  2084. hideAnyPanZoom : function() {
  2085. return (this._suppressPanLabels[0] || this._suppressPanLabels[1] || this._suppressPanLabels[2] || this._suppressPanLabels[3]);
  2086. },
  2087. /**
  2088. * 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.
  2089. * @param (boolean) panning Whether this is a pan in-progress; use false otherwise including when pan-zoom ends.
  2090. */
  2091. /** @expose */
  2092. redraw : function(panning) {
  2093. for (var role = 0; role < 4; ++role) {
  2094. if (this._axisComponents[role] && this._lastAxisDrawSelectors[role]) {
  2095. this._axisComponents[role].displayTickLabels(this._drawAxisLabels[role]);
  2096. this._axisComponents[role].showPanZoomTickLabels(!panning || !this._suppressPanLabels[role]);
  2097. var isAllow = this._axisComponents[role].isAllowAutomaticAxisLayoutToChangeOrientation();
  2098. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2099. this._lastAxisDrawSelectors[role].call(this._axisComponents[role]);
  2100. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(isAllow);
  2101. }
  2102. if (this._gridComponents[role] && this._lastGridDrawSelectors[role]) {
  2103. this._lastGridDrawSelectors[role].call(this._gridComponents[role]);
  2104. }
  2105. }
  2106. },
  2107. /** @expose */
  2108. preventStaggerRotate45 : function(preventStaggerRotate45) {
  2109. this._preventStaggerRotate45 = preventStaggerRotate45;
  2110. },
  2111. /**
  2112. * 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.
  2113. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2114. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2115. */
  2116. drawAxis : function(position, role) {
  2117. var axisGroup = this._axisSelectors[position];
  2118. this._lastAxisDrawSelectors[role] = axisGroup;
  2119. var comp = this.axisComponent(role);
  2120. var layoutModeID = role == 2 ? "axis.y.labels.layoutMode" : role == 3 ? "axis.y2.labels.layoutMode" : "axis.x.labels.layoutMode";
  2121. var allowStaggerID = role == 2 ? "axis.y.labels.allowStagger" : role == 3 ? "axis.y2.labels.allowStagger" : "axis.x.labels.allowStagger";
  2122. var allowRotate45ID = role == 2 ? "axis.y.labels.allowRotate45" : role == 3 ? "axis.y2.labels.allowRotate45" : "axis.x.labels.allowRotate45";
  2123. var allowRotate90ID = role == 2 ? "axis.y.labels.allowRotate90" : role == 3 ? "axis.y2.labels.allowRotate90" : "axis.x.labels.allowRotate90";
  2124. var layoutMode = ""+(this._context.getPropertyValue(layoutModeID));
  2125. var allowStagger = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowStaggerID));
  2126. var allowRotate45 = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowRotate45ID));
  2127. var allowRotate90 = (this._context.getPropertyValue(allowRotate90ID));
  2128. var textTruncateIndicator = (this._context.getPropertyValue("axis.labels.truncationText"));
  2129. var axisBounds = this._axisRects[position];
  2130. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2131. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2132. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2133. 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);
  2134. this._drawAxisLabels[role] = comp._displayTickLabels;
  2135. var axisGroupUpdate = axisGroup;
  2136. if (this._duration > 0 && !this._firstDraw && this._lastAxisDrew[position]) {
  2137. axisGroupUpdate = axisGroup.transition().duration(this._duration);
  2138. }
  2139. axisGroupUpdate.attr("transform", axisTransform);
  2140. axisGroupUpdate.call(comp);
  2141. var dataSlotEntryList = this._dataSlotEntries[role];
  2142. axisGroup.selectAll(".axis-title").property("dataSlots", dataSlotEntryList);
  2143. this._lastAxisDrew[position] = comp.renderedShapes();
  2144. if (this._defs) {
  2145. var clipAxis = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this._context.instanceId() + "clip" + orient);
  2146. var text = axisGroup.append("text").text("000,000");
  2147. var bbox = text.node().getBBox();
  2148. var w = bbox.width;
  2149. var h = bbox.height;
  2150. text.remove();
  2151. var clipRect;
  2152. if (position == 0 || position == 1) {
  2153. var leftEdge = axisBounds.x + transform[0] * -1;
  2154. var rightEdge = leftEdge + axisBounds.width;
  2155. if (!(this._scales[role].isOrdinal()) && !(this._scales[role].isClustered())) {
  2156. var numericLeftEdge = this._elementRect.x - w + transform[0] * -1;
  2157. var numericRightEdge = numericLeftEdge + this._elementRect.width + w * 2;
  2158. if (numericLeftEdge < leftEdge) {
  2159. leftEdge = numericLeftEdge;
  2160. }
  2161. if (numericRightEdge > rightEdge) {
  2162. rightEdge = numericRightEdge;
  2163. }
  2164. }
  2165. clipRect = new rave['internal']['RectStruct'](leftEdge, axisBounds.y + transform[1] * -1, rightEdge - leftEdge, axisBounds.height);
  2166. } else {
  2167. clipRect = new rave['internal']['RectStruct'](axisBounds.x + transform[0] * -1, this._elementRect.y - h / 2 + transform[1] * -1, axisBounds.width, this._elementRect.height + h);
  2168. }
  2169. clipAxis.clipRect(clipRect).applyTo(axisGroup.select(".axis." + orient)).call(this._defs);
  2170. }
  2171. },
  2172. /**
  2173. * If the axis selector for the position is defined, clear the shapes from the axis group.
  2174. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2175. */
  2176. clearAxis : function(position) {
  2177. if (this._axisSelectors[position]) {
  2178. this._clearAxis.scale(null);
  2179. this._axisSelectors[position].call(this._clearAxis);
  2180. }
  2181. this._lastAxisDrew[position] = false;
  2182. },
  2183. /**
  2184. * 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.
  2185. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2186. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2187. */
  2188. drawGrid : function(position, role) {
  2189. var gridGroup = this._gridSelectors[position];
  2190. this._lastGridDrawSelectors[role] = gridGroup;
  2191. var comp = this.gridComponent(role);
  2192. var axisBounds = this._axisRects[position];
  2193. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2194. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2195. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2196. comp.setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).orient(orient).setPreExecute(this._context.getPreExecute()).bounds(this._elementRect).axis(this._axisComponents[role].axis());
  2197. if (this._duration <= 0 || this._firstDraw || !this._lastAxisDrew[position]) {
  2198. gridGroup.attr("transform", axisTransform).call(comp);
  2199. } else {
  2200. gridGroup.transition().duration(this._duration).attr("transform", axisTransform).call(comp);
  2201. }
  2202. this._lastGridDrew[position] = comp.renderedShapes();
  2203. },
  2204. /**
  2205. * If the grid selector for the position is defined, clear the shapes from the grid group.
  2206. * @param (int) position The grid position, BOTTOM, TOP, LEFT, RIGHT
  2207. */
  2208. clearGrid : function(position) {
  2209. if (this._gridSelectors[position]) {
  2210. this._clearGrid.axis(null);
  2211. this._gridSelectors[position].call(this._clearGrid);
  2212. }
  2213. this._lastGridDrew[position] = false;
  2214. },
  2215. /**
  2216. * @param (boolean) visible Whether the manager should draw axes
  2217. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2218. */
  2219. /** @expose */
  2220. visible : function(visible) {
  2221. this._visible = visible;
  2222. return this;
  2223. },
  2224. /**
  2225. * @param (int) duration The transition duration; if <= 0, no transition is used.
  2226. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2227. */
  2228. /** @expose */
  2229. duration : function(duration) {
  2230. this._duration = duration;
  2231. return this;
  2232. },
  2233. /**
  2234. * @param (boolean) transpose Whether to transpose the chart (switch the positions of the X and Y axis)
  2235. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2236. */
  2237. /** @expose */
  2238. transpose : function(transpose) {
  2239. this._transpose = transpose;
  2240. return this;
  2241. },
  2242. /**
  2243. * @param (boolean) swapX Whether to switch the postitions of the X1 and X2 axes
  2244. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2245. */
  2246. /** @expose */
  2247. swapX : function(swapX) {
  2248. this._swapX = swapX;
  2249. return this;
  2250. },
  2251. /**
  2252. * @param (boolean) swapY Whether to switch the postitions of the Y1 and Y2 axes
  2253. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2254. */
  2255. /** @expose */
  2256. swapY : function(swapY) {
  2257. this._swapY = swapY;
  2258. return this;
  2259. },
  2260. /**
  2261. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2262. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The coordinate scale for that role, may be null
  2263. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2264. */
  2265. /** @expose */
  2266. scale : function(role, scale) {
  2267. this._scales[role] = scale;
  2268. return this;
  2269. },
  2270. /**
  2271. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2272. * @param (boolean) suppressLabels Whether to suppress the labels when panning the axis
  2273. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2274. */
  2275. /** @expose */
  2276. suppressPanLabels : function(role, suppressLabels) {
  2277. this._suppressPanLabels[role] = suppressLabels;
  2278. return this;
  2279. },
  2280. /**
  2281. * 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.
  2282. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2283. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) The component for the role
  2284. */
  2285. /** @expose */
  2286. axisComponent : function(role) {
  2287. if (!this._axisComponents[role]) {
  2288. this._axisComponents[role] = new com_ibm_rave_bundles_components_AxisComponentImpl();
  2289. }
  2290. return this._axisComponents[role];
  2291. },
  2292. /**
  2293. * 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.
  2294. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2295. * @return (com.ibm.rave.bundles.components.GridComponentImpl) The component for the role
  2296. */
  2297. /** @expose */
  2298. gridComponent : function(role) {
  2299. if (!this._gridComponents[role]) {
  2300. this._gridComponents[role] = new com_ibm_rave_bundles_components_GridComponentImpl();
  2301. }
  2302. return this._gridComponents[role];
  2303. },
  2304. /**
  2305. * Set the bundle &lt;defs&gt; node. Clip paths will be defined in this node.
  2306. * @param (rave['internal']['Selector']) defs The defs node
  2307. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2308. */
  2309. /** @expose */
  2310. defsSelector : function(defs) {
  2311. this._defs = com_ibm_rave_bundles_components_AxesManager.checkSelector(defs);
  2312. return this;
  2313. },
  2314. /**
  2315. * Set the selector for an axis group node.
  2316. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2317. * @param (rave['internal']['Selector']) axisGroup The axis group node, may be null
  2318. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2319. */
  2320. /** @expose */
  2321. axisSelector : function(position, axisGroup) {
  2322. this._axisSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(axisGroup);
  2323. return this;
  2324. },
  2325. /**
  2326. * Set the selector for a grid group node.
  2327. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2328. * @param (rave['internal']['Selector']) gridGroup The grid group node, may be null
  2329. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2330. */
  2331. /** @expose */
  2332. gridSelector : function(position, gridGroup) {
  2333. this._gridSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(gridGroup);
  2334. return this;
  2335. },
  2336. /**
  2337. * Set the element (grid) bounds rectangle to a copy of the given rectangle.
  2338. * @param (rave['internal']['RectStruct']) elementRect The rectangle, if null the bounds are set to 0,0,0,0
  2339. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2340. */
  2341. /** @expose */
  2342. elementRect : function(elementRect) {
  2343. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, elementRect);
  2344. return this;
  2345. },
  2346. /**
  2347. * Set an axis bounds rectangle to a copy of the given rectangle.
  2348. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2349. * @param (rave['internal']['RectStruct']) axisRect The axis bounds, if null the bounds are set to 0,0,0,0
  2350. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2351. */
  2352. /** @expose */
  2353. axisRect : function(position, axisRect) {
  2354. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], axisRect);
  2355. return this;
  2356. },
  2357. /**
  2358. * 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.
  2359. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2360. */
  2361. /** @expose */
  2362. useDefaultSelectors : function() {
  2363. this.defsSelector(this._context.node.select("defs"));
  2364. this.axisSelector(0, this._context.node.select("g.axisTransform.bottom"));
  2365. this.axisSelector(1, this._context.node.select("g.axisTransform.top"));
  2366. this.axisSelector(2, this._context.node.select("g.axisTransform.left"));
  2367. this.axisSelector(3, this._context.node.select("g.axisTransform.right"));
  2368. this.gridSelector(0, this._context.node.select("g.grid.bottom"));
  2369. this.gridSelector(1, this._context.node.select("g.grid.top"));
  2370. this.gridSelector(2, this._context.node.select("g.grid.left"));
  2371. this.gridSelector(3, this._context.node.select("g.grid.right"));
  2372. return this;
  2373. },
  2374. /**
  2375. * Convenience method: Set the element rectangle and axis rectangles from the rectangles in the layout.
  2376. * @param (com.ibm.rave.bundles.components.ChartLayoutComponentImpl) layoutInfo Layout information
  2377. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2378. */
  2379. /** @expose */
  2380. useBoundsFromLayout : function(layoutInfo) {
  2381. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutInfo.elementRect());
  2382. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[0], layoutInfo.bottomRect());
  2383. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[1], layoutInfo.topRect());
  2384. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[2], layoutInfo.leftRect());
  2385. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[3], layoutInfo.rightRect());
  2386. return this;
  2387. },
  2388. /**
  2389. * 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.
  2390. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2391. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2392. */
  2393. /** @expose */
  2394. useDefaultX1Properties : function(setGridParameters) {
  2395. 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"))));
  2396. var titleFontStyle = (this._context.getPropertyValue("axis.x.title.style.font"));
  2397. var labelFontStyle = (this._context.getPropertyValue("axis.x.labels.style.font"));
  2398. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2399. this.axisComponent(0).labelStyle(labelFontStyle);
  2400. } else {
  2401. 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")));
  2402. }
  2403. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2404. this.axisComponent(0).titleStyle(titleFontStyle);
  2405. } else {
  2406. 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")));
  2407. }
  2408. if (setGridParameters) {
  2409. 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")));
  2410. }
  2411. this.suppressPanLabels(0, (this._context.getPropertyValue("axis.x.labels.zoomPan")));
  2412. return this;
  2413. },
  2414. /**
  2415. * 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.
  2416. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2417. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2418. */
  2419. /** @expose */
  2420. useDefaultY1Properties : function(setGridParameters) {
  2421. 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")));
  2422. var titleFontStyle = (this._context.getPropertyValue("axis.y.title.style.font"));
  2423. var labelFontStyle = (this._context.getPropertyValue("axis.y.labels.style.font"));
  2424. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2425. this.axisComponent(2).labelStyle(labelFontStyle);
  2426. } else {
  2427. 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")));
  2428. }
  2429. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2430. this.axisComponent(2).titleStyle(titleFontStyle);
  2431. } else {
  2432. 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")));
  2433. }
  2434. if (setGridParameters) {
  2435. 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")));
  2436. }
  2437. this.suppressPanLabels(2, (this._context.getPropertyValue("axis.y.labels.zoomPan")));
  2438. return this;
  2439. },
  2440. /**
  2441. * 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.
  2442. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2443. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2444. */
  2445. /** @expose */
  2446. useDefaultY2Properties : function(setGridParameters) {
  2447. 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")));
  2448. var titleFontStyle = (this._context.getPropertyValue("axis.y2.title.style.font"));
  2449. var labelFontStyle = (this._context.getPropertyValue("axis.y2.labels.style.font"));
  2450. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2451. this.axisComponent(3).labelStyle(labelFontStyle);
  2452. } else {
  2453. 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")));
  2454. }
  2455. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2456. this.axisComponent(3).titleStyle(titleFontStyle);
  2457. } else {
  2458. 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")));
  2459. }
  2460. if (setGridParameters) {
  2461. 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")));
  2462. }
  2463. this.suppressPanLabels(3, (this._context.getPropertyValue("axis.y2.labels.zoomPan")));
  2464. return this;
  2465. },
  2466. /**
  2467. * 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.
  2468. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2469. * @param (Array) entries Non-null list of data slot entries
  2470. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  2471. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined for the axis, may be null
  2472. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2473. */
  2474. /** @expose */
  2475. setTickFormatterList : function(role, entries, format, defaultFunction) {
  2476. var fmtRole;
  2477. switch (role) {
  2478. case 2:
  2479. fmtRole = "ROLE_Y1";
  2480. break;
  2481. case 1:
  2482. fmtRole = "ROLE_X2";
  2483. break;
  2484. case 3:
  2485. fmtRole = "ROLE_Y2";
  2486. break;
  2487. case 0:
  2488. default:
  2489. fmtRole = "ROLE_X1";
  2490. break;
  2491. }
  2492. 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);
  2493. this.axisComponent(role).tickFormat(fmt);
  2494. 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);
  2495. this.axisComponent(role).simplifiedTickFormat(simplefmt);
  2496. return this;
  2497. },
  2498. /**
  2499. * 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.
  2500. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2501. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  2502. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2503. */
  2504. /** @expose */
  2505. setTickFormatter : function(role, entry) {
  2506. var entries = [];
  2507. if (entry) {
  2508. entries.push(entry);
  2509. }
  2510. return this.setTickFormatterList(role, entries, "none", null);
  2511. },
  2512. /**
  2513. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined scale.
  2514. * @param (Number) padding Padding, relevant only for ordinal scales
  2515. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2516. * @param (int) pixelPad Pixel padding at each end
  2517. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2518. */
  2519. /** @expose */
  2520. setScaleRanges : function(padding, outerPadding, pixelPad) {
  2521. this.setIndependentScaleRanges(padding, outerPadding, pixelPad);
  2522. this.setDependentScaleRanges(padding, outerPadding, pixelPad);
  2523. return this;
  2524. },
  2525. /**
  2526. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2527. * @param (Number) padding Padding, relevant only for ordinal scales
  2528. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2529. * @param (int) pixelPad Pixel padding at each end
  2530. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2531. */
  2532. /** @expose */
  2533. setIndependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2534. this.setScaleRangePadded(this._scales[0], false, padding, outerPadding, pixelPad);
  2535. this.setScaleRangePadded(this._scales[1], false, padding, outerPadding, pixelPad);
  2536. return this;
  2537. },
  2538. /**
  2539. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2540. * @param (Number) padding Padding, relevant only for ordinal scales
  2541. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2542. * @param (int) pixelPad Pixel padding at each end
  2543. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2544. */
  2545. /** @expose */
  2546. setDependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2547. this.setScaleRangePadded(this._scales[2], true, padding, outerPadding, pixelPad);
  2548. this.setScaleRangePadded(this._scales[3], true, padding, outerPadding, pixelPad);
  2549. return this;
  2550. },
  2551. /**
  2552. * 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)} .
  2553. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2554. * @param (rave['library']['internal']['DataSlotEntry']) slot DataSlotEntry to be associated with the axis role.
  2555. */
  2556. setDataSlot$0 : function(role, slot) {
  2557. this.setDataSlot$1(role, [slot]);
  2558. return this;
  2559. },
  2560. /**
  2561. * Set a list of data slot entries that will be associated with the specified axis role.
  2562. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2563. * @param (Array) slots List of DataSlotEntry to be associated with the axis role.
  2564. */
  2565. setDataSlot$1 : function(role, slots) {
  2566. if (role < 4 && role >= 0) {
  2567. this._dataSlotEntries[role].length = 0;
  2568. if (slots) {
  2569. for (var __i_enFor0 = 0, __exp_enFor0 = slots, __len_enFor0 = __exp_enFor0.length;
  2570. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  2571. var slot = __exp_enFor0[__i_enFor0];
  2572. this._dataSlotEntries[role].push(slot);
  2573. }
  2574. }
  2575. }
  2576. return this;
  2577. },
  2578. /**
  2579. * </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.
  2580. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale Bundle independent scale
  2581. * @param (boolean) dependent Whether this is the dependent scale
  2582. * @param (Number) padding Padding, relevant only for ordinal scales
  2583. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2584. * @param (int) pixelPad Pixel padding at each end
  2585. */
  2586. setScaleRangePadded : function(scale, dependent, padding, outerPadding, pixelPad) {
  2587. if (scale) {
  2588. var min, max;
  2589. if (dependent == this._transpose) {
  2590. min = this._elementRect.x + pixelPad;
  2591. max = this._elementRect.x + this._elementRect.width - pixelPad;
  2592. } else {
  2593. if (scale.isContinuous()) {
  2594. min = this._elementRect.y + this._elementRect.height - pixelPad;
  2595. max = this._elementRect.y + pixelPad;
  2596. } else {
  2597. min = this._elementRect.y + pixelPad;
  2598. max = this._elementRect.y + this._elementRect.height - pixelPad;
  2599. }
  2600. }
  2601. scale.range(min, max, padding, outerPadding);
  2602. }
  2603. },
  2604. /**
  2605. * Given a geometric position BOTTOM, TOP, LEFT, or RIGHT, return the role X1, X2, Y1, or Y2 used by that role.
  2606. * @param (int) position The position index
  2607. * @return (int) The role index
  2608. */
  2609. positionToRole : function(position) {
  2610. var r = position;
  2611. if (this._transpose) {
  2612. r = (r + 2) % 4;
  2613. }
  2614. if (this._swapX && r < 2) {
  2615. r = 1 - r;
  2616. }
  2617. if (this._swapY && r > 1) {
  2618. r = 5 - r;
  2619. }
  2620. return r;
  2621. },
  2622. /**
  2623. * Given a role X1, X2, Y1, or Y2, return the geometric position BOTTOM, TOP, LEFT, or RIGHT for that role.
  2624. * @param (int) role The role index
  2625. * @return (int) The position index
  2626. */
  2627. roleToPosition : function(role) {
  2628. var p = role;
  2629. if (this._swapX && role < 2) {
  2630. p = 1 - p;
  2631. }
  2632. if (this._swapY && p > 1) {
  2633. p = 5 - p;
  2634. }
  2635. if (this._transpose) {
  2636. p = (p + 2) % 4;
  2637. }
  2638. return p;
  2639. },
  2640. /**
  2641. * Sets the magnitude for the tick interval.
  2642. * @param (int) role role index of the axis
  2643. * @param (Number) tickMagnitude power of 10
  2644. * @return (com.ibm.rave.bundles.components.AxesManager) this
  2645. */
  2646. /** @expose */
  2647. scaleTickMagnitude : function(role, tickMagnitude) {
  2648. this.axisComponent(role).scaleTickMagnitude(tickMagnitude);
  2649. return this;
  2650. },
  2651. /** @expose */
  2652. setDataSlot : function(a0, a1) {
  2653. var args = arguments;
  2654. if (args.length == 2 && typeof a1 === "function") {
  2655. return this.setDataSlot$0(a0, a1);
  2656. }
  2657. return this.setDataSlot$1(a0, a1);
  2658. }
  2659. });
  2660. /**
  2661. * @param (rave['internal']['Selector']) s A selector
  2662. * @return (rave['internal']['Selector']) s if it is non-null and has at least one node, null otherwise
  2663. */
  2664. com_ibm_rave_bundles_components_AxesManager.checkSelector = function(s) {
  2665. return s && !(s.empty()) ? s : null;
  2666. };
  2667. /**
  2668. * Set a rectangle to a copy of another. If the source is null, the target is set to 0,0,0,0
  2669. * @param (rave['internal']['RectStruct']) target A non-null rectangle
  2670. * @param (rave['internal']['RectStruct']) source A possibly-null rectnalge
  2671. */
  2672. com_ibm_rave_bundles_components_AxesManager.setRect = function(target, source) {
  2673. if (source) {
  2674. target.x = source.x;
  2675. target.y = source.y;
  2676. target.width = source.width;
  2677. target.height = source.height;
  2678. } else {
  2679. target.x = 0;
  2680. target.y = 0;
  2681. target.width = 0;
  2682. target.height = 0;
  2683. }
  2684. };
  2685. /**
  2686. * A ValueFunction that appends '%' to the value.
  2687. * @param (int) n Number of digits
  2688. */
  2689. /** @expose */
  2690. com_ibm_rave_bundles_components_AxesManager.percentFormat = function(n) {
  2691. var digits = "." + n + "f";
  2692. var format = rave.format(digits);
  2693. return function(value, ix, gix) {
  2694. return format.call(null, value, 0, 0) + "%";
  2695. };
  2696. };
  2697. /**
  2698. * Called prior to chart layout. Axes are configured with no real bounding constraints to calculate their preferred size.
  2699. */
  2700. com_ibm_rave_bundles_components_AxesManager.AxisLayout = rave['internal']['Declare']({
  2701. /** @expose */
  2702. position : 0,
  2703. /** @expose */
  2704. score : 0,
  2705. constructor : function(position, score) {
  2706. this.position = position;
  2707. this.score = score;
  2708. }
  2709. });
  2710. /**
  2711. * Logical first X (independent) axis, default position bottom
  2712. */
  2713. /** @expose */
  2714. com_ibm_rave_bundles_components_AxesManager.X1 = 0;
  2715. /**
  2716. * Logical second X (independent) axis, default position top
  2717. */
  2718. /** @expose */
  2719. com_ibm_rave_bundles_components_AxesManager.X2 = 1;
  2720. /**
  2721. * Logical first Y (dependent) axis, default position left
  2722. */
  2723. /** @expose */
  2724. com_ibm_rave_bundles_components_AxesManager.Y1 = 2;
  2725. /**
  2726. * Logical first Y (dependent) axis, default position right
  2727. */
  2728. /** @expose */
  2729. com_ibm_rave_bundles_components_AxesManager.Y2 = 3;
  2730. /**
  2731. * Geometric group on bottom
  2732. */
  2733. /** @expose */
  2734. com_ibm_rave_bundles_components_AxesManager.BOTTOM = 0;
  2735. /**
  2736. * Geometric group on top
  2737. */
  2738. /** @expose */
  2739. com_ibm_rave_bundles_components_AxesManager.TOP = 1;
  2740. /**
  2741. * Geometric group on left
  2742. */
  2743. /** @expose */
  2744. com_ibm_rave_bundles_components_AxesManager.LEFT = 2;
  2745. /**
  2746. * Geometric group on right
  2747. */
  2748. /** @expose */
  2749. com_ibm_rave_bundles_components_AxesManager.RIGHT = 3;
  2750. /**
  2751. * Maps the role indexes to the role strings used by the components API
  2752. */
  2753. com_ibm_rave_bundles_components_AxesManager.ROLES = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2754. /**
  2755. * Maps the role indexes to the role strings used by the custom formatter API. TODO: Unify the strings
  2756. */
  2757. com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2758. /**
  2759. * Maps the position indexes to the orient strings used by D3
  2760. */
  2761. com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS = ["bottom", "top", "left", "right"];
  2762. /**
  2763. * Maps the position indexes to the custom formatter strings
  2764. */
  2765. com_ibm_rave_bundles_components_AxesManager.FORMATTERS = ["bottom", "top", "left", "right"];
  2766. // $source: com/ibm/rave/bundles/component/AxisComponent
  2767. /************************************************************************
  2768. ** IBM Confidential
  2769. **
  2770. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2771. **
  2772. ** (C) Copyright IBM Corp. 2017
  2773. **
  2774. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2775. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2776. ************************************************************************/
  2777. // GENERATED
  2778. /**
  2779. * <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>
  2780. */
  2781. var com_ibm_rave_bundles_component_AxisComponent = rave['internal']['Declare'].implement(
  2782. /**
  2783. * @return (String) The role of the axis in the chart
  2784. */
  2785. //role : function() {},
  2786. /**
  2787. * @return (rave['internal']['Axis']) The capability Axis used by this AxisComponent
  2788. */
  2789. //axis : function() {},
  2790. /**
  2791. * The tickFormat is applied to the values of the ticks to create the string that is displayed.
  2792. * @param (rave['internal']['ValueFunction']) tickFormat The new tickFormat
  2793. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2794. */
  2795. //tickFormat : function(tickFormat) {},
  2796. /**
  2797. * Get the tickFormat function used by this component. May be null.
  2798. * @return (rave['internal']['ValueFunction']) Format function, or null
  2799. */
  2800. //tickFormat : function() {},
  2801. /**
  2802. * Set the indicator to be used for truncated text ex: indicator set to "..." , results in helloworld - > hello...
  2803. * @param (String) indicator the string to be placed to indicated truncated text
  2804. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2805. */
  2806. //textTruncateIndicator : function(indicator) {},
  2807. /**
  2808. * Whether to display the axis title.
  2809. * @param (boolean) displayAxisTitle true to display the axis title, false otherwise
  2810. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2811. */
  2812. //displayAxisTitle : function(displayAxisTitle) {},
  2813. /**
  2814. * Whether to display the axis line.
  2815. * @param (boolean) displayAxisLine true to display the axis line, false otherwise
  2816. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2817. */
  2818. //displayAxisLine : function(displayAxisLine) {},
  2819. /**
  2820. * Whether to display the axis tick marks.
  2821. * @param (boolean) displayTicks true to display the axis ticks, false otherwise
  2822. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2823. */
  2824. //displayTicks : function(displayTicks) {},
  2825. /**
  2826. * Whether to display the axis labels, as set by the show axis labels property
  2827. * @param (boolean) displayTickLabels true to display the axis tick labels, false otherwise
  2828. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2829. */
  2830. //displayTickLabels : function(displayTickLabels) {},
  2831. /**
  2832. * Whether to display the axis labels, as set by the hide pan-zoom labels property
  2833. * @param (boolean) showPanZoomTickLabels true to display the axis tick labels, false otherwise
  2834. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2835. */
  2836. //showPanZoomTickLabels : function(showPanZoomTickLabels) {},
  2837. /**
  2838. * @param (String) axisTitle The new axisTitle
  2839. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2840. */
  2841. //axisTitle : function(axisTitle) {},
  2842. /**
  2843. * 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)} .
  2844. * @param (String) axisColor The new line and tick color
  2845. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2846. */
  2847. //axisColor : function(axisColor) {},
  2848. /**
  2849. * The color used to draw the axis line.
  2850. * @param (String) lineColor The new lineColor
  2851. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2852. */
  2853. //lineColor : function(lineColor) {},
  2854. /**
  2855. * The color used to draw the axis ticks.
  2856. * @param (String) tickColor The new tickColor
  2857. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2858. */
  2859. //tickColor : function(tickColor) {},
  2860. /**
  2861. * The color used to draw the axis labels.
  2862. * @param (String) labelColor The new labelColor
  2863. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2864. */
  2865. //labelColor : function(labelColor) {},
  2866. /**
  2867. * The style for the axis labels.
  2868. * @param (String) fontStyle CSS string of font properties
  2869. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2870. */
  2871. //labelStyle : function(fontStyle) {},
  2872. /**
  2873. * The style for the axis labels.
  2874. * @param (String) fill The color used to draw the labels
  2875. * @param (String) fontSize CSS font size
  2876. * @param (String) fontFamily CSS font-families list
  2877. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2878. */
  2879. //labelStyle : function(fill, fontSize, fontFamily) {},
  2880. /**
  2881. * The color used to draw the axis title.
  2882. * @param (String) titleColor The new titleColor
  2883. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2884. */
  2885. //titleColor : function(titleColor) {},
  2886. /**
  2887. * The style for the axis title.
  2888. * @param (String) fontStyle CSS string of font properties
  2889. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2890. */
  2891. //titleStyle : function(fontStyle) {},
  2892. /**
  2893. * The style for the axis title.
  2894. * @param (String) fill The color used to draw the title
  2895. * @param (String) fontSize CSS font size
  2896. * @param (String) fontFamily CSS font-families list
  2897. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2898. */
  2899. //titleStyle : function(fill, fontSize, fontFamily) {}
  2900. );
  2901. /**
  2902. * The string returned by {@link #this.type()} is "AxisComponent".
  2903. */
  2904. /** @expose */
  2905. com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE = "AxisComponent";
  2906. /**
  2907. * Returned by {@link #this.role()} for the first independent axis.
  2908. */
  2909. /** @expose */
  2910. com_ibm_rave_bundles_component_AxisComponent.ROLE_X1 = "ROLE_X1";
  2911. /**
  2912. * Returned by {@link #this.role()} for the first dependent axis.
  2913. */
  2914. /** @expose */
  2915. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y1 = "ROLE_Y1";
  2916. /**
  2917. * Returned by {@link #this.role()} for the second independent axis.
  2918. */
  2919. /** @expose */
  2920. com_ibm_rave_bundles_component_AxisComponent.ROLE_X2 = "ROLE_X2";
  2921. /**
  2922. * Returned by {@link #this.role()} for the second dependent axis.
  2923. */
  2924. /** @expose */
  2925. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y2 = "ROLE_Y2";
  2926. // $source: com/ibm/rave/bundles/utilities/TextCrossfader
  2927. /************************************************************************
  2928. ** IBM Confidential
  2929. **
  2930. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2931. **
  2932. ** (C) Copyright IBM Corp. 2017
  2933. **
  2934. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2935. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2936. ************************************************************************/
  2937. // GENERATED
  2938. /**
  2939. * <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>
  2940. */
  2941. var com_ibm_rave_bundles_utilities_TextCrossfader = rave['internal']['Declare']({
  2942. });
  2943. /**
  2944. * <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!
  2945. * @param (rave['internal']['Selection']) selection Selection containing the single text node, may be a transition
  2946. * @param (String) oldText Old value of the text string, may be null
  2947. * @param (String) newText New value of the text string, may be null
  2948. * @param (Object) fillOpacity Fill opacity, may be null (in which case 1.0 is assumed)
  2949. * @param (double) delay Number between 0 and 0.5 controlling the timing of the fade
  2950. * @return (rave['internal']['Selection']) The selection, modified by the new text and fill-opacity
  2951. */
  2952. /** @expose */
  2953. com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade = function(selection, oldText, newText, fillOpacity, delay) {
  2954. if (!(selection.isTransition())) {
  2955. return selection.text(newText);
  2956. }
  2957. var _t = (selection).tween("text", function(data, index, groupIndex) {
  2958. return function(t) {
  2959. this.rave_setText(t < 0.5 ? oldText : newText);
  2960. };
  2961. });
  2962. var t0 = Math.max(0.0, Math.min(0.5, delay));
  2963. if (t0 == 0.5 || (oldText == null && newText == null) || (oldText != null && oldText == newText)) {
  2964. return selection;
  2965. }
  2966. var opacity = fillOpacity == null ? 1.0 : + (fillOpacity);
  2967. var tf = 1.0 / (0.5 - t0);
  2968. return _t.tween("fill-opacity", function(data, index, groupIndex) {
  2969. return function(t) {
  2970. if (t <= t0 || t >= (1.0 - t0)) {
  2971. this.rave_setStyle("fill-opacity", fillOpacity);
  2972. } else {
  2973. this.rave_setStyle("fill-opacity", opacity * Math.abs(t - 0.5) * tf);
  2974. }
  2975. };
  2976. });
  2977. };
  2978. // $source: com/ibm/rave/bundles/utilities/BundleLabelDropper
  2979. /************************************************************************
  2980. ** IBM Confidential
  2981. **
  2982. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2983. **
  2984. ** (C) Copyright IBM Corp. 2017
  2985. **
  2986. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2987. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2988. ************************************************************************/
  2989. // GENERATED
  2990. var com_ibm_rave_bundles_utilities_BundleLabelDropper = rave['internal']['Declare']({
  2991. //_dropOverlap : null,
  2992. labelCount : 0,
  2993. _$functionClassMethod : function() {
  2994. var _$self = function(args) {
  2995. if (args !== null || arguments.length > 1){
  2996. args = Array.prototype.slice.call(arguments, 0);
  2997. }
  2998. {
  2999. _$self.drop(args[0], ((args[1])));
  3000. return null;
  3001. }
  3002. };
  3003. return _$self;
  3004. },
  3005. /** @expose */
  3006. constructor : function() {
  3007. this._dropOverlap = (rave.capabilities.extension("position")).drop().remove(false);
  3008. this._dropOverlap.setOverlapGap(4.0);
  3009. },
  3010. /**
  3011. * Drop the overlapping labels or reset the overlap.
  3012. * @param (rave['internal']['Selection']) labels The selector for the labels
  3013. * @param (boolean) removeOverlap true to remove the overlapping labels, false to reset
  3014. */
  3015. /** @expose */
  3016. drop : function(labels, removeOverlap) {
  3017. if (!(labels.isTransition())) {
  3018. this.applyLabelDrop(labels, removeOverlap);
  3019. } else {
  3020. var steps = [0, 25, 75];
  3021. var self = this;
  3022. (labels).tween("__pointLabelDrop__", function(data, index, groupIndex) {
  3023. if (index == 0) {
  3024. return function(t) {
  3025. var currentStep = Math.floor(t * 100);
  3026. if (steps.length > 0 && currentStep < 100 && currentStep >= steps[0]) {
  3027. steps.splice(0, 1);
  3028. self.applyLabelDrop(labels, removeOverlap);
  3029. }
  3030. };
  3031. }
  3032. return null;
  3033. });
  3034. this.labelCount = 0;
  3035. (labels).each(function(data, index, groupIndex) {
  3036. ++self.labelCount;
  3037. }).each("end", function(args) {
  3038. if (args !== null || arguments.length > 1){
  3039. args = Array.prototype.slice.call(arguments, 0);
  3040. }
  3041. {
  3042. if (--self.labelCount == 0) {
  3043. self.applyLabelDrop(labels, removeOverlap);
  3044. }
  3045. return null;
  3046. }
  3047. });
  3048. }
  3049. },
  3050. applyLabelDrop : function(labels, removeOverlap) {
  3051. if (removeOverlap) {
  3052. labels.call(this._dropOverlap);
  3053. } else {
  3054. this._dropOverlap.reset(labels);
  3055. }
  3056. },
  3057. /** @expose */
  3058. configureForDataLabels : function(rect) {
  3059. if (rect) {
  3060. var ex = [[rect.x, rect.y], [rect.x + rect.width, rect.y + rect.height]];
  3061. this._dropOverlap.extent(ex);
  3062. }
  3063. this._dropOverlap.noClipping();
  3064. }
  3065. });
  3066. /**
  3067. * Drop overlap extension
  3068. */
  3069. //com_ibm_rave_bundles_utilities_BundleLabelDropper.POSITION_EXTENSION = "position";
  3070. /**
  3071. * space between labels during overlap testing
  3072. */
  3073. com_ibm_rave_bundles_utilities_BundleLabelDropper.OVERLAP_GAP = 4;
  3074. // $source: com/ibm/rave/bundles/components/StyleStructs
  3075. /************************************************************************
  3076. ** IBM Confidential
  3077. **
  3078. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3079. **
  3080. ** (C) Copyright IBM Corp. 2017
  3081. **
  3082. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3083. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3084. ************************************************************************/
  3085. // GENERATED
  3086. /**
  3087. * Struct classes to hold style properties.
  3088. */
  3089. var com_ibm_rave_bundles_components_StyleStructs = rave['internal']['Declare']({
  3090. });
  3091. /**
  3092. * Filled shape style properties.
  3093. */
  3094. com_ibm_rave_bundles_components_StyleStructs.ShapeStyle = function() {
  3095. this._fill = null;
  3096. this._stroke = null;
  3097. this._strokeWidth = null;
  3098. };
  3099. /**
  3100. * Line style properties.
  3101. */
  3102. com_ibm_rave_bundles_components_StyleStructs.LineStyle = function() {
  3103. this._stroke = null;
  3104. this._strokeWidth = null;
  3105. this._dashArray = null;
  3106. };
  3107. // $source: com/ibm/rave/bundles/component/GridComponent
  3108. /************************************************************************
  3109. ** IBM Confidential
  3110. **
  3111. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3112. **
  3113. ** (C) Copyright IBM Corp. 2017
  3114. **
  3115. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3116. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3117. ************************************************************************/
  3118. // GENERATED
  3119. /**
  3120. * <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>
  3121. */
  3122. var com_ibm_rave_bundles_component_GridComponent = rave['internal']['Declare'].implement(
  3123. /**
  3124. * @return (String) The role of the grid in the chart
  3125. */
  3126. //role : function() {},
  3127. /**
  3128. * Whether to display the gridlines.
  3129. * @param (boolean) displayGridlines The new displayGridlines
  3130. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3131. */
  3132. //displayGridlines : function(displayGridlines) {},
  3133. /**
  3134. * Set the line styling. Equivalent to calling {@link #this.gridlineColor(String)} and {@link #this.dashArray(String)} .
  3135. * @param (String) stroke The stroke color
  3136. * @param (String) dashArray The stroke-dasharray
  3137. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3138. */
  3139. //gridlineStyle : function(stroke, dashArray) {},
  3140. /**
  3141. * The color used to draw the gridlines.
  3142. * @param (String) gridlineColor The new stroke color
  3143. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3144. */
  3145. //gridlineColor : function(gridlineColor) {},
  3146. /**
  3147. * 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.
  3148. * @param (String) dashArray The new dash array
  3149. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3150. */
  3151. //dashArray : function(dashArray) {}
  3152. );
  3153. /**
  3154. * The string returned by {@link #this.type()} is "GridComponent".
  3155. */
  3156. /** @expose */
  3157. com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE = "GridComponent";
  3158. // $source: com/ibm/rave/bundles/components/IntervalDataUtilities
  3159. /************************************************************************
  3160. ** IBM Confidential
  3161. **
  3162. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3163. **
  3164. ** (C) Copyright IBM Corp. 2017
  3165. **
  3166. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3167. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3168. ************************************************************************/
  3169. // GENERATED
  3170. /**
  3171. * 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.
  3172. */
  3173. var com_ibm_rave_bundles_components_IntervalDataUtilities = rave['internal']['Declare']({
  3174. });
  3175. /**
  3176. * <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>
  3177. * @param (Array) data Data array
  3178. * @param (rave['internal']['SingleValueFunction']) x X accessor, should not be null
  3179. * @param (rave['internal']['SingleValueFunction']) xScale Function to check if the X value is valid
  3180. * @param (rave['internal']['SingleValueFunction']) y Y accessor, should not be null
  3181. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3182. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3183. * @return (Array) Array of intervals for the data
  3184. */
  3185. /** @expose */
  3186. com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars = function(data, x, xScale, y, yStart, color, label) {
  3187. var result = [];
  3188. if (!data || data.length == 0 || !x || !y) {
  3189. return result;
  3190. }
  3191. data.forEach(function(d, ix, list) {
  3192. var xv = x(d);
  3193. if (xv != null && (!xScale || xScale(xv) != null)) {
  3194. var yv = y(d);
  3195. var yvStart = !yStart ? 0 : yStart(d);
  3196. if (yv != null && yvStart != null) {
  3197. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3198. r.key = ix;
  3199. r.ind1 = xv;
  3200. r.ind2 = r.ind1;
  3201. r.cind = r.ind1;
  3202. r.dep1 = yvStart;
  3203. r.dep2 = yv;
  3204. r.cdep = r.dep2;
  3205. r.color = color ? color(d) : null;
  3206. r.label = label ? label(d) : null;
  3207. r.value = r.dep2;
  3208. r._originalData = d;
  3209. r.valueAsPercentOfCategory = 100;
  3210. result.push(r);
  3211. }
  3212. }
  3213. return null;
  3214. });
  3215. var sum = 0;
  3216. for (var i = 0; i < result.length; ++i) {
  3217. var iData = result[i];
  3218. var value = + (iData.value);
  3219. sum += Math.abs(value);
  3220. }
  3221. if (sum != 0) {
  3222. for (var i = 0; i < result.length; ++i) {
  3223. var iData = result[i];
  3224. var value = + (iData.value);
  3225. iData.valueAsPercentOfColor = value / sum * 100;
  3226. }
  3227. }
  3228. return result;
  3229. };
  3230. /**
  3231. * Create intervals for bars in a clustered chart. This is similar to the simple bars, except the independent values are an array of accessors.
  3232. * @param (Array) data Data array
  3233. * @param (Array) x Independent accessor array, should not be null and no entries should be null
  3234. * @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
  3235. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3236. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3237. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3238. * @return (Array) Array of intervals for the data
  3239. */
  3240. /** @expose */
  3241. com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars = function(data, x, xScale, y, yStart, color, label) {
  3242. var result = [];
  3243. if (!data || data.length == 0 || !x || x.length == 0 || !y) {
  3244. return result;
  3245. }
  3246. var len = x.length;
  3247. var categories = {};
  3248. var colors = {};
  3249. data.forEach(function(d, ix, list) {
  3250. var OK = true;
  3251. var ind = [];
  3252. for (var i = 0; i < len; ++i) {
  3253. var xv = x[i](d);
  3254. if (xv == null || (xScale[i] && xScale[i](xv) == null)) {
  3255. OK = false;
  3256. break;
  3257. }
  3258. ind.push(xv);
  3259. if (i == 0) {
  3260. if (!(categories.hasOwnProperty(xv))) {
  3261. categories[""+(xv)] = 1;
  3262. }
  3263. } else if (!(colors.hasOwnProperty(xv))) {
  3264. colors[""+(xv)] = 1;
  3265. }
  3266. }
  3267. var dep = y(d);
  3268. var depStart = !yStart ? 0 : yStart(d);
  3269. if (OK && dep != null && depStart != null) {
  3270. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3271. r.key = ix;
  3272. r.ind1 = ind;
  3273. r.ind2 = ind;
  3274. r.cind = ind;
  3275. r.dep1 = depStart;
  3276. r.dep2 = dep;
  3277. r.cdep = r.dep2;
  3278. r.color = color ? color(d) : null;
  3279. r.label = label ? label(d) : null;
  3280. r.value = r.dep2;
  3281. r._originalData = d;
  3282. result.push(r);
  3283. }
  3284. return null;
  3285. });
  3286. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3287. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3288. var o = __exp_enFor0[__i_enFor0];
  3289. var s = ""+(o);
  3290. var sum = 0;
  3291. for (var i = 0; i < result.length; ++i) {
  3292. var iData = result[i];
  3293. if (s == (iData.ind1)[0]) {
  3294. var value = + (iData.value);
  3295. sum += Math.abs(value);
  3296. }
  3297. }
  3298. if (sum == 0) {
  3299. continue;
  3300. }
  3301. for (var i = 0; i < result.length; ++i) {
  3302. var iData = result[i];
  3303. if (s == (iData.ind1)[0]) {
  3304. var value = + (iData.value);
  3305. iData.valueAsPercentOfCategory = value / sum * 100;
  3306. }
  3307. }
  3308. }
  3309. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3310. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3311. var o = __exp_enFor1[__i_enFor1];
  3312. var s = ""+(o);
  3313. var sum = 0;
  3314. for (var i = 0; i < result.length; ++i) {
  3315. var iData = result[i];
  3316. if (s == iData.color) {
  3317. var value = + (iData.value);
  3318. sum += Math.abs(value);
  3319. }
  3320. }
  3321. if (sum == 0) {
  3322. continue;
  3323. }
  3324. for (var i = 0; i < result.length; ++i) {
  3325. var iData = result[i];
  3326. if (s == iData.color) {
  3327. var value = + (iData.value);
  3328. iData.valueAsPercentOfColor = value / sum * 100;
  3329. }
  3330. }
  3331. }
  3332. return result;
  3333. };
  3334. /**
  3335. * 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.
  3336. * @param (Array) data Data array
  3337. * @param (rave['internal']['SingleValueFunction']) x Independent accessor, should not be null
  3338. * @param (rave['internal']['SingleValueFunction']) xScale Possibly-null function to check if X values are in domain
  3339. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3340. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3341. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3342. * @param (boolean) percent If true, create percent bars
  3343. * @return (Array) Array of intervals for the data
  3344. */
  3345. /** @expose */
  3346. com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars = function(data, x, xScale, y, color, label, percent) {
  3347. var result = [];
  3348. if (!data || data.length == 0 || !x || !y) {
  3349. return result;
  3350. }
  3351. var stacks = {};
  3352. var categories = {};
  3353. var colors = {};
  3354. data.forEach(function(d, ix, list) {
  3355. var xv = x(d);
  3356. if (xv != null && (!xScale || xScale(xv) != null)) {
  3357. var yv = y(d);
  3358. if (yv != null) {
  3359. var stack = stacks[xv];
  3360. if (!stack) {
  3361. stack = new com_ibm_rave_bundles_components_IntervalDataUtilities.Stack();
  3362. stacks[xv] = stack;
  3363. }
  3364. var dVal = + (yv);
  3365. if (!percent) {
  3366. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3367. r.key = ix;
  3368. r.ind1 = xv;
  3369. r.ind2 = xv;
  3370. r.cind = xv;
  3371. var sum = dVal < 0.0 ? stack.negativeSum : stack.positiveSum;
  3372. r.dep1 = sum;
  3373. r.dep2 = sum + dVal;
  3374. r.cdep = r.dep2;
  3375. r.color = color ? color(d) : null;
  3376. r.label = label ? label(d) : null;
  3377. r.value = dVal;
  3378. r._originalData = d;
  3379. result.push(r);
  3380. }
  3381. if (dVal < 0.0) {
  3382. stack.negativeSum += dVal;
  3383. } else {
  3384. stack.positiveCount++;
  3385. stack.positiveSum += dVal;
  3386. }
  3387. if (!(categories.hasOwnProperty(xv))) {
  3388. categories[""+(xv)] = 1;
  3389. }
  3390. if (color) {
  3391. var o = color(d);
  3392. if ((o != null) && !(colors.hasOwnProperty(o))) {
  3393. colors[""+(o)] = 1;
  3394. }
  3395. }
  3396. }
  3397. }
  3398. return null;
  3399. });
  3400. if (percent) {
  3401. data.forEach(function(d, ix, list) {
  3402. var xv = x(d);
  3403. if (xv != null && (!xScale || xScale(xv) != null)) {
  3404. var yv = y(d);
  3405. if (yv != null) {
  3406. var stack = stacks[xv];
  3407. var dVal = + (yv);
  3408. var percent;
  3409. if (dVal < 0.0) {
  3410. percent = -100.0 * dVal / stack.negativeSum;
  3411. } else if (stack.positiveSum > 0) {
  3412. percent = 100.0 * dVal / stack.positiveSum;
  3413. } else {
  3414. percent = 100.0 / stack.positiveCount;
  3415. }
  3416. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3417. r.key = ix;
  3418. r.ind1 = xv;
  3419. r.ind2 = xv;
  3420. r.cind = xv;
  3421. var sum = dVal < 0.0 ? stack.negativePercent : stack.positivePercent;
  3422. r.dep1 = sum;
  3423. r.dep2 = sum + percent;
  3424. r.cdep = r.dep2;
  3425. r.color = color ? color(d) : null;
  3426. r.label = label ? label(d) : null;
  3427. r.value = dVal;
  3428. r.valueAsPercentOfCategory = percent;
  3429. r._originalData = d;
  3430. result.push(r);
  3431. if (dVal < 0.0) {
  3432. stack.negativePercent += percent;
  3433. } else {
  3434. stack.positivePercent += percent;
  3435. }
  3436. }
  3437. }
  3438. return null;
  3439. });
  3440. } else {
  3441. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3442. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3443. var o = __exp_enFor0[__i_enFor0];
  3444. var s = ""+(o);
  3445. var sum = 0;
  3446. for (var i = 0; i < result.length; ++i) {
  3447. var iData = result[i];
  3448. if (s == iData.ind1) {
  3449. var value = + (iData.value);
  3450. sum += Math.abs(value);
  3451. }
  3452. }
  3453. if (sum == 0) {
  3454. continue;
  3455. }
  3456. for (var i = 0; i < result.length; ++i) {
  3457. var iData = result[i];
  3458. if (s == iData.ind1) {
  3459. var value = + (iData.value);
  3460. iData.valueAsPercentOfCategory = value / sum * 100;
  3461. }
  3462. }
  3463. }
  3464. }
  3465. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3466. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3467. var o = __exp_enFor1[__i_enFor1];
  3468. var s = ""+(o);
  3469. var sum = 0;
  3470. for (var i = 0; i < result.length; ++i) {
  3471. var iData = result[i];
  3472. if (s == iData.color) {
  3473. var value = + (iData.value);
  3474. sum += Math.abs(value);
  3475. }
  3476. }
  3477. if (sum == 0) {
  3478. continue;
  3479. }
  3480. for (var i = 0; i < result.length; ++i) {
  3481. var iData = result[i];
  3482. if (s == iData.color) {
  3483. var value = + (iData.value);
  3484. iData.valueAsPercentOfColor = value / sum * 100;
  3485. }
  3486. }
  3487. }
  3488. return result;
  3489. };
  3490. /**
  3491. * Structure class holding interval information.
  3492. */
  3493. com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData = rave['internal']['Declare']({
  3494. /**
  3495. * Key value; for now this is the data index
  3496. */
  3497. /** @expose */
  3498. key : null,
  3499. /**
  3500. * First independent value
  3501. */
  3502. /** @expose */
  3503. ind1 : null,
  3504. /**
  3505. * Second independent value (in all current uses, same as ind1)
  3506. */
  3507. /** @expose */
  3508. ind2 : null,
  3509. /**
  3510. * First dependent value
  3511. */
  3512. /** @expose */
  3513. dep1 : null,
  3514. /**
  3515. * Second dependent value
  3516. */
  3517. /** @expose */
  3518. dep2 : null,
  3519. /**
  3520. * The data value that the interval represents. Not the pixel value. Used in stacked chart
  3521. */
  3522. /** @expose */
  3523. value : null,
  3524. /**
  3525. * Color value
  3526. */
  3527. /** @expose */
  3528. color : null,
  3529. /**
  3530. * Label value
  3531. */
  3532. /** @expose */
  3533. label : null,
  3534. /**
  3535. * Callout independent value (in all current uses, same as ind1)
  3536. */
  3537. /** @expose */
  3538. cind : null,
  3539. /**
  3540. * Callout dependent value (dependent extent)
  3541. */
  3542. /** @expose */
  3543. cdep : null,
  3544. /** @expose */
  3545. _originalData : null,
  3546. /**
  3547. * The data value (in percentage) for specific category
  3548. */
  3549. /** @expose */
  3550. valueAsPercentOfCategory : NaN,
  3551. /**
  3552. * The data value (in percentage) across all categories
  3553. */
  3554. /** @expose */
  3555. valueAsPercentOfColor : NaN,
  3556. /** @expose */
  3557. originalData : function() {
  3558. return this._originalData;
  3559. },
  3560. /** @expose */
  3561. originalDataList : function() {
  3562. var list = [];
  3563. list.push(this._originalData);
  3564. return list;
  3565. }
  3566. });
  3567. com_ibm_rave_bundles_components_IntervalDataUtilities.Stack = function() {
  3568. this.positiveCount = 0;
  3569. this.positiveSum = 0;
  3570. this.negativeSum = 0;
  3571. this.positivePercent = 0;
  3572. this.negativePercent = 0;
  3573. };
  3574. /**
  3575. * Accessor for the callout dependent value
  3576. */
  3577. /** @expose */
  3578. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_DEPENDENT_ACCESSOR = function(data) {
  3579. return (data).cdep;
  3580. };
  3581. /**
  3582. * Accessor for the callout independent value
  3583. */
  3584. /** @expose */
  3585. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_INDEPENDENT_ACCESSOR = function(data) {
  3586. return (data).cind;
  3587. };
  3588. /**
  3589. * Accessor for the data value
  3590. */
  3591. /** @expose */
  3592. com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR = function(data) {
  3593. return (data).value;
  3594. };
  3595. /**
  3596. * Accessor for data value as percent of category
  3597. */
  3598. /** @expose */
  3599. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(data) {
  3600. var percent = (data).valueAsPercentOfCategory;
  3601. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3602. };
  3603. /**
  3604. * Accessor for data value as percent of color (series)
  3605. */
  3606. /** @expose */
  3607. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(data) {
  3608. var percent = (data).valueAsPercentOfColor;
  3609. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3610. };
  3611. // $source: com/ibm/rave/bundles/data/PointDataUtilities
  3612. /************************************************************************
  3613. ** IBM Confidential
  3614. **
  3615. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3616. **
  3617. ** (C) Copyright IBM Corp. 2017
  3618. **
  3619. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3620. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3621. ************************************************************************/
  3622. // GENERATED
  3623. /**
  3624. * Utility class for building arrays of point datum objects from tabular data.
  3625. */
  3626. var com_ibm_rave_bundles_data_PointDataUtilities = rave['internal']['Declare']({
  3627. });
  3628. /**
  3629. * <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>
  3630. * @param (Array) data Input data, list of arbitrary objects
  3631. * @param (rave['internal']['SingleValueFunction']) xAccessor X accessor function, may be null
  3632. * @param (rave['internal']['SingleValueFunction']) xScale Scale to test if the X value should be included, may be null
  3633. * @param (rave['internal']['SingleValueFunction']) yAccessor Y accessor function, may be null
  3634. * @param (rave['internal']['SingleValueFunction']) yScale Scale to test if the Y value should be included, may be null
  3635. * @return (Array) List of PointData objects
  3636. */
  3637. /** @expose */
  3638. com_ibm_rave_bundles_data_PointDataUtilities.buildPoints = function(data, xAccessor, xScale, yAccessor, yScale) {
  3639. var result = [];
  3640. if (data) {
  3641. for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
  3642. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3643. var o = __exp_enFor0[__i_enFor0];
  3644. if (o != null) {
  3645. var xv = null;
  3646. if (xAccessor) {
  3647. xv = xAccessor(o);
  3648. if (xv == null || (xScale && xScale(xv) == null)) {
  3649. continue;
  3650. }
  3651. }
  3652. var yv = null;
  3653. if (yAccessor) {
  3654. yv = yAccessor(o);
  3655. if (yv == null || (yScale && yScale(yv) == null)) {
  3656. continue;
  3657. }
  3658. }
  3659. var datum = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
  3660. datum._x = xv;
  3661. datum._y = yv;
  3662. datum._originalData = o;
  3663. result.push(datum);
  3664. }
  3665. }
  3666. }
  3667. return result;
  3668. };
  3669. /**
  3670. * 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.
  3671. */
  3672. com_ibm_rave_bundles_data_PointDataUtilities.PointDatum = rave['internal']['Declare']({
  3673. /**
  3674. * The X value
  3675. */
  3676. /** @expose */
  3677. _x : null,
  3678. /**
  3679. * The Y value
  3680. */
  3681. /** @expose */
  3682. _y : null,
  3683. /**
  3684. * The data value (in percentage) that the point represents
  3685. */
  3686. /** @expose */
  3687. _yAsPercentOfCategory : null,
  3688. /**
  3689. * The data value (in percentage) that the point represents
  3690. */
  3691. /** @expose */
  3692. _yAsPercentOfColor : null,
  3693. /**
  3694. * The original data
  3695. */
  3696. /** @expose */
  3697. _originalData : null,
  3698. /** @expose */
  3699. originalData : function() {
  3700. return this._originalData;
  3701. },
  3702. /** @expose */
  3703. originalDataList : function() {
  3704. var list = [];
  3705. list.push(this._originalData);
  3706. return list;
  3707. }
  3708. });
  3709. /**
  3710. * Accessor returning the _x property of a PointDatum.
  3711. */
  3712. /** @expose */
  3713. com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR = function(d) {
  3714. return (d)._x;
  3715. };
  3716. /**
  3717. * Accessor returning the _y property of a PointDatum.
  3718. */
  3719. /** @expose */
  3720. com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR = function(d) {
  3721. return (d)._y;
  3722. };
  3723. /**
  3724. * Accessor returning the _yAsPercentOfCategory property of a PointDatum.
  3725. */
  3726. /** @expose */
  3727. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(d) {
  3728. var percent = + ((d)._yAsPercentOfCategory);
  3729. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3730. };
  3731. /**
  3732. * Accessor returning the _yAsPercentOfColor property of a PointDatum.
  3733. */
  3734. /** @expose */
  3735. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(d) {
  3736. var percent = + ((d)._yAsPercentOfColor);
  3737. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3738. };
  3739. // $source: com/ibm/rave/bundles/utilities/ColorUtil
  3740. /************************************************************************
  3741. ** IBM Confidential
  3742. **
  3743. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3744. **
  3745. ** (C) Copyright IBM Corp. 2017
  3746. **
  3747. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3748. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3749. ************************************************************************/
  3750. // GENERATED
  3751. var com_ibm_rave_bundles_utilities_ColorUtil = rave['internal']['Declare']({
  3752. });
  3753. /**
  3754. * It is used to get a foreground color which has atleast a 4.5 contrast ratio with the background color.
  3755. * @param (Object) bg bakground color
  3756. * @param (Object) fg foreground color
  3757. * @return (Object) a color ( darker/ligher/same fg color ) which contrast with background.
  3758. */
  3759. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0 = function(bg, fg) {
  3760. var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(bg, fg);
  3761. if (contrastRatio < 4.5) {
  3762. var bgHSL = rave.hsl(bg);
  3763. var fgHSL = rave.hsl(fg);
  3764. 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);
  3765. if (brightness > 0.5) {
  3766. if (bgHSL.getL() > 0.5) {
  3767. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), bgHSL.getL() - 0.4));
  3768. } else {
  3769. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), 0.1));
  3770. }
  3771. } else {
  3772. if (bgHSL.getL() < 0.5) {
  3773. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), bgHSL.getL() + 0.4));
  3774. } else {
  3775. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), 0.9));
  3776. }
  3777. }
  3778. }
  3779. return fg;
  3780. };
  3781. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1 = function(labelColor) {
  3782. var labelRGB = rave.rgb(labelColor);
  3783. return labelRGB.contrastShift(21);
  3784. };
  3785. /** @expose */
  3786. com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio = function(colorA, colorB) {
  3787. var foregroundLuminance = rave.rgb(colorA).getLuminance();
  3788. var backgroundLuminance = rave.rgb(colorB).getLuminance();
  3789. var contrastRatio = (foregroundLuminance >= backgroundLuminance) ? (foregroundLuminance + 0.05) / (backgroundLuminance + 0.05) : (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
  3790. return contrastRatio;
  3791. };
  3792. /** @expose */
  3793. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor = function(a0, a1) {
  3794. var args = arguments;
  3795. if (args.length == 1) {
  3796. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1(a0);
  3797. }
  3798. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0(a0, a1);
  3799. };
  3800. // $source: com/ibm/rave/bundles/component/PointComponent
  3801. /************************************************************************
  3802. ** IBM Confidential
  3803. **
  3804. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3805. **
  3806. ** (C) Copyright IBM Corp. 2017
  3807. **
  3808. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3809. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3810. ************************************************************************/
  3811. // GENERATED
  3812. /**
  3813. * <p> A component that renders point elements (glyphs based on data, showing a point with X and Y dimensions, as in a scatterplot chart). The {@link #this.type()} method returns "PointComponent". </p>
  3814. */
  3815. var com_ibm_rave_bundles_component_PointComponent = rave['internal']['Declare'].implement(
  3816. /**
  3817. * The default size used for a point, when no size scale is used or when the size data for the element is null.
  3818. * @param (double) defaultSize The new defaultSize
  3819. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  3820. */
  3821. //defaultSize : function(defaultSize) {},
  3822. /**
  3823. * Turn labels on or off. If labels are on but there is no label data, empty text nodes will be created.
  3824. * @param (boolean) itemLabel Whether to use labels
  3825. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  3826. */
  3827. //itemLabel : function(itemLabel) {},
  3828. /**
  3829. * Whether to drop overlapping labels.
  3830. * @param (boolean) itemOverlap The new itemOverlap
  3831. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  3832. */
  3833. //itemOverlap : function(itemOverlap) {},
  3834. /**
  3835. * The symbol to be used for the points.
  3836. * @param (String) symbol The new symbol
  3837. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  3838. */
  3839. //symbol : function(symbol) {},
  3840. /**
  3841. * Set the width of border
  3842. * @param (String) borderWidth CSS value
  3843. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  3844. */
  3845. //borderWidth : function(borderWidth) {},
  3846. /**
  3847. * Set the color of border
  3848. * @param (String) borderColor
  3849. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  3850. */
  3851. //borderColor : function(borderColor) {},
  3852. /**
  3853. * Set the classname of the labellayer
  3854. * @param string
  3855. * @return (com.ibm.rave.bundles.component.PointComponent) This object
  3856. */
  3857. //labelLayerClassName : function(className) {},
  3858. /**
  3859. * Set the classname of the elementlayer
  3860. * @param string
  3861. * @return (com.ibm.rave.bundles.component.PointComponent) This object
  3862. */
  3863. //elementLayerClassName : function(className) {},
  3864. /**
  3865. * Sets function that will specify position of item label for given chart element.
  3866. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  3867. * @return (com.ibm.rave.bundles.component.PointComponent) This object
  3868. */
  3869. //itemLabelPosition : function(labelPosition) {}
  3870. );
  3871. /**
  3872. * The string returned by {@link #this.type()} is "PointComponent".
  3873. */
  3874. /** @expose */
  3875. com_ibm_rave_bundles_component_PointComponent.COMPONENT_TYPE = "PointComponent";
  3876. // $source: com/ibm/rave/bundles/utilities/PathUtils
  3877. /************************************************************************
  3878. ** IBM Confidential
  3879. **
  3880. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3881. **
  3882. ** (C) Copyright IBM Corp. 2017
  3883. **
  3884. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3885. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3886. ************************************************************************/
  3887. // GENERATED
  3888. var com_ibm_rave_bundles_utilities_PathUtils = rave['internal']['Declare']({
  3889. });
  3890. /**
  3891. * Transition a path element selection with a fade-out-fade-in effect. In many cases, transitioning between two unrelated path strings will result in an undesirable morphing effect. This method allows the path to first fade out (to opacity 0), update the path string without morphing, then fade back in.
  3892. * @param (rave['internal']['Selection']) selection A selection (either Selector or Transition) containing "path" elements.
  3893. * @param (rave['internal']['ValueFunction']) pathFunction The path string generator function, e.g. Rave.svg.line().
  3894. */
  3895. /** @expose */
  3896. com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn = function(selection, pathFunction) {
  3897. if (selection.isTransition()) {
  3898. var transition = selection;
  3899. transition.ease("linear").styleTween("opacity", function(data, index, value) {
  3900. var path = rave.select(this);
  3901. if (!(this.rave_hasProperty("__rave_originalOpacity__"))) {
  3902. this.rave_setProperty("__rave_originalOpacity__", path.style("opacity"));
  3903. }
  3904. var styleOpacity = this.rave_getProperty("__rave_originalOpacity__");
  3905. var opacity = styleOpacity != null ? parseFloat(""+(styleOpacity)) : 1.0;
  3906. var mid1 = 0.45, mid2 = 0.55;
  3907. var s = rave.scale.linear().domain([0.0, mid1, mid2, 1.0]).range([opacity, 0.0, 0.0, opacity]);
  3908. var setPath = [];
  3909. setPath[0] = false;
  3910. return function(t) {
  3911. if (t > mid1 && !setPath[0]) {
  3912. path.attr("d", pathFunction);
  3913. setPath[0] = true;
  3914. }
  3915. return + (s.call(null, t, 0, 0));
  3916. };
  3917. });
  3918. transition.each("end", function(args) {
  3919. if (args !== null || arguments.length > 1){
  3920. args = Array.prototype.slice.call(arguments, 0);
  3921. }
  3922. {
  3923. this.rave_removeProperty("__rave_originalOpacity__");
  3924. return null;
  3925. }
  3926. });
  3927. } else {
  3928. selection.attr("d", pathFunction);
  3929. }
  3930. };
  3931. //com_ibm_rave_bundles_utilities_PathUtils.OPACITY = "opacity";
  3932. //com_ibm_rave_bundles_utilities_PathUtils.ORIGINAL_OPACITY = "__rave_originalOpacity__";
  3933. //com_ibm_rave_bundles_utilities_PathUtils.PATH_DATA = "d";
  3934. //com_ibm_rave_bundles_utilities_PathUtils.EASE_LINEAR = "linear";
  3935. // $source: com/ibm/rave/bundles/utilities/LabelStyleUtil
  3936. /************************************************************************
  3937. ** IBM Confidential
  3938. **
  3939. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3940. **
  3941. ** (C) Copyright IBM Corp. 2017
  3942. **
  3943. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3944. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3945. ************************************************************************/
  3946. // GENERATED
  3947. //@import com/ibm/rave/bundles/components/FilterComponentImpl (runtime) // new
  3948. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor, getContrastRatio
  3949. /**
  3950. * This class can be used to apply styles on labels. Eg: when we need to overrule the given label style properties.
  3951. */
  3952. var com_ibm_rave_bundles_utilities_LabelStyleUtil = rave['internal']['Declare']({
  3953. //_labelFontStyle : null,
  3954. //_contrastLabelColorfilter : null,
  3955. //_sameLabelColorfilter : null,
  3956. /**
  3957. * eg: apply contrast label color with background. apply different font size for each level label. apply a contrast shadow for a label.
  3958. */
  3959. //_labelFillColor : null,
  3960. //_labelFontSize : null,
  3961. _labelShadow : false,
  3962. _$functionClassMethod : function() {
  3963. var _$self = function(args) {
  3964. if (args !== null || arguments.length > 1){
  3965. args = Array.prototype.slice.call(arguments, 0);
  3966. }
  3967. {
  3968. if (_$self._labelFontStyle) {
  3969. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(_$self._labelFontStyle), __len_enFor0 = __exp_enFor0.length;
  3970. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3971. var stylenName = __exp_enFor0[__i_enFor0];
  3972. if ((stylenName == "fill" || stylenName == "color" && _$self._labelFillColor) || (stylenName == "font-size" && _$self._labelFontSize) || (stylenName == "text-shadow" && _$self._labelShadow == true)) {
  3973. continue;
  3974. }
  3975. this.style(stylenName, _$self._labelFontStyle[stylenName]);
  3976. }
  3977. }
  3978. if (_$self._labelFillColor) {
  3979. this.style("fill", _$self._labelFillColor);
  3980. }
  3981. if (_$self._labelFontSize) {
  3982. this.style("font-size", _$self._labelFontSize);
  3983. }
  3984. var labels = this.selectAll("*");
  3985. if (labels.length == 0) {
  3986. labels = this;
  3987. }
  3988. if (_$self._labelShadow) {
  3989. var self = _$self;
  3990. var defaultLabelFill = _$self.getDefaultLabelColor(_$self._labelFontStyle);
  3991. _$self._contrastLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("contrast_label_drop_shadow");
  3992. _$self._contrastLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill)));
  3993. _$self._sameLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("same_label_drop_shadow");
  3994. _$self._sameLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(defaultLabelFill));
  3995. var owner = this.node().rave_getOwner();
  3996. rave.select(owner).select("defs").call(_$self._contrastLabelColorfilter);
  3997. rave.select(owner).select("defs").call(_$self._sameLabelColorfilter);
  3998. this.each(function(data, index, groupIndex) {
  3999. if (self._labelFillColor) {
  4000. var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(rave.rgb(self._labelFillColor.call(this, data, index, groupIndex)), defaultLabelFill);
  4001. if (contrastRatio < 4.5) {
  4002. this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
  4003. } else {
  4004. this.setAttribute("filter", "url(#" + self._sameLabelColorfilter.getId() + ")");
  4005. }
  4006. } else {
  4007. this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
  4008. }
  4009. });
  4010. labels.each(function(data, index, groupIndex) {
  4011. if (self._labelFillColor) {
  4012. this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._labelFillColor.call(this, data, index, groupIndex)).toString());
  4013. } else {
  4014. this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill).toString());
  4015. }
  4016. });
  4017. } else {
  4018. labels.each(function(data, index, groupIndex) {
  4019. this.rave_setProperty("_rave_drop_shadow", null);
  4020. });
  4021. this.attr("filter", null);
  4022. }
  4023. return null;
  4024. }
  4025. };
  4026. return _$self;
  4027. },
  4028. /** @expose */
  4029. labelFont : function(labelFontStyle) {
  4030. this._labelFontStyle = labelFontStyle;
  4031. return this;
  4032. },
  4033. /** @expose */
  4034. labelFillColor : function(_labelFillColor) {
  4035. this._labelFillColor = _labelFillColor;
  4036. return this;
  4037. },
  4038. /** @expose */
  4039. labelFontSize : function(_labelFontSize) {
  4040. this._labelFontSize = _labelFontSize;
  4041. return this;
  4042. },
  4043. /** @expose */
  4044. labelShadow : function(labelShadow) {
  4045. this._labelShadow = labelShadow;
  4046. return this;
  4047. },
  4048. /** @expose */
  4049. getDefaultLabelColor : function(_labelStyle) {
  4050. if (!_labelStyle) {
  4051. return "#000000";
  4052. }
  4053. var defaultFillColor;
  4054. if (_labelStyle) {
  4055. defaultFillColor = _labelStyle["fill"];
  4056. if (defaultFillColor == null) {
  4057. defaultFillColor = _labelStyle["color"];
  4058. }
  4059. }
  4060. if (defaultFillColor == null) {
  4061. defaultFillColor = "#000000";
  4062. }
  4063. return defaultFillColor.toString();
  4064. }
  4065. });
  4066. // $source: com/ibm/rave/bundles/component/PackedBubbleComponent
  4067. /************************************************************************
  4068. ** IBM Confidential
  4069. **
  4070. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4071. **
  4072. ** (C) Copyright IBM Corp. 2017
  4073. **
  4074. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4075. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4076. ************************************************************************/
  4077. // GENERATED
  4078. /**
  4079. * <p> A component that renders packed bubble layouts using one of the core or capability node-packing algorithms. The {@link #this.type()} method returns "PackedBubbleComponent". </p>
  4080. */
  4081. var com_ibm_rave_bundles_component_PackedBubbleComponent = rave['internal']['Declare'].implement(
  4082. /**
  4083. * Turn labels on or off. If labels are on but there is no label data, empty text nodes will be created.
  4084. * @param (boolean) itemLabel Whether to use labels
  4085. * @return (com.ibm.rave.bundles.component.PackedBubbleComponent) This component
  4086. */
  4087. //itemLabel : function(itemLabel) {},
  4088. /**
  4089. * Set the border width of the bubbles
  4090. * @param (String) borderWidth
  4091. * @return (com.ibm.rave.bundles.component.PackedBubbleComponent) This component
  4092. */
  4093. //borderWidth : function(borderWidth) {},
  4094. /**
  4095. * Set the border color of the bubbles.
  4096. * @param (String) borderColor
  4097. * @return (com.ibm.rave.bundles.component.PackedBubbleComponent) This component
  4098. */
  4099. //borderColor : function(borderColor) {},
  4100. /**
  4101. * Set the classname of the labellayer
  4102. * @param string
  4103. * @return (com.ibm.rave.bundles.component.PackedBubbleComponent) This object
  4104. */
  4105. //labelLayerClassName : function(className) {},
  4106. /**
  4107. * Set the classname of the elementlayer
  4108. * @param string
  4109. * @return (com.ibm.rave.bundles.component.PackedBubbleComponent) This object
  4110. */
  4111. //elementLayerClassName : function(className) {}
  4112. );
  4113. /**
  4114. * The string returned by {@link #this.type()} is "PackedBubbleComponent".
  4115. */
  4116. /** @expose */
  4117. com_ibm_rave_bundles_component_PackedBubbleComponent.COMPONENT_TYPE = "PackedBubbleComponent";
  4118. // $source: com/ibm/rave/bundles/components/ComponentConfiguration
  4119. /************************************************************************
  4120. ** IBM Confidential
  4121. **
  4122. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4123. **
  4124. ** (C) Copyright IBM Corp. 2017
  4125. **
  4126. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4127. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4128. ************************************************************************/
  4129. // GENERATED
  4130. /**
  4131. * Utility class that does configuration for components, optionally drawing them into selections. Some of the configuration information is taken from a bundle context, and uses standard property IDs as defined in the shared property files and {@link (rave['library']['internal']['CommonPropertyIDs']) CommonPropertyIDs} . If a bundle does not use define the expected properties, an error will occur. In this documentation the property ID is referred to by the CommonPropertyIDs constant, for example property LEGEND_DISPLAY means the property with the ID {@link this.CommonPropertyIDs#"legend.display"} .
  4132. */
  4133. var com_ibm_rave_bundles_components_ComponentConfiguration = rave['internal']['Declare']({
  4134. //constructor : function() {}
  4135. });
  4136. /**
  4137. * <p> Do "standard" configuration of a Zoom and optionally run it on a selection. If the provided Zoom is null a new one is created. Component properties are set as follows: </p> <ul> <li>zoom#x is the xScale if that is non-null, and is not set if it is null</li> <li>zoom#y is the yScale if that is non-null, and is not set if it is null</li> <li>zoom#scaleExtent is the scaleExtent if that is non-null, or (0.2,5.0) otherwise</li> <li>zoom#on binds the "zoom" events to the callback</li> </ul> <p> Note that it is not possible to remove a scale from an existing zoom, since the core Zoom does not allow null scales in the x() and y() methods. To do that, first disable any existing zoom (with Selector#on("zoom",null)) then call this method with a null Zoom. </p> <p> The scales are ordered x, y, x2, y2 in the parameters and in the p and s arrays, since most charts will only have the x and y scales. </p>
  4138. * @param (rave['internal']['Selection']) chart Selection on which to run the zoom, may be null
  4139. * @param (rave['internal']['Zoom']) zoom The Zoom; if null one is created and returned
  4140. * @param (rave['library']['internal']['CoordinateScaleImpl']) xScale X dimension scale, may be null
  4141. * @param (rave['library']['internal']['CoordinateScaleImpl']) yScale Y dimension scale, may be null
  4142. * @param (rave['library']['internal']['CoordinateScaleImpl']) x2Scale X2 dimension scale, may be null
  4143. * @param (rave['library']['internal']['CoordinateScaleImpl']) y2Scale Y2 dimension scale, may be null
  4144. * @param (Array) scaleExtent Scale extent, may be null; if null the range 0.2 to 5.0 is used
  4145. * @param (rave['internal']['RectStruct']) chartRect The rectangle of the chart
  4146. * @param (double[]) p the zoom translate position (x, y, x2, y2)
  4147. * @param (double[]) s the zoom scale (x, y, x2, y2)
  4148. * @param (String) zoomOps The zoom operation (x|y|x2|y2|all)
  4149. * @param (rave['internal']['RunFunction']) callback Callback on each zoom event, must not be null
  4150. * @return (rave['internal']['Zoom']) The zoom
  4151. */
  4152. /** @expose */
  4153. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom = function(chart, zoom, xScale, yScale, x2Scale, y2Scale, scaleExtent, chartRect, p, s, zoomOps, callback) {
  4154. var z = zoom ? zoom : rave.behavior.zoom();
  4155. var z1 = (x2Scale || y2Scale) && zoomOps == "all" ? rave.behavior.zoom() : null;
  4156. var dummyScale = (rave.scale.linear());
  4157. z.x(dummyScale);
  4158. z.y(dummyScale);
  4159. if (xScale && zoomOps == "x") {
  4160. z.x(xScale.scale());
  4161. z.scale(s[0]);
  4162. z.translate([p[0], 0]);
  4163. }
  4164. if (yScale && zoomOps == "y") {
  4165. z.y(yScale.scale());
  4166. z.scale(s[1]);
  4167. z.translate([0, p[1]]);
  4168. }
  4169. if (x2Scale && zoomOps == "x2") {
  4170. z.x(x2Scale.scale());
  4171. z.scale(s[2]);
  4172. z.translate([p[2], 0]);
  4173. }
  4174. if (y2Scale && zoomOps == "y2") {
  4175. z.y(y2Scale.scale());
  4176. z.scale(s[3]);
  4177. z.translate([0, p[3]]);
  4178. }
  4179. if (zoomOps == "all") {
  4180. if (xScale) {
  4181. z.x(xScale.scale());
  4182. }
  4183. if (yScale) {
  4184. z.y(yScale.scale());
  4185. }
  4186. z.scale(1);
  4187. z.translate([0, 0]);
  4188. if (z1) {
  4189. if (x2Scale) {
  4190. z1.x(x2Scale.scale());
  4191. }
  4192. if (y2Scale) {
  4193. z1.y(y2Scale.scale());
  4194. }
  4195. z1.scale(1);
  4196. z1.translate([0, 0]);
  4197. }
  4198. }
  4199. z.scaleExtent(scaleExtent ? scaleExtent : [1, Infinity]).on("zoom.default", function(args) {
  4200. if (args !== null || arguments.length > 1){
  4201. args = Array.prototype.slice.call(arguments, 0);
  4202. }
  4203. {
  4204. var event = args[3];
  4205. var scale = event.scale;
  4206. var translate = event.translate;
  4207. var scaledX = chartRect.x * (scale - 1);
  4208. var scaledXExtent = (chartRect.width * (1 - scale)) - scaledX;
  4209. translate[0] = Math.min(-scaledX, Math.max(scaledXExtent, translate[0]));
  4210. var scaledY = chartRect.y * (scale - 1);
  4211. var scaledYExtent = (chartRect.height * (1 - scale)) - scaledY;
  4212. translate[1] = Math.min(-scaledY, Math.max(scaledYExtent, translate[1]));
  4213. z.translate([translate[0], translate[1]]);
  4214. if (z1) {
  4215. z1.translate([translate[0], translate[1]]);
  4216. z1.scale(scale);
  4217. }
  4218. if (zoomOps == "x") {
  4219. p[0] = translate[0];
  4220. s[0] = scale;
  4221. } else if (zoomOps == "y") {
  4222. p[1] = translate[1];
  4223. s[1] = scale;
  4224. } else if (zoomOps == "x2") {
  4225. p[2] = translate[0];
  4226. s[2] = scale;
  4227. } else if (zoomOps == "y2") {
  4228. p[3] = translate[1];
  4229. s[3] = scale;
  4230. } else if (zoomOps == "all") {
  4231. p[0] = translate[0];
  4232. p[1] = translate[1];
  4233. p[2] = translate[0];
  4234. p[3] = translate[1];
  4235. s[0] = scale;
  4236. s[1] = scale;
  4237. s[2] = scale;
  4238. s[3] = scale;
  4239. }
  4240. return callback.apply(this, args);
  4241. }
  4242. });
  4243. return z;
  4244. };
  4245. // $source: com/ibm/rave/bundles/data/HierarchyBundleDatum
  4246. /************************************************************************
  4247. ** IBM Confidential
  4248. **
  4249. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4250. **
  4251. ** (C) Copyright IBM Corp. 2017
  4252. **
  4253. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4254. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4255. ************************************************************************/
  4256. // GENERATED
  4257. /**
  4258. * Bundle datum wrapper for Core hierarchical data types.
  4259. */
  4260. var com_ibm_rave_bundles_data_HierarchyBundleDatum = rave['internal']['Declare']({
  4261. /** @expose */
  4262. _hierarchyNode : null,
  4263. /** @expose */
  4264. originalData : function() {
  4265. return this._hierarchyNode["data"];
  4266. },
  4267. /** @expose */
  4268. originalDataList : function() {
  4269. var list = [];
  4270. list.push(this._hierarchyNode["data"]);
  4271. return list;
  4272. }
  4273. });
  4274. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModule
  4275. /************************************************************************
  4276. ** IBM Confidential
  4277. **
  4278. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4279. **
  4280. ** (C) Copyright IBM Corp. 2015
  4281. **
  4282. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4283. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4284. ************************************************************************/
  4285. // Must be the first import
  4286. // @import ./BundleModuleHeader
  4287. // expose DataFormatter to the global variable rave
  4288. //rave["library"]["CustomFormatter"]=com_ibm_rave_library_framework_CustomFormatter;
  4289. // $source: com/ibm/rave/bundles/bubbleBundle/BubbleBundle
  4290. /************************************************************************
  4291. ** IBM Confidential
  4292. **
  4293. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4294. **
  4295. ** (C) Copyright IBM Corp. 2017
  4296. **
  4297. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4298. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4299. ************************************************************************/
  4300. // GENERATED
  4301. //@import com/ibm/rave/library/Library (static) // Library
  4302. //@import com/ibm/rave/bundles/RaveBundle (loadtime) // superclass
  4303. //@import com/ibm/rave/bundles/bubbleBundle/BubbleView (runtime) // new
  4304. var com_ibm_rave_bundles_bubbleBundle_BubbleBundle = rave['internal']['Declare'](com_ibm_rave_bundles_RaveBundle, {
  4305. /** @expose */
  4306. getName : function() {
  4307. return com_ibm_rave_bundles_bubbleBundle_BubbleBundle.BUNDLE_NAME;
  4308. },
  4309. /** @expose */
  4310. createView : function(ctx) {
  4311. return new com_ibm_rave_bundles_bubbleBundle_BubbleView(ctx);
  4312. }
  4313. //constructor : function() {}
  4314. });
  4315. /**
  4316. * Register the bundle factory with the library. The bundle will not be made available if this method is not called.
  4317. */
  4318. /** @expose */
  4319. com_ibm_rave_bundles_bubbleBundle_BubbleBundle.init = function() {
  4320. if (!(com_ibm_rave_library_Library.bundle.isRegistered(com_ibm_rave_bundles_bubbleBundle_BubbleBundle.BUNDLE_NAME))) {
  4321. var bundle;
  4322. com_ibm_rave_library_Library.bundle.extension(com_ibm_rave_bundles_bubbleBundle_BubbleBundle.BUNDLE_NAME, function() {
  4323. if (!bundle) {
  4324. bundle = new com_ibm_rave_bundles_bubbleBundle_BubbleBundle();
  4325. bundle.loadResources();
  4326. require("./vizlibrary-bubble.css");
  4327. }
  4328. return bundle;
  4329. });
  4330. }
  4331. return com_ibm_rave_bundles_bubbleBundle_BubbleBundle.BUNDLE_NAME;
  4332. };
  4333. com_ibm_rave_bundles_bubbleBundle_BubbleBundle.BUNDLE_NAME = "bubbleBundle";
  4334. // Auto initialization
  4335. com_ibm_rave_bundles_bubbleBundle_BubbleBundle.init();
  4336. if (!com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_bubbleBundle_BubbleBundle.BUNDLE_NAME]) {
  4337. com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_bubbleBundle_BubbleBundle.BUNDLE_NAME] = function() {
  4338. if (!bundle) {
  4339. bundle = new com_ibm_rave_bundles_bubbleBundle_BubbleBundle();
  4340. bundle.loadResources();
  4341. require("./vizlibrary-bubble.css");
  4342. }
  4343. return bundle;
  4344. };
  4345. } else {
  4346. console.log("Could not register extension: BubbleBundle");
  4347. }
  4348. // $source: com/ibm/rave/bundles/bubbleBundle/BubbleView
  4349. /************************************************************************
  4350. ** IBM Confidential
  4351. **
  4352. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4353. **
  4354. ** (C) Copyright IBM Corp. 2019
  4355. **
  4356. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4357. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4358. ************************************************************************/
  4359. // GENERATED
  4360. //@import com/ibm/rave/bundles/views/BundleView (loadtime) // superclass
  4361. //@import com/ibm/rave/bundles/components/PointComponentImpl (runtime) // new
  4362. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities, buildPoints
  4363. //@import com/ibm/rave/bundles/components/PackedBubbleComponentImpl (runtime) // new
  4364. //@import com/ibm/rave/bundles/components/FilterComponentImpl (runtime) // new
  4365. //@import com/ibm/rave/bundles/components/ComponentConfiguration (runtime) // configureZoom
  4366. //@import com/ibm/rave/bundles/data/HierarchyBundleDatum (runtime) // new
  4367. /**
  4368. * Componentized version of the bubble view. This version does not yet handle the packed bubble view (we still need to resolve the design of hierarchical data). It shows a 2-axis scatterplot, and if the X and Y data slots are not defined the points are all in the center of the chart.
  4369. */
  4370. var com_ibm_rave_bundles_bubbleBundle_BubbleView = rave['internal']['Declare'](com_ibm_rave_bundles_views_BundleView, {
  4371. //handle : null,
  4372. /**
  4373. * Point component for scatterplots, created in setup
  4374. */
  4375. //_pointComponent : null,
  4376. /**
  4377. * Packed bubble component for packed layouts, created in setup
  4378. */
  4379. //_packedBubbleComponent : null,
  4380. //_filter : null,
  4381. /**
  4382. * Scatterplot data from last display: array of integrator-supplied data with non-null X and Y
  4383. */
  4384. //_scatterplotData : null,
  4385. /**
  4386. * Scatterplot data from last display: coordinate scales for X and Y
  4387. */
  4388. //independentScale : null, //dependentScale : null,
  4389. //zoomXScale : null, //zoomYScale : null,
  4390. /**
  4391. * Hierarchical data from last display: result of converting the integrator-supplied data to a tree
  4392. */
  4393. //_hierarchyData : null,
  4394. //zoomendedTimer : null,
  4395. clicked : false,
  4396. lastWasPacked : false,
  4397. scatter : false,
  4398. constructor : function(context) {
  4399. this._pointComponent = null;
  4400. this._packedBubbleComponent = null;
  4401. },
  4402. /** @expose */
  4403. isAxesManagerRequired : function() {
  4404. return true;
  4405. },
  4406. /** @expose */
  4407. setup : function() {
  4408. com_ibm_rave_bundles_views_BundleView.prototype.setup.call(this);
  4409. this._pointComponent = new com_ibm_rave_bundles_components_PointComponentImpl();
  4410. this._pointComponent.independentAccessor(com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR).dependentAccessor(com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR);
  4411. this._packedBubbleComponent = new com_ibm_rave_bundles_components_PackedBubbleComponentImpl();
  4412. this._filter = new com_ibm_rave_bundles_components_FilterComponentImpl(this.context.instanceId() + "drop_shadow");
  4413. var self = this;
  4414. var style = {};
  4415. style["stroke-width"] = "0px";
  4416. rave['library']['internal']['BundleUtils'].setupDefaultActions(this.context, ".chart .element-shape", style);
  4417. var zoomScatter = this.context.actions.action("zoom");
  4418. zoomScatter.setBindFn(function() {
  4419. if (self.scatter) {
  4420. self.context.node.selectAll(".chart").call(self.context.actions.action("zoom").get("zoom"));
  4421. }
  4422. });
  4423. var zoomAction = self.context.actions.action("zoomPackedBubble").setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
  4424. _$functionClassMethod : function() {
  4425. var _$self = function(args) {
  4426. if (args !== null || arguments.length > 1){
  4427. args = Array.prototype.slice.call(arguments);
  4428. }
  4429. {
  4430. self._packedBubbleComponent.clickAction(args[0]);
  4431. }
  4432. };
  4433. return _$self;
  4434. }
  4435. }))());
  4436. zoomAction.setBindFn(function() {
  4437. self.context.node.selectAll(".element-shape.packed-bubble-parent, .element-shape.packed-bubble-child").on("dblclick.default", function(data, index, groupIndex, event) {
  4438. zoomAction(data);
  4439. });
  4440. });
  4441. var toggleSelectionAction = this.context.actions.action("toggleSelect");
  4442. var deselectAllAction = this.context.actions.action("deselectAll");
  4443. var toggleSelectionListener = function(data, index, groupIndex, event) {
  4444. var selected = this;
  4445. if (self.clicked) {
  4446. self.clicked = false;
  4447. clearTimeout(self.handle);
  4448. } else {
  4449. self.clicked = true;
  4450. self.handle = setTimeout(function() {
  4451. self.clicked = false;
  4452. if (selected.rave_containsClass("packed-bubble-parent")) {
  4453. deselectAllAction(self.context.node.selectAll(".chart .element-shape"));
  4454. } else {
  4455. toggleSelectionAction(rave.select(selected), self.context.node.selectAll(".chart .element-shape").filter("*:not(.packed-bubble-parent)"));
  4456. }
  4457. }, 200);
  4458. }
  4459. };
  4460. toggleSelectionAction.setBindFn(function() {
  4461. self.context.node.selectAll(".chart .element-shape").on("click.default", toggleSelectionListener).on("touchstart.default", toggleSelectionListener);
  4462. });
  4463. },
  4464. /** @expose */
  4465. draw : function() {
  4466. if (this.isUpdateNothing()) {
  4467. return;
  4468. }
  4469. this.preDraw("g.vizlibrary-bubble");
  4470. if (!(this.validateDataModel("g.element-group", "g.axis"))) {
  4471. return;
  4472. }
  4473. if (this.updateType == 0) {
  4474. this.context.actions.action("deselectAll")(this.context.node.selectAll(".element-group .element-shape"));
  4475. }
  4476. this.setBorder("symbol.borderWidth", "symbol.borderColor");
  4477. var duration = this.getEffectDuration("");
  4478. this.setBackgroundProperties(this._layoutComponent.chartRect(), duration);
  4479. var dataSet = this.dataModel.dataset("data");
  4480. if ("tabular" == this.dataModel.getDescriptor().id()) {
  4481. var xDataSlotEntry = dataSet.slot("x").entry();
  4482. var yDataSlotEntry = dataSet.slot("y").entry();
  4483. this.scatter = (rave['library']['internal']['AbstractView'].accessorOf(xDataSlotEntry) || rave['library']['internal']['AbstractView'].accessorOf(yDataSlotEntry));
  4484. if (this.scatter) {
  4485. this.drawScatterplot(this._chart, this.dataModel, duration);
  4486. } else {
  4487. this.drawTabularPackedBubble(this._chart, dataSet, duration);
  4488. }
  4489. } else {
  4490. this.scatter = false;
  4491. this.drawHierarchicalPackedBubble(this._chart, dataSet, duration);
  4492. }
  4493. this.setShadow();
  4494. this.resetUpdate();
  4495. },
  4496. /** @expose */
  4497. getCoordinateScale : function(role) {
  4498. if ("ROLE_X1" == role) {
  4499. return this.independentScale;
  4500. }
  4501. if ("ROLE_Y1" == role) {
  4502. return this.dependentScale;
  4503. }
  4504. return null;
  4505. },
  4506. setShadow : function() {
  4507. var drop_shadow = (this.context.getPropertyValue("shadow.style"));
  4508. var style = rave['internal']['CSSUtil'].parseShadowStyle(drop_shadow);
  4509. if (style) {
  4510. this._filter.setDropshadow(this.context.convertCSSSizeToPixels(style[0]), this.context.convertCSSSizeToPixels(style[1]), this.context.convertCSSSizeToPixels(style[2]), style[3]);
  4511. this.context.node.select("defs").call(this._filter);
  4512. }
  4513. var enabled = style && this.getBooleanProperty("shadow.display");
  4514. this.applyShadow(this.context.node.select("g.element-group").selectAll("path.element-shape"), enabled, drop_shadow);
  4515. this.applyShadow(this.context.node.selectAll("path.packed-bubble-parent"), false, null);
  4516. this.applyShadow(this.context.node.select("g.legendGroup").selectAll("path.legendShape"), enabled, drop_shadow);
  4517. },
  4518. applyShadow : function(s, enabled, drop_shadow) {
  4519. s.attr("filter", enabled ? "url(#" + this._filter.getId() + ")" : null).property("_rave_drop_shadow", enabled ? drop_shadow : null);
  4520. },
  4521. /**
  4522. * Draw the scatterplot chart. The data model is tabular, at least one of the slots X and Y is non-null.
  4523. * @param (rave['internal']['Selector']) chart Selector for g.vislibrary-bubble
  4524. * @param (rave['library']['internal']['DataModel']) dataModel The data model
  4525. * @param (int) inDuration Duration of effects
  4526. */
  4527. drawScatterplot : function(chart, dataModel, inDuration) {
  4528. this.lastWasPacked = false;
  4529. var duration = inDuration;
  4530. var effect = this.getStringProperty("effect.name");
  4531. if (effect == null || "none" == effect) {
  4532. duration = 0;
  4533. }
  4534. var dataSet = dataModel.dataset("data");
  4535. var xDataSlotEntry = dataSet.slot("x").entry();
  4536. var yDataSlotEntry = dataSet.slot("y").entry();
  4537. var colorDataSlotEntry = dataSet.slot("color").entry();
  4538. var sizeDataSlotEntry = dataSet.slot("size").entry();
  4539. if (!colorDataSlotEntry) {
  4540. var label = null;
  4541. if (xDataSlotEntry && xDataSlotEntry.label() != null) {
  4542. label = xDataSlotEntry.label();
  4543. }
  4544. if (yDataSlotEntry && yDataSlotEntry.label() != null) {
  4545. label = label == null ? yDataSlotEntry.label() : label + ", " + yDataSlotEntry.label();
  4546. }
  4547. if (sizeDataSlotEntry && sizeDataSlotEntry.label() != null) {
  4548. label = label == null ? sizeDataSlotEntry.label() : label + ", " + sizeDataSlotEntry.label();
  4549. }
  4550. dataSet.slot("color").overrideLabel(label);
  4551. }
  4552. var xAccessor = rave['library']['internal']['AbstractView'].accessorOf(xDataSlotEntry);
  4553. var yAccessor = rave['library']['internal']['AbstractView'].accessorOf(yDataSlotEntry);
  4554. var originalData = (dataSet.data());
  4555. this._scatterplotData = com_ibm_rave_bundles_data_PointDataUtilities.buildPoints(originalData, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(originalData, xDataSlotEntry), yAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(originalData, yDataSlotEntry));
  4556. var glyphSize1 = Math.abs((+ (this.context.getPropertyValue("sizeScale.first"))));
  4557. var glyphSize2 = Math.abs((+ (this.context.getPropertyValue("sizeScale.second"))));
  4558. var domain = rave['library']['internal']['ScaleManager'].numericDomain(originalData, sizeDataSlotEntry);
  4559. var sizeScale = domain ? rave.scale.linear().domain(domain).range([glyphSize1, glyphSize2]) : null;
  4560. var colorPalette = this.getPalette();
  4561. colorPalette.setData(dataSet, "color");
  4562. colorPalette.setAccessor(rave['library']['internal']['AbstractView'].originalDatumAccessor(dataSet.slot("color").entry()));
  4563. colorPalette.setNullColor((this.context.getPropertyValue("color.null")));
  4564. var showLegend = this.isShowLegend();
  4565. var legendVisibilityChanged = this._legends.anyVisible() != showLegend;
  4566. if (legendVisibilityChanged) {
  4567. this.updateType = 1;
  4568. }
  4569. var swatchSizeColors;
  4570. if (sizeScale) {
  4571. var minValue = + (domain[0]);
  4572. var maxValue = + (domain[1]);
  4573. var nullColor = (this.context.getPropertyValue("color.null"));
  4574. swatchSizeColors = rave.scale.ordinal().domain([minValue, maxValue]).range([nullColor]);
  4575. }
  4576. var legendPosition = this.getLegendPosition();
  4577. var symbol = this.getStringProperty("symbolShape");
  4578. this._legends.position(legendPosition).transition(!("none" == effect), duration).setPreExecute(this.context.getPreExecute()).visible(0, showLegend).selector(0, this.context.node.selectAll("g.legendColor")).palette(0, colorPalette).shape(0, symbol).title(0, this.context.getDataSlotLabel("legend.title", colorDataSlotEntry)).titleFill(0, (this.context.getPropertyValue("legend.titlestyle.fill"))).titleFontSize(0, (this.context.getPropertyValue("legend.titlestyle.fontsize"))).titleFontFamily(0, (this.context.getPropertyValue("legend.titlestyle.fontfamily"))).setDataSlot(0, colorDataSlotEntry).visible(1, showLegend && (sizeScale)).selector(1, this.context.node.selectAll("g.legendSize")).scale(1, swatchSizeColors).swatchSize(1, function(_data, index, groupIndex) {
  4579. return + (sizeScale.call(null, _data, index, groupIndex));
  4580. }).shape(1, "circle").setDataSlot(1, sizeDataSlotEntry);
  4581. var transpose = this.getBooleanProperty("transpose");
  4582. if (this.updateType <= 1) {
  4583. this.independentScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(originalData, xDataSlotEntry);
  4584. this.dependentScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(originalData, yDataSlotEntry);
  4585. var subDomainDivisionY = !yDataSlotEntry ? null : yDataSlotEntry.subDomainDivision();
  4586. var scaleDivisionY = subDomainDivisionY == null ? null : + (subDomainDivisionY);
  4587. var subDomainDivisionX = !xDataSlotEntry ? null : xDataSlotEntry.subDomainDivision();
  4588. var scaleDivisionX = subDomainDivisionX == null ? null : + (subDomainDivisionX);
  4589. this._axes.visible(true).duration(duration).transpose(transpose).scale(0, this.independentScale).scale(2, this.dependentScale).setDataSlot(0, xDataSlotEntry).setDataSlot(2, yDataSlotEntry).useDefaultSelectors().useDefaultX1Properties(true).useDefaultY1Properties(true).scaleTickMagnitude(2, scaleDivisionY).scaleTickMagnitude(0, scaleDivisionX).setTickFormatter(0, xDataSlotEntry).setTickFormatter(2, yDataSlotEntry);
  4590. this.prepareLayoutComponent();
  4591. this.prepareLayoutSizables(this._layoutComponent, false, true, true, false, this._legends.anyVisible());
  4592. var isLegendLeftOrRight = "left" == legendPosition || "right" == legendPosition;
  4593. if (isLegendLeftOrRight) {
  4594. this._legends.preLayout(this._layoutComponent, false);
  4595. this._axes.preLayout(this._layoutComponent, false, 0.1, 0.05, 0, 0.1, 0.0, 0);
  4596. } else {
  4597. this._axes.preLayout(this._layoutComponent, true, 0.1, 0.05, 0, 0.1, 0.0, 0);
  4598. this._legends.preLayout(this._layoutComponent, true);
  4599. }
  4600. this._layoutComponent.layout();
  4601. legendPosition = this._layoutComponent.legendPosition();
  4602. this._axes.useBoundsFromLayout(this._layoutComponent).setScaleRanges(0.1, 0.05, 0);
  4603. var pixels = 2 + Math.sqrt(Math.max(glyphSize1, glyphSize2));
  4604. if (this.independentScale) {
  4605. this.independentScale.expandZeroExtent(false);
  4606. this.independentScale.expandPixels(pixels, false);
  4607. if (this.getBooleanProperty("axis.x.scale.nice")) {
  4608. this.independentScale.nice(scaleDivisionX);
  4609. }
  4610. if (this.getBooleanProperty("axis.x.scale.includeZero")) {
  4611. this.independentScale.includeZero();
  4612. }
  4613. if (transpose) {
  4614. this.zoomYScale = this.independentScale.scale().copy();
  4615. } else {
  4616. this.zoomXScale = this.independentScale.scale().copy();
  4617. }
  4618. }
  4619. if (this.dependentScale) {
  4620. this.dependentScale.expandZeroExtent(false);
  4621. this.dependentScale.expandPixels(pixels, false);
  4622. if (this.getBooleanProperty("axis.y.scale.nice")) {
  4623. this.dependentScale.nice(scaleDivisionY);
  4624. }
  4625. if (this.getBooleanProperty("axis.y.scale.includeZero")) {
  4626. this.dependentScale.includeZero();
  4627. }
  4628. if (transpose) {
  4629. this.zoomXScale = this.dependentScale.scale().copy();
  4630. } else {
  4631. this.zoomYScale = this.dependentScale.scale().copy();
  4632. }
  4633. }
  4634. this.resetZoom();
  4635. this._legends.rectangle(this._layoutComponent.legendRect());
  4636. }
  4637. var elementRect = this._layoutComponent.elementRect();
  4638. this._clip.clipRect(elementRect).applyTo(chart.select(".content")).call(this.context.node.select("defs"));
  4639. chart.select("rect.background.elements").attr("x", elementRect.x).attr("y", elementRect.y).attr("width", elementRect.width).attr("height", elementRect.height);
  4640. var xScale = this.independentScale, yScale = this.dependentScale;
  4641. if (transpose) {
  4642. xScale = this.dependentScale;
  4643. yScale = this.independentScale;
  4644. }
  4645. var keyDataSlotEntry = dataSet.slot("key").entry();
  4646. var labelDataSlotEntry = dataSet.slot("label").entry();
  4647. this._pointComponent.data(this._scatterplotData).key(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(keyDataSlotEntry))).sizeAccessor(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(sizeDataSlotEntry))).labelAccessor(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelDataSlotEntry)));
  4648. this._pointComponent.bounds(elementRect).independentScale(this.independentScale).dependentScale(this.dependentScale).transpose(transpose).colorPalette(colorPalette).sizeScale(sizeScale).effect(effect).labelFont(this.getBackgroundConstrastLabelStyle()).labelFormatter(this.context.getCustomFormatterForElementLabels(labelDataSlotEntry)).labelContrast(this.getBooleanProperty("contrast.label.color")).labelShadow(this.getBooleanProperty("label.shadow")).setPreExecute(this.context.getPreExecute()).defaultSize(glyphSize2).symbol(symbol).itemOverlap(this.getBooleanProperty("itemLabel.overlap")).itemLabel(this.getBooleanProperty("itemLabel.display")).itemLabelPosition(function(data, index, groupIndex) {
  4649. return 5;
  4650. }).borderWidth(this.context.convertCSSSizeToPixels(this.context.getPropertyValue("symbol.borderWidth"))).borderColor((this.context.getPropertyValue("symbol.borderColor")));
  4651. if (this.updateType <= 2) {
  4652. var ops = this.getStringProperty("zoom");
  4653. if (xScale && (ops == "all" || ops == "x")) {
  4654. (xScale.scale()).domain(this.zoomXScale.domain());
  4655. }
  4656. if (yScale && (ops == "all" || ops == "y")) {
  4657. (yScale.scale()).domain(this.zoomYScale.domain());
  4658. }
  4659. var self = this;
  4660. var zoom = this.context.actions.action("zoom").get("zoom");
  4661. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom(chart, zoom, xScale, yScale, null, null, null, elementRect, this._zoomP, this._zoomS, ops, function(args) {
  4662. if (args !== null || arguments.length > 1){
  4663. args = Array.prototype.slice.call(arguments, 0);
  4664. }
  4665. {
  4666. chart.selectAll("g.elements").call(self._pointComponent);
  4667. self._axes.redraw(true);
  4668. zoom.on("zoomend.hideLabels", function(args) {
  4669. if (args !== null || arguments.length > 1){
  4670. args = Array.prototype.slice.call(arguments, 0);
  4671. }
  4672. {
  4673. if (self._axes.hideAnyPanZoom()) {
  4674. if (self.zoomendedTimer != null) {
  4675. clearTimeout(self.zoomendedTimer);
  4676. }
  4677. self.zoomendedTimer = setTimeout(function() {
  4678. self.zoomendedTimer = null;
  4679. self._axes.redraw(false);
  4680. }, 300);
  4681. }
  4682. return null;
  4683. }
  4684. });
  4685. return chart;
  4686. }
  4687. });
  4688. }
  4689. if (this.updateType <= 3) {
  4690. chart.selectAll("g.elements").transition().duration(duration).call(this._pointComponent);
  4691. this._axes.visible(true).duration(duration).useDefaultSelectors().useDefaultX1Properties(true).useDefaultY1Properties(true).setTickFormatter(0, xDataSlotEntry).setTickFormatter(2, yDataSlotEntry);
  4692. this._axes.draw();
  4693. this._legends.draw();
  4694. }
  4695. chart.selectAll(".element-shape").classed("bundle-shape", true);
  4696. chart.selectAll(".legendShape").classed("bundle-shape", true);
  4697. },
  4698. /** @expose */
  4699. getLegendCount : function() {
  4700. return 2;
  4701. },
  4702. /**
  4703. * Convert the hierarchical data model to _hierarchyData if necessary, then call renderPackedBubble.
  4704. * @param (rave['internal']['Selector']) chart The chart selector
  4705. * @param dataModel Data model, known to be hierarchical
  4706. * @param (int) duration Effect duration
  4707. */
  4708. drawHierarchicalPackedBubble : function(chart, dataSet, duration) {
  4709. if (this.updateType == 0) {
  4710. var builder = new rave['library']['internal']['HierarchyUtility'](new (rave['internal']['Declare']([rave['library']['internal']['HUFactory']], {
  4711. _$functionClassMethod : function() {
  4712. var _$self = function() {
  4713. return {};
  4714. };
  4715. return _$self;
  4716. }
  4717. }))());
  4718. this._hierarchyData = builder.buildHierarchy(dataSet.data(), rave['library']['internal']['AbstractView'].accessorOf(dataSet.slot("children").entry()), rave['library']['internal']['AbstractView'].accessorOf(dataSet.slot("size").entry()), 1.0);
  4719. }
  4720. this.renderPackedBubble(chart, dataSet, duration, false);
  4721. },
  4722. /**
  4723. * Convert the tabular data model to _hierarchyData if necessary, then call renderPackedBubble.
  4724. * @param (rave['internal']['Selector']) chart The chart selector
  4725. * @param dataModel Data model, known to be hierarchical
  4726. * @param (int) duration Effect duration
  4727. */
  4728. drawTabularPackedBubble : function(chart, dataSet, duration) {
  4729. if (this.updateType == 0) {
  4730. var builder = new rave['library']['internal']['HierarchyUtility'](new (rave['internal']['Declare']([rave['library']['internal']['HUFactory']], {
  4731. _$functionClassMethod : function() {
  4732. var _$self = function() {
  4733. return {};
  4734. };
  4735. return _$self;
  4736. }
  4737. }))());
  4738. this._hierarchyData = builder.buildTabular((dataSet.data()), rave['library']['internal']['AbstractView'].accessorOf(dataSet.slot("size").entry()), 1.0);
  4739. }
  4740. this.renderPackedBubble(chart, dataSet, duration, true);
  4741. },
  4742. /**
  4743. * Render the hierarchical tree in _hierarchyData.
  4744. * @param (rave['internal']['Selector']) chart The chart selector
  4745. * @param dataModel Data model, known to be hierarchical
  4746. * @param (int) duration Effect duration
  4747. */
  4748. renderPackedBubble : function(chart, dataSet, duration, tabular) {
  4749. this.independentScale = null;
  4750. this.dependentScale = null;
  4751. this.context.actions.action("zoom").getUnBind()();
  4752. var _duration = duration;
  4753. var effect = this.getStringProperty("effect.name");
  4754. if (effect == null || "none" == effect) {
  4755. _duration = 0;
  4756. }
  4757. if (!this.lastWasPacked) {
  4758. chart.selectAll("path.element-shape").remove();
  4759. chart.selectAll("text.element-label").remove();
  4760. this.lastWasPacked = true;
  4761. }
  4762. this._axes.visible(false).draw();
  4763. var colorLevel = this.getIntProperty("itemColor");
  4764. var colorAccessor = dataSet.slot("color").entry();
  4765. var colorDataAccessor = this.colorAccessor(colorLevel, colorAccessor);
  4766. var legendDisplay = this.isShowLegend();
  4767. var legendPosition = this.getLegendPosition();
  4768. var colorPalette = this.getPalette();
  4769. this._legends.position(legendPosition).transition(!("none" == effect), _duration).setPreExecute(this.context.getPreExecute()).visible(0, legendDisplay).selector(0, this.context.node.selectAll("g.legendColor")).palette(0, colorPalette).shape(0, "circle").title(0, this.context.getDataSlotLabel("legend.title", colorAccessor)).titleFill(0, (this.context.getPropertyValue("legend.titlestyle.fill"))).titleFontSize(0, (this.context.getPropertyValue("legend.titlestyle.fontsize"))).titleFontFamily(0, (this.context.getPropertyValue("legend.titlestyle.fontfamily"))).setDataSlot(0, colorAccessor).visible(1, false);
  4770. var showNegatives = this.getBooleanProperty("packedBubbleNegativeValueDisplay");
  4771. var domain;
  4772. if (colorAccessor) {
  4773. var domainColorDataAccessor = function(data) {
  4774. var d = data;
  4775. if (d["children"]) {
  4776. return null;
  4777. }
  4778. for (var i = 0; i < d["depth"] - colorLevel; ++i) {
  4779. d = d["parent"];
  4780. }
  4781. var value = (d["data"] == null) ? null : colorAccessor(d["data"]);
  4782. if (!showNegatives && value != null) {
  4783. var dValue = + (value);
  4784. if (dValue < 0) {
  4785. value = null;
  4786. }
  4787. }
  4788. return value;
  4789. };
  4790. domain = colorAccessor.domain();
  4791. if (!domain) {
  4792. var isNumeric = "numeric" == colorAccessor.type();
  4793. var type = isNumeric ? "numeric" : "string";
  4794. var sort = isNumeric ? true : false;
  4795. domain = rave['library']['internal']['ScaleManager'].ordinalDomainWithValueFunction(this._hierarchyData._nodes, type, domainColorDataAccessor, sort);
  4796. }
  4797. }
  4798. colorPalette.setData(domain, dataSet, "color");
  4799. colorPalette.setAccessor(colorDataAccessor);
  4800. colorPalette.setNullColor((this.context.getPropertyValue("color.null")));
  4801. this.prepareLayoutComponent();
  4802. this.prepareLayoutSizables(this._layoutComponent, false, false, false, false, legendDisplay);
  4803. this._legends.preLayout(this._layoutComponent);
  4804. this._layoutComponent.layout();
  4805. legendPosition = this._layoutComponent.legendPosition();
  4806. this._legends.position(legendPosition);
  4807. var pack;
  4808. if ("BubbleLayout" == this.getStringProperty("pack")) {
  4809. pack = (rave.layout.extension("bubble"));
  4810. } else {
  4811. pack = rave.layout.pack();
  4812. }
  4813. var chartRect = this._layoutComponent.chartRect();
  4814. pack.sort(null);
  4815. pack.size([chartRect.width - 2, chartRect.height - 2]);
  4816. var nodes;
  4817. if (this._hierarchyData._root) {
  4818. nodes = this.packNodes(pack, dataSet);
  4819. } else {
  4820. nodes = [];
  4821. }
  4822. var mappedNodes = nodes.map(function(currentValue, index, array) {
  4823. var d = new com_ibm_rave_bundles_data_HierarchyBundleDatum();
  4824. d._hierarchyNode = currentValue;
  4825. return d;
  4826. });
  4827. var labelEntry = dataSet.slot("label").entry();
  4828. this._clip.clipRect(chartRect).call(this.context.node.select("defs"));
  4829. this._legends.rectangle(this._layoutComponent.legendRect());
  4830. this._packedBubbleComponent.data(mappedNodes).colorPalette(colorPalette).duration(_duration).bounds(chartRect).hideRoot(tabular).sizeAccessor(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(dataSet.slot("size").entry()))).labelAccessor(this.labelAccessor(labelEntry)).labelFont((this.context.getPropertyValue("labelstyle.font"))).labelFormatter(this.context.getCustomFormatterForElementLabels(labelEntry)).labelContrast(this.getBooleanProperty("contrast.label.color")).labelShadow(this.getBooleanProperty("label.shadow")).key(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(dataSet.slot("key").entry()))).packNodeAccessor(function(data) {
  4831. return (data)._hierarchyNode;
  4832. }).setPreExecute(this.context.getPreExecute()).itemLabel(this.getBooleanProperty("itemLabel.display")).clipItemLabels(true).borderWidth(this.context.convertCSSSizeToPixels(this.context.getPropertyValue("symbol.borderWidth"))).borderColor((this.context.getPropertyValue("symbol.borderColor")));
  4833. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(chartRect).backgroundColor(this.context.getPropertyValue("background.elements.color"));
  4834. this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
  4835. chart.selectAll("g.elements").transition().duration(_duration).call(this._packedBubbleComponent);
  4836. this._legends.draw();
  4837. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom(chart, null, null, null, null, null, null, chartRect, this._zoomP, this._zoomS, "none", function(args) {
  4838. if (args !== null || arguments.length > 1){
  4839. args = Array.prototype.slice.call(arguments, 0);
  4840. }
  4841. {
  4842. return chart;
  4843. }
  4844. });
  4845. },
  4846. /**
  4847. * Creates a new nodes tree from those read from the data file in order to filter out nodes with negative value (if requested by bundles properties) and find a suitable substitute value for nodes with zero value (if any). This newly created PackNode tree will be passed to the pack/bubble layout. Original PackNode tree is left intact.
  4848. * @return (Array) the root of the newly modified tree, could be an exact replica of the original if it had no nodes with -ve values and no nodes with zero values
  4849. */
  4850. packNodes : function(pack, dataSet) {
  4851. var showNegatives = this.getBooleanProperty("packedBubbleNegativeValueDisplay");
  4852. var domainMin = NaN;
  4853. var domainMax = NaN;
  4854. var domain;
  4855. var sizeEntry = dataSet.slot("size").entry();
  4856. if (sizeEntry) {
  4857. domain = sizeEntry.domain();
  4858. }
  4859. if ((domain) && (domain.length == 2)) {
  4860. domainMin = + (domain[0]);
  4861. domainMax = + (domain[1]);
  4862. }
  4863. var zeroValuedNodes = [];
  4864. var clonedRoot = this.cloneNode(null, this._hierarchyData._root, showNegatives, zeroValuedNodes, null, domainMin, domainMax);
  4865. var lowestValue = [];
  4866. lowestValue[0] = 1.7976931348623157E308;
  4867. this.processTree(this._hierarchyData._root, clonedRoot, showNegatives, zeroValuedNodes, lowestValue, domainMin, domainMax);
  4868. if (zeroValuedNodes.length > 0) {
  4869. var low = Math.min(lowestValue[0] / 4.0, 2.0);
  4870. for (var __i_enFor0 = 0, __exp_enFor0 = zeroValuedNodes, __len_enFor0 = __exp_enFor0.length;
  4871. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4872. var zeroNode = __exp_enFor0[__i_enFor0];
  4873. zeroNode["value"] = low;
  4874. }
  4875. }
  4876. var nodes = pack.create(clonedRoot);
  4877. return nodes;
  4878. },
  4879. processTree : function(node, clonedNode, showNegatives, zeroValuedNodes, lowestValue, domainMin, domainMax) {
  4880. if (node["children"]) {
  4881. for (var __i_enFor0 = 0, __exp_enFor0 = node["children"], __len_enFor0 = __exp_enFor0.length;
  4882. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4883. var child = __exp_enFor0[__i_enFor0];
  4884. var clonedChild = this.cloneNode(clonedNode, child, showNegatives, zeroValuedNodes, lowestValue, domainMin, domainMax);
  4885. if (clonedChild) {
  4886. if (!clonedNode["children"]) {
  4887. clonedNode["children"] = [];
  4888. }
  4889. clonedNode["children"].push(clonedChild);
  4890. this.processTree(child, clonedChild, showNegatives, zeroValuedNodes, lowestValue, domainMin, domainMax);
  4891. }
  4892. }
  4893. }
  4894. },
  4895. cloneNode : function(clonedParentNode, node, showNegatives, zeroValuedNodes, lowestValue, domainMin, domainMax) {
  4896. if (!showNegatives && node["value"] < 0) {
  4897. return null;
  4898. }
  4899. var clone = {};
  4900. clone["data"] = node["data"];
  4901. clone["depth"] = node["depth"];
  4902. clone["parent"] = clonedParentNode;
  4903. clone["value"] = Math.abs(node["value"]);
  4904. if (!(isNaN(domainMin)) && (node["value"] < domainMin)) {
  4905. clone["value"] = Math.abs(domainMin);
  4906. }
  4907. if (!(isNaN(domainMax)) && (node["value"] > domainMax)) {
  4908. clone["value"] = Math.abs(domainMax);
  4909. }
  4910. if (clone["value"] == 0) {
  4911. zeroValuedNodes.push(clone);
  4912. } else if (lowestValue && clone["value"] < lowestValue[0]) {
  4913. lowestValue[0] = clone["value"];
  4914. }
  4915. return clone;
  4916. },
  4917. /** @expose */
  4918. requireUpdate : function(property) {
  4919. var dataModel = this.context.dataModel();
  4920. if ("tabular" == dataModel.getDescriptor().id()) {
  4921. if (property == "itemColor") {
  4922. return 4;
  4923. }
  4924. } else {
  4925. if (property == "sizeScale.first" || property == "sizeScale.second") {
  4926. return 4;
  4927. }
  4928. if (property == "transpose" || property == "symbolShape") {
  4929. return 4;
  4930. }
  4931. if (property == "axis.x.title.text" || property == "axis.x.title.display") {
  4932. return 4;
  4933. }
  4934. if (property == "axis.y.title.text" || property == "axis.y.title.display") {
  4935. return 4;
  4936. }
  4937. if (property == "axis.x.title.style.fill" || property == "axis.x.line.style.stroke" || property == "axis.x.labels.style.fill" || property == "axis.y.title.style.fill" || property == "axis.y.line.style.stroke" || property == "axis.y.labels.style.fill") {
  4938. return 4;
  4939. }
  4940. if (property == "axis.y.gridlines.style.stroke" || property == "axis.x.gridlines.style.stroke" || property == "axis.y.gridlines.display" || property == "axis.x.gridlines.display" || property == "axis.y.gridlines.style.stroke-dasharray" || property == "axis.x.gridlines.style.stroke-dasharray") {
  4941. return 4;
  4942. }
  4943. if (property == "zoom") {
  4944. return 4;
  4945. }
  4946. }
  4947. return rave['library']['internal']['AbstractView'].prototype.requireUpdate.call(this, property);
  4948. },
  4949. /**
  4950. * Label accessor for packed bubble. The object is a PackNode, the label comes from the datum attached to the object. Returns null for nodes with children (this needs to change).
  4951. */
  4952. labelAccessor : function(labelAccessor) {
  4953. if (!labelAccessor) {
  4954. return null;
  4955. }
  4956. return function(data, index, gindex) {
  4957. var d = (data)._hierarchyNode;
  4958. if (d["data"] == null || d["children"]) {
  4959. return null;
  4960. }
  4961. return (labelAccessor(d["data"]));
  4962. };
  4963. },
  4964. /**
  4965. * Color accessor for packed bubble. The object is a PackNode, the label comes from the datum attached to the object. Returns null for non-leaves, and follows up the tree to the colorLevel for leaves (that may need to change).
  4966. */
  4967. colorAccessor : function(colorLevel, colorAccessor) {
  4968. if (!colorAccessor) {
  4969. return null;
  4970. }
  4971. return function(data) {
  4972. var d = (data)._hierarchyNode;
  4973. if (d["children"]) {
  4974. return null;
  4975. }
  4976. for (var i = 0; i < d["depth"] - colorLevel; ++i) {
  4977. d = d["parent"];
  4978. }
  4979. return (d["data"] == null) ? null : colorAccessor(d["data"]);
  4980. };
  4981. },
  4982. /** @expose */
  4983. getGroupStructure : function() {
  4984. return ["defs", "g.vizlibrary vizlibrary-bubble", "(", "rect.background chart", "g.chart", "(", "g.content", "(", "rect.background elements", "g.gridlines", "(", "g.grid left", "g.grid bottom", ")", "g.elements", "(", "g.element-group", "g.element-label-group", ")", ")", "g.axes", "(", "g.axes-layout", "g.axisTransform left", "g.axisTransform bottom", ")", ")", "g.legends", "(", "g.legends-layout", "g.legendColor", "g.legendSize", ")", ")"];
  4985. }
  4986. });
  4987. com_ibm_rave_bundles_bubbleBundle_BubbleView.ZERO_SUB_REDUCTION_FACTOR = 4.0;
  4988. com_ibm_rave_bundles_bubbleBundle_BubbleView.ZERO_SUB_MAX_VALUE = 2.0;
  4989. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATAMODEL_TABULAR = "tabular";
  4990. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASET_DATA = "data";
  4991. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASLOT_X = "x";
  4992. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASLOT_Y = "y";
  4993. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASLOT_SIZE = "size";
  4994. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASLOT_COLOR = "color";
  4995. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASLOT_LABEL = "label";
  4996. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASLOT_KEY = "key";
  4997. //com_ibm_rave_bundles_bubbleBundle_BubbleView.DATASLOT_CHILDREN = "children";
  4998. //com_ibm_rave_bundles_bubbleBundle_BubbleView.SYMBOL_SHAPE = "symbolShape";
  4999. //com_ibm_rave_bundles_bubbleBundle_BubbleView.ITEM_COLOR_ID = "itemColor";
  5000. //com_ibm_rave_bundles_bubbleBundle_BubbleView.LABEL_DISPLAY = "itemLabel.display";
  5001. //com_ibm_rave_bundles_bubbleBundle_BubbleView.LABEL_FONTSTYLE = "labelstyle.font";
  5002. //com_ibm_rave_bundles_bubbleBundle_BubbleView.PACKED_BUBBLE_NEGATIVE_VALUE_DISPLAY = "packedBubbleNegativeValueDisplay";
  5003. //com_ibm_rave_bundles_bubbleBundle_BubbleView.LABEL_OVERLAP = "itemLabel.overlap";
  5004. //com_ibm_rave_bundles_bubbleBundle_BubbleView.LAYOUT_PACKLAYOUT = "PackLayout";
  5005. //com_ibm_rave_bundles_bubbleBundle_BubbleView.LAYOUT_BUBBLELAYOUT = "BubbleLayout";
  5006. /**
  5007. * Accessor with AxisCallout used when X or Y accessor is not defined in the data model. Returns null.
  5008. */
  5009. com_ibm_rave_bundles_bubbleBundle_BubbleView.NOACCESSOR = function(arg0) {
  5010. return null;
  5011. };
  5012. // $source: com/ibm/rave/bundles/components/BackgroundComponentImpl
  5013. /************************************************************************
  5014. ** IBM Confidential
  5015. **
  5016. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5017. **
  5018. ** (C) Copyright IBM Corp. 2017
  5019. **
  5020. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5021. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5022. ************************************************************************/
  5023. // GENERATED
  5024. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5025. //@import com/ibm/rave/bundles/component/BackgroundComponent (runtime) // BackgroundComponent
  5026. /**
  5027. * <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>
  5028. */
  5029. var com_ibm_rave_bundles_components_BackgroundComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5030. //_backgroundColor : null,
  5031. //_rect : null,
  5032. /** @expose */
  5033. constructor : function() {
  5034. this._rect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5035. },
  5036. /** @expose */
  5037. execute : function(g) {
  5038. this.preExecute();
  5039. g.style("fill", this._backgroundColor != null ? this._backgroundColor : "#FFFFFF").style("fill-opacity", 1.0);
  5040. g.attr("x", this._rect.x).attr("y", this._rect.y).attr("width", this._rect.width).attr("height", this._rect.height);
  5041. },
  5042. /** @expose */
  5043. type : function() {
  5044. return com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE;
  5045. },
  5046. backgroundColor$0 : function() {
  5047. return this._backgroundColor;
  5048. },
  5049. backgroundColor$1 : function(backgroundColor) {
  5050. this._backgroundColor = backgroundColor;
  5051. return this;
  5052. },
  5053. /**
  5054. * @param (rave['library']['internal']['ContextSize']) size New value of size property
  5055. * @return (com.ibm.rave.bundles.components.BackgroundComponentImpl) This component
  5056. */
  5057. /** @expose */
  5058. size : function(size) {
  5059. this._rect.x = 0;
  5060. this._rect.y = 0;
  5061. this._rect.width = size.w;
  5062. this._rect.height = size.h;
  5063. return this;
  5064. },
  5065. /** @expose */
  5066. rect : function(rect) {
  5067. var r = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  5068. this._rect = r;
  5069. return this;
  5070. },
  5071. /** @expose */
  5072. backgroundColor : function(a0) {
  5073. var args = arguments;
  5074. if (args.length == 0) {
  5075. return this.backgroundColor$0();
  5076. }
  5077. return this.backgroundColor$1(a0);
  5078. }
  5079. });
  5080. // $source: com/ibm/rave/bundles/components/ChartLayoutComponentImpl
  5081. /************************************************************************
  5082. ** IBM Confidential
  5083. **
  5084. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5085. **
  5086. ** (C) Copyright IBM Corp. 2017
  5087. **
  5088. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5089. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5090. ************************************************************************/
  5091. // GENERATED
  5092. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5093. //@import com/ibm/rave/bundles/component/ChartLayoutComponent (runtime) // ChartLayoutComponent
  5094. /**
  5095. * <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>
  5096. */
  5097. var com_ibm_rave_bundles_components_ChartLayoutComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5098. //_padding : null,
  5099. //_legendChartGap : null,
  5100. //_topChartPadding : null,
  5101. //_leftChartPadding : null,
  5102. //_bottomChartPadding : null,
  5103. //_rightChartPadding : null,
  5104. //_legendPosition : null,
  5105. //_legendSizable : null,
  5106. //_axisSizables : null,
  5107. //_overallRect : null,
  5108. //_legendRect : null,
  5109. //_chartRect : null,
  5110. //_topRect : null,
  5111. //_leftRect : null,
  5112. //_bottomRect : null,
  5113. //_rightRect : null,
  5114. //_elementRect : null,
  5115. _leftPadding : 0, _topPadding : 0, _rightPadding : 0, _bottomPadding : 0,
  5116. _legendChartAlign : false,
  5117. _preLegendAtMax : false,
  5118. _preAxesAtZero : false,
  5119. constructor : function() {
  5120. this._axisSizables = [];
  5121. /**
  5122. * Construct. All padding is 0, legendPosition is "right", all slices have a size of 0 (value of null).
  5123. */
  5124. {
  5125. this._padding = 0.0;
  5126. this._topPadding = 0;
  5127. this._leftPadding = 0;
  5128. this._bottomPadding = 0;
  5129. this._rightPadding = 0;
  5130. this._topChartPadding = 0.0;
  5131. this._leftChartPadding = 0.0;
  5132. this._bottomChartPadding = 0.0;
  5133. this._rightChartPadding = 0.0;
  5134. this._legendChartGap = 0.0;
  5135. this._legendPosition = "right";
  5136. this._overallRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5137. this._legendRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5138. this._chartRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5139. this._topRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5140. this._leftRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5141. this._bottomRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5142. this._rightRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5143. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  5144. this._legendChartAlign = true;
  5145. }
  5146. },
  5147. /** @expose */
  5148. execute : function(g) {
  5149. this.layout();
  5150. },
  5151. /**
  5152. * Calculates rectangles during preliminary layout
  5153. * @param (boolean) legendAtMax true if legend is given max size; false if legend is asked for its preferred size
  5154. * @param (boolean) axesAtZero true if axes are given a size of 0; false if axes are asked for their preferred size
  5155. */
  5156. /** @expose */
  5157. preLayout : function(legendAtMax, axesAtZero) {
  5158. this._preLegendAtMax = legendAtMax;
  5159. this._preAxesAtZero = axesAtZero;
  5160. this.layout();
  5161. this._preLegendAtMax = false;
  5162. this._preAxesAtZero = false;
  5163. },
  5164. /**
  5165. * Calls preExecute, then does the layout with the property values, updating the chart, legend, axis, and elements rectangles.
  5166. */
  5167. /** @expose */
  5168. layout : function() {
  5169. this.preExecute();
  5170. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._chartRect, this._overallRect);
  5171. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._legendRect, this._overallRect);
  5172. var x = this._overallRect.x;
  5173. var y = this._overallRect.y;
  5174. var w = this._overallRect.width;
  5175. var h = this._overallRect.height;
  5176. var maxWH = Math.max(w, h);
  5177. var tbLegend = "top" == this._legendPosition || "bottom" == this._legendPosition;
  5178. var legendPercent = this._axisSizables.length == 0 ? 0.5 : 0.3;
  5179. var legendMaxSize = (tbLegend ? this._legendRect.height : this._legendRect.width) * legendPercent;
  5180. var legendDynamicSize = this._legendSizable ? (this._preLegendAtMax ? maxWH : this._legendSizable.getPreferredSize()) : 0;
  5181. if (legendDynamicSize > legendMaxSize) {
  5182. legendDynamicSize = legendMaxSize;
  5183. }
  5184. var isLegendTop = false;
  5185. var isLegendBottom = false;
  5186. var isLegendLeft = false;
  5187. var isLegendRight = false;
  5188. if ("top" == this._legendPosition) {
  5189. this._legendRect.height = legendDynamicSize;
  5190. this._chartRect.height -= this._legendRect.height;
  5191. this._chartRect.y += this._legendRect.height;
  5192. isLegendTop = true;
  5193. } else if ("bottom" == this._legendPosition) {
  5194. this._legendRect.height = legendDynamicSize;
  5195. this._chartRect.height -= this._legendRect.height;
  5196. this._legendRect.y = y + h - this._legendRect.height;
  5197. isLegendBottom = true;
  5198. } else if ("left" == this._legendPosition) {
  5199. this._legendRect.width = legendDynamicSize;
  5200. this._chartRect.width -= this._legendRect.width;
  5201. this._chartRect.x += this._legendRect.width;
  5202. isLegendLeft = true;
  5203. } else {
  5204. this._legendRect.width = legendDynamicSize;
  5205. this._chartRect.width -= this._legendRect.width;
  5206. this._legendRect.x = x + w - this._legendRect.width;
  5207. isLegendRight = true;
  5208. }
  5209. if (this.evaluatePadding(this._padding, w, h)) {
  5210. var lrgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, w);
  5211. var tbgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, h);
  5212. var chartTop = isLegendTop && this._legendSizable ? tbgap : this._topPadding;
  5213. var chartLeft = isLegendLeft && this._legendSizable ? lrgap : this._leftPadding;
  5214. var chartBottom = isLegendBottom && this._legendSizable ? tbgap : this._bottomPadding;
  5215. var chartRight = isLegendRight && this._legendSizable ? lrgap : this._rightPadding;
  5216. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  5217. } else {
  5218. var lrpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, w);
  5219. var tbpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, h);
  5220. var chartTop = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);
  5221. var chartLeft = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding, w);
  5222. var chartBottom = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding, h);
  5223. var chartRight = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._rightChartPadding, w);
  5224. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  5225. this._topPadding = tbpadding;
  5226. this._leftPadding = lrpadding;
  5227. this._bottomPadding = tbpadding;
  5228. this._rightPadding = lrpadding;
  5229. }
  5230. if (this._legendSizable) {
  5231. if (isLegendRight) {
  5232. this._legendRect.x -= this._rightPadding;
  5233. this._chartRect.width -= this._rightPadding;
  5234. this._legendRect.y += this._topPadding;
  5235. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  5236. } else if (isLegendLeft) {
  5237. this._legendRect.x += this._leftPadding;
  5238. this._chartRect.x += this._leftPadding;
  5239. this._chartRect.width -= this._leftPadding;
  5240. this._legendRect.y += this._topPadding;
  5241. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  5242. } else if (isLegendTop) {
  5243. this._legendRect.y += this._topPadding;
  5244. this._chartRect.y += this._topPadding;
  5245. this._chartRect.height -= this._topPadding;
  5246. this._legendRect.x += this._leftPadding;
  5247. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  5248. } else {
  5249. this._legendRect.y -= this._bottomPadding;
  5250. this._chartRect.height -= this._bottomPadding;
  5251. this._legendRect.x += this._leftPadding;
  5252. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  5253. }
  5254. }
  5255. x = this._chartRect.x;
  5256. y = this._chartRect.y;
  5257. w = this._chartRect.width;
  5258. h = this._chartRect.height;
  5259. var bottomH = 0;
  5260. var topH = 0;
  5261. var leftW = 0;
  5262. var rightW = 0;
  5263. var tbSO = 0;
  5264. var lrSO = 0;
  5265. if (!this._preAxesAtZero) {
  5266. var countHorz = 0;
  5267. var countVert = 0;
  5268. for (var i = 0; i < this._axisSizables.length; ++i) {
  5269. var sizable = this._axisSizables[i];
  5270. if (sizable) {
  5271. var orientation = sizable.getSizableOrientation();
  5272. if ("top" == orientation || "bottom" == orientation) {
  5273. countHorz++;
  5274. } else {
  5275. countVert++;
  5276. }
  5277. }
  5278. }
  5279. for (var i = 0; i < this._axisSizables.length; ++i) {
  5280. var sizable = this._axisSizables[i];
  5281. if (sizable) {
  5282. var orientation = sizable.getSizableOrientation();
  5283. var tbAxis = "top" == orientation || "bottom" == orientation;
  5284. var axisDynamicSize = sizable.getPreferredSize();
  5285. var spillOver = sizable.getSpillOverSize();
  5286. if (tbAxis) {
  5287. var axisPercent = countHorz > 1 ? 0.4 : 0.5;
  5288. if (axisDynamicSize > this._chartRect.height * axisPercent) {
  5289. axisDynamicSize = this._chartRect.height * axisPercent;
  5290. }
  5291. if ("top" == orientation) {
  5292. topH = axisDynamicSize;
  5293. } else {
  5294. bottomH = axisDynamicSize;
  5295. }
  5296. if (spillOver > lrSO) {
  5297. lrSO = spillOver;
  5298. }
  5299. } else {
  5300. var axisPercent = countVert > 1 ? 0.4 : 0.5;
  5301. if (axisDynamicSize > this._chartRect.width * axisPercent) {
  5302. axisDynamicSize = this._chartRect.width * axisPercent;
  5303. }
  5304. if ("left" == orientation) {
  5305. leftW = axisDynamicSize;
  5306. } else {
  5307. rightW = axisDynamicSize;
  5308. }
  5309. if (spillOver > tbSO) {
  5310. tbSO = spillOver;
  5311. }
  5312. }
  5313. }
  5314. }
  5315. }
  5316. if (lrSO > leftW) {
  5317. leftW = lrSO;
  5318. }
  5319. if (lrSO > rightW) {
  5320. rightW = lrSO;
  5321. }
  5322. if (tbSO > topH) {
  5323. topH = tbSO;
  5324. }
  5325. if (tbSO > bottomH) {
  5326. bottomH = tbSO;
  5327. }
  5328. this._leftRect.x = x;
  5329. this._leftRect.width = leftW;
  5330. this._leftRect.y = y;
  5331. this._leftRect.height = h;
  5332. this._rightRect.x = x + w - rightW;
  5333. this._rightRect.width = rightW;
  5334. this._rightRect.y = y;
  5335. this._rightRect.height = h;
  5336. this._topRect.y = y;
  5337. this._topRect.height = topH;
  5338. this._topRect.x = x;
  5339. this._topRect.width = w;
  5340. this._bottomRect.y = y + h - bottomH;
  5341. this._bottomRect.height = bottomH;
  5342. this._bottomRect.x = x;
  5343. this._bottomRect.width = w;
  5344. this._elementRect.x = x + leftW;
  5345. this._elementRect.y = y + topH;
  5346. this._elementRect.width = w - (leftW + rightW);
  5347. this._elementRect.height = h - (topH + bottomH);
  5348. if (this._legendSizable && this._legendChartAlign) {
  5349. if (tbLegend) {
  5350. this._legendRect.x = this._elementRect.x;
  5351. this._legendRect.width = this._elementRect.width;
  5352. } else {
  5353. this._legendRect.y = this._elementRect.y;
  5354. this._legendRect.height = this._elementRect.height;
  5355. }
  5356. }
  5357. },
  5358. evaluatePadding : function(padding, horizontalExtent, verticalExtent) {
  5359. if (padding == null) {
  5360. return false;
  5361. }
  5362. var paddingString = (padding) + "";
  5363. if (paddingString.length == 0) {
  5364. return false;
  5365. }
  5366. this._topPadding = 0;
  5367. this._leftPadding = 0;
  5368. this._bottomPadding = 0;
  5369. this._rightPadding = 0;
  5370. var items = paddingString.split(new RegExp(";"));
  5371. for (var __i_enFor0 = 0, __len_enFor0 = items.length;
  5372. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  5373. var item = items[__i_enFor0];
  5374. var parts = item.split(new RegExp(":"));
  5375. if (items.length == 1 && parts.length != 2) {
  5376. return false;
  5377. }
  5378. if (parts.length == 2) {
  5379. if (0 <= parts[0].indexOf("top")) {
  5380. this._topPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  5381. } else if (0 <= parts[0].indexOf("left")) {
  5382. this._leftPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  5383. } else if (0 <= parts[0].indexOf("bottom")) {
  5384. this._bottomPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  5385. } else if (0 <= parts[0].indexOf("right")) {
  5386. this._rightPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  5387. }
  5388. }
  5389. }
  5390. return true;
  5391. },
  5392. /**
  5393. * @return (rave['internal']['RectStruct']) Legend rectangle
  5394. */
  5395. /** @expose */
  5396. legendRect : function() {
  5397. return this._legendRect;
  5398. },
  5399. /**
  5400. * @return (rave['internal']['RectStruct']) Chart (elements plus axes) rectangle
  5401. */
  5402. /** @expose */
  5403. chartRect : function() {
  5404. return this._chartRect;
  5405. },
  5406. /**
  5407. * @return (rave['internal']['RectStruct']) Top axis rectangle
  5408. */
  5409. /** @expose */
  5410. topRect : function() {
  5411. return this._topRect;
  5412. },
  5413. /**
  5414. * @return (rave['internal']['RectStruct']) Left axis rectangle
  5415. */
  5416. /** @expose */
  5417. leftRect : function() {
  5418. return this._leftRect;
  5419. },
  5420. /**
  5421. * @return (rave['internal']['RectStruct']) Bottom axis rectangle
  5422. */
  5423. /** @expose */
  5424. bottomRect : function() {
  5425. return this._bottomRect;
  5426. },
  5427. /**
  5428. * @return (rave['internal']['RectStruct']) Right axis rectangle
  5429. */
  5430. /** @expose */
  5431. rightRect : function() {
  5432. return this._rightRect;
  5433. },
  5434. /**
  5435. * @return (rave['internal']['RectStruct']) Legend rectangle
  5436. */
  5437. /** @expose */
  5438. elementRect : function() {
  5439. return this._elementRect;
  5440. },
  5441. /**
  5442. * Set the overall rectangle. This should be called before doing the layout.
  5443. * @param (rave['internal']['RectStruct']) overall The overall rectangle
  5444. */
  5445. /** @expose */
  5446. overall : function(overall) {
  5447. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._overallRect, overall);
  5448. return this;
  5449. },
  5450. padding$0 : function() {
  5451. return this._padding;
  5452. },
  5453. legendChartAlign$0 : function() {
  5454. return this._legendChartAlign;
  5455. },
  5456. legendChartGap$0 : function() {
  5457. return this._legendChartGap;
  5458. },
  5459. topPadding$0 : function() {
  5460. return this._topChartPadding;
  5461. },
  5462. leftPadding$0 : function() {
  5463. return this._leftChartPadding;
  5464. },
  5465. bottomPadding$0 : function() {
  5466. return this._bottomChartPadding;
  5467. },
  5468. rightPadding$0 : function() {
  5469. return this._rightChartPadding;
  5470. },
  5471. legendPosition$0 : function() {
  5472. return this._legendPosition;
  5473. },
  5474. topPadding$1 : function(padding) {
  5475. this._topChartPadding = padding;
  5476. return this;
  5477. },
  5478. leftPadding$1 : function(padding) {
  5479. this._leftChartPadding = padding;
  5480. return this;
  5481. },
  5482. bottomPadding$1 : function(padding) {
  5483. this._bottomChartPadding = padding;
  5484. return this;
  5485. },
  5486. rightPadding$1 : function(padding) {
  5487. this._rightChartPadding = padding;
  5488. return this;
  5489. },
  5490. /** @expose */
  5491. type : function() {
  5492. return com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE;
  5493. },
  5494. padding$1 : function(value) {
  5495. this._padding = value;
  5496. return this;
  5497. },
  5498. /** @expose */
  5499. chartPadding : function(top, left, bottom, right) {
  5500. this._topChartPadding = top;
  5501. this._leftChartPadding = left;
  5502. this._bottomChartPadding = bottom;
  5503. this._rightChartPadding = right;
  5504. return this;
  5505. },
  5506. legendChartAlign$1 : function(legendChartAlign) {
  5507. this._legendChartAlign = legendChartAlign;
  5508. return this;
  5509. },
  5510. legendChartGap$1 : function(value) {
  5511. this._legendChartGap = value;
  5512. return this;
  5513. },
  5514. legendPosition$1 : function(position) {
  5515. if ("top" == position || "bottom" == position || "left" == position || "right" == position) {
  5516. this._legendPosition = position;
  5517. }
  5518. return this;
  5519. },
  5520. /** @expose */
  5521. legendSize : function(sizable) {
  5522. this._legendSizable = sizable;
  5523. return this;
  5524. },
  5525. /** @expose */
  5526. removeAxisSizables : function() {
  5527. this._axisSizables.length = 0;
  5528. return this;
  5529. },
  5530. /** @expose */
  5531. addAxisSizable : function(sizable) {
  5532. this._axisSizables.push(sizable);
  5533. return this;
  5534. },
  5535. /** @expose */
  5536. padding : function(a0) {
  5537. var args = arguments;
  5538. if (args.length == 0) {
  5539. return this.padding$0();
  5540. }
  5541. return this.padding$1(a0);
  5542. },
  5543. /** @expose */
  5544. legendChartAlign : function(a0) {
  5545. var args = arguments;
  5546. if (args.length == 0) {
  5547. return this.legendChartAlign$0();
  5548. }
  5549. return this.legendChartAlign$1(a0);
  5550. },
  5551. /** @expose */
  5552. legendChartGap : function(a0) {
  5553. var args = arguments;
  5554. if (args.length == 0) {
  5555. return this.legendChartGap$0();
  5556. }
  5557. return this.legendChartGap$1(a0);
  5558. },
  5559. /** @expose */
  5560. topPadding : function(a0) {
  5561. var args = arguments;
  5562. if (args.length == 0) {
  5563. return this.topPadding$0();
  5564. }
  5565. return this.topPadding$1(a0);
  5566. },
  5567. /** @expose */
  5568. leftPadding : function(a0) {
  5569. var args = arguments;
  5570. if (args.length == 0) {
  5571. return this.leftPadding$0();
  5572. }
  5573. return this.leftPadding$1(a0);
  5574. },
  5575. /** @expose */
  5576. bottomPadding : function(a0) {
  5577. var args = arguments;
  5578. if (args.length == 0) {
  5579. return this.bottomPadding$0();
  5580. }
  5581. return this.bottomPadding$1(a0);
  5582. },
  5583. /** @expose */
  5584. rightPadding : function(a0) {
  5585. var args = arguments;
  5586. if (args.length == 0) {
  5587. return this.rightPadding$0();
  5588. }
  5589. return this.rightPadding$1(a0);
  5590. },
  5591. /** @expose */
  5592. legendPosition : function(a0) {
  5593. var args = arguments;
  5594. if (args.length == 0) {
  5595. return this.legendPosition$0();
  5596. }
  5597. return this.legendPosition$1(a0);
  5598. }
  5599. });
  5600. /**
  5601. * Set preferred rectangle to the same position and size as the source rectangle.
  5602. * @param (rave['internal']['RectStruct']) t preferred rectangle
  5603. * @param (rave['internal']['RectStruct']) s Source rectangle
  5604. * @return (rave['internal']['RectStruct']) preferred rectangle
  5605. */
  5606. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect = function(t, s) {
  5607. t.x = s.x;
  5608. t.y = s.y;
  5609. t.width = s.width;
  5610. t.height = s.height;
  5611. return t;
  5612. };
  5613. /**
  5614. * 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.
  5615. * @param (rave['internal']['RectStruct']) r Rectangle
  5616. * @param (double) top Top inset in pixels
  5617. * @param (double) left Left inset in pixels
  5618. * @param (double) bottom Bottom inset in pixels
  5619. * @param (double) right Right inset in pixels
  5620. * @return (rave['internal']['RectStruct']) The rectangle
  5621. */
  5622. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset = function(r, top, left, bottom, right) {
  5623. var ileft = Math.max(0.0, left);
  5624. var iright = Math.max(0.0, right);
  5625. if (ileft + iright <= r.width) {
  5626. r.x += ileft;
  5627. r.width -= ileft + iright;
  5628. }
  5629. var itop = Math.max(0.0, top);
  5630. var ibottom = Math.max(0.0, bottom);
  5631. if (itop + ibottom <= r.height) {
  5632. r.y += itop;
  5633. r.height -= itop + ibottom;
  5634. }
  5635. return r;
  5636. };
  5637. /**
  5638. * 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.
  5639. * @param (Object) value The size
  5640. * @param (double) extent The extent in the dimension
  5641. * @param defValue The default to use if not parsable
  5642. * @return (double) Size in pixels
  5643. */
  5644. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize = function(value, extent) {
  5645. var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10.0);
  5646. var d = v != null ? v : 0;
  5647. return Math.max(0.0, Math.min(d, extent));
  5648. };
  5649. /** @expose */
  5650. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT = 0.4;
  5651. /** @expose */
  5652. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT_SINGLE_PER_ORIENTATION = 0.5;
  5653. /** @expose */
  5654. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT = 0.3;
  5655. /** @expose */
  5656. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT_NO_AXIS = 0.5;
  5657. // $source: com/ibm/rave/bundles/components/ClipPathComponentImpl
  5658. /************************************************************************
  5659. ** IBM Confidential
  5660. **
  5661. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5662. **
  5663. ** (C) Copyright IBM Corp. 2017
  5664. **
  5665. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5666. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5667. ************************************************************************/
  5668. // GENERATED
  5669. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5670. /**
  5671. * 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>
  5672. */
  5673. var com_ibm_rave_bundles_components_ClipPathComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5674. //_id : null,
  5675. //_clipRect : null,
  5676. constructor : function(id) {
  5677. this._clipRect = new rave['internal']['RectStruct'](0, 0, 100, 100);
  5678. /**
  5679. * 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.
  5680. * @param (String) id String ID that is unique <em>across the document</em>.
  5681. */
  5682. {
  5683. this._id = id;
  5684. }
  5685. },
  5686. /** @expose */
  5687. type : function() {
  5688. return "ClipPathComponent";
  5689. },
  5690. /**
  5691. * Set the rectangular clipping area. Make the _clipRect one pixel larger than requested to avoid the cut-off at bounds. TODO: why?!?
  5692. * @param (rave['internal']['RectStruct']) rect The rectangular bounds of the clipping area.
  5693. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  5694. */
  5695. /** @expose */
  5696. clipRect : function(rect) {
  5697. this._clipRect = new rave['internal']['RectStruct'](rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2);
  5698. return this;
  5699. },
  5700. /**
  5701. * Set the clip-path attribute on the provided selection.
  5702. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  5703. */
  5704. /** @expose */
  5705. applyTo : function(s) {
  5706. s.attr("clip-path", "url(" + this.url() + ")");
  5707. return this;
  5708. },
  5709. /**
  5710. * Retrieve the id assigned to this clip path.
  5711. */
  5712. /** @expose */
  5713. id : function() {
  5714. return this._id;
  5715. },
  5716. /**
  5717. * Retrieve the URL that can be used to reference this clip path.
  5718. */
  5719. /** @expose */
  5720. url : function() {
  5721. return "#" + this._id;
  5722. },
  5723. /** @expose */
  5724. execute : function(g) {
  5725. var clipPath = g.selectAll("#" + this._id).data([0]);
  5726. clipPath.enter().append("clipPath").attr("id", this._id).append("rect");
  5727. 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);
  5728. }
  5729. });
  5730. // $source: com/ibm/rave/bundles/components/LegendComponentImpl
  5731. /************************************************************************
  5732. ** IBM Confidential
  5733. **
  5734. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5735. **
  5736. ** (C) Copyright IBM Corp. 2017
  5737. **
  5738. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5739. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5740. ************************************************************************/
  5741. // GENERATED
  5742. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5743. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  5744. /**
  5745. * <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>
  5746. */
  5747. var com_ibm_rave_bundles_components_LegendComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5748. /**
  5749. * Legend size property
  5750. */
  5751. //_size : null,
  5752. /**
  5753. * Color scale
  5754. */
  5755. //_colorPalette : null,
  5756. /**
  5757. * Orient, "horizontal" or "vertical"
  5758. */
  5759. //_orient : null,
  5760. /**
  5761. * Swatch size function
  5762. */
  5763. //_swatchSizeFunc : null,
  5764. /**
  5765. * Scale
  5766. */
  5767. //_scale : null,
  5768. /**
  5769. * Swatch symbol
  5770. */
  5771. //_shape : null,
  5772. /**
  5773. * Legend title
  5774. */
  5775. //_title : null,
  5776. /**
  5777. * Legend title styling
  5778. */
  5779. //_titleStyle : null,
  5780. /**
  5781. * Legend entry styling
  5782. */
  5783. //_entryStyle : null,
  5784. /**
  5785. * Custom formatter
  5786. */
  5787. //_labelFormat : null,
  5788. /**
  5789. * The swatch legend, created on demand
  5790. */
  5791. //_swatchLegend : null,
  5792. /**
  5793. * The continuous legend, created on demand
  5794. */
  5795. //_continuousLegend : null,
  5796. /**
  5797. * The legend type, either "SwatchLegend" or "ContinuousLegend"
  5798. */
  5799. //_legendType : null,
  5800. /**
  5801. * Is the legend visible
  5802. */
  5803. _visible : false,
  5804. /**
  5805. * Swatch size in square pixels
  5806. */
  5807. _swatchSize : 0,
  5808. /**
  5809. * Constructor; sets bound and, colorScale to null, all other properties to their default values.
  5810. */
  5811. /** @expose */
  5812. constructor : function() {
  5813. this._visible = true;
  5814. this._size = null;
  5815. this._colorPalette = null;
  5816. this._orient = "horizontal";
  5817. this._swatchSize = 16.0 * 16.0;
  5818. this._swatchSizeFunc = null;
  5819. this._scale = null;
  5820. this._shape = "square";
  5821. this._title = null;
  5822. this._titleStyle = {};
  5823. this._entryStyle = {};
  5824. this._labelFormat = null;
  5825. this._swatchLegend = null;
  5826. this._continuousLegend = null;
  5827. this._legendType = null;
  5828. },
  5829. /** @expose */
  5830. type : function() {
  5831. return "LegendComponent";
  5832. },
  5833. /** @expose */
  5834. execute : function(g) {
  5835. if (this._colorPalette) {
  5836. if ("continuous" == this._colorPalette.getType()) {
  5837. if (!this._continuousLegend) {
  5838. this._continuousLegend = (rave.capabilities.extension("legend")).continuous();
  5839. }
  5840. this._legendType = "ContinuousLegend";
  5841. } else {
  5842. if (!this._swatchLegend) {
  5843. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  5844. }
  5845. this._legendType = "SwatchLegend";
  5846. }
  5847. } else if (this._swatchSizeFunc) {
  5848. if (!this._swatchLegend) {
  5849. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  5850. }
  5851. this._legendType = "SwatchLegend";
  5852. } else {
  5853. this._legendType = null;
  5854. }
  5855. this.preExecute();
  5856. if (!this._visible || (!this._colorPalette && !this._swatchSizeFunc) || !this._size || this._size[0] <= 0 || this._size[1] <= 0) {
  5857. g.selectAll("*").remove();
  5858. return;
  5859. }
  5860. var fontChecker = rave.capabilities.extension("fontchecker");
  5861. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  5862. 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);
  5863. var legend = g.call(this._continuousLegend);
  5864. if (this._entryStyle) {
  5865. legend.selectAll(".legendLabel").style(this._entryStyle);
  5866. }
  5867. if (this._titleStyle) {
  5868. legend.selectAll(".legendTitle").style(this._titleStyle);
  5869. }
  5870. if (fontChecker) {
  5871. legend.selectAll(".legendLabel").call(fontChecker);
  5872. legend.selectAll(".legendTitle").call(fontChecker);
  5873. }
  5874. } else {
  5875. var insets = {};
  5876. insets["bottom"] = 5;
  5877. var swatchSize = this._swatchSize;
  5878. var scale = null;
  5879. var labelFormatter = this._labelFormat;
  5880. if (this._swatchSizeFunc && this._scale) {
  5881. swatchSize = this._swatchSizeFunc;
  5882. scale = this._scale;
  5883. }
  5884. if (this._colorPalette) {
  5885. scale = this._colorPalette.getScale();
  5886. var originalDomain = this._colorPalette.originalDomain();
  5887. if (originalDomain) {
  5888. scale.domain(originalDomain);
  5889. var f = this._colorPalette.originalDomainLabelAccessor();
  5890. if (this._labelFormat) {
  5891. var self = this;
  5892. labelFormatter = function(data, index, groupIndex) {
  5893. return self._labelFormat.call(this, f.call(this, data, index, groupIndex), index, groupIndex);
  5894. };
  5895. } else {
  5896. labelFormatter = f;
  5897. }
  5898. }
  5899. }
  5900. 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);
  5901. var legend = g.call(this._swatchLegend);
  5902. if (this._entryStyle) {
  5903. legend.selectAll(".legendLabel").style(this._entryStyle);
  5904. }
  5905. if (this._titleStyle) {
  5906. legend.selectAll(".legendTitle").style(this._titleStyle);
  5907. }
  5908. if (fontChecker) {
  5909. legend.selectAll(".legendLabel").call(fontChecker);
  5910. legend.selectAll(".legendTitle").call(fontChecker);
  5911. }
  5912. }
  5913. },
  5914. /** @expose */
  5915. legend : function() {
  5916. if ("ContinuousLegend" == this._legendType) {
  5917. return this._continuousLegend;
  5918. }
  5919. if ("SwatchLegend" == this._legendType) {
  5920. return this._swatchLegend;
  5921. }
  5922. return null;
  5923. },
  5924. /** @expose */
  5925. legendType : function() {
  5926. return this._legendType;
  5927. },
  5928. /**
  5929. * Set the visible property.
  5930. * @param (boolean) visible New visible
  5931. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5932. */
  5933. /** @expose */
  5934. visible : function(visible) {
  5935. this._visible = visible;
  5936. return this;
  5937. },
  5938. /**
  5939. * see if the legend is visible
  5940. * @return (boolean) if its visible
  5941. */
  5942. /** @expose */
  5943. isVisible : function() {
  5944. return this._visible;
  5945. },
  5946. /**
  5947. * Set the size property.
  5948. * @param (Array) size New size
  5949. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5950. */
  5951. /** @expose */
  5952. size : function(size) {
  5953. this._size = size;
  5954. return this;
  5955. },
  5956. /**
  5957. * Set the color scale property.
  5958. * @param (rave['library']['internal']['Palette']) colorPalette New color scale
  5959. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5960. */
  5961. /** @expose */
  5962. colorPalette : function(colorPalette) {
  5963. this._colorPalette = colorPalette;
  5964. return this;
  5965. },
  5966. /**
  5967. * Set the orient property. If the argument is not "horizontal" or "vertical", it is ignored and the orient property is not changed.
  5968. * @param (String) orient New orient
  5969. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5970. */
  5971. /** @expose */
  5972. orient : function(orient) {
  5973. if ("horizontal" == orient || "vertical" == orient) {
  5974. this._orient = orient;
  5975. }
  5976. return this;
  5977. },
  5978. /**
  5979. * 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".
  5980. * @param (String) position Legend position
  5981. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5982. */
  5983. /** @expose */
  5984. position : function(position) {
  5985. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  5986. },
  5987. swatchSize$0 : function(swatchSize) {
  5988. if (swatchSize >= 0.0 && swatchSize != null) {
  5989. this._swatchSize = swatchSize;
  5990. }
  5991. return this;
  5992. },
  5993. /** @expose */
  5994. scale : function(scale) {
  5995. this._scale = scale;
  5996. return this;
  5997. },
  5998. swatchSize$1 : function(swatchSize) {
  5999. if (swatchSize) {
  6000. this._swatchSizeFunc = swatchSize;
  6001. }
  6002. return this;
  6003. },
  6004. /** @expose */
  6005. shape : function(shape) {
  6006. this._shape = shape;
  6007. return this;
  6008. },
  6009. /** @expose */
  6010. title : function(title) {
  6011. this._title = (title != null && title.length > 0) ? title : null;
  6012. return this;
  6013. },
  6014. /** @expose */
  6015. titleFill : function(titleFill) {
  6016. this._titleStyle["fill"] = titleFill;
  6017. return this;
  6018. },
  6019. /** @expose */
  6020. titleFontSize : function(titleFontSize) {
  6021. this._titleStyle["font-size"] = titleFontSize;
  6022. return this;
  6023. },
  6024. /** @expose */
  6025. titleFontFamily : function(titleFontFamily) {
  6026. this._titleStyle["font-family"] = titleFontFamily;
  6027. return this;
  6028. },
  6029. /** @expose */
  6030. labelFormat : function(labelFormat) {
  6031. this._labelFormat = labelFormat;
  6032. return this;
  6033. },
  6034. /** @expose */
  6035. titleFont : function(titleFontStyle) {
  6036. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(titleFontStyle);
  6037. return this;
  6038. },
  6039. /** @expose */
  6040. entryFont : function(entryFontStyle) {
  6041. this._entryStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(entryFontStyle);
  6042. return this;
  6043. },
  6044. /** @expose */
  6045. getSpaceUsed : function() {
  6046. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  6047. return this._continuousLegend.getUsedSize() + 2;
  6048. } else {
  6049. return this._swatchLegend.getUsedSize() + 2;
  6050. }
  6051. },
  6052. /** @expose */
  6053. swatchSize : function(a0) {
  6054. var args = arguments;
  6055. if (args.length == 1 && typeof a0 === "function") {
  6056. return this.swatchSize$1(a0);
  6057. }
  6058. return this.swatchSize$0(a0);
  6059. }
  6060. });
  6061. /**
  6062. * Get the orient for a position. "top" and "bottom" return "horizontal", anything else ("left", "right", or unknown/null) is "vertical".
  6063. * @param (String) position A position
  6064. * @return (String) "horizontal" or "vertical"
  6065. */
  6066. /** @expose */
  6067. com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf = function(position) {
  6068. if ("top" == position || "bottom" == position) {
  6069. return "horizontal";
  6070. }
  6071. return "vertical";
  6072. };
  6073. //com_ibm_rave_bundles_components_LegendComponentImpl.HORIZONTAL = "horizontal";
  6074. //com_ibm_rave_bundles_components_LegendComponentImpl.VERTICAL = "vertical";
  6075. com_ibm_rave_bundles_components_LegendComponentImpl.BAR_THINKNESS = 16;
  6076. com_ibm_rave_bundles_components_LegendComponentImpl.SWATCH_SIZE = 16;
  6077. /** @expose */
  6078. com_ibm_rave_bundles_components_LegendComponentImpl.TOP = "top";
  6079. /** @expose */
  6080. com_ibm_rave_bundles_components_LegendComponentImpl.BOTTOM = "bottom";
  6081. /** @expose */
  6082. com_ibm_rave_bundles_components_LegendComponentImpl.LEFT = "left";
  6083. /** @expose */
  6084. com_ibm_rave_bundles_components_LegendComponentImpl.RIGHT = "right";
  6085. /** @expose */
  6086. com_ibm_rave_bundles_components_LegendComponentImpl.ADJUSTABLE = -1;
  6087. // $source: com/ibm/rave/bundles/components/AxisComponentImpl
  6088. /************************************************************************
  6089. ** IBM Confidential
  6090. **
  6091. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  6092. **
  6093. ** (C) Copyright IBM Corp. 2018
  6094. **
  6095. ** The source code for this program is not published or otherwise divested of its trade secrets,
  6096. ** irrespective of what has been deposited with the U.S. Copyright Office.
  6097. ************************************************************************/
  6098. // GENERATED
  6099. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  6100. //@import com/ibm/rave/bundles/component/AxisComponent (runtime) // AxisComponent
  6101. //@import com/ibm/rave/bundles/utilities/TextCrossfader (runtime) // textCrossFade
  6102. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  6103. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  6104. /**
  6105. * <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>
  6106. */
  6107. var com_ibm_rave_bundles_components_AxisComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  6108. /**
  6109. * Axis - created on demand
  6110. */
  6111. //_axis : null,
  6112. /**
  6113. * Role, from the AxisComponent API
  6114. */
  6115. //_role : null,
  6116. /**
  6117. * CoordinateScale
  6118. */
  6119. //_scale : null,
  6120. /**
  6121. * Orient, always one of the four legal values
  6122. */
  6123. //_orient : null,
  6124. /**
  6125. * Size
  6126. */
  6127. //_bounds : null,
  6128. //_elementRect : null,
  6129. /**
  6130. * The title text; default null (nothing visible)
  6131. */
  6132. /** @expose */
  6133. _axisTitle : null,
  6134. /**
  6135. * The title style; defaults null (use the CSS styling)
  6136. */
  6137. /** @expose */
  6138. _titleStyle : null,
  6139. /**
  6140. * Axis line color; default null (use the CSS styling)
  6141. */
  6142. /** @expose */
  6143. _lineColor : null,
  6144. /**
  6145. * Axis tick color; default null (use the CSS styling)
  6146. */
  6147. /** @expose */
  6148. _tickColor : null,
  6149. /**
  6150. * Axis tick label style; defaults null (use the CSS styling)
  6151. */
  6152. /** @expose */
  6153. _labelStyle : null,
  6154. //_staggerRotate45Nodes : null,
  6155. //_staggerFirstNode : null,
  6156. //_staggerLastNode : null,
  6157. /**
  6158. * Axis tick label formatting
  6159. */
  6160. //_tickFormat : null,
  6161. //_dropOverlap : null,
  6162. /**
  6163. * Used to get the extension to enable axis label wrapping
  6164. */
  6165. //_textFlow : null,
  6166. /**
  6167. * Used to check the fonts on each label to make sure all characters are covered
  6168. */
  6169. //_fontChecker : null,
  6170. /**
  6171. * Run function that applies the properties to the axis line
  6172. */
  6173. //_axisLineProperties : null,
  6174. /**
  6175. * Run function that applies the properties to the axis ticks
  6176. */
  6177. //_axisTickProperties : null,
  6178. /**
  6179. * Run function that applies the properties to the axis tick labels
  6180. */
  6181. //_axisTickLabelProperties : null,
  6182. /**
  6183. * Run function that hides or displays the axis tick labels
  6184. */
  6185. //_displayHideLabels : null,
  6186. /**
  6187. * Run function that hides or displays the axis tick labels
  6188. */
  6189. //_panZoomLabels : null,
  6190. /**
  6191. * The tick handler registered with the axis; will get called during axis transition
  6192. */
  6193. //_tickHandler : null,
  6194. //_textTruncationIndicator : null,
  6195. /**
  6196. * Used when dealing with numeric scale on the vertical axis and the numbers don't fit
  6197. */
  6198. //_simplifiedTickFormat : null,
  6199. //_tickMagnitude : null,
  6200. /**
  6201. * Whether to display the axis title; default true
  6202. */
  6203. /** @expose */
  6204. _displayAxisTitle : false,
  6205. /**
  6206. * Whether to display the axis line; default true
  6207. */
  6208. /** @expose */
  6209. _displayAxisLine : false,
  6210. /**
  6211. * Whether to display the axis ticks; default true
  6212. */
  6213. /** @expose */
  6214. _displayTicks : false,
  6215. /**
  6216. * Whether to display the axis tick labels (conditional on show labels property); default true
  6217. */
  6218. /** @expose */
  6219. _displayTickLabels : false,
  6220. /**
  6221. * Whether to display the axis tick labels (conditional on pan-zoom hide property); default true
  6222. */
  6223. /** @expose */
  6224. _showPanZoomTickLabels : false,
  6225. /**
  6226. * Whether to rotate the axis tick labels; default false
  6227. */
  6228. _rotateLabels : false,
  6229. _staggerCellWidth : 0,
  6230. _staggerAlignFirstAtStart : false,
  6231. _staggerAlignLastAtEnd : false,
  6232. _layoutTimerId : 0,
  6233. _layoutTitleSize : 0,
  6234. _layoutLabelSize : 0,
  6235. _layoutLabelHeight : 0,
  6236. _layoutAverageDigitWidth : 0,
  6237. _layoutSpillOver : 0,
  6238. /**
  6239. * Whether to hide overlapping labels; default true
  6240. */
  6241. /** @expose */
  6242. _hideOverlappingLabels : false,
  6243. /**
  6244. * When true, don't start a new timer
  6245. */
  6246. _pendingLabelTimer : false,
  6247. /**
  6248. * The padding in px between tick axis line and tick label, and also between tick label and title. Default 16px.
  6249. */
  6250. _padding : 0,
  6251. /**
  6252. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  6253. */
  6254. _renderedShapes : false,
  6255. _layoutMode : -1,
  6256. _allowAutoAxisLayoutToChangeOrientaiton : true,
  6257. _lastAutomaticAxisLayoutOrientation : -1,
  6258. _allowStagger : false,
  6259. _allowRotate45 : false,
  6260. _allowRotate90 : false,
  6261. constructor : function() {
  6262. {
  6263. var self = this;
  6264. this._axisLineProperties = function(args) {
  6265. if (args !== null || arguments.length > 1){
  6266. args = Array.prototype.slice.call(arguments, 0);
  6267. }
  6268. {
  6269. var line = this.selectAll("path.domain");
  6270. if (self._lineColor != null) {
  6271. line.style("stroke", self._lineColor);
  6272. }
  6273. if (self._displayAxisLine) {
  6274. line.attr("visibility", null);
  6275. } else {
  6276. line.attr("visibility", "hidden");
  6277. }
  6278. return null;
  6279. }
  6280. };
  6281. this._axisTickProperties = function(args) {
  6282. if (args !== null || arguments.length > 1){
  6283. args = Array.prototype.slice.call(arguments, 0);
  6284. }
  6285. {
  6286. var tickLines = this.selectAll("line");
  6287. if (self._displayTicks) {
  6288. tickLines.attr("visibility", null);
  6289. } else {
  6290. tickLines.attr("visibility", "hidden");
  6291. }
  6292. if (self._lineColor != null) {
  6293. tickLines.style("stroke", self._tickColor);
  6294. }
  6295. return null;
  6296. }
  6297. };
  6298. this._axisTickLabelProperties = function(args) {
  6299. if (args !== null || arguments.length > 1){
  6300. args = Array.prototype.slice.call(arguments, 0);
  6301. }
  6302. {
  6303. var labels = this.selectAll("text");
  6304. labels.each(self._displayHideLabels);
  6305. labels.each(self._panZoomLabels);
  6306. labels.style(self._labelStyle);
  6307. self._axis.ticksHandler(null);
  6308. return null;
  6309. }
  6310. };
  6311. this._displayHideLabels = function(obj, group, index) {
  6312. if (self._displayTickLabels) {
  6313. if (this.rave_hasProperty("__tickLabelHidden__")) {
  6314. this.rave_removeProperty("__tickLabelHidden__");
  6315. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6316. if (count <= 1) {
  6317. this.rave_removeProperty("__hiddenCount__");
  6318. this.removeAttribute("visibility");
  6319. } else {
  6320. this.rave_setProperty("__hiddenCount__", count - 1);
  6321. }
  6322. }
  6323. } else {
  6324. if (!(this.rave_hasProperty("__tickLabelHidden__"))) {
  6325. this.setAttribute("visibility", "hidden");
  6326. this.rave_setProperty("__tickLabelHidden__", "hidden");
  6327. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6328. this.rave_setProperty("__hiddenCount__", count + 1);
  6329. }
  6330. }
  6331. };
  6332. this._panZoomLabels = function(obj, group, index) {
  6333. if (self._showPanZoomTickLabels) {
  6334. if (this.rave_hasProperty("__panZoomHidden__")) {
  6335. this.rave_removeProperty("__panZoomHidden__");
  6336. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6337. if (count <= 1) {
  6338. this.rave_removeProperty("__hiddenCount__");
  6339. this.removeAttribute("visibility");
  6340. } else {
  6341. this.rave_setProperty("__hiddenCount__", count - 1);
  6342. }
  6343. }
  6344. } else {
  6345. if (!(this.rave_hasProperty("__panZoomHidden__"))) {
  6346. this.setAttribute("visibility", "hidden");
  6347. this.rave_setProperty("__panZoomHidden__", "hidden");
  6348. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6349. this.rave_setProperty("__hiddenCount__", count + 1);
  6350. }
  6351. }
  6352. };
  6353. }
  6354. this._tickHandler = new com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler(this._axisTickLabelProperties, this._axisTickProperties);
  6355. /**
  6356. * Initialize properties to defaults
  6357. */
  6358. {
  6359. this._axis = null;
  6360. this._role = null;
  6361. this._scale = null;
  6362. this._orient = "bottom";
  6363. this._bounds = null;
  6364. this._displayAxisTitle = true;
  6365. this._axisTitle = null;
  6366. this._titleStyle = {};
  6367. this._displayAxisLine = true;
  6368. this._lineColor = null;
  6369. this._displayTicks = true;
  6370. this._tickColor = null;
  6371. this._displayTickLabels = true;
  6372. this._labelStyle = {};
  6373. this._rotateLabels = false;
  6374. this._hideOverlappingLabels = true;
  6375. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  6376. this._tickFormat = null;
  6377. this._showPanZoomTickLabels = true;
  6378. this._pendingLabelTimer = false;
  6379. this._padding = 16;
  6380. this._textFlow = rave.capabilities.extension("textflow");
  6381. this._fontChecker = rave.capabilities.extension("fontchecker");
  6382. this._renderedShapes = false;
  6383. }
  6384. },
  6385. /** @expose */
  6386. type : function() {
  6387. return com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE;
  6388. },
  6389. /** @expose */
  6390. role : function() {
  6391. return this._role;
  6392. },
  6393. /** @expose */
  6394. execute : function(g) {
  6395. this.preExecute();
  6396. if (!this._scale) {
  6397. g.selectAll("*").remove();
  6398. this._renderedShapes = false;
  6399. return;
  6400. }
  6401. this._renderedShapes = true;
  6402. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6403. this._hideOverlappingLabels = false;
  6404. this._rotateLabels = true;
  6405. } else {
  6406. this._hideOverlappingLabels = true;
  6407. this._rotateLabels = true;
  6408. }
  6409. this.drawTitle(g);
  6410. this.drawAxis(g);
  6411. this.handleAxisText(g);
  6412. this.drawTitle(g);
  6413. },
  6414. /**
  6415. * This is one place where all the calls that affect the axis text happen in case of allowAutomaticAxisLayout the new behavior applies here
  6416. * @param (rave['internal']['Selector']) g
  6417. */
  6418. handleAxisText : function(g) {
  6419. this.stopLabelDroppingUpdate();
  6420. var duration = 0, delay = 0;
  6421. var g2 = rave.transition(g);
  6422. if (g2.isTransition()) {
  6423. var t2 = (g2);
  6424. duration = t2.duration();
  6425. delay = t2.delay();
  6426. }
  6427. var axisSelector = g.selectAll("g.axis");
  6428. var labels = axisSelector.selectAll("g.tick").filter(rave['library']['internal']['BundleUtils'].notExit).selectAll("text");
  6429. var fontChecker = rave.capabilities.extension("fontchecker");
  6430. labels.style(this._labelStyle);
  6431. if (fontChecker) {
  6432. labels.call(fontChecker);
  6433. }
  6434. var mode = this._allowAutoAxisLayoutToChangeOrientaiton ? this.determineWhichAutoMode(g) : this._lastAutomaticAxisLayoutOrientation;
  6435. this.configureStaggerData(g, mode);
  6436. this.handleLabelsRotationAndPosition(g, labels, mode);
  6437. this.hashingNumericScales(labels, this.labelExtent(g), mode);
  6438. if (duration == 0) {
  6439. this.doLabelWrapping(g, mode);
  6440. this.handleLabelsRotationAndPosition(g, labels, mode);
  6441. }
  6442. this._lastAutomaticAxisLayoutOrientation = mode;
  6443. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6444. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6445. var tick = axisSelector.append("g").classed("tick", true);
  6446. var tickText = tick.append("text");
  6447. if (labels.size() == 0) {
  6448. var singleValue = this._scale.scale().domain()[0];
  6449. var formatter = this._tickFormat;
  6450. if (!formatter) {
  6451. var tickFunc = this._scale.scale().tickFormat;
  6452. if (tickFunc) {
  6453. formatter = tickFunc.apply(tickFunc, [singleValue]);
  6454. }
  6455. }
  6456. var node = tickText[0][0];
  6457. var stringValue = formatter ? formatter.call(node, singleValue, 0, 0) : ""+(singleValue);
  6458. tickText.text(stringValue);
  6459. var dim = node.getBBox();
  6460. this._layoutLabelSize = isHorizontal ? dim.height : dim.width;
  6461. if (!isHorizontal || mode != 0) {
  6462. tickText.text(".0");
  6463. this._layoutLabelSize += node.getBBox().width;
  6464. }
  6465. }
  6466. if (!isHorizontal || mode != 0) {
  6467. tickText.text(".0");
  6468. var node = tickText[0][0];
  6469. var dim = node.getBBox();
  6470. this._layoutAverageDigitWidth = dim.width;
  6471. }
  6472. tick.remove();
  6473. }
  6474. if (this._hideOverlappingLabels && duration > 0) {
  6475. this.updateLabelDropping(labels, duration, delay);
  6476. }
  6477. if (duration > 0) {
  6478. this.doLabelWrappingAfterAnimation(g, labels, mode, duration, delay);
  6479. }
  6480. if (!this._displayTickLabels) {
  6481. this._layoutLabelSize = 0;
  6482. this._layoutAverageDigitWidth = 0;
  6483. }
  6484. },
  6485. /**
  6486. * 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
  6487. * @param (rave['internal']['Selector']) g selector
  6488. * @param (rave['internal']['Selector']) labels labels selector
  6489. * @param (int) mode one of HORIZONTAL, STAGGER, ROTATE90
  6490. */
  6491. handleLabelsRotationAndPosition : function(g, labels, mode) {
  6492. if (mode == 2 || mode == 1) {
  6493. if (this._orient == "bottom") {
  6494. this.rotateLabels(g, labels, "end", mode);
  6495. } else if (this._orient == "top") {
  6496. this.rotateLabels(g, labels, "start", mode);
  6497. } else {
  6498. this.rotateLabels(g, labels, "middle", mode);
  6499. }
  6500. } else {
  6501. if (this._orient == "bottom" || this._orient == "top") {
  6502. this.rotateLabels(g, labels, "middle", mode);
  6503. } else if (this._orient == "right") {
  6504. this.rotateLabels(g, labels, "start", mode);
  6505. } else {
  6506. this.rotateLabels(g, labels, "end", mode);
  6507. }
  6508. }
  6509. },
  6510. /**
  6511. * <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>
  6512. * @param (rave['internal']['Selector']) labels
  6513. */
  6514. hashingNumericScales : function(labels, extent, mode) {
  6515. if (!labels || !extent) {
  6516. return;
  6517. }
  6518. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6519. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6520. var tickSpace = mode == 1 ? extent[1] : extent[0];
  6521. this._textTruncationIndicator = "";
  6522. this._layoutLabelSize = 0;
  6523. for (var i = 0; i < labels.size(); ++i) {
  6524. var node = labels[i][0];
  6525. var dim = node.getBBox();
  6526. var width = dim.width;
  6527. var height = dim.height;
  6528. var size = !isHorizontal || mode == 1 ? width : height;
  6529. if (size > this._layoutLabelSize) {
  6530. this._layoutLabelSize = size;
  6531. }
  6532. if (width >= tickSpace) {
  6533. if (this._simplifiedTickFormat) {
  6534. var newText = this._simplifiedTickFormat.call(null, node.rave_getData(), 0, 0);
  6535. if (newText != null) {
  6536. node.rave_setText(newText);
  6537. }
  6538. if (node.getBBox().width >= tickSpace) {
  6539. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  6540. }
  6541. } else {
  6542. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  6543. }
  6544. }
  6545. }
  6546. }
  6547. },
  6548. /**
  6549. * @param (int) size The desired size of the string
  6550. * @param (String) ch The character to be repeated in the string
  6551. * @return (String) A string of the specified size containing repetition of the specified character
  6552. */
  6553. stringOfSize : function(size, ch) {
  6554. var returnString = "";
  6555. for (var i = 0; i < size; ++i) {
  6556. returnString += ch;
  6557. }
  6558. return returnString;
  6559. },
  6560. configureStaggerData : function(g, mode) {
  6561. if (mode == 3 || mode == 2) {
  6562. var horizontalDimensions = this.labelExtent(g);
  6563. var cellWidth = horizontalDimensions[0];
  6564. var axisSelector = g.selectAll("g.axis");
  6565. var labels = axisSelector.selectAll("text");
  6566. var domain = this._scale.scale().domain();
  6567. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  6568. this._staggerRotate45Nodes = [];
  6569. this._staggerFirstNode = null;
  6570. this._staggerLastNode = null;
  6571. for (var i = 0; i < labels.size(); ++i) {
  6572. var node = labels[0][i];
  6573. if (this.isValid(node.rave_getData())) {
  6574. var domainIndex = -1;
  6575. if (mode == 3) {
  6576. var domainLabel = !this._tickFormat ? node.rave_getText() : originalDataLabelAccessor.call(node, node.rave_getData(), 0, 0);
  6577. for (var index = 0; index < domain.length; ++index) {
  6578. if (domain[index].toString() == domainLabel) {
  6579. domainIndex = index;
  6580. break;
  6581. }
  6582. }
  6583. }
  6584. this._staggerRotate45Nodes.push(new com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex(node, domainIndex));
  6585. if (domainIndex == 0) {
  6586. this._staggerFirstNode = node;
  6587. }
  6588. if (domainIndex == domain.length - 1) {
  6589. this._staggerLastNode = node;
  6590. }
  6591. }
  6592. }
  6593. this._staggerCellWidth = cellWidth * 2;
  6594. this._staggerAlignFirstAtStart = this._staggerFirstNode ? this._staggerFirstNode.getBBox().width > cellWidth : false;
  6595. this._staggerAlignLastAtEnd = this._staggerLastNode ? this._staggerLastNode.getBBox().width > cellWidth : false;
  6596. }
  6597. },
  6598. getStaggerIndex : function(node) {
  6599. for (var index = 0; index < this._staggerRotate45Nodes.length; ++index) {
  6600. if (this._staggerRotate45Nodes[index].contains(node)) {
  6601. var domainIndex = this._staggerRotate45Nodes[index].getIndex();
  6602. return domainIndex == -1 ? 0 : domainIndex;
  6603. }
  6604. }
  6605. return -1;
  6606. },
  6607. getStaggerCount : function() {
  6608. var domain = this._scale.scale().domain();
  6609. return domain.length;
  6610. },
  6611. /**
  6612. * <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>
  6613. * @param (rave['internal']['Selector']) g
  6614. */
  6615. determineWhichAutoMode : function(g) {
  6616. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6617. var axisSelector = g.selectAll("g.axis");
  6618. var labels = axisSelector.selectAll("text");
  6619. var dim = this.labelExtent(g);
  6620. var cellWidth = dim[0];
  6621. var cellWidth90 = dim[1];
  6622. var layoutLabelHeight = 0;
  6623. var layoutLabelWidth = 0;
  6624. var horizontalScore = 0;
  6625. var staggerScore = 0;
  6626. var rotate45Score = 0;
  6627. var rotate90Score = 0;
  6628. var validNodes = [];
  6629. for (var i = 0; i < labels.size(); ++i) {
  6630. var node = labels[0][i];
  6631. if (this.isValid(node.rave_getData())) {
  6632. validNodes.push(node);
  6633. }
  6634. }
  6635. var labelCount = validNodes.length;
  6636. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6637. var mode = 0;
  6638. if (isHorizontal) {
  6639. mode = this._layoutMode == 1 ? 1 : 0;
  6640. var tick = axisSelector.append("g").classed("tick", true);
  6641. var tickText = tick.append("text");
  6642. tickText.style(this._labelStyle);
  6643. tickText.text(",0");
  6644. var node = tickText[0][0];
  6645. var zeroWidth = node.getBBox().width;
  6646. tick.remove();
  6647. var widestLabel = 0;
  6648. for (var i = 0; i < labelCount; ++i) {
  6649. node = validNodes[i];
  6650. var nodeRect = node.getBBox();
  6651. if (nodeRect.width > widestLabel) {
  6652. widestLabel = nodeRect.width;
  6653. }
  6654. if (nodeRect.height > this._layoutLabelHeight) {
  6655. this._layoutLabelHeight = nodeRect.height;
  6656. }
  6657. }
  6658. widestLabel += zeroWidth;
  6659. this._layoutSpillOver = mode == 1 ? this._layoutLabelHeight / 2 : widestLabel / 2 + 2;
  6660. } else {
  6661. for (var i = 0; i < labelCount; ++i) {
  6662. var node = validNodes[i];
  6663. var nodeRect = node.getBBox();
  6664. if (nodeRect.height > this._layoutLabelHeight) {
  6665. this._layoutLabelHeight = nodeRect.height;
  6666. }
  6667. }
  6668. this._layoutSpillOver = this._layoutLabelHeight / 2;
  6669. }
  6670. return mode;
  6671. }
  6672. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  6673. var staggerStringsWontMatch = this._tickFormat && !originalDataLabelAccessor;
  6674. var calcStagger = ((this._allowStagger && this._layoutMode == -1) || this._layoutMode == 3) && !staggerStringsWontMatch;
  6675. var calcRotate45 = (this._allowRotate45 && this._layoutMode == -1) || this._layoutMode == 2;
  6676. var calcRotate90 = (this._allowRotate90 && this._layoutMode == -1) || this._layoutMode == 1;
  6677. var spaceFor45Label = 0;
  6678. for (var i = 0; i < labelCount; ++i) {
  6679. var node = validNodes[i];
  6680. var nodeRect = node.getBBox();
  6681. layoutLabelHeight = nodeRect.height;
  6682. var labelWidth = nodeRect.width;
  6683. if (labelWidth > layoutLabelWidth) {
  6684. layoutLabelWidth = labelWidth;
  6685. }
  6686. horizontalScore += (labelWidth <= cellWidth ? 1 : cellWidth / labelWidth);
  6687. if (isHorizontal) {
  6688. if (calcStagger) {
  6689. var spaceForLabel = cellWidth * 2;
  6690. if (i == 0 && i == labelCount - 1) {
  6691. spaceForLabel *= 0.5;
  6692. } else if (i == 0 || i == labelCount - 1) {
  6693. spaceForLabel *= 0.75;
  6694. }
  6695. staggerScore += (labelWidth <= spaceForLabel ? 1 : spaceForLabel / labelWidth);
  6696. }
  6697. if (calcRotate45) {
  6698. if (spaceFor45Label == 0) {
  6699. spaceFor45Label = cellWidth90 / 0.7071 - layoutLabelHeight;
  6700. }
  6701. var space = this.calculate45DegreeSpace(node, spaceFor45Label);
  6702. rotate45Score += (labelWidth <= space ? 1 : space / labelWidth);
  6703. }
  6704. if (calcRotate90) {
  6705. rotate90Score += (labelWidth <= cellWidth90 ? 1 : cellWidth90 / labelWidth);
  6706. }
  6707. }
  6708. }
  6709. var mode = 0;
  6710. if (this._layoutMode == -1) {
  6711. if (isHorizontal && this._allowStagger) {
  6712. horizontalScore *= 1.1;
  6713. staggerScore *= 1.1;
  6714. }
  6715. if ((staggerScore > horizontalScore) && (staggerScore >= rotate45Score) && (staggerScore >= rotate90Score)) {
  6716. mode = 3;
  6717. } else if ((rotate45Score > horizontalScore) && (rotate45Score >= rotate90Score)) {
  6718. mode = 2;
  6719. } else if (rotate90Score > horizontalScore) {
  6720. mode = 1;
  6721. }
  6722. } else {
  6723. if ((this._layoutMode == 3 && staggerStringsWontMatch) || !isHorizontal) {
  6724. mode = 0;
  6725. } else {
  6726. mode = this._layoutMode;
  6727. }
  6728. }
  6729. if (isHorizontal) {
  6730. switch (mode) {
  6731. case 3:
  6732. this._layoutLabelSize = layoutLabelHeight * 2;
  6733. break;
  6734. case 2:
  6735. this._layoutLabelSize = (layoutLabelWidth + layoutLabelHeight) * 0.7071;
  6736. break;
  6737. case 1:
  6738. this._layoutLabelSize = layoutLabelWidth;
  6739. break;
  6740. case 0:
  6741. default:
  6742. this._layoutLabelSize = layoutLabelHeight;
  6743. break;
  6744. }
  6745. } else {
  6746. this._layoutLabelSize = layoutLabelWidth;
  6747. }
  6748. this._layoutLabelHeight = layoutLabelHeight;
  6749. return mode;
  6750. },
  6751. calculate45DegreeSpace : function(node, maxWidth) {
  6752. var width = maxWidth;
  6753. var tfm = node.rave_getParentNode().getAttribute("transform");
  6754. if (tfm != null) {
  6755. var tfmString = tfm.toString();
  6756. var indexOfTrans = tfmString.indexOf("translate(");
  6757. if (indexOfTrans != -1) {
  6758. indexOfTrans += 10;
  6759. var indexOfComma = tfmString.indexOf(",", indexOfTrans);
  6760. if (indexOfComma != -1) {
  6761. var xAmount = tfmString.substring(indexOfTrans, indexOfComma);
  6762. var xLabelPos = + (xAmount);
  6763. var width45Degrees = node.getBBox().width;
  6764. var xLabelWidth = width45Degrees * 0.7071;
  6765. var isBottom = this._orient == "bottom";
  6766. if (isBottom) {
  6767. xLabelPos -= node.getBBox().height / 4;
  6768. if (xLabelPos - xLabelWidth < this._bounds.x) {
  6769. xLabelWidth = xLabelPos - this._bounds.x;
  6770. width = xLabelWidth / 0.7071;
  6771. }
  6772. } else {
  6773. if (xLabelPos + xLabelWidth > this._bounds.x + this._bounds.width) {
  6774. xLabelWidth = (this._bounds.x + this._bounds.width) - xLabelPos;
  6775. width = xLabelWidth / 0.7071;
  6776. }
  6777. }
  6778. if (width > maxWidth) {
  6779. width = maxWidth;
  6780. }
  6781. }
  6782. }
  6783. }
  6784. return width;
  6785. },
  6786. /**
  6787. * @param (rave['internal']['Selector']) labels selector with all labels to be rotated
  6788. * @param (rave['internal']['Selector']) g The parent selector of labels
  6789. * @param (String) textAnchor The position of the anchor
  6790. * @param alignmentMode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  6791. */
  6792. rotateLabels : function(g, labels, textAnchor, mode) {
  6793. if (this._rotateLabels) {
  6794. var self = this;
  6795. var positioning = function(data, index, groupIndex) {
  6796. var x = 0;
  6797. var y = 0;
  6798. var rotation_cy = 0;
  6799. var isBottom = self._orient == "bottom";
  6800. if (mode == 3) {
  6801. var cellIndex = self.getStaggerIndex(this);
  6802. if (cellIndex != -1) {
  6803. if (cellIndex % 2 == 1) {
  6804. var staggerDirection = isBottom ? 1 : -1;
  6805. y += (self._layoutLabelHeight * staggerDirection);
  6806. }
  6807. if (cellIndex == 0 && self._staggerAlignFirstAtStart) {
  6808. x -= self._staggerCellWidth / 4;
  6809. } else if (cellIndex == self.getStaggerCount() - 1 && self._staggerAlignLastAtEnd) {
  6810. x += self._staggerCellWidth / 4;
  6811. }
  6812. }
  6813. } else if (mode == 2) {
  6814. if (isBottom) {
  6815. x -= self._layoutLabelHeight;
  6816. } else {
  6817. x += self._layoutLabelHeight / 2;
  6818. }
  6819. } else if (mode == 1) {
  6820. if (isBottom) {
  6821. x -= (this.getBBox().height / 2 + self._layoutLabelHeight / 4);
  6822. rotation_cy = ~~(self._padding / 4 + self._axis.tickSize());
  6823. } else {
  6824. x -= (this.getBBox().height / 2 - self._layoutLabelHeight);
  6825. rotation_cy = ~~-(self._padding / 4 + self._axis.tickSize());
  6826. }
  6827. }
  6828. var rotationDegrees = mode == 1 ? -90 : mode == 2 ? -45 : 0;
  6829. return "translate(" + x + "," + y + ") rotate(" + rotationDegrees + ",0," + rotation_cy + ")";
  6830. };
  6831. labels.attr("transform", positioning).style("text-anchor", textAnchor);
  6832. if (mode == 3) {
  6833. if (this._staggerAlignFirstAtStart) {
  6834. this._staggerFirstNode.rave_setStyle("text-anchor", "start");
  6835. }
  6836. if (this._staggerAlignLastAtEnd) {
  6837. this._staggerLastNode.rave_setStyle("text-anchor", "end");
  6838. }
  6839. }
  6840. }
  6841. },
  6842. /** @expose */
  6843. axis : function() {
  6844. return this._axis;
  6845. },
  6846. /**
  6847. * Draw the axis. The scale is non-null.
  6848. * @param (rave['internal']['Selector']) g Selector group into which the axis is drawn.
  6849. */
  6850. drawAxis : function(g) {
  6851. var axisSelector = g.selectAll("g.axis").data([0]);
  6852. axisSelector.enter().append("g").classed("axis", true).classed(this._orient, true);
  6853. if (!this._axis) {
  6854. this._axis = new rave['internal']['Axis']();
  6855. }
  6856. if (this._hideOverlappingLabels) {
  6857. this._textFlow.valignment("top").dropTextOnFail(false);
  6858. }
  6859. this._axis.ticksHandler(this._tickHandler);
  6860. this._axis.orient(this._orient);
  6861. this._axis.tickFormat(this._tickFormat);
  6862. this._axis.tickPadding(10.0);
  6863. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6864. var labelHeight = 20.0;
  6865. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6866. if (isHorizontal) {
  6867. labelHeight /= 0.7071;
  6868. }
  6869. var range = this._scale.scale().rangeExtent();
  6870. var extent = + (range[1]) - + (range[0]);
  6871. this._axis.ticks(extent / labelHeight);
  6872. } else {
  6873. if (this._tickMagnitude == null) {
  6874. this._axis.ticks(10.0);
  6875. } else {
  6876. this._axis.ticks.apply(this._axis, [10.0, this._scale.scale().getTickFormat(), this._tickMagnitude]);
  6877. }
  6878. }
  6879. var s = this._scale.scale();
  6880. if (this._scale.originalDomain()) {
  6881. var sOrdinal = s.copy();
  6882. sOrdinal.domain(this._scale.originalDomain());
  6883. s = sOrdinal;
  6884. var self = this;
  6885. var originalDataLabelAccessor = (self._scale).originalDomainLabelAccessor();
  6886. var tickFormatter;
  6887. if (originalDataLabelAccessor) {
  6888. if (this._tickFormat) {
  6889. tickFormatter = function(data, index, groupIndex) {
  6890. return self._tickFormat.call(this, originalDataLabelAccessor.call(this, data, index, groupIndex), index, groupIndex);
  6891. };
  6892. } else {
  6893. tickFormatter = originalDataLabelAccessor;
  6894. }
  6895. } else {
  6896. tickFormatter = this._tickFormat;
  6897. }
  6898. this._axis.tickFormat(tickFormatter);
  6899. }
  6900. this._axis.scale(s);
  6901. axisSelector.call(this._axis);
  6902. var g2 = rave.transition(axisSelector);
  6903. if (!(g2.isTransition())) {
  6904. axisSelector.selectAll("text").call(this._dropOverlap, this._hideOverlappingLabels);
  6905. }
  6906. axisSelector.selectAll("path.domain").classed("axis-line", true);
  6907. axisSelector.selectAll("g.tick line").classed("axis-tick", true);
  6908. if (this._fontChecker) {
  6909. axisSelector.selectAll("g.tick text").classed("axis-label", true).call(this._fontChecker);
  6910. } else {
  6911. axisSelector.selectAll("g.tick text").classed("axis-label", true);
  6912. }
  6913. axisSelector.call(this._axisLineProperties);
  6914. },
  6915. /**
  6916. * Draw the axis title.
  6917. * @param (rave['internal']['Selector']) g Selector group into which the title is drawn.
  6918. */
  6919. drawTitle : function(g) {
  6920. if (!this._displayAxisTitle || this._axisTitle == null || this._axisTitle.trim().length == 0 || !this._bounds) {
  6921. g.selectAll("text.axis-title." + this._orient).remove();
  6922. return;
  6923. }
  6924. var x = 0;
  6925. var y = 0;
  6926. var dy = "";
  6927. var transform;
  6928. if ("top" == this._orient) {
  6929. x = this._elementRect.x + this._elementRect.width / 2;
  6930. y = -this._bounds.height + this._padding / 4;
  6931. dy = "0.75em";
  6932. } else if ("bottom" == this._orient) {
  6933. x = this._elementRect.x + this._elementRect.width / 2;
  6934. y = this._bounds.height - this._padding / 4;
  6935. dy = "-0.25em";
  6936. } else if ("left" == this._orient) {
  6937. x = -this._elementRect.y - this._elementRect.height / 2;
  6938. y = -this._bounds.width + this._padding / 4;
  6939. dy = "0.75em";
  6940. transform = "rotate(-90)";
  6941. } else {
  6942. x = this._elementRect.y + this._elementRect.height / 2;
  6943. y = -this._bounds.width + this._padding / 4;
  6944. dy = "0.75em";
  6945. transform = "rotate(90)";
  6946. }
  6947. var fillOpacity;
  6948. {
  6949. var tmp = g.append("text").attr("class", "axis-title " + this._orient);
  6950. fillOpacity = tmp.style("fill-opacity");
  6951. tmp.remove();
  6952. } var label = g.selectAll("text.axis-title." + this._orient);
  6953. if (label.size() == 0) {
  6954. 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);
  6955. if (this._fontChecker) {
  6956. g.selectAll("text.axis-title." + this._orient).call(this._fontChecker);
  6957. }
  6958. }
  6959. 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);
  6960. },
  6961. getUnZoomedScale : function(scale) {
  6962. var s = scale.copy();
  6963. if (s.getZoomTransform()) {
  6964. s.getZoomTransform()(1, 0);
  6965. }
  6966. return s;
  6967. },
  6968. isValid : function(data) {
  6969. var s = this.getUnZoomedScale(this._axis.scale());
  6970. var v = + (s.call(null, data, 0, 0));
  6971. var range = this._axis.scale().range();
  6972. if (this._axis.scale().range().indexOf(v)> -1) {
  6973. return true;
  6974. }
  6975. if (range[0] < v && v < range[1]) {
  6976. return true;
  6977. }
  6978. if (range[0] > v && v > range[1]) {
  6979. return true;
  6980. }
  6981. return false;
  6982. },
  6983. /**
  6984. * Apply label wrapping if requested.
  6985. * @param (rave['internal']['Selector']) g
  6986. * @param (int) mode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  6987. */
  6988. doLabelWrapping : function(g, mode) {
  6989. if (this._displayTickLabels) {
  6990. this._textFlow.valignment("top");
  6991. if (!this._hideOverlappingLabels) {
  6992. this._textFlow.dropTextOnFail(true);
  6993. }
  6994. var d = this.labelExtent(g);
  6995. if (!d || d[0] < 0 || d[1] < 0) {
  6996. return;
  6997. }
  6998. var w = ~~ (d[0]);
  6999. var h = ~~ (d[1]);
  7000. if (mode == 2) {
  7001. w = ~~(d[1] / 0.7071 - this._layoutLabelHeight);
  7002. h = ~~(this._layoutLabelHeight / 0.7071);
  7003. } else if (mode == 1) {
  7004. var tmp = w;
  7005. w = h;
  7006. h = tmp;
  7007. }
  7008. var allowWrap = mode == 1;
  7009. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  7010. var hActual = ~~ (this._layoutLabelHeight * 1.2);
  7011. if (hActual > h) {
  7012. h = hActual;
  7013. }
  7014. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  7015. if (mode == 0 && !isHorizontal) {
  7016. allowWrap = true;
  7017. }
  7018. }
  7019. var self = this;
  7020. var cellWidth = w;
  7021. var cellHeight = h;
  7022. this._textFlow.wrap(allowWrap).truncate(true).textTruncateIndicator(this._textTruncationIndicator != null ? this._textTruncationIndicator : "...").spacing(1.2).extent(function(data, index, groupIndex) {
  7023. var width = cellWidth;
  7024. var height = cellHeight;
  7025. if (mode == 2) {
  7026. var cellIndex = self.getStaggerIndex(this);
  7027. if (cellIndex != -1) {
  7028. width = ~~self.calculate45DegreeSpace(this, cellWidth);
  7029. }
  7030. } else if (mode == 3) {
  7031. var cellIndex = self.getStaggerIndex(this);
  7032. if (cellIndex != -1) {
  7033. if (cellIndex == 0 && cellIndex == self.getStaggerCount() - 1) {
  7034. width = cellWidth;
  7035. } else if (cellIndex == 0 || cellIndex == self.getStaggerCount() - 1) {
  7036. width = cellWidth * 3 / 2;
  7037. } else {
  7038. width = cellWidth * 2;
  7039. }
  7040. height = cellHeight / 2;
  7041. }
  7042. }
  7043. return [width, height];
  7044. });
  7045. g.selectAll("g.tick > text").call(this._textFlow);
  7046. }
  7047. },
  7048. /**
  7049. * <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>
  7050. * @param (rave['internal']['Selector']) g Selector group for axis
  7051. * @return (Array) The extent of the axis label bounds
  7052. */
  7053. /** @expose */
  7054. labelExtent : function(g) {
  7055. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  7056. var w = this._bounds.width;
  7057. var h = this._bounds.height;
  7058. if (this._scale.scale().rangeBand) {
  7059. var rangeBandValue = + (this._scale.scale().rangeBand());
  7060. if (isHorizontal) {
  7061. w = rangeBandValue;
  7062. } else {
  7063. h = rangeBandValue;
  7064. }
  7065. }
  7066. this.calcTitleExtent(g);
  7067. if (isHorizontal) {
  7068. h -= this._axis.tickSize();
  7069. h -= this._padding / 2;
  7070. if (this._layoutTitleSize != 0) {
  7071. h -= this._layoutTitleSize;
  7072. h -= this._padding / 2;
  7073. }
  7074. } else {
  7075. w -= this._axis.tickSize();
  7076. w -= this._padding / 2;
  7077. if (this._layoutTitleSize != 0) {
  7078. w -= this._layoutTitleSize;
  7079. w -= this._padding / 2;
  7080. }
  7081. }
  7082. return [w, h];
  7083. },
  7084. calcTitleExtent : function(g) {
  7085. this._layoutTitleSize = 0;
  7086. var title = g.selectAll("text.axis-title");
  7087. if (title.size() > 0) {
  7088. var textHeight = title[0][0].getBBox().height;
  7089. this._layoutTitleSize = textHeight;
  7090. }
  7091. },
  7092. /**
  7093. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  7094. * @param (String) role The new role
  7095. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) This object
  7096. */
  7097. /** @expose */
  7098. setRole : function(role) {
  7099. this._role = role;
  7100. return this;
  7101. },
  7102. /**
  7103. * Set the ticks interval on the scale based on the magnitude. tickMagnitude represents power of 10. null value gives the default scale ticks.
  7104. * @param (Number) tickMagnitude
  7105. * @return (com.ibm.rave.bundles.component.AxisComponent) this
  7106. */
  7107. /** @expose */
  7108. scaleTickMagnitude : function(tickMagnitude) {
  7109. this._tickMagnitude = tickMagnitude;
  7110. return this;
  7111. },
  7112. /**
  7113. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The new scale
  7114. */
  7115. /** @expose */
  7116. scale : function(scale) {
  7117. this._scale = scale ? scale : null;
  7118. return this;
  7119. },
  7120. /**
  7121. * Only legal values are accepted, otherwise the orient is unchanged.
  7122. * @param (String) orient The new orient
  7123. */
  7124. orient$0 : function(orient) {
  7125. if ("left" == orient || "bottom" == orient || "right" == orient || "top" == orient) {
  7126. this._orient = orient;
  7127. if (this._role == null) {
  7128. if ("left" == orient) {
  7129. this._role = "ROLE_Y1";
  7130. } else if ("bottom" == orient) {
  7131. this._role = "ROLE_X1";
  7132. } else if ("right" == orient) {
  7133. this._role = "ROLE_Y2";
  7134. } else {
  7135. this._role = "ROLE_X2";
  7136. }
  7137. }
  7138. }
  7139. return this;
  7140. },
  7141. /**
  7142. * Returns the current orientation string return The current orient
  7143. */
  7144. orient$1 : function() {
  7145. return this._orient;
  7146. },
  7147. /**
  7148. * @param (rave['internal']['RectStruct']) bounds The new bounds
  7149. */
  7150. /** @expose */
  7151. bounds : function(bounds) {
  7152. this._bounds = bounds;
  7153. return this;
  7154. },
  7155. /** @expose */
  7156. elementRect : function(elementRect) {
  7157. this._elementRect = elementRect;
  7158. return this;
  7159. },
  7160. tickFormat$0 : function(tickFormat) {
  7161. this._tickFormat = tickFormat;
  7162. return this;
  7163. },
  7164. tickFormat$1 : function() {
  7165. return this._tickFormat;
  7166. },
  7167. simplifiedTickFormat$0 : function(tickFormat) {
  7168. this._simplifiedTickFormat = tickFormat;
  7169. return this;
  7170. },
  7171. simplifiedTickFormat$1 : function() {
  7172. return this._simplifiedTickFormat;
  7173. },
  7174. /** @expose */
  7175. displayAxisTitle : function(displayAxisTitle) {
  7176. this._displayAxisTitle = displayAxisTitle;
  7177. return this;
  7178. },
  7179. /** @expose */
  7180. displayAxisLine : function(displayAxisLine) {
  7181. this._displayAxisLine = displayAxisLine;
  7182. return this;
  7183. },
  7184. /** @expose */
  7185. displayTicks : function(displayTicks) {
  7186. this._displayTicks = displayTicks;
  7187. return this;
  7188. },
  7189. /** @expose */
  7190. displayTickLabels : function(displayTickLabels) {
  7191. this._displayTickLabels = displayTickLabels;
  7192. return this;
  7193. },
  7194. /** @expose */
  7195. allowAutomaticAxisLayoutToChangeOrientation : function(state) {
  7196. this._allowAutoAxisLayoutToChangeOrientaiton = state;
  7197. return this;
  7198. },
  7199. /** @expose */
  7200. isAllowAutomaticAxisLayoutToChangeOrientation : function() {
  7201. return this._allowAutoAxisLayoutToChangeOrientaiton;
  7202. },
  7203. /** @expose */
  7204. showPanZoomTickLabels : function(showPanZoomTickLabels) {
  7205. this._showPanZoomTickLabels = showPanZoomTickLabels;
  7206. return this;
  7207. },
  7208. /** @expose */
  7209. axisTitle : function(axisTitle) {
  7210. this._axisTitle = axisTitle;
  7211. return this;
  7212. },
  7213. /** @expose */
  7214. axisColor : function(axisColor) {
  7215. this._lineColor = axisColor;
  7216. this._tickColor = axisColor;
  7217. return this;
  7218. },
  7219. /** @expose */
  7220. lineColor : function(lineColor) {
  7221. this._lineColor = lineColor;
  7222. return this;
  7223. },
  7224. /** @expose */
  7225. tickColor : function(tickColor) {
  7226. this._tickColor = tickColor;
  7227. return this;
  7228. },
  7229. /** @expose */
  7230. labelColor : function(labelColor) {
  7231. this._labelStyle["fill"] = labelColor;
  7232. return this;
  7233. },
  7234. labelStyle$0 : function(fill, fontSize, fontFamily) {
  7235. this._labelStyle["fill"] = fill;
  7236. this._labelStyle["font-size"] = fontSize;
  7237. this._labelStyle["font-family"] = fontFamily;
  7238. return this;
  7239. },
  7240. /** @expose */
  7241. titleColor : function(titleColor) {
  7242. this._titleStyle["fill"] = titleColor;
  7243. return this;
  7244. },
  7245. titleStyle$0 : function(fill, fontSize, fontFamily) {
  7246. this._titleStyle["fill"] = fill;
  7247. this._titleStyle["font-size"] = fontSize;
  7248. this._titleStyle["font-family"] = fontFamily;
  7249. return this;
  7250. },
  7251. /**
  7252. * @param (int) padding The new padding
  7253. */
  7254. /** @expose */
  7255. padding : function(padding) {
  7256. this._padding = padding;
  7257. return this;
  7258. },
  7259. /**
  7260. * @param mode LayoutMode for axis, one of: null (numeric axis), automatic, horizontal, stagger, rotate45, rotate90
  7261. */
  7262. /** @expose */
  7263. layoutMode : function(layoutMode) {
  7264. this._layoutMode = -1;
  7265. if (layoutMode != null) {
  7266. if (layoutMode == "horizontal") {
  7267. this._layoutMode = 0;
  7268. } else if (layoutMode == "stagger") {
  7269. this._layoutMode = 3;
  7270. } else if (layoutMode == "rotate45") {
  7271. this._layoutMode = 2;
  7272. } else if (layoutMode == "rotate90") {
  7273. this._layoutMode = 1;
  7274. }
  7275. }
  7276. return this;
  7277. },
  7278. /**
  7279. * @param (boolean) allow Enable Stagger to be considered in the automatic layout algorithm
  7280. */
  7281. /** @expose */
  7282. allowStagger : function(allow) {
  7283. this._allowStagger = allow;
  7284. return this;
  7285. },
  7286. /**
  7287. * @param (boolean) allow Enable Rotate 45 to be considered in the automatic layout algorithm
  7288. */
  7289. /** @expose */
  7290. allowRotate45 : function(allow) {
  7291. this._allowRotate45 = allow;
  7292. return this;
  7293. },
  7294. /**
  7295. * @param (boolean) allow Enable Rotate 90 to be considered in the automatic layout algorithm
  7296. */
  7297. /** @expose */
  7298. allowRotate90 : function(allow) {
  7299. this._allowRotate90 = allow;
  7300. return this;
  7301. },
  7302. /**
  7303. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  7304. */
  7305. renderedShapes : function() {
  7306. return this._renderedShapes;
  7307. },
  7308. labelStyle$1 : function(fontStyle) {
  7309. this._labelStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  7310. return this;
  7311. },
  7312. titleStyle$1 : function(fontStyle) {
  7313. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  7314. return this;
  7315. },
  7316. /**
  7317. * Determines whether the axis is swapped.
  7318. * @return (boolean) True if axis is swapped
  7319. */
  7320. isAxisSwapped : function() {
  7321. 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")));
  7322. },
  7323. /**
  7324. * <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>
  7325. * @param (String) indicator the string to be placed to indicated truncated text
  7326. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  7327. */
  7328. /** @expose */
  7329. textTruncateIndicator : function(indicator) {
  7330. this._textTruncationIndicator = indicator;
  7331. return this;
  7332. },
  7333. /**
  7334. * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
  7335. */
  7336. stopLabelDroppingUpdate : function() {
  7337. this._pendingLabelTimer = false;
  7338. },
  7339. /**
  7340. * 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.
  7341. * @param (rave['internal']['Selector']) labels the selection of valid labels for the end of the transition
  7342. * @param (double) duration of the transition. If 0, we don't do anything.
  7343. * @param (double) delay of the transition. Added to the duration to delay the updates.
  7344. */
  7345. updateLabelDropping : function(labels, duration, delay) {
  7346. var self = this;
  7347. var start = delay + duration;
  7348. var labelCollideCallback = function(elapsed) {
  7349. if (!self._pendingLabelTimer) {
  7350. return true;
  7351. }
  7352. labels.call(self._dropOverlap, self._hideOverlappingLabels);
  7353. if (elapsed >= start) {
  7354. self._pendingLabelTimer = false;
  7355. return true;
  7356. }
  7357. return false;
  7358. };
  7359. if (duration > 0) {
  7360. this._pendingLabelTimer = true;
  7361. rave.timer(labelCollideCallback, start);
  7362. }
  7363. },
  7364. doLabelWrappingAfterAnimation : function(g, labels, mode, duration, delay) {
  7365. this._layoutTimerId++;
  7366. var timerId = this._layoutTimerId;
  7367. var self = this;
  7368. var wrapCallback = function(elapsed) {
  7369. if (self._layoutTimerId == timerId) {
  7370. self.doLabelWrapping(g, mode);
  7371. self.handleLabelsRotationAndPosition(g, labels, mode);
  7372. }
  7373. return true;
  7374. };
  7375. rave.timer(wrapCallback, delay + duration);
  7376. },
  7377. /** @expose */
  7378. preLayout : function() {
  7379. this._layoutTitleSize = 0;
  7380. this._layoutLabelSize = 0;
  7381. this._layoutLabelHeight = 0;
  7382. this._layoutAverageDigitWidth = 0;
  7383. this._layoutSpillOver = 0;
  7384. },
  7385. /** @expose */
  7386. getSizableType : function() {
  7387. return this._scale.isOrdinal() || this._scale.isClustered() ? 1 : 0;
  7388. },
  7389. /** @expose */
  7390. getSizableOrientation : function() {
  7391. return this._orient;
  7392. },
  7393. /** @expose */
  7394. getPreferredSize : function() {
  7395. var layoutPaddingSize = 0;
  7396. if (this._axis) {
  7397. layoutPaddingSize = this._axis.tickSize();
  7398. if (this._layoutLabelSize != 0) {
  7399. layoutPaddingSize += this._padding / 2;
  7400. }
  7401. if (this._layoutTitleSize != 0) {
  7402. layoutPaddingSize += this._padding / 2;
  7403. }
  7404. }
  7405. return this._layoutLabelSize + this._layoutAverageDigitWidth + this._layoutTitleSize + layoutPaddingSize + 2;
  7406. },
  7407. /** @expose */
  7408. getSpillOverSize : function() {
  7409. return this._layoutSpillOver;
  7410. },
  7411. /** @expose */
  7412. orient : function(a0) {
  7413. var args = arguments;
  7414. if (args.length == 0) {
  7415. return this.orient$1();
  7416. }
  7417. return this.orient$0(a0);
  7418. },
  7419. /** @expose */
  7420. tickFormat : function(a0) {
  7421. var args = arguments;
  7422. if (args.length == 0) {
  7423. return this.tickFormat$1();
  7424. }
  7425. return this.tickFormat$0(a0);
  7426. },
  7427. /** @expose */
  7428. simplifiedTickFormat : function(a0) {
  7429. var args = arguments;
  7430. if (args.length == 0) {
  7431. return this.simplifiedTickFormat$1();
  7432. }
  7433. return this.simplifiedTickFormat$0(a0);
  7434. },
  7435. /** @expose */
  7436. labelStyle : function(a0, a1, a2) {
  7437. var args = arguments;
  7438. if (args.length == 1) {
  7439. return this.labelStyle$1(a0);
  7440. }
  7441. return this.labelStyle$0(a0, a1, a2);
  7442. },
  7443. /** @expose */
  7444. titleStyle : function(a0, a1, a2) {
  7445. var args = arguments;
  7446. if (args.length == 1) {
  7447. return this.titleStyle$1(a0);
  7448. }
  7449. return this.titleStyle$0(a0, a1, a2);
  7450. }
  7451. });
  7452. /**
  7453. * 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.
  7454. * @param (rave['internal']['RectStruct']) bounds Rectangle of the axis bounds
  7455. * @param (String) orient Orient, "top", "bottom", "left", "right"; if not valid, "bottom" used
  7456. * @return (double[]) Translation [x,y]
  7457. */
  7458. /** @expose */
  7459. com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation = function(bounds, orient) {
  7460. if ("left" == orient) {
  7461. return [bounds.x + bounds.width, 0.0];
  7462. }
  7463. if ("right" == orient) {
  7464. return [bounds.x, 0.0];
  7465. }
  7466. if ("top" == orient) {
  7467. return [0.0, bounds.y + bounds.height];
  7468. }
  7469. return [0.0, bounds.y];
  7470. };
  7471. com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex = rave['internal']['Declare']({
  7472. //_node : null,
  7473. _domainIndex : 0,
  7474. /** @expose */
  7475. constructor : function(node, domainIndex) {
  7476. this._node = node;
  7477. this._domainIndex = domainIndex;
  7478. },
  7479. /** @expose */
  7480. contains : function(node) {
  7481. return node == this._node;
  7482. },
  7483. /** @expose */
  7484. getIndex : function() {
  7485. return this._domainIndex;
  7486. }
  7487. });
  7488. /**
  7489. * Tick Handler for the axis. This will get called as the core axis is transitioned.
  7490. */
  7491. com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler = rave['internal']['Declare'](rave['internal']['AbstractTickHandler'], {
  7492. //_label : null,
  7493. //_tick : null,
  7494. _$functionClassMethod : function() {
  7495. var _$self = function(args) {
  7496. if (args !== null || arguments.length > 1){
  7497. args = Array.prototype.slice.call(arguments, 0);
  7498. }
  7499. {
  7500. _$self.handle(args[0]);
  7501. return null;
  7502. }
  7503. };
  7504. return _$self;
  7505. },
  7506. constructor : function(label, tick) {
  7507. this._label = label;
  7508. this._tick = tick;
  7509. },
  7510. /** @expose */
  7511. handle : function(ticks) {
  7512. ticks.call(this._tick);
  7513. ticks.call(this._label);
  7514. }
  7515. });
  7516. //com_ibm_rave_bundles_components_AxisComponentImpl.VISIBILITY = "visibility";
  7517. //com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN = "hidden";
  7518. /** @expose */
  7519. com_ibm_rave_bundles_components_AxisComponentImpl.LABEL_HIDDEN_FLAG = "__tickLabelHidden__";
  7520. /** @expose */
  7521. com_ibm_rave_bundles_components_AxisComponentImpl.PANZOOM_HIDDEN_FLAG = "__panZoomHidden__";
  7522. /** @expose */
  7523. com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN_COUNT = "__hiddenCount__";
  7524. /** @expose */
  7525. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_SPACE_PER_TICK = 20;
  7526. /** @expose */
  7527. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_TICK_COUNT = 10;
  7528. /** @expose */
  7529. com_ibm_rave_bundles_components_AxisComponentImpl.TICK_PADDING = 10;
  7530. //com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL_WEIGHT = 1.1;
  7531. com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL = 0;
  7532. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE90 = 1;
  7533. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE45 = 2;
  7534. com_ibm_rave_bundles_components_AxisComponentImpl.STAGGER = 3;
  7535. /**
  7536. * Constant used for text flow spacing
  7537. */
  7538. com_ibm_rave_bundles_components_AxisComponentImpl.TEXTFLOW_SPACING = 1.2;
  7539. /**
  7540. * Bottom axis orientation string.
  7541. */
  7542. /** @expose */
  7543. com_ibm_rave_bundles_components_AxisComponentImpl.BOTTOM_ORIENTATION = "bottom";
  7544. /**
  7545. * Top axis orientation string.
  7546. */
  7547. /** @expose */
  7548. com_ibm_rave_bundles_components_AxisComponentImpl.TOP_ORIENTATION = "top";
  7549. /**
  7550. * Left axis orientation string.
  7551. */
  7552. /** @expose */
  7553. com_ibm_rave_bundles_components_AxisComponentImpl.LEFT_ORIENTATION = "left";
  7554. /**
  7555. * Right axis orientation string.
  7556. */
  7557. /** @expose */
  7558. com_ibm_rave_bundles_components_AxisComponentImpl.RIGHT_ORIENTATION = "right";
  7559. com_ibm_rave_bundles_components_AxisComponentImpl.AUTOMODE = -1;
  7560. // $source: com/ibm/rave/bundles/components/GridComponentImpl
  7561. /************************************************************************
  7562. ** IBM Confidential
  7563. **
  7564. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7565. **
  7566. ** (C) Copyright IBM Corp. 2017
  7567. **
  7568. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7569. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7570. ************************************************************************/
  7571. // GENERATED
  7572. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  7573. //@import com/ibm/rave/bundles/components/StyleStructs (runtime) // new
  7574. //@import com/ibm/rave/bundles/component/GridComponent (runtime) // GridComponent
  7575. /**
  7576. * <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>
  7577. */
  7578. var com_ibm_rave_bundles_components_GridComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  7579. /**
  7580. * The axis property
  7581. */
  7582. //_axis : null,
  7583. /**
  7584. * Role, from the AxisComponent API
  7585. */
  7586. //_role : null,
  7587. /**
  7588. * The orientation
  7589. */
  7590. //_orient : null,
  7591. /**
  7592. * The bounds
  7593. */
  7594. //_bounds : null,
  7595. /**
  7596. * Style of gridlines
  7597. */
  7598. //_gridlineStyle : null,
  7599. /**
  7600. * Whether to display gridlines
  7601. */
  7602. _displayGridlines : false,
  7603. /**
  7604. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  7605. */
  7606. _renderedShapes : false,
  7607. /**
  7608. * Construct, with all properties the defaults.
  7609. */
  7610. /** @expose */
  7611. constructor : function() {
  7612. this._axis = null;
  7613. this._role = null;
  7614. this._orient = "bottom";
  7615. this._bounds = null;
  7616. this._displayGridlines = true;
  7617. this._gridlineStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
  7618. this._renderedShapes = false;
  7619. },
  7620. /** @expose */
  7621. type : function() {
  7622. return com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE;
  7623. },
  7624. /** @expose */
  7625. role : function() {
  7626. return this._role;
  7627. },
  7628. /** @expose */
  7629. execute : function(g) {
  7630. this.preExecute();
  7631. if (!this._displayGridlines || !this._axis || !this._bounds) {
  7632. g.selectAll("*").remove();
  7633. this._renderedShapes = false;
  7634. return;
  7635. }
  7636. this._renderedShapes = true;
  7637. var size = ("bottom" == this._orient || "top" == this._orient) ? this._bounds.height : this._bounds.width;
  7638. var ticksHandler = this._axis.ticksHandler();
  7639. var tickSize = this._axis.tickSize();
  7640. var outerTickSize = this._axis.outerTickSize();
  7641. var tickFormat = this._axis.tickFormat();
  7642. var ax = this._axis.tickSize(-size, 0).tickFormat("").ticksHandler(null);
  7643. g.call(ax);
  7644. this._axis.tickSize(tickSize, outerTickSize).tickFormat(tickFormat).ticksHandler(ticksHandler);
  7645. g.selectAll("g.tick line").classed("grid-tick", true);
  7646. g.selectAll(".grid-tick").style("stroke", this._gridlineStyle._stroke).style("stroke-dasharray", (this._gridlineStyle._dashArray));
  7647. g.selectAll("path.domain").remove();
  7648. },
  7649. /**
  7650. * @param (rave['internal']['Axis']) axis The new axis
  7651. */
  7652. /** @expose */
  7653. axis : function(axis) {
  7654. this._axis = axis;
  7655. return this;
  7656. },
  7657. /**
  7658. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  7659. * @param (String) role The new role
  7660. * @return (com.ibm.rave.bundles.components.GridComponentImpl) This object
  7661. */
  7662. /** @expose */
  7663. setRole : function(role) {
  7664. this._role = role;
  7665. return this;
  7666. },
  7667. /**
  7668. * Only legal values are accepted, otherwise the orient is unchanged.
  7669. * @param (String) orient The new orient
  7670. */
  7671. orient$0 : function(orient) {
  7672. if ("left" == orient || "right" == orient || "bottom" == orient || "top" == orient) {
  7673. this._orient = orient;
  7674. }
  7675. return this;
  7676. },
  7677. /**
  7678. * @param (rave['internal']['RectStruct']) bounds The new bounds
  7679. */
  7680. /** @expose */
  7681. bounds : function(bounds) {
  7682. this._bounds = bounds;
  7683. return this;
  7684. },
  7685. displayGridlines$0 : function(displayGridlines) {
  7686. this._displayGridlines = displayGridlines;
  7687. return this;
  7688. },
  7689. /** @expose */
  7690. gridlineStyle : function(gridlineColor, dashArray) {
  7691. this.gridlineColor(gridlineColor);
  7692. this.dashArray(dashArray);
  7693. return this;
  7694. },
  7695. gridlineColor$0 : function(gridlineColor) {
  7696. this._gridlineStyle._stroke = (gridlineColor != null && gridlineColor.length > 0) ? gridlineColor : null;
  7697. return this;
  7698. },
  7699. dashArray$0 : function(dashArray) {
  7700. this._gridlineStyle._dashArray = (dashArray != null && dashArray.length > 0) ? dashArray : null;
  7701. return this;
  7702. },
  7703. /**
  7704. * @return (String) The orientation of the gridline.
  7705. */
  7706. orient$1 : function() {
  7707. return this._orient;
  7708. },
  7709. displayGridlines$1 : function() {
  7710. return this._displayGridlines;
  7711. },
  7712. gridlineColor$1 : function() {
  7713. return this._gridlineStyle._stroke;
  7714. },
  7715. dashArray$1 : function() {
  7716. return this._gridlineStyle._dashArray;
  7717. },
  7718. /**
  7719. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  7720. */
  7721. renderedShapes : function() {
  7722. return this._renderedShapes;
  7723. },
  7724. /** @expose */
  7725. orient : function(a0) {
  7726. var args = arguments;
  7727. if (args.length == 0) {
  7728. return this.orient$1();
  7729. }
  7730. return this.orient$0(a0);
  7731. },
  7732. /** @expose */
  7733. displayGridlines : function(a0) {
  7734. var args = arguments;
  7735. if (args.length == 0) {
  7736. return this.displayGridlines$1();
  7737. }
  7738. return this.displayGridlines$0(a0);
  7739. },
  7740. /** @expose */
  7741. gridlineColor : function(a0) {
  7742. var args = arguments;
  7743. if (args.length == 0) {
  7744. return this.gridlineColor$1();
  7745. }
  7746. return this.gridlineColor$0(a0);
  7747. },
  7748. /** @expose */
  7749. dashArray : function(a0) {
  7750. var args = arguments;
  7751. if (args.length == 0) {
  7752. return this.dashArray$1();
  7753. }
  7754. return this.dashArray$0(a0);
  7755. }
  7756. });
  7757. // $source: com/ibm/rave/bundles/components/KeyedBundleComponentImpl
  7758. /************************************************************************
  7759. ** IBM Confidential
  7760. **
  7761. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7762. **
  7763. ** (C) Copyright IBM Corp. 2017
  7764. **
  7765. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7766. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7767. ************************************************************************/
  7768. // GENERATED
  7769. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  7770. /**
  7771. * This type of component generates scene nodes based on a provided data set. Accordingly, any component deriving from this class can (and should) make use of this class's <em>key function</em>. Typically this key function will be passed to the second argument of {@link this.Selector#this.data(, rave['internal']['ValueFunction'])} method in Rave Core, when joining data to scene nodes. For more information on how key functions are used, see the documentation for {@link this.Selector#this.data(, rave['internal']['ValueFunction'])} in Rave Core.
  7772. * @param < (com.ibm.rave.bundles.components.KeyedBundleComponentImpl) T > Any class that extends this component type must have a self reference in order to support method chaining of the {@link this.KeyedBundleComponentImpl#this.key(rave['internal']['SingleValueFunction'])} method. For example: <pre> public class MyComponent extends DataBasedBundleComponent<MyComponent> { ... ... MyComponent c = new MyComponent(); c.someSetter(arg) .key(keyFunction) // returns the MyComponent instance, rather than a DataBasedBundleComponent instance. .otherSetter(arg2); </pre>
  7773. */
  7774. var com_ibm_rave_bundles_components_KeyedBundleComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  7775. //keyFunction : null,
  7776. /**
  7777. * Set the key function this component should use when joining data to scene nodes.
  7778. * @param (rave['internal']['SingleValueFunction']) keyFunction This function will be passed each datum individually and must return a unique value (a key).
  7779. * @return (com.ibm.rave.bundles.components.KeyedBundleComponentImpl) This.
  7780. */
  7781. /** @expose */
  7782. key : function(keyFunction) {
  7783. this.keyFunction = keyFunction;
  7784. return this;
  7785. },
  7786. /**
  7787. * Returns a {@link (rave['internal']['ValueFunction']) ValueFunction} that wraps the provided key function.
  7788. */
  7789. /** @expose */
  7790. getKey : function() {
  7791. if (!this.keyFunction) {
  7792. return null;
  7793. }
  7794. var self = this;
  7795. return function(datum, index, groupIndex) {
  7796. return self.keyFunction(datum);
  7797. };
  7798. }
  7799. });
  7800. // $source: com/ibm/rave/bundles/components/PointComponentImpl
  7801. /************************************************************************
  7802. ** IBM Confidential
  7803. **
  7804. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7805. **
  7806. ** (C) Copyright IBM Corp. 2017
  7807. **
  7808. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7809. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7810. ************************************************************************/
  7811. // GENERATED
  7812. //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
  7813. //@import com/ibm/rave/bundles/component/PointComponent (runtime) // PointComponent
  7814. //@import com/ibm/rave/bundles/utilities/PathUtils (runtime) // fadeOutIn
  7815. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  7816. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  7817. //@import com/ibm/rave/bundles/utilities/LabelStyleUtil (runtime) // new
  7818. /**
  7819. * <p> A component to draw point charts. The component puts its shapes into the selector passed to its execute method. </p> <p> The data array passed to the component has one entry per point to be drawn. Each entry has five properties. Accessors are used to get these properties from the object, and scales to convert them to a graphical property. If a property is not defined (either no accessor or no scale), a default value is used for the property. The five properties are: </p> <ul> <li> <b>dependent</b>: One of the two coordinate variables for the points. If not defined the coordinate is the midpoint of the chart dimension. </li> <li> <b>independent</b>: One of the two coordinate variables for the points. If not defined the coordinate is the midpoint of the chart dimension. </li> <li> <b>color</b>: Used for the fill color of the points. If not defined the fill is a default value set with a property. </li> <li> <b>size</b>: Used to size the points. If not defined the point is sized to a default value set with a property. </li> <li> <b>label</b>: Label for the point. If not defined the point is not labeled. The point component does not do internationalization, and this string is the value displayed. </li> </ul> <p> Scatterplots in general do not distinguish between the dependent and independent variables. The names are used here for compatibility with other two-axis plots such as the line and column. </p> <p> The component properties are: </p> <p> <b>data</b>: An array with one entry per point. If null, no points are drawn. </p> <p> <b>independentAccessor</b>: A value function applied to a data object to get the independent value. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>independentScale</b>: A scale applied to the independent value to get the pixel coordinate for drawing the line. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>dependentAccessor</b>: A value function applied to a data object to get the dependent value. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>dependentScale</b>: A scale applied to the dependent value to get the pixel coordinate for drawing the line. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>colorAccessor</b>: A value function applied to a data object to get the color value. If null, the point is drawn in the primary color. The default is null. </p> <p> <b>colorPalette</b>: A palette applied to the color value to get a color value for drawing the point. If null or if it returns null, the point is drawn in the primary color. </p> <p> <b>sizeAccessor</b>: A value function applied to a data object to get the size value used for the point size. If null, the point is drawn with the default size. The default is null. </p> <p> <b>sizeScale</b>: A scale applied to the size value to get the size for drawing for drawing the line. If null or if it returns null, the point is drawn with the default size. The default is null. </p> <p> <b>labelAccessor</b>: A value function applied to a data object to get the label. If null, the point is not labeled. The default is null. </p> <p> <b>labelFormatter</b>: A value function applied to the data label (as returned by the labelAccessor) to get the formatted text string used in the chart. If null, the data label is coerced to a string and used as the formatted text string. The default is null. The method is not called when the data label is null. </p> <p> <b>bounds</b>: The bounding rectangle of the component, used to find the midpoints of the coordinates when the independent or dependent variables are not defined. If either of those variables is not defined and the bounds is null, no points are drawn. The default is null. </p> <p> <b>transpose</b>: A boolean. If false the independent data is shown on the X axis and the dependent data on the Y; if true they are swapped. Default false. </p> <p> <b>primaryColor</b>: The color used to draw the point when the point has no color value or there is no color scale. If null, the point is drawn but not colored, and the CSS style will be used. </p> <p> <b>symbol</b>: The symbol used to draw the shape, which must be one of the RAVE/D3 symbol generator names or "rectangle". If null, the point is drawn as a circle. </p> <p> <b>defaultSize</b>: The size used to draw the point when the point has no size value or there is no size scale. The default is 100 and the value cannot be set to less than 0. Note that this uses the RAVE/D3 convention, where the size is in square pixels. </p> <p> <b>itemLabel</b>: A boolean. If true and if the label accessor is defined, the label is shown on each item. Default true. </p> <p> <b>itemOverlap</b>: A boolean. If true, overlapping labels are removed. Default is true. </p> <p> <b>effect</b>: A string. Requests an entrance effect; if null or not a supported effect, no entrance effect is used. Default null. The supported effects are: </p> <ul> <li> "grow": Shapes start at size zero and grow to full size. </li> <li> "fromBase": Shapes start at dependent coordinate 0 and move to final position. Only used when the dependent scale is non-ordinal. </li> <li> "grow+fromBase": Combines the grow and fromBase effects. </li> </ul>
  7820. */
  7821. var com_ibm_rave_bundles_components_PointComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
  7822. /**
  7823. * Data
  7824. */
  7825. //_data : null,
  7826. /**
  7827. * Accessor for independent variable
  7828. */
  7829. //_independentAccessor : null,
  7830. /**
  7831. * Independent variable scale
  7832. */
  7833. //_independentScale : null,
  7834. /**
  7835. * Accessor for dependent variable
  7836. */
  7837. //_dependentAccessor : null,
  7838. /**
  7839. * Dependent scale
  7840. */
  7841. //_dependentScale : null,
  7842. /**
  7843. * Color scale
  7844. */
  7845. //_colorPalette : null,
  7846. /**
  7847. * Accessor for size role
  7848. */
  7849. //_sizeAccessor : null,
  7850. /**
  7851. * Size scale
  7852. */
  7853. //_sizeScale : null,
  7854. /**
  7855. * Accessor for label role
  7856. */
  7857. //_labelAccessor : null,
  7858. /**
  7859. * Label formatter, may be null
  7860. */
  7861. //_labelFormatter : null,
  7862. //_labelFontStyle : null,
  7863. /**
  7864. * Bounds
  7865. */
  7866. //_bounds : null,
  7867. /**
  7868. * Symbol
  7869. */
  7870. //_symbol : null,
  7871. /**
  7872. * Previous symbol: allows better transitions between symbols
  7873. */
  7874. //_prevSymbol : null,
  7875. //_dropOverlap : null,
  7876. /**
  7877. * Effect
  7878. */
  7879. //_effect : null,
  7880. //_borderWidth : null,
  7881. //_borderColor : null,
  7882. //_itemLabelPosition : null,
  7883. //_labelStyleUtil : null,
  7884. /**
  7885. * Transpose
  7886. */
  7887. _transpose : false,
  7888. /**
  7889. * Default size
  7890. */
  7891. _defaultSize : 0,
  7892. /**
  7893. * Show label
  7894. */
  7895. _itemLabel : false,
  7896. /**
  7897. * Drop overlapping labels
  7898. */
  7899. _itemOverlap : false,
  7900. _labelLayerClass : ".element-label-group",
  7901. _elementLayerClass : ".element-group",
  7902. _labelContrast : false,
  7903. _labelShadow : false,
  7904. constructor : function() {
  7905. this._labelFontStyle = {};
  7906. {
  7907. this._data = null;
  7908. this._independentAccessor = null;
  7909. this._independentScale = null;
  7910. this._dependentAccessor = null;
  7911. this._dependentScale = null;
  7912. this._colorPalette = null;
  7913. this._sizeAccessor = null;
  7914. this._sizeScale = null;
  7915. this._labelAccessor = null;
  7916. this._labelFormatter = null;
  7917. this._bounds = null;
  7918. this._transpose = false;
  7919. this._defaultSize = 400.0;
  7920. this._symbol = null;
  7921. this._prevSymbol = null;
  7922. this._itemLabel = true;
  7923. this._itemOverlap = true;
  7924. this._effect = null;
  7925. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  7926. this._borderWidth = null;
  7927. this._borderColor = null;
  7928. this._labelStyleUtil = new com_ibm_rave_bundles_utilities_LabelStyleUtil();
  7929. if (!(rave.svg.symbolTypes.indexOf("donutPlus")> -1)) {
  7930. rave.svg.symbolCreator("donutPlus", rave['library']['internal']['CommonPropertyConstants'].DONUT_PLUS);
  7931. }
  7932. if (!(rave.svg.symbolTypes.indexOf("donut-thin")> -1)) {
  7933. rave.svg.symbolCreator("donut-thin", rave['library']['internal']['CommonPropertyConstants'].DONUT_THIN);
  7934. }
  7935. }
  7936. },
  7937. /** @expose */
  7938. type : function() {
  7939. return com_ibm_rave_bundles_component_PointComponent.COMPONENT_TYPE;
  7940. },
  7941. /** @expose */
  7942. execute : function(g) {
  7943. this.preExecute();
  7944. var elementGroupSelector = g.selectAll(this._elementLayerClass);
  7945. var labelGroupSelector = g.selectAll(this._labelLayerClass);
  7946. if (g.classed(this._elementLayerClass) || elementGroupSelector.size() == 0 || labelGroupSelector.size() == 0) {
  7947. elementGroupSelector = g;
  7948. labelGroupSelector = g;
  7949. }
  7950. if (!this._data || (!this._bounds && (!this._independentAccessor || !this._independentScale || !this._dependentAccessor || !this._dependentScale))) {
  7951. elementGroupSelector.selectAll("*").remove();
  7952. labelGroupSelector.selectAll("*").remove();
  7953. return;
  7954. }
  7955. elementGroupSelector.selectAll("*").remove();
  7956. labelGroupSelector.selectAll("*").remove();
  7957. var self = this;
  7958. var enterTransform = this.pointTransform(true);
  7959. var finalTransform = this.pointTransform(false);
  7960. var symbols = [];
  7961. if (this._symbol == null) {
  7962. elementGroupSelector.selectAll("*").remove();
  7963. } else if (this._symbol == "donutPlus") {
  7964. var s = new rave['internal']['Symbol']().type("circle");
  7965. symbols.push(s);
  7966. s = new rave['internal']['Symbol']().type("donut-thin");
  7967. symbols.push(s);
  7968. } else {
  7969. var s = new rave['internal']['Symbol']().type(this._symbol);
  7970. symbols.push(s);
  7971. elementGroupSelector.selectAll("." + com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT).remove();
  7972. }
  7973. for (var i = 0; i < symbols.length; ++i) {
  7974. var type = i == 0 ? "element-shape" : com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT;
  7975. var shapes = elementGroupSelector.selectAll("." + type).data(this._data, this.getKey());
  7976. shapes.exit().remove();
  7977. var symbol = symbols[i];
  7978. var fillStyle = this.symbolFill(type);
  7979. shapes.enter().append("path").attr("class", type).attr("transform", enterTransform).attr("d", symbol.size(this.enterSize(this._defaultSize, type))).style("fill", fillStyle).style("stroke", fillStyle).style("stroke-width", "0px");
  7980. var s = rave.transition(shapes).attr("transform", finalTransform).style("fill", fillStyle);
  7981. this.updateBorder(s, this._borderWidth, this._borderColor);
  7982. symbol.size(this.finalSize(this._defaultSize, type));
  7983. if (this._prevSymbol != null && !(this._prevSymbol == this._symbol)) {
  7984. com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn(s, symbol);
  7985. } else {
  7986. s.attr("d", symbol);
  7987. }
  7988. }
  7989. if (this._itemLabel && this._labelAccessor) {
  7990. var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
  7991. if (elementLabelGroupSelector.size() == 0) {
  7992. elementLabelGroupSelector = g;
  7993. }
  7994. var labels = elementLabelGroupSelector.selectAll("element-label").data(this._data, this.getKey());
  7995. labels.exit().remove();
  7996. var labelText = !this._labelFormatter ? function(data, index, groupIndex) {
  7997. return self._labelAccessor(data);
  7998. } : function(data, index, groupIndex) {
  7999. var v = self._labelAccessor(data);
  8000. return v == null ? null : self._labelFormatter.call(this, v, index, groupIndex);
  8001. };
  8002. var fontChecker = rave.capabilities.extension("fontchecker");
  8003. labels.enter().append("text").attr("class", "element-label").attr("x", this.positionX(true)).attr("y", this.positionY(true)).attr("dx", this.getXOffset()).attr("dy", this.getYOffset()).style("text-anchor", this.getAnchor()).text(labelText);
  8004. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  8005. this._labelStyleUtil.labelFont(this._labelFontStyle).labelFillColor(this._labelContrast ? this.getLabelFill() : function(data, index, groupIndex) {
  8006. return labelColor;
  8007. }).labelShadow(this._labelShadow);
  8008. labels.call(this._labelStyleUtil);
  8009. if (fontChecker) {
  8010. labels.call(fontChecker);
  8011. }
  8012. var labelTransition = rave.transition(labels).attr("x", this.positionX(false)).attr("y", this.positionY(false)).attr("dx", this.getXOffset()).attr("dy", this.getYOffset()).style("text-anchor", this.getAnchor()).text(labelText);
  8013. this._dropOverlap.configureForDataLabels(this._bounds);
  8014. labelTransition.call(this._dropOverlap, this._itemOverlap);
  8015. } else {
  8016. var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
  8017. if (elementLabelGroupSelector.size() == 0) {
  8018. elementLabelGroupSelector = g;
  8019. }
  8020. elementLabelGroupSelector.selectAll("text.element-label").remove();
  8021. }
  8022. },
  8023. symbolFill : function(type) {
  8024. var self = this;
  8025. return function(d, index, groupIndex) {
  8026. if (self._symbol == "donutPlus" && type == com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT) {
  8027. return "white";
  8028. }
  8029. return !self._colorPalette ? null : self._colorPalette.call(null, d, 0, 0);
  8030. };
  8031. },
  8032. /**
  8033. * Get the enter transform of a shape, for the argument to attr("transform",v). If the effect requires from-base movement, this is a translate where the independent coordinate starts at the scale zero. Otherwise it is the same as finalTransform(). This should only be called if either bounds is non-null, or the dependent and independent accessors and scales are all non-null. The result depends on the transpose, on which accessors and scales are defined, on the bounds, and on the effect.
  8034. * @return (rave['internal']['ValueFunction']) Transform value function
  8035. */
  8036. pointTransform : function(enter) {
  8037. var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
  8038. var dependent = useDependentZero ? this.dependentZero() : this.dependent();
  8039. var independent = this.independent();
  8040. if (this._transpose) {
  8041. return function(data, index, groupIndex) {
  8042. return "translate(" + dependent.call(this, data, index, groupIndex) + "," + independent.call(this, data, index, groupIndex) + ")";
  8043. };
  8044. }
  8045. return function(data, index, groupIndex) {
  8046. return "translate(" + independent.call(this, data, index, groupIndex) + "," + dependent.call(this, data, index, groupIndex) + ")";
  8047. };
  8048. },
  8049. /**
  8050. * Get the enter x of a label, for the argument to attr("x",v). If the effect requires from-base movement, this is a translate where the independent coordinate starts at the scale zero. Otherwise it is the same as finalTransform(). This should only be called if either bounds is non-null, or the dependent and independent accessors and scales are all non-null. The result depends on the transpose, on which accessors and scales are defined, on the bounds, and on the effect.
  8051. * @return (rave['internal']['ValueFunction']) X value function
  8052. */
  8053. positionX : function(enter) {
  8054. var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
  8055. var dependent = useDependentZero ? this.dependentZero() : this.dependent();
  8056. var independent = this.independent();
  8057. if (this._transpose) {
  8058. return function(data, index, groupIndex) {
  8059. return dependent.call(this, data, index, groupIndex);
  8060. };
  8061. }
  8062. return function(data, index, groupIndex) {
  8063. return independent.call(this, data, index, groupIndex);
  8064. };
  8065. },
  8066. /**
  8067. * Get the enter y of a label, for the argument to attr("y",v). If the effect requires from-base movement, this is a translate where the independent coordinate starts at the scale zero. Otherwise it is the same as finalTransform(). This should only be called if either bounds is non-null, or the dependent and independent accessors and scales are all non-null. The result depends on the transpose, on which accessors and scales are defined, on the bounds, and on the effect.
  8068. * @return (rave['internal']['ValueFunction']) Y value function
  8069. */
  8070. positionY : function(enter) {
  8071. var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
  8072. var dependent = useDependentZero ? this.dependentZero() : this.dependent();
  8073. var independent = this.independent();
  8074. if (this._transpose) {
  8075. return function(data, index, groupIndex) {
  8076. return independent.call(this, data, index, groupIndex);
  8077. };
  8078. }
  8079. return function(data, index, groupIndex) {
  8080. return dependent.call(this, data, index, groupIndex);
  8081. };
  8082. },
  8083. /**
  8084. * Get a value function that returns the scaled independent coordinate. It should be called only if bounds is defined, or if the independent accessor and scale are both defined.
  8085. * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
  8086. */
  8087. independent : function() {
  8088. if (this._independentAccessor && this._independentScale) {
  8089. var self = this;
  8090. return function(data, index, groupIndex) {
  8091. return self._independentScale.center(self._independentAccessor(data));
  8092. };
  8093. }
  8094. var midpoint = this._transpose ? this._bounds.y + this._bounds.height / 2.0 : this._bounds.x + this._bounds.width / 2.0;
  8095. return function(data, index, groupIndex) {
  8096. return midpoint;
  8097. };
  8098. },
  8099. /**
  8100. * Get a value function that returns the scaled independent coordinate. It should be called only if bounds is defined, or if the dependent accessor and scale are both defined.
  8101. * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
  8102. */
  8103. dependent : function() {
  8104. if (this._dependentAccessor && this._dependentScale) {
  8105. var self = this;
  8106. return function(data, index, groupIndex) {
  8107. return self._dependentScale.center(self._dependentAccessor(data));
  8108. };
  8109. }
  8110. var midpoint = this._transpose ? this._bounds.x + this._bounds.width / 2.0 : this._bounds.y + this._bounds.height / 2.0;
  8111. return function(data, index, groupIndex) {
  8112. return midpoint;
  8113. };
  8114. },
  8115. /**
  8116. * Get a value function that returns the scaled independent zero. If the independent scale is ordinal, this returns the same thing as dependent(); otherwise it returns the scaled zero of the dependent scale.
  8117. * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
  8118. */
  8119. dependentZero : function() {
  8120. if (!this._dependentScale || !(this._dependentScale.isLinear())) {
  8121. return this.dependent();
  8122. }
  8123. var self = this;
  8124. return function(data, index, groupIndex) {
  8125. return self._dependentScale.center(0.0);
  8126. };
  8127. },
  8128. /**
  8129. * Get the initial size of a shape, for the argument to BundleSymbol#size(). If the effect requires shape-grow, this is 0.0. Otherwise it is the final size.
  8130. * @return (rave['internal']['ValueFunction']) Size value function
  8131. */
  8132. enterSize : function(size, type) {
  8133. if ("grow" == this._effect || "growfromBase" == this._effect) {
  8134. return function(data, index, groupIndex) {
  8135. return 0.0;
  8136. };
  8137. }
  8138. return this.finalSize(size, type);
  8139. },
  8140. /**
  8141. * Get the final size of a shape, for the argument to BundleSymbol#size(). If the size accessor and size scale are both defined, the size comes from the scale applied to the accessor value (using the default size for a null accessor value); otherwise it is the default size.
  8142. * @return (rave['internal']['ValueFunction']) Size value function
  8143. */
  8144. finalSize : function(size, type) {
  8145. var self = this;
  8146. var ratio = self._symbol == "donutPlus" && type == com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT ? 0.6 : 1;
  8147. if (this._sizeAccessor && this._sizeScale) {
  8148. return function(d, index, groupIndex) {
  8149. var v = self._sizeAccessor(d);
  8150. return v != null ? + (self._sizeScale.call(null, v, 0, 0)) * ratio : size * ratio;
  8151. };
  8152. }
  8153. return function(d, index, groupIndex) {
  8154. return size * ratio;
  8155. };
  8156. },
  8157. getAnchor : function() {
  8158. var self = this;
  8159. return function(data, index, groupIndex) {
  8160. if (!self._itemLabelPosition) {
  8161. return "middle";
  8162. }
  8163. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  8164. if (0 == labelPosition || 2 == labelPosition || 1 == labelPosition) {
  8165. return "middle";
  8166. } else if (3 == labelPosition) {
  8167. return "end";
  8168. } else if (4 == labelPosition || 5 == labelPosition) {
  8169. return "start";
  8170. }
  8171. return "middle";
  8172. };
  8173. },
  8174. getLabelFill : function() {
  8175. var self = this;
  8176. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  8177. return function(data, index, groupIndex) {
  8178. if (!self._colorPalette || !self._itemLabelPosition) {
  8179. return labelColor;
  8180. }
  8181. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  8182. if (1 == labelPosition) {
  8183. var elementColor = self._colorPalette.call(this, data, index, groupIndex);
  8184. if (elementColor != null) {
  8185. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(elementColor, labelColor).toString();
  8186. }
  8187. }
  8188. return labelColor;
  8189. };
  8190. },
  8191. getXOffset : function() {
  8192. var self = this;
  8193. return function(data, index, groupIndex) {
  8194. var padding = 5;
  8195. if ((!self._itemLabelPosition)) {
  8196. return "0em";
  8197. }
  8198. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  8199. if (3 == labelPosition) {
  8200. return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
  8201. }
  8202. if (4 == labelPosition) {
  8203. return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
  8204. }
  8205. if (5 == labelPosition) {
  8206. return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2) + "px";
  8207. }
  8208. return "0em";
  8209. };
  8210. },
  8211. getYOffset : function() {
  8212. var self = this;
  8213. return function(data, index, groupIndex) {
  8214. var padding = 5;
  8215. if ((!self._itemLabelPosition)) {
  8216. return "0.3em";
  8217. }
  8218. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  8219. if (0 == labelPosition) {
  8220. return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
  8221. }
  8222. if (2 == labelPosition) {
  8223. var fontHeight = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber("1em", 100.0, 10.0);
  8224. return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + fontHeight + padding) + "px";
  8225. }
  8226. if (5 == labelPosition) {
  8227. return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2) + "px";
  8228. }
  8229. return "0.3em";
  8230. };
  8231. },
  8232. /**
  8233. * @param (java.lang.Object[]) data The new data
  8234. */
  8235. /** @expose */
  8236. data : function(data) {
  8237. this._data = data;
  8238. return this;
  8239. },
  8240. /**
  8241. * @param (rave['internal']['SingleValueFunction']) independentAccessor The new independent accessor
  8242. */
  8243. /** @expose */
  8244. independentAccessor : function(independentAccessor) {
  8245. this._independentAccessor = independentAccessor;
  8246. return this;
  8247. },
  8248. /**
  8249. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
  8250. */
  8251. /** @expose */
  8252. independentScale : function(independentScale) {
  8253. this._independentScale = independentScale;
  8254. return this;
  8255. },
  8256. /**
  8257. * @param (rave['internal']['SingleValueFunction']) dependentAccessor The new dependent accessor
  8258. */
  8259. /** @expose */
  8260. dependentAccessor : function(dependentAccessor) {
  8261. this._dependentAccessor = dependentAccessor;
  8262. return this;
  8263. },
  8264. /**
  8265. * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
  8266. */
  8267. /** @expose */
  8268. dependentScale : function(dependentScale) {
  8269. this._dependentScale = dependentScale;
  8270. return this;
  8271. },
  8272. /**
  8273. * @param (rave['library']['internal']['Palette']) colorPalette The new colorPalette
  8274. */
  8275. /** @expose */
  8276. colorPalette : function(colorPalette) {
  8277. this._colorPalette = colorPalette;
  8278. return this;
  8279. },
  8280. /**
  8281. * @param (rave['internal']['SingleValueFunction']) sizeAccessor The new sizeAccessor
  8282. */
  8283. /** @expose */
  8284. sizeAccessor : function(sizeAccessor) {
  8285. this._sizeAccessor = sizeAccessor;
  8286. return this;
  8287. },
  8288. /**
  8289. * @param (rave['internal']['AbstractScale']) sizeScale The new sizeScale
  8290. */
  8291. /** @expose */
  8292. sizeScale : function(sizeScale) {
  8293. this._sizeScale = sizeScale;
  8294. return this;
  8295. },
  8296. /**
  8297. * @param (rave['internal']['SingleValueFunction']) labelAccessor The new labelAccessor
  8298. */
  8299. /** @expose */
  8300. labelAccessor : function(labelAccessor) {
  8301. this._labelAccessor = labelAccessor;
  8302. return this;
  8303. },
  8304. /**
  8305. * @param (rave['internal']['ValueFunction']) labelFormatter The new labelFormatter
  8306. */
  8307. /** @expose */
  8308. labelFormatter : function(labelFormatter) {
  8309. this._labelFormatter = labelFormatter;
  8310. return this;
  8311. },
  8312. /**
  8313. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  8314. */
  8315. /** @expose */
  8316. itemLabelPosition : function(labelPosition) {
  8317. this._itemLabelPosition = labelPosition;
  8318. return this;
  8319. },
  8320. /**
  8321. * @param (rave['internal']['RectStruct']) bounds The new bounds
  8322. */
  8323. /** @expose */
  8324. bounds : function(bounds) {
  8325. this._bounds = bounds;
  8326. return this;
  8327. },
  8328. /**
  8329. * @param (boolean) transpose The new transpose
  8330. */
  8331. /** @expose */
  8332. transpose : function(transpose) {
  8333. this._transpose = transpose;
  8334. return this;
  8335. },
  8336. /**
  8337. * @param (double) defaultSize The new defaultSize
  8338. */
  8339. /** @expose */
  8340. defaultSize : function(defaultSize) {
  8341. this._defaultSize = defaultSize;
  8342. return this;
  8343. },
  8344. /** @expose */
  8345. itemLabel : function(itemLabel) {
  8346. this._itemLabel = itemLabel;
  8347. return this;
  8348. },
  8349. /** @expose */
  8350. labelFont : function(labelFont) {
  8351. this._labelFontStyle = labelFont;
  8352. return this;
  8353. },
  8354. /**
  8355. * @param (boolean) itemOverlap The new itemOverlap
  8356. */
  8357. /** @expose */
  8358. itemOverlap : function(itemOverlap) {
  8359. this._itemOverlap = itemOverlap;
  8360. return this;
  8361. },
  8362. /**
  8363. * @param (String) symbol The new symbol
  8364. */
  8365. /** @expose */
  8366. symbol : function(symbol) {
  8367. this._prevSymbol = this._symbol;
  8368. this._symbol = symbol;
  8369. return this;
  8370. },
  8371. /**
  8372. * @param (String) effect The new effect
  8373. */
  8374. /** @expose */
  8375. effect : function(effect) {
  8376. this._effect = effect;
  8377. return this;
  8378. },
  8379. /** @expose */
  8380. borderWidth : function(borderWidth) {
  8381. this._borderWidth = borderWidth;
  8382. return this;
  8383. },
  8384. /** @expose */
  8385. borderColor : function(borderColor) {
  8386. this._borderColor = borderColor;
  8387. return this;
  8388. },
  8389. /**
  8390. * @param (String) className - the class name for labelslayer. If not set, the default is ".element-label-group" return this
  8391. */
  8392. /** @expose */
  8393. labelLayerClassName : function(className) {
  8394. this._labelLayerClass = className;
  8395. return this;
  8396. },
  8397. /**
  8398. * @param (String) className - the class name for elementslayer. If not set, the default is ".element-group" return this
  8399. */
  8400. /** @expose */
  8401. elementLayerClassName : function(className) {
  8402. this._elementLayerClass = className;
  8403. return this;
  8404. },
  8405. /**
  8406. * @param (boolean) labelContrast {boolean} whether to contrast the label color with background/background element color.
  8407. * @return (com.ibm.rave.bundles.components.PointComponentImpl) this
  8408. */
  8409. /** @expose */
  8410. labelContrast : function(labelContrast) {
  8411. this._labelContrast = labelContrast;
  8412. return this;
  8413. },
  8414. /**
  8415. * @param (boolean) labelShadow {boolean} whether to show a label shadow with a contrast label color.
  8416. * @return (com.ibm.rave.bundles.components.PointComponentImpl) this
  8417. */
  8418. /** @expose */
  8419. labelShadow : function(labelShadow) {
  8420. this._labelShadow = labelShadow;
  8421. return this;
  8422. }
  8423. });
  8424. /** @expose */
  8425. com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT = "element-shape-secondary";
  8426. /** @expose */
  8427. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_TOP = 0;
  8428. /** @expose */
  8429. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_CENTER = 1;
  8430. /** @expose */
  8431. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_BOTTOM = 2;
  8432. /** @expose */
  8433. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_LEFT = 3;
  8434. /** @expose */
  8435. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_RIGHT = 4;
  8436. /** @expose */
  8437. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_TOP_RIGHT = 5;
  8438. // $source: com/ibm/rave/bundles/components/FilterComponentImpl
  8439. /************************************************************************
  8440. ** IBM Confidential
  8441. **
  8442. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  8443. **
  8444. ** (C) Copyright IBM Corp. 2017
  8445. **
  8446. ** The source code for this program is not published or otherwise divested of its trade secrets,
  8447. ** irrespective of what has been deposited with the U.S. Copyright Office.
  8448. ************************************************************************/
  8449. // GENERATED
  8450. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  8451. var com_ibm_rave_bundles_components_FilterComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  8452. //_id : null,
  8453. //color : null,
  8454. offset_x : 0,
  8455. offset_y : 0,
  8456. blur_radius : 0,
  8457. /** @expose */
  8458. constructor : function(id) {
  8459. this._id = id;
  8460. },
  8461. /** @expose */
  8462. setDropshadow : function(offset_x, offset_y, radius, rgb) {
  8463. this.offset_x = this.getValue(offset_x);
  8464. this.offset_y = this.getValue(offset_y);
  8465. this.blur_radius = this.getValue(radius);
  8466. this.color = rgb;
  8467. },
  8468. getValue : function(s) {
  8469. if (s == null) {
  8470. return 0;
  8471. }
  8472. return + (s.substring(0, s.length - 2));
  8473. },
  8474. /** @expose */
  8475. execute : function(g) {
  8476. var s = g.selectAll("#" + this._id).data([0]);
  8477. var filter = s.enter().append("filter").attr("id", this._id).attr("height", "500%").attr("width", "500%");
  8478. filter.append("feGaussianBlur").attr("in", "SourceAlpha");
  8479. filter.append("feOffset").attr("result", "offsetBlur");
  8480. filter.append("feFlood");
  8481. filter.append("feComposite").attr("in2", "offsetBlur").attr("operator", "in");
  8482. var merge = filter.append("feMerge");
  8483. merge.append("feMergeNode");
  8484. merge.append("feMergeNode").attr("in", "SourceGraphic");
  8485. s.select("feGaussianBlur").attr("stdDeviation", this.blur_radius);
  8486. s.select("feOffset").attr("dx", this.offset_x).attr("dy", this.offset_y);
  8487. s.select("feFlood").attr("flood-color", !this.color ? "black" : this.color);
  8488. },
  8489. /** @expose */
  8490. type : function() {
  8491. return "FilterComponent";
  8492. },
  8493. /** @expose */
  8494. getId : function() {
  8495. return this._id;
  8496. }
  8497. });
  8498. // $source: com/ibm/rave/bundles/components/PackedBubbleComponentImpl
  8499. /************************************************************************
  8500. ** IBM Confidential
  8501. **
  8502. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  8503. **
  8504. ** (C) Copyright IBM Corp. 2017
  8505. **
  8506. ** The source code for this program is not published or otherwise divested of its trade secrets,
  8507. ** irrespective of what has been deposited with the U.S. Copyright Office.
  8508. ************************************************************************/
  8509. // GENERATED
  8510. //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
  8511. //@import com/ibm/rave/bundles/component/PackedBubbleComponent (runtime) // PackedBubbleComponent
  8512. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  8513. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  8514. //@import com/ibm/rave/bundles/utilities/LabelStyleUtil (runtime) // new
  8515. var com_ibm_rave_bundles_components_PackedBubbleComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
  8516. //_data : null,
  8517. //_colorPalette : null,
  8518. //_bounds : null,
  8519. //_labelAccessor : null,
  8520. //_labelFormatter : null,
  8521. //_packNodeAccessor : null,
  8522. /**
  8523. * Accessor for original size of input data
  8524. */
  8525. //_sizeAccessor : null,
  8526. //_view : null,
  8527. //_g : null,
  8528. //_shapeTypeFn : null,
  8529. //_borderWidth : null,
  8530. //_borderColor : null,
  8531. //_labelFontStyle : null,
  8532. //_labelStyleUtil : null,
  8533. //_labelInfos : null,
  8534. _dur : 0,
  8535. _itemLabel : false,
  8536. _clipItemLabel : false,
  8537. _hideRoot : false,
  8538. _labelLayerClass : ".element-label-group",
  8539. _elementLayerClass : ".element-group",
  8540. _labelContrast : false,
  8541. _labelShadow : false,
  8542. constructor : function() {
  8543. this._packNodeAccessor = com_ibm_rave_bundles_components_PackedBubbleComponentImpl.DEFAULT_PACKNODE_ACCESSOR;
  8544. this._labelFontStyle = {};
  8545. this._labelInfos = [];
  8546. {
  8547. this._data = null;
  8548. this._colorPalette = null;
  8549. this._dur = 1000;
  8550. this._itemLabel = true;
  8551. this._clipItemLabel = false;
  8552. this._labelAccessor = null;
  8553. this._g = null;
  8554. this._sizeAccessor = null;
  8555. this._shapeTypeFn = new com_ibm_rave_bundles_components_PackedBubbleComponentImpl.ShapeTypeValueFunction(null);
  8556. this._borderWidth = null;
  8557. this._borderColor = null;
  8558. this._labelStyleUtil = new com_ibm_rave_bundles_utilities_LabelStyleUtil();
  8559. }
  8560. },
  8561. /**
  8562. * @param (rave['internal']['SingleValueFunction']) sizeAccessor The new sizeAccessor
  8563. */
  8564. /** @expose */
  8565. sizeAccessor : function(sizeAccessor) {
  8566. this._sizeAccessor = sizeAccessor;
  8567. return this;
  8568. },
  8569. /** @expose */
  8570. type : function() {
  8571. return com_ibm_rave_bundles_component_PackedBubbleComponent.COMPONENT_TYPE;
  8572. },
  8573. /** @expose */
  8574. labelFont : function(labelFont) {
  8575. this._labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(labelFont);
  8576. return this;
  8577. },
  8578. /** @expose */
  8579. execute : function(g) {
  8580. this.preExecute();
  8581. this._g = g;
  8582. var elementGroupSelector = g.selectAll(this._elementLayerClass);
  8583. var labelGroupSelector = g.selectAll(this._labelLayerClass);
  8584. if (this._data.length == 0) {
  8585. elementGroupSelector.selectAll("*").remove();
  8586. labelGroupSelector.selectAll("*").remove();
  8587. return;
  8588. }
  8589. this._labelInfos.length = 0;
  8590. var node0 = this._packNodeAccessor(this._data[0]);
  8591. this._view = [node0["x"], node0["y"], node0["r"] * 2];
  8592. var elements = elementGroupSelector.selectAll("g.element").data(this._data, this.getKey());
  8593. var self = this;
  8594. var oldShapeTypeFn = this._shapeTypeFn;
  8595. this._shapeTypeFn = new com_ibm_rave_bundles_components_PackedBubbleComponentImpl.ShapeTypeValueFunction(this._sizeAccessor);
  8596. this.switchShapes(elements);
  8597. var elementEnter = elements.enter().append("g").attr("class", "element").attr("transform", "translate (" + (this._bounds.x + this._bounds.width / 2) + "," + (this._bounds.y + this._bounds.height / 2) + ")");
  8598. elementEnter.append("path").attr("class", this.bubbleClass()).classed("element-shape", true).attr("d", rave.svg.symbol().type(this._shapeTypeFn).size(0)).style("fill-opacity", this.bubbleOpacity()).style("stroke-opacity", this.bubbleStrokeOpacity());
  8599. var labels = labelGroupSelector.selectAll(".packed-element-label").data(this._data, this.getKey());
  8600. labels.enter().append("text").attr("dy", ".3em").attr("class", "packed-element-label").style("text-anchor", "middle").style("fill-opacity", 1e-6).attr("transform", "translate (" + (this._bounds.x + this._bounds.width / 2) + "," + (this._bounds.y + this._bounds.height / 2) + ")");
  8601. var rest = !self._clipItemLabel ? null : labels.text(this.labelText()).filter(function(data, index, groupIndex) {
  8602. if (groupIndex >= self._labelInfos.length) {
  8603. self._labelInfos[groupIndex] = [];
  8604. }
  8605. var d = self._packNodeAccessor(data);
  8606. if (d["data"] == null || d["children"]) {
  8607. return false;
  8608. }
  8609. var bbox = this.getBBox();
  8610. var maxWidth = Math.max(d["r"] * 2 - bbox.height, 0);
  8611. var text = this.rave_getText();
  8612. var textLen = text.length;
  8613. var len = textLen == 0 ? 0 : Math.floor(textLen * (maxWidth / bbox.width));
  8614. var textFits = (len >= textLen) ? true : false;
  8615. if (!textFits) {
  8616. len--;
  8617. }
  8618. self._labelInfos[groupIndex][index] = new com_ibm_rave_bundles_components_PackedBubbleComponentImpl.LabelInfo(text, len, maxWidth, textFits);
  8619. return !textFits;
  8620. });
  8621. var localOptimizer = function(data, index, groupIndex) {
  8622. var info = self._labelInfos[groupIndex][index];
  8623. if (!info || info.done) {
  8624. return false;
  8625. }
  8626. var maxWidth = info.maxWidth;
  8627. var width = this.getBBox().width;
  8628. if ((maxWidth == 0) || (width == maxWidth)) {
  8629. info.done = true;
  8630. return false;
  8631. }
  8632. switch (info.delta) {
  8633. case 0:
  8634. info.delta = width < maxWidth ? 1 : -1;
  8635. break;
  8636. case 1:
  8637. if (width > maxWidth) {
  8638. info.len--;
  8639. info.done = true;
  8640. return false;
  8641. }
  8642. break;
  8643. case -1:
  8644. if (width < maxWidth) {
  8645. info.done = true;
  8646. return false;
  8647. }
  8648. break;
  8649. }
  8650. if ((info.len <= 0) && (info.delta == -1)) {
  8651. info.done = true;
  8652. return false;
  8653. }
  8654. info.len += info.delta;
  8655. return true;
  8656. };
  8657. while ((rest) && !(rest.empty())) {
  8658. rest = labels.text(this.truncateLabelText(1)).filter(localOptimizer);
  8659. }
  8660. var fontChecker = rave.capabilities.extension("fontchecker");
  8661. if (fontChecker) {
  8662. labels.call(fontChecker);
  8663. }
  8664. labels.text(this.truncateLabelText(1));
  8665. rave.transition(elements).attr("transform", this.getTransform());
  8666. rave.transition(labels).style("fill-opacity", this._itemLabel ? 1 : 1e-6).attr("transform", this.getTransform());
  8667. var s = rave.transition(elements.select("path"));
  8668. s.attr("d", this.sizeShapes(1)).style("fill", this._colorPalette);
  8669. this.updateBorder(s, this._borderWidth, this._borderColor);
  8670. rave.transition(elements.exit().select("path")).style("fill-opacity", 1e-6).attr("d", rave.svg.symbol().type(oldShapeTypeFn).size(0));
  8671. rave.transition(labels.exit().select("text")).style("fill-opacity", 1e-6);
  8672. rave.transition(elements.exit()).remove();
  8673. rave.transition(labels.exit()).remove();
  8674. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  8675. this._labelStyleUtil.labelFont(this._labelFontStyle).labelFillColor(this._labelContrast ? this.getLabelFill() : function(data, index, groupIndex) {
  8676. return labelColor;
  8677. }).labelShadow(this._labelShadow);
  8678. labels.call(this._labelStyleUtil);
  8679. if (fontChecker) {
  8680. labels.call(fontChecker);
  8681. }
  8682. },
  8683. switchShapes : function(elements) {
  8684. var self = this;
  8685. var paths = elements.select("path");
  8686. var sizes = [];
  8687. paths.each(function(data, index, groupIndex) {
  8688. var bBox = this.getBBox();
  8689. sizes.push(Math.pow(Math.min(bBox.width, bBox.height) / 2, 2) * Math.PI);
  8690. }).each(function(data, index, groupIndex) {
  8691. var node = rave.select(this);
  8692. node.attr("d", rave.svg.symbol().type(self._shapeTypeFn).size(sizes.shift()));
  8693. });
  8694. },
  8695. bubbleClass : function() {
  8696. var self = this;
  8697. return function(data, index, groupIndex) {
  8698. var node = self._packNodeAccessor(data);
  8699. return !node["children"] ? "packed-bubble-child" : "packed-bubble-parent";
  8700. };
  8701. },
  8702. bubbleOpacity : function() {
  8703. var self = this;
  8704. if (this._hideRoot) {
  8705. return function(data, index, groupIndex) {
  8706. return index == 0 ? 0.0 : !self._packNodeAccessor(data)["children"] ? 1 : 0.25;
  8707. };
  8708. }
  8709. return function(data, index, groupIndex) {
  8710. return !self._packNodeAccessor(data)["children"] ? 1 : 0.25;
  8711. };
  8712. },
  8713. bubbleStrokeOpacity : function() {
  8714. if (this._hideRoot) {
  8715. return function(data, index, groupIndex) {
  8716. return index == 0 ? 0.0 : 1.0;
  8717. };
  8718. }
  8719. return function(data, index, groupIndex) {
  8720. return 1.0;
  8721. };
  8722. },
  8723. getTransform : function() {
  8724. var self = this;
  8725. return function(data, index, groupIndex) {
  8726. var node = self._packNodeAccessor(data);
  8727. return "translate (" + (self._bounds.x + node["x"]) + "," + (self._bounds.y + node["y"]) + ")";
  8728. };
  8729. },
  8730. labelText : function() {
  8731. var self = this;
  8732. return (!this._itemLabel || !this._labelAccessor) ? null : !this._labelFormatter ? this._labelAccessor : function(data, index, groupIndex) {
  8733. var v = self._labelAccessor.call(this, data, index, groupIndex);
  8734. return v == null ? null : self._labelFormatter.call(this, v, index, groupIndex);
  8735. };
  8736. },
  8737. truncateLabelText : function(zoomFactor) {
  8738. var self = this;
  8739. return !self._clipItemLabel ? this.labelText() : function(data, index, groupIndex) {
  8740. var info = self._labelInfos[groupIndex][index];
  8741. if (!info || info.len <= 0) {
  8742. return "";
  8743. }
  8744. if (info.text.length <= info.len * zoomFactor) {
  8745. return info.text;
  8746. }
  8747. return info.text.substring(0, Math.round(info.len * zoomFactor)) + "...";
  8748. };
  8749. },
  8750. getLabelFill : function() {
  8751. var self = this;
  8752. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  8753. return function(data, index, groupIndex) {
  8754. if (!self._colorPalette) {
  8755. return labelColor;
  8756. }
  8757. var elementColor = self._colorPalette.call(this, data, index, groupIndex);
  8758. if (elementColor != null) {
  8759. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(elementColor, labelColor).toString();
  8760. }
  8761. return labelColor;
  8762. };
  8763. },
  8764. sizeShapes : function(k) {
  8765. var self = this;
  8766. return rave.svg.symbol().type(this._shapeTypeFn).size(function(data, index, groupIndex) {
  8767. return Math.pow(+ (self._packNodeAccessor(data)["r"] * k), 2) * Math.PI;
  8768. });
  8769. },
  8770. /** @expose */
  8771. data : function(data) {
  8772. this._data = data;
  8773. return this;
  8774. },
  8775. /** @expose */
  8776. colorPalette : function(colorPalette) {
  8777. this._colorPalette = colorPalette;
  8778. return this;
  8779. },
  8780. /** @expose */
  8781. duration : function(_dur) {
  8782. this._dur = _dur;
  8783. return this;
  8784. },
  8785. /** @expose */
  8786. itemLabel : function(itemLabel) {
  8787. this._itemLabel = itemLabel;
  8788. return this;
  8789. },
  8790. /** @expose */
  8791. clipItemLabels : function(_clip) {
  8792. this._clipItemLabel = _clip;
  8793. return this;
  8794. },
  8795. /** @expose */
  8796. hideRoot : function(hideRoot) {
  8797. this._hideRoot = hideRoot;
  8798. return this;
  8799. },
  8800. /** @expose */
  8801. bounds : function(bounds) {
  8802. this._bounds = bounds;
  8803. return this;
  8804. },
  8805. /** @expose */
  8806. labelAccessor : function(_labelAccessor) {
  8807. this._labelAccessor = _labelAccessor;
  8808. return this;
  8809. },
  8810. /** @expose */
  8811. labelFormatter : function(labelFormatter) {
  8812. this._labelFormatter = labelFormatter;
  8813. return this;
  8814. },
  8815. /**
  8816. * @param (boolean) labelContrast {boolean} whether to contrast the label color with background/background element color.
  8817. * @return (com.ibm.rave.bundles.components.PackedBubbleComponentImpl) this
  8818. */
  8819. /** @expose */
  8820. labelContrast : function(labelContrast) {
  8821. this._labelContrast = labelContrast;
  8822. return this;
  8823. },
  8824. /**
  8825. * @param (boolean) labelShadow {boolean} whether to show a label shadow with a contrast label color.
  8826. * @return (com.ibm.rave.bundles.components.PackedBubbleComponentImpl) this
  8827. */
  8828. /** @expose */
  8829. labelShadow : function(labelShadow) {
  8830. this._labelShadow = labelShadow;
  8831. return this;
  8832. },
  8833. /** @expose */
  8834. packNodeAccessor : function(accessor) {
  8835. this._packNodeAccessor = accessor;
  8836. return this;
  8837. },
  8838. /** @expose */
  8839. clickAction : function(data) {
  8840. rave.transition().duration(this._dur).tween("zoom", this.getZoomTween(data));
  8841. },
  8842. getZoomTween : function(data) {
  8843. var self = this;
  8844. var node = this._packNodeAccessor(data);
  8845. return function(data, index, groupIndex) {
  8846. var i = rave.interpolateZoom(self._view, [node["x"], node["y"], node["r"] * 2]);
  8847. return function(t) {
  8848. var v = i(t);
  8849. var k = Math.min(self._bounds.width, self._bounds.height) / v[2];
  8850. self._view = v;
  8851. var node = self._g.selectAll(".element").attr("transform", self.getZoomTransform(k, v));
  8852. self._g.selectAll(".packed-element-label").attr("transform", self.getZoomTransform(k, v));
  8853. self._g.selectAll(".packed-element-label").text(self.truncateLabelText(k));
  8854. node.select("path").attr("d", self.sizeShapes(k));
  8855. };
  8856. };
  8857. },
  8858. /**
  8859. * Interpolation that returns the "translate" transform for a node, when transitioning to a view v.
  8860. * @param (double) k Scaling factor, found from the final (zoomed) width and the actual geometry of the bounds
  8861. * @param (Array) v View as retured by a ZoomInterpolator
  8862. * @return (rave['internal']['ValueFunction']) "translate(x,y)" string
  8863. */
  8864. getZoomTransform : function(k, v) {
  8865. var self = this;
  8866. return function(data, index, groupIndex) {
  8867. var node = self._packNodeAccessor(data);
  8868. var x = (self._bounds.x + self._bounds.width / 2 - (v[0] - node["x"]) * k);
  8869. var y = (self._bounds.y + self._bounds.height / 2 - (v[1] - node["y"]) * k);
  8870. return "translate(" + x + "," + y + ")";
  8871. };
  8872. },
  8873. /** @expose */
  8874. borderWidth : function(borderWidth) {
  8875. this._borderWidth = borderWidth;
  8876. return this;
  8877. },
  8878. /** @expose */
  8879. borderColor : function(borderColor) {
  8880. this._borderColor = borderColor;
  8881. return this;
  8882. },
  8883. /**
  8884. * @param (String) className - the class name for labelslayer. If not set, the default is ".element-label-group" return this
  8885. */
  8886. /** @expose */
  8887. labelLayerClassName : function(className) {
  8888. this._labelLayerClass = className;
  8889. return this;
  8890. },
  8891. /**
  8892. * @param (String) className - the class name for elementslayer. If not set, the default is ".element-group" return this
  8893. */
  8894. /** @expose */
  8895. elementLayerClassName : function(className) {
  8896. this._elementLayerClass = className;
  8897. return this;
  8898. }
  8899. });
  8900. /**
  8901. * A value function class that is passed to Symbol to use different shape for bubbles based on their value
  8902. */
  8903. com_ibm_rave_bundles_components_PackedBubbleComponentImpl.ShapeTypeValueFunction = rave['internal']['Declare']({
  8904. //_sizeAccessor : null,
  8905. _$functionClassMethod : function() {
  8906. var _$self = function(data, index, groupIndex) {
  8907. if (!_$self._sizeAccessor) {
  8908. return "circle";
  8909. }
  8910. var size = (_$self._sizeAccessor(data));
  8911. if (size == null) {
  8912. return "circle";
  8913. }
  8914. var val = size;
  8915. if (val > 0) {
  8916. return "circle";
  8917. } else if (val == 0) {
  8918. return "donutPlus";
  8919. } else {
  8920. return "donut-thin";
  8921. }
  8922. };
  8923. return _$self;
  8924. },
  8925. constructor : function(sizeAccessor) {
  8926. this._sizeAccessor = sizeAccessor;
  8927. }
  8928. });
  8929. com_ibm_rave_bundles_components_PackedBubbleComponentImpl.LabelInfo = rave['internal']['Declare']({
  8930. /** @expose */
  8931. text : null,
  8932. /** @expose */
  8933. maxWidth : 0,
  8934. /** @expose */
  8935. len : 0,
  8936. /** @expose */
  8937. delta : 0,
  8938. /** @expose */
  8939. done : false,
  8940. /** @expose */
  8941. constructor : function(_text, _len, _maxWidth, _done) {
  8942. this.text = _text;
  8943. this.len = _len;
  8944. this.maxWidth = _maxWidth;
  8945. this.done = _done;
  8946. this.delta = 0;
  8947. }
  8948. });
  8949. com_ibm_rave_bundles_components_PackedBubbleComponentImpl.DEFAULT_PACKNODE_ACCESSOR = function(data) {
  8950. return data;
  8951. };
  8952. })();
  8953. },{"./configuration/configuration.json":1,"./i18n/messages_en.json":2,"./vizlibrary-bubble.css":4,"./vizlibrary.css":5}],4:[function(require,module,exports){
  8954. var css = ".vizlibrary-bubble .bundle-shape {\n fill: #ccc;\n fill-opacity: 0.85;\n}\n.vizlibrary-bubble .element-label {\n pointer-events: none;\n}\n.vizlibrary-bubble .element-shape-secondary {\n pointer-events: none;\n}\n.vizlibrary-bubble .packed-bubble-parent {\n stroke: #ccc;\n fill: #ccc;\n stroke-width: 1px;\n}\n.vizlibrary-bubble .packed-element-label {\n pointer-events: none;\n font-size: 14px;\n font-weight: 300;\n color: #3c4646;\n line-height: 28px;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-bubble/node/rave-library-bubble/vizlibrary-bubble.css"})); module.exports = css;
  8955. },{"browserify-css":6}],5:[function(require,module,exports){
  8956. 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-bubble/node/rave-library-bubble/vizlibrary.css"})); module.exports = css;
  8957. },{"browserify-css":6}],6:[function(require,module,exports){
  8958. 'use strict';
  8959. // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
  8960. module.exports = {
  8961. // Create a <link> tag with optional data attributes
  8962. createLink: function(href, attributes) {
  8963. var head = document.head || document.getElementsByTagName('head')[0];
  8964. var link = document.createElement('link');
  8965. link.href = href;
  8966. link.rel = 'stylesheet';
  8967. for (var key in attributes) {
  8968. if ( ! attributes.hasOwnProperty(key)) {
  8969. continue;
  8970. }
  8971. var value = attributes[key];
  8972. link.setAttribute('data-' + key, value);
  8973. }
  8974. head.appendChild(link);
  8975. },
  8976. // Create a <style> tag with optional data attributes
  8977. createStyle: function(cssText, attributes) {
  8978. var head = document.head || document.getElementsByTagName('head')[0],
  8979. style = document.createElement('style');
  8980. style.type = 'text/css';
  8981. for (var key in attributes) {
  8982. if ( ! attributes.hasOwnProperty(key)) {
  8983. continue;
  8984. }
  8985. var value = attributes[key];
  8986. style.setAttribute('data-' + key, value);
  8987. }
  8988. if (style.sheet) { // for jsdom and IE9+
  8989. style.innerHTML = cssText;
  8990. style.sheet.cssText = cssText;
  8991. head.appendChild(style);
  8992. } else if (style.styleSheet) { // for IE8 and below
  8993. head.appendChild(style);
  8994. style.styleSheet.cssText = cssText;
  8995. } else { // for Chrome, Firefox, and Safari
  8996. style.appendChild(document.createTextNode(cssText));
  8997. head.appendChild(style);
  8998. }
  8999. }
  9000. };
  9001. },{}]},{},[3]);
  9002. return rave.library.bundle.extension('bubbleBundle');
  9003. }));