rave-library-area.js 362 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741
  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.raveLibraryArea = 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=[{"previews":{"image":[{"file":"resources\/preview_area_small.png","tags":["small","notext"]}],"svg":[{"file":"resources\/preview_area_small.svg","tags":["small","notext"]}]},"genericMeta":{"copyright":"IBM 2015, 2016","author":"IBM","description":"areaBundle.metadata.description","id":"rave-library-area","label":"areaBundle.metadata.label","version":"1.0.0","tags":["area"]}},{"datamodels":[{"description":"datamodel.tabular.area.description","id":"tabular","label":"datamodel.tabular.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/x_axis_32.png","svg":"..\/rave-library\/resources\/x_axis_32.svg"},"description":"dataslot.x.area.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.area.description","id":"color","label":"dataslot.color.label","cardinality":"0..1","datatypes":["string"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.y.area.description","id":"y","label":"dataslot.value.label","cardinality":"1","datatypes":["numeric"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.key.description","id":"key","label":"dataslot.key.label","cardinality":"0..1","datatypes":["numeric","string","date"]}],"description":"dataset.tabular.area.description","id":"data","label":"dataset.tabular.label","type":"tabular","cardinality":"1"}],"tags":["area","simple","basic"]}]},{"properties":{"area":{"type":"object","properties":{"borderColor":{"default":"#FFFFFF","name":"area.borderColor.name","description":"area.borderColor.description","type":"color"},"borderWidth":{"default":"0px","name":"area.borderWidth.name","description":"area.borderWidth.description","type":"length"},"interpolate":{"default":"linear","name":"area.interpolate.name","options":[{"id":"area.interpolate.options.linear","value":"linear"},{"id":"area.interpolate.options.step","value":"step"},{"id":"area.interpolate.options.step-before","value":"step-before"},{"id":"area.interpolate.options.step-after","value":"step-after"},{"id":"area.interpolate.options.basis","value":"basis"},{"id":"area.interpolate.options.cardinal","value":"cardinal"}],"description":"area.interpolate.description","type":"string"},"opacity":{"default":1,"min":0,"name":"area.opacity.name","description":"area.opacity.description","type":"numeric"}}},"color":{"type":"object","properties":{"palette":{"name":"color.palette.name","options":["categorical"],"description":"color.palette.description","type":"palette"}}},"data":{"type":"object","properties":{"handling":{"default":"Simple","resetView":"data","name":"data.handling.name","options":[{"id":"data.handling.options.Simple","value":"Simple"},{"id":"data.handling.options.Stacked","value":"Stacked"},{"id":"data.handling.options.Stacked100","value":"Stacked100"},{"id":"data.handling.options.Stream","value":"Stream"}],"description":"data.handling.description","type":"string"}}},"effect":{"type":"object","properties":{"duration":{"default":1000,"min":0,"name":"effect.duration.name","description":"effect.duration.description","type":"numeric"},"name":{"default":"fromBase","name":"effect.name.name","options":[{"id":"effect.name.options.fromBase","value":"fromBase"},{"id":"effect.name.options.transition","value":"transition"},{"id":"effect.name.options.none","value":"none"}],"description":"effect.name.description","type":"string"}}},"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":{"layout":{"type":"object","properties":{"padding":{"default":"10","resetView":"layout","name":"layout.padding.name","description":"layout.padding.description","type":"padding"},"legendsize":{"type":"object","properties":{"min":{"default":"0","resetView":"layout","name":"layout.legendsize.min.name","description":"layout.legendsize.min.description","type":"length"},"max":{"default":"20%","resetView":"layout","name":"layout.legendsize.max.name","description":"layout.legendsize.max.description","type":"length"},"preferred":{"default":"20%","resetView":"layout","name":"layout.legendsize.preferred.name","description":"layout.legendsize.preferred.description","type":"length"}}},"legendchart":{"type":"object","properties":{"gap":{"default":"10","resetView":"layout","name":"layout.legendchart.gap.name","description":"layout.legendchart.gap.description","type":"length"},"align":{"default":false,"resetView":"layout","name":"layout.legendchart.align.name","description":"layout.legendchart.align.description","type":"boolean"}}},"chart":{"type":"object","properties":{"padding":{"type":"object","properties":{"top":{"default":"0","resetView":"layout","name":"layout.chart.padding.top.name","description":"layout.chart.padding.top.description","type":"length"},"left":{"default":"0","resetView":"layout","name":"layout.chart.padding.left.name","description":"layout.chart.padding.left.description","type":"length"},"bottom":{"default":"0","resetView":"layout","name":"layout.chart.padding.bottom.name","description":"layout.chart.padding.bottom.description","type":"length"},"right":{"default":"0","resetView":"layout","name":"layout.chart.padding.right.name","description":"layout.chart.padding.right.description","type":"length"}}}}}}}}},{"properties":{"background":{"type":"object","properties":{"elements":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.elements.color.name","description":"background.elements.color.description","type":"color"}}},"chart":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.chart.color.name","description":"background.chart.color.description","type":"color"}}}}}}},{"properties":{"transpose":{"trueLabel":"transpose.trueLabel","default":false,"falseLabel":"transpose.falseLabel","resetView":"layout","name":"transpose.name","description":"transpose.description","type":"boolean"}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.x.ticks.display.trueLabel","default":false,"falseLabel":"axis.x.ticks.display.falseLabel","name":"axis.x.ticks.display.name","description":"axis.x.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.ticks.style.stroke.name","description":"axis.x.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.x.line.display.trueLabel","default":false,"falseLabel":"axis.x.line.display.falseLabel","name":"axis.x.line.display.name","description":"axis.x.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.line.style.stroke.name","description":"axis.x.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.x.labels.display.trueLabel","default":true,"falseLabel":"axis.x.labels.display.falseLabel","resetView":"layout","name":"axis.x.labels.display.name","description":"axis.x.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.labels.style.font-size.name","description":"axis.x.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.labels.style.font-family.name","description":"axis.x.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.x.labels.style.fill.name","description":"axis.x.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.labels.style.font.name","description":"axis.x.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.x.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.x.labels.zoomPan.falseLabel","name":"axis.x.labels.zoomPan.name","description":"axis.x.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.x.title.display.trueLabel","default":true,"falseLabel":"axis.x.title.display.falseLabel","resetView":"layout","name":"axis.x.title.display.name","description":"axis.x.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.title.style.font-size.name","description":"axis.x.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.title.style.font-family.name","description":"axis.x.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.x.title.style.fill.name","description":"axis.x.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.title.style.font.name","description":"axis.x.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.x.title.text.name","description":"axis.x.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.x.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.x.scale.includeZero.falseLabel","resetView":"layout","name":"axis.x.scale.includeZero.name","description":"axis.x.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.x.scale.nice.trueLabel","default":false,"falseLabel":"axis.x.scale.nice.falseLabel","resetView":"layout","name":"axis.x.scale.nice.name","description":"axis.x.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"labels":{"type":"object","properties":{"allowRotate90":{"trueLabel":"axis.x.labels.allowRotate90.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate90.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate90.name","description":"axis.x.labels.allowRotate90.description","type":"boolean"},"layoutMode":{"default":"automatic","resetView":"layout","name":"axis.x.labels.layoutMode.name","options":[{"id":"axis.x.labels.layoutMode.options.automatic","value":"automatic"},{"id":"axis.x.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.x.labels.layoutMode.options.stagger","value":"stagger"},{"id":"axis.x.labels.layoutMode.options.rotate45","value":"rotate45"},{"id":"axis.x.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.x.labels.layoutMode.description","type":"string"},"allowRotate45":{"trueLabel":"axis.x.labels.allowRotate45.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate45.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate45.name","description":"axis.x.labels.allowRotate45.description","type":"boolean"},"allowStagger":{"trueLabel":"axis.x.labels.allowStagger.trueLabel","default":true,"falseLabel":"axis.x.labels.allowStagger.falseLabel","resetView":"layout","name":"axis.x.labels.allowStagger.name","description":"axis.x.labels.allowStagger.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.x.gridlines.display.trueLabel","default":false,"falseLabel":"axis.x.gridlines.display.falseLabel","name":"axis.x.gridlines.display.name","description":"axis.x.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.x.gridlines.style.stroke-dasharray.name","description":"axis.x.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.x.gridlines.style.stroke.name","description":"axis.x.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.y.ticks.display.trueLabel","default":false,"falseLabel":"axis.y.ticks.display.falseLabel","name":"axis.y.ticks.display.name","description":"axis.y.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.ticks.style.stroke.name","description":"axis.y.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.y.line.display.trueLabel","default":false,"falseLabel":"axis.y.line.display.falseLabel","name":"axis.y.line.display.name","description":"axis.y.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.line.style.stroke.name","description":"axis.y.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.y.labels.display.trueLabel","default":true,"falseLabel":"axis.y.labels.display.falseLabel","resetView":"layout","name":"axis.y.labels.display.name","description":"axis.y.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.labels.style.font-size.name","description":"axis.y.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.labels.style.font-family.name","description":"axis.y.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.y.labels.style.fill.name","description":"axis.y.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.labels.style.font.name","description":"axis.y.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.y.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.y.labels.zoomPan.falseLabel","name":"axis.y.labels.zoomPan.name","description":"axis.y.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.y.title.display.trueLabel","default":true,"falseLabel":"axis.y.title.display.falseLabel","resetView":"layout","name":"axis.y.title.display.name","description":"axis.y.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.title.style.font-size.name","description":"axis.y.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.title.style.font-family.name","description":"axis.y.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.y.title.style.fill.name","description":"axis.y.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.title.style.font.name","description":"axis.y.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.y.title.text.name","description":"axis.y.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.y.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.y.scale.includeZero.falseLabel","resetView":"layout","name":"axis.y.scale.includeZero.name","description":"axis.y.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.y.scale.nice.trueLabel","default":false,"falseLabel":"axis.y.scale.nice.falseLabel","resetView":"layout","name":"axis.y.scale.nice.name","description":"axis.y.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"labels":{"type":"object","properties":{"layoutMode":{"default":"horizontal","resetView":"layout","name":"axis.y.labels.layoutMode.name","options":[{"id":"axis.y.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.y.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.y.labels.layoutMode.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.y.gridlines.display.trueLabel","default":true,"falseLabel":"axis.y.gridlines.display.falseLabel","name":"axis.y.gridlines.display.name","description":"axis.y.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.y.gridlines.style.stroke-dasharray.name","description":"axis.y.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.y.gridlines.style.stroke.name","description":"axis.y.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"properties":{"legend":{"type":"object","properties":{"display":{"trueLabel":"legend.display.trueLabel","default":true,"falseLabel":"legend.display.falseLabel","resetView":"layout","name":"legend.display.name","description":"legend.display.description","type":"boolean"},"entrystyle":{"type":"object","properties":{"font":{"name":"legend.entrystyle.font.name","description":"legend.entrystyle.font.description","type":"font"}}},"position":{"default":"right","resetView":"layout","name":"legend.position.name","options":[{"id":"legend.position.options.top","value":"top"},{"id":"legend.position.options.bottom","value":"bottom"},{"id":"legend.position.options.right","value":"right"},{"id":"legend.position.options.left","value":"left"}],"description":"legend.position.description","type":"string"},"title":{"default":"","resetView":"layout","name":"legend.title.name","description":"legend.title.description","type":"string"},"titlestyle":{"type":"object","properties":{"fontfamily":{"default":null,"name":"legend.titlestyle.fontfamily.name","description":"legend.titlestyle.fontfamily.description","type":"string"},"fontsize":{"default":null,"resetView":"layout","name":"legend.titlestyle.fontsize.name","description":"legend.titlestyle.fontsize.description","type":"string"},"fill":{"default":null,"name":"legend.titlestyle.fill.name","description":"legend.titlestyle.fill.description","type":"color"},"font":{"resetView":"layout","name":"legend.titlestyle.font.name","description":"legend.titlestyle.font.description","type":"font"}}}}}}},{"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"}}}}}}}}},{"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":"area.interpolate"},{"propertyID":"axis.x.title.display"},{"propertyID":"axis.y.title.display"},{"propertyID":"legend.display"},{"propertyID":"legend.position"},{"propertyID":"area.opacity"}],"icon":"","description":"propertyPresentation.simple.description","id":"simple","label":"propertyPresentation.simple.label","tags":["Area","Stacked Area","Area Properties Presentation","Simple","ca.dashboard"]},{"presentationItems":[{"propertyGroup":{"presentationItems":[{"propertyID":"background.chart.color"},{"propertyID":"background.elements.color"},{"propertyID":"color.palette"},{"propertyID":"layout.padding"},{"propertyID":"data.handling"}],"icon":"","description":"propertyPresentation.advanced.commonProperties.description","id":"commonProperties","label":"propertyPresentation.advanced.commonProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"area.borderColor"},{"propertyID":"area.borderWidth"},{"propertyID":"area.opacity"},{"propertyID":"transpose"}],"icon":"","description":"area.propertyPresentation.advanced.areaSpecificProperties.description","id":"areaSpecificProperties","label":"area.propertyPresentation.advanced.areaSpecificProperties.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":["Area","Stacked Area","Area Properties Presentation","advanced","ca.reporting"]}]},{"configurations":[{"dataSlots":[{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/area_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/area_preview_320.png","tags":["medium","color"]},{"file":"resources\/area_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/area_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/area_preview_320.svg","tags":["medium","color"]},{"file":"resources\/area_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"area.config.area.description","id":"area","label":"area.config.area.label","tags":["ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"area.interpolate","value":"linear"},{"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":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/area_curved_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/area_curved_preview_320.png","tags":["medium","color"]},{"file":"resources\/area_curved_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/area_curved_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/area_curved_preview_320.svg","tags":["medium","color"]},{"file":"resources\/area_curved_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"area.config.smoothArea.description","id":"smoothArea","label":"area.config.smoothArea.label","tags":["ca.reporting","ca.dashboard"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"area.interpolate","value":"cardinal"},{"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":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/stream_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/stream_preview_320.png","tags":["medium","color"]},{"file":"resources\/stream_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/stream_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/stream_preview_320.svg","tags":["medium","color"]},{"file":"resources\/stream_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"area.config.river.description","id":"river","label":"area.config.river.label","tags":["ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"area.interpolate","value":"cardinal"},{"id":"data.handling","value":"Stream"},{"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"},{"id":"axis.y.line.display","value":false},{"id":"axis.y.ticks.display","value":false},{"id":"axis.y.labels.display","value":false},{"id":"axis.y.title.display","value":false},{"id":"axis.y.gridlines.display","value":false}]},{"dataSlots":[{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"y"},{"dataModelId":"tabular","dataSetId":"data","hidden":true,"dataSlotId":"key"}],"previews":{"image":[{"file":"resources\/steppedarea_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/steppedarea_preview_320.png","tags":["medium","color"]},{"file":"resources\/steppedarea_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/steppedarea_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/steppedarea_preview_320.svg","tags":["medium","color"]},{"file":"resources\/steppedarea_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"area.config.step.description","id":"step","label":"area.config.step.label","tags":["ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"area.interpolate","value":"step"},{"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"}]}]},{"build":"development","name":"rave-library-area","description":"This is the IBM Rave area 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. "area.borderColor.description": "The color of area border.",
  63. "area.borderColor.name": "Border color",
  64. "area.borderWidth.description": "The width of area border.",
  65. "area.borderWidth.name": "Border width",
  66. "area.config.area.description": "Area charts are like line charts, but the areas below the lines are filled with colors or patterns. Stacked charts are useful for comparing proportional contributions within a category. They plot the relative value that each data series contributes to the total.",
  67. "area.config.area.label": "Area",
  68. "area.config.river.description": "A river chart is an area chart where sections are stacked on top of one another instead of overlaying each other. Use river charts to show changes of different categories over time, when the categories start and stop at different times. The height of each individual river shows how the river has changed over time, while the length shows its duration. Colors can provide more information about a category's values or to differentiate between different categories.",
  69. "area.config.river.label": "River",
  70. "area.config.smoothArea.description": "Area charts are like line charts, but the areas below the lines are filled with colors or patterns. Stacked charts are useful for comparing proportional contributions within a category. They plot the relative value that each data series contributes to the total.",
  71. "area.config.smoothArea.label": "Smooth area",
  72. "area.config.step.description": "Area charts are like line charts, but the areas below the lines are filled with colors or patterns. Stepped area charts form a series of steps between data points.",
  73. "area.config.step.label": "Stepped area",
  74. "area.interpolate.description": "Controls how the top of the area chart is drawn.",
  75. "area.interpolate.name": "Interpolation mode",
  76. "area.interpolate.options.basis": "Basis",
  77. "area.interpolate.options.basis-open": "Basis-open",
  78. "area.interpolate.options.cardinal": "Cardinal",
  79. "area.interpolate.options.cardinal-open": "Cardinal-open",
  80. "area.interpolate.options.linear": "Linear",
  81. "area.interpolate.options.monotone": "Monotone",
  82. "area.interpolate.options.step": "Step",
  83. "area.interpolate.options.step-after": "Step-after",
  84. "area.interpolate.options.step-before": "Step-before",
  85. "area.opacity.description": "The opacity of the colored area. The value must be between 0 (fully transparent) and 1 (fully opaque).",
  86. "area.opacity.name": "Opacity",
  87. "area.propertyPresentation.advanced.areaSpecificProperties.description": "Area-specific properties",
  88. "area.propertyPresentation.advanced.areaSpecificProperties.label": "Area",
  89. "areaBundle.metadata.description": "Area charts are like line charts, but the areas below the lines are filled with colors or patterns. Stacked charts are useful for comparing proportional contributions within a category. They plot the relative value that each data series contributes to the total.",
  90. "areaBundle.metadata.label": "Area",
  91. "areaBundle.metadata.tags.area": "Area",
  92. "areaBundle.metadata.tags.stacked.area": "Stacked area",
  93. "axis.x.gridlines.display.description": "Shows or hides the X-axis gridlines.",
  94. "axis.x.gridlines.display.falseLabel": "Hide",
  95. "axis.x.gridlines.display.name": "Show gridlines",
  96. "axis.x.gridlines.display.trueLabel": "Show",
  97. "axis.x.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the X-axis gridlines.",
  98. "axis.x.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
  99. "axis.x.gridlines.style.stroke.description": "The color of the X-axis gridline.",
  100. "axis.x.gridlines.style.stroke.name": "Gridline color",
  101. "axis.x.labels.allowRotate45.description": "Enables or disables the rotate45 option for labels automatic layout.",
  102. "axis.x.labels.allowRotate45.falseLabel": "Disable rotate45 option",
  103. "axis.x.labels.allowRotate45.name": "Allow rotate 45",
  104. "axis.x.labels.allowRotate45.trueLabel": "Enable rotate45 option",
  105. "axis.x.labels.allowRotate90.description": "Enables or disables the rotate90 option for labels automatic layout.",
  106. "axis.x.labels.allowRotate90.falseLabel": "Disable rotate90 option",
  107. "axis.x.labels.allowRotate90.name": "Allow rotate 90",
  108. "axis.x.labels.allowRotate90.trueLabel": "Enable rotate90 option",
  109. "axis.x.labels.allowStagger.description": "Allows the stagger option for labels automatic layout.",
  110. "axis.x.labels.allowStagger.falseLabel": "X-axis do not allow stagger",
  111. "axis.x.labels.allowStagger.name": "Allow stagger",
  112. "axis.x.labels.allowStagger.trueLabel": "X-axis allow stagger",
  113. "axis.x.labels.display.description": "Shows or hides the X-axis labels.",
  114. "axis.x.labels.display.falseLabel": "Hide",
  115. "axis.x.labels.display.name": "Show labels",
  116. "axis.x.labels.display.trueLabel": "Show",
  117. "axis.x.labels.layoutMode.description": "Configure the layout mode for the X-axis labels.",
  118. "axis.x.labels.layoutMode.name": "Layout Mode",
  119. "axis.x.labels.layoutMode.options.automatic": "Automatic",
  120. "axis.x.labels.layoutMode.options.horizontal": "Horizontal",
  121. "axis.x.labels.layoutMode.options.rotate45": "Rotated 45 degrees",
  122. "axis.x.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  123. "axis.x.labels.layoutMode.options.stagger": "Stagger",
  124. "axis.x.labels.style.fill.description": "The color of X-axis labels.",
  125. "axis.x.labels.style.fill.name": "Label color",
  126. "axis.x.labels.style.font-family.description": "The font families of the X-axis labels.",
  127. "axis.x.labels.style.font-family.name": "Label font families",
  128. "axis.x.labels.style.font-size.description": "The size of X-axis labels (CSS size).",
  129. "axis.x.labels.style.font-size.name": "Label font size",
  130. "axis.x.labels.style.font.description": "The font properties of X-axis labels (CSS styles).",
  131. "axis.x.labels.style.font.name": "Label font",
  132. "axis.x.labels.zoomPan.description": "Shows or hides X-axis labels when panning and zooming.",
  133. "axis.x.labels.zoomPan.falseLabel": "Show",
  134. "axis.x.labels.zoomPan.name": "Label pan-zoom",
  135. "axis.x.labels.zoomPan.trueLabel": "Hide",
  136. "axis.x.line.display.description": "Shows or hides the X-axis line.",
  137. "axis.x.line.display.falseLabel": "Hide",
  138. "axis.x.line.display.name": "Show line",
  139. "axis.x.line.display.trueLabel": "Show",
  140. "axis.x.line.style.stroke.description": "The color of the X-axis line.",
  141. "axis.x.line.style.stroke.name": "Line color",
  142. "axis.x.scale.includeZero.description": "When set to Yes, includes 0 on the X-axis.",
  143. "axis.x.scale.includeZero.falseLabel": "Do not include",
  144. "axis.x.scale.includeZero.name": "Includes zero",
  145. "axis.x.scale.includeZero.trueLabel": "Include",
  146. "axis.x.scale.max.description": "The maximum value that appears on the X-axis.",
  147. "axis.x.scale.max.name": "Maximum value",
  148. "axis.x.scale.min.description": "The minimum value that appears on the X-axis.",
  149. "axis.x.scale.min.name": "Minimum value",
  150. "axis.x.scale.nice.description": "When set to Yes, uses nice endpoint values on the X-axis.",
  151. "axis.x.scale.nice.falseLabel": "Do not nice",
  152. "axis.x.scale.nice.name": "Nicing",
  153. "axis.x.scale.nice.trueLabel": "Apply nicing",
  154. "axis.x.ticks.display.description": "Shows or hides the X-axis tick marks.",
  155. "axis.x.ticks.display.falseLabel": "Hide",
  156. "axis.x.ticks.display.name": "Show ticks",
  157. "axis.x.ticks.display.trueLabel": "Show",
  158. "axis.x.ticks.style.stroke.description": "The color of the X-axis ticks.",
  159. "axis.x.ticks.style.stroke.name": "Tick color",
  160. "axis.x.title.display.description": "Shows or hides the X-axis title.",
  161. "axis.x.title.display.falseLabel": "Hide",
  162. "axis.x.title.display.name": "Show title",
  163. "axis.x.title.display.trueLabel": "Show",
  164. "axis.x.title.style.fill.description": "The color of the X-axis title.",
  165. "axis.x.title.style.fill.name": "Title color",
  166. "axis.x.title.style.font-family.description": "The font family names of the X-axis title.",
  167. "axis.x.title.style.font-family.name": "Title font families",
  168. "axis.x.title.style.font-size.description": "The X-axis title font size (CSS size).",
  169. "axis.x.title.style.font-size.name": "Title font size",
  170. "axis.x.title.style.font.description": "The X-axis title font properties (CSS style).",
  171. "axis.x.title.style.font.name": "Title font",
  172. "axis.x.title.text.description": "The title of the X-axis.",
  173. "axis.x.title.text.name": "Title",
  174. "axis.y.gridlines.display.description": "Shows or hides the Y-axis gridlines.",
  175. "axis.y.gridlines.display.falseLabel": "Hide",
  176. "axis.y.gridlines.display.name": "Show gridlines",
  177. "axis.y.gridlines.display.trueLabel": "Show",
  178. "axis.y.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the Y-axis gridlines.",
  179. "axis.y.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
  180. "axis.y.gridlines.style.stroke.description": "The color of the Y-axis gridline.",
  181. "axis.y.gridlines.style.stroke.name": "Gridline color",
  182. "axis.y.labels.display.description": "Shows or hides the Y-axis labels.",
  183. "axis.y.labels.display.falseLabel": "Hide",
  184. "axis.y.labels.display.name": "Show labels",
  185. "axis.y.labels.display.trueLabel": "Show",
  186. "axis.y.labels.layoutMode.description": "Configure the layout mode for the Y-axis labels.",
  187. "axis.y.labels.layoutMode.name": "Layout Mode",
  188. "axis.y.labels.layoutMode.options.horizontal": "Horizontal",
  189. "axis.y.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  190. "axis.y.labels.style.fill.description": "The color of Y-axis labels.",
  191. "axis.y.labels.style.fill.name": "Label color",
  192. "axis.y.labels.style.font-family.description": "The font families of the Y-axis labels.",
  193. "axis.y.labels.style.font-family.name": "Label font families",
  194. "axis.y.labels.style.font-size.description": "The size of Y-axis labels (CSS size).",
  195. "axis.y.labels.style.font-size.name": "Label font size",
  196. "axis.y.labels.style.font.description": "The font properties of Y-axis labels (CSS styles).",
  197. "axis.y.labels.style.font.name": "Label font",
  198. "axis.y.labels.zoomPan.description": "Shows or hides Y-axis labels when panning and zooming.",
  199. "axis.y.labels.zoomPan.falseLabel": "Show",
  200. "axis.y.labels.zoomPan.name": "Label pan-zoom",
  201. "axis.y.labels.zoomPan.trueLabel": "Hide",
  202. "axis.y.line.display.description": "Shows or hides the Y-axis line.",
  203. "axis.y.line.display.falseLabel": "Hide",
  204. "axis.y.line.display.name": "Show line",
  205. "axis.y.line.display.trueLabel": "Show",
  206. "axis.y.line.style.stroke.description": "The color of the Y-axis line.",
  207. "axis.y.line.style.stroke.name": "Line color",
  208. "axis.y.scale.includeZero.description": "When set to Yes, includes 0 on the Y-axis.",
  209. "axis.y.scale.includeZero.falseLabel": "Do not include",
  210. "axis.y.scale.includeZero.name": "Includes zero",
  211. "axis.y.scale.includeZero.trueLabel": "Include",
  212. "axis.y.scale.max.description": "The maximum value that appears on the Y-axis.",
  213. "axis.y.scale.max.name": "Maximum value",
  214. "axis.y.scale.min.description": "The minimum value tha appears on the Y-axis.",
  215. "axis.y.scale.min.name": "Minimum value",
  216. "axis.y.scale.nice.description": "When set to Yes, uses nice endpoint values on the Y-axis.",
  217. "axis.y.scale.nice.falseLabel": "Do not nice",
  218. "axis.y.scale.nice.name": "Nicing",
  219. "axis.y.scale.nice.trueLabel": "Apply nicing",
  220. "axis.y.ticks.display.description": "Shows or hides the Y-axis tick marks.",
  221. "axis.y.ticks.display.falseLabel": "Hide",
  222. "axis.y.ticks.display.name": "Show ticks",
  223. "axis.y.ticks.display.trueLabel": "Show",
  224. "axis.y.ticks.style.stroke.description": "The color of the Y-axis ticks.",
  225. "axis.y.ticks.style.stroke.name": "Tick color",
  226. "axis.y.title.display.description": "Shows or hides the Y-axis title.",
  227. "axis.y.title.display.falseLabel": "Hide",
  228. "axis.y.title.display.name": "Show title",
  229. "axis.y.title.display.trueLabel": "Show",
  230. "axis.y.title.style.fill.description": "The color of the Y-axis title.",
  231. "axis.y.title.style.fill.name": "Title color",
  232. "axis.y.title.style.font-family.description": "The font family names of the Y-axis title.",
  233. "axis.y.title.style.font-family.name": "Title font families",
  234. "axis.y.title.style.font-size.description": "The size of the Y-axis title font (CSS size).",
  235. "axis.y.title.style.font-size.name": "Title font size",
  236. "axis.y.title.style.font.description": "The Y-axis title font properties (CSS styles).",
  237. "axis.y.title.style.font.name": "Title font",
  238. "axis.y.title.text.description": "The title of the Y-axis.",
  239. "axis.y.title.text.name": "Title",
  240. "background.chart.color.description": "The background color of the chart.",
  241. "background.chart.color.name": "Background color",
  242. "background.elements.color.description": "The background color behind the elements of the chart.",
  243. "background.elements.color.name": "Elements background color",
  244. "color.palette.description": "The color palette that controls the colors or patterns that are applied to data elements in the chart.",
  245. "color.palette.name": "Color palette",
  246. "data.handling.description": "The configuration that is used to plot the data.",
  247. "data.handling.name": "Configuration",
  248. "data.handling.options.Simple": "Simple",
  249. "data.handling.options.Stacked": "Stacked",
  250. "data.handling.options.Stacked100": "Stacked 100%",
  251. "data.handling.options.Stream": "Stream",
  252. "datamodel.hierarchial.label": "Hierarchical data model",
  253. "datamodel.tabular.area.description": "Area chart tabular model, where each entry is a point on the area chart's top with X, Y, and optional group. The group value is used to group the points into areas.",
  254. "datamodel.tabular.label": "Tabular data model",
  255. "dataset.hierarchial.label": "Hierarchical data set",
  256. "dataset.tabular.area.description": "Area chart point data in tabular (array) form.",
  257. "dataset.tabular.description": "The tabular data set of rows and columns.",
  258. "dataset.tabular.label": "Tabular data set",
  259. "dataset.tabular.link.description": "Determines the links between the nodes.",
  260. "dataset.tabular.link.label": "Tabular links data set",
  261. "dataset.tabular.node.description": "The tabular data set that defines the nodes.",
  262. "dataset.tabular.node.label": "Tabular node data set",
  263. "dataslot.categories.label": "Categories",
  264. "dataslot.category.label": "Category",
  265. "dataslot.children.description": "When applied to a tree node, returns the children of that node as an array-list.",
  266. "dataslot.children.label": "Children",
  267. "dataslot.color.area.description": "Groups are used to combine points into areas. If groups are not specified, all points are in one area. Groups are also used for the area fill color.",
  268. "dataslot.color.description": "Determines the color of the shape.",
  269. "dataslot.color.label": "Color",
  270. "dataslot.key.description": "Called for each row to match elements. Primarily used for transitions.",
  271. "dataslot.key.label": "Key",
  272. "dataslot.label.description": "Determines the label of the shape.",
  273. "dataslot.label.label": "Label",
  274. "dataslot.maximumValue.label": "Maximum value",
  275. "dataslot.source.label": "Source",
  276. "dataslot.sourceValue.label": "Source value",
  277. "dataslot.tabular.id.description": "The identifier for the nodes.",
  278. "dataslot.tabular.id.label": "Identifier",
  279. "dataslot.tabular.size.description": "Determines the size of the shape.",
  280. "dataslot.tabular.size.label": "Size",
  281. "dataslot.target.label": "Target",
  282. "dataslot.targetValue.label": "Target value",
  283. "dataslot.value.label": "Value",
  284. "dataslot.x.area.description": "The X coordinate of the point. The value can be a number, string, or date.",
  285. "dataslot.x.label": "X axis",
  286. "dataslot.y.area.description": "The Y coordinate of the point. The value must be a number.",
  287. "dataslot.y.label": "Y axis",
  288. "defaultPalette.description": "Rave2 default description",
  289. "defaultPalette.label": "Rave2 default",
  290. "effect.duration.description": "The animation duration, in ms.",
  291. "effect.duration.name": "Animation duration (ms)",
  292. "effect.name.description": "The effect that is used when the chart is drawn.",
  293. "effect.name.name": "Animation",
  294. "effect.name.options.fromBase": "From base",
  295. "effect.name.options.none": "None",
  296. "effect.name.options.transition": "Transition",
  297. "grid.color.description": "The color of the grid lines.",
  298. "grid.color.name": "Grid line color",
  299. "grid.display.description": "Shows or hides the grid lines.",
  300. "grid.display.name": "Show grid lines",
  301. "layout.axissize.bottom.max.description": "The maximum size of the bottom axis, as a CSS size or percentage.",
  302. "layout.axissize.bottom.max.name": "Bottom axis maximum size",
  303. "layout.axissize.bottom.min.description": "The minimum size of the bottom axis, as a CSS size or percentage.",
  304. "layout.axissize.bottom.min.name": "Bottom axis minimum size",
  305. "layout.axissize.bottom.preferred.description": "The preferred size of the bottom axis, as a CSS size or percentage.",
  306. "layout.axissize.bottom.preferred.name": "Bottom axis preferred size",
  307. "layout.axissize.left.max.description": "The maximum size of the left axis, as a CSS size or percentage.",
  308. "layout.axissize.left.max.name": "Left axis maximum size",
  309. "layout.axissize.left.min.description": "The minimum size of the left axis, as a CSS size or percentage.",
  310. "layout.axissize.left.min.name": "Left axis minimum size",
  311. "layout.axissize.left.preferred.description": "The preferred size of the left axis, as a CSS size or percentage.",
  312. "layout.axissize.left.preferred.name": "Left axis preferred size",
  313. "layout.axissize.right.max.description": "The maximum size of the right axis, as a CSS size or percentage.",
  314. "layout.axissize.right.max.name": "Right axis maximum size",
  315. "layout.axissize.right.min.description": "The minimum size of the right axis, as a CSS size or percentage.",
  316. "layout.axissize.right.min.name": "Right axis minimum size",
  317. "layout.axissize.right.preferred.description": "The preferred size of the right axis, as a CSS size or percentage.",
  318. "layout.axissize.right.preferred.name": "Right axis preferred size",
  319. "layout.axissize.top.max.description": "The maximum size of the top axis, as a CSS size or percentage.",
  320. "layout.axissize.top.max.name": "Top axis maximum size",
  321. "layout.axissize.top.min.description": "The minimum size of the top axis, as a CSS size or percentage.",
  322. "layout.axissize.top.min.name": "Top axis minimum size",
  323. "layout.axissize.top.preferred.description": "The preferred size of the top axis, as a CSS size or percentage.",
  324. "layout.axissize.top.preferred.name": "Top axis preferred size",
  325. "layout.chart.padding.bottom.description": "The bottom padding for the chart.",
  326. "layout.chart.padding.bottom.name": "Bottom padding",
  327. "layout.chart.padding.left.description": "The left padding for the chart.",
  328. "layout.chart.padding.left.name": "Left padding",
  329. "layout.chart.padding.right.description": "Right padding for the chart.",
  330. "layout.chart.padding.right.name": "Right padding",
  331. "layout.chart.padding.top.description": "The top padding for the chart.",
  332. "layout.chart.padding.top.name": "Top padding",
  333. "layout.legendchart.align.description": "Whether to align the legend to the interior of the chart.",
  334. "layout.legendchart.align.name": "Align legend to chart",
  335. "layout.legendchart.gap.description": "Space between the chart and the legend, as a CSS size or percentage.",
  336. "layout.legendchart.gap.name": "Space between legend and chart",
  337. "layout.legendsize.max.description": "The maximum size of the legend, as a CSS size or percentage.",
  338. "layout.legendsize.max.name": "Maximum size",
  339. "layout.legendsize.min.description": "The minimum size of the legend, as a CSS size or percentage.",
  340. "layout.legendsize.min.name": "Minimum size",
  341. "layout.legendsize.preferred.description": "The preferred size of the legend, as a CSS size or percentage.",
  342. "layout.legendsize.preferred.name": "Preferred size",
  343. "layout.padding.description": "The padding around the chart and legend.",
  344. "layout.padding.name": "Padding",
  345. "legend.display.description": "Shows or hides the legend.",
  346. "legend.display.falseLabel": "Hide",
  347. "legend.display.name": "Show legend",
  348. "legend.display.trueLabel": "Show",
  349. "legend.entrystyle.font.description": "The font properties of the legend entry.",
  350. "legend.entrystyle.font.name": "Entry font",
  351. "legend.position.description": "The position of the legend in the chart.",
  352. "legend.position.name": "Legend position",
  353. "legend.position.options.bottom": "Bottom",
  354. "legend.position.options.left": "Left",
  355. "legend.position.options.right": "Right",
  356. "legend.position.options.top": "Top",
  357. "legend.title.description": "The title of the legend.",
  358. "legend.title.name": "Title",
  359. "legend.titlestyle.fill.description": "The color of the legend title.",
  360. "legend.titlestyle.fill.name": "Title color",
  361. "legend.titlestyle.font.description": "The font properties of the legend title.",
  362. "legend.titlestyle.font.name": "Title font",
  363. "legend.titlestyle.fontfamily.description": "The font family of the legend title.",
  364. "legend.titlestyle.fontfamily.name": "Title font family",
  365. "legend.titlestyle.fontsize.description": "The font size of the legend title.",
  366. "legend.titlestyle.fontsize.name": "Title font size",
  367. "propertyPresentation.advanced.axisSizeProperties.description": "Axis size properties.",
  368. "propertyPresentation.advanced.axisSizeProperties.label": "Axis size",
  369. "propertyPresentation.advanced.clientBehaviorProperties.description": "Client side properties.",
  370. "propertyPresentation.advanced.clientBehaviorProperties.label": "Client behavior",
  371. "propertyPresentation.advanced.commonProperties.description": "Common properties.",
  372. "propertyPresentation.advanced.commonProperties.label": "Common",
  373. "propertyPresentation.advanced.description": "Advanced list of all properties in a grouped structure.",
  374. "propertyPresentation.advanced.label": "Advanced",
  375. "propertyPresentation.advanced.labelProperties.description": "Label properties",
  376. "propertyPresentation.advanced.labelProperties.label": "Label",
  377. "propertyPresentation.advanced.legendProperties.description": "Legend properties.",
  378. "propertyPresentation.advanced.legendProperties.label": "Legend",
  379. "propertyPresentation.advanced.xAxisProperties.description": "X-axis properties.",
  380. "propertyPresentation.advanced.xAxisProperties.label": "X-axis",
  381. "propertyPresentation.advanced.yAxisProperties.description": "Y-axis properties.",
  382. "propertyPresentation.advanced.yAxisProperties.label": "Y-axis",
  383. "propertyPresentation.simple.description": "Simple list of the most common properties.",
  384. "propertyPresentation.simple.label": "Simple",
  385. "rave2.colorpalette.blueContinuousSequential.description": "Blue continuous sequential description",
  386. "rave2.colorpalette.blueContinuousSequential.label": "Blue continuous sequential",
  387. "rave2.colorpalette.blueDiscreteSequential.description": "Blue discrete sequential description",
  388. "rave2.colorpalette.blueDiscreteSequential.label": "Blue discrete sequential",
  389. "rave2.colorpalette.blueGreenContinuousDivergent.description": "Blue green continuous divergent description",
  390. "rave2.colorpalette.blueGreenContinuousDivergent.label": "Blue green continuous divergent",
  391. "rave2.colorpalette.blueGreenDiscreteDivergent.description": "Blue green discrete divergent description",
  392. "rave2.colorpalette.blueGreenDiscreteDivergent.label": "Blue green discrete divergent",
  393. "rave2.colorpalette.dark.description": "Dark description",
  394. "rave2.colorpalette.dark.label": "Dark",
  395. "rave2.colorpalette.financial.description": "Financial description",
  396. "rave2.colorpalette.financial.label": "Financial",
  397. "rave2.colorpalette.greenContinuousSequential.description": "Green continuous sequential description",
  398. "rave2.colorpalette.greenContinuousSequential.label": "Green continuous sequential",
  399. "rave2.colorpalette.greenDiscreteSequential.description": "Green discrete sequential description",
  400. "rave2.colorpalette.greenDiscreteSequential.label": "Green discrete sequential",
  401. "rave2.colorpalette.light.description": "Light description",
  402. "rave2.colorpalette.light.label": "Light",
  403. "rave2.colorpalette.medical.description": "Medical description",
  404. "rave2.colorpalette.medical.label": "Medical",
  405. "rave2.colorpalette.orangeContinuousSequential.description": "Orange continuous sequential description",
  406. "rave2.colorpalette.orangeContinuousSequential.label": "Orange continuous sequential",
  407. "rave2.colorpalette.orangeDiscreteSequential.description": "Orange discrete sequential description",
  408. "rave2.colorpalette.orangeDiscreteSequential.label": " Orange discrete sequential",
  409. "rave2.colorpalette.purpleContinuousSequential.description": "Purple continuous sequential description",
  410. "rave2.colorpalette.purpleContinuousSequential.label": "Purple continuous sequential",
  411. "rave2.colorpalette.purpleDiscreteSequential.description": "Purple discrete sequential description",
  412. "rave2.colorpalette.purpleDiscreteSequential.label": "Purple discrete sequential",
  413. "rave2.colorpalette.redBlueContinuousDivergent.description": "Red blue continuous divergent description",
  414. "rave2.colorpalette.redBlueContinuousDivergent.label": "Red blue continuous divergent",
  415. "rave2.colorpalette.redBlueDiscreteDivergent.description": "Red blue discrete divergent description",
  416. "rave2.colorpalette.redBlueDiscreteDivergent.label": "Red blue discrete divergent",
  417. "rave2.colorpalette.redBlueInverseContinuousDivergent.description": "Red blue inverse continuous divergent description",
  418. "rave2.colorpalette.redBlueInverseContinuousDivergent.label": "Red blue inverse continuous divergent",
  419. "rave2.colorpalette.redBlueInverseDiscreteDivergent.description": "Red blue inverse discrete divergent description",
  420. "rave2.colorpalette.redBlueInverseDiscreteDivergent.label": "Red blue inverse discrete divergent",
  421. "rave2.colorpalette.redContinuousSequential.description": "Red continuous sequential description",
  422. "rave2.colorpalette.redContinuousSequential.label": "Red continuous sequential",
  423. "rave2.colorpalette.redDiscreteSequential.description": "Red discrete sequential description",
  424. "rave2.colorpalette.redDiscreteSequential.label": " Red discrete sequential",
  425. "rave2.colorpalette.redGreenContinuousDivergent.description": "Red green continuous divergent description",
  426. "rave2.colorpalette.redGreenContinuousDivergent.label": "Red green continuous divergent",
  427. "rave2.colorpalette.redGreenDiscreteDivergent.description": "Red green discrete divergent description",
  428. "rave2.colorpalette.redGreenDiscreteDivergent.label": "Red green discrete divergent",
  429. "rave2.colorpalette.redGreenInverseContinuousDivergent.description": "Red green inverse continuous divergent description",
  430. "rave2.colorpalette.redGreenInverseContinuousDivergent.label": "Red green inverse continuous divergent",
  431. "rave2.colorpalette.redGreenInverseDiscreteDivergent.description": "Red green inverse discrete divergent description",
  432. "rave2.colorpalette.redGreenInverseDiscreteDivergent.label": "Red green inverse discrete divergent",
  433. "rave2.colorpalette.tealContinuousSequential.description": "Teal continuous sequential description",
  434. "rave2.colorpalette.tealContinuousSequential.label": "Teal continuous sequential",
  435. "rave2.colorpalette.tealDiscreteSequential.description": "Teal discrete sequential description",
  436. "rave2.colorpalette.tealDiscreteSequential.label": "Teal discrete sequential",
  437. "rave2.colorpalette.tealPurpleContinuousDivergent.description": "Teal purple continuous divergent description",
  438. "rave2.colorpalette.tealPurpleContinuousDivergent.label": "Teal purple continuous divergent",
  439. "rave2.colorpalette.tealPurpleDiscreteDivergent.description": "Teal purple discrete divergent description",
  440. "rave2.colorpalette.tealPurpleDiscreteDivergent.label": "Teal purple discrete divergent",
  441. "rave2.colorpalette.violetContinuousSequential.description": "Violet continuous sequential description",
  442. "rave2.colorpalette.violetContinuousSequential.label": "Violet continuous sequential",
  443. "rave2.colorpalette.violetDiscreteSequential.description": "Violet discrete sequential description",
  444. "rave2.colorpalette.violetDiscreteSequential.label": "Violet discrete sequential",
  445. "rave2.colorpalette.yellowContinuousSequential.description": "Yellow continuous sequential description",
  446. "rave2.colorpalette.yellowContinuousSequential.label": "Yellow continuous sequential",
  447. "rave2.colorpalette.yellowDiscreteSequential.description": "Yellow discrete sequential description",
  448. "rave2.colorpalette.yellowDiscreteSequential.label": "Yellow discrete sequential",
  449. "transpose.description": "When set to Yes, the Y-axis shows the independent scale and the X-axis shows the dependent scale.",
  450. "transpose.falseLabel": "Do not transpose",
  451. "transpose.name": "Switch X and Y axes",
  452. "transpose.trueLabel": "Transpose",
  453. "zoom.description": "Zooms the chart in the X, Y, or both directions.",
  454. "zoom.name": "Zoom",
  455. "zoom.options.both": "Both",
  456. "zoom.options.none": "None",
  457. "zoom.options.x": "X",
  458. "zoom.options.y": "Y"
  459. }
  460. },{}],3:[function(require,module,exports){
  461. (function() {
  462. var $ = {};
  463. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModuleHeader
  464. /************************************************************************
  465. ** IBM Confidential
  466. **
  467. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  468. **
  469. ** (C) Copyright IBM Corp. 2015
  470. **
  471. ** The source code for this program is not published or otherwise divested of its trade secrets,
  472. ** irrespective of what has been deposited with the U.S. Copyright Office.
  473. ************************************************************************/
  474. var com_ibm_rave_library_Library = rave["library"];
  475. rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
  476. rave["internal"]["CSSUtil"]= rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
  477. // $source: com/ibm/rave/bundles/RaveBundle
  478. /************************************************************************
  479. ** IBM Confidential
  480. **
  481. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  482. **
  483. ** (C) Copyright IBM Corp. 2017
  484. **
  485. ** The source code for this program is not published or otherwise divested of its trade secrets,
  486. ** irrespective of what has been deposited with the U.S. Copyright Office.
  487. ************************************************************************/
  488. // GENERATED
  489. //@import com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader (runtime) // new
  490. /**
  491. * A RaveBundle extends the regular Bundle abstract class but includes common functionality for Rave-made bundles that aren't for general use.
  492. */
  493. var com_ibm_rave_bundles_RaveBundle = rave['internal']['Declare'](rave['library']['internal']['Bundle'], {
  494. /** @expose */
  495. loader : null,
  496. /** @expose */
  497. constructor : function() {
  498. ;
  499. ;
  500. ;
  501. ;
  502. ;
  503. ;
  504. this.loader = new com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader("/com/ibm/rave/bundles/" + this.getName());
  505. },
  506. /**
  507. * Load extra resources required for this bundle. Currently the compiled configuration.json file. And .css.
  508. */
  509. /** @expose */
  510. loadResources : function() {
  511. this.setMessageCatalog(rave['library']['internal']['Bundle'].DEFAULT_LOCALE, require("./i18n/messages_en.json"));
  512. var array = require("./configuration/configuration.json");
  513. if (array) {
  514. for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
  515. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  516. var artifact = __exp_enFor0[__i_enFor0];
  517. this.initialize(artifact);
  518. }
  519. }
  520. require("./vizlibrary.css");
  521. }
  522. });
  523. //com_ibm_rave_bundles_RaveBundle.CONFIGURATION_FILE = "./configuration/configuration.json";
  524. // $source: com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader
  525. // Intentionally empty - everything in this file is inlined
  526. var com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader = function(){};
  527. // $source: com/ibm/rave/bundles/views/BundleView
  528. /************************************************************************
  529. ** IBM Confidential
  530. **
  531. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  532. **
  533. ** (C) Copyright IBM Corp. 2017
  534. **
  535. ** The source code for this program is not published or otherwise divested of its trade secrets,
  536. ** irrespective of what has been deposited with the U.S. Copyright Office.
  537. ************************************************************************/
  538. // GENERATED
  539. //@import com/ibm/rave/bundles/components/BackgroundComponentImpl (runtime) // new
  540. //@import com/ibm/rave/bundles/components/ChartLayoutComponentImpl (runtime) // new
  541. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  542. //@import com/ibm/rave/bundles/components/LegendsManager (runtime) // new
  543. //@import com/ibm/rave/bundles/components/AxesManager (runtime) // new
  544. //@import com/ibm/rave/library/Library (runtime) // Library
  545. //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities
  546. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
  547. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  548. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  549. var com_ibm_rave_bundles_views_BundleView = rave['internal']['Declare'](rave['library']['internal']['AbstractView'], {
  550. /**
  551. * Background component
  552. */
  553. /** @expose */
  554. _backgroundComponent : null,
  555. /**
  556. * Layout component
  557. */
  558. /** @expose */
  559. _layoutComponent : null,
  560. /**
  561. * Clip component
  562. */
  563. /** @expose */
  564. _clip : null,
  565. /**
  566. * Axes manager
  567. */
  568. /** @expose */
  569. _axes : null,
  570. /**
  571. * Legends manager
  572. */
  573. /** @expose */
  574. _legends : null,
  575. //_groupStructure : null,
  576. /** @expose */
  577. _chart : null,
  578. /** @expose */
  579. dataModel : null,
  580. /** @expose */
  581. _zoomP : null,
  582. /** @expose */
  583. _zoomS : null,
  584. /** @expose */
  585. constructor : function(context) {
  586. },
  587. /** @expose */
  588. getGroupStructure : function() {},
  589. /** @expose */
  590. setup : function() {
  591. rave['library']['internal']['AbstractView'].prototype.setup.call(this);
  592. this._backgroundComponent = new com_ibm_rave_bundles_components_BackgroundComponentImpl();
  593. this._layoutComponent = new com_ibm_rave_bundles_components_ChartLayoutComponentImpl();
  594. this._clip = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this.context.instanceId() + "clipViewport");
  595. if (this.isZoomSupported()) {
  596. this.resetZoom();
  597. }
  598. this._legends = new com_ibm_rave_bundles_components_LegendsManager(this.context, this.getLegendCount());
  599. if (this.isAxesManagerRequired()) {
  600. this._axes = new com_ibm_rave_bundles_components_AxesManager(this.context);
  601. }
  602. this._groupStructure = this.getGroupStructure();
  603. },
  604. /** @expose */
  605. preDraw : function(chartId) {
  606. this.cancelTransitions();
  607. rave['library']['internal']['AbstractView'].createGroupStructure(this.context.node, this._groupStructure);
  608. this._chart = this.context.node.selectAll(chartId);
  609. },
  610. /** @expose */
  611. resetZoom : function() {
  612. this._zoomP = [0, 0, 0, 0];
  613. this._zoomS = [1, 1, 1, 1];
  614. },
  615. /** @expose */
  616. validateDataModel : function(elementsToRemove) {
  617. if (elementsToRemove !== null || arguments.length > 1){
  618. elementsToRemove = Array.prototype.slice.call(arguments);
  619. }
  620. {
  621. this.dataModel = this.context.dataModel();
  622. if (!(this.dataValid())) {
  623. for (var __i_enFor0 = 0, __len_enFor0 = elementsToRemove.length;
  624. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  625. var e = elementsToRemove[__i_enFor0];
  626. this._chart.selectAll(e).selectAll("*").remove();
  627. }
  628. this._legends.visible(false).draw();
  629. return false;
  630. }
  631. return true;
  632. }
  633. },
  634. /** @expose */
  635. dataValid : function() {
  636. return this.dataModel.validate();
  637. },
  638. /** @expose */
  639. getLegendCount : function() {
  640. return 1;
  641. },
  642. /** @expose */
  643. isAxesManagerRequired : function() {
  644. return false;
  645. },
  646. /** @expose */
  647. isZoomSupported : function() {
  648. return true;
  649. },
  650. /** @expose */
  651. getProperty : function(s) {
  652. return this.context.getPropertyValue(s);
  653. },
  654. /** @expose */
  655. getPropertyDefault : function(s) {
  656. return this.context.getPropertyDefault(s);
  657. },
  658. /** @expose */
  659. getBooleanProperty : function(s) {
  660. var obj = this.getProperty(s);
  661. return (obj);
  662. },
  663. /** @expose */
  664. getDoubleProperty : function(s) {
  665. var obj = this.getProperty(s);
  666. return + (obj);
  667. },
  668. /** @expose */
  669. getIntProperty : function(s) {
  670. var obj = this.getProperty(s);
  671. return ~~ (obj);
  672. },
  673. /**
  674. * @param (String) id Property ID
  675. * @return (String) Property value as a string
  676. */
  677. /** @expose */
  678. getStringProperty : function(id) {
  679. var obj = this.getProperty(id);
  680. return (obj == null) ? null : ""+(obj);
  681. },
  682. /**
  683. * @param (String) id Property ID
  684. * @return (String) Property value as a string, returning null for the empty string
  685. */
  686. /** @expose */
  687. getStringPropertyEmptyAsNull : function(id) {
  688. var s = this.getStringProperty(id);
  689. return (s == null || s.length == 0) ? null : s;
  690. },
  691. /**
  692. * @param (String) id Property ID
  693. * @return (Number) Property value as a string, containing size as the number of pixels
  694. */
  695. /** @expose */
  696. getCSSSizeToPixelNumber : function(id) {
  697. var cssSize = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.context.getPropertyValue(id), 100.0, 10.0);
  698. return (cssSize == null) ? 0.0 : cssSize;
  699. },
  700. /**
  701. * Based on effect duration and effect property, determine the effect duration in ms.
  702. * @param (String) effect Effect name, one of the options available from EFFECT_OPTIONS.
  703. * @return (int) Effect duration in ms.
  704. */
  705. /** @expose */
  706. getEffectDuration : function(effect) {
  707. var duration = this.getIntProperty("effect.duration");
  708. if ((duration < 0) || (effect == null) || "none" == effect) {
  709. duration = 0;
  710. }
  711. return duration;
  712. },
  713. /** @expose */
  714. getTopPadding : function() {
  715. return this.getProperty("layout.chart.padding.top");
  716. },
  717. /** @expose */
  718. getLeftPadding : function() {
  719. return this.getProperty("layout.chart.padding.left");
  720. },
  721. /** @expose */
  722. getBottomPadding : function() {
  723. return this.getProperty("layout.chart.padding.bottom");
  724. },
  725. /** @expose */
  726. getRightPadding : function() {
  727. return this.getProperty("layout.chart.padding.right");
  728. },
  729. /** @expose */
  730. getLayoutPadding : function() {
  731. return this.getProperty("layout.padding");
  732. },
  733. /** @expose */
  734. getLegendChartGap : function() {
  735. return this.getProperty("layout.legendchart.gap");
  736. },
  737. /** @expose */
  738. getLegendChartAlign : function() {
  739. return this.getBooleanProperty("layout.legendchart.align");
  740. },
  741. /** @expose */
  742. getLegendPosition : function() {
  743. return this.getStringProperty("legend.position");
  744. },
  745. getPalette$0 : function() {
  746. return this.getPalette$1("color.palette");
  747. },
  748. getPalette$1 : function(paletteID) {
  749. var id = this.getStringProperty(paletteID);
  750. var colorPalette = com_ibm_rave_library_Library.palettes.getPalette(id);
  751. return (!colorPalette) ? com_ibm_rave_library_Library.palettes.getDefaultPalette() : colorPalette;
  752. },
  753. getDynamicPalette$0 : function() {
  754. return this.getDynamicPalette$1("color.palette", "color.dynamicPalette.min", "color.dynamicPalette.mid", "color.dynamicPalette.max");
  755. },
  756. /**
  757. * 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.
  758. * @param (String) paletteID The palette ID
  759. * @return (rave['library']['internal']['Palette']) Palette
  760. */
  761. getDynamicPalette$1 : function(paletteID, minId, midId, maxId) {
  762. var colorPalette;
  763. var min = this.getStringProperty(minId);
  764. if (min != null) {
  765. var mid = this.getStringProperty(midId);
  766. if (mid != null) {
  767. var max = this.getStringProperty(maxId);
  768. if (max != null) {
  769. var fills = [min, mid, max];
  770. colorPalette = rave['library']['internal']['AbstractView'].getFillPalette(fills);
  771. }
  772. }
  773. }
  774. return (!colorPalette) ? this.getPalette(paletteID) : colorPalette;
  775. },
  776. /** @expose */
  777. prepareLayoutComponent : function() {
  778. 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());
  779. },
  780. /** @expose */
  781. prepareLayoutSizables : function(layoutComponent, useX2, useY1, useX1, useY2, useLegend) {
  782. layoutComponent.removeAxisSizables();
  783. if (useX1) {
  784. layoutComponent.addAxisSizable(this._axes.axisComponent(0));
  785. }
  786. if (useY1) {
  787. layoutComponent.addAxisSizable(this._axes.axisComponent(2));
  788. }
  789. if (useX2) {
  790. layoutComponent.addAxisSizable(this._axes.axisComponent(1));
  791. }
  792. if (useY2) {
  793. layoutComponent.addAxisSizable(this._axes.axisComponent(3));
  794. }
  795. layoutComponent.legendSize(useLegend ? this._legends : null);
  796. },
  797. /** @expose */
  798. resetUpdate : function() {
  799. this.updateType = 4;
  800. },
  801. /** @expose */
  802. isUpdateNothing : function() {
  803. return this.updateType == 4;
  804. },
  805. /** @expose */
  806. isShowLegend : function() {
  807. return this.getBooleanProperty("legend.display");
  808. },
  809. cancelTransitions : function() {
  810. this.context.node.selectAll("*").interrupt();
  811. },
  812. /** @expose */
  813. setBackgroundProperties : function(elementRect, duration) {
  814. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).size(this.context.size).backgroundColor(this.getStringProperty("background.chart.color"));
  815. this.context.node.selectAll("rect.background.chart").transition().duration(duration).call(this._backgroundComponent);
  816. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(elementRect).backgroundColor(this.getStringProperty("background.elements.color"));
  817. this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
  818. },
  819. /** @expose */
  820. isShowDataLabels : function() {
  821. return this.getBooleanProperty("data.label.display");
  822. },
  823. /** @expose */
  824. isShowDataLabelsAsPercentageOfColor : function() {
  825. var dataLabel = this.getStringProperty("data.label.type");
  826. return "PercentOfColor" == dataLabel;
  827. },
  828. /** @expose */
  829. isShowDataLabelsAsPercentageOfCategory : function() {
  830. var dataLabel = this.getStringProperty("data.label.type");
  831. return "PercentOfCategory" == dataLabel;
  832. },
  833. /** @expose */
  834. getlDataLabelAccessor : function(dataSet, slot, isInterval) {
  835. var labelAccessor;
  836. var labelEntry = dataSet.slot(slot).entry();
  837. if (!labelEntry) {
  838. if (this.isShowDataLabelsAsPercentageOfCategory()) {
  839. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR;
  840. } else if (this.isShowDataLabelsAsPercentageOfColor()) {
  841. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR;
  842. } else {
  843. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR;
  844. }
  845. } else {
  846. labelAccessor = rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelEntry));
  847. }
  848. return labelAccessor;
  849. },
  850. /** @expose */
  851. getEntryForDataLabelFormatter : function(dataSet, labelSlot, defaultSlot) {
  852. var labelEntry = dataSet.slot(labelSlot).entry();
  853. return labelEntry ? labelEntry : dataSet.slot(defaultSlot).entry();
  854. },
  855. /** @expose */
  856. getBackgroundConstrastLabelStyle : function() {
  857. var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
  858. if (this.getBooleanProperty("contrast.label.color") == false) {
  859. return labelFontStyle;
  860. }
  861. var defaultFillColor;
  862. if (labelFontStyle) {
  863. defaultFillColor = labelFontStyle["fill"];
  864. if (defaultFillColor == null) {
  865. defaultFillColor = labelFontStyle["color"];
  866. }
  867. } else {
  868. labelFontStyle = {};
  869. }
  870. if (defaultFillColor == null) {
  871. defaultFillColor = "#000000";
  872. }
  873. labelFontStyle["fill"] = com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(this.getStringProperty("background.elements.color"), defaultFillColor);
  874. return labelFontStyle;
  875. },
  876. /** @expose */
  877. getPalette : function(a0) {
  878. var args = arguments;
  879. if (args.length == 0) {
  880. return this.getPalette$0();
  881. }
  882. if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
  883. return this.getPalette$1(a0);
  884. }
  885. return rave['library']['internal']['AbstractView'].prototype.getPalette.apply(this, args);
  886. },
  887. /** @expose */
  888. getDynamicPalette : function(a0, a1, a2, a3) {
  889. var args = arguments;
  890. if (args.length == 0) {
  891. return this.getDynamicPalette$0();
  892. }
  893. return this.getDynamicPalette$1(a0, a1, a2, a3);
  894. }
  895. });
  896. // $source: com/ibm/rave/bundles/components/BundleComponentImpl
  897. /************************************************************************
  898. ** IBM Confidential
  899. **
  900. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  901. **
  902. ** (C) Copyright IBM Corp. 2017
  903. **
  904. ** The source code for this program is not published or otherwise divested of its trade secrets,
  905. ** irrespective of what has been deposited with the U.S. Copyright Office.
  906. ************************************************************************/
  907. // GENERATED
  908. var com_ibm_rave_bundles_components_BundleComponentImpl = rave['internal']['Declare']({
  909. /**
  910. * The pre-execution callback.
  911. */
  912. //_preExecuteCallback : null,
  913. /**
  914. * The render callback.
  915. */
  916. /** @expose */
  917. _renderCallback : null,
  918. _$functionClassMethod : function() {
  919. var _$self = function(args) {
  920. if (args !== null || arguments.length > 1){
  921. args = Array.prototype.slice.call(arguments, 0);
  922. }
  923. {
  924. var self = _$self;
  925. this.each(function(data, index, groupIndex) {
  926. self.execute(rave.select(this));
  927. });
  928. return null;
  929. }
  930. };
  931. return _$self;
  932. },
  933. /**
  934. * 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.
  935. * @param (rave['internal']['Selector']) g <g> node that this component will be applied to.
  936. */
  937. /** @expose */
  938. execute : function(g) {},
  939. /**
  940. * Set the pre-execute callback for this component.
  941. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  942. */
  943. /** @expose */
  944. setPreExecute : function(callback) {
  945. this._preExecuteCallback = callback;
  946. return this;
  947. },
  948. /**
  949. * If the pre-execute component is non-null, call it with this object. Note that this object must also implement BundleComponent.
  950. */
  951. /** @expose */
  952. preExecute : function() {
  953. if (this._preExecuteCallback) {
  954. this._preExecuteCallback(this);
  955. }
  956. },
  957. /**
  958. * Set the render callback for this component.
  959. * @param (rave['internal']['RunFunction']) callback The callback
  960. */
  961. /** @expose */
  962. setRenderCallback : function(callback) {
  963. this._renderCallback = callback;
  964. return this;
  965. },
  966. /**
  967. * 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.
  968. */
  969. /** @expose */
  970. type : function() {},
  971. /** @expose */
  972. updateBorder : function(s, borderWidth, borderColor) {
  973. if (borderWidth != null) {
  974. s.each(function(data, index, groupIndex) {
  975. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  976. this.rave_setStyle("stroke-width", borderWidth, "");
  977. }
  978. });
  979. }
  980. if (borderColor != null) {
  981. s.each(function(data, index, groupIndex) {
  982. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  983. this.rave_setStyle("stroke", borderColor, "");
  984. }
  985. });
  986. }
  987. },
  988. /** @expose */
  989. getDefaultLabelColor : function(_labelStyle) {
  990. if (!_labelStyle) {
  991. return "#000000";
  992. }
  993. var defaultFillColor;
  994. if (_labelStyle) {
  995. defaultFillColor = _labelStyle["fill"];
  996. if (defaultFillColor == null) {
  997. defaultFillColor = _labelStyle["color"];
  998. }
  999. }
  1000. if (defaultFillColor == null) {
  1001. defaultFillColor = "#000000";
  1002. }
  1003. return defaultFillColor.toString();
  1004. }
  1005. });
  1006. // $source: com/ibm/rave/bundles/component/BackgroundComponent
  1007. /************************************************************************
  1008. ** IBM Confidential
  1009. **
  1010. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1011. **
  1012. ** (C) Copyright IBM Corp. 2017
  1013. **
  1014. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1015. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1016. ************************************************************************/
  1017. // GENERATED
  1018. /**
  1019. * <p> A component that renders the background to the chart. The {@link #this.type()} method returns "BackgroundComponent". </p>
  1020. */
  1021. var com_ibm_rave_bundles_component_BackgroundComponent = rave['internal']['Declare'].implement(
  1022. /**
  1023. * Get the background color.
  1024. * @return (String) The background color
  1025. */
  1026. //backgroundColor : function() {},
  1027. /**
  1028. * Set the background color. If the color is null, white is used.
  1029. * @param (String) backgroundColor The new background color
  1030. * @return (com.ibm.rave.bundles.component.BackgroundComponent) This object
  1031. */
  1032. //backgroundColor : function(backgroundColor) {}
  1033. );
  1034. /**
  1035. * The string returned by {@link #this.type()} is "BackgroundComponent".
  1036. */
  1037. /** @expose */
  1038. com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE = "BackgroundComponent";
  1039. // $source: com/ibm/rave/bundles/component/ChartLayoutComponent
  1040. /************************************************************************
  1041. ** IBM Confidential
  1042. **
  1043. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1044. **
  1045. ** (C) Copyright IBM Corp. 2017
  1046. **
  1047. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1048. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1049. ************************************************************************/
  1050. // GENERATED
  1051. /**
  1052. * <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>
  1053. */
  1054. var com_ibm_rave_bundles_component_ChartLayoutComponent = rave['internal']['Declare'].implement(
  1055. //padding : function() {},
  1056. //topPadding : function() {},
  1057. //leftPadding : function() {},
  1058. //bottomPadding : function() {},
  1059. //rightPadding : function() {},
  1060. //legendChartAlign : function() {},
  1061. //legendPosition : function() {},
  1062. //legendChartGap : function() {},
  1063. //legendPosition : function(position) {},
  1064. //topPadding : function(value) {},
  1065. //leftPadding : function(value) {},
  1066. //bottomPadding : function(value) {},
  1067. //rightPadding : function(value) {},
  1068. /**
  1069. * Sets the padding around the outside of the chart/legend.
  1070. * @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.
  1071. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1072. */
  1073. //padding : function(value) {},
  1074. /**
  1075. * Sets all chart paddings. Null values are treated as 0.
  1076. * @param (Object) top New top padding
  1077. * @param (Object) left New left padding
  1078. * @param (Object) bottom New bottom padding
  1079. * @param (Object) right New right padding
  1080. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1081. * @deprecated Please use {@link #this.padding(Object)} and {@link #this.legendChartGap(Object)}
  1082. */
  1083. //chartPadding : function(top, left, bottom, right) {},
  1084. /**
  1085. * Sets whether the legend should align with the chart "body".
  1086. * @param (boolean) legendChartAlign the boolean state
  1087. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1088. */
  1089. //legendChartAlign : function(legendChartAlign) {},
  1090. /**
  1091. * Set the space for the gap between chart and legend
  1092. * @param (Object) value the gap distance (css length)
  1093. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1094. */
  1095. //legendChartGap : function(value) {},
  1096. /**
  1097. * Set the size information for the legend. Null value is treated as no visible legend.
  1098. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1099. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1100. */
  1101. //legendSize : function(sizable) {},
  1102. /**
  1103. * Reset list of axis sizables to 0
  1104. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1105. */
  1106. //removeAxisSizables : function() {},
  1107. /**
  1108. * Add an axis to be considered in layout operation.
  1109. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1110. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1111. */
  1112. //addAxisSizable : function(sizable) {}
  1113. );
  1114. /**
  1115. * The string returned by {@link #this.type()} is "ChartLayoutComponent".
  1116. */
  1117. /** @expose */
  1118. com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE = "ChartLayoutComponent";
  1119. // $source: com/ibm/rave/bundles/components/LegendsManager
  1120. /************************************************************************
  1121. ** IBM Confidential
  1122. **
  1123. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1124. **
  1125. ** (C) Copyright IBM Corp. 2017
  1126. **
  1127. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1128. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1129. ************************************************************************/
  1130. // GENERATED
  1131. //@import com/ibm/rave/bundles/components/LegendComponentImpl (runtime) // new, orientationOf
  1132. /**
  1133. * <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>
  1134. */
  1135. var com_ibm_rave_bundles_components_LegendsManager = rave['internal']['Declare']({
  1136. /**
  1137. * Bundle context
  1138. */
  1139. //_context : null,
  1140. /**
  1141. * Component used to draw all legends
  1142. */
  1143. //_comp : null,
  1144. /**
  1145. * Global visibility; if false no legends are drawn
  1146. */
  1147. //_visible : null,
  1148. /**
  1149. * Rectangle containing all legends
  1150. */
  1151. //_rectangle : null,
  1152. /**
  1153. * Legend orientation
  1154. */
  1155. //_orient : null,
  1156. /**
  1157. * Pre-execute component callback
  1158. */
  1159. //_preExecute : null,
  1160. /**
  1161. * Selectors for each legend
  1162. */
  1163. //_selectors : null,
  1164. /**
  1165. * Palettes for each legend
  1166. */
  1167. //_palettes : null,
  1168. /**
  1169. * Scale size functions for each legend
  1170. */
  1171. //_scale : null,
  1172. /**
  1173. * Swatch size functions for each legend
  1174. */
  1175. //_swatchSizes : null,
  1176. /**
  1177. * Shapes for each legend
  1178. */
  1179. //_shapes : null,
  1180. /**
  1181. * Titles for each legend
  1182. */
  1183. //_titles : null,
  1184. /**
  1185. * Title fonts for each legend
  1186. */
  1187. //_titleFonts : null,
  1188. /**
  1189. * Title fills for each legend
  1190. */
  1191. //_titleFills : null,
  1192. /**
  1193. * Title font sizes for each legend
  1194. */
  1195. //_titleFontSizes : null,
  1196. /**
  1197. * Title font families for each legend
  1198. */
  1199. //_titleFontFamilies : null,
  1200. /**
  1201. * Entry fonts for each legend
  1202. */
  1203. //_entryFonts : null,
  1204. /**
  1205. * Custom formatters for each legend, created from the registered custom formatters
  1206. */
  1207. //_formatters : null,
  1208. /**
  1209. * Whether each legend was visible in the last draw
  1210. */
  1211. //_lastVisible : null,
  1212. //_dataSlotEntries : null,
  1213. /**
  1214. * Number of legends
  1215. */
  1216. _numLegends : 0,
  1217. /**
  1218. * Whether to use a transition.
  1219. */
  1220. _doTransition : false,
  1221. /**
  1222. * Duration of the transition.
  1223. */
  1224. _duration : 0,
  1225. _spaceUsed : 0,
  1226. /**
  1227. * Construct the manager.
  1228. * @param (int) numLegends Number of legends, must be positive
  1229. */
  1230. /** @expose */
  1231. constructor : function(context, numLegends) {
  1232. this._context = context;
  1233. this._numLegends = numLegends;
  1234. this._comp = new com_ibm_rave_bundles_components_LegendComponentImpl();
  1235. this._rectangle = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1236. this._orient = "vertical";
  1237. this._preExecute = null;
  1238. this._selectors = [];
  1239. this._palettes = [];
  1240. this._scale = [];
  1241. this._swatchSizes = [];
  1242. this._shapes = [];
  1243. this._titles = [];
  1244. this._titleFonts = [];
  1245. this._titleFills = [];
  1246. this._titleFontSizes = [];
  1247. this._titleFontFamilies = [];
  1248. this._entryFonts = [];
  1249. this._formatters = [];
  1250. this._lastVisible = [];
  1251. this._visible = [];
  1252. this._dataSlotEntries = [];
  1253. for (var i = 0; i < this._numLegends; ++i) {
  1254. this._selectors[i] = null;
  1255. this._palettes[i] = null;
  1256. this._swatchSizes[i] = null;
  1257. this._shapes[i] = null;
  1258. this._titles[i] = null;
  1259. this._formatters[i] = null;
  1260. this._lastVisible[i] = false;
  1261. this._visible[i] = true;
  1262. }
  1263. },
  1264. /**
  1265. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) The legend component used by this manager; for unit tests
  1266. */
  1267. getLegendComponent : function() {
  1268. return this._comp;
  1269. },
  1270. /**
  1271. * Set a specific legend visible
  1272. * @param (int) legendIndex The index of the legend
  1273. * @param (boolean) visible New value of visible flag
  1274. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1275. */
  1276. visible$0 : function(legendIndex, visible) {
  1277. if (legendIndex < this._visible.length) {
  1278. this._visible[legendIndex] = visible;
  1279. }
  1280. return this;
  1281. },
  1282. /**
  1283. * Set all legend visible
  1284. * @param (boolean) visible New value of visible flag
  1285. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1286. */
  1287. visible$1 : function(visible) {
  1288. for (var i = 0; i < this._visible.length; ++i) {
  1289. this._visible[i] = visible;
  1290. }
  1291. return this;
  1292. },
  1293. /**
  1294. * Set the layout rectangle. The rectangle is copied. If it is null, the layout rectangle is unchanged.
  1295. * @param (rave['internal']['RectStruct']) rect New layout rectangle
  1296. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1297. */
  1298. /** @expose */
  1299. rectangle : function(rect) {
  1300. if (rect) {
  1301. this._rectangle = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  1302. }
  1303. return this;
  1304. },
  1305. /**
  1306. * Set the orient property. If the argument is not "horizontal" or "vertical", the orient property is not changed.
  1307. * @param (String) orient New orient
  1308. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1309. */
  1310. /** @expose */
  1311. orient : function(orient) {
  1312. if ("horizontal" == orient || "vertical" == orient) {
  1313. this._orient = orient;
  1314. }
  1315. return this;
  1316. },
  1317. /**
  1318. * 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".
  1319. * @param (String) position Legend position
  1320. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1321. */
  1322. /** @expose */
  1323. position : function(position) {
  1324. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  1325. },
  1326. /**
  1327. * Set the transition information. If the duration is negative, 0 is used.
  1328. * @param (boolean) doTransition Whether to do a transition
  1329. * @param (int) duration Duration of the transition when used
  1330. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1331. */
  1332. /** @expose */
  1333. transition : function(doTransition, duration) {
  1334. this._doTransition = doTransition;
  1335. this._duration = (duration >= 0) ? duration : 0;
  1336. return this;
  1337. },
  1338. /**
  1339. * Set the pre-execute callback for all legends. The callback may be null.
  1340. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  1341. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1342. */
  1343. /** @expose */
  1344. setPreExecute : function(callback) {
  1345. this._preExecute = callback;
  1346. return this;
  1347. },
  1348. /**
  1349. * Set the selector to be used when rendering a legend. If the index is out of range no selectors change.
  1350. * @param (int) index Legend array index
  1351. * @param (rave['internal']['Selector']) selector Selector, may be null (but this is not advisable)
  1352. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1353. */
  1354. /** @expose */
  1355. selector : function(index, selector) {
  1356. if (index >= 0 && index < this._numLegends) {
  1357. this._selectors[index] = selector;
  1358. }
  1359. return this;
  1360. },
  1361. /**
  1362. * Set the palette of a legend. If the index is out of range no information is changed.
  1363. * @param (int) index Legend array index
  1364. * @param (rave['library']['internal']['Palette']) palette Palette, may be null
  1365. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1366. */
  1367. /** @expose */
  1368. palette : function(index, palette) {
  1369. if (index >= 0 && index < this._numLegends) {
  1370. this._palettes[index] = palette;
  1371. }
  1372. return this;
  1373. },
  1374. /**
  1375. * Set the shape of a legend. If the index is out of range no information is changed.
  1376. * @param (int) index Legend array index
  1377. * @param (String) shape Shape, may be null (defaulting to square)
  1378. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1379. */
  1380. /** @expose */
  1381. shape : function(index, shape) {
  1382. if (index >= 0 && index < this._numLegends) {
  1383. this._shapes[index] = shape;
  1384. }
  1385. return this;
  1386. },
  1387. /**
  1388. * Set the title of a legend. If the index is out of range no information is changed.
  1389. * @param (int) index Legend array index
  1390. * @param (String) title Title, may be null
  1391. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1392. */
  1393. /** @expose */
  1394. title : function(index, title) {
  1395. if (index >= 0 && index < this._numLegends) {
  1396. this._titles[index] = title;
  1397. }
  1398. return this;
  1399. },
  1400. /**
  1401. * Set the title font style of a legend. If the index is out of range no information is changed.
  1402. * @param (int) index Legend array index
  1403. * @param (String) titleFont Title font string, may be null
  1404. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1405. */
  1406. /** @expose */
  1407. titleFont : function(index, titleFont) {
  1408. if (index >= 0 && index < this._numLegends) {
  1409. this._titleFonts[index] = titleFont;
  1410. }
  1411. return this;
  1412. },
  1413. /**
  1414. * Set the entry font style of a legend. If the index is out of range no information is changed.
  1415. * @param (int) index Legend array index
  1416. * @param (String) entryFont Entry font string, may be null
  1417. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1418. */
  1419. /** @expose */
  1420. entryFont : function(index, entryFont) {
  1421. if (index >= 0 && index < this._numLegends) {
  1422. this._entryFonts[index] = entryFont;
  1423. }
  1424. return this;
  1425. },
  1426. /**
  1427. * Set the title fill of a legend. If the index is out of range no information is changed.
  1428. * @param (int) index Legend array index
  1429. * @param (String) titleFill Fill color string, may be null
  1430. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1431. */
  1432. /** @expose */
  1433. titleFill : function(index, titleFill) {
  1434. if (index >= 0 && index < this._numLegends) {
  1435. this._titleFills[index] = titleFill;
  1436. }
  1437. return this;
  1438. },
  1439. /**
  1440. * Set the title font size of a legend. If the index is out of range no information is changed.
  1441. * @param (int) index Legend array index
  1442. * @param (String) titleFontSize Font size string, may be null
  1443. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1444. */
  1445. /** @expose */
  1446. titleFontSize : function(index, titleFontSize) {
  1447. if (index >= 0 && index < this._numLegends) {
  1448. this._titleFontSizes[index] = titleFontSize;
  1449. }
  1450. return this;
  1451. },
  1452. /**
  1453. * Set the title font family of a legend. If the index is out of range no information is changed.
  1454. * @param (int) index Legend array index
  1455. * @param (String) titleFontFamily Font family string, may be null
  1456. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1457. */
  1458. /** @expose */
  1459. titleFontFamily : function(index, titleFontFamily) {
  1460. if (index >= 0 && index < this._numLegends) {
  1461. this._titleFontFamilies[index] = titleFontFamily;
  1462. }
  1463. return this;
  1464. },
  1465. /**
  1466. * Set the scale of a legend. If the index is out of range no information is changed.
  1467. * @param (int) index Legend array index
  1468. * @param (rave['internal']['AbstractScale']) scale Scale, may be null
  1469. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1470. */
  1471. /** @expose */
  1472. scale : function(index, scale) {
  1473. if (index >= 0 && index < this._numLegends) {
  1474. this._scale[index] = scale;
  1475. }
  1476. return this;
  1477. },
  1478. /**
  1479. * Set the swatch size function of a legend. If the index is out of range no information is changed.
  1480. * @param (int) index Legend array index
  1481. * @param (rave['internal']['ValueFunction']) swatchSize Swatch size function, may be null
  1482. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1483. */
  1484. /** @expose */
  1485. swatchSize : function(index, swatchSize) {
  1486. if (index >= 0 && index < this._numLegends) {
  1487. this._swatchSizes[index] = swatchSize;
  1488. }
  1489. return this;
  1490. },
  1491. /**
  1492. * 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.
  1493. * @param (int) index Legend array index
  1494. * @param (Array) entries List of data slot entries, if null an empty list is used
  1495. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  1496. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined, may be null
  1497. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1498. */
  1499. /** @expose */
  1500. formatterList : function(index, entries, format, defaultFunction) {
  1501. if (index >= 0 && index < this._numLegends) {
  1502. this._formatters[index] = this._context.getCustomFormatterWithFlag(["legend", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("legend-label", "ROLE_NONE", format, entries), defaultFunction, false);
  1503. }
  1504. return this;
  1505. },
  1506. /**
  1507. * 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.
  1508. * @param (int) index Legend array index
  1509. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1510. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1511. */
  1512. /** @expose */
  1513. formatter : function(index, entry) {
  1514. var entries = [];
  1515. if (entry) {
  1516. entries.push(entry);
  1517. }
  1518. return this.formatterList(index, entries, "none", null);
  1519. },
  1520. /**
  1521. * 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.
  1522. * @return (boolean) Whether any legend are visible (will be drawn)
  1523. */
  1524. /** @expose */
  1525. anyVisible : function() {
  1526. for (var i = 0; i < this._numLegends; ++i) {
  1527. if (this._visible[i] == true && (this._palettes[i] || this._swatchSizes[i])) {
  1528. return true;
  1529. }
  1530. }
  1531. return false;
  1532. },
  1533. /**
  1534. * 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'])} .
  1535. * @param (int) index Legend array index
  1536. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1537. * @return (com.ibm.rave.bundles.components.LegendsManager) This LegendsManager
  1538. */
  1539. /** @expose */
  1540. setDataSlot : function(index, entry) {
  1541. if (index >= 0 && index < this._numLegends) {
  1542. this._dataSlotEntries[index] = entry;
  1543. }
  1544. return this.formatter(index, entry);
  1545. },
  1546. preLayout$0 : function(layoutComponent) {
  1547. this.preLayout$1(layoutComponent, true);
  1548. return this;
  1549. },
  1550. preLayout$1 : function(layoutComponent, axesBeforeLegend) {
  1551. var layoutTransition = this._doTransition;
  1552. var layoutDuration = this._duration;
  1553. this._doTransition = false;
  1554. this._duration = 0;
  1555. var children = [];
  1556. for (var i = 0; i < this._numLegends; ++i) {
  1557. children[i] = "g.layoutLegend-" + i;
  1558. }
  1559. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.legends-layout"), children);
  1560. var layoutSelectors = [];
  1561. var layoutLastVisible = [];
  1562. for (var i = 0; i < this._numLegends; ++i) {
  1563. layoutSelectors[i] = this._selectors[i];
  1564. layoutLastVisible[i] = this._lastVisible[i];
  1565. this._lastVisible[i] = false;
  1566. if (this._selectors[i]) {
  1567. this._selectors[i] = this._context.node.select("g.layoutLegend-" + i);
  1568. }
  1569. }
  1570. layoutComponent.preLayout(true, !axesBeforeLegend);
  1571. this.rectangle(layoutComponent.legendRect());
  1572. this.draw();
  1573. this._doTransition = layoutTransition;
  1574. this._duration = layoutDuration;
  1575. this._context.node.select("g.legends-layout").selectAll("*").remove();
  1576. for (var i = 0; i < this._numLegends; ++i) {
  1577. this._lastVisible[i] = layoutLastVisible[i];
  1578. this._selectors[i] = layoutSelectors[i];
  1579. }
  1580. return this;
  1581. },
  1582. /**
  1583. * Render the legends using the current global and per-legend settings.
  1584. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1585. */
  1586. /** @expose */
  1587. draw : function() {
  1588. var nVisible = 0;
  1589. for (var i = 0; i < this._numLegends; ++i) {
  1590. if ((this._swatchSizes[i] || this._palettes[i]) && this._visible[i]) {
  1591. nVisible++;
  1592. }
  1593. }
  1594. var x = this._rectangle.x;
  1595. var y = this._rectangle.y;
  1596. var dx;
  1597. var dy;
  1598. var size;
  1599. if (nVisible == 0) {
  1600. dx = 0;
  1601. dy = 0;
  1602. size = [this._rectangle.width, this._rectangle.height];
  1603. } else if ("horizontal" == this._orient) {
  1604. dx = this._rectangle.width / nVisible;
  1605. dy = 0;
  1606. size = [dx, this._rectangle.height];
  1607. } else {
  1608. dx = 0;
  1609. dy = this._rectangle.height / nVisible;
  1610. size = [this._rectangle.width, dy];
  1611. }
  1612. this._comp.orient(this._orient).size(size);
  1613. this._spaceUsed = 0;
  1614. for (var i = 0; i < this._numLegends; ++i) {
  1615. if (this._selectors[i]) {
  1616. var visible = this._visible[i] && (this._palettes[i] || this._swatchSizes[i]);
  1617. 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]);
  1618. var fontStyle = this._context.getPropertyValue("legend.titlestyle.font");
  1619. if (this._titleFonts[i] != null && !(this._titleFonts[i] == "")) {
  1620. this._comp.titleFont(this._titleFonts[i]);
  1621. } else if (fontStyle != null && !(fontStyle == "")) {
  1622. this._comp.titleFont(this._context.getPropertyValue("legend.titlestyle.font"));
  1623. }
  1624. fontStyle = this._context.getPropertyValue("legend.entrystyle.font");
  1625. if (this._entryFonts[i] != null) {
  1626. this._comp.entryFont(this._entryFonts[i]);
  1627. } else if (fontStyle != null && !(fontStyle == "")) {
  1628. this._comp.entryFont(this._context.getPropertyValue("legend.entrystyle.font"));
  1629. }
  1630. var s = (this._doTransition && this._lastVisible[i]) ? this._selectors[i].transition("transition").duration(this._duration) : this._selectors[i];
  1631. s.attr("transform", "translate(" + x + "," + y + ")").call(this._comp);
  1632. var dataSlotEntries = [];
  1633. if (this._dataSlotEntries[i]) {
  1634. dataSlotEntries.push(this._dataSlotEntries[i]);
  1635. }
  1636. this._selectors[i].selectAll(".legendTitle").property("dataSlots", dataSlotEntries);
  1637. if (visible) {
  1638. x += dx;
  1639. y += dy;
  1640. if (this._comp.getSpaceUsed() > this._spaceUsed) {
  1641. this._spaceUsed = this._comp.getSpaceUsed();
  1642. }
  1643. }
  1644. this._lastVisible[i] = visible;
  1645. } else {
  1646. this._lastVisible[i] = false;
  1647. }
  1648. }
  1649. return this;
  1650. },
  1651. /** @expose */
  1652. getSizableType : function() {
  1653. return 2;
  1654. },
  1655. /** @expose */
  1656. getSizableOrientation : function() {
  1657. return this._orient;
  1658. },
  1659. /** @expose */
  1660. getPreferredSize : function() {
  1661. return this._spaceUsed;
  1662. },
  1663. /** @expose */
  1664. getSpillOverSize : function() {
  1665. return 0;
  1666. },
  1667. /** @expose */
  1668. visible : function(a0, a1) {
  1669. var args = arguments;
  1670. if (args.length == 1) {
  1671. return this.visible$1(a0);
  1672. }
  1673. return this.visible$0(a0, a1);
  1674. },
  1675. /** @expose */
  1676. preLayout : function(a0, a1) {
  1677. var args = arguments;
  1678. if (args.length == 1) {
  1679. return this.preLayout$0(a0);
  1680. }
  1681. return this.preLayout$1(a0, a1);
  1682. }
  1683. });
  1684. // $source: com/ibm/rave/bundles/utilities/FontPropertyParser
  1685. /************************************************************************
  1686. ** IBM Confidential
  1687. **
  1688. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1689. **
  1690. ** (C) Copyright IBM Corp. 2017
  1691. **
  1692. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1693. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1694. ************************************************************************/
  1695. // GENERATED
  1696. var com_ibm_rave_bundles_utilities_FontPropertyParser = rave['internal']['Declare']({
  1697. });
  1698. /**
  1699. * Method to parse the css font styles and return a style map.
  1700. * @param (String) fontStyle CSS string (eg. "font-family: courier; font-size: 22; fill: red")
  1701. * @return (Object) Font Style Map
  1702. */
  1703. /** @expose */
  1704. com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont = function(fontStyle) {
  1705. if (fontStyle != null && fontStyle.length > 0) {
  1706. var properties = fontStyle.split(new RegExp(";"));
  1707. var fontStyles = {};
  1708. for (var __i_enFor0 = 0, __len_enFor0 = properties.length;
  1709. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  1710. var property = properties[__i_enFor0];
  1711. var fontMap = property.split(new RegExp(":"));
  1712. if (fontMap.length == 2) {
  1713. var key = fontMap[0].trim();
  1714. fontStyles[key == "color" ? "fill" : key] = fontMap[1].trim();
  1715. }
  1716. }
  1717. return fontStyles;
  1718. }
  1719. return null;
  1720. };
  1721. // $source: com/ibm/rave/bundles/components/AxesManager
  1722. /************************************************************************
  1723. ** IBM Confidential
  1724. **
  1725. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1726. **
  1727. ** (C) Copyright IBM Corp. 2018
  1728. **
  1729. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1730. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1731. ************************************************************************/
  1732. // GENERATED
  1733. //@import com/ibm/rave/bundles/components/AxisComponentImpl (runtime) // new, getTranslation
  1734. //@import com/ibm/rave/bundles/components/GridComponentImpl (runtime) // new
  1735. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  1736. /**
  1737. * <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>
  1738. */
  1739. var com_ibm_rave_bundles_components_AxesManager = rave['internal']['Declare']({
  1740. /**
  1741. * Bundle context
  1742. */
  1743. //_context : null,
  1744. /**
  1745. * Selector for the bundle defs node. If null, no clip paths will be defined.
  1746. */
  1747. //_defs : null,
  1748. /**
  1749. * Scales for the axes, indexed by X1, X2, Y1, Y2
  1750. */
  1751. //_scales : null,
  1752. /**
  1753. * Whether to suppress labels when panning, indexed by X1, X2, Y1, Y2.
  1754. */
  1755. //_suppressPanLabels : null,
  1756. /**
  1757. * Value of the axis drawAxisLabels, set when axis is drawn, indexed by X1, X2, Y1, Y2.
  1758. */
  1759. //_drawAxisLabels : null,
  1760. /**
  1761. * Axis components created on demand, indexed by X1, X2, Y1, Y2
  1762. */
  1763. //_axisComponents : null,
  1764. /**
  1765. * When last drawn, the selector used for each axis role, indexed by X1, X2, Y1, Y2; used for redraws.
  1766. */
  1767. //_lastAxisDrawSelectors : null,
  1768. /**
  1769. * Grid components created on demand, indexed by X1, X2, Y1, Y2
  1770. */
  1771. //_gridComponents : null,
  1772. /**
  1773. * When last drawn, the selector used for each grid role, indexed by X1, X2, Y1, Y2; used for redraws.
  1774. */
  1775. //_lastGridDrawSelectors : null,
  1776. /**
  1777. * For clearing axis
  1778. */
  1779. //_clearAxis : null,
  1780. /**
  1781. * For clearing grid
  1782. */
  1783. //_clearGrid : null,
  1784. /**
  1785. * Selectors for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1786. */
  1787. //_axisSelectors : null,
  1788. /**
  1789. * Selectors for the grid groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1790. */
  1791. //_gridSelectors : null,
  1792. /**
  1793. * Bounding rectangles for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1794. */
  1795. //_axisRects : null,
  1796. /**
  1797. * Center elements bounds, also the grid bounds.
  1798. */
  1799. //_elementRect : null,
  1800. /**
  1801. * Whether anything was drawn into the axis group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1802. */
  1803. //_lastAxisDrew : null,
  1804. /**
  1805. * Whether anything was drawn into the grid group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  1806. */
  1807. //_lastGridDrew : null,
  1808. //_dataSlotEntries : null,
  1809. //_layoutAxisOrder : null,
  1810. /**
  1811. * On the first draw, no transitions are used.
  1812. */
  1813. _firstDraw : false,
  1814. /**
  1815. * Whether to draw the axes and grids.
  1816. */
  1817. _visible : true,
  1818. /**
  1819. * Transition duration, ms
  1820. */
  1821. _duration : 0,
  1822. /**
  1823. * Transpose the axes (assign X to left/right and Y to top/bottom)
  1824. */
  1825. _transpose : false,
  1826. /**
  1827. * Switch the independent (X) axes, drawing X1 where X2 normally goes and vice-versa
  1828. */
  1829. _swapX : false,
  1830. /**
  1831. * Switch the dependent (Y) axes, drawing Y1 where Y2 normally goes and vice-versa
  1832. */
  1833. _swapY : false,
  1834. _layoutInProgress : false,
  1835. _layoutMaxWidth : 0,
  1836. _layoutMaxHeight : 0,
  1837. _xPadding : 0, _xOuterPadding : 0, _yPadding : 0, _yOuterPadding : 0,
  1838. _xPixelPad : 0, _yPixelPad : 0,
  1839. /**
  1840. * Hack to allow heatmap in "unit cell" mode to disable stagger because of the post scaling that messes up axis layout
  1841. */
  1842. _preventStaggerRotate45 : false,
  1843. constructor : function(context) {
  1844. this._scales = [];
  1845. this._suppressPanLabels = [];
  1846. this._drawAxisLabels = [];
  1847. this._axisComponents = [];
  1848. this._lastAxisDrawSelectors = [];
  1849. this._gridComponents = [];
  1850. this._lastGridDrawSelectors = [];
  1851. this._clearAxis = new com_ibm_rave_bundles_components_AxisComponentImpl();
  1852. this._clearGrid = new com_ibm_rave_bundles_components_GridComponentImpl();
  1853. this._axisSelectors = [];
  1854. this._gridSelectors = [];
  1855. this._axisRects = [];
  1856. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1857. this._lastAxisDrew = [];
  1858. this._lastGridDrew = [];
  1859. this._dataSlotEntries = [];
  1860. this._layoutAxisOrder = [];
  1861. /**
  1862. * Construct and initialize. No axis scales or selector groups are defined.
  1863. * @param (rave['library']['internal']['BundleContext']) context The bundle context
  1864. */
  1865. {
  1866. this._context = context;
  1867. for (var i = 0; i < 4; ++i) {
  1868. this._scales[i] = null;
  1869. this._suppressPanLabels[i] = false;
  1870. this._axisComponents[i] = null;
  1871. this._lastAxisDrawSelectors[i] = null;
  1872. this._gridComponents[i] = null;
  1873. this._lastGridDrawSelectors[i] = null;
  1874. this._axisSelectors[i] = null;
  1875. this._gridSelectors[i] = null;
  1876. this._axisRects[i] = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1877. this._lastAxisDrew[i] = false;
  1878. this._lastGridDrew[i] = false;
  1879. this._dataSlotEntries[i] = [];
  1880. }
  1881. }
  1882. },
  1883. /** @expose */
  1884. preLayout : function(layoutComponent, axesBeforeLegend, xPadding, xOuterPadding, xPixelPad, yPadding, yOuterPadding, yPixelPad) {
  1885. this._xPadding = xPadding;
  1886. this._xOuterPadding = xOuterPadding;
  1887. this._xPixelPad = xPixelPad;
  1888. this._yPadding = yPadding;
  1889. this._yOuterPadding = yOuterPadding;
  1890. this._yPixelPad = yPixelPad;
  1891. this._layoutInProgress = true;
  1892. var layoutDuration = this._duration;
  1893. this._duration = 0;
  1894. 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"];
  1895. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.axes-layout"), children);
  1896. var layoutAxisSelectors = [];
  1897. var layoutGridSelectors = [];
  1898. var layoutLastAxisDrew = [];
  1899. for (var position = 0; position < 4; ++position) {
  1900. if (this._axisComponents[position]) {
  1901. this._axisComponents[position].preLayout();
  1902. }
  1903. layoutAxisSelectors[position] = this._axisSelectors[position];
  1904. layoutGridSelectors[position] = this._gridSelectors[position];
  1905. layoutLastAxisDrew[position] = this._lastAxisDrew[position];
  1906. if (this._axisSelectors[position]) {
  1907. this.axisSelector(position, this._context.node.select("g.layoutAxis-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  1908. }
  1909. if (this._gridSelectors[position]) {
  1910. this.gridSelector(position, this._context.node.select("g.layoutGrid-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  1911. }
  1912. }
  1913. layoutComponent.preLayout(axesBeforeLegend, true);
  1914. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutComponent.elementRect());
  1915. var countHorz = 0;
  1916. var countVert = 0;
  1917. var axes = [];
  1918. for (var position = 0; position < 4; ++position) {
  1919. var role = this.positionToRole(position);
  1920. var isHorz = position == 1 || position == 0;
  1921. if (this._axisSelectors[position] && this._scales[role]) {
  1922. if (isHorz) {
  1923. countHorz++;
  1924. } else {
  1925. countVert++;
  1926. }
  1927. if (this._scales[role].isOrdinal() || this._scales[role].isClustered()) {
  1928. var score = isHorz ? 4 : 2;
  1929. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  1930. } else {
  1931. var score = isHorz ? 3 : 1;
  1932. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  1933. }
  1934. } else {
  1935. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, 5));
  1936. }
  1937. }
  1938. axes.sort(function(a1, a2) {
  1939. var a1value = a1.score;
  1940. var a2value = a2.score;
  1941. return a1value < a2value ? -1 : a1value > a2value ? 1 : 0;
  1942. });
  1943. this._layoutAxisOrder = [];
  1944. for (var i = 0; i < 4; ++i) {
  1945. this._layoutAxisOrder[i] = axes[i].position;
  1946. }
  1947. this._layoutMaxWidth = this._elementRect.width * (countVert > 1 ? 0.5 : 0.4);
  1948. this._layoutMaxHeight = this._elementRect.height * (countHorz > 1 ? 0.5 : 0.4);
  1949. for (var index = 0; index < 4; ++index) {
  1950. var position = this._layoutAxisOrder[index];
  1951. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], this._elementRect);
  1952. }
  1953. this.draw();
  1954. this._duration = layoutDuration;
  1955. this._context.node.select("g.axes-layout").selectAll("*").remove();
  1956. for (var position = 0; position < 4; ++position) {
  1957. this._lastAxisDrew[position] = layoutLastAxisDrew[position];
  1958. this._axisSelectors[position] = layoutAxisSelectors[position];
  1959. this._gridSelectors[position] = layoutGridSelectors[position];
  1960. }
  1961. this._layoutInProgress = false;
  1962. return this;
  1963. },
  1964. getPositionToDraw : function(index) {
  1965. return this._layoutInProgress ? this._layoutAxisOrder[index] : index;
  1966. },
  1967. preDrawAxis : function(index) {
  1968. if (this._layoutInProgress) {
  1969. var position = this._layoutAxisOrder[index];
  1970. var role = this.positionToRole(position);
  1971. if (role == 0 || role == 1) {
  1972. this.setScaleRangePadded(this._scales[role], false, this._xPadding, this._xOuterPadding, this._xPixelPad);
  1973. } else {
  1974. this.setScaleRangePadded(this._scales[role], true, this._yPadding, this._yOuterPadding, this._yPixelPad);
  1975. }
  1976. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(true);
  1977. }
  1978. },
  1979. postDrawAxis : function(index) {
  1980. if (this._layoutInProgress) {
  1981. var position = this._layoutAxisOrder[index];
  1982. var role = this.positionToRole(position);
  1983. var axis = this._axisComponents[role];
  1984. var size = axis.getPreferredSize();
  1985. if (position == 1 || position == 0) {
  1986. if (size > this._layoutMaxHeight) {
  1987. size = this._layoutMaxHeight;
  1988. }
  1989. this._elementRect.height -= size;
  1990. if (position == 1) {
  1991. this._elementRect.y += size;
  1992. }
  1993. } else {
  1994. if (size > this._layoutMaxWidth) {
  1995. size = this._layoutMaxWidth;
  1996. }
  1997. this._elementRect.width -= size;
  1998. if (position == 2) {
  1999. this._elementRect.x += size;
  2000. }
  2001. }
  2002. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2003. }
  2004. },
  2005. /**
  2006. * 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.
  2007. */
  2008. /** @expose */
  2009. draw : function() {
  2010. for (var role = 0; role < 4; ++role) {
  2011. this._lastAxisDrawSelectors[role] = null;
  2012. this._lastGridDrawSelectors[role] = null;
  2013. }
  2014. for (var index = 0; index < 4; ++index) {
  2015. var position = this.getPositionToDraw(index);
  2016. var role = this.positionToRole(position);
  2017. if (!this._visible || !this._axisSelectors[position] || !this._scales[role]) {
  2018. this.clearAxis(position);
  2019. this.clearGrid(position);
  2020. } else {
  2021. this.preDrawAxis(index);
  2022. this.drawAxis(position, role);
  2023. this.postDrawAxis(index);
  2024. if (this._gridSelectors[position]) {
  2025. this.drawGrid(position, role);
  2026. }
  2027. }
  2028. }
  2029. this._firstDraw = false;
  2030. },
  2031. /**
  2032. * @return (boolean) true if we are hiding any labels during pan-zoom.
  2033. */
  2034. /** @expose */
  2035. hideAnyPanZoom : function() {
  2036. return (this._suppressPanLabels[0] || this._suppressPanLabels[1] || this._suppressPanLabels[2] || this._suppressPanLabels[3]);
  2037. },
  2038. /**
  2039. * 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.
  2040. * @param (boolean) panning Whether this is a pan in-progress; use false otherwise including when pan-zoom ends.
  2041. */
  2042. /** @expose */
  2043. redraw : function(panning) {
  2044. for (var role = 0; role < 4; ++role) {
  2045. if (this._axisComponents[role] && this._lastAxisDrawSelectors[role]) {
  2046. this._axisComponents[role].displayTickLabels(this._drawAxisLabels[role]);
  2047. this._axisComponents[role].showPanZoomTickLabels(!panning || !this._suppressPanLabels[role]);
  2048. var isAllow = this._axisComponents[role].isAllowAutomaticAxisLayoutToChangeOrientation();
  2049. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2050. this._lastAxisDrawSelectors[role].call(this._axisComponents[role]);
  2051. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(isAllow);
  2052. }
  2053. if (this._gridComponents[role] && this._lastGridDrawSelectors[role]) {
  2054. this._lastGridDrawSelectors[role].call(this._gridComponents[role]);
  2055. }
  2056. }
  2057. },
  2058. /** @expose */
  2059. preventStaggerRotate45 : function(preventStaggerRotate45) {
  2060. this._preventStaggerRotate45 = preventStaggerRotate45;
  2061. },
  2062. /**
  2063. * 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.
  2064. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2065. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2066. */
  2067. drawAxis : function(position, role) {
  2068. var axisGroup = this._axisSelectors[position];
  2069. this._lastAxisDrawSelectors[role] = axisGroup;
  2070. var comp = this.axisComponent(role);
  2071. var layoutModeID = role == 2 ? "axis.y.labels.layoutMode" : role == 3 ? "axis.y2.labels.layoutMode" : "axis.x.labels.layoutMode";
  2072. var allowStaggerID = role == 2 ? "axis.y.labels.allowStagger" : role == 3 ? "axis.y2.labels.allowStagger" : "axis.x.labels.allowStagger";
  2073. var allowRotate45ID = role == 2 ? "axis.y.labels.allowRotate45" : role == 3 ? "axis.y2.labels.allowRotate45" : "axis.x.labels.allowRotate45";
  2074. var allowRotate90ID = role == 2 ? "axis.y.labels.allowRotate90" : role == 3 ? "axis.y2.labels.allowRotate90" : "axis.x.labels.allowRotate90";
  2075. var layoutMode = ""+(this._context.getPropertyValue(layoutModeID));
  2076. var allowStagger = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowStaggerID));
  2077. var allowRotate45 = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowRotate45ID));
  2078. var allowRotate90 = (this._context.getPropertyValue(allowRotate90ID));
  2079. var textTruncateIndicator = (this._context.getPropertyValue("axis.labels.truncationText"));
  2080. var axisBounds = this._axisRects[position];
  2081. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2082. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2083. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2084. 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);
  2085. this._drawAxisLabels[role] = comp._displayTickLabels;
  2086. var axisGroupUpdate = axisGroup;
  2087. if (this._duration > 0 && !this._firstDraw && this._lastAxisDrew[position]) {
  2088. axisGroupUpdate = axisGroup.transition().duration(this._duration);
  2089. }
  2090. axisGroupUpdate.attr("transform", axisTransform);
  2091. axisGroupUpdate.call(comp);
  2092. var dataSlotEntryList = this._dataSlotEntries[role];
  2093. axisGroup.selectAll(".axis-title").property("dataSlots", dataSlotEntryList);
  2094. this._lastAxisDrew[position] = comp.renderedShapes();
  2095. if (this._defs) {
  2096. var clipAxis = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this._context.instanceId() + "clip" + orient);
  2097. var text = axisGroup.append("text").text("000,000");
  2098. var bbox = text.node().getBBox();
  2099. var w = bbox.width;
  2100. var h = bbox.height;
  2101. text.remove();
  2102. var clipRect;
  2103. if (position == 0 || position == 1) {
  2104. var leftEdge = axisBounds.x + transform[0] * -1;
  2105. var rightEdge = leftEdge + axisBounds.width;
  2106. if (!(this._scales[role].isOrdinal()) && !(this._scales[role].isClustered())) {
  2107. var numericLeftEdge = this._elementRect.x - w + transform[0] * -1;
  2108. var numericRightEdge = numericLeftEdge + this._elementRect.width + w * 2;
  2109. if (numericLeftEdge < leftEdge) {
  2110. leftEdge = numericLeftEdge;
  2111. }
  2112. if (numericRightEdge > rightEdge) {
  2113. rightEdge = numericRightEdge;
  2114. }
  2115. }
  2116. clipRect = new rave['internal']['RectStruct'](leftEdge, axisBounds.y + transform[1] * -1, rightEdge - leftEdge, axisBounds.height);
  2117. } else {
  2118. clipRect = new rave['internal']['RectStruct'](axisBounds.x + transform[0] * -1, this._elementRect.y - h / 2 + transform[1] * -1, axisBounds.width, this._elementRect.height + h);
  2119. }
  2120. clipAxis.clipRect(clipRect).applyTo(axisGroup.select(".axis." + orient)).call(this._defs);
  2121. }
  2122. },
  2123. /**
  2124. * If the axis selector for the position is defined, clear the shapes from the axis group.
  2125. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2126. */
  2127. clearAxis : function(position) {
  2128. if (this._axisSelectors[position]) {
  2129. this._clearAxis.scale(null);
  2130. this._axisSelectors[position].call(this._clearAxis);
  2131. }
  2132. this._lastAxisDrew[position] = false;
  2133. },
  2134. /**
  2135. * 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.
  2136. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2137. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2138. */
  2139. drawGrid : function(position, role) {
  2140. var gridGroup = this._gridSelectors[position];
  2141. this._lastGridDrawSelectors[role] = gridGroup;
  2142. var comp = this.gridComponent(role);
  2143. var axisBounds = this._axisRects[position];
  2144. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2145. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2146. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2147. comp.setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).orient(orient).setPreExecute(this._context.getPreExecute()).bounds(this._elementRect).axis(this._axisComponents[role].axis());
  2148. if (this._duration <= 0 || this._firstDraw || !this._lastAxisDrew[position]) {
  2149. gridGroup.attr("transform", axisTransform).call(comp);
  2150. } else {
  2151. gridGroup.transition().duration(this._duration).attr("transform", axisTransform).call(comp);
  2152. }
  2153. this._lastGridDrew[position] = comp.renderedShapes();
  2154. },
  2155. /**
  2156. * If the grid selector for the position is defined, clear the shapes from the grid group.
  2157. * @param (int) position The grid position, BOTTOM, TOP, LEFT, RIGHT
  2158. */
  2159. clearGrid : function(position) {
  2160. if (this._gridSelectors[position]) {
  2161. this._clearGrid.axis(null);
  2162. this._gridSelectors[position].call(this._clearGrid);
  2163. }
  2164. this._lastGridDrew[position] = false;
  2165. },
  2166. /**
  2167. * @param (boolean) visible Whether the manager should draw axes
  2168. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2169. */
  2170. /** @expose */
  2171. visible : function(visible) {
  2172. this._visible = visible;
  2173. return this;
  2174. },
  2175. /**
  2176. * @param (int) duration The transition duration; if <= 0, no transition is used.
  2177. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2178. */
  2179. /** @expose */
  2180. duration : function(duration) {
  2181. this._duration = duration;
  2182. return this;
  2183. },
  2184. /**
  2185. * @param (boolean) transpose Whether to transpose the chart (switch the positions of the X and Y axis)
  2186. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2187. */
  2188. /** @expose */
  2189. transpose : function(transpose) {
  2190. this._transpose = transpose;
  2191. return this;
  2192. },
  2193. /**
  2194. * @param (boolean) swapX Whether to switch the postitions of the X1 and X2 axes
  2195. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2196. */
  2197. /** @expose */
  2198. swapX : function(swapX) {
  2199. this._swapX = swapX;
  2200. return this;
  2201. },
  2202. /**
  2203. * @param (boolean) swapY Whether to switch the postitions of the Y1 and Y2 axes
  2204. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2205. */
  2206. /** @expose */
  2207. swapY : function(swapY) {
  2208. this._swapY = swapY;
  2209. return this;
  2210. },
  2211. /**
  2212. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2213. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The coordinate scale for that role, may be null
  2214. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2215. */
  2216. /** @expose */
  2217. scale : function(role, scale) {
  2218. this._scales[role] = scale;
  2219. return this;
  2220. },
  2221. /**
  2222. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2223. * @param (boolean) suppressLabels Whether to suppress the labels when panning the axis
  2224. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2225. */
  2226. /** @expose */
  2227. suppressPanLabels : function(role, suppressLabels) {
  2228. this._suppressPanLabels[role] = suppressLabels;
  2229. return this;
  2230. },
  2231. /**
  2232. * 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.
  2233. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2234. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) The component for the role
  2235. */
  2236. /** @expose */
  2237. axisComponent : function(role) {
  2238. if (!this._axisComponents[role]) {
  2239. this._axisComponents[role] = new com_ibm_rave_bundles_components_AxisComponentImpl();
  2240. }
  2241. return this._axisComponents[role];
  2242. },
  2243. /**
  2244. * 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.
  2245. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2246. * @return (com.ibm.rave.bundles.components.GridComponentImpl) The component for the role
  2247. */
  2248. /** @expose */
  2249. gridComponent : function(role) {
  2250. if (!this._gridComponents[role]) {
  2251. this._gridComponents[role] = new com_ibm_rave_bundles_components_GridComponentImpl();
  2252. }
  2253. return this._gridComponents[role];
  2254. },
  2255. /**
  2256. * Set the bundle &lt;defs&gt; node. Clip paths will be defined in this node.
  2257. * @param (rave['internal']['Selector']) defs The defs node
  2258. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2259. */
  2260. /** @expose */
  2261. defsSelector : function(defs) {
  2262. this._defs = com_ibm_rave_bundles_components_AxesManager.checkSelector(defs);
  2263. return this;
  2264. },
  2265. /**
  2266. * Set the selector for an axis group node.
  2267. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2268. * @param (rave['internal']['Selector']) axisGroup The axis group node, may be null
  2269. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2270. */
  2271. /** @expose */
  2272. axisSelector : function(position, axisGroup) {
  2273. this._axisSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(axisGroup);
  2274. return this;
  2275. },
  2276. /**
  2277. * Set the selector for a grid group node.
  2278. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2279. * @param (rave['internal']['Selector']) gridGroup The grid group node, may be null
  2280. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2281. */
  2282. /** @expose */
  2283. gridSelector : function(position, gridGroup) {
  2284. this._gridSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(gridGroup);
  2285. return this;
  2286. },
  2287. /**
  2288. * Set the element (grid) bounds rectangle to a copy of the given rectangle.
  2289. * @param (rave['internal']['RectStruct']) elementRect The rectangle, if null the bounds are set to 0,0,0,0
  2290. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2291. */
  2292. /** @expose */
  2293. elementRect : function(elementRect) {
  2294. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, elementRect);
  2295. return this;
  2296. },
  2297. /**
  2298. * Set an axis bounds rectangle to a copy of the given rectangle.
  2299. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2300. * @param (rave['internal']['RectStruct']) axisRect The axis bounds, if null the bounds are set to 0,0,0,0
  2301. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2302. */
  2303. /** @expose */
  2304. axisRect : function(position, axisRect) {
  2305. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], axisRect);
  2306. return this;
  2307. },
  2308. /**
  2309. * 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.
  2310. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2311. */
  2312. /** @expose */
  2313. useDefaultSelectors : function() {
  2314. this.defsSelector(this._context.node.select("defs"));
  2315. this.axisSelector(0, this._context.node.select("g.axisTransform.bottom"));
  2316. this.axisSelector(1, this._context.node.select("g.axisTransform.top"));
  2317. this.axisSelector(2, this._context.node.select("g.axisTransform.left"));
  2318. this.axisSelector(3, this._context.node.select("g.axisTransform.right"));
  2319. this.gridSelector(0, this._context.node.select("g.grid.bottom"));
  2320. this.gridSelector(1, this._context.node.select("g.grid.top"));
  2321. this.gridSelector(2, this._context.node.select("g.grid.left"));
  2322. this.gridSelector(3, this._context.node.select("g.grid.right"));
  2323. return this;
  2324. },
  2325. /**
  2326. * Convenience method: Set the element rectangle and axis rectangles from the rectangles in the layout.
  2327. * @param (com.ibm.rave.bundles.components.ChartLayoutComponentImpl) layoutInfo Layout information
  2328. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2329. */
  2330. /** @expose */
  2331. useBoundsFromLayout : function(layoutInfo) {
  2332. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutInfo.elementRect());
  2333. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[0], layoutInfo.bottomRect());
  2334. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[1], layoutInfo.topRect());
  2335. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[2], layoutInfo.leftRect());
  2336. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[3], layoutInfo.rightRect());
  2337. return this;
  2338. },
  2339. /**
  2340. * 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.
  2341. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2342. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2343. */
  2344. /** @expose */
  2345. useDefaultX1Properties : function(setGridParameters) {
  2346. 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"))));
  2347. var titleFontStyle = (this._context.getPropertyValue("axis.x.title.style.font"));
  2348. var labelFontStyle = (this._context.getPropertyValue("axis.x.labels.style.font"));
  2349. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2350. this.axisComponent(0).labelStyle(labelFontStyle);
  2351. } else {
  2352. 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")));
  2353. }
  2354. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2355. this.axisComponent(0).titleStyle(titleFontStyle);
  2356. } else {
  2357. 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")));
  2358. }
  2359. if (setGridParameters) {
  2360. 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")));
  2361. }
  2362. this.suppressPanLabels(0, (this._context.getPropertyValue("axis.x.labels.zoomPan")));
  2363. return this;
  2364. },
  2365. /**
  2366. * 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.
  2367. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2368. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2369. */
  2370. /** @expose */
  2371. useDefaultY1Properties : function(setGridParameters) {
  2372. 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")));
  2373. var titleFontStyle = (this._context.getPropertyValue("axis.y.title.style.font"));
  2374. var labelFontStyle = (this._context.getPropertyValue("axis.y.labels.style.font"));
  2375. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2376. this.axisComponent(2).labelStyle(labelFontStyle);
  2377. } else {
  2378. 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")));
  2379. }
  2380. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2381. this.axisComponent(2).titleStyle(titleFontStyle);
  2382. } else {
  2383. 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")));
  2384. }
  2385. if (setGridParameters) {
  2386. 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")));
  2387. }
  2388. this.suppressPanLabels(2, (this._context.getPropertyValue("axis.y.labels.zoomPan")));
  2389. return this;
  2390. },
  2391. /**
  2392. * 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.
  2393. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2394. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2395. */
  2396. /** @expose */
  2397. useDefaultY2Properties : function(setGridParameters) {
  2398. 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")));
  2399. var titleFontStyle = (this._context.getPropertyValue("axis.y2.title.style.font"));
  2400. var labelFontStyle = (this._context.getPropertyValue("axis.y2.labels.style.font"));
  2401. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2402. this.axisComponent(3).labelStyle(labelFontStyle);
  2403. } else {
  2404. 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")));
  2405. }
  2406. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2407. this.axisComponent(3).titleStyle(titleFontStyle);
  2408. } else {
  2409. 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")));
  2410. }
  2411. if (setGridParameters) {
  2412. 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")));
  2413. }
  2414. this.suppressPanLabels(3, (this._context.getPropertyValue("axis.y2.labels.zoomPan")));
  2415. return this;
  2416. },
  2417. /**
  2418. * 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.
  2419. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2420. * @param (Array) entries Non-null list of data slot entries
  2421. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  2422. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined for the axis, may be null
  2423. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2424. */
  2425. /** @expose */
  2426. setTickFormatterList : function(role, entries, format, defaultFunction) {
  2427. var fmtRole;
  2428. switch (role) {
  2429. case 2:
  2430. fmtRole = "ROLE_Y1";
  2431. break;
  2432. case 1:
  2433. fmtRole = "ROLE_X2";
  2434. break;
  2435. case 3:
  2436. fmtRole = "ROLE_Y2";
  2437. break;
  2438. case 0:
  2439. default:
  2440. fmtRole = "ROLE_X1";
  2441. break;
  2442. }
  2443. 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);
  2444. this.axisComponent(role).tickFormat(fmt);
  2445. 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);
  2446. this.axisComponent(role).simplifiedTickFormat(simplefmt);
  2447. return this;
  2448. },
  2449. /**
  2450. * 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.
  2451. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2452. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  2453. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2454. */
  2455. /** @expose */
  2456. setTickFormatter : function(role, entry) {
  2457. var entries = [];
  2458. if (entry) {
  2459. entries.push(entry);
  2460. }
  2461. return this.setTickFormatterList(role, entries, "none", null);
  2462. },
  2463. /**
  2464. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined scale.
  2465. * @param (Number) padding Padding, relevant only for ordinal scales
  2466. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2467. * @param (int) pixelPad Pixel padding at each end
  2468. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2469. */
  2470. /** @expose */
  2471. setScaleRanges : function(padding, outerPadding, pixelPad) {
  2472. this.setIndependentScaleRanges(padding, outerPadding, pixelPad);
  2473. this.setDependentScaleRanges(padding, outerPadding, pixelPad);
  2474. return this;
  2475. },
  2476. /**
  2477. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2478. * @param (Number) padding Padding, relevant only for ordinal scales
  2479. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2480. * @param (int) pixelPad Pixel padding at each end
  2481. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2482. */
  2483. /** @expose */
  2484. setIndependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2485. this.setScaleRangePadded(this._scales[0], false, padding, outerPadding, pixelPad);
  2486. this.setScaleRangePadded(this._scales[1], false, padding, outerPadding, pixelPad);
  2487. return this;
  2488. },
  2489. /**
  2490. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2491. * @param (Number) padding Padding, relevant only for ordinal scales
  2492. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2493. * @param (int) pixelPad Pixel padding at each end
  2494. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2495. */
  2496. /** @expose */
  2497. setDependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2498. this.setScaleRangePadded(this._scales[2], true, padding, outerPadding, pixelPad);
  2499. this.setScaleRangePadded(this._scales[3], true, padding, outerPadding, pixelPad);
  2500. return this;
  2501. },
  2502. /**
  2503. * 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)} .
  2504. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2505. * @param (rave['library']['internal']['DataSlotEntry']) slot DataSlotEntry to be associated with the axis role.
  2506. */
  2507. setDataSlot$0 : function(role, slot) {
  2508. this.setDataSlot$1(role, [slot]);
  2509. return this;
  2510. },
  2511. /**
  2512. * Set a list of data slot entries that will be associated with the specified axis role.
  2513. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2514. * @param (Array) slots List of DataSlotEntry to be associated with the axis role.
  2515. */
  2516. setDataSlot$1 : function(role, slots) {
  2517. if (role < 4 && role >= 0) {
  2518. this._dataSlotEntries[role].length = 0;
  2519. if (slots) {
  2520. for (var __i_enFor0 = 0, __exp_enFor0 = slots, __len_enFor0 = __exp_enFor0.length;
  2521. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  2522. var slot = __exp_enFor0[__i_enFor0];
  2523. this._dataSlotEntries[role].push(slot);
  2524. }
  2525. }
  2526. }
  2527. return this;
  2528. },
  2529. /**
  2530. * </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.
  2531. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale Bundle independent scale
  2532. * @param (boolean) dependent Whether this is the dependent scale
  2533. * @param (Number) padding Padding, relevant only for ordinal scales
  2534. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2535. * @param (int) pixelPad Pixel padding at each end
  2536. */
  2537. setScaleRangePadded : function(scale, dependent, padding, outerPadding, pixelPad) {
  2538. if (scale) {
  2539. var min, max;
  2540. if (dependent == this._transpose) {
  2541. min = this._elementRect.x + pixelPad;
  2542. max = this._elementRect.x + this._elementRect.width - pixelPad;
  2543. } else {
  2544. if (scale.isContinuous()) {
  2545. min = this._elementRect.y + this._elementRect.height - pixelPad;
  2546. max = this._elementRect.y + pixelPad;
  2547. } else {
  2548. min = this._elementRect.y + pixelPad;
  2549. max = this._elementRect.y + this._elementRect.height - pixelPad;
  2550. }
  2551. }
  2552. scale.range(min, max, padding, outerPadding);
  2553. }
  2554. },
  2555. /**
  2556. * Given a geometric position BOTTOM, TOP, LEFT, or RIGHT, return the role X1, X2, Y1, or Y2 used by that role.
  2557. * @param (int) position The position index
  2558. * @return (int) The role index
  2559. */
  2560. positionToRole : function(position) {
  2561. var r = position;
  2562. if (this._transpose) {
  2563. r = (r + 2) % 4;
  2564. }
  2565. if (this._swapX && r < 2) {
  2566. r = 1 - r;
  2567. }
  2568. if (this._swapY && r > 1) {
  2569. r = 5 - r;
  2570. }
  2571. return r;
  2572. },
  2573. /**
  2574. * Given a role X1, X2, Y1, or Y2, return the geometric position BOTTOM, TOP, LEFT, or RIGHT for that role.
  2575. * @param (int) role The role index
  2576. * @return (int) The position index
  2577. */
  2578. roleToPosition : function(role) {
  2579. var p = role;
  2580. if (this._swapX && role < 2) {
  2581. p = 1 - p;
  2582. }
  2583. if (this._swapY && p > 1) {
  2584. p = 5 - p;
  2585. }
  2586. if (this._transpose) {
  2587. p = (p + 2) % 4;
  2588. }
  2589. return p;
  2590. },
  2591. /**
  2592. * Sets the magnitude for the tick interval.
  2593. * @param (int) role role index of the axis
  2594. * @param (Number) tickMagnitude power of 10
  2595. * @return (com.ibm.rave.bundles.components.AxesManager) this
  2596. */
  2597. /** @expose */
  2598. scaleTickMagnitude : function(role, tickMagnitude) {
  2599. this.axisComponent(role).scaleTickMagnitude(tickMagnitude);
  2600. return this;
  2601. },
  2602. /** @expose */
  2603. setDataSlot : function(a0, a1) {
  2604. var args = arguments;
  2605. if (args.length == 2 && typeof a1 === "function") {
  2606. return this.setDataSlot$0(a0, a1);
  2607. }
  2608. return this.setDataSlot$1(a0, a1);
  2609. }
  2610. });
  2611. /**
  2612. * @param (rave['internal']['Selector']) s A selector
  2613. * @return (rave['internal']['Selector']) s if it is non-null and has at least one node, null otherwise
  2614. */
  2615. com_ibm_rave_bundles_components_AxesManager.checkSelector = function(s) {
  2616. return s && !(s.empty()) ? s : null;
  2617. };
  2618. /**
  2619. * Set a rectangle to a copy of another. If the source is null, the target is set to 0,0,0,0
  2620. * @param (rave['internal']['RectStruct']) target A non-null rectangle
  2621. * @param (rave['internal']['RectStruct']) source A possibly-null rectnalge
  2622. */
  2623. com_ibm_rave_bundles_components_AxesManager.setRect = function(target, source) {
  2624. if (source) {
  2625. target.x = source.x;
  2626. target.y = source.y;
  2627. target.width = source.width;
  2628. target.height = source.height;
  2629. } else {
  2630. target.x = 0;
  2631. target.y = 0;
  2632. target.width = 0;
  2633. target.height = 0;
  2634. }
  2635. };
  2636. /**
  2637. * A ValueFunction that appends '%' to the value.
  2638. * @param (int) n Number of digits
  2639. */
  2640. /** @expose */
  2641. com_ibm_rave_bundles_components_AxesManager.percentFormat = function(n) {
  2642. var digits = "." + n + "f";
  2643. var format = rave.format(digits);
  2644. return function(value, ix, gix) {
  2645. return format.call(null, value, 0, 0) + "%";
  2646. };
  2647. };
  2648. /**
  2649. * Called prior to chart layout. Axes are configured with no real bounding constraints to calculate their preferred size.
  2650. */
  2651. com_ibm_rave_bundles_components_AxesManager.AxisLayout = rave['internal']['Declare']({
  2652. /** @expose */
  2653. position : 0,
  2654. /** @expose */
  2655. score : 0,
  2656. constructor : function(position, score) {
  2657. this.position = position;
  2658. this.score = score;
  2659. }
  2660. });
  2661. /**
  2662. * Logical first X (independent) axis, default position bottom
  2663. */
  2664. /** @expose */
  2665. com_ibm_rave_bundles_components_AxesManager.X1 = 0;
  2666. /**
  2667. * Logical second X (independent) axis, default position top
  2668. */
  2669. /** @expose */
  2670. com_ibm_rave_bundles_components_AxesManager.X2 = 1;
  2671. /**
  2672. * Logical first Y (dependent) axis, default position left
  2673. */
  2674. /** @expose */
  2675. com_ibm_rave_bundles_components_AxesManager.Y1 = 2;
  2676. /**
  2677. * Logical first Y (dependent) axis, default position right
  2678. */
  2679. /** @expose */
  2680. com_ibm_rave_bundles_components_AxesManager.Y2 = 3;
  2681. /**
  2682. * Geometric group on bottom
  2683. */
  2684. /** @expose */
  2685. com_ibm_rave_bundles_components_AxesManager.BOTTOM = 0;
  2686. /**
  2687. * Geometric group on top
  2688. */
  2689. /** @expose */
  2690. com_ibm_rave_bundles_components_AxesManager.TOP = 1;
  2691. /**
  2692. * Geometric group on left
  2693. */
  2694. /** @expose */
  2695. com_ibm_rave_bundles_components_AxesManager.LEFT = 2;
  2696. /**
  2697. * Geometric group on right
  2698. */
  2699. /** @expose */
  2700. com_ibm_rave_bundles_components_AxesManager.RIGHT = 3;
  2701. /**
  2702. * Maps the role indexes to the role strings used by the components API
  2703. */
  2704. com_ibm_rave_bundles_components_AxesManager.ROLES = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2705. /**
  2706. * Maps the role indexes to the role strings used by the custom formatter API. TODO: Unify the strings
  2707. */
  2708. com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2709. /**
  2710. * Maps the position indexes to the orient strings used by D3
  2711. */
  2712. com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS = ["bottom", "top", "left", "right"];
  2713. /**
  2714. * Maps the position indexes to the custom formatter strings
  2715. */
  2716. com_ibm_rave_bundles_components_AxesManager.FORMATTERS = ["bottom", "top", "left", "right"];
  2717. // $source: com/ibm/rave/bundles/component/AxisComponent
  2718. /************************************************************************
  2719. ** IBM Confidential
  2720. **
  2721. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2722. **
  2723. ** (C) Copyright IBM Corp. 2017
  2724. **
  2725. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2726. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2727. ************************************************************************/
  2728. // GENERATED
  2729. /**
  2730. * <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>
  2731. */
  2732. var com_ibm_rave_bundles_component_AxisComponent = rave['internal']['Declare'].implement(
  2733. /**
  2734. * @return (String) The role of the axis in the chart
  2735. */
  2736. //role : function() {},
  2737. /**
  2738. * @return (rave['internal']['Axis']) The capability Axis used by this AxisComponent
  2739. */
  2740. //axis : function() {},
  2741. /**
  2742. * The tickFormat is applied to the values of the ticks to create the string that is displayed.
  2743. * @param (rave['internal']['ValueFunction']) tickFormat The new tickFormat
  2744. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2745. */
  2746. //tickFormat : function(tickFormat) {},
  2747. /**
  2748. * Get the tickFormat function used by this component. May be null.
  2749. * @return (rave['internal']['ValueFunction']) Format function, or null
  2750. */
  2751. //tickFormat : function() {},
  2752. /**
  2753. * Set the indicator to be used for truncated text ex: indicator set to "..." , results in helloworld - > hello...
  2754. * @param (String) indicator the string to be placed to indicated truncated text
  2755. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2756. */
  2757. //textTruncateIndicator : function(indicator) {},
  2758. /**
  2759. * Whether to display the axis title.
  2760. * @param (boolean) displayAxisTitle true to display the axis title, false otherwise
  2761. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2762. */
  2763. //displayAxisTitle : function(displayAxisTitle) {},
  2764. /**
  2765. * Whether to display the axis line.
  2766. * @param (boolean) displayAxisLine true to display the axis line, false otherwise
  2767. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2768. */
  2769. //displayAxisLine : function(displayAxisLine) {},
  2770. /**
  2771. * Whether to display the axis tick marks.
  2772. * @param (boolean) displayTicks true to display the axis ticks, false otherwise
  2773. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2774. */
  2775. //displayTicks : function(displayTicks) {},
  2776. /**
  2777. * Whether to display the axis labels, as set by the show axis labels property
  2778. * @param (boolean) displayTickLabels true to display the axis tick labels, false otherwise
  2779. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2780. */
  2781. //displayTickLabels : function(displayTickLabels) {},
  2782. /**
  2783. * Whether to display the axis labels, as set by the hide pan-zoom labels property
  2784. * @param (boolean) showPanZoomTickLabels true to display the axis tick labels, false otherwise
  2785. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2786. */
  2787. //showPanZoomTickLabels : function(showPanZoomTickLabels) {},
  2788. /**
  2789. * @param (String) axisTitle The new axisTitle
  2790. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2791. */
  2792. //axisTitle : function(axisTitle) {},
  2793. /**
  2794. * 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)} .
  2795. * @param (String) axisColor The new line and tick color
  2796. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2797. */
  2798. //axisColor : function(axisColor) {},
  2799. /**
  2800. * The color used to draw the axis line.
  2801. * @param (String) lineColor The new lineColor
  2802. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2803. */
  2804. //lineColor : function(lineColor) {},
  2805. /**
  2806. * The color used to draw the axis ticks.
  2807. * @param (String) tickColor The new tickColor
  2808. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2809. */
  2810. //tickColor : function(tickColor) {},
  2811. /**
  2812. * The color used to draw the axis labels.
  2813. * @param (String) labelColor The new labelColor
  2814. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2815. */
  2816. //labelColor : function(labelColor) {},
  2817. /**
  2818. * The style for the axis labels.
  2819. * @param (String) fontStyle CSS string of font properties
  2820. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2821. */
  2822. //labelStyle : function(fontStyle) {},
  2823. /**
  2824. * The style for the axis labels.
  2825. * @param (String) fill The color used to draw the labels
  2826. * @param (String) fontSize CSS font size
  2827. * @param (String) fontFamily CSS font-families list
  2828. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2829. */
  2830. //labelStyle : function(fill, fontSize, fontFamily) {},
  2831. /**
  2832. * The color used to draw the axis title.
  2833. * @param (String) titleColor The new titleColor
  2834. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2835. */
  2836. //titleColor : function(titleColor) {},
  2837. /**
  2838. * The style for the axis title.
  2839. * @param (String) fontStyle CSS string of font properties
  2840. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2841. */
  2842. //titleStyle : function(fontStyle) {},
  2843. /**
  2844. * The style for the axis title.
  2845. * @param (String) fill The color used to draw the title
  2846. * @param (String) fontSize CSS font size
  2847. * @param (String) fontFamily CSS font-families list
  2848. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2849. */
  2850. //titleStyle : function(fill, fontSize, fontFamily) {}
  2851. );
  2852. /**
  2853. * The string returned by {@link #this.type()} is "AxisComponent".
  2854. */
  2855. /** @expose */
  2856. com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE = "AxisComponent";
  2857. /**
  2858. * Returned by {@link #this.role()} for the first independent axis.
  2859. */
  2860. /** @expose */
  2861. com_ibm_rave_bundles_component_AxisComponent.ROLE_X1 = "ROLE_X1";
  2862. /**
  2863. * Returned by {@link #this.role()} for the first dependent axis.
  2864. */
  2865. /** @expose */
  2866. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y1 = "ROLE_Y1";
  2867. /**
  2868. * Returned by {@link #this.role()} for the second independent axis.
  2869. */
  2870. /** @expose */
  2871. com_ibm_rave_bundles_component_AxisComponent.ROLE_X2 = "ROLE_X2";
  2872. /**
  2873. * Returned by {@link #this.role()} for the second dependent axis.
  2874. */
  2875. /** @expose */
  2876. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y2 = "ROLE_Y2";
  2877. // $source: com/ibm/rave/bundles/utilities/TextCrossfader
  2878. /************************************************************************
  2879. ** IBM Confidential
  2880. **
  2881. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2882. **
  2883. ** (C) Copyright IBM Corp. 2017
  2884. **
  2885. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2886. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2887. ************************************************************************/
  2888. // GENERATED
  2889. /**
  2890. * <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>
  2891. */
  2892. var com_ibm_rave_bundles_utilities_TextCrossfader = rave['internal']['Declare']({
  2893. });
  2894. /**
  2895. * <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!
  2896. * @param (rave['internal']['Selection']) selection Selection containing the single text node, may be a transition
  2897. * @param (String) oldText Old value of the text string, may be null
  2898. * @param (String) newText New value of the text string, may be null
  2899. * @param (Object) fillOpacity Fill opacity, may be null (in which case 1.0 is assumed)
  2900. * @param (double) delay Number between 0 and 0.5 controlling the timing of the fade
  2901. * @return (rave['internal']['Selection']) The selection, modified by the new text and fill-opacity
  2902. */
  2903. /** @expose */
  2904. com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade = function(selection, oldText, newText, fillOpacity, delay) {
  2905. if (!(selection.isTransition())) {
  2906. return selection.text(newText);
  2907. }
  2908. var _t = (selection).tween("text", function(data, index, groupIndex) {
  2909. return function(t) {
  2910. this.rave_setText(t < 0.5 ? oldText : newText);
  2911. };
  2912. });
  2913. var t0 = Math.max(0.0, Math.min(0.5, delay));
  2914. if (t0 == 0.5 || (oldText == null && newText == null) || (oldText != null && oldText == newText)) {
  2915. return selection;
  2916. }
  2917. var opacity = fillOpacity == null ? 1.0 : + (fillOpacity);
  2918. var tf = 1.0 / (0.5 - t0);
  2919. return _t.tween("fill-opacity", function(data, index, groupIndex) {
  2920. return function(t) {
  2921. if (t <= t0 || t >= (1.0 - t0)) {
  2922. this.rave_setStyle("fill-opacity", fillOpacity);
  2923. } else {
  2924. this.rave_setStyle("fill-opacity", opacity * Math.abs(t - 0.5) * tf);
  2925. }
  2926. };
  2927. });
  2928. };
  2929. // $source: com/ibm/rave/bundles/utilities/BundleLabelDropper
  2930. /************************************************************************
  2931. ** IBM Confidential
  2932. **
  2933. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2934. **
  2935. ** (C) Copyright IBM Corp. 2017
  2936. **
  2937. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2938. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2939. ************************************************************************/
  2940. // GENERATED
  2941. var com_ibm_rave_bundles_utilities_BundleLabelDropper = rave['internal']['Declare']({
  2942. //_dropOverlap : null,
  2943. labelCount : 0,
  2944. _$functionClassMethod : function() {
  2945. var _$self = function(args) {
  2946. if (args !== null || arguments.length > 1){
  2947. args = Array.prototype.slice.call(arguments, 0);
  2948. }
  2949. {
  2950. _$self.drop(args[0], ((args[1])));
  2951. return null;
  2952. }
  2953. };
  2954. return _$self;
  2955. },
  2956. /** @expose */
  2957. constructor : function() {
  2958. this._dropOverlap = (rave.capabilities.extension("position")).drop().remove(false);
  2959. this._dropOverlap.setOverlapGap(4.0);
  2960. },
  2961. /**
  2962. * Drop the overlapping labels or reset the overlap.
  2963. * @param (rave['internal']['Selection']) labels The selector for the labels
  2964. * @param (boolean) removeOverlap true to remove the overlapping labels, false to reset
  2965. */
  2966. /** @expose */
  2967. drop : function(labels, removeOverlap) {
  2968. if (!(labels.isTransition())) {
  2969. this.applyLabelDrop(labels, removeOverlap);
  2970. } else {
  2971. var steps = [0, 25, 75];
  2972. var self = this;
  2973. (labels).tween("__pointLabelDrop__", function(data, index, groupIndex) {
  2974. if (index == 0) {
  2975. return function(t) {
  2976. var currentStep = Math.floor(t * 100);
  2977. if (steps.length > 0 && currentStep < 100 && currentStep >= steps[0]) {
  2978. steps.splice(0, 1);
  2979. self.applyLabelDrop(labels, removeOverlap);
  2980. }
  2981. };
  2982. }
  2983. return null;
  2984. });
  2985. this.labelCount = 0;
  2986. (labels).each(function(data, index, groupIndex) {
  2987. ++self.labelCount;
  2988. }).each("end", function(args) {
  2989. if (args !== null || arguments.length > 1){
  2990. args = Array.prototype.slice.call(arguments, 0);
  2991. }
  2992. {
  2993. if (--self.labelCount == 0) {
  2994. self.applyLabelDrop(labels, removeOverlap);
  2995. }
  2996. return null;
  2997. }
  2998. });
  2999. }
  3000. },
  3001. applyLabelDrop : function(labels, removeOverlap) {
  3002. if (removeOverlap) {
  3003. labels.call(this._dropOverlap);
  3004. } else {
  3005. this._dropOverlap.reset(labels);
  3006. }
  3007. },
  3008. /** @expose */
  3009. configureForDataLabels : function(rect) {
  3010. if (rect) {
  3011. var ex = [[rect.x, rect.y], [rect.x + rect.width, rect.y + rect.height]];
  3012. this._dropOverlap.extent(ex);
  3013. }
  3014. this._dropOverlap.noClipping();
  3015. }
  3016. });
  3017. /**
  3018. * Drop overlap extension
  3019. */
  3020. //com_ibm_rave_bundles_utilities_BundleLabelDropper.POSITION_EXTENSION = "position";
  3021. /**
  3022. * space between labels during overlap testing
  3023. */
  3024. com_ibm_rave_bundles_utilities_BundleLabelDropper.OVERLAP_GAP = 4;
  3025. // $source: com/ibm/rave/bundles/components/StyleStructs
  3026. /************************************************************************
  3027. ** IBM Confidential
  3028. **
  3029. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3030. **
  3031. ** (C) Copyright IBM Corp. 2017
  3032. **
  3033. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3034. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3035. ************************************************************************/
  3036. // GENERATED
  3037. /**
  3038. * Struct classes to hold style properties.
  3039. */
  3040. var com_ibm_rave_bundles_components_StyleStructs = rave['internal']['Declare']({
  3041. });
  3042. /**
  3043. * Filled shape style properties.
  3044. */
  3045. com_ibm_rave_bundles_components_StyleStructs.ShapeStyle = function() {
  3046. this._fill = null;
  3047. this._stroke = null;
  3048. this._strokeWidth = null;
  3049. };
  3050. /**
  3051. * Line style properties.
  3052. */
  3053. com_ibm_rave_bundles_components_StyleStructs.LineStyle = function() {
  3054. this._stroke = null;
  3055. this._strokeWidth = null;
  3056. this._dashArray = null;
  3057. };
  3058. // $source: com/ibm/rave/bundles/component/GridComponent
  3059. /************************************************************************
  3060. ** IBM Confidential
  3061. **
  3062. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3063. **
  3064. ** (C) Copyright IBM Corp. 2017
  3065. **
  3066. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3067. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3068. ************************************************************************/
  3069. // GENERATED
  3070. /**
  3071. * <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>
  3072. */
  3073. var com_ibm_rave_bundles_component_GridComponent = rave['internal']['Declare'].implement(
  3074. /**
  3075. * @return (String) The role of the grid in the chart
  3076. */
  3077. //role : function() {},
  3078. /**
  3079. * Whether to display the gridlines.
  3080. * @param (boolean) displayGridlines The new displayGridlines
  3081. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3082. */
  3083. //displayGridlines : function(displayGridlines) {},
  3084. /**
  3085. * Set the line styling. Equivalent to calling {@link #this.gridlineColor(String)} and {@link #this.dashArray(String)} .
  3086. * @param (String) stroke The stroke color
  3087. * @param (String) dashArray The stroke-dasharray
  3088. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3089. */
  3090. //gridlineStyle : function(stroke, dashArray) {},
  3091. /**
  3092. * The color used to draw the gridlines.
  3093. * @param (String) gridlineColor The new stroke color
  3094. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3095. */
  3096. //gridlineColor : function(gridlineColor) {},
  3097. /**
  3098. * 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.
  3099. * @param (String) dashArray The new dash array
  3100. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3101. */
  3102. //dashArray : function(dashArray) {}
  3103. );
  3104. /**
  3105. * The string returned by {@link #this.type()} is "GridComponent".
  3106. */
  3107. /** @expose */
  3108. com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE = "GridComponent";
  3109. // $source: com/ibm/rave/bundles/components/IntervalDataUtilities
  3110. /************************************************************************
  3111. ** IBM Confidential
  3112. **
  3113. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3114. **
  3115. ** (C) Copyright IBM Corp. 2017
  3116. **
  3117. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3118. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3119. ************************************************************************/
  3120. // GENERATED
  3121. /**
  3122. * 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.
  3123. */
  3124. var com_ibm_rave_bundles_components_IntervalDataUtilities = rave['internal']['Declare']({
  3125. });
  3126. /**
  3127. * <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>
  3128. * @param (Array) data Data array
  3129. * @param (rave['internal']['SingleValueFunction']) x X accessor, should not be null
  3130. * @param (rave['internal']['SingleValueFunction']) xScale Function to check if the X value is valid
  3131. * @param (rave['internal']['SingleValueFunction']) y Y accessor, should not be null
  3132. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3133. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3134. * @return (Array) Array of intervals for the data
  3135. */
  3136. /** @expose */
  3137. com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars = function(data, x, xScale, y, yStart, color, label) {
  3138. var result = [];
  3139. if (!data || data.length == 0 || !x || !y) {
  3140. return result;
  3141. }
  3142. data.forEach(function(d, ix, list) {
  3143. var xv = x(d);
  3144. if (xv != null && (!xScale || xScale(xv) != null)) {
  3145. var yv = y(d);
  3146. var yvStart = !yStart ? 0 : yStart(d);
  3147. if (yv != null && yvStart != null) {
  3148. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3149. r.key = ix;
  3150. r.ind1 = xv;
  3151. r.ind2 = r.ind1;
  3152. r.cind = r.ind1;
  3153. r.dep1 = yvStart;
  3154. r.dep2 = yv;
  3155. r.cdep = r.dep2;
  3156. r.color = color ? color(d) : null;
  3157. r.label = label ? label(d) : null;
  3158. r.value = r.dep2;
  3159. r._originalData = d;
  3160. r.valueAsPercentOfCategory = 100;
  3161. result.push(r);
  3162. }
  3163. }
  3164. return null;
  3165. });
  3166. var sum = 0;
  3167. for (var i = 0; i < result.length; ++i) {
  3168. var iData = result[i];
  3169. var value = + (iData.value);
  3170. sum += Math.abs(value);
  3171. }
  3172. if (sum != 0) {
  3173. for (var i = 0; i < result.length; ++i) {
  3174. var iData = result[i];
  3175. var value = + (iData.value);
  3176. iData.valueAsPercentOfColor = value / sum * 100;
  3177. }
  3178. }
  3179. return result;
  3180. };
  3181. /**
  3182. * Create intervals for bars in a clustered chart. This is similar to the simple bars, except the independent values are an array of accessors.
  3183. * @param (Array) data Data array
  3184. * @param (Array) x Independent accessor array, should not be null and no entries should be null
  3185. * @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
  3186. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3187. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3188. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3189. * @return (Array) Array of intervals for the data
  3190. */
  3191. /** @expose */
  3192. com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars = function(data, x, xScale, y, yStart, color, label) {
  3193. var result = [];
  3194. if (!data || data.length == 0 || !x || x.length == 0 || !y) {
  3195. return result;
  3196. }
  3197. var len = x.length;
  3198. var categories = {};
  3199. var colors = {};
  3200. data.forEach(function(d, ix, list) {
  3201. var OK = true;
  3202. var ind = [];
  3203. for (var i = 0; i < len; ++i) {
  3204. var xv = x[i](d);
  3205. if (xv == null || (xScale[i] && xScale[i](xv) == null)) {
  3206. OK = false;
  3207. break;
  3208. }
  3209. ind.push(xv);
  3210. if (i == 0) {
  3211. if (!(categories.hasOwnProperty(xv))) {
  3212. categories[""+(xv)] = 1;
  3213. }
  3214. } else if (!(colors.hasOwnProperty(xv))) {
  3215. colors[""+(xv)] = 1;
  3216. }
  3217. }
  3218. var dep = y(d);
  3219. var depStart = !yStart ? 0 : yStart(d);
  3220. if (OK && dep != null && depStart != null) {
  3221. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3222. r.key = ix;
  3223. r.ind1 = ind;
  3224. r.ind2 = ind;
  3225. r.cind = ind;
  3226. r.dep1 = depStart;
  3227. r.dep2 = dep;
  3228. r.cdep = r.dep2;
  3229. r.color = color ? color(d) : null;
  3230. r.label = label ? label(d) : null;
  3231. r.value = r.dep2;
  3232. r._originalData = d;
  3233. result.push(r);
  3234. }
  3235. return null;
  3236. });
  3237. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3238. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3239. var o = __exp_enFor0[__i_enFor0];
  3240. var s = ""+(o);
  3241. var sum = 0;
  3242. for (var i = 0; i < result.length; ++i) {
  3243. var iData = result[i];
  3244. if (s == (iData.ind1)[0]) {
  3245. var value = + (iData.value);
  3246. sum += Math.abs(value);
  3247. }
  3248. }
  3249. if (sum == 0) {
  3250. continue;
  3251. }
  3252. for (var i = 0; i < result.length; ++i) {
  3253. var iData = result[i];
  3254. if (s == (iData.ind1)[0]) {
  3255. var value = + (iData.value);
  3256. iData.valueAsPercentOfCategory = value / sum * 100;
  3257. }
  3258. }
  3259. }
  3260. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3261. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3262. var o = __exp_enFor1[__i_enFor1];
  3263. var s = ""+(o);
  3264. var sum = 0;
  3265. for (var i = 0; i < result.length; ++i) {
  3266. var iData = result[i];
  3267. if (s == iData.color) {
  3268. var value = + (iData.value);
  3269. sum += Math.abs(value);
  3270. }
  3271. }
  3272. if (sum == 0) {
  3273. continue;
  3274. }
  3275. for (var i = 0; i < result.length; ++i) {
  3276. var iData = result[i];
  3277. if (s == iData.color) {
  3278. var value = + (iData.value);
  3279. iData.valueAsPercentOfColor = value / sum * 100;
  3280. }
  3281. }
  3282. }
  3283. return result;
  3284. };
  3285. /**
  3286. * 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.
  3287. * @param (Array) data Data array
  3288. * @param (rave['internal']['SingleValueFunction']) x Independent accessor, should not be null
  3289. * @param (rave['internal']['SingleValueFunction']) xScale Possibly-null function to check if X values are in domain
  3290. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3291. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3292. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3293. * @param (boolean) percent If true, create percent bars
  3294. * @return (Array) Array of intervals for the data
  3295. */
  3296. /** @expose */
  3297. com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars = function(data, x, xScale, y, color, label, percent) {
  3298. var result = [];
  3299. if (!data || data.length == 0 || !x || !y) {
  3300. return result;
  3301. }
  3302. var stacks = {};
  3303. var categories = {};
  3304. var colors = {};
  3305. data.forEach(function(d, ix, list) {
  3306. var xv = x(d);
  3307. if (xv != null && (!xScale || xScale(xv) != null)) {
  3308. var yv = y(d);
  3309. if (yv != null) {
  3310. var stack = stacks[xv];
  3311. if (!stack) {
  3312. stack = new com_ibm_rave_bundles_components_IntervalDataUtilities.Stack();
  3313. stacks[xv] = stack;
  3314. }
  3315. var dVal = + (yv);
  3316. if (!percent) {
  3317. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3318. r.key = ix;
  3319. r.ind1 = xv;
  3320. r.ind2 = xv;
  3321. r.cind = xv;
  3322. var sum = dVal < 0.0 ? stack.negativeSum : stack.positiveSum;
  3323. r.dep1 = sum;
  3324. r.dep2 = sum + dVal;
  3325. r.cdep = r.dep2;
  3326. r.color = color ? color(d) : null;
  3327. r.label = label ? label(d) : null;
  3328. r.value = dVal;
  3329. r._originalData = d;
  3330. result.push(r);
  3331. }
  3332. if (dVal < 0.0) {
  3333. stack.negativeSum += dVal;
  3334. } else {
  3335. stack.positiveCount++;
  3336. stack.positiveSum += dVal;
  3337. }
  3338. if (!(categories.hasOwnProperty(xv))) {
  3339. categories[""+(xv)] = 1;
  3340. }
  3341. if (color) {
  3342. var o = color(d);
  3343. if ((o != null) && !(colors.hasOwnProperty(o))) {
  3344. colors[""+(o)] = 1;
  3345. }
  3346. }
  3347. }
  3348. }
  3349. return null;
  3350. });
  3351. if (percent) {
  3352. data.forEach(function(d, ix, list) {
  3353. var xv = x(d);
  3354. if (xv != null && (!xScale || xScale(xv) != null)) {
  3355. var yv = y(d);
  3356. if (yv != null) {
  3357. var stack = stacks[xv];
  3358. var dVal = + (yv);
  3359. var percent;
  3360. if (dVal < 0.0) {
  3361. percent = -100.0 * dVal / stack.negativeSum;
  3362. } else if (stack.positiveSum > 0) {
  3363. percent = 100.0 * dVal / stack.positiveSum;
  3364. } else {
  3365. percent = 100.0 / stack.positiveCount;
  3366. }
  3367. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3368. r.key = ix;
  3369. r.ind1 = xv;
  3370. r.ind2 = xv;
  3371. r.cind = xv;
  3372. var sum = dVal < 0.0 ? stack.negativePercent : stack.positivePercent;
  3373. r.dep1 = sum;
  3374. r.dep2 = sum + percent;
  3375. r.cdep = r.dep2;
  3376. r.color = color ? color(d) : null;
  3377. r.label = label ? label(d) : null;
  3378. r.value = dVal;
  3379. r.valueAsPercentOfCategory = percent;
  3380. r._originalData = d;
  3381. result.push(r);
  3382. if (dVal < 0.0) {
  3383. stack.negativePercent += percent;
  3384. } else {
  3385. stack.positivePercent += percent;
  3386. }
  3387. }
  3388. }
  3389. return null;
  3390. });
  3391. } else {
  3392. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3393. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3394. var o = __exp_enFor0[__i_enFor0];
  3395. var s = ""+(o);
  3396. var sum = 0;
  3397. for (var i = 0; i < result.length; ++i) {
  3398. var iData = result[i];
  3399. if (s == iData.ind1) {
  3400. var value = + (iData.value);
  3401. sum += Math.abs(value);
  3402. }
  3403. }
  3404. if (sum == 0) {
  3405. continue;
  3406. }
  3407. for (var i = 0; i < result.length; ++i) {
  3408. var iData = result[i];
  3409. if (s == iData.ind1) {
  3410. var value = + (iData.value);
  3411. iData.valueAsPercentOfCategory = value / sum * 100;
  3412. }
  3413. }
  3414. }
  3415. }
  3416. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3417. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3418. var o = __exp_enFor1[__i_enFor1];
  3419. var s = ""+(o);
  3420. var sum = 0;
  3421. for (var i = 0; i < result.length; ++i) {
  3422. var iData = result[i];
  3423. if (s == iData.color) {
  3424. var value = + (iData.value);
  3425. sum += Math.abs(value);
  3426. }
  3427. }
  3428. if (sum == 0) {
  3429. continue;
  3430. }
  3431. for (var i = 0; i < result.length; ++i) {
  3432. var iData = result[i];
  3433. if (s == iData.color) {
  3434. var value = + (iData.value);
  3435. iData.valueAsPercentOfColor = value / sum * 100;
  3436. }
  3437. }
  3438. }
  3439. return result;
  3440. };
  3441. /**
  3442. * Structure class holding interval information.
  3443. */
  3444. com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData = rave['internal']['Declare']({
  3445. /**
  3446. * Key value; for now this is the data index
  3447. */
  3448. /** @expose */
  3449. key : null,
  3450. /**
  3451. * First independent value
  3452. */
  3453. /** @expose */
  3454. ind1 : null,
  3455. /**
  3456. * Second independent value (in all current uses, same as ind1)
  3457. */
  3458. /** @expose */
  3459. ind2 : null,
  3460. /**
  3461. * First dependent value
  3462. */
  3463. /** @expose */
  3464. dep1 : null,
  3465. /**
  3466. * Second dependent value
  3467. */
  3468. /** @expose */
  3469. dep2 : null,
  3470. /**
  3471. * The data value that the interval represents. Not the pixel value. Used in stacked chart
  3472. */
  3473. /** @expose */
  3474. value : null,
  3475. /**
  3476. * Color value
  3477. */
  3478. /** @expose */
  3479. color : null,
  3480. /**
  3481. * Label value
  3482. */
  3483. /** @expose */
  3484. label : null,
  3485. /**
  3486. * Callout independent value (in all current uses, same as ind1)
  3487. */
  3488. /** @expose */
  3489. cind : null,
  3490. /**
  3491. * Callout dependent value (dependent extent)
  3492. */
  3493. /** @expose */
  3494. cdep : null,
  3495. /** @expose */
  3496. _originalData : null,
  3497. /**
  3498. * The data value (in percentage) for specific category
  3499. */
  3500. /** @expose */
  3501. valueAsPercentOfCategory : NaN,
  3502. /**
  3503. * The data value (in percentage) across all categories
  3504. */
  3505. /** @expose */
  3506. valueAsPercentOfColor : NaN,
  3507. /** @expose */
  3508. originalData : function() {
  3509. return this._originalData;
  3510. },
  3511. /** @expose */
  3512. originalDataList : function() {
  3513. var list = [];
  3514. list.push(this._originalData);
  3515. return list;
  3516. }
  3517. });
  3518. com_ibm_rave_bundles_components_IntervalDataUtilities.Stack = function() {
  3519. this.positiveCount = 0;
  3520. this.positiveSum = 0;
  3521. this.negativeSum = 0;
  3522. this.positivePercent = 0;
  3523. this.negativePercent = 0;
  3524. };
  3525. /**
  3526. * Accessor for the callout dependent value
  3527. */
  3528. /** @expose */
  3529. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_DEPENDENT_ACCESSOR = function(data) {
  3530. return (data).cdep;
  3531. };
  3532. /**
  3533. * Accessor for the callout independent value
  3534. */
  3535. /** @expose */
  3536. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_INDEPENDENT_ACCESSOR = function(data) {
  3537. return (data).cind;
  3538. };
  3539. /**
  3540. * Accessor for the data value
  3541. */
  3542. /** @expose */
  3543. com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR = function(data) {
  3544. return (data).value;
  3545. };
  3546. /**
  3547. * Accessor for data value as percent of category
  3548. */
  3549. /** @expose */
  3550. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(data) {
  3551. var percent = (data).valueAsPercentOfCategory;
  3552. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3553. };
  3554. /**
  3555. * Accessor for data value as percent of color (series)
  3556. */
  3557. /** @expose */
  3558. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(data) {
  3559. var percent = (data).valueAsPercentOfColor;
  3560. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3561. };
  3562. // $source: com/ibm/rave/bundles/data/PointDataUtilities
  3563. /************************************************************************
  3564. ** IBM Confidential
  3565. **
  3566. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3567. **
  3568. ** (C) Copyright IBM Corp. 2017
  3569. **
  3570. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3571. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3572. ************************************************************************/
  3573. // GENERATED
  3574. /**
  3575. * Utility class for building arrays of point datum objects from tabular data.
  3576. */
  3577. var com_ibm_rave_bundles_data_PointDataUtilities = rave['internal']['Declare']({
  3578. });
  3579. /**
  3580. * <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>
  3581. * @param (Array) data Input data, list of arbitrary objects
  3582. * @param (rave['internal']['SingleValueFunction']) xAccessor X accessor function, may be null
  3583. * @param (rave['internal']['SingleValueFunction']) xScale Scale to test if the X value should be included, may be null
  3584. * @param (rave['internal']['SingleValueFunction']) yAccessor Y accessor function, may be null
  3585. * @param (rave['internal']['SingleValueFunction']) yScale Scale to test if the Y value should be included, may be null
  3586. * @return (Array) List of PointData objects
  3587. */
  3588. /** @expose */
  3589. com_ibm_rave_bundles_data_PointDataUtilities.buildPoints = function(data, xAccessor, xScale, yAccessor, yScale) {
  3590. var result = [];
  3591. if (data) {
  3592. for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
  3593. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3594. var o = __exp_enFor0[__i_enFor0];
  3595. if (o != null) {
  3596. var xv = null;
  3597. if (xAccessor) {
  3598. xv = xAccessor(o);
  3599. if (xv == null || (xScale && xScale(xv) == null)) {
  3600. continue;
  3601. }
  3602. }
  3603. var yv = null;
  3604. if (yAccessor) {
  3605. yv = yAccessor(o);
  3606. if (yv == null || (yScale && yScale(yv) == null)) {
  3607. continue;
  3608. }
  3609. }
  3610. var datum = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
  3611. datum._x = xv;
  3612. datum._y = yv;
  3613. datum._originalData = o;
  3614. result.push(datum);
  3615. }
  3616. }
  3617. }
  3618. return result;
  3619. };
  3620. /**
  3621. * 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.
  3622. */
  3623. com_ibm_rave_bundles_data_PointDataUtilities.PointDatum = rave['internal']['Declare']({
  3624. /**
  3625. * The X value
  3626. */
  3627. /** @expose */
  3628. _x : null,
  3629. /**
  3630. * The Y value
  3631. */
  3632. /** @expose */
  3633. _y : null,
  3634. /**
  3635. * The data value (in percentage) that the point represents
  3636. */
  3637. /** @expose */
  3638. _yAsPercentOfCategory : null,
  3639. /**
  3640. * The data value (in percentage) that the point represents
  3641. */
  3642. /** @expose */
  3643. _yAsPercentOfColor : null,
  3644. /**
  3645. * The original data
  3646. */
  3647. /** @expose */
  3648. _originalData : null,
  3649. /** @expose */
  3650. originalData : function() {
  3651. return this._originalData;
  3652. },
  3653. /** @expose */
  3654. originalDataList : function() {
  3655. var list = [];
  3656. list.push(this._originalData);
  3657. return list;
  3658. }
  3659. });
  3660. /**
  3661. * Accessor returning the _x property of a PointDatum.
  3662. */
  3663. /** @expose */
  3664. com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR = function(d) {
  3665. return (d)._x;
  3666. };
  3667. /**
  3668. * Accessor returning the _y property of a PointDatum.
  3669. */
  3670. /** @expose */
  3671. com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR = function(d) {
  3672. return (d)._y;
  3673. };
  3674. /**
  3675. * Accessor returning the _yAsPercentOfCategory property of a PointDatum.
  3676. */
  3677. /** @expose */
  3678. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(d) {
  3679. var percent = + ((d)._yAsPercentOfCategory);
  3680. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3681. };
  3682. /**
  3683. * Accessor returning the _yAsPercentOfColor property of a PointDatum.
  3684. */
  3685. /** @expose */
  3686. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(d) {
  3687. var percent = + ((d)._yAsPercentOfColor);
  3688. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3689. };
  3690. // $source: com/ibm/rave/bundles/utilities/ColorUtil
  3691. /************************************************************************
  3692. ** IBM Confidential
  3693. **
  3694. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3695. **
  3696. ** (C) Copyright IBM Corp. 2017
  3697. **
  3698. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3699. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3700. ************************************************************************/
  3701. // GENERATED
  3702. var com_ibm_rave_bundles_utilities_ColorUtil = rave['internal']['Declare']({
  3703. });
  3704. /**
  3705. * It is used to get a foreground color which has atleast a 4.5 contrast ratio with the background color.
  3706. * @param (Object) bg bakground color
  3707. * @param (Object) fg foreground color
  3708. * @return (Object) a color ( darker/ligher/same fg color ) which contrast with background.
  3709. */
  3710. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0 = function(bg, fg) {
  3711. var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(bg, fg);
  3712. if (contrastRatio < 4.5) {
  3713. var bgHSL = rave.hsl(bg);
  3714. var fgHSL = rave.hsl(fg);
  3715. 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);
  3716. if (brightness > 0.5) {
  3717. if (bgHSL.getL() > 0.5) {
  3718. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), bgHSL.getL() - 0.4));
  3719. } else {
  3720. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), 0.1));
  3721. }
  3722. } else {
  3723. if (bgHSL.getL() < 0.5) {
  3724. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), bgHSL.getL() + 0.4));
  3725. } else {
  3726. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), 0.9));
  3727. }
  3728. }
  3729. }
  3730. return fg;
  3731. };
  3732. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1 = function(labelColor) {
  3733. var labelRGB = rave.rgb(labelColor);
  3734. return labelRGB.contrastShift(21);
  3735. };
  3736. /** @expose */
  3737. com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio = function(colorA, colorB) {
  3738. var foregroundLuminance = rave.rgb(colorA).getLuminance();
  3739. var backgroundLuminance = rave.rgb(colorB).getLuminance();
  3740. var contrastRatio = (foregroundLuminance >= backgroundLuminance) ? (foregroundLuminance + 0.05) / (backgroundLuminance + 0.05) : (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
  3741. return contrastRatio;
  3742. };
  3743. /** @expose */
  3744. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor = function(a0, a1) {
  3745. var args = arguments;
  3746. if (args.length == 1) {
  3747. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1(a0);
  3748. }
  3749. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0(a0, a1);
  3750. };
  3751. // $source: com/ibm/rave/bundles/utilities/PathUtils
  3752. /************************************************************************
  3753. ** IBM Confidential
  3754. **
  3755. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3756. **
  3757. ** (C) Copyright IBM Corp. 2017
  3758. **
  3759. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3760. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3761. ************************************************************************/
  3762. // GENERATED
  3763. var com_ibm_rave_bundles_utilities_PathUtils = rave['internal']['Declare']({
  3764. });
  3765. /**
  3766. * Transition a path element selection with a fade-out-fade-in effect. In many cases, transitioning between two unrelated path strings will result in an undesirable morphing effect. This method allows the path to first fade out (to opacity 0), update the path string without morphing, then fade back in.
  3767. * @param (rave['internal']['Selection']) selection A selection (either Selector or Transition) containing "path" elements.
  3768. * @param (rave['internal']['ValueFunction']) pathFunction The path string generator function, e.g. Rave.svg.line().
  3769. */
  3770. /** @expose */
  3771. com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn = function(selection, pathFunction) {
  3772. if (selection.isTransition()) {
  3773. var transition = selection;
  3774. transition.ease("linear").styleTween("opacity", function(data, index, value) {
  3775. var path = rave.select(this);
  3776. if (!(this.rave_hasProperty("__rave_originalOpacity__"))) {
  3777. this.rave_setProperty("__rave_originalOpacity__", path.style("opacity"));
  3778. }
  3779. var styleOpacity = this.rave_getProperty("__rave_originalOpacity__");
  3780. var opacity = styleOpacity != null ? parseFloat(""+(styleOpacity)) : 1.0;
  3781. var mid1 = 0.45, mid2 = 0.55;
  3782. var s = rave.scale.linear().domain([0.0, mid1, mid2, 1.0]).range([opacity, 0.0, 0.0, opacity]);
  3783. var setPath = [];
  3784. setPath[0] = false;
  3785. return function(t) {
  3786. if (t > mid1 && !setPath[0]) {
  3787. path.attr("d", pathFunction);
  3788. setPath[0] = true;
  3789. }
  3790. return + (s.call(null, t, 0, 0));
  3791. };
  3792. });
  3793. transition.each("end", function(args) {
  3794. if (args !== null || arguments.length > 1){
  3795. args = Array.prototype.slice.call(arguments, 0);
  3796. }
  3797. {
  3798. this.rave_removeProperty("__rave_originalOpacity__");
  3799. return null;
  3800. }
  3801. });
  3802. } else {
  3803. selection.attr("d", pathFunction);
  3804. }
  3805. };
  3806. //com_ibm_rave_bundles_utilities_PathUtils.OPACITY = "opacity";
  3807. //com_ibm_rave_bundles_utilities_PathUtils.ORIGINAL_OPACITY = "__rave_originalOpacity__";
  3808. //com_ibm_rave_bundles_utilities_PathUtils.PATH_DATA = "d";
  3809. //com_ibm_rave_bundles_utilities_PathUtils.EASE_LINEAR = "linear";
  3810. // $source: com/ibm/rave/bundles/component/AreaComponent
  3811. /************************************************************************
  3812. ** IBM Confidential
  3813. **
  3814. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3815. **
  3816. ** (C) Copyright IBM Corp. 2017
  3817. **
  3818. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3819. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3820. ************************************************************************/
  3821. // GENERATED
  3822. /**
  3823. * <p> A component that renders area elements (polygons defined by a line with points in X and Y dimensions, as in an area chart). The {@link #this.type()} method returns "AreaComponent". </p>
  3824. */
  3825. var com_ibm_rave_bundles_component_AreaComponent = rave['internal']['Declare'].implement(
  3826. /**
  3827. * @param (double) opacity The opacity of the area elements
  3828. * @return (com.ibm.rave.bundles.component.AreaComponent) This component
  3829. */
  3830. //chartOpacity : function(opacity) {},
  3831. /**
  3832. * @param (String) borderColor The color of the line on each area element; if null, the fill color is used
  3833. * @return (com.ibm.rave.bundles.component.AreaComponent) This component
  3834. */
  3835. //borderColor : function(borderColor) {},
  3836. /**
  3837. * @param (String) borderWidth The width of the line on each area element
  3838. * @return (com.ibm.rave.bundles.component.AreaComponent) This component
  3839. */
  3840. //borderWidth : function(borderWidth) {},
  3841. /**
  3842. * The interpolation modes are from the RAVE core line path generator, for example "linear", "cardinal".
  3843. * @param (String) interpolate The interpolation mode
  3844. * @return (com.ibm.rave.bundles.component.AreaComponent) This component
  3845. */
  3846. //interpolate : function(interpolate) {}
  3847. );
  3848. /**
  3849. * The string returned by {@link #this.type()} is "AreaComponent".
  3850. */
  3851. /** @expose */
  3852. com_ibm_rave_bundles_component_AreaComponent.COMPONENT_TYPE = "AreaComponent";
  3853. // $source: com/ibm/rave/bundles/data/LineDataUtilities
  3854. /************************************************************************
  3855. ** IBM Confidential
  3856. **
  3857. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3858. **
  3859. ** (C) Copyright IBM Corp. 2017
  3860. **
  3861. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3862. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3863. ************************************************************************/
  3864. // GENERATED
  3865. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // new
  3866. /**
  3867. * <p> Utility class for working with line and area features, as used in the line, area, and composite bundles. A line or area is represented by a LineDatum, which has a group (line ID) and a points array. The points are two-element arrays as used in the RAVE core line and area path generators. </p> <p> The buildLines method takes tabular data and accessors as used in all three bundles' data models, where the table is of <I>point</I> data with X, Y, and group slots. Points with null X are ignored; other points are formed into lines using the group values. Note that line points may have null Y values; this causes a gap in the line or area. Points are added in data order. </p> <p> The other static methods work with an array of LineDatum as returned by buildLines: </p> <ul> <li> Sort each line by the X value of its points, using a CoordinateScale to define X-ordering. </li> <li> Get all points from the lines that have non-null X and Y values. These points are the ones that would be shown in a line-with-points chart. </li> <li> Get all points from the lines that match the "null-point-null" pattern. This means that the point has a non-null Y, and the points before and after it (using the current line sorting) have null Y. The first point in the line is considered to have a null Y before it, and the last point a null Y after it. </li> </ul> <p> Points are returned as an array of PointDatum so may be used in components exactly as the points returned by PointDataUtilities. </p>
  3868. */
  3869. var com_ibm_rave_bundles_data_LineDataUtilities = rave['internal']['Declare']({
  3870. });
  3871. /**
  3872. * <p> Process tabular data as used in the tabular data models of the line, area, and composite bundles, returning an array-list of LineData objects. Each row of data in the table is a single point with X, Y, and optional group values. The group accessor returns strings, as in all three bundles. The points are grouped by the accessor values (null is treated as a distinct value) and each group forms a LineData. If the group accessor is null, all points are in one group. </p> <p> If the xScale is non-null and returns null for an X value, the point is ignored. </p> <p> The LineData group value is the unique group value (possibly null). The LineData points are the [X,Y] coordinates as an ArrayEx, suitable for use with the line and area path generators. The points in each line are in row (input array) order. This wil be the single place where we need to fix the sorting problem, defect 23553. </p>
  3873. * @param (Array) data Array of data objects
  3874. * @param (rave['internal']['SingleValueFunction']) xAccessor Non-null X accessor function
  3875. * @param (rave['internal']['SingleValueFunction']) xScale Value function used to check if X value is in domain
  3876. * @param (rave['internal']['SingleValueFunction']) yAccessor Non-null Y accessor function
  3877. * @param (rave['internal']['SingleValueFunction']) groupAccessor Possibly-null group accessor function
  3878. * @return (Array) Non-null but possibly empty array of LineData items, one per distinct group value
  3879. */
  3880. /** @expose */
  3881. com_ibm_rave_bundles_data_LineDataUtilities.buildLines = function(data, xAccessor, xScale, yAccessor, groupAccessor) {
  3882. var result = [];
  3883. if (!data || data.length == 0) {
  3884. return result;
  3885. }
  3886. var categories = {};
  3887. var noGroup;
  3888. var lines = {};
  3889. for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
  3890. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3891. var datum = __exp_enFor0[__i_enFor0];
  3892. if (datum == null) {
  3893. continue;
  3894. }
  3895. var xValue = xAccessor(datum);
  3896. if (xValue != null && (!xScale || xScale(xValue) != null)) {
  3897. if (!(categories.hasOwnProperty(xValue))) {
  3898. categories[""+(xValue)] = 1;
  3899. }
  3900. var group = groupAccessor ? (groupAccessor(datum)) : null;
  3901. var line;
  3902. if (group == null) {
  3903. if (!noGroup) {
  3904. noGroup = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(null);
  3905. result.push(noGroup);
  3906. }
  3907. line = noGroup;
  3908. } else {
  3909. line = lines[group];
  3910. if (!line) {
  3911. line = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(group);
  3912. lines[group] = line;
  3913. result.push(line);
  3914. }
  3915. }
  3916. line.addPoint(datum, xValue, yAccessor(datum));
  3917. }
  3918. }
  3919. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(categories), __len_enFor1 = __exp_enFor1.length;
  3920. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3921. var o = __exp_enFor1[__i_enFor1];
  3922. var s = ""+(o);
  3923. var sum = 0;
  3924. for (var i = 0; i < result.length; ++i) {
  3925. var lineDatum = result[i];
  3926. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  3927. var pointDatum = lineDatum._pointData[j];
  3928. if (s == pointDatum._x) {
  3929. pointDatum._yAsPercentOfCategory = NaN;
  3930. var value = + (pointDatum._y);
  3931. sum += Math.abs(value);
  3932. }
  3933. }
  3934. }
  3935. if (sum == 0) {
  3936. continue;
  3937. }
  3938. for (var i = 0; i < result.length; ++i) {
  3939. var lineDatum = result[i];
  3940. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  3941. var pointDatum = lineDatum._pointData[j];
  3942. if (s == pointDatum._x) {
  3943. var value = + (pointDatum._y);
  3944. pointDatum._yAsPercentOfCategory = value / sum * 100;
  3945. }
  3946. }
  3947. }
  3948. }
  3949. for (var i = 0; i < result.length; ++i) {
  3950. var sum = 0;
  3951. var lineDatum = result[i];
  3952. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  3953. var pointDatum = lineDatum._pointData[j];
  3954. pointDatum._yAsPercentOfColor = NaN;
  3955. var value = + (pointDatum._y);
  3956. sum += Math.abs(value);
  3957. }
  3958. if (sum != 0) {
  3959. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  3960. var pointDatum = lineDatum._pointData[j];
  3961. var value = + (pointDatum._y);
  3962. pointDatum._yAsPercentOfColor = value / sum * 100;
  3963. }
  3964. }
  3965. }
  3966. return result;
  3967. };
  3968. com_ibm_rave_bundles_data_LineDataUtilities.get = function(val, data) {
  3969. for (var i = 0; i < data.length; ++i) {
  3970. var entry = data[i];
  3971. if (entry.key===val) {
  3972. return entry;
  3973. }
  3974. }
  3975. return null;
  3976. };
  3977. /** @expose */
  3978. com_ibm_rave_bundles_data_LineDataUtilities.buildLinesForStacking = function(data, xAccessor, yAccessor, groupAccessor) {
  3979. if (!data || data.length == 0) {
  3980. return [];
  3981. }
  3982. var keyToOriginalValue = {};
  3983. var stacks = [];
  3984. var nest = rave.nest();
  3985. nest.key(function(d) {
  3986. var keyValue = xAccessor(d);
  3987. var strKeyValue = (keyValue);
  3988. keyToOriginalValue[strKeyValue] = keyValue;
  3989. return strKeyValue;
  3990. });
  3991. nest.key(function(d) {
  3992. var stack = groupAccessor(d).toString();
  3993. if (!(stacks.indexOf(stack)> -1)) {
  3994. stacks.push(stack);
  3995. }
  3996. return stack;
  3997. });
  3998. var result = nest.entries(data);
  3999. var missingValue = new Number(0);
  4000. var stackData = stacks.map(function(name, index, array) {
  4001. var line = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(array[index].valueOf());
  4002. result.forEach(function(currentValue, index, array) {
  4003. var values = currentValue.values;
  4004. var currentElement = com_ibm_rave_bundles_data_LineDataUtilities.get(line.group, values);
  4005. var datum = null;
  4006. var yValue = null;
  4007. if (!currentElement) {
  4008. yValue = missingValue;
  4009. } else {
  4010. datum = (currentElement.values)[0];
  4011. yValue = yAccessor(datum);
  4012. if (yValue == null) {
  4013. yValue = missingValue;
  4014. }
  4015. }
  4016. line.addPoint(datum, keyToOriginalValue[currentValue.key], yValue);
  4017. return null;
  4018. });
  4019. return line;
  4020. });
  4021. return stackData;
  4022. };
  4023. /**
  4024. * <p> Sort an array of LineData by the X-coordinate. The CoordinateScale must be initialized with the domain of the line data, and its range must be set. The points of each line are sorted in increasing order of the scaled X-value. </p> <p> For efficiency this method assumes the lines are as created by buildLines, so each point is non-null, and has two values of which the first is non-null. </p>
  4025. * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
  4026. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale A non-null scale
  4027. */
  4028. /** @expose */
  4029. com_ibm_rave_bundles_data_LineDataUtilities.sortLines = function(lines, scale) {
  4030. var comp = function(a, b) {
  4031. var av = scale.center(a._x);
  4032. if (av == null) {
  4033. return 1;
  4034. }
  4035. var bv = scale.center(b._x);
  4036. if (bv == null) {
  4037. return -1;
  4038. }
  4039. var v = av - bv;
  4040. return v < 0 ? -1 : v > 0 ? 1 : 0;
  4041. };
  4042. for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
  4043. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4044. var line = __exp_enFor0[__i_enFor0];
  4045. line.sort(comp);
  4046. }
  4047. };
  4048. /**
  4049. * Get one PointDatum object for every point in the lines, omitting any points where the X or Y value is null. The returned array may be empty.
  4050. * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
  4051. * @return (Array) Array of PointDatum for points where X and Y are both non-null
  4052. */
  4053. /** @expose */
  4054. com_ibm_rave_bundles_data_LineDataUtilities.getLineWithPoints = function(lines) {
  4055. var result = [];
  4056. for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
  4057. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4058. var line = __exp_enFor0[__i_enFor0];
  4059. line.getLineWithPoints(result);
  4060. }
  4061. return result;
  4062. };
  4063. /**
  4064. * Get one PointDatum object for every point in the lines that meets the "null-point-null" criterion: The point has non-null X and Y, and the points before/after it have null Y.
  4065. * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
  4066. * @return (Array) Array of PointDatum for points meeting the null-point-null criterion
  4067. */
  4068. /** @expose */
  4069. com_ibm_rave_bundles_data_LineDataUtilities.getNPNPoints = function(lines) {
  4070. var result = [];
  4071. for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
  4072. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4073. var line = __exp_enFor0[__i_enFor0];
  4074. line.getNPNPoints(result);
  4075. }
  4076. return result;
  4077. };
  4078. /**
  4079. * <p> Representation of a line. Assumes that the line will be built from data objects representing points, and grouped into lines by a group key. Contains: </p> <p> Group key, for the line identifier. May be null. </p> <p> Array of PointDatum objects. This is used when sorting the point data. </p> <p> Array of points for line or area generator. Each point is a two-element [x,y] array in the unscaled data space. </p> <p> Original data. This is an array of objects from the original point data. </p>
  4080. */
  4081. com_ibm_rave_bundles_data_LineDataUtilities.LineDatum = rave['internal']['Declare']({
  4082. /**
  4083. * Group key, may be null
  4084. */
  4085. /** @expose */
  4086. group : null,
  4087. /**
  4088. * Array of line-generator points in data space, non-null but may be empty
  4089. */
  4090. /** @expose */
  4091. points : null,
  4092. /**
  4093. * Array of point datum objects, non-null but may be empty.
  4094. */
  4095. //_pointData : null,
  4096. /**
  4097. * Original data, non-null but may be empty.
  4098. */
  4099. //_originalData : null,
  4100. /**
  4101. * Construct.
  4102. * @param (String) group The line's group.
  4103. */
  4104. constructor : function(group) {
  4105. this.group = group;
  4106. this.points = [];
  4107. this._pointData = [];
  4108. this._originalData = [];
  4109. },
  4110. /** @expose */
  4111. originalData : function() {
  4112. return this._originalData;
  4113. },
  4114. /** @expose */
  4115. originalDataList : function() {
  4116. return this._originalData;
  4117. },
  4118. /**
  4119. * Add a point to the line.
  4120. * @param (Object) originalData Original data for this point
  4121. * @param (Object) x X value, must not be null
  4122. * @param (Object) y Y value, may be null (for line/non-stacking area charts with gaps for null Y)
  4123. */
  4124. addPoint : function(originalData, x, y) {
  4125. var point = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
  4126. point._x = x;
  4127. point._y = y;
  4128. point._originalData = originalData;
  4129. this.points.push([x, y]);
  4130. this._pointData.push(point);
  4131. this._originalData.push(originalData);
  4132. },
  4133. /**
  4134. * Sort the points by X value (data values) using the comparator, which must compare the X values of two PointDatum objects. The PointDatum array is sorted first, then the line generator and original data arrays are sorted to match.
  4135. * @param (rave['internal']['Comparator']) comp Comparator that takes PointDatum arguments and sorts by X value
  4136. */
  4137. sort : function(comp) {
  4138. this._pointData.sort(comp);
  4139. var N = this._pointData.length;
  4140. for (var i = 0; i < N; ++i) {
  4141. var d = this._pointData[i];
  4142. var p = this.points[i];
  4143. p[0] = d._x;
  4144. p[1] = d._y;
  4145. this._originalData[i] = d._originalData;
  4146. }
  4147. },
  4148. /**
  4149. * Add all PointDatum objects where X and Y are non-null to the array. For efficiency this assumes the X values are non-null.
  4150. * @param (Array) result Array collecting points
  4151. */
  4152. getLineWithPoints : function(result) {
  4153. for (var __i_enFor0 = 0, __exp_enFor0 = this._pointData, __len_enFor0 = __exp_enFor0.length;
  4154. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4155. var point = __exp_enFor0[__i_enFor0];
  4156. if (point._y != null) {
  4157. result.push(point);
  4158. }
  4159. }
  4160. },
  4161. /**
  4162. * Add all PointDatum objects that meet the "null-point-null" criterion to the array. For efficiency this assumes the X values are non-null.
  4163. * @param (Array) result Array collecting points
  4164. */
  4165. getNPNPoints : function(result) {
  4166. var N = this._pointData.length;
  4167. var lastY;
  4168. for (var i = 0; i < N; ++i) {
  4169. var point = this._pointData[i];
  4170. if (point._y != null) {
  4171. var nextY = (i < N - 1) ? this._pointData[i + 1]._y : null;
  4172. if (lastY == null && nextY == null) {
  4173. result.push(point);
  4174. }
  4175. }
  4176. lastY = point._y;
  4177. }
  4178. }
  4179. });
  4180. /**
  4181. * A value function that takes a LineData as argument and returns the group.
  4182. */
  4183. /** @expose */
  4184. com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR = function(d) {
  4185. return (d).group;
  4186. };
  4187. /**
  4188. * A value function that takes a LineData as argument and returns theoints.
  4189. */
  4190. /** @expose */
  4191. com_ibm_rave_bundles_data_LineDataUtilities.POINTS_ACCESSOR = function(d) {
  4192. return (d).points;
  4193. };
  4194. // $source: com/ibm/rave/bundles/components/ComponentConfiguration
  4195. /************************************************************************
  4196. ** IBM Confidential
  4197. **
  4198. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4199. **
  4200. ** (C) Copyright IBM Corp. 2017
  4201. **
  4202. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4203. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4204. ************************************************************************/
  4205. // GENERATED
  4206. /**
  4207. * 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"} .
  4208. */
  4209. var com_ibm_rave_bundles_components_ComponentConfiguration = rave['internal']['Declare']({
  4210. //constructor : function() {}
  4211. });
  4212. /**
  4213. * <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>
  4214. * @param (rave['internal']['Selection']) chart Selection on which to run the zoom, may be null
  4215. * @param (rave['internal']['Zoom']) zoom The Zoom; if null one is created and returned
  4216. * @param (rave['library']['internal']['CoordinateScaleImpl']) xScale X dimension scale, may be null
  4217. * @param (rave['library']['internal']['CoordinateScaleImpl']) yScale Y dimension scale, may be null
  4218. * @param (rave['library']['internal']['CoordinateScaleImpl']) x2Scale X2 dimension scale, may be null
  4219. * @param (rave['library']['internal']['CoordinateScaleImpl']) y2Scale Y2 dimension scale, may be null
  4220. * @param (Array) scaleExtent Scale extent, may be null; if null the range 0.2 to 5.0 is used
  4221. * @param (rave['internal']['RectStruct']) chartRect The rectangle of the chart
  4222. * @param (double[]) p the zoom translate position (x, y, x2, y2)
  4223. * @param (double[]) s the zoom scale (x, y, x2, y2)
  4224. * @param (String) zoomOps The zoom operation (x|y|x2|y2|all)
  4225. * @param (rave['internal']['RunFunction']) callback Callback on each zoom event, must not be null
  4226. * @return (rave['internal']['Zoom']) The zoom
  4227. */
  4228. /** @expose */
  4229. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom = function(chart, zoom, xScale, yScale, x2Scale, y2Scale, scaleExtent, chartRect, p, s, zoomOps, callback) {
  4230. var z = zoom ? zoom : rave.behavior.zoom();
  4231. var z1 = (x2Scale || y2Scale) && zoomOps == "all" ? rave.behavior.zoom() : null;
  4232. var dummyScale = (rave.scale.linear());
  4233. z.x(dummyScale);
  4234. z.y(dummyScale);
  4235. if (xScale && zoomOps == "x") {
  4236. z.x(xScale.scale());
  4237. z.scale(s[0]);
  4238. z.translate([p[0], 0]);
  4239. }
  4240. if (yScale && zoomOps == "y") {
  4241. z.y(yScale.scale());
  4242. z.scale(s[1]);
  4243. z.translate([0, p[1]]);
  4244. }
  4245. if (x2Scale && zoomOps == "x2") {
  4246. z.x(x2Scale.scale());
  4247. z.scale(s[2]);
  4248. z.translate([p[2], 0]);
  4249. }
  4250. if (y2Scale && zoomOps == "y2") {
  4251. z.y(y2Scale.scale());
  4252. z.scale(s[3]);
  4253. z.translate([0, p[3]]);
  4254. }
  4255. if (zoomOps == "all") {
  4256. if (xScale) {
  4257. z.x(xScale.scale());
  4258. }
  4259. if (yScale) {
  4260. z.y(yScale.scale());
  4261. }
  4262. z.scale(1);
  4263. z.translate([0, 0]);
  4264. if (z1) {
  4265. if (x2Scale) {
  4266. z1.x(x2Scale.scale());
  4267. }
  4268. if (y2Scale) {
  4269. z1.y(y2Scale.scale());
  4270. }
  4271. z1.scale(1);
  4272. z1.translate([0, 0]);
  4273. }
  4274. }
  4275. z.scaleExtent(scaleExtent ? scaleExtent : [1, Infinity]).on("zoom.default", function(args) {
  4276. if (args !== null || arguments.length > 1){
  4277. args = Array.prototype.slice.call(arguments, 0);
  4278. }
  4279. {
  4280. var event = args[3];
  4281. var scale = event.scale;
  4282. var translate = event.translate;
  4283. var scaledX = chartRect.x * (scale - 1);
  4284. var scaledXExtent = (chartRect.width * (1 - scale)) - scaledX;
  4285. translate[0] = Math.min(-scaledX, Math.max(scaledXExtent, translate[0]));
  4286. var scaledY = chartRect.y * (scale - 1);
  4287. var scaledYExtent = (chartRect.height * (1 - scale)) - scaledY;
  4288. translate[1] = Math.min(-scaledY, Math.max(scaledYExtent, translate[1]));
  4289. z.translate([translate[0], translate[1]]);
  4290. if (z1) {
  4291. z1.translate([translate[0], translate[1]]);
  4292. z1.scale(scale);
  4293. }
  4294. if (zoomOps == "x") {
  4295. p[0] = translate[0];
  4296. s[0] = scale;
  4297. } else if (zoomOps == "y") {
  4298. p[1] = translate[1];
  4299. s[1] = scale;
  4300. } else if (zoomOps == "x2") {
  4301. p[2] = translate[0];
  4302. s[2] = scale;
  4303. } else if (zoomOps == "y2") {
  4304. p[3] = translate[1];
  4305. s[3] = scale;
  4306. } else if (zoomOps == "all") {
  4307. p[0] = translate[0];
  4308. p[1] = translate[1];
  4309. p[2] = translate[0];
  4310. p[3] = translate[1];
  4311. s[0] = scale;
  4312. s[1] = scale;
  4313. s[2] = scale;
  4314. s[3] = scale;
  4315. }
  4316. return callback.apply(this, args);
  4317. }
  4318. });
  4319. return z;
  4320. };
  4321. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModule
  4322. /************************************************************************
  4323. ** IBM Confidential
  4324. **
  4325. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4326. **
  4327. ** (C) Copyright IBM Corp. 2015
  4328. **
  4329. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4330. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4331. ************************************************************************/
  4332. // Must be the first import
  4333. // @import ./BundleModuleHeader
  4334. // expose DataFormatter to the global variable rave
  4335. //rave["library"]["CustomFormatter"]=com_ibm_rave_library_framework_CustomFormatter;
  4336. // $source: com/ibm/rave/bundles/areaBundle/AreaBundle
  4337. /************************************************************************
  4338. ** IBM Confidential
  4339. **
  4340. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4341. **
  4342. ** (C) Copyright IBM Corp. 2017
  4343. **
  4344. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4345. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4346. ************************************************************************/
  4347. // GENERATED
  4348. //@import com/ibm/rave/library/Library (static) // Library
  4349. //@import com/ibm/rave/bundles/RaveBundle (loadtime) // superclass
  4350. //@import com/ibm/rave/bundles/areaBundle/AreaView (runtime) // new
  4351. var com_ibm_rave_bundles_areaBundle_AreaBundle = rave['internal']['Declare'](com_ibm_rave_bundles_RaveBundle, {
  4352. /** @expose */
  4353. getName : function() {
  4354. return "areaBundle";
  4355. },
  4356. /** @expose */
  4357. createView : function(ctx) {
  4358. return new com_ibm_rave_bundles_areaBundle_AreaView(ctx);
  4359. }
  4360. //constructor : function() {}
  4361. });
  4362. /**
  4363. * Register the bundle factory with the library. The bundle will not be made available if this method is not called.
  4364. */
  4365. /** @expose */
  4366. com_ibm_rave_bundles_areaBundle_AreaBundle.init = function() {
  4367. if (!(com_ibm_rave_library_Library.bundle.isRegistered("areaBundle"))) {
  4368. var bundle;
  4369. com_ibm_rave_library_Library.bundle.extension("areaBundle", function() {
  4370. if (!bundle) {
  4371. bundle = new com_ibm_rave_bundles_areaBundle_AreaBundle();
  4372. bundle.loadResources();
  4373. require("./vizlibrary-area.css");
  4374. }
  4375. return bundle;
  4376. });
  4377. }
  4378. return "areaBundle";
  4379. };
  4380. com_ibm_rave_bundles_areaBundle_AreaBundle.BUNDLE_NAME = "areaBundle";
  4381. // Auto initialization
  4382. com_ibm_rave_bundles_areaBundle_AreaBundle.init();
  4383. if (!com_ibm_rave_library_Library.bundle["areaBundle"]) {
  4384. com_ibm_rave_library_Library.bundle["areaBundle"] = function() {
  4385. if (!bundle) {
  4386. bundle = new com_ibm_rave_bundles_areaBundle_AreaBundle();
  4387. bundle.loadResources();
  4388. require("./vizlibrary-area.css");
  4389. }
  4390. return bundle;
  4391. };
  4392. } else {
  4393. console.log("Could not register extension: AreaBundle");
  4394. }
  4395. // $source: com/ibm/rave/bundles/areaBundle/AreaView
  4396. /************************************************************************
  4397. ** IBM Confidential
  4398. **
  4399. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4400. **
  4401. ** (C) Copyright IBM Corp. 2018
  4402. **
  4403. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4404. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4405. ************************************************************************/
  4406. // GENERATED
  4407. //@import com/ibm/rave/bundles/views/BundleView (loadtime) // superclass
  4408. //@import com/ibm/rave/bundles/components/AreaComponentImpl (runtime) // new
  4409. //@import com/ibm/rave/bundles/data/LineDataUtilities (runtime) // buildLines, sortLines, LineDataUtilities, buildLinesForStacking
  4410. //@import com/ibm/rave/bundles/components/AxesManager (runtime) // percentFormat
  4411. //@import com/ibm/rave/bundles/components/ComponentConfiguration (runtime) // configureZoom
  4412. /**
  4413. * Draws area charts with a categorical independent axis and a numeric dependent axis. The data entities each define independent and dependent values and a group. Entities with the same group are combined to form the area element. Groups are also used for the area color. Areas may be plotted normally, stacked, stacked to 100%, or streamed.
  4414. */
  4415. var com_ibm_rave_bundles_areaBundle_AreaView = rave['internal']['Declare'](com_ibm_rave_bundles_views_BundleView, {
  4416. /**
  4417. * Line component, created in setup
  4418. */
  4419. //_areaComponent : null,
  4420. //_dependentScale : null, //_independentScale : null,
  4421. //_areaData : null,
  4422. //zoomXScale : null, //zoomYScale : null,
  4423. //zoomendedTimer : null,
  4424. /**
  4425. * Is the data meant for a stack chart or simple?
  4426. */
  4427. _isStacked : false,
  4428. /**
  4429. * Construct the view
  4430. * @param (rave['library']['internal']['BundleContext']) context Bundle context
  4431. */
  4432. /** @expose */
  4433. constructor : function(context) {
  4434. this._areaComponent = null;
  4435. this._isStacked = false;
  4436. },
  4437. /** @expose */
  4438. isAxesManagerRequired : function() {
  4439. return true;
  4440. },
  4441. /** @expose */
  4442. setup : function() {
  4443. com_ibm_rave_bundles_views_BundleView.prototype.setup.call(this);
  4444. var style = {};
  4445. style["stroke-width"] = "1px";
  4446. style["stroke"] = function(data, index, groupIndex) {
  4447. return rave.select(this).style("fill");
  4448. };
  4449. rave['library']['internal']['BundleUtils'].setupDefaultActions(this.context, ".chart .element-shape", style);
  4450. this._areaComponent = new com_ibm_rave_bundles_components_AreaComponentImpl();
  4451. this._areaComponent.pointsAccessor(com_ibm_rave_bundles_data_LineDataUtilities.POINTS_ACCESSOR).groupAccessor(com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR);
  4452. },
  4453. /** @expose */
  4454. draw : function() {
  4455. if (this.isUpdateNothing()) {
  4456. return;
  4457. }
  4458. this.preDraw("g.vizlibrary-area");
  4459. if (!(this.validateDataModel("g.element-group", "g.grid", "g.axis"))) {
  4460. return;
  4461. }
  4462. var borderWidth = this.context.convertCSSSizeToPixels(this.context.getPropertyValue("area.borderWidth"));
  4463. var borderColor = (this.context.getPropertyValue("area.borderColor"));
  4464. var areaOpacity = (this.context.getPropertyValue("area.opacity"));
  4465. var highlight = this.context.actions.action("highlight").getOperation();
  4466. if ((borderWidth.length > 0) && (rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(borderWidth, 100.0, 10.0) > 0)) {
  4467. highlight.primaryStyleDefault["stroke-width"] = borderWidth;
  4468. } else {
  4469. highlight.primaryStyleDefault["stroke-width"] = "2px";
  4470. }
  4471. var unHighlightstyle = {};
  4472. unHighlightstyle["stroke-width"] = borderWidth;
  4473. unHighlightstyle["stroke"] = borderColor;
  4474. this.context.actions.action("unhighlight").setOperation(rave['library']['internal']['OperationsUtil'].unhighlight(unHighlightstyle));
  4475. var style = {};
  4476. style["stroke-width"] = borderWidth;
  4477. style["stroke"] = borderColor;
  4478. style["opacity"] = areaOpacity;
  4479. this.context.actions.action("deselectAll").setOperation(rave['library']['internal']['OperationsUtil'].deselectAll(style));
  4480. this.context.actions.action("toggleSelect").setOperation(rave['library']['internal']['OperationsUtil'].toggleSelection(style));
  4481. var effect = this.getStringProperty("effect.name");
  4482. var duration = this.getEffectDuration(effect);
  4483. var dataHandling = this.getStringProperty("data.handling");
  4484. var transpose = this.getBooleanProperty("transpose");
  4485. this._isStacked = !("Simple" == dataHandling);
  4486. var dataSet = this.dataModel.dataset("data");
  4487. var xDataSlotEntry = dataSet.slot("x").entry();
  4488. var yDataSlotEntry = dataSet.slot("y").entry();
  4489. var groupDataSlotEntry = dataSet.slot("color").entry();
  4490. if (!groupDataSlotEntry && yDataSlotEntry) {
  4491. dataSet.slot("color").overrideLabel(yDataSlotEntry.label());
  4492. }
  4493. var data = (dataSet.data());
  4494. var colorPalette = this.getPalette();
  4495. colorPalette.setData(dataSet, "color");
  4496. colorPalette.setAccessor(com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR);
  4497. var legendPosition = this.getLegendPosition();
  4498. this._legends.visible(this.isShowLegend()).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", groupDataSlotEntry)).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, groupDataSlotEntry);
  4499. if (this.updateType == 0) {
  4500. var xAccessor = rave['library']['internal']['AbstractView'].accessorOf(xDataSlotEntry);
  4501. var yAccessor = rave['library']['internal']['AbstractView'].accessorOf(yDataSlotEntry);
  4502. var groupAccessor = rave['library']['internal']['AbstractView'].accessorOf(groupDataSlotEntry);
  4503. if (this._isStacked && (groupAccessor)) {
  4504. this._areaData = com_ibm_rave_bundles_data_LineDataUtilities.buildLinesForStacking(data, xAccessor, yAccessor, groupAccessor);
  4505. } else {
  4506. var xScale = rave['library']['internal']['AbstractView'].domainCheckerOf(data, xDataSlotEntry);
  4507. this._areaData = com_ibm_rave_bundles_data_LineDataUtilities.buildLines(data, xAccessor, xScale, yAccessor, groupAccessor);
  4508. }
  4509. }
  4510. var stacked100 = "Stacked100" == this.getStringProperty("data.handling");
  4511. if (this.updateType <= 1) {
  4512. this._independentScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(data, xDataSlotEntry, false);
  4513. this._dependentScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(data, yDataSlotEntry);
  4514. var subDomainDivisionY = yDataSlotEntry.subDomainDivision();
  4515. var scaleDivisionY = subDomainDivisionY == null ? null : + (subDomainDivisionY);
  4516. 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);
  4517. this.prepareLayoutComponent();
  4518. this.prepareLayoutSizables(this._layoutComponent, false, true, true, false, this._legends.anyVisible());
  4519. var isLegendLeftOrRight = "left" == legendPosition || "right" == legendPosition;
  4520. if (isLegendLeftOrRight) {
  4521. this._legends.preLayout(this._layoutComponent, false);
  4522. this._axes.preLayout(this._layoutComponent, false, 0.1, 0.0, 0, 0.1, 0.0, 0);
  4523. } else {
  4524. this._axes.preLayout(this._layoutComponent, true, 0.1, 0.0, 0, 0.1, 0.0, 0);
  4525. this._legends.preLayout(this._layoutComponent, true);
  4526. }
  4527. this._layoutComponent.layout();
  4528. legendPosition = this._layoutComponent.legendPosition();
  4529. this._legends.position(legendPosition);
  4530. this._axes.useBoundsFromLayout(this._layoutComponent).setScaleRanges(0.1, 0.0, 0);
  4531. if (this.updateType == 0 && this._independentScale) {
  4532. com_ibm_rave_bundles_data_LineDataUtilities.sortLines(this._areaData, this._independentScale);
  4533. }
  4534. if (this._isStacked && this._independentScale && this._dependentScale) {
  4535. this._areaData = this.addBaseline(this._areaData, dataHandling);
  4536. var numbers = this.calculateDependentDomain(this._areaData, dataHandling);
  4537. if (!yDataSlotEntry.domain()) {
  4538. this._dependentScale = rave['library']['internal']['LinearCoordinateScale'].create(numbers);
  4539. this._axes.scale(2, this._dependentScale).setScaleRanges(0.1, 0.0, 0);
  4540. }
  4541. }
  4542. if (this._independentScale) {
  4543. this._independentScale.expandZeroExtent(false);
  4544. if (this.getBooleanProperty("axis.x.scale.nice")) {
  4545. this._independentScale.nice();
  4546. }
  4547. if (this.getBooleanProperty("axis.x.scale.includeZero")) {
  4548. this._independentScale.includeZero();
  4549. }
  4550. if (transpose) {
  4551. this.zoomYScale = this._independentScale.scale().copy();
  4552. } else {
  4553. this.zoomXScale = this._independentScale.scale().copy();
  4554. }
  4555. }
  4556. if (this._dependentScale) {
  4557. if (!("Stream" == dataHandling) && this.getBooleanProperty("axis.y.scale.includeZero")) {
  4558. this._dependentScale.includeZero();
  4559. }
  4560. this._dependentScale.expandZeroExtent(false);
  4561. if (this.getBooleanProperty("axis.y.scale.nice")) {
  4562. this._dependentScale.nice(scaleDivisionY);
  4563. }
  4564. if (transpose) {
  4565. this.zoomXScale = this._dependentScale.scale().copy();
  4566. } else {
  4567. this.zoomYScale = this._dependentScale.scale().copy();
  4568. }
  4569. }
  4570. this.resetZoom();
  4571. }
  4572. var elementRect = this._layoutComponent.elementRect();
  4573. this._clip.clipRect(elementRect).applyTo(this._chart.select(".content")).call(this.context.node.select("defs").transition().duration(duration));
  4574. this._chart.select("rect.background.elements").attr("x", elementRect.x).attr("y", elementRect.y).attr("width", elementRect.width).attr("height", elementRect.height);
  4575. this._legends.rectangle(this._layoutComponent.legendRect());
  4576. var xScale = this._independentScale, yScale = this._dependentScale;
  4577. if (transpose) {
  4578. xScale = this._dependentScale;
  4579. yScale = this._independentScale;
  4580. }
  4581. this.setBackgroundProperties(elementRect, duration);
  4582. this._areaComponent.data(this._areaData).independentScale(this._independentScale).dependentScale(this._dependentScale).transpose(transpose).colorPalette(colorPalette).effect(effect).stack(this._isStacked).setPreExecute(this.context.getPreExecute()).interpolate(this.getStringProperty(com_ibm_rave_bundles_areaBundle_AreaView.AREA_INTREPOLATE_PROPERTY)).borderColor(borderColor).borderWidth(borderWidth).chartOpacity(areaOpacity);
  4583. this._chart.selectAll("g.element-group").transition().duration(duration).call(this._areaComponent);
  4584. this._axes.visible(true).duration(duration).useDefaultSelectors().useDefaultX1Properties(true).useDefaultY1Properties(true).setTickFormatter(0, xDataSlotEntry).setTickFormatterList(2, [yDataSlotEntry], stacked100 ? "percent" : "none", stacked100 ? com_ibm_rave_bundles_components_AxesManager.percentFormat(0) : null);
  4585. this._axes.draw();
  4586. this._legends.draw();
  4587. if (this.updateType <= 2) {
  4588. var ops = this.getStringProperty("zoom");
  4589. if (xScale && (ops == "all" || ops == "x")) {
  4590. (xScale.scale()).domain(this.zoomXScale.domain());
  4591. }
  4592. if (yScale && (ops == "all" || ops == "y")) {
  4593. (yScale.scale()).domain(this.zoomYScale.domain());
  4594. }
  4595. var self = this;
  4596. var zoom = this.context.actions.action("zoom").get("zoom");
  4597. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom(this._chart, zoom, xScale, yScale, null, null, null, elementRect, this._zoomP, this._zoomS, this.getStringProperty("zoom"), function(args) {
  4598. if (args !== null || arguments.length > 1){
  4599. args = Array.prototype.slice.call(arguments, 0);
  4600. }
  4601. {
  4602. self._chart.selectAll("g.element-group").call(self._areaComponent);
  4603. self._axes.redraw(true);
  4604. return self._chart;
  4605. }
  4606. });
  4607. zoom.on("zoomend.hideLabels", function(args) {
  4608. if (args !== null || arguments.length > 1){
  4609. args = Array.prototype.slice.call(arguments, 0);
  4610. }
  4611. {
  4612. if (self._axes.hideAnyPanZoom()) {
  4613. if (self.zoomendedTimer != null) {
  4614. clearTimeout(self.zoomendedTimer);
  4615. }
  4616. self.zoomendedTimer = setTimeout(function() {
  4617. self.zoomendedTimer = null;
  4618. self._axes.redraw(false);
  4619. }, 300);
  4620. }
  4621. return null;
  4622. }
  4623. });
  4624. }
  4625. this.resetUpdate();
  4626. this._chart.selectAll(".element-shape").classed("bundle-shape", true);
  4627. this._chart.selectAll(".legendShape").classed("bundle-shape", true);
  4628. },
  4629. /** @expose */
  4630. getCoordinateScale : function(role) {
  4631. if ("ROLE_X1" == role) {
  4632. return this._independentScale;
  4633. }
  4634. if ("ROLE_Y1" == role) {
  4635. return this._dependentScale;
  4636. }
  4637. return null;
  4638. },
  4639. /**
  4640. * Using the Stack Layout, add a baseline for each point
  4641. * @return (Array) Array of areas with the included baseline values for all the points
  4642. */
  4643. /** @expose */
  4644. addBaseline : function(data, dataHandling) {
  4645. var self = this;
  4646. var stacklayout = rave.layout.stack();
  4647. stacklayout.values(function(arg1, arg2, arg3) {
  4648. return (arg1).points;
  4649. }).x(function(arg1, arg2, arg3) {
  4650. return self._independentScale.scale().call(null, (arg1)[0], arg2, arg3);
  4651. }).y(function(arg1, arg2, arg3) {
  4652. return (arg1)[1];
  4653. }).out(function(stackNode, y0, y) {
  4654. (stackNode).push(y0);
  4655. if ("Stacked100" == dataHandling) {
  4656. (stackNode)[1] = y;
  4657. }
  4658. });
  4659. if ("Stream" == dataHandling) {
  4660. stacklayout.offset("silhouette");
  4661. }
  4662. if ("Stacked100" == dataHandling) {
  4663. stacklayout.offset(com_ibm_rave_bundles_areaBundle_AreaView.STACKOFFSET_EXPANDPERCENT);
  4664. }
  4665. return stacklayout.accumulator("separate-positives-negatives").stack(data, 0);
  4666. },
  4667. /**
  4668. * Calculate the min and max domain for the Y axis based on the data. If the dataHandling is stream, the Y values are offset so that the domain is centered at 0.
  4669. * @param (Array) data Array of lines
  4670. * @param (String) dataHandling Data handling property value
  4671. * @return (Array) [min,max] of point Y values; Y data values are modified when handing is stream
  4672. */
  4673. calculateDependentDomain : function(data, dataHandling) {
  4674. var yValueMin = function(point, ix, ctxt) {
  4675. var v1 = + (point[2]);
  4676. return Math.min(v1, + (point[1]) + v1);
  4677. };
  4678. var yValueMax = function(point, ix, ctxt) {
  4679. var v1 = + (point[2]);
  4680. return Math.max(v1, + (point[1]) + v1);
  4681. };
  4682. var min = + (rave.min(data, function(lineData, ix, iy) {
  4683. return + (rave.min((lineData).points.map(yValueMin)));
  4684. }));
  4685. var max = + (rave.max(data, function(lineData, ix, iy) {
  4686. return + (rave.max((lineData).points.map(yValueMax)));
  4687. }));
  4688. if ("Stream" == dataHandling) {
  4689. for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
  4690. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4691. var line = __exp_enFor0[__i_enFor0];
  4692. for (var __i_enFor1 = 0, __exp_enFor1 = line.points, __len_enFor1 = __exp_enFor1.length;
  4693. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  4694. var point = __exp_enFor1[__i_enFor1];
  4695. if (point[2] != null) {
  4696. point[2] = + (point[2]) - min;
  4697. }
  4698. }
  4699. }
  4700. max = max - min;
  4701. min = 0.0;
  4702. }
  4703. return [min, max];
  4704. },
  4705. /** @expose */
  4706. getGroupStructure : function() {
  4707. return ["defs", "g.vizlibrary vizlibrary-area", "(", "rect.background chart", "g.chart", "(", "g.content", "(", "rect.background elements", "g.gridlines", "(", "g.grid left", "g.grid bottom", ")", "g.elements", "(", "g.element-group", ")", ")", "g.axes", "(", "g.axes-layout", "g.axisTransform left", "g.axisTransform bottom", ")", "g.axis-callout", ")", "g.legends", "(", "g.legends-layout", "g.legend", ")", ")"];
  4708. }
  4709. });
  4710. //com_ibm_rave_bundles_areaBundle_AreaView.DATAMODEL_TABULAR = "tabular";
  4711. //com_ibm_rave_bundles_areaBundle_AreaView.DATASET_DATA = "data";
  4712. //com_ibm_rave_bundles_areaBundle_AreaView.DATASLOT_X = "x";
  4713. //com_ibm_rave_bundles_areaBundle_AreaView.DATASLOT_Y = "y";
  4714. //com_ibm_rave_bundles_areaBundle_AreaView.DATASLOT_GROUP = "color";
  4715. com_ibm_rave_bundles_areaBundle_AreaView.AREA_INTREPOLATE_PROPERTY = "area.interpolate";
  4716. /**
  4717. * Copied from core StackLayout.java, but normalizes to 0,100 instead of 0,1.
  4718. */
  4719. com_ibm_rave_bundles_areaBundle_AreaView.STACKOFFSET_EXPANDPERCENT = function(data, index, groupIndex) {
  4720. var aData = data;
  4721. var n = aData.length;
  4722. var m = aData[0].length;
  4723. var k = 100.0 / n;
  4724. var y0 = [];
  4725. for (var j = 0; j < m; ++j) {
  4726. var oPos = 0;
  4727. var oNeg = 0;
  4728. for (var i = 0; i < n; ++i) {
  4729. var value = aData[i][j][1];
  4730. if (value >= 0) {
  4731. oPos += value;
  4732. } else {
  4733. oNeg += value;
  4734. }
  4735. }
  4736. if (oPos != 0 || oNeg != 0) {
  4737. for (var i = 0; i < n; ++i) {
  4738. var ijElement = aData[i][j];
  4739. var val = ijElement[1];
  4740. if (val >= 0) {
  4741. ijElement[1] = 100.0 * val / oPos;
  4742. } else {
  4743. ijElement[1] = (-100.0) * val / oNeg;
  4744. }
  4745. }
  4746. } else {
  4747. for (var i = 0; i < n; ++i) {
  4748. var ijElement = aData[i][j];
  4749. ijElement[1] = k;
  4750. }
  4751. }
  4752. }
  4753. for (var j = 0; j < m; ++j) {
  4754. y0[j] = 0;
  4755. }
  4756. return y0;
  4757. };
  4758. // $source: com/ibm/rave/bundles/components/BackgroundComponentImpl
  4759. /************************************************************************
  4760. ** IBM Confidential
  4761. **
  4762. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4763. **
  4764. ** (C) Copyright IBM Corp. 2017
  4765. **
  4766. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4767. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4768. ************************************************************************/
  4769. // GENERATED
  4770. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  4771. //@import com/ibm/rave/bundles/component/BackgroundComponent (runtime) // BackgroundComponent
  4772. /**
  4773. * <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>
  4774. */
  4775. var com_ibm_rave_bundles_components_BackgroundComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  4776. //_backgroundColor : null,
  4777. //_rect : null,
  4778. /** @expose */
  4779. constructor : function() {
  4780. this._rect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4781. },
  4782. /** @expose */
  4783. execute : function(g) {
  4784. this.preExecute();
  4785. g.style("fill", this._backgroundColor != null ? this._backgroundColor : "#FFFFFF").style("fill-opacity", 1.0);
  4786. g.attr("x", this._rect.x).attr("y", this._rect.y).attr("width", this._rect.width).attr("height", this._rect.height);
  4787. },
  4788. /** @expose */
  4789. type : function() {
  4790. return com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE;
  4791. },
  4792. backgroundColor$0 : function() {
  4793. return this._backgroundColor;
  4794. },
  4795. backgroundColor$1 : function(backgroundColor) {
  4796. this._backgroundColor = backgroundColor;
  4797. return this;
  4798. },
  4799. /**
  4800. * @param (rave['library']['internal']['ContextSize']) size New value of size property
  4801. * @return (com.ibm.rave.bundles.components.BackgroundComponentImpl) This component
  4802. */
  4803. /** @expose */
  4804. size : function(size) {
  4805. this._rect.x = 0;
  4806. this._rect.y = 0;
  4807. this._rect.width = size.w;
  4808. this._rect.height = size.h;
  4809. return this;
  4810. },
  4811. /** @expose */
  4812. rect : function(rect) {
  4813. var r = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  4814. this._rect = r;
  4815. return this;
  4816. },
  4817. /** @expose */
  4818. backgroundColor : function(a0) {
  4819. var args = arguments;
  4820. if (args.length == 0) {
  4821. return this.backgroundColor$0();
  4822. }
  4823. return this.backgroundColor$1(a0);
  4824. }
  4825. });
  4826. // $source: com/ibm/rave/bundles/components/ChartLayoutComponentImpl
  4827. /************************************************************************
  4828. ** IBM Confidential
  4829. **
  4830. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4831. **
  4832. ** (C) Copyright IBM Corp. 2017
  4833. **
  4834. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4835. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4836. ************************************************************************/
  4837. // GENERATED
  4838. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  4839. //@import com/ibm/rave/bundles/component/ChartLayoutComponent (runtime) // ChartLayoutComponent
  4840. /**
  4841. * <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>
  4842. */
  4843. var com_ibm_rave_bundles_components_ChartLayoutComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  4844. //_padding : null,
  4845. //_legendChartGap : null,
  4846. //_topChartPadding : null,
  4847. //_leftChartPadding : null,
  4848. //_bottomChartPadding : null,
  4849. //_rightChartPadding : null,
  4850. //_legendPosition : null,
  4851. //_legendSizable : null,
  4852. //_axisSizables : null,
  4853. //_overallRect : null,
  4854. //_legendRect : null,
  4855. //_chartRect : null,
  4856. //_topRect : null,
  4857. //_leftRect : null,
  4858. //_bottomRect : null,
  4859. //_rightRect : null,
  4860. //_elementRect : null,
  4861. _leftPadding : 0, _topPadding : 0, _rightPadding : 0, _bottomPadding : 0,
  4862. _legendChartAlign : false,
  4863. _preLegendAtMax : false,
  4864. _preAxesAtZero : false,
  4865. constructor : function() {
  4866. this._axisSizables = [];
  4867. /**
  4868. * Construct. All padding is 0, legendPosition is "right", all slices have a size of 0 (value of null).
  4869. */
  4870. {
  4871. this._padding = 0.0;
  4872. this._topPadding = 0;
  4873. this._leftPadding = 0;
  4874. this._bottomPadding = 0;
  4875. this._rightPadding = 0;
  4876. this._topChartPadding = 0.0;
  4877. this._leftChartPadding = 0.0;
  4878. this._bottomChartPadding = 0.0;
  4879. this._rightChartPadding = 0.0;
  4880. this._legendChartGap = 0.0;
  4881. this._legendPosition = "right";
  4882. this._overallRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4883. this._legendRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4884. this._chartRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4885. this._topRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4886. this._leftRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4887. this._bottomRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4888. this._rightRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4889. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  4890. this._legendChartAlign = true;
  4891. }
  4892. },
  4893. /** @expose */
  4894. execute : function(g) {
  4895. this.layout();
  4896. },
  4897. /**
  4898. * Calculates rectangles during preliminary layout
  4899. * @param (boolean) legendAtMax true if legend is given max size; false if legend is asked for its preferred size
  4900. * @param (boolean) axesAtZero true if axes are given a size of 0; false if axes are asked for their preferred size
  4901. */
  4902. /** @expose */
  4903. preLayout : function(legendAtMax, axesAtZero) {
  4904. this._preLegendAtMax = legendAtMax;
  4905. this._preAxesAtZero = axesAtZero;
  4906. this.layout();
  4907. this._preLegendAtMax = false;
  4908. this._preAxesAtZero = false;
  4909. },
  4910. /**
  4911. * Calls preExecute, then does the layout with the property values, updating the chart, legend, axis, and elements rectangles.
  4912. */
  4913. /** @expose */
  4914. layout : function() {
  4915. this.preExecute();
  4916. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._chartRect, this._overallRect);
  4917. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._legendRect, this._overallRect);
  4918. var x = this._overallRect.x;
  4919. var y = this._overallRect.y;
  4920. var w = this._overallRect.width;
  4921. var h = this._overallRect.height;
  4922. var maxWH = Math.max(w, h);
  4923. var tbLegend = "top" == this._legendPosition || "bottom" == this._legendPosition;
  4924. var legendPercent = this._axisSizables.length == 0 ? 0.5 : 0.3;
  4925. var legendMaxSize = (tbLegend ? this._legendRect.height : this._legendRect.width) * legendPercent;
  4926. var legendDynamicSize = this._legendSizable ? (this._preLegendAtMax ? maxWH : this._legendSizable.getPreferredSize()) : 0;
  4927. if (legendDynamicSize > legendMaxSize) {
  4928. legendDynamicSize = legendMaxSize;
  4929. }
  4930. var isLegendTop = false;
  4931. var isLegendBottom = false;
  4932. var isLegendLeft = false;
  4933. var isLegendRight = false;
  4934. if ("top" == this._legendPosition) {
  4935. this._legendRect.height = legendDynamicSize;
  4936. this._chartRect.height -= this._legendRect.height;
  4937. this._chartRect.y += this._legendRect.height;
  4938. isLegendTop = true;
  4939. } else if ("bottom" == this._legendPosition) {
  4940. this._legendRect.height = legendDynamicSize;
  4941. this._chartRect.height -= this._legendRect.height;
  4942. this._legendRect.y = y + h - this._legendRect.height;
  4943. isLegendBottom = true;
  4944. } else if ("left" == this._legendPosition) {
  4945. this._legendRect.width = legendDynamicSize;
  4946. this._chartRect.width -= this._legendRect.width;
  4947. this._chartRect.x += this._legendRect.width;
  4948. isLegendLeft = true;
  4949. } else {
  4950. this._legendRect.width = legendDynamicSize;
  4951. this._chartRect.width -= this._legendRect.width;
  4952. this._legendRect.x = x + w - this._legendRect.width;
  4953. isLegendRight = true;
  4954. }
  4955. if (this.evaluatePadding(this._padding, w, h)) {
  4956. var lrgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, w);
  4957. var tbgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, h);
  4958. var chartTop = isLegendTop && this._legendSizable ? tbgap : this._topPadding;
  4959. var chartLeft = isLegendLeft && this._legendSizable ? lrgap : this._leftPadding;
  4960. var chartBottom = isLegendBottom && this._legendSizable ? tbgap : this._bottomPadding;
  4961. var chartRight = isLegendRight && this._legendSizable ? lrgap : this._rightPadding;
  4962. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  4963. } else {
  4964. var lrpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, w);
  4965. var tbpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, h);
  4966. var chartTop = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);
  4967. var chartLeft = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding, w);
  4968. var chartBottom = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding, h);
  4969. var chartRight = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._rightChartPadding, w);
  4970. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  4971. this._topPadding = tbpadding;
  4972. this._leftPadding = lrpadding;
  4973. this._bottomPadding = tbpadding;
  4974. this._rightPadding = lrpadding;
  4975. }
  4976. if (this._legendSizable) {
  4977. if (isLegendRight) {
  4978. this._legendRect.x -= this._rightPadding;
  4979. this._chartRect.width -= this._rightPadding;
  4980. this._legendRect.y += this._topPadding;
  4981. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  4982. } else if (isLegendLeft) {
  4983. this._legendRect.x += this._leftPadding;
  4984. this._chartRect.x += this._leftPadding;
  4985. this._chartRect.width -= this._leftPadding;
  4986. this._legendRect.y += this._topPadding;
  4987. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  4988. } else if (isLegendTop) {
  4989. this._legendRect.y += this._topPadding;
  4990. this._chartRect.y += this._topPadding;
  4991. this._chartRect.height -= this._topPadding;
  4992. this._legendRect.x += this._leftPadding;
  4993. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  4994. } else {
  4995. this._legendRect.y -= this._bottomPadding;
  4996. this._chartRect.height -= this._bottomPadding;
  4997. this._legendRect.x += this._leftPadding;
  4998. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  4999. }
  5000. }
  5001. x = this._chartRect.x;
  5002. y = this._chartRect.y;
  5003. w = this._chartRect.width;
  5004. h = this._chartRect.height;
  5005. var bottomH = 0;
  5006. var topH = 0;
  5007. var leftW = 0;
  5008. var rightW = 0;
  5009. var tbSO = 0;
  5010. var lrSO = 0;
  5011. if (!this._preAxesAtZero) {
  5012. var countHorz = 0;
  5013. var countVert = 0;
  5014. for (var i = 0; i < this._axisSizables.length; ++i) {
  5015. var sizable = this._axisSizables[i];
  5016. if (sizable) {
  5017. var orientation = sizable.getSizableOrientation();
  5018. if ("top" == orientation || "bottom" == orientation) {
  5019. countHorz++;
  5020. } else {
  5021. countVert++;
  5022. }
  5023. }
  5024. }
  5025. for (var i = 0; i < this._axisSizables.length; ++i) {
  5026. var sizable = this._axisSizables[i];
  5027. if (sizable) {
  5028. var orientation = sizable.getSizableOrientation();
  5029. var tbAxis = "top" == orientation || "bottom" == orientation;
  5030. var axisDynamicSize = sizable.getPreferredSize();
  5031. var spillOver = sizable.getSpillOverSize();
  5032. if (tbAxis) {
  5033. var axisPercent = countHorz > 1 ? 0.4 : 0.5;
  5034. if (axisDynamicSize > this._chartRect.height * axisPercent) {
  5035. axisDynamicSize = this._chartRect.height * axisPercent;
  5036. }
  5037. if ("top" == orientation) {
  5038. topH = axisDynamicSize;
  5039. } else {
  5040. bottomH = axisDynamicSize;
  5041. }
  5042. if (spillOver > lrSO) {
  5043. lrSO = spillOver;
  5044. }
  5045. } else {
  5046. var axisPercent = countVert > 1 ? 0.4 : 0.5;
  5047. if (axisDynamicSize > this._chartRect.width * axisPercent) {
  5048. axisDynamicSize = this._chartRect.width * axisPercent;
  5049. }
  5050. if ("left" == orientation) {
  5051. leftW = axisDynamicSize;
  5052. } else {
  5053. rightW = axisDynamicSize;
  5054. }
  5055. if (spillOver > tbSO) {
  5056. tbSO = spillOver;
  5057. }
  5058. }
  5059. }
  5060. }
  5061. }
  5062. if (lrSO > leftW) {
  5063. leftW = lrSO;
  5064. }
  5065. if (lrSO > rightW) {
  5066. rightW = lrSO;
  5067. }
  5068. if (tbSO > topH) {
  5069. topH = tbSO;
  5070. }
  5071. if (tbSO > bottomH) {
  5072. bottomH = tbSO;
  5073. }
  5074. this._leftRect.x = x;
  5075. this._leftRect.width = leftW;
  5076. this._leftRect.y = y;
  5077. this._leftRect.height = h;
  5078. this._rightRect.x = x + w - rightW;
  5079. this._rightRect.width = rightW;
  5080. this._rightRect.y = y;
  5081. this._rightRect.height = h;
  5082. this._topRect.y = y;
  5083. this._topRect.height = topH;
  5084. this._topRect.x = x;
  5085. this._topRect.width = w;
  5086. this._bottomRect.y = y + h - bottomH;
  5087. this._bottomRect.height = bottomH;
  5088. this._bottomRect.x = x;
  5089. this._bottomRect.width = w;
  5090. this._elementRect.x = x + leftW;
  5091. this._elementRect.y = y + topH;
  5092. this._elementRect.width = w - (leftW + rightW);
  5093. this._elementRect.height = h - (topH + bottomH);
  5094. if (this._legendSizable && this._legendChartAlign) {
  5095. if (tbLegend) {
  5096. this._legendRect.x = this._elementRect.x;
  5097. this._legendRect.width = this._elementRect.width;
  5098. } else {
  5099. this._legendRect.y = this._elementRect.y;
  5100. this._legendRect.height = this._elementRect.height;
  5101. }
  5102. }
  5103. },
  5104. evaluatePadding : function(padding, horizontalExtent, verticalExtent) {
  5105. if (padding == null) {
  5106. return false;
  5107. }
  5108. var paddingString = (padding) + "";
  5109. if (paddingString.length == 0) {
  5110. return false;
  5111. }
  5112. this._topPadding = 0;
  5113. this._leftPadding = 0;
  5114. this._bottomPadding = 0;
  5115. this._rightPadding = 0;
  5116. var items = paddingString.split(new RegExp(";"));
  5117. for (var __i_enFor0 = 0, __len_enFor0 = items.length;
  5118. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  5119. var item = items[__i_enFor0];
  5120. var parts = item.split(new RegExp(":"));
  5121. if (items.length == 1 && parts.length != 2) {
  5122. return false;
  5123. }
  5124. if (parts.length == 2) {
  5125. if (0 <= parts[0].indexOf("top")) {
  5126. this._topPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  5127. } else if (0 <= parts[0].indexOf("left")) {
  5128. this._leftPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  5129. } else if (0 <= parts[0].indexOf("bottom")) {
  5130. this._bottomPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  5131. } else if (0 <= parts[0].indexOf("right")) {
  5132. this._rightPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  5133. }
  5134. }
  5135. }
  5136. return true;
  5137. },
  5138. /**
  5139. * @return (rave['internal']['RectStruct']) Legend rectangle
  5140. */
  5141. /** @expose */
  5142. legendRect : function() {
  5143. return this._legendRect;
  5144. },
  5145. /**
  5146. * @return (rave['internal']['RectStruct']) Chart (elements plus axes) rectangle
  5147. */
  5148. /** @expose */
  5149. chartRect : function() {
  5150. return this._chartRect;
  5151. },
  5152. /**
  5153. * @return (rave['internal']['RectStruct']) Top axis rectangle
  5154. */
  5155. /** @expose */
  5156. topRect : function() {
  5157. return this._topRect;
  5158. },
  5159. /**
  5160. * @return (rave['internal']['RectStruct']) Left axis rectangle
  5161. */
  5162. /** @expose */
  5163. leftRect : function() {
  5164. return this._leftRect;
  5165. },
  5166. /**
  5167. * @return (rave['internal']['RectStruct']) Bottom axis rectangle
  5168. */
  5169. /** @expose */
  5170. bottomRect : function() {
  5171. return this._bottomRect;
  5172. },
  5173. /**
  5174. * @return (rave['internal']['RectStruct']) Right axis rectangle
  5175. */
  5176. /** @expose */
  5177. rightRect : function() {
  5178. return this._rightRect;
  5179. },
  5180. /**
  5181. * @return (rave['internal']['RectStruct']) Legend rectangle
  5182. */
  5183. /** @expose */
  5184. elementRect : function() {
  5185. return this._elementRect;
  5186. },
  5187. /**
  5188. * Set the overall rectangle. This should be called before doing the layout.
  5189. * @param (rave['internal']['RectStruct']) overall The overall rectangle
  5190. */
  5191. /** @expose */
  5192. overall : function(overall) {
  5193. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._overallRect, overall);
  5194. return this;
  5195. },
  5196. padding$0 : function() {
  5197. return this._padding;
  5198. },
  5199. legendChartAlign$0 : function() {
  5200. return this._legendChartAlign;
  5201. },
  5202. legendChartGap$0 : function() {
  5203. return this._legendChartGap;
  5204. },
  5205. topPadding$0 : function() {
  5206. return this._topChartPadding;
  5207. },
  5208. leftPadding$0 : function() {
  5209. return this._leftChartPadding;
  5210. },
  5211. bottomPadding$0 : function() {
  5212. return this._bottomChartPadding;
  5213. },
  5214. rightPadding$0 : function() {
  5215. return this._rightChartPadding;
  5216. },
  5217. legendPosition$0 : function() {
  5218. return this._legendPosition;
  5219. },
  5220. topPadding$1 : function(padding) {
  5221. this._topChartPadding = padding;
  5222. return this;
  5223. },
  5224. leftPadding$1 : function(padding) {
  5225. this._leftChartPadding = padding;
  5226. return this;
  5227. },
  5228. bottomPadding$1 : function(padding) {
  5229. this._bottomChartPadding = padding;
  5230. return this;
  5231. },
  5232. rightPadding$1 : function(padding) {
  5233. this._rightChartPadding = padding;
  5234. return this;
  5235. },
  5236. /** @expose */
  5237. type : function() {
  5238. return com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE;
  5239. },
  5240. padding$1 : function(value) {
  5241. this._padding = value;
  5242. return this;
  5243. },
  5244. /** @expose */
  5245. chartPadding : function(top, left, bottom, right) {
  5246. this._topChartPadding = top;
  5247. this._leftChartPadding = left;
  5248. this._bottomChartPadding = bottom;
  5249. this._rightChartPadding = right;
  5250. return this;
  5251. },
  5252. legendChartAlign$1 : function(legendChartAlign) {
  5253. this._legendChartAlign = legendChartAlign;
  5254. return this;
  5255. },
  5256. legendChartGap$1 : function(value) {
  5257. this._legendChartGap = value;
  5258. return this;
  5259. },
  5260. legendPosition$1 : function(position) {
  5261. if ("top" == position || "bottom" == position || "left" == position || "right" == position) {
  5262. this._legendPosition = position;
  5263. }
  5264. return this;
  5265. },
  5266. /** @expose */
  5267. legendSize : function(sizable) {
  5268. this._legendSizable = sizable;
  5269. return this;
  5270. },
  5271. /** @expose */
  5272. removeAxisSizables : function() {
  5273. this._axisSizables.length = 0;
  5274. return this;
  5275. },
  5276. /** @expose */
  5277. addAxisSizable : function(sizable) {
  5278. this._axisSizables.push(sizable);
  5279. return this;
  5280. },
  5281. /** @expose */
  5282. padding : function(a0) {
  5283. var args = arguments;
  5284. if (args.length == 0) {
  5285. return this.padding$0();
  5286. }
  5287. return this.padding$1(a0);
  5288. },
  5289. /** @expose */
  5290. legendChartAlign : function(a0) {
  5291. var args = arguments;
  5292. if (args.length == 0) {
  5293. return this.legendChartAlign$0();
  5294. }
  5295. return this.legendChartAlign$1(a0);
  5296. },
  5297. /** @expose */
  5298. legendChartGap : function(a0) {
  5299. var args = arguments;
  5300. if (args.length == 0) {
  5301. return this.legendChartGap$0();
  5302. }
  5303. return this.legendChartGap$1(a0);
  5304. },
  5305. /** @expose */
  5306. topPadding : function(a0) {
  5307. var args = arguments;
  5308. if (args.length == 0) {
  5309. return this.topPadding$0();
  5310. }
  5311. return this.topPadding$1(a0);
  5312. },
  5313. /** @expose */
  5314. leftPadding : function(a0) {
  5315. var args = arguments;
  5316. if (args.length == 0) {
  5317. return this.leftPadding$0();
  5318. }
  5319. return this.leftPadding$1(a0);
  5320. },
  5321. /** @expose */
  5322. bottomPadding : function(a0) {
  5323. var args = arguments;
  5324. if (args.length == 0) {
  5325. return this.bottomPadding$0();
  5326. }
  5327. return this.bottomPadding$1(a0);
  5328. },
  5329. /** @expose */
  5330. rightPadding : function(a0) {
  5331. var args = arguments;
  5332. if (args.length == 0) {
  5333. return this.rightPadding$0();
  5334. }
  5335. return this.rightPadding$1(a0);
  5336. },
  5337. /** @expose */
  5338. legendPosition : function(a0) {
  5339. var args = arguments;
  5340. if (args.length == 0) {
  5341. return this.legendPosition$0();
  5342. }
  5343. return this.legendPosition$1(a0);
  5344. }
  5345. });
  5346. /**
  5347. * Set preferred rectangle to the same position and size as the source rectangle.
  5348. * @param (rave['internal']['RectStruct']) t preferred rectangle
  5349. * @param (rave['internal']['RectStruct']) s Source rectangle
  5350. * @return (rave['internal']['RectStruct']) preferred rectangle
  5351. */
  5352. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect = function(t, s) {
  5353. t.x = s.x;
  5354. t.y = s.y;
  5355. t.width = s.width;
  5356. t.height = s.height;
  5357. return t;
  5358. };
  5359. /**
  5360. * 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.
  5361. * @param (rave['internal']['RectStruct']) r Rectangle
  5362. * @param (double) top Top inset in pixels
  5363. * @param (double) left Left inset in pixels
  5364. * @param (double) bottom Bottom inset in pixels
  5365. * @param (double) right Right inset in pixels
  5366. * @return (rave['internal']['RectStruct']) The rectangle
  5367. */
  5368. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset = function(r, top, left, bottom, right) {
  5369. var ileft = Math.max(0.0, left);
  5370. var iright = Math.max(0.0, right);
  5371. if (ileft + iright <= r.width) {
  5372. r.x += ileft;
  5373. r.width -= ileft + iright;
  5374. }
  5375. var itop = Math.max(0.0, top);
  5376. var ibottom = Math.max(0.0, bottom);
  5377. if (itop + ibottom <= r.height) {
  5378. r.y += itop;
  5379. r.height -= itop + ibottom;
  5380. }
  5381. return r;
  5382. };
  5383. /**
  5384. * 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.
  5385. * @param (Object) value The size
  5386. * @param (double) extent The extent in the dimension
  5387. * @param defValue The default to use if not parsable
  5388. * @return (double) Size in pixels
  5389. */
  5390. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize = function(value, extent) {
  5391. var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10.0);
  5392. var d = v != null ? v : 0;
  5393. return Math.max(0.0, Math.min(d, extent));
  5394. };
  5395. /** @expose */
  5396. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT = 0.4;
  5397. /** @expose */
  5398. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT_SINGLE_PER_ORIENTATION = 0.5;
  5399. /** @expose */
  5400. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT = 0.3;
  5401. /** @expose */
  5402. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT_NO_AXIS = 0.5;
  5403. // $source: com/ibm/rave/bundles/components/ClipPathComponentImpl
  5404. /************************************************************************
  5405. ** IBM Confidential
  5406. **
  5407. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5408. **
  5409. ** (C) Copyright IBM Corp. 2017
  5410. **
  5411. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5412. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5413. ************************************************************************/
  5414. // GENERATED
  5415. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5416. /**
  5417. * 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>
  5418. */
  5419. var com_ibm_rave_bundles_components_ClipPathComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5420. //_id : null,
  5421. //_clipRect : null,
  5422. constructor : function(id) {
  5423. this._clipRect = new rave['internal']['RectStruct'](0, 0, 100, 100);
  5424. /**
  5425. * 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.
  5426. * @param (String) id String ID that is unique <em>across the document</em>.
  5427. */
  5428. {
  5429. this._id = id;
  5430. }
  5431. },
  5432. /** @expose */
  5433. type : function() {
  5434. return "ClipPathComponent";
  5435. },
  5436. /**
  5437. * Set the rectangular clipping area. Make the _clipRect one pixel larger than requested to avoid the cut-off at bounds. TODO: why?!?
  5438. * @param (rave['internal']['RectStruct']) rect The rectangular bounds of the clipping area.
  5439. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  5440. */
  5441. /** @expose */
  5442. clipRect : function(rect) {
  5443. this._clipRect = new rave['internal']['RectStruct'](rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2);
  5444. return this;
  5445. },
  5446. /**
  5447. * Set the clip-path attribute on the provided selection.
  5448. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  5449. */
  5450. /** @expose */
  5451. applyTo : function(s) {
  5452. s.attr("clip-path", "url(" + this.url() + ")");
  5453. return this;
  5454. },
  5455. /**
  5456. * Retrieve the id assigned to this clip path.
  5457. */
  5458. /** @expose */
  5459. id : function() {
  5460. return this._id;
  5461. },
  5462. /**
  5463. * Retrieve the URL that can be used to reference this clip path.
  5464. */
  5465. /** @expose */
  5466. url : function() {
  5467. return "#" + this._id;
  5468. },
  5469. /** @expose */
  5470. execute : function(g) {
  5471. var clipPath = g.selectAll("#" + this._id).data([0]);
  5472. clipPath.enter().append("clipPath").attr("id", this._id).append("rect");
  5473. 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);
  5474. }
  5475. });
  5476. // $source: com/ibm/rave/bundles/components/LegendComponentImpl
  5477. /************************************************************************
  5478. ** IBM Confidential
  5479. **
  5480. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5481. **
  5482. ** (C) Copyright IBM Corp. 2017
  5483. **
  5484. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5485. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5486. ************************************************************************/
  5487. // GENERATED
  5488. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5489. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  5490. /**
  5491. * <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>
  5492. */
  5493. var com_ibm_rave_bundles_components_LegendComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5494. /**
  5495. * Legend size property
  5496. */
  5497. //_size : null,
  5498. /**
  5499. * Color scale
  5500. */
  5501. //_colorPalette : null,
  5502. /**
  5503. * Orient, "horizontal" or "vertical"
  5504. */
  5505. //_orient : null,
  5506. /**
  5507. * Swatch size function
  5508. */
  5509. //_swatchSizeFunc : null,
  5510. /**
  5511. * Scale
  5512. */
  5513. //_scale : null,
  5514. /**
  5515. * Swatch symbol
  5516. */
  5517. //_shape : null,
  5518. /**
  5519. * Legend title
  5520. */
  5521. //_title : null,
  5522. /**
  5523. * Legend title styling
  5524. */
  5525. //_titleStyle : null,
  5526. /**
  5527. * Legend entry styling
  5528. */
  5529. //_entryStyle : null,
  5530. /**
  5531. * Custom formatter
  5532. */
  5533. //_labelFormat : null,
  5534. /**
  5535. * The swatch legend, created on demand
  5536. */
  5537. //_swatchLegend : null,
  5538. /**
  5539. * The continuous legend, created on demand
  5540. */
  5541. //_continuousLegend : null,
  5542. /**
  5543. * The legend type, either "SwatchLegend" or "ContinuousLegend"
  5544. */
  5545. //_legendType : null,
  5546. /**
  5547. * Is the legend visible
  5548. */
  5549. _visible : false,
  5550. /**
  5551. * Swatch size in square pixels
  5552. */
  5553. _swatchSize : 0,
  5554. /**
  5555. * Constructor; sets bound and, colorScale to null, all other properties to their default values.
  5556. */
  5557. /** @expose */
  5558. constructor : function() {
  5559. this._visible = true;
  5560. this._size = null;
  5561. this._colorPalette = null;
  5562. this._orient = "horizontal";
  5563. this._swatchSize = 16.0 * 16.0;
  5564. this._swatchSizeFunc = null;
  5565. this._scale = null;
  5566. this._shape = "square";
  5567. this._title = null;
  5568. this._titleStyle = {};
  5569. this._entryStyle = {};
  5570. this._labelFormat = null;
  5571. this._swatchLegend = null;
  5572. this._continuousLegend = null;
  5573. this._legendType = null;
  5574. },
  5575. /** @expose */
  5576. type : function() {
  5577. return "LegendComponent";
  5578. },
  5579. /** @expose */
  5580. execute : function(g) {
  5581. if (this._colorPalette) {
  5582. if ("continuous" == this._colorPalette.getType()) {
  5583. if (!this._continuousLegend) {
  5584. this._continuousLegend = (rave.capabilities.extension("legend")).continuous();
  5585. }
  5586. this._legendType = "ContinuousLegend";
  5587. } else {
  5588. if (!this._swatchLegend) {
  5589. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  5590. }
  5591. this._legendType = "SwatchLegend";
  5592. }
  5593. } else if (this._swatchSizeFunc) {
  5594. if (!this._swatchLegend) {
  5595. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  5596. }
  5597. this._legendType = "SwatchLegend";
  5598. } else {
  5599. this._legendType = null;
  5600. }
  5601. this.preExecute();
  5602. if (!this._visible || (!this._colorPalette && !this._swatchSizeFunc) || !this._size || this._size[0] <= 0 || this._size[1] <= 0) {
  5603. g.selectAll("*").remove();
  5604. return;
  5605. }
  5606. var fontChecker = rave.capabilities.extension("fontchecker");
  5607. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  5608. 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);
  5609. var legend = g.call(this._continuousLegend);
  5610. if (this._entryStyle) {
  5611. legend.selectAll(".legendLabel").style(this._entryStyle);
  5612. }
  5613. if (this._titleStyle) {
  5614. legend.selectAll(".legendTitle").style(this._titleStyle);
  5615. }
  5616. if (fontChecker) {
  5617. legend.selectAll(".legendLabel").call(fontChecker);
  5618. legend.selectAll(".legendTitle").call(fontChecker);
  5619. }
  5620. } else {
  5621. var insets = {};
  5622. insets["bottom"] = 5;
  5623. var swatchSize = this._swatchSize;
  5624. var scale = null;
  5625. var labelFormatter = this._labelFormat;
  5626. if (this._swatchSizeFunc && this._scale) {
  5627. swatchSize = this._swatchSizeFunc;
  5628. scale = this._scale;
  5629. }
  5630. if (this._colorPalette) {
  5631. scale = this._colorPalette.getScale();
  5632. var originalDomain = this._colorPalette.originalDomain();
  5633. if (originalDomain) {
  5634. scale.domain(originalDomain);
  5635. var f = this._colorPalette.originalDomainLabelAccessor();
  5636. if (this._labelFormat) {
  5637. var self = this;
  5638. labelFormatter = function(data, index, groupIndex) {
  5639. return self._labelFormat.call(this, f.call(this, data, index, groupIndex), index, groupIndex);
  5640. };
  5641. } else {
  5642. labelFormatter = f;
  5643. }
  5644. }
  5645. }
  5646. 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);
  5647. var legend = g.call(this._swatchLegend);
  5648. if (this._entryStyle) {
  5649. legend.selectAll(".legendLabel").style(this._entryStyle);
  5650. }
  5651. if (this._titleStyle) {
  5652. legend.selectAll(".legendTitle").style(this._titleStyle);
  5653. }
  5654. if (fontChecker) {
  5655. legend.selectAll(".legendLabel").call(fontChecker);
  5656. legend.selectAll(".legendTitle").call(fontChecker);
  5657. }
  5658. }
  5659. },
  5660. /** @expose */
  5661. legend : function() {
  5662. if ("ContinuousLegend" == this._legendType) {
  5663. return this._continuousLegend;
  5664. }
  5665. if ("SwatchLegend" == this._legendType) {
  5666. return this._swatchLegend;
  5667. }
  5668. return null;
  5669. },
  5670. /** @expose */
  5671. legendType : function() {
  5672. return this._legendType;
  5673. },
  5674. /**
  5675. * Set the visible property.
  5676. * @param (boolean) visible New visible
  5677. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5678. */
  5679. /** @expose */
  5680. visible : function(visible) {
  5681. this._visible = visible;
  5682. return this;
  5683. },
  5684. /**
  5685. * see if the legend is visible
  5686. * @return (boolean) if its visible
  5687. */
  5688. /** @expose */
  5689. isVisible : function() {
  5690. return this._visible;
  5691. },
  5692. /**
  5693. * Set the size property.
  5694. * @param (Array) size New size
  5695. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5696. */
  5697. /** @expose */
  5698. size : function(size) {
  5699. this._size = size;
  5700. return this;
  5701. },
  5702. /**
  5703. * Set the color scale property.
  5704. * @param (rave['library']['internal']['Palette']) colorPalette New color scale
  5705. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5706. */
  5707. /** @expose */
  5708. colorPalette : function(colorPalette) {
  5709. this._colorPalette = colorPalette;
  5710. return this;
  5711. },
  5712. /**
  5713. * Set the orient property. If the argument is not "horizontal" or "vertical", it is ignored and the orient property is not changed.
  5714. * @param (String) orient New orient
  5715. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5716. */
  5717. /** @expose */
  5718. orient : function(orient) {
  5719. if ("horizontal" == orient || "vertical" == orient) {
  5720. this._orient = orient;
  5721. }
  5722. return this;
  5723. },
  5724. /**
  5725. * 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".
  5726. * @param (String) position Legend position
  5727. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  5728. */
  5729. /** @expose */
  5730. position : function(position) {
  5731. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  5732. },
  5733. swatchSize$0 : function(swatchSize) {
  5734. if (swatchSize >= 0.0 && swatchSize != null) {
  5735. this._swatchSize = swatchSize;
  5736. }
  5737. return this;
  5738. },
  5739. /** @expose */
  5740. scale : function(scale) {
  5741. this._scale = scale;
  5742. return this;
  5743. },
  5744. swatchSize$1 : function(swatchSize) {
  5745. if (swatchSize) {
  5746. this._swatchSizeFunc = swatchSize;
  5747. }
  5748. return this;
  5749. },
  5750. /** @expose */
  5751. shape : function(shape) {
  5752. this._shape = shape;
  5753. return this;
  5754. },
  5755. /** @expose */
  5756. title : function(title) {
  5757. this._title = (title != null && title.length > 0) ? title : null;
  5758. return this;
  5759. },
  5760. /** @expose */
  5761. titleFill : function(titleFill) {
  5762. this._titleStyle["fill"] = titleFill;
  5763. return this;
  5764. },
  5765. /** @expose */
  5766. titleFontSize : function(titleFontSize) {
  5767. this._titleStyle["font-size"] = titleFontSize;
  5768. return this;
  5769. },
  5770. /** @expose */
  5771. titleFontFamily : function(titleFontFamily) {
  5772. this._titleStyle["font-family"] = titleFontFamily;
  5773. return this;
  5774. },
  5775. /** @expose */
  5776. labelFormat : function(labelFormat) {
  5777. this._labelFormat = labelFormat;
  5778. return this;
  5779. },
  5780. /** @expose */
  5781. titleFont : function(titleFontStyle) {
  5782. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(titleFontStyle);
  5783. return this;
  5784. },
  5785. /** @expose */
  5786. entryFont : function(entryFontStyle) {
  5787. this._entryStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(entryFontStyle);
  5788. return this;
  5789. },
  5790. /** @expose */
  5791. getSpaceUsed : function() {
  5792. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  5793. return this._continuousLegend.getUsedSize() + 2;
  5794. } else {
  5795. return this._swatchLegend.getUsedSize() + 2;
  5796. }
  5797. },
  5798. /** @expose */
  5799. swatchSize : function(a0) {
  5800. var args = arguments;
  5801. if (args.length == 1 && typeof a0 === "function") {
  5802. return this.swatchSize$1(a0);
  5803. }
  5804. return this.swatchSize$0(a0);
  5805. }
  5806. });
  5807. /**
  5808. * Get the orient for a position. "top" and "bottom" return "horizontal", anything else ("left", "right", or unknown/null) is "vertical".
  5809. * @param (String) position A position
  5810. * @return (String) "horizontal" or "vertical"
  5811. */
  5812. /** @expose */
  5813. com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf = function(position) {
  5814. if ("top" == position || "bottom" == position) {
  5815. return "horizontal";
  5816. }
  5817. return "vertical";
  5818. };
  5819. //com_ibm_rave_bundles_components_LegendComponentImpl.HORIZONTAL = "horizontal";
  5820. //com_ibm_rave_bundles_components_LegendComponentImpl.VERTICAL = "vertical";
  5821. com_ibm_rave_bundles_components_LegendComponentImpl.BAR_THINKNESS = 16;
  5822. com_ibm_rave_bundles_components_LegendComponentImpl.SWATCH_SIZE = 16;
  5823. /** @expose */
  5824. com_ibm_rave_bundles_components_LegendComponentImpl.TOP = "top";
  5825. /** @expose */
  5826. com_ibm_rave_bundles_components_LegendComponentImpl.BOTTOM = "bottom";
  5827. /** @expose */
  5828. com_ibm_rave_bundles_components_LegendComponentImpl.LEFT = "left";
  5829. /** @expose */
  5830. com_ibm_rave_bundles_components_LegendComponentImpl.RIGHT = "right";
  5831. /** @expose */
  5832. com_ibm_rave_bundles_components_LegendComponentImpl.ADJUSTABLE = -1;
  5833. // $source: com/ibm/rave/bundles/components/AxisComponentImpl
  5834. /************************************************************************
  5835. ** IBM Confidential
  5836. **
  5837. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5838. **
  5839. ** (C) Copyright IBM Corp. 2018
  5840. **
  5841. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5842. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5843. ************************************************************************/
  5844. // GENERATED
  5845. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  5846. //@import com/ibm/rave/bundles/component/AxisComponent (runtime) // AxisComponent
  5847. //@import com/ibm/rave/bundles/utilities/TextCrossfader (runtime) // textCrossFade
  5848. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  5849. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  5850. /**
  5851. * <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>
  5852. */
  5853. var com_ibm_rave_bundles_components_AxisComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  5854. /**
  5855. * Axis - created on demand
  5856. */
  5857. //_axis : null,
  5858. /**
  5859. * Role, from the AxisComponent API
  5860. */
  5861. //_role : null,
  5862. /**
  5863. * CoordinateScale
  5864. */
  5865. //_scale : null,
  5866. /**
  5867. * Orient, always one of the four legal values
  5868. */
  5869. //_orient : null,
  5870. /**
  5871. * Size
  5872. */
  5873. //_bounds : null,
  5874. //_elementRect : null,
  5875. /**
  5876. * The title text; default null (nothing visible)
  5877. */
  5878. /** @expose */
  5879. _axisTitle : null,
  5880. /**
  5881. * The title style; defaults null (use the CSS styling)
  5882. */
  5883. /** @expose */
  5884. _titleStyle : null,
  5885. /**
  5886. * Axis line color; default null (use the CSS styling)
  5887. */
  5888. /** @expose */
  5889. _lineColor : null,
  5890. /**
  5891. * Axis tick color; default null (use the CSS styling)
  5892. */
  5893. /** @expose */
  5894. _tickColor : null,
  5895. /**
  5896. * Axis tick label style; defaults null (use the CSS styling)
  5897. */
  5898. /** @expose */
  5899. _labelStyle : null,
  5900. //_staggerRotate45Nodes : null,
  5901. //_staggerFirstNode : null,
  5902. //_staggerLastNode : null,
  5903. /**
  5904. * Axis tick label formatting
  5905. */
  5906. //_tickFormat : null,
  5907. //_dropOverlap : null,
  5908. /**
  5909. * Used to get the extension to enable axis label wrapping
  5910. */
  5911. //_textFlow : null,
  5912. /**
  5913. * Used to check the fonts on each label to make sure all characters are covered
  5914. */
  5915. //_fontChecker : null,
  5916. /**
  5917. * Run function that applies the properties to the axis line
  5918. */
  5919. //_axisLineProperties : null,
  5920. /**
  5921. * Run function that applies the properties to the axis ticks
  5922. */
  5923. //_axisTickProperties : null,
  5924. /**
  5925. * Run function that applies the properties to the axis tick labels
  5926. */
  5927. //_axisTickLabelProperties : null,
  5928. /**
  5929. * Run function that hides or displays the axis tick labels
  5930. */
  5931. //_displayHideLabels : null,
  5932. /**
  5933. * Run function that hides or displays the axis tick labels
  5934. */
  5935. //_panZoomLabels : null,
  5936. /**
  5937. * The tick handler registered with the axis; will get called during axis transition
  5938. */
  5939. //_tickHandler : null,
  5940. //_textTruncationIndicator : null,
  5941. /**
  5942. * Used when dealing with numeric scale on the vertical axis and the numbers don't fit
  5943. */
  5944. //_simplifiedTickFormat : null,
  5945. //_tickMagnitude : null,
  5946. /**
  5947. * Whether to display the axis title; default true
  5948. */
  5949. /** @expose */
  5950. _displayAxisTitle : false,
  5951. /**
  5952. * Whether to display the axis line; default true
  5953. */
  5954. /** @expose */
  5955. _displayAxisLine : false,
  5956. /**
  5957. * Whether to display the axis ticks; default true
  5958. */
  5959. /** @expose */
  5960. _displayTicks : false,
  5961. /**
  5962. * Whether to display the axis tick labels (conditional on show labels property); default true
  5963. */
  5964. /** @expose */
  5965. _displayTickLabels : false,
  5966. /**
  5967. * Whether to display the axis tick labels (conditional on pan-zoom hide property); default true
  5968. */
  5969. /** @expose */
  5970. _showPanZoomTickLabels : false,
  5971. /**
  5972. * Whether to rotate the axis tick labels; default false
  5973. */
  5974. _rotateLabels : false,
  5975. _staggerCellWidth : 0,
  5976. _staggerAlignFirstAtStart : false,
  5977. _staggerAlignLastAtEnd : false,
  5978. _layoutTimerId : 0,
  5979. _layoutTitleSize : 0,
  5980. _layoutLabelSize : 0,
  5981. _layoutLabelHeight : 0,
  5982. _layoutAverageDigitWidth : 0,
  5983. _layoutSpillOver : 0,
  5984. /**
  5985. * Whether to hide overlapping labels; default true
  5986. */
  5987. /** @expose */
  5988. _hideOverlappingLabels : false,
  5989. /**
  5990. * When true, don't start a new timer
  5991. */
  5992. _pendingLabelTimer : false,
  5993. /**
  5994. * The padding in px between tick axis line and tick label, and also between tick label and title. Default 16px.
  5995. */
  5996. _padding : 0,
  5997. /**
  5998. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  5999. */
  6000. _renderedShapes : false,
  6001. _layoutMode : -1,
  6002. _allowAutoAxisLayoutToChangeOrientaiton : true,
  6003. _lastAutomaticAxisLayoutOrientation : -1,
  6004. _allowStagger : false,
  6005. _allowRotate45 : false,
  6006. _allowRotate90 : false,
  6007. constructor : function() {
  6008. {
  6009. var self = this;
  6010. this._axisLineProperties = function(args) {
  6011. if (args !== null || arguments.length > 1){
  6012. args = Array.prototype.slice.call(arguments, 0);
  6013. }
  6014. {
  6015. var line = this.selectAll("path.domain");
  6016. if (self._lineColor != null) {
  6017. line.style("stroke", self._lineColor);
  6018. }
  6019. if (self._displayAxisLine) {
  6020. line.attr("visibility", null);
  6021. } else {
  6022. line.attr("visibility", "hidden");
  6023. }
  6024. return null;
  6025. }
  6026. };
  6027. this._axisTickProperties = function(args) {
  6028. if (args !== null || arguments.length > 1){
  6029. args = Array.prototype.slice.call(arguments, 0);
  6030. }
  6031. {
  6032. var tickLines = this.selectAll("line");
  6033. if (self._displayTicks) {
  6034. tickLines.attr("visibility", null);
  6035. } else {
  6036. tickLines.attr("visibility", "hidden");
  6037. }
  6038. if (self._lineColor != null) {
  6039. tickLines.style("stroke", self._tickColor);
  6040. }
  6041. return null;
  6042. }
  6043. };
  6044. this._axisTickLabelProperties = function(args) {
  6045. if (args !== null || arguments.length > 1){
  6046. args = Array.prototype.slice.call(arguments, 0);
  6047. }
  6048. {
  6049. var labels = this.selectAll("text");
  6050. labels.each(self._displayHideLabels);
  6051. labels.each(self._panZoomLabels);
  6052. labels.style(self._labelStyle);
  6053. self._axis.ticksHandler(null);
  6054. return null;
  6055. }
  6056. };
  6057. this._displayHideLabels = function(obj, group, index) {
  6058. if (self._displayTickLabels) {
  6059. if (this.rave_hasProperty("__tickLabelHidden__")) {
  6060. this.rave_removeProperty("__tickLabelHidden__");
  6061. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6062. if (count <= 1) {
  6063. this.rave_removeProperty("__hiddenCount__");
  6064. this.removeAttribute("visibility");
  6065. } else {
  6066. this.rave_setProperty("__hiddenCount__", count - 1);
  6067. }
  6068. }
  6069. } else {
  6070. if (!(this.rave_hasProperty("__tickLabelHidden__"))) {
  6071. this.setAttribute("visibility", "hidden");
  6072. this.rave_setProperty("__tickLabelHidden__", "hidden");
  6073. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6074. this.rave_setProperty("__hiddenCount__", count + 1);
  6075. }
  6076. }
  6077. };
  6078. this._panZoomLabels = function(obj, group, index) {
  6079. if (self._showPanZoomTickLabels) {
  6080. if (this.rave_hasProperty("__panZoomHidden__")) {
  6081. this.rave_removeProperty("__panZoomHidden__");
  6082. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6083. if (count <= 1) {
  6084. this.rave_removeProperty("__hiddenCount__");
  6085. this.removeAttribute("visibility");
  6086. } else {
  6087. this.rave_setProperty("__hiddenCount__", count - 1);
  6088. }
  6089. }
  6090. } else {
  6091. if (!(this.rave_hasProperty("__panZoomHidden__"))) {
  6092. this.setAttribute("visibility", "hidden");
  6093. this.rave_setProperty("__panZoomHidden__", "hidden");
  6094. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  6095. this.rave_setProperty("__hiddenCount__", count + 1);
  6096. }
  6097. }
  6098. };
  6099. }
  6100. this._tickHandler = new com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler(this._axisTickLabelProperties, this._axisTickProperties);
  6101. /**
  6102. * Initialize properties to defaults
  6103. */
  6104. {
  6105. this._axis = null;
  6106. this._role = null;
  6107. this._scale = null;
  6108. this._orient = "bottom";
  6109. this._bounds = null;
  6110. this._displayAxisTitle = true;
  6111. this._axisTitle = null;
  6112. this._titleStyle = {};
  6113. this._displayAxisLine = true;
  6114. this._lineColor = null;
  6115. this._displayTicks = true;
  6116. this._tickColor = null;
  6117. this._displayTickLabels = true;
  6118. this._labelStyle = {};
  6119. this._rotateLabels = false;
  6120. this._hideOverlappingLabels = true;
  6121. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  6122. this._tickFormat = null;
  6123. this._showPanZoomTickLabels = true;
  6124. this._pendingLabelTimer = false;
  6125. this._padding = 16;
  6126. this._textFlow = rave.capabilities.extension("textflow");
  6127. this._fontChecker = rave.capabilities.extension("fontchecker");
  6128. this._renderedShapes = false;
  6129. }
  6130. },
  6131. /** @expose */
  6132. type : function() {
  6133. return com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE;
  6134. },
  6135. /** @expose */
  6136. role : function() {
  6137. return this._role;
  6138. },
  6139. /** @expose */
  6140. execute : function(g) {
  6141. this.preExecute();
  6142. if (!this._scale) {
  6143. g.selectAll("*").remove();
  6144. this._renderedShapes = false;
  6145. return;
  6146. }
  6147. this._renderedShapes = true;
  6148. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6149. this._hideOverlappingLabels = false;
  6150. this._rotateLabels = true;
  6151. } else {
  6152. this._hideOverlappingLabels = true;
  6153. this._rotateLabels = true;
  6154. }
  6155. this.drawTitle(g);
  6156. this.drawAxis(g);
  6157. this.handleAxisText(g);
  6158. this.drawTitle(g);
  6159. },
  6160. /**
  6161. * This is one place where all the calls that affect the axis text happen in case of allowAutomaticAxisLayout the new behavior applies here
  6162. * @param (rave['internal']['Selector']) g
  6163. */
  6164. handleAxisText : function(g) {
  6165. this.stopLabelDroppingUpdate();
  6166. var duration = 0, delay = 0;
  6167. var g2 = rave.transition(g);
  6168. if (g2.isTransition()) {
  6169. var t2 = (g2);
  6170. duration = t2.duration();
  6171. delay = t2.delay();
  6172. }
  6173. var axisSelector = g.selectAll("g.axis");
  6174. var labels = axisSelector.selectAll("g.tick").filter(rave['library']['internal']['BundleUtils'].notExit).selectAll("text");
  6175. var fontChecker = rave.capabilities.extension("fontchecker");
  6176. labels.style(this._labelStyle);
  6177. if (fontChecker) {
  6178. labels.call(fontChecker);
  6179. }
  6180. var mode = this._allowAutoAxisLayoutToChangeOrientaiton ? this.determineWhichAutoMode(g) : this._lastAutomaticAxisLayoutOrientation;
  6181. this.configureStaggerData(g, mode);
  6182. this.handleLabelsRotationAndPosition(g, labels, mode);
  6183. this.hashingNumericScales(labels, this.labelExtent(g), mode);
  6184. if (duration == 0) {
  6185. this.doLabelWrapping(g, mode);
  6186. this.handleLabelsRotationAndPosition(g, labels, mode);
  6187. }
  6188. this._lastAutomaticAxisLayoutOrientation = mode;
  6189. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6190. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6191. var tick = axisSelector.append("g").classed("tick", true);
  6192. var tickText = tick.append("text");
  6193. if (labels.size() == 0) {
  6194. var singleValue = this._scale.scale().domain()[0];
  6195. var formatter = this._tickFormat;
  6196. if (!formatter) {
  6197. var tickFunc = this._scale.scale().tickFormat;
  6198. if (tickFunc) {
  6199. formatter = tickFunc.apply(tickFunc, [singleValue]);
  6200. }
  6201. }
  6202. var node = tickText[0][0];
  6203. var stringValue = formatter ? formatter.call(node, singleValue, 0, 0) : ""+(singleValue);
  6204. tickText.text(stringValue);
  6205. var dim = node.getBBox();
  6206. this._layoutLabelSize = isHorizontal ? dim.height : dim.width;
  6207. if (!isHorizontal || mode != 0) {
  6208. tickText.text(".0");
  6209. this._layoutLabelSize += node.getBBox().width;
  6210. }
  6211. }
  6212. if (!isHorizontal || mode != 0) {
  6213. tickText.text(".0");
  6214. var node = tickText[0][0];
  6215. var dim = node.getBBox();
  6216. this._layoutAverageDigitWidth = dim.width;
  6217. }
  6218. tick.remove();
  6219. }
  6220. if (this._hideOverlappingLabels && duration > 0) {
  6221. this.updateLabelDropping(labels, duration, delay);
  6222. }
  6223. if (duration > 0) {
  6224. this.doLabelWrappingAfterAnimation(g, labels, mode, duration, delay);
  6225. }
  6226. if (!this._displayTickLabels) {
  6227. this._layoutLabelSize = 0;
  6228. this._layoutAverageDigitWidth = 0;
  6229. }
  6230. },
  6231. /**
  6232. * 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
  6233. * @param (rave['internal']['Selector']) g selector
  6234. * @param (rave['internal']['Selector']) labels labels selector
  6235. * @param (int) mode one of HORIZONTAL, STAGGER, ROTATE90
  6236. */
  6237. handleLabelsRotationAndPosition : function(g, labels, mode) {
  6238. if (mode == 2 || mode == 1) {
  6239. if (this._orient == "bottom") {
  6240. this.rotateLabels(g, labels, "end", mode);
  6241. } else if (this._orient == "top") {
  6242. this.rotateLabels(g, labels, "start", mode);
  6243. } else {
  6244. this.rotateLabels(g, labels, "middle", mode);
  6245. }
  6246. } else {
  6247. if (this._orient == "bottom" || this._orient == "top") {
  6248. this.rotateLabels(g, labels, "middle", mode);
  6249. } else if (this._orient == "right") {
  6250. this.rotateLabels(g, labels, "start", mode);
  6251. } else {
  6252. this.rotateLabels(g, labels, "end", mode);
  6253. }
  6254. }
  6255. },
  6256. /**
  6257. * <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>
  6258. * @param (rave['internal']['Selector']) labels
  6259. */
  6260. hashingNumericScales : function(labels, extent, mode) {
  6261. if (!labels || !extent) {
  6262. return;
  6263. }
  6264. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6265. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6266. var tickSpace = mode == 1 ? extent[1] : extent[0];
  6267. this._textTruncationIndicator = "";
  6268. this._layoutLabelSize = 0;
  6269. for (var i = 0; i < labels.size(); ++i) {
  6270. var node = labels[i][0];
  6271. var dim = node.getBBox();
  6272. var width = dim.width;
  6273. var height = dim.height;
  6274. var size = !isHorizontal || mode == 1 ? width : height;
  6275. if (size > this._layoutLabelSize) {
  6276. this._layoutLabelSize = size;
  6277. }
  6278. if (width >= tickSpace) {
  6279. if (this._simplifiedTickFormat) {
  6280. var newText = this._simplifiedTickFormat.call(null, node.rave_getData(), 0, 0);
  6281. if (newText != null) {
  6282. node.rave_setText(newText);
  6283. }
  6284. if (node.getBBox().width >= tickSpace) {
  6285. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  6286. }
  6287. } else {
  6288. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  6289. }
  6290. }
  6291. }
  6292. }
  6293. },
  6294. /**
  6295. * @param (int) size The desired size of the string
  6296. * @param (String) ch The character to be repeated in the string
  6297. * @return (String) A string of the specified size containing repetition of the specified character
  6298. */
  6299. stringOfSize : function(size, ch) {
  6300. var returnString = "";
  6301. for (var i = 0; i < size; ++i) {
  6302. returnString += ch;
  6303. }
  6304. return returnString;
  6305. },
  6306. configureStaggerData : function(g, mode) {
  6307. if (mode == 3 || mode == 2) {
  6308. var horizontalDimensions = this.labelExtent(g);
  6309. var cellWidth = horizontalDimensions[0];
  6310. var axisSelector = g.selectAll("g.axis");
  6311. var labels = axisSelector.selectAll("text");
  6312. var domain = this._scale.scale().domain();
  6313. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  6314. this._staggerRotate45Nodes = [];
  6315. this._staggerFirstNode = null;
  6316. this._staggerLastNode = null;
  6317. for (var i = 0; i < labels.size(); ++i) {
  6318. var node = labels[0][i];
  6319. if (this.isValid(node.rave_getData())) {
  6320. var domainIndex = -1;
  6321. if (mode == 3) {
  6322. var domainLabel = !this._tickFormat ? node.rave_getText() : originalDataLabelAccessor.call(node, node.rave_getData(), 0, 0);
  6323. for (var index = 0; index < domain.length; ++index) {
  6324. if (domain[index].toString() == domainLabel) {
  6325. domainIndex = index;
  6326. break;
  6327. }
  6328. }
  6329. }
  6330. this._staggerRotate45Nodes.push(new com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex(node, domainIndex));
  6331. if (domainIndex == 0) {
  6332. this._staggerFirstNode = node;
  6333. }
  6334. if (domainIndex == domain.length - 1) {
  6335. this._staggerLastNode = node;
  6336. }
  6337. }
  6338. }
  6339. this._staggerCellWidth = cellWidth * 2;
  6340. this._staggerAlignFirstAtStart = this._staggerFirstNode ? this._staggerFirstNode.getBBox().width > cellWidth : false;
  6341. this._staggerAlignLastAtEnd = this._staggerLastNode ? this._staggerLastNode.getBBox().width > cellWidth : false;
  6342. }
  6343. },
  6344. getStaggerIndex : function(node) {
  6345. for (var index = 0; index < this._staggerRotate45Nodes.length; ++index) {
  6346. if (this._staggerRotate45Nodes[index].contains(node)) {
  6347. var domainIndex = this._staggerRotate45Nodes[index].getIndex();
  6348. return domainIndex == -1 ? 0 : domainIndex;
  6349. }
  6350. }
  6351. return -1;
  6352. },
  6353. getStaggerCount : function() {
  6354. var domain = this._scale.scale().domain();
  6355. return domain.length;
  6356. },
  6357. /**
  6358. * <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>
  6359. * @param (rave['internal']['Selector']) g
  6360. */
  6361. determineWhichAutoMode : function(g) {
  6362. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6363. var axisSelector = g.selectAll("g.axis");
  6364. var labels = axisSelector.selectAll("text");
  6365. var dim = this.labelExtent(g);
  6366. var cellWidth = dim[0];
  6367. var cellWidth90 = dim[1];
  6368. var layoutLabelHeight = 0;
  6369. var layoutLabelWidth = 0;
  6370. var horizontalScore = 0;
  6371. var staggerScore = 0;
  6372. var rotate45Score = 0;
  6373. var rotate90Score = 0;
  6374. var validNodes = [];
  6375. for (var i = 0; i < labels.size(); ++i) {
  6376. var node = labels[0][i];
  6377. if (this.isValid(node.rave_getData())) {
  6378. validNodes.push(node);
  6379. }
  6380. }
  6381. var labelCount = validNodes.length;
  6382. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  6383. var mode = 0;
  6384. if (isHorizontal) {
  6385. mode = this._layoutMode == 1 ? 1 : 0;
  6386. var tick = axisSelector.append("g").classed("tick", true);
  6387. var tickText = tick.append("text");
  6388. tickText.style(this._labelStyle);
  6389. tickText.text(",0");
  6390. var node = tickText[0][0];
  6391. var zeroWidth = node.getBBox().width;
  6392. tick.remove();
  6393. var widestLabel = 0;
  6394. for (var i = 0; i < labelCount; ++i) {
  6395. node = validNodes[i];
  6396. var nodeRect = node.getBBox();
  6397. if (nodeRect.width > widestLabel) {
  6398. widestLabel = nodeRect.width;
  6399. }
  6400. if (nodeRect.height > this._layoutLabelHeight) {
  6401. this._layoutLabelHeight = nodeRect.height;
  6402. }
  6403. }
  6404. widestLabel += zeroWidth;
  6405. this._layoutSpillOver = mode == 1 ? this._layoutLabelHeight / 2 : widestLabel / 2 + 2;
  6406. } else {
  6407. for (var i = 0; i < labelCount; ++i) {
  6408. var node = validNodes[i];
  6409. var nodeRect = node.getBBox();
  6410. if (nodeRect.height > this._layoutLabelHeight) {
  6411. this._layoutLabelHeight = nodeRect.height;
  6412. }
  6413. }
  6414. this._layoutSpillOver = this._layoutLabelHeight / 2;
  6415. }
  6416. return mode;
  6417. }
  6418. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  6419. var staggerStringsWontMatch = this._tickFormat && !originalDataLabelAccessor;
  6420. var calcStagger = ((this._allowStagger && this._layoutMode == -1) || this._layoutMode == 3) && !staggerStringsWontMatch;
  6421. var calcRotate45 = (this._allowRotate45 && this._layoutMode == -1) || this._layoutMode == 2;
  6422. var calcRotate90 = (this._allowRotate90 && this._layoutMode == -1) || this._layoutMode == 1;
  6423. var spaceFor45Label = 0;
  6424. for (var i = 0; i < labelCount; ++i) {
  6425. var node = validNodes[i];
  6426. var nodeRect = node.getBBox();
  6427. layoutLabelHeight = nodeRect.height;
  6428. var labelWidth = nodeRect.width;
  6429. if (labelWidth > layoutLabelWidth) {
  6430. layoutLabelWidth = labelWidth;
  6431. }
  6432. horizontalScore += (labelWidth <= cellWidth ? 1 : cellWidth / labelWidth);
  6433. if (isHorizontal) {
  6434. if (calcStagger) {
  6435. var spaceForLabel = cellWidth * 2;
  6436. if (i == 0 && i == labelCount - 1) {
  6437. spaceForLabel *= 0.5;
  6438. } else if (i == 0 || i == labelCount - 1) {
  6439. spaceForLabel *= 0.75;
  6440. }
  6441. staggerScore += (labelWidth <= spaceForLabel ? 1 : spaceForLabel / labelWidth);
  6442. }
  6443. if (calcRotate45) {
  6444. if (spaceFor45Label == 0) {
  6445. spaceFor45Label = cellWidth90 / 0.7071 - layoutLabelHeight;
  6446. }
  6447. var space = this.calculate45DegreeSpace(node, spaceFor45Label);
  6448. rotate45Score += (labelWidth <= space ? 1 : space / labelWidth);
  6449. }
  6450. if (calcRotate90) {
  6451. rotate90Score += (labelWidth <= cellWidth90 ? 1 : cellWidth90 / labelWidth);
  6452. }
  6453. }
  6454. }
  6455. var mode = 0;
  6456. if (this._layoutMode == -1) {
  6457. if (isHorizontal && this._allowStagger) {
  6458. horizontalScore *= 1.1;
  6459. staggerScore *= 1.1;
  6460. }
  6461. if ((staggerScore > horizontalScore) && (staggerScore >= rotate45Score) && (staggerScore >= rotate90Score)) {
  6462. mode = 3;
  6463. } else if ((rotate45Score > horizontalScore) && (rotate45Score >= rotate90Score)) {
  6464. mode = 2;
  6465. } else if (rotate90Score > horizontalScore) {
  6466. mode = 1;
  6467. }
  6468. } else {
  6469. if ((this._layoutMode == 3 && staggerStringsWontMatch) || !isHorizontal) {
  6470. mode = 0;
  6471. } else {
  6472. mode = this._layoutMode;
  6473. }
  6474. }
  6475. if (isHorizontal) {
  6476. switch (mode) {
  6477. case 3:
  6478. this._layoutLabelSize = layoutLabelHeight * 2;
  6479. break;
  6480. case 2:
  6481. this._layoutLabelSize = (layoutLabelWidth + layoutLabelHeight) * 0.7071;
  6482. break;
  6483. case 1:
  6484. this._layoutLabelSize = layoutLabelWidth;
  6485. break;
  6486. case 0:
  6487. default:
  6488. this._layoutLabelSize = layoutLabelHeight;
  6489. break;
  6490. }
  6491. } else {
  6492. this._layoutLabelSize = layoutLabelWidth;
  6493. }
  6494. this._layoutLabelHeight = layoutLabelHeight;
  6495. return mode;
  6496. },
  6497. calculate45DegreeSpace : function(node, maxWidth) {
  6498. var width = maxWidth;
  6499. var tfm = node.rave_getParentNode().getAttribute("transform");
  6500. if (tfm != null) {
  6501. var tfmString = tfm.toString();
  6502. var indexOfTrans = tfmString.indexOf("translate(");
  6503. if (indexOfTrans != -1) {
  6504. indexOfTrans += 10;
  6505. var indexOfComma = tfmString.indexOf(",", indexOfTrans);
  6506. if (indexOfComma != -1) {
  6507. var xAmount = tfmString.substring(indexOfTrans, indexOfComma);
  6508. var xLabelPos = + (xAmount);
  6509. var width45Degrees = node.getBBox().width;
  6510. var xLabelWidth = width45Degrees * 0.7071;
  6511. var isBottom = this._orient == "bottom";
  6512. if (isBottom) {
  6513. xLabelPos -= node.getBBox().height / 4;
  6514. if (xLabelPos - xLabelWidth < this._bounds.x) {
  6515. xLabelWidth = xLabelPos - this._bounds.x;
  6516. width = xLabelWidth / 0.7071;
  6517. }
  6518. } else {
  6519. if (xLabelPos + xLabelWidth > this._bounds.x + this._bounds.width) {
  6520. xLabelWidth = (this._bounds.x + this._bounds.width) - xLabelPos;
  6521. width = xLabelWidth / 0.7071;
  6522. }
  6523. }
  6524. if (width > maxWidth) {
  6525. width = maxWidth;
  6526. }
  6527. }
  6528. }
  6529. }
  6530. return width;
  6531. },
  6532. /**
  6533. * @param (rave['internal']['Selector']) labels selector with all labels to be rotated
  6534. * @param (rave['internal']['Selector']) g The parent selector of labels
  6535. * @param (String) textAnchor The position of the anchor
  6536. * @param alignmentMode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  6537. */
  6538. rotateLabels : function(g, labels, textAnchor, mode) {
  6539. if (this._rotateLabels) {
  6540. var self = this;
  6541. var positioning = function(data, index, groupIndex) {
  6542. var x = 0;
  6543. var y = 0;
  6544. var rotation_cy = 0;
  6545. var isBottom = self._orient == "bottom";
  6546. if (mode == 3) {
  6547. var cellIndex = self.getStaggerIndex(this);
  6548. if (cellIndex != -1) {
  6549. if (cellIndex % 2 == 1) {
  6550. var staggerDirection = isBottom ? 1 : -1;
  6551. y += (self._layoutLabelHeight * staggerDirection);
  6552. }
  6553. if (cellIndex == 0 && self._staggerAlignFirstAtStart) {
  6554. x -= self._staggerCellWidth / 4;
  6555. } else if (cellIndex == self.getStaggerCount() - 1 && self._staggerAlignLastAtEnd) {
  6556. x += self._staggerCellWidth / 4;
  6557. }
  6558. }
  6559. } else if (mode == 2) {
  6560. if (isBottom) {
  6561. x -= self._layoutLabelHeight;
  6562. } else {
  6563. x += self._layoutLabelHeight / 2;
  6564. }
  6565. } else if (mode == 1) {
  6566. if (isBottom) {
  6567. x -= (this.getBBox().height / 2 + self._layoutLabelHeight / 4);
  6568. rotation_cy = ~~(self._padding / 4 + self._axis.tickSize());
  6569. } else {
  6570. x -= (this.getBBox().height / 2 - self._layoutLabelHeight);
  6571. rotation_cy = ~~-(self._padding / 4 + self._axis.tickSize());
  6572. }
  6573. }
  6574. var rotationDegrees = mode == 1 ? -90 : mode == 2 ? -45 : 0;
  6575. return "translate(" + x + "," + y + ") rotate(" + rotationDegrees + ",0," + rotation_cy + ")";
  6576. };
  6577. labels.attr("transform", positioning).style("text-anchor", textAnchor);
  6578. if (mode == 3) {
  6579. if (this._staggerAlignFirstAtStart) {
  6580. this._staggerFirstNode.rave_setStyle("text-anchor", "start");
  6581. }
  6582. if (this._staggerAlignLastAtEnd) {
  6583. this._staggerLastNode.rave_setStyle("text-anchor", "end");
  6584. }
  6585. }
  6586. }
  6587. },
  6588. /** @expose */
  6589. axis : function() {
  6590. return this._axis;
  6591. },
  6592. /**
  6593. * Draw the axis. The scale is non-null.
  6594. * @param (rave['internal']['Selector']) g Selector group into which the axis is drawn.
  6595. */
  6596. drawAxis : function(g) {
  6597. var axisSelector = g.selectAll("g.axis").data([0]);
  6598. axisSelector.enter().append("g").classed("axis", true).classed(this._orient, true);
  6599. if (!this._axis) {
  6600. this._axis = new rave['internal']['Axis']();
  6601. }
  6602. if (this._hideOverlappingLabels) {
  6603. this._textFlow.valignment("top").dropTextOnFail(false);
  6604. }
  6605. this._axis.ticksHandler(this._tickHandler);
  6606. this._axis.orient(this._orient);
  6607. this._axis.tickFormat(this._tickFormat);
  6608. this._axis.tickPadding(10.0);
  6609. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6610. var labelHeight = 20.0;
  6611. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6612. if (isHorizontal) {
  6613. labelHeight /= 0.7071;
  6614. }
  6615. var range = this._scale.scale().rangeExtent();
  6616. var extent = + (range[1]) - + (range[0]);
  6617. this._axis.ticks(extent / labelHeight);
  6618. } else {
  6619. if (this._tickMagnitude == null) {
  6620. this._axis.ticks(10.0);
  6621. } else {
  6622. this._axis.ticks.apply(this._axis, [10.0, this._scale.scale().getTickFormat(), this._tickMagnitude]);
  6623. }
  6624. }
  6625. var s = this._scale.scale();
  6626. if (this._scale.originalDomain()) {
  6627. var sOrdinal = s.copy();
  6628. sOrdinal.domain(this._scale.originalDomain());
  6629. s = sOrdinal;
  6630. var self = this;
  6631. var originalDataLabelAccessor = (self._scale).originalDomainLabelAccessor();
  6632. var tickFormatter;
  6633. if (originalDataLabelAccessor) {
  6634. if (this._tickFormat) {
  6635. tickFormatter = function(data, index, groupIndex) {
  6636. return self._tickFormat.call(this, originalDataLabelAccessor.call(this, data, index, groupIndex), index, groupIndex);
  6637. };
  6638. } else {
  6639. tickFormatter = originalDataLabelAccessor;
  6640. }
  6641. } else {
  6642. tickFormatter = this._tickFormat;
  6643. }
  6644. this._axis.tickFormat(tickFormatter);
  6645. }
  6646. this._axis.scale(s);
  6647. axisSelector.call(this._axis);
  6648. var g2 = rave.transition(axisSelector);
  6649. if (!(g2.isTransition())) {
  6650. axisSelector.selectAll("text").call(this._dropOverlap, this._hideOverlappingLabels);
  6651. }
  6652. axisSelector.selectAll("path.domain").classed("axis-line", true);
  6653. axisSelector.selectAll("g.tick line").classed("axis-tick", true);
  6654. if (this._fontChecker) {
  6655. axisSelector.selectAll("g.tick text").classed("axis-label", true).call(this._fontChecker);
  6656. } else {
  6657. axisSelector.selectAll("g.tick text").classed("axis-label", true);
  6658. }
  6659. axisSelector.call(this._axisLineProperties);
  6660. },
  6661. /**
  6662. * Draw the axis title.
  6663. * @param (rave['internal']['Selector']) g Selector group into which the title is drawn.
  6664. */
  6665. drawTitle : function(g) {
  6666. if (!this._displayAxisTitle || this._axisTitle == null || this._axisTitle.trim().length == 0 || !this._bounds) {
  6667. g.selectAll("text.axis-title." + this._orient).remove();
  6668. return;
  6669. }
  6670. var x = 0;
  6671. var y = 0;
  6672. var dy = "";
  6673. var transform;
  6674. if ("top" == this._orient) {
  6675. x = this._elementRect.x + this._elementRect.width / 2;
  6676. y = -this._bounds.height + this._padding / 4;
  6677. dy = "0.75em";
  6678. } else if ("bottom" == this._orient) {
  6679. x = this._elementRect.x + this._elementRect.width / 2;
  6680. y = this._bounds.height - this._padding / 4;
  6681. dy = "-0.25em";
  6682. } else if ("left" == this._orient) {
  6683. x = -this._elementRect.y - this._elementRect.height / 2;
  6684. y = -this._bounds.width + this._padding / 4;
  6685. dy = "0.75em";
  6686. transform = "rotate(-90)";
  6687. } else {
  6688. x = this._elementRect.y + this._elementRect.height / 2;
  6689. y = -this._bounds.width + this._padding / 4;
  6690. dy = "0.75em";
  6691. transform = "rotate(90)";
  6692. }
  6693. var fillOpacity;
  6694. {
  6695. var tmp = g.append("text").attr("class", "axis-title " + this._orient);
  6696. fillOpacity = tmp.style("fill-opacity");
  6697. tmp.remove();
  6698. } var label = g.selectAll("text.axis-title." + this._orient);
  6699. if (label.size() == 0) {
  6700. 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);
  6701. if (this._fontChecker) {
  6702. g.selectAll("text.axis-title." + this._orient).call(this._fontChecker);
  6703. }
  6704. }
  6705. 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);
  6706. },
  6707. getUnZoomedScale : function(scale) {
  6708. var s = scale.copy();
  6709. if (s.getZoomTransform()) {
  6710. s.getZoomTransform()(1, 0);
  6711. }
  6712. return s;
  6713. },
  6714. isValid : function(data) {
  6715. var s = this.getUnZoomedScale(this._axis.scale());
  6716. var v = + (s.call(null, data, 0, 0));
  6717. var range = this._axis.scale().range();
  6718. if (this._axis.scale().range().indexOf(v)> -1) {
  6719. return true;
  6720. }
  6721. if (range[0] < v && v < range[1]) {
  6722. return true;
  6723. }
  6724. if (range[0] > v && v > range[1]) {
  6725. return true;
  6726. }
  6727. return false;
  6728. },
  6729. /**
  6730. * Apply label wrapping if requested.
  6731. * @param (rave['internal']['Selector']) g
  6732. * @param (int) mode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  6733. */
  6734. doLabelWrapping : function(g, mode) {
  6735. if (this._displayTickLabels) {
  6736. this._textFlow.valignment("top");
  6737. if (!this._hideOverlappingLabels) {
  6738. this._textFlow.dropTextOnFail(true);
  6739. }
  6740. var d = this.labelExtent(g);
  6741. if (!d || d[0] < 0 || d[1] < 0) {
  6742. return;
  6743. }
  6744. var w = ~~ (d[0]);
  6745. var h = ~~ (d[1]);
  6746. if (mode == 2) {
  6747. w = ~~(d[1] / 0.7071 - this._layoutLabelHeight);
  6748. h = ~~(this._layoutLabelHeight / 0.7071);
  6749. } else if (mode == 1) {
  6750. var tmp = w;
  6751. w = h;
  6752. h = tmp;
  6753. }
  6754. var allowWrap = mode == 1;
  6755. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  6756. var hActual = ~~ (this._layoutLabelHeight * 1.2);
  6757. if (hActual > h) {
  6758. h = hActual;
  6759. }
  6760. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6761. if (mode == 0 && !isHorizontal) {
  6762. allowWrap = true;
  6763. }
  6764. }
  6765. var self = this;
  6766. var cellWidth = w;
  6767. var cellHeight = h;
  6768. this._textFlow.wrap(allowWrap).truncate(true).textTruncateIndicator(this._textTruncationIndicator != null ? this._textTruncationIndicator : "...").spacing(1.2).extent(function(data, index, groupIndex) {
  6769. var width = cellWidth;
  6770. var height = cellHeight;
  6771. if (mode == 2) {
  6772. var cellIndex = self.getStaggerIndex(this);
  6773. if (cellIndex != -1) {
  6774. width = ~~self.calculate45DegreeSpace(this, cellWidth);
  6775. }
  6776. } else if (mode == 3) {
  6777. var cellIndex = self.getStaggerIndex(this);
  6778. if (cellIndex != -1) {
  6779. if (cellIndex == 0 && cellIndex == self.getStaggerCount() - 1) {
  6780. width = cellWidth;
  6781. } else if (cellIndex == 0 || cellIndex == self.getStaggerCount() - 1) {
  6782. width = cellWidth * 3 / 2;
  6783. } else {
  6784. width = cellWidth * 2;
  6785. }
  6786. height = cellHeight / 2;
  6787. }
  6788. }
  6789. return [width, height];
  6790. });
  6791. g.selectAll("g.tick > text").call(this._textFlow);
  6792. }
  6793. },
  6794. /**
  6795. * <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>
  6796. * @param (rave['internal']['Selector']) g Selector group for axis
  6797. * @return (Array) The extent of the axis label bounds
  6798. */
  6799. /** @expose */
  6800. labelExtent : function(g) {
  6801. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  6802. var w = this._bounds.width;
  6803. var h = this._bounds.height;
  6804. if (this._scale.scale().rangeBand) {
  6805. var rangeBandValue = + (this._scale.scale().rangeBand());
  6806. if (isHorizontal) {
  6807. w = rangeBandValue;
  6808. } else {
  6809. h = rangeBandValue;
  6810. }
  6811. }
  6812. this.calcTitleExtent(g);
  6813. if (isHorizontal) {
  6814. h -= this._axis.tickSize();
  6815. h -= this._padding / 2;
  6816. if (this._layoutTitleSize != 0) {
  6817. h -= this._layoutTitleSize;
  6818. h -= this._padding / 2;
  6819. }
  6820. } else {
  6821. w -= this._axis.tickSize();
  6822. w -= this._padding / 2;
  6823. if (this._layoutTitleSize != 0) {
  6824. w -= this._layoutTitleSize;
  6825. w -= this._padding / 2;
  6826. }
  6827. }
  6828. return [w, h];
  6829. },
  6830. calcTitleExtent : function(g) {
  6831. this._layoutTitleSize = 0;
  6832. var title = g.selectAll("text.axis-title");
  6833. if (title.size() > 0) {
  6834. var textHeight = title[0][0].getBBox().height;
  6835. this._layoutTitleSize = textHeight;
  6836. }
  6837. },
  6838. /**
  6839. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  6840. * @param (String) role The new role
  6841. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) This object
  6842. */
  6843. /** @expose */
  6844. setRole : function(role) {
  6845. this._role = role;
  6846. return this;
  6847. },
  6848. /**
  6849. * Set the ticks interval on the scale based on the magnitude. tickMagnitude represents power of 10. null value gives the default scale ticks.
  6850. * @param (Number) tickMagnitude
  6851. * @return (com.ibm.rave.bundles.component.AxisComponent) this
  6852. */
  6853. /** @expose */
  6854. scaleTickMagnitude : function(tickMagnitude) {
  6855. this._tickMagnitude = tickMagnitude;
  6856. return this;
  6857. },
  6858. /**
  6859. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The new scale
  6860. */
  6861. /** @expose */
  6862. scale : function(scale) {
  6863. this._scale = scale ? scale : null;
  6864. return this;
  6865. },
  6866. /**
  6867. * Only legal values are accepted, otherwise the orient is unchanged.
  6868. * @param (String) orient The new orient
  6869. */
  6870. orient$0 : function(orient) {
  6871. if ("left" == orient || "bottom" == orient || "right" == orient || "top" == orient) {
  6872. this._orient = orient;
  6873. if (this._role == null) {
  6874. if ("left" == orient) {
  6875. this._role = "ROLE_Y1";
  6876. } else if ("bottom" == orient) {
  6877. this._role = "ROLE_X1";
  6878. } else if ("right" == orient) {
  6879. this._role = "ROLE_Y2";
  6880. } else {
  6881. this._role = "ROLE_X2";
  6882. }
  6883. }
  6884. }
  6885. return this;
  6886. },
  6887. /**
  6888. * Returns the current orientation string return The current orient
  6889. */
  6890. orient$1 : function() {
  6891. return this._orient;
  6892. },
  6893. /**
  6894. * @param (rave['internal']['RectStruct']) bounds The new bounds
  6895. */
  6896. /** @expose */
  6897. bounds : function(bounds) {
  6898. this._bounds = bounds;
  6899. return this;
  6900. },
  6901. /** @expose */
  6902. elementRect : function(elementRect) {
  6903. this._elementRect = elementRect;
  6904. return this;
  6905. },
  6906. tickFormat$0 : function(tickFormat) {
  6907. this._tickFormat = tickFormat;
  6908. return this;
  6909. },
  6910. tickFormat$1 : function() {
  6911. return this._tickFormat;
  6912. },
  6913. simplifiedTickFormat$0 : function(tickFormat) {
  6914. this._simplifiedTickFormat = tickFormat;
  6915. return this;
  6916. },
  6917. simplifiedTickFormat$1 : function() {
  6918. return this._simplifiedTickFormat;
  6919. },
  6920. /** @expose */
  6921. displayAxisTitle : function(displayAxisTitle) {
  6922. this._displayAxisTitle = displayAxisTitle;
  6923. return this;
  6924. },
  6925. /** @expose */
  6926. displayAxisLine : function(displayAxisLine) {
  6927. this._displayAxisLine = displayAxisLine;
  6928. return this;
  6929. },
  6930. /** @expose */
  6931. displayTicks : function(displayTicks) {
  6932. this._displayTicks = displayTicks;
  6933. return this;
  6934. },
  6935. /** @expose */
  6936. displayTickLabels : function(displayTickLabels) {
  6937. this._displayTickLabels = displayTickLabels;
  6938. return this;
  6939. },
  6940. /** @expose */
  6941. allowAutomaticAxisLayoutToChangeOrientation : function(state) {
  6942. this._allowAutoAxisLayoutToChangeOrientaiton = state;
  6943. return this;
  6944. },
  6945. /** @expose */
  6946. isAllowAutomaticAxisLayoutToChangeOrientation : function() {
  6947. return this._allowAutoAxisLayoutToChangeOrientaiton;
  6948. },
  6949. /** @expose */
  6950. showPanZoomTickLabels : function(showPanZoomTickLabels) {
  6951. this._showPanZoomTickLabels = showPanZoomTickLabels;
  6952. return this;
  6953. },
  6954. /** @expose */
  6955. axisTitle : function(axisTitle) {
  6956. this._axisTitle = axisTitle;
  6957. return this;
  6958. },
  6959. /** @expose */
  6960. axisColor : function(axisColor) {
  6961. this._lineColor = axisColor;
  6962. this._tickColor = axisColor;
  6963. return this;
  6964. },
  6965. /** @expose */
  6966. lineColor : function(lineColor) {
  6967. this._lineColor = lineColor;
  6968. return this;
  6969. },
  6970. /** @expose */
  6971. tickColor : function(tickColor) {
  6972. this._tickColor = tickColor;
  6973. return this;
  6974. },
  6975. /** @expose */
  6976. labelColor : function(labelColor) {
  6977. this._labelStyle["fill"] = labelColor;
  6978. return this;
  6979. },
  6980. labelStyle$0 : function(fill, fontSize, fontFamily) {
  6981. this._labelStyle["fill"] = fill;
  6982. this._labelStyle["font-size"] = fontSize;
  6983. this._labelStyle["font-family"] = fontFamily;
  6984. return this;
  6985. },
  6986. /** @expose */
  6987. titleColor : function(titleColor) {
  6988. this._titleStyle["fill"] = titleColor;
  6989. return this;
  6990. },
  6991. titleStyle$0 : function(fill, fontSize, fontFamily) {
  6992. this._titleStyle["fill"] = fill;
  6993. this._titleStyle["font-size"] = fontSize;
  6994. this._titleStyle["font-family"] = fontFamily;
  6995. return this;
  6996. },
  6997. /**
  6998. * @param (int) padding The new padding
  6999. */
  7000. /** @expose */
  7001. padding : function(padding) {
  7002. this._padding = padding;
  7003. return this;
  7004. },
  7005. /**
  7006. * @param mode LayoutMode for axis, one of: null (numeric axis), automatic, horizontal, stagger, rotate45, rotate90
  7007. */
  7008. /** @expose */
  7009. layoutMode : function(layoutMode) {
  7010. this._layoutMode = -1;
  7011. if (layoutMode != null) {
  7012. if (layoutMode == "horizontal") {
  7013. this._layoutMode = 0;
  7014. } else if (layoutMode == "stagger") {
  7015. this._layoutMode = 3;
  7016. } else if (layoutMode == "rotate45") {
  7017. this._layoutMode = 2;
  7018. } else if (layoutMode == "rotate90") {
  7019. this._layoutMode = 1;
  7020. }
  7021. }
  7022. return this;
  7023. },
  7024. /**
  7025. * @param (boolean) allow Enable Stagger to be considered in the automatic layout algorithm
  7026. */
  7027. /** @expose */
  7028. allowStagger : function(allow) {
  7029. this._allowStagger = allow;
  7030. return this;
  7031. },
  7032. /**
  7033. * @param (boolean) allow Enable Rotate 45 to be considered in the automatic layout algorithm
  7034. */
  7035. /** @expose */
  7036. allowRotate45 : function(allow) {
  7037. this._allowRotate45 = allow;
  7038. return this;
  7039. },
  7040. /**
  7041. * @param (boolean) allow Enable Rotate 90 to be considered in the automatic layout algorithm
  7042. */
  7043. /** @expose */
  7044. allowRotate90 : function(allow) {
  7045. this._allowRotate90 = allow;
  7046. return this;
  7047. },
  7048. /**
  7049. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  7050. */
  7051. renderedShapes : function() {
  7052. return this._renderedShapes;
  7053. },
  7054. labelStyle$1 : function(fontStyle) {
  7055. this._labelStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  7056. return this;
  7057. },
  7058. titleStyle$1 : function(fontStyle) {
  7059. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  7060. return this;
  7061. },
  7062. /**
  7063. * Determines whether the axis is swapped.
  7064. * @return (boolean) True if axis is swapped
  7065. */
  7066. isAxisSwapped : function() {
  7067. 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")));
  7068. },
  7069. /**
  7070. * <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>
  7071. * @param (String) indicator the string to be placed to indicated truncated text
  7072. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  7073. */
  7074. /** @expose */
  7075. textTruncateIndicator : function(indicator) {
  7076. this._textTruncationIndicator = indicator;
  7077. return this;
  7078. },
  7079. /**
  7080. * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
  7081. */
  7082. stopLabelDroppingUpdate : function() {
  7083. this._pendingLabelTimer = false;
  7084. },
  7085. /**
  7086. * 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.
  7087. * @param (rave['internal']['Selector']) labels the selection of valid labels for the end of the transition
  7088. * @param (double) duration of the transition. If 0, we don't do anything.
  7089. * @param (double) delay of the transition. Added to the duration to delay the updates.
  7090. */
  7091. updateLabelDropping : function(labels, duration, delay) {
  7092. var self = this;
  7093. var start = delay + duration;
  7094. var labelCollideCallback = function(elapsed) {
  7095. if (!self._pendingLabelTimer) {
  7096. return true;
  7097. }
  7098. labels.call(self._dropOverlap, self._hideOverlappingLabels);
  7099. if (elapsed >= start) {
  7100. self._pendingLabelTimer = false;
  7101. return true;
  7102. }
  7103. return false;
  7104. };
  7105. if (duration > 0) {
  7106. this._pendingLabelTimer = true;
  7107. rave.timer(labelCollideCallback, start);
  7108. }
  7109. },
  7110. doLabelWrappingAfterAnimation : function(g, labels, mode, duration, delay) {
  7111. this._layoutTimerId++;
  7112. var timerId = this._layoutTimerId;
  7113. var self = this;
  7114. var wrapCallback = function(elapsed) {
  7115. if (self._layoutTimerId == timerId) {
  7116. self.doLabelWrapping(g, mode);
  7117. self.handleLabelsRotationAndPosition(g, labels, mode);
  7118. }
  7119. return true;
  7120. };
  7121. rave.timer(wrapCallback, delay + duration);
  7122. },
  7123. /** @expose */
  7124. preLayout : function() {
  7125. this._layoutTitleSize = 0;
  7126. this._layoutLabelSize = 0;
  7127. this._layoutLabelHeight = 0;
  7128. this._layoutAverageDigitWidth = 0;
  7129. this._layoutSpillOver = 0;
  7130. },
  7131. /** @expose */
  7132. getSizableType : function() {
  7133. return this._scale.isOrdinal() || this._scale.isClustered() ? 1 : 0;
  7134. },
  7135. /** @expose */
  7136. getSizableOrientation : function() {
  7137. return this._orient;
  7138. },
  7139. /** @expose */
  7140. getPreferredSize : function() {
  7141. var layoutPaddingSize = 0;
  7142. if (this._axis) {
  7143. layoutPaddingSize = this._axis.tickSize();
  7144. if (this._layoutLabelSize != 0) {
  7145. layoutPaddingSize += this._padding / 2;
  7146. }
  7147. if (this._layoutTitleSize != 0) {
  7148. layoutPaddingSize += this._padding / 2;
  7149. }
  7150. }
  7151. return this._layoutLabelSize + this._layoutAverageDigitWidth + this._layoutTitleSize + layoutPaddingSize + 2;
  7152. },
  7153. /** @expose */
  7154. getSpillOverSize : function() {
  7155. return this._layoutSpillOver;
  7156. },
  7157. /** @expose */
  7158. orient : function(a0) {
  7159. var args = arguments;
  7160. if (args.length == 0) {
  7161. return this.orient$1();
  7162. }
  7163. return this.orient$0(a0);
  7164. },
  7165. /** @expose */
  7166. tickFormat : function(a0) {
  7167. var args = arguments;
  7168. if (args.length == 0) {
  7169. return this.tickFormat$1();
  7170. }
  7171. return this.tickFormat$0(a0);
  7172. },
  7173. /** @expose */
  7174. simplifiedTickFormat : function(a0) {
  7175. var args = arguments;
  7176. if (args.length == 0) {
  7177. return this.simplifiedTickFormat$1();
  7178. }
  7179. return this.simplifiedTickFormat$0(a0);
  7180. },
  7181. /** @expose */
  7182. labelStyle : function(a0, a1, a2) {
  7183. var args = arguments;
  7184. if (args.length == 1) {
  7185. return this.labelStyle$1(a0);
  7186. }
  7187. return this.labelStyle$0(a0, a1, a2);
  7188. },
  7189. /** @expose */
  7190. titleStyle : function(a0, a1, a2) {
  7191. var args = arguments;
  7192. if (args.length == 1) {
  7193. return this.titleStyle$1(a0);
  7194. }
  7195. return this.titleStyle$0(a0, a1, a2);
  7196. }
  7197. });
  7198. /**
  7199. * 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.
  7200. * @param (rave['internal']['RectStruct']) bounds Rectangle of the axis bounds
  7201. * @param (String) orient Orient, "top", "bottom", "left", "right"; if not valid, "bottom" used
  7202. * @return (double[]) Translation [x,y]
  7203. */
  7204. /** @expose */
  7205. com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation = function(bounds, orient) {
  7206. if ("left" == orient) {
  7207. return [bounds.x + bounds.width, 0.0];
  7208. }
  7209. if ("right" == orient) {
  7210. return [bounds.x, 0.0];
  7211. }
  7212. if ("top" == orient) {
  7213. return [0.0, bounds.y + bounds.height];
  7214. }
  7215. return [0.0, bounds.y];
  7216. };
  7217. com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex = rave['internal']['Declare']({
  7218. //_node : null,
  7219. _domainIndex : 0,
  7220. /** @expose */
  7221. constructor : function(node, domainIndex) {
  7222. this._node = node;
  7223. this._domainIndex = domainIndex;
  7224. },
  7225. /** @expose */
  7226. contains : function(node) {
  7227. return node == this._node;
  7228. },
  7229. /** @expose */
  7230. getIndex : function() {
  7231. return this._domainIndex;
  7232. }
  7233. });
  7234. /**
  7235. * Tick Handler for the axis. This will get called as the core axis is transitioned.
  7236. */
  7237. com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler = rave['internal']['Declare'](rave['internal']['AbstractTickHandler'], {
  7238. //_label : null,
  7239. //_tick : null,
  7240. _$functionClassMethod : function() {
  7241. var _$self = function(args) {
  7242. if (args !== null || arguments.length > 1){
  7243. args = Array.prototype.slice.call(arguments, 0);
  7244. }
  7245. {
  7246. _$self.handle(args[0]);
  7247. return null;
  7248. }
  7249. };
  7250. return _$self;
  7251. },
  7252. constructor : function(label, tick) {
  7253. this._label = label;
  7254. this._tick = tick;
  7255. },
  7256. /** @expose */
  7257. handle : function(ticks) {
  7258. ticks.call(this._tick);
  7259. ticks.call(this._label);
  7260. }
  7261. });
  7262. //com_ibm_rave_bundles_components_AxisComponentImpl.VISIBILITY = "visibility";
  7263. //com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN = "hidden";
  7264. /** @expose */
  7265. com_ibm_rave_bundles_components_AxisComponentImpl.LABEL_HIDDEN_FLAG = "__tickLabelHidden__";
  7266. /** @expose */
  7267. com_ibm_rave_bundles_components_AxisComponentImpl.PANZOOM_HIDDEN_FLAG = "__panZoomHidden__";
  7268. /** @expose */
  7269. com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN_COUNT = "__hiddenCount__";
  7270. /** @expose */
  7271. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_SPACE_PER_TICK = 20;
  7272. /** @expose */
  7273. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_TICK_COUNT = 10;
  7274. /** @expose */
  7275. com_ibm_rave_bundles_components_AxisComponentImpl.TICK_PADDING = 10;
  7276. //com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL_WEIGHT = 1.1;
  7277. com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL = 0;
  7278. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE90 = 1;
  7279. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE45 = 2;
  7280. com_ibm_rave_bundles_components_AxisComponentImpl.STAGGER = 3;
  7281. /**
  7282. * Constant used for text flow spacing
  7283. */
  7284. com_ibm_rave_bundles_components_AxisComponentImpl.TEXTFLOW_SPACING = 1.2;
  7285. /**
  7286. * Bottom axis orientation string.
  7287. */
  7288. /** @expose */
  7289. com_ibm_rave_bundles_components_AxisComponentImpl.BOTTOM_ORIENTATION = "bottom";
  7290. /**
  7291. * Top axis orientation string.
  7292. */
  7293. /** @expose */
  7294. com_ibm_rave_bundles_components_AxisComponentImpl.TOP_ORIENTATION = "top";
  7295. /**
  7296. * Left axis orientation string.
  7297. */
  7298. /** @expose */
  7299. com_ibm_rave_bundles_components_AxisComponentImpl.LEFT_ORIENTATION = "left";
  7300. /**
  7301. * Right axis orientation string.
  7302. */
  7303. /** @expose */
  7304. com_ibm_rave_bundles_components_AxisComponentImpl.RIGHT_ORIENTATION = "right";
  7305. com_ibm_rave_bundles_components_AxisComponentImpl.AUTOMODE = -1;
  7306. // $source: com/ibm/rave/bundles/components/GridComponentImpl
  7307. /************************************************************************
  7308. ** IBM Confidential
  7309. **
  7310. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7311. **
  7312. ** (C) Copyright IBM Corp. 2017
  7313. **
  7314. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7315. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7316. ************************************************************************/
  7317. // GENERATED
  7318. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  7319. //@import com/ibm/rave/bundles/components/StyleStructs (runtime) // new
  7320. //@import com/ibm/rave/bundles/component/GridComponent (runtime) // GridComponent
  7321. /**
  7322. * <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>
  7323. */
  7324. var com_ibm_rave_bundles_components_GridComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  7325. /**
  7326. * The axis property
  7327. */
  7328. //_axis : null,
  7329. /**
  7330. * Role, from the AxisComponent API
  7331. */
  7332. //_role : null,
  7333. /**
  7334. * The orientation
  7335. */
  7336. //_orient : null,
  7337. /**
  7338. * The bounds
  7339. */
  7340. //_bounds : null,
  7341. /**
  7342. * Style of gridlines
  7343. */
  7344. //_gridlineStyle : null,
  7345. /**
  7346. * Whether to display gridlines
  7347. */
  7348. _displayGridlines : false,
  7349. /**
  7350. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  7351. */
  7352. _renderedShapes : false,
  7353. /**
  7354. * Construct, with all properties the defaults.
  7355. */
  7356. /** @expose */
  7357. constructor : function() {
  7358. this._axis = null;
  7359. this._role = null;
  7360. this._orient = "bottom";
  7361. this._bounds = null;
  7362. this._displayGridlines = true;
  7363. this._gridlineStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
  7364. this._renderedShapes = false;
  7365. },
  7366. /** @expose */
  7367. type : function() {
  7368. return com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE;
  7369. },
  7370. /** @expose */
  7371. role : function() {
  7372. return this._role;
  7373. },
  7374. /** @expose */
  7375. execute : function(g) {
  7376. this.preExecute();
  7377. if (!this._displayGridlines || !this._axis || !this._bounds) {
  7378. g.selectAll("*").remove();
  7379. this._renderedShapes = false;
  7380. return;
  7381. }
  7382. this._renderedShapes = true;
  7383. var size = ("bottom" == this._orient || "top" == this._orient) ? this._bounds.height : this._bounds.width;
  7384. var ticksHandler = this._axis.ticksHandler();
  7385. var tickSize = this._axis.tickSize();
  7386. var outerTickSize = this._axis.outerTickSize();
  7387. var tickFormat = this._axis.tickFormat();
  7388. var ax = this._axis.tickSize(-size, 0).tickFormat("").ticksHandler(null);
  7389. g.call(ax);
  7390. this._axis.tickSize(tickSize, outerTickSize).tickFormat(tickFormat).ticksHandler(ticksHandler);
  7391. g.selectAll("g.tick line").classed("grid-tick", true);
  7392. g.selectAll(".grid-tick").style("stroke", this._gridlineStyle._stroke).style("stroke-dasharray", (this._gridlineStyle._dashArray));
  7393. g.selectAll("path.domain").remove();
  7394. },
  7395. /**
  7396. * @param (rave['internal']['Axis']) axis The new axis
  7397. */
  7398. /** @expose */
  7399. axis : function(axis) {
  7400. this._axis = axis;
  7401. return this;
  7402. },
  7403. /**
  7404. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  7405. * @param (String) role The new role
  7406. * @return (com.ibm.rave.bundles.components.GridComponentImpl) This object
  7407. */
  7408. /** @expose */
  7409. setRole : function(role) {
  7410. this._role = role;
  7411. return this;
  7412. },
  7413. /**
  7414. * Only legal values are accepted, otherwise the orient is unchanged.
  7415. * @param (String) orient The new orient
  7416. */
  7417. orient$0 : function(orient) {
  7418. if ("left" == orient || "right" == orient || "bottom" == orient || "top" == orient) {
  7419. this._orient = orient;
  7420. }
  7421. return this;
  7422. },
  7423. /**
  7424. * @param (rave['internal']['RectStruct']) bounds The new bounds
  7425. */
  7426. /** @expose */
  7427. bounds : function(bounds) {
  7428. this._bounds = bounds;
  7429. return this;
  7430. },
  7431. displayGridlines$0 : function(displayGridlines) {
  7432. this._displayGridlines = displayGridlines;
  7433. return this;
  7434. },
  7435. /** @expose */
  7436. gridlineStyle : function(gridlineColor, dashArray) {
  7437. this.gridlineColor(gridlineColor);
  7438. this.dashArray(dashArray);
  7439. return this;
  7440. },
  7441. gridlineColor$0 : function(gridlineColor) {
  7442. this._gridlineStyle._stroke = (gridlineColor != null && gridlineColor.length > 0) ? gridlineColor : null;
  7443. return this;
  7444. },
  7445. dashArray$0 : function(dashArray) {
  7446. this._gridlineStyle._dashArray = (dashArray != null && dashArray.length > 0) ? dashArray : null;
  7447. return this;
  7448. },
  7449. /**
  7450. * @return (String) The orientation of the gridline.
  7451. */
  7452. orient$1 : function() {
  7453. return this._orient;
  7454. },
  7455. displayGridlines$1 : function() {
  7456. return this._displayGridlines;
  7457. },
  7458. gridlineColor$1 : function() {
  7459. return this._gridlineStyle._stroke;
  7460. },
  7461. dashArray$1 : function() {
  7462. return this._gridlineStyle._dashArray;
  7463. },
  7464. /**
  7465. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  7466. */
  7467. renderedShapes : function() {
  7468. return this._renderedShapes;
  7469. },
  7470. /** @expose */
  7471. orient : function(a0) {
  7472. var args = arguments;
  7473. if (args.length == 0) {
  7474. return this.orient$1();
  7475. }
  7476. return this.orient$0(a0);
  7477. },
  7478. /** @expose */
  7479. displayGridlines : function(a0) {
  7480. var args = arguments;
  7481. if (args.length == 0) {
  7482. return this.displayGridlines$1();
  7483. }
  7484. return this.displayGridlines$0(a0);
  7485. },
  7486. /** @expose */
  7487. gridlineColor : function(a0) {
  7488. var args = arguments;
  7489. if (args.length == 0) {
  7490. return this.gridlineColor$1();
  7491. }
  7492. return this.gridlineColor$0(a0);
  7493. },
  7494. /** @expose */
  7495. dashArray : function(a0) {
  7496. var args = arguments;
  7497. if (args.length == 0) {
  7498. return this.dashArray$1();
  7499. }
  7500. return this.dashArray$0(a0);
  7501. }
  7502. });
  7503. // $source: com/ibm/rave/bundles/components/KeyedBundleComponentImpl
  7504. /************************************************************************
  7505. ** IBM Confidential
  7506. **
  7507. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7508. **
  7509. ** (C) Copyright IBM Corp. 2017
  7510. **
  7511. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7512. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7513. ************************************************************************/
  7514. // GENERATED
  7515. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  7516. /**
  7517. * 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.
  7518. * @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>
  7519. */
  7520. var com_ibm_rave_bundles_components_KeyedBundleComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  7521. //keyFunction : null,
  7522. /**
  7523. * Set the key function this component should use when joining data to scene nodes.
  7524. * @param (rave['internal']['SingleValueFunction']) keyFunction This function will be passed each datum individually and must return a unique value (a key).
  7525. * @return (com.ibm.rave.bundles.components.KeyedBundleComponentImpl) This.
  7526. */
  7527. /** @expose */
  7528. key : function(keyFunction) {
  7529. this.keyFunction = keyFunction;
  7530. return this;
  7531. },
  7532. /**
  7533. * Returns a {@link (rave['internal']['ValueFunction']) ValueFunction} that wraps the provided key function.
  7534. */
  7535. /** @expose */
  7536. getKey : function() {
  7537. if (!this.keyFunction) {
  7538. return null;
  7539. }
  7540. var self = this;
  7541. return function(datum, index, groupIndex) {
  7542. return self.keyFunction(datum);
  7543. };
  7544. }
  7545. });
  7546. // $source: com/ibm/rave/bundles/components/AbstractPathComponent
  7547. /************************************************************************
  7548. ** IBM Confidential
  7549. **
  7550. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7551. **
  7552. ** (C) Copyright IBM Corp. 2017
  7553. **
  7554. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7555. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7556. ************************************************************************/
  7557. // GENERATED
  7558. //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
  7559. //@import com/ibm/rave/bundles/utilities/PathUtils (runtime) // fadeOutIn
  7560. /**
  7561. * Base class for Line and Area components, both of which create similar path-based elements.
  7562. */
  7563. var com_ibm_rave_bundles_components_AbstractPathComponent = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
  7564. /**
  7565. * Interpolation Mode (Smoothness of the line)
  7566. */
  7567. /** @expose */
  7568. _interpolateMode : null,
  7569. /**
  7570. * Keep track of the previous Interpolation Mode
  7571. */
  7572. /** @expose */
  7573. _previousInterpolateMode : null,
  7574. constructor : function() {
  7575. this._interpolateMode = rave['internal']['SVGLine'].r2_svg_lineLinear.getKey();
  7576. this._previousInterpolateMode = this._interpolateMode;
  7577. },
  7578. /** @expose */
  7579. updatePath : function(updateSelection, pathFunction) {
  7580. if (this._interpolateMode != null && !(this._interpolateMode == this._previousInterpolateMode)) {
  7581. com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn(updateSelection, pathFunction);
  7582. } else {
  7583. updateSelection.attr("d", pathFunction);
  7584. }
  7585. this._previousInterpolateMode = this._interpolateMode;
  7586. }
  7587. });
  7588. // $source: com/ibm/rave/bundles/components/AreaComponentImpl
  7589. /************************************************************************
  7590. ** IBM Confidential
  7591. **
  7592. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7593. **
  7594. ** (C) Copyright IBM Corp. 2017
  7595. **
  7596. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7597. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7598. ************************************************************************/
  7599. // GENERATED
  7600. //@import com/ibm/rave/bundles/components/AbstractPathComponent (loadtime) // superclass
  7601. //@import com/ibm/rave/bundles/component/AreaComponent (runtime) // AreaComponent
  7602. /**
  7603. * <p> A component to draw area charts. The component puts its shapes into the selector passed to its execute method. </p> <p> The data array passed to the component has one entry per line to be drawn. Each entry has two properties. Accessors are used to get these properties from the object. Their roles are: </p>
  7604. */
  7605. var com_ibm_rave_bundles_components_AreaComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_AbstractPathComponent, {
  7606. /**
  7607. * Data
  7608. */
  7609. //_data : null,
  7610. /**
  7611. * Accessor for points role
  7612. */
  7613. //_pointsAccessor : null,
  7614. /**
  7615. * Accessor for group data
  7616. */
  7617. //_groupAccessor : null,
  7618. /**
  7619. * Accessor for independent variable from a point
  7620. */
  7621. //_independentAccessor : null,
  7622. /**
  7623. * Independent variable scale
  7624. */
  7625. //_independentScale : null,
  7626. /**
  7627. * Accessor for dependent variable from a point
  7628. */
  7629. //_dependentAccessor : null,
  7630. /**
  7631. * Dependent scale
  7632. */
  7633. //_dependentScale : null,
  7634. /**
  7635. * Accessor for dependent variable from a point for Y0
  7636. */
  7637. //_dependentY0Accessor : null,
  7638. /**
  7639. * Accessor for checking to see if Y value is null
  7640. */
  7641. //_definedAccessor : null,
  7642. /**
  7643. * Color scale
  7644. */
  7645. //_colorPalette : null,
  7646. /**
  7647. * stroke color, if null use the color palette
  7648. */
  7649. //_borderColor : null,
  7650. /**
  7651. * stroke width, if null use 0px
  7652. */
  7653. //_borderWidth : null,
  7654. /**
  7655. * Effect, only "fromBase" supported
  7656. */
  7657. //_effect : null,
  7658. /**
  7659. * chart opacity
  7660. */
  7661. _areaOpacity : 0,
  7662. /**
  7663. * Used to determine if the chart is Stacked or Simple
  7664. */
  7665. _isStacked : false,
  7666. /**
  7667. * Transpose
  7668. */
  7669. _transpose : false,
  7670. /**
  7671. * Initialize all properties to default values.
  7672. */
  7673. /** @expose */
  7674. constructor : function() {
  7675. this._data = null;
  7676. this._pointsAccessor = function(data) {
  7677. return (data)["points"];
  7678. };
  7679. this._groupAccessor = function(data) {
  7680. return (data)["group"];
  7681. };
  7682. this._independentAccessor = function(data) {
  7683. return (data)[0];
  7684. };
  7685. var self = this;
  7686. this._dependentAccessor = function(data) {
  7687. if (self._isStacked) {
  7688. return + ((data)[1]) + + ((data)[2]);
  7689. }
  7690. return (data)[1];
  7691. };
  7692. this._dependentY0Accessor = function(data) {
  7693. return (data)[2];
  7694. };
  7695. this._definedAccessor = function(data) {
  7696. return ((data)[1] != null) && ((data)[0] != null);
  7697. };
  7698. this._independentScale = null;
  7699. this._dependentScale = null;
  7700. this._colorPalette = null;
  7701. this._borderColor = null;
  7702. this._borderWidth = null;
  7703. this._transpose = false;
  7704. this._effect = null;
  7705. this._interpolateMode = null;
  7706. this._previousInterpolateMode = null;
  7707. this._areaOpacity = 1.0;
  7708. },
  7709. /** @expose */
  7710. type : function() {
  7711. return com_ibm_rave_bundles_component_AreaComponent.COMPONENT_TYPE;
  7712. },
  7713. /** @expose */
  7714. execute : function(g) {
  7715. this.preExecute();
  7716. if (!this._data || !this._pointsAccessor || !this._independentAccessor || !this._independentScale || !this._dependentAccessor || !this._dependentScale) {
  7717. g.selectAll("*").remove();
  7718. return;
  7719. }
  7720. var self = this;
  7721. var independent = function(data, index, groupIndex) {
  7722. return self._independentScale.center(self._independentAccessor(data));
  7723. };
  7724. var dependent = function(data, index, groupIndex) {
  7725. return self._dependentScale.center(self._dependentAccessor(data));
  7726. };
  7727. var baselineStacked = function(data, index, groupIndex) {
  7728. return self._dependentScale.center(self._dependentY0Accessor(data));
  7729. };
  7730. var baselineSimple = function(data, index, groupIndex) {
  7731. return self._dependentScale.center(0);
  7732. };
  7733. var definedAccessorY = function(data, index, groupIndex) {
  7734. return (self._definedAccessor(data));
  7735. };
  7736. var area = rave.svg.area();
  7737. if (this._transpose) {
  7738. area.x1(dependent).y(independent).x0(this._isStacked ? baselineStacked : baselineSimple);
  7739. } else {
  7740. area.x(independent).y1(dependent).y0(this._isStacked ? baselineStacked : baselineSimple);
  7741. }
  7742. area.defined(definedAccessorY);
  7743. area.interpolate(this._interpolateMode);
  7744. var areaFunction = function(d, index, groupIndex) {
  7745. return area.call(this, self._pointsAccessor(d));
  7746. };
  7747. var areas = g.selectAll("path.element-shape").data(this._data, function(data, index, groupIndex) {
  7748. return self._groupAccessor(data);
  7749. });
  7750. areas.exit().remove();
  7751. var enter = areas.enter();
  7752. enter = enter.insert("path", "path").attr("class", "element-shape").style("fill", this._colorPalette).style("stroke", this._borderColor != null ? this._borderColor : this._colorPalette).style("stroke-width", this._borderWidth != null ? this._borderWidth : "0px");
  7753. if ("fromBase" == this._effect) {
  7754. var dependentZero = function(data, index, groupIndex) {
  7755. return self._dependentScale.center(0.0);
  7756. };
  7757. var areaEnter = rave.svg.area();
  7758. if (this._transpose) {
  7759. areaEnter.x1(dependentZero).y(independent).x0(dependentZero);
  7760. } else {
  7761. areaEnter.x(independent).y1(dependentZero).y0(dependentZero);
  7762. }
  7763. areaEnter.defined(definedAccessorY);
  7764. areaEnter.interpolate(this._interpolateMode);
  7765. enter.attr("d", function(d, index, groupIndex) {
  7766. return areaEnter.call(this, self._pointsAccessor(d));
  7767. });
  7768. } else {
  7769. enter.attr("d", areaFunction);
  7770. }
  7771. var areasUpdate = rave.transition(areas).style("fill", this._colorPalette).style("opacity", this._areaOpacity);
  7772. this.updateBorder(areasUpdate, this._borderWidth, this._borderColor);
  7773. this.updatePath(areasUpdate, areaFunction);
  7774. this._effect = null;
  7775. },
  7776. /**
  7777. * @param (java.lang.Object[]) data The new data
  7778. */
  7779. /** @expose */
  7780. data : function(data) {
  7781. this._data = data;
  7782. return this;
  7783. },
  7784. /**
  7785. * @param (rave['internal']['SingleValueFunction']) pointsAccessor The new pointsAccessor
  7786. */
  7787. /** @expose */
  7788. pointsAccessor : function(pointsAccessor) {
  7789. this._pointsAccessor = pointsAccessor;
  7790. return this;
  7791. },
  7792. /**
  7793. * @param (rave['internal']['SingleValueFunction']) groupAccessor The new accessor for the groups
  7794. */
  7795. /** @expose */
  7796. groupAccessor : function(groupAccessor) {
  7797. this._groupAccessor = groupAccessor;
  7798. return this;
  7799. },
  7800. /**
  7801. * @param (rave['internal']['SingleValueFunction']) independentAccessor The new independent accessor
  7802. */
  7803. /** @expose */
  7804. independentAccessor : function(independentAccessor) {
  7805. this._independentAccessor = independentAccessor;
  7806. return this;
  7807. },
  7808. /**
  7809. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
  7810. */
  7811. /** @expose */
  7812. independentScale : function(independentScale) {
  7813. this._independentScale = independentScale;
  7814. return this;
  7815. },
  7816. /**
  7817. * @param (rave['internal']['SingleValueFunction']) dependentAccessor The new dependent accessor
  7818. */
  7819. /** @expose */
  7820. dependentAccessor : function(dependentAccessor) {
  7821. this._dependentAccessor = dependentAccessor;
  7822. return this;
  7823. },
  7824. /**
  7825. * @param (rave['internal']['SingleValueFunction']) dependentY0Accessor The new dependent accessor for the Y0 (baseline) value
  7826. */
  7827. /** @expose */
  7828. dependentY0Accessor : function(dependentY0Accessor) {
  7829. this._dependentY0Accessor = dependentY0Accessor;
  7830. return this;
  7831. },
  7832. /**
  7833. * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
  7834. */
  7835. /** @expose */
  7836. dependentScale : function(dependentScale) {
  7837. this._dependentScale = dependentScale;
  7838. return this;
  7839. },
  7840. /**
  7841. * @param (rave['internal']['SingleValueFunction']) definedAccessor The new defined accessor
  7842. */
  7843. /** @expose */
  7844. definedAccessor : function(definedAccessor) {
  7845. this._definedAccessor = definedAccessor;
  7846. return this;
  7847. },
  7848. /**
  7849. * @param (rave['library']['internal']['Palette']) colorPalette The new color palette
  7850. */
  7851. /** @expose */
  7852. colorPalette : function(colorPalette) {
  7853. this._colorPalette = colorPalette;
  7854. return this;
  7855. },
  7856. /** @expose */
  7857. borderColor : function(borderColor) {
  7858. this._borderColor = borderColor;
  7859. return this;
  7860. },
  7861. /** @expose */
  7862. borderWidth : function(borderWidth) {
  7863. this._borderWidth = borderWidth;
  7864. return this;
  7865. },
  7866. /** @expose */
  7867. chartOpacity : function(opacity) {
  7868. this._areaOpacity = opacity;
  7869. return this;
  7870. },
  7871. /**
  7872. * @param (boolean) transpose The new transpose
  7873. */
  7874. /** @expose */
  7875. transpose : function(transpose) {
  7876. this._transpose = transpose;
  7877. return this;
  7878. },
  7879. /**
  7880. * @param (String) effect The new effect
  7881. */
  7882. /** @expose */
  7883. effect : function(effect) {
  7884. this._effect = effect;
  7885. return this;
  7886. },
  7887. /**
  7888. * @param (boolean) stacked Is the area chart simple or a stacked variation?
  7889. */
  7890. /** @expose */
  7891. stack : function(stacked) {
  7892. this._isStacked = stacked;
  7893. return this;
  7894. },
  7895. /**
  7896. * @param (String) mode sets the interpolation mode that makes the line of the area chart smooth or jagged.
  7897. */
  7898. /** @expose */
  7899. interpolate : function(mode) {
  7900. this._interpolateMode = mode;
  7901. return this;
  7902. }
  7903. });
  7904. })();
  7905. },{"./configuration/configuration.json":1,"./i18n/messages_en.json":2,"./vizlibrary-area.css":4,"./vizlibrary.css":5}],4:[function(require,module,exports){
  7906. var css = ".vizlibrary-area .element-group {\n fill: #ccc;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-area/node/rave-library-area/vizlibrary-area.css"})); module.exports = css;
  7907. },{"browserify-css":6}],5:[function(require,module,exports){
  7908. 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-area/node/rave-library-area/vizlibrary.css"})); module.exports = css;
  7909. },{"browserify-css":6}],6:[function(require,module,exports){
  7910. 'use strict';
  7911. // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
  7912. module.exports = {
  7913. // Create a <link> tag with optional data attributes
  7914. createLink: function(href, attributes) {
  7915. var head = document.head || document.getElementsByTagName('head')[0];
  7916. var link = document.createElement('link');
  7917. link.href = href;
  7918. link.rel = 'stylesheet';
  7919. for (var key in attributes) {
  7920. if ( ! attributes.hasOwnProperty(key)) {
  7921. continue;
  7922. }
  7923. var value = attributes[key];
  7924. link.setAttribute('data-' + key, value);
  7925. }
  7926. head.appendChild(link);
  7927. },
  7928. // Create a <style> tag with optional data attributes
  7929. createStyle: function(cssText, attributes) {
  7930. var head = document.head || document.getElementsByTagName('head')[0],
  7931. style = document.createElement('style');
  7932. style.type = 'text/css';
  7933. for (var key in attributes) {
  7934. if ( ! attributes.hasOwnProperty(key)) {
  7935. continue;
  7936. }
  7937. var value = attributes[key];
  7938. style.setAttribute('data-' + key, value);
  7939. }
  7940. if (style.sheet) { // for jsdom and IE9+
  7941. style.innerHTML = cssText;
  7942. style.sheet.cssText = cssText;
  7943. head.appendChild(style);
  7944. } else if (style.styleSheet) { // for IE8 and below
  7945. head.appendChild(style);
  7946. style.styleSheet.cssText = cssText;
  7947. } else { // for Chrome, Firefox, and Safari
  7948. style.appendChild(document.createTextNode(cssText));
  7949. head.appendChild(style);
  7950. }
  7951. }
  7952. };
  7953. },{}]},{},[3]);
  7954. return rave.library.bundle.extension('areaBundle');
  7955. }));