rave-library-column.js 390 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098
  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.raveLibraryColumn = 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=[{"defaultModel":"tabular","datamodels":[{"description":"datamodel.tabular.column.description","id":"tabular","label":"datamodel.tabular.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/x_axis_32.png","svg":"..\/rave-library\/resources\/x_axis_column_32.svg"},"description":"dataslot.x.column.description","id":"x","label":"dataslot.x.label","cardinality":"1","datatypes":["numeric","string","date"],"tags":["ca.dashboard.defaultSort=ascending"]},{"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":["string","numeric"],"tags":["ca.dashboard.defaultSort=ascending","ca.dashboard.repeatHere=true"]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.y.column.description","id":"y","label":"dataslot.value.label","cardinality":"1","datatypes":["numeric","date"],"tags":["ca.dashboard.multiple=true"]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.yStart.column.description","id":"yStart","label":"dataslot.yStart.column.label","cardinality":"0..1","datatypes":["numeric","date"],"tags":[]},{"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.tabular.description","id":"data","label":"dataset.tabular.label","type":"tabular","cardinality":"1"}],"tags":["column","simple","basic"]}]},{"properties":{"label.shadow":{"default":false,"resetView":"layout","name":"label.shadow.name","description":"label.shadow.description","type":"boolean"},"data":{"type":"object","properties":{"handling":{"default":"None","resetView":"data","name":"data.handling.name","options":[{"id":"data.handling.options.None","value":"None"},{"id":"data.handling.options.Clustered","value":"Clustered"},{"id":"data.handling.options.Stacked","value":"Stacked"},{"id":"data.handling.options.Stacked100","value":"Stacked100"}],"description":"data.handling.description","type":"string"}}},"color":{"type":"object","properties":{"null":{"default":"silver","name":"color.null.name","description":"color.null.description","type":"color"},"palette":{"resetView":"layout","name":"color.palette.name","options":["categorical","continuous"],"description":"color.palette.description","type":"palette"}}},"labelstyle":{"type":"object","properties":{"font":{"default":null,"name":"labelstyle.font.name","description":"labelstyle.font.description","type":"string"}}},"effect":{"type":"object","properties":{"duration":{"default":1000,"min":0,"name":"effect.duration.name","description":"effect.duration.description","type":"numeric"},"delay":{"trueLabel":"column.trueLabel.stagger","default":true,"falseLabel":"column.falseLabel.stagger","name":"effect.delay.name","description":"effect.delay.description","type":"boolean"},"name":{"default":"transition","name":"effect.name.name","options":[{"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"}}}}},"column":{"type":"object","properties":{"borderColor":{"default":"black","name":"column.borderColor.name","description":"column.borderColor.description","type":"color"},"size":{"default":"10px","resetView":"layout","name":"column.size.name","description":"column.size.description","type":"length"},"borderWidth":{"default":"0px","name":"column.borderWidth.name","description":"column.borderWidth.description","type":"length"},"applysize":{"default":false,"resetView":"layout","name":"column.applysize.name","description":"column.applysize.description","type":"boolean"}}},"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"}}},{"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":{"data":{"type":"object","properties":{"label":{"type":"object","properties":{"display":{"default":false,"resetView":"layout","name":"data.label.display.name","description":"data.label.display.description","type":"boolean"},"type":{"default":"Value","resetView":"layout","name":"data.label.type.name","options":[{"id":"data.label.type.options.value","value":"Value"},{"id":"data.label.type.options.percentByCategory","value":"PercentOfCategory"},{"id":"data.label.type.options.percentByColor","value":"PercentOfColor"}],"description":"data.label.type.description","type":"string"}}}}}}},{"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":{"labels":{"type":"object","properties":{"truncationText":{"default":"...","name":"axis.labels.truncationText.name","description":"axis.labels.truncationText.description","type":"string"}}}}}}},{"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"}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.y.scale.includeZero.trueLabel","default":true,"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":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_column_small.png","tags":["small","notext"]}],"svg":[{"file":"resources\/preview_column_small.svg","tags":["small","notext"]}]},"genericMeta":{"copyright":"IBM 2015, 2016","author":"IBM","description":"column.description","id":"rave-library-column","label":"column.label","version":"1.0.0","tags":["column"]}},{"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":[]}]},{"propertyPresentations":[{"presentationItems":[{"propertyID":"color.palette"},{"propertyID":"axis.x.title.display"},{"propertyID":"axis.y.title.display"},{"propertyID":"legend.display"},{"propertyID":"legend.position"}],"icon":"","description":"propertyPresentation.simple.description","id":"simple","label":"propertyPresentation.simple.label","tags":["Column","Column Properties Presentation","Simple","ca.dashboard"]},{"presentationItems":[{"propertyGroup":{"presentationItems":[{"propertyID":"background.chart.color"},{"propertyID":"background.elements.color"},{"propertyID":"color.palette"},{"propertyID":"color.null"},{"propertyID":"layout.padding"}],"icon":"","description":"propertyPresentation.advanced.commonProperties.description","id":"commonProperties","label":"propertyPresentation.advanced.commonProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"column.borderColor"},{"propertyID":"column.borderWidth"},{"propertyID":"transpose"},{"propertyID":"data.handling"}],"icon":"","description":"column.propertyPresentation.advanced.columnSpecificProperties.description","id":"columnSpecificProperties","label":"column.propertyPresentation.advanced.columnSpecificProperties.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"}],"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":["Column","Column Properties Presentation","advanced","ca.reporting"]}]},{"configurations":[{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"yStart"},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/stacked_column_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/stacked_column_preview_320.png","tags":["medium","color"]},{"file":"resources\/stacked_column_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/stacked_column_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/stacked_column_preview_320.svg","tags":["medium","color"]},{"file":"resources\/stacked_column_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"column.config.stackedcolumn.description","id":"stackedcolumn","label":"column.config.stackedcolumn.label","tags":["ca.dashboard","ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"hidden":true,"id":"data.handling","value":"Stacked"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"30%"},{"id":"layout.axissize.left.max","value":"200"}]},{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"yStart"},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/stacked_bar_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/stacked_bar_preview_320.png","tags":["medium","color"]},{"file":"resources\/stacked_bar_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/stacked_bar_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/stacked_bar_preview_320.svg","tags":["medium","color"]},{"file":"resources\/stacked_bar_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"column.config.stackedbar.description","id":"stackedbar","label":"column.config.stackedbar.label","tags":["ca.dashboard","ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"hidden":true,"id":"data.handling","value":"Stacked"},{"id":"transpose","value":true},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"30%"},{"id":"layout.axissize.left.max","value":"200"}]},{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y","tags":["ca.chart.definition.supportsRange=true"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"yStart"},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/column_cluster_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/column_cluster_preview_320.png","tags":["medium","color"]},{"file":"resources\/column_cluster_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/column_cluster_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/column_cluster_preview_320.svg","tags":["medium","color"]},{"file":"resources\/column_cluster_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"column.config.clusteredcolumn.description","id":"clusteredcolumn","label":"column.config.clusteredcolumn.label","tags":["ca.dashboard","ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"hidden":true,"id":"data.handling","value":"Clustered"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"30%"},{"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"color.null"}]},{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y","tags":["ca.chart.definition.supportsRange=true"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"yStart"},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","svgIcon":"..\/rave-library\/resources\/y_axis_bar_32.svg","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/bar_cluster_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/bar_cluster_preview_320.png","tags":["medium","color"]},{"file":"resources\/bar_cluster_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/bar_cluster_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/bar_cluster_preview_320.svg","tags":["medium","color"]},{"file":"resources\/bar_cluster_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"column.config.clusteredbar.description","id":"clusteredbar","label":"column.config.clusteredbar.label","tags":["ca.dashboard","ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"hidden":true,"id":"data.handling","value":"Clustered"},{"id":"transpose","value":true},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"30%"},{"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"color.null"}]},{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"yStart"},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"color"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/column_floating_vertical_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/column_floating_vertical_preview_320.png","tags":["medium","color"]},{"file":"resources\/column_floating_vertical_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/column_floating_vertical_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/column_floating_vertical_preview_320.svg","tags":["medium","color"]},{"file":"resources\/column_floating_vertical_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"column.config.floatingBar.description","id":"floatingBar","label":"column.config.floatingBar.label","tags":["ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"hidden":true,"id":"data.handling"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"30%"},{"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"color.null"}]},{"dataSlots":[{"dataTypes":["date"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataTypes":["date"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"yStart"},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/gantt_chart_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/gantt_chart_preview_320.png","tags":["medium","color"]},{"file":"resources\/gantt_chart_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/gantt_chart_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/gantt_chart_preview_320.svg","tags":["medium","color"]},{"file":"resources\/gantt_chart_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"column.config.gantt.description","id":"gantt","label":"column.config.gantt.label","tags":[]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"hidden":true,"id":"data.handling"},{"id":"transpose","value":true},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"30%"},{"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"color.null"}]},{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"yStart"},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"color"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"label"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/column_floating_horizontal_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/column_floating_horizontal_preview_320.png","tags":["medium","color"]},{"file":"resources\/column_floating_horizontal_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/column_floating_horizontal_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/column_floating_horizontal_preview_320.svg","tags":["medium","color"]},{"file":"resources\/column_floating_horizontal_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"column.config.floatingBarRotated.description","id":"floatingBarRotated","label":"column.config.floatingBarRotated.label","tags":["ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"hidden":true,"id":"data.handling"},{"id":"transpose","value":true},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"30%"},{"id":"layout.axissize.left.max","value":"200"},{"hidden":true,"id":"color.null"}]}]},{"build":"development","name":"rave-library-column","description":"This is the IBM Rave column 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.dependent.nice.description": "Shows or hides nice scale values on the dependent axis.",
  63. "axis.dependent.nice.name": "Show dependent axis nice values",
  64. "axis.dependent.title.description": "The title of the dependent axis.",
  65. "axis.dependent.title.display.description": "Shows or hides the dependent axis title.",
  66. "axis.dependent.title.display.name": "Show dependent axis title",
  67. "axis.dependent.title.name": "Dependent axis title",
  68. "axis.dependent.visible.line.description": "Shows or hides the dependent axis line.",
  69. "axis.dependent.visible.line.name": "Show dependent axis line",
  70. "axis.dependent.visible.tickLabels.description": "Shows or hides the dependent axis tick labels.",
  71. "axis.dependent.visible.tickLabels.name": "Show dependent axis tick labels",
  72. "axis.dependent.visible.ticks.description": "Shows or hides the dependent axis ticks.",
  73. "axis.dependent.visible.ticks.name": "Show dependent axis ticks",
  74. "axis.independent.nice.description": "Shows or hides nice scale values on the independent axis.",
  75. "axis.independent.nice.name": "Show independent axis nice values",
  76. "axis.independent.title.description": "The title of the independent axis.",
  77. "axis.independent.title.display.description": "Shows or hides the independent axis title.",
  78. "axis.independent.title.display.name": "Show independent axis title",
  79. "axis.independent.title.name": "Independent axis title",
  80. "axis.independent.visible.line.description": "Shows or hides the independent axis line.",
  81. "axis.independent.visible.line.name": "Show independent axis line",
  82. "axis.independent.visible.tickLabels.description": "Shows or hides the independent axis tick labels.",
  83. "axis.independent.visible.tickLabels.name": "Show independent axis tick labels",
  84. "axis.independent.visible.tickLabelsRotation.description": "The angle of rotation, in degrees, for independent axis tick labels.",
  85. "axis.independent.visible.tickLabelsRotation.name": "Angle of rotation for independent axis tick labels",
  86. "axis.independent.visible.tickLabelsTextAnchor.description": "Positions the independent axis tick labels in the chart.",
  87. "axis.independent.visible.tickLabelsTextAnchor.name": "Text anchor for independent axis tick labels",
  88. "axis.independent.visible.tickLabelsTextAnchor.options.end": "End",
  89. "axis.independent.visible.tickLabelsTextAnchor.options.middle": "Middle",
  90. "axis.independent.visible.tickLabelsTextAnchor.options.start": "Start",
  91. "axis.independent.visible.tickLabelsWrapValignment.description": "Sets the vertical alignment for wrapped independent axis tick labels.",
  92. "axis.independent.visible.tickLabelsWrapValignment.name": "Vertical alignment for wrapped independent axis tick labels",
  93. "axis.independent.visible.tickLabelsWrapValignment.options.bottom": "Bottom",
  94. "axis.independent.visible.tickLabelsWrapValignment.options.middle": "Middle",
  95. "axis.independent.visible.tickLabelsWrapValignment.options.top": "Top",
  96. "axis.independent.visible.tickLabelsZoomingPanning.description": "Shows or hides the independent axis tick labels during zooming and panning.",
  97. "axis.independent.visible.tickLabelsZoomingPanning.name": "Show axis tick labels when zoom/pan",
  98. "axis.independent.visible.ticks.description": "Shows or hides the independent axis ticks.",
  99. "axis.independent.visible.ticks.name": "Show independent axis ticks",
  100. "axis.label.color.description": "The color that is applied to the axis labels.",
  101. "axis.label.color.name": "Axis label color",
  102. "axis.label.hide.overlap.description": "Hides axis labels when they overlap.",
  103. "axis.label.hide.overlap.name": "Hide overlapping axis labels",
  104. "axis.label.wrap.description": "Wraps axis labels when they overlap.",
  105. "axis.label.wrap.name": "Wrap axis labels",
  106. "axis.labels.truncationText.description": "The text that is placed at the end of labels to indicate truncation.",
  107. "axis.labels.truncationText.name": "Axis truncation text",
  108. "axis.line.color.description": "The color that is applied to the axis lines and ticks.",
  109. "axis.line.color.name": "Axis line color",
  110. "axis.title.color.description": "The color that is applied to the axis title.",
  111. "axis.title.color.name": "Axis title color",
  112. "axis.x.gridlines.display.description": "Shows or hides the X-axis gridlines.",
  113. "axis.x.gridlines.display.falseLabel": "Hide",
  114. "axis.x.gridlines.display.name": "Show gridlines",
  115. "axis.x.gridlines.display.trueLabel": "Show",
  116. "axis.x.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the X-axis gridlines.",
  117. "axis.x.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
  118. "axis.x.gridlines.style.stroke.description": "The color of the X-axis gridline.",
  119. "axis.x.gridlines.style.stroke.name": "Gridline color",
  120. "axis.x.labels.allowRotate45.description": "Enables or disables the rotate45 option for labels automatic layout.",
  121. "axis.x.labels.allowRotate45.falseLabel": "Disable rotate45 option",
  122. "axis.x.labels.allowRotate45.name": "Allow rotate 45",
  123. "axis.x.labels.allowRotate45.trueLabel": "Enable rotate45 option",
  124. "axis.x.labels.allowRotate90.description": "Enables or disables the rotate90 option for labels automatic layout.",
  125. "axis.x.labels.allowRotate90.falseLabel": "Disable rotate90 option",
  126. "axis.x.labels.allowRotate90.name": "Allow rotate 90",
  127. "axis.x.labels.allowRotate90.trueLabel": "Enable rotate90 option",
  128. "axis.x.labels.allowStagger.description": "Allows the stagger option for labels automatic layout.",
  129. "axis.x.labels.allowStagger.falseLabel": "X-axis do not allow stagger",
  130. "axis.x.labels.allowStagger.name": "Allow stagger",
  131. "axis.x.labels.allowStagger.trueLabel": "X-axis allow stagger",
  132. "axis.x.labels.display.description": "Shows or hides the X-axis labels.",
  133. "axis.x.labels.display.falseLabel": "Hide",
  134. "axis.x.labels.display.name": "Show labels",
  135. "axis.x.labels.display.trueLabel": "Show",
  136. "axis.x.labels.layoutMode.description": "Configure the layout mode for the X-axis labels.",
  137. "axis.x.labels.layoutMode.name": "Layout Mode",
  138. "axis.x.labels.layoutMode.options.automatic": "Automatic",
  139. "axis.x.labels.layoutMode.options.horizontal": "Horizontal",
  140. "axis.x.labels.layoutMode.options.rotate45": "Rotated 45 degrees",
  141. "axis.x.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  142. "axis.x.labels.layoutMode.options.stagger": "Stagger",
  143. "axis.x.labels.style.fill.description": "The color of X-axis labels.",
  144. "axis.x.labels.style.fill.name": "Label color",
  145. "axis.x.labels.style.font-family.description": "The font families of the X-axis labels.",
  146. "axis.x.labels.style.font-family.name": "Label font families",
  147. "axis.x.labels.style.font-size.description": "The size of X-axis labels (CSS size).",
  148. "axis.x.labels.style.font-size.name": "Label font size",
  149. "axis.x.labels.style.font.description": "The font properties of X-axis labels (CSS styles).",
  150. "axis.x.labels.style.font.name": "Label font",
  151. "axis.x.labels.zoomPan.description": "Shows or hides X-axis labels when panning and zooming.",
  152. "axis.x.labels.zoomPan.falseLabel": "Show",
  153. "axis.x.labels.zoomPan.name": "Label pan-zoom",
  154. "axis.x.labels.zoomPan.trueLabel": "Hide",
  155. "axis.x.line.display.description": "Shows or hides the X-axis line.",
  156. "axis.x.line.display.falseLabel": "Hide",
  157. "axis.x.line.display.name": "Show line",
  158. "axis.x.line.display.trueLabel": "Show",
  159. "axis.x.line.style.stroke.description": "The color of the X-axis line.",
  160. "axis.x.line.style.stroke.name": "Line color",
  161. "axis.x.scale.includeZero.description": "When set to Yes, includes 0 on the X-axis.",
  162. "axis.x.scale.includeZero.falseLabel": "Do not include",
  163. "axis.x.scale.includeZero.name": "Includes zero",
  164. "axis.x.scale.includeZero.trueLabel": "Include",
  165. "axis.x.scale.max.description": "The maximum value that appears on the X-axis.",
  166. "axis.x.scale.max.name": "Maximum value",
  167. "axis.x.scale.min.description": "The minimum value that appears on the X-axis.",
  168. "axis.x.scale.min.name": "Minimum value",
  169. "axis.x.scale.nice.description": "When set to Yes, uses nice endpoint values on the X-axis.",
  170. "axis.x.scale.nice.falseLabel": "Do not nice",
  171. "axis.x.scale.nice.name": "Nicing",
  172. "axis.x.scale.nice.trueLabel": "Apply nicing",
  173. "axis.x.ticks.display.description": "Shows or hides the X-axis tick marks.",
  174. "axis.x.ticks.display.falseLabel": "Hide",
  175. "axis.x.ticks.display.name": "Show ticks",
  176. "axis.x.ticks.display.trueLabel": "Show",
  177. "axis.x.ticks.style.stroke.description": "The color of the X-axis ticks.",
  178. "axis.x.ticks.style.stroke.name": "Tick color",
  179. "axis.x.title.display.description": "Shows or hides the X-axis title.",
  180. "axis.x.title.display.falseLabel": "Hide",
  181. "axis.x.title.display.name": "Show title",
  182. "axis.x.title.display.trueLabel": "Show",
  183. "axis.x.title.style.fill.description": "The color of the X-axis title.",
  184. "axis.x.title.style.fill.name": "Title color",
  185. "axis.x.title.style.font-family.description": "The font family names of the X-axis title.",
  186. "axis.x.title.style.font-family.name": "Title font families",
  187. "axis.x.title.style.font-size.description": "The X-axis title font size (CSS size).",
  188. "axis.x.title.style.font-size.name": "Title font size",
  189. "axis.x.title.style.font.description": "The X-axis title font properties (CSS style).",
  190. "axis.x.title.style.font.name": "Title font",
  191. "axis.x.title.text.description": "The title of the X-axis.",
  192. "axis.x.title.text.name": "Title",
  193. "axis.y.gridlines.display.description": "Shows or hides the Y-axis gridlines.",
  194. "axis.y.gridlines.display.falseLabel": "Hide",
  195. "axis.y.gridlines.display.name": "Show gridlines",
  196. "axis.y.gridlines.display.trueLabel": "Show",
  197. "axis.y.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the Y-axis gridlines.",
  198. "axis.y.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
  199. "axis.y.gridlines.style.stroke.description": "The color of the Y-axis gridline.",
  200. "axis.y.gridlines.style.stroke.name": "Gridline color",
  201. "axis.y.labels.display.description": "Shows or hides the Y-axis labels.",
  202. "axis.y.labels.display.falseLabel": "Hide",
  203. "axis.y.labels.display.name": "Show labels",
  204. "axis.y.labels.display.trueLabel": "Show",
  205. "axis.y.labels.layoutMode.description": "Configure the layout mode for the Y-axis labels.",
  206. "axis.y.labels.layoutMode.name": "Layout Mode",
  207. "axis.y.labels.layoutMode.options.horizontal": "Horizontal",
  208. "axis.y.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  209. "axis.y.labels.style.fill.description": "The color of Y-axis labels.",
  210. "axis.y.labels.style.fill.name": "Label color",
  211. "axis.y.labels.style.font-family.description": "The font families of the Y-axis labels.",
  212. "axis.y.labels.style.font-family.name": "Label font families",
  213. "axis.y.labels.style.font-size.description": "The size of Y-axis labels (CSS size).",
  214. "axis.y.labels.style.font-size.name": "Label font size",
  215. "axis.y.labels.style.font.description": "The font properties of Y-axis labels (CSS styles).",
  216. "axis.y.labels.style.font.name": "Label font",
  217. "axis.y.labels.zoomPan.description": "Shows or hides Y-axis labels when panning and zooming.",
  218. "axis.y.labels.zoomPan.falseLabel": "Show",
  219. "axis.y.labels.zoomPan.name": "Label pan-zoom",
  220. "axis.y.labels.zoomPan.trueLabel": "Hide",
  221. "axis.y.line.display.description": "Shows or hides the Y-axis line.",
  222. "axis.y.line.display.falseLabel": "Hide",
  223. "axis.y.line.display.name": "Show line",
  224. "axis.y.line.display.trueLabel": "Show",
  225. "axis.y.line.style.stroke.description": "The color of the Y-axis line.",
  226. "axis.y.line.style.stroke.name": "Line color",
  227. "axis.y.scale.includeZero.description": "When set to Yes, includes 0 on the Y-axis.",
  228. "axis.y.scale.includeZero.falseLabel": "Do not include",
  229. "axis.y.scale.includeZero.name": "Includes zero",
  230. "axis.y.scale.includeZero.trueLabel": "Include",
  231. "axis.y.scale.max.description": "The maximum value that appears on the Y-axis.",
  232. "axis.y.scale.max.name": "Maximum value",
  233. "axis.y.scale.min.description": "The minimum value tha appears on the Y-axis.",
  234. "axis.y.scale.min.name": "Minimum value",
  235. "axis.y.scale.nice.description": "When set to Yes, uses nice endpoint values on the Y-axis.",
  236. "axis.y.scale.nice.falseLabel": "Do not nice",
  237. "axis.y.scale.nice.name": "Nicing",
  238. "axis.y.scale.nice.trueLabel": "Apply nicing",
  239. "axis.y.ticks.display.description": "Shows or hides the Y-axis tick marks.",
  240. "axis.y.ticks.display.falseLabel": "Hide",
  241. "axis.y.ticks.display.name": "Show ticks",
  242. "axis.y.ticks.display.trueLabel": "Show",
  243. "axis.y.ticks.style.stroke.description": "The color of the Y-axis ticks.",
  244. "axis.y.ticks.style.stroke.name": "Tick color",
  245. "axis.y.title.display.description": "Shows or hides the Y-axis title.",
  246. "axis.y.title.display.falseLabel": "Hide",
  247. "axis.y.title.display.name": "Show title",
  248. "axis.y.title.display.trueLabel": "Show",
  249. "axis.y.title.style.fill.description": "The color of the Y-axis title.",
  250. "axis.y.title.style.fill.name": "Title color",
  251. "axis.y.title.style.font-family.description": "The font family names of the Y-axis title.",
  252. "axis.y.title.style.font-family.name": "Title font families",
  253. "axis.y.title.style.font-size.description": "The size of the Y-axis title font (CSS size).",
  254. "axis.y.title.style.font-size.name": "Title font size",
  255. "axis.y.title.style.font.description": "The Y-axis title font properties (CSS styles).",
  256. "axis.y.title.style.font.name": "Title font",
  257. "axis.y.title.text.description": "The title of the Y-axis.",
  258. "axis.y.title.text.name": "Title",
  259. "background.chart.color.description": "The background color of the chart.",
  260. "background.chart.color.name": "Background color",
  261. "background.color.description": "The background color of the chart.",
  262. "background.elements.color.description": "The background color behind the elements of the chart.",
  263. "background.elements.color.name": "Elements background color",
  264. "color.null.description": "The color that is applied to null values.",
  265. "color.null.name": "Null values color",
  266. "color.palette.description": "The color palette that controls the colors or patterns that are applied to data elements in the chart.",
  267. "color.palette.name": "Color palette",
  268. "column.applysize.description": "When set to Yes, applies the column size to ordinal scales.",
  269. "column.applysize.name": "Apply size to ordinal columns",
  270. "column.borderColor.description": "The color of the column borders.",
  271. "column.borderColor.name": "Column border color",
  272. "column.borderWidth.description": "The width of the column borders.",
  273. "column.borderWidth.name": "Column border width",
  274. "column.config.bar.description": "Configures a simple horizontal bar. Most properties and some data models are hidden.",
  275. "column.config.bar.label": "Horizontal bar",
  276. "column.config.clusteredbar.description": "Bar visualizations use horizontal data markers that are arranged in groups to compare individual values. You can use bar visualizations to compare discrete data or show trends over time. Use clustered bar visualizations to compare values across multiple categories.",
  277. "column.config.clusteredbar.label": "Clustered bar",
  278. "column.config.clusteredcolumn.description": "Column visualizations use vertical data markers that are arranged in groups to compare individual values. You can use column visualizations to compare discrete data or show trends over time. Use clustered column visualizations to compare values across multiple categories.",
  279. "column.config.clusteredcolumn.label": "Clustered column",
  280. "column.config.column.description": "Configures a simple vertical column chart. Most properties and some data models are hidden.",
  281. "column.config.column.label": "Vertical column",
  282. "column.config.floatingBar.description": "Floating column charts use vertical data markers to show running lows and highs in a data set. For example, daily low and high temperatures.",
  283. "column.config.floatingBar.label": "Floating column",
  284. "column.config.floatingBarRotated.description": "Floating bar visualizations use horizontal data markers to show running lows and highs in a data set. For example, daily low and high temperatures.",
  285. "column.config.floatingBarRotated.label": "Floating bar",
  286. "column.config.gantt.description": "Gantt visualizations are bar visualizations that illustrate a project schedule by showing activities displayed against time.",
  287. "column.config.gantt.label": "Gantt",
  288. "column.config.stackedbar.description": "Bar visualizations use vertical data markers to compare individual values. You can use bar visualizations to compare discrete data or show trends over time. Stacked visualizations are useful for comparing proportional contributions within a category. They plot the relative value that each data series contributes to the total.",
  289. "column.config.stackedbar.label": "Stacked bar",
  290. "column.config.stackedcolumn.description": "Column visualizations use vertical data markers to compare individual values. You can use column visualizations to compare discrete data or show trends over time. Stacked visualizations are useful for comparing proportional contributions within a category. They plot the relative value that each data series contributes to the total.",
  291. "column.config.stackedcolumn.label": "Stacked column",
  292. "column.description": "Column charts use vertical data markers to compare individual values. You can use column charts to compare discrete data or show trends over time. Based on the data provided, many different types of column and bar charts can be rendered, including stacked, clustered, and 100% stacked.",
  293. "column.falseLabel.itemLabel": "Hide",
  294. "column.falseLabel.stagger": "Do not stagger",
  295. "column.label": "Column",
  296. "column.propertyPresentation.advanced.columnSpecificProperties.description": "Column-specific properties",
  297. "column.propertyPresentation.advanced.columnSpecificProperties.label": "Column",
  298. "column.size.description": "The width (transposed height) of columns when continuous data is used.",
  299. "column.size.name": "Column size",
  300. "column.trueLabel.itemLabel": "Show",
  301. "column.trueLabel.stagger": "Stagger",
  302. "contrast.label.color.description": "Adjust the label color to contrast with background.",
  303. "contrast.label.color.name": "Contrast label color with background",
  304. "data.handling.description": "The configuration that is used to plot the data.",
  305. "data.handling.name": "Configuration",
  306. "data.handling.options.Clustered": "Clustered",
  307. "data.handling.options.None": "None",
  308. "data.handling.options.Stacked": "Stacked",
  309. "data.handling.options.Stacked100": "Stacked 100%",
  310. "data.label.display.description": "Shows or hides data labels.",
  311. "data.label.display.name": "Data label",
  312. "data.label.type.description": "Type of data labels to display.",
  313. "data.label.type.name": "Data label type",
  314. "data.label.type.options.percentByCategory": "Percentage of category",
  315. "data.label.type.options.percentByColor": "Percentage of color (series)",
  316. "data.label.type.options.value": "Value",
  317. "datamodel.hierarchial.label": "Hierarchical data model",
  318. "datamodel.tabular.column.description": "The data model for a simple bar chart, with each bar having x, y, color, and label.",
  319. "datamodel.tabular.label": "Tabular data model",
  320. "dataset.hierarchial.label": "Hierarchical data set",
  321. "dataset.tabular.description": "The tabular data set of rows and columns.",
  322. "dataset.tabular.label": "Tabular data set",
  323. "dataset.tabular.link.description": "Determines the links between the nodes.",
  324. "dataset.tabular.link.label": "Tabular links data set",
  325. "dataset.tabular.node.description": "The tabular data set that defines the nodes.",
  326. "dataset.tabular.node.label": "Tabular node data set",
  327. "dataslot.categories.label": "Categories",
  328. "dataslot.category.label": "Category",
  329. "dataslot.children.description": "When applied to a tree node, returns the children of that node as an array-list.",
  330. "dataslot.children.label": "Children",
  331. "dataslot.color.description": "Determines the color of the shape.",
  332. "dataslot.color.label": "Color",
  333. "dataslot.key.description": "Called for each row to match elements. Primarily used for transitions.",
  334. "dataslot.key.label": "Key",
  335. "dataslot.label.description": "Determines the label of the shape.",
  336. "dataslot.label.label": "Label",
  337. "dataslot.maximumValue.label": "Maximum value",
  338. "dataslot.source.label": "Source",
  339. "dataslot.sourceValue.label": "Source value",
  340. "dataslot.tabular.id.description": "The identifier for the nodes.",
  341. "dataslot.tabular.id.label": "Identifier",
  342. "dataslot.tabular.size.description": "Determines the size of the shape.",
  343. "dataslot.tabular.size.label": "Size",
  344. "dataslot.target.label": "Target",
  345. "dataslot.targetValue.label": "Target value",
  346. "dataslot.value.label": "Value",
  347. "dataslot.x.column.description": "The x coordinate of the column. The value must be a number, string, or date.",
  348. "dataslot.x.label": "X axis",
  349. "dataslot.y.column.description": "The y coordinate of the column. The value must be a number or date.",
  350. "dataslot.y.label": "Y axis",
  351. "dataslot.yStart.column.description": "The start position of the column on the y scale. The value must be a number or date.",
  352. "dataslot.yStart.column.label": "Y start",
  353. "defaultPalette.description": "Rave2 default description",
  354. "defaultPalette.label": "Rave2 default",
  355. "effect.delay.description": "Staggers (delays) the transitions along the X coordinate.",
  356. "effect.delay.name": "Stagger transition",
  357. "effect.duration.description": "The animation duration, in ms.",
  358. "effect.duration.name": "Animation duration (ms)",
  359. "effect.name.description": "The effect that is used when the chart is drawn.",
  360. "effect.name.name": "Animation",
  361. "effect.name.options.none": "None",
  362. "effect.name.options.transition": "Transition",
  363. "grid.color.description": "The color of the grid lines.",
  364. "grid.color.name": "Grid line color",
  365. "grid.dependent.color.description": "The color of the dependent axis gridline.",
  366. "grid.dependent.color.name": "Dependent axis gridline color",
  367. "grid.dependent.dash.description": "The dash pattern for dependent axis gridlines.",
  368. "grid.dependent.dash.name": "Dependent axis gridline dash pattern",
  369. "grid.dependent.display.description": "Shows or hides the dependent axis gridlines.",
  370. "grid.dependent.display.name": "Show dependent axis gridlines",
  371. "grid.display.description": "Shows or hides the grid lines in the chart.",
  372. "grid.display.name": "Show grid lines",
  373. "grid.independent.color.description": "The color of the independent axis gridline.",
  374. "grid.independent.color.name": "Independent axis gridline color",
  375. "grid.independent.dash.description": "The dash pattern for independent axis gridlines.",
  376. "grid.independent.dash.name": "Independent axis gridline dash pattern",
  377. "grid.independent.display.description": "Shows or hides the independent axis gridlines.",
  378. "grid.independent.display.name": "Show independent axis gridlines",
  379. "item.label.description": "Shows or hides item labels.",
  380. "item.label.name": "Item label",
  381. "label.shadow.description": "Show or hide shadow for labels.",
  382. "label.shadow.name": "Label shadow",
  383. "labelstyle.font.description": "Font styles for the item labels",
  384. "labelstyle.font.name": "Item label font",
  385. "layout.axissize.bottom.max.description": "The maximum size of the bottom axis, as a CSS size or percentage.",
  386. "layout.axissize.bottom.max.name": "Bottom axis maximum size",
  387. "layout.axissize.bottom.min.description": "The minimum size of the bottom axis, as a CSS size or percentage.",
  388. "layout.axissize.bottom.min.name": "Bottom axis minimum size",
  389. "layout.axissize.bottom.preferred.description": "The preferred size of the bottom axis, as a CSS size or percentage.",
  390. "layout.axissize.bottom.preferred.name": "Bottom axis preferred size",
  391. "layout.axissize.left.max.description": "The maximum size of the left axis, as a CSS size or percentage.",
  392. "layout.axissize.left.max.name": "Left axis maximum size",
  393. "layout.axissize.left.min.description": "The minimum size of the left axis, as a CSS size or percentage.",
  394. "layout.axissize.left.min.name": "Left axis minimum size",
  395. "layout.axissize.left.preferred.description": "The preferred size of the left axis, as a CSS size or percentage.",
  396. "layout.axissize.left.preferred.name": "Left axis preferred size",
  397. "layout.axissize.right.max.description": "The maximum size of the right axis, as a CSS size or percentage.",
  398. "layout.axissize.right.max.name": "Right axis maximum size",
  399. "layout.axissize.right.min.description": "The minimum size of the right axis, as a CSS size or percentage.",
  400. "layout.axissize.right.min.name": "Right axis minimum size",
  401. "layout.axissize.right.preferred.description": "The preferred size of the right axis, as a CSS size or percentage.",
  402. "layout.axissize.right.preferred.name": "Right axis preferred size",
  403. "layout.axissize.top.max.description": "The maximum size of the top axis, as a CSS size or percentage.",
  404. "layout.axissize.top.max.name": "Top axis maximum size",
  405. "layout.axissize.top.min.description": "The minimum size of the top axis, as a CSS size or percentage.",
  406. "layout.axissize.top.min.name": "Top axis minimum size",
  407. "layout.axissize.top.preferred.description": "The preferred size of the top axis, as a CSS size or percentage.",
  408. "layout.axissize.top.preferred.name": "Top axis preferred size",
  409. "layout.chart.padding.bottom.description": "The bottom padding for the chart.",
  410. "layout.chart.padding.bottom.name": "Bottom padding",
  411. "layout.chart.padding.left.description": "The left padding for the chart.",
  412. "layout.chart.padding.left.name": "Left padding",
  413. "layout.chart.padding.right.description": "Right padding for the chart.",
  414. "layout.chart.padding.right.name": "Right padding",
  415. "layout.chart.padding.top.description": "The top padding for the chart.",
  416. "layout.chart.padding.top.name": "Top padding",
  417. "layout.legendchart.align.description": "Whether to align the legend to the interior of the chart.",
  418. "layout.legendchart.align.name": "Align legend to chart",
  419. "layout.legendchart.gap.description": "Space between the chart and the legend, as a CSS size or percentage.",
  420. "layout.legendchart.gap.name": "Space between legend and chart",
  421. "layout.legendsize.max.description": "The maximum size of the legend, as a CSS size or percentage.",
  422. "layout.legendsize.max.name": "Maximum size",
  423. "layout.legendsize.min.description": "The minimum size of the legend, as a CSS size or percentage.",
  424. "layout.legendsize.min.name": "Minimum size",
  425. "layout.legendsize.preferred.description": "The preferred size of the legend, as a CSS size or percentage.",
  426. "layout.legendsize.preferred.name": "Preferred size",
  427. "layout.padding.description": "The padding around the chart and legend.",
  428. "layout.padding.name": "Padding",
  429. "legend.display.description": "Shows or hides the legend.",
  430. "legend.display.falseLabel": "Hide",
  431. "legend.display.name": "Show legend",
  432. "legend.display.trueLabel": "Show",
  433. "legend.entrystyle.font.description": "The font properties of the legend entry.",
  434. "legend.entrystyle.font.name": "Entry font",
  435. "legend.position.description": "The position of the legend in the chart.",
  436. "legend.position.name": "Legend position",
  437. "legend.position.options.bottom": "Bottom",
  438. "legend.position.options.left": "Left",
  439. "legend.position.options.right": "Right",
  440. "legend.position.options.top": "Top",
  441. "legend.size.height.description": "The height of the legend, as a CSS size or percentage.",
  442. "legend.size.height.name": "Height",
  443. "legend.size.width.description": "The width of the legend, as a CSS size or percentage.",
  444. "legend.size.width.name": "Width",
  445. "legend.title.color.description": "The color of the legend title.",
  446. "legend.title.color.name": "Title color",
  447. "legend.title.description": "The title of the legend.",
  448. "legend.title.font.description": "The font of the legend title.",
  449. "legend.title.font.name": "Title font",
  450. "legend.title.name": "Title",
  451. "legend.titlestyle.fill.description": "The color of the legend title.",
  452. "legend.titlestyle.fill.name": "Title color",
  453. "legend.titlestyle.font.description": "The font properties of the legend title.",
  454. "legend.titlestyle.font.name": "Title font",
  455. "legend.titlestyle.fontfamily.description": "The font family of the legend title.",
  456. "legend.titlestyle.fontfamily.name": "Title font family",
  457. "legend.titlestyle.fontsize.description": "The font size of the legend title.",
  458. "legend.titlestyle.fontsize.name": "Title font size",
  459. "propertyPresentation.advanced.axisSizeProperties.description": "Axis size properties.",
  460. "propertyPresentation.advanced.axisSizeProperties.label": "Axis size",
  461. "propertyPresentation.advanced.clientBehaviorProperties.description": "Client side properties.",
  462. "propertyPresentation.advanced.clientBehaviorProperties.label": "Client behavior",
  463. "propertyPresentation.advanced.commonProperties.description": "Common properties.",
  464. "propertyPresentation.advanced.commonProperties.label": "Common",
  465. "propertyPresentation.advanced.description": "Advanced list of all properties in a grouped structure.",
  466. "propertyPresentation.advanced.label": "Advanced",
  467. "propertyPresentation.advanced.labelProperties.description": "Label properties",
  468. "propertyPresentation.advanced.labelProperties.label": "Label",
  469. "propertyPresentation.advanced.legendProperties.description": "Legend properties.",
  470. "propertyPresentation.advanced.legendProperties.label": "Legend",
  471. "propertyPresentation.advanced.xAxisProperties.description": "X-axis properties.",
  472. "propertyPresentation.advanced.xAxisProperties.label": "X-axis",
  473. "propertyPresentation.advanced.yAxisProperties.description": "Y-axis properties.",
  474. "propertyPresentation.advanced.yAxisProperties.label": "Y-axis",
  475. "propertyPresentation.simple.description": "Simple list of the most common properties.",
  476. "propertyPresentation.simple.label": "Simple",
  477. "rave2.colorpalette.blueContinuousSequential.description": "Blue continuous sequential description",
  478. "rave2.colorpalette.blueContinuousSequential.label": "Blue continuous sequential",
  479. "rave2.colorpalette.blueDiscreteSequential.description": "Blue discrete sequential description",
  480. "rave2.colorpalette.blueDiscreteSequential.label": "Blue discrete sequential",
  481. "rave2.colorpalette.blueGreenContinuousDivergent.description": "Blue green continuous divergent description",
  482. "rave2.colorpalette.blueGreenContinuousDivergent.label": "Blue green continuous divergent",
  483. "rave2.colorpalette.blueGreenDiscreteDivergent.description": "Blue green discrete divergent description",
  484. "rave2.colorpalette.blueGreenDiscreteDivergent.label": "Blue green discrete divergent",
  485. "rave2.colorpalette.dark.description": "Dark description",
  486. "rave2.colorpalette.dark.label": "Dark",
  487. "rave2.colorpalette.financial.description": "Financial description",
  488. "rave2.colorpalette.financial.label": "Financial",
  489. "rave2.colorpalette.greenContinuousSequential.description": "Green continuous sequential description",
  490. "rave2.colorpalette.greenContinuousSequential.label": "Green continuous sequential",
  491. "rave2.colorpalette.greenDiscreteSequential.description": "Green discrete sequential description",
  492. "rave2.colorpalette.greenDiscreteSequential.label": "Green discrete sequential",
  493. "rave2.colorpalette.light.description": "Light description",
  494. "rave2.colorpalette.light.label": "Light",
  495. "rave2.colorpalette.medical.description": "Medical description",
  496. "rave2.colorpalette.medical.label": "Medical",
  497. "rave2.colorpalette.orangeContinuousSequential.description": "Orange continuous sequential description",
  498. "rave2.colorpalette.orangeContinuousSequential.label": "Orange continuous sequential",
  499. "rave2.colorpalette.orangeDiscreteSequential.description": "Orange discrete sequential description",
  500. "rave2.colorpalette.orangeDiscreteSequential.label": " Orange discrete sequential",
  501. "rave2.colorpalette.purpleContinuousSequential.description": "Purple continuous sequential description",
  502. "rave2.colorpalette.purpleContinuousSequential.label": "Purple continuous sequential",
  503. "rave2.colorpalette.purpleDiscreteSequential.description": "Purple discrete sequential description",
  504. "rave2.colorpalette.purpleDiscreteSequential.label": "Purple discrete sequential",
  505. "rave2.colorpalette.redBlueContinuousDivergent.description": "Red blue continuous divergent description",
  506. "rave2.colorpalette.redBlueContinuousDivergent.label": "Red blue continuous divergent",
  507. "rave2.colorpalette.redBlueDiscreteDivergent.description": "Red blue discrete divergent description",
  508. "rave2.colorpalette.redBlueDiscreteDivergent.label": "Red blue discrete divergent",
  509. "rave2.colorpalette.redBlueInverseContinuousDivergent.description": "Red blue inverse continuous divergent description",
  510. "rave2.colorpalette.redBlueInverseContinuousDivergent.label": "Red blue inverse continuous divergent",
  511. "rave2.colorpalette.redBlueInverseDiscreteDivergent.description": "Red blue inverse discrete divergent description",
  512. "rave2.colorpalette.redBlueInverseDiscreteDivergent.label": "Red blue inverse discrete divergent",
  513. "rave2.colorpalette.redContinuousSequential.description": "Red continuous sequential description",
  514. "rave2.colorpalette.redContinuousSequential.label": "Red continuous sequential",
  515. "rave2.colorpalette.redDiscreteSequential.description": "Red discrete sequential description",
  516. "rave2.colorpalette.redDiscreteSequential.label": " Red discrete sequential",
  517. "rave2.colorpalette.redGreenContinuousDivergent.description": "Red green continuous divergent description",
  518. "rave2.colorpalette.redGreenContinuousDivergent.label": "Red green continuous divergent",
  519. "rave2.colorpalette.redGreenDiscreteDivergent.description": "Red green discrete divergent description",
  520. "rave2.colorpalette.redGreenDiscreteDivergent.label": "Red green discrete divergent",
  521. "rave2.colorpalette.redGreenInverseContinuousDivergent.description": "Red green inverse continuous divergent description",
  522. "rave2.colorpalette.redGreenInverseContinuousDivergent.label": "Red green inverse continuous divergent",
  523. "rave2.colorpalette.redGreenInverseDiscreteDivergent.description": "Red green inverse discrete divergent description",
  524. "rave2.colorpalette.redGreenInverseDiscreteDivergent.label": "Red green inverse discrete divergent",
  525. "rave2.colorpalette.tealContinuousSequential.description": "Teal continuous sequential description",
  526. "rave2.colorpalette.tealContinuousSequential.label": "Teal continuous sequential",
  527. "rave2.colorpalette.tealDiscreteSequential.description": "Teal discrete sequential description",
  528. "rave2.colorpalette.tealDiscreteSequential.label": "Teal discrete sequential",
  529. "rave2.colorpalette.tealPurpleContinuousDivergent.description": "Teal purple continuous divergent description",
  530. "rave2.colorpalette.tealPurpleContinuousDivergent.label": "Teal purple continuous divergent",
  531. "rave2.colorpalette.tealPurpleDiscreteDivergent.description": "Teal purple discrete divergent description",
  532. "rave2.colorpalette.tealPurpleDiscreteDivergent.label": "Teal purple discrete divergent",
  533. "rave2.colorpalette.violetContinuousSequential.description": "Violet continuous sequential description",
  534. "rave2.colorpalette.violetContinuousSequential.label": "Violet continuous sequential",
  535. "rave2.colorpalette.violetDiscreteSequential.description": "Violet discrete sequential description",
  536. "rave2.colorpalette.violetDiscreteSequential.label": "Violet discrete sequential",
  537. "rave2.colorpalette.yellowContinuousSequential.description": "Yellow continuous sequential description",
  538. "rave2.colorpalette.yellowContinuousSequential.label": "Yellow continuous sequential",
  539. "rave2.colorpalette.yellowDiscreteSequential.description": "Yellow discrete sequential description",
  540. "rave2.colorpalette.yellowDiscreteSequential.label": "Yellow discrete sequential",
  541. "transpose.description": "When set to Yes, the Y-axis shows the independent scale and the X-axis shows the dependent scale.",
  542. "transpose.falseLabel": "Do not transpose",
  543. "transpose.name": "Switch X and Y axes",
  544. "transpose.trueLabel": "Transpose",
  545. "zoom.description": "Zooms the chart in the X, Y, or both directions.",
  546. "zoom.name": "Zoom",
  547. "zoom.options.both": "Both",
  548. "zoom.options.none": "None",
  549. "zoom.options.x": "X",
  550. "zoom.options.y": "Y"
  551. }
  552. },{}],3:[function(require,module,exports){
  553. (function() {
  554. var $ = {};
  555. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModuleHeader
  556. /************************************************************************
  557. ** IBM Confidential
  558. **
  559. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  560. **
  561. ** (C) Copyright IBM Corp. 2015
  562. **
  563. ** The source code for this program is not published or otherwise divested of its trade secrets,
  564. ** irrespective of what has been deposited with the U.S. Copyright Office.
  565. ************************************************************************/
  566. var com_ibm_rave_library_Library = rave["library"];
  567. rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
  568. rave["internal"]["CSSUtil"]= rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
  569. // $source: com/ibm/rave/bundles/RaveBundle
  570. /************************************************************************
  571. ** IBM Confidential
  572. **
  573. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  574. **
  575. ** (C) Copyright IBM Corp. 2017
  576. **
  577. ** The source code for this program is not published or otherwise divested of its trade secrets,
  578. ** irrespective of what has been deposited with the U.S. Copyright Office.
  579. ************************************************************************/
  580. // GENERATED
  581. //@import com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader (runtime) // new
  582. /**
  583. * A RaveBundle extends the regular Bundle abstract class but includes common functionality for Rave-made bundles that aren't for general use.
  584. */
  585. var com_ibm_rave_bundles_RaveBundle = rave['internal']['Declare'](rave['library']['internal']['Bundle'], {
  586. /** @expose */
  587. loader : null,
  588. /** @expose */
  589. constructor : function() {
  590. ;
  591. ;
  592. ;
  593. ;
  594. ;
  595. ;
  596. this.loader = new com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader("/com/ibm/rave/bundles/" + this.getName());
  597. },
  598. /**
  599. * Load extra resources required for this bundle. Currently the compiled configuration.json file. And .css.
  600. */
  601. /** @expose */
  602. loadResources : function() {
  603. this.setMessageCatalog(rave['library']['internal']['Bundle'].DEFAULT_LOCALE, require("./i18n/messages_en.json"));
  604. var array = require("./configuration/configuration.json");
  605. if (array) {
  606. for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
  607. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  608. var artifact = __exp_enFor0[__i_enFor0];
  609. this.initialize(artifact);
  610. }
  611. }
  612. require("./vizlibrary.css");
  613. }
  614. });
  615. //com_ibm_rave_bundles_RaveBundle.CONFIGURATION_FILE = "./configuration/configuration.json";
  616. // $source: com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader
  617. // Intentionally empty - everything in this file is inlined
  618. var com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader = function(){};
  619. // $source: com/ibm/rave/bundles/views/BundleView
  620. /************************************************************************
  621. ** IBM Confidential
  622. **
  623. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  624. **
  625. ** (C) Copyright IBM Corp. 2017
  626. **
  627. ** The source code for this program is not published or otherwise divested of its trade secrets,
  628. ** irrespective of what has been deposited with the U.S. Copyright Office.
  629. ************************************************************************/
  630. // GENERATED
  631. //@import com/ibm/rave/bundles/components/BackgroundComponentImpl (runtime) // new
  632. //@import com/ibm/rave/bundles/components/ChartLayoutComponentImpl (runtime) // new
  633. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  634. //@import com/ibm/rave/bundles/components/LegendsManager (runtime) // new
  635. //@import com/ibm/rave/bundles/components/AxesManager (runtime) // new
  636. //@import com/ibm/rave/library/Library (runtime) // Library
  637. //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities
  638. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
  639. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  640. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  641. var com_ibm_rave_bundles_views_BundleView = rave['internal']['Declare'](rave['library']['internal']['AbstractView'], {
  642. /**
  643. * Background component
  644. */
  645. /** @expose */
  646. _backgroundComponent : null,
  647. /**
  648. * Layout component
  649. */
  650. /** @expose */
  651. _layoutComponent : null,
  652. /**
  653. * Clip component
  654. */
  655. /** @expose */
  656. _clip : null,
  657. /**
  658. * Axes manager
  659. */
  660. /** @expose */
  661. _axes : null,
  662. /**
  663. * Legends manager
  664. */
  665. /** @expose */
  666. _legends : null,
  667. //_groupStructure : null,
  668. /** @expose */
  669. _chart : null,
  670. /** @expose */
  671. dataModel : null,
  672. /** @expose */
  673. _zoomP : null,
  674. /** @expose */
  675. _zoomS : null,
  676. /** @expose */
  677. constructor : function(context) {
  678. },
  679. /** @expose */
  680. getGroupStructure : function() {},
  681. /** @expose */
  682. setup : function() {
  683. rave['library']['internal']['AbstractView'].prototype.setup.call(this);
  684. this._backgroundComponent = new com_ibm_rave_bundles_components_BackgroundComponentImpl();
  685. this._layoutComponent = new com_ibm_rave_bundles_components_ChartLayoutComponentImpl();
  686. this._clip = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this.context.instanceId() + "clipViewport");
  687. if (this.isZoomSupported()) {
  688. this.resetZoom();
  689. }
  690. this._legends = new com_ibm_rave_bundles_components_LegendsManager(this.context, this.getLegendCount());
  691. if (this.isAxesManagerRequired()) {
  692. this._axes = new com_ibm_rave_bundles_components_AxesManager(this.context);
  693. }
  694. this._groupStructure = this.getGroupStructure();
  695. },
  696. /** @expose */
  697. preDraw : function(chartId) {
  698. this.cancelTransitions();
  699. rave['library']['internal']['AbstractView'].createGroupStructure(this.context.node, this._groupStructure);
  700. this._chart = this.context.node.selectAll(chartId);
  701. },
  702. /** @expose */
  703. resetZoom : function() {
  704. this._zoomP = [0, 0, 0, 0];
  705. this._zoomS = [1, 1, 1, 1];
  706. },
  707. /** @expose */
  708. validateDataModel : function(elementsToRemove) {
  709. if (elementsToRemove !== null || arguments.length > 1){
  710. elementsToRemove = Array.prototype.slice.call(arguments);
  711. }
  712. {
  713. this.dataModel = this.context.dataModel();
  714. if (!(this.dataValid())) {
  715. for (var __i_enFor0 = 0, __len_enFor0 = elementsToRemove.length;
  716. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  717. var e = elementsToRemove[__i_enFor0];
  718. this._chart.selectAll(e).selectAll("*").remove();
  719. }
  720. this._legends.visible(false).draw();
  721. return false;
  722. }
  723. return true;
  724. }
  725. },
  726. /** @expose */
  727. dataValid : function() {
  728. return this.dataModel.validate();
  729. },
  730. /** @expose */
  731. getLegendCount : function() {
  732. return 1;
  733. },
  734. /** @expose */
  735. isAxesManagerRequired : function() {
  736. return false;
  737. },
  738. /** @expose */
  739. isZoomSupported : function() {
  740. return true;
  741. },
  742. /** @expose */
  743. getProperty : function(s) {
  744. return this.context.getPropertyValue(s);
  745. },
  746. /** @expose */
  747. getPropertyDefault : function(s) {
  748. return this.context.getPropertyDefault(s);
  749. },
  750. /** @expose */
  751. getBooleanProperty : function(s) {
  752. var obj = this.getProperty(s);
  753. return (obj);
  754. },
  755. /** @expose */
  756. getDoubleProperty : function(s) {
  757. var obj = this.getProperty(s);
  758. return + (obj);
  759. },
  760. /** @expose */
  761. getIntProperty : function(s) {
  762. var obj = this.getProperty(s);
  763. return ~~ (obj);
  764. },
  765. /**
  766. * @param (String) id Property ID
  767. * @return (String) Property value as a string
  768. */
  769. /** @expose */
  770. getStringProperty : function(id) {
  771. var obj = this.getProperty(id);
  772. return (obj == null) ? null : ""+(obj);
  773. },
  774. /**
  775. * @param (String) id Property ID
  776. * @return (String) Property value as a string, returning null for the empty string
  777. */
  778. /** @expose */
  779. getStringPropertyEmptyAsNull : function(id) {
  780. var s = this.getStringProperty(id);
  781. return (s == null || s.length == 0) ? null : s;
  782. },
  783. /**
  784. * @param (String) id Property ID
  785. * @return (Number) Property value as a string, containing size as the number of pixels
  786. */
  787. /** @expose */
  788. getCSSSizeToPixelNumber : function(id) {
  789. var cssSize = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.context.getPropertyValue(id), 100.0, 10.0);
  790. return (cssSize == null) ? 0.0 : cssSize;
  791. },
  792. /**
  793. * Based on effect duration and effect property, determine the effect duration in ms.
  794. * @param (String) effect Effect name, one of the options available from EFFECT_OPTIONS.
  795. * @return (int) Effect duration in ms.
  796. */
  797. /** @expose */
  798. getEffectDuration : function(effect) {
  799. var duration = this.getIntProperty("effect.duration");
  800. if ((duration < 0) || (effect == null) || "none" == effect) {
  801. duration = 0;
  802. }
  803. return duration;
  804. },
  805. /** @expose */
  806. getTopPadding : function() {
  807. return this.getProperty("layout.chart.padding.top");
  808. },
  809. /** @expose */
  810. getLeftPadding : function() {
  811. return this.getProperty("layout.chart.padding.left");
  812. },
  813. /** @expose */
  814. getBottomPadding : function() {
  815. return this.getProperty("layout.chart.padding.bottom");
  816. },
  817. /** @expose */
  818. getRightPadding : function() {
  819. return this.getProperty("layout.chart.padding.right");
  820. },
  821. /** @expose */
  822. getLayoutPadding : function() {
  823. return this.getProperty("layout.padding");
  824. },
  825. /** @expose */
  826. getLegendChartGap : function() {
  827. return this.getProperty("layout.legendchart.gap");
  828. },
  829. /** @expose */
  830. getLegendChartAlign : function() {
  831. return this.getBooleanProperty("layout.legendchart.align");
  832. },
  833. /** @expose */
  834. getLegendPosition : function() {
  835. return this.getStringProperty("legend.position");
  836. },
  837. getPalette$0 : function() {
  838. return this.getPalette$1("color.palette");
  839. },
  840. getPalette$1 : function(paletteID) {
  841. var id = this.getStringProperty(paletteID);
  842. var colorPalette = com_ibm_rave_library_Library.palettes.getPalette(id);
  843. return (!colorPalette) ? com_ibm_rave_library_Library.palettes.getDefaultPalette() : colorPalette;
  844. },
  845. getDynamicPalette$0 : function() {
  846. return this.getDynamicPalette$1("color.palette", "color.dynamicPalette.min", "color.dynamicPalette.mid", "color.dynamicPalette.max");
  847. },
  848. /**
  849. * 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.
  850. * @param (String) paletteID The palette ID
  851. * @return (rave['library']['internal']['Palette']) Palette
  852. */
  853. getDynamicPalette$1 : function(paletteID, minId, midId, maxId) {
  854. var colorPalette;
  855. var min = this.getStringProperty(minId);
  856. if (min != null) {
  857. var mid = this.getStringProperty(midId);
  858. if (mid != null) {
  859. var max = this.getStringProperty(maxId);
  860. if (max != null) {
  861. var fills = [min, mid, max];
  862. colorPalette = rave['library']['internal']['AbstractView'].getFillPalette(fills);
  863. }
  864. }
  865. }
  866. return (!colorPalette) ? this.getPalette(paletteID) : colorPalette;
  867. },
  868. /** @expose */
  869. prepareLayoutComponent : function() {
  870. 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());
  871. },
  872. /** @expose */
  873. prepareLayoutSizables : function(layoutComponent, useX2, useY1, useX1, useY2, useLegend) {
  874. layoutComponent.removeAxisSizables();
  875. if (useX1) {
  876. layoutComponent.addAxisSizable(this._axes.axisComponent(0));
  877. }
  878. if (useY1) {
  879. layoutComponent.addAxisSizable(this._axes.axisComponent(2));
  880. }
  881. if (useX2) {
  882. layoutComponent.addAxisSizable(this._axes.axisComponent(1));
  883. }
  884. if (useY2) {
  885. layoutComponent.addAxisSizable(this._axes.axisComponent(3));
  886. }
  887. layoutComponent.legendSize(useLegend ? this._legends : null);
  888. },
  889. /** @expose */
  890. resetUpdate : function() {
  891. this.updateType = 4;
  892. },
  893. /** @expose */
  894. isUpdateNothing : function() {
  895. return this.updateType == 4;
  896. },
  897. /** @expose */
  898. isShowLegend : function() {
  899. return this.getBooleanProperty("legend.display");
  900. },
  901. cancelTransitions : function() {
  902. this.context.node.selectAll("*").interrupt();
  903. },
  904. /** @expose */
  905. setBackgroundProperties : function(elementRect, duration) {
  906. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).size(this.context.size).backgroundColor(this.getStringProperty("background.chart.color"));
  907. this.context.node.selectAll("rect.background.chart").transition().duration(duration).call(this._backgroundComponent);
  908. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(elementRect).backgroundColor(this.getStringProperty("background.elements.color"));
  909. this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
  910. },
  911. /** @expose */
  912. isShowDataLabels : function() {
  913. return this.getBooleanProperty("data.label.display");
  914. },
  915. /** @expose */
  916. isShowDataLabelsAsPercentageOfColor : function() {
  917. var dataLabel = this.getStringProperty("data.label.type");
  918. return "PercentOfColor" == dataLabel;
  919. },
  920. /** @expose */
  921. isShowDataLabelsAsPercentageOfCategory : function() {
  922. var dataLabel = this.getStringProperty("data.label.type");
  923. return "PercentOfCategory" == dataLabel;
  924. },
  925. /** @expose */
  926. getlDataLabelAccessor : function(dataSet, slot, isInterval) {
  927. var labelAccessor;
  928. var labelEntry = dataSet.slot(slot).entry();
  929. if (!labelEntry) {
  930. if (this.isShowDataLabelsAsPercentageOfCategory()) {
  931. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR;
  932. } else if (this.isShowDataLabelsAsPercentageOfColor()) {
  933. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR;
  934. } else {
  935. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR;
  936. }
  937. } else {
  938. labelAccessor = rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelEntry));
  939. }
  940. return labelAccessor;
  941. },
  942. /** @expose */
  943. getEntryForDataLabelFormatter : function(dataSet, labelSlot, defaultSlot) {
  944. var labelEntry = dataSet.slot(labelSlot).entry();
  945. return labelEntry ? labelEntry : dataSet.slot(defaultSlot).entry();
  946. },
  947. /** @expose */
  948. getBackgroundConstrastLabelStyle : function() {
  949. var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
  950. if (this.getBooleanProperty("contrast.label.color") == false) {
  951. return labelFontStyle;
  952. }
  953. var defaultFillColor;
  954. if (labelFontStyle) {
  955. defaultFillColor = labelFontStyle["fill"];
  956. if (defaultFillColor == null) {
  957. defaultFillColor = labelFontStyle["color"];
  958. }
  959. } else {
  960. labelFontStyle = {};
  961. }
  962. if (defaultFillColor == null) {
  963. defaultFillColor = "#000000";
  964. }
  965. labelFontStyle["fill"] = com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(this.getStringProperty("background.elements.color"), defaultFillColor);
  966. return labelFontStyle;
  967. },
  968. /** @expose */
  969. getPalette : function(a0) {
  970. var args = arguments;
  971. if (args.length == 0) {
  972. return this.getPalette$0();
  973. }
  974. if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
  975. return this.getPalette$1(a0);
  976. }
  977. return rave['library']['internal']['AbstractView'].prototype.getPalette.apply(this, args);
  978. },
  979. /** @expose */
  980. getDynamicPalette : function(a0, a1, a2, a3) {
  981. var args = arguments;
  982. if (args.length == 0) {
  983. return this.getDynamicPalette$0();
  984. }
  985. return this.getDynamicPalette$1(a0, a1, a2, a3);
  986. }
  987. });
  988. // $source: com/ibm/rave/bundles/components/BundleComponentImpl
  989. /************************************************************************
  990. ** IBM Confidential
  991. **
  992. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  993. **
  994. ** (C) Copyright IBM Corp. 2017
  995. **
  996. ** The source code for this program is not published or otherwise divested of its trade secrets,
  997. ** irrespective of what has been deposited with the U.S. Copyright Office.
  998. ************************************************************************/
  999. // GENERATED
  1000. var com_ibm_rave_bundles_components_BundleComponentImpl = rave['internal']['Declare']({
  1001. /**
  1002. * The pre-execution callback.
  1003. */
  1004. //_preExecuteCallback : null,
  1005. /**
  1006. * The render callback.
  1007. */
  1008. /** @expose */
  1009. _renderCallback : null,
  1010. _$functionClassMethod : function() {
  1011. var _$self = function(args) {
  1012. if (args !== null || arguments.length > 1){
  1013. args = Array.prototype.slice.call(arguments, 0);
  1014. }
  1015. {
  1016. var self = _$self;
  1017. this.each(function(data, index, groupIndex) {
  1018. self.execute(rave.select(this));
  1019. });
  1020. return null;
  1021. }
  1022. };
  1023. return _$self;
  1024. },
  1025. /**
  1026. * 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.
  1027. * @param (rave['internal']['Selector']) g <g> node that this component will be applied to.
  1028. */
  1029. /** @expose */
  1030. execute : function(g) {},
  1031. /**
  1032. * Set the pre-execute callback for this component.
  1033. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  1034. */
  1035. /** @expose */
  1036. setPreExecute : function(callback) {
  1037. this._preExecuteCallback = callback;
  1038. return this;
  1039. },
  1040. /**
  1041. * If the pre-execute component is non-null, call it with this object. Note that this object must also implement BundleComponent.
  1042. */
  1043. /** @expose */
  1044. preExecute : function() {
  1045. if (this._preExecuteCallback) {
  1046. this._preExecuteCallback(this);
  1047. }
  1048. },
  1049. /**
  1050. * Set the render callback for this component.
  1051. * @param (rave['internal']['RunFunction']) callback The callback
  1052. */
  1053. /** @expose */
  1054. setRenderCallback : function(callback) {
  1055. this._renderCallback = callback;
  1056. return this;
  1057. },
  1058. /**
  1059. * 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.
  1060. */
  1061. /** @expose */
  1062. type : function() {},
  1063. /** @expose */
  1064. updateBorder : function(s, borderWidth, borderColor) {
  1065. if (borderWidth != null) {
  1066. s.each(function(data, index, groupIndex) {
  1067. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  1068. this.rave_setStyle("stroke-width", borderWidth, "");
  1069. }
  1070. });
  1071. }
  1072. if (borderColor != null) {
  1073. s.each(function(data, index, groupIndex) {
  1074. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  1075. this.rave_setStyle("stroke", borderColor, "");
  1076. }
  1077. });
  1078. }
  1079. },
  1080. /** @expose */
  1081. getDefaultLabelColor : function(_labelStyle) {
  1082. if (!_labelStyle) {
  1083. return "#000000";
  1084. }
  1085. var defaultFillColor;
  1086. if (_labelStyle) {
  1087. defaultFillColor = _labelStyle["fill"];
  1088. if (defaultFillColor == null) {
  1089. defaultFillColor = _labelStyle["color"];
  1090. }
  1091. }
  1092. if (defaultFillColor == null) {
  1093. defaultFillColor = "#000000";
  1094. }
  1095. return defaultFillColor.toString();
  1096. }
  1097. });
  1098. // $source: com/ibm/rave/bundles/component/BackgroundComponent
  1099. /************************************************************************
  1100. ** IBM Confidential
  1101. **
  1102. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1103. **
  1104. ** (C) Copyright IBM Corp. 2017
  1105. **
  1106. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1107. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1108. ************************************************************************/
  1109. // GENERATED
  1110. /**
  1111. * <p> A component that renders the background to the chart. The {@link #this.type()} method returns "BackgroundComponent". </p>
  1112. */
  1113. var com_ibm_rave_bundles_component_BackgroundComponent = rave['internal']['Declare'].implement(
  1114. /**
  1115. * Get the background color.
  1116. * @return (String) The background color
  1117. */
  1118. //backgroundColor : function() {},
  1119. /**
  1120. * Set the background color. If the color is null, white is used.
  1121. * @param (String) backgroundColor The new background color
  1122. * @return (com.ibm.rave.bundles.component.BackgroundComponent) This object
  1123. */
  1124. //backgroundColor : function(backgroundColor) {}
  1125. );
  1126. /**
  1127. * The string returned by {@link #this.type()} is "BackgroundComponent".
  1128. */
  1129. /** @expose */
  1130. com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE = "BackgroundComponent";
  1131. // $source: com/ibm/rave/bundles/component/ChartLayoutComponent
  1132. /************************************************************************
  1133. ** IBM Confidential
  1134. **
  1135. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1136. **
  1137. ** (C) Copyright IBM Corp. 2017
  1138. **
  1139. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1140. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1141. ************************************************************************/
  1142. // GENERATED
  1143. /**
  1144. * <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>
  1145. */
  1146. var com_ibm_rave_bundles_component_ChartLayoutComponent = rave['internal']['Declare'].implement(
  1147. //padding : function() {},
  1148. //topPadding : function() {},
  1149. //leftPadding : function() {},
  1150. //bottomPadding : function() {},
  1151. //rightPadding : function() {},
  1152. //legendChartAlign : function() {},
  1153. //legendPosition : function() {},
  1154. //legendChartGap : function() {},
  1155. //legendPosition : function(position) {},
  1156. //topPadding : function(value) {},
  1157. //leftPadding : function(value) {},
  1158. //bottomPadding : function(value) {},
  1159. //rightPadding : function(value) {},
  1160. /**
  1161. * Sets the padding around the outside of the chart/legend.
  1162. * @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.
  1163. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1164. */
  1165. //padding : function(value) {},
  1166. /**
  1167. * Sets all chart paddings. Null values are treated as 0.
  1168. * @param (Object) top New top padding
  1169. * @param (Object) left New left padding
  1170. * @param (Object) bottom New bottom padding
  1171. * @param (Object) right New right padding
  1172. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1173. * @deprecated Please use {@link #this.padding(Object)} and {@link #this.legendChartGap(Object)}
  1174. */
  1175. //chartPadding : function(top, left, bottom, right) {},
  1176. /**
  1177. * Sets whether the legend should align with the chart "body".
  1178. * @param (boolean) legendChartAlign the boolean state
  1179. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1180. */
  1181. //legendChartAlign : function(legendChartAlign) {},
  1182. /**
  1183. * Set the space for the gap between chart and legend
  1184. * @param (Object) value the gap distance (css length)
  1185. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1186. */
  1187. //legendChartGap : function(value) {},
  1188. /**
  1189. * Set the size information for the legend. Null value is treated as no visible legend.
  1190. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1191. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1192. */
  1193. //legendSize : function(sizable) {},
  1194. /**
  1195. * Reset list of axis sizables to 0
  1196. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1197. */
  1198. //removeAxisSizables : function() {},
  1199. /**
  1200. * Add an axis to be considered in layout operation.
  1201. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1202. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1203. */
  1204. //addAxisSizable : function(sizable) {}
  1205. );
  1206. /**
  1207. * The string returned by {@link #this.type()} is "ChartLayoutComponent".
  1208. */
  1209. /** @expose */
  1210. com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE = "ChartLayoutComponent";
  1211. // $source: com/ibm/rave/bundles/components/LegendsManager
  1212. /************************************************************************
  1213. ** IBM Confidential
  1214. **
  1215. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1216. **
  1217. ** (C) Copyright IBM Corp. 2017
  1218. **
  1219. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1220. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1221. ************************************************************************/
  1222. // GENERATED
  1223. //@import com/ibm/rave/bundles/components/LegendComponentImpl (runtime) // new, orientationOf
  1224. /**
  1225. * <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>
  1226. */
  1227. var com_ibm_rave_bundles_components_LegendsManager = rave['internal']['Declare']({
  1228. /**
  1229. * Bundle context
  1230. */
  1231. //_context : null,
  1232. /**
  1233. * Component used to draw all legends
  1234. */
  1235. //_comp : null,
  1236. /**
  1237. * Global visibility; if false no legends are drawn
  1238. */
  1239. //_visible : null,
  1240. /**
  1241. * Rectangle containing all legends
  1242. */
  1243. //_rectangle : null,
  1244. /**
  1245. * Legend orientation
  1246. */
  1247. //_orient : null,
  1248. /**
  1249. * Pre-execute component callback
  1250. */
  1251. //_preExecute : null,
  1252. /**
  1253. * Selectors for each legend
  1254. */
  1255. //_selectors : null,
  1256. /**
  1257. * Palettes for each legend
  1258. */
  1259. //_palettes : null,
  1260. /**
  1261. * Scale size functions for each legend
  1262. */
  1263. //_scale : null,
  1264. /**
  1265. * Swatch size functions for each legend
  1266. */
  1267. //_swatchSizes : null,
  1268. /**
  1269. * Shapes for each legend
  1270. */
  1271. //_shapes : null,
  1272. /**
  1273. * Titles for each legend
  1274. */
  1275. //_titles : null,
  1276. /**
  1277. * Title fonts for each legend
  1278. */
  1279. //_titleFonts : null,
  1280. /**
  1281. * Title fills for each legend
  1282. */
  1283. //_titleFills : null,
  1284. /**
  1285. * Title font sizes for each legend
  1286. */
  1287. //_titleFontSizes : null,
  1288. /**
  1289. * Title font families for each legend
  1290. */
  1291. //_titleFontFamilies : null,
  1292. /**
  1293. * Entry fonts for each legend
  1294. */
  1295. //_entryFonts : null,
  1296. /**
  1297. * Custom formatters for each legend, created from the registered custom formatters
  1298. */
  1299. //_formatters : null,
  1300. /**
  1301. * Whether each legend was visible in the last draw
  1302. */
  1303. //_lastVisible : null,
  1304. //_dataSlotEntries : null,
  1305. /**
  1306. * Number of legends
  1307. */
  1308. _numLegends : 0,
  1309. /**
  1310. * Whether to use a transition.
  1311. */
  1312. _doTransition : false,
  1313. /**
  1314. * Duration of the transition.
  1315. */
  1316. _duration : 0,
  1317. _spaceUsed : 0,
  1318. /**
  1319. * Construct the manager.
  1320. * @param (int) numLegends Number of legends, must be positive
  1321. */
  1322. /** @expose */
  1323. constructor : function(context, numLegends) {
  1324. this._context = context;
  1325. this._numLegends = numLegends;
  1326. this._comp = new com_ibm_rave_bundles_components_LegendComponentImpl();
  1327. this._rectangle = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1328. this._orient = "vertical";
  1329. this._preExecute = null;
  1330. this._selectors = [];
  1331. this._palettes = [];
  1332. this._scale = [];
  1333. this._swatchSizes = [];
  1334. this._shapes = [];
  1335. this._titles = [];
  1336. this._titleFonts = [];
  1337. this._titleFills = [];
  1338. this._titleFontSizes = [];
  1339. this._titleFontFamilies = [];
  1340. this._entryFonts = [];
  1341. this._formatters = [];
  1342. this._lastVisible = [];
  1343. this._visible = [];
  1344. this._dataSlotEntries = [];
  1345. for (var i = 0; i < this._numLegends; ++i) {
  1346. this._selectors[i] = null;
  1347. this._palettes[i] = null;
  1348. this._swatchSizes[i] = null;
  1349. this._shapes[i] = null;
  1350. this._titles[i] = null;
  1351. this._formatters[i] = null;
  1352. this._lastVisible[i] = false;
  1353. this._visible[i] = true;
  1354. }
  1355. },
  1356. /**
  1357. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) The legend component used by this manager; for unit tests
  1358. */
  1359. getLegendComponent : function() {
  1360. return this._comp;
  1361. },
  1362. /**
  1363. * Set a specific legend visible
  1364. * @param (int) legendIndex The index of the legend
  1365. * @param (boolean) visible New value of visible flag
  1366. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1367. */
  1368. visible$0 : function(legendIndex, visible) {
  1369. if (legendIndex < this._visible.length) {
  1370. this._visible[legendIndex] = visible;
  1371. }
  1372. return this;
  1373. },
  1374. /**
  1375. * Set all legend visible
  1376. * @param (boolean) visible New value of visible flag
  1377. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1378. */
  1379. visible$1 : function(visible) {
  1380. for (var i = 0; i < this._visible.length; ++i) {
  1381. this._visible[i] = visible;
  1382. }
  1383. return this;
  1384. },
  1385. /**
  1386. * Set the layout rectangle. The rectangle is copied. If it is null, the layout rectangle is unchanged.
  1387. * @param (rave['internal']['RectStruct']) rect New layout rectangle
  1388. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1389. */
  1390. /** @expose */
  1391. rectangle : function(rect) {
  1392. if (rect) {
  1393. this._rectangle = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  1394. }
  1395. return this;
  1396. },
  1397. /**
  1398. * Set the orient property. If the argument is not "horizontal" or "vertical", the orient property is not changed.
  1399. * @param (String) orient New orient
  1400. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1401. */
  1402. /** @expose */
  1403. orient : function(orient) {
  1404. if ("horizontal" == orient || "vertical" == orient) {
  1405. this._orient = orient;
  1406. }
  1407. return this;
  1408. },
  1409. /**
  1410. * 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".
  1411. * @param (String) position Legend position
  1412. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1413. */
  1414. /** @expose */
  1415. position : function(position) {
  1416. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  1417. },
  1418. /**
  1419. * Set the transition information. If the duration is negative, 0 is used.
  1420. * @param (boolean) doTransition Whether to do a transition
  1421. * @param (int) duration Duration of the transition when used
  1422. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1423. */
  1424. /** @expose */
  1425. transition : function(doTransition, duration) {
  1426. this._doTransition = doTransition;
  1427. this._duration = (duration >= 0) ? duration : 0;
  1428. return this;
  1429. },
  1430. /**
  1431. * Set the pre-execute callback for all legends. The callback may be null.
  1432. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  1433. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1434. */
  1435. /** @expose */
  1436. setPreExecute : function(callback) {
  1437. this._preExecute = callback;
  1438. return this;
  1439. },
  1440. /**
  1441. * Set the selector to be used when rendering a legend. If the index is out of range no selectors change.
  1442. * @param (int) index Legend array index
  1443. * @param (rave['internal']['Selector']) selector Selector, may be null (but this is not advisable)
  1444. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1445. */
  1446. /** @expose */
  1447. selector : function(index, selector) {
  1448. if (index >= 0 && index < this._numLegends) {
  1449. this._selectors[index] = selector;
  1450. }
  1451. return this;
  1452. },
  1453. /**
  1454. * Set the palette of a legend. If the index is out of range no information is changed.
  1455. * @param (int) index Legend array index
  1456. * @param (rave['library']['internal']['Palette']) palette Palette, may be null
  1457. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1458. */
  1459. /** @expose */
  1460. palette : function(index, palette) {
  1461. if (index >= 0 && index < this._numLegends) {
  1462. this._palettes[index] = palette;
  1463. }
  1464. return this;
  1465. },
  1466. /**
  1467. * Set the shape of a legend. If the index is out of range no information is changed.
  1468. * @param (int) index Legend array index
  1469. * @param (String) shape Shape, may be null (defaulting to square)
  1470. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1471. */
  1472. /** @expose */
  1473. shape : function(index, shape) {
  1474. if (index >= 0 && index < this._numLegends) {
  1475. this._shapes[index] = shape;
  1476. }
  1477. return this;
  1478. },
  1479. /**
  1480. * Set the title of a legend. If the index is out of range no information is changed.
  1481. * @param (int) index Legend array index
  1482. * @param (String) title Title, may be null
  1483. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1484. */
  1485. /** @expose */
  1486. title : function(index, title) {
  1487. if (index >= 0 && index < this._numLegends) {
  1488. this._titles[index] = title;
  1489. }
  1490. return this;
  1491. },
  1492. /**
  1493. * Set the title font style of a legend. If the index is out of range no information is changed.
  1494. * @param (int) index Legend array index
  1495. * @param (String) titleFont Title font string, may be null
  1496. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1497. */
  1498. /** @expose */
  1499. titleFont : function(index, titleFont) {
  1500. if (index >= 0 && index < this._numLegends) {
  1501. this._titleFonts[index] = titleFont;
  1502. }
  1503. return this;
  1504. },
  1505. /**
  1506. * Set the entry font style of a legend. If the index is out of range no information is changed.
  1507. * @param (int) index Legend array index
  1508. * @param (String) entryFont Entry font string, may be null
  1509. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1510. */
  1511. /** @expose */
  1512. entryFont : function(index, entryFont) {
  1513. if (index >= 0 && index < this._numLegends) {
  1514. this._entryFonts[index] = entryFont;
  1515. }
  1516. return this;
  1517. },
  1518. /**
  1519. * Set the title fill of a legend. If the index is out of range no information is changed.
  1520. * @param (int) index Legend array index
  1521. * @param (String) titleFill Fill color string, may be null
  1522. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1523. */
  1524. /** @expose */
  1525. titleFill : function(index, titleFill) {
  1526. if (index >= 0 && index < this._numLegends) {
  1527. this._titleFills[index] = titleFill;
  1528. }
  1529. return this;
  1530. },
  1531. /**
  1532. * Set the title font size of a legend. If the index is out of range no information is changed.
  1533. * @param (int) index Legend array index
  1534. * @param (String) titleFontSize Font size string, may be null
  1535. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1536. */
  1537. /** @expose */
  1538. titleFontSize : function(index, titleFontSize) {
  1539. if (index >= 0 && index < this._numLegends) {
  1540. this._titleFontSizes[index] = titleFontSize;
  1541. }
  1542. return this;
  1543. },
  1544. /**
  1545. * Set the title font family of a legend. If the index is out of range no information is changed.
  1546. * @param (int) index Legend array index
  1547. * @param (String) titleFontFamily Font family string, may be null
  1548. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1549. */
  1550. /** @expose */
  1551. titleFontFamily : function(index, titleFontFamily) {
  1552. if (index >= 0 && index < this._numLegends) {
  1553. this._titleFontFamilies[index] = titleFontFamily;
  1554. }
  1555. return this;
  1556. },
  1557. /**
  1558. * Set the scale of a legend. If the index is out of range no information is changed.
  1559. * @param (int) index Legend array index
  1560. * @param (rave['internal']['AbstractScale']) scale Scale, may be null
  1561. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1562. */
  1563. /** @expose */
  1564. scale : function(index, scale) {
  1565. if (index >= 0 && index < this._numLegends) {
  1566. this._scale[index] = scale;
  1567. }
  1568. return this;
  1569. },
  1570. /**
  1571. * Set the swatch size function of a legend. If the index is out of range no information is changed.
  1572. * @param (int) index Legend array index
  1573. * @param (rave['internal']['ValueFunction']) swatchSize Swatch size function, may be null
  1574. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1575. */
  1576. /** @expose */
  1577. swatchSize : function(index, swatchSize) {
  1578. if (index >= 0 && index < this._numLegends) {
  1579. this._swatchSizes[index] = swatchSize;
  1580. }
  1581. return this;
  1582. },
  1583. /**
  1584. * 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.
  1585. * @param (int) index Legend array index
  1586. * @param (Array) entries List of data slot entries, if null an empty list is used
  1587. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  1588. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined, may be null
  1589. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1590. */
  1591. /** @expose */
  1592. formatterList : function(index, entries, format, defaultFunction) {
  1593. if (index >= 0 && index < this._numLegends) {
  1594. this._formatters[index] = this._context.getCustomFormatterWithFlag(["legend", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("legend-label", "ROLE_NONE", format, entries), defaultFunction, false);
  1595. }
  1596. return this;
  1597. },
  1598. /**
  1599. * 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.
  1600. * @param (int) index Legend array index
  1601. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1602. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1603. */
  1604. /** @expose */
  1605. formatter : function(index, entry) {
  1606. var entries = [];
  1607. if (entry) {
  1608. entries.push(entry);
  1609. }
  1610. return this.formatterList(index, entries, "none", null);
  1611. },
  1612. /**
  1613. * 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.
  1614. * @return (boolean) Whether any legend are visible (will be drawn)
  1615. */
  1616. /** @expose */
  1617. anyVisible : function() {
  1618. for (var i = 0; i < this._numLegends; ++i) {
  1619. if (this._visible[i] == true && (this._palettes[i] || this._swatchSizes[i])) {
  1620. return true;
  1621. }
  1622. }
  1623. return false;
  1624. },
  1625. /**
  1626. * 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'])} .
  1627. * @param (int) index Legend array index
  1628. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1629. * @return (com.ibm.rave.bundles.components.LegendsManager) This LegendsManager
  1630. */
  1631. /** @expose */
  1632. setDataSlot : function(index, entry) {
  1633. if (index >= 0 && index < this._numLegends) {
  1634. this._dataSlotEntries[index] = entry;
  1635. }
  1636. return this.formatter(index, entry);
  1637. },
  1638. preLayout$0 : function(layoutComponent) {
  1639. this.preLayout$1(layoutComponent, true);
  1640. return this;
  1641. },
  1642. preLayout$1 : function(layoutComponent, axesBeforeLegend) {
  1643. var layoutTransition = this._doTransition;
  1644. var layoutDuration = this._duration;
  1645. this._doTransition = false;
  1646. this._duration = 0;
  1647. var children = [];
  1648. for (var i = 0; i < this._numLegends; ++i) {
  1649. children[i] = "g.layoutLegend-" + i;
  1650. }
  1651. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.legends-layout"), children);
  1652. var layoutSelectors = [];
  1653. var layoutLastVisible = [];
  1654. for (var i = 0; i < this._numLegends; ++i) {
  1655. layoutSelectors[i] = this._selectors[i];
  1656. layoutLastVisible[i] = this._lastVisible[i];
  1657. this._lastVisible[i] = false;
  1658. if (this._selectors[i]) {
  1659. this._selectors[i] = this._context.node.select("g.layoutLegend-" + i);
  1660. }
  1661. }
  1662. layoutComponent.preLayout(true, !axesBeforeLegend);
  1663. this.rectangle(layoutComponent.legendRect());
  1664. this.draw();
  1665. this._doTransition = layoutTransition;
  1666. this._duration = layoutDuration;
  1667. this._context.node.select("g.legends-layout").selectAll("*").remove();
  1668. for (var i = 0; i < this._numLegends; ++i) {
  1669. this._lastVisible[i] = layoutLastVisible[i];
  1670. this._selectors[i] = layoutSelectors[i];
  1671. }
  1672. return this;
  1673. },
  1674. /**
  1675. * Render the legends using the current global and per-legend settings.
  1676. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1677. */
  1678. /** @expose */
  1679. draw : function() {
  1680. var nVisible = 0;
  1681. for (var i = 0; i < this._numLegends; ++i) {
  1682. if ((this._swatchSizes[i] || this._palettes[i]) && this._visible[i]) {
  1683. nVisible++;
  1684. }
  1685. }
  1686. var x = this._rectangle.x;
  1687. var y = this._rectangle.y;
  1688. var dx;
  1689. var dy;
  1690. var size;
  1691. if (nVisible == 0) {
  1692. dx = 0;
  1693. dy = 0;
  1694. size = [this._rectangle.width, this._rectangle.height];
  1695. } else if ("horizontal" == this._orient) {
  1696. dx = this._rectangle.width / nVisible;
  1697. dy = 0;
  1698. size = [dx, this._rectangle.height];
  1699. } else {
  1700. dx = 0;
  1701. dy = this._rectangle.height / nVisible;
  1702. size = [this._rectangle.width, dy];
  1703. }
  1704. this._comp.orient(this._orient).size(size);
  1705. this._spaceUsed = 0;
  1706. for (var i = 0; i < this._numLegends; ++i) {
  1707. if (this._selectors[i]) {
  1708. var visible = this._visible[i] && (this._palettes[i] || this._swatchSizes[i]);
  1709. 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]);
  1710. var fontStyle = this._context.getPropertyValue("legend.titlestyle.font");
  1711. if (this._titleFonts[i] != null && !(this._titleFonts[i] == "")) {
  1712. this._comp.titleFont(this._titleFonts[i]);
  1713. } else if (fontStyle != null && !(fontStyle == "")) {
  1714. this._comp.titleFont(this._context.getPropertyValue("legend.titlestyle.font"));
  1715. }
  1716. fontStyle = this._context.getPropertyValue("legend.entrystyle.font");
  1717. if (this._entryFonts[i] != null) {
  1718. this._comp.entryFont(this._entryFonts[i]);
  1719. } else if (fontStyle != null && !(fontStyle == "")) {
  1720. this._comp.entryFont(this._context.getPropertyValue("legend.entrystyle.font"));
  1721. }
  1722. var s = (this._doTransition && this._lastVisible[i]) ? this._selectors[i].transition("transition").duration(this._duration) : this._selectors[i];
  1723. s.attr("transform", "translate(" + x + "," + y + ")").call(this._comp);
  1724. var dataSlotEntries = [];
  1725. if (this._dataSlotEntries[i]) {
  1726. dataSlotEntries.push(this._dataSlotEntries[i]);
  1727. }
  1728. this._selectors[i].selectAll(".legendTitle").property("dataSlots", dataSlotEntries);
  1729. if (visible) {
  1730. x += dx;
  1731. y += dy;
  1732. if (this._comp.getSpaceUsed() > this._spaceUsed) {
  1733. this._spaceUsed = this._comp.getSpaceUsed();
  1734. }
  1735. }
  1736. this._lastVisible[i] = visible;
  1737. } else {
  1738. this._lastVisible[i] = false;
  1739. }
  1740. }
  1741. return this;
  1742. },
  1743. /** @expose */
  1744. getSizableType : function() {
  1745. return 2;
  1746. },
  1747. /** @expose */
  1748. getSizableOrientation : function() {
  1749. return this._orient;
  1750. },
  1751. /** @expose */
  1752. getPreferredSize : function() {
  1753. return this._spaceUsed;
  1754. },
  1755. /** @expose */
  1756. getSpillOverSize : function() {
  1757. return 0;
  1758. },
  1759. /** @expose */
  1760. visible : function(a0, a1) {
  1761. var args = arguments;
  1762. if (args.length == 1) {
  1763. return this.visible$1(a0);
  1764. }
  1765. return this.visible$0(a0, a1);
  1766. },
  1767. /** @expose */
  1768. preLayout : function(a0, a1) {
  1769. var args = arguments;
  1770. if (args.length == 1) {
  1771. return this.preLayout$0(a0);
  1772. }
  1773. return this.preLayout$1(a0, a1);
  1774. }
  1775. });
  1776. // $source: com/ibm/rave/bundles/utilities/FontPropertyParser
  1777. /************************************************************************
  1778. ** IBM Confidential
  1779. **
  1780. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1781. **
  1782. ** (C) Copyright IBM Corp. 2017
  1783. **
  1784. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1785. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1786. ************************************************************************/
  1787. // GENERATED
  1788. var com_ibm_rave_bundles_utilities_FontPropertyParser = rave['internal']['Declare']({
  1789. });
  1790. /**
  1791. * Method to parse the css font styles and return a style map.
  1792. * @param (String) fontStyle CSS string (eg. "font-family: courier; font-size: 22; fill: red")
  1793. * @return (Object) Font Style Map
  1794. */
  1795. /** @expose */
  1796. com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont = function(fontStyle) {
  1797. if (fontStyle != null && fontStyle.length > 0) {
  1798. var properties = fontStyle.split(new RegExp(";"));
  1799. var fontStyles = {};
  1800. for (var __i_enFor0 = 0, __len_enFor0 = properties.length;
  1801. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  1802. var property = properties[__i_enFor0];
  1803. var fontMap = property.split(new RegExp(":"));
  1804. if (fontMap.length == 2) {
  1805. var key = fontMap[0].trim();
  1806. fontStyles[key == "color" ? "fill" : key] = fontMap[1].trim();
  1807. }
  1808. }
  1809. return fontStyles;
  1810. }
  1811. return null;
  1812. };
  1813. // $source: com/ibm/rave/bundles/components/AxesManager
  1814. /************************************************************************
  1815. ** IBM Confidential
  1816. **
  1817. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1818. **
  1819. ** (C) Copyright IBM Corp. 2018
  1820. **
  1821. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1822. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1823. ************************************************************************/
  1824. // GENERATED
  1825. //@import com/ibm/rave/bundles/components/AxisComponentImpl (runtime) // new, getTranslation
  1826. //@import com/ibm/rave/bundles/components/GridComponentImpl (runtime) // new
  1827. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  1828. /**
  1829. * <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>
  1830. */
  1831. var com_ibm_rave_bundles_components_AxesManager = rave['internal']['Declare']({
  1832. /**
  1833. * Bundle context
  1834. */
  1835. //_context : null,
  1836. /**
  1837. * Selector for the bundle defs node. If null, no clip paths will be defined.
  1838. */
  1839. //_defs : null,
  1840. /**
  1841. * Scales for the axes, indexed by X1, X2, Y1, Y2
  1842. */
  1843. //_scales : null,
  1844. /**
  1845. * Whether to suppress labels when panning, indexed by X1, X2, Y1, Y2.
  1846. */
  1847. //_suppressPanLabels : null,
  1848. /**
  1849. * Value of the axis drawAxisLabels, set when axis is drawn, indexed by X1, X2, Y1, Y2.
  1850. */
  1851. //_drawAxisLabels : null,
  1852. /**
  1853. * Axis components created on demand, indexed by X1, X2, Y1, Y2
  1854. */
  1855. //_axisComponents : null,
  1856. /**
  1857. * When last drawn, the selector used for each axis role, indexed by X1, X2, Y1, Y2; used for redraws.
  1858. */
  1859. //_lastAxisDrawSelectors : null,
  1860. /**
  1861. * Grid components created on demand, indexed by X1, X2, Y1, Y2
  1862. */
  1863. //_gridComponents : null,
  1864. /**
  1865. * When last drawn, the selector used for each grid role, indexed by X1, X2, Y1, Y2; used for redraws.
  1866. */
  1867. //_lastGridDrawSelectors : null,
  1868. /**
  1869. * For clearing axis
  1870. */
  1871. //_clearAxis : null,
  1872. /**
  1873. * For clearing grid
  1874. */
  1875. //_clearGrid : null,
  1876. /**
  1877. * Selectors for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1878. */
  1879. //_axisSelectors : null,
  1880. /**
  1881. * Selectors for the grid groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1882. */
  1883. //_gridSelectors : null,
  1884. /**
  1885. * Bounding rectangles for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1886. */
  1887. //_axisRects : null,
  1888. /**
  1889. * Center elements bounds, also the grid bounds.
  1890. */
  1891. //_elementRect : null,
  1892. /**
  1893. * Whether anything was drawn into the axis group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1894. */
  1895. //_lastAxisDrew : null,
  1896. /**
  1897. * Whether anything was drawn into the grid group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1898. */
  1899. //_lastGridDrew : null,
  1900. //_dataSlotEntries : null,
  1901. //_layoutAxisOrder : null,
  1902. /**
  1903. * On the first draw, no transitions are used.
  1904. */
  1905. _firstDraw : false,
  1906. /**
  1907. * Whether to draw the axes and grids.
  1908. */
  1909. _visible : true,
  1910. /**
  1911. * Transition duration, ms
  1912. */
  1913. _duration : 0,
  1914. /**
  1915. * Transpose the axes (assign X to left/right and Y to top/bottom)
  1916. */
  1917. _transpose : false,
  1918. /**
  1919. * Switch the independent (X) axes, drawing X1 where X2 normally goes and vice-versa
  1920. */
  1921. _swapX : false,
  1922. /**
  1923. * Switch the dependent (Y) axes, drawing Y1 where Y2 normally goes and vice-versa
  1924. */
  1925. _swapY : false,
  1926. _layoutInProgress : false,
  1927. _layoutMaxWidth : 0,
  1928. _layoutMaxHeight : 0,
  1929. _xPadding : 0, _xOuterPadding : 0, _yPadding : 0, _yOuterPadding : 0,
  1930. _xPixelPad : 0, _yPixelPad : 0,
  1931. /**
  1932. * Hack to allow heatmap in "unit cell" mode to disable stagger because of the post scaling that messes up axis layout
  1933. */
  1934. _preventStaggerRotate45 : false,
  1935. constructor : function(context) {
  1936. this._scales = [];
  1937. this._suppressPanLabels = [];
  1938. this._drawAxisLabels = [];
  1939. this._axisComponents = [];
  1940. this._lastAxisDrawSelectors = [];
  1941. this._gridComponents = [];
  1942. this._lastGridDrawSelectors = [];
  1943. this._clearAxis = new com_ibm_rave_bundles_components_AxisComponentImpl();
  1944. this._clearGrid = new com_ibm_rave_bundles_components_GridComponentImpl();
  1945. this._axisSelectors = [];
  1946. this._gridSelectors = [];
  1947. this._axisRects = [];
  1948. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1949. this._lastAxisDrew = [];
  1950. this._lastGridDrew = [];
  1951. this._dataSlotEntries = [];
  1952. this._layoutAxisOrder = [];
  1953. /**
  1954. * Construct and initialize. No axis scales or selector groups are defined.
  1955. * @param (rave['library']['internal']['BundleContext']) context The bundle context
  1956. */
  1957. {
  1958. this._context = context;
  1959. for (var i = 0; i < 4; ++i) {
  1960. this._scales[i] = null;
  1961. this._suppressPanLabels[i] = false;
  1962. this._axisComponents[i] = null;
  1963. this._lastAxisDrawSelectors[i] = null;
  1964. this._gridComponents[i] = null;
  1965. this._lastGridDrawSelectors[i] = null;
  1966. this._axisSelectors[i] = null;
  1967. this._gridSelectors[i] = null;
  1968. this._axisRects[i] = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1969. this._lastAxisDrew[i] = false;
  1970. this._lastGridDrew[i] = false;
  1971. this._dataSlotEntries[i] = [];
  1972. }
  1973. }
  1974. },
  1975. /** @expose */
  1976. preLayout : function(layoutComponent, axesBeforeLegend, xPadding, xOuterPadding, xPixelPad, yPadding, yOuterPadding, yPixelPad) {
  1977. this._xPadding = xPadding;
  1978. this._xOuterPadding = xOuterPadding;
  1979. this._xPixelPad = xPixelPad;
  1980. this._yPadding = yPadding;
  1981. this._yOuterPadding = yOuterPadding;
  1982. this._yPixelPad = yPixelPad;
  1983. this._layoutInProgress = true;
  1984. var layoutDuration = this._duration;
  1985. this._duration = 0;
  1986. 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"];
  1987. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.axes-layout"), children);
  1988. var layoutAxisSelectors = [];
  1989. var layoutGridSelectors = [];
  1990. var layoutLastAxisDrew = [];
  1991. for (var position = 0; position < 4; ++position) {
  1992. if (this._axisComponents[position]) {
  1993. this._axisComponents[position].preLayout();
  1994. }
  1995. layoutAxisSelectors[position] = this._axisSelectors[position];
  1996. layoutGridSelectors[position] = this._gridSelectors[position];
  1997. layoutLastAxisDrew[position] = this._lastAxisDrew[position];
  1998. if (this._axisSelectors[position]) {
  1999. this.axisSelector(position, this._context.node.select("g.layoutAxis-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  2000. }
  2001. if (this._gridSelectors[position]) {
  2002. this.gridSelector(position, this._context.node.select("g.layoutGrid-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  2003. }
  2004. }
  2005. layoutComponent.preLayout(axesBeforeLegend, true);
  2006. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutComponent.elementRect());
  2007. var countHorz = 0;
  2008. var countVert = 0;
  2009. var axes = [];
  2010. for (var position = 0; position < 4; ++position) {
  2011. var role = this.positionToRole(position);
  2012. var isHorz = position == 1 || position == 0;
  2013. if (this._axisSelectors[position] && this._scales[role]) {
  2014. if (isHorz) {
  2015. countHorz++;
  2016. } else {
  2017. countVert++;
  2018. }
  2019. if (this._scales[role].isOrdinal() || this._scales[role].isClustered()) {
  2020. var score = isHorz ? 4 : 2;
  2021. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  2022. } else {
  2023. var score = isHorz ? 3 : 1;
  2024. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  2025. }
  2026. } else {
  2027. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, 5));
  2028. }
  2029. }
  2030. axes.sort(function(a1, a2) {
  2031. var a1value = a1.score;
  2032. var a2value = a2.score;
  2033. return a1value < a2value ? -1 : a1value > a2value ? 1 : 0;
  2034. });
  2035. this._layoutAxisOrder = [];
  2036. for (var i = 0; i < 4; ++i) {
  2037. this._layoutAxisOrder[i] = axes[i].position;
  2038. }
  2039. this._layoutMaxWidth = this._elementRect.width * (countVert > 1 ? 0.5 : 0.4);
  2040. this._layoutMaxHeight = this._elementRect.height * (countHorz > 1 ? 0.5 : 0.4);
  2041. for (var index = 0; index < 4; ++index) {
  2042. var position = this._layoutAxisOrder[index];
  2043. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], this._elementRect);
  2044. }
  2045. this.draw();
  2046. this._duration = layoutDuration;
  2047. this._context.node.select("g.axes-layout").selectAll("*").remove();
  2048. for (var position = 0; position < 4; ++position) {
  2049. this._lastAxisDrew[position] = layoutLastAxisDrew[position];
  2050. this._axisSelectors[position] = layoutAxisSelectors[position];
  2051. this._gridSelectors[position] = layoutGridSelectors[position];
  2052. }
  2053. this._layoutInProgress = false;
  2054. return this;
  2055. },
  2056. getPositionToDraw : function(index) {
  2057. return this._layoutInProgress ? this._layoutAxisOrder[index] : index;
  2058. },
  2059. preDrawAxis : function(index) {
  2060. if (this._layoutInProgress) {
  2061. var position = this._layoutAxisOrder[index];
  2062. var role = this.positionToRole(position);
  2063. if (role == 0 || role == 1) {
  2064. this.setScaleRangePadded(this._scales[role], false, this._xPadding, this._xOuterPadding, this._xPixelPad);
  2065. } else {
  2066. this.setScaleRangePadded(this._scales[role], true, this._yPadding, this._yOuterPadding, this._yPixelPad);
  2067. }
  2068. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(true);
  2069. }
  2070. },
  2071. postDrawAxis : function(index) {
  2072. if (this._layoutInProgress) {
  2073. var position = this._layoutAxisOrder[index];
  2074. var role = this.positionToRole(position);
  2075. var axis = this._axisComponents[role];
  2076. var size = axis.getPreferredSize();
  2077. if (position == 1 || position == 0) {
  2078. if (size > this._layoutMaxHeight) {
  2079. size = this._layoutMaxHeight;
  2080. }
  2081. this._elementRect.height -= size;
  2082. if (position == 1) {
  2083. this._elementRect.y += size;
  2084. }
  2085. } else {
  2086. if (size > this._layoutMaxWidth) {
  2087. size = this._layoutMaxWidth;
  2088. }
  2089. this._elementRect.width -= size;
  2090. if (position == 2) {
  2091. this._elementRect.x += size;
  2092. }
  2093. }
  2094. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2095. }
  2096. },
  2097. /**
  2098. * 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.
  2099. */
  2100. /** @expose */
  2101. draw : function() {
  2102. for (var role = 0; role < 4; ++role) {
  2103. this._lastAxisDrawSelectors[role] = null;
  2104. this._lastGridDrawSelectors[role] = null;
  2105. }
  2106. for (var index = 0; index < 4; ++index) {
  2107. var position = this.getPositionToDraw(index);
  2108. var role = this.positionToRole(position);
  2109. if (!this._visible || !this._axisSelectors[position] || !this._scales[role]) {
  2110. this.clearAxis(position);
  2111. this.clearGrid(position);
  2112. } else {
  2113. this.preDrawAxis(index);
  2114. this.drawAxis(position, role);
  2115. this.postDrawAxis(index);
  2116. if (this._gridSelectors[position]) {
  2117. this.drawGrid(position, role);
  2118. }
  2119. }
  2120. }
  2121. this._firstDraw = false;
  2122. },
  2123. /**
  2124. * @return (boolean) true if we are hiding any labels during pan-zoom.
  2125. */
  2126. /** @expose */
  2127. hideAnyPanZoom : function() {
  2128. return (this._suppressPanLabels[0] || this._suppressPanLabels[1] || this._suppressPanLabels[2] || this._suppressPanLabels[3]);
  2129. },
  2130. /**
  2131. * 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.
  2132. * @param (boolean) panning Whether this is a pan in-progress; use false otherwise including when pan-zoom ends.
  2133. */
  2134. /** @expose */
  2135. redraw : function(panning) {
  2136. for (var role = 0; role < 4; ++role) {
  2137. if (this._axisComponents[role] && this._lastAxisDrawSelectors[role]) {
  2138. this._axisComponents[role].displayTickLabels(this._drawAxisLabels[role]);
  2139. this._axisComponents[role].showPanZoomTickLabels(!panning || !this._suppressPanLabels[role]);
  2140. var isAllow = this._axisComponents[role].isAllowAutomaticAxisLayoutToChangeOrientation();
  2141. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2142. this._lastAxisDrawSelectors[role].call(this._axisComponents[role]);
  2143. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(isAllow);
  2144. }
  2145. if (this._gridComponents[role] && this._lastGridDrawSelectors[role]) {
  2146. this._lastGridDrawSelectors[role].call(this._gridComponents[role]);
  2147. }
  2148. }
  2149. },
  2150. /** @expose */
  2151. preventStaggerRotate45 : function(preventStaggerRotate45) {
  2152. this._preventStaggerRotate45 = preventStaggerRotate45;
  2153. },
  2154. /**
  2155. * 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.
  2156. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2157. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2158. */
  2159. drawAxis : function(position, role) {
  2160. var axisGroup = this._axisSelectors[position];
  2161. this._lastAxisDrawSelectors[role] = axisGroup;
  2162. var comp = this.axisComponent(role);
  2163. var layoutModeID = role == 2 ? "axis.y.labels.layoutMode" : role == 3 ? "axis.y2.labels.layoutMode" : "axis.x.labels.layoutMode";
  2164. var allowStaggerID = role == 2 ? "axis.y.labels.allowStagger" : role == 3 ? "axis.y2.labels.allowStagger" : "axis.x.labels.allowStagger";
  2165. var allowRotate45ID = role == 2 ? "axis.y.labels.allowRotate45" : role == 3 ? "axis.y2.labels.allowRotate45" : "axis.x.labels.allowRotate45";
  2166. var allowRotate90ID = role == 2 ? "axis.y.labels.allowRotate90" : role == 3 ? "axis.y2.labels.allowRotate90" : "axis.x.labels.allowRotate90";
  2167. var layoutMode = ""+(this._context.getPropertyValue(layoutModeID));
  2168. var allowStagger = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowStaggerID));
  2169. var allowRotate45 = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowRotate45ID));
  2170. var allowRotate90 = (this._context.getPropertyValue(allowRotate90ID));
  2171. var textTruncateIndicator = (this._context.getPropertyValue("axis.labels.truncationText"));
  2172. var axisBounds = this._axisRects[position];
  2173. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2174. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2175. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2176. 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);
  2177. this._drawAxisLabels[role] = comp._displayTickLabels;
  2178. var axisGroupUpdate = axisGroup;
  2179. if (this._duration > 0 && !this._firstDraw && this._lastAxisDrew[position]) {
  2180. axisGroupUpdate = axisGroup.transition().duration(this._duration);
  2181. }
  2182. axisGroupUpdate.attr("transform", axisTransform);
  2183. axisGroupUpdate.call(comp);
  2184. var dataSlotEntryList = this._dataSlotEntries[role];
  2185. axisGroup.selectAll(".axis-title").property("dataSlots", dataSlotEntryList);
  2186. this._lastAxisDrew[position] = comp.renderedShapes();
  2187. if (this._defs) {
  2188. var clipAxis = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this._context.instanceId() + "clip" + orient);
  2189. var text = axisGroup.append("text").text("000,000");
  2190. var bbox = text.node().getBBox();
  2191. var w = bbox.width;
  2192. var h = bbox.height;
  2193. text.remove();
  2194. var clipRect;
  2195. if (position == 0 || position == 1) {
  2196. var leftEdge = axisBounds.x + transform[0] * -1;
  2197. var rightEdge = leftEdge + axisBounds.width;
  2198. if (!(this._scales[role].isOrdinal()) && !(this._scales[role].isClustered())) {
  2199. var numericLeftEdge = this._elementRect.x - w + transform[0] * -1;
  2200. var numericRightEdge = numericLeftEdge + this._elementRect.width + w * 2;
  2201. if (numericLeftEdge < leftEdge) {
  2202. leftEdge = numericLeftEdge;
  2203. }
  2204. if (numericRightEdge > rightEdge) {
  2205. rightEdge = numericRightEdge;
  2206. }
  2207. }
  2208. clipRect = new rave['internal']['RectStruct'](leftEdge, axisBounds.y + transform[1] * -1, rightEdge - leftEdge, axisBounds.height);
  2209. } else {
  2210. clipRect = new rave['internal']['RectStruct'](axisBounds.x + transform[0] * -1, this._elementRect.y - h / 2 + transform[1] * -1, axisBounds.width, this._elementRect.height + h);
  2211. }
  2212. clipAxis.clipRect(clipRect).applyTo(axisGroup.select(".axis." + orient)).call(this._defs);
  2213. }
  2214. },
  2215. /**
  2216. * If the axis selector for the position is defined, clear the shapes from the axis group.
  2217. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2218. */
  2219. clearAxis : function(position) {
  2220. if (this._axisSelectors[position]) {
  2221. this._clearAxis.scale(null);
  2222. this._axisSelectors[position].call(this._clearAxis);
  2223. }
  2224. this._lastAxisDrew[position] = false;
  2225. },
  2226. /**
  2227. * 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.
  2228. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2229. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2230. */
  2231. drawGrid : function(position, role) {
  2232. var gridGroup = this._gridSelectors[position];
  2233. this._lastGridDrawSelectors[role] = gridGroup;
  2234. var comp = this.gridComponent(role);
  2235. var axisBounds = this._axisRects[position];
  2236. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2237. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2238. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2239. comp.setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).orient(orient).setPreExecute(this._context.getPreExecute()).bounds(this._elementRect).axis(this._axisComponents[role].axis());
  2240. if (this._duration <= 0 || this._firstDraw || !this._lastAxisDrew[position]) {
  2241. gridGroup.attr("transform", axisTransform).call(comp);
  2242. } else {
  2243. gridGroup.transition().duration(this._duration).attr("transform", axisTransform).call(comp);
  2244. }
  2245. this._lastGridDrew[position] = comp.renderedShapes();
  2246. },
  2247. /**
  2248. * If the grid selector for the position is defined, clear the shapes from the grid group.
  2249. * @param (int) position The grid position, BOTTOM, TOP, LEFT, RIGHT
  2250. */
  2251. clearGrid : function(position) {
  2252. if (this._gridSelectors[position]) {
  2253. this._clearGrid.axis(null);
  2254. this._gridSelectors[position].call(this._clearGrid);
  2255. }
  2256. this._lastGridDrew[position] = false;
  2257. },
  2258. /**
  2259. * @param (boolean) visible Whether the manager should draw axes
  2260. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2261. */
  2262. /** @expose */
  2263. visible : function(visible) {
  2264. this._visible = visible;
  2265. return this;
  2266. },
  2267. /**
  2268. * @param (int) duration The transition duration; if <= 0, no transition is used.
  2269. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2270. */
  2271. /** @expose */
  2272. duration : function(duration) {
  2273. this._duration = duration;
  2274. return this;
  2275. },
  2276. /**
  2277. * @param (boolean) transpose Whether to transpose the chart (switch the positions of the X and Y axis)
  2278. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2279. */
  2280. /** @expose */
  2281. transpose : function(transpose) {
  2282. this._transpose = transpose;
  2283. return this;
  2284. },
  2285. /**
  2286. * @param (boolean) swapX Whether to switch the postitions of the X1 and X2 axes
  2287. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2288. */
  2289. /** @expose */
  2290. swapX : function(swapX) {
  2291. this._swapX = swapX;
  2292. return this;
  2293. },
  2294. /**
  2295. * @param (boolean) swapY Whether to switch the postitions of the Y1 and Y2 axes
  2296. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2297. */
  2298. /** @expose */
  2299. swapY : function(swapY) {
  2300. this._swapY = swapY;
  2301. return this;
  2302. },
  2303. /**
  2304. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2305. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The coordinate scale for that role, may be null
  2306. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2307. */
  2308. /** @expose */
  2309. scale : function(role, scale) {
  2310. this._scales[role] = scale;
  2311. return this;
  2312. },
  2313. /**
  2314. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2315. * @param (boolean) suppressLabels Whether to suppress the labels when panning the axis
  2316. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2317. */
  2318. /** @expose */
  2319. suppressPanLabels : function(role, suppressLabels) {
  2320. this._suppressPanLabels[role] = suppressLabels;
  2321. return this;
  2322. },
  2323. /**
  2324. * 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.
  2325. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2326. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) The component for the role
  2327. */
  2328. /** @expose */
  2329. axisComponent : function(role) {
  2330. if (!this._axisComponents[role]) {
  2331. this._axisComponents[role] = new com_ibm_rave_bundles_components_AxisComponentImpl();
  2332. }
  2333. return this._axisComponents[role];
  2334. },
  2335. /**
  2336. * 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.
  2337. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2338. * @return (com.ibm.rave.bundles.components.GridComponentImpl) The component for the role
  2339. */
  2340. /** @expose */
  2341. gridComponent : function(role) {
  2342. if (!this._gridComponents[role]) {
  2343. this._gridComponents[role] = new com_ibm_rave_bundles_components_GridComponentImpl();
  2344. }
  2345. return this._gridComponents[role];
  2346. },
  2347. /**
  2348. * Set the bundle &lt;defs&gt; node. Clip paths will be defined in this node.
  2349. * @param (rave['internal']['Selector']) defs The defs node
  2350. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2351. */
  2352. /** @expose */
  2353. defsSelector : function(defs) {
  2354. this._defs = com_ibm_rave_bundles_components_AxesManager.checkSelector(defs);
  2355. return this;
  2356. },
  2357. /**
  2358. * Set the selector for an axis group node.
  2359. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2360. * @param (rave['internal']['Selector']) axisGroup The axis group node, may be null
  2361. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2362. */
  2363. /** @expose */
  2364. axisSelector : function(position, axisGroup) {
  2365. this._axisSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(axisGroup);
  2366. return this;
  2367. },
  2368. /**
  2369. * Set the selector for a grid group node.
  2370. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2371. * @param (rave['internal']['Selector']) gridGroup The grid group node, may be null
  2372. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2373. */
  2374. /** @expose */
  2375. gridSelector : function(position, gridGroup) {
  2376. this._gridSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(gridGroup);
  2377. return this;
  2378. },
  2379. /**
  2380. * Set the element (grid) bounds rectangle to a copy of the given rectangle.
  2381. * @param (rave['internal']['RectStruct']) elementRect The rectangle, if null the bounds are set to 0,0,0,0
  2382. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2383. */
  2384. /** @expose */
  2385. elementRect : function(elementRect) {
  2386. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, elementRect);
  2387. return this;
  2388. },
  2389. /**
  2390. * Set an axis bounds rectangle to a copy of the given rectangle.
  2391. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2392. * @param (rave['internal']['RectStruct']) axisRect The axis bounds, if null the bounds are set to 0,0,0,0
  2393. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2394. */
  2395. /** @expose */
  2396. axisRect : function(position, axisRect) {
  2397. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], axisRect);
  2398. return this;
  2399. },
  2400. /**
  2401. * 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.
  2402. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2403. */
  2404. /** @expose */
  2405. useDefaultSelectors : function() {
  2406. this.defsSelector(this._context.node.select("defs"));
  2407. this.axisSelector(0, this._context.node.select("g.axisTransform.bottom"));
  2408. this.axisSelector(1, this._context.node.select("g.axisTransform.top"));
  2409. this.axisSelector(2, this._context.node.select("g.axisTransform.left"));
  2410. this.axisSelector(3, this._context.node.select("g.axisTransform.right"));
  2411. this.gridSelector(0, this._context.node.select("g.grid.bottom"));
  2412. this.gridSelector(1, this._context.node.select("g.grid.top"));
  2413. this.gridSelector(2, this._context.node.select("g.grid.left"));
  2414. this.gridSelector(3, this._context.node.select("g.grid.right"));
  2415. return this;
  2416. },
  2417. /**
  2418. * Convenience method: Set the element rectangle and axis rectangles from the rectangles in the layout.
  2419. * @param (com.ibm.rave.bundles.components.ChartLayoutComponentImpl) layoutInfo Layout information
  2420. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2421. */
  2422. /** @expose */
  2423. useBoundsFromLayout : function(layoutInfo) {
  2424. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutInfo.elementRect());
  2425. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[0], layoutInfo.bottomRect());
  2426. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[1], layoutInfo.topRect());
  2427. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[2], layoutInfo.leftRect());
  2428. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[3], layoutInfo.rightRect());
  2429. return this;
  2430. },
  2431. /**
  2432. * 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.
  2433. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2434. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2435. */
  2436. /** @expose */
  2437. useDefaultX1Properties : function(setGridParameters) {
  2438. 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"))));
  2439. var titleFontStyle = (this._context.getPropertyValue("axis.x.title.style.font"));
  2440. var labelFontStyle = (this._context.getPropertyValue("axis.x.labels.style.font"));
  2441. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2442. this.axisComponent(0).labelStyle(labelFontStyle);
  2443. } else {
  2444. 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")));
  2445. }
  2446. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2447. this.axisComponent(0).titleStyle(titleFontStyle);
  2448. } else {
  2449. 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")));
  2450. }
  2451. if (setGridParameters) {
  2452. 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")));
  2453. }
  2454. this.suppressPanLabels(0, (this._context.getPropertyValue("axis.x.labels.zoomPan")));
  2455. return this;
  2456. },
  2457. /**
  2458. * 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.
  2459. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2460. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2461. */
  2462. /** @expose */
  2463. useDefaultY1Properties : function(setGridParameters) {
  2464. 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")));
  2465. var titleFontStyle = (this._context.getPropertyValue("axis.y.title.style.font"));
  2466. var labelFontStyle = (this._context.getPropertyValue("axis.y.labels.style.font"));
  2467. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2468. this.axisComponent(2).labelStyle(labelFontStyle);
  2469. } else {
  2470. 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")));
  2471. }
  2472. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2473. this.axisComponent(2).titleStyle(titleFontStyle);
  2474. } else {
  2475. 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")));
  2476. }
  2477. if (setGridParameters) {
  2478. 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")));
  2479. }
  2480. this.suppressPanLabels(2, (this._context.getPropertyValue("axis.y.labels.zoomPan")));
  2481. return this;
  2482. },
  2483. /**
  2484. * 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.
  2485. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2486. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2487. */
  2488. /** @expose */
  2489. useDefaultY2Properties : function(setGridParameters) {
  2490. 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")));
  2491. var titleFontStyle = (this._context.getPropertyValue("axis.y2.title.style.font"));
  2492. var labelFontStyle = (this._context.getPropertyValue("axis.y2.labels.style.font"));
  2493. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2494. this.axisComponent(3).labelStyle(labelFontStyle);
  2495. } else {
  2496. 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")));
  2497. }
  2498. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2499. this.axisComponent(3).titleStyle(titleFontStyle);
  2500. } else {
  2501. 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")));
  2502. }
  2503. if (setGridParameters) {
  2504. 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")));
  2505. }
  2506. this.suppressPanLabels(3, (this._context.getPropertyValue("axis.y2.labels.zoomPan")));
  2507. return this;
  2508. },
  2509. /**
  2510. * 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.
  2511. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2512. * @param (Array) entries Non-null list of data slot entries
  2513. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  2514. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined for the axis, may be null
  2515. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2516. */
  2517. /** @expose */
  2518. setTickFormatterList : function(role, entries, format, defaultFunction) {
  2519. var fmtRole;
  2520. switch (role) {
  2521. case 2:
  2522. fmtRole = "ROLE_Y1";
  2523. break;
  2524. case 1:
  2525. fmtRole = "ROLE_X2";
  2526. break;
  2527. case 3:
  2528. fmtRole = "ROLE_Y2";
  2529. break;
  2530. case 0:
  2531. default:
  2532. fmtRole = "ROLE_X1";
  2533. break;
  2534. }
  2535. 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);
  2536. this.axisComponent(role).tickFormat(fmt);
  2537. 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);
  2538. this.axisComponent(role).simplifiedTickFormat(simplefmt);
  2539. return this;
  2540. },
  2541. /**
  2542. * 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.
  2543. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2544. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  2545. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2546. */
  2547. /** @expose */
  2548. setTickFormatter : function(role, entry) {
  2549. var entries = [];
  2550. if (entry) {
  2551. entries.push(entry);
  2552. }
  2553. return this.setTickFormatterList(role, entries, "none", null);
  2554. },
  2555. /**
  2556. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined scale.
  2557. * @param (Number) padding Padding, relevant only for ordinal scales
  2558. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2559. * @param (int) pixelPad Pixel padding at each end
  2560. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2561. */
  2562. /** @expose */
  2563. setScaleRanges : function(padding, outerPadding, pixelPad) {
  2564. this.setIndependentScaleRanges(padding, outerPadding, pixelPad);
  2565. this.setDependentScaleRanges(padding, outerPadding, pixelPad);
  2566. return this;
  2567. },
  2568. /**
  2569. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2570. * @param (Number) padding Padding, relevant only for ordinal scales
  2571. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2572. * @param (int) pixelPad Pixel padding at each end
  2573. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2574. */
  2575. /** @expose */
  2576. setIndependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2577. this.setScaleRangePadded(this._scales[0], false, padding, outerPadding, pixelPad);
  2578. this.setScaleRangePadded(this._scales[1], false, padding, outerPadding, pixelPad);
  2579. return this;
  2580. },
  2581. /**
  2582. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2583. * @param (Number) padding Padding, relevant only for ordinal scales
  2584. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2585. * @param (int) pixelPad Pixel padding at each end
  2586. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2587. */
  2588. /** @expose */
  2589. setDependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2590. this.setScaleRangePadded(this._scales[2], true, padding, outerPadding, pixelPad);
  2591. this.setScaleRangePadded(this._scales[3], true, padding, outerPadding, pixelPad);
  2592. return this;
  2593. },
  2594. /**
  2595. * 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)} .
  2596. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2597. * @param (rave['library']['internal']['DataSlotEntry']) slot DataSlotEntry to be associated with the axis role.
  2598. */
  2599. setDataSlot$0 : function(role, slot) {
  2600. this.setDataSlot$1(role, [slot]);
  2601. return this;
  2602. },
  2603. /**
  2604. * Set a list of data slot entries that will be associated with the specified axis role.
  2605. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2606. * @param (Array) slots List of DataSlotEntry to be associated with the axis role.
  2607. */
  2608. setDataSlot$1 : function(role, slots) {
  2609. if (role < 4 && role >= 0) {
  2610. this._dataSlotEntries[role].length = 0;
  2611. if (slots) {
  2612. for (var __i_enFor0 = 0, __exp_enFor0 = slots, __len_enFor0 = __exp_enFor0.length;
  2613. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  2614. var slot = __exp_enFor0[__i_enFor0];
  2615. this._dataSlotEntries[role].push(slot);
  2616. }
  2617. }
  2618. }
  2619. return this;
  2620. },
  2621. /**
  2622. * </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.
  2623. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale Bundle independent scale
  2624. * @param (boolean) dependent Whether this is the dependent scale
  2625. * @param (Number) padding Padding, relevant only for ordinal scales
  2626. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2627. * @param (int) pixelPad Pixel padding at each end
  2628. */
  2629. setScaleRangePadded : function(scale, dependent, padding, outerPadding, pixelPad) {
  2630. if (scale) {
  2631. var min, max;
  2632. if (dependent == this._transpose) {
  2633. min = this._elementRect.x + pixelPad;
  2634. max = this._elementRect.x + this._elementRect.width - pixelPad;
  2635. } else {
  2636. if (scale.isContinuous()) {
  2637. min = this._elementRect.y + this._elementRect.height - pixelPad;
  2638. max = this._elementRect.y + pixelPad;
  2639. } else {
  2640. min = this._elementRect.y + pixelPad;
  2641. max = this._elementRect.y + this._elementRect.height - pixelPad;
  2642. }
  2643. }
  2644. scale.range(min, max, padding, outerPadding);
  2645. }
  2646. },
  2647. /**
  2648. * Given a geometric position BOTTOM, TOP, LEFT, or RIGHT, return the role X1, X2, Y1, or Y2 used by that role.
  2649. * @param (int) position The position index
  2650. * @return (int) The role index
  2651. */
  2652. positionToRole : function(position) {
  2653. var r = position;
  2654. if (this._transpose) {
  2655. r = (r + 2) % 4;
  2656. }
  2657. if (this._swapX && r < 2) {
  2658. r = 1 - r;
  2659. }
  2660. if (this._swapY && r > 1) {
  2661. r = 5 - r;
  2662. }
  2663. return r;
  2664. },
  2665. /**
  2666. * Given a role X1, X2, Y1, or Y2, return the geometric position BOTTOM, TOP, LEFT, or RIGHT for that role.
  2667. * @param (int) role The role index
  2668. * @return (int) The position index
  2669. */
  2670. roleToPosition : function(role) {
  2671. var p = role;
  2672. if (this._swapX && role < 2) {
  2673. p = 1 - p;
  2674. }
  2675. if (this._swapY && p > 1) {
  2676. p = 5 - p;
  2677. }
  2678. if (this._transpose) {
  2679. p = (p + 2) % 4;
  2680. }
  2681. return p;
  2682. },
  2683. /**
  2684. * Sets the magnitude for the tick interval.
  2685. * @param (int) role role index of the axis
  2686. * @param (Number) tickMagnitude power of 10
  2687. * @return (com.ibm.rave.bundles.components.AxesManager) this
  2688. */
  2689. /** @expose */
  2690. scaleTickMagnitude : function(role, tickMagnitude) {
  2691. this.axisComponent(role).scaleTickMagnitude(tickMagnitude);
  2692. return this;
  2693. },
  2694. /** @expose */
  2695. setDataSlot : function(a0, a1) {
  2696. var args = arguments;
  2697. if (args.length == 2 && typeof a1 === "function") {
  2698. return this.setDataSlot$0(a0, a1);
  2699. }
  2700. return this.setDataSlot$1(a0, a1);
  2701. }
  2702. });
  2703. /**
  2704. * @param (rave['internal']['Selector']) s A selector
  2705. * @return (rave['internal']['Selector']) s if it is non-null and has at least one node, null otherwise
  2706. */
  2707. com_ibm_rave_bundles_components_AxesManager.checkSelector = function(s) {
  2708. return s && !(s.empty()) ? s : null;
  2709. };
  2710. /**
  2711. * Set a rectangle to a copy of another. If the source is null, the target is set to 0,0,0,0
  2712. * @param (rave['internal']['RectStruct']) target A non-null rectangle
  2713. * @param (rave['internal']['RectStruct']) source A possibly-null rectnalge
  2714. */
  2715. com_ibm_rave_bundles_components_AxesManager.setRect = function(target, source) {
  2716. if (source) {
  2717. target.x = source.x;
  2718. target.y = source.y;
  2719. target.width = source.width;
  2720. target.height = source.height;
  2721. } else {
  2722. target.x = 0;
  2723. target.y = 0;
  2724. target.width = 0;
  2725. target.height = 0;
  2726. }
  2727. };
  2728. /**
  2729. * A ValueFunction that appends '%' to the value.
  2730. * @param (int) n Number of digits
  2731. */
  2732. /** @expose */
  2733. com_ibm_rave_bundles_components_AxesManager.percentFormat = function(n) {
  2734. var digits = "." + n + "f";
  2735. var format = rave.format(digits);
  2736. return function(value, ix, gix) {
  2737. return format.call(null, value, 0, 0) + "%";
  2738. };
  2739. };
  2740. /**
  2741. * Called prior to chart layout. Axes are configured with no real bounding constraints to calculate their preferred size.
  2742. */
  2743. com_ibm_rave_bundles_components_AxesManager.AxisLayout = rave['internal']['Declare']({
  2744. /** @expose */
  2745. position : 0,
  2746. /** @expose */
  2747. score : 0,
  2748. constructor : function(position, score) {
  2749. this.position = position;
  2750. this.score = score;
  2751. }
  2752. });
  2753. /**
  2754. * Logical first X (independent) axis, default position bottom
  2755. */
  2756. /** @expose */
  2757. com_ibm_rave_bundles_components_AxesManager.X1 = 0;
  2758. /**
  2759. * Logical second X (independent) axis, default position top
  2760. */
  2761. /** @expose */
  2762. com_ibm_rave_bundles_components_AxesManager.X2 = 1;
  2763. /**
  2764. * Logical first Y (dependent) axis, default position left
  2765. */
  2766. /** @expose */
  2767. com_ibm_rave_bundles_components_AxesManager.Y1 = 2;
  2768. /**
  2769. * Logical first Y (dependent) axis, default position right
  2770. */
  2771. /** @expose */
  2772. com_ibm_rave_bundles_components_AxesManager.Y2 = 3;
  2773. /**
  2774. * Geometric group on bottom
  2775. */
  2776. /** @expose */
  2777. com_ibm_rave_bundles_components_AxesManager.BOTTOM = 0;
  2778. /**
  2779. * Geometric group on top
  2780. */
  2781. /** @expose */
  2782. com_ibm_rave_bundles_components_AxesManager.TOP = 1;
  2783. /**
  2784. * Geometric group on left
  2785. */
  2786. /** @expose */
  2787. com_ibm_rave_bundles_components_AxesManager.LEFT = 2;
  2788. /**
  2789. * Geometric group on right
  2790. */
  2791. /** @expose */
  2792. com_ibm_rave_bundles_components_AxesManager.RIGHT = 3;
  2793. /**
  2794. * Maps the role indexes to the role strings used by the components API
  2795. */
  2796. com_ibm_rave_bundles_components_AxesManager.ROLES = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2797. /**
  2798. * Maps the role indexes to the role strings used by the custom formatter API. TODO: Unify the strings
  2799. */
  2800. com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2801. /**
  2802. * Maps the position indexes to the orient strings used by D3
  2803. */
  2804. com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS = ["bottom", "top", "left", "right"];
  2805. /**
  2806. * Maps the position indexes to the custom formatter strings
  2807. */
  2808. com_ibm_rave_bundles_components_AxesManager.FORMATTERS = ["bottom", "top", "left", "right"];
  2809. // $source: com/ibm/rave/bundles/component/AxisComponent
  2810. /************************************************************************
  2811. ** IBM Confidential
  2812. **
  2813. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2814. **
  2815. ** (C) Copyright IBM Corp. 2017
  2816. **
  2817. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2818. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2819. ************************************************************************/
  2820. // GENERATED
  2821. /**
  2822. * <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>
  2823. */
  2824. var com_ibm_rave_bundles_component_AxisComponent = rave['internal']['Declare'].implement(
  2825. /**
  2826. * @return (String) The role of the axis in the chart
  2827. */
  2828. //role : function() {},
  2829. /**
  2830. * @return (rave['internal']['Axis']) The capability Axis used by this AxisComponent
  2831. */
  2832. //axis : function() {},
  2833. /**
  2834. * The tickFormat is applied to the values of the ticks to create the string that is displayed.
  2835. * @param (rave['internal']['ValueFunction']) tickFormat The new tickFormat
  2836. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2837. */
  2838. //tickFormat : function(tickFormat) {},
  2839. /**
  2840. * Get the tickFormat function used by this component. May be null.
  2841. * @return (rave['internal']['ValueFunction']) Format function, or null
  2842. */
  2843. //tickFormat : function() {},
  2844. /**
  2845. * Set the indicator to be used for truncated text ex: indicator set to "..." , results in helloworld - > hello...
  2846. * @param (String) indicator the string to be placed to indicated truncated text
  2847. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2848. */
  2849. //textTruncateIndicator : function(indicator) {},
  2850. /**
  2851. * Whether to display the axis title.
  2852. * @param (boolean) displayAxisTitle true to display the axis title, false otherwise
  2853. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2854. */
  2855. //displayAxisTitle : function(displayAxisTitle) {},
  2856. /**
  2857. * Whether to display the axis line.
  2858. * @param (boolean) displayAxisLine true to display the axis line, false otherwise
  2859. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2860. */
  2861. //displayAxisLine : function(displayAxisLine) {},
  2862. /**
  2863. * Whether to display the axis tick marks.
  2864. * @param (boolean) displayTicks true to display the axis ticks, false otherwise
  2865. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2866. */
  2867. //displayTicks : function(displayTicks) {},
  2868. /**
  2869. * Whether to display the axis labels, as set by the show axis labels property
  2870. * @param (boolean) displayTickLabels true to display the axis tick labels, false otherwise
  2871. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2872. */
  2873. //displayTickLabels : function(displayTickLabels) {},
  2874. /**
  2875. * Whether to display the axis labels, as set by the hide pan-zoom labels property
  2876. * @param (boolean) showPanZoomTickLabels true to display the axis tick labels, false otherwise
  2877. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2878. */
  2879. //showPanZoomTickLabels : function(showPanZoomTickLabels) {},
  2880. /**
  2881. * @param (String) axisTitle The new axisTitle
  2882. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2883. */
  2884. //axisTitle : function(axisTitle) {},
  2885. /**
  2886. * 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)} .
  2887. * @param (String) axisColor The new line and tick color
  2888. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2889. */
  2890. //axisColor : function(axisColor) {},
  2891. /**
  2892. * The color used to draw the axis line.
  2893. * @param (String) lineColor The new lineColor
  2894. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2895. */
  2896. //lineColor : function(lineColor) {},
  2897. /**
  2898. * The color used to draw the axis ticks.
  2899. * @param (String) tickColor The new tickColor
  2900. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2901. */
  2902. //tickColor : function(tickColor) {},
  2903. /**
  2904. * The color used to draw the axis labels.
  2905. * @param (String) labelColor The new labelColor
  2906. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2907. */
  2908. //labelColor : function(labelColor) {},
  2909. /**
  2910. * The style for the axis labels.
  2911. * @param (String) fontStyle CSS string of font properties
  2912. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2913. */
  2914. //labelStyle : function(fontStyle) {},
  2915. /**
  2916. * The style for the axis labels.
  2917. * @param (String) fill The color used to draw the labels
  2918. * @param (String) fontSize CSS font size
  2919. * @param (String) fontFamily CSS font-families list
  2920. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2921. */
  2922. //labelStyle : function(fill, fontSize, fontFamily) {},
  2923. /**
  2924. * The color used to draw the axis title.
  2925. * @param (String) titleColor The new titleColor
  2926. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2927. */
  2928. //titleColor : function(titleColor) {},
  2929. /**
  2930. * The style for the axis title.
  2931. * @param (String) fontStyle CSS string of font properties
  2932. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2933. */
  2934. //titleStyle : function(fontStyle) {},
  2935. /**
  2936. * The style for the axis title.
  2937. * @param (String) fill The color used to draw the title
  2938. * @param (String) fontSize CSS font size
  2939. * @param (String) fontFamily CSS font-families list
  2940. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2941. */
  2942. //titleStyle : function(fill, fontSize, fontFamily) {}
  2943. );
  2944. /**
  2945. * The string returned by {@link #this.type()} is "AxisComponent".
  2946. */
  2947. /** @expose */
  2948. com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE = "AxisComponent";
  2949. /**
  2950. * Returned by {@link #this.role()} for the first independent axis.
  2951. */
  2952. /** @expose */
  2953. com_ibm_rave_bundles_component_AxisComponent.ROLE_X1 = "ROLE_X1";
  2954. /**
  2955. * Returned by {@link #this.role()} for the first dependent axis.
  2956. */
  2957. /** @expose */
  2958. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y1 = "ROLE_Y1";
  2959. /**
  2960. * Returned by {@link #this.role()} for the second independent axis.
  2961. */
  2962. /** @expose */
  2963. com_ibm_rave_bundles_component_AxisComponent.ROLE_X2 = "ROLE_X2";
  2964. /**
  2965. * Returned by {@link #this.role()} for the second dependent axis.
  2966. */
  2967. /** @expose */
  2968. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y2 = "ROLE_Y2";
  2969. // $source: com/ibm/rave/bundles/utilities/TextCrossfader
  2970. /************************************************************************
  2971. ** IBM Confidential
  2972. **
  2973. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2974. **
  2975. ** (C) Copyright IBM Corp. 2017
  2976. **
  2977. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2978. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2979. ************************************************************************/
  2980. // GENERATED
  2981. /**
  2982. * <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>
  2983. */
  2984. var com_ibm_rave_bundles_utilities_TextCrossfader = rave['internal']['Declare']({
  2985. });
  2986. /**
  2987. * <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!
  2988. * @param (rave['internal']['Selection']) selection Selection containing the single text node, may be a transition
  2989. * @param (String) oldText Old value of the text string, may be null
  2990. * @param (String) newText New value of the text string, may be null
  2991. * @param (Object) fillOpacity Fill opacity, may be null (in which case 1.0 is assumed)
  2992. * @param (double) delay Number between 0 and 0.5 controlling the timing of the fade
  2993. * @return (rave['internal']['Selection']) The selection, modified by the new text and fill-opacity
  2994. */
  2995. /** @expose */
  2996. com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade = function(selection, oldText, newText, fillOpacity, delay) {
  2997. if (!(selection.isTransition())) {
  2998. return selection.text(newText);
  2999. }
  3000. var _t = (selection).tween("text", function(data, index, groupIndex) {
  3001. return function(t) {
  3002. this.rave_setText(t < 0.5 ? oldText : newText);
  3003. };
  3004. });
  3005. var t0 = Math.max(0.0, Math.min(0.5, delay));
  3006. if (t0 == 0.5 || (oldText == null && newText == null) || (oldText != null && oldText == newText)) {
  3007. return selection;
  3008. }
  3009. var opacity = fillOpacity == null ? 1.0 : + (fillOpacity);
  3010. var tf = 1.0 / (0.5 - t0);
  3011. return _t.tween("fill-opacity", function(data, index, groupIndex) {
  3012. return function(t) {
  3013. if (t <= t0 || t >= (1.0 - t0)) {
  3014. this.rave_setStyle("fill-opacity", fillOpacity);
  3015. } else {
  3016. this.rave_setStyle("fill-opacity", opacity * Math.abs(t - 0.5) * tf);
  3017. }
  3018. };
  3019. });
  3020. };
  3021. // $source: com/ibm/rave/bundles/utilities/BundleLabelDropper
  3022. /************************************************************************
  3023. ** IBM Confidential
  3024. **
  3025. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3026. **
  3027. ** (C) Copyright IBM Corp. 2017
  3028. **
  3029. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3030. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3031. ************************************************************************/
  3032. // GENERATED
  3033. var com_ibm_rave_bundles_utilities_BundleLabelDropper = rave['internal']['Declare']({
  3034. //_dropOverlap : null,
  3035. labelCount : 0,
  3036. _$functionClassMethod : function() {
  3037. var _$self = function(args) {
  3038. if (args !== null || arguments.length > 1){
  3039. args = Array.prototype.slice.call(arguments, 0);
  3040. }
  3041. {
  3042. _$self.drop(args[0], ((args[1])));
  3043. return null;
  3044. }
  3045. };
  3046. return _$self;
  3047. },
  3048. /** @expose */
  3049. constructor : function() {
  3050. this._dropOverlap = (rave.capabilities.extension("position")).drop().remove(false);
  3051. this._dropOverlap.setOverlapGap(4.0);
  3052. },
  3053. /**
  3054. * Drop the overlapping labels or reset the overlap.
  3055. * @param (rave['internal']['Selection']) labels The selector for the labels
  3056. * @param (boolean) removeOverlap true to remove the overlapping labels, false to reset
  3057. */
  3058. /** @expose */
  3059. drop : function(labels, removeOverlap) {
  3060. if (!(labels.isTransition())) {
  3061. this.applyLabelDrop(labels, removeOverlap);
  3062. } else {
  3063. var steps = [0, 25, 75];
  3064. var self = this;
  3065. (labels).tween("__pointLabelDrop__", function(data, index, groupIndex) {
  3066. if (index == 0) {
  3067. return function(t) {
  3068. var currentStep = Math.floor(t * 100);
  3069. if (steps.length > 0 && currentStep < 100 && currentStep >= steps[0]) {
  3070. steps.splice(0, 1);
  3071. self.applyLabelDrop(labels, removeOverlap);
  3072. }
  3073. };
  3074. }
  3075. return null;
  3076. });
  3077. this.labelCount = 0;
  3078. (labels).each(function(data, index, groupIndex) {
  3079. ++self.labelCount;
  3080. }).each("end", function(args) {
  3081. if (args !== null || arguments.length > 1){
  3082. args = Array.prototype.slice.call(arguments, 0);
  3083. }
  3084. {
  3085. if (--self.labelCount == 0) {
  3086. self.applyLabelDrop(labels, removeOverlap);
  3087. }
  3088. return null;
  3089. }
  3090. });
  3091. }
  3092. },
  3093. applyLabelDrop : function(labels, removeOverlap) {
  3094. if (removeOverlap) {
  3095. labels.call(this._dropOverlap);
  3096. } else {
  3097. this._dropOverlap.reset(labels);
  3098. }
  3099. },
  3100. /** @expose */
  3101. configureForDataLabels : function(rect) {
  3102. if (rect) {
  3103. var ex = [[rect.x, rect.y], [rect.x + rect.width, rect.y + rect.height]];
  3104. this._dropOverlap.extent(ex);
  3105. }
  3106. this._dropOverlap.noClipping();
  3107. }
  3108. });
  3109. /**
  3110. * Drop overlap extension
  3111. */
  3112. //com_ibm_rave_bundles_utilities_BundleLabelDropper.POSITION_EXTENSION = "position";
  3113. /**
  3114. * space between labels during overlap testing
  3115. */
  3116. com_ibm_rave_bundles_utilities_BundleLabelDropper.OVERLAP_GAP = 4;
  3117. // $source: com/ibm/rave/bundles/components/StyleStructs
  3118. /************************************************************************
  3119. ** IBM Confidential
  3120. **
  3121. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3122. **
  3123. ** (C) Copyright IBM Corp. 2017
  3124. **
  3125. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3126. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3127. ************************************************************************/
  3128. // GENERATED
  3129. /**
  3130. * Struct classes to hold style properties.
  3131. */
  3132. var com_ibm_rave_bundles_components_StyleStructs = rave['internal']['Declare']({
  3133. });
  3134. /**
  3135. * Filled shape style properties.
  3136. */
  3137. com_ibm_rave_bundles_components_StyleStructs.ShapeStyle = function() {
  3138. this._fill = null;
  3139. this._stroke = null;
  3140. this._strokeWidth = null;
  3141. };
  3142. /**
  3143. * Line style properties.
  3144. */
  3145. com_ibm_rave_bundles_components_StyleStructs.LineStyle = function() {
  3146. this._stroke = null;
  3147. this._strokeWidth = null;
  3148. this._dashArray = null;
  3149. };
  3150. // $source: com/ibm/rave/bundles/component/GridComponent
  3151. /************************************************************************
  3152. ** IBM Confidential
  3153. **
  3154. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3155. **
  3156. ** (C) Copyright IBM Corp. 2017
  3157. **
  3158. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3159. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3160. ************************************************************************/
  3161. // GENERATED
  3162. /**
  3163. * <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>
  3164. */
  3165. var com_ibm_rave_bundles_component_GridComponent = rave['internal']['Declare'].implement(
  3166. /**
  3167. * @return (String) The role of the grid in the chart
  3168. */
  3169. //role : function() {},
  3170. /**
  3171. * Whether to display the gridlines.
  3172. * @param (boolean) displayGridlines The new displayGridlines
  3173. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3174. */
  3175. //displayGridlines : function(displayGridlines) {},
  3176. /**
  3177. * Set the line styling. Equivalent to calling {@link #this.gridlineColor(String)} and {@link #this.dashArray(String)} .
  3178. * @param (String) stroke The stroke color
  3179. * @param (String) dashArray The stroke-dasharray
  3180. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3181. */
  3182. //gridlineStyle : function(stroke, dashArray) {},
  3183. /**
  3184. * The color used to draw the gridlines.
  3185. * @param (String) gridlineColor The new stroke color
  3186. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3187. */
  3188. //gridlineColor : function(gridlineColor) {},
  3189. /**
  3190. * 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.
  3191. * @param (String) dashArray The new dash array
  3192. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3193. */
  3194. //dashArray : function(dashArray) {}
  3195. );
  3196. /**
  3197. * The string returned by {@link #this.type()} is "GridComponent".
  3198. */
  3199. /** @expose */
  3200. com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE = "GridComponent";
  3201. // $source: com/ibm/rave/bundles/components/IntervalDataUtilities
  3202. /************************************************************************
  3203. ** IBM Confidential
  3204. **
  3205. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3206. **
  3207. ** (C) Copyright IBM Corp. 2017
  3208. **
  3209. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3210. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3211. ************************************************************************/
  3212. // GENERATED
  3213. /**
  3214. * 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.
  3215. */
  3216. var com_ibm_rave_bundles_components_IntervalDataUtilities = rave['internal']['Declare']({
  3217. });
  3218. /**
  3219. * <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>
  3220. * @param (Array) data Data array
  3221. * @param (rave['internal']['SingleValueFunction']) x X accessor, should not be null
  3222. * @param (rave['internal']['SingleValueFunction']) xScale Function to check if the X value is valid
  3223. * @param (rave['internal']['SingleValueFunction']) y Y accessor, should not be null
  3224. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3225. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3226. * @return (Array) Array of intervals for the data
  3227. */
  3228. /** @expose */
  3229. com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars = function(data, x, xScale, y, yStart, color, label) {
  3230. var result = [];
  3231. if (!data || data.length == 0 || !x || !y) {
  3232. return result;
  3233. }
  3234. data.forEach(function(d, ix, list) {
  3235. var xv = x(d);
  3236. if (xv != null && (!xScale || xScale(xv) != null)) {
  3237. var yv = y(d);
  3238. var yvStart = !yStart ? 0 : yStart(d);
  3239. if (yv != null && yvStart != null) {
  3240. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3241. r.key = ix;
  3242. r.ind1 = xv;
  3243. r.ind2 = r.ind1;
  3244. r.cind = r.ind1;
  3245. r.dep1 = yvStart;
  3246. r.dep2 = yv;
  3247. r.cdep = r.dep2;
  3248. r.color = color ? color(d) : null;
  3249. r.label = label ? label(d) : null;
  3250. r.value = r.dep2;
  3251. r._originalData = d;
  3252. r.valueAsPercentOfCategory = 100;
  3253. result.push(r);
  3254. }
  3255. }
  3256. return null;
  3257. });
  3258. var sum = 0;
  3259. for (var i = 0; i < result.length; ++i) {
  3260. var iData = result[i];
  3261. var value = + (iData.value);
  3262. sum += Math.abs(value);
  3263. }
  3264. if (sum != 0) {
  3265. for (var i = 0; i < result.length; ++i) {
  3266. var iData = result[i];
  3267. var value = + (iData.value);
  3268. iData.valueAsPercentOfColor = value / sum * 100;
  3269. }
  3270. }
  3271. return result;
  3272. };
  3273. /**
  3274. * Create intervals for bars in a clustered chart. This is similar to the simple bars, except the independent values are an array of accessors.
  3275. * @param (Array) data Data array
  3276. * @param (Array) x Independent accessor array, should not be null and no entries should be null
  3277. * @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
  3278. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3279. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3280. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3281. * @return (Array) Array of intervals for the data
  3282. */
  3283. /** @expose */
  3284. com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars = function(data, x, xScale, y, yStart, color, label) {
  3285. var result = [];
  3286. if (!data || data.length == 0 || !x || x.length == 0 || !y) {
  3287. return result;
  3288. }
  3289. var len = x.length;
  3290. var categories = {};
  3291. var colors = {};
  3292. data.forEach(function(d, ix, list) {
  3293. var OK = true;
  3294. var ind = [];
  3295. for (var i = 0; i < len; ++i) {
  3296. var xv = x[i](d);
  3297. if (xv == null || (xScale[i] && xScale[i](xv) == null)) {
  3298. OK = false;
  3299. break;
  3300. }
  3301. ind.push(xv);
  3302. if (i == 0) {
  3303. if (!(categories.hasOwnProperty(xv))) {
  3304. categories[""+(xv)] = 1;
  3305. }
  3306. } else if (!(colors.hasOwnProperty(xv))) {
  3307. colors[""+(xv)] = 1;
  3308. }
  3309. }
  3310. var dep = y(d);
  3311. var depStart = !yStart ? 0 : yStart(d);
  3312. if (OK && dep != null && depStart != null) {
  3313. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3314. r.key = ix;
  3315. r.ind1 = ind;
  3316. r.ind2 = ind;
  3317. r.cind = ind;
  3318. r.dep1 = depStart;
  3319. r.dep2 = dep;
  3320. r.cdep = r.dep2;
  3321. r.color = color ? color(d) : null;
  3322. r.label = label ? label(d) : null;
  3323. r.value = r.dep2;
  3324. r._originalData = d;
  3325. result.push(r);
  3326. }
  3327. return null;
  3328. });
  3329. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3330. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3331. var o = __exp_enFor0[__i_enFor0];
  3332. var s = ""+(o);
  3333. var sum = 0;
  3334. for (var i = 0; i < result.length; ++i) {
  3335. var iData = result[i];
  3336. if (s == (iData.ind1)[0]) {
  3337. var value = + (iData.value);
  3338. sum += Math.abs(value);
  3339. }
  3340. }
  3341. if (sum == 0) {
  3342. continue;
  3343. }
  3344. for (var i = 0; i < result.length; ++i) {
  3345. var iData = result[i];
  3346. if (s == (iData.ind1)[0]) {
  3347. var value = + (iData.value);
  3348. iData.valueAsPercentOfCategory = value / sum * 100;
  3349. }
  3350. }
  3351. }
  3352. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3353. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3354. var o = __exp_enFor1[__i_enFor1];
  3355. var s = ""+(o);
  3356. var sum = 0;
  3357. for (var i = 0; i < result.length; ++i) {
  3358. var iData = result[i];
  3359. if (s == iData.color) {
  3360. var value = + (iData.value);
  3361. sum += Math.abs(value);
  3362. }
  3363. }
  3364. if (sum == 0) {
  3365. continue;
  3366. }
  3367. for (var i = 0; i < result.length; ++i) {
  3368. var iData = result[i];
  3369. if (s == iData.color) {
  3370. var value = + (iData.value);
  3371. iData.valueAsPercentOfColor = value / sum * 100;
  3372. }
  3373. }
  3374. }
  3375. return result;
  3376. };
  3377. /**
  3378. * 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.
  3379. * @param (Array) data Data array
  3380. * @param (rave['internal']['SingleValueFunction']) x Independent accessor, should not be null
  3381. * @param (rave['internal']['SingleValueFunction']) xScale Possibly-null function to check if X values are in domain
  3382. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3383. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3384. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3385. * @param (boolean) percent If true, create percent bars
  3386. * @return (Array) Array of intervals for the data
  3387. */
  3388. /** @expose */
  3389. com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars = function(data, x, xScale, y, color, label, percent) {
  3390. var result = [];
  3391. if (!data || data.length == 0 || !x || !y) {
  3392. return result;
  3393. }
  3394. var stacks = {};
  3395. var categories = {};
  3396. var colors = {};
  3397. data.forEach(function(d, ix, list) {
  3398. var xv = x(d);
  3399. if (xv != null && (!xScale || xScale(xv) != null)) {
  3400. var yv = y(d);
  3401. if (yv != null) {
  3402. var stack = stacks[xv];
  3403. if (!stack) {
  3404. stack = new com_ibm_rave_bundles_components_IntervalDataUtilities.Stack();
  3405. stacks[xv] = stack;
  3406. }
  3407. var dVal = + (yv);
  3408. if (!percent) {
  3409. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3410. r.key = ix;
  3411. r.ind1 = xv;
  3412. r.ind2 = xv;
  3413. r.cind = xv;
  3414. var sum = dVal < 0.0 ? stack.negativeSum : stack.positiveSum;
  3415. r.dep1 = sum;
  3416. r.dep2 = sum + dVal;
  3417. r.cdep = r.dep2;
  3418. r.color = color ? color(d) : null;
  3419. r.label = label ? label(d) : null;
  3420. r.value = dVal;
  3421. r._originalData = d;
  3422. result.push(r);
  3423. }
  3424. if (dVal < 0.0) {
  3425. stack.negativeSum += dVal;
  3426. } else {
  3427. stack.positiveCount++;
  3428. stack.positiveSum += dVal;
  3429. }
  3430. if (!(categories.hasOwnProperty(xv))) {
  3431. categories[""+(xv)] = 1;
  3432. }
  3433. if (color) {
  3434. var o = color(d);
  3435. if ((o != null) && !(colors.hasOwnProperty(o))) {
  3436. colors[""+(o)] = 1;
  3437. }
  3438. }
  3439. }
  3440. }
  3441. return null;
  3442. });
  3443. if (percent) {
  3444. data.forEach(function(d, ix, list) {
  3445. var xv = x(d);
  3446. if (xv != null && (!xScale || xScale(xv) != null)) {
  3447. var yv = y(d);
  3448. if (yv != null) {
  3449. var stack = stacks[xv];
  3450. var dVal = + (yv);
  3451. var percent;
  3452. if (dVal < 0.0) {
  3453. percent = -100.0 * dVal / stack.negativeSum;
  3454. } else if (stack.positiveSum > 0) {
  3455. percent = 100.0 * dVal / stack.positiveSum;
  3456. } else {
  3457. percent = 100.0 / stack.positiveCount;
  3458. }
  3459. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3460. r.key = ix;
  3461. r.ind1 = xv;
  3462. r.ind2 = xv;
  3463. r.cind = xv;
  3464. var sum = dVal < 0.0 ? stack.negativePercent : stack.positivePercent;
  3465. r.dep1 = sum;
  3466. r.dep2 = sum + percent;
  3467. r.cdep = r.dep2;
  3468. r.color = color ? color(d) : null;
  3469. r.label = label ? label(d) : null;
  3470. r.value = dVal;
  3471. r.valueAsPercentOfCategory = percent;
  3472. r._originalData = d;
  3473. result.push(r);
  3474. if (dVal < 0.0) {
  3475. stack.negativePercent += percent;
  3476. } else {
  3477. stack.positivePercent += percent;
  3478. }
  3479. }
  3480. }
  3481. return null;
  3482. });
  3483. } else {
  3484. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3485. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3486. var o = __exp_enFor0[__i_enFor0];
  3487. var s = ""+(o);
  3488. var sum = 0;
  3489. for (var i = 0; i < result.length; ++i) {
  3490. var iData = result[i];
  3491. if (s == iData.ind1) {
  3492. var value = + (iData.value);
  3493. sum += Math.abs(value);
  3494. }
  3495. }
  3496. if (sum == 0) {
  3497. continue;
  3498. }
  3499. for (var i = 0; i < result.length; ++i) {
  3500. var iData = result[i];
  3501. if (s == iData.ind1) {
  3502. var value = + (iData.value);
  3503. iData.valueAsPercentOfCategory = value / sum * 100;
  3504. }
  3505. }
  3506. }
  3507. }
  3508. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3509. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3510. var o = __exp_enFor1[__i_enFor1];
  3511. var s = ""+(o);
  3512. var sum = 0;
  3513. for (var i = 0; i < result.length; ++i) {
  3514. var iData = result[i];
  3515. if (s == iData.color) {
  3516. var value = + (iData.value);
  3517. sum += Math.abs(value);
  3518. }
  3519. }
  3520. if (sum == 0) {
  3521. continue;
  3522. }
  3523. for (var i = 0; i < result.length; ++i) {
  3524. var iData = result[i];
  3525. if (s == iData.color) {
  3526. var value = + (iData.value);
  3527. iData.valueAsPercentOfColor = value / sum * 100;
  3528. }
  3529. }
  3530. }
  3531. return result;
  3532. };
  3533. /**
  3534. * Structure class holding interval information.
  3535. */
  3536. com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData = rave['internal']['Declare']({
  3537. /**
  3538. * Key value; for now this is the data index
  3539. */
  3540. /** @expose */
  3541. key : null,
  3542. /**
  3543. * First independent value
  3544. */
  3545. /** @expose */
  3546. ind1 : null,
  3547. /**
  3548. * Second independent value (in all current uses, same as ind1)
  3549. */
  3550. /** @expose */
  3551. ind2 : null,
  3552. /**
  3553. * First dependent value
  3554. */
  3555. /** @expose */
  3556. dep1 : null,
  3557. /**
  3558. * Second dependent value
  3559. */
  3560. /** @expose */
  3561. dep2 : null,
  3562. /**
  3563. * The data value that the interval represents. Not the pixel value. Used in stacked chart
  3564. */
  3565. /** @expose */
  3566. value : null,
  3567. /**
  3568. * Color value
  3569. */
  3570. /** @expose */
  3571. color : null,
  3572. /**
  3573. * Label value
  3574. */
  3575. /** @expose */
  3576. label : null,
  3577. /**
  3578. * Callout independent value (in all current uses, same as ind1)
  3579. */
  3580. /** @expose */
  3581. cind : null,
  3582. /**
  3583. * Callout dependent value (dependent extent)
  3584. */
  3585. /** @expose */
  3586. cdep : null,
  3587. /** @expose */
  3588. _originalData : null,
  3589. /**
  3590. * The data value (in percentage) for specific category
  3591. */
  3592. /** @expose */
  3593. valueAsPercentOfCategory : NaN,
  3594. /**
  3595. * The data value (in percentage) across all categories
  3596. */
  3597. /** @expose */
  3598. valueAsPercentOfColor : NaN,
  3599. /** @expose */
  3600. originalData : function() {
  3601. return this._originalData;
  3602. },
  3603. /** @expose */
  3604. originalDataList : function() {
  3605. var list = [];
  3606. list.push(this._originalData);
  3607. return list;
  3608. }
  3609. });
  3610. com_ibm_rave_bundles_components_IntervalDataUtilities.Stack = function() {
  3611. this.positiveCount = 0;
  3612. this.positiveSum = 0;
  3613. this.negativeSum = 0;
  3614. this.positivePercent = 0;
  3615. this.negativePercent = 0;
  3616. };
  3617. /**
  3618. * Accessor for the callout dependent value
  3619. */
  3620. /** @expose */
  3621. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_DEPENDENT_ACCESSOR = function(data) {
  3622. return (data).cdep;
  3623. };
  3624. /**
  3625. * Accessor for the callout independent value
  3626. */
  3627. /** @expose */
  3628. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_INDEPENDENT_ACCESSOR = function(data) {
  3629. return (data).cind;
  3630. };
  3631. /**
  3632. * Accessor for the data value
  3633. */
  3634. /** @expose */
  3635. com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR = function(data) {
  3636. return (data).value;
  3637. };
  3638. /**
  3639. * Accessor for data value as percent of category
  3640. */
  3641. /** @expose */
  3642. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(data) {
  3643. var percent = (data).valueAsPercentOfCategory;
  3644. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3645. };
  3646. /**
  3647. * Accessor for data value as percent of color (series)
  3648. */
  3649. /** @expose */
  3650. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(data) {
  3651. var percent = (data).valueAsPercentOfColor;
  3652. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3653. };
  3654. // $source: com/ibm/rave/bundles/data/PointDataUtilities
  3655. /************************************************************************
  3656. ** IBM Confidential
  3657. **
  3658. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3659. **
  3660. ** (C) Copyright IBM Corp. 2017
  3661. **
  3662. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3663. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3664. ************************************************************************/
  3665. // GENERATED
  3666. /**
  3667. * Utility class for building arrays of point datum objects from tabular data.
  3668. */
  3669. var com_ibm_rave_bundles_data_PointDataUtilities = rave['internal']['Declare']({
  3670. });
  3671. /**
  3672. * <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>
  3673. * @param (Array) data Input data, list of arbitrary objects
  3674. * @param (rave['internal']['SingleValueFunction']) xAccessor X accessor function, may be null
  3675. * @param (rave['internal']['SingleValueFunction']) xScale Scale to test if the X value should be included, may be null
  3676. * @param (rave['internal']['SingleValueFunction']) yAccessor Y accessor function, may be null
  3677. * @param (rave['internal']['SingleValueFunction']) yScale Scale to test if the Y value should be included, may be null
  3678. * @return (Array) List of PointData objects
  3679. */
  3680. /** @expose */
  3681. com_ibm_rave_bundles_data_PointDataUtilities.buildPoints = function(data, xAccessor, xScale, yAccessor, yScale) {
  3682. var result = [];
  3683. if (data) {
  3684. for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
  3685. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3686. var o = __exp_enFor0[__i_enFor0];
  3687. if (o != null) {
  3688. var xv = null;
  3689. if (xAccessor) {
  3690. xv = xAccessor(o);
  3691. if (xv == null || (xScale && xScale(xv) == null)) {
  3692. continue;
  3693. }
  3694. }
  3695. var yv = null;
  3696. if (yAccessor) {
  3697. yv = yAccessor(o);
  3698. if (yv == null || (yScale && yScale(yv) == null)) {
  3699. continue;
  3700. }
  3701. }
  3702. var datum = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
  3703. datum._x = xv;
  3704. datum._y = yv;
  3705. datum._originalData = o;
  3706. result.push(datum);
  3707. }
  3708. }
  3709. }
  3710. return result;
  3711. };
  3712. /**
  3713. * 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.
  3714. */
  3715. com_ibm_rave_bundles_data_PointDataUtilities.PointDatum = rave['internal']['Declare']({
  3716. /**
  3717. * The X value
  3718. */
  3719. /** @expose */
  3720. _x : null,
  3721. /**
  3722. * The Y value
  3723. */
  3724. /** @expose */
  3725. _y : null,
  3726. /**
  3727. * The data value (in percentage) that the point represents
  3728. */
  3729. /** @expose */
  3730. _yAsPercentOfCategory : null,
  3731. /**
  3732. * The data value (in percentage) that the point represents
  3733. */
  3734. /** @expose */
  3735. _yAsPercentOfColor : null,
  3736. /**
  3737. * The original data
  3738. */
  3739. /** @expose */
  3740. _originalData : null,
  3741. /** @expose */
  3742. originalData : function() {
  3743. return this._originalData;
  3744. },
  3745. /** @expose */
  3746. originalDataList : function() {
  3747. var list = [];
  3748. list.push(this._originalData);
  3749. return list;
  3750. }
  3751. });
  3752. /**
  3753. * Accessor returning the _x property of a PointDatum.
  3754. */
  3755. /** @expose */
  3756. com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR = function(d) {
  3757. return (d)._x;
  3758. };
  3759. /**
  3760. * Accessor returning the _y property of a PointDatum.
  3761. */
  3762. /** @expose */
  3763. com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR = function(d) {
  3764. return (d)._y;
  3765. };
  3766. /**
  3767. * Accessor returning the _yAsPercentOfCategory property of a PointDatum.
  3768. */
  3769. /** @expose */
  3770. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(d) {
  3771. var percent = + ((d)._yAsPercentOfCategory);
  3772. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3773. };
  3774. /**
  3775. * Accessor returning the _yAsPercentOfColor property of a PointDatum.
  3776. */
  3777. /** @expose */
  3778. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(d) {
  3779. var percent = + ((d)._yAsPercentOfColor);
  3780. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3781. };
  3782. // $source: com/ibm/rave/bundles/utilities/ColorUtil
  3783. /************************************************************************
  3784. ** IBM Confidential
  3785. **
  3786. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3787. **
  3788. ** (C) Copyright IBM Corp. 2017
  3789. **
  3790. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3791. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3792. ************************************************************************/
  3793. // GENERATED
  3794. var com_ibm_rave_bundles_utilities_ColorUtil = rave['internal']['Declare']({
  3795. });
  3796. /**
  3797. * It is used to get a foreground color which has atleast a 4.5 contrast ratio with the background color.
  3798. * @param (Object) bg bakground color
  3799. * @param (Object) fg foreground color
  3800. * @return (Object) a color ( darker/ligher/same fg color ) which contrast with background.
  3801. */
  3802. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0 = function(bg, fg) {
  3803. var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(bg, fg);
  3804. if (contrastRatio < 4.5) {
  3805. var bgHSL = rave.hsl(bg);
  3806. var fgHSL = rave.hsl(fg);
  3807. 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);
  3808. if (brightness > 0.5) {
  3809. if (bgHSL.getL() > 0.5) {
  3810. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), bgHSL.getL() - 0.4));
  3811. } else {
  3812. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), 0.1));
  3813. }
  3814. } else {
  3815. if (bgHSL.getL() < 0.5) {
  3816. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), bgHSL.getL() + 0.4));
  3817. } else {
  3818. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), 0.9));
  3819. }
  3820. }
  3821. }
  3822. return fg;
  3823. };
  3824. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1 = function(labelColor) {
  3825. var labelRGB = rave.rgb(labelColor);
  3826. return labelRGB.contrastShift(21);
  3827. };
  3828. /** @expose */
  3829. com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio = function(colorA, colorB) {
  3830. var foregroundLuminance = rave.rgb(colorA).getLuminance();
  3831. var backgroundLuminance = rave.rgb(colorB).getLuminance();
  3832. var contrastRatio = (foregroundLuminance >= backgroundLuminance) ? (foregroundLuminance + 0.05) / (backgroundLuminance + 0.05) : (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
  3833. return contrastRatio;
  3834. };
  3835. /** @expose */
  3836. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor = function(a0, a1) {
  3837. var args = arguments;
  3838. if (args.length == 1) {
  3839. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1(a0);
  3840. }
  3841. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0(a0, a1);
  3842. };
  3843. // $source: com/ibm/rave/bundles/component/IntervalComponent
  3844. /************************************************************************
  3845. ** IBM Confidential
  3846. **
  3847. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3848. **
  3849. ** (C) Copyright IBM Corp. 2017
  3850. **
  3851. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3852. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3853. ************************************************************************/
  3854. // GENERATED
  3855. /**
  3856. * <p> A component that renders interval elements (rectangles based on data, showing an extent in both X and Y dimensions, as in a bar chart). The {@link #this.type()} method returns "IntervalComponent". </p>
  3857. */
  3858. var com_ibm_rave_bundles_component_IntervalComponent = rave['internal']['Declare'].implement(
  3859. /**
  3860. * Turn labels on or off. If labels are on but there is no label data, empty text nodes will be created.
  3861. * @param (boolean) itemLabel Whether to use labels
  3862. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  3863. */
  3864. //itemLabel : function(itemLabel) {},
  3865. /**
  3866. * @param (boolean) _itemOverlap Whether to show/hide overlap labels
  3867. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  3868. */
  3869. //itemOverlap : function(_itemOverlap) {},
  3870. /**
  3871. * Sets function that will specify position of item label for given chart element.
  3872. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  3873. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  3874. */
  3875. //itemLabelPosition : function(labelPosition) {},
  3876. /**
  3877. * Set the border width, which is also the stroke width.
  3878. * @param (String) width
  3879. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  3880. */
  3881. //borderWidth : function(width) {},
  3882. /**
  3883. * Set the border color.
  3884. * @param (String) borderColor
  3885. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  3886. */
  3887. //borderColor : function(borderColor) {},
  3888. /**
  3889. * Set the classname of the labellayer
  3890. * @param (String) string
  3891. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  3892. */
  3893. //labelLayerClassName : function(string) {},
  3894. /**
  3895. * Set the classname of the elementlayer
  3896. * @param (String) string
  3897. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  3898. */
  3899. //elementLayerClassName : function(string) {},
  3900. /**
  3901. * @param bounds The bounds of the chart area.
  3902. */
  3903. //bounds : function(chartRect) {}
  3904. );
  3905. /**
  3906. * The string returned by {@link #this.type()} is "IntervalComponent".
  3907. */
  3908. /** @expose */
  3909. com_ibm_rave_bundles_component_IntervalComponent.COMPONENT_TYPE = "IntervalComponent";
  3910. // $source: com/ibm/rave/bundles/utilities/LabelStyleUtil
  3911. /************************************************************************
  3912. ** IBM Confidential
  3913. **
  3914. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3915. **
  3916. ** (C) Copyright IBM Corp. 2017
  3917. **
  3918. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3919. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3920. ************************************************************************/
  3921. // GENERATED
  3922. //@import com/ibm/rave/bundles/components/FilterComponentImpl (runtime) // new
  3923. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor, getContrastRatio
  3924. /**
  3925. * This class can be used to apply styles on labels. Eg: when we need to overrule the given label style properties.
  3926. */
  3927. var com_ibm_rave_bundles_utilities_LabelStyleUtil = rave['internal']['Declare']({
  3928. //_labelFontStyle : null,
  3929. //_contrastLabelColorfilter : null,
  3930. //_sameLabelColorfilter : null,
  3931. /**
  3932. * eg: apply contrast label color with background. apply different font size for each level label. apply a contrast shadow for a label.
  3933. */
  3934. //_labelFillColor : null,
  3935. //_labelFontSize : null,
  3936. _labelShadow : false,
  3937. _$functionClassMethod : function() {
  3938. var _$self = function(args) {
  3939. if (args !== null || arguments.length > 1){
  3940. args = Array.prototype.slice.call(arguments, 0);
  3941. }
  3942. {
  3943. if (_$self._labelFontStyle) {
  3944. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(_$self._labelFontStyle), __len_enFor0 = __exp_enFor0.length;
  3945. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3946. var stylenName = __exp_enFor0[__i_enFor0];
  3947. if ((stylenName == "fill" || stylenName == "color" && _$self._labelFillColor) || (stylenName == "font-size" && _$self._labelFontSize) || (stylenName == "text-shadow" && _$self._labelShadow == true)) {
  3948. continue;
  3949. }
  3950. this.style(stylenName, _$self._labelFontStyle[stylenName]);
  3951. }
  3952. }
  3953. if (_$self._labelFillColor) {
  3954. this.style("fill", _$self._labelFillColor);
  3955. }
  3956. if (_$self._labelFontSize) {
  3957. this.style("font-size", _$self._labelFontSize);
  3958. }
  3959. var labels = this.selectAll("*");
  3960. if (labels.length == 0) {
  3961. labels = this;
  3962. }
  3963. if (_$self._labelShadow) {
  3964. var self = _$self;
  3965. var defaultLabelFill = _$self.getDefaultLabelColor(_$self._labelFontStyle);
  3966. _$self._contrastLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("contrast_label_drop_shadow");
  3967. _$self._contrastLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill)));
  3968. _$self._sameLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("same_label_drop_shadow");
  3969. _$self._sameLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(defaultLabelFill));
  3970. var owner = this.node().rave_getOwner();
  3971. rave.select(owner).select("defs").call(_$self._contrastLabelColorfilter);
  3972. rave.select(owner).select("defs").call(_$self._sameLabelColorfilter);
  3973. this.each(function(data, index, groupIndex) {
  3974. if (self._labelFillColor) {
  3975. var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(rave.rgb(self._labelFillColor.call(this, data, index, groupIndex)), defaultLabelFill);
  3976. if (contrastRatio < 4.5) {
  3977. this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
  3978. } else {
  3979. this.setAttribute("filter", "url(#" + self._sameLabelColorfilter.getId() + ")");
  3980. }
  3981. } else {
  3982. this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
  3983. }
  3984. });
  3985. labels.each(function(data, index, groupIndex) {
  3986. if (self._labelFillColor) {
  3987. this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._labelFillColor.call(this, data, index, groupIndex)).toString());
  3988. } else {
  3989. this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill).toString());
  3990. }
  3991. });
  3992. } else {
  3993. labels.each(function(data, index, groupIndex) {
  3994. this.rave_setProperty("_rave_drop_shadow", null);
  3995. });
  3996. this.attr("filter", null);
  3997. }
  3998. return null;
  3999. }
  4000. };
  4001. return _$self;
  4002. },
  4003. /** @expose */
  4004. labelFont : function(labelFontStyle) {
  4005. this._labelFontStyle = labelFontStyle;
  4006. return this;
  4007. },
  4008. /** @expose */
  4009. labelFillColor : function(_labelFillColor) {
  4010. this._labelFillColor = _labelFillColor;
  4011. return this;
  4012. },
  4013. /** @expose */
  4014. labelFontSize : function(_labelFontSize) {
  4015. this._labelFontSize = _labelFontSize;
  4016. return this;
  4017. },
  4018. /** @expose */
  4019. labelShadow : function(labelShadow) {
  4020. this._labelShadow = labelShadow;
  4021. return this;
  4022. },
  4023. /** @expose */
  4024. getDefaultLabelColor : function(_labelStyle) {
  4025. if (!_labelStyle) {
  4026. return "#000000";
  4027. }
  4028. var defaultFillColor;
  4029. if (_labelStyle) {
  4030. defaultFillColor = _labelStyle["fill"];
  4031. if (defaultFillColor == null) {
  4032. defaultFillColor = _labelStyle["color"];
  4033. }
  4034. }
  4035. if (defaultFillColor == null) {
  4036. defaultFillColor = "#000000";
  4037. }
  4038. return defaultFillColor.toString();
  4039. }
  4040. });
  4041. // $source: com/ibm/rave/bundles/components/ComponentConfiguration
  4042. /************************************************************************
  4043. ** IBM Confidential
  4044. **
  4045. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4046. **
  4047. ** (C) Copyright IBM Corp. 2017
  4048. **
  4049. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4050. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4051. ************************************************************************/
  4052. // GENERATED
  4053. /**
  4054. * 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"} .
  4055. */
  4056. var com_ibm_rave_bundles_components_ComponentConfiguration = rave['internal']['Declare']({
  4057. //constructor : function() {}
  4058. });
  4059. /**
  4060. * <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>
  4061. * @param (rave['internal']['Selection']) chart Selection on which to run the zoom, may be null
  4062. * @param (rave['internal']['Zoom']) zoom The Zoom; if null one is created and returned
  4063. * @param (rave['library']['internal']['CoordinateScaleImpl']) xScale X dimension scale, may be null
  4064. * @param (rave['library']['internal']['CoordinateScaleImpl']) yScale Y dimension scale, may be null
  4065. * @param (rave['library']['internal']['CoordinateScaleImpl']) x2Scale X2 dimension scale, may be null
  4066. * @param (rave['library']['internal']['CoordinateScaleImpl']) y2Scale Y2 dimension scale, may be null
  4067. * @param (Array) scaleExtent Scale extent, may be null; if null the range 0.2 to 5.0 is used
  4068. * @param (rave['internal']['RectStruct']) chartRect The rectangle of the chart
  4069. * @param (double[]) p the zoom translate position (x, y, x2, y2)
  4070. * @param (double[]) s the zoom scale (x, y, x2, y2)
  4071. * @param (String) zoomOps The zoom operation (x|y|x2|y2|all)
  4072. * @param (rave['internal']['RunFunction']) callback Callback on each zoom event, must not be null
  4073. * @return (rave['internal']['Zoom']) The zoom
  4074. */
  4075. /** @expose */
  4076. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom = function(chart, zoom, xScale, yScale, x2Scale, y2Scale, scaleExtent, chartRect, p, s, zoomOps, callback) {
  4077. var z = zoom ? zoom : rave.behavior.zoom();
  4078. var z1 = (x2Scale || y2Scale) && zoomOps == "all" ? rave.behavior.zoom() : null;
  4079. var dummyScale = (rave.scale.linear());
  4080. z.x(dummyScale);
  4081. z.y(dummyScale);
  4082. if (xScale && zoomOps == "x") {
  4083. z.x(xScale.scale());
  4084. z.scale(s[0]);
  4085. z.translate([p[0], 0]);
  4086. }
  4087. if (yScale && zoomOps == "y") {
  4088. z.y(yScale.scale());
  4089. z.scale(s[1]);
  4090. z.translate([0, p[1]]);
  4091. }
  4092. if (x2Scale && zoomOps == "x2") {
  4093. z.x(x2Scale.scale());
  4094. z.scale(s[2]);
  4095. z.translate([p[2], 0]);
  4096. }
  4097. if (y2Scale && zoomOps == "y2") {
  4098. z.y(y2Scale.scale());
  4099. z.scale(s[3]);
  4100. z.translate([0, p[3]]);
  4101. }
  4102. if (zoomOps == "all") {
  4103. if (xScale) {
  4104. z.x(xScale.scale());
  4105. }
  4106. if (yScale) {
  4107. z.y(yScale.scale());
  4108. }
  4109. z.scale(1);
  4110. z.translate([0, 0]);
  4111. if (z1) {
  4112. if (x2Scale) {
  4113. z1.x(x2Scale.scale());
  4114. }
  4115. if (y2Scale) {
  4116. z1.y(y2Scale.scale());
  4117. }
  4118. z1.scale(1);
  4119. z1.translate([0, 0]);
  4120. }
  4121. }
  4122. z.scaleExtent(scaleExtent ? scaleExtent : [1, Infinity]).on("zoom.default", function(args) {
  4123. if (args !== null || arguments.length > 1){
  4124. args = Array.prototype.slice.call(arguments, 0);
  4125. }
  4126. {
  4127. var event = args[3];
  4128. var scale = event.scale;
  4129. var translate = event.translate;
  4130. var scaledX = chartRect.x * (scale - 1);
  4131. var scaledXExtent = (chartRect.width * (1 - scale)) - scaledX;
  4132. translate[0] = Math.min(-scaledX, Math.max(scaledXExtent, translate[0]));
  4133. var scaledY = chartRect.y * (scale - 1);
  4134. var scaledYExtent = (chartRect.height * (1 - scale)) - scaledY;
  4135. translate[1] = Math.min(-scaledY, Math.max(scaledYExtent, translate[1]));
  4136. z.translate([translate[0], translate[1]]);
  4137. if (z1) {
  4138. z1.translate([translate[0], translate[1]]);
  4139. z1.scale(scale);
  4140. }
  4141. if (zoomOps == "x") {
  4142. p[0] = translate[0];
  4143. s[0] = scale;
  4144. } else if (zoomOps == "y") {
  4145. p[1] = translate[1];
  4146. s[1] = scale;
  4147. } else if (zoomOps == "x2") {
  4148. p[2] = translate[0];
  4149. s[2] = scale;
  4150. } else if (zoomOps == "y2") {
  4151. p[3] = translate[1];
  4152. s[3] = scale;
  4153. } else if (zoomOps == "all") {
  4154. p[0] = translate[0];
  4155. p[1] = translate[1];
  4156. p[2] = translate[0];
  4157. p[3] = translate[1];
  4158. s[0] = scale;
  4159. s[1] = scale;
  4160. s[2] = scale;
  4161. s[3] = scale;
  4162. }
  4163. return callback.apply(this, args);
  4164. }
  4165. });
  4166. return z;
  4167. };
  4168. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModule
  4169. /************************************************************************
  4170. ** IBM Confidential
  4171. **
  4172. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4173. **
  4174. ** (C) Copyright IBM Corp. 2015
  4175. **
  4176. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4177. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4178. ************************************************************************/
  4179. // Must be the first import
  4180. // @import ./BundleModuleHeader
  4181. // expose DataFormatter to the global variable rave
  4182. //rave["library"]["CustomFormatter"]=com_ibm_rave_library_framework_CustomFormatter;
  4183. // $source: com/ibm/rave/bundles/columnBundle/ColumnBundle
  4184. /************************************************************************
  4185. ** IBM Confidential
  4186. **
  4187. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4188. **
  4189. ** (C) Copyright IBM Corp. 2017
  4190. **
  4191. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4192. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4193. ************************************************************************/
  4194. // GENERATED
  4195. //@import com/ibm/rave/library/Library (static) // Library
  4196. //@import com/ibm/rave/bundles/RaveBundle (loadtime) // superclass
  4197. //@import com/ibm/rave/bundles/columnBundle/ColumnView (runtime) // new
  4198. var com_ibm_rave_bundles_columnBundle_ColumnBundle = rave['internal']['Declare'](com_ibm_rave_bundles_RaveBundle, {
  4199. /** @expose */
  4200. getName : function() {
  4201. return com_ibm_rave_bundles_columnBundle_ColumnBundle.BUNDLE_NAME;
  4202. },
  4203. /** @expose */
  4204. createView : function(ctx) {
  4205. return new com_ibm_rave_bundles_columnBundle_ColumnView(ctx);
  4206. }
  4207. //constructor : function() {}
  4208. });
  4209. /**
  4210. * Register the bundle factory with the library. The bundle will not be made available if this method is not called.
  4211. */
  4212. /** @expose */
  4213. com_ibm_rave_bundles_columnBundle_ColumnBundle.init = function() {
  4214. if (!(com_ibm_rave_library_Library.bundle.isRegistered(com_ibm_rave_bundles_columnBundle_ColumnBundle.BUNDLE_NAME))) {
  4215. var bundle;
  4216. com_ibm_rave_library_Library.bundle.extension(com_ibm_rave_bundles_columnBundle_ColumnBundle.BUNDLE_NAME, function() {
  4217. if (!bundle) {
  4218. bundle = new com_ibm_rave_bundles_columnBundle_ColumnBundle();
  4219. bundle.loadResources();
  4220. require("./vizlibrary-column.css");
  4221. }
  4222. return bundle;
  4223. });
  4224. }
  4225. return com_ibm_rave_bundles_columnBundle_ColumnBundle.BUNDLE_NAME;
  4226. };
  4227. com_ibm_rave_bundles_columnBundle_ColumnBundle.BUNDLE_NAME = "columnBundle";
  4228. // Auto initialization
  4229. com_ibm_rave_bundles_columnBundle_ColumnBundle.init();
  4230. if (!com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_columnBundle_ColumnBundle.BUNDLE_NAME]) {
  4231. com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_columnBundle_ColumnBundle.BUNDLE_NAME] = function() {
  4232. if (!bundle) {
  4233. bundle = new com_ibm_rave_bundles_columnBundle_ColumnBundle();
  4234. bundle.loadResources();
  4235. require("./vizlibrary-column.css");
  4236. }
  4237. return bundle;
  4238. };
  4239. } else {
  4240. console.log("Could not register extension: ColumnBundle");
  4241. }
  4242. // $source: com/ibm/rave/bundles/views/AbstractColumnView
  4243. /************************************************************************
  4244. ** IBM Confidential
  4245. **
  4246. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4247. **
  4248. ** (C) Copyright IBM Corp. 2017
  4249. **
  4250. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4251. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4252. ************************************************************************/
  4253. // GENERATED
  4254. //@import com/ibm/rave/bundles/views/BundleView (loadtime) // superclass
  4255. //@import com/ibm/rave/bundles/components/IntervalComponentImpl (runtime) // new
  4256. //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities, simpleBars, clusteredBars, stackedBars
  4257. //@import com/ibm/rave/library/Library (runtime) // logError
  4258. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  4259. /**
  4260. * An abstract Column view implementation that contains code common to 'column'-like charts. For instance a composite (column/line) chart will also use this functionality.
  4261. */
  4262. var com_ibm_rave_bundles_views_AbstractColumnView = rave['internal']['Declare'](com_ibm_rave_bundles_views_BundleView, {
  4263. /** @expose */
  4264. datasetId : null,
  4265. /**
  4266. * Interval component, created in setup
  4267. */
  4268. /** @expose */
  4269. _intervalComponent : null,
  4270. /** @expose */
  4271. constructor : function(context) {
  4272. this.datasetId = "data";
  4273. },
  4274. /** @expose */
  4275. setup : function() {
  4276. com_ibm_rave_bundles_views_BundleView.prototype.setup.call(this);
  4277. this._intervalComponent = new com_ibm_rave_bundles_components_IntervalComponentImpl();
  4278. this._intervalComponent.keyAccessor(function(data) {
  4279. return (data).key;
  4280. }).independent1Accessor(function(data) {
  4281. return (data).ind1;
  4282. }).independent2Accessor(function(data) {
  4283. return (data).ind2;
  4284. }).dependent1Accessor(function(data) {
  4285. return (data).dep1;
  4286. }).dependent2Accessor(function(data) {
  4287. return (data).dep2;
  4288. }).valueAccessor(com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR);
  4289. },
  4290. /** @expose */
  4291. dataValid : function() {
  4292. if (!(this.dataModel.validate())) {
  4293. return false;
  4294. }
  4295. var dataHandling = this.getStringProperty("data.handling");
  4296. var dataSet = this.dataModel.dataset(this.datasetId);
  4297. var yAccessor = dataSet.slot("y").entry();
  4298. var yStart = dataSet.slot("yStart");
  4299. var yStartAccessor = yStart ? yStart.entry() : null;
  4300. if (dataHandling == "Stacked" || dataHandling == "Stacked100") {
  4301. if (yStartAccessor || yAccessor.type() == "date") {
  4302. com_ibm_rave_library_Library.logError(408, "Column chart isn't stackable when ystart is defined or y is date");
  4303. return false;
  4304. }
  4305. }
  4306. if (yStartAccessor && !(yStartAccessor.type() == yAccessor.type())) {
  4307. com_ibm_rave_library_Library.logError(409, "y and ystart slot must have the same data type in Column data");
  4308. return false;
  4309. }
  4310. return true;
  4311. },
  4312. /**
  4313. * Convert data model into array of IntervalData structures, based on the group handling. See {@link (com.ibm.rave.bundles.components.IntervalDataUtilities) IntervalDataUtilities} .
  4314. * @return (Array) Array of intervals
  4315. */
  4316. /** @expose */
  4317. makeData : function(dataModel, _data) {
  4318. if (!_data || _data.length == 0) {
  4319. return [];
  4320. }
  4321. var dataSet = dataModel.dataset(this.datasetId);
  4322. var xAccessor = dataSet.slot("x").entry();
  4323. var yAccessor = dataSet.slot("y").entry();
  4324. var colorAccessor = dataSet.slot("color").entry();
  4325. var labelAccessor = dataSet.slot("label").entry();
  4326. var yStart = dataSet.slot("yStart");
  4327. var yStartAccessor = yStart ? yStart.entry() : null;
  4328. var dataHandling = this.getStringProperty("data.handling");
  4329. if ("Clustered" == dataHandling && colorAccessor) {
  4330. return com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars(_data, [xAccessor, colorAccessor], [rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), rave['library']['internal']['AbstractView'].domainCheckerOf(_data, colorAccessor)], yAccessor, yStartAccessor, colorAccessor, labelAccessor);
  4331. }
  4332. if ("Stacked" == dataHandling) {
  4333. return com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, colorAccessor, labelAccessor, false);
  4334. }
  4335. if ("Stacked100" == dataHandling) {
  4336. return com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, colorAccessor, labelAccessor, true);
  4337. }
  4338. return com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, yStartAccessor, colorAccessor, labelAccessor);
  4339. },
  4340. /** @expose */
  4341. configureDataLabels : function(dataSet, colorDataSlotEntry) {
  4342. if (!(this.isShowDataLabels())) {
  4343. this._intervalComponent.itemLabel(false);
  4344. this._intervalComponent.itemLabelPosition(null);
  4345. this._intervalComponent.labelFont(null);
  4346. this._intervalComponent.labelAccessor(null);
  4347. this._intervalComponent.labelFormatter(null);
  4348. return;
  4349. }
  4350. var dataHandling = this.getStringProperty("data.handling");
  4351. var isStacked = (colorDataSlotEntry) && ("Stacked" == dataHandling || "Stacked100" == dataHandling);
  4352. var dataLabelPosition = function(data, index, groupIndex) {
  4353. if (isStacked) {
  4354. return 1;
  4355. } else {
  4356. var iData = data;
  4357. var value = + (iData.value);
  4358. return (value >= 0) ? 0 : 2;
  4359. }
  4360. };
  4361. var labelAccessor = this.getlDataLabelAccessor(dataSet, "label", true);
  4362. var labelEntry = this.getEntryForDataLabelFormatter(dataSet, "label", "y");
  4363. this._intervalComponent.itemLabel(true);
  4364. this._intervalComponent.itemOverlap(true);
  4365. this._intervalComponent.itemLabelPosition(dataLabelPosition);
  4366. var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
  4367. if (!isStacked) {
  4368. labelFontStyle = this.getBackgroundConstrastLabelStyle();
  4369. }
  4370. this._intervalComponent.labelFont(labelFontStyle);
  4371. this._intervalComponent.labelAccessor(labelAccessor);
  4372. this._intervalComponent.labelContrast(this.getBooleanProperty("contrast.label.color"));
  4373. this._intervalComponent.labelFormatter(this.context.getCustomFormatterForElementLabels(labelEntry, (dataSet.slot("label").entry()) ? "ROLE_NONE" : "ROLE_Y1"));
  4374. this._intervalComponent.labelContrast(this.getBooleanProperty("contrast.label.color"));
  4375. this._intervalComponent.labelShadow(this.getBooleanProperty("label.shadow"));
  4376. }
  4377. });
  4378. /** @expose */
  4379. com_ibm_rave_bundles_views_AbstractColumnView.DATAMODEL_TABULAR = "tabular";
  4380. /** @expose */
  4381. com_ibm_rave_bundles_views_AbstractColumnView.DATASET_DATA = "data";
  4382. /** @expose */
  4383. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_X = "x";
  4384. /** @expose */
  4385. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_Y = "y";
  4386. /** @expose */
  4387. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_Y_START = "yStart";
  4388. /** @expose */
  4389. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_COLOR = "color";
  4390. /** @expose */
  4391. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_LABEL = "label";
  4392. // $source: com/ibm/rave/bundles/columnBundle/ColumnView
  4393. /************************************************************************
  4394. ** IBM Confidential
  4395. **
  4396. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4397. **
  4398. ** (C) Copyright IBM Corp. 2018
  4399. **
  4400. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4401. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4402. ************************************************************************/
  4403. // GENERATED
  4404. //@import com/ibm/rave/bundles/views/AbstractColumnView (loadtime) // superclass
  4405. //@import com/ibm/rave/bundles/components/AxesManager (runtime) // percentFormat
  4406. //@import com/ibm/rave/bundles/components/ComponentConfiguration (runtime) // configureZoom
  4407. /**
  4408. * Column bundle view using the interval component.
  4409. */
  4410. var com_ibm_rave_bundles_columnBundle_ColumnView = rave['internal']['Declare'](com_ibm_rave_bundles_views_AbstractColumnView, {
  4411. /**
  4412. * the color accessor for the palette
  4413. */
  4414. //_colorAccessor : null,
  4415. /**
  4416. * Data from last render
  4417. */
  4418. //_data : null,
  4419. /**
  4420. * Data from last render, converted to IntervalData
  4421. */
  4422. //intervalData : null,
  4423. /**
  4424. * Scales from last render
  4425. */
  4426. //_independentScale : null, //_dependentScale : null,
  4427. //userKey : null,
  4428. //zoomXScale : null, //zoomYScale : null,
  4429. //zoomendedTimer : null,
  4430. /**
  4431. * Whether the chart was clustered last render
  4432. */
  4433. _wasClustered : false,
  4434. /**
  4435. * Whether the chart was stacked last render
  4436. */
  4437. _wasStacked : false,
  4438. /** @expose */
  4439. constructor : function(context) {
  4440. this._intervalComponent = null;
  4441. this._colorAccessor = null;
  4442. this._data = null;
  4443. },
  4444. /** @expose */
  4445. isAxesManagerRequired : function() {
  4446. return true;
  4447. },
  4448. /** @expose */
  4449. setup : function() {
  4450. com_ibm_rave_bundles_views_AbstractColumnView.prototype.setup.call(this);
  4451. var style = {};
  4452. style["stroke-width"] = "0px";
  4453. rave['library']['internal']['BundleUtils'].setupDefaultActions(this.context, ".chart ." + "element-shape", style);
  4454. this.context.actions.action("select").setOperation(rave['library']['internal']['OperationsUtil'].select());
  4455. this.context.actions.action("deselect").setOperation(rave['library']['internal']['OperationsUtil'].deselect());
  4456. this._colorAccessor = function(data) {
  4457. return (data).color;
  4458. };
  4459. this._wasClustered = false;
  4460. this._wasStacked = false;
  4461. },
  4462. /** @expose */
  4463. draw : function() {
  4464. if (this.isUpdateNothing()) {
  4465. return;
  4466. }
  4467. if (this.context.getPrerenderCallback()) {
  4468. this.context.getPrerenderCallback()();
  4469. }
  4470. this.preDraw("g.vizlibrary-column");
  4471. this.setBorder("column.borderWidth", "column.borderColor");
  4472. if (!(this.validateDataModel("g.element-group", "g.grid", "g.axis"))) {
  4473. return;
  4474. }
  4475. var effect = this.getStringProperty("effect.name");
  4476. var duration = this.getEffectDuration(effect);
  4477. var dataSet = this.dataModel.dataset("data");
  4478. var transpose = this.getBooleanProperty("transpose");
  4479. if (this.updateType == 0) {
  4480. this._data = (dataSet.data());
  4481. this.intervalData = this.makeData(this.dataModel, this._data);
  4482. this.userKey = dataSet.slot("key").entry();
  4483. this.context.actions.action("deselectAll")(this.context.node.selectAll(".chart ." + "element-shape"));
  4484. }
  4485. var xDataSlotEntry = dataSet.slot("x").entry();
  4486. var yDataSlotEntry = dataSet.slot("y").entry();
  4487. var colorDataSlotEntry = dataSet.slot("color").entry();
  4488. if (!colorDataSlotEntry && yDataSlotEntry) {
  4489. dataSet.slot("color").overrideLabel(yDataSlotEntry.label());
  4490. }
  4491. var colorPalette = this.getPalette();
  4492. if (colorPalette) {
  4493. colorPalette.setData(dataSet, "color");
  4494. colorPalette.setAccessor(this._colorAccessor);
  4495. colorPalette.setNullColor(this.getStringProperty("color.null"));
  4496. }
  4497. var showLegend = this.isShowLegend();
  4498. var legendVisibilityChanged = this._legends.anyVisible() != showLegend;
  4499. if (legendVisibilityChanged) {
  4500. this.updateType = 1;
  4501. }
  4502. var legendPosition = this.getLegendPosition();
  4503. this._legends.visible(showLegend).position(legendPosition).transition(!("none" == effect), duration).setPreExecute(this.context.getPreExecute()).selector(0, this.context.node.selectAll("g.legend")).palette(0, colorPalette).shape(0, "square").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);
  4504. var stacked100 = "Stacked100" == this.getStringProperty("data.handling");
  4505. if (this.updateType <= 1) {
  4506. this._independentScale = this.makeIndependentScale(dataSet);
  4507. this._dependentScale = this.makeDependentScale(dataSet, this.intervalData);
  4508. var subDomainDivisionY = yDataSlotEntry.subDomainDivision();
  4509. var scaleDivisionY = subDomainDivisionY == null ? null : + (subDomainDivisionY);
  4510. 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).setTickFormatter(0, xDataSlotEntry).setTickFormatterList(2, [yDataSlotEntry], stacked100 ? "percent" : "none", stacked100 ? com_ibm_rave_bundles_components_AxesManager.percentFormat(0) : null);
  4511. this.prepareLayoutComponent();
  4512. this.prepareLayoutSizables(this._layoutComponent, false, true, true, false, this._legends.anyVisible());
  4513. var isLegendLeftOrRight = "left" == legendPosition || "right" == legendPosition;
  4514. if (isLegendLeftOrRight) {
  4515. this._legends.preLayout(this._layoutComponent, false);
  4516. this._axes.preLayout(this._layoutComponent, false, 0.1, 0.05, 0, 0.1, 0.05, 0);
  4517. } else {
  4518. this._axes.preLayout(this._layoutComponent, true, 0.1, 0.05, 0, 0.1, 0.05, 0);
  4519. this._legends.preLayout(this._layoutComponent, true);
  4520. }
  4521. this._layoutComponent.layout();
  4522. legendPosition = this._layoutComponent.legendPosition();
  4523. this._legends.position(legendPosition);
  4524. this._axes.useBoundsFromLayout(this._layoutComponent).setScaleRanges(0.1, 0.05, 0);
  4525. if (this._independentScale) {
  4526. var csize = this.getCSSSizeToPixelNumber("column.size");
  4527. this._independentScale.setWidth(csize);
  4528. this._independentScale.applyWidth(this.getBooleanProperty("column.applysize"));
  4529. this._independentScale.expandZeroExtent(false);
  4530. this._independentScale.expandPixels(csize / 2.0 + 1.0, false);
  4531. if (this.getBooleanProperty("axis.x.scale.nice")) {
  4532. this._independentScale.nice();
  4533. }
  4534. if (this.getBooleanProperty("axis.x.scale.includeZero")) {
  4535. this._independentScale.includeZero();
  4536. }
  4537. if (transpose) {
  4538. this.zoomYScale = this._independentScale.scale().copy();
  4539. } else {
  4540. this.zoomXScale = this._independentScale.scale().copy();
  4541. }
  4542. }
  4543. if (this._dependentScale) {
  4544. var domainmax = + (this._dependentScale.scale().domain()[1]);
  4545. if (this.getBooleanProperty("axis.y.scale.includeZero")) {
  4546. this._dependentScale.includeZero();
  4547. }
  4548. this._dependentScale.expandZeroExtent(true);
  4549. if (this.getBooleanProperty("axis.y.scale.nice")) {
  4550. this._dependentScale.nice(scaleDivisionY);
  4551. }
  4552. var dataHandling = this.getStringProperty("data.handling");
  4553. var isStacked = (colorDataSlotEntry) && ("Stacked" == dataHandling || "Stacked100" == dataHandling);
  4554. if (this.getBooleanProperty("data.label.display") && !isStacked) {
  4555. var niceScaleDomain = this._dependentScale.scale().domain();
  4556. var range = this._dependentScale.scale().range();
  4557. var dependentScaleLengthPx = Math.abs(+ (range[1]) - + (range[0]));
  4558. var pixelPerUnit = dependentScaleLengthPx / Math.abs(+ (niceScaleDomain[1]) - + (niceScaleDomain[0]));
  4559. var padding = Math.abs(+ (niceScaleDomain[1]) - + (domainmax)) * pixelPerUnit;
  4560. var paddingNeeded = 20;
  4561. if (transpose && (""+(domainmax)).length * 12 < dependentScaleLengthPx / 4) {
  4562. paddingNeeded = (""+(domainmax)).length * 12;
  4563. }
  4564. this._dependentScale.expandPixels(padding < paddingNeeded ? (paddingNeeded - padding) : 2.0, true);
  4565. } else {
  4566. this._dependentScale.expandPixels(2.0, true);
  4567. }
  4568. if (transpose) {
  4569. this.zoomXScale = this._dependentScale.scale().copy();
  4570. } else {
  4571. this.zoomYScale = this._dependentScale.scale().copy();
  4572. }
  4573. }
  4574. this.resetZoom();
  4575. }
  4576. var chartRect = this._layoutComponent.elementRect();
  4577. this._legends.rectangle(this._layoutComponent.legendRect());
  4578. this._clip.clipRect(chartRect).applyTo(this._chart.select(".content")).call(this.context.node.select("defs").transition().duration(duration));
  4579. this._chart.select("rect.background.elements").attr("x", chartRect.x).attr("y", chartRect.y).attr("width", chartRect.width).attr("height", chartRect.height);
  4580. var xScale, yScale;
  4581. if (transpose) {
  4582. xScale = this._dependentScale;
  4583. yScale = this._independentScale;
  4584. } else {
  4585. xScale = this._independentScale;
  4586. yScale = this._dependentScale;
  4587. }
  4588. this.setBackgroundProperties(chartRect, duration);
  4589. this.configureDataLabels(dataSet, colorDataSlotEntry);
  4590. this._intervalComponent.data(this.intervalData).key(rave['library']['internal']['AbstractView'].originalDatumAccessor(this.userKey ? this.userKey.accessor() : null)).independentScale(this._independentScale).dependentScale(this._dependentScale).transpose(transpose).colorPalette(colorPalette).specialTransition(this.getSpecialTransition(transpose, colorDataSlotEntry)).delay(this.delayFunction(duration, this._independentScale)).setPreExecute(this.context.getPreExecute()).setRenderCallback(this.context.getRenderCallback()).borderWidth(this.context.convertCSSSizeToPixels(this.context.getPropertyValue("column.borderWidth"))).borderColor((this.context.getPropertyValue("column.borderColor"))).bounds(this._layoutComponent.elementRect());
  4591. var intervalUpdate = this._chart.selectAll("g.elements");
  4592. if (this.updateType <= 1) {
  4593. intervalUpdate = intervalUpdate.transition().duration(duration);
  4594. }
  4595. intervalUpdate.call(this._intervalComponent);
  4596. this._axes.useDefaultX1Properties(true);
  4597. this._axes.useDefaultY1Properties(true);
  4598. this._axes.setTickFormatter(0, xDataSlotEntry);
  4599. this._axes.setTickFormatterList(2, [yDataSlotEntry], stacked100 ? "percent" : "none", stacked100 ? com_ibm_rave_bundles_components_AxesManager.percentFormat(0) : null);
  4600. this._axes.draw();
  4601. this._legends.draw();
  4602. if (this.updateType <= 2) {
  4603. var ops = this.getStringProperty("zoom");
  4604. if (xScale && (ops == "all" || ops == "x")) {
  4605. (xScale.scale()).domain(this.zoomXScale.domain());
  4606. }
  4607. if (yScale && (ops == "all" || ops == "y")) {
  4608. (yScale.scale()).domain(this.zoomYScale.domain());
  4609. }
  4610. var self = this;
  4611. var zoom = this.context.actions.action("zoom").get("zoom");
  4612. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom(this._chart, zoom, xScale, yScale, null, null, null, chartRect, this._zoomP, this._zoomS, this.getStringProperty("zoom"), function(args) {
  4613. if (args !== null || arguments.length > 1){
  4614. args = Array.prototype.slice.call(arguments, 0);
  4615. }
  4616. {
  4617. self._intervalComponent.specialTransition(null);
  4618. self._chart.selectAll("g.elements").call(self._intervalComponent);
  4619. self._axes.redraw(true);
  4620. zoom.on("zoomend.hideLabels", function(args) {
  4621. if (args !== null || arguments.length > 1){
  4622. args = Array.prototype.slice.call(arguments, 0);
  4623. }
  4624. {
  4625. if (self._axes.hideAnyPanZoom()) {
  4626. if (self.zoomendedTimer != null) {
  4627. clearTimeout(self.zoomendedTimer);
  4628. }
  4629. self.zoomendedTimer = setTimeout(function() {
  4630. self.zoomendedTimer = null;
  4631. self._axes.redraw(false);
  4632. }, 300);
  4633. }
  4634. return null;
  4635. }
  4636. });
  4637. return self._chart;
  4638. }
  4639. });
  4640. }
  4641. this.resetUpdate();
  4642. this._chart.selectAll(".element-shape").classed("bundle-shape", true);
  4643. this._chart.selectAll(".legendShape").classed("bundle-shape", true);
  4644. if (this.context.getPostrenderCallback()) {
  4645. this.context.getPostrenderCallback()();
  4646. }
  4647. },
  4648. /** @expose */
  4649. getCoordinateScale : function(role) {
  4650. if ("ROLE_X1" == role) {
  4651. return this._independentScale;
  4652. }
  4653. if ("ROLE_Y1" == role) {
  4654. return this._dependentScale;
  4655. }
  4656. return null;
  4657. },
  4658. /**
  4659. * When the delay option is true, the transition of a bar is delayed by a fraction of the duration based on the bar's ordinal scale value.
  4660. * @param (int) duration
  4661. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale
  4662. * @return (rave['internal']['ValueFunction'])
  4663. */
  4664. delayFunction : function(duration, independentScale) {
  4665. if (duration > 0 && independentScale && this.getBooleanProperty("effect.delay")) {
  4666. var range = independentScale.scale().range();
  4667. if (range && range.length > 1) {
  4668. var rmin = (+ (range[0]));
  4669. var rmax = (+ (range[range.length - 1]));
  4670. if (rmin != rmax) {
  4671. var scaling = duration / (rmax - rmin);
  4672. return function(data, index, groupIndex) {
  4673. return (+ (independentScale.center((data).ind1)) - rmin) * scaling;
  4674. };
  4675. }
  4676. }
  4677. }
  4678. return null;
  4679. },
  4680. /**
  4681. * Create the independent scale. If the "ordinalScale" datum is null, the scale is null and data will not be displayed. If the "groupScale" datum is non-null, the scale is a grouped scale using the ordinal and group datum; otherwise it is an ordinal scale using the ordinal datum.
  4682. * @return (rave['library']['internal']['CoordinateScaleImpl']) Coordinate scale for the independent values
  4683. */
  4684. makeIndependentScale : function(dataSet) {
  4685. var xAccessor = dataSet.slot("x").entry();
  4686. if (!xAccessor) {
  4687. return null;
  4688. }
  4689. var colorAccessor = dataSet.slot("color").entry();
  4690. if (colorAccessor && "Clustered" == this.getStringProperty("data.handling")) {
  4691. return rave['library']['internal']['ScaleManager'].makeClusteredScale(this._data, [xAccessor, colorAccessor]);
  4692. }
  4693. var scale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(this._data, xAccessor);
  4694. return scale;
  4695. },
  4696. /**
  4697. * Create the dependent scale from the data values. The scale range includes all dep1 and dep2 values in the array. It also includes 0 and is padded by 2 pixels to avoid clipping.
  4698. * @param (Array) data Data array
  4699. * @return (rave['library']['internal']['CoordinateScaleImpl']) Coordinate scale for the range of values
  4700. */
  4701. makeDependentScale : function(dataSet, data) {
  4702. var domain = dataSet.slot("y").entry().domain();
  4703. if (domain) {
  4704. return rave['library']['internal']['LinearCoordinateScale'].create(domain);
  4705. }
  4706. var yStart = dataSet.slot("yStart").entry();
  4707. var omax = rave.max(data, function(data, ix, gix) {
  4708. var dep1 = + ((data).dep1);
  4709. var dep2 = + ((data).dep2);
  4710. return yStart || dep1 != 0 ? Math.max(dep1, dep2) : dep2;
  4711. });
  4712. if (omax == null) {
  4713. return null;
  4714. }
  4715. var omin = rave.min(data, function(data, ix, gix) {
  4716. var dep1 = + ((data).dep1);
  4717. var dep2 = + ((data).dep2);
  4718. return yStart || dep1 != 0 ? Math.min(dep1, dep2) : dep2;
  4719. });
  4720. var ySlot = dataSet.slot("y").entry();
  4721. if ("date" == ySlot.type()) {
  4722. return rave['library']['internal']['TimeCoordinateScale'].create([new Date(omin), new Date(omax)]);
  4723. } else {
  4724. return rave['library']['internal']['LinearCoordinateScale'].create([omin, omax]);
  4725. }
  4726. },
  4727. /**
  4728. * Special transition for clustered to stacked or vice-versa. Also updates _wasStacked and _wasClustered.
  4729. * @param (boolean) transpose Whether the chart is transposed
  4730. * @param (rave['library']['internal']['DataSlotEntry']) colorAccessor The color accessor (needed to tell if the chart is clustered)
  4731. * @return (String) String for transition type
  4732. */
  4733. getSpecialTransition : function(transpose, colorAccessor) {
  4734. var result;
  4735. var handling = this.getStringProperty("data.handling");
  4736. var isClustered = colorAccessor && "Clustered" == handling;
  4737. var isStacked = "Stacked" == handling || "Stacked100" == handling;
  4738. if (this._wasClustered && isStacked) {
  4739. result = transpose ? "YX_CTS" : "XY_CTS";
  4740. } else if (this._wasStacked && isClustered) {
  4741. result = transpose ? "XY_STC" : "YX_STC";
  4742. }
  4743. this._wasClustered = isClustered;
  4744. this._wasStacked = isStacked;
  4745. return result;
  4746. },
  4747. /** @expose */
  4748. requireUpdate : function(property) {
  4749. return rave['library']['internal']['AbstractView'].prototype.requireUpdate.call(this, property);
  4750. },
  4751. /** @expose */
  4752. getGroupStructure : function() {
  4753. return ["defs", "g.vizlibrary vizlibrary-column", "(", "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.axis-callout", ")", "g.legends", "(", "g.legends-layout", "g.legend", ")", ")"];
  4754. }
  4755. });
  4756. //com_ibm_rave_bundles_columnBundle_ColumnView.DATASLOT_KEY = "key";
  4757. // $source: com/ibm/rave/bundles/components/BackgroundComponentImpl
  4758. /************************************************************************
  4759. ** IBM Confidential
  4760. **
  4761. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4762. **
  4763. ** (C) Copyright IBM Corp. 2017
  4764. **
  4765. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4766. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4767. ************************************************************************/
  4768. // GENERATED
  4769. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  4770. //@import com/ibm/rave/bundles/component/BackgroundComponent (runtime) // BackgroundComponent
  4771. /**
  4772. * <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>
  4773. */
  4774. var com_ibm_rave_bundles_components_BackgroundComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  4775. //_backgroundColor : null,
  4776. //_rect : null,
  4777. /** @expose */
  4778. constructor : function() {
  4779. this._rect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4780. },
  4781. /** @expose */
  4782. execute : function(g) {
  4783. this.preExecute();
  4784. g.style("fill", this._backgroundColor != null ? this._backgroundColor : "#FFFFFF").style("fill-opacity", 1.0);
  4785. g.attr("x", this._rect.x).attr("y", this._rect.y).attr("width", this._rect.width).attr("height", this._rect.height);
  4786. },
  4787. /** @expose */
  4788. type : function() {
  4789. return com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE;
  4790. },
  4791. backgroundColor$0 : function() {
  4792. return this._backgroundColor;
  4793. },
  4794. backgroundColor$1 : function(backgroundColor) {
  4795. this._backgroundColor = backgroundColor;
  4796. return this;
  4797. },
  4798. /**
  4799. * @param (rave['library']['internal']['ContextSize']) size New value of size property
  4800. * @return (com.ibm.rave.bundles.components.BackgroundComponentImpl) This component
  4801. */
  4802. /** @expose */
  4803. size : function(size) {
  4804. this._rect.x = 0;
  4805. this._rect.y = 0;
  4806. this._rect.width = size.w;
  4807. this._rect.height = size.h;
  4808. return this;
  4809. },
  4810. /** @expose */
  4811. rect : function(rect) {
  4812. var r = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  4813. this._rect = r;
  4814. return this;
  4815. },
  4816. /** @expose */
  4817. backgroundColor : function(a0) {
  4818. var args = arguments;
  4819. if (args.length == 0) {
  4820. return this.backgroundColor$0();
  4821. }
  4822. return this.backgroundColor$1(a0);
  4823. }
  4824. });
  4825. // $source: com/ibm/rave/bundles/components/ChartLayoutComponentImpl
  4826. /************************************************************************
  4827. ** IBM Confidential
  4828. **
  4829. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4830. **
  4831. ** (C) Copyright IBM Corp. 2017
  4832. **
  4833. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4834. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4835. ************************************************************************/
  4836. // GENERATED
  4837. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  4838. //@import com/ibm/rave/bundles/component/ChartLayoutComponent (runtime) // ChartLayoutComponent
  4839. /**
  4840. * <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>
  4841. */
  4842. var com_ibm_rave_bundles_components_ChartLayoutComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  4843. //_padding : null,
  4844. //_legendChartGap : null,
  4845. //_topChartPadding : null,
  4846. //_leftChartPadding : null,
  4847. //_bottomChartPadding : null,
  4848. //_rightChartPadding : null,
  4849. //_legendPosition : null,
  4850. //_legendSizable : null,
  4851. //_axisSizables : null,
  4852. //_overallRect : null,
  4853. //_legendRect : null,
  4854. //_chartRect : null,
  4855. //_topRect : null,
  4856. //_leftRect : null,
  4857. //_bottomRect : null,
  4858. //_rightRect : null,
  4859. //_elementRect : null,
  4860. _leftPadding : 0, _topPadding : 0, _rightPadding : 0, _bottomPadding : 0,
  4861. _legendChartAlign : false,
  4862. _preLegendAtMax : false,
  4863. _preAxesAtZero : false,
  4864. constructor : function() {
  4865. this._axisSizables = [];
  4866. /**
  4867. * Construct. All padding is 0, legendPosition is "right", all slices have a size of 0 (value of null).
  4868. */
  4869. {
  4870. this._padding = 0.0;
  4871. this._topPadding = 0;
  4872. this._leftPadding = 0;
  4873. this._bottomPadding = 0;
  4874. this._rightPadding = 0;
  4875. this._topChartPadding = 0.0;
  4876. this._leftChartPadding = 0.0;
  4877. this._bottomChartPadding = 0.0;
  4878. this._rightChartPadding = 0.0;
  4879. this._legendChartGap = 0.0;
  4880. this._legendPosition = "right";
  4881. this._overallRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4882. this._legendRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4883. this._chartRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4884. this._topRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4885. this._leftRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4886. this._bottomRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4887. this._rightRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4888. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4889. this._legendChartAlign = true;
  4890. }
  4891. },
  4892. /** @expose */
  4893. execute : function(g) {
  4894. this.layout();
  4895. },
  4896. /**
  4897. * Calculates rectangles during preliminary layout
  4898. * @param (boolean) legendAtMax true if legend is given max size; false if legend is asked for its preferred size
  4899. * @param (boolean) axesAtZero true if axes are given a size of 0; false if axes are asked for their preferred size
  4900. */
  4901. /** @expose */
  4902. preLayout : function(legendAtMax, axesAtZero) {
  4903. this._preLegendAtMax = legendAtMax;
  4904. this._preAxesAtZero = axesAtZero;
  4905. this.layout();
  4906. this._preLegendAtMax = false;
  4907. this._preAxesAtZero = false;
  4908. },
  4909. /**
  4910. * Calls preExecute, then does the layout with the property values, updating the chart, legend, axis, and elements rectangles.
  4911. */
  4912. /** @expose */
  4913. layout : function() {
  4914. this.preExecute();
  4915. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._chartRect, this._overallRect);
  4916. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._legendRect, this._overallRect);
  4917. var x = this._overallRect.x;
  4918. var y = this._overallRect.y;
  4919. var w = this._overallRect.width;
  4920. var h = this._overallRect.height;
  4921. var maxWH = Math.max(w, h);
  4922. var tbLegend = "top" == this._legendPosition || "bottom" == this._legendPosition;
  4923. var legendPercent = this._axisSizables.length == 0 ? 0.5 : 0.3;
  4924. var legendMaxSize = (tbLegend ? this._legendRect.height : this._legendRect.width) * legendPercent;
  4925. var legendDynamicSize = this._legendSizable ? (this._preLegendAtMax ? maxWH : this._legendSizable.getPreferredSize()) : 0;
  4926. if (legendDynamicSize > legendMaxSize) {
  4927. legendDynamicSize = legendMaxSize;
  4928. }
  4929. var isLegendTop = false;
  4930. var isLegendBottom = false;
  4931. var isLegendLeft = false;
  4932. var isLegendRight = false;
  4933. if ("top" == this._legendPosition) {
  4934. this._legendRect.height = legendDynamicSize;
  4935. this._chartRect.height -= this._legendRect.height;
  4936. this._chartRect.y += this._legendRect.height;
  4937. isLegendTop = true;
  4938. } else if ("bottom" == this._legendPosition) {
  4939. this._legendRect.height = legendDynamicSize;
  4940. this._chartRect.height -= this._legendRect.height;
  4941. this._legendRect.y = y + h - this._legendRect.height;
  4942. isLegendBottom = true;
  4943. } else if ("left" == this._legendPosition) {
  4944. this._legendRect.width = legendDynamicSize;
  4945. this._chartRect.width -= this._legendRect.width;
  4946. this._chartRect.x += this._legendRect.width;
  4947. isLegendLeft = true;
  4948. } else {
  4949. this._legendRect.width = legendDynamicSize;
  4950. this._chartRect.width -= this._legendRect.width;
  4951. this._legendRect.x = x + w - this._legendRect.width;
  4952. isLegendRight = true;
  4953. }
  4954. if (this.evaluatePadding(this._padding, w, h)) {
  4955. var lrgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, w);
  4956. var tbgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, h);
  4957. var chartTop = isLegendTop && this._legendSizable ? tbgap : this._topPadding;
  4958. var chartLeft = isLegendLeft && this._legendSizable ? lrgap : this._leftPadding;
  4959. var chartBottom = isLegendBottom && this._legendSizable ? tbgap : this._bottomPadding;
  4960. var chartRight = isLegendRight && this._legendSizable ? lrgap : this._rightPadding;
  4961. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  4962. } else {
  4963. var lrpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, w);
  4964. var tbpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, h);
  4965. var chartTop = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);
  4966. var chartLeft = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding, w);
  4967. var chartBottom = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding, h);
  4968. var chartRight = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._rightChartPadding, w);
  4969. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  4970. this._topPadding = tbpadding;
  4971. this._leftPadding = lrpadding;
  4972. this._bottomPadding = tbpadding;
  4973. this._rightPadding = lrpadding;
  4974. }
  4975. if (this._legendSizable) {
  4976. if (isLegendRight) {
  4977. this._legendRect.x -= this._rightPadding;
  4978. this._chartRect.width -= this._rightPadding;
  4979. this._legendRect.y += this._topPadding;
  4980. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  4981. } else if (isLegendLeft) {
  4982. this._legendRect.x += this._leftPadding;
  4983. this._chartRect.x += this._leftPadding;
  4984. this._chartRect.width -= this._leftPadding;
  4985. this._legendRect.y += this._topPadding;
  4986. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  4987. } else if (isLegendTop) {
  4988. this._legendRect.y += this._topPadding;
  4989. this._chartRect.y += this._topPadding;
  4990. this._chartRect.height -= this._topPadding;
  4991. this._legendRect.x += this._leftPadding;
  4992. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  4993. } else {
  4994. this._legendRect.y -= this._bottomPadding;
  4995. this._chartRect.height -= this._bottomPadding;
  4996. this._legendRect.x += this._leftPadding;
  4997. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  4998. }
  4999. }
  5000. x = this._chartRect.x;
  5001. y = this._chartRect.y;
  5002. w = this._chartRect.width;
  5003. h = this._chartRect.height;
  5004. var bottomH = 0;
  5005. var topH = 0;
  5006. var leftW = 0;
  5007. var rightW = 0;
  5008. var tbSO = 0;
  5009. var lrSO = 0;
  5010. if (!this._preAxesAtZero) {
  5011. var countHorz = 0;
  5012. var countVert = 0;
  5013. for (var i = 0; i < this._axisSizables.length; ++i) {
  5014. var sizable = this._axisSizables[i];
  5015. if (sizable) {
  5016. var orientation = sizable.getSizableOrientation();
  5017. if ("top" == orientation || "bottom" == orientation) {
  5018. countHorz++;
  5019. } else {
  5020. countVert++;
  5021. }
  5022. }
  5023. }
  5024. for (var i = 0; i < this._axisSizables.length; ++i) {
  5025. var sizable = this._axisSizables[i];
  5026. if (sizable) {
  5027. var orientation = sizable.getSizableOrientation();
  5028. var tbAxis = "top" == orientation || "bottom" == orientation;
  5029. var axisDynamicSize = sizable.getPreferredSize();
  5030. var spillOver = sizable.getSpillOverSize();
  5031. if (tbAxis) {
  5032. var axisPercent = countHorz > 1 ? 0.4 : 0.5;
  5033. if (axisDynamicSize > this._chartRect.height * axisPercent) {
  5034. axisDynamicSize = this._chartRect.height * axisPercent;
  5035. }
  5036. if ("top" == orientation) {
  5037. topH = axisDynamicSize;
  5038. } else {
  5039. bottomH = axisDynamicSize;
  5040. }
  5041. if (spillOver > lrSO) {
  5042. lrSO = spillOver;
  5043. }
  5044. } else {
  5045. var axisPercent = countVert > 1 ? 0.4 : 0.5;
  5046. if (axisDynamicSize > this._chartRect.width * axisPercent) {
  5047. axisDynamicSize = this._chartRect.width * axisPercent;
  5048. }
  5049. if ("left" == orientation) {
  5050. leftW = axisDynamicSize;
  5051. } else {
  5052. rightW = axisDynamicSize;
  5053. }
  5054. if (spillOver > tbSO) {
  5055. tbSO = spillOver;
  5056. }
  5057. }
  5058. }
  5059. }
  5060. }
  5061. if (lrSO > leftW) {
  5062. leftW = lrSO;
  5063. }
  5064. if (lrSO > rightW) {
  5065. rightW = lrSO;
  5066. }
  5067. if (tbSO > topH) {
  5068. topH = tbSO;
  5069. }
  5070. if (tbSO > bottomH) {
  5071. bottomH = tbSO;
  5072. }
  5073. this._leftRect.x = x;
  5074. this._leftRect.width = leftW;
  5075. this._leftRect.y = y;
  5076. this._leftRect.height = h;
  5077. this._rightRect.x = x + w - rightW;
  5078. this._rightRect.width = rightW;
  5079. this._rightRect.y = y;
  5080. this._rightRect.height = h;
  5081. this._topRect.y = y;
  5082. this._topRect.height = topH;
  5083. this._topRect.x = x;
  5084. this._topRect.width = w;
  5085. this._bottomRect.y = y + h - bottomH;
  5086. this._bottomRect.height = bottomH;
  5087. this._bottomRect.x = x;
  5088. this._bottomRect.width = w;
  5089. this._elementRect.x = x + leftW;
  5090. this._elementRect.y = y + topH;
  5091. this._elementRect.width = w - (leftW + rightW);
  5092. this._elementRect.height = h - (topH + bottomH);
  5093. if (this._legendSizable && this._legendChartAlign) {
  5094. if (tbLegend) {
  5095. this._legendRect.x = this._elementRect.x;
  5096. this._legendRect.width = this._elementRect.width;
  5097. } else {
  5098. this._legendRect.y = this._elementRect.y;
  5099. this._legendRect.height = this._elementRect.height;
  5100. }
  5101. }
  5102. },
  5103. evaluatePadding : function(padding, horizontalExtent, verticalExtent) {
  5104. if (padding == null) {
  5105. return false;
  5106. }
  5107. var paddingString = (padding) + "";
  5108. if (paddingString.length == 0) {
  5109. return false;
  5110. }
  5111. this._topPadding = 0;
  5112. this._leftPadding = 0;
  5113. this._bottomPadding = 0;
  5114. this._rightPadding = 0;
  5115. var items = paddingString.split(new RegExp(";"));
  5116. for (var __i_enFor0 = 0, __len_enFor0 = items.length;
  5117. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  5118. var item = items[__i_enFor0];
  5119. var parts = item.split(new RegExp(":"));
  5120. if (items.length == 1 && parts.length != 2) {
  5121. return false;
  5122. }
  5123. if (parts.length == 2) {
  5124. if (0 <= parts[0].indexOf("top")) {
  5125. this._topPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  5126. } else if (0 <= parts[0].indexOf("left")) {
  5127. this._leftPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  5128. } else if (0 <= parts[0].indexOf("bottom")) {
  5129. this._bottomPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  5130. } else if (0 <= parts[0].indexOf("right")) {
  5131. this._rightPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  5132. }
  5133. }
  5134. }
  5135. return true;
  5136. },
  5137. /**
  5138. * @return (rave['internal']['RectStruct']) Legend rectangle
  5139. */
  5140. /** @expose */
  5141. legendRect : function() {
  5142. return this._legendRect;
  5143. },
  5144. /**
  5145. * @return (rave['internal']['RectStruct']) Chart (elements plus axes) rectangle
  5146. */
  5147. /** @expose */
  5148. chartRect : function() {
  5149. return this._chartRect;
  5150. },
  5151. /**
  5152. * @return (rave['internal']['RectStruct']) Top axis rectangle
  5153. */
  5154. /** @expose */
  5155. topRect : function() {
  5156. return this._topRect;
  5157. },
  5158. /**
  5159. * @return (rave['internal']['RectStruct']) Left axis rectangle
  5160. */
  5161. /** @expose */
  5162. leftRect : function() {
  5163. return this._leftRect;
  5164. },
  5165. /**
  5166. * @return (rave['internal']['RectStruct']) Bottom axis rectangle
  5167. */
  5168. /** @expose */
  5169. bottomRect : function() {
  5170. return this._bottomRect;
  5171. },
  5172. /**
  5173. * @return (rave['internal']['RectStruct']) Right axis rectangle
  5174. */
  5175. /** @expose */
  5176. rightRect : function() {
  5177. return this._rightRect;
  5178. },
  5179. /**
  5180. * @return (rave['internal']['RectStruct']) Legend rectangle
  5181. */
  5182. /** @expose */
  5183. elementRect : function() {
  5184. return this._elementRect;
  5185. },
  5186. /**
  5187. * Set the overall rectangle. This should be called before doing the layout.
  5188. * @param (rave['internal']['RectStruct']) overall The overall rectangle
  5189. */
  5190. /** @expose */
  5191. overall : function(overall) {
  5192. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._overallRect, overall);
  5193. return this;
  5194. },
  5195. padding$0 : function() {
  5196. return this._padding;
  5197. },
  5198. legendChartAlign$0 : function() {
  5199. return this._legendChartAlign;
  5200. },
  5201. legendChartGap$0 : function() {
  5202. return this._legendChartGap;
  5203. },
  5204. topPadding$0 : function() {
  5205. return this._topChartPadding;
  5206. },
  5207. leftPadding$0 : function() {
  5208. return this._leftChartPadding;
  5209. },
  5210. bottomPadding$0 : function() {
  5211. return this._bottomChartPadding;
  5212. },
  5213. rightPadding$0 : function() {
  5214. return this._rightChartPadding;
  5215. },
  5216. legendPosition$0 : function() {
  5217. return this._legendPosition;
  5218. },
  5219. topPadding$1 : function(padding) {
  5220. this._topChartPadding = padding;
  5221. return this;
  5222. },
  5223. leftPadding$1 : function(padding) {
  5224. this._leftChartPadding = padding;
  5225. return this;
  5226. },
  5227. bottomPadding$1 : function(padding) {
  5228. this._bottomChartPadding = padding;
  5229. return this;
  5230. },
  5231. rightPadding$1 : function(padding) {
  5232. this._rightChartPadding = padding;
  5233. return this;
  5234. },
  5235. /** @expose */
  5236. type : function() {
  5237. return com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE;
  5238. },
  5239. padding$1 : function(value) {
  5240. this._padding = value;
  5241. return this;
  5242. },
  5243. /** @expose */
  5244. chartPadding : function(top, left, bottom, right) {
  5245. this._topChartPadding = top;
  5246. this._leftChartPadding = left;
  5247. this._bottomChartPadding = bottom;
  5248. this._rightChartPadding = right;
  5249. return this;
  5250. },
  5251. legendChartAlign$1 : function(legendChartAlign) {
  5252. this._legendChartAlign = legendChartAlign;
  5253. return this;
  5254. },
  5255. legendChartGap$1 : function(value) {
  5256. this._legendChartGap = value;
  5257. return this;
  5258. },
  5259. legendPosition$1 : function(position) {
  5260. if ("top" == position || "bottom" == position || "left" == position || "right" == position) {
  5261. this._legendPosition = position;
  5262. }
  5263. return this;
  5264. },
  5265. /** @expose */
  5266. legendSize : function(sizable) {
  5267. this._legendSizable = sizable;
  5268. return this;
  5269. },
  5270. /** @expose */
  5271. removeAxisSizables : function() {
  5272. this._axisSizables.length = 0;
  5273. return this;
  5274. },
  5275. /** @expose */
  5276. addAxisSizable : function(sizable) {
  5277. this._axisSizables.push(sizable);
  5278. return this;
  5279. },
  5280. /** @expose */
  5281. padding : function(a0) {
  5282. var args = arguments;
  5283. if (args.length == 0) {
  5284. return this.padding$0();
  5285. }
  5286. return this.padding$1(a0);
  5287. },
  5288. /** @expose */
  5289. legendChartAlign : function(a0) {
  5290. var args = arguments;
  5291. if (args.length == 0) {
  5292. return this.legendChartAlign$0();
  5293. }
  5294. return this.legendChartAlign$1(a0);
  5295. },
  5296. /** @expose */
  5297. legendChartGap : function(a0) {
  5298. var args = arguments;
  5299. if (args.length == 0) {
  5300. return this.legendChartGap$0();
  5301. }
  5302. return this.legendChartGap$1(a0);
  5303. },
  5304. /** @expose */
  5305. topPadding : function(a0) {
  5306. var args = arguments;
  5307. if (args.length == 0) {
  5308. return this.topPadding$0();
  5309. }
  5310. return this.topPadding$1(a0);
  5311. },
  5312. /** @expose */
  5313. leftPadding : function(a0) {
  5314. var args = arguments;
  5315. if (args.length == 0) {
  5316. return this.leftPadding$0();
  5317. }
  5318. return this.leftPadding$1(a0);
  5319. },
  5320. /** @expose */
  5321. bottomPadding : function(a0) {
  5322. var args = arguments;
  5323. if (args.length == 0) {
  5324. return this.bottomPadding$0();
  5325. }
  5326. return this.bottomPadding$1(a0);
  5327. },
  5328. /** @expose */
  5329. rightPadding : function(a0) {
  5330. var args = arguments;
  5331. if (args.length == 0) {
  5332. return this.rightPadding$0();
  5333. }
  5334. return this.rightPadding$1(a0);
  5335. },
  5336. /** @expose */
  5337. legendPosition : function(a0) {
  5338. var args = arguments;
  5339. if (args.length == 0) {
  5340. return this.legendPosition$0();
  5341. }
  5342. return this.legendPosition$1(a0);
  5343. }
  5344. });
  5345. /**
  5346. * Set preferred rectangle to the same position and size as the source rectangle.
  5347. * @param (rave['internal']['RectStruct']) t preferred rectangle
  5348. * @param (rave['internal']['RectStruct']) s Source rectangle
  5349. * @return (rave['internal']['RectStruct']) preferred rectangle
  5350. */
  5351. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect = function(t, s) {
  5352. t.x = s.x;
  5353. t.y = s.y;
  5354. t.width = s.width;
  5355. t.height = s.height;
  5356. return t;
  5357. };
  5358. /**
  5359. * 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.
  5360. * @param (rave['internal']['RectStruct']) r Rectangle
  5361. * @param (double) top Top inset in pixels
  5362. * @param (double) left Left inset in pixels
  5363. * @param (double) bottom Bottom inset in pixels
  5364. * @param (double) right Right inset in pixels
  5365. * @return (rave['internal']['RectStruct']) The rectangle
  5366. */
  5367. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset = function(r, top, left, bottom, right) {
  5368. var ileft = Math.max(0.0, left);
  5369. var iright = Math.max(0.0, right);
  5370. if (ileft + iright <= r.width) {
  5371. r.x += ileft;
  5372. r.width -= ileft + iright;
  5373. }
  5374. var itop = Math.max(0.0, top);
  5375. var ibottom = Math.max(0.0, bottom);
  5376. if (itop + ibottom <= r.height) {
  5377. r.y += itop;
  5378. r.height -= itop + ibottom;
  5379. }
  5380. return r;
  5381. };
  5382. /**
  5383. * 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.
  5384. * @param (Object) value The size
  5385. * @param (double) extent The extent in the dimension
  5386. * @param defValue The default to use if not parsable
  5387. * @return (double) Size in pixels
  5388. */
  5389. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize = function(value, extent) {
  5390. var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10.0);
  5391. var d = v != null ? v : 0;
  5392. return Math.max(0.0, Math.min(d, extent));
  5393. };
  5394. /** @expose */
  5395. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT = 0.4;
  5396. /** @expose */
  5397. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT_SINGLE_PER_ORIENTATION = 0.5;
  5398. /** @expose */
  5399. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT = 0.3;
  5400. /** @expose */
  5401. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT_NO_AXIS = 0.5;
  5402. // $source: com/ibm/rave/bundles/components/ClipPathComponentImpl
  5403. /************************************************************************
  5404. ** IBM Confidential
  5405. **
  5406. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5407. **
  5408. ** (C) Copyright IBM Corp. 2017
  5409. **
  5410. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5411. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5412. ************************************************************************/
  5413. // GENERATED
  5414. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5415. /**
  5416. * 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>
  5417. */
  5418. var com_ibm_rave_bundles_components_ClipPathComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5419. //_id : null,
  5420. //_clipRect : null,
  5421. constructor : function(id) {
  5422. this._clipRect = new rave['internal']['RectStruct'](0, 0, 100, 100);
  5423. /**
  5424. * 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.
  5425. * @param (String) id String ID that is unique <em>across the document</em>.
  5426. */
  5427. {
  5428. this._id = id;
  5429. }
  5430. },
  5431. /** @expose */
  5432. type : function() {
  5433. return "ClipPathComponent";
  5434. },
  5435. /**
  5436. * Set the rectangular clipping area. Make the _clipRect one pixel larger than requested to avoid the cut-off at bounds. TODO: why?!?
  5437. * @param (rave['internal']['RectStruct']) rect The rectangular bounds of the clipping area.
  5438. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  5439. */
  5440. /** @expose */
  5441. clipRect : function(rect) {
  5442. this._clipRect = new rave['internal']['RectStruct'](rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2);
  5443. return this;
  5444. },
  5445. /**
  5446. * Set the clip-path attribute on the provided selection.
  5447. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  5448. */
  5449. /** @expose */
  5450. applyTo : function(s) {
  5451. s.attr("clip-path", "url(" + this.url() + ")");
  5452. return this;
  5453. },
  5454. /**
  5455. * Retrieve the id assigned to this clip path.
  5456. */
  5457. /** @expose */
  5458. id : function() {
  5459. return this._id;
  5460. },
  5461. /**
  5462. * Retrieve the URL that can be used to reference this clip path.
  5463. */
  5464. /** @expose */
  5465. url : function() {
  5466. return "#" + this._id;
  5467. },
  5468. /** @expose */
  5469. execute : function(g) {
  5470. var clipPath = g.selectAll("#" + this._id).data([0]);
  5471. clipPath.enter().append("clipPath").attr("id", this._id).append("rect");
  5472. 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);
  5473. }
  5474. });
  5475. // $source: com/ibm/rave/bundles/components/LegendComponentImpl
  5476. /************************************************************************
  5477. ** IBM Confidential
  5478. **
  5479. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5480. **
  5481. ** (C) Copyright IBM Corp. 2017
  5482. **
  5483. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5484. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5485. ************************************************************************/
  5486. // GENERATED
  5487. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5488. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  5489. /**
  5490. * <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>
  5491. */
  5492. var com_ibm_rave_bundles_components_LegendComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5493. /**
  5494. * Legend size property
  5495. */
  5496. //_size : null,
  5497. /**
  5498. * Color scale
  5499. */
  5500. //_colorPalette : null,
  5501. /**
  5502. * Orient, "horizontal" or "vertical"
  5503. */
  5504. //_orient : null,
  5505. /**
  5506. * Swatch size function
  5507. */
  5508. //_swatchSizeFunc : null,
  5509. /**
  5510. * Scale
  5511. */
  5512. //_scale : null,
  5513. /**
  5514. * Swatch symbol
  5515. */
  5516. //_shape : null,
  5517. /**
  5518. * Legend title
  5519. */
  5520. //_title : null,
  5521. /**
  5522. * Legend title styling
  5523. */
  5524. //_titleStyle : null,
  5525. /**
  5526. * Legend entry styling
  5527. */
  5528. //_entryStyle : null,
  5529. /**
  5530. * Custom formatter
  5531. */
  5532. //_labelFormat : null,
  5533. /**
  5534. * The swatch legend, created on demand
  5535. */
  5536. //_swatchLegend : null,
  5537. /**
  5538. * The continuous legend, created on demand
  5539. */
  5540. //_continuousLegend : null,
  5541. /**
  5542. * The legend type, either "SwatchLegend" or "ContinuousLegend"
  5543. */
  5544. //_legendType : null,
  5545. /**
  5546. * Is the legend visible
  5547. */
  5548. _visible : false,
  5549. /**
  5550. * Swatch size in square pixels
  5551. */
  5552. _swatchSize : 0,
  5553. /**
  5554. * Constructor; sets bound and, colorScale to null, all other properties to their default values.
  5555. */
  5556. /** @expose */
  5557. constructor : function() {
  5558. this._visible = true;
  5559. this._size = null;
  5560. this._colorPalette = null;
  5561. this._orient = "horizontal";
  5562. this._swatchSize = 16.0 * 16.0;
  5563. this._swatchSizeFunc = null;
  5564. this._scale = null;
  5565. this._shape = "square";
  5566. this._title = null;
  5567. this._titleStyle = {};
  5568. this._entryStyle = {};
  5569. this._labelFormat = null;
  5570. this._swatchLegend = null;
  5571. this._continuousLegend = null;
  5572. this._legendType = null;
  5573. },
  5574. /** @expose */
  5575. type : function() {
  5576. return "LegendComponent";
  5577. },
  5578. /** @expose */
  5579. execute : function(g) {
  5580. if (this._colorPalette) {
  5581. if ("continuous" == this._colorPalette.getType()) {
  5582. if (!this._continuousLegend) {
  5583. this._continuousLegend = (rave.capabilities.extension("legend")).continuous();
  5584. }
  5585. this._legendType = "ContinuousLegend";
  5586. } else {
  5587. if (!this._swatchLegend) {
  5588. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  5589. }
  5590. this._legendType = "SwatchLegend";
  5591. }
  5592. } else if (this._swatchSizeFunc) {
  5593. if (!this._swatchLegend) {
  5594. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  5595. }
  5596. this._legendType = "SwatchLegend";
  5597. } else {
  5598. this._legendType = null;
  5599. }
  5600. this.preExecute();
  5601. if (!this._visible || (!this._colorPalette && !this._swatchSizeFunc) || !this._size || this._size[0] <= 0 || this._size[1] <= 0) {
  5602. g.selectAll("*").remove();
  5603. return;
  5604. }
  5605. var fontChecker = rave.capabilities.extension("fontchecker");
  5606. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  5607. 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);
  5608. var legend = g.call(this._continuousLegend);
  5609. if (this._entryStyle) {
  5610. legend.selectAll(".legendLabel").style(this._entryStyle);
  5611. }
  5612. if (this._titleStyle) {
  5613. legend.selectAll(".legendTitle").style(this._titleStyle);
  5614. }
  5615. if (fontChecker) {
  5616. legend.selectAll(".legendLabel").call(fontChecker);
  5617. legend.selectAll(".legendTitle").call(fontChecker);
  5618. }
  5619. } else {
  5620. var insets = {};
  5621. insets["bottom"] = 5;
  5622. var swatchSize = this._swatchSize;
  5623. var scale = null;
  5624. var labelFormatter = this._labelFormat;
  5625. if (this._swatchSizeFunc && this._scale) {
  5626. swatchSize = this._swatchSizeFunc;
  5627. scale = this._scale;
  5628. }
  5629. if (this._colorPalette) {
  5630. scale = this._colorPalette.getScale();
  5631. var originalDomain = this._colorPalette.originalDomain();
  5632. if (originalDomain) {
  5633. scale.domain(originalDomain);
  5634. var f = this._colorPalette.originalDomainLabelAccessor();
  5635. if (this._labelFormat) {
  5636. var self = this;
  5637. labelFormatter = function(data, index, groupIndex) {
  5638. return self._labelFormat.call(this, f.call(this, data, index, groupIndex), index, groupIndex);
  5639. };
  5640. } else {
  5641. labelFormatter = f;
  5642. }
  5643. }
  5644. }
  5645. 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);
  5646. var legend = g.call(this._swatchLegend);
  5647. if (this._entryStyle) {
  5648. legend.selectAll(".legendLabel").style(this._entryStyle);
  5649. }
  5650. if (this._titleStyle) {
  5651. legend.selectAll(".legendTitle").style(this._titleStyle);
  5652. }
  5653. if (fontChecker) {
  5654. legend.selectAll(".legendLabel").call(fontChecker);
  5655. legend.selectAll(".legendTitle").call(fontChecker);
  5656. }
  5657. }
  5658. },
  5659. /** @expose */
  5660. legend : function() {
  5661. if ("ContinuousLegend" == this._legendType) {
  5662. return this._continuousLegend;
  5663. }
  5664. if ("SwatchLegend" == this._legendType) {
  5665. return this._swatchLegend;
  5666. }
  5667. return null;
  5668. },
  5669. /** @expose */
  5670. legendType : function() {
  5671. return this._legendType;
  5672. },
  5673. /**
  5674. * Set the visible property.
  5675. * @param (boolean) visible New visible
  5676. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5677. */
  5678. /** @expose */
  5679. visible : function(visible) {
  5680. this._visible = visible;
  5681. return this;
  5682. },
  5683. /**
  5684. * see if the legend is visible
  5685. * @return (boolean) if its visible
  5686. */
  5687. /** @expose */
  5688. isVisible : function() {
  5689. return this._visible;
  5690. },
  5691. /**
  5692. * Set the size property.
  5693. * @param (Array) size New size
  5694. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5695. */
  5696. /** @expose */
  5697. size : function(size) {
  5698. this._size = size;
  5699. return this;
  5700. },
  5701. /**
  5702. * Set the color scale property.
  5703. * @param (rave['library']['internal']['Palette']) colorPalette New color scale
  5704. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5705. */
  5706. /** @expose */
  5707. colorPalette : function(colorPalette) {
  5708. this._colorPalette = colorPalette;
  5709. return this;
  5710. },
  5711. /**
  5712. * Set the orient property. If the argument is not "horizontal" or "vertical", it is ignored and the orient property is not changed.
  5713. * @param (String) orient New orient
  5714. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5715. */
  5716. /** @expose */
  5717. orient : function(orient) {
  5718. if ("horizontal" == orient || "vertical" == orient) {
  5719. this._orient = orient;
  5720. }
  5721. return this;
  5722. },
  5723. /**
  5724. * 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".
  5725. * @param (String) position Legend position
  5726. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5727. */
  5728. /** @expose */
  5729. position : function(position) {
  5730. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  5731. },
  5732. swatchSize$0 : function(swatchSize) {
  5733. if (swatchSize >= 0.0 && swatchSize != null) {
  5734. this._swatchSize = swatchSize;
  5735. }
  5736. return this;
  5737. },
  5738. /** @expose */
  5739. scale : function(scale) {
  5740. this._scale = scale;
  5741. return this;
  5742. },
  5743. swatchSize$1 : function(swatchSize) {
  5744. if (swatchSize) {
  5745. this._swatchSizeFunc = swatchSize;
  5746. }
  5747. return this;
  5748. },
  5749. /** @expose */
  5750. shape : function(shape) {
  5751. this._shape = shape;
  5752. return this;
  5753. },
  5754. /** @expose */
  5755. title : function(title) {
  5756. this._title = (title != null && title.length > 0) ? title : null;
  5757. return this;
  5758. },
  5759. /** @expose */
  5760. titleFill : function(titleFill) {
  5761. this._titleStyle["fill"] = titleFill;
  5762. return this;
  5763. },
  5764. /** @expose */
  5765. titleFontSize : function(titleFontSize) {
  5766. this._titleStyle["font-size"] = titleFontSize;
  5767. return this;
  5768. },
  5769. /** @expose */
  5770. titleFontFamily : function(titleFontFamily) {
  5771. this._titleStyle["font-family"] = titleFontFamily;
  5772. return this;
  5773. },
  5774. /** @expose */
  5775. labelFormat : function(labelFormat) {
  5776. this._labelFormat = labelFormat;
  5777. return this;
  5778. },
  5779. /** @expose */
  5780. titleFont : function(titleFontStyle) {
  5781. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(titleFontStyle);
  5782. return this;
  5783. },
  5784. /** @expose */
  5785. entryFont : function(entryFontStyle) {
  5786. this._entryStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(entryFontStyle);
  5787. return this;
  5788. },
  5789. /** @expose */
  5790. getSpaceUsed : function() {
  5791. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  5792. return this._continuousLegend.getUsedSize() + 2;
  5793. } else {
  5794. return this._swatchLegend.getUsedSize() + 2;
  5795. }
  5796. },
  5797. /** @expose */
  5798. swatchSize : function(a0) {
  5799. var args = arguments;
  5800. if (args.length == 1 && typeof a0 === "function") {
  5801. return this.swatchSize$1(a0);
  5802. }
  5803. return this.swatchSize$0(a0);
  5804. }
  5805. });
  5806. /**
  5807. * Get the orient for a position. "top" and "bottom" return "horizontal", anything else ("left", "right", or unknown/null) is "vertical".
  5808. * @param (String) position A position
  5809. * @return (String) "horizontal" or "vertical"
  5810. */
  5811. /** @expose */
  5812. com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf = function(position) {
  5813. if ("top" == position || "bottom" == position) {
  5814. return "horizontal";
  5815. }
  5816. return "vertical";
  5817. };
  5818. //com_ibm_rave_bundles_components_LegendComponentImpl.HORIZONTAL = "horizontal";
  5819. //com_ibm_rave_bundles_components_LegendComponentImpl.VERTICAL = "vertical";
  5820. com_ibm_rave_bundles_components_LegendComponentImpl.BAR_THINKNESS = 16;
  5821. com_ibm_rave_bundles_components_LegendComponentImpl.SWATCH_SIZE = 16;
  5822. /** @expose */
  5823. com_ibm_rave_bundles_components_LegendComponentImpl.TOP = "top";
  5824. /** @expose */
  5825. com_ibm_rave_bundles_components_LegendComponentImpl.BOTTOM = "bottom";
  5826. /** @expose */
  5827. com_ibm_rave_bundles_components_LegendComponentImpl.LEFT = "left";
  5828. /** @expose */
  5829. com_ibm_rave_bundles_components_LegendComponentImpl.RIGHT = "right";
  5830. /** @expose */
  5831. com_ibm_rave_bundles_components_LegendComponentImpl.ADJUSTABLE = -1;
  5832. // $source: com/ibm/rave/bundles/components/AxisComponentImpl
  5833. /************************************************************************
  5834. ** IBM Confidential
  5835. **
  5836. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5837. **
  5838. ** (C) Copyright IBM Corp. 2018
  5839. **
  5840. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5841. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5842. ************************************************************************/
  5843. // GENERATED
  5844. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5845. //@import com/ibm/rave/bundles/component/AxisComponent (runtime) // AxisComponent
  5846. //@import com/ibm/rave/bundles/utilities/TextCrossfader (runtime) // textCrossFade
  5847. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  5848. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  5849. /**
  5850. * <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>
  5851. */
  5852. var com_ibm_rave_bundles_components_AxisComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5853. /**
  5854. * Axis - created on demand
  5855. */
  5856. //_axis : null,
  5857. /**
  5858. * Role, from the AxisComponent API
  5859. */
  5860. //_role : null,
  5861. /**
  5862. * CoordinateScale
  5863. */
  5864. //_scale : null,
  5865. /**
  5866. * Orient, always one of the four legal values
  5867. */
  5868. //_orient : null,
  5869. /**
  5870. * Size
  5871. */
  5872. //_bounds : null,
  5873. //_elementRect : null,
  5874. /**
  5875. * The title text; default null (nothing visible)
  5876. */
  5877. /** @expose */
  5878. _axisTitle : null,
  5879. /**
  5880. * The title style; defaults null (use the CSS styling)
  5881. */
  5882. /** @expose */
  5883. _titleStyle : null,
  5884. /**
  5885. * Axis line color; default null (use the CSS styling)
  5886. */
  5887. /** @expose */
  5888. _lineColor : null,
  5889. /**
  5890. * Axis tick color; default null (use the CSS styling)
  5891. */
  5892. /** @expose */
  5893. _tickColor : null,
  5894. /**
  5895. * Axis tick label style; defaults null (use the CSS styling)
  5896. */
  5897. /** @expose */
  5898. _labelStyle : null,
  5899. //_staggerRotate45Nodes : null,
  5900. //_staggerFirstNode : null,
  5901. //_staggerLastNode : null,
  5902. /**
  5903. * Axis tick label formatting
  5904. */
  5905. //_tickFormat : null,
  5906. //_dropOverlap : null,
  5907. /**
  5908. * Used to get the extension to enable axis label wrapping
  5909. */
  5910. //_textFlow : null,
  5911. /**
  5912. * Used to check the fonts on each label to make sure all characters are covered
  5913. */
  5914. //_fontChecker : null,
  5915. /**
  5916. * Run function that applies the properties to the axis line
  5917. */
  5918. //_axisLineProperties : null,
  5919. /**
  5920. * Run function that applies the properties to the axis ticks
  5921. */
  5922. //_axisTickProperties : null,
  5923. /**
  5924. * Run function that applies the properties to the axis tick labels
  5925. */
  5926. //_axisTickLabelProperties : null,
  5927. /**
  5928. * Run function that hides or displays the axis tick labels
  5929. */
  5930. //_displayHideLabels : null,
  5931. /**
  5932. * Run function that hides or displays the axis tick labels
  5933. */
  5934. //_panZoomLabels : null,
  5935. /**
  5936. * The tick handler registered with the axis; will get called during axis transition
  5937. */
  5938. //_tickHandler : null,
  5939. //_textTruncationIndicator : null,
  5940. /**
  5941. * Used when dealing with numeric scale on the vertical axis and the numbers don't fit
  5942. */
  5943. //_simplifiedTickFormat : null,
  5944. //_tickMagnitude : null,
  5945. /**
  5946. * Whether to display the axis title; default true
  5947. */
  5948. /** @expose */
  5949. _displayAxisTitle : false,
  5950. /**
  5951. * Whether to display the axis line; default true
  5952. */
  5953. /** @expose */
  5954. _displayAxisLine : false,
  5955. /**
  5956. * Whether to display the axis ticks; default true
  5957. */
  5958. /** @expose */
  5959. _displayTicks : false,
  5960. /**
  5961. * Whether to display the axis tick labels (conditional on show labels property); default true
  5962. */
  5963. /** @expose */
  5964. _displayTickLabels : false,
  5965. /**
  5966. * Whether to display the axis tick labels (conditional on pan-zoom hide property); default true
  5967. */
  5968. /** @expose */
  5969. _showPanZoomTickLabels : false,
  5970. /**
  5971. * Whether to rotate the axis tick labels; default false
  5972. */
  5973. _rotateLabels : false,
  5974. _staggerCellWidth : 0,
  5975. _staggerAlignFirstAtStart : false,
  5976. _staggerAlignLastAtEnd : false,
  5977. _layoutTimerId : 0,
  5978. _layoutTitleSize : 0,
  5979. _layoutLabelSize : 0,
  5980. _layoutLabelHeight : 0,
  5981. _layoutAverageDigitWidth : 0,
  5982. _layoutSpillOver : 0,
  5983. /**
  5984. * Whether to hide overlapping labels; default true
  5985. */
  5986. /** @expose */
  5987. _hideOverlappingLabels : false,
  5988. /**
  5989. * When true, don't start a new timer
  5990. */
  5991. _pendingLabelTimer : false,
  5992. /**
  5993. * The padding in px between tick axis line and tick label, and also between tick label and title. Default 16px.
  5994. */
  5995. _padding : 0,
  5996. /**
  5997. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  5998. */
  5999. _renderedShapes : false,
  6000. _layoutMode : -1,
  6001. _allowAutoAxisLayoutToChangeOrientaiton : true,
  6002. _lastAutomaticAxisLayoutOrientation : -1,
  6003. _allowStagger : false,
  6004. _allowRotate45 : false,
  6005. _allowRotate90 : false,
  6006. constructor : function() {
  6007. {
  6008. var self = this;
  6009. this._axisLineProperties = function(args) {
  6010. if (args !== null || arguments.length > 1){
  6011. args = Array.prototype.slice.call(arguments, 0);
  6012. }
  6013. {
  6014. var line = this.selectAll("path.domain");
  6015. if (self._lineColor != null) {
  6016. line.style("stroke", self._lineColor);
  6017. }
  6018. if (self._displayAxisLine) {
  6019. line.attr("visibility", null);
  6020. } else {
  6021. line.attr("visibility", "hidden");
  6022. }
  6023. return null;
  6024. }
  6025. };
  6026. this._axisTickProperties = function(args) {
  6027. if (args !== null || arguments.length > 1){
  6028. args = Array.prototype.slice.call(arguments, 0);
  6029. }
  6030. {
  6031. var tickLines = this.selectAll("line");
  6032. if (self._displayTicks) {
  6033. tickLines.attr("visibility", null);
  6034. } else {
  6035. tickLines.attr("visibility", "hidden");
  6036. }
  6037. if (self._lineColor != null) {
  6038. tickLines.style("stroke", self._tickColor);
  6039. }
  6040. return null;
  6041. }
  6042. };
  6043. this._axisTickLabelProperties = function(args) {
  6044. if (args !== null || arguments.length > 1){
  6045. args = Array.prototype.slice.call(arguments, 0);
  6046. }
  6047. {
  6048. var labels = this.selectAll("text");
  6049. labels.each(self._displayHideLabels);
  6050. labels.each(self._panZoomLabels);
  6051. labels.style(self._labelStyle);
  6052. self._axis.ticksHandler(null);
  6053. return null;
  6054. }
  6055. };
  6056. this._displayHideLabels = function(obj, group, index) {
  6057. if (self._displayTickLabels) {
  6058. if (this.rave_hasProperty("__tickLabelHidden__")) {
  6059. this.rave_removeProperty("__tickLabelHidden__");
  6060. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6061. if (count <= 1) {
  6062. this.rave_removeProperty("__hiddenCount__");
  6063. this.removeAttribute("visibility");
  6064. } else {
  6065. this.rave_setProperty("__hiddenCount__", count - 1);
  6066. }
  6067. }
  6068. } else {
  6069. if (!(this.rave_hasProperty("__tickLabelHidden__"))) {
  6070. this.setAttribute("visibility", "hidden");
  6071. this.rave_setProperty("__tickLabelHidden__", "hidden");
  6072. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6073. this.rave_setProperty("__hiddenCount__", count + 1);
  6074. }
  6075. }
  6076. };
  6077. this._panZoomLabels = function(obj, group, index) {
  6078. if (self._showPanZoomTickLabels) {
  6079. if (this.rave_hasProperty("__panZoomHidden__")) {
  6080. this.rave_removeProperty("__panZoomHidden__");
  6081. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6082. if (count <= 1) {
  6083. this.rave_removeProperty("__hiddenCount__");
  6084. this.removeAttribute("visibility");
  6085. } else {
  6086. this.rave_setProperty("__hiddenCount__", count - 1);
  6087. }
  6088. }
  6089. } else {
  6090. if (!(this.rave_hasProperty("__panZoomHidden__"))) {
  6091. this.setAttribute("visibility", "hidden");
  6092. this.rave_setProperty("__panZoomHidden__", "hidden");
  6093. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6094. this.rave_setProperty("__hiddenCount__", count + 1);
  6095. }
  6096. }
  6097. };
  6098. }
  6099. this._tickHandler = new com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler(this._axisTickLabelProperties, this._axisTickProperties);
  6100. /**
  6101. * Initialize properties to defaults
  6102. */
  6103. {
  6104. this._axis = null;
  6105. this._role = null;
  6106. this._scale = null;
  6107. this._orient = "bottom";
  6108. this._bounds = null;
  6109. this._displayAxisTitle = true;
  6110. this._axisTitle = null;
  6111. this._titleStyle = {};
  6112. this._displayAxisLine = true;
  6113. this._lineColor = null;
  6114. this._displayTicks = true;
  6115. this._tickColor = null;
  6116. this._displayTickLabels = true;
  6117. this._labelStyle = {};
  6118. this._rotateLabels = false;
  6119. this._hideOverlappingLabels = true;
  6120. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  6121. this._tickFormat = null;
  6122. this._showPanZoomTickLabels = true;
  6123. this._pendingLabelTimer = false;
  6124. this._padding = 16;
  6125. this._textFlow = rave.capabilities.extension("textflow");
  6126. this._fontChecker = rave.capabilities.extension("fontchecker");
  6127. this._renderedShapes = false;
  6128. }
  6129. },
  6130. /** @expose */
  6131. type : function() {
  6132. return com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE;
  6133. },
  6134. /** @expose */
  6135. role : function() {
  6136. return this._role;
  6137. },
  6138. /** @expose */
  6139. execute : function(g) {
  6140. this.preExecute();
  6141. if (!this._scale) {
  6142. g.selectAll("*").remove();
  6143. this._renderedShapes = false;
  6144. return;
  6145. }
  6146. this._renderedShapes = true;
  6147. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6148. this._hideOverlappingLabels = false;
  6149. this._rotateLabels = true;
  6150. } else {
  6151. this._hideOverlappingLabels = true;
  6152. this._rotateLabels = true;
  6153. }
  6154. this.drawTitle(g);
  6155. this.drawAxis(g);
  6156. this.handleAxisText(g);
  6157. this.drawTitle(g);
  6158. },
  6159. /**
  6160. * This is one place where all the calls that affect the axis text happen in case of allowAutomaticAxisLayout the new behavior applies here
  6161. * @param (rave['internal']['Selector']) g
  6162. */
  6163. handleAxisText : function(g) {
  6164. this.stopLabelDroppingUpdate();
  6165. var duration = 0, delay = 0;
  6166. var g2 = rave.transition(g);
  6167. if (g2.isTransition()) {
  6168. var t2 = (g2);
  6169. duration = t2.duration();
  6170. delay = t2.delay();
  6171. }
  6172. var axisSelector = g.selectAll("g.axis");
  6173. var labels = axisSelector.selectAll("g.tick").filter(rave['library']['internal']['BundleUtils'].notExit).selectAll("text");
  6174. var fontChecker = rave.capabilities.extension("fontchecker");
  6175. labels.style(this._labelStyle);
  6176. if (fontChecker) {
  6177. labels.call(fontChecker);
  6178. }
  6179. var mode = this._allowAutoAxisLayoutToChangeOrientaiton ? this.determineWhichAutoMode(g) : this._lastAutomaticAxisLayoutOrientation;
  6180. this.configureStaggerData(g, mode);
  6181. this.handleLabelsRotationAndPosition(g, labels, mode);
  6182. this.hashingNumericScales(labels, this.labelExtent(g), mode);
  6183. if (duration == 0) {
  6184. this.doLabelWrapping(g, mode);
  6185. this.handleLabelsRotationAndPosition(g, labels, mode);
  6186. }
  6187. this._lastAutomaticAxisLayoutOrientation = mode;
  6188. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6189. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6190. var tick = axisSelector.append("g").classed("tick", true);
  6191. var tickText = tick.append("text");
  6192. if (labels.size() == 0) {
  6193. var singleValue = this._scale.scale().domain()[0];
  6194. var formatter = this._tickFormat;
  6195. if (!formatter) {
  6196. var tickFunc = this._scale.scale().tickFormat;
  6197. if (tickFunc) {
  6198. formatter = tickFunc.apply(tickFunc, [singleValue]);
  6199. }
  6200. }
  6201. var node = tickText[0][0];
  6202. var stringValue = formatter ? formatter.call(node, singleValue, 0, 0) : ""+(singleValue);
  6203. tickText.text(stringValue);
  6204. var dim = node.getBBox();
  6205. this._layoutLabelSize = isHorizontal ? dim.height : dim.width;
  6206. if (!isHorizontal || mode != 0) {
  6207. tickText.text(".0");
  6208. this._layoutLabelSize += node.getBBox().width;
  6209. }
  6210. }
  6211. if (!isHorizontal || mode != 0) {
  6212. tickText.text(".0");
  6213. var node = tickText[0][0];
  6214. var dim = node.getBBox();
  6215. this._layoutAverageDigitWidth = dim.width;
  6216. }
  6217. tick.remove();
  6218. }
  6219. if (this._hideOverlappingLabels && duration > 0) {
  6220. this.updateLabelDropping(labels, duration, delay);
  6221. }
  6222. if (duration > 0) {
  6223. this.doLabelWrappingAfterAnimation(g, labels, mode, duration, delay);
  6224. }
  6225. if (!this._displayTickLabels) {
  6226. this._layoutLabelSize = 0;
  6227. this._layoutAverageDigitWidth = 0;
  6228. }
  6229. },
  6230. /**
  6231. * 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
  6232. * @param (rave['internal']['Selector']) g selector
  6233. * @param (rave['internal']['Selector']) labels labels selector
  6234. * @param (int) mode one of HORIZONTAL, STAGGER, ROTATE90
  6235. */
  6236. handleLabelsRotationAndPosition : function(g, labels, mode) {
  6237. if (mode == 2 || mode == 1) {
  6238. if (this._orient == "bottom") {
  6239. this.rotateLabels(g, labels, "end", mode);
  6240. } else if (this._orient == "top") {
  6241. this.rotateLabels(g, labels, "start", mode);
  6242. } else {
  6243. this.rotateLabels(g, labels, "middle", mode);
  6244. }
  6245. } else {
  6246. if (this._orient == "bottom" || this._orient == "top") {
  6247. this.rotateLabels(g, labels, "middle", mode);
  6248. } else if (this._orient == "right") {
  6249. this.rotateLabels(g, labels, "start", mode);
  6250. } else {
  6251. this.rotateLabels(g, labels, "end", mode);
  6252. }
  6253. }
  6254. },
  6255. /**
  6256. * <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>
  6257. * @param (rave['internal']['Selector']) labels
  6258. */
  6259. hashingNumericScales : function(labels, extent, mode) {
  6260. if (!labels || !extent) {
  6261. return;
  6262. }
  6263. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6264. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6265. var tickSpace = mode == 1 ? extent[1] : extent[0];
  6266. this._textTruncationIndicator = "";
  6267. this._layoutLabelSize = 0;
  6268. for (var i = 0; i < labels.size(); ++i) {
  6269. var node = labels[i][0];
  6270. var dim = node.getBBox();
  6271. var width = dim.width;
  6272. var height = dim.height;
  6273. var size = !isHorizontal || mode == 1 ? width : height;
  6274. if (size > this._layoutLabelSize) {
  6275. this._layoutLabelSize = size;
  6276. }
  6277. if (width >= tickSpace) {
  6278. if (this._simplifiedTickFormat) {
  6279. var newText = this._simplifiedTickFormat.call(null, node.rave_getData(), 0, 0);
  6280. if (newText != null) {
  6281. node.rave_setText(newText);
  6282. }
  6283. if (node.getBBox().width >= tickSpace) {
  6284. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  6285. }
  6286. } else {
  6287. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  6288. }
  6289. }
  6290. }
  6291. }
  6292. },
  6293. /**
  6294. * @param (int) size The desired size of the string
  6295. * @param (String) ch The character to be repeated in the string
  6296. * @return (String) A string of the specified size containing repetition of the specified character
  6297. */
  6298. stringOfSize : function(size, ch) {
  6299. var returnString = "";
  6300. for (var i = 0; i < size; ++i) {
  6301. returnString += ch;
  6302. }
  6303. return returnString;
  6304. },
  6305. configureStaggerData : function(g, mode) {
  6306. if (mode == 3 || mode == 2) {
  6307. var horizontalDimensions = this.labelExtent(g);
  6308. var cellWidth = horizontalDimensions[0];
  6309. var axisSelector = g.selectAll("g.axis");
  6310. var labels = axisSelector.selectAll("text");
  6311. var domain = this._scale.scale().domain();
  6312. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  6313. this._staggerRotate45Nodes = [];
  6314. this._staggerFirstNode = null;
  6315. this._staggerLastNode = null;
  6316. for (var i = 0; i < labels.size(); ++i) {
  6317. var node = labels[0][i];
  6318. if (this.isValid(node.rave_getData())) {
  6319. var domainIndex = -1;
  6320. if (mode == 3) {
  6321. var domainLabel = !this._tickFormat ? node.rave_getText() : originalDataLabelAccessor.call(node, node.rave_getData(), 0, 0);
  6322. for (var index = 0; index < domain.length; ++index) {
  6323. if (domain[index].toString() == domainLabel) {
  6324. domainIndex = index;
  6325. break;
  6326. }
  6327. }
  6328. }
  6329. this._staggerRotate45Nodes.push(new com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex(node, domainIndex));
  6330. if (domainIndex == 0) {
  6331. this._staggerFirstNode = node;
  6332. }
  6333. if (domainIndex == domain.length - 1) {
  6334. this._staggerLastNode = node;
  6335. }
  6336. }
  6337. }
  6338. this._staggerCellWidth = cellWidth * 2;
  6339. this._staggerAlignFirstAtStart = this._staggerFirstNode ? this._staggerFirstNode.getBBox().width > cellWidth : false;
  6340. this._staggerAlignLastAtEnd = this._staggerLastNode ? this._staggerLastNode.getBBox().width > cellWidth : false;
  6341. }
  6342. },
  6343. getStaggerIndex : function(node) {
  6344. for (var index = 0; index < this._staggerRotate45Nodes.length; ++index) {
  6345. if (this._staggerRotate45Nodes[index].contains(node)) {
  6346. var domainIndex = this._staggerRotate45Nodes[index].getIndex();
  6347. return domainIndex == -1 ? 0 : domainIndex;
  6348. }
  6349. }
  6350. return -1;
  6351. },
  6352. getStaggerCount : function() {
  6353. var domain = this._scale.scale().domain();
  6354. return domain.length;
  6355. },
  6356. /**
  6357. * <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>
  6358. * @param (rave['internal']['Selector']) g
  6359. */
  6360. determineWhichAutoMode : function(g) {
  6361. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6362. var axisSelector = g.selectAll("g.axis");
  6363. var labels = axisSelector.selectAll("text");
  6364. var dim = this.labelExtent(g);
  6365. var cellWidth = dim[0];
  6366. var cellWidth90 = dim[1];
  6367. var layoutLabelHeight = 0;
  6368. var layoutLabelWidth = 0;
  6369. var horizontalScore = 0;
  6370. var staggerScore = 0;
  6371. var rotate45Score = 0;
  6372. var rotate90Score = 0;
  6373. var validNodes = [];
  6374. for (var i = 0; i < labels.size(); ++i) {
  6375. var node = labels[0][i];
  6376. if (this.isValid(node.rave_getData())) {
  6377. validNodes.push(node);
  6378. }
  6379. }
  6380. var labelCount = validNodes.length;
  6381. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6382. var mode = 0;
  6383. if (isHorizontal) {
  6384. mode = this._layoutMode == 1 ? 1 : 0;
  6385. var tick = axisSelector.append("g").classed("tick", true);
  6386. var tickText = tick.append("text");
  6387. tickText.style(this._labelStyle);
  6388. tickText.text(",0");
  6389. var node = tickText[0][0];
  6390. var zeroWidth = node.getBBox().width;
  6391. tick.remove();
  6392. var widestLabel = 0;
  6393. for (var i = 0; i < labelCount; ++i) {
  6394. node = validNodes[i];
  6395. var nodeRect = node.getBBox();
  6396. if (nodeRect.width > widestLabel) {
  6397. widestLabel = nodeRect.width;
  6398. }
  6399. if (nodeRect.height > this._layoutLabelHeight) {
  6400. this._layoutLabelHeight = nodeRect.height;
  6401. }
  6402. }
  6403. widestLabel += zeroWidth;
  6404. this._layoutSpillOver = mode == 1 ? this._layoutLabelHeight / 2 : widestLabel / 2 + 2;
  6405. } else {
  6406. for (var i = 0; i < labelCount; ++i) {
  6407. var node = validNodes[i];
  6408. var nodeRect = node.getBBox();
  6409. if (nodeRect.height > this._layoutLabelHeight) {
  6410. this._layoutLabelHeight = nodeRect.height;
  6411. }
  6412. }
  6413. this._layoutSpillOver = this._layoutLabelHeight / 2;
  6414. }
  6415. return mode;
  6416. }
  6417. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  6418. var staggerStringsWontMatch = this._tickFormat && !originalDataLabelAccessor;
  6419. var calcStagger = ((this._allowStagger && this._layoutMode == -1) || this._layoutMode == 3) && !staggerStringsWontMatch;
  6420. var calcRotate45 = (this._allowRotate45 && this._layoutMode == -1) || this._layoutMode == 2;
  6421. var calcRotate90 = (this._allowRotate90 && this._layoutMode == -1) || this._layoutMode == 1;
  6422. var spaceFor45Label = 0;
  6423. for (var i = 0; i < labelCount; ++i) {
  6424. var node = validNodes[i];
  6425. var nodeRect = node.getBBox();
  6426. layoutLabelHeight = nodeRect.height;
  6427. var labelWidth = nodeRect.width;
  6428. if (labelWidth > layoutLabelWidth) {
  6429. layoutLabelWidth = labelWidth;
  6430. }
  6431. horizontalScore += (labelWidth <= cellWidth ? 1 : cellWidth / labelWidth);
  6432. if (isHorizontal) {
  6433. if (calcStagger) {
  6434. var spaceForLabel = cellWidth * 2;
  6435. if (i == 0 && i == labelCount - 1) {
  6436. spaceForLabel *= 0.5;
  6437. } else if (i == 0 || i == labelCount - 1) {
  6438. spaceForLabel *= 0.75;
  6439. }
  6440. staggerScore += (labelWidth <= spaceForLabel ? 1 : spaceForLabel / labelWidth);
  6441. }
  6442. if (calcRotate45) {
  6443. if (spaceFor45Label == 0) {
  6444. spaceFor45Label = cellWidth90 / 0.7071 - layoutLabelHeight;
  6445. }
  6446. var space = this.calculate45DegreeSpace(node, spaceFor45Label);
  6447. rotate45Score += (labelWidth <= space ? 1 : space / labelWidth);
  6448. }
  6449. if (calcRotate90) {
  6450. rotate90Score += (labelWidth <= cellWidth90 ? 1 : cellWidth90 / labelWidth);
  6451. }
  6452. }
  6453. }
  6454. var mode = 0;
  6455. if (this._layoutMode == -1) {
  6456. if (isHorizontal && this._allowStagger) {
  6457. horizontalScore *= 1.1;
  6458. staggerScore *= 1.1;
  6459. }
  6460. if ((staggerScore > horizontalScore) && (staggerScore >= rotate45Score) && (staggerScore >= rotate90Score)) {
  6461. mode = 3;
  6462. } else if ((rotate45Score > horizontalScore) && (rotate45Score >= rotate90Score)) {
  6463. mode = 2;
  6464. } else if (rotate90Score > horizontalScore) {
  6465. mode = 1;
  6466. }
  6467. } else {
  6468. if ((this._layoutMode == 3 && staggerStringsWontMatch) || !isHorizontal) {
  6469. mode = 0;
  6470. } else {
  6471. mode = this._layoutMode;
  6472. }
  6473. }
  6474. if (isHorizontal) {
  6475. switch (mode) {
  6476. case 3:
  6477. this._layoutLabelSize = layoutLabelHeight * 2;
  6478. break;
  6479. case 2:
  6480. this._layoutLabelSize = (layoutLabelWidth + layoutLabelHeight) * 0.7071;
  6481. break;
  6482. case 1:
  6483. this._layoutLabelSize = layoutLabelWidth;
  6484. break;
  6485. case 0:
  6486. default:
  6487. this._layoutLabelSize = layoutLabelHeight;
  6488. break;
  6489. }
  6490. } else {
  6491. this._layoutLabelSize = layoutLabelWidth;
  6492. }
  6493. this._layoutLabelHeight = layoutLabelHeight;
  6494. return mode;
  6495. },
  6496. calculate45DegreeSpace : function(node, maxWidth) {
  6497. var width = maxWidth;
  6498. var tfm = node.rave_getParentNode().getAttribute("transform");
  6499. if (tfm != null) {
  6500. var tfmString = tfm.toString();
  6501. var indexOfTrans = tfmString.indexOf("translate(");
  6502. if (indexOfTrans != -1) {
  6503. indexOfTrans += 10;
  6504. var indexOfComma = tfmString.indexOf(",", indexOfTrans);
  6505. if (indexOfComma != -1) {
  6506. var xAmount = tfmString.substring(indexOfTrans, indexOfComma);
  6507. var xLabelPos = + (xAmount);
  6508. var width45Degrees = node.getBBox().width;
  6509. var xLabelWidth = width45Degrees * 0.7071;
  6510. var isBottom = this._orient == "bottom";
  6511. if (isBottom) {
  6512. xLabelPos -= node.getBBox().height / 4;
  6513. if (xLabelPos - xLabelWidth < this._bounds.x) {
  6514. xLabelWidth = xLabelPos - this._bounds.x;
  6515. width = xLabelWidth / 0.7071;
  6516. }
  6517. } else {
  6518. if (xLabelPos + xLabelWidth > this._bounds.x + this._bounds.width) {
  6519. xLabelWidth = (this._bounds.x + this._bounds.width) - xLabelPos;
  6520. width = xLabelWidth / 0.7071;
  6521. }
  6522. }
  6523. if (width > maxWidth) {
  6524. width = maxWidth;
  6525. }
  6526. }
  6527. }
  6528. }
  6529. return width;
  6530. },
  6531. /**
  6532. * @param (rave['internal']['Selector']) labels selector with all labels to be rotated
  6533. * @param (rave['internal']['Selector']) g The parent selector of labels
  6534. * @param (String) textAnchor The position of the anchor
  6535. * @param alignmentMode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  6536. */
  6537. rotateLabels : function(g, labels, textAnchor, mode) {
  6538. if (this._rotateLabels) {
  6539. var self = this;
  6540. var positioning = function(data, index, groupIndex) {
  6541. var x = 0;
  6542. var y = 0;
  6543. var rotation_cy = 0;
  6544. var isBottom = self._orient == "bottom";
  6545. if (mode == 3) {
  6546. var cellIndex = self.getStaggerIndex(this);
  6547. if (cellIndex != -1) {
  6548. if (cellIndex % 2 == 1) {
  6549. var staggerDirection = isBottom ? 1 : -1;
  6550. y += (self._layoutLabelHeight * staggerDirection);
  6551. }
  6552. if (cellIndex == 0 && self._staggerAlignFirstAtStart) {
  6553. x -= self._staggerCellWidth / 4;
  6554. } else if (cellIndex == self.getStaggerCount() - 1 && self._staggerAlignLastAtEnd) {
  6555. x += self._staggerCellWidth / 4;
  6556. }
  6557. }
  6558. } else if (mode == 2) {
  6559. if (isBottom) {
  6560. x -= self._layoutLabelHeight;
  6561. } else {
  6562. x += self._layoutLabelHeight / 2;
  6563. }
  6564. } else if (mode == 1) {
  6565. if (isBottom) {
  6566. x -= (this.getBBox().height / 2 + self._layoutLabelHeight / 4);
  6567. rotation_cy = ~~(self._padding / 4 + self._axis.tickSize());
  6568. } else {
  6569. x -= (this.getBBox().height / 2 - self._layoutLabelHeight);
  6570. rotation_cy = ~~-(self._padding / 4 + self._axis.tickSize());
  6571. }
  6572. }
  6573. var rotationDegrees = mode == 1 ? -90 : mode == 2 ? -45 : 0;
  6574. return "translate(" + x + "," + y + ") rotate(" + rotationDegrees + ",0," + rotation_cy + ")";
  6575. };
  6576. labels.attr("transform", positioning).style("text-anchor", textAnchor);
  6577. if (mode == 3) {
  6578. if (this._staggerAlignFirstAtStart) {
  6579. this._staggerFirstNode.rave_setStyle("text-anchor", "start");
  6580. }
  6581. if (this._staggerAlignLastAtEnd) {
  6582. this._staggerLastNode.rave_setStyle("text-anchor", "end");
  6583. }
  6584. }
  6585. }
  6586. },
  6587. /** @expose */
  6588. axis : function() {
  6589. return this._axis;
  6590. },
  6591. /**
  6592. * Draw the axis. The scale is non-null.
  6593. * @param (rave['internal']['Selector']) g Selector group into which the axis is drawn.
  6594. */
  6595. drawAxis : function(g) {
  6596. var axisSelector = g.selectAll("g.axis").data([0]);
  6597. axisSelector.enter().append("g").classed("axis", true).classed(this._orient, true);
  6598. if (!this._axis) {
  6599. this._axis = new rave['internal']['Axis']();
  6600. }
  6601. if (this._hideOverlappingLabels) {
  6602. this._textFlow.valignment("top").dropTextOnFail(false);
  6603. }
  6604. this._axis.ticksHandler(this._tickHandler);
  6605. this._axis.orient(this._orient);
  6606. this._axis.tickFormat(this._tickFormat);
  6607. this._axis.tickPadding(10.0);
  6608. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6609. var labelHeight = 20.0;
  6610. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6611. if (isHorizontal) {
  6612. labelHeight /= 0.7071;
  6613. }
  6614. var range = this._scale.scale().rangeExtent();
  6615. var extent = + (range[1]) - + (range[0]);
  6616. this._axis.ticks(extent / labelHeight);
  6617. } else {
  6618. if (this._tickMagnitude == null) {
  6619. this._axis.ticks(10.0);
  6620. } else {
  6621. this._axis.ticks.apply(this._axis, [10.0, this._scale.scale().getTickFormat(), this._tickMagnitude]);
  6622. }
  6623. }
  6624. var s = this._scale.scale();
  6625. if (this._scale.originalDomain()) {
  6626. var sOrdinal = s.copy();
  6627. sOrdinal.domain(this._scale.originalDomain());
  6628. s = sOrdinal;
  6629. var self = this;
  6630. var originalDataLabelAccessor = (self._scale).originalDomainLabelAccessor();
  6631. var tickFormatter;
  6632. if (originalDataLabelAccessor) {
  6633. if (this._tickFormat) {
  6634. tickFormatter = function(data, index, groupIndex) {
  6635. return self._tickFormat.call(this, originalDataLabelAccessor.call(this, data, index, groupIndex), index, groupIndex);
  6636. };
  6637. } else {
  6638. tickFormatter = originalDataLabelAccessor;
  6639. }
  6640. } else {
  6641. tickFormatter = this._tickFormat;
  6642. }
  6643. this._axis.tickFormat(tickFormatter);
  6644. }
  6645. this._axis.scale(s);
  6646. axisSelector.call(this._axis);
  6647. var g2 = rave.transition(axisSelector);
  6648. if (!(g2.isTransition())) {
  6649. axisSelector.selectAll("text").call(this._dropOverlap, this._hideOverlappingLabels);
  6650. }
  6651. axisSelector.selectAll("path.domain").classed("axis-line", true);
  6652. axisSelector.selectAll("g.tick line").classed("axis-tick", true);
  6653. if (this._fontChecker) {
  6654. axisSelector.selectAll("g.tick text").classed("axis-label", true).call(this._fontChecker);
  6655. } else {
  6656. axisSelector.selectAll("g.tick text").classed("axis-label", true);
  6657. }
  6658. axisSelector.call(this._axisLineProperties);
  6659. },
  6660. /**
  6661. * Draw the axis title.
  6662. * @param (rave['internal']['Selector']) g Selector group into which the title is drawn.
  6663. */
  6664. drawTitle : function(g) {
  6665. if (!this._displayAxisTitle || this._axisTitle == null || this._axisTitle.trim().length == 0 || !this._bounds) {
  6666. g.selectAll("text.axis-title." + this._orient).remove();
  6667. return;
  6668. }
  6669. var x = 0;
  6670. var y = 0;
  6671. var dy = "";
  6672. var transform;
  6673. if ("top" == this._orient) {
  6674. x = this._elementRect.x + this._elementRect.width / 2;
  6675. y = -this._bounds.height + this._padding / 4;
  6676. dy = "0.75em";
  6677. } else if ("bottom" == this._orient) {
  6678. x = this._elementRect.x + this._elementRect.width / 2;
  6679. y = this._bounds.height - this._padding / 4;
  6680. dy = "-0.25em";
  6681. } else if ("left" == this._orient) {
  6682. x = -this._elementRect.y - this._elementRect.height / 2;
  6683. y = -this._bounds.width + this._padding / 4;
  6684. dy = "0.75em";
  6685. transform = "rotate(-90)";
  6686. } else {
  6687. x = this._elementRect.y + this._elementRect.height / 2;
  6688. y = -this._bounds.width + this._padding / 4;
  6689. dy = "0.75em";
  6690. transform = "rotate(90)";
  6691. }
  6692. var fillOpacity;
  6693. {
  6694. var tmp = g.append("text").attr("class", "axis-title " + this._orient);
  6695. fillOpacity = tmp.style("fill-opacity");
  6696. tmp.remove();
  6697. } var label = g.selectAll("text.axis-title." + this._orient);
  6698. if (label.size() == 0) {
  6699. 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);
  6700. if (this._fontChecker) {
  6701. g.selectAll("text.axis-title." + this._orient).call(this._fontChecker);
  6702. }
  6703. }
  6704. 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);
  6705. },
  6706. getUnZoomedScale : function(scale) {
  6707. var s = scale.copy();
  6708. if (s.getZoomTransform()) {
  6709. s.getZoomTransform()(1, 0);
  6710. }
  6711. return s;
  6712. },
  6713. isValid : function(data) {
  6714. var s = this.getUnZoomedScale(this._axis.scale());
  6715. var v = + (s.call(null, data, 0, 0));
  6716. var range = this._axis.scale().range();
  6717. if (this._axis.scale().range().indexOf(v)> -1) {
  6718. return true;
  6719. }
  6720. if (range[0] < v && v < range[1]) {
  6721. return true;
  6722. }
  6723. if (range[0] > v && v > range[1]) {
  6724. return true;
  6725. }
  6726. return false;
  6727. },
  6728. /**
  6729. * Apply label wrapping if requested.
  6730. * @param (rave['internal']['Selector']) g
  6731. * @param (int) mode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  6732. */
  6733. doLabelWrapping : function(g, mode) {
  6734. if (this._displayTickLabels) {
  6735. this._textFlow.valignment("top");
  6736. if (!this._hideOverlappingLabels) {
  6737. this._textFlow.dropTextOnFail(true);
  6738. }
  6739. var d = this.labelExtent(g);
  6740. if (!d || d[0] < 0 || d[1] < 0) {
  6741. return;
  6742. }
  6743. var w = ~~ (d[0]);
  6744. var h = ~~ (d[1]);
  6745. if (mode == 2) {
  6746. w = ~~(d[1] / 0.7071 - this._layoutLabelHeight);
  6747. h = ~~(this._layoutLabelHeight / 0.7071);
  6748. } else if (mode == 1) {
  6749. var tmp = w;
  6750. w = h;
  6751. h = tmp;
  6752. }
  6753. var allowWrap = mode == 1;
  6754. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6755. var hActual = ~~ (this._layoutLabelHeight * 1.2);
  6756. if (hActual > h) {
  6757. h = hActual;
  6758. }
  6759. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6760. if (mode == 0 && !isHorizontal) {
  6761. allowWrap = true;
  6762. }
  6763. }
  6764. var self = this;
  6765. var cellWidth = w;
  6766. var cellHeight = h;
  6767. this._textFlow.wrap(allowWrap).truncate(true).textTruncateIndicator(this._textTruncationIndicator != null ? this._textTruncationIndicator : "...").spacing(1.2).extent(function(data, index, groupIndex) {
  6768. var width = cellWidth;
  6769. var height = cellHeight;
  6770. if (mode == 2) {
  6771. var cellIndex = self.getStaggerIndex(this);
  6772. if (cellIndex != -1) {
  6773. width = ~~self.calculate45DegreeSpace(this, cellWidth);
  6774. }
  6775. } else if (mode == 3) {
  6776. var cellIndex = self.getStaggerIndex(this);
  6777. if (cellIndex != -1) {
  6778. if (cellIndex == 0 && cellIndex == self.getStaggerCount() - 1) {
  6779. width = cellWidth;
  6780. } else if (cellIndex == 0 || cellIndex == self.getStaggerCount() - 1) {
  6781. width = cellWidth * 3 / 2;
  6782. } else {
  6783. width = cellWidth * 2;
  6784. }
  6785. height = cellHeight / 2;
  6786. }
  6787. }
  6788. return [width, height];
  6789. });
  6790. g.selectAll("g.tick > text").call(this._textFlow);
  6791. }
  6792. },
  6793. /**
  6794. * <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>
  6795. * @param (rave['internal']['Selector']) g Selector group for axis
  6796. * @return (Array) The extent of the axis label bounds
  6797. */
  6798. /** @expose */
  6799. labelExtent : function(g) {
  6800. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6801. var w = this._bounds.width;
  6802. var h = this._bounds.height;
  6803. if (this._scale.scale().rangeBand) {
  6804. var rangeBandValue = + (this._scale.scale().rangeBand());
  6805. if (isHorizontal) {
  6806. w = rangeBandValue;
  6807. } else {
  6808. h = rangeBandValue;
  6809. }
  6810. }
  6811. this.calcTitleExtent(g);
  6812. if (isHorizontal) {
  6813. h -= this._axis.tickSize();
  6814. h -= this._padding / 2;
  6815. if (this._layoutTitleSize != 0) {
  6816. h -= this._layoutTitleSize;
  6817. h -= this._padding / 2;
  6818. }
  6819. } else {
  6820. w -= this._axis.tickSize();
  6821. w -= this._padding / 2;
  6822. if (this._layoutTitleSize != 0) {
  6823. w -= this._layoutTitleSize;
  6824. w -= this._padding / 2;
  6825. }
  6826. }
  6827. return [w, h];
  6828. },
  6829. calcTitleExtent : function(g) {
  6830. this._layoutTitleSize = 0;
  6831. var title = g.selectAll("text.axis-title");
  6832. if (title.size() > 0) {
  6833. var textHeight = title[0][0].getBBox().height;
  6834. this._layoutTitleSize = textHeight;
  6835. }
  6836. },
  6837. /**
  6838. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  6839. * @param (String) role The new role
  6840. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) This object
  6841. */
  6842. /** @expose */
  6843. setRole : function(role) {
  6844. this._role = role;
  6845. return this;
  6846. },
  6847. /**
  6848. * Set the ticks interval on the scale based on the magnitude. tickMagnitude represents power of 10. null value gives the default scale ticks.
  6849. * @param (Number) tickMagnitude
  6850. * @return (com.ibm.rave.bundles.component.AxisComponent) this
  6851. */
  6852. /** @expose */
  6853. scaleTickMagnitude : function(tickMagnitude) {
  6854. this._tickMagnitude = tickMagnitude;
  6855. return this;
  6856. },
  6857. /**
  6858. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The new scale
  6859. */
  6860. /** @expose */
  6861. scale : function(scale) {
  6862. this._scale = scale ? scale : null;
  6863. return this;
  6864. },
  6865. /**
  6866. * Only legal values are accepted, otherwise the orient is unchanged.
  6867. * @param (String) orient The new orient
  6868. */
  6869. orient$0 : function(orient) {
  6870. if ("left" == orient || "bottom" == orient || "right" == orient || "top" == orient) {
  6871. this._orient = orient;
  6872. if (this._role == null) {
  6873. if ("left" == orient) {
  6874. this._role = "ROLE_Y1";
  6875. } else if ("bottom" == orient) {
  6876. this._role = "ROLE_X1";
  6877. } else if ("right" == orient) {
  6878. this._role = "ROLE_Y2";
  6879. } else {
  6880. this._role = "ROLE_X2";
  6881. }
  6882. }
  6883. }
  6884. return this;
  6885. },
  6886. /**
  6887. * Returns the current orientation string return The current orient
  6888. */
  6889. orient$1 : function() {
  6890. return this._orient;
  6891. },
  6892. /**
  6893. * @param (rave['internal']['RectStruct']) bounds The new bounds
  6894. */
  6895. /** @expose */
  6896. bounds : function(bounds) {
  6897. this._bounds = bounds;
  6898. return this;
  6899. },
  6900. /** @expose */
  6901. elementRect : function(elementRect) {
  6902. this._elementRect = elementRect;
  6903. return this;
  6904. },
  6905. tickFormat$0 : function(tickFormat) {
  6906. this._tickFormat = tickFormat;
  6907. return this;
  6908. },
  6909. tickFormat$1 : function() {
  6910. return this._tickFormat;
  6911. },
  6912. simplifiedTickFormat$0 : function(tickFormat) {
  6913. this._simplifiedTickFormat = tickFormat;
  6914. return this;
  6915. },
  6916. simplifiedTickFormat$1 : function() {
  6917. return this._simplifiedTickFormat;
  6918. },
  6919. /** @expose */
  6920. displayAxisTitle : function(displayAxisTitle) {
  6921. this._displayAxisTitle = displayAxisTitle;
  6922. return this;
  6923. },
  6924. /** @expose */
  6925. displayAxisLine : function(displayAxisLine) {
  6926. this._displayAxisLine = displayAxisLine;
  6927. return this;
  6928. },
  6929. /** @expose */
  6930. displayTicks : function(displayTicks) {
  6931. this._displayTicks = displayTicks;
  6932. return this;
  6933. },
  6934. /** @expose */
  6935. displayTickLabels : function(displayTickLabels) {
  6936. this._displayTickLabels = displayTickLabels;
  6937. return this;
  6938. },
  6939. /** @expose */
  6940. allowAutomaticAxisLayoutToChangeOrientation : function(state) {
  6941. this._allowAutoAxisLayoutToChangeOrientaiton = state;
  6942. return this;
  6943. },
  6944. /** @expose */
  6945. isAllowAutomaticAxisLayoutToChangeOrientation : function() {
  6946. return this._allowAutoAxisLayoutToChangeOrientaiton;
  6947. },
  6948. /** @expose */
  6949. showPanZoomTickLabels : function(showPanZoomTickLabels) {
  6950. this._showPanZoomTickLabels = showPanZoomTickLabels;
  6951. return this;
  6952. },
  6953. /** @expose */
  6954. axisTitle : function(axisTitle) {
  6955. this._axisTitle = axisTitle;
  6956. return this;
  6957. },
  6958. /** @expose */
  6959. axisColor : function(axisColor) {
  6960. this._lineColor = axisColor;
  6961. this._tickColor = axisColor;
  6962. return this;
  6963. },
  6964. /** @expose */
  6965. lineColor : function(lineColor) {
  6966. this._lineColor = lineColor;
  6967. return this;
  6968. },
  6969. /** @expose */
  6970. tickColor : function(tickColor) {
  6971. this._tickColor = tickColor;
  6972. return this;
  6973. },
  6974. /** @expose */
  6975. labelColor : function(labelColor) {
  6976. this._labelStyle["fill"] = labelColor;
  6977. return this;
  6978. },
  6979. labelStyle$0 : function(fill, fontSize, fontFamily) {
  6980. this._labelStyle["fill"] = fill;
  6981. this._labelStyle["font-size"] = fontSize;
  6982. this._labelStyle["font-family"] = fontFamily;
  6983. return this;
  6984. },
  6985. /** @expose */
  6986. titleColor : function(titleColor) {
  6987. this._titleStyle["fill"] = titleColor;
  6988. return this;
  6989. },
  6990. titleStyle$0 : function(fill, fontSize, fontFamily) {
  6991. this._titleStyle["fill"] = fill;
  6992. this._titleStyle["font-size"] = fontSize;
  6993. this._titleStyle["font-family"] = fontFamily;
  6994. return this;
  6995. },
  6996. /**
  6997. * @param (int) padding The new padding
  6998. */
  6999. /** @expose */
  7000. padding : function(padding) {
  7001. this._padding = padding;
  7002. return this;
  7003. },
  7004. /**
  7005. * @param mode LayoutMode for axis, one of: null (numeric axis), automatic, horizontal, stagger, rotate45, rotate90
  7006. */
  7007. /** @expose */
  7008. layoutMode : function(layoutMode) {
  7009. this._layoutMode = -1;
  7010. if (layoutMode != null) {
  7011. if (layoutMode == "horizontal") {
  7012. this._layoutMode = 0;
  7013. } else if (layoutMode == "stagger") {
  7014. this._layoutMode = 3;
  7015. } else if (layoutMode == "rotate45") {
  7016. this._layoutMode = 2;
  7017. } else if (layoutMode == "rotate90") {
  7018. this._layoutMode = 1;
  7019. }
  7020. }
  7021. return this;
  7022. },
  7023. /**
  7024. * @param (boolean) allow Enable Stagger to be considered in the automatic layout algorithm
  7025. */
  7026. /** @expose */
  7027. allowStagger : function(allow) {
  7028. this._allowStagger = allow;
  7029. return this;
  7030. },
  7031. /**
  7032. * @param (boolean) allow Enable Rotate 45 to be considered in the automatic layout algorithm
  7033. */
  7034. /** @expose */
  7035. allowRotate45 : function(allow) {
  7036. this._allowRotate45 = allow;
  7037. return this;
  7038. },
  7039. /**
  7040. * @param (boolean) allow Enable Rotate 90 to be considered in the automatic layout algorithm
  7041. */
  7042. /** @expose */
  7043. allowRotate90 : function(allow) {
  7044. this._allowRotate90 = allow;
  7045. return this;
  7046. },
  7047. /**
  7048. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  7049. */
  7050. renderedShapes : function() {
  7051. return this._renderedShapes;
  7052. },
  7053. labelStyle$1 : function(fontStyle) {
  7054. this._labelStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  7055. return this;
  7056. },
  7057. titleStyle$1 : function(fontStyle) {
  7058. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  7059. return this;
  7060. },
  7061. /**
  7062. * Determines whether the axis is swapped.
  7063. * @return (boolean) True if axis is swapped
  7064. */
  7065. isAxisSwapped : function() {
  7066. 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")));
  7067. },
  7068. /**
  7069. * <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>
  7070. * @param (String) indicator the string to be placed to indicated truncated text
  7071. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  7072. */
  7073. /** @expose */
  7074. textTruncateIndicator : function(indicator) {
  7075. this._textTruncationIndicator = indicator;
  7076. return this;
  7077. },
  7078. /**
  7079. * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
  7080. */
  7081. stopLabelDroppingUpdate : function() {
  7082. this._pendingLabelTimer = false;
  7083. },
  7084. /**
  7085. * 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.
  7086. * @param (rave['internal']['Selector']) labels the selection of valid labels for the end of the transition
  7087. * @param (double) duration of the transition. If 0, we don't do anything.
  7088. * @param (double) delay of the transition. Added to the duration to delay the updates.
  7089. */
  7090. updateLabelDropping : function(labels, duration, delay) {
  7091. var self = this;
  7092. var start = delay + duration;
  7093. var labelCollideCallback = function(elapsed) {
  7094. if (!self._pendingLabelTimer) {
  7095. return true;
  7096. }
  7097. labels.call(self._dropOverlap, self._hideOverlappingLabels);
  7098. if (elapsed >= start) {
  7099. self._pendingLabelTimer = false;
  7100. return true;
  7101. }
  7102. return false;
  7103. };
  7104. if (duration > 0) {
  7105. this._pendingLabelTimer = true;
  7106. rave.timer(labelCollideCallback, start);
  7107. }
  7108. },
  7109. doLabelWrappingAfterAnimation : function(g, labels, mode, duration, delay) {
  7110. this._layoutTimerId++;
  7111. var timerId = this._layoutTimerId;
  7112. var self = this;
  7113. var wrapCallback = function(elapsed) {
  7114. if (self._layoutTimerId == timerId) {
  7115. self.doLabelWrapping(g, mode);
  7116. self.handleLabelsRotationAndPosition(g, labels, mode);
  7117. }
  7118. return true;
  7119. };
  7120. rave.timer(wrapCallback, delay + duration);
  7121. },
  7122. /** @expose */
  7123. preLayout : function() {
  7124. this._layoutTitleSize = 0;
  7125. this._layoutLabelSize = 0;
  7126. this._layoutLabelHeight = 0;
  7127. this._layoutAverageDigitWidth = 0;
  7128. this._layoutSpillOver = 0;
  7129. },
  7130. /** @expose */
  7131. getSizableType : function() {
  7132. return this._scale.isOrdinal() || this._scale.isClustered() ? 1 : 0;
  7133. },
  7134. /** @expose */
  7135. getSizableOrientation : function() {
  7136. return this._orient;
  7137. },
  7138. /** @expose */
  7139. getPreferredSize : function() {
  7140. var layoutPaddingSize = 0;
  7141. if (this._axis) {
  7142. layoutPaddingSize = this._axis.tickSize();
  7143. if (this._layoutLabelSize != 0) {
  7144. layoutPaddingSize += this._padding / 2;
  7145. }
  7146. if (this._layoutTitleSize != 0) {
  7147. layoutPaddingSize += this._padding / 2;
  7148. }
  7149. }
  7150. return this._layoutLabelSize + this._layoutAverageDigitWidth + this._layoutTitleSize + layoutPaddingSize + 2;
  7151. },
  7152. /** @expose */
  7153. getSpillOverSize : function() {
  7154. return this._layoutSpillOver;
  7155. },
  7156. /** @expose */
  7157. orient : function(a0) {
  7158. var args = arguments;
  7159. if (args.length == 0) {
  7160. return this.orient$1();
  7161. }
  7162. return this.orient$0(a0);
  7163. },
  7164. /** @expose */
  7165. tickFormat : function(a0) {
  7166. var args = arguments;
  7167. if (args.length == 0) {
  7168. return this.tickFormat$1();
  7169. }
  7170. return this.tickFormat$0(a0);
  7171. },
  7172. /** @expose */
  7173. simplifiedTickFormat : function(a0) {
  7174. var args = arguments;
  7175. if (args.length == 0) {
  7176. return this.simplifiedTickFormat$1();
  7177. }
  7178. return this.simplifiedTickFormat$0(a0);
  7179. },
  7180. /** @expose */
  7181. labelStyle : function(a0, a1, a2) {
  7182. var args = arguments;
  7183. if (args.length == 1) {
  7184. return this.labelStyle$1(a0);
  7185. }
  7186. return this.labelStyle$0(a0, a1, a2);
  7187. },
  7188. /** @expose */
  7189. titleStyle : function(a0, a1, a2) {
  7190. var args = arguments;
  7191. if (args.length == 1) {
  7192. return this.titleStyle$1(a0);
  7193. }
  7194. return this.titleStyle$0(a0, a1, a2);
  7195. }
  7196. });
  7197. /**
  7198. * 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.
  7199. * @param (rave['internal']['RectStruct']) bounds Rectangle of the axis bounds
  7200. * @param (String) orient Orient, "top", "bottom", "left", "right"; if not valid, "bottom" used
  7201. * @return (double[]) Translation [x,y]
  7202. */
  7203. /** @expose */
  7204. com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation = function(bounds, orient) {
  7205. if ("left" == orient) {
  7206. return [bounds.x + bounds.width, 0.0];
  7207. }
  7208. if ("right" == orient) {
  7209. return [bounds.x, 0.0];
  7210. }
  7211. if ("top" == orient) {
  7212. return [0.0, bounds.y + bounds.height];
  7213. }
  7214. return [0.0, bounds.y];
  7215. };
  7216. com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex = rave['internal']['Declare']({
  7217. //_node : null,
  7218. _domainIndex : 0,
  7219. /** @expose */
  7220. constructor : function(node, domainIndex) {
  7221. this._node = node;
  7222. this._domainIndex = domainIndex;
  7223. },
  7224. /** @expose */
  7225. contains : function(node) {
  7226. return node == this._node;
  7227. },
  7228. /** @expose */
  7229. getIndex : function() {
  7230. return this._domainIndex;
  7231. }
  7232. });
  7233. /**
  7234. * Tick Handler for the axis. This will get called as the core axis is transitioned.
  7235. */
  7236. com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler = rave['internal']['Declare'](rave['internal']['AbstractTickHandler'], {
  7237. //_label : null,
  7238. //_tick : null,
  7239. _$functionClassMethod : function() {
  7240. var _$self = function(args) {
  7241. if (args !== null || arguments.length > 1){
  7242. args = Array.prototype.slice.call(arguments, 0);
  7243. }
  7244. {
  7245. _$self.handle(args[0]);
  7246. return null;
  7247. }
  7248. };
  7249. return _$self;
  7250. },
  7251. constructor : function(label, tick) {
  7252. this._label = label;
  7253. this._tick = tick;
  7254. },
  7255. /** @expose */
  7256. handle : function(ticks) {
  7257. ticks.call(this._tick);
  7258. ticks.call(this._label);
  7259. }
  7260. });
  7261. //com_ibm_rave_bundles_components_AxisComponentImpl.VISIBILITY = "visibility";
  7262. //com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN = "hidden";
  7263. /** @expose */
  7264. com_ibm_rave_bundles_components_AxisComponentImpl.LABEL_HIDDEN_FLAG = "__tickLabelHidden__";
  7265. /** @expose */
  7266. com_ibm_rave_bundles_components_AxisComponentImpl.PANZOOM_HIDDEN_FLAG = "__panZoomHidden__";
  7267. /** @expose */
  7268. com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN_COUNT = "__hiddenCount__";
  7269. /** @expose */
  7270. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_SPACE_PER_TICK = 20;
  7271. /** @expose */
  7272. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_TICK_COUNT = 10;
  7273. /** @expose */
  7274. com_ibm_rave_bundles_components_AxisComponentImpl.TICK_PADDING = 10;
  7275. //com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL_WEIGHT = 1.1;
  7276. com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL = 0;
  7277. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE90 = 1;
  7278. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE45 = 2;
  7279. com_ibm_rave_bundles_components_AxisComponentImpl.STAGGER = 3;
  7280. /**
  7281. * Constant used for text flow spacing
  7282. */
  7283. com_ibm_rave_bundles_components_AxisComponentImpl.TEXTFLOW_SPACING = 1.2;
  7284. /**
  7285. * Bottom axis orientation string.
  7286. */
  7287. /** @expose */
  7288. com_ibm_rave_bundles_components_AxisComponentImpl.BOTTOM_ORIENTATION = "bottom";
  7289. /**
  7290. * Top axis orientation string.
  7291. */
  7292. /** @expose */
  7293. com_ibm_rave_bundles_components_AxisComponentImpl.TOP_ORIENTATION = "top";
  7294. /**
  7295. * Left axis orientation string.
  7296. */
  7297. /** @expose */
  7298. com_ibm_rave_bundles_components_AxisComponentImpl.LEFT_ORIENTATION = "left";
  7299. /**
  7300. * Right axis orientation string.
  7301. */
  7302. /** @expose */
  7303. com_ibm_rave_bundles_components_AxisComponentImpl.RIGHT_ORIENTATION = "right";
  7304. com_ibm_rave_bundles_components_AxisComponentImpl.AUTOMODE = -1;
  7305. // $source: com/ibm/rave/bundles/components/GridComponentImpl
  7306. /************************************************************************
  7307. ** IBM Confidential
  7308. **
  7309. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7310. **
  7311. ** (C) Copyright IBM Corp. 2017
  7312. **
  7313. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7314. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7315. ************************************************************************/
  7316. // GENERATED
  7317. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  7318. //@import com/ibm/rave/bundles/components/StyleStructs (runtime) // new
  7319. //@import com/ibm/rave/bundles/component/GridComponent (runtime) // GridComponent
  7320. /**
  7321. * <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>
  7322. */
  7323. var com_ibm_rave_bundles_components_GridComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  7324. /**
  7325. * The axis property
  7326. */
  7327. //_axis : null,
  7328. /**
  7329. * Role, from the AxisComponent API
  7330. */
  7331. //_role : null,
  7332. /**
  7333. * The orientation
  7334. */
  7335. //_orient : null,
  7336. /**
  7337. * The bounds
  7338. */
  7339. //_bounds : null,
  7340. /**
  7341. * Style of gridlines
  7342. */
  7343. //_gridlineStyle : null,
  7344. /**
  7345. * Whether to display gridlines
  7346. */
  7347. _displayGridlines : false,
  7348. /**
  7349. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  7350. */
  7351. _renderedShapes : false,
  7352. /**
  7353. * Construct, with all properties the defaults.
  7354. */
  7355. /** @expose */
  7356. constructor : function() {
  7357. this._axis = null;
  7358. this._role = null;
  7359. this._orient = "bottom";
  7360. this._bounds = null;
  7361. this._displayGridlines = true;
  7362. this._gridlineStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
  7363. this._renderedShapes = false;
  7364. },
  7365. /** @expose */
  7366. type : function() {
  7367. return com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE;
  7368. },
  7369. /** @expose */
  7370. role : function() {
  7371. return this._role;
  7372. },
  7373. /** @expose */
  7374. execute : function(g) {
  7375. this.preExecute();
  7376. if (!this._displayGridlines || !this._axis || !this._bounds) {
  7377. g.selectAll("*").remove();
  7378. this._renderedShapes = false;
  7379. return;
  7380. }
  7381. this._renderedShapes = true;
  7382. var size = ("bottom" == this._orient || "top" == this._orient) ? this._bounds.height : this._bounds.width;
  7383. var ticksHandler = this._axis.ticksHandler();
  7384. var tickSize = this._axis.tickSize();
  7385. var outerTickSize = this._axis.outerTickSize();
  7386. var tickFormat = this._axis.tickFormat();
  7387. var ax = this._axis.tickSize(-size, 0).tickFormat("").ticksHandler(null);
  7388. g.call(ax);
  7389. this._axis.tickSize(tickSize, outerTickSize).tickFormat(tickFormat).ticksHandler(ticksHandler);
  7390. g.selectAll("g.tick line").classed("grid-tick", true);
  7391. g.selectAll(".grid-tick").style("stroke", this._gridlineStyle._stroke).style("stroke-dasharray", (this._gridlineStyle._dashArray));
  7392. g.selectAll("path.domain").remove();
  7393. },
  7394. /**
  7395. * @param (rave['internal']['Axis']) axis The new axis
  7396. */
  7397. /** @expose */
  7398. axis : function(axis) {
  7399. this._axis = axis;
  7400. return this;
  7401. },
  7402. /**
  7403. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  7404. * @param (String) role The new role
  7405. * @return (com.ibm.rave.bundles.components.GridComponentImpl) This object
  7406. */
  7407. /** @expose */
  7408. setRole : function(role) {
  7409. this._role = role;
  7410. return this;
  7411. },
  7412. /**
  7413. * Only legal values are accepted, otherwise the orient is unchanged.
  7414. * @param (String) orient The new orient
  7415. */
  7416. orient$0 : function(orient) {
  7417. if ("left" == orient || "right" == orient || "bottom" == orient || "top" == orient) {
  7418. this._orient = orient;
  7419. }
  7420. return this;
  7421. },
  7422. /**
  7423. * @param (rave['internal']['RectStruct']) bounds The new bounds
  7424. */
  7425. /** @expose */
  7426. bounds : function(bounds) {
  7427. this._bounds = bounds;
  7428. return this;
  7429. },
  7430. displayGridlines$0 : function(displayGridlines) {
  7431. this._displayGridlines = displayGridlines;
  7432. return this;
  7433. },
  7434. /** @expose */
  7435. gridlineStyle : function(gridlineColor, dashArray) {
  7436. this.gridlineColor(gridlineColor);
  7437. this.dashArray(dashArray);
  7438. return this;
  7439. },
  7440. gridlineColor$0 : function(gridlineColor) {
  7441. this._gridlineStyle._stroke = (gridlineColor != null && gridlineColor.length > 0) ? gridlineColor : null;
  7442. return this;
  7443. },
  7444. dashArray$0 : function(dashArray) {
  7445. this._gridlineStyle._dashArray = (dashArray != null && dashArray.length > 0) ? dashArray : null;
  7446. return this;
  7447. },
  7448. /**
  7449. * @return (String) The orientation of the gridline.
  7450. */
  7451. orient$1 : function() {
  7452. return this._orient;
  7453. },
  7454. displayGridlines$1 : function() {
  7455. return this._displayGridlines;
  7456. },
  7457. gridlineColor$1 : function() {
  7458. return this._gridlineStyle._stroke;
  7459. },
  7460. dashArray$1 : function() {
  7461. return this._gridlineStyle._dashArray;
  7462. },
  7463. /**
  7464. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  7465. */
  7466. renderedShapes : function() {
  7467. return this._renderedShapes;
  7468. },
  7469. /** @expose */
  7470. orient : function(a0) {
  7471. var args = arguments;
  7472. if (args.length == 0) {
  7473. return this.orient$1();
  7474. }
  7475. return this.orient$0(a0);
  7476. },
  7477. /** @expose */
  7478. displayGridlines : function(a0) {
  7479. var args = arguments;
  7480. if (args.length == 0) {
  7481. return this.displayGridlines$1();
  7482. }
  7483. return this.displayGridlines$0(a0);
  7484. },
  7485. /** @expose */
  7486. gridlineColor : function(a0) {
  7487. var args = arguments;
  7488. if (args.length == 0) {
  7489. return this.gridlineColor$1();
  7490. }
  7491. return this.gridlineColor$0(a0);
  7492. },
  7493. /** @expose */
  7494. dashArray : function(a0) {
  7495. var args = arguments;
  7496. if (args.length == 0) {
  7497. return this.dashArray$1();
  7498. }
  7499. return this.dashArray$0(a0);
  7500. }
  7501. });
  7502. // $source: com/ibm/rave/bundles/components/KeyedBundleComponentImpl
  7503. /************************************************************************
  7504. ** IBM Confidential
  7505. **
  7506. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7507. **
  7508. ** (C) Copyright IBM Corp. 2017
  7509. **
  7510. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7511. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7512. ************************************************************************/
  7513. // GENERATED
  7514. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  7515. /**
  7516. * 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.
  7517. * @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>
  7518. */
  7519. var com_ibm_rave_bundles_components_KeyedBundleComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  7520. //keyFunction : null,
  7521. /**
  7522. * Set the key function this component should use when joining data to scene nodes.
  7523. * @param (rave['internal']['SingleValueFunction']) keyFunction This function will be passed each datum individually and must return a unique value (a key).
  7524. * @return (com.ibm.rave.bundles.components.KeyedBundleComponentImpl) This.
  7525. */
  7526. /** @expose */
  7527. key : function(keyFunction) {
  7528. this.keyFunction = keyFunction;
  7529. return this;
  7530. },
  7531. /**
  7532. * Returns a {@link (rave['internal']['ValueFunction']) ValueFunction} that wraps the provided key function.
  7533. */
  7534. /** @expose */
  7535. getKey : function() {
  7536. if (!this.keyFunction) {
  7537. return null;
  7538. }
  7539. var self = this;
  7540. return function(datum, index, groupIndex) {
  7541. return self.keyFunction(datum);
  7542. };
  7543. }
  7544. });
  7545. // $source: com/ibm/rave/bundles/components/IntervalComponentImpl
  7546. /************************************************************************
  7547. ** IBM Confidential
  7548. **
  7549. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7550. **
  7551. ** (C) Copyright IBM Corp. 2017
  7552. **
  7553. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7554. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7555. ************************************************************************/
  7556. // GENERATED
  7557. //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
  7558. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  7559. //@import com/ibm/rave/bundles/component/IntervalComponent (runtime) // IntervalComponent
  7560. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  7561. //@import com/ibm/rave/bundles/utilities/LabelStyleUtil (runtime) // new
  7562. /**
  7563. * <p> A component to draw interval charts. The component puts its shapes into the selector passed to its execute method. Intervals are rectangular regions bounded by ranges in the dependent and independent dimensions. </p> <p> The data array passed to the component has one entry per interval to be drawn. Each entry has six 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 six properties are: </p> <ul> <li> <b>dependent1</b>: The first endpoint of the dependent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>dependent2</b>: The second endpoint of the dependent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>independent1</b>: The first endpoint of the independent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>independent2</b>: The second endpoint of the independent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>color</b>: Used for the fill color of the intervals. If not defined the fill is a default value set with a property.</li> <li> <b>label</b>: Label for the interval. If not defined the interval is not labeled. The interval component does not do internationalization, and this string is the value displayed.</li> </ul> <p> Intervals in general do not distinguish between the dependent and independent variables, although in bar charts they do. The names are used here for compatibility with other two-axis plots such as the line and point. </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>independent1Accessor</b>: A value function applied to a data object to get the independent1 value. If null, the interval is not drawn. The default is null. </p> <p> <b>independent2Accessor</b>:A value function applied to a data object to get the independent2 value. If null, the interval is not drawn. The default is null. </p> <p> <b>independentScale</b>: A scale applied to the independent values 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>dependentAccessor1</b>: A value function applied to a data object to get the dependent1 value. If null, the interval is not drawn. The default is null. </p> <p> <b>dependentAccessor2</b>: A value function applied to a data object to get the dependent2 value. If null, the interval is not drawn. 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>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>valueAccessor</b>: A value function applied to a data object to get the data value that the interval represents. If null, the interval is not drawn. </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 fill the interval when the interval 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>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>itemLabelPosition</b>: A value function applied to a data object to get the item label position. If null, the label is centered. </p>
  7564. */
  7565. var com_ibm_rave_bundles_components_IntervalComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
  7566. /**
  7567. * Data
  7568. */
  7569. //_data : null,
  7570. /**
  7571. * Accessor for key variable
  7572. */
  7573. //_keyAccessor : null,
  7574. /**
  7575. * Accessor for independent1 variable
  7576. */
  7577. //_independent1Accessor : null,
  7578. /**
  7579. * Accessor for independent2 variable
  7580. */
  7581. //_independent2Accessor : null,
  7582. /**
  7583. * Independent variable scale
  7584. */
  7585. //_independentScale : null,
  7586. /**
  7587. * Accessor for dependent1 variable
  7588. */
  7589. //_dependent1Accessor : null,
  7590. /**
  7591. * Accessor for dependent2 variable
  7592. */
  7593. //_dependent2Accessor : null,
  7594. /**
  7595. * Dependent scale
  7596. */
  7597. //_dependentScale : null,
  7598. /**
  7599. * Color scale
  7600. */
  7601. //_colorPalette : null,
  7602. /**
  7603. * Accessor for label role
  7604. */
  7605. //_labelAccessor : null,
  7606. /**
  7607. * Accessor for data values
  7608. */
  7609. //_valueAccessor : null,
  7610. /**
  7611. * Label formatter, may be null
  7612. */
  7613. //_labelFormatter : null,
  7614. //_dropOverlap : null,
  7615. /**
  7616. * Show label
  7617. */
  7618. //_itemLabelPosition : null,
  7619. /**
  7620. * border width
  7621. */
  7622. //_borderWidth : null,
  7623. //_borderColor : null,
  7624. /**
  7625. * Effect
  7626. */
  7627. //_specialTransition : null,
  7628. //_delay : null,
  7629. //_labelFontStyle : null,
  7630. //_bounds : null,
  7631. //_labelStyleUtil : null,
  7632. /**
  7633. * Transpose
  7634. */
  7635. _transpose : false,
  7636. /**
  7637. * Show label
  7638. */
  7639. _itemLabel : false,
  7640. /**
  7641. * Drop overlapping labels
  7642. */
  7643. _itemOverlap : true,
  7644. _labelLayerClass : ".element-label-group",
  7645. _elementLayerClass : ".element-group",
  7646. _labelContrast : false,
  7647. _labelShadow : false,
  7648. constructor : function() {
  7649. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  7650. this._delay = function(data, index, groupIndex) {
  7651. return 0;
  7652. };
  7653. this._labelFontStyle = {};
  7654. {
  7655. this._labelStyleUtil = new com_ibm_rave_bundles_utilities_LabelStyleUtil();
  7656. }
  7657. },
  7658. /** @expose */
  7659. type : function() {
  7660. return com_ibm_rave_bundles_component_IntervalComponent.COMPONENT_TYPE;
  7661. },
  7662. /** @expose */
  7663. execute : function(g) {
  7664. this.preExecute();
  7665. var elementGroupSelector = g.selectAll(this._elementLayerClass);
  7666. var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
  7667. if (g.classed(this._elementLayerClass) || elementGroupSelector.size() == 0 || elementLabelGroupSelector.size() == 0) {
  7668. elementGroupSelector = g;
  7669. elementLabelGroupSelector = g;
  7670. }
  7671. if (!this._data || !this._independent1Accessor || !this._independent2Accessor || !this._independentScale || !this._dependent1Accessor || !this._dependent2Accessor || !this._dependentScale) {
  7672. elementGroupSelector.selectAll("*").remove();
  7673. elementLabelGroupSelector.selectAll("*").remove();
  7674. return;
  7675. }
  7676. var self = this;
  7677. var labelText = !this._labelFormatter ? function(data, index, groupIndex) {
  7678. if (Math.max(+ (self._dependentScale.upper(self._dependent1Accessor(data))), + (self._dependentScale.upper(self._dependent2Accessor(data)))) - Math.min(+ (self._dependentScale.lower(self._dependent1Accessor(data))), + (self._dependentScale.lower(self._dependent2Accessor(data)))) < 0.001) {
  7679. return null;
  7680. }
  7681. return self._labelAccessor(data);
  7682. } : function(data, index, groupIndex) {
  7683. var v = self._labelAccessor(data);
  7684. return v == null ? null : self._labelFormatter.call(this, v, index, groupIndex);
  7685. };
  7686. var keyFunction = !this._keyAccessor ? null : function(datum, ix, gix) {
  7687. return self._keyAccessor(datum);
  7688. };
  7689. var labelsOn = this._itemLabel && this._labelAccessor;
  7690. if (!labelsOn) {
  7691. g.selectAll("text.element-label").remove();
  7692. }
  7693. var elementSelector = elementGroupSelector.selectAll(".element").data(this._data, this.getKey() ? this.getKey() : keyFunction);
  7694. elementSelector.exit().remove();
  7695. var elementEnter = elementSelector.enter().append("g").attr("class", "element");
  7696. elementEnter.append("rect").attr("class", "element-shape").attr("x", this._specialTransition == null ? this.rectangleCoord$0(true, true, true) : this.rectangleCoord$0(true, false, true)).attr("width", this._specialTransition == null ? this.rectangleSize(true, true, true) : this.rectangleSize(true, false, true)).attr("y", this.rectangleCoord$0(false, true, true)).attr("height", 0).style("fill", this._colorPalette);
  7697. if (labelsOn) {
  7698. var elementLabelSelector = elementLabelGroupSelector.selectAll(".element-label").data(this._data, this.getKey() ? this.getKey() : keyFunction);
  7699. elementLabelSelector.exit().remove();
  7700. elementLabelSelector.enter().append("text").attr("class", "element-label");
  7701. this.addLabels(elementLabelSelector).text(labelText);
  7702. }
  7703. var shapes = elementSelector.select(".element-shape");
  7704. var t = rave.transition(shapes);
  7705. if (t != shapes && this._delay) {
  7706. (t).delay(this._delay);
  7707. }
  7708. t.style("fill", this._colorPalette);
  7709. this.updateBorder(t, this._borderWidth, this._borderColor);
  7710. var fontChecker = rave.capabilities.extension("fontchecker");
  7711. if (this._specialTransition == null) {
  7712. t.attr("x", this.rectangleCoord$0(true, false, false)).attr("width", this.rectangleSize(true, false, false)).attr("y", this.rectangleCoord$0(false, false, false)).attr("height", this.rectangleSize(false, false, false));
  7713. } else if (this.isXYanimation()) {
  7714. t.attr("y", this.rectangleCoord$0(false, false, false)).attr("height", this.rectangleSize(false, false, false)).transition().attr("x", this.rectangleCoord$0(true, false, false)).attr("width", this.rectangleSize(true, false, false));
  7715. } else {
  7716. t.attr("x", this.rectangleCoord$0(true, false, false)).attr("width", this.rectangleSize(true, false, false)).transition().attr("y", this.rectangleCoord$0(false, false, false)).attr("height", this.rectangleSize(false, false, false));
  7717. }
  7718. if (this._renderCallback) {
  7719. t.call(this._renderCallback, "elements");
  7720. }
  7721. if (labelsOn) {
  7722. var labels = g.selectAll(".element-label");
  7723. var t2 = rave.transition(labels);
  7724. if (fontChecker) {
  7725. labels.call(fontChecker);
  7726. }
  7727. if (t2 != labels && this._delay) {
  7728. (t2).delay(this._delay);
  7729. }
  7730. t2.attr("x", this.getXPosition()).attr("dx", this.getXOffset()).attr("y", this.getYPosition()).attr("dy", this.getYOffset()).style("text-anchor", this.getAnchor());
  7731. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  7732. this._labelStyleUtil.labelFont(this._labelFontStyle).labelFillColor(this._labelContrast ? this.getLabelFill() : function(data, index, groupIndex) {
  7733. return labelColor;
  7734. }).labelShadow(this._labelShadow);
  7735. labels.call(this._labelStyleUtil);
  7736. t2.text(labelText);
  7737. this._dropOverlap.configureForDataLabels(this._bounds);
  7738. t2.call(this._dropOverlap, this._itemOverlap);
  7739. }
  7740. },
  7741. /**
  7742. * Add a &lt;text g=element-label"&gt; to each node in the selection s, setting the text properties to the usual defaults.
  7743. * @param (rave['internal']['Selector']) s Selector
  7744. * @return (rave['internal']['Selector']) Selector for the added labels
  7745. */
  7746. addLabels : function(s) {
  7747. return s.selectAll("element-label").attr("x", this.rectangleCenter(true, true, true)).attr("y", this.rectangleCenter(false, true, true)).attr("dy", ".3em").style("text-anchor", "middle");
  7748. },
  7749. getAnchor : function() {
  7750. var self = this;
  7751. return function(data, index, groupIndex) {
  7752. if (!self._transpose || (!self._itemLabelPosition)) {
  7753. return "middle";
  7754. }
  7755. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  7756. if (0 == labelPosition) {
  7757. return "start";
  7758. } else if (1 == labelPosition) {
  7759. return "middle";
  7760. } else {
  7761. return "end";
  7762. }
  7763. };
  7764. },
  7765. getLabelFill : function() {
  7766. var self = this;
  7767. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  7768. return function(data, index, groupIndex) {
  7769. if (!self._itemLabelPosition) {
  7770. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._colorPalette.call(this, data, index, groupIndex), labelColor).toString();
  7771. }
  7772. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  7773. if (1 == labelPosition) {
  7774. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._colorPalette.call(this, data, index, groupIndex), labelColor).toString();
  7775. }
  7776. return labelColor;
  7777. };
  7778. },
  7779. getXOffset : function() {
  7780. var self = this;
  7781. return function(data, index, groupIndex) {
  7782. if (!self._transpose || (!self._itemLabelPosition)) {
  7783. return "0em";
  7784. }
  7785. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  7786. if (0 == labelPosition) {
  7787. return ".3em";
  7788. } else if (1 == labelPosition) {
  7789. return "0em";
  7790. } else {
  7791. return "-.3em";
  7792. }
  7793. };
  7794. },
  7795. getYOffset : function() {
  7796. var self = this;
  7797. return function(data, index, groupIndex) {
  7798. if (self._transpose || (!self._itemLabelPosition)) {
  7799. return ".3em";
  7800. }
  7801. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  7802. if (0 == labelPosition) {
  7803. return "-.3em";
  7804. } else if (1 == labelPosition) {
  7805. return ".3em";
  7806. } else {
  7807. return "1.1em";
  7808. }
  7809. };
  7810. },
  7811. getXPosition : function() {
  7812. var self = this;
  7813. return function(data, index, groupIndex) {
  7814. if (!self._transpose || (!self._itemLabelPosition)) {
  7815. return self.rectangleCenter(true, false, false).call(this, data, index, groupIndex);
  7816. }
  7817. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  7818. if (0 == labelPosition) {
  7819. return self.rectangleCoord$1(true, false, false, true).call(this, data, index, groupIndex);
  7820. } else if (1 == labelPosition) {
  7821. return self.rectangleCenter(true, false, false).call(this, data, index, groupIndex);
  7822. } else {
  7823. return self.rectangleCoord$1(true, false, false, false).call(this, data, index, groupIndex);
  7824. }
  7825. };
  7826. },
  7827. getYPosition : function() {
  7828. var self = this;
  7829. return function(data, index, groupIndex) {
  7830. if (self._transpose || (!self._itemLabelPosition)) {
  7831. return self.rectangleCenter(false, false, false).call(this, data, index, groupIndex);
  7832. }
  7833. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  7834. if (0 == labelPosition) {
  7835. return self.rectangleCoord$1(false, false, false, false).call(this, data, index, groupIndex);
  7836. } else if (1 == labelPosition) {
  7837. return self.rectangleCenter(false, false, false).call(this, data, index, groupIndex);
  7838. } else {
  7839. return self.rectangleCoord$1(false, false, false, true).call(this, data, index, groupIndex);
  7840. }
  7841. };
  7842. },
  7843. /**
  7844. * Return a value function that gives the "x" or "y" coordinate of a rectangle.
  7845. * @param (boolean) xdim Whether "x" (true) or "y" (false) is requested
  7846. * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns the coordinate for value 0.0
  7847. * @param (boolean) enter Whether the coordinate is for an enter transition
  7848. * @return (rave['internal']['ValueFunction']) Value function for that coordinate
  7849. */
  7850. rectangleCoord$0 : function(xdim, fromBase, enter) {
  7851. return this.rectangleCoord$1(xdim, fromBase, enter, false);
  7852. },
  7853. rectangleCoord$1 : function(xdim, fromBase, enter, useMax) {
  7854. var useDependent = xdim == this._transpose;
  7855. var scale = useDependent ? this._dependentScale : this._independentScale;
  7856. if (fromBase && useDependent && this._dependentScale.isLinear()) {
  7857. var value = scale.lower(0.0);
  7858. return function(data, index, groupIndex) {
  7859. return value;
  7860. };
  7861. }
  7862. var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
  7863. var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
  7864. if (enter && this.isCTShandling()) {
  7865. return function(data, index, groupIndex) {
  7866. return scale.center(a1(data));
  7867. };
  7868. }
  7869. return function(data, index, groupIndex) {
  7870. if (useMax) {
  7871. return Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data))));
  7872. } else {
  7873. return Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data))));
  7874. }
  7875. };
  7876. },
  7877. /**
  7878. * Return a value function that gives the "height" or "width" coordinate of a rectangle.
  7879. * @param (boolean) xdim Whether "width" (true) or "height" (false) is requested
  7880. * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns 0.001
  7881. * @param (boolean) enter Whether the size is for an enter transition
  7882. * @return (rave['internal']['ValueFunction']) Value function for that coordinate
  7883. */
  7884. rectangleSize : function(xdim, fromBase, enter) {
  7885. var useDependent = xdim == this._transpose;
  7886. var scale = useDependent ? this._dependentScale : this._independentScale;
  7887. if ((fromBase && useDependent && this._dependentScale.isLinear()) || (enter && this.isCTShandling())) {
  7888. return function(data, index, groupIndex) {
  7889. return 0.001;
  7890. };
  7891. }
  7892. var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
  7893. var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
  7894. return function(data, index, groupIndex) {
  7895. return Math.max(0.001, Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data)))) - Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data)))));
  7896. };
  7897. },
  7898. /**
  7899. * @return (boolean) Whether the XY animation (shift X, then Y) should be used
  7900. */
  7901. isXYanimation : function() {
  7902. return "XY_CTS" == this._specialTransition || "XY_STC" == this._specialTransition;
  7903. },
  7904. /**
  7905. * @return (boolean) Whether the data handling changed from clustered to stacked
  7906. */
  7907. isCTShandling : function() {
  7908. return "XY_CTS" == this._specialTransition || "YX_CTS" == this._specialTransition;
  7909. },
  7910. /**
  7911. * Return a value function that gives the x or y center coordinate of a rectangle.
  7912. * @param (boolean) xdim Whether the x (true) or y (false) is requested
  7913. * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns the scaled 0.0
  7914. * @param (boolean) enter Whether the center is for an enter transition
  7915. * @return (rave['internal']['ValueFunction']) Value function for that coordinate
  7916. */
  7917. rectangleCenter : function(xdim, fromBase, enter) {
  7918. var useDependent = xdim == this._transpose;
  7919. var scale = useDependent ? this._dependentScale : this._independentScale;
  7920. if (fromBase && useDependent && this._dependentScale.isLinear()) {
  7921. var value = scale.lower(0.0);
  7922. return function(data, index, groupIndex) {
  7923. return value;
  7924. };
  7925. }
  7926. var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
  7927. var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
  7928. if (enter && this.isCTShandling()) {
  7929. return function(data, index, groupIndex) {
  7930. return + (scale.center(a1(data)));
  7931. };
  7932. }
  7933. return function(data, index, groupIndex) {
  7934. var val = (Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data)))) + Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data))))) / 2.0;
  7935. if (isNaN(val)) {
  7936. val = 0;
  7937. }
  7938. return val;
  7939. };
  7940. },
  7941. /**
  7942. * @param (java.lang.Object[]) data The new data
  7943. */
  7944. /** @expose */
  7945. data : function(data) {
  7946. this._data = data;
  7947. return this;
  7948. },
  7949. /**
  7950. * @param (rave['internal']['SingleValueFunction']) keyAccessor The new key accessor
  7951. */
  7952. /** @expose */
  7953. keyAccessor : function(keyAccessor) {
  7954. this._keyAccessor = keyAccessor;
  7955. return this;
  7956. },
  7957. /**
  7958. * @param (rave['internal']['SingleValueFunction']) independent1Accessor The new independent1 accessor
  7959. */
  7960. /** @expose */
  7961. independent1Accessor : function(independent1Accessor) {
  7962. this._independent1Accessor = independent1Accessor;
  7963. return this;
  7964. },
  7965. /**
  7966. * @param (rave['internal']['SingleValueFunction']) independent2Accessor The new independent1 accessor
  7967. */
  7968. /** @expose */
  7969. independent2Accessor : function(independent2Accessor) {
  7970. this._independent2Accessor = independent2Accessor;
  7971. return this;
  7972. },
  7973. /**
  7974. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
  7975. */
  7976. /** @expose */
  7977. independentScale : function(independentScale) {
  7978. this._independentScale = independentScale;
  7979. return this;
  7980. },
  7981. /**
  7982. * @param (rave['internal']['SingleValueFunction']) dependent1Accessor The new dependent1 accessor
  7983. */
  7984. /** @expose */
  7985. dependent1Accessor : function(dependent1Accessor) {
  7986. this._dependent1Accessor = dependent1Accessor;
  7987. return this;
  7988. },
  7989. /**
  7990. * @param (rave['internal']['SingleValueFunction']) dependent2Accessor The new dependent2 accessor
  7991. */
  7992. /** @expose */
  7993. dependent2Accessor : function(dependent2Accessor) {
  7994. this._dependent2Accessor = dependent2Accessor;
  7995. return this;
  7996. },
  7997. /**
  7998. * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
  7999. */
  8000. /** @expose */
  8001. dependentScale : function(dependentScale) {
  8002. this._dependentScale = dependentScale;
  8003. return this;
  8004. },
  8005. /**
  8006. * @param (rave['library']['internal']['Palette']) colorPalette The new colorPalette
  8007. */
  8008. /** @expose */
  8009. colorPalette : function(colorPalette) {
  8010. this._colorPalette = colorPalette;
  8011. return this;
  8012. },
  8013. /**
  8014. * @param (rave['internal']['SingleValueFunction']) labelAccessor The new labelAccessor
  8015. */
  8016. /** @expose */
  8017. labelAccessor : function(labelAccessor) {
  8018. this._labelAccessor = labelAccessor;
  8019. return this;
  8020. },
  8021. /**
  8022. * @param (rave['internal']['ValueFunction']) labelFormatter The new labelFormatter
  8023. */
  8024. /** @expose */
  8025. labelFormatter : function(labelFormatter) {
  8026. this._labelFormatter = labelFormatter;
  8027. return this;
  8028. },
  8029. /**
  8030. * @param (boolean) transpose The new transpose
  8031. */
  8032. /** @expose */
  8033. transpose : function(transpose) {
  8034. this._transpose = transpose;
  8035. return this;
  8036. },
  8037. /**
  8038. * @param (boolean) itemLabel The new itemLabel
  8039. */
  8040. /** @expose */
  8041. itemLabel : function(itemLabel) {
  8042. this._itemLabel = itemLabel;
  8043. return this;
  8044. },
  8045. /**
  8046. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  8047. */
  8048. /** @expose */
  8049. itemLabelPosition : function(labelPosition) {
  8050. this._itemLabelPosition = labelPosition;
  8051. return this;
  8052. },
  8053. /**
  8054. * @param itemOverlap drop or show overlap labels
  8055. */
  8056. /** @expose */
  8057. itemOverlap : function(_itemOverlap) {
  8058. this._itemOverlap = _itemOverlap;
  8059. return this;
  8060. },
  8061. /** @expose */
  8062. valueAccessor : function(valueAccessor) {
  8063. this._valueAccessor = valueAccessor;
  8064. return this;
  8065. },
  8066. /**
  8067. * Set the special transition used for clustered-to-stacked. Allowed values are: <ul> <li> "YX_CTS": The data handling changed from clustered to stacked, and the animation is to change the Y values then the X values </li> <li> "XY_CTS": The data handling changed from clustered to stacked, and the animation is to change the X values then the Y values </li> <li> "YX_STC": The data handling changed from stacked to clustered, and the animation is to change the Y values then the X values </li> <li> "XY_STC": The data handling changed from stacked to clustered, and the animation is to change the X values then the Y values </li> <li> null: No special transition </li> </ul>
  8068. * @param (String) specialTransition Transition
  8069. * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) This object
  8070. */
  8071. /** @expose */
  8072. specialTransition : function(specialTransition) {
  8073. this._specialTransition = specialTransition;
  8074. return this;
  8075. },
  8076. /** @expose */
  8077. delay : function(delayFunction) {
  8078. this._delay = delayFunction;
  8079. return this;
  8080. },
  8081. /** @expose */
  8082. borderWidth : function(width) {
  8083. this._borderWidth = width;
  8084. return this;
  8085. },
  8086. /** @expose */
  8087. borderColor : function(color) {
  8088. this._borderColor = color;
  8089. return this;
  8090. },
  8091. /** @expose */
  8092. labelFont : function(labelFontStyle) {
  8093. this._labelFontStyle = labelFontStyle;
  8094. return this;
  8095. },
  8096. /**
  8097. * @param (rave['internal']['RectStruct']) bounds The bounds of the chart area, used for label collision.
  8098. */
  8099. /** @expose */
  8100. bounds : function(bounds) {
  8101. this._bounds = bounds;
  8102. return this;
  8103. },
  8104. /**
  8105. * @param (String) className - the class name for labelslayer. If not set, the default is ".element-label-group" return this
  8106. */
  8107. /** @expose */
  8108. labelLayerClassName : function(className) {
  8109. this._labelLayerClass = className;
  8110. return this;
  8111. },
  8112. /**
  8113. * @param (String) className - the class name for elementslayer. If not set, the default is ".element-group" return this
  8114. */
  8115. /** @expose */
  8116. elementLayerClassName : function(className) {
  8117. this._elementLayerClass = className;
  8118. return this;
  8119. },
  8120. /**
  8121. * @param (boolean) labelContrast {boolean} whether to contrast the label color with background/background element color.
  8122. * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) this
  8123. */
  8124. /** @expose */
  8125. labelContrast : function(labelContrast) {
  8126. this._labelContrast = labelContrast;
  8127. return this;
  8128. },
  8129. /**
  8130. * @param (boolean) labelShadow {boolean} whether to show a label shadow with a contrast label color.
  8131. * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) this
  8132. */
  8133. /** @expose */
  8134. labelShadow : function(labelShadow) {
  8135. this._labelShadow = labelShadow;
  8136. return this;
  8137. },
  8138. rectangleCoord : function(a0, a1, a2, a3) {
  8139. var args = arguments;
  8140. if (args.length == 3) {
  8141. return this.rectangleCoord$0(a0, a1, a2);
  8142. }
  8143. return this.rectangleCoord$1(a0, a1, a2, a3);
  8144. }
  8145. });
  8146. /** @expose */
  8147. com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_TOP = 0;
  8148. /** @expose */
  8149. com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_CENTER = 1;
  8150. /** @expose */
  8151. com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_BOTTOM = 2;
  8152. // $source: com/ibm/rave/bundles/components/FilterComponentImpl
  8153. /************************************************************************
  8154. ** IBM Confidential
  8155. **
  8156. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  8157. **
  8158. ** (C) Copyright IBM Corp. 2017
  8159. **
  8160. ** The source code for this program is not published or otherwise divested of its trade secrets,
  8161. ** irrespective of what has been deposited with the U.S. Copyright Office.
  8162. ************************************************************************/
  8163. // GENERATED
  8164. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  8165. var com_ibm_rave_bundles_components_FilterComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  8166. //_id : null,
  8167. //color : null,
  8168. offset_x : 0,
  8169. offset_y : 0,
  8170. blur_radius : 0,
  8171. /** @expose */
  8172. constructor : function(id) {
  8173. this._id = id;
  8174. },
  8175. /** @expose */
  8176. setDropshadow : function(offset_x, offset_y, radius, rgb) {
  8177. this.offset_x = this.getValue(offset_x);
  8178. this.offset_y = this.getValue(offset_y);
  8179. this.blur_radius = this.getValue(radius);
  8180. this.color = rgb;
  8181. },
  8182. getValue : function(s) {
  8183. if (s == null) {
  8184. return 0;
  8185. }
  8186. return + (s.substring(0, s.length - 2));
  8187. },
  8188. /** @expose */
  8189. execute : function(g) {
  8190. var s = g.selectAll("#" + this._id).data([0]);
  8191. var filter = s.enter().append("filter").attr("id", this._id).attr("height", "500%").attr("width", "500%");
  8192. filter.append("feGaussianBlur").attr("in", "SourceAlpha");
  8193. filter.append("feOffset").attr("result", "offsetBlur");
  8194. filter.append("feFlood");
  8195. filter.append("feComposite").attr("in2", "offsetBlur").attr("operator", "in");
  8196. var merge = filter.append("feMerge");
  8197. merge.append("feMergeNode");
  8198. merge.append("feMergeNode").attr("in", "SourceGraphic");
  8199. s.select("feGaussianBlur").attr("stdDeviation", this.blur_radius);
  8200. s.select("feOffset").attr("dx", this.offset_x).attr("dy", this.offset_y);
  8201. s.select("feFlood").attr("flood-color", !this.color ? "black" : this.color);
  8202. },
  8203. /** @expose */
  8204. type : function() {
  8205. return "FilterComponent";
  8206. },
  8207. /** @expose */
  8208. getId : function() {
  8209. return this._id;
  8210. }
  8211. });
  8212. })();
  8213. },{"./configuration/configuration.json":1,"./i18n/messages_en.json":2,"./vizlibrary-column.css":4,"./vizlibrary.css":5}],4:[function(require,module,exports){
  8214. var css = ".vizlibrary-column .element-group .element-shape {\n fill: #ccc;\n fill-opacity: 1.0;\n stroke: white;\n stroke-width: 0.0px;\n shape-rendering: crispEdges;\n}\n.vizlibrary-column .element-shape.dim {\n fill-opacity: 0.3;\n stroke-width: 0.0px;\n}\n.vizlibrary-column .element-label {\n pointer-events: none;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-column/node/rave-library-column/vizlibrary-column.css"})); module.exports = css;
  8215. },{"browserify-css":6}],5:[function(require,module,exports){
  8216. 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-column/node/rave-library-column/vizlibrary.css"})); module.exports = css;
  8217. },{"browserify-css":6}],6:[function(require,module,exports){
  8218. 'use strict';
  8219. // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
  8220. module.exports = {
  8221. // Create a <link> tag with optional data attributes
  8222. createLink: function(href, attributes) {
  8223. var head = document.head || document.getElementsByTagName('head')[0];
  8224. var link = document.createElement('link');
  8225. link.href = href;
  8226. link.rel = 'stylesheet';
  8227. for (var key in attributes) {
  8228. if ( ! attributes.hasOwnProperty(key)) {
  8229. continue;
  8230. }
  8231. var value = attributes[key];
  8232. link.setAttribute('data-' + key, value);
  8233. }
  8234. head.appendChild(link);
  8235. },
  8236. // Create a <style> tag with optional data attributes
  8237. createStyle: function(cssText, attributes) {
  8238. var head = document.head || document.getElementsByTagName('head')[0],
  8239. style = document.createElement('style');
  8240. style.type = 'text/css';
  8241. for (var key in attributes) {
  8242. if ( ! attributes.hasOwnProperty(key)) {
  8243. continue;
  8244. }
  8245. var value = attributes[key];
  8246. style.setAttribute('data-' + key, value);
  8247. }
  8248. if (style.sheet) { // for jsdom and IE9+
  8249. style.innerHTML = cssText;
  8250. style.sheet.cssText = cssText;
  8251. head.appendChild(style);
  8252. } else if (style.styleSheet) { // for IE8 and below
  8253. head.appendChild(style);
  8254. style.styleSheet.cssText = cssText;
  8255. } else { // for Chrome, Firefox, and Safari
  8256. style.appendChild(document.createTextNode(cssText));
  8257. head.appendChild(style);
  8258. }
  8259. }
  8260. };
  8261. },{}]},{},[3]);
  8262. return rave.library.bundle.extension('columnBundle');
  8263. }));