rave-library-composite.js 512 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631
  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.raveLibraryComposite = 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_composite_small.png","tags":["small","notext"]}],"svg":[{"file":"resources\/preview_composite_small.svg","tags":["small","notext"]}]},"genericMeta":{"copyright":"IBM 2015, 2016","author":"IBM","description":"composite.description","id":"rave-library-composite","label":"composite.label","version":"1.0.0","tags":["composite"]}},{"defaultModel":"tabular","datamodels":[{"description":"datamodel.simple.description","id":"simple","label":"datamodel.simple.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/x_axis_32.png","svg":"..\/rave-library\/resources\/x_axis_32.svg"},"description":"dataslot.x.composite.description","id":"x","label":"dataslot.x.label","cardinality":"1","datatypes":["numeric","string","date"],"tags":["ca.dashboard.defaultSort=ascending"]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.yLine.composite.description","id":"yLine","label":"dataslot.yLine.label","cardinality":"1","datatypes":["numeric"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.yColumn.composite.description","id":"y","label":"dataslot.yColumn.label","cardinality":"1","datatypes":["numeric"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.yStart.composite.description","id":"yStart","label":"dataslot.yStart.composite.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/color_by_32.png","svg":"..\/rave-library\/resources\/color_by_32.svg"},"description":"dataslot.color.composite.description","id":"color","label":"dataslot.color.label","cardinality":"0..1","datatypes":["string","numeric"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/label_32.png","svg":"..\/rave-library\/resources\/label_32.svg"},"description":"dataslost.label.composite.column.description","id":"label","label":"dataslot.label.label","cardinality":"0..1","datatypes":["string"]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.key.description","id":"key","label":"dataslot.key.label","cardinality":"0..1","datatypes":["numeric","string","date"]},{"icon":{"image":"..\/rave-library\/resources\/color_by_32.png","svg":"..\/rave-library\/resources\/color_by_32.svg"},"description":"dataslot.colorLine.composite.line.description","id":"colorLine","label":"dataslot.colorLine.label","cardinality":"0..1","datatypes":["string"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/label_32.png","svg":"..\/rave-library\/resources\/label_32.svg"},"description":"dataslot.labelLine.composite.line.description","id":"labelLine","label":"dataslot.labelLine.label","cardinality":"0..1","datatypes":["string"]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.keyLine.description","id":"keyLine","label":"dataslot.keyLine.label","cardinality":"0..1","datatypes":["numeric","string","date"]}],"description":"dataset.composite.description","id":"composite","label":"dataset.composite.label","type":"tabular","cardinality":"1"}],"tags":["column","simple","basic"]},{"description":"datamodel.tabular.composite.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.composite.description","id":"x","label":"dataslot.x.label","cardinality":"1","datatypes":["numeric","string","date"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.y.composite.description","id":"y","label":"dataslot.y.label","cardinality":"1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.yStart.composite.description","id":"yStart","label":"dataslot.yStart.composite.label","cardinality":"0..1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/color_by_32.png","svg":"..\/rave-library\/resources\/color_by_32.svg"},"description":"dataslot.color.composite.description","id":"color","label":"dataslot.color.label","cardinality":"0..1","datatypes":["string","numeric"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/label_32.png","svg":"..\/rave-library\/resources\/label_32.svg"},"description":"dataslost.label.composite.column.description","id":"label","label":"dataslot.label.label","cardinality":"0..1","datatypes":["string"]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.key.description","id":"key","label":"dataslot.key.label","cardinality":"0..1","datatypes":["numeric","string","date"]}],"description":"dataset.tabular.composite.column.description","id":"column","label":"dataset.tabular.composite.column.label","type":"tabular","cardinality":"1"},{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/x_axis_32.png","svg":"..\/rave-library\/resources\/x_axis_32.svg"},"description":"dataslot.x.composite.description","id":"x","label":"dataslot.x.label","cardinality":"1","datatypes":["numeric","string","date"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/numeric_value_32.png","svg":"..\/rave-library\/resources\/numeric_value_32.svg"},"description":"dataslot.y.composite.description","id":"y","label":"dataslot.y.label","cardinality":"1","datatypes":["numeric"]},{"icon":{"image":"..\/rave-library\/resources\/color_by_32.png","svg":"..\/rave-library\/resources\/color_by_32.svg"},"description":"dataslot.color.composite.line.description","id":"color","label":"dataslot.color.label","cardinality":"0..1","datatypes":["string"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/label_32.png","svg":"..\/rave-library\/resources\/label_32.svg"},"description":"dataslot.label.composite.line.description","id":"label","label":"dataslot.label.label","cardinality":"0..1","datatypes":["string"]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.key.description","id":"key","label":"dataslot.key.label","cardinality":"0..1","datatypes":["numeric","string","date"]}],"description":"dataset.tabular.composite.line.description","id":"line","label":"dataset.tabular.composite.line.label","type":"tabular","cardinality":"1"}],"tags":["column","simple","basic"]}]},{"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-column.element-shape, .element-point.element-shape"}],"id":"toggleSelect","label":"actions.toggleSelect.label","tags":[]},{"icon":null,"options":[],"description":"actions.zoom.description","binding":[],"id":"zoom","label":"actions.zoom.label","tags":[]}]},{"configurations":[{"dataSlots":[{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"key"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"keyLine"}],"previews":{"image":[{"file":"resources\/column_and_line_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/column_and_line_preview_320.png","tags":["medium","color"]},{"file":"resources\/column_and_line_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/column_and_line_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/column_and_line_preview_320.svg","tags":["medium","color"]},{"file":"resources\/column_and_line_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"composite.config.composite.description","id":"composite","label":"composite.config.composite.label","tags":[]},"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"legend.position","value":"bottom"},{"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":"layout.axissize.right.min","value":"5"},{"id":"layout.axissize.right.preferred","value":"30%"},{"id":"layout.axissize.right.max","value":"200"},{"id":"alignAxes","value":true}]},{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"simple","dataSetId":"composite","hidden":false,"dataSlotId":"y"},{"dataTypes":["string"],"dataModelId":"simple","dataSetId":"composite","hidden":false,"dataSlotId":"x"},{"dataTypes":["numeric"],"dataModelId":"simple","dataSetId":"composite","hidden":false,"dataSlotId":"yLine"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"label"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"key"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"color"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"labelLine"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"keyLine"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"yStart"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"colorLine"}],"previews":{"image":[{"file":"resources\/column_and_line_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/column_and_line_preview_320.png","tags":["medium","color"]},{"file":"resources\/column_and_line_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/column_and_line_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/column_and_line_preview_320.svg","tags":["medium","color"]},{"file":"resources\/column_and_line_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"composite.config.compositeSmoothOneDataSet.description","id":"compositeSmoothOneDataSet","label":"composite.config.compositeSmoothOneDataSet.label","tags":["ca.dashboard","ca.dashboard.legendPosition=true"]},"datamodels":[{"hidden":true,"id":"tabular"}],"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"lineWithPoints.interpolate","value":"cardinal"},{"id":"legend.position","value":"bottom"},{"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":"layout.axissize.right.min","value":"5"},{"id":"layout.axissize.right.preferred","value":"30%"},{"id":"layout.axissize.right.max","value":"200"},{"id":"alignAxes","value":true}]},{"dataSlots":[{"dataTypes":["numeric"],"dataModelId":"simple","dataSetId":"composite","hidden":false,"dataSlotId":"y","tags":["ca.chart.definition.supportsRange=true"]},{"dataTypes":["string"],"dataModelId":"simple","dataSetId":"composite","hidden":false,"dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["numeric"],"dataModelId":"simple","dataSetId":"composite","hidden":false,"dataSlotId":"yLine","tags":["ca.chart.definition.supportsRange=true"]},{"dataTypes":["string"],"dataModelId":"simple","dataSetId":"composite","hidden":false,"dataSlotId":"colorLine","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"label"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"key"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"color"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"labelLine"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"keyLine"},{"dataModelId":"simple","dataSetId":"composite","hidden":true,"dataSlotId":"yStart"}],"previews":{"image":[{"file":"resources\/column_and_line_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/column_and_line_preview_320.png","tags":["medium","color"]},{"file":"resources\/column_and_line_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/column_and_line_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/column_and_line_preview_320.svg","tags":["medium","color"]},{"file":"resources\/column_and_line_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"composite.config.compositeOneDataSet.description","id":"compositeOneDataSet","label":"composite.config.compositeOneDataSet.label","tags":["ca.reporting"]},"datamodels":[{"hidden":true,"id":"tabular"}],"properties":[{"id":"effect.duration","value":500},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"legend.position","value":"bottom"},{"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":"layout.axissize.right.min","value":"5"},{"id":"layout.axissize.right.preferred","value":"30%"},{"id":"layout.axissize.right.max","value":"200"},{"id":"alignAxes","value":true},{"id":"data.handling","value":"Stacked"}]}]},{"properties":{"alignAxes":{"trueLabel":"alignAxes.trueLabel","default":false,"falseLabel":"alignAxes.falseLabel","resetView":"data","name":"alignAxes.name","description":"alignAxes.description","type":"boolean"},"label.shadow":{"default":false,"resetView":"layout","name":"label.shadow.name","description":"label.shadow.description","type":"boolean"},"data":{"type":"object","properties":{"handling":{"default":"None","resetView":"data","name":"data.handling.name","options":[{"id":"data.handling.options.None","value":"None"},{"id":"data.handling.options.Clustered","value":"Clustered"},{"id":"data.handling.options.Stacked","value":"Stacked"},{"id":"data.handling.options.Stacked100","value":"Stacked100"}],"description":"data.handling.description","type":"string"}}},"color":{"type":"object","properties":{"null":{"default":"silver","name":"color.null.name","description":"color.null.description","type":"color"},"palette":{"type":"object","properties":{"line":{"resetView":"layout","name":"color.palette.line.name","options":["categorical"],"description":"color.palette.line.description","type":"palette"},"column":{"resetView":"layout","name":"color.palette.column.name","options":["categorical","continuous"],"description":"color.palette.column.description","type":"palette"}}}}},"legend":{"type":"object","properties":{"line":{"type":"object","properties":{"display":{"trueLabel":"composite.trueLabel.lineLegend","default":true,"falseLabel":"composite.falseLabel.lineLegend","resetView":"layout","name":"legend.line.display.name","description":"legend.line.display.description","type":"boolean"},"entrystyle":{"type":"object","properties":{"font":{"default":null,"name":"legend.line.entrystyle.font.name","description":"legend.line.entrystyle.font.description","type":"font"}}},"title":{"name":"legend.line.title.name","description":"legend.line.title.description","type":"string"},"titlestyle":{"type":"object","properties":{"fontfamily":{"default":null,"name":"legend.line.titlestyle.fontfamily.name","description":"legend.line.titlestyle.fontfamily.description","type":"string"},"fontsize":{"default":null,"name":"legend.line.titlestyle.fontsize.name","description":"legend.line.titlestyle.fontsize.description","type":"string"},"fill":{"default":null,"name":"legend.line.titlestyle.fill.name","description":"legend.line.titlestyle.fill.description","type":"color"},"font":{"default":null,"name":"legend.line.titlestyle.font.name","description":"legend.line.titlestyle.font.description","type":"font"}}}}},"column":{"type":"object","properties":{"display":{"trueLabel":"composite.trueLabel.columnLegend","default":true,"falseLabel":"composite.falseLabel.columnLegend","resetView":"layout","name":"legend.column.display.name","description":"legend.column.display.description","type":"boolean"},"entrystyle":{"type":"object","properties":{"font":{"default":null,"name":"legend.column.entrystyle.font.name","description":"legend.column.entrystyle.font.description","type":"font"}}},"title":{"name":"legend.column.title.name","description":"legend.column.title.description","type":"string"},"titlestyle":{"type":"object","properties":{"fontfamily":{"default":null,"name":"legend.column.titlestyle.fontfamily.name","description":"legend.column.titlestyle.fontfamily.description","type":"string"},"fontsize":{"default":null,"name":"legend.column.titlestyle.fontsize.name","description":"legend.column.titlestyle.fontsize.description","type":"string"},"fill":{"default":null,"name":"legend.column.titlestyle.fill.name","description":"legend.column.titlestyle.fill.description","type":"color"},"font":{"default":null,"name":"legend.column.titlestyle.font.name","description":"legend.column.titlestyle.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.left","value":"left"},{"id":"legend.position.options.right","value":"right"}],"description":"legend.position.description","type":"string"}}},"labelResolution":{"default":"none","name":"labelResolution.name","options":[{"id":"labelResolution.options.none","value":"none"},{"id":"labelResolution.options.MoveLabels","value":"Move Labels"},{"id":"labelResolution.options.DropLabels","value":"Drop Labels"}],"description":"labelResolution.description","type":"string"},"column":{"type":"object","properties":{"borderColor":{"default":"black","name":"column.borderColor.name","description":"column.borderColor.description","type":"color"},"size":{"default":"10px","resetView":"layout","name":"column.size.name","description":"column.size.description","type":"length"},"borderWidth":{"default":"0px","name":"column.borderWidth.name","description":"column.borderWidth.description","type":"length"},"applysize":{"trueLabel":"composite.trueLabel.applySize","default":false,"falseLabel":"composite.falseLabel.applySize","resetView":"layout","name":"column.applysize.name","description":"column.applysize.description","type":"boolean"}}},"zoom":{"default":"all","resetView":"zoom","name":"zoom.name","options":[{"id":"zoom.options.all","value":"all"},{"id":"zoom.options.x","value":"x"},{"id":"zoom.options.y","value":"y"},{"id":"zoom.options.y2","value":"y2"},{"id":"zoom.options.none","value":"none"}],"description":"zoom.description","type":"string"},"itemLabel":{"trueLabel":"composite.trueLabel.itemLabel","default":true,"falseLabel":"composite.falseLabel.itemLabel","name":"item.label.name","description":"item.label.description","type":"boolean"},"sortX":{"trueLabel":"composite.trueLabel.sortX","default":true,"falseLabel":"composite.falseLabel.sortX","resetView":"data","name":"sortX.name","description":"sortX.description","type":"boolean"},"labelstyle":{"type":"object","properties":{"font":{"default":null,"name":"labelstyle.font.name","description":"labelstyle.font.description","type":"string"}}},"effect":{"type":"object","properties":{"duration":{"default":1000,"min":0,"name":"effect.duration.name","description":"effect.duration.description","type":"numeric"},"delay":{"trueLabel":"composite.trueLabel.delay","default":true,"falseLabel":"composite.falseLabel.delay","name":"effect.delay.name","description":"effect.delay.description","type":"boolean"},"name":{"default":"transition","name":"effect.name.name","options":[{"id":"effect.name.options.transition","value":"transition"},{"id":"effect.name.options.none","value":"none"}],"description":"effect.name.description","type":"string"}}},"contrast":{"type":"object","properties":{"label":{"type":"object","properties":{"color":{"default":false,"resetView":"layout","name":"contrast.label.color.name","description":"contrast.label.color.description","type":"boolean"}}}}},"lineWithPoints":{"type":"object","properties":{"symbol":{"default":"donutPlus","resetView":"layout","name":"lineWithPoints.symbol.name","options":[{"id":"lineWithPoints.symbol.options.circle","value":"circle"},{"id":"lineWithPoints.symbol.options.cross","value":"cross"},{"id":"lineWithPoints.symbol.options.diamond","value":"diamond"},{"id":"lineWithPoints.symbol.options.square","value":"square"},{"id":"lineWithPoints.symbol.options.triangle-down","value":"triangle-down"},{"id":"lineWithPoints.symbol.options.triangle-up","value":"triangle-up"},{"id":"lineWithPoints.symbol.options.horizontal-rectangle","value":"horizontal-rectangle"},{"id":"lineWithPoints.symbol.options.vertical-rectangle","value":"vertical-rectangle"},{"id":"lineWithPoints.symbol.options.triangle-left","value":"triangle-left"},{"id":"lineWithPoints.symbol.options.triangle-right","value":"triangle-right"},{"id":"lineWithPoints.symbol.options.star","value":"star"},{"id":"lineWithPoints.symbol.options.donut","value":"donut"},{"id":"lineWithPoints.symbol.options.donut-plus","value":"donutPlus"}],"description":"lineWithPoints.symbol.description","type":"string"},"showMissingAsGap":{"default":"true","name":"lineWithPoints.showMissingAsGap.name","description":"lineWithPoints.showMissingAsGap.description","type":"boolean"},"size":{"default":"100","resetView":"layout","name":"lineWithPoints.size.name","description":"lineWithPoints.size.description","type":"string"},"display":{"default":"line_points","resetView":"layout","name":"lineWithPoints.display.name","options":[{"id":"lineWithPoints.display.options.linePoints","value":"line_points"},{"id":"lineWithPoints.display.options.line","value":"line"},{"id":"lineWithPoints.display.options.points","value":"points"}],"description":"lineWithPoints.display.description","type":"string"},"interpolate":{"default":"linear","name":"lineWithPoints.interpolate.name","options":[{"id":"lineWithPoints.interpolate.options.linear","value":"linear"},{"id":"lineWithPoints.interpolate.options.step","value":"step"},{"id":"lineWithPoints.interpolate.options.step-before","value":"step-before"},{"id":"lineWithPoints.interpolate.options.step-after","value":"step-after"},{"id":"lineWithPoints.interpolate.options.basis","value":"basis"},{"id":"lineWithPoints.interpolate.options.basis-open","value":"basis-open"},{"id":"lineWithPoints.interpolate.options.cardinal","value":"cardinal"},{"id":"lineWithPoints.interpolate.options.cardinal-open","value":"cardinal-open"},{"id":"lineWithPoints.interpolate.options.monotone","value":"monotone"}],"description":"lineWithPoints.interpolate.description","type":"string"}}},"swapLineColumn":{"trueLabel":"swapLineColumn.trueLabel","default":false,"falseLabel":"swapLineColumn.falseLabel","name":"swapLineColumn.name","description":"swapLineColumn.description","type":"boolean"}}},{"properties":{"axis":{"type":"object","properties":{"labels":{"type":"object","properties":{"truncationText":{"default":"...","name":"axis.labels.truncationText.name","description":"axis.labels.truncationText.description","type":"string"}}}}}}},{"properties":{"layout":{"type":"object","properties":{"axissize":{"type":"object","properties":{"top":{"type":"object","properties":{"min":{"default":"55","resetView":"layout","name":"layout.axissize.top.min.name","description":"layout.axissize.top.min.description","type":"length"},"max":{"default":"55","resetView":"layout","name":"layout.axissize.top.max.name","description":"layout.axissize.top.max.description","type":"length"},"preferred":{"default":"55","resetView":"layout","name":"layout.axissize.top.preferred.name","description":"layout.axissize.top.preferred.description","type":"length"}}}}}}}}},{"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":{"axissize":{"type":"object","properties":{"right":{"type":"object","properties":{"min":{"default":"65","resetView":"layout","name":"layout.axissize.right.min.name","description":"layout.axissize.right.min.description","type":"length"},"max":{"default":"65","resetView":"layout","name":"layout.axissize.right.max.name","description":"layout.axissize.right.max.description","type":"length"},"preferred":{"default":"65","resetView":"layout","name":"layout.axissize.right.preferred.name","description":"layout.axissize.right.preferred.description","type":"length"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"labels":{"type":"object","properties":{"truncationText":{"default":"...","name":"axis.labels.truncationText.name","description":"axis.labels.truncationText.description","type":"string"}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.x.ticks.display.trueLabel","default":false,"falseLabel":"axis.x.ticks.display.falseLabel","name":"axis.x.ticks.display.name","description":"axis.x.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.ticks.style.stroke.name","description":"axis.x.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.x.line.display.trueLabel","default":false,"falseLabel":"axis.x.line.display.falseLabel","name":"axis.x.line.display.name","description":"axis.x.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.line.style.stroke.name","description":"axis.x.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.x.labels.display.trueLabel","default":true,"falseLabel":"axis.x.labels.display.falseLabel","resetView":"layout","name":"axis.x.labels.display.name","description":"axis.x.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.labels.style.font-size.name","description":"axis.x.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.labels.style.font-family.name","description":"axis.x.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.x.labels.style.fill.name","description":"axis.x.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.labels.style.font.name","description":"axis.x.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.x.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.x.labels.zoomPan.falseLabel","name":"axis.x.labels.zoomPan.name","description":"axis.x.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.x.title.display.trueLabel","default":true,"falseLabel":"axis.x.title.display.falseLabel","resetView":"layout","name":"axis.x.title.display.name","description":"axis.x.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.title.style.font-size.name","description":"axis.x.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.title.style.font-family.name","description":"axis.x.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.x.title.style.fill.name","description":"axis.x.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.title.style.font.name","description":"axis.x.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.x.title.text.name","description":"axis.x.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.x.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.x.scale.includeZero.falseLabel","resetView":"layout","name":"axis.x.scale.includeZero.name","description":"axis.x.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.x.scale.nice.trueLabel","default":false,"falseLabel":"axis.x.scale.nice.falseLabel","resetView":"layout","name":"axis.x.scale.nice.name","description":"axis.x.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"labels":{"type":"object","properties":{"allowRotate90":{"trueLabel":"axis.x.labels.allowRotate90.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate90.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate90.name","description":"axis.x.labels.allowRotate90.description","type":"boolean"},"layoutMode":{"default":"automatic","resetView":"layout","name":"axis.x.labels.layoutMode.name","options":[{"id":"axis.x.labels.layoutMode.options.automatic","value":"automatic"},{"id":"axis.x.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.x.labels.layoutMode.options.stagger","value":"stagger"},{"id":"axis.x.labels.layoutMode.options.rotate45","value":"rotate45"},{"id":"axis.x.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.x.labels.layoutMode.description","type":"string"},"allowRotate45":{"trueLabel":"axis.x.labels.allowRotate45.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate45.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate45.name","description":"axis.x.labels.allowRotate45.description","type":"boolean"},"allowStagger":{"trueLabel":"axis.x.labels.allowStagger.trueLabel","default":true,"falseLabel":"axis.x.labels.allowStagger.falseLabel","resetView":"layout","name":"axis.x.labels.allowStagger.name","description":"axis.x.labels.allowStagger.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.x.gridlines.display.trueLabel","default":false,"falseLabel":"axis.x.gridlines.display.falseLabel","name":"axis.x.gridlines.display.name","description":"axis.x.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.x.gridlines.style.stroke-dasharray.name","description":"axis.x.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.x.gridlines.style.stroke.name","description":"axis.x.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.y.ticks.display.trueLabel","default":false,"falseLabel":"axis.y.ticks.display.falseLabel","name":"axis.y.ticks.display.name","description":"axis.y.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.ticks.style.stroke.name","description":"axis.y.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.y.line.display.trueLabel","default":false,"falseLabel":"axis.y.line.display.falseLabel","name":"axis.y.line.display.name","description":"axis.y.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.line.style.stroke.name","description":"axis.y.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.y.labels.display.trueLabel","default":true,"falseLabel":"axis.y.labels.display.falseLabel","resetView":"layout","name":"axis.y.labels.display.name","description":"axis.y.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.labels.style.font-size.name","description":"axis.y.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.labels.style.font-family.name","description":"axis.y.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.y.labels.style.fill.name","description":"axis.y.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.labels.style.font.name","description":"axis.y.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.y.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.y.labels.zoomPan.falseLabel","name":"axis.y.labels.zoomPan.name","description":"axis.y.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.y.title.display.trueLabel","default":true,"falseLabel":"axis.y.title.display.falseLabel","resetView":"layout","name":"axis.y.title.display.name","description":"axis.y.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.title.style.font-size.name","description":"axis.y.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.title.style.font-family.name","description":"axis.y.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.y.title.style.fill.name","description":"axis.y.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.title.style.font.name","description":"axis.y.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.y.title.text.name","description":"axis.y.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.y.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.y.scale.includeZero.falseLabel","resetView":"layout","name":"axis.y.scale.includeZero.name","description":"axis.y.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.y.scale.nice.trueLabel","default":false,"falseLabel":"axis.y.scale.nice.falseLabel","resetView":"layout","name":"axis.y.scale.nice.name","description":"axis.y.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"labels":{"type":"object","properties":{"layoutMode":{"default":"horizontal","resetView":"layout","name":"axis.y.labels.layoutMode.name","options":[{"id":"axis.y.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.y.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.y.labels.layoutMode.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.y.gridlines.display.trueLabel","default":true,"falseLabel":"axis.y.gridlines.display.falseLabel","name":"axis.y.gridlines.display.name","description":"axis.y.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.y.gridlines.style.stroke-dasharray.name","description":"axis.y.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.y.gridlines.style.stroke.name","description":"axis.y.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y2":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.y2.ticks.display.trueLabel","default":false,"falseLabel":"axis.y2.ticks.display.falseLabel","name":"axis.y2.ticks.display.name","description":"axis.y2.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y2.ticks.style.stroke.name","description":"axis.y2.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.y2.line.display.trueLabel","default":false,"falseLabel":"axis.y2.line.display.falseLabel","name":"axis.y2.line.display.name","description":"axis.y2.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y2.line.style.stroke.name","description":"axis.y2.line.style.stroke.description","type":"color"}}}}},"title":{"type":"object","properties":{"display":{"trueLabel":"axis.y2.title.display.trueLabel","default":true,"falseLabel":"axis.y2.title.display.falseLabel","resetView":"layout","name":"axis.y2.title.display.name","description":"axis.y2.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y2.title.style.font-size.name","description":"axis.y2.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y2.title.style.font-family.name","description":"axis.y2.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.y2.title.style.fill.name","description":"axis.y2.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y2.title.style.font.name","description":"axis.y2.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.y2.title.text.name","description":"axis.y2.title.text.description","type":"string"}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.y2.labels.display.trueLabel","default":true,"falseLabel":"axis.y2.labels.display.falseLabel","resetView":"layout","name":"axis.y2.labels.display.name","description":"axis.y2.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y2.labels.style.font-size.name","description":"axis.y2.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y2.labels.style.font-family.name","description":"axis.y2.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.y2.labels.style.fill.name","description":"axis.y2.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y2.labels.style.font.name","description":"axis.y2.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.y2.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.y2.labels.zoomPan.falseLabel","name":"axis.y2.labels.zoomPan.name","description":"axis.y2.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y2":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.y2.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.y2.scale.includeZero.falseLabel","resetView":"layout","name":"axis.y2.scale.includeZero.name","description":"axis.y2.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.y2.scale.nice.trueLabel","default":false,"falseLabel":"axis.y2.scale.nice.falseLabel","resetView":"layout","name":"axis.y2.scale.nice.name","description":"axis.y2.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y2":{"type":"object","properties":{"labels":{"type":"object","properties":{"layoutMode":{"default":"horizontal","resetView":"layout","name":"axis.y2.labels.layoutMode.name","options":[{"id":"axis.y2.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.y2.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.y2.labels.layoutMode.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y2":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.y2.gridlines.display.trueLabel","default":true,"falseLabel":"axis.y2.gridlines.display.falseLabel","name":"axis.y2.gridlines.display.name","description":"axis.y2.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.y2.gridlines.style.stroke-dasharray.name","description":"axis.y2.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.y2.gridlines.style.stroke.name","description":"axis.y2.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"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":{"transpose":{"trueLabel":"transpose.trueLabel","default":false,"falseLabel":"transpose.falseLabel","resetView":"layout","name":"transpose.name","description":"transpose.description","type":"boolean"}}},{"properties":{"data":{"type":"object","properties":{"label":{"type":"object","properties":{"display":{"default":false,"resetView":"layout","name":"data.label.display.name","description":"data.label.display.description","type":"boolean"},"type":{"default":"Value","resetView":"layout","name":"data.label.type.name","options":[{"id":"data.label.type.options.value","value":"Value"},{"id":"data.label.type.options.percentByCategory","value":"PercentOfCategory"},{"id":"data.label.type.options.percentByColor","value":"PercentOfColor"}],"description":"data.label.type.description","type":"string"}}}}}}},{"properties":{"background":{"type":"object","properties":{"elements":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.elements.color.name","description":"background.elements.color.description","type":"color"}}},"chart":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.chart.color.name","description":"background.chart.color.description","type":"color"}}}}}}},{"properties":{"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"}}}}},"y2":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.y2.scale.includeZero.trueLabel","default":true,"falseLabel":"axis.y2.scale.includeZero.falseLabel","resetView":"layout","name":"axis.y2.scale.includeZero.name","description":"axis.y2.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.y2.scale.nice.trueLabel","default":true,"falseLabel":"axis.y2.scale.nice.falseLabel","resetView":"layout","name":"axis.y2.scale.nice.name","description":"axis.y2.scale.nice.description","type":"boolean"}}}}}}}}},{"propertyPresentations":[{"presentationItems":[{"propertyID":"color.palette.column"},{"propertyID":"color.palette.line"},{"propertyID":"axis.x.title.display"},{"propertyID":"axis.y.title.display"},{"propertyID":"legend.column.display"},{"propertyID":"legend.line.display"},{"propertyID":"legend.position"},{"propertyID":"lineWithPoints.interpolate"},{"propertyID":"lineWithPoints.symbol"}],"icon":"","description":"propertyPresentation.simple.description","id":"simple","label":"propertyPresentation.simple.label","tags":["Composite","Composite Properties Presentation","Simple","ca.dashboard"]},{"presentationItems":[{"propertyGroup":{"presentationItems":[{"propertyID":"background.chart.color"},{"propertyID":"background.elements.color"},{"propertyID":"color.palette.column"},{"propertyID":"color.palette.line"},{"propertyID":"layout.padding"}],"icon":"","description":"propertyPresentation.advanced.commonProperties.description","id":"commonProperties","label":"propertyPresentation.advanced.commonProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"sortX"},{"propertyID":"column.borderColor"},{"propertyID":"column.borderWidth"},{"propertyID":"alignAxes"},{"propertyID":"lineWithPoints.size"},{"propertyID":"lineWithPoints.display"},{"propertyID":"lineWithPoints.symbol"},{"propertyID":"lineWithPoints.showMissingAsGap"},{"propertyID":"swapLineColumn"},{"propertyID":"transpose"}],"icon":"","description":"composite.propertyPresentation.advanced.compositeSpecificProperties.description","id":"compositeSpecificProperties","label":"composite.propertyPresentation.advanced.compositeSpecificProperties.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":"axis.y2.gridlines.display"},{"propertyID":"axis.y2.gridlines.style.stroke"},{"propertyID":"axis.y2.gridlines.style.stroke-dasharray"},{"propertyID":"axis.y2.labels.display"},{"propertyID":"axis.y2.labels.style.font"},{"propertyID":"axis.y2.line.display"},{"propertyID":"axis.y2.line.style.stroke"},{"propertyID":"axis.y2.ticks.display"},{"propertyID":"axis.y2.ticks.style.stroke"},{"propertyID":"axis.y2.title.display"},{"propertyID":"axis.y2.title.style.font"},{"propertyID":"axis.y2.title.text"}],"icon":"","description":"composite.propertyPresentation.advanced.y2AxisProperties.description","id":"y2AxisProperties","label":"composite.propertyPresentation.advanced.y2AxisProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"legend.position"},{"propertyID":"legend.line.display"},{"propertyID":"legend.line.title"},{"propertyID":"legend.line.titlestyle.font"},{"propertyID":"legend.line.entrystyle.font"},{"propertyID":"legend.column.display"},{"propertyID":"legend.column.title"},{"propertyID":"legend.column.titlestyle.font"},{"propertyID":"legend.column.entrystyle.font"},{"propertyID":"layout.legendchart.gap"},{"propertyID":"layout.legendchart.align"}],"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":["Composite","Composite Properties Presentation","advanced","ca.reporting"]}]},{"build":"development","name":"rave-library-composite","description":"This is the IBM Rave composite line bar 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. "alignAxes.description": "Aligns the grid lines of dependent axes.",
  63. "alignAxes.falseLabel": "Do not align",
  64. "alignAxes.name": "Align dependent axes on grid",
  65. "alignAxes.trueLabel": "Align",
  66. "axis.labels.truncationText.description": "The text that is placed at the end of labels to indicate truncation.",
  67. "axis.labels.truncationText.name": "Axis truncation text",
  68. "axis.x.gridlines.display.description": "Shows or hides the X-axis gridlines.",
  69. "axis.x.gridlines.display.falseLabel": "Hide",
  70. "axis.x.gridlines.display.name": "Show gridlines",
  71. "axis.x.gridlines.display.trueLabel": "Show",
  72. "axis.x.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the X-axis gridlines.",
  73. "axis.x.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
  74. "axis.x.gridlines.style.stroke.description": "The color of the X-axis gridline.",
  75. "axis.x.gridlines.style.stroke.name": "Gridline color",
  76. "axis.x.labels.allowRotate45.description": "Enables or disables the rotate45 option for labels automatic layout.",
  77. "axis.x.labels.allowRotate45.falseLabel": "Disable rotate45 option",
  78. "axis.x.labels.allowRotate45.name": "Allow rotate 45",
  79. "axis.x.labels.allowRotate45.trueLabel": "Enable rotate45 option",
  80. "axis.x.labels.allowRotate90.description": "Enables or disables the rotate90 option for labels automatic layout.",
  81. "axis.x.labels.allowRotate90.falseLabel": "Disable rotate90 option",
  82. "axis.x.labels.allowRotate90.name": "Allow rotate 90",
  83. "axis.x.labels.allowRotate90.trueLabel": "Enable rotate90 option",
  84. "axis.x.labels.allowStagger.description": "Allows the stagger option for labels automatic layout.",
  85. "axis.x.labels.allowStagger.falseLabel": "X-axis do not allow stagger",
  86. "axis.x.labels.allowStagger.name": "Allow stagger",
  87. "axis.x.labels.allowStagger.trueLabel": "X-axis allow stagger",
  88. "axis.x.labels.display.description": "Shows or hides the X-axis labels.",
  89. "axis.x.labels.display.falseLabel": "Hide",
  90. "axis.x.labels.display.name": "Show labels",
  91. "axis.x.labels.display.trueLabel": "Show",
  92. "axis.x.labels.layoutMode.description": "Configure the layout mode for the X-axis labels.",
  93. "axis.x.labels.layoutMode.name": "Layout Mode",
  94. "axis.x.labels.layoutMode.options.automatic": "Automatic",
  95. "axis.x.labels.layoutMode.options.horizontal": "Horizontal",
  96. "axis.x.labels.layoutMode.options.rotate45": "Rotated 45 degrees",
  97. "axis.x.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  98. "axis.x.labels.layoutMode.options.stagger": "Stagger",
  99. "axis.x.labels.style.fill.description": "The color of X-axis labels.",
  100. "axis.x.labels.style.fill.name": "Label color",
  101. "axis.x.labels.style.font-family.description": "The font families of the X-axis labels.",
  102. "axis.x.labels.style.font-family.name": "Label font families",
  103. "axis.x.labels.style.font-size.description": "The size of X-axis labels (CSS size).",
  104. "axis.x.labels.style.font-size.name": "Label font size",
  105. "axis.x.labels.style.font.description": "The font properties of X-axis labels (CSS styles).",
  106. "axis.x.labels.style.font.name": "Label font",
  107. "axis.x.labels.zoomPan.description": "Shows or hides X-axis labels when panning and zooming.",
  108. "axis.x.labels.zoomPan.falseLabel": "Show",
  109. "axis.x.labels.zoomPan.name": "Label pan-zoom",
  110. "axis.x.labels.zoomPan.trueLabel": "Hide",
  111. "axis.x.line.display.description": "Shows or hides the X-axis line.",
  112. "axis.x.line.display.falseLabel": "Hide",
  113. "axis.x.line.display.name": "Show line",
  114. "axis.x.line.display.trueLabel": "Show",
  115. "axis.x.line.style.stroke.description": "The color of the X-axis line.",
  116. "axis.x.line.style.stroke.name": "Line color",
  117. "axis.x.scale.includeZero.description": "When set to Yes, includes 0 on the X-axis.",
  118. "axis.x.scale.includeZero.falseLabel": "Do not include",
  119. "axis.x.scale.includeZero.name": "Includes zero",
  120. "axis.x.scale.includeZero.trueLabel": "Include",
  121. "axis.x.scale.max.description": "The maximum value that appears on the X-axis.",
  122. "axis.x.scale.max.name": "Maximum value",
  123. "axis.x.scale.min.description": "The minimum value that appears on the X-axis.",
  124. "axis.x.scale.min.name": "Minimum value",
  125. "axis.x.scale.nice.description": "When set to Yes, uses nice endpoint values on the X-axis.",
  126. "axis.x.scale.nice.falseLabel": "Do not nice",
  127. "axis.x.scale.nice.name": "Nicing",
  128. "axis.x.scale.nice.trueLabel": "Apply nicing",
  129. "axis.x.ticks.display.description": "Shows or hides the X-axis tick marks.",
  130. "axis.x.ticks.display.falseLabel": "Hide",
  131. "axis.x.ticks.display.name": "Show ticks",
  132. "axis.x.ticks.display.trueLabel": "Show",
  133. "axis.x.ticks.style.stroke.description": "The color of the X-axis ticks.",
  134. "axis.x.ticks.style.stroke.name": "Tick color",
  135. "axis.x.title.display.description": "Shows or hides the X-axis title.",
  136. "axis.x.title.display.falseLabel": "Hide",
  137. "axis.x.title.display.name": "Show title",
  138. "axis.x.title.display.trueLabel": "Show",
  139. "axis.x.title.style.fill.description": "The color of the X-axis title.",
  140. "axis.x.title.style.fill.name": "Title color",
  141. "axis.x.title.style.font-family.description": "The font family names of the X-axis title.",
  142. "axis.x.title.style.font-family.name": "Title font families",
  143. "axis.x.title.style.font-size.description": "The X-axis title font size (CSS size).",
  144. "axis.x.title.style.font-size.name": "Title font size",
  145. "axis.x.title.style.font.description": "The X-axis title font properties (CSS style).",
  146. "axis.x.title.style.font.name": "Title font",
  147. "axis.x.title.text.description": "The title of the X-axis.",
  148. "axis.x.title.text.name": "Title",
  149. "axis.y.gridlines.display.description": "Shows or hides the column chart Y-axis gridlines.",
  150. "axis.y.gridlines.display.falseLabel": "Hide",
  151. "axis.y.gridlines.display.name": "Y-axis (column) show gridlines",
  152. "axis.y.gridlines.display.trueLabel": "Show",
  153. "axis.y.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the column chart Y-axis gridlines.",
  154. "axis.y.gridlines.style.stroke-dasharray.name": "Y-axis (column) gridline dash pattern",
  155. "axis.y.gridlines.style.stroke.description": "The color of the column chart Y-axis gridline.",
  156. "axis.y.gridlines.style.stroke.name": "Y-axis (column) gridline color",
  157. "axis.y.labels.display.description": "Shows or hides the column chart Y-axis labels.",
  158. "axis.y.labels.display.falseLabel": "Hide",
  159. "axis.y.labels.display.name": "Y-axis (column) show labels",
  160. "axis.y.labels.display.trueLabel": "Show",
  161. "axis.y.labels.hideOverlap.description": "Shows or hides overlapping labels on the column chart Y-axis.",
  162. "axis.y.labels.hideOverlap.falseLabel": "Do not hide",
  163. "axis.y.labels.hideOverlap.name": "Y-axis (column) hide overlapping labels",
  164. "axis.y.labels.hideOverlap.trueLabel": "Hide",
  165. "axis.y.labels.layoutMode.description": "Configure the layout mode for the Y-axis labels.",
  166. "axis.y.labels.layoutMode.name": "Layout Mode",
  167. "axis.y.labels.layoutMode.options.horizontal": "Horizontal",
  168. "axis.y.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  169. "axis.y.labels.rotation.description": "Rotates the column chart Y-axis labels.",
  170. "axis.y.labels.rotation.name": "Y-axis (column) label rotation",
  171. "axis.y.labels.style.fill.description": "The color of the column chart Y-axis labels.",
  172. "axis.y.labels.style.fill.name": "Y-axis (column) label color",
  173. "axis.y.labels.style.font-family.description": "The font families of the column chart Y-axis labels.",
  174. "axis.y.labels.style.font-family.name": "Y-axis (column) label font families",
  175. "axis.y.labels.style.font-size.description": "The size of the column chart Y-axis labels (CSS size).",
  176. "axis.y.labels.style.font-size.name": "Y-axis (column) label font size",
  177. "axis.y.labels.style.font.description": "The font properties of the column chart Y-axis labels (CSS styles).",
  178. "axis.y.labels.style.font.name": "Y-axis (column) label font",
  179. "axis.y.labels.style.text-anchor.description": "The text anchor position of the column chart Y-axis labels.",
  180. "axis.y.labels.style.text-anchor.name": "Y-axis (column) label text anchor",
  181. "axis.y.labels.style.text-anchor.options.end": "End",
  182. "axis.y.labels.style.text-anchor.options.middle": "Middle",
  183. "axis.y.labels.style.text-anchor.options.start": "Start",
  184. "axis.y.labels.wrap.description": "Enables or disables label wrapping on the column chart Y-axis.",
  185. "axis.y.labels.wrap.falseLabel": "Do not wrap",
  186. "axis.y.labels.wrap.name": "Y-axis (column) label wrap",
  187. "axis.y.labels.wrap.trueLabel": "Wrap",
  188. "axis.y.labels.wrapValignment.description": "Vertically aligns the column chart Y-axis labels.",
  189. "axis.y.labels.wrapValignment.name": "Y-axis (column) wrapped label alignment",
  190. "axis.y.labels.wrapValignment.options.bottom": "Bottom",
  191. "axis.y.labels.wrapValignment.options.middle": "Middle",
  192. "axis.y.labels.wrapValignment.options.top": "Top",
  193. "axis.y.labels.zoomPan.description": "Shows or hides the column chart Y-axis labels when panning and zooming.",
  194. "axis.y.labels.zoomPan.falseLabel": "Show",
  195. "axis.y.labels.zoomPan.name": "Y-axis (column) label hide pan-zoom",
  196. "axis.y.labels.zoomPan.trueLabel": "Hide",
  197. "axis.y.line.display.description": "Shows or hides the column chart Y-axis line.",
  198. "axis.y.line.display.falseLabel": "Hide",
  199. "axis.y.line.display.name": "Y-axis (column) show line",
  200. "axis.y.line.display.trueLabel": "Show",
  201. "axis.y.line.style.stroke.description": "The color of the column chart Y-axis line.",
  202. "axis.y.line.style.stroke.name": "Y-axis (column) line color",
  203. "axis.y.scale.includeZero.description": "When set to Yes, includes 0 on the column chart Y-axis.",
  204. "axis.y.scale.includeZero.falseLabel": "Do not include",
  205. "axis.y.scale.includeZero.name": "Y-axis (column) includes zero",
  206. "axis.y.scale.includeZero.trueLabel": "Include",
  207. "axis.y.scale.max.description": "The maximum value that appears on the column chart Y-axis.",
  208. "axis.y.scale.max.name": "Y-axis (column) maximum value",
  209. "axis.y.scale.min.description": "The minimum value that appears on the column chart Y-axis.",
  210. "axis.y.scale.min.name": "Y-axis (column) minimum value",
  211. "axis.y.scale.nice.description": "When set to Yes, uses nice endpoint values on the column chart Y-axis.",
  212. "axis.y.scale.nice.falseLabel": "Do not nice",
  213. "axis.y.scale.nice.name": "Y-axis (column) nicing",
  214. "axis.y.scale.nice.trueLabel": "Apply nicing",
  215. "axis.y.ticks.display.description": "Shows or hides the column Y-axis tick marks.",
  216. "axis.y.ticks.display.falseLabel": "Hide",
  217. "axis.y.ticks.display.name": "Y-axis (column) show ticks",
  218. "axis.y.ticks.display.trueLabel": "Show",
  219. "axis.y.ticks.style.stroke.description": "The color of the column chart Y-axis ticks.",
  220. "axis.y.ticks.style.stroke.name": "Y-axis (column) tick color",
  221. "axis.y.title.display.description": "Shows or hides the column chart Y-axis title.",
  222. "axis.y.title.display.falseLabel": "Hide",
  223. "axis.y.title.display.name": "Y-axis (column) show title",
  224. "axis.y.title.display.trueLabel": "Show",
  225. "axis.y.title.style.fill.description": "The color of the column chart Y-axis title.",
  226. "axis.y.title.style.fill.name": "Y-axis (column) title color",
  227. "axis.y.title.style.font-family.description": "The font family names of the column chart Y-axis title.",
  228. "axis.y.title.style.font-family.name": "Y-axis (column) title font families",
  229. "axis.y.title.style.font-size.description": "The size of the column chart Y-axis title font (CSS size).",
  230. "axis.y.title.style.font-size.name": "Y-axis (column) title font size",
  231. "axis.y.title.style.font.description": "The font properties of the column chart Y-axis title (CSS styles).",
  232. "axis.y.title.style.font.name": "Y-axis (column) title font",
  233. "axis.y.title.text.description": "The title of the column chart Y-axis.",
  234. "axis.y.title.text.name": "Y-axis (column) title",
  235. "axis.y2.gridlines.display.description": "Shows or hides the line chart Y-axis gridlines.",
  236. "axis.y2.gridlines.display.falseLabel": "Hide",
  237. "axis.y2.gridlines.display.name": "Y-axis (line) show gridlines",
  238. "axis.y2.gridlines.display.trueLabel": "Show",
  239. "axis.y2.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the line chart Y-axis gridlines.",
  240. "axis.y2.gridlines.style.stroke-dasharray.name": "Y-axis (line) gridline dash pattern",
  241. "axis.y2.gridlines.style.stroke.description": "The color of the line chart Y-axis gridline.",
  242. "axis.y2.gridlines.style.stroke.name": "Y-axis (line) gridline color",
  243. "axis.y2.labels.display.description": "Shows or hides the line chart Y-axis labels.",
  244. "axis.y2.labels.display.falseLabel": "Hide",
  245. "axis.y2.labels.display.name": "Y-axis (line) show labels",
  246. "axis.y2.labels.display.trueLabel": "Show",
  247. "axis.y2.labels.hideOverlap.description": "Shows or hides overlapping labels on the line chart Y-axis.",
  248. "axis.y2.labels.hideOverlap.falseLabel": "Do not hide",
  249. "axis.y2.labels.hideOverlap.name": "Y-axis (line) hide overlapping labels",
  250. "axis.y2.labels.hideOverlap.trueLabel": "Hide",
  251. "axis.y2.labels.layoutMode.description": "Configure the layout mode for the Y2-axis labels.",
  252. "axis.y2.labels.layoutMode.name": "Layout Mode",
  253. "axis.y2.labels.layoutMode.options.horizontal": "Horizontal",
  254. "axis.y2.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
  255. "axis.y2.labels.rotation.description": "Rotates the line chart Y-axis labels.",
  256. "axis.y2.labels.rotation.name": "Y-axis (line) label rotation",
  257. "axis.y2.labels.style.fill.description": "The color of the line chart Y-axis labels.",
  258. "axis.y2.labels.style.fill.name": "Y-axis (line) label color",
  259. "axis.y2.labels.style.font-family.description": "The font families of the line chart Y-axis labels.",
  260. "axis.y2.labels.style.font-family.name": "Y-axis (line) label font families",
  261. "axis.y2.labels.style.font-size.description": "The size of the line chart Y-axis labels (CSS size).",
  262. "axis.y2.labels.style.font-size.name": "Y-axis (line) label font size",
  263. "axis.y2.labels.style.font.description": "The font properties of the line chart Y-axis labels (CSS styles).",
  264. "axis.y2.labels.style.font.name": "Y-axis (line) label font",
  265. "axis.y2.labels.style.text-anchor.description": "The text anchor position of the line chart Y-axis labels.",
  266. "axis.y2.labels.style.text-anchor.name": "Y-axis (line) label text anchor",
  267. "axis.y2.labels.style.text-anchor.options.end": "End",
  268. "axis.y2.labels.style.text-anchor.options.middle": "Middle",
  269. "axis.y2.labels.style.text-anchor.options.start": "Start",
  270. "axis.y2.labels.wrap.description": "Enables or disables label wrapping on the line chart Y-axis.",
  271. "axis.y2.labels.wrap.falseLabel": "Do not wrap",
  272. "axis.y2.labels.wrap.name": "Y-axis (line) label wrap",
  273. "axis.y2.labels.wrap.trueLabel": "Wrap",
  274. "axis.y2.labels.wrapValignment.description": "Vertically aligns the line chart Y-axis labels.",
  275. "axis.y2.labels.wrapValignment.name": "Y-axis (line) wrapped label alignment",
  276. "axis.y2.labels.wrapValignment.options.bottom": "Bottom",
  277. "axis.y2.labels.wrapValignment.options.middle": "Middle",
  278. "axis.y2.labels.wrapValignment.options.top": "Top",
  279. "axis.y2.labels.zoomPan.description": "Shows or hides the line chart Y-axis labels when panning and zooming.",
  280. "axis.y2.labels.zoomPan.falseLabel": "Show",
  281. "axis.y2.labels.zoomPan.name": "Y-axis (line) label hide pan-zoom",
  282. "axis.y2.labels.zoomPan.trueLabel": "Hide",
  283. "axis.y2.line.display.description": "Shows or hides the line Y-axis line.",
  284. "axis.y2.line.display.falseLabel": "Hide",
  285. "axis.y2.line.display.name": "Y-axis (line) show line",
  286. "axis.y2.line.display.trueLabel": "Show",
  287. "axis.y2.line.style.stroke.description": "The color of the line chart Y-axis line.",
  288. "axis.y2.line.style.stroke.name": "Y-axis (line) line color",
  289. "axis.y2.scale.includeZero.description": "When set to Yes, includes 0 on the line chart Y-axis.",
  290. "axis.y2.scale.includeZero.falseLabel": "Do not include",
  291. "axis.y2.scale.includeZero.name": "Y-axis (line) includes zero",
  292. "axis.y2.scale.includeZero.trueLabel": "Include",
  293. "axis.y2.scale.max.description": "The maximum value that appears on the line Y-axis",
  294. "axis.y2.scale.max.name": "Y-axis (line) maximum value",
  295. "axis.y2.scale.min.description": "The minimum value that appears on the line chart Y-axis.",
  296. "axis.y2.scale.min.name": "Y-axis (line) minimum value",
  297. "axis.y2.scale.nice.description": "When set to Yes, uses nice endpoint values on the line chart Y-axis.",
  298. "axis.y2.scale.nice.falseLabel": "Do not nice",
  299. "axis.y2.scale.nice.name": "Y-axis (line) nicing",
  300. "axis.y2.scale.nice.trueLabel": "Apply nicing",
  301. "axis.y2.ticks.display.description": "Shows or hides the line chart Y-axis tick marks.",
  302. "axis.y2.ticks.display.falseLabel": "Hide",
  303. "axis.y2.ticks.display.name": "Y-axis (line) show ticks",
  304. "axis.y2.ticks.display.trueLabel": "Show",
  305. "axis.y2.ticks.style.stroke.description": "The color of the line chart Y-axis ticks.",
  306. "axis.y2.ticks.style.stroke.name": "Y-axis (line) tick color",
  307. "axis.y2.title.display.description": "Shows or hides the line chart Y-axis title.",
  308. "axis.y2.title.display.falseLabel": "Hide",
  309. "axis.y2.title.display.name": "Y-axis (line) show title",
  310. "axis.y2.title.display.trueLabel": "Show",
  311. "axis.y2.title.style.fill.description": "The color of the line chart Y-axis title.",
  312. "axis.y2.title.style.fill.name": "Y-axis (line) title color",
  313. "axis.y2.title.style.font-family.description": "The font family names of the line chart Y-axis title.",
  314. "axis.y2.title.style.font-family.name": "Y-axis (line) title font families",
  315. "axis.y2.title.style.font-size.description": "The size of the line chart Y-axis title font (CSS size).",
  316. "axis.y2.title.style.font-size.name": "Y-axis (line) title font size",
  317. "axis.y2.title.style.font.description": "The font properties of the line chart Y-axis title (CSS styles).",
  318. "axis.y2.title.style.font.name": "Y-axis (line) title font",
  319. "axis.y2.title.text.description": "The title of the line chart Y-axis.",
  320. "axis.y2.title.text.name": "Y-axis (line) title",
  321. "background.chart.color.description": "The background color of the chart.",
  322. "background.chart.color.name": "Background color",
  323. "background.color.description": "The background color of the chart.",
  324. "background.elements.color.description": "The background color behind the elements of the chart.",
  325. "background.elements.color.name": "Elements background color",
  326. "color.null.description": "The color that is used for null values in the column chart.",
  327. "color.null.name": "Null color for columns",
  328. "color.palette.column.description": "The color palette to use for the column chart.",
  329. "color.palette.column.name": "Column color palette",
  330. "color.palette.line.description": "The color palette to use for the line chart.",
  331. "color.palette.line.name": "Line color palette",
  332. "column.applysize.description": "When set to Yes, the size of the columns is controlled by ordinal scales.",
  333. "column.applysize.name": "Apply size to ordinal columns",
  334. "column.borderColor.description": "The color of borders in the column chart.",
  335. "column.borderColor.name": "Column border color",
  336. "column.borderWidth.description": "The width of the borders in the column chart.",
  337. "column.borderWidth.name": "Column border width",
  338. "column.size.description": "The width (transposed height) of the columns when continuous data is used.",
  339. "column.size.name": "Column size",
  340. "composite.config.composite.description": "A visualization that combines the features of bar visualizations and line visualizations. Combination visualizations overlay a line chart on a column chart to plot multiple data series against one or more categories.",
  341. "composite.config.composite.label": "Advanced line and column",
  342. "composite.config.compositeOneDataSet.description": "A visualization that combines the features of bar visualizations and line visualizations. Combination visualizations overlay a line chart on a column chart.",
  343. "composite.config.compositeOneDataSet.label": "Simple line and column",
  344. "composite.config.compositeSmoothOneDataSet.description": "A visualization that combines the features of bar visualizations and line visualizations. Combination visualizations overlay a line chart on a column chart.",
  345. "composite.config.compositeSmoothOneDataSet.label": "Line and column",
  346. "composite.description": "Composite charts render a combination of a column chart and a line chart. The left axis refers to the column chart and the right axis refers to the line chart.",
  347. "composite.falseLabel.applySize": "Do not apply size",
  348. "composite.falseLabel.columnLegend": "Hide",
  349. "composite.falseLabel.delay": "No stagger",
  350. "composite.falseLabel.itemLabel": "Hide",
  351. "composite.falseLabel.lineLegend": "Hide",
  352. "composite.falseLabel.lineOnly": "Line only",
  353. "composite.falseLabel.sortX": "Do not sort lines (use data ordering)",
  354. "composite.label": "Composite",
  355. "composite.propertyPresentation.advanced.compositeSpecificProperties.description": "Composite-specific properties",
  356. "composite.propertyPresentation.advanced.compositeSpecificProperties.label": "Composite",
  357. "composite.propertyPresentation.advanced.y2AxisProperties.description": "The properties of the second Y axis.",
  358. "composite.propertyPresentation.advanced.y2AxisProperties.label": "Y2-axis",
  359. "composite.trueLabel.applySize": "Apply size",
  360. "composite.trueLabel.columnLegend": "Show",
  361. "composite.trueLabel.delay": "Use stagger",
  362. "composite.trueLabel.itemLabel": "Show",
  363. "composite.trueLabel.lineLegend": "Show",
  364. "composite.trueLabel.lineWithPoints": "Line with points",
  365. "composite.trueLabel.sortX": "Sort lines by x value",
  366. "contrast.label.color.description": "Adjust the label color to contrast with background.",
  367. "contrast.label.color.name": "Contrast label color with background",
  368. "data.handling.description": "The configuration that is used to plot the data.",
  369. "data.handling.name": "Configuration",
  370. "data.handling.options.Clustered": "Clustered",
  371. "data.handling.options.None": "None",
  372. "data.handling.options.Stacked": "Stacked",
  373. "data.handling.options.Stacked100": "Stacked 100%",
  374. "data.label.display.description": "Shows or hides data labels.",
  375. "data.label.display.name": "Data label",
  376. "data.label.type.description": "Type of data labels to display.",
  377. "data.label.type.name": "Data label type",
  378. "data.label.type.options.percentByCategory": "Percentage of category",
  379. "data.label.type.options.percentByColor": "Percentage of color (series)",
  380. "data.label.type.options.value": "Value",
  381. "datamodel.hierarchial.label": "Hierarchical data model",
  382. "datamodel.simple.description": "The data model for the simple composite chart.",
  383. "datamodel.simple.label": "Simple composite chart data model",
  384. "datamodel.tabular.composite.description": "The composite data model, providing separate column and line data sets.",
  385. "datamodel.tabular.label": "Tabular data model",
  386. "dataset.composite.description": "The data set for the composite chart.",
  387. "dataset.composite.label": "Tabular data sets - line and column",
  388. "dataset.hierarchial.label": "Hierarchical data set",
  389. "dataset.tabular.composite.column.description": "The tabular data set for the columns.",
  390. "dataset.tabular.composite.column.label": "Column tabular data set",
  391. "dataset.tabular.composite.line.description": "The tabular data set for the lines.",
  392. "dataset.tabular.composite.line.label": "Line tabular data set",
  393. "dataset.tabular.description": "The tabular data set of rows and columns.",
  394. "dataset.tabular.label": "Tabular data set",
  395. "dataset.tabular.link.description": "Determines the links between the nodes.",
  396. "dataset.tabular.link.label": "Tabular links data set",
  397. "dataset.tabular.node.description": "The tabular data set that defines the nodes.",
  398. "dataset.tabular.node.label": "Tabular node data set",
  399. "dataslost.label.composite.column.description": "The label for the columns.",
  400. "dataslot.categories.label": "Categories",
  401. "dataslot.category.label": "Category",
  402. "dataslot.children.description": "When applied to a tree node, returns the children of that node as an array-list.",
  403. "dataslot.children.label": "Children",
  404. "dataslot.color.composite.description": "The color of the columns.",
  405. "dataslot.color.composite.line.description": "The color of the lines.",
  406. "dataslot.color.description": "Determines the color of the shape.",
  407. "dataslot.color.label": "Color",
  408. "dataslot.colorLine.composite.line.description": "The color of the line.",
  409. "dataslot.colorLine.label": "Color line",
  410. "dataslot.group.composite.line.description": "Group that is used to combine points into lines. If not provided, all points are in one line. Groups are also used for the line color.",
  411. "dataslot.key.description": "Called for each row to match elements. Primarily used for transitions.",
  412. "dataslot.key.label": "Key",
  413. "dataslot.keyLine.description": "The key for the line.",
  414. "dataslot.keyLine.label": "Key line",
  415. "dataslot.label.composite.line.description": "If defined, the label of the point (not the line).",
  416. "dataslot.label.description": "Determines the label of the shape.",
  417. "dataslot.label.label": "Label",
  418. "dataslot.labelLine.composite.line.description": "The label for the line.",
  419. "dataslot.labelLine.label": "Label line",
  420. "dataslot.maximumValue.label": "Maximum value",
  421. "dataslot.source.label": "Source",
  422. "dataslot.sourceValue.label": "Source value",
  423. "dataslot.tabular.id.description": "The identifier for the nodes.",
  424. "dataslot.tabular.id.label": "Identifier",
  425. "dataslot.tabular.size.description": "Determines the size of the shape.",
  426. "dataslot.tabular.size.label": "Size",
  427. "dataslot.target.label": "Target",
  428. "dataslot.targetValue.label": "Target value",
  429. "dataslot.value.label": "Value",
  430. "dataslot.x.composite.description": "The X coordinate of the column. The value can be a number, string, or date.",
  431. "dataslot.x.label": "X axis",
  432. "dataslot.y.composite.description": "The Y value (extent) of the column. The value must be a number.",
  433. "dataslot.y.label": "Y axis",
  434. "dataslot.yColumn.composite.description": "The Y value (extent) of the column. The value must be a number.",
  435. "dataslot.yColumn.label": "Column value",
  436. "dataslot.yLine.composite.description": "The Y value (extent) of the line. The value must be a number.",
  437. "dataslot.yLine.label": "Line value",
  438. "dataslot.yStart.composite.description": "The start position of the column on the Y scale.",
  439. "dataslot.yStart.composite.label": "Y start",
  440. "defaultPalette.description": "Rave2 default description",
  441. "defaultPalette.label": "Rave2 default",
  442. "effect.delay.description": "Staggers (delays) the transitions along the X coordinate.",
  443. "effect.delay.name": "Stagger transition",
  444. "effect.duration.description": "The animation duration, in ms.",
  445. "effect.duration.name": "Animation duration (ms)",
  446. "effect.name.description": "The effect that is used when the chart is drawn.",
  447. "effect.name.name": "Animation",
  448. "effect.name.options.none": "None",
  449. "effect.name.options.transition": "Transition",
  450. "item.label.description": "Shows or hides item labels.",
  451. "item.label.name": "Item labels",
  452. "label.shadow.description": "Show or hide shadow for labels.",
  453. "label.shadow.name": "Label shadow",
  454. "labelResolution.description": "The method to use to resolve label overlaps.",
  455. "labelResolution.name": "Label resolution",
  456. "labelResolution.options.DropLabels": "Drop labels",
  457. "labelResolution.options.MoveLabels": "Move labels",
  458. "labelResolution.options.none": "None",
  459. "labelstyle.font.description": "Font styles for the item labels",
  460. "labelstyle.font.name": "Item label font",
  461. "layout.axissize.bottom.max.description": "The maximum size of the bottom axis, as a CSS size or percentage.",
  462. "layout.axissize.bottom.max.name": "Bottom axis maximum size",
  463. "layout.axissize.bottom.min.description": "The minimum size of the bottom axis, as a CSS size or percentage.",
  464. "layout.axissize.bottom.min.name": "Bottom axis minimum size",
  465. "layout.axissize.bottom.preferred.description": "The preferred size of the bottom axis, as a CSS size or percentage.",
  466. "layout.axissize.bottom.preferred.name": "Bottom axis preferred size",
  467. "layout.axissize.left.max.description": "The maximum size of the left axis, as a CSS size or percentage.",
  468. "layout.axissize.left.max.name": "Left axis maximum size",
  469. "layout.axissize.left.min.description": "The minimum size of the left axis, as a CSS size or percentage.",
  470. "layout.axissize.left.min.name": "Left axis minimum size",
  471. "layout.axissize.left.preferred.description": "The preferred size of the left axis, as a CSS size or percentage.",
  472. "layout.axissize.left.preferred.name": "Left axis preferred size",
  473. "layout.axissize.right.max.description": "The maximum size of the right axis, as a CSS size or percentage.",
  474. "layout.axissize.right.max.name": "Right axis maximum size",
  475. "layout.axissize.right.min.description": "The minimum size of the right axis, as a CSS size or percentage.",
  476. "layout.axissize.right.min.name": "Right axis minimum size",
  477. "layout.axissize.right.preferred.description": "The preferred size of the right axis, as a CSS size or percentage.",
  478. "layout.axissize.right.preferred.name": "Right axis preferred size",
  479. "layout.axissize.top.max.description": "The maximum size of the top axis, as a CSS size or percentage.",
  480. "layout.axissize.top.max.name": "Top axis maximum size",
  481. "layout.axissize.top.min.description": "The minimum size of the top axis, as a CSS size or percentage.",
  482. "layout.axissize.top.min.name": "Top axis minimum size",
  483. "layout.axissize.top.preferred.description": "The preferred size of the top axis, as a CSS size or percentage.",
  484. "layout.axissize.top.preferred.name": "Top axis preferred size",
  485. "layout.chart.padding.bottom.description": "The bottom padding for the chart.",
  486. "layout.chart.padding.bottom.name": "Bottom padding",
  487. "layout.chart.padding.left.description": "The left padding for the chart.",
  488. "layout.chart.padding.left.name": "Left padding",
  489. "layout.chart.padding.right.description": "Right padding for the chart.",
  490. "layout.chart.padding.right.name": "Right padding",
  491. "layout.chart.padding.top.description": "The top padding for the chart.",
  492. "layout.chart.padding.top.name": "Top padding",
  493. "layout.legendchart.align.description": "Whether to align the legend to the interior of the chart.",
  494. "layout.legendchart.align.name": "Align legend to chart",
  495. "layout.legendchart.gap.description": "Space between the chart and the legend, as a CSS size or percentage.",
  496. "layout.legendchart.gap.name": "Space between legend and chart",
  497. "layout.legendsize.max.description": "The maximum size of the legend, as a CSS size or percentage.",
  498. "layout.legendsize.max.name": "Maximum size",
  499. "layout.legendsize.min.description": "The minimum size of the legend, as a CSS size or percentage.",
  500. "layout.legendsize.min.name": "Minimum size",
  501. "layout.legendsize.preferred.description": "The preferred size of the legend, as a CSS size or percentage.",
  502. "layout.legendsize.preferred.name": "Preferred size",
  503. "layout.padding.description": "The padding around the chart and legend.",
  504. "layout.padding.name": "Padding",
  505. "legend.column.display.description": "Shows or hides the legend for the column chart.",
  506. "legend.column.display.name": "Show column legend",
  507. "legend.column.entrystyle.font.description": "The font style of the column chart legend entries.",
  508. "legend.column.entrystyle.font.name": "Column legend entry font",
  509. "legend.column.title.description": "The title of the column chart legend.",
  510. "legend.column.title.name": "Column legend title",
  511. "legend.column.titlestyle.fill.description": "The color of the column chart legend title.",
  512. "legend.column.titlestyle.fill.name": "Column legend title color",
  513. "legend.column.titlestyle.font.description": "The font style of the column chart legend title.",
  514. "legend.column.titlestyle.font.name": "Column legend title font",
  515. "legend.column.titlestyle.fontfamily.description": "The font family of the column chart legend title.",
  516. "legend.column.titlestyle.fontfamily.name": "Column legend title font family",
  517. "legend.column.titlestyle.fontsize.description": "The font size of the column chart legend title.",
  518. "legend.column.titlestyle.fontsize.name": "Column legend title font size",
  519. "legend.display.description": "Shows or hides the legend.",
  520. "legend.display.falseLabel": "Hide",
  521. "legend.display.name": "Show legend",
  522. "legend.display.trueLabel": "Show",
  523. "legend.entrystyle.font.description": "The font properties of the legend entry.",
  524. "legend.entrystyle.font.name": "Entry font",
  525. "legend.line.display.description": "Shows or hides the line chart legend.",
  526. "legend.line.display.name": "Show line legend",
  527. "legend.line.entrystyle.font.description": "The font style of the line chart legend entries.",
  528. "legend.line.entrystyle.font.name": "Line legend entry font",
  529. "legend.line.title.description": "The title of the line chart legend.",
  530. "legend.line.title.name": "Line legend title",
  531. "legend.line.titlestyle.fill.description": "The color of the line chart legend title.",
  532. "legend.line.titlestyle.fill.name": "Line legend title color",
  533. "legend.line.titlestyle.font.description": "The font style of the line chart legend title.",
  534. "legend.line.titlestyle.font.name": "Line legend title font",
  535. "legend.line.titlestyle.fontfamily.description": "The font family of the line chart legend title.",
  536. "legend.line.titlestyle.fontfamily.name": "Line legend title font family",
  537. "legend.line.titlestyle.fontsize.description": "The font size of the line chart legend title.",
  538. "legend.line.titlestyle.fontsize.name": "Line legend title font size",
  539. "legend.position.description": "The position of the legend in the chart.",
  540. "legend.position.name": "Legend position",
  541. "legend.position.options.bottom": "Bottom",
  542. "legend.position.options.left": "Left",
  543. "legend.position.options.right": "Right",
  544. "legend.position.options.top": "Top",
  545. "legend.title.description": "The title of the legend.",
  546. "legend.title.name": "Title",
  547. "legend.titlestyle.fill.description": "The color of the legend title.",
  548. "legend.titlestyle.fill.name": "Title color",
  549. "legend.titlestyle.font.description": "The font properties of the legend title.",
  550. "legend.titlestyle.font.name": "Title font",
  551. "legend.titlestyle.fontfamily.description": "The font family of the legend title.",
  552. "legend.titlestyle.fontfamily.name": "Title font family",
  553. "legend.titlestyle.fontsize.description": "The font size of the legend title.",
  554. "legend.titlestyle.fontsize.name": "Title font size",
  555. "lineWithPoints.display.description": "In the line chart, shows line and points, line only, or points only.",
  556. "lineWithPoints.display.name": "Line chart display mode",
  557. "lineWithPoints.display.options.line": "Line(s) only",
  558. "lineWithPoints.display.options.linePoints": "Line and points",
  559. "lineWithPoints.display.options.points": "Points only",
  560. "lineWithPoints.interpolate.description": "Controls how the line in the line chart is drawn.",
  561. "lineWithPoints.interpolate.name": "Interpolation mode",
  562. "lineWithPoints.interpolate.options.basis": "Basis",
  563. "lineWithPoints.interpolate.options.basis-open": "Basis-open",
  564. "lineWithPoints.interpolate.options.cardinal": "Cardinal",
  565. "lineWithPoints.interpolate.options.cardinal-open": "Cardinal-open",
  566. "lineWithPoints.interpolate.options.linear": "Linear",
  567. "lineWithPoints.interpolate.options.monotone": "Monotone",
  568. "lineWithPoints.interpolate.options.step": "Step",
  569. "lineWithPoints.interpolate.options.step-after": "Step-after",
  570. "lineWithPoints.interpolate.options.step-before": "Step-before",
  571. "lineWithPoints.showMissingAsGap.description": "Show missing data as gap instead of interpolating a line across the missing data",
  572. "lineWithPoints.showMissingAsGap.name": "Show missing data as gap",
  573. "lineWithPoints.size.description": "The size, in square pixels, of the line-with-points symbol.",
  574. "lineWithPoints.size.name": "Line-with-points size",
  575. "lineWithPoints.symbol.description": "The shape that is used for the line-with-points symbol.",
  576. "lineWithPoints.symbol.name": "Line-with-points symbol",
  577. "lineWithPoints.symbol.options.circle": "Circle",
  578. "lineWithPoints.symbol.options.cross": "Cross",
  579. "lineWithPoints.symbol.options.diamond": "Diamond",
  580. "lineWithPoints.symbol.options.donut": "Donut",
  581. "lineWithPoints.symbol.options.donut-plus": "Donut-plus",
  582. "lineWithPoints.symbol.options.horizontal-rectangle": "Horizontal-rectangle",
  583. "lineWithPoints.symbol.options.rectangle": "Rectangle",
  584. "lineWithPoints.symbol.options.square": "Square",
  585. "lineWithPoints.symbol.options.star": "Star",
  586. "lineWithPoints.symbol.options.triangle-down": "Triangle-down",
  587. "lineWithPoints.symbol.options.triangle-left": "Triangle-left",
  588. "lineWithPoints.symbol.options.triangle-right": "Triangle-right",
  589. "lineWithPoints.symbol.options.triangle-up": "Triangle-up",
  590. "lineWithPoints.symbol.options.vertical-rectangle": "Vertical-rectangle",
  591. "propertyPresentation.advanced.axisSizeProperties.description": "Axis size properties.",
  592. "propertyPresentation.advanced.axisSizeProperties.label": "Axis size",
  593. "propertyPresentation.advanced.clientBehaviorProperties.description": "Client side properties.",
  594. "propertyPresentation.advanced.clientBehaviorProperties.label": "Client behavior",
  595. "propertyPresentation.advanced.commonProperties.description": "Common properties.",
  596. "propertyPresentation.advanced.commonProperties.label": "Common",
  597. "propertyPresentation.advanced.description": "Advanced list of all properties in a grouped structure.",
  598. "propertyPresentation.advanced.label": "Advanced",
  599. "propertyPresentation.advanced.labelProperties.description": "Label properties",
  600. "propertyPresentation.advanced.labelProperties.label": "Label",
  601. "propertyPresentation.advanced.legendProperties.description": "Legend properties.",
  602. "propertyPresentation.advanced.legendProperties.label": "Legend",
  603. "propertyPresentation.advanced.xAxisProperties.description": "X-axis properties.",
  604. "propertyPresentation.advanced.xAxisProperties.label": "X-axis",
  605. "propertyPresentation.advanced.yAxisProperties.description": "Y-axis properties.",
  606. "propertyPresentation.advanced.yAxisProperties.label": "Y-axis",
  607. "propertyPresentation.simple.description": "Simple list of the most common properties.",
  608. "propertyPresentation.simple.label": "Simple",
  609. "rave2.colorpalette.blueContinuousSequential.description": "Blue continuous sequential description",
  610. "rave2.colorpalette.blueContinuousSequential.label": "Blue continuous sequential",
  611. "rave2.colorpalette.blueDiscreteSequential.description": "Blue discrete sequential description",
  612. "rave2.colorpalette.blueDiscreteSequential.label": "Blue discrete sequential",
  613. "rave2.colorpalette.blueGreenContinuousDivergent.description": "Blue green continuous divergent description",
  614. "rave2.colorpalette.blueGreenContinuousDivergent.label": "Blue green continuous divergent",
  615. "rave2.colorpalette.blueGreenDiscreteDivergent.description": "Blue green discrete divergent description",
  616. "rave2.colorpalette.blueGreenDiscreteDivergent.label": "Blue green discrete divergent",
  617. "rave2.colorpalette.dark.description": "Dark description",
  618. "rave2.colorpalette.dark.label": "Dark",
  619. "rave2.colorpalette.financial.description": "Financial description",
  620. "rave2.colorpalette.financial.label": "Financial",
  621. "rave2.colorpalette.greenContinuousSequential.description": "Green continuous sequential description",
  622. "rave2.colorpalette.greenContinuousSequential.label": "Green continuous sequential",
  623. "rave2.colorpalette.greenDiscreteSequential.description": "Green discrete sequential description",
  624. "rave2.colorpalette.greenDiscreteSequential.label": "Green discrete sequential",
  625. "rave2.colorpalette.light.description": "Light description",
  626. "rave2.colorpalette.light.label": "Light",
  627. "rave2.colorpalette.medical.description": "Medical description",
  628. "rave2.colorpalette.medical.label": "Medical",
  629. "rave2.colorpalette.orangeContinuousSequential.description": "Orange continuous sequential description",
  630. "rave2.colorpalette.orangeContinuousSequential.label": "Orange continuous sequential",
  631. "rave2.colorpalette.orangeDiscreteSequential.description": "Orange discrete sequential description",
  632. "rave2.colorpalette.orangeDiscreteSequential.label": " Orange discrete sequential",
  633. "rave2.colorpalette.purpleContinuousSequential.description": "Purple continuous sequential description",
  634. "rave2.colorpalette.purpleContinuousSequential.label": "Purple continuous sequential",
  635. "rave2.colorpalette.purpleDiscreteSequential.description": "Purple discrete sequential description",
  636. "rave2.colorpalette.purpleDiscreteSequential.label": "Purple discrete sequential",
  637. "rave2.colorpalette.redBlueContinuousDivergent.description": "Red blue continuous divergent description",
  638. "rave2.colorpalette.redBlueContinuousDivergent.label": "Red blue continuous divergent",
  639. "rave2.colorpalette.redBlueDiscreteDivergent.description": "Red blue discrete divergent description",
  640. "rave2.colorpalette.redBlueDiscreteDivergent.label": "Red blue discrete divergent",
  641. "rave2.colorpalette.redBlueInverseContinuousDivergent.description": "Red blue inverse continuous divergent description",
  642. "rave2.colorpalette.redBlueInverseContinuousDivergent.label": "Red blue inverse continuous divergent",
  643. "rave2.colorpalette.redBlueInverseDiscreteDivergent.description": "Red blue inverse discrete divergent description",
  644. "rave2.colorpalette.redBlueInverseDiscreteDivergent.label": "Red blue inverse discrete divergent",
  645. "rave2.colorpalette.redContinuousSequential.description": "Red continuous sequential description",
  646. "rave2.colorpalette.redContinuousSequential.label": "Red continuous sequential",
  647. "rave2.colorpalette.redDiscreteSequential.description": "Red discrete sequential description",
  648. "rave2.colorpalette.redDiscreteSequential.label": " Red discrete sequential",
  649. "rave2.colorpalette.redGreenContinuousDivergent.description": "Red green continuous divergent description",
  650. "rave2.colorpalette.redGreenContinuousDivergent.label": "Red green continuous divergent",
  651. "rave2.colorpalette.redGreenDiscreteDivergent.description": "Red green discrete divergent description",
  652. "rave2.colorpalette.redGreenDiscreteDivergent.label": "Red green discrete divergent",
  653. "rave2.colorpalette.redGreenInverseContinuousDivergent.description": "Red green inverse continuous divergent description",
  654. "rave2.colorpalette.redGreenInverseContinuousDivergent.label": "Red green inverse continuous divergent",
  655. "rave2.colorpalette.redGreenInverseDiscreteDivergent.description": "Red green inverse discrete divergent description",
  656. "rave2.colorpalette.redGreenInverseDiscreteDivergent.label": "Red green inverse discrete divergent",
  657. "rave2.colorpalette.tealContinuousSequential.description": "Teal continuous sequential description",
  658. "rave2.colorpalette.tealContinuousSequential.label": "Teal continuous sequential",
  659. "rave2.colorpalette.tealDiscreteSequential.description": "Teal discrete sequential description",
  660. "rave2.colorpalette.tealDiscreteSequential.label": "Teal discrete sequential",
  661. "rave2.colorpalette.tealPurpleContinuousDivergent.description": "Teal purple continuous divergent description",
  662. "rave2.colorpalette.tealPurpleContinuousDivergent.label": "Teal purple continuous divergent",
  663. "rave2.colorpalette.tealPurpleDiscreteDivergent.description": "Teal purple discrete divergent description",
  664. "rave2.colorpalette.tealPurpleDiscreteDivergent.label": "Teal purple discrete divergent",
  665. "rave2.colorpalette.violetContinuousSequential.description": "Violet continuous sequential description",
  666. "rave2.colorpalette.violetContinuousSequential.label": "Violet continuous sequential",
  667. "rave2.colorpalette.violetDiscreteSequential.description": "Violet discrete sequential description",
  668. "rave2.colorpalette.violetDiscreteSequential.label": "Violet discrete sequential",
  669. "rave2.colorpalette.yellowContinuousSequential.description": "Yellow continuous sequential description",
  670. "rave2.colorpalette.yellowContinuousSequential.label": "Yellow continuous sequential",
  671. "rave2.colorpalette.yellowDiscreteSequential.description": "Yellow discrete sequential description",
  672. "rave2.colorpalette.yellowDiscreteSequential.label": "Yellow discrete sequential",
  673. "sortX.description": "Sorts the line points by x.",
  674. "sortX.name": "Sort points by x",
  675. "swapLineColumn.description": "When set to Yes, shows the line chart axis on the left and the column chart axis on the right.",
  676. "swapLineColumn.falseLabel": "Do not switch",
  677. "swapLineColumn.name": "Switch line and column axes",
  678. "swapLineColumn.trueLabel": "Switch",
  679. "transpose.description": "When set to Yes, the Y-axis shows the independent scale and the X-axis shows the dependent scale.",
  680. "transpose.falseLabel": "Do not transpose",
  681. "transpose.name": "Switch X and Y axes",
  682. "transpose.trueLabel": "Transpose",
  683. "zoom.description": "Zooms the chart in the X, Y, Y2, or in all directions.",
  684. "zoom.name": "Zoom",
  685. "zoom.options.all": "All",
  686. "zoom.options.none": "None",
  687. "zoom.options.x": "X",
  688. "zoom.options.y": "Y",
  689. "zoom.options.y2": "Y2"
  690. }
  691. },{}],3:[function(require,module,exports){
  692. (function() {
  693. var $ = {};
  694. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModuleHeader
  695. /************************************************************************
  696. ** IBM Confidential
  697. **
  698. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  699. **
  700. ** (C) Copyright IBM Corp. 2015
  701. **
  702. ** The source code for this program is not published or otherwise divested of its trade secrets,
  703. ** irrespective of what has been deposited with the U.S. Copyright Office.
  704. ************************************************************************/
  705. var com_ibm_rave_library_Library = rave["library"];
  706. rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
  707. rave["internal"]["CSSUtil"]= rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
  708. // $source: com/ibm/rave/bundles/RaveBundle
  709. /************************************************************************
  710. ** IBM Confidential
  711. **
  712. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  713. **
  714. ** (C) Copyright IBM Corp. 2017
  715. **
  716. ** The source code for this program is not published or otherwise divested of its trade secrets,
  717. ** irrespective of what has been deposited with the U.S. Copyright Office.
  718. ************************************************************************/
  719. // GENERATED
  720. //@import com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader (runtime) // new
  721. /**
  722. * A RaveBundle extends the regular Bundle abstract class but includes common functionality for Rave-made bundles that aren't for general use.
  723. */
  724. var com_ibm_rave_bundles_RaveBundle = rave['internal']['Declare'](rave['library']['internal']['Bundle'], {
  725. /** @expose */
  726. loader : null,
  727. /** @expose */
  728. constructor : function() {
  729. ;
  730. ;
  731. ;
  732. ;
  733. ;
  734. ;
  735. this.loader = new com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader("/com/ibm/rave/bundles/" + this.getName());
  736. },
  737. /**
  738. * Load extra resources required for this bundle. Currently the compiled configuration.json file. And .css.
  739. */
  740. /** @expose */
  741. loadResources : function() {
  742. this.setMessageCatalog(rave['library']['internal']['Bundle'].DEFAULT_LOCALE, require("./i18n/messages_en.json"));
  743. var array = require("./configuration/configuration.json");
  744. if (array) {
  745. for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
  746. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  747. var artifact = __exp_enFor0[__i_enFor0];
  748. this.initialize(artifact);
  749. }
  750. }
  751. require("./vizlibrary.css");
  752. }
  753. });
  754. //com_ibm_rave_bundles_RaveBundle.CONFIGURATION_FILE = "./configuration/configuration.json";
  755. // $source: com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader
  756. // Intentionally empty - everything in this file is inlined
  757. var com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader = function(){};
  758. // $source: com/ibm/rave/bundles/views/BundleView
  759. /************************************************************************
  760. ** IBM Confidential
  761. **
  762. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  763. **
  764. ** (C) Copyright IBM Corp. 2017
  765. **
  766. ** The source code for this program is not published or otherwise divested of its trade secrets,
  767. ** irrespective of what has been deposited with the U.S. Copyright Office.
  768. ************************************************************************/
  769. // GENERATED
  770. //@import com/ibm/rave/bundles/components/BackgroundComponentImpl (runtime) // new
  771. //@import com/ibm/rave/bundles/components/ChartLayoutComponentImpl (runtime) // new
  772. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  773. //@import com/ibm/rave/bundles/components/LegendsManager (runtime) // new
  774. //@import com/ibm/rave/bundles/components/AxesManager (runtime) // new
  775. //@import com/ibm/rave/library/Library (runtime) // Library
  776. //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities
  777. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
  778. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  779. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  780. var com_ibm_rave_bundles_views_BundleView = rave['internal']['Declare'](rave['library']['internal']['AbstractView'], {
  781. /**
  782. * Background component
  783. */
  784. /** @expose */
  785. _backgroundComponent : null,
  786. /**
  787. * Layout component
  788. */
  789. /** @expose */
  790. _layoutComponent : null,
  791. /**
  792. * Clip component
  793. */
  794. /** @expose */
  795. _clip : null,
  796. /**
  797. * Axes manager
  798. */
  799. /** @expose */
  800. _axes : null,
  801. /**
  802. * Legends manager
  803. */
  804. /** @expose */
  805. _legends : null,
  806. //_groupStructure : null,
  807. /** @expose */
  808. _chart : null,
  809. /** @expose */
  810. dataModel : null,
  811. /** @expose */
  812. _zoomP : null,
  813. /** @expose */
  814. _zoomS : null,
  815. /** @expose */
  816. constructor : function(context) {
  817. },
  818. /** @expose */
  819. getGroupStructure : function() {},
  820. /** @expose */
  821. setup : function() {
  822. rave['library']['internal']['AbstractView'].prototype.setup.call(this);
  823. this._backgroundComponent = new com_ibm_rave_bundles_components_BackgroundComponentImpl();
  824. this._layoutComponent = new com_ibm_rave_bundles_components_ChartLayoutComponentImpl();
  825. this._clip = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this.context.instanceId() + "clipViewport");
  826. if (this.isZoomSupported()) {
  827. this.resetZoom();
  828. }
  829. this._legends = new com_ibm_rave_bundles_components_LegendsManager(this.context, this.getLegendCount());
  830. if (this.isAxesManagerRequired()) {
  831. this._axes = new com_ibm_rave_bundles_components_AxesManager(this.context);
  832. }
  833. this._groupStructure = this.getGroupStructure();
  834. },
  835. /** @expose */
  836. preDraw : function(chartId) {
  837. this.cancelTransitions();
  838. rave['library']['internal']['AbstractView'].createGroupStructure(this.context.node, this._groupStructure);
  839. this._chart = this.context.node.selectAll(chartId);
  840. },
  841. /** @expose */
  842. resetZoom : function() {
  843. this._zoomP = [0, 0, 0, 0];
  844. this._zoomS = [1, 1, 1, 1];
  845. },
  846. /** @expose */
  847. validateDataModel : function(elementsToRemove) {
  848. if (elementsToRemove !== null || arguments.length > 1){
  849. elementsToRemove = Array.prototype.slice.call(arguments);
  850. }
  851. {
  852. this.dataModel = this.context.dataModel();
  853. if (!(this.dataValid())) {
  854. for (var __i_enFor0 = 0, __len_enFor0 = elementsToRemove.length;
  855. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  856. var e = elementsToRemove[__i_enFor0];
  857. this._chart.selectAll(e).selectAll("*").remove();
  858. }
  859. this._legends.visible(false).draw();
  860. return false;
  861. }
  862. return true;
  863. }
  864. },
  865. /** @expose */
  866. dataValid : function() {
  867. return this.dataModel.validate();
  868. },
  869. /** @expose */
  870. getLegendCount : function() {
  871. return 1;
  872. },
  873. /** @expose */
  874. isAxesManagerRequired : function() {
  875. return false;
  876. },
  877. /** @expose */
  878. isZoomSupported : function() {
  879. return true;
  880. },
  881. /** @expose */
  882. getProperty : function(s) {
  883. return this.context.getPropertyValue(s);
  884. },
  885. /** @expose */
  886. getPropertyDefault : function(s) {
  887. return this.context.getPropertyDefault(s);
  888. },
  889. /** @expose */
  890. getBooleanProperty : function(s) {
  891. var obj = this.getProperty(s);
  892. return (obj);
  893. },
  894. /** @expose */
  895. getDoubleProperty : function(s) {
  896. var obj = this.getProperty(s);
  897. return + (obj);
  898. },
  899. /** @expose */
  900. getIntProperty : function(s) {
  901. var obj = this.getProperty(s);
  902. return ~~ (obj);
  903. },
  904. /**
  905. * @param (String) id Property ID
  906. * @return (String) Property value as a string
  907. */
  908. /** @expose */
  909. getStringProperty : function(id) {
  910. var obj = this.getProperty(id);
  911. return (obj == null) ? null : ""+(obj);
  912. },
  913. /**
  914. * @param (String) id Property ID
  915. * @return (String) Property value as a string, returning null for the empty string
  916. */
  917. /** @expose */
  918. getStringPropertyEmptyAsNull : function(id) {
  919. var s = this.getStringProperty(id);
  920. return (s == null || s.length == 0) ? null : s;
  921. },
  922. /**
  923. * @param (String) id Property ID
  924. * @return (Number) Property value as a string, containing size as the number of pixels
  925. */
  926. /** @expose */
  927. getCSSSizeToPixelNumber : function(id) {
  928. var cssSize = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.context.getPropertyValue(id), 100.0, 10.0);
  929. return (cssSize == null) ? 0.0 : cssSize;
  930. },
  931. /**
  932. * Based on effect duration and effect property, determine the effect duration in ms.
  933. * @param (String) effect Effect name, one of the options available from EFFECT_OPTIONS.
  934. * @return (int) Effect duration in ms.
  935. */
  936. /** @expose */
  937. getEffectDuration : function(effect) {
  938. var duration = this.getIntProperty("effect.duration");
  939. if ((duration < 0) || (effect == null) || "none" == effect) {
  940. duration = 0;
  941. }
  942. return duration;
  943. },
  944. /** @expose */
  945. getTopPadding : function() {
  946. return this.getProperty("layout.chart.padding.top");
  947. },
  948. /** @expose */
  949. getLeftPadding : function() {
  950. return this.getProperty("layout.chart.padding.left");
  951. },
  952. /** @expose */
  953. getBottomPadding : function() {
  954. return this.getProperty("layout.chart.padding.bottom");
  955. },
  956. /** @expose */
  957. getRightPadding : function() {
  958. return this.getProperty("layout.chart.padding.right");
  959. },
  960. /** @expose */
  961. getLayoutPadding : function() {
  962. return this.getProperty("layout.padding");
  963. },
  964. /** @expose */
  965. getLegendChartGap : function() {
  966. return this.getProperty("layout.legendchart.gap");
  967. },
  968. /** @expose */
  969. getLegendChartAlign : function() {
  970. return this.getBooleanProperty("layout.legendchart.align");
  971. },
  972. /** @expose */
  973. getLegendPosition : function() {
  974. return this.getStringProperty("legend.position");
  975. },
  976. getPalette$0 : function() {
  977. return this.getPalette$1("color.palette");
  978. },
  979. getPalette$1 : function(paletteID) {
  980. var id = this.getStringProperty(paletteID);
  981. var colorPalette = com_ibm_rave_library_Library.palettes.getPalette(id);
  982. return (!colorPalette) ? com_ibm_rave_library_Library.palettes.getDefaultPalette() : colorPalette;
  983. },
  984. getDynamicPalette$0 : function() {
  985. return this.getDynamicPalette$1("color.palette", "color.dynamicPalette.min", "color.dynamicPalette.mid", "color.dynamicPalette.max");
  986. },
  987. /**
  988. * 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.
  989. * @param (String) paletteID The palette ID
  990. * @return (rave['library']['internal']['Palette']) Palette
  991. */
  992. getDynamicPalette$1 : function(paletteID, minId, midId, maxId) {
  993. var colorPalette;
  994. var min = this.getStringProperty(minId);
  995. if (min != null) {
  996. var mid = this.getStringProperty(midId);
  997. if (mid != null) {
  998. var max = this.getStringProperty(maxId);
  999. if (max != null) {
  1000. var fills = [min, mid, max];
  1001. colorPalette = rave['library']['internal']['AbstractView'].getFillPalette(fills);
  1002. }
  1003. }
  1004. }
  1005. return (!colorPalette) ? this.getPalette(paletteID) : colorPalette;
  1006. },
  1007. /** @expose */
  1008. prepareLayoutComponent : function() {
  1009. 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());
  1010. },
  1011. /** @expose */
  1012. prepareLayoutSizables : function(layoutComponent, useX2, useY1, useX1, useY2, useLegend) {
  1013. layoutComponent.removeAxisSizables();
  1014. if (useX1) {
  1015. layoutComponent.addAxisSizable(this._axes.axisComponent(0));
  1016. }
  1017. if (useY1) {
  1018. layoutComponent.addAxisSizable(this._axes.axisComponent(2));
  1019. }
  1020. if (useX2) {
  1021. layoutComponent.addAxisSizable(this._axes.axisComponent(1));
  1022. }
  1023. if (useY2) {
  1024. layoutComponent.addAxisSizable(this._axes.axisComponent(3));
  1025. }
  1026. layoutComponent.legendSize(useLegend ? this._legends : null);
  1027. },
  1028. /** @expose */
  1029. resetUpdate : function() {
  1030. this.updateType = 4;
  1031. },
  1032. /** @expose */
  1033. isUpdateNothing : function() {
  1034. return this.updateType == 4;
  1035. },
  1036. /** @expose */
  1037. isShowLegend : function() {
  1038. return this.getBooleanProperty("legend.display");
  1039. },
  1040. cancelTransitions : function() {
  1041. this.context.node.selectAll("*").interrupt();
  1042. },
  1043. /** @expose */
  1044. setBackgroundProperties : function(elementRect, duration) {
  1045. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).size(this.context.size).backgroundColor(this.getStringProperty("background.chart.color"));
  1046. this.context.node.selectAll("rect.background.chart").transition().duration(duration).call(this._backgroundComponent);
  1047. this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(elementRect).backgroundColor(this.getStringProperty("background.elements.color"));
  1048. this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
  1049. },
  1050. /** @expose */
  1051. isShowDataLabels : function() {
  1052. return this.getBooleanProperty("data.label.display");
  1053. },
  1054. /** @expose */
  1055. isShowDataLabelsAsPercentageOfColor : function() {
  1056. var dataLabel = this.getStringProperty("data.label.type");
  1057. return "PercentOfColor" == dataLabel;
  1058. },
  1059. /** @expose */
  1060. isShowDataLabelsAsPercentageOfCategory : function() {
  1061. var dataLabel = this.getStringProperty("data.label.type");
  1062. return "PercentOfCategory" == dataLabel;
  1063. },
  1064. /** @expose */
  1065. getlDataLabelAccessor : function(dataSet, slot, isInterval) {
  1066. var labelAccessor;
  1067. var labelEntry = dataSet.slot(slot).entry();
  1068. if (!labelEntry) {
  1069. if (this.isShowDataLabelsAsPercentageOfCategory()) {
  1070. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR;
  1071. } else if (this.isShowDataLabelsAsPercentageOfColor()) {
  1072. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR;
  1073. } else {
  1074. labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR;
  1075. }
  1076. } else {
  1077. labelAccessor = rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelEntry));
  1078. }
  1079. return labelAccessor;
  1080. },
  1081. /** @expose */
  1082. getEntryForDataLabelFormatter : function(dataSet, labelSlot, defaultSlot) {
  1083. var labelEntry = dataSet.slot(labelSlot).entry();
  1084. return labelEntry ? labelEntry : dataSet.slot(defaultSlot).entry();
  1085. },
  1086. /** @expose */
  1087. getBackgroundConstrastLabelStyle : function() {
  1088. var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
  1089. if (this.getBooleanProperty("contrast.label.color") == false) {
  1090. return labelFontStyle;
  1091. }
  1092. var defaultFillColor;
  1093. if (labelFontStyle) {
  1094. defaultFillColor = labelFontStyle["fill"];
  1095. if (defaultFillColor == null) {
  1096. defaultFillColor = labelFontStyle["color"];
  1097. }
  1098. } else {
  1099. labelFontStyle = {};
  1100. }
  1101. if (defaultFillColor == null) {
  1102. defaultFillColor = "#000000";
  1103. }
  1104. labelFontStyle["fill"] = com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(this.getStringProperty("background.elements.color"), defaultFillColor);
  1105. return labelFontStyle;
  1106. },
  1107. /** @expose */
  1108. getPalette : function(a0) {
  1109. var args = arguments;
  1110. if (args.length == 0) {
  1111. return this.getPalette$0();
  1112. }
  1113. if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
  1114. return this.getPalette$1(a0);
  1115. }
  1116. return rave['library']['internal']['AbstractView'].prototype.getPalette.apply(this, args);
  1117. },
  1118. /** @expose */
  1119. getDynamicPalette : function(a0, a1, a2, a3) {
  1120. var args = arguments;
  1121. if (args.length == 0) {
  1122. return this.getDynamicPalette$0();
  1123. }
  1124. return this.getDynamicPalette$1(a0, a1, a2, a3);
  1125. }
  1126. });
  1127. // $source: com/ibm/rave/bundles/components/BundleComponentImpl
  1128. /************************************************************************
  1129. ** IBM Confidential
  1130. **
  1131. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1132. **
  1133. ** (C) Copyright IBM Corp. 2017
  1134. **
  1135. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1136. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1137. ************************************************************************/
  1138. // GENERATED
  1139. var com_ibm_rave_bundles_components_BundleComponentImpl = rave['internal']['Declare']({
  1140. /**
  1141. * The pre-execution callback.
  1142. */
  1143. //_preExecuteCallback : null,
  1144. /**
  1145. * The render callback.
  1146. */
  1147. /** @expose */
  1148. _renderCallback : null,
  1149. _$functionClassMethod : function() {
  1150. var _$self = function(args) {
  1151. if (args !== null || arguments.length > 1){
  1152. args = Array.prototype.slice.call(arguments, 0);
  1153. }
  1154. {
  1155. var self = _$self;
  1156. this.each(function(data, index, groupIndex) {
  1157. self.execute(rave.select(this));
  1158. });
  1159. return null;
  1160. }
  1161. };
  1162. return _$self;
  1163. },
  1164. /**
  1165. * 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.
  1166. * @param (rave['internal']['Selector']) g <g> node that this component will be applied to.
  1167. */
  1168. /** @expose */
  1169. execute : function(g) {},
  1170. /**
  1171. * Set the pre-execute callback for this component.
  1172. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  1173. */
  1174. /** @expose */
  1175. setPreExecute : function(callback) {
  1176. this._preExecuteCallback = callback;
  1177. return this;
  1178. },
  1179. /**
  1180. * If the pre-execute component is non-null, call it with this object. Note that this object must also implement BundleComponent.
  1181. */
  1182. /** @expose */
  1183. preExecute : function() {
  1184. if (this._preExecuteCallback) {
  1185. this._preExecuteCallback(this);
  1186. }
  1187. },
  1188. /**
  1189. * Set the render callback for this component.
  1190. * @param (rave['internal']['RunFunction']) callback The callback
  1191. */
  1192. /** @expose */
  1193. setRenderCallback : function(callback) {
  1194. this._renderCallback = callback;
  1195. return this;
  1196. },
  1197. /**
  1198. * 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.
  1199. */
  1200. /** @expose */
  1201. type : function() {},
  1202. /** @expose */
  1203. updateBorder : function(s, borderWidth, borderColor) {
  1204. if (borderWidth != null) {
  1205. s.each(function(data, index, groupIndex) {
  1206. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  1207. this.rave_setStyle("stroke-width", borderWidth, "");
  1208. }
  1209. });
  1210. }
  1211. if (borderColor != null) {
  1212. s.each(function(data, index, groupIndex) {
  1213. if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
  1214. this.rave_setStyle("stroke", borderColor, "");
  1215. }
  1216. });
  1217. }
  1218. },
  1219. /** @expose */
  1220. getDefaultLabelColor : function(_labelStyle) {
  1221. if (!_labelStyle) {
  1222. return "#000000";
  1223. }
  1224. var defaultFillColor;
  1225. if (_labelStyle) {
  1226. defaultFillColor = _labelStyle["fill"];
  1227. if (defaultFillColor == null) {
  1228. defaultFillColor = _labelStyle["color"];
  1229. }
  1230. }
  1231. if (defaultFillColor == null) {
  1232. defaultFillColor = "#000000";
  1233. }
  1234. return defaultFillColor.toString();
  1235. }
  1236. });
  1237. // $source: com/ibm/rave/bundles/component/BackgroundComponent
  1238. /************************************************************************
  1239. ** IBM Confidential
  1240. **
  1241. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1242. **
  1243. ** (C) Copyright IBM Corp. 2017
  1244. **
  1245. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1246. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1247. ************************************************************************/
  1248. // GENERATED
  1249. /**
  1250. * <p> A component that renders the background to the chart. The {@link #this.type()} method returns "BackgroundComponent". </p>
  1251. */
  1252. var com_ibm_rave_bundles_component_BackgroundComponent = rave['internal']['Declare'].implement(
  1253. /**
  1254. * Get the background color.
  1255. * @return (String) The background color
  1256. */
  1257. //backgroundColor : function() {},
  1258. /**
  1259. * Set the background color. If the color is null, white is used.
  1260. * @param (String) backgroundColor The new background color
  1261. * @return (com.ibm.rave.bundles.component.BackgroundComponent) This object
  1262. */
  1263. //backgroundColor : function(backgroundColor) {}
  1264. );
  1265. /**
  1266. * The string returned by {@link #this.type()} is "BackgroundComponent".
  1267. */
  1268. /** @expose */
  1269. com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE = "BackgroundComponent";
  1270. // $source: com/ibm/rave/bundles/component/ChartLayoutComponent
  1271. /************************************************************************
  1272. ** IBM Confidential
  1273. **
  1274. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1275. **
  1276. ** (C) Copyright IBM Corp. 2017
  1277. **
  1278. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1279. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1280. ************************************************************************/
  1281. // GENERATED
  1282. /**
  1283. * <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>
  1284. */
  1285. var com_ibm_rave_bundles_component_ChartLayoutComponent = rave['internal']['Declare'].implement(
  1286. //padding : function() {},
  1287. //topPadding : function() {},
  1288. //leftPadding : function() {},
  1289. //bottomPadding : function() {},
  1290. //rightPadding : function() {},
  1291. //legendChartAlign : function() {},
  1292. //legendPosition : function() {},
  1293. //legendChartGap : function() {},
  1294. //legendPosition : function(position) {},
  1295. //topPadding : function(value) {},
  1296. //leftPadding : function(value) {},
  1297. //bottomPadding : function(value) {},
  1298. //rightPadding : function(value) {},
  1299. /**
  1300. * Sets the padding around the outside of the chart/legend.
  1301. * @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.
  1302. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1303. */
  1304. //padding : function(value) {},
  1305. /**
  1306. * Sets all chart paddings. Null values are treated as 0.
  1307. * @param (Object) top New top padding
  1308. * @param (Object) left New left padding
  1309. * @param (Object) bottom New bottom padding
  1310. * @param (Object) right New right padding
  1311. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1312. * @deprecated Please use {@link #this.padding(Object)} and {@link #this.legendChartGap(Object)}
  1313. */
  1314. //chartPadding : function(top, left, bottom, right) {},
  1315. /**
  1316. * Sets whether the legend should align with the chart "body".
  1317. * @param (boolean) legendChartAlign the boolean state
  1318. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1319. */
  1320. //legendChartAlign : function(legendChartAlign) {},
  1321. /**
  1322. * Set the space for the gap between chart and legend
  1323. * @param (Object) value the gap distance (css length)
  1324. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1325. */
  1326. //legendChartGap : function(value) {},
  1327. /**
  1328. * Set the size information for the legend. Null value is treated as no visible legend.
  1329. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1330. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1331. */
  1332. //legendSize : function(sizable) {},
  1333. /**
  1334. * Reset list of axis sizables to 0
  1335. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1336. */
  1337. //removeAxisSizables : function() {},
  1338. /**
  1339. * Add an axis to be considered in layout operation.
  1340. * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
  1341. * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
  1342. */
  1343. //addAxisSizable : function(sizable) {}
  1344. );
  1345. /**
  1346. * The string returned by {@link #this.type()} is "ChartLayoutComponent".
  1347. */
  1348. /** @expose */
  1349. com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE = "ChartLayoutComponent";
  1350. // $source: com/ibm/rave/bundles/components/LegendsManager
  1351. /************************************************************************
  1352. ** IBM Confidential
  1353. **
  1354. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1355. **
  1356. ** (C) Copyright IBM Corp. 2017
  1357. **
  1358. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1359. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1360. ************************************************************************/
  1361. // GENERATED
  1362. //@import com/ibm/rave/bundles/components/LegendComponentImpl (runtime) // new, orientationOf
  1363. /**
  1364. * <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>
  1365. */
  1366. var com_ibm_rave_bundles_components_LegendsManager = rave['internal']['Declare']({
  1367. /**
  1368. * Bundle context
  1369. */
  1370. //_context : null,
  1371. /**
  1372. * Component used to draw all legends
  1373. */
  1374. //_comp : null,
  1375. /**
  1376. * Global visibility; if false no legends are drawn
  1377. */
  1378. //_visible : null,
  1379. /**
  1380. * Rectangle containing all legends
  1381. */
  1382. //_rectangle : null,
  1383. /**
  1384. * Legend orientation
  1385. */
  1386. //_orient : null,
  1387. /**
  1388. * Pre-execute component callback
  1389. */
  1390. //_preExecute : null,
  1391. /**
  1392. * Selectors for each legend
  1393. */
  1394. //_selectors : null,
  1395. /**
  1396. * Palettes for each legend
  1397. */
  1398. //_palettes : null,
  1399. /**
  1400. * Scale size functions for each legend
  1401. */
  1402. //_scale : null,
  1403. /**
  1404. * Swatch size functions for each legend
  1405. */
  1406. //_swatchSizes : null,
  1407. /**
  1408. * Shapes for each legend
  1409. */
  1410. //_shapes : null,
  1411. /**
  1412. * Titles for each legend
  1413. */
  1414. //_titles : null,
  1415. /**
  1416. * Title fonts for each legend
  1417. */
  1418. //_titleFonts : null,
  1419. /**
  1420. * Title fills for each legend
  1421. */
  1422. //_titleFills : null,
  1423. /**
  1424. * Title font sizes for each legend
  1425. */
  1426. //_titleFontSizes : null,
  1427. /**
  1428. * Title font families for each legend
  1429. */
  1430. //_titleFontFamilies : null,
  1431. /**
  1432. * Entry fonts for each legend
  1433. */
  1434. //_entryFonts : null,
  1435. /**
  1436. * Custom formatters for each legend, created from the registered custom formatters
  1437. */
  1438. //_formatters : null,
  1439. /**
  1440. * Whether each legend was visible in the last draw
  1441. */
  1442. //_lastVisible : null,
  1443. //_dataSlotEntries : null,
  1444. /**
  1445. * Number of legends
  1446. */
  1447. _numLegends : 0,
  1448. /**
  1449. * Whether to use a transition.
  1450. */
  1451. _doTransition : false,
  1452. /**
  1453. * Duration of the transition.
  1454. */
  1455. _duration : 0,
  1456. _spaceUsed : 0,
  1457. /**
  1458. * Construct the manager.
  1459. * @param (int) numLegends Number of legends, must be positive
  1460. */
  1461. /** @expose */
  1462. constructor : function(context, numLegends) {
  1463. this._context = context;
  1464. this._numLegends = numLegends;
  1465. this._comp = new com_ibm_rave_bundles_components_LegendComponentImpl();
  1466. this._rectangle = new rave['internal']['RectStruct'](0, 0, 0, 0);
  1467. this._orient = "vertical";
  1468. this._preExecute = null;
  1469. this._selectors = [];
  1470. this._palettes = [];
  1471. this._scale = [];
  1472. this._swatchSizes = [];
  1473. this._shapes = [];
  1474. this._titles = [];
  1475. this._titleFonts = [];
  1476. this._titleFills = [];
  1477. this._titleFontSizes = [];
  1478. this._titleFontFamilies = [];
  1479. this._entryFonts = [];
  1480. this._formatters = [];
  1481. this._lastVisible = [];
  1482. this._visible = [];
  1483. this._dataSlotEntries = [];
  1484. for (var i = 0; i < this._numLegends; ++i) {
  1485. this._selectors[i] = null;
  1486. this._palettes[i] = null;
  1487. this._swatchSizes[i] = null;
  1488. this._shapes[i] = null;
  1489. this._titles[i] = null;
  1490. this._formatters[i] = null;
  1491. this._lastVisible[i] = false;
  1492. this._visible[i] = true;
  1493. }
  1494. },
  1495. /**
  1496. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) The legend component used by this manager; for unit tests
  1497. */
  1498. getLegendComponent : function() {
  1499. return this._comp;
  1500. },
  1501. /**
  1502. * Set a specific legend visible
  1503. * @param (int) legendIndex The index of the legend
  1504. * @param (boolean) visible New value of visible flag
  1505. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1506. */
  1507. visible$0 : function(legendIndex, visible) {
  1508. if (legendIndex < this._visible.length) {
  1509. this._visible[legendIndex] = visible;
  1510. }
  1511. return this;
  1512. },
  1513. /**
  1514. * Set all legend visible
  1515. * @param (boolean) visible New value of visible flag
  1516. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1517. */
  1518. visible$1 : function(visible) {
  1519. for (var i = 0; i < this._visible.length; ++i) {
  1520. this._visible[i] = visible;
  1521. }
  1522. return this;
  1523. },
  1524. /**
  1525. * Set the layout rectangle. The rectangle is copied. If it is null, the layout rectangle is unchanged.
  1526. * @param (rave['internal']['RectStruct']) rect New layout rectangle
  1527. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1528. */
  1529. /** @expose */
  1530. rectangle : function(rect) {
  1531. if (rect) {
  1532. this._rectangle = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  1533. }
  1534. return this;
  1535. },
  1536. /**
  1537. * Set the orient property. If the argument is not "horizontal" or "vertical", the orient property is not changed.
  1538. * @param (String) orient New orient
  1539. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1540. */
  1541. /** @expose */
  1542. orient : function(orient) {
  1543. if ("horizontal" == orient || "vertical" == orient) {
  1544. this._orient = orient;
  1545. }
  1546. return this;
  1547. },
  1548. /**
  1549. * 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".
  1550. * @param (String) position Legend position
  1551. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1552. */
  1553. /** @expose */
  1554. position : function(position) {
  1555. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  1556. },
  1557. /**
  1558. * Set the transition information. If the duration is negative, 0 is used.
  1559. * @param (boolean) doTransition Whether to do a transition
  1560. * @param (int) duration Duration of the transition when used
  1561. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1562. */
  1563. /** @expose */
  1564. transition : function(doTransition, duration) {
  1565. this._doTransition = doTransition;
  1566. this._duration = (duration >= 0) ? duration : 0;
  1567. return this;
  1568. },
  1569. /**
  1570. * Set the pre-execute callback for all legends. The callback may be null.
  1571. * @param (rave['library']['internal']['ComponentCallback']) callback The callback
  1572. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1573. */
  1574. /** @expose */
  1575. setPreExecute : function(callback) {
  1576. this._preExecute = callback;
  1577. return this;
  1578. },
  1579. /**
  1580. * Set the selector to be used when rendering a legend. If the index is out of range no selectors change.
  1581. * @param (int) index Legend array index
  1582. * @param (rave['internal']['Selector']) selector Selector, may be null (but this is not advisable)
  1583. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1584. */
  1585. /** @expose */
  1586. selector : function(index, selector) {
  1587. if (index >= 0 && index < this._numLegends) {
  1588. this._selectors[index] = selector;
  1589. }
  1590. return this;
  1591. },
  1592. /**
  1593. * Set the palette of a legend. If the index is out of range no information is changed.
  1594. * @param (int) index Legend array index
  1595. * @param (rave['library']['internal']['Palette']) palette Palette, may be null
  1596. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1597. */
  1598. /** @expose */
  1599. palette : function(index, palette) {
  1600. if (index >= 0 && index < this._numLegends) {
  1601. this._palettes[index] = palette;
  1602. }
  1603. return this;
  1604. },
  1605. /**
  1606. * Set the shape of a legend. If the index is out of range no information is changed.
  1607. * @param (int) index Legend array index
  1608. * @param (String) shape Shape, may be null (defaulting to square)
  1609. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1610. */
  1611. /** @expose */
  1612. shape : function(index, shape) {
  1613. if (index >= 0 && index < this._numLegends) {
  1614. this._shapes[index] = shape;
  1615. }
  1616. return this;
  1617. },
  1618. /**
  1619. * Set the title of a legend. If the index is out of range no information is changed.
  1620. * @param (int) index Legend array index
  1621. * @param (String) title Title, may be null
  1622. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1623. */
  1624. /** @expose */
  1625. title : function(index, title) {
  1626. if (index >= 0 && index < this._numLegends) {
  1627. this._titles[index] = title;
  1628. }
  1629. return this;
  1630. },
  1631. /**
  1632. * Set the title font style of a legend. If the index is out of range no information is changed.
  1633. * @param (int) index Legend array index
  1634. * @param (String) titleFont Title font string, may be null
  1635. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1636. */
  1637. /** @expose */
  1638. titleFont : function(index, titleFont) {
  1639. if (index >= 0 && index < this._numLegends) {
  1640. this._titleFonts[index] = titleFont;
  1641. }
  1642. return this;
  1643. },
  1644. /**
  1645. * Set the entry font style of a legend. If the index is out of range no information is changed.
  1646. * @param (int) index Legend array index
  1647. * @param (String) entryFont Entry font string, may be null
  1648. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1649. */
  1650. /** @expose */
  1651. entryFont : function(index, entryFont) {
  1652. if (index >= 0 && index < this._numLegends) {
  1653. this._entryFonts[index] = entryFont;
  1654. }
  1655. return this;
  1656. },
  1657. /**
  1658. * Set the title fill of a legend. If the index is out of range no information is changed.
  1659. * @param (int) index Legend array index
  1660. * @param (String) titleFill Fill color string, may be null
  1661. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1662. */
  1663. /** @expose */
  1664. titleFill : function(index, titleFill) {
  1665. if (index >= 0 && index < this._numLegends) {
  1666. this._titleFills[index] = titleFill;
  1667. }
  1668. return this;
  1669. },
  1670. /**
  1671. * Set the title font size of a legend. If the index is out of range no information is changed.
  1672. * @param (int) index Legend array index
  1673. * @param (String) titleFontSize Font size string, may be null
  1674. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1675. */
  1676. /** @expose */
  1677. titleFontSize : function(index, titleFontSize) {
  1678. if (index >= 0 && index < this._numLegends) {
  1679. this._titleFontSizes[index] = titleFontSize;
  1680. }
  1681. return this;
  1682. },
  1683. /**
  1684. * Set the title font family of a legend. If the index is out of range no information is changed.
  1685. * @param (int) index Legend array index
  1686. * @param (String) titleFontFamily Font family string, may be null
  1687. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1688. */
  1689. /** @expose */
  1690. titleFontFamily : function(index, titleFontFamily) {
  1691. if (index >= 0 && index < this._numLegends) {
  1692. this._titleFontFamilies[index] = titleFontFamily;
  1693. }
  1694. return this;
  1695. },
  1696. /**
  1697. * Set the scale of a legend. If the index is out of range no information is changed.
  1698. * @param (int) index Legend array index
  1699. * @param (rave['internal']['AbstractScale']) scale Scale, may be null
  1700. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1701. */
  1702. /** @expose */
  1703. scale : function(index, scale) {
  1704. if (index >= 0 && index < this._numLegends) {
  1705. this._scale[index] = scale;
  1706. }
  1707. return this;
  1708. },
  1709. /**
  1710. * Set the swatch size function of a legend. If the index is out of range no information is changed.
  1711. * @param (int) index Legend array index
  1712. * @param (rave['internal']['ValueFunction']) swatchSize Swatch size function, may be null
  1713. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1714. */
  1715. /** @expose */
  1716. swatchSize : function(index, swatchSize) {
  1717. if (index >= 0 && index < this._numLegends) {
  1718. this._swatchSizes[index] = swatchSize;
  1719. }
  1720. return this;
  1721. },
  1722. /**
  1723. * 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.
  1724. * @param (int) index Legend array index
  1725. * @param (Array) entries List of data slot entries, if null an empty list is used
  1726. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  1727. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined, may be null
  1728. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1729. */
  1730. /** @expose */
  1731. formatterList : function(index, entries, format, defaultFunction) {
  1732. if (index >= 0 && index < this._numLegends) {
  1733. this._formatters[index] = this._context.getCustomFormatterWithFlag(["legend", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("legend-label", "ROLE_NONE", format, entries), defaultFunction, false);
  1734. }
  1735. return this;
  1736. },
  1737. /**
  1738. * 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.
  1739. * @param (int) index Legend array index
  1740. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1741. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1742. */
  1743. /** @expose */
  1744. formatter : function(index, entry) {
  1745. var entries = [];
  1746. if (entry) {
  1747. entries.push(entry);
  1748. }
  1749. return this.formatterList(index, entries, "none", null);
  1750. },
  1751. /**
  1752. * 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.
  1753. * @return (boolean) Whether any legend are visible (will be drawn)
  1754. */
  1755. /** @expose */
  1756. anyVisible : function() {
  1757. for (var i = 0; i < this._numLegends; ++i) {
  1758. if (this._visible[i] == true && (this._palettes[i] || this._swatchSizes[i])) {
  1759. return true;
  1760. }
  1761. }
  1762. return false;
  1763. },
  1764. /**
  1765. * 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'])} .
  1766. * @param (int) index Legend array index
  1767. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  1768. * @return (com.ibm.rave.bundles.components.LegendsManager) This LegendsManager
  1769. */
  1770. /** @expose */
  1771. setDataSlot : function(index, entry) {
  1772. if (index >= 0 && index < this._numLegends) {
  1773. this._dataSlotEntries[index] = entry;
  1774. }
  1775. return this.formatter(index, entry);
  1776. },
  1777. preLayout$0 : function(layoutComponent) {
  1778. this.preLayout$1(layoutComponent, true);
  1779. return this;
  1780. },
  1781. preLayout$1 : function(layoutComponent, axesBeforeLegend) {
  1782. var layoutTransition = this._doTransition;
  1783. var layoutDuration = this._duration;
  1784. this._doTransition = false;
  1785. this._duration = 0;
  1786. var children = [];
  1787. for (var i = 0; i < this._numLegends; ++i) {
  1788. children[i] = "g.layoutLegend-" + i;
  1789. }
  1790. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.legends-layout"), children);
  1791. var layoutSelectors = [];
  1792. var layoutLastVisible = [];
  1793. for (var i = 0; i < this._numLegends; ++i) {
  1794. layoutSelectors[i] = this._selectors[i];
  1795. layoutLastVisible[i] = this._lastVisible[i];
  1796. this._lastVisible[i] = false;
  1797. if (this._selectors[i]) {
  1798. this._selectors[i] = this._context.node.select("g.layoutLegend-" + i);
  1799. }
  1800. }
  1801. layoutComponent.preLayout(true, !axesBeforeLegend);
  1802. this.rectangle(layoutComponent.legendRect());
  1803. this.draw();
  1804. this._doTransition = layoutTransition;
  1805. this._duration = layoutDuration;
  1806. this._context.node.select("g.legends-layout").selectAll("*").remove();
  1807. for (var i = 0; i < this._numLegends; ++i) {
  1808. this._lastVisible[i] = layoutLastVisible[i];
  1809. this._selectors[i] = layoutSelectors[i];
  1810. }
  1811. return this;
  1812. },
  1813. /**
  1814. * Render the legends using the current global and per-legend settings.
  1815. * @return (com.ibm.rave.bundles.components.LegendsManager) This object
  1816. */
  1817. /** @expose */
  1818. draw : function() {
  1819. var nVisible = 0;
  1820. for (var i = 0; i < this._numLegends; ++i) {
  1821. if ((this._swatchSizes[i] || this._palettes[i]) && this._visible[i]) {
  1822. nVisible++;
  1823. }
  1824. }
  1825. var x = this._rectangle.x;
  1826. var y = this._rectangle.y;
  1827. var dx;
  1828. var dy;
  1829. var size;
  1830. if (nVisible == 0) {
  1831. dx = 0;
  1832. dy = 0;
  1833. size = [this._rectangle.width, this._rectangle.height];
  1834. } else if ("horizontal" == this._orient) {
  1835. dx = this._rectangle.width / nVisible;
  1836. dy = 0;
  1837. size = [dx, this._rectangle.height];
  1838. } else {
  1839. dx = 0;
  1840. dy = this._rectangle.height / nVisible;
  1841. size = [this._rectangle.width, dy];
  1842. }
  1843. this._comp.orient(this._orient).size(size);
  1844. this._spaceUsed = 0;
  1845. for (var i = 0; i < this._numLegends; ++i) {
  1846. if (this._selectors[i]) {
  1847. var visible = this._visible[i] && (this._palettes[i] || this._swatchSizes[i]);
  1848. 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]);
  1849. var fontStyle = this._context.getPropertyValue("legend.titlestyle.font");
  1850. if (this._titleFonts[i] != null && !(this._titleFonts[i] == "")) {
  1851. this._comp.titleFont(this._titleFonts[i]);
  1852. } else if (fontStyle != null && !(fontStyle == "")) {
  1853. this._comp.titleFont(this._context.getPropertyValue("legend.titlestyle.font"));
  1854. }
  1855. fontStyle = this._context.getPropertyValue("legend.entrystyle.font");
  1856. if (this._entryFonts[i] != null) {
  1857. this._comp.entryFont(this._entryFonts[i]);
  1858. } else if (fontStyle != null && !(fontStyle == "")) {
  1859. this._comp.entryFont(this._context.getPropertyValue("legend.entrystyle.font"));
  1860. }
  1861. var s = (this._doTransition && this._lastVisible[i]) ? this._selectors[i].transition("transition").duration(this._duration) : this._selectors[i];
  1862. s.attr("transform", "translate(" + x + "," + y + ")").call(this._comp);
  1863. var dataSlotEntries = [];
  1864. if (this._dataSlotEntries[i]) {
  1865. dataSlotEntries.push(this._dataSlotEntries[i]);
  1866. }
  1867. this._selectors[i].selectAll(".legendTitle").property("dataSlots", dataSlotEntries);
  1868. if (visible) {
  1869. x += dx;
  1870. y += dy;
  1871. if (this._comp.getSpaceUsed() > this._spaceUsed) {
  1872. this._spaceUsed = this._comp.getSpaceUsed();
  1873. }
  1874. }
  1875. this._lastVisible[i] = visible;
  1876. } else {
  1877. this._lastVisible[i] = false;
  1878. }
  1879. }
  1880. return this;
  1881. },
  1882. /** @expose */
  1883. getSizableType : function() {
  1884. return 2;
  1885. },
  1886. /** @expose */
  1887. getSizableOrientation : function() {
  1888. return this._orient;
  1889. },
  1890. /** @expose */
  1891. getPreferredSize : function() {
  1892. return this._spaceUsed;
  1893. },
  1894. /** @expose */
  1895. getSpillOverSize : function() {
  1896. return 0;
  1897. },
  1898. /** @expose */
  1899. visible : function(a0, a1) {
  1900. var args = arguments;
  1901. if (args.length == 1) {
  1902. return this.visible$1(a0);
  1903. }
  1904. return this.visible$0(a0, a1);
  1905. },
  1906. /** @expose */
  1907. preLayout : function(a0, a1) {
  1908. var args = arguments;
  1909. if (args.length == 1) {
  1910. return this.preLayout$0(a0);
  1911. }
  1912. return this.preLayout$1(a0, a1);
  1913. }
  1914. });
  1915. // $source: com/ibm/rave/bundles/utilities/FontPropertyParser
  1916. /************************************************************************
  1917. ** IBM Confidential
  1918. **
  1919. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1920. **
  1921. ** (C) Copyright IBM Corp. 2017
  1922. **
  1923. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1924. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1925. ************************************************************************/
  1926. // GENERATED
  1927. var com_ibm_rave_bundles_utilities_FontPropertyParser = rave['internal']['Declare']({
  1928. });
  1929. /**
  1930. * Method to parse the css font styles and return a style map.
  1931. * @param (String) fontStyle CSS string (eg. "font-family: courier; font-size: 22; fill: red")
  1932. * @return (Object) Font Style Map
  1933. */
  1934. /** @expose */
  1935. com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont = function(fontStyle) {
  1936. if (fontStyle != null && fontStyle.length > 0) {
  1937. var properties = fontStyle.split(new RegExp(";"));
  1938. var fontStyles = {};
  1939. for (var __i_enFor0 = 0, __len_enFor0 = properties.length;
  1940. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  1941. var property = properties[__i_enFor0];
  1942. var fontMap = property.split(new RegExp(":"));
  1943. if (fontMap.length == 2) {
  1944. var key = fontMap[0].trim();
  1945. fontStyles[key == "color" ? "fill" : key] = fontMap[1].trim();
  1946. }
  1947. }
  1948. return fontStyles;
  1949. }
  1950. return null;
  1951. };
  1952. // $source: com/ibm/rave/bundles/components/AxesManager
  1953. /************************************************************************
  1954. ** IBM Confidential
  1955. **
  1956. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  1957. **
  1958. ** (C) Copyright IBM Corp. 2018
  1959. **
  1960. ** The source code for this program is not published or otherwise divested of its trade secrets,
  1961. ** irrespective of what has been deposited with the U.S. Copyright Office.
  1962. ************************************************************************/
  1963. // GENERATED
  1964. //@import com/ibm/rave/bundles/components/AxisComponentImpl (runtime) // new, getTranslation
  1965. //@import com/ibm/rave/bundles/components/GridComponentImpl (runtime) // new
  1966. //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
  1967. /**
  1968. * <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>
  1969. */
  1970. var com_ibm_rave_bundles_components_AxesManager = rave['internal']['Declare']({
  1971. /**
  1972. * Bundle context
  1973. */
  1974. //_context : null,
  1975. /**
  1976. * Selector for the bundle defs node. If null, no clip paths will be defined.
  1977. */
  1978. //_defs : null,
  1979. /**
  1980. * Scales for the axes, indexed by X1, X2, Y1, Y2
  1981. */
  1982. //_scales : null,
  1983. /**
  1984. * Whether to suppress labels when panning, indexed by X1, X2, Y1, Y2.
  1985. */
  1986. //_suppressPanLabels : null,
  1987. /**
  1988. * Value of the axis drawAxisLabels, set when axis is drawn, indexed by X1, X2, Y1, Y2.
  1989. */
  1990. //_drawAxisLabels : null,
  1991. /**
  1992. * Axis components created on demand, indexed by X1, X2, Y1, Y2
  1993. */
  1994. //_axisComponents : null,
  1995. /**
  1996. * When last drawn, the selector used for each axis role, indexed by X1, X2, Y1, Y2; used for redraws.
  1997. */
  1998. //_lastAxisDrawSelectors : null,
  1999. /**
  2000. * Grid components created on demand, indexed by X1, X2, Y1, Y2
  2001. */
  2002. //_gridComponents : null,
  2003. /**
  2004. * When last drawn, the selector used for each grid role, indexed by X1, X2, Y1, Y2; used for redraws.
  2005. */
  2006. //_lastGridDrawSelectors : null,
  2007. /**
  2008. * For clearing axis
  2009. */
  2010. //_clearAxis : null,
  2011. /**
  2012. * For clearing grid
  2013. */
  2014. //_clearGrid : null,
  2015. /**
  2016. * Selectors for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  2017. */
  2018. //_axisSelectors : null,
  2019. /**
  2020. * Selectors for the grid groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  2021. */
  2022. //_gridSelectors : null,
  2023. /**
  2024. * Bounding rectangles for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
  2025. */
  2026. //_axisRects : null,
  2027. /**
  2028. * Center elements bounds, also the grid bounds.
  2029. */
  2030. //_elementRect : null,
  2031. /**
  2032. * Whether anything was drawn into the axis group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  2033. */
  2034. //_lastAxisDrew : null,
  2035. /**
  2036. * Whether anything was drawn into the grid group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
  2037. */
  2038. //_lastGridDrew : null,
  2039. //_dataSlotEntries : null,
  2040. //_layoutAxisOrder : null,
  2041. /**
  2042. * On the first draw, no transitions are used.
  2043. */
  2044. _firstDraw : false,
  2045. /**
  2046. * Whether to draw the axes and grids.
  2047. */
  2048. _visible : true,
  2049. /**
  2050. * Transition duration, ms
  2051. */
  2052. _duration : 0,
  2053. /**
  2054. * Transpose the axes (assign X to left/right and Y to top/bottom)
  2055. */
  2056. _transpose : false,
  2057. /**
  2058. * Switch the independent (X) axes, drawing X1 where X2 normally goes and vice-versa
  2059. */
  2060. _swapX : false,
  2061. /**
  2062. * Switch the dependent (Y) axes, drawing Y1 where Y2 normally goes and vice-versa
  2063. */
  2064. _swapY : false,
  2065. _layoutInProgress : false,
  2066. _layoutMaxWidth : 0,
  2067. _layoutMaxHeight : 0,
  2068. _xPadding : 0, _xOuterPadding : 0, _yPadding : 0, _yOuterPadding : 0,
  2069. _xPixelPad : 0, _yPixelPad : 0,
  2070. /**
  2071. * Hack to allow heatmap in "unit cell" mode to disable stagger because of the post scaling that messes up axis layout
  2072. */
  2073. _preventStaggerRotate45 : false,
  2074. constructor : function(context) {
  2075. this._scales = [];
  2076. this._suppressPanLabels = [];
  2077. this._drawAxisLabels = [];
  2078. this._axisComponents = [];
  2079. this._lastAxisDrawSelectors = [];
  2080. this._gridComponents = [];
  2081. this._lastGridDrawSelectors = [];
  2082. this._clearAxis = new com_ibm_rave_bundles_components_AxisComponentImpl();
  2083. this._clearGrid = new com_ibm_rave_bundles_components_GridComponentImpl();
  2084. this._axisSelectors = [];
  2085. this._gridSelectors = [];
  2086. this._axisRects = [];
  2087. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  2088. this._lastAxisDrew = [];
  2089. this._lastGridDrew = [];
  2090. this._dataSlotEntries = [];
  2091. this._layoutAxisOrder = [];
  2092. /**
  2093. * Construct and initialize. No axis scales or selector groups are defined.
  2094. * @param (rave['library']['internal']['BundleContext']) context The bundle context
  2095. */
  2096. {
  2097. this._context = context;
  2098. for (var i = 0; i < 4; ++i) {
  2099. this._scales[i] = null;
  2100. this._suppressPanLabels[i] = false;
  2101. this._axisComponents[i] = null;
  2102. this._lastAxisDrawSelectors[i] = null;
  2103. this._gridComponents[i] = null;
  2104. this._lastGridDrawSelectors[i] = null;
  2105. this._axisSelectors[i] = null;
  2106. this._gridSelectors[i] = null;
  2107. this._axisRects[i] = new rave['internal']['RectStruct'](0, 0, 0, 0);
  2108. this._lastAxisDrew[i] = false;
  2109. this._lastGridDrew[i] = false;
  2110. this._dataSlotEntries[i] = [];
  2111. }
  2112. }
  2113. },
  2114. /** @expose */
  2115. preLayout : function(layoutComponent, axesBeforeLegend, xPadding, xOuterPadding, xPixelPad, yPadding, yOuterPadding, yPixelPad) {
  2116. this._xPadding = xPadding;
  2117. this._xOuterPadding = xOuterPadding;
  2118. this._xPixelPad = xPixelPad;
  2119. this._yPadding = yPadding;
  2120. this._yOuterPadding = yOuterPadding;
  2121. this._yPixelPad = yPixelPad;
  2122. this._layoutInProgress = true;
  2123. var layoutDuration = this._duration;
  2124. this._duration = 0;
  2125. 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"];
  2126. rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.axes-layout"), children);
  2127. var layoutAxisSelectors = [];
  2128. var layoutGridSelectors = [];
  2129. var layoutLastAxisDrew = [];
  2130. for (var position = 0; position < 4; ++position) {
  2131. if (this._axisComponents[position]) {
  2132. this._axisComponents[position].preLayout();
  2133. }
  2134. layoutAxisSelectors[position] = this._axisSelectors[position];
  2135. layoutGridSelectors[position] = this._gridSelectors[position];
  2136. layoutLastAxisDrew[position] = this._lastAxisDrew[position];
  2137. if (this._axisSelectors[position]) {
  2138. this.axisSelector(position, this._context.node.select("g.layoutAxis-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  2139. }
  2140. if (this._gridSelectors[position]) {
  2141. this.gridSelector(position, this._context.node.select("g.layoutGrid-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
  2142. }
  2143. }
  2144. layoutComponent.preLayout(axesBeforeLegend, true);
  2145. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutComponent.elementRect());
  2146. var countHorz = 0;
  2147. var countVert = 0;
  2148. var axes = [];
  2149. for (var position = 0; position < 4; ++position) {
  2150. var role = this.positionToRole(position);
  2151. var isHorz = position == 1 || position == 0;
  2152. if (this._axisSelectors[position] && this._scales[role]) {
  2153. if (isHorz) {
  2154. countHorz++;
  2155. } else {
  2156. countVert++;
  2157. }
  2158. if (this._scales[role].isOrdinal() || this._scales[role].isClustered()) {
  2159. var score = isHorz ? 4 : 2;
  2160. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  2161. } else {
  2162. var score = isHorz ? 3 : 1;
  2163. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
  2164. }
  2165. } else {
  2166. axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, 5));
  2167. }
  2168. }
  2169. axes.sort(function(a1, a2) {
  2170. var a1value = a1.score;
  2171. var a2value = a2.score;
  2172. return a1value < a2value ? -1 : a1value > a2value ? 1 : 0;
  2173. });
  2174. this._layoutAxisOrder = [];
  2175. for (var i = 0; i < 4; ++i) {
  2176. this._layoutAxisOrder[i] = axes[i].position;
  2177. }
  2178. this._layoutMaxWidth = this._elementRect.width * (countVert > 1 ? 0.5 : 0.4);
  2179. this._layoutMaxHeight = this._elementRect.height * (countHorz > 1 ? 0.5 : 0.4);
  2180. for (var index = 0; index < 4; ++index) {
  2181. var position = this._layoutAxisOrder[index];
  2182. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], this._elementRect);
  2183. }
  2184. this.draw();
  2185. this._duration = layoutDuration;
  2186. this._context.node.select("g.axes-layout").selectAll("*").remove();
  2187. for (var position = 0; position < 4; ++position) {
  2188. this._lastAxisDrew[position] = layoutLastAxisDrew[position];
  2189. this._axisSelectors[position] = layoutAxisSelectors[position];
  2190. this._gridSelectors[position] = layoutGridSelectors[position];
  2191. }
  2192. this._layoutInProgress = false;
  2193. return this;
  2194. },
  2195. getPositionToDraw : function(index) {
  2196. return this._layoutInProgress ? this._layoutAxisOrder[index] : index;
  2197. },
  2198. preDrawAxis : function(index) {
  2199. if (this._layoutInProgress) {
  2200. var position = this._layoutAxisOrder[index];
  2201. var role = this.positionToRole(position);
  2202. if (role == 0 || role == 1) {
  2203. this.setScaleRangePadded(this._scales[role], false, this._xPadding, this._xOuterPadding, this._xPixelPad);
  2204. } else {
  2205. this.setScaleRangePadded(this._scales[role], true, this._yPadding, this._yOuterPadding, this._yPixelPad);
  2206. }
  2207. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(true);
  2208. }
  2209. },
  2210. postDrawAxis : function(index) {
  2211. if (this._layoutInProgress) {
  2212. var position = this._layoutAxisOrder[index];
  2213. var role = this.positionToRole(position);
  2214. var axis = this._axisComponents[role];
  2215. var size = axis.getPreferredSize();
  2216. if (position == 1 || position == 0) {
  2217. if (size > this._layoutMaxHeight) {
  2218. size = this._layoutMaxHeight;
  2219. }
  2220. this._elementRect.height -= size;
  2221. if (position == 1) {
  2222. this._elementRect.y += size;
  2223. }
  2224. } else {
  2225. if (size > this._layoutMaxWidth) {
  2226. size = this._layoutMaxWidth;
  2227. }
  2228. this._elementRect.width -= size;
  2229. if (position == 2) {
  2230. this._elementRect.x += size;
  2231. }
  2232. }
  2233. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2234. }
  2235. },
  2236. /**
  2237. * 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.
  2238. */
  2239. /** @expose */
  2240. draw : function() {
  2241. for (var role = 0; role < 4; ++role) {
  2242. this._lastAxisDrawSelectors[role] = null;
  2243. this._lastGridDrawSelectors[role] = null;
  2244. }
  2245. for (var index = 0; index < 4; ++index) {
  2246. var position = this.getPositionToDraw(index);
  2247. var role = this.positionToRole(position);
  2248. if (!this._visible || !this._axisSelectors[position] || !this._scales[role]) {
  2249. this.clearAxis(position);
  2250. this.clearGrid(position);
  2251. } else {
  2252. this.preDrawAxis(index);
  2253. this.drawAxis(position, role);
  2254. this.postDrawAxis(index);
  2255. if (this._gridSelectors[position]) {
  2256. this.drawGrid(position, role);
  2257. }
  2258. }
  2259. }
  2260. this._firstDraw = false;
  2261. },
  2262. /**
  2263. * @return (boolean) true if we are hiding any labels during pan-zoom.
  2264. */
  2265. /** @expose */
  2266. hideAnyPanZoom : function() {
  2267. return (this._suppressPanLabels[0] || this._suppressPanLabels[1] || this._suppressPanLabels[2] || this._suppressPanLabels[3]);
  2268. },
  2269. /**
  2270. * 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.
  2271. * @param (boolean) panning Whether this is a pan in-progress; use false otherwise including when pan-zoom ends.
  2272. */
  2273. /** @expose */
  2274. redraw : function(panning) {
  2275. for (var role = 0; role < 4; ++role) {
  2276. if (this._axisComponents[role] && this._lastAxisDrawSelectors[role]) {
  2277. this._axisComponents[role].displayTickLabels(this._drawAxisLabels[role]);
  2278. this._axisComponents[role].showPanZoomTickLabels(!panning || !this._suppressPanLabels[role]);
  2279. var isAllow = this._axisComponents[role].isAllowAutomaticAxisLayoutToChangeOrientation();
  2280. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
  2281. this._lastAxisDrawSelectors[role].call(this._axisComponents[role]);
  2282. this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(isAllow);
  2283. }
  2284. if (this._gridComponents[role] && this._lastGridDrawSelectors[role]) {
  2285. this._lastGridDrawSelectors[role].call(this._gridComponents[role]);
  2286. }
  2287. }
  2288. },
  2289. /** @expose */
  2290. preventStaggerRotate45 : function(preventStaggerRotate45) {
  2291. this._preventStaggerRotate45 = preventStaggerRotate45;
  2292. },
  2293. /**
  2294. * 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.
  2295. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2296. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2297. */
  2298. drawAxis : function(position, role) {
  2299. var axisGroup = this._axisSelectors[position];
  2300. this._lastAxisDrawSelectors[role] = axisGroup;
  2301. var comp = this.axisComponent(role);
  2302. var layoutModeID = role == 2 ? "axis.y.labels.layoutMode" : role == 3 ? "axis.y2.labels.layoutMode" : "axis.x.labels.layoutMode";
  2303. var allowStaggerID = role == 2 ? "axis.y.labels.allowStagger" : role == 3 ? "axis.y2.labels.allowStagger" : "axis.x.labels.allowStagger";
  2304. var allowRotate45ID = role == 2 ? "axis.y.labels.allowRotate45" : role == 3 ? "axis.y2.labels.allowRotate45" : "axis.x.labels.allowRotate45";
  2305. var allowRotate90ID = role == 2 ? "axis.y.labels.allowRotate90" : role == 3 ? "axis.y2.labels.allowRotate90" : "axis.x.labels.allowRotate90";
  2306. var layoutMode = ""+(this._context.getPropertyValue(layoutModeID));
  2307. var allowStagger = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowStaggerID));
  2308. var allowRotate45 = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowRotate45ID));
  2309. var allowRotate90 = (this._context.getPropertyValue(allowRotate90ID));
  2310. var textTruncateIndicator = (this._context.getPropertyValue("axis.labels.truncationText"));
  2311. var axisBounds = this._axisRects[position];
  2312. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2313. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2314. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2315. 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);
  2316. this._drawAxisLabels[role] = comp._displayTickLabels;
  2317. var axisGroupUpdate = axisGroup;
  2318. if (this._duration > 0 && !this._firstDraw && this._lastAxisDrew[position]) {
  2319. axisGroupUpdate = axisGroup.transition().duration(this._duration);
  2320. }
  2321. axisGroupUpdate.attr("transform", axisTransform);
  2322. axisGroupUpdate.call(comp);
  2323. var dataSlotEntryList = this._dataSlotEntries[role];
  2324. axisGroup.selectAll(".axis-title").property("dataSlots", dataSlotEntryList);
  2325. this._lastAxisDrew[position] = comp.renderedShapes();
  2326. if (this._defs) {
  2327. var clipAxis = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this._context.instanceId() + "clip" + orient);
  2328. var text = axisGroup.append("text").text("000,000");
  2329. var bbox = text.node().getBBox();
  2330. var w = bbox.width;
  2331. var h = bbox.height;
  2332. text.remove();
  2333. var clipRect;
  2334. if (position == 0 || position == 1) {
  2335. var leftEdge = axisBounds.x + transform[0] * -1;
  2336. var rightEdge = leftEdge + axisBounds.width;
  2337. if (!(this._scales[role].isOrdinal()) && !(this._scales[role].isClustered())) {
  2338. var numericLeftEdge = this._elementRect.x - w + transform[0] * -1;
  2339. var numericRightEdge = numericLeftEdge + this._elementRect.width + w * 2;
  2340. if (numericLeftEdge < leftEdge) {
  2341. leftEdge = numericLeftEdge;
  2342. }
  2343. if (numericRightEdge > rightEdge) {
  2344. rightEdge = numericRightEdge;
  2345. }
  2346. }
  2347. clipRect = new rave['internal']['RectStruct'](leftEdge, axisBounds.y + transform[1] * -1, rightEdge - leftEdge, axisBounds.height);
  2348. } else {
  2349. clipRect = new rave['internal']['RectStruct'](axisBounds.x + transform[0] * -1, this._elementRect.y - h / 2 + transform[1] * -1, axisBounds.width, this._elementRect.height + h);
  2350. }
  2351. clipAxis.clipRect(clipRect).applyTo(axisGroup.select(".axis." + orient)).call(this._defs);
  2352. }
  2353. },
  2354. /**
  2355. * If the axis selector for the position is defined, clear the shapes from the axis group.
  2356. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2357. */
  2358. clearAxis : function(position) {
  2359. if (this._axisSelectors[position]) {
  2360. this._clearAxis.scale(null);
  2361. this._axisSelectors[position].call(this._clearAxis);
  2362. }
  2363. this._lastAxisDrew[position] = false;
  2364. },
  2365. /**
  2366. * 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.
  2367. * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
  2368. * @param (int) role The axis role, X1, X2, Y1, or Y2
  2369. */
  2370. drawGrid : function(position, role) {
  2371. var gridGroup = this._gridSelectors[position];
  2372. this._lastGridDrawSelectors[role] = gridGroup;
  2373. var comp = this.gridComponent(role);
  2374. var axisBounds = this._axisRects[position];
  2375. var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
  2376. var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
  2377. var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
  2378. comp.setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).orient(orient).setPreExecute(this._context.getPreExecute()).bounds(this._elementRect).axis(this._axisComponents[role].axis());
  2379. if (this._duration <= 0 || this._firstDraw || !this._lastAxisDrew[position]) {
  2380. gridGroup.attr("transform", axisTransform).call(comp);
  2381. } else {
  2382. gridGroup.transition().duration(this._duration).attr("transform", axisTransform).call(comp);
  2383. }
  2384. this._lastGridDrew[position] = comp.renderedShapes();
  2385. },
  2386. /**
  2387. * If the grid selector for the position is defined, clear the shapes from the grid group.
  2388. * @param (int) position The grid position, BOTTOM, TOP, LEFT, RIGHT
  2389. */
  2390. clearGrid : function(position) {
  2391. if (this._gridSelectors[position]) {
  2392. this._clearGrid.axis(null);
  2393. this._gridSelectors[position].call(this._clearGrid);
  2394. }
  2395. this._lastGridDrew[position] = false;
  2396. },
  2397. /**
  2398. * @param (boolean) visible Whether the manager should draw axes
  2399. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2400. */
  2401. /** @expose */
  2402. visible : function(visible) {
  2403. this._visible = visible;
  2404. return this;
  2405. },
  2406. /**
  2407. * @param (int) duration The transition duration; if <= 0, no transition is used.
  2408. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2409. */
  2410. /** @expose */
  2411. duration : function(duration) {
  2412. this._duration = duration;
  2413. return this;
  2414. },
  2415. /**
  2416. * @param (boolean) transpose Whether to transpose the chart (switch the positions of the X and Y axis)
  2417. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2418. */
  2419. /** @expose */
  2420. transpose : function(transpose) {
  2421. this._transpose = transpose;
  2422. return this;
  2423. },
  2424. /**
  2425. * @param (boolean) swapX Whether to switch the postitions of the X1 and X2 axes
  2426. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2427. */
  2428. /** @expose */
  2429. swapX : function(swapX) {
  2430. this._swapX = swapX;
  2431. return this;
  2432. },
  2433. /**
  2434. * @param (boolean) swapY Whether to switch the postitions of the Y1 and Y2 axes
  2435. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2436. */
  2437. /** @expose */
  2438. swapY : function(swapY) {
  2439. this._swapY = swapY;
  2440. return this;
  2441. },
  2442. /**
  2443. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2444. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The coordinate scale for that role, may be null
  2445. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2446. */
  2447. /** @expose */
  2448. scale : function(role, scale) {
  2449. this._scales[role] = scale;
  2450. return this;
  2451. },
  2452. /**
  2453. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2454. * @param (boolean) suppressLabels Whether to suppress the labels when panning the axis
  2455. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2456. */
  2457. /** @expose */
  2458. suppressPanLabels : function(role, suppressLabels) {
  2459. this._suppressPanLabels[role] = suppressLabels;
  2460. return this;
  2461. },
  2462. /**
  2463. * 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.
  2464. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2465. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) The component for the role
  2466. */
  2467. /** @expose */
  2468. axisComponent : function(role) {
  2469. if (!this._axisComponents[role]) {
  2470. this._axisComponents[role] = new com_ibm_rave_bundles_components_AxisComponentImpl();
  2471. }
  2472. return this._axisComponents[role];
  2473. },
  2474. /**
  2475. * 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.
  2476. * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2477. * @return (com.ibm.rave.bundles.components.GridComponentImpl) The component for the role
  2478. */
  2479. /** @expose */
  2480. gridComponent : function(role) {
  2481. if (!this._gridComponents[role]) {
  2482. this._gridComponents[role] = new com_ibm_rave_bundles_components_GridComponentImpl();
  2483. }
  2484. return this._gridComponents[role];
  2485. },
  2486. /**
  2487. * Set the bundle &lt;defs&gt; node. Clip paths will be defined in this node.
  2488. * @param (rave['internal']['Selector']) defs The defs node
  2489. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2490. */
  2491. /** @expose */
  2492. defsSelector : function(defs) {
  2493. this._defs = com_ibm_rave_bundles_components_AxesManager.checkSelector(defs);
  2494. return this;
  2495. },
  2496. /**
  2497. * Set the selector for an axis group node.
  2498. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2499. * @param (rave['internal']['Selector']) axisGroup The axis group node, may be null
  2500. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2501. */
  2502. /** @expose */
  2503. axisSelector : function(position, axisGroup) {
  2504. this._axisSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(axisGroup);
  2505. return this;
  2506. },
  2507. /**
  2508. * Set the selector for a grid group node.
  2509. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2510. * @param (rave['internal']['Selector']) gridGroup The grid group node, may be null
  2511. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2512. */
  2513. /** @expose */
  2514. gridSelector : function(position, gridGroup) {
  2515. this._gridSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(gridGroup);
  2516. return this;
  2517. },
  2518. /**
  2519. * Set the element (grid) bounds rectangle to a copy of the given rectangle.
  2520. * @param (rave['internal']['RectStruct']) elementRect The rectangle, if null the bounds are set to 0,0,0,0
  2521. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2522. */
  2523. /** @expose */
  2524. elementRect : function(elementRect) {
  2525. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, elementRect);
  2526. return this;
  2527. },
  2528. /**
  2529. * Set an axis bounds rectangle to a copy of the given rectangle.
  2530. * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
  2531. * @param (rave['internal']['RectStruct']) axisRect The axis bounds, if null the bounds are set to 0,0,0,0
  2532. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2533. */
  2534. /** @expose */
  2535. axisRect : function(position, axisRect) {
  2536. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], axisRect);
  2537. return this;
  2538. },
  2539. /**
  2540. * 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.
  2541. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2542. */
  2543. /** @expose */
  2544. useDefaultSelectors : function() {
  2545. this.defsSelector(this._context.node.select("defs"));
  2546. this.axisSelector(0, this._context.node.select("g.axisTransform.bottom"));
  2547. this.axisSelector(1, this._context.node.select("g.axisTransform.top"));
  2548. this.axisSelector(2, this._context.node.select("g.axisTransform.left"));
  2549. this.axisSelector(3, this._context.node.select("g.axisTransform.right"));
  2550. this.gridSelector(0, this._context.node.select("g.grid.bottom"));
  2551. this.gridSelector(1, this._context.node.select("g.grid.top"));
  2552. this.gridSelector(2, this._context.node.select("g.grid.left"));
  2553. this.gridSelector(3, this._context.node.select("g.grid.right"));
  2554. return this;
  2555. },
  2556. /**
  2557. * Convenience method: Set the element rectangle and axis rectangles from the rectangles in the layout.
  2558. * @param (com.ibm.rave.bundles.components.ChartLayoutComponentImpl) layoutInfo Layout information
  2559. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2560. */
  2561. /** @expose */
  2562. useBoundsFromLayout : function(layoutInfo) {
  2563. com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutInfo.elementRect());
  2564. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[0], layoutInfo.bottomRect());
  2565. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[1], layoutInfo.topRect());
  2566. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[2], layoutInfo.leftRect());
  2567. com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[3], layoutInfo.rightRect());
  2568. return this;
  2569. },
  2570. /**
  2571. * 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.
  2572. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2573. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2574. */
  2575. /** @expose */
  2576. useDefaultX1Properties : function(setGridParameters) {
  2577. 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"))));
  2578. var titleFontStyle = (this._context.getPropertyValue("axis.x.title.style.font"));
  2579. var labelFontStyle = (this._context.getPropertyValue("axis.x.labels.style.font"));
  2580. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2581. this.axisComponent(0).labelStyle(labelFontStyle);
  2582. } else {
  2583. 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")));
  2584. }
  2585. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2586. this.axisComponent(0).titleStyle(titleFontStyle);
  2587. } else {
  2588. 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")));
  2589. }
  2590. if (setGridParameters) {
  2591. 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")));
  2592. }
  2593. this.suppressPanLabels(0, (this._context.getPropertyValue("axis.x.labels.zoomPan")));
  2594. return this;
  2595. },
  2596. /**
  2597. * 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.
  2598. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2599. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2600. */
  2601. /** @expose */
  2602. useDefaultY1Properties : function(setGridParameters) {
  2603. 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")));
  2604. var titleFontStyle = (this._context.getPropertyValue("axis.y.title.style.font"));
  2605. var labelFontStyle = (this._context.getPropertyValue("axis.y.labels.style.font"));
  2606. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2607. this.axisComponent(2).labelStyle(labelFontStyle);
  2608. } else {
  2609. 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")));
  2610. }
  2611. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2612. this.axisComponent(2).titleStyle(titleFontStyle);
  2613. } else {
  2614. 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")));
  2615. }
  2616. if (setGridParameters) {
  2617. 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")));
  2618. }
  2619. this.suppressPanLabels(2, (this._context.getPropertyValue("axis.y.labels.zoomPan")));
  2620. return this;
  2621. },
  2622. /**
  2623. * 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.
  2624. * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
  2625. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2626. */
  2627. /** @expose */
  2628. useDefaultY2Properties : function(setGridParameters) {
  2629. 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")));
  2630. var titleFontStyle = (this._context.getPropertyValue("axis.y2.title.style.font"));
  2631. var labelFontStyle = (this._context.getPropertyValue("axis.y2.labels.style.font"));
  2632. if (labelFontStyle != null && labelFontStyle.length > 0) {
  2633. this.axisComponent(3).labelStyle(labelFontStyle);
  2634. } else {
  2635. 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")));
  2636. }
  2637. if (titleFontStyle != null && titleFontStyle.length > 0) {
  2638. this.axisComponent(3).titleStyle(titleFontStyle);
  2639. } else {
  2640. 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")));
  2641. }
  2642. if (setGridParameters) {
  2643. 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")));
  2644. }
  2645. this.suppressPanLabels(3, (this._context.getPropertyValue("axis.y2.labels.zoomPan")));
  2646. return this;
  2647. },
  2648. /**
  2649. * 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.
  2650. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2651. * @param (Array) entries Non-null list of data slot entries
  2652. * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
  2653. * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined for the axis, may be null
  2654. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2655. */
  2656. /** @expose */
  2657. setTickFormatterList : function(role, entries, format, defaultFunction) {
  2658. var fmtRole;
  2659. switch (role) {
  2660. case 2:
  2661. fmtRole = "ROLE_Y1";
  2662. break;
  2663. case 1:
  2664. fmtRole = "ROLE_X2";
  2665. break;
  2666. case 3:
  2667. fmtRole = "ROLE_Y2";
  2668. break;
  2669. case 0:
  2670. default:
  2671. fmtRole = "ROLE_X1";
  2672. break;
  2673. }
  2674. 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);
  2675. this.axisComponent(role).tickFormat(fmt);
  2676. 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);
  2677. this.axisComponent(role).simplifiedTickFormat(simplefmt);
  2678. return this;
  2679. },
  2680. /**
  2681. * 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.
  2682. * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2683. * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
  2684. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2685. */
  2686. /** @expose */
  2687. setTickFormatter : function(role, entry) {
  2688. var entries = [];
  2689. if (entry) {
  2690. entries.push(entry);
  2691. }
  2692. return this.setTickFormatterList(role, entries, "none", null);
  2693. },
  2694. /**
  2695. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined scale.
  2696. * @param (Number) padding Padding, relevant only for ordinal scales
  2697. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2698. * @param (int) pixelPad Pixel padding at each end
  2699. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2700. */
  2701. /** @expose */
  2702. setScaleRanges : function(padding, outerPadding, pixelPad) {
  2703. this.setIndependentScaleRanges(padding, outerPadding, pixelPad);
  2704. this.setDependentScaleRanges(padding, outerPadding, pixelPad);
  2705. return this;
  2706. },
  2707. /**
  2708. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2709. * @param (Number) padding Padding, relevant only for ordinal scales
  2710. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2711. * @param (int) pixelPad Pixel padding at each end
  2712. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2713. */
  2714. /** @expose */
  2715. setIndependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2716. this.setScaleRangePadded(this._scales[0], false, padding, outerPadding, pixelPad);
  2717. this.setScaleRangePadded(this._scales[1], false, padding, outerPadding, pixelPad);
  2718. return this;
  2719. },
  2720. /**
  2721. * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
  2722. * @param (Number) padding Padding, relevant only for ordinal scales
  2723. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2724. * @param (int) pixelPad Pixel padding at each end
  2725. * @return (com.ibm.rave.bundles.components.AxesManager) This object
  2726. */
  2727. /** @expose */
  2728. setDependentScaleRanges : function(padding, outerPadding, pixelPad) {
  2729. this.setScaleRangePadded(this._scales[2], true, padding, outerPadding, pixelPad);
  2730. this.setScaleRangePadded(this._scales[3], true, padding, outerPadding, pixelPad);
  2731. return this;
  2732. },
  2733. /**
  2734. * 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)} .
  2735. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2736. * @param (rave['library']['internal']['DataSlotEntry']) slot DataSlotEntry to be associated with the axis role.
  2737. */
  2738. setDataSlot$0 : function(role, slot) {
  2739. this.setDataSlot$1(role, [slot]);
  2740. return this;
  2741. },
  2742. /**
  2743. * Set a list of data slot entries that will be associated with the specified axis role.
  2744. * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
  2745. * @param (Array) slots List of DataSlotEntry to be associated with the axis role.
  2746. */
  2747. setDataSlot$1 : function(role, slots) {
  2748. if (role < 4 && role >= 0) {
  2749. this._dataSlotEntries[role].length = 0;
  2750. if (slots) {
  2751. for (var __i_enFor0 = 0, __exp_enFor0 = slots, __len_enFor0 = __exp_enFor0.length;
  2752. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  2753. var slot = __exp_enFor0[__i_enFor0];
  2754. this._dataSlotEntries[role].push(slot);
  2755. }
  2756. }
  2757. }
  2758. return this;
  2759. },
  2760. /**
  2761. * </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.
  2762. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale Bundle independent scale
  2763. * @param (boolean) dependent Whether this is the dependent scale
  2764. * @param (Number) padding Padding, relevant only for ordinal scales
  2765. * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
  2766. * @param (int) pixelPad Pixel padding at each end
  2767. */
  2768. setScaleRangePadded : function(scale, dependent, padding, outerPadding, pixelPad) {
  2769. if (scale) {
  2770. var min, max;
  2771. if (dependent == this._transpose) {
  2772. min = this._elementRect.x + pixelPad;
  2773. max = this._elementRect.x + this._elementRect.width - pixelPad;
  2774. } else {
  2775. if (scale.isContinuous()) {
  2776. min = this._elementRect.y + this._elementRect.height - pixelPad;
  2777. max = this._elementRect.y + pixelPad;
  2778. } else {
  2779. min = this._elementRect.y + pixelPad;
  2780. max = this._elementRect.y + this._elementRect.height - pixelPad;
  2781. }
  2782. }
  2783. scale.range(min, max, padding, outerPadding);
  2784. }
  2785. },
  2786. /**
  2787. * Given a geometric position BOTTOM, TOP, LEFT, or RIGHT, return the role X1, X2, Y1, or Y2 used by that role.
  2788. * @param (int) position The position index
  2789. * @return (int) The role index
  2790. */
  2791. positionToRole : function(position) {
  2792. var r = position;
  2793. if (this._transpose) {
  2794. r = (r + 2) % 4;
  2795. }
  2796. if (this._swapX && r < 2) {
  2797. r = 1 - r;
  2798. }
  2799. if (this._swapY && r > 1) {
  2800. r = 5 - r;
  2801. }
  2802. return r;
  2803. },
  2804. /**
  2805. * Given a role X1, X2, Y1, or Y2, return the geometric position BOTTOM, TOP, LEFT, or RIGHT for that role.
  2806. * @param (int) role The role index
  2807. * @return (int) The position index
  2808. */
  2809. roleToPosition : function(role) {
  2810. var p = role;
  2811. if (this._swapX && role < 2) {
  2812. p = 1 - p;
  2813. }
  2814. if (this._swapY && p > 1) {
  2815. p = 5 - p;
  2816. }
  2817. if (this._transpose) {
  2818. p = (p + 2) % 4;
  2819. }
  2820. return p;
  2821. },
  2822. /**
  2823. * Sets the magnitude for the tick interval.
  2824. * @param (int) role role index of the axis
  2825. * @param (Number) tickMagnitude power of 10
  2826. * @return (com.ibm.rave.bundles.components.AxesManager) this
  2827. */
  2828. /** @expose */
  2829. scaleTickMagnitude : function(role, tickMagnitude) {
  2830. this.axisComponent(role).scaleTickMagnitude(tickMagnitude);
  2831. return this;
  2832. },
  2833. /** @expose */
  2834. setDataSlot : function(a0, a1) {
  2835. var args = arguments;
  2836. if (args.length == 2 && typeof a1 === "function") {
  2837. return this.setDataSlot$0(a0, a1);
  2838. }
  2839. return this.setDataSlot$1(a0, a1);
  2840. }
  2841. });
  2842. /**
  2843. * @param (rave['internal']['Selector']) s A selector
  2844. * @return (rave['internal']['Selector']) s if it is non-null and has at least one node, null otherwise
  2845. */
  2846. com_ibm_rave_bundles_components_AxesManager.checkSelector = function(s) {
  2847. return s && !(s.empty()) ? s : null;
  2848. };
  2849. /**
  2850. * Set a rectangle to a copy of another. If the source is null, the target is set to 0,0,0,0
  2851. * @param (rave['internal']['RectStruct']) target A non-null rectangle
  2852. * @param (rave['internal']['RectStruct']) source A possibly-null rectnalge
  2853. */
  2854. com_ibm_rave_bundles_components_AxesManager.setRect = function(target, source) {
  2855. if (source) {
  2856. target.x = source.x;
  2857. target.y = source.y;
  2858. target.width = source.width;
  2859. target.height = source.height;
  2860. } else {
  2861. target.x = 0;
  2862. target.y = 0;
  2863. target.width = 0;
  2864. target.height = 0;
  2865. }
  2866. };
  2867. /**
  2868. * A ValueFunction that appends '%' to the value.
  2869. * @param (int) n Number of digits
  2870. */
  2871. /** @expose */
  2872. com_ibm_rave_bundles_components_AxesManager.percentFormat = function(n) {
  2873. var digits = "." + n + "f";
  2874. var format = rave.format(digits);
  2875. return function(value, ix, gix) {
  2876. return format.call(null, value, 0, 0) + "%";
  2877. };
  2878. };
  2879. /**
  2880. * Called prior to chart layout. Axes are configured with no real bounding constraints to calculate their preferred size.
  2881. */
  2882. com_ibm_rave_bundles_components_AxesManager.AxisLayout = rave['internal']['Declare']({
  2883. /** @expose */
  2884. position : 0,
  2885. /** @expose */
  2886. score : 0,
  2887. constructor : function(position, score) {
  2888. this.position = position;
  2889. this.score = score;
  2890. }
  2891. });
  2892. /**
  2893. * Logical first X (independent) axis, default position bottom
  2894. */
  2895. /** @expose */
  2896. com_ibm_rave_bundles_components_AxesManager.X1 = 0;
  2897. /**
  2898. * Logical second X (independent) axis, default position top
  2899. */
  2900. /** @expose */
  2901. com_ibm_rave_bundles_components_AxesManager.X2 = 1;
  2902. /**
  2903. * Logical first Y (dependent) axis, default position left
  2904. */
  2905. /** @expose */
  2906. com_ibm_rave_bundles_components_AxesManager.Y1 = 2;
  2907. /**
  2908. * Logical first Y (dependent) axis, default position right
  2909. */
  2910. /** @expose */
  2911. com_ibm_rave_bundles_components_AxesManager.Y2 = 3;
  2912. /**
  2913. * Geometric group on bottom
  2914. */
  2915. /** @expose */
  2916. com_ibm_rave_bundles_components_AxesManager.BOTTOM = 0;
  2917. /**
  2918. * Geometric group on top
  2919. */
  2920. /** @expose */
  2921. com_ibm_rave_bundles_components_AxesManager.TOP = 1;
  2922. /**
  2923. * Geometric group on left
  2924. */
  2925. /** @expose */
  2926. com_ibm_rave_bundles_components_AxesManager.LEFT = 2;
  2927. /**
  2928. * Geometric group on right
  2929. */
  2930. /** @expose */
  2931. com_ibm_rave_bundles_components_AxesManager.RIGHT = 3;
  2932. /**
  2933. * Maps the role indexes to the role strings used by the components API
  2934. */
  2935. com_ibm_rave_bundles_components_AxesManager.ROLES = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2936. /**
  2937. * Maps the role indexes to the role strings used by the custom formatter API. TODO: Unify the strings
  2938. */
  2939. com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
  2940. /**
  2941. * Maps the position indexes to the orient strings used by D3
  2942. */
  2943. com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS = ["bottom", "top", "left", "right"];
  2944. /**
  2945. * Maps the position indexes to the custom formatter strings
  2946. */
  2947. com_ibm_rave_bundles_components_AxesManager.FORMATTERS = ["bottom", "top", "left", "right"];
  2948. // $source: com/ibm/rave/bundles/component/AxisComponent
  2949. /************************************************************************
  2950. ** IBM Confidential
  2951. **
  2952. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  2953. **
  2954. ** (C) Copyright IBM Corp. 2017
  2955. **
  2956. ** The source code for this program is not published or otherwise divested of its trade secrets,
  2957. ** irrespective of what has been deposited with the U.S. Copyright Office.
  2958. ************************************************************************/
  2959. // GENERATED
  2960. /**
  2961. * <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>
  2962. */
  2963. var com_ibm_rave_bundles_component_AxisComponent = rave['internal']['Declare'].implement(
  2964. /**
  2965. * @return (String) The role of the axis in the chart
  2966. */
  2967. //role : function() {},
  2968. /**
  2969. * @return (rave['internal']['Axis']) The capability Axis used by this AxisComponent
  2970. */
  2971. //axis : function() {},
  2972. /**
  2973. * The tickFormat is applied to the values of the ticks to create the string that is displayed.
  2974. * @param (rave['internal']['ValueFunction']) tickFormat The new tickFormat
  2975. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2976. */
  2977. //tickFormat : function(tickFormat) {},
  2978. /**
  2979. * Get the tickFormat function used by this component. May be null.
  2980. * @return (rave['internal']['ValueFunction']) Format function, or null
  2981. */
  2982. //tickFormat : function() {},
  2983. /**
  2984. * Set the indicator to be used for truncated text ex: indicator set to "..." , results in helloworld - > hello...
  2985. * @param (String) indicator the string to be placed to indicated truncated text
  2986. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2987. */
  2988. //textTruncateIndicator : function(indicator) {},
  2989. /**
  2990. * Whether to display the axis title.
  2991. * @param (boolean) displayAxisTitle true to display the axis title, false otherwise
  2992. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2993. */
  2994. //displayAxisTitle : function(displayAxisTitle) {},
  2995. /**
  2996. * Whether to display the axis line.
  2997. * @param (boolean) displayAxisLine true to display the axis line, false otherwise
  2998. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  2999. */
  3000. //displayAxisLine : function(displayAxisLine) {},
  3001. /**
  3002. * Whether to display the axis tick marks.
  3003. * @param (boolean) displayTicks true to display the axis ticks, false otherwise
  3004. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3005. */
  3006. //displayTicks : function(displayTicks) {},
  3007. /**
  3008. * Whether to display the axis labels, as set by the show axis labels property
  3009. * @param (boolean) displayTickLabels true to display the axis tick labels, false otherwise
  3010. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3011. */
  3012. //displayTickLabels : function(displayTickLabels) {},
  3013. /**
  3014. * Whether to display the axis labels, as set by the hide pan-zoom labels property
  3015. * @param (boolean) showPanZoomTickLabels true to display the axis tick labels, false otherwise
  3016. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3017. */
  3018. //showPanZoomTickLabels : function(showPanZoomTickLabels) {},
  3019. /**
  3020. * @param (String) axisTitle The new axisTitle
  3021. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3022. */
  3023. //axisTitle : function(axisTitle) {},
  3024. /**
  3025. * 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)} .
  3026. * @param (String) axisColor The new line and tick color
  3027. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3028. */
  3029. //axisColor : function(axisColor) {},
  3030. /**
  3031. * The color used to draw the axis line.
  3032. * @param (String) lineColor The new lineColor
  3033. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3034. */
  3035. //lineColor : function(lineColor) {},
  3036. /**
  3037. * The color used to draw the axis ticks.
  3038. * @param (String) tickColor The new tickColor
  3039. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3040. */
  3041. //tickColor : function(tickColor) {},
  3042. /**
  3043. * The color used to draw the axis labels.
  3044. * @param (String) labelColor The new labelColor
  3045. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3046. */
  3047. //labelColor : function(labelColor) {},
  3048. /**
  3049. * The style for the axis labels.
  3050. * @param (String) fontStyle CSS string of font properties
  3051. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3052. */
  3053. //labelStyle : function(fontStyle) {},
  3054. /**
  3055. * The style for the axis labels.
  3056. * @param (String) fill The color used to draw the labels
  3057. * @param (String) fontSize CSS font size
  3058. * @param (String) fontFamily CSS font-families list
  3059. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3060. */
  3061. //labelStyle : function(fill, fontSize, fontFamily) {},
  3062. /**
  3063. * The color used to draw the axis title.
  3064. * @param (String) titleColor The new titleColor
  3065. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3066. */
  3067. //titleColor : function(titleColor) {},
  3068. /**
  3069. * The style for the axis title.
  3070. * @param (String) fontStyle CSS string of font properties
  3071. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3072. */
  3073. //titleStyle : function(fontStyle) {},
  3074. /**
  3075. * The style for the axis title.
  3076. * @param (String) fill The color used to draw the title
  3077. * @param (String) fontSize CSS font size
  3078. * @param (String) fontFamily CSS font-families list
  3079. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  3080. */
  3081. //titleStyle : function(fill, fontSize, fontFamily) {}
  3082. );
  3083. /**
  3084. * The string returned by {@link #this.type()} is "AxisComponent".
  3085. */
  3086. /** @expose */
  3087. com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE = "AxisComponent";
  3088. /**
  3089. * Returned by {@link #this.role()} for the first independent axis.
  3090. */
  3091. /** @expose */
  3092. com_ibm_rave_bundles_component_AxisComponent.ROLE_X1 = "ROLE_X1";
  3093. /**
  3094. * Returned by {@link #this.role()} for the first dependent axis.
  3095. */
  3096. /** @expose */
  3097. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y1 = "ROLE_Y1";
  3098. /**
  3099. * Returned by {@link #this.role()} for the second independent axis.
  3100. */
  3101. /** @expose */
  3102. com_ibm_rave_bundles_component_AxisComponent.ROLE_X2 = "ROLE_X2";
  3103. /**
  3104. * Returned by {@link #this.role()} for the second dependent axis.
  3105. */
  3106. /** @expose */
  3107. com_ibm_rave_bundles_component_AxisComponent.ROLE_Y2 = "ROLE_Y2";
  3108. // $source: com/ibm/rave/bundles/utilities/TextCrossfader
  3109. /************************************************************************
  3110. ** IBM Confidential
  3111. **
  3112. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3113. **
  3114. ** (C) Copyright IBM Corp. 2017
  3115. **
  3116. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3117. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3118. ************************************************************************/
  3119. // GENERATED
  3120. /**
  3121. * <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>
  3122. */
  3123. var com_ibm_rave_bundles_utilities_TextCrossfader = rave['internal']['Declare']({
  3124. });
  3125. /**
  3126. * <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!
  3127. * @param (rave['internal']['Selection']) selection Selection containing the single text node, may be a transition
  3128. * @param (String) oldText Old value of the text string, may be null
  3129. * @param (String) newText New value of the text string, may be null
  3130. * @param (Object) fillOpacity Fill opacity, may be null (in which case 1.0 is assumed)
  3131. * @param (double) delay Number between 0 and 0.5 controlling the timing of the fade
  3132. * @return (rave['internal']['Selection']) The selection, modified by the new text and fill-opacity
  3133. */
  3134. /** @expose */
  3135. com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade = function(selection, oldText, newText, fillOpacity, delay) {
  3136. if (!(selection.isTransition())) {
  3137. return selection.text(newText);
  3138. }
  3139. var _t = (selection).tween("text", function(data, index, groupIndex) {
  3140. return function(t) {
  3141. this.rave_setText(t < 0.5 ? oldText : newText);
  3142. };
  3143. });
  3144. var t0 = Math.max(0.0, Math.min(0.5, delay));
  3145. if (t0 == 0.5 || (oldText == null && newText == null) || (oldText != null && oldText == newText)) {
  3146. return selection;
  3147. }
  3148. var opacity = fillOpacity == null ? 1.0 : + (fillOpacity);
  3149. var tf = 1.0 / (0.5 - t0);
  3150. return _t.tween("fill-opacity", function(data, index, groupIndex) {
  3151. return function(t) {
  3152. if (t <= t0 || t >= (1.0 - t0)) {
  3153. this.rave_setStyle("fill-opacity", fillOpacity);
  3154. } else {
  3155. this.rave_setStyle("fill-opacity", opacity * Math.abs(t - 0.5) * tf);
  3156. }
  3157. };
  3158. });
  3159. };
  3160. // $source: com/ibm/rave/bundles/utilities/BundleLabelDropper
  3161. /************************************************************************
  3162. ** IBM Confidential
  3163. **
  3164. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3165. **
  3166. ** (C) Copyright IBM Corp. 2017
  3167. **
  3168. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3169. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3170. ************************************************************************/
  3171. // GENERATED
  3172. var com_ibm_rave_bundles_utilities_BundleLabelDropper = rave['internal']['Declare']({
  3173. //_dropOverlap : null,
  3174. labelCount : 0,
  3175. _$functionClassMethod : function() {
  3176. var _$self = function(args) {
  3177. if (args !== null || arguments.length > 1){
  3178. args = Array.prototype.slice.call(arguments, 0);
  3179. }
  3180. {
  3181. _$self.drop(args[0], ((args[1])));
  3182. return null;
  3183. }
  3184. };
  3185. return _$self;
  3186. },
  3187. /** @expose */
  3188. constructor : function() {
  3189. this._dropOverlap = (rave.capabilities.extension("position")).drop().remove(false);
  3190. this._dropOverlap.setOverlapGap(4.0);
  3191. },
  3192. /**
  3193. * Drop the overlapping labels or reset the overlap.
  3194. * @param (rave['internal']['Selection']) labels The selector for the labels
  3195. * @param (boolean) removeOverlap true to remove the overlapping labels, false to reset
  3196. */
  3197. /** @expose */
  3198. drop : function(labels, removeOverlap) {
  3199. if (!(labels.isTransition())) {
  3200. this.applyLabelDrop(labels, removeOverlap);
  3201. } else {
  3202. var steps = [0, 25, 75];
  3203. var self = this;
  3204. (labels).tween("__pointLabelDrop__", function(data, index, groupIndex) {
  3205. if (index == 0) {
  3206. return function(t) {
  3207. var currentStep = Math.floor(t * 100);
  3208. if (steps.length > 0 && currentStep < 100 && currentStep >= steps[0]) {
  3209. steps.splice(0, 1);
  3210. self.applyLabelDrop(labels, removeOverlap);
  3211. }
  3212. };
  3213. }
  3214. return null;
  3215. });
  3216. this.labelCount = 0;
  3217. (labels).each(function(data, index, groupIndex) {
  3218. ++self.labelCount;
  3219. }).each("end", function(args) {
  3220. if (args !== null || arguments.length > 1){
  3221. args = Array.prototype.slice.call(arguments, 0);
  3222. }
  3223. {
  3224. if (--self.labelCount == 0) {
  3225. self.applyLabelDrop(labels, removeOverlap);
  3226. }
  3227. return null;
  3228. }
  3229. });
  3230. }
  3231. },
  3232. applyLabelDrop : function(labels, removeOverlap) {
  3233. if (removeOverlap) {
  3234. labels.call(this._dropOverlap);
  3235. } else {
  3236. this._dropOverlap.reset(labels);
  3237. }
  3238. },
  3239. /** @expose */
  3240. configureForDataLabels : function(rect) {
  3241. if (rect) {
  3242. var ex = [[rect.x, rect.y], [rect.x + rect.width, rect.y + rect.height]];
  3243. this._dropOverlap.extent(ex);
  3244. }
  3245. this._dropOverlap.noClipping();
  3246. }
  3247. });
  3248. /**
  3249. * Drop overlap extension
  3250. */
  3251. //com_ibm_rave_bundles_utilities_BundleLabelDropper.POSITION_EXTENSION = "position";
  3252. /**
  3253. * space between labels during overlap testing
  3254. */
  3255. com_ibm_rave_bundles_utilities_BundleLabelDropper.OVERLAP_GAP = 4;
  3256. // $source: com/ibm/rave/bundles/components/StyleStructs
  3257. /************************************************************************
  3258. ** IBM Confidential
  3259. **
  3260. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3261. **
  3262. ** (C) Copyright IBM Corp. 2017
  3263. **
  3264. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3265. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3266. ************************************************************************/
  3267. // GENERATED
  3268. /**
  3269. * Struct classes to hold style properties.
  3270. */
  3271. var com_ibm_rave_bundles_components_StyleStructs = rave['internal']['Declare']({
  3272. });
  3273. /**
  3274. * Filled shape style properties.
  3275. */
  3276. com_ibm_rave_bundles_components_StyleStructs.ShapeStyle = function() {
  3277. this._fill = null;
  3278. this._stroke = null;
  3279. this._strokeWidth = null;
  3280. };
  3281. /**
  3282. * Line style properties.
  3283. */
  3284. com_ibm_rave_bundles_components_StyleStructs.LineStyle = function() {
  3285. this._stroke = null;
  3286. this._strokeWidth = null;
  3287. this._dashArray = null;
  3288. };
  3289. // $source: com/ibm/rave/bundles/component/GridComponent
  3290. /************************************************************************
  3291. ** IBM Confidential
  3292. **
  3293. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3294. **
  3295. ** (C) Copyright IBM Corp. 2017
  3296. **
  3297. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3298. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3299. ************************************************************************/
  3300. // GENERATED
  3301. /**
  3302. * <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>
  3303. */
  3304. var com_ibm_rave_bundles_component_GridComponent = rave['internal']['Declare'].implement(
  3305. /**
  3306. * @return (String) The role of the grid in the chart
  3307. */
  3308. //role : function() {},
  3309. /**
  3310. * Whether to display the gridlines.
  3311. * @param (boolean) displayGridlines The new displayGridlines
  3312. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3313. */
  3314. //displayGridlines : function(displayGridlines) {},
  3315. /**
  3316. * Set the line styling. Equivalent to calling {@link #this.gridlineColor(String)} and {@link #this.dashArray(String)} .
  3317. * @param (String) stroke The stroke color
  3318. * @param (String) dashArray The stroke-dasharray
  3319. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3320. */
  3321. //gridlineStyle : function(stroke, dashArray) {},
  3322. /**
  3323. * The color used to draw the gridlines.
  3324. * @param (String) gridlineColor The new stroke color
  3325. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3326. */
  3327. //gridlineColor : function(gridlineColor) {},
  3328. /**
  3329. * 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.
  3330. * @param (String) dashArray The new dash array
  3331. * @return (com.ibm.rave.bundles.component.GridComponent) This component
  3332. */
  3333. //dashArray : function(dashArray) {}
  3334. );
  3335. /**
  3336. * The string returned by {@link #this.type()} is "GridComponent".
  3337. */
  3338. /** @expose */
  3339. com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE = "GridComponent";
  3340. // $source: com/ibm/rave/bundles/components/IntervalDataUtilities
  3341. /************************************************************************
  3342. ** IBM Confidential
  3343. **
  3344. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3345. **
  3346. ** (C) Copyright IBM Corp. 2017
  3347. **
  3348. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3349. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3350. ************************************************************************/
  3351. // GENERATED
  3352. /**
  3353. * 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.
  3354. */
  3355. var com_ibm_rave_bundles_components_IntervalDataUtilities = rave['internal']['Declare']({
  3356. });
  3357. /**
  3358. * <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>
  3359. * @param (Array) data Data array
  3360. * @param (rave['internal']['SingleValueFunction']) x X accessor, should not be null
  3361. * @param (rave['internal']['SingleValueFunction']) xScale Function to check if the X value is valid
  3362. * @param (rave['internal']['SingleValueFunction']) y Y accessor, should not be null
  3363. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3364. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3365. * @return (Array) Array of intervals for the data
  3366. */
  3367. /** @expose */
  3368. com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars = function(data, x, xScale, y, yStart, color, label) {
  3369. var result = [];
  3370. if (!data || data.length == 0 || !x || !y) {
  3371. return result;
  3372. }
  3373. data.forEach(function(d, ix, list) {
  3374. var xv = x(d);
  3375. if (xv != null && (!xScale || xScale(xv) != null)) {
  3376. var yv = y(d);
  3377. var yvStart = !yStart ? 0 : yStart(d);
  3378. if (yv != null && yvStart != null) {
  3379. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3380. r.key = ix;
  3381. r.ind1 = xv;
  3382. r.ind2 = r.ind1;
  3383. r.cind = r.ind1;
  3384. r.dep1 = yvStart;
  3385. r.dep2 = yv;
  3386. r.cdep = r.dep2;
  3387. r.color = color ? color(d) : null;
  3388. r.label = label ? label(d) : null;
  3389. r.value = r.dep2;
  3390. r._originalData = d;
  3391. r.valueAsPercentOfCategory = 100;
  3392. result.push(r);
  3393. }
  3394. }
  3395. return null;
  3396. });
  3397. var sum = 0;
  3398. for (var i = 0; i < result.length; ++i) {
  3399. var iData = result[i];
  3400. var value = + (iData.value);
  3401. sum += Math.abs(value);
  3402. }
  3403. if (sum != 0) {
  3404. for (var i = 0; i < result.length; ++i) {
  3405. var iData = result[i];
  3406. var value = + (iData.value);
  3407. iData.valueAsPercentOfColor = value / sum * 100;
  3408. }
  3409. }
  3410. return result;
  3411. };
  3412. /**
  3413. * Create intervals for bars in a clustered chart. This is similar to the simple bars, except the independent values are an array of accessors.
  3414. * @param (Array) data Data array
  3415. * @param (Array) x Independent accessor array, should not be null and no entries should be null
  3416. * @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
  3417. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3418. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3419. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3420. * @return (Array) Array of intervals for the data
  3421. */
  3422. /** @expose */
  3423. com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars = function(data, x, xScale, y, yStart, color, label) {
  3424. var result = [];
  3425. if (!data || data.length == 0 || !x || x.length == 0 || !y) {
  3426. return result;
  3427. }
  3428. var len = x.length;
  3429. var categories = {};
  3430. var colors = {};
  3431. data.forEach(function(d, ix, list) {
  3432. var OK = true;
  3433. var ind = [];
  3434. for (var i = 0; i < len; ++i) {
  3435. var xv = x[i](d);
  3436. if (xv == null || (xScale[i] && xScale[i](xv) == null)) {
  3437. OK = false;
  3438. break;
  3439. }
  3440. ind.push(xv);
  3441. if (i == 0) {
  3442. if (!(categories.hasOwnProperty(xv))) {
  3443. categories[""+(xv)] = 1;
  3444. }
  3445. } else if (!(colors.hasOwnProperty(xv))) {
  3446. colors[""+(xv)] = 1;
  3447. }
  3448. }
  3449. var dep = y(d);
  3450. var depStart = !yStart ? 0 : yStart(d);
  3451. if (OK && dep != null && depStart != null) {
  3452. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3453. r.key = ix;
  3454. r.ind1 = ind;
  3455. r.ind2 = ind;
  3456. r.cind = ind;
  3457. r.dep1 = depStart;
  3458. r.dep2 = dep;
  3459. r.cdep = r.dep2;
  3460. r.color = color ? color(d) : null;
  3461. r.label = label ? label(d) : null;
  3462. r.value = r.dep2;
  3463. r._originalData = d;
  3464. result.push(r);
  3465. }
  3466. return null;
  3467. });
  3468. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3469. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3470. var o = __exp_enFor0[__i_enFor0];
  3471. var s = ""+(o);
  3472. var sum = 0;
  3473. for (var i = 0; i < result.length; ++i) {
  3474. var iData = result[i];
  3475. if (s == (iData.ind1)[0]) {
  3476. var value = + (iData.value);
  3477. sum += Math.abs(value);
  3478. }
  3479. }
  3480. if (sum == 0) {
  3481. continue;
  3482. }
  3483. for (var i = 0; i < result.length; ++i) {
  3484. var iData = result[i];
  3485. if (s == (iData.ind1)[0]) {
  3486. var value = + (iData.value);
  3487. iData.valueAsPercentOfCategory = value / sum * 100;
  3488. }
  3489. }
  3490. }
  3491. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3492. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3493. var o = __exp_enFor1[__i_enFor1];
  3494. var s = ""+(o);
  3495. var sum = 0;
  3496. for (var i = 0; i < result.length; ++i) {
  3497. var iData = result[i];
  3498. if (s == iData.color) {
  3499. var value = + (iData.value);
  3500. sum += Math.abs(value);
  3501. }
  3502. }
  3503. if (sum == 0) {
  3504. continue;
  3505. }
  3506. for (var i = 0; i < result.length; ++i) {
  3507. var iData = result[i];
  3508. if (s == iData.color) {
  3509. var value = + (iData.value);
  3510. iData.valueAsPercentOfColor = value / sum * 100;
  3511. }
  3512. }
  3513. }
  3514. return result;
  3515. };
  3516. /**
  3517. * 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.
  3518. * @param (Array) data Data array
  3519. * @param (rave['internal']['SingleValueFunction']) x Independent accessor, should not be null
  3520. * @param (rave['internal']['SingleValueFunction']) xScale Possibly-null function to check if X values are in domain
  3521. * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
  3522. * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
  3523. * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
  3524. * @param (boolean) percent If true, create percent bars
  3525. * @return (Array) Array of intervals for the data
  3526. */
  3527. /** @expose */
  3528. com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars = function(data, x, xScale, y, color, label, percent) {
  3529. var result = [];
  3530. if (!data || data.length == 0 || !x || !y) {
  3531. return result;
  3532. }
  3533. var stacks = {};
  3534. var categories = {};
  3535. var colors = {};
  3536. data.forEach(function(d, ix, list) {
  3537. var xv = x(d);
  3538. if (xv != null && (!xScale || xScale(xv) != null)) {
  3539. var yv = y(d);
  3540. if (yv != null) {
  3541. var stack = stacks[xv];
  3542. if (!stack) {
  3543. stack = new com_ibm_rave_bundles_components_IntervalDataUtilities.Stack();
  3544. stacks[xv] = stack;
  3545. }
  3546. var dVal = + (yv);
  3547. if (!percent) {
  3548. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3549. r.key = ix;
  3550. r.ind1 = xv;
  3551. r.ind2 = xv;
  3552. r.cind = xv;
  3553. var sum = dVal < 0.0 ? stack.negativeSum : stack.positiveSum;
  3554. r.dep1 = sum;
  3555. r.dep2 = sum + dVal;
  3556. r.cdep = r.dep2;
  3557. r.color = color ? color(d) : null;
  3558. r.label = label ? label(d) : null;
  3559. r.value = dVal;
  3560. r._originalData = d;
  3561. result.push(r);
  3562. }
  3563. if (dVal < 0.0) {
  3564. stack.negativeSum += dVal;
  3565. } else {
  3566. stack.positiveCount++;
  3567. stack.positiveSum += dVal;
  3568. }
  3569. if (!(categories.hasOwnProperty(xv))) {
  3570. categories[""+(xv)] = 1;
  3571. }
  3572. if (color) {
  3573. var o = color(d);
  3574. if ((o != null) && !(colors.hasOwnProperty(o))) {
  3575. colors[""+(o)] = 1;
  3576. }
  3577. }
  3578. }
  3579. }
  3580. return null;
  3581. });
  3582. if (percent) {
  3583. data.forEach(function(d, ix, list) {
  3584. var xv = x(d);
  3585. if (xv != null && (!xScale || xScale(xv) != null)) {
  3586. var yv = y(d);
  3587. if (yv != null) {
  3588. var stack = stacks[xv];
  3589. var dVal = + (yv);
  3590. var percent;
  3591. if (dVal < 0.0) {
  3592. percent = -100.0 * dVal / stack.negativeSum;
  3593. } else if (stack.positiveSum > 0) {
  3594. percent = 100.0 * dVal / stack.positiveSum;
  3595. } else {
  3596. percent = 100.0 / stack.positiveCount;
  3597. }
  3598. var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
  3599. r.key = ix;
  3600. r.ind1 = xv;
  3601. r.ind2 = xv;
  3602. r.cind = xv;
  3603. var sum = dVal < 0.0 ? stack.negativePercent : stack.positivePercent;
  3604. r.dep1 = sum;
  3605. r.dep2 = sum + percent;
  3606. r.cdep = r.dep2;
  3607. r.color = color ? color(d) : null;
  3608. r.label = label ? label(d) : null;
  3609. r.value = dVal;
  3610. r.valueAsPercentOfCategory = percent;
  3611. r._originalData = d;
  3612. result.push(r);
  3613. if (dVal < 0.0) {
  3614. stack.negativePercent += percent;
  3615. } else {
  3616. stack.positivePercent += percent;
  3617. }
  3618. }
  3619. }
  3620. return null;
  3621. });
  3622. } else {
  3623. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
  3624. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3625. var o = __exp_enFor0[__i_enFor0];
  3626. var s = ""+(o);
  3627. var sum = 0;
  3628. for (var i = 0; i < result.length; ++i) {
  3629. var iData = result[i];
  3630. if (s == iData.ind1) {
  3631. var value = + (iData.value);
  3632. sum += Math.abs(value);
  3633. }
  3634. }
  3635. if (sum == 0) {
  3636. continue;
  3637. }
  3638. for (var i = 0; i < result.length; ++i) {
  3639. var iData = result[i];
  3640. if (s == iData.ind1) {
  3641. var value = + (iData.value);
  3642. iData.valueAsPercentOfCategory = value / sum * 100;
  3643. }
  3644. }
  3645. }
  3646. }
  3647. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
  3648. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  3649. var o = __exp_enFor1[__i_enFor1];
  3650. var s = ""+(o);
  3651. var sum = 0;
  3652. for (var i = 0; i < result.length; ++i) {
  3653. var iData = result[i];
  3654. if (s == iData.color) {
  3655. var value = + (iData.value);
  3656. sum += Math.abs(value);
  3657. }
  3658. }
  3659. if (sum == 0) {
  3660. continue;
  3661. }
  3662. for (var i = 0; i < result.length; ++i) {
  3663. var iData = result[i];
  3664. if (s == iData.color) {
  3665. var value = + (iData.value);
  3666. iData.valueAsPercentOfColor = value / sum * 100;
  3667. }
  3668. }
  3669. }
  3670. return result;
  3671. };
  3672. /**
  3673. * Structure class holding interval information.
  3674. */
  3675. com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData = rave['internal']['Declare']({
  3676. /**
  3677. * Key value; for now this is the data index
  3678. */
  3679. /** @expose */
  3680. key : null,
  3681. /**
  3682. * First independent value
  3683. */
  3684. /** @expose */
  3685. ind1 : null,
  3686. /**
  3687. * Second independent value (in all current uses, same as ind1)
  3688. */
  3689. /** @expose */
  3690. ind2 : null,
  3691. /**
  3692. * First dependent value
  3693. */
  3694. /** @expose */
  3695. dep1 : null,
  3696. /**
  3697. * Second dependent value
  3698. */
  3699. /** @expose */
  3700. dep2 : null,
  3701. /**
  3702. * The data value that the interval represents. Not the pixel value. Used in stacked chart
  3703. */
  3704. /** @expose */
  3705. value : null,
  3706. /**
  3707. * Color value
  3708. */
  3709. /** @expose */
  3710. color : null,
  3711. /**
  3712. * Label value
  3713. */
  3714. /** @expose */
  3715. label : null,
  3716. /**
  3717. * Callout independent value (in all current uses, same as ind1)
  3718. */
  3719. /** @expose */
  3720. cind : null,
  3721. /**
  3722. * Callout dependent value (dependent extent)
  3723. */
  3724. /** @expose */
  3725. cdep : null,
  3726. /** @expose */
  3727. _originalData : null,
  3728. /**
  3729. * The data value (in percentage) for specific category
  3730. */
  3731. /** @expose */
  3732. valueAsPercentOfCategory : NaN,
  3733. /**
  3734. * The data value (in percentage) across all categories
  3735. */
  3736. /** @expose */
  3737. valueAsPercentOfColor : NaN,
  3738. /** @expose */
  3739. originalData : function() {
  3740. return this._originalData;
  3741. },
  3742. /** @expose */
  3743. originalDataList : function() {
  3744. var list = [];
  3745. list.push(this._originalData);
  3746. return list;
  3747. }
  3748. });
  3749. com_ibm_rave_bundles_components_IntervalDataUtilities.Stack = function() {
  3750. this.positiveCount = 0;
  3751. this.positiveSum = 0;
  3752. this.negativeSum = 0;
  3753. this.positivePercent = 0;
  3754. this.negativePercent = 0;
  3755. };
  3756. /**
  3757. * Accessor for the callout dependent value
  3758. */
  3759. /** @expose */
  3760. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_DEPENDENT_ACCESSOR = function(data) {
  3761. return (data).cdep;
  3762. };
  3763. /**
  3764. * Accessor for the callout independent value
  3765. */
  3766. /** @expose */
  3767. com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_INDEPENDENT_ACCESSOR = function(data) {
  3768. return (data).cind;
  3769. };
  3770. /**
  3771. * Accessor for the data value
  3772. */
  3773. /** @expose */
  3774. com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR = function(data) {
  3775. return (data).value;
  3776. };
  3777. /**
  3778. * Accessor for data value as percent of category
  3779. */
  3780. /** @expose */
  3781. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(data) {
  3782. var percent = (data).valueAsPercentOfCategory;
  3783. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3784. };
  3785. /**
  3786. * Accessor for data value as percent of color (series)
  3787. */
  3788. /** @expose */
  3789. com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(data) {
  3790. var percent = (data).valueAsPercentOfColor;
  3791. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3792. };
  3793. // $source: com/ibm/rave/bundles/data/PointDataUtilities
  3794. /************************************************************************
  3795. ** IBM Confidential
  3796. **
  3797. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3798. **
  3799. ** (C) Copyright IBM Corp. 2017
  3800. **
  3801. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3802. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3803. ************************************************************************/
  3804. // GENERATED
  3805. /**
  3806. * Utility class for building arrays of point datum objects from tabular data.
  3807. */
  3808. var com_ibm_rave_bundles_data_PointDataUtilities = rave['internal']['Declare']({
  3809. });
  3810. /**
  3811. * <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>
  3812. * @param (Array) data Input data, list of arbitrary objects
  3813. * @param (rave['internal']['SingleValueFunction']) xAccessor X accessor function, may be null
  3814. * @param (rave['internal']['SingleValueFunction']) xScale Scale to test if the X value should be included, may be null
  3815. * @param (rave['internal']['SingleValueFunction']) yAccessor Y accessor function, may be null
  3816. * @param (rave['internal']['SingleValueFunction']) yScale Scale to test if the Y value should be included, may be null
  3817. * @return (Array) List of PointData objects
  3818. */
  3819. /** @expose */
  3820. com_ibm_rave_bundles_data_PointDataUtilities.buildPoints = function(data, xAccessor, xScale, yAccessor, yScale) {
  3821. var result = [];
  3822. if (data) {
  3823. for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
  3824. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  3825. var o = __exp_enFor0[__i_enFor0];
  3826. if (o != null) {
  3827. var xv = null;
  3828. if (xAccessor) {
  3829. xv = xAccessor(o);
  3830. if (xv == null || (xScale && xScale(xv) == null)) {
  3831. continue;
  3832. }
  3833. }
  3834. var yv = null;
  3835. if (yAccessor) {
  3836. yv = yAccessor(o);
  3837. if (yv == null || (yScale && yScale(yv) == null)) {
  3838. continue;
  3839. }
  3840. }
  3841. var datum = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
  3842. datum._x = xv;
  3843. datum._y = yv;
  3844. datum._originalData = o;
  3845. result.push(datum);
  3846. }
  3847. }
  3848. }
  3849. return result;
  3850. };
  3851. /**
  3852. * 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.
  3853. */
  3854. com_ibm_rave_bundles_data_PointDataUtilities.PointDatum = rave['internal']['Declare']({
  3855. /**
  3856. * The X value
  3857. */
  3858. /** @expose */
  3859. _x : null,
  3860. /**
  3861. * The Y value
  3862. */
  3863. /** @expose */
  3864. _y : null,
  3865. /**
  3866. * The data value (in percentage) that the point represents
  3867. */
  3868. /** @expose */
  3869. _yAsPercentOfCategory : null,
  3870. /**
  3871. * The data value (in percentage) that the point represents
  3872. */
  3873. /** @expose */
  3874. _yAsPercentOfColor : null,
  3875. /**
  3876. * The original data
  3877. */
  3878. /** @expose */
  3879. _originalData : null,
  3880. /** @expose */
  3881. originalData : function() {
  3882. return this._originalData;
  3883. },
  3884. /** @expose */
  3885. originalDataList : function() {
  3886. var list = [];
  3887. list.push(this._originalData);
  3888. return list;
  3889. }
  3890. });
  3891. /**
  3892. * Accessor returning the _x property of a PointDatum.
  3893. */
  3894. /** @expose */
  3895. com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR = function(d) {
  3896. return (d)._x;
  3897. };
  3898. /**
  3899. * Accessor returning the _y property of a PointDatum.
  3900. */
  3901. /** @expose */
  3902. com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR = function(d) {
  3903. return (d)._y;
  3904. };
  3905. /**
  3906. * Accessor returning the _yAsPercentOfCategory property of a PointDatum.
  3907. */
  3908. /** @expose */
  3909. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(d) {
  3910. var percent = + ((d)._yAsPercentOfCategory);
  3911. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3912. };
  3913. /**
  3914. * Accessor returning the _yAsPercentOfColor property of a PointDatum.
  3915. */
  3916. /** @expose */
  3917. com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(d) {
  3918. var percent = + ((d)._yAsPercentOfColor);
  3919. return isNaN(percent) ? "" : percent.toFixed(1) + "%";
  3920. };
  3921. // $source: com/ibm/rave/bundles/utilities/ColorUtil
  3922. /************************************************************************
  3923. ** IBM Confidential
  3924. **
  3925. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3926. **
  3927. ** (C) Copyright IBM Corp. 2017
  3928. **
  3929. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3930. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3931. ************************************************************************/
  3932. // GENERATED
  3933. var com_ibm_rave_bundles_utilities_ColorUtil = rave['internal']['Declare']({
  3934. });
  3935. /**
  3936. * It is used to get a foreground color which has atleast a 4.5 contrast ratio with the background color.
  3937. * @param (Object) bg bakground color
  3938. * @param (Object) fg foreground color
  3939. * @return (Object) a color ( darker/ligher/same fg color ) which contrast with background.
  3940. */
  3941. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0 = function(bg, fg) {
  3942. var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(bg, fg);
  3943. if (contrastRatio < 4.5) {
  3944. var bgHSL = rave.hsl(bg);
  3945. var fgHSL = rave.hsl(fg);
  3946. 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);
  3947. if (brightness > 0.5) {
  3948. if (bgHSL.getL() > 0.5) {
  3949. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), bgHSL.getL() - 0.4));
  3950. } else {
  3951. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), 0.1));
  3952. }
  3953. } else {
  3954. if (bgHSL.getL() < 0.5) {
  3955. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), bgHSL.getL() + 0.4));
  3956. } else {
  3957. return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), 0.9));
  3958. }
  3959. }
  3960. }
  3961. return fg;
  3962. };
  3963. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1 = function(labelColor) {
  3964. var labelRGB = rave.rgb(labelColor);
  3965. return labelRGB.contrastShift(21);
  3966. };
  3967. /** @expose */
  3968. com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio = function(colorA, colorB) {
  3969. var foregroundLuminance = rave.rgb(colorA).getLuminance();
  3970. var backgroundLuminance = rave.rgb(colorB).getLuminance();
  3971. var contrastRatio = (foregroundLuminance >= backgroundLuminance) ? (foregroundLuminance + 0.05) / (backgroundLuminance + 0.05) : (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
  3972. return contrastRatio;
  3973. };
  3974. /** @expose */
  3975. com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor = function(a0, a1) {
  3976. var args = arguments;
  3977. if (args.length == 1) {
  3978. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1(a0);
  3979. }
  3980. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0(a0, a1);
  3981. };
  3982. // $source: com/ibm/rave/bundles/component/IntervalComponent
  3983. /************************************************************************
  3984. ** IBM Confidential
  3985. **
  3986. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  3987. **
  3988. ** (C) Copyright IBM Corp. 2017
  3989. **
  3990. ** The source code for this program is not published or otherwise divested of its trade secrets,
  3991. ** irrespective of what has been deposited with the U.S. Copyright Office.
  3992. ************************************************************************/
  3993. // GENERATED
  3994. /**
  3995. * <p> A component that renders interval elements (rectangles based on data, showing an extent in both X and Y dimensions, as in a bar chart). The {@link #this.type()} method returns "IntervalComponent". </p>
  3996. */
  3997. var com_ibm_rave_bundles_component_IntervalComponent = rave['internal']['Declare'].implement(
  3998. /**
  3999. * Turn labels on or off. If labels are on but there is no label data, empty text nodes will be created.
  4000. * @param (boolean) itemLabel Whether to use labels
  4001. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  4002. */
  4003. //itemLabel : function(itemLabel) {},
  4004. /**
  4005. * @param (boolean) _itemOverlap Whether to show/hide overlap labels
  4006. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  4007. */
  4008. //itemOverlap : function(_itemOverlap) {},
  4009. /**
  4010. * Sets function that will specify position of item label for given chart element.
  4011. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  4012. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  4013. */
  4014. //itemLabelPosition : function(labelPosition) {},
  4015. /**
  4016. * Set the border width, which is also the stroke width.
  4017. * @param (String) width
  4018. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  4019. */
  4020. //borderWidth : function(width) {},
  4021. /**
  4022. * Set the border color.
  4023. * @param (String) borderColor
  4024. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  4025. */
  4026. //borderColor : function(borderColor) {},
  4027. /**
  4028. * Set the classname of the labellayer
  4029. * @param (String) string
  4030. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  4031. */
  4032. //labelLayerClassName : function(string) {},
  4033. /**
  4034. * Set the classname of the elementlayer
  4035. * @param (String) string
  4036. * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
  4037. */
  4038. //elementLayerClassName : function(string) {},
  4039. /**
  4040. * @param bounds The bounds of the chart area.
  4041. */
  4042. //bounds : function(chartRect) {}
  4043. );
  4044. /**
  4045. * The string returned by {@link #this.type()} is "IntervalComponent".
  4046. */
  4047. /** @expose */
  4048. com_ibm_rave_bundles_component_IntervalComponent.COMPONENT_TYPE = "IntervalComponent";
  4049. // $source: com/ibm/rave/bundles/utilities/LabelStyleUtil
  4050. /************************************************************************
  4051. ** IBM Confidential
  4052. **
  4053. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4054. **
  4055. ** (C) Copyright IBM Corp. 2017
  4056. **
  4057. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4058. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4059. ************************************************************************/
  4060. // GENERATED
  4061. //@import com/ibm/rave/bundles/components/FilterComponentImpl (runtime) // new
  4062. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor, getContrastRatio
  4063. /**
  4064. * This class can be used to apply styles on labels. Eg: when we need to overrule the given label style properties.
  4065. */
  4066. var com_ibm_rave_bundles_utilities_LabelStyleUtil = rave['internal']['Declare']({
  4067. //_labelFontStyle : null,
  4068. //_contrastLabelColorfilter : null,
  4069. //_sameLabelColorfilter : null,
  4070. /**
  4071. * eg: apply contrast label color with background. apply different font size for each level label. apply a contrast shadow for a label.
  4072. */
  4073. //_labelFillColor : null,
  4074. //_labelFontSize : null,
  4075. _labelShadow : false,
  4076. _$functionClassMethod : function() {
  4077. var _$self = function(args) {
  4078. if (args !== null || arguments.length > 1){
  4079. args = Array.prototype.slice.call(arguments, 0);
  4080. }
  4081. {
  4082. if (_$self._labelFontStyle) {
  4083. for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(_$self._labelFontStyle), __len_enFor0 = __exp_enFor0.length;
  4084. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4085. var stylenName = __exp_enFor0[__i_enFor0];
  4086. if ((stylenName == "fill" || stylenName == "color" && _$self._labelFillColor) || (stylenName == "font-size" && _$self._labelFontSize) || (stylenName == "text-shadow" && _$self._labelShadow == true)) {
  4087. continue;
  4088. }
  4089. this.style(stylenName, _$self._labelFontStyle[stylenName]);
  4090. }
  4091. }
  4092. if (_$self._labelFillColor) {
  4093. this.style("fill", _$self._labelFillColor);
  4094. }
  4095. if (_$self._labelFontSize) {
  4096. this.style("font-size", _$self._labelFontSize);
  4097. }
  4098. var labels = this.selectAll("*");
  4099. if (labels.length == 0) {
  4100. labels = this;
  4101. }
  4102. if (_$self._labelShadow) {
  4103. var self = _$self;
  4104. var defaultLabelFill = _$self.getDefaultLabelColor(_$self._labelFontStyle);
  4105. _$self._contrastLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("contrast_label_drop_shadow");
  4106. _$self._contrastLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill)));
  4107. _$self._sameLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("same_label_drop_shadow");
  4108. _$self._sameLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(defaultLabelFill));
  4109. var owner = this.node().rave_getOwner();
  4110. rave.select(owner).select("defs").call(_$self._contrastLabelColorfilter);
  4111. rave.select(owner).select("defs").call(_$self._sameLabelColorfilter);
  4112. this.each(function(data, index, groupIndex) {
  4113. if (self._labelFillColor) {
  4114. var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(rave.rgb(self._labelFillColor.call(this, data, index, groupIndex)), defaultLabelFill);
  4115. if (contrastRatio < 4.5) {
  4116. this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
  4117. } else {
  4118. this.setAttribute("filter", "url(#" + self._sameLabelColorfilter.getId() + ")");
  4119. }
  4120. } else {
  4121. this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
  4122. }
  4123. });
  4124. labels.each(function(data, index, groupIndex) {
  4125. if (self._labelFillColor) {
  4126. this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._labelFillColor.call(this, data, index, groupIndex)).toString());
  4127. } else {
  4128. this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill).toString());
  4129. }
  4130. });
  4131. } else {
  4132. labels.each(function(data, index, groupIndex) {
  4133. this.rave_setProperty("_rave_drop_shadow", null);
  4134. });
  4135. this.attr("filter", null);
  4136. }
  4137. return null;
  4138. }
  4139. };
  4140. return _$self;
  4141. },
  4142. /** @expose */
  4143. labelFont : function(labelFontStyle) {
  4144. this._labelFontStyle = labelFontStyle;
  4145. return this;
  4146. },
  4147. /** @expose */
  4148. labelFillColor : function(_labelFillColor) {
  4149. this._labelFillColor = _labelFillColor;
  4150. return this;
  4151. },
  4152. /** @expose */
  4153. labelFontSize : function(_labelFontSize) {
  4154. this._labelFontSize = _labelFontSize;
  4155. return this;
  4156. },
  4157. /** @expose */
  4158. labelShadow : function(labelShadow) {
  4159. this._labelShadow = labelShadow;
  4160. return this;
  4161. },
  4162. /** @expose */
  4163. getDefaultLabelColor : function(_labelStyle) {
  4164. if (!_labelStyle) {
  4165. return "#000000";
  4166. }
  4167. var defaultFillColor;
  4168. if (_labelStyle) {
  4169. defaultFillColor = _labelStyle["fill"];
  4170. if (defaultFillColor == null) {
  4171. defaultFillColor = _labelStyle["color"];
  4172. }
  4173. }
  4174. if (defaultFillColor == null) {
  4175. defaultFillColor = "#000000";
  4176. }
  4177. return defaultFillColor.toString();
  4178. }
  4179. });
  4180. // $source: com/ibm/rave/bundles/component/LabelCollisionComponent
  4181. /************************************************************************
  4182. ** IBM Confidential
  4183. **
  4184. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4185. **
  4186. ** (C) Copyright IBM Corp. 2017
  4187. **
  4188. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4189. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4190. ************************************************************************/
  4191. // GENERATED
  4192. /**
  4193. */
  4194. var com_ibm_rave_bundles_component_LabelCollisionComponent = rave['internal']['Declare'].implement(
  4195. );
  4196. /**
  4197. * The string returned by {@link #this.type()} is "LabelCollisionComponent".
  4198. */
  4199. /** @expose */
  4200. com_ibm_rave_bundles_component_LabelCollisionComponent.COMPONENT_TYPE = "LabelCollisionComponent";
  4201. // $source: com/ibm/rave/bundles/utilities/PathUtils
  4202. /************************************************************************
  4203. ** IBM Confidential
  4204. **
  4205. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4206. **
  4207. ** (C) Copyright IBM Corp. 2017
  4208. **
  4209. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4210. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4211. ************************************************************************/
  4212. // GENERATED
  4213. var com_ibm_rave_bundles_utilities_PathUtils = rave['internal']['Declare']({
  4214. });
  4215. /**
  4216. * 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.
  4217. * @param (rave['internal']['Selection']) selection A selection (either Selector or Transition) containing "path" elements.
  4218. * @param (rave['internal']['ValueFunction']) pathFunction The path string generator function, e.g. Rave.svg.line().
  4219. */
  4220. /** @expose */
  4221. com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn = function(selection, pathFunction) {
  4222. if (selection.isTransition()) {
  4223. var transition = selection;
  4224. transition.ease("linear").styleTween("opacity", function(data, index, value) {
  4225. var path = rave.select(this);
  4226. if (!(this.rave_hasProperty("__rave_originalOpacity__"))) {
  4227. this.rave_setProperty("__rave_originalOpacity__", path.style("opacity"));
  4228. }
  4229. var styleOpacity = this.rave_getProperty("__rave_originalOpacity__");
  4230. var opacity = styleOpacity != null ? parseFloat(""+(styleOpacity)) : 1.0;
  4231. var mid1 = 0.45, mid2 = 0.55;
  4232. var s = rave.scale.linear().domain([0.0, mid1, mid2, 1.0]).range([opacity, 0.0, 0.0, opacity]);
  4233. var setPath = [];
  4234. setPath[0] = false;
  4235. return function(t) {
  4236. if (t > mid1 && !setPath[0]) {
  4237. path.attr("d", pathFunction);
  4238. setPath[0] = true;
  4239. }
  4240. return + (s.call(null, t, 0, 0));
  4241. };
  4242. });
  4243. transition.each("end", function(args) {
  4244. if (args !== null || arguments.length > 1){
  4245. args = Array.prototype.slice.call(arguments, 0);
  4246. }
  4247. {
  4248. this.rave_removeProperty("__rave_originalOpacity__");
  4249. return null;
  4250. }
  4251. });
  4252. } else {
  4253. selection.attr("d", pathFunction);
  4254. }
  4255. };
  4256. //com_ibm_rave_bundles_utilities_PathUtils.OPACITY = "opacity";
  4257. //com_ibm_rave_bundles_utilities_PathUtils.ORIGINAL_OPACITY = "__rave_originalOpacity__";
  4258. //com_ibm_rave_bundles_utilities_PathUtils.PATH_DATA = "d";
  4259. //com_ibm_rave_bundles_utilities_PathUtils.EASE_LINEAR = "linear";
  4260. // $source: com/ibm/rave/bundles/component/LineComponent
  4261. /************************************************************************
  4262. ** IBM Confidential
  4263. **
  4264. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4265. **
  4266. ** (C) Copyright IBM Corp. 2017
  4267. **
  4268. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4269. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4270. ************************************************************************/
  4271. // GENERATED
  4272. /**
  4273. * <p> A component that renders line elements (polylines, each with a series of points in X and Y dimensions, as in a line chart). The {@link #this.type()} method returns "LineComponent". </p>
  4274. */
  4275. var com_ibm_rave_bundles_component_LineComponent = rave['internal']['Declare'].implement(
  4276. /**
  4277. * The interpolation modes are from the RAVE core line path generator, for example "linear", "cardinal".
  4278. * @param (String) interpolate The interpolation mode
  4279. * @return (com.ibm.rave.bundles.component.LineComponent) This component
  4280. */
  4281. //interpolate : function(interpolate) {}
  4282. );
  4283. /**
  4284. * The string returned by {@link #this.type()} is "LineComponent".
  4285. */
  4286. /** @expose */
  4287. com_ibm_rave_bundles_component_LineComponent.COMPONENT_TYPE = "LineComponent";
  4288. // $source: com/ibm/rave/bundles/data/LineDataUtilities
  4289. /************************************************************************
  4290. ** IBM Confidential
  4291. **
  4292. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4293. **
  4294. ** (C) Copyright IBM Corp. 2017
  4295. **
  4296. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4297. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4298. ************************************************************************/
  4299. // GENERATED
  4300. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // new
  4301. /**
  4302. * <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>
  4303. */
  4304. var com_ibm_rave_bundles_data_LineDataUtilities = rave['internal']['Declare']({
  4305. });
  4306. /**
  4307. * <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>
  4308. * @param (Array) data Array of data objects
  4309. * @param (rave['internal']['SingleValueFunction']) xAccessor Non-null X accessor function
  4310. * @param (rave['internal']['SingleValueFunction']) xScale Value function used to check if X value is in domain
  4311. * @param (rave['internal']['SingleValueFunction']) yAccessor Non-null Y accessor function
  4312. * @param (rave['internal']['SingleValueFunction']) groupAccessor Possibly-null group accessor function
  4313. * @return (Array) Non-null but possibly empty array of LineData items, one per distinct group value
  4314. */
  4315. /** @expose */
  4316. com_ibm_rave_bundles_data_LineDataUtilities.buildLines = function(data, xAccessor, xScale, yAccessor, groupAccessor) {
  4317. var result = [];
  4318. if (!data || data.length == 0) {
  4319. return result;
  4320. }
  4321. var categories = {};
  4322. var noGroup;
  4323. var lines = {};
  4324. for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
  4325. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4326. var datum = __exp_enFor0[__i_enFor0];
  4327. if (datum == null) {
  4328. continue;
  4329. }
  4330. var xValue = xAccessor(datum);
  4331. if (xValue != null && (!xScale || xScale(xValue) != null)) {
  4332. if (!(categories.hasOwnProperty(xValue))) {
  4333. categories[""+(xValue)] = 1;
  4334. }
  4335. var group = groupAccessor ? (groupAccessor(datum)) : null;
  4336. var line;
  4337. if (group == null) {
  4338. if (!noGroup) {
  4339. noGroup = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(null);
  4340. result.push(noGroup);
  4341. }
  4342. line = noGroup;
  4343. } else {
  4344. line = lines[group];
  4345. if (!line) {
  4346. line = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(group);
  4347. lines[group] = line;
  4348. result.push(line);
  4349. }
  4350. }
  4351. line.addPoint(datum, xValue, yAccessor(datum));
  4352. }
  4353. }
  4354. for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(categories), __len_enFor1 = __exp_enFor1.length;
  4355. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  4356. var o = __exp_enFor1[__i_enFor1];
  4357. var s = ""+(o);
  4358. var sum = 0;
  4359. for (var i = 0; i < result.length; ++i) {
  4360. var lineDatum = result[i];
  4361. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  4362. var pointDatum = lineDatum._pointData[j];
  4363. if (s == pointDatum._x) {
  4364. pointDatum._yAsPercentOfCategory = NaN;
  4365. var value = + (pointDatum._y);
  4366. sum += Math.abs(value);
  4367. }
  4368. }
  4369. }
  4370. if (sum == 0) {
  4371. continue;
  4372. }
  4373. for (var i = 0; i < result.length; ++i) {
  4374. var lineDatum = result[i];
  4375. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  4376. var pointDatum = lineDatum._pointData[j];
  4377. if (s == pointDatum._x) {
  4378. var value = + (pointDatum._y);
  4379. pointDatum._yAsPercentOfCategory = value / sum * 100;
  4380. }
  4381. }
  4382. }
  4383. }
  4384. for (var i = 0; i < result.length; ++i) {
  4385. var sum = 0;
  4386. var lineDatum = result[i];
  4387. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  4388. var pointDatum = lineDatum._pointData[j];
  4389. pointDatum._yAsPercentOfColor = NaN;
  4390. var value = + (pointDatum._y);
  4391. sum += Math.abs(value);
  4392. }
  4393. if (sum != 0) {
  4394. for (var j = 0; j < lineDatum._pointData.length; ++j) {
  4395. var pointDatum = lineDatum._pointData[j];
  4396. var value = + (pointDatum._y);
  4397. pointDatum._yAsPercentOfColor = value / sum * 100;
  4398. }
  4399. }
  4400. }
  4401. return result;
  4402. };
  4403. com_ibm_rave_bundles_data_LineDataUtilities.get = function(val, data) {
  4404. for (var i = 0; i < data.length; ++i) {
  4405. var entry = data[i];
  4406. if (entry.key===val) {
  4407. return entry;
  4408. }
  4409. }
  4410. return null;
  4411. };
  4412. /** @expose */
  4413. com_ibm_rave_bundles_data_LineDataUtilities.buildLinesForStacking = function(data, xAccessor, yAccessor, groupAccessor) {
  4414. if (!data || data.length == 0) {
  4415. return [];
  4416. }
  4417. var keyToOriginalValue = {};
  4418. var stacks = [];
  4419. var nest = rave.nest();
  4420. nest.key(function(d) {
  4421. var keyValue = xAccessor(d);
  4422. var strKeyValue = (keyValue);
  4423. keyToOriginalValue[strKeyValue] = keyValue;
  4424. return strKeyValue;
  4425. });
  4426. nest.key(function(d) {
  4427. var stack = groupAccessor(d).toString();
  4428. if (!(stacks.indexOf(stack)> -1)) {
  4429. stacks.push(stack);
  4430. }
  4431. return stack;
  4432. });
  4433. var result = nest.entries(data);
  4434. var missingValue = new Number(0);
  4435. var stackData = stacks.map(function(name, index, array) {
  4436. var line = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(array[index].valueOf());
  4437. result.forEach(function(currentValue, index, array) {
  4438. var values = currentValue.values;
  4439. var currentElement = com_ibm_rave_bundles_data_LineDataUtilities.get(line.group, values);
  4440. var datum = null;
  4441. var yValue = null;
  4442. if (!currentElement) {
  4443. yValue = missingValue;
  4444. } else {
  4445. datum = (currentElement.values)[0];
  4446. yValue = yAccessor(datum);
  4447. if (yValue == null) {
  4448. yValue = missingValue;
  4449. }
  4450. }
  4451. line.addPoint(datum, keyToOriginalValue[currentValue.key], yValue);
  4452. return null;
  4453. });
  4454. return line;
  4455. });
  4456. return stackData;
  4457. };
  4458. /**
  4459. * <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>
  4460. * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
  4461. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale A non-null scale
  4462. */
  4463. /** @expose */
  4464. com_ibm_rave_bundles_data_LineDataUtilities.sortLines = function(lines, scale) {
  4465. var comp = function(a, b) {
  4466. var av = scale.center(a._x);
  4467. if (av == null) {
  4468. return 1;
  4469. }
  4470. var bv = scale.center(b._x);
  4471. if (bv == null) {
  4472. return -1;
  4473. }
  4474. var v = av - bv;
  4475. return v < 0 ? -1 : v > 0 ? 1 : 0;
  4476. };
  4477. for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
  4478. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4479. var line = __exp_enFor0[__i_enFor0];
  4480. line.sort(comp);
  4481. }
  4482. };
  4483. /**
  4484. * 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.
  4485. * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
  4486. * @return (Array) Array of PointDatum for points where X and Y are both non-null
  4487. */
  4488. /** @expose */
  4489. com_ibm_rave_bundles_data_LineDataUtilities.getLineWithPoints = function(lines) {
  4490. var result = [];
  4491. for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
  4492. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4493. var line = __exp_enFor0[__i_enFor0];
  4494. line.getLineWithPoints(result);
  4495. }
  4496. return result;
  4497. };
  4498. /**
  4499. * 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.
  4500. * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
  4501. * @return (Array) Array of PointDatum for points meeting the null-point-null criterion
  4502. */
  4503. /** @expose */
  4504. com_ibm_rave_bundles_data_LineDataUtilities.getNPNPoints = function(lines) {
  4505. var result = [];
  4506. for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
  4507. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4508. var line = __exp_enFor0[__i_enFor0];
  4509. line.getNPNPoints(result);
  4510. }
  4511. return result;
  4512. };
  4513. /**
  4514. * <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>
  4515. */
  4516. com_ibm_rave_bundles_data_LineDataUtilities.LineDatum = rave['internal']['Declare']({
  4517. /**
  4518. * Group key, may be null
  4519. */
  4520. /** @expose */
  4521. group : null,
  4522. /**
  4523. * Array of line-generator points in data space, non-null but may be empty
  4524. */
  4525. /** @expose */
  4526. points : null,
  4527. /**
  4528. * Array of point datum objects, non-null but may be empty.
  4529. */
  4530. //_pointData : null,
  4531. /**
  4532. * Original data, non-null but may be empty.
  4533. */
  4534. //_originalData : null,
  4535. /**
  4536. * Construct.
  4537. * @param (String) group The line's group.
  4538. */
  4539. constructor : function(group) {
  4540. this.group = group;
  4541. this.points = [];
  4542. this._pointData = [];
  4543. this._originalData = [];
  4544. },
  4545. /** @expose */
  4546. originalData : function() {
  4547. return this._originalData;
  4548. },
  4549. /** @expose */
  4550. originalDataList : function() {
  4551. return this._originalData;
  4552. },
  4553. /**
  4554. * Add a point to the line.
  4555. * @param (Object) originalData Original data for this point
  4556. * @param (Object) x X value, must not be null
  4557. * @param (Object) y Y value, may be null (for line/non-stacking area charts with gaps for null Y)
  4558. */
  4559. addPoint : function(originalData, x, y) {
  4560. var point = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
  4561. point._x = x;
  4562. point._y = y;
  4563. point._originalData = originalData;
  4564. this.points.push([x, y]);
  4565. this._pointData.push(point);
  4566. this._originalData.push(originalData);
  4567. },
  4568. /**
  4569. * 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.
  4570. * @param (rave['internal']['Comparator']) comp Comparator that takes PointDatum arguments and sorts by X value
  4571. */
  4572. sort : function(comp) {
  4573. this._pointData.sort(comp);
  4574. var N = this._pointData.length;
  4575. for (var i = 0; i < N; ++i) {
  4576. var d = this._pointData[i];
  4577. var p = this.points[i];
  4578. p[0] = d._x;
  4579. p[1] = d._y;
  4580. this._originalData[i] = d._originalData;
  4581. }
  4582. },
  4583. /**
  4584. * Add all PointDatum objects where X and Y are non-null to the array. For efficiency this assumes the X values are non-null.
  4585. * @param (Array) result Array collecting points
  4586. */
  4587. getLineWithPoints : function(result) {
  4588. for (var __i_enFor0 = 0, __exp_enFor0 = this._pointData, __len_enFor0 = __exp_enFor0.length;
  4589. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  4590. var point = __exp_enFor0[__i_enFor0];
  4591. if (point._y != null) {
  4592. result.push(point);
  4593. }
  4594. }
  4595. },
  4596. /**
  4597. * Add all PointDatum objects that meet the "null-point-null" criterion to the array. For efficiency this assumes the X values are non-null.
  4598. * @param (Array) result Array collecting points
  4599. */
  4600. getNPNPoints : function(result) {
  4601. var N = this._pointData.length;
  4602. var lastY;
  4603. for (var i = 0; i < N; ++i) {
  4604. var point = this._pointData[i];
  4605. if (point._y != null) {
  4606. var nextY = (i < N - 1) ? this._pointData[i + 1]._y : null;
  4607. if (lastY == null && nextY == null) {
  4608. result.push(point);
  4609. }
  4610. }
  4611. lastY = point._y;
  4612. }
  4613. }
  4614. });
  4615. /**
  4616. * A value function that takes a LineData as argument and returns the group.
  4617. */
  4618. /** @expose */
  4619. com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR = function(d) {
  4620. return (d).group;
  4621. };
  4622. /**
  4623. * A value function that takes a LineData as argument and returns theoints.
  4624. */
  4625. /** @expose */
  4626. com_ibm_rave_bundles_data_LineDataUtilities.POINTS_ACCESSOR = function(d) {
  4627. return (d).points;
  4628. };
  4629. // $source: com/ibm/rave/bundles/component/PointComponent
  4630. /************************************************************************
  4631. ** IBM Confidential
  4632. **
  4633. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4634. **
  4635. ** (C) Copyright IBM Corp. 2017
  4636. **
  4637. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4638. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4639. ************************************************************************/
  4640. // GENERATED
  4641. /**
  4642. * <p> A component that renders point elements (glyphs based on data, showing a point with X and Y dimensions, as in a scatterplot chart). The {@link #this.type()} method returns "PointComponent". </p>
  4643. */
  4644. var com_ibm_rave_bundles_component_PointComponent = rave['internal']['Declare'].implement(
  4645. /**
  4646. * The default size used for a point, when no size scale is used or when the size data for the element is null.
  4647. * @param (double) defaultSize The new defaultSize
  4648. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  4649. */
  4650. //defaultSize : function(defaultSize) {},
  4651. /**
  4652. * Turn labels on or off. If labels are on but there is no label data, empty text nodes will be created.
  4653. * @param (boolean) itemLabel Whether to use labels
  4654. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  4655. */
  4656. //itemLabel : function(itemLabel) {},
  4657. /**
  4658. * Whether to drop overlapping labels.
  4659. * @param (boolean) itemOverlap The new itemOverlap
  4660. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  4661. */
  4662. //itemOverlap : function(itemOverlap) {},
  4663. /**
  4664. * The symbol to be used for the points.
  4665. * @param (String) symbol The new symbol
  4666. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  4667. */
  4668. //symbol : function(symbol) {},
  4669. /**
  4670. * Set the width of border
  4671. * @param (String) borderWidth CSS value
  4672. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  4673. */
  4674. //borderWidth : function(borderWidth) {},
  4675. /**
  4676. * Set the color of border
  4677. * @param (String) borderColor
  4678. * @return (com.ibm.rave.bundles.component.PointComponent) This component
  4679. */
  4680. //borderColor : function(borderColor) {},
  4681. /**
  4682. * Set the classname of the labellayer
  4683. * @param string
  4684. * @return (com.ibm.rave.bundles.component.PointComponent) This object
  4685. */
  4686. //labelLayerClassName : function(className) {},
  4687. /**
  4688. * Set the classname of the elementlayer
  4689. * @param string
  4690. * @return (com.ibm.rave.bundles.component.PointComponent) This object
  4691. */
  4692. //elementLayerClassName : function(className) {},
  4693. /**
  4694. * Sets function that will specify position of item label for given chart element.
  4695. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  4696. * @return (com.ibm.rave.bundles.component.PointComponent) This object
  4697. */
  4698. //itemLabelPosition : function(labelPosition) {}
  4699. );
  4700. /**
  4701. * The string returned by {@link #this.type()} is "PointComponent".
  4702. */
  4703. /** @expose */
  4704. com_ibm_rave_bundles_component_PointComponent.COMPONENT_TYPE = "PointComponent";
  4705. // $source: com/ibm/rave/bundles/components/AlignAxisTicksComponent
  4706. /************************************************************************
  4707. ** IBM Confidential
  4708. **
  4709. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4710. **
  4711. ** (C) Copyright IBM Corp. 2017
  4712. **
  4713. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4714. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4715. ************************************************************************/
  4716. // GENERATED
  4717. /**
  4718. * This is a utility class with one public method, alignAxisScales, which takes the Linear Coordinate Scales of two axes and aligns them so that their ticks and their zero positions align, producing one set of grid lines for both. This works only for Linear Coordinate Scales.
  4719. */
  4720. var com_ibm_rave_bundles_components_AlignAxisTicksComponent = rave['internal']['Declare']({
  4721. });
  4722. /**
  4723. * To align the axes so that the grid lines coincide, we ensure that both scales will be subdivided into the same or a multiple of the number of ticks by the LinearScale tick maker. This means that we may have to increase the upper range of at least one of the scales. To ensure that the alignment is not thrown of be a large remainder at one of the scales, we always set the scales to nice if they have not already been set.
  4724. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale1 the scale for the first axis
  4725. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale2 the scale for the second axis
  4726. */
  4727. /** @expose */
  4728. com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignAxisScales = function(scale1, scale2) {
  4729. if (scale1.isLinear() && scale2.isLinear()) {
  4730. com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScaleZero(scale1, scale2);
  4731. var count1 = com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale1, null);
  4732. var count2 = com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale2, null);
  4733. if (count1 > count2) {
  4734. com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale2, count1);
  4735. } else if (count1 < count2) {
  4736. com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale1, count2);
  4737. }
  4738. }
  4739. };
  4740. /**
  4741. * This method takes two scales and expands them in the negative and positive direction so that their zero tick will align on both sides. There are a number of possible scenarios for this, each comprised of one of a and one of b below: a1. scale 1 has a negative and a positive a2. scale 1 has no negative but a positive a3. scale 1 has a negative and no positive a4. scale 1 has no extent b1. scale 2 has a negative and a positive b2. scale 2 has no negative but a positive b3. scale 2 has a negative and no positive b4. scale 2 has no extent All are covered in the method.
  4742. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale1 the scale for the first axis
  4743. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale2 the scale for the second axis
  4744. */
  4745. /** @expose */
  4746. com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScaleZero = function(scale1, scale2) {
  4747. var extent1 = rave['internal']['AbstractScale'].scaleExtent(scale1.scale().domain());
  4748. var extent2 = rave['internal']['AbstractScale'].scaleExtent(scale2.scale().domain());
  4749. var min1 = + (extent1[0]);
  4750. var min2 = + (extent2[0]);
  4751. if (min1 >= 0.0 && min2 >= 0.0) {
  4752. return;
  4753. }
  4754. var max1 = + (extent1[1]);
  4755. var max2 = + (extent2[1]);
  4756. if (max1 <= 0.0 && max2 <= 0.0) {
  4757. return;
  4758. }
  4759. var ratio1 = 0;
  4760. var ratio2 = 0;
  4761. if (min1 < 0.0) {
  4762. ratio1 = max1 / Math.abs(min1);
  4763. if (min2 < 0.0) {
  4764. ratio2 = max2 / Math.abs(min2);
  4765. if (ratio1 > ratio2) {
  4766. extent2[1] = Math.abs(min2) * ratio1;
  4767. }
  4768. if (ratio2 > ratio1) {
  4769. extent1[1] = Math.abs(min1) * ratio2;
  4770. }
  4771. } else {
  4772. if (ratio1 > 0.0) {
  4773. extent2[0] = -max2 / ratio1;
  4774. } else {
  4775. ratio1 = Math.abs(min1) / max2;
  4776. ratio1 = ratio1 > 4.0 ? 4.0 : ratio1;
  4777. ratio1 = ratio1 < 0.25 ? 0.25 : ratio1;
  4778. extent1[1] = -min1 / ratio1;
  4779. extent2[0] = -max2 * ratio1;
  4780. }
  4781. }
  4782. } else if (min2 < 0.0) {
  4783. if (max2 > 0) {
  4784. ratio2 = max2 / Math.abs(min2);
  4785. extent1[0] = -max1 / ratio2;
  4786. } else {
  4787. ratio2 = Math.abs(min2) / max1;
  4788. ratio2 = ratio2 > 4.0 ? 4.0 : ratio2;
  4789. ratio2 = ratio2 < 0.25 ? 0.25 : ratio2;
  4790. extent2[1] = -min2 / ratio2;
  4791. extent1[0] = -max1 * ratio2;
  4792. }
  4793. }
  4794. var exList = [];
  4795. exList.splice(0, 0, extent2[0]);
  4796. exList.splice(1, 0, extent2[1]);
  4797. scale2.scale().domain(exList);
  4798. exList.length = 0;
  4799. exList.splice(0, 0, extent1[0]);
  4800. exList.splice(1, 0, extent1[1]);
  4801. scale1.scale().domain(exList);
  4802. };
  4803. /**
  4804. * Mainly copied from LinearScale, this calculates the number of ticks that will be created, and can be used, if tickCount is not null, to increase the domain of the shorter axis to make the ticks match the other axis.
  4805. * @param (rave['library']['internal']['CoordinateScaleImpl']) coordScale the original scale
  4806. * @param (Number) tickCount the tickCount we wish to expand the scale to
  4807. * @return (double) the number of ticks of the scale
  4808. */
  4809. /** @expose */
  4810. com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale = function(coordScale, tickCount) {
  4811. var m = 10;
  4812. var extent = rave['internal']['AbstractScale'].scaleExtent(coordScale.scale().domain());
  4813. var span = + (extent[1]) - + (extent[0]);
  4814. var step = Math.pow(10, Math.floor(Math.log(span / m) / Math.log(10)));
  4815. var err = m / span * step;
  4816. if (err <= 0.15) {
  4817. step *= 10;
  4818. } else if (err <= 0.35) {
  4819. step *= 5;
  4820. } else if (err <= 0.75) {
  4821. step *= 2;
  4822. }
  4823. var min = + (extent[0]);
  4824. var max = + (extent[1]);
  4825. var numSteps = (max - min) / step;
  4826. if (tickCount != null && numSteps < tickCount) {
  4827. var negSteps = 0.0;
  4828. if (min < 0.0) {
  4829. negSteps = Math.abs(min) / step;
  4830. }
  4831. var posSteps = max / step;
  4832. negSteps = negSteps * tickCount / numSteps;
  4833. posSteps = posSteps * tickCount / numSteps;
  4834. var exList = [];
  4835. exList.splice(0, 0, -negSteps * step);
  4836. exList.splice(1, 0, posSteps * step);
  4837. coordScale.scale().domain(exList);
  4838. numSteps = tickCount;
  4839. }
  4840. return numSteps;
  4841. };
  4842. com_ibm_rave_bundles_components_AlignAxisTicksComponent.LINEAR_DEFAULT_TICKS = 10;
  4843. // $source: com/ibm/rave/bundles/components/ComponentConfiguration
  4844. /************************************************************************
  4845. ** IBM Confidential
  4846. **
  4847. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4848. **
  4849. ** (C) Copyright IBM Corp. 2017
  4850. **
  4851. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4852. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4853. ************************************************************************/
  4854. // GENERATED
  4855. /**
  4856. * 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"} .
  4857. */
  4858. var com_ibm_rave_bundles_components_ComponentConfiguration = rave['internal']['Declare']({
  4859. //constructor : function() {}
  4860. });
  4861. /**
  4862. * <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>
  4863. * @param (rave['internal']['Selection']) chart Selection on which to run the zoom, may be null
  4864. * @param (rave['internal']['Zoom']) zoom The Zoom; if null one is created and returned
  4865. * @param (rave['library']['internal']['CoordinateScaleImpl']) xScale X dimension scale, may be null
  4866. * @param (rave['library']['internal']['CoordinateScaleImpl']) yScale Y dimension scale, may be null
  4867. * @param (rave['library']['internal']['CoordinateScaleImpl']) x2Scale X2 dimension scale, may be null
  4868. * @param (rave['library']['internal']['CoordinateScaleImpl']) y2Scale Y2 dimension scale, may be null
  4869. * @param (Array) scaleExtent Scale extent, may be null; if null the range 0.2 to 5.0 is used
  4870. * @param (rave['internal']['RectStruct']) chartRect The rectangle of the chart
  4871. * @param (double[]) p the zoom translate position (x, y, x2, y2)
  4872. * @param (double[]) s the zoom scale (x, y, x2, y2)
  4873. * @param (String) zoomOps The zoom operation (x|y|x2|y2|all)
  4874. * @param (rave['internal']['RunFunction']) callback Callback on each zoom event, must not be null
  4875. * @return (rave['internal']['Zoom']) The zoom
  4876. */
  4877. /** @expose */
  4878. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom = function(chart, zoom, xScale, yScale, x2Scale, y2Scale, scaleExtent, chartRect, p, s, zoomOps, callback) {
  4879. var z = zoom ? zoom : rave.behavior.zoom();
  4880. var z1 = (x2Scale || y2Scale) && zoomOps == "all" ? rave.behavior.zoom() : null;
  4881. var dummyScale = (rave.scale.linear());
  4882. z.x(dummyScale);
  4883. z.y(dummyScale);
  4884. if (xScale && zoomOps == "x") {
  4885. z.x(xScale.scale());
  4886. z.scale(s[0]);
  4887. z.translate([p[0], 0]);
  4888. }
  4889. if (yScale && zoomOps == "y") {
  4890. z.y(yScale.scale());
  4891. z.scale(s[1]);
  4892. z.translate([0, p[1]]);
  4893. }
  4894. if (x2Scale && zoomOps == "x2") {
  4895. z.x(x2Scale.scale());
  4896. z.scale(s[2]);
  4897. z.translate([p[2], 0]);
  4898. }
  4899. if (y2Scale && zoomOps == "y2") {
  4900. z.y(y2Scale.scale());
  4901. z.scale(s[3]);
  4902. z.translate([0, p[3]]);
  4903. }
  4904. if (zoomOps == "all") {
  4905. if (xScale) {
  4906. z.x(xScale.scale());
  4907. }
  4908. if (yScale) {
  4909. z.y(yScale.scale());
  4910. }
  4911. z.scale(1);
  4912. z.translate([0, 0]);
  4913. if (z1) {
  4914. if (x2Scale) {
  4915. z1.x(x2Scale.scale());
  4916. }
  4917. if (y2Scale) {
  4918. z1.y(y2Scale.scale());
  4919. }
  4920. z1.scale(1);
  4921. z1.translate([0, 0]);
  4922. }
  4923. }
  4924. z.scaleExtent(scaleExtent ? scaleExtent : [1, Infinity]).on("zoom.default", function(args) {
  4925. if (args !== null || arguments.length > 1){
  4926. args = Array.prototype.slice.call(arguments, 0);
  4927. }
  4928. {
  4929. var event = args[3];
  4930. var scale = event.scale;
  4931. var translate = event.translate;
  4932. var scaledX = chartRect.x * (scale - 1);
  4933. var scaledXExtent = (chartRect.width * (1 - scale)) - scaledX;
  4934. translate[0] = Math.min(-scaledX, Math.max(scaledXExtent, translate[0]));
  4935. var scaledY = chartRect.y * (scale - 1);
  4936. var scaledYExtent = (chartRect.height * (1 - scale)) - scaledY;
  4937. translate[1] = Math.min(-scaledY, Math.max(scaledYExtent, translate[1]));
  4938. z.translate([translate[0], translate[1]]);
  4939. if (z1) {
  4940. z1.translate([translate[0], translate[1]]);
  4941. z1.scale(scale);
  4942. }
  4943. if (zoomOps == "x") {
  4944. p[0] = translate[0];
  4945. s[0] = scale;
  4946. } else if (zoomOps == "y") {
  4947. p[1] = translate[1];
  4948. s[1] = scale;
  4949. } else if (zoomOps == "x2") {
  4950. p[2] = translate[0];
  4951. s[2] = scale;
  4952. } else if (zoomOps == "y2") {
  4953. p[3] = translate[1];
  4954. s[3] = scale;
  4955. } else if (zoomOps == "all") {
  4956. p[0] = translate[0];
  4957. p[1] = translate[1];
  4958. p[2] = translate[0];
  4959. p[3] = translate[1];
  4960. s[0] = scale;
  4961. s[1] = scale;
  4962. s[2] = scale;
  4963. s[3] = scale;
  4964. }
  4965. return callback.apply(this, args);
  4966. }
  4967. });
  4968. return z;
  4969. };
  4970. // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModule
  4971. /************************************************************************
  4972. ** IBM Confidential
  4973. **
  4974. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4975. **
  4976. ** (C) Copyright IBM Corp. 2015
  4977. **
  4978. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4979. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4980. ************************************************************************/
  4981. // Must be the first import
  4982. // @import ./BundleModuleHeader
  4983. // expose DataFormatter to the global variable rave
  4984. //rave["library"]["CustomFormatter"]=com_ibm_rave_library_framework_CustomFormatter;
  4985. // $source: com/ibm/rave/bundles/compositeBundle/CompositeBundle
  4986. /************************************************************************
  4987. ** IBM Confidential
  4988. **
  4989. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  4990. **
  4991. ** (C) Copyright IBM Corp. 2017
  4992. **
  4993. ** The source code for this program is not published or otherwise divested of its trade secrets,
  4994. ** irrespective of what has been deposited with the U.S. Copyright Office.
  4995. ************************************************************************/
  4996. // GENERATED
  4997. //@import com/ibm/rave/library/Library (static) // Library
  4998. //@import com/ibm/rave/bundles/RaveBundle (loadtime) // superclass
  4999. //@import com/ibm/rave/bundles/compositeBundle/CompositeView (runtime) // new
  5000. var com_ibm_rave_bundles_compositeBundle_CompositeBundle = rave['internal']['Declare'](com_ibm_rave_bundles_RaveBundle, {
  5001. /** @expose */
  5002. getName : function() {
  5003. return com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME;
  5004. },
  5005. /** @expose */
  5006. createView : function(ctx) {
  5007. return new com_ibm_rave_bundles_compositeBundle_CompositeView(ctx);
  5008. }
  5009. //constructor : function() {}
  5010. });
  5011. /**
  5012. * Register the bundle factory with the library. The bundle will not be made available if this method is not called.
  5013. */
  5014. /** @expose */
  5015. com_ibm_rave_bundles_compositeBundle_CompositeBundle.init = function() {
  5016. if (!(com_ibm_rave_library_Library.bundle.isRegistered(com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME))) {
  5017. var bundle;
  5018. com_ibm_rave_library_Library.bundle.extension(com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME, function() {
  5019. if (!bundle) {
  5020. bundle = new com_ibm_rave_bundles_compositeBundle_CompositeBundle();
  5021. bundle.loadResources();
  5022. require("./vizlibrary-composite.css");
  5023. }
  5024. return bundle;
  5025. });
  5026. }
  5027. return com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME;
  5028. };
  5029. com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME = "compositeBundle";
  5030. // Auto initialization
  5031. com_ibm_rave_bundles_compositeBundle_CompositeBundle.init();
  5032. if (!com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME]) {
  5033. com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME] = function() {
  5034. if (!bundle) {
  5035. bundle = new com_ibm_rave_bundles_compositeBundle_CompositeBundle();
  5036. bundle.loadResources();
  5037. require("./vizlibrary-composite.css");
  5038. }
  5039. return bundle;
  5040. };
  5041. } else {
  5042. console.log("Could not register extension: CompositeBundle");
  5043. }
  5044. // $source: com/ibm/rave/bundles/views/AbstractColumnView
  5045. /************************************************************************
  5046. ** IBM Confidential
  5047. **
  5048. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5049. **
  5050. ** (C) Copyright IBM Corp. 2017
  5051. **
  5052. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5053. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5054. ************************************************************************/
  5055. // GENERATED
  5056. //@import com/ibm/rave/bundles/views/BundleView (loadtime) // superclass
  5057. //@import com/ibm/rave/bundles/components/IntervalComponentImpl (runtime) // new
  5058. //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities, simpleBars, clusteredBars, stackedBars
  5059. //@import com/ibm/rave/library/Library (runtime) // logError
  5060. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  5061. /**
  5062. * An abstract Column view implementation that contains code common to 'column'-like charts. For instance a composite (column/line) chart will also use this functionality.
  5063. */
  5064. var com_ibm_rave_bundles_views_AbstractColumnView = rave['internal']['Declare'](com_ibm_rave_bundles_views_BundleView, {
  5065. /** @expose */
  5066. datasetId : null,
  5067. /**
  5068. * Interval component, created in setup
  5069. */
  5070. /** @expose */
  5071. _intervalComponent : null,
  5072. /** @expose */
  5073. constructor : function(context) {
  5074. this.datasetId = "data";
  5075. },
  5076. /** @expose */
  5077. setup : function() {
  5078. com_ibm_rave_bundles_views_BundleView.prototype.setup.call(this);
  5079. this._intervalComponent = new com_ibm_rave_bundles_components_IntervalComponentImpl();
  5080. this._intervalComponent.keyAccessor(function(data) {
  5081. return (data).key;
  5082. }).independent1Accessor(function(data) {
  5083. return (data).ind1;
  5084. }).independent2Accessor(function(data) {
  5085. return (data).ind2;
  5086. }).dependent1Accessor(function(data) {
  5087. return (data).dep1;
  5088. }).dependent2Accessor(function(data) {
  5089. return (data).dep2;
  5090. }).valueAccessor(com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR);
  5091. },
  5092. /** @expose */
  5093. dataValid : function() {
  5094. if (!(this.dataModel.validate())) {
  5095. return false;
  5096. }
  5097. var dataHandling = this.getStringProperty("data.handling");
  5098. var dataSet = this.dataModel.dataset(this.datasetId);
  5099. var yAccessor = dataSet.slot("y").entry();
  5100. var yStart = dataSet.slot("yStart");
  5101. var yStartAccessor = yStart ? yStart.entry() : null;
  5102. if (dataHandling == "Stacked" || dataHandling == "Stacked100") {
  5103. if (yStartAccessor || yAccessor.type() == "date") {
  5104. com_ibm_rave_library_Library.logError(408, "Column chart isn't stackable when ystart is defined or y is date");
  5105. return false;
  5106. }
  5107. }
  5108. if (yStartAccessor && !(yStartAccessor.type() == yAccessor.type())) {
  5109. com_ibm_rave_library_Library.logError(409, "y and ystart slot must have the same data type in Column data");
  5110. return false;
  5111. }
  5112. return true;
  5113. },
  5114. /**
  5115. * Convert data model into array of IntervalData structures, based on the group handling. See {@link (com.ibm.rave.bundles.components.IntervalDataUtilities) IntervalDataUtilities} .
  5116. * @return (Array) Array of intervals
  5117. */
  5118. /** @expose */
  5119. makeData : function(dataModel, _data) {
  5120. if (!_data || _data.length == 0) {
  5121. return [];
  5122. }
  5123. var dataSet = dataModel.dataset(this.datasetId);
  5124. var xAccessor = dataSet.slot("x").entry();
  5125. var yAccessor = dataSet.slot("y").entry();
  5126. var colorAccessor = dataSet.slot("color").entry();
  5127. var labelAccessor = dataSet.slot("label").entry();
  5128. var yStart = dataSet.slot("yStart");
  5129. var yStartAccessor = yStart ? yStart.entry() : null;
  5130. var dataHandling = this.getStringProperty("data.handling");
  5131. if ("Clustered" == dataHandling && colorAccessor) {
  5132. return com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars(_data, [xAccessor, colorAccessor], [rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), rave['library']['internal']['AbstractView'].domainCheckerOf(_data, colorAccessor)], yAccessor, yStartAccessor, colorAccessor, labelAccessor);
  5133. }
  5134. if ("Stacked" == dataHandling) {
  5135. return com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, colorAccessor, labelAccessor, false);
  5136. }
  5137. if ("Stacked100" == dataHandling) {
  5138. return com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, colorAccessor, labelAccessor, true);
  5139. }
  5140. return com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, yStartAccessor, colorAccessor, labelAccessor);
  5141. },
  5142. /** @expose */
  5143. configureDataLabels : function(dataSet, colorDataSlotEntry) {
  5144. if (!(this.isShowDataLabels())) {
  5145. this._intervalComponent.itemLabel(false);
  5146. this._intervalComponent.itemLabelPosition(null);
  5147. this._intervalComponent.labelFont(null);
  5148. this._intervalComponent.labelAccessor(null);
  5149. this._intervalComponent.labelFormatter(null);
  5150. return;
  5151. }
  5152. var dataHandling = this.getStringProperty("data.handling");
  5153. var isStacked = (colorDataSlotEntry) && ("Stacked" == dataHandling || "Stacked100" == dataHandling);
  5154. var dataLabelPosition = function(data, index, groupIndex) {
  5155. if (isStacked) {
  5156. return 1;
  5157. } else {
  5158. var iData = data;
  5159. var value = + (iData.value);
  5160. return (value >= 0) ? 0 : 2;
  5161. }
  5162. };
  5163. var labelAccessor = this.getlDataLabelAccessor(dataSet, "label", true);
  5164. var labelEntry = this.getEntryForDataLabelFormatter(dataSet, "label", "y");
  5165. this._intervalComponent.itemLabel(true);
  5166. this._intervalComponent.itemOverlap(true);
  5167. this._intervalComponent.itemLabelPosition(dataLabelPosition);
  5168. var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
  5169. if (!isStacked) {
  5170. labelFontStyle = this.getBackgroundConstrastLabelStyle();
  5171. }
  5172. this._intervalComponent.labelFont(labelFontStyle);
  5173. this._intervalComponent.labelAccessor(labelAccessor);
  5174. this._intervalComponent.labelContrast(this.getBooleanProperty("contrast.label.color"));
  5175. this._intervalComponent.labelFormatter(this.context.getCustomFormatterForElementLabels(labelEntry, (dataSet.slot("label").entry()) ? "ROLE_NONE" : "ROLE_Y1"));
  5176. this._intervalComponent.labelContrast(this.getBooleanProperty("contrast.label.color"));
  5177. this._intervalComponent.labelShadow(this.getBooleanProperty("label.shadow"));
  5178. }
  5179. });
  5180. /** @expose */
  5181. com_ibm_rave_bundles_views_AbstractColumnView.DATAMODEL_TABULAR = "tabular";
  5182. /** @expose */
  5183. com_ibm_rave_bundles_views_AbstractColumnView.DATASET_DATA = "data";
  5184. /** @expose */
  5185. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_X = "x";
  5186. /** @expose */
  5187. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_Y = "y";
  5188. /** @expose */
  5189. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_Y_START = "yStart";
  5190. /** @expose */
  5191. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_COLOR = "color";
  5192. /** @expose */
  5193. com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_LABEL = "label";
  5194. // $source: com/ibm/rave/bundles/compositeBundle/CompositeView
  5195. /************************************************************************
  5196. ** IBM Confidential
  5197. **
  5198. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  5199. **
  5200. ** (C) Copyright IBM Corp. 2018
  5201. **
  5202. ** The source code for this program is not published or otherwise divested of its trade secrets,
  5203. ** irrespective of what has been deposited with the U.S. Copyright Office.
  5204. ************************************************************************/
  5205. // GENERATED
  5206. //@import com/ibm/rave/bundles/views/AbstractColumnView (loadtime) // superclass
  5207. //@import com/ibm/rave/bundles/components/LabelCollisionComponentImpl (runtime) // new
  5208. //@import com/ibm/rave/bundles/components/LineComponentImpl (runtime) // new
  5209. //@import com/ibm/rave/bundles/data/LineDataUtilities (runtime) // getNPNPoints, buildLines, sortLines, LineDataUtilities, getLineWithPoints
  5210. //@import com/ibm/rave/bundles/components/PointComponentImpl (runtime) // new
  5211. //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
  5212. //@import com/ibm/rave/bundles/components/AxesManager (runtime) // percentFormat
  5213. //@import com/ibm/rave/bundles/components/AlignAxisTicksComponent (runtime) // alignAxisScales
  5214. //@import com/ibm/rave/bundles/components/ComponentConfiguration (runtime) // configureZoom
  5215. //@import com/ibm/rave/library/Library (runtime) // logError
  5216. /**
  5217. * <p> A composite view with a column and line chart. The two are plotted on the same independent (X) axis, and have separate dependent (Y) axes. </p>
  5218. */
  5219. var com_ibm_rave_bundles_compositeBundle_CompositeView = rave['internal']['Declare'](com_ibm_rave_bundles_views_AbstractColumnView, {
  5220. /**
  5221. * Line component, created in setup
  5222. */
  5223. //_lineComponent : null,
  5224. /**
  5225. * Point component, created when first needed
  5226. */
  5227. //_pointComponent : null,
  5228. /**
  5229. * Column data
  5230. */
  5231. //_intervalData : null,
  5232. /**
  5233. * Line data
  5234. */
  5235. //_lineData : null,
  5236. /**
  5237. * Point data; the line points which have non-null X and Y
  5238. */
  5239. //_pointData : null,
  5240. /**
  5241. * Null-point data; the line points which have non-null X and Y, and are flanked by points with null Y
  5242. */
  5243. //_pointNPNData : null,
  5244. //_independentScale : null, //_intervalDependentScale : null, //_lineDependentScale : null,
  5245. //zoomendedTimer : null,
  5246. /**
  5247. * color accessor for the column portion of the composite bundle
  5248. */
  5249. //_columnColorAccessor : null,
  5250. //indepScale : null, //intervalScale : null, //lineScale : null,
  5251. /**
  5252. * Label collision component, created in setup
  5253. */
  5254. /** @expose */
  5255. _labelCollisionComponent : null,
  5256. _transpose : false,
  5257. /**
  5258. * When true, don't start a new timer
  5259. */
  5260. _pendingLabelTimer : false,
  5261. /**
  5262. * Counts the number of label collision timers to kill
  5263. */
  5264. _cancelLabelTimers : 0,
  5265. /** @expose */
  5266. constructor : function(context) {
  5267. this.datasetId = "column";
  5268. this._columnColorAccessor = function(data) {
  5269. return (data).color;
  5270. };
  5271. },
  5272. /** @expose */
  5273. getLegendCount : function() {
  5274. return 2;
  5275. },
  5276. /** @expose */
  5277. isAxesManagerRequired : function() {
  5278. return true;
  5279. },
  5280. /** @expose */
  5281. setup : function() {
  5282. com_ibm_rave_bundles_views_AbstractColumnView.prototype.setup.call(this);
  5283. this._pendingLabelTimer = false;
  5284. this._cancelLabelTimers = 0;
  5285. this._labelCollisionComponent = new com_ibm_rave_bundles_components_LabelCollisionComponentImpl();
  5286. rave['library']['internal']['BundleUtils'].setupDefaultActions(this.context, ".chart ." + "element-shape", null);
  5287. this._lineComponent = new com_ibm_rave_bundles_components_LineComponentImpl();
  5288. this._lineComponent.pointsAccessor(function(data) {
  5289. return (data).points;
  5290. }).groupAccessor(com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR);
  5291. this._pointComponent = new com_ibm_rave_bundles_components_PointComponentImpl();
  5292. this._pointComponent.independentAccessor(com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR).dependentAccessor(com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR);
  5293. },
  5294. /** @expose */
  5295. draw : function() {
  5296. if (this.isUpdateNothing()) {
  5297. return;
  5298. }
  5299. this.preDraw("g.vizlibrary-composite");
  5300. this.dataModel = this.context.dataModel();
  5301. if (this.dataModel.getDescriptor().id() == com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE) {
  5302. this.datasetId = "composite";
  5303. } else {
  5304. this.datasetId = "column";
  5305. }
  5306. if (!(this.validateDataModel("g.element-group", "g.grid", "g.axis"))) {
  5307. return;
  5308. }
  5309. this.setActionsWithBorder();
  5310. this.stopLabelCollisions();
  5311. var columnDataSet;
  5312. var lineDataSet;
  5313. if (this.dataModel.getDescriptor().id() == com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE) {
  5314. columnDataSet = this.dataModel.dataset("composite");
  5315. lineDataSet = this.dataModel.dataset("composite");
  5316. } else {
  5317. columnDataSet = this.dataModel.dataset(this.datasetId);
  5318. lineDataSet = this.dataModel.dataset("line");
  5319. }
  5320. if (!(this.compatibleDomains(columnDataSet, lineDataSet))) {
  5321. this._chart.selectAll("g.element-group").selectAll("*").remove();
  5322. this._chart.selectAll("g.element-label-group").selectAll("*").remove();
  5323. this._chart.selectAll("g.grid").selectAll("*").remove();
  5324. this._chart.selectAll("g.axis").selectAll("*").remove();
  5325. this._legends.visible(false).draw();
  5326. }
  5327. var effect = this.getStringProperty("effect.name");
  5328. var duration = this.getEffectDuration(effect);
  5329. this._transpose = this.getBooleanProperty("transpose");
  5330. var columnData = (columnDataSet.data());
  5331. var lineModelData = (lineDataSet.data());
  5332. var useLineLegend = this.getBooleanProperty("legend.line.display");
  5333. var useColumnLegend = this.getBooleanProperty("legend.column.display");
  5334. var legendPosition = this.getLegendPosition();
  5335. var columnXDataSlotEntry = columnDataSet.slot("x").entry();
  5336. var columnYDataSlotEntry = columnDataSet.slot("y").entry();
  5337. var columnColorDataSlotEntry = columnDataSet.slot("color").entry();
  5338. if (!columnColorDataSlotEntry && columnYDataSlotEntry) {
  5339. columnDataSet.slot("color").overrideLabel(columnYDataSlotEntry.label());
  5340. }
  5341. var lineXDataSlotEntry = lineDataSet.slot("x").entry();
  5342. var lineYDataSlotEntry;
  5343. var lineColorDataSlotEntry;
  5344. var lineYSlotName = "y";
  5345. var lineColorSlotName = "color";
  5346. if (this.dataModel.getDescriptor().id() == com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE) {
  5347. lineYSlotName += "Line";
  5348. lineColorSlotName += "Line";
  5349. }
  5350. lineYDataSlotEntry = lineDataSet.slot(lineYSlotName).entry();
  5351. lineColorDataSlotEntry = lineDataSet.slot(lineColorSlotName).entry();
  5352. if (!lineColorDataSlotEntry && lineYDataSlotEntry) {
  5353. lineDataSet.slot(lineColorSlotName).overrideLabel(lineYDataSlotEntry.label());
  5354. }
  5355. if (this.updateType == 0) {
  5356. this._intervalData = this.makeData(this.dataModel, columnData);
  5357. this._lineData = com_ibm_rave_bundles_data_LineDataUtilities.buildLines(lineModelData, rave['library']['internal']['AbstractView'].accessorOf(lineXDataSlotEntry), rave['library']['internal']['AbstractView'].domainCheckerOf(lineModelData, lineXDataSlotEntry), rave['library']['internal']['AbstractView'].accessorOf(lineYDataSlotEntry), rave['library']['internal']['AbstractView'].accessorOf(lineColorDataSlotEntry));
  5358. this.context.actions.action("deselectAll")(this.context.node.selectAll("." + "element-shape"));
  5359. }
  5360. var columnColorPalette = this.getPalette("color.palette.column");
  5361. columnColorPalette.setData(columnDataSet, "color");
  5362. columnColorPalette.setAccessor(this._columnColorAccessor);
  5363. columnColorPalette.setNullColor(this.getStringProperty("color.null"));
  5364. var swap = this.getBooleanProperty("swapLineColumn");
  5365. var lineColorPalette = this.getPalette("color.palette.line");
  5366. lineColorPalette.setData(lineDataSet, lineColorSlotName);
  5367. lineColorPalette.setAccessor(com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR);
  5368. var drawLineOrPoints = this.getStringProperty("lineWithPoints.display");
  5369. var drawPoints = ("line_points" == drawLineOrPoints || "points" == drawLineOrPoints);
  5370. var drawLine = ("line_points" == drawLineOrPoints || "line" == drawLineOrPoints);
  5371. this.configureLegends(effect, duration, useLineLegend, useColumnLegend, legendPosition, columnColorDataSlotEntry, lineColorDataSlotEntry, columnColorPalette, lineColorPalette, drawPoints);
  5372. this.doLayout(columnDataSet, lineDataSet, duration, lineModelData, columnXDataSlotEntry, columnYDataSlotEntry, lineXDataSlotEntry, lineYDataSlotEntry, swap);
  5373. if (this.updateType == 0 && this._independentScale && this.getBooleanProperty("sortX")) {
  5374. com_ibm_rave_bundles_data_LineDataUtilities.sortLines(this._lineData, this._independentScale);
  5375. }
  5376. if (this.updateType == 0) {
  5377. this._pointData = com_ibm_rave_bundles_data_LineDataUtilities.getLineWithPoints(this._lineData);
  5378. this._pointNPNData = com_ibm_rave_bundles_data_LineDataUtilities.getNPNPoints(this._lineData);
  5379. }
  5380. var elementRect = this._layoutComponent.elementRect();
  5381. this._clip.clipRect(elementRect).applyTo(this._chart.select(".content1")).call(this.context.node.select("defs"));
  5382. this._clip.clipRect(elementRect).applyTo(this._chart.select(".content2")).call(this.context.node.select("defs"));
  5383. this._chart.select("rect.background.elements").attr("x", elementRect.x).attr("y", elementRect.y).attr("width", elementRect.width).attr("height", elementRect.height);
  5384. this._legends.rectangle(this._layoutComponent.legendRect());
  5385. this.setBackgroundProperties(elementRect, duration);
  5386. this.configureDataLabels(columnDataSet, columnColorDataSlotEntry);
  5387. this.drawLinesAndPoints(columnDataSet, lineDataSet, effect, duration, lineColorDataSlotEntry, lineColorSlotName, columnColorPalette, lineColorPalette, drawPoints, drawLine, elementRect);
  5388. this.drawAxes(duration, columnXDataSlotEntry, columnYDataSlotEntry, lineYDataSlotEntry);
  5389. this._legends.draw();
  5390. this.zoom(swap, elementRect);
  5391. this.runLabelCollisions(this._chart, elementRect, duration, this.delayFunction(duration, this._independentScale));
  5392. this.resetUpdate();
  5393. this._chart.selectAll(".element-shape").classed("bundle-shape", true);
  5394. this._chart.selectAll(".legendShape").classed("bundle-shape", true);
  5395. },
  5396. drawAxes : function(duration, columnXDataSlotEntry, columnYDataSlotEntry, lineYDataSlotEntry) {
  5397. var stacked100 = "Stacked100" == this.getStringProperty("data.handling");
  5398. var subDomainDivisionColumn = columnYDataSlotEntry.subDomainDivision();
  5399. var scaleDivisionColumn = subDomainDivisionColumn == null ? null : + (subDomainDivisionColumn);
  5400. var subDomainDivisionLine = lineYDataSlotEntry.subDomainDivision();
  5401. var scaleDivisionLine = subDomainDivisionLine == null ? null : + (subDomainDivisionLine);
  5402. this._axes.visible(true).duration(duration).useDefaultSelectors().useDefaultX1Properties(true).useDefaultY1Properties(true).useDefaultY2Properties(true).scaleTickMagnitude(2, scaleDivisionColumn).scaleTickMagnitude(3, scaleDivisionLine).setTickFormatterList(0, [columnXDataSlotEntry, columnYDataSlotEntry], "none", null).setTickFormatterList(2, [columnYDataSlotEntry], stacked100 ? "percent" : "none", stacked100 ? com_ibm_rave_bundles_components_AxesManager.percentFormat(0) : null).setTickFormatter(3, lineYDataSlotEntry);
  5403. this._axes.draw();
  5404. },
  5405. doLayout : function(columnDataSet, lineDataSet, duration, lineModelData, columnXDataSlotEntry, columnYDataSlotEntry, lineXDataSlotEntry, lineYDataSlotEntry, swap) {
  5406. var legendPosition;
  5407. if (this.updateType <= 1) {
  5408. this._independentScale = this.makeIndependentScale(columnDataSet, lineDataSet);
  5409. this._intervalDependentScale = this.makeIntervalDependentScale(columnDataSet.slot("y").entry(), this._intervalData);
  5410. this._lineDependentScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(lineModelData, lineYDataSlotEntry);
  5411. var subDomainDivisionColumn = columnYDataSlotEntry.subDomainDivision();
  5412. var scaleDivisionColumn = subDomainDivisionColumn == null ? null : + (subDomainDivisionColumn);
  5413. var subDomainDivisionLine = lineYDataSlotEntry.subDomainDivision();
  5414. var scaleDivisionLine = subDomainDivisionLine == null ? null : + (subDomainDivisionLine);
  5415. this._axes.visible(true).duration(duration).transpose(this._transpose).swapY(swap ^ this._transpose).scale(0, this._independentScale).scale(2, this._intervalDependentScale).scale(3, this._lineDependentScale).scaleTickMagnitude(2, scaleDivisionColumn).scaleTickMagnitude(3, scaleDivisionLine).setDataSlot(0, [columnXDataSlotEntry, lineXDataSlotEntry]).setDataSlot(2, columnYDataSlotEntry).setDataSlot(3, lineYDataSlotEntry).useDefaultSelectors().useDefaultX1Properties(true).useDefaultY1Properties(true).useDefaultY2Properties(true);
  5416. this.prepareLayoutComponent();
  5417. this.prepareLayoutSizables(this._layoutComponent, false, true, true, true, this._legends.anyVisible());
  5418. legendPosition = this._layoutComponent.legendPosition();
  5419. var isLegendLeftOrRight = "left" == legendPosition || "right" == legendPosition;
  5420. if (isLegendLeftOrRight) {
  5421. this._legends.preLayout(this._layoutComponent, false);
  5422. this._axes.preLayout(this._layoutComponent, false, 0.1, 0.05, 0, 0.1, 0.0, 0);
  5423. } else {
  5424. this._axes.preLayout(this._layoutComponent, true, 0.1, 0.05, 0, 0.1, 0.0, 0);
  5425. this._legends.preLayout(this._layoutComponent, true);
  5426. }
  5427. this._layoutComponent.layout();
  5428. this._legends.position(legendPosition);
  5429. this._axes.useBoundsFromLayout(this._layoutComponent).setIndependentScaleRanges(0.1, 0.05, 0).setDependentScaleRanges(0.1, 0.0, 0);
  5430. if (this._independentScale) {
  5431. var csize = this.getCSSSizeToPixelNumber("column.size");
  5432. this._independentScale.setWidth(csize);
  5433. this._independentScale.applyWidth(this.getBooleanProperty("column.applysize"));
  5434. this._independentScale.expandZeroExtent(false);
  5435. this._independentScale.expandPixels(csize / 2.0 + 1.0, false);
  5436. if (this.getBooleanProperty("axis.x.scale.nice")) {
  5437. this._independentScale.nice();
  5438. }
  5439. if (this.getBooleanProperty("axis.x.scale.includeZero")) {
  5440. this._independentScale.includeZero();
  5441. }
  5442. this.indepScale = this._independentScale.scale().copy();
  5443. }
  5444. var intervalDomainmax = 0.0;
  5445. if (this._intervalDependentScale) {
  5446. intervalDomainmax = + (this._intervalDependentScale.scale().domain()[1]);
  5447. if (this.getBooleanProperty("axis.y.scale.includeZero")) {
  5448. this._intervalDependentScale.includeZero();
  5449. }
  5450. this._intervalDependentScale.expandZeroExtent(true);
  5451. if (this.getBooleanProperty("axis.y.scale.nice")) {
  5452. this._intervalDependentScale.nice(scaleDivisionColumn);
  5453. }
  5454. }
  5455. var lineDomainmax = 0.0;
  5456. if (this._lineDependentScale) {
  5457. lineDomainmax = + (this._lineDependentScale.scale().domain()[1]);
  5458. if (this.getBooleanProperty("axis.y2.scale.includeZero")) {
  5459. this._lineDependentScale.includeZero();
  5460. }
  5461. this._lineDependentScale.expandZeroExtent(true);
  5462. if (this.getBooleanProperty("axis.y2.scale.nice")) {
  5463. this._lineDependentScale.nice(scaleDivisionLine);
  5464. }
  5465. }
  5466. var isLineOnly = "line" == this.getStringProperty("lineWithPoints.display");
  5467. var linePadding = isLineOnly ? 2.0 : Math.max(2.0, 2 + Math.sqrt(this.getCSSSizeToPixelNumber("lineWithPoints.size")));
  5468. var intervalPadding = 2.0;
  5469. if (this.getBooleanProperty("data.label.display")) {
  5470. if (this._lineDependentScale) {
  5471. var lineNiceScaleDomain = this._lineDependentScale.scale().domain();
  5472. var lineRange = this._lineDependentScale.scale().range();
  5473. var pixelPerUnit = Math.abs(+ (lineRange[1]) - + (lineRange[0])) / Math.abs(+ (lineNiceScaleDomain[1]) - + (lineNiceScaleDomain[0]));
  5474. linePadding = 20 - (Math.abs(+ (lineNiceScaleDomain[1]) - lineDomainmax) * pixelPerUnit);
  5475. }
  5476. var columnColorDataSlotEntry = columnDataSet.slot("color").entry();
  5477. var dataHandling = this.getStringProperty("data.handling");
  5478. var isStacked = (columnColorDataSlotEntry) && ("Stacked" == dataHandling || "Stacked100" == dataHandling);
  5479. if (this._intervalDependentScale && !isStacked) {
  5480. var intervalNiceScaleDomain = this._intervalDependentScale.scale().domain();
  5481. var intervalRange = this._intervalDependentScale.scale().range();
  5482. var dependentScaleLengthPx = Math.abs(+ (intervalRange[1]) - + (intervalRange[0]));
  5483. var intervalPixelPerUnit = dependentScaleLengthPx / Math.abs(+ (intervalNiceScaleDomain[1]) - + (intervalNiceScaleDomain[0]));
  5484. var paddingNeeded = 20;
  5485. if (this._transpose && (""+(intervalDomainmax)).length * 12 < dependentScaleLengthPx / 4) {
  5486. paddingNeeded = (""+(intervalDomainmax)).length * 12;
  5487. }
  5488. intervalPadding = paddingNeeded - Math.abs(+ (intervalNiceScaleDomain[1]) - intervalDomainmax) * intervalPixelPerUnit;
  5489. }
  5490. }
  5491. if (this._intervalDependentScale && this._lineDependentScale && this.getBooleanProperty("alignAxes")) {
  5492. com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignAxisScales(this._intervalDependentScale, this._lineDependentScale);
  5493. }
  5494. if (this.isSameDomain() || this.getBooleanProperty("alignAxes")) {
  5495. this._intervalDependentScale.expandPixels(Math.max(linePadding, intervalPadding), true);
  5496. this._lineDependentScale.expandPixels(Math.max(linePadding, intervalPadding), true);
  5497. } else {
  5498. if (this._intervalDependentScale) {
  5499. this._intervalDependentScale.expandPixels(intervalPadding, true);
  5500. }
  5501. if (this._lineDependentScale) {
  5502. this._lineDependentScale.expandPixels(linePadding, true);
  5503. }
  5504. }
  5505. if (this._intervalDependentScale) {
  5506. this.intervalScale = this._intervalDependentScale.scale().copy();
  5507. }
  5508. if (this._lineDependentScale) {
  5509. this.lineScale = this._lineDependentScale.scale().copy();
  5510. }
  5511. this.resetZoom();
  5512. }
  5513. },
  5514. isSameDomain : function() {
  5515. if ((!this._intervalDependentScale) || (!this._lineDependentScale)) {
  5516. return false;
  5517. }
  5518. var y1Domain = this._intervalDependentScale.scale().domain();
  5519. var y1Min = Math.floor(+ (y1Domain[0]));
  5520. var y1Max = Math.ceil(+ (y1Domain[1]));
  5521. var y2Domain = this._lineDependentScale.scale().domain();
  5522. var y2Min = Math.floor(+ (y2Domain[0]));
  5523. var y2Max = Math.ceil(+ (y2Domain[1]));
  5524. var minDifferent = (y1Min < y2Min) || (y1Min > y2Min);
  5525. var maxDifferent = (y1Max < y2Max) || (y1Max > y2Max);
  5526. return (minDifferent || maxDifferent) ? false : true;
  5527. },
  5528. zoom : function(swap, elementRect) {
  5529. if (this.updateType <= 2) {
  5530. var ops = this.getStringProperty("zoom");
  5531. if (this._independentScale && (ops == "all" || ops == "x")) {
  5532. (this._independentScale.scale()).domain(this.indepScale.domain());
  5533. }
  5534. if (this._intervalDependentScale && (ops == "all" || ops == "y")) {
  5535. (this._intervalDependentScale.scale()).domain(this.intervalScale.domain());
  5536. }
  5537. if (this._lineDependentScale && (ops == "all" || ops == "y2")) {
  5538. (this._lineDependentScale.scale()).domain(this.lineScale.domain());
  5539. }
  5540. var xScale = this._transpose ? (swap ? this._lineDependentScale : this._intervalDependentScale) : this._independentScale;
  5541. var x2Scale = this._transpose ? (swap ? this._intervalDependentScale : this._lineDependentScale) : null;
  5542. var yScale = this._transpose ? this._independentScale : (swap ? this._lineDependentScale : this._intervalDependentScale);
  5543. var y2Scale = this._transpose ? null : this._lineDependentScale;
  5544. var self = this;
  5545. var zoom = this.context.actions.action("zoom").get("zoom");
  5546. com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom(this._chart, zoom, xScale, yScale, x2Scale, y2Scale, null, elementRect, this._zoomP, this._zoomS, this.convertZoomOps(swap), function(args) {
  5547. if (args !== null || arguments.length > 1){
  5548. args = Array.prototype.slice.call(arguments, 0);
  5549. }
  5550. {
  5551. self._chart.selectAll("g.element-column").call(self._intervalComponent);
  5552. self._chart.selectAll("g.element-line").call(self._lineComponent);
  5553. if (self._pointComponent) {
  5554. self._chart.selectAll("g.element-point").call(self._pointComponent);
  5555. }
  5556. self._axes.redraw(true);
  5557. self._chart.call(self._labelCollisionComponent);
  5558. return self._chart;
  5559. }
  5560. });
  5561. zoom.on("zoomend.hideLabels", function(args) {
  5562. if (args !== null || arguments.length > 1){
  5563. args = Array.prototype.slice.call(arguments, 0);
  5564. }
  5565. {
  5566. if (self._axes.hideAnyPanZoom()) {
  5567. if (self.zoomendedTimer != null) {
  5568. clearTimeout(self.zoomendedTimer);
  5569. }
  5570. self.zoomendedTimer = setTimeout(function() {
  5571. self.zoomendedTimer = null;
  5572. self._axes.redraw(false);
  5573. self._chart.call(self._labelCollisionComponent);
  5574. }, 300);
  5575. }
  5576. return null;
  5577. }
  5578. });
  5579. }
  5580. },
  5581. drawLinesAndPoints : function(columnDataSet, lineDataSet, effect, duration, lineColorDataSlotEntry, lineColorSlotName, columnColorPalette, lineColorPalette, drawPoints, drawLine, elementRect) {
  5582. this._intervalComponent.data(this._intervalData).key(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(columnDataSet.slot("key").entry()))).independentScale(this._independentScale).dependentScale(this._intervalDependentScale).transpose(this._transpose).colorPalette(columnColorPalette).delay(this.delayFunction(duration, this._independentScale)).setPreExecute(this.context.getPreExecute()).borderWidth(this.context.convertCSSSizeToPixels(this.context.getPropertyValue("column.borderWidth"))).borderColor((this.context.getPropertyValue("column.borderColor"))).bounds(this._layoutComponent.elementRect());
  5583. this._chart.selectAll("g.element-column").transition("transition").duration(duration).call(this._intervalComponent);
  5584. var lineKeyDataSlotEntry = lineDataSet.slot("key").entry();
  5585. if (drawLine) {
  5586. this._lineComponent.data(this._lineData);
  5587. } else {
  5588. this._lineComponent.data(null);
  5589. }
  5590. var showMissingAsGap = this.getBooleanProperty("lineWithPoints.showMissingAsGap");
  5591. this._lineComponent.key(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(lineKeyDataSlotEntry))).independentScale(this._independentScale).dependentScale(this._lineDependentScale).transpose(this._transpose).colorPalette(lineColorPalette).effect(effect).showMissingAsGap(showMissingAsGap).setPreExecute(this.context.getPreExecute()).interpolate(this.getStringProperty("lineWithPoints.interpolate"));
  5592. this._chart.selectAll("g.element-line").transition("transition").duration(duration).call(this._lineComponent);
  5593. if (drawPoints || this.isShowDataLabels()) {
  5594. this._pointComponent.data(this._pointData);
  5595. } else {
  5596. this._pointComponent.data(showMissingAsGap ? this._pointNPNData : null);
  5597. }
  5598. this.configureLineDataLabels(lineDataSet);
  5599. var pointsColorPalette = this.getPalette("color.palette.line");
  5600. pointsColorPalette.setData(lineDataSet, lineColorSlotName);
  5601. pointsColorPalette.setAccessor(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(lineColorDataSlotEntry)));
  5602. this._pointComponent.key(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(lineKeyDataSlotEntry))).bounds(elementRect).independentScale(this._independentScale).dependentScale(this._lineDependentScale).colorPalette(pointsColorPalette).labelContrast(this.getBooleanProperty("contrast.label.color")).labelShadow(this.getBooleanProperty("label.shadow")).transpose(this._transpose).effect(effect).setPreExecute(this.context.getPreExecute()).defaultSize(this.getCSSSizeToPixelNumber("lineWithPoints.size")).symbol(drawPoints ? this.getStringProperty("lineWithPoints.symbol") : null).itemOverlap(false);
  5603. this._chart.selectAll("g.element-point").transition("transition").duration(duration).call(this._pointComponent);
  5604. },
  5605. configureLegends : function(effect, duration, useLineLegend, useColumnLegend, legendPosition, columnColorDataSlotEntry, lineColorDataSlotEntry, columnColorPalette, lineColorPalette, drawPoints) {
  5606. var lineTitleString = (this.context.getPropertyValue("legend.line.titlestyle.font"));
  5607. if (lineTitleString != null) {
  5608. this._legends.titleFont(0, lineTitleString);
  5609. }
  5610. var lineEntryString = (this.context.getPropertyValue("legend.line.entrystyle.font"));
  5611. if (lineEntryString != null) {
  5612. this._legends.entryFont(0, lineEntryString);
  5613. }
  5614. var columnTitleString = (this.context.getPropertyValue("legend.column.titlestyle.font"));
  5615. if (columnTitleString != null) {
  5616. this._legends.titleFont(1, columnTitleString);
  5617. }
  5618. var columnEntryString = (this.context.getPropertyValue("legend.column.entrystyle.font"));
  5619. if (columnEntryString != null) {
  5620. this._legends.entryFont(1, columnEntryString);
  5621. }
  5622. this._legends.position(legendPosition).transition(!("none" == effect), duration).setPreExecute(this.context.getPreExecute()).visible(0, useLineLegend).selector(0, this.context.node.selectAll("g.legend.line")).palette(0, lineColorPalette).shape(0, drawPoints ? this.getStringProperty("lineWithPoints.symbol") : "compositeViewLegendLineSymbol").title(0, this.context.getDataSlotLabel("legend.line.title", lineColorDataSlotEntry)).titleFill(0, (this.context.getPropertyValue("legend.line.titlestyle.fill"))).titleFontSize(0, (this.context.getPropertyValue("legend.line.titlestyle.fontsize"))).titleFontFamily(0, (this.context.getPropertyValue("legend.line.titlestyle.fontfamily"))).setDataSlot(0, lineColorDataSlotEntry).visible(1, useColumnLegend).selector(1, this.context.node.selectAll("g.legend.column")).palette(1, columnColorPalette).shape(1, "square").title(1, this.context.getDataSlotLabel("legend.column.title", columnColorDataSlotEntry)).titleFill(1, (this.context.getPropertyValue("legend.column.titlestyle.fill"))).titleFontSize(1, (this.context.getPropertyValue("legend.column.titlestyle.fontsize"))).titleFontFamily(1, (this.context.getPropertyValue("legend.column.titlestyle.fontfamily"))).setDataSlot(1, columnColorDataSlotEntry);
  5623. },
  5624. /**
  5625. * Check if the X accessors of the two data sets have the same type, and if not report an error and return false. The model has already been validated, so the accessors are non-null.
  5626. * @param dataModel Data model to be checked
  5627. * @return (boolean) True if X accessors are the same type, false otherwise
  5628. */
  5629. compatibleDomains : function(columnDataSet, lineDataSet) {
  5630. var columnDataSlotEntry = columnDataSet.slot("x").entry();
  5631. var lineDataSlotEntry = lineDataSet.slot("x").entry();
  5632. if (columnDataSlotEntry && lineDataSlotEntry && !(columnDataSlotEntry.type() == lineDataSlotEntry.type())) {
  5633. com_ibm_rave_library_Library.logError(101, "The column bundle X accessors must be the same type");
  5634. return false;
  5635. }
  5636. return true;
  5637. },
  5638. /**
  5639. * Create the independent scale. This combines the X domains from the column and line data sets. The X accessors are known to be of the same type. TODO: Domain classes, with a merge function.
  5640. * @return (rave['library']['internal']['CoordinateScaleImpl']) Coordinate scale for the independent values
  5641. */
  5642. makeIndependentScale : function(columnDataSet, lineDataSet) {
  5643. var columnData = (columnDataSet.data());
  5644. var lineData = (lineDataSet.data());
  5645. var columnXAccessor = columnDataSet.slot("x").entry();
  5646. var lineXAccessor = lineDataSet.slot("x").entry();
  5647. if (!columnXAccessor || !lineXAccessor) {
  5648. return null;
  5649. }
  5650. var columnScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(columnData, columnXAccessor);
  5651. var lineScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(lineData, lineXAccessor);
  5652. var isClustered = "Clustered" == this.getStringProperty("data.handling");
  5653. if (isClustered || "string" == columnXAccessor.type()) {
  5654. var intervalDomain = (rave['library']['internal']['ScaleManager'].ordinalDomain(columnData, columnXAccessor));
  5655. var lineDomain = (rave['library']['internal']['ScaleManager'].ordinalDomain(lineData, lineXAccessor));
  5656. var uniqueValues = [];
  5657. var originalDomainMap = rave['internal']['ES6Map'].create();
  5658. if (intervalDomain) {
  5659. for (var __i_enFor0 = 0, __exp_enFor0 = intervalDomain, __len_enFor0 = __exp_enFor0.length;
  5660. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  5661. var v = __exp_enFor0[__i_enFor0];
  5662. if (v != null) {
  5663. var datum = originalDomainMap.get(v);
  5664. if (!datum) {
  5665. uniqueValues.push(v);
  5666. datum = originalDomainMap.set(v, new rave['library']['internal']['OrdinalCoordinateScaleDatum'](v));
  5667. }
  5668. }
  5669. }
  5670. }
  5671. if (lineDomain) {
  5672. for (var __i_enFor1 = 0, __exp_enFor1 = lineDomain, __len_enFor1 = __exp_enFor1.length;
  5673. __i_enFor1 < __len_enFor1; ++__i_enFor1) {
  5674. var v = __exp_enFor1[__i_enFor1];
  5675. if (v != null) {
  5676. var datum = originalDomainMap.get(v);
  5677. if (!datum) {
  5678. uniqueValues.push(v);
  5679. datum = originalDomainMap.set(v, new rave['library']['internal']['OrdinalCoordinateScaleDatum'](v));
  5680. }
  5681. }
  5682. }
  5683. }
  5684. for (var __i_enFor2 = 0, __exp_enFor2 = columnData, __len_enFor2 = __exp_enFor2.length;
  5685. __i_enFor2 < __len_enFor2; ++__i_enFor2) {
  5686. var o = __exp_enFor2[__i_enFor2];
  5687. var key = columnXAccessor(o);
  5688. var datum = originalDomainMap.get(key);
  5689. if (datum) {
  5690. datum.push(o);
  5691. }
  5692. }
  5693. for (var __i_enFor3 = 0, __exp_enFor3 = lineData, __len_enFor3 = __exp_enFor3.length;
  5694. __i_enFor3 < __len_enFor3; ++__i_enFor3) {
  5695. var o = __exp_enFor3[__i_enFor3];
  5696. var key = lineXAccessor(o);
  5697. var datum = originalDomainMap.get(key);
  5698. if (datum) {
  5699. datum.push(o);
  5700. }
  5701. }
  5702. var originalDomain = [];
  5703. for (var __i_enFor4 = 0, __exp_enFor4 = uniqueValues, __len_enFor4 = __exp_enFor4.length;
  5704. __i_enFor4 < __len_enFor4; ++__i_enFor4) {
  5705. var d = __exp_enFor4[__i_enFor4];
  5706. originalDomain.push(originalDomainMap.get(d));
  5707. }
  5708. if (isClustered) {
  5709. var colorAccessor = columnDataSet.slot("color").entry();
  5710. var domains = [];
  5711. domains.push(uniqueValues);
  5712. domains.push(rave['library']['internal']['ScaleManager'].ordinalDomain(columnData, colorAccessor));
  5713. columnScale = rave['library']['internal']['ClusteredCoordinateScale'].create(domains, originalDomain);
  5714. } else {
  5715. columnScale = rave['library']['internal']['OrdinalCoordinateScale'].create(uniqueValues, originalDomain);
  5716. }
  5717. } else {
  5718. var intervalDomain = columnScale.scale().domain();
  5719. var lineDomain = lineScale.scale().domain();
  5720. if (intervalDomain.length == 0 && !lineDomain) {
  5721. return null;
  5722. }
  5723. var domain;
  5724. if (intervalDomain.length == 0 && lineDomain) {
  5725. domain = (lineDomain);
  5726. } else if (!lineDomain && intervalDomain.length > 0) {
  5727. domain = (intervalDomain);
  5728. } else {
  5729. domain = [rave.min([intervalDomain[0], lineDomain[0]]), rave.max([intervalDomain[1], lineDomain[1]])];
  5730. }
  5731. var type = lineXAccessor.type();
  5732. if ("numeric" == type) {
  5733. columnScale = rave['library']['internal']['LinearCoordinateScale'].create(domain);
  5734. } else {
  5735. columnScale = rave['library']['internal']['TimeCoordinateScale'].create(domain);
  5736. }
  5737. }
  5738. if (columnScale) {
  5739. columnScale.originalDomainLabelAccessor(function(data, index, groupIndex) {
  5740. var key = (data).key();
  5741. return ""+(key);
  5742. });
  5743. }
  5744. return columnScale;
  5745. },
  5746. /**
  5747. * Create the dependent scale from the data values. The scale range includes all dep1 and dep2 values in the array. It also includes 0 and is padded by 2 pixels to avoid clipping.
  5748. * @param (Array) data Data array
  5749. * @return (rave['library']['internal']['CoordinateScaleImpl']) Coordinate scale for the range of values
  5750. */
  5751. makeIntervalDependentScale : function(columnYDataSlotEntry, data) {
  5752. var domain = columnYDataSlotEntry.domain();
  5753. if (domain) {
  5754. return rave['library']['internal']['LinearCoordinateScale'].create(domain);
  5755. }
  5756. var omax = rave.max(data, function(data, ix, gix) {
  5757. var dep1 = + (((data).dep1));
  5758. var dep2 = + (((data).dep2));
  5759. return dep1 != 0 ? Math.max(dep1, dep2) : dep2;
  5760. });
  5761. if (omax == null) {
  5762. return null;
  5763. }
  5764. var omin = rave.min(data, function(data, ix, gix) {
  5765. var dep1 = + (((data).dep1));
  5766. var dep2 = + (((data).dep2));
  5767. return dep1 != 0 ? Math.min(dep1, dep2) : dep2;
  5768. });
  5769. var scale = rave['library']['internal']['LinearCoordinateScale'].create([omin, omax]);
  5770. return scale;
  5771. },
  5772. /** @expose */
  5773. getCoordinateScale : function(role) {
  5774. if ("ROLE_X1" == role) {
  5775. return this._independentScale;
  5776. }
  5777. if ("ROLE_Y1" == role) {
  5778. return this._intervalDependentScale;
  5779. }
  5780. if ("ROLE_Y2" == role) {
  5781. return this._lineDependentScale;
  5782. }
  5783. return null;
  5784. },
  5785. /**
  5786. * Corrects the zoom operation for transpose and switch. This adjusts the operation so that no matter the setting for transpose and switch, the original axis corresponding to the setting will be the one that is zoomed, not the axis currently occupying that position.
  5787. * @param (boolean) swap true if we are swapping the dependent axes
  5788. * @return (String) the proper zoom code
  5789. */
  5790. convertZoomOps : function(swap) {
  5791. var zoom = this.getStringProperty("zoom");
  5792. if (this._transpose) {
  5793. if ("x" == zoom) {
  5794. zoom = "y";
  5795. } else if ("y" == zoom) {
  5796. if (swap) {
  5797. zoom = "x2";
  5798. } else {
  5799. zoom = "x";
  5800. }
  5801. } else if ("y2" == zoom) {
  5802. if (swap) {
  5803. zoom = "x";
  5804. } else {
  5805. zoom = "x2";
  5806. }
  5807. }
  5808. }
  5809. return zoom;
  5810. },
  5811. /**
  5812. * When the delay option is true, the transition of a bar is delayed by a fraction of the duration based on the bar's ordinal scale value.
  5813. * @param (int) duration
  5814. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale
  5815. * @return (rave['internal']['ValueFunction'])
  5816. */
  5817. delayFunction : function(duration, independentScale) {
  5818. if (duration > 0 && independentScale && this.getBooleanProperty("effect.delay")) {
  5819. var range = independentScale.scale().range();
  5820. if (range && range.length > 1) {
  5821. var rmin = (+ (range[0]));
  5822. var rmax = (+ (range[range.length - 1]));
  5823. if (rmin != rmax) {
  5824. var scaling = duration / (rmax - rmin);
  5825. return function(data, index, groupIndex) {
  5826. return (+ (independentScale.center((data).ind1)) - rmin) * scaling;
  5827. };
  5828. }
  5829. }
  5830. }
  5831. return null;
  5832. },
  5833. /** @expose */
  5834. requireUpdate : function(property) {
  5835. if (property == "axis.y2.title.text" && !(this.getBooleanProperty("axis.y2.title.display"))) {
  5836. return 4;
  5837. }
  5838. if (property == "legend.title.column" && !(this.isShowLegend())) {
  5839. return 4;
  5840. }
  5841. if (property == "legend.title.line" && !(this.isShowLegend())) {
  5842. return 4;
  5843. }
  5844. if (property == "swapLineColumn") {
  5845. return 1;
  5846. }
  5847. return rave['library']['internal']['AbstractView'].prototype.requireUpdate.call(this, property);
  5848. },
  5849. /**
  5850. * Set up all actions, taking into account the settings for the border width and color.
  5851. */
  5852. /** @expose */
  5853. setActionsWithBorder : function() {
  5854. var self = this;
  5855. var borderWidth = this.context.convertCSSSizeToPixels(this.context.getPropertyValue("column.borderWidth"));
  5856. var v = this.getProperty("column.borderColor");
  5857. var borderColor = v == null ? null : ""+(v);
  5858. var style = {};
  5859. style["stroke-width"] = borderWidth;
  5860. style["stroke"] = borderColor;
  5861. var highlightAction = this.context.actions.action("highlight");
  5862. var unhighlightAction = this.context.actions.action("unhighlight");
  5863. var deselectAllAction = this.context.actions.action("deselectAll");
  5864. var lineHighlightEventListener = function(data, index, groupIndex, event) {
  5865. if (this.rave_getParentNode().rave_containsClass("element-line") && this.rave_containsClass("element-shape")) {
  5866. rave.select(this).style("stroke-width", 4);
  5867. } else {
  5868. highlightAction(rave.select(this));
  5869. }
  5870. };
  5871. highlightAction.setBindFn(rave['library']['internal']['BundleUtils'].bindOrUnbindActionFunctionCreater(this.context, ".element-point .element-shape, .element-line .element-shape, .element-column .element-shape", ["mouseenter.default"], lineHighlightEventListener));
  5872. var unhighlightEventListener = function(data, index, groupIndex, event) {
  5873. if (this.rave_getParentNode().rave_containsClass("element-line") && this.rave_containsClass("element-shape")) {
  5874. rave.select(this).style("stroke-width", 2);
  5875. } else if (this.rave_getParentNode().rave_containsClass("element-point") && this.rave_containsClass("element-shape")) {
  5876. rave.select(this).style("stroke-width", 0);
  5877. } else if (this.rave_getParentNode().rave_getParentNode().rave_containsClass("element-column") && this.rave_containsClass("element-shape")) {
  5878. highlightAction(rave.select(this), style);
  5879. }
  5880. };
  5881. unhighlightAction.setBindFn(rave['library']['internal']['BundleUtils'].bindOrUnbindActionFunctionCreater(this.context, ".element-point .element-shape, .element-line .element-shape, .element-column .element-shape", ["mouseout.default"], unhighlightEventListener));
  5882. var deselectAllEventListener = function(data, index, groupIndex, event) {
  5883. self.context.node.selectAll(".element-point .element-shape").style("stroke-width", 0).style("opacity", 1).property("selected", null);
  5884. self.context.node.selectAll(".element-line .element-shape").style("stroke-width", 2).style("opacity", 1).property("selected", null);
  5885. self.context.node.selectAll(".element-column .element-shape").style(style).style("opacity", 1).property("selected", null);
  5886. };
  5887. deselectAllAction.setBindFn(rave['library']['internal']['BundleUtils'].bindOrUnbindActionFunctionCreater(this.context, ".background", ["click.default", "touchstart.default"], deselectAllEventListener));
  5888. },
  5889. /** @expose */
  5890. configureLineDataLabels : function(dataSet) {
  5891. if (!(this.isShowDataLabels())) {
  5892. this._pointComponent.itemLabel(false);
  5893. this._pointComponent.itemLabelPosition(null);
  5894. this._pointComponent.labelFont(null);
  5895. this._pointComponent.labelAccessor(null);
  5896. this._pointComponent.labelFormatter(null);
  5897. return;
  5898. }
  5899. var self = this;
  5900. var dataLabelPosition = function(data, index, groupIndex) {
  5901. var currentData = data;
  5902. var prevData = (index == 0) ? null : self._pointData[index - 1];
  5903. var nextData = (index == self._pointData.length - 1) ? null : self._pointData[index + 1];
  5904. if (!prevData || !nextData) {
  5905. return 0;
  5906. }
  5907. var angleWithPreviousPoint = Math.atan2(self._lineDependentScale.center(prevData._y) - self._lineDependentScale.center(currentData._y), self._independentScale.center(prevData._x) - self._independentScale.center(currentData._x));
  5908. var angleWithNextPoint = Math.atan2(self._lineDependentScale.center(nextData._y) - self._lineDependentScale.center(currentData._y), self._independentScale.center(nextData._x) - self._independentScale.center(currentData._x));
  5909. if (angleWithNextPoint <= 0 && angleWithPreviousPoint <= 0) {
  5910. return 2;
  5911. }
  5912. if ((angleWithNextPoint >= 0 && angleWithPreviousPoint >= 0) || ((180 - Math.abs(angleWithPreviousPoint * (180 / Math.PI)) < 30) && Math.abs(angleWithNextPoint * (180 / Math.PI)) < 30)) {
  5913. return 0;
  5914. }
  5915. if (180 - Math.abs(angleWithPreviousPoint * (180 / Math.PI)) > 30) {
  5916. return 3;
  5917. }
  5918. return 4;
  5919. };
  5920. var labelAccessor = this.getlDataLabelAccessor(dataSet, "label", false);
  5921. var labelEntry = this.getEntryForDataLabelFormatter(dataSet, "label", "y");
  5922. this._pointComponent.itemLabel(true);
  5923. this._pointComponent.labelFont(this.getBackgroundConstrastLabelStyle());
  5924. this._pointComponent.labelFormatter(this.context.getCustomFormatterForElementLabels(labelEntry, (dataSet.slot("label").entry()) ? "ROLE_NONE" : "ROLE_Y2"));
  5925. this._pointComponent.labelAccessor(labelAccessor);
  5926. this._pointComponent.itemLabelPosition(dataLabelPosition);
  5927. },
  5928. /**
  5929. * Start a Rave timer with a delay of half the transition duration and a start time of the current time plus the duration. If there are no staggered transitions, (that is, no delay function) this should trigger the label collisions to begin as soon as the ordinary transitions end, after the duration. If there are staggered transitions, we have to wait double the transition time. In this way the label collisions will never fire until all the transitions are complete, and the labels will have settled into their target positions and be ready for collision resolution. Note that this delay will occur even when there are no visible transitions--there is no way to tell whether we are doing a full redraw, or a minor property update.
  5930. * @param (rave['internal']['Selector']) chart the entire chart
  5931. * @param (rave['internal']['RectStruct']) chartRect the center rectangle for the chart area, without axes or legends
  5932. * @param (Object) delayFunction if null, there are no staggered transitions
  5933. */
  5934. /** @expose */
  5935. runLabelCollisions : function(chart, chartRect, duration, delayFunction) {
  5936. if (!(this.isShowDataLabels())) {
  5937. return;
  5938. }
  5939. var self = this;
  5940. var staggeredTransitions = delayFunction == null ? false : true;
  5941. this._pendingLabelTimer = true;
  5942. var labelCollideCallback = function(elapsed) {
  5943. if (self._cancelLabelTimers > 0) {
  5944. self._cancelLabelTimers--;
  5945. return true;
  5946. }
  5947. self._labelCollisionComponent.bounds(chartRect).numberOfSweeps(1000).labelResolution("Drop Labels");
  5948. chart.call(self._labelCollisionComponent);
  5949. self._pendingLabelTimer = false;
  5950. return true;
  5951. };
  5952. if (staggeredTransitions) {
  5953. rave.timer(labelCollideCallback, duration * 2.0);
  5954. } else {
  5955. rave.timer(labelCollideCallback, duration);
  5956. }
  5957. },
  5958. /**
  5959. * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
  5960. */
  5961. /** @expose */
  5962. stopLabelCollisions : function() {
  5963. this._labelCollisionComponent.labelResolution("none");
  5964. if (this._pendingLabelTimer) {
  5965. this._cancelLabelTimers++;
  5966. }
  5967. },
  5968. /** @expose */
  5969. getGroupStructure : function() {
  5970. return ["defs", "g.vizlibrary vizlibrary-composite", "(", "rect.background chart", "g.chart", "(", "rect.background elements", "g.gridlines", "(", "g.grid left", "g.grid right", "g.grid top", "g.grid bottom", ")", "g.content1", "(", "g.element-column", "(", "g.element-group", "g.element-label-group", ")", ")", "g.axes", "(", "g.axes-layout", "g.axisTransform left", "g.axisTransform right", "g.axisTransform top", "g.axisTransform bottom", ")", "g.content2", "(", "g.elements2", "(", "g.element-group element-line", "g.element-point", "(", "g.element-group", "g.element-label-group", ")", ")", ")", "g.axis-callout", ")", "g.legends", "(", "g.legends-layout", "g.legend line", "g.legend column", ")", ")"];
  5971. }
  5972. });
  5973. com_ibm_rave_bundles_compositeBundle_CompositeView.SCALE_PADDING = 2.0;
  5974. //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASET_COLUMNDATA = "column";
  5975. //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASET_LINEDATA = "line";
  5976. //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASLOT_GROUP = "color";
  5977. //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASLOT_KEY = "key";
  5978. /**
  5979. * CSS class for shapes inside an element.
  5980. */
  5981. //com_ibm_rave_bundles_compositeBundle_CompositeView.ELEMENT_SHAPE_CLASSES = "element-shape";
  5982. //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_WITH_POINTS_SYMBOL = "lineWithPoints.symbol";
  5983. //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_OR_POINTS_DISPLAY = "lineWithPoints.display";
  5984. //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_DISPLAY = "line";
  5985. //com_ibm_rave_bundles_compositeBundle_CompositeView.POINTS_DISPLAY = "points";
  5986. //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_WITH_POINTS_DISPLAY = "line_points";
  5987. //com_ibm_rave_bundles_compositeBundle_CompositeView.COLUMN_BORDER_WIDTH = "column.border.width";
  5988. //com_ibm_rave_bundles_compositeBundle_CompositeView.COLUMN_BORDER_COLOR = "column.border.color";
  5989. //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_WITH_POINTS_SIZE = "lineWithPoints.size";
  5990. //com_ibm_rave_bundles_compositeBundle_CompositeView.COLOR_PALLETTE_COLUMN = "color.palette.column";
  5991. //com_ibm_rave_bundles_compositeBundle_CompositeView.COLOR_PALLETTE_LINE = "color.palette.line";
  5992. //com_ibm_rave_bundles_compositeBundle_CompositeView.AXIS_LINE_COLUMN_SWAP = "swapLineColumn";
  5993. /** @expose */
  5994. com_ibm_rave_bundles_compositeBundle_CompositeView.GRID_ALIGN_DEPENDENT_AXES = "alignAxes";
  5995. //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_INTERPOLATE_PROPERTY = "lineWithPoints.interpolate";
  5996. //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_MISSING_AS_GAP_PROPERTY = "lineWithPoints.showMissingAsGap";
  5997. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_DISPLAY = "legend.line.display";
  5998. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLE = "legend.line.title";
  5999. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FONT = "legend.line.titlestyle.font";
  6000. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_ENTRYSTYLE_FONT = "legend.line.entrystyle.font";
  6001. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FILL = "legend.line.titlestyle.fill";
  6002. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FONTSIZE = "legend.line.titlestyle.fontsize";
  6003. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FONTFAMILY = "legend.line.titlestyle.fontfamily";
  6004. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_DISPLAY = "legend.column.display";
  6005. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLE = "legend.column.title";
  6006. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FONT = "legend.column.titlestyle.font";
  6007. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_ENTRYSTYLE_FONT = "legend.column.entrystyle.font";
  6008. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FILL = "legend.column.titlestyle.fill";
  6009. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FONTSIZE = "legend.column.titlestyle.fontsize";
  6010. //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FONTFAMILY = "legend.column.titlestyle.fontfamily";
  6011. com_ibm_rave_bundles_compositeBundle_CompositeView.DATASET_COMPOSITE = "composite";
  6012. com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE = "simple";
  6013. // $source: com/ibm/rave/bundles/components/BackgroundComponentImpl
  6014. /************************************************************************
  6015. ** IBM Confidential
  6016. **
  6017. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  6018. **
  6019. ** (C) Copyright IBM Corp. 2017
  6020. **
  6021. ** The source code for this program is not published or otherwise divested of its trade secrets,
  6022. ** irrespective of what has been deposited with the U.S. Copyright Office.
  6023. ************************************************************************/
  6024. // GENERATED
  6025. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  6026. //@import com/ibm/rave/bundles/component/BackgroundComponent (runtime) // BackgroundComponent
  6027. /**
  6028. * <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>
  6029. */
  6030. var com_ibm_rave_bundles_components_BackgroundComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  6031. //_backgroundColor : null,
  6032. //_rect : null,
  6033. /** @expose */
  6034. constructor : function() {
  6035. this._rect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6036. },
  6037. /** @expose */
  6038. execute : function(g) {
  6039. this.preExecute();
  6040. g.style("fill", this._backgroundColor != null ? this._backgroundColor : "#FFFFFF").style("fill-opacity", 1.0);
  6041. g.attr("x", this._rect.x).attr("y", this._rect.y).attr("width", this._rect.width).attr("height", this._rect.height);
  6042. },
  6043. /** @expose */
  6044. type : function() {
  6045. return com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE;
  6046. },
  6047. backgroundColor$0 : function() {
  6048. return this._backgroundColor;
  6049. },
  6050. backgroundColor$1 : function(backgroundColor) {
  6051. this._backgroundColor = backgroundColor;
  6052. return this;
  6053. },
  6054. /**
  6055. * @param (rave['library']['internal']['ContextSize']) size New value of size property
  6056. * @return (com.ibm.rave.bundles.components.BackgroundComponentImpl) This component
  6057. */
  6058. /** @expose */
  6059. size : function(size) {
  6060. this._rect.x = 0;
  6061. this._rect.y = 0;
  6062. this._rect.width = size.w;
  6063. this._rect.height = size.h;
  6064. return this;
  6065. },
  6066. /** @expose */
  6067. rect : function(rect) {
  6068. var r = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
  6069. this._rect = r;
  6070. return this;
  6071. },
  6072. /** @expose */
  6073. backgroundColor : function(a0) {
  6074. var args = arguments;
  6075. if (args.length == 0) {
  6076. return this.backgroundColor$0();
  6077. }
  6078. return this.backgroundColor$1(a0);
  6079. }
  6080. });
  6081. // $source: com/ibm/rave/bundles/components/ChartLayoutComponentImpl
  6082. /************************************************************************
  6083. ** IBM Confidential
  6084. **
  6085. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  6086. **
  6087. ** (C) Copyright IBM Corp. 2017
  6088. **
  6089. ** The source code for this program is not published or otherwise divested of its trade secrets,
  6090. ** irrespective of what has been deposited with the U.S. Copyright Office.
  6091. ************************************************************************/
  6092. // GENERATED
  6093. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  6094. //@import com/ibm/rave/bundles/component/ChartLayoutComponent (runtime) // ChartLayoutComponent
  6095. /**
  6096. * <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>
  6097. */
  6098. var com_ibm_rave_bundles_components_ChartLayoutComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  6099. //_padding : null,
  6100. //_legendChartGap : null,
  6101. //_topChartPadding : null,
  6102. //_leftChartPadding : null,
  6103. //_bottomChartPadding : null,
  6104. //_rightChartPadding : null,
  6105. //_legendPosition : null,
  6106. //_legendSizable : null,
  6107. //_axisSizables : null,
  6108. //_overallRect : null,
  6109. //_legendRect : null,
  6110. //_chartRect : null,
  6111. //_topRect : null,
  6112. //_leftRect : null,
  6113. //_bottomRect : null,
  6114. //_rightRect : null,
  6115. //_elementRect : null,
  6116. _leftPadding : 0, _topPadding : 0, _rightPadding : 0, _bottomPadding : 0,
  6117. _legendChartAlign : false,
  6118. _preLegendAtMax : false,
  6119. _preAxesAtZero : false,
  6120. constructor : function() {
  6121. this._axisSizables = [];
  6122. /**
  6123. * Construct. All padding is 0, legendPosition is "right", all slices have a size of 0 (value of null).
  6124. */
  6125. {
  6126. this._padding = 0.0;
  6127. this._topPadding = 0;
  6128. this._leftPadding = 0;
  6129. this._bottomPadding = 0;
  6130. this._rightPadding = 0;
  6131. this._topChartPadding = 0.0;
  6132. this._leftChartPadding = 0.0;
  6133. this._bottomChartPadding = 0.0;
  6134. this._rightChartPadding = 0.0;
  6135. this._legendChartGap = 0.0;
  6136. this._legendPosition = "right";
  6137. this._overallRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6138. this._legendRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6139. this._chartRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6140. this._topRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6141. this._leftRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6142. this._bottomRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6143. this._rightRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6144. this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
  6145. this._legendChartAlign = true;
  6146. }
  6147. },
  6148. /** @expose */
  6149. execute : function(g) {
  6150. this.layout();
  6151. },
  6152. /**
  6153. * Calculates rectangles during preliminary layout
  6154. * @param (boolean) legendAtMax true if legend is given max size; false if legend is asked for its preferred size
  6155. * @param (boolean) axesAtZero true if axes are given a size of 0; false if axes are asked for their preferred size
  6156. */
  6157. /** @expose */
  6158. preLayout : function(legendAtMax, axesAtZero) {
  6159. this._preLegendAtMax = legendAtMax;
  6160. this._preAxesAtZero = axesAtZero;
  6161. this.layout();
  6162. this._preLegendAtMax = false;
  6163. this._preAxesAtZero = false;
  6164. },
  6165. /**
  6166. * Calls preExecute, then does the layout with the property values, updating the chart, legend, axis, and elements rectangles.
  6167. */
  6168. /** @expose */
  6169. layout : function() {
  6170. this.preExecute();
  6171. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._chartRect, this._overallRect);
  6172. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._legendRect, this._overallRect);
  6173. var x = this._overallRect.x;
  6174. var y = this._overallRect.y;
  6175. var w = this._overallRect.width;
  6176. var h = this._overallRect.height;
  6177. var maxWH = Math.max(w, h);
  6178. var tbLegend = "top" == this._legendPosition || "bottom" == this._legendPosition;
  6179. var legendPercent = this._axisSizables.length == 0 ? 0.5 : 0.3;
  6180. var legendMaxSize = (tbLegend ? this._legendRect.height : this._legendRect.width) * legendPercent;
  6181. var legendDynamicSize = this._legendSizable ? (this._preLegendAtMax ? maxWH : this._legendSizable.getPreferredSize()) : 0;
  6182. if (legendDynamicSize > legendMaxSize) {
  6183. legendDynamicSize = legendMaxSize;
  6184. }
  6185. var isLegendTop = false;
  6186. var isLegendBottom = false;
  6187. var isLegendLeft = false;
  6188. var isLegendRight = false;
  6189. if ("top" == this._legendPosition) {
  6190. this._legendRect.height = legendDynamicSize;
  6191. this._chartRect.height -= this._legendRect.height;
  6192. this._chartRect.y += this._legendRect.height;
  6193. isLegendTop = true;
  6194. } else if ("bottom" == this._legendPosition) {
  6195. this._legendRect.height = legendDynamicSize;
  6196. this._chartRect.height -= this._legendRect.height;
  6197. this._legendRect.y = y + h - this._legendRect.height;
  6198. isLegendBottom = true;
  6199. } else if ("left" == this._legendPosition) {
  6200. this._legendRect.width = legendDynamicSize;
  6201. this._chartRect.width -= this._legendRect.width;
  6202. this._chartRect.x += this._legendRect.width;
  6203. isLegendLeft = true;
  6204. } else {
  6205. this._legendRect.width = legendDynamicSize;
  6206. this._chartRect.width -= this._legendRect.width;
  6207. this._legendRect.x = x + w - this._legendRect.width;
  6208. isLegendRight = true;
  6209. }
  6210. if (this.evaluatePadding(this._padding, w, h)) {
  6211. var lrgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, w);
  6212. var tbgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, h);
  6213. var chartTop = isLegendTop && this._legendSizable ? tbgap : this._topPadding;
  6214. var chartLeft = isLegendLeft && this._legendSizable ? lrgap : this._leftPadding;
  6215. var chartBottom = isLegendBottom && this._legendSizable ? tbgap : this._bottomPadding;
  6216. var chartRight = isLegendRight && this._legendSizable ? lrgap : this._rightPadding;
  6217. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  6218. } else {
  6219. var lrpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, w);
  6220. var tbpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, h);
  6221. var chartTop = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);
  6222. var chartLeft = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding, w);
  6223. var chartBottom = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding, h);
  6224. var chartRight = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._rightChartPadding, w);
  6225. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
  6226. this._topPadding = tbpadding;
  6227. this._leftPadding = lrpadding;
  6228. this._bottomPadding = tbpadding;
  6229. this._rightPadding = lrpadding;
  6230. }
  6231. if (this._legendSizable) {
  6232. if (isLegendRight) {
  6233. this._legendRect.x -= this._rightPadding;
  6234. this._chartRect.width -= this._rightPadding;
  6235. this._legendRect.y += this._topPadding;
  6236. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  6237. } else if (isLegendLeft) {
  6238. this._legendRect.x += this._leftPadding;
  6239. this._chartRect.x += this._leftPadding;
  6240. this._chartRect.width -= this._leftPadding;
  6241. this._legendRect.y += this._topPadding;
  6242. this._legendRect.height -= (this._topPadding + this._bottomPadding);
  6243. } else if (isLegendTop) {
  6244. this._legendRect.y += this._topPadding;
  6245. this._chartRect.y += this._topPadding;
  6246. this._chartRect.height -= this._topPadding;
  6247. this._legendRect.x += this._leftPadding;
  6248. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  6249. } else {
  6250. this._legendRect.y -= this._bottomPadding;
  6251. this._chartRect.height -= this._bottomPadding;
  6252. this._legendRect.x += this._leftPadding;
  6253. this._legendRect.width -= (this._leftPadding + this._rightPadding);
  6254. }
  6255. }
  6256. x = this._chartRect.x;
  6257. y = this._chartRect.y;
  6258. w = this._chartRect.width;
  6259. h = this._chartRect.height;
  6260. var bottomH = 0;
  6261. var topH = 0;
  6262. var leftW = 0;
  6263. var rightW = 0;
  6264. var tbSO = 0;
  6265. var lrSO = 0;
  6266. if (!this._preAxesAtZero) {
  6267. var countHorz = 0;
  6268. var countVert = 0;
  6269. for (var i = 0; i < this._axisSizables.length; ++i) {
  6270. var sizable = this._axisSizables[i];
  6271. if (sizable) {
  6272. var orientation = sizable.getSizableOrientation();
  6273. if ("top" == orientation || "bottom" == orientation) {
  6274. countHorz++;
  6275. } else {
  6276. countVert++;
  6277. }
  6278. }
  6279. }
  6280. for (var i = 0; i < this._axisSizables.length; ++i) {
  6281. var sizable = this._axisSizables[i];
  6282. if (sizable) {
  6283. var orientation = sizable.getSizableOrientation();
  6284. var tbAxis = "top" == orientation || "bottom" == orientation;
  6285. var axisDynamicSize = sizable.getPreferredSize();
  6286. var spillOver = sizable.getSpillOverSize();
  6287. if (tbAxis) {
  6288. var axisPercent = countHorz > 1 ? 0.4 : 0.5;
  6289. if (axisDynamicSize > this._chartRect.height * axisPercent) {
  6290. axisDynamicSize = this._chartRect.height * axisPercent;
  6291. }
  6292. if ("top" == orientation) {
  6293. topH = axisDynamicSize;
  6294. } else {
  6295. bottomH = axisDynamicSize;
  6296. }
  6297. if (spillOver > lrSO) {
  6298. lrSO = spillOver;
  6299. }
  6300. } else {
  6301. var axisPercent = countVert > 1 ? 0.4 : 0.5;
  6302. if (axisDynamicSize > this._chartRect.width * axisPercent) {
  6303. axisDynamicSize = this._chartRect.width * axisPercent;
  6304. }
  6305. if ("left" == orientation) {
  6306. leftW = axisDynamicSize;
  6307. } else {
  6308. rightW = axisDynamicSize;
  6309. }
  6310. if (spillOver > tbSO) {
  6311. tbSO = spillOver;
  6312. }
  6313. }
  6314. }
  6315. }
  6316. }
  6317. if (lrSO > leftW) {
  6318. leftW = lrSO;
  6319. }
  6320. if (lrSO > rightW) {
  6321. rightW = lrSO;
  6322. }
  6323. if (tbSO > topH) {
  6324. topH = tbSO;
  6325. }
  6326. if (tbSO > bottomH) {
  6327. bottomH = tbSO;
  6328. }
  6329. this._leftRect.x = x;
  6330. this._leftRect.width = leftW;
  6331. this._leftRect.y = y;
  6332. this._leftRect.height = h;
  6333. this._rightRect.x = x + w - rightW;
  6334. this._rightRect.width = rightW;
  6335. this._rightRect.y = y;
  6336. this._rightRect.height = h;
  6337. this._topRect.y = y;
  6338. this._topRect.height = topH;
  6339. this._topRect.x = x;
  6340. this._topRect.width = w;
  6341. this._bottomRect.y = y + h - bottomH;
  6342. this._bottomRect.height = bottomH;
  6343. this._bottomRect.x = x;
  6344. this._bottomRect.width = w;
  6345. this._elementRect.x = x + leftW;
  6346. this._elementRect.y = y + topH;
  6347. this._elementRect.width = w - (leftW + rightW);
  6348. this._elementRect.height = h - (topH + bottomH);
  6349. if (this._legendSizable && this._legendChartAlign) {
  6350. if (tbLegend) {
  6351. this._legendRect.x = this._elementRect.x;
  6352. this._legendRect.width = this._elementRect.width;
  6353. } else {
  6354. this._legendRect.y = this._elementRect.y;
  6355. this._legendRect.height = this._elementRect.height;
  6356. }
  6357. }
  6358. },
  6359. evaluatePadding : function(padding, horizontalExtent, verticalExtent) {
  6360. if (padding == null) {
  6361. return false;
  6362. }
  6363. var paddingString = (padding) + "";
  6364. if (paddingString.length == 0) {
  6365. return false;
  6366. }
  6367. this._topPadding = 0;
  6368. this._leftPadding = 0;
  6369. this._bottomPadding = 0;
  6370. this._rightPadding = 0;
  6371. var items = paddingString.split(new RegExp(";"));
  6372. for (var __i_enFor0 = 0, __len_enFor0 = items.length;
  6373. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  6374. var item = items[__i_enFor0];
  6375. var parts = item.split(new RegExp(":"));
  6376. if (items.length == 1 && parts.length != 2) {
  6377. return false;
  6378. }
  6379. if (parts.length == 2) {
  6380. if (0 <= parts[0].indexOf("top")) {
  6381. this._topPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  6382. } else if (0 <= parts[0].indexOf("left")) {
  6383. this._leftPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  6384. } else if (0 <= parts[0].indexOf("bottom")) {
  6385. this._bottomPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
  6386. } else if (0 <= parts[0].indexOf("right")) {
  6387. this._rightPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
  6388. }
  6389. }
  6390. }
  6391. return true;
  6392. },
  6393. /**
  6394. * @return (rave['internal']['RectStruct']) Legend rectangle
  6395. */
  6396. /** @expose */
  6397. legendRect : function() {
  6398. return this._legendRect;
  6399. },
  6400. /**
  6401. * @return (rave['internal']['RectStruct']) Chart (elements plus axes) rectangle
  6402. */
  6403. /** @expose */
  6404. chartRect : function() {
  6405. return this._chartRect;
  6406. },
  6407. /**
  6408. * @return (rave['internal']['RectStruct']) Top axis rectangle
  6409. */
  6410. /** @expose */
  6411. topRect : function() {
  6412. return this._topRect;
  6413. },
  6414. /**
  6415. * @return (rave['internal']['RectStruct']) Left axis rectangle
  6416. */
  6417. /** @expose */
  6418. leftRect : function() {
  6419. return this._leftRect;
  6420. },
  6421. /**
  6422. * @return (rave['internal']['RectStruct']) Bottom axis rectangle
  6423. */
  6424. /** @expose */
  6425. bottomRect : function() {
  6426. return this._bottomRect;
  6427. },
  6428. /**
  6429. * @return (rave['internal']['RectStruct']) Right axis rectangle
  6430. */
  6431. /** @expose */
  6432. rightRect : function() {
  6433. return this._rightRect;
  6434. },
  6435. /**
  6436. * @return (rave['internal']['RectStruct']) Legend rectangle
  6437. */
  6438. /** @expose */
  6439. elementRect : function() {
  6440. return this._elementRect;
  6441. },
  6442. /**
  6443. * Set the overall rectangle. This should be called before doing the layout.
  6444. * @param (rave['internal']['RectStruct']) overall The overall rectangle
  6445. */
  6446. /** @expose */
  6447. overall : function(overall) {
  6448. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._overallRect, overall);
  6449. return this;
  6450. },
  6451. padding$0 : function() {
  6452. return this._padding;
  6453. },
  6454. legendChartAlign$0 : function() {
  6455. return this._legendChartAlign;
  6456. },
  6457. legendChartGap$0 : function() {
  6458. return this._legendChartGap;
  6459. },
  6460. topPadding$0 : function() {
  6461. return this._topChartPadding;
  6462. },
  6463. leftPadding$0 : function() {
  6464. return this._leftChartPadding;
  6465. },
  6466. bottomPadding$0 : function() {
  6467. return this._bottomChartPadding;
  6468. },
  6469. rightPadding$0 : function() {
  6470. return this._rightChartPadding;
  6471. },
  6472. legendPosition$0 : function() {
  6473. return this._legendPosition;
  6474. },
  6475. topPadding$1 : function(padding) {
  6476. this._topChartPadding = padding;
  6477. return this;
  6478. },
  6479. leftPadding$1 : function(padding) {
  6480. this._leftChartPadding = padding;
  6481. return this;
  6482. },
  6483. bottomPadding$1 : function(padding) {
  6484. this._bottomChartPadding = padding;
  6485. return this;
  6486. },
  6487. rightPadding$1 : function(padding) {
  6488. this._rightChartPadding = padding;
  6489. return this;
  6490. },
  6491. /** @expose */
  6492. type : function() {
  6493. return com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE;
  6494. },
  6495. padding$1 : function(value) {
  6496. this._padding = value;
  6497. return this;
  6498. },
  6499. /** @expose */
  6500. chartPadding : function(top, left, bottom, right) {
  6501. this._topChartPadding = top;
  6502. this._leftChartPadding = left;
  6503. this._bottomChartPadding = bottom;
  6504. this._rightChartPadding = right;
  6505. return this;
  6506. },
  6507. legendChartAlign$1 : function(legendChartAlign) {
  6508. this._legendChartAlign = legendChartAlign;
  6509. return this;
  6510. },
  6511. legendChartGap$1 : function(value) {
  6512. this._legendChartGap = value;
  6513. return this;
  6514. },
  6515. legendPosition$1 : function(position) {
  6516. if ("top" == position || "bottom" == position || "left" == position || "right" == position) {
  6517. this._legendPosition = position;
  6518. }
  6519. return this;
  6520. },
  6521. /** @expose */
  6522. legendSize : function(sizable) {
  6523. this._legendSizable = sizable;
  6524. return this;
  6525. },
  6526. /** @expose */
  6527. removeAxisSizables : function() {
  6528. this._axisSizables.length = 0;
  6529. return this;
  6530. },
  6531. /** @expose */
  6532. addAxisSizable : function(sizable) {
  6533. this._axisSizables.push(sizable);
  6534. return this;
  6535. },
  6536. /** @expose */
  6537. padding : function(a0) {
  6538. var args = arguments;
  6539. if (args.length == 0) {
  6540. return this.padding$0();
  6541. }
  6542. return this.padding$1(a0);
  6543. },
  6544. /** @expose */
  6545. legendChartAlign : function(a0) {
  6546. var args = arguments;
  6547. if (args.length == 0) {
  6548. return this.legendChartAlign$0();
  6549. }
  6550. return this.legendChartAlign$1(a0);
  6551. },
  6552. /** @expose */
  6553. legendChartGap : function(a0) {
  6554. var args = arguments;
  6555. if (args.length == 0) {
  6556. return this.legendChartGap$0();
  6557. }
  6558. return this.legendChartGap$1(a0);
  6559. },
  6560. /** @expose */
  6561. topPadding : function(a0) {
  6562. var args = arguments;
  6563. if (args.length == 0) {
  6564. return this.topPadding$0();
  6565. }
  6566. return this.topPadding$1(a0);
  6567. },
  6568. /** @expose */
  6569. leftPadding : function(a0) {
  6570. var args = arguments;
  6571. if (args.length == 0) {
  6572. return this.leftPadding$0();
  6573. }
  6574. return this.leftPadding$1(a0);
  6575. },
  6576. /** @expose */
  6577. bottomPadding : function(a0) {
  6578. var args = arguments;
  6579. if (args.length == 0) {
  6580. return this.bottomPadding$0();
  6581. }
  6582. return this.bottomPadding$1(a0);
  6583. },
  6584. /** @expose */
  6585. rightPadding : function(a0) {
  6586. var args = arguments;
  6587. if (args.length == 0) {
  6588. return this.rightPadding$0();
  6589. }
  6590. return this.rightPadding$1(a0);
  6591. },
  6592. /** @expose */
  6593. legendPosition : function(a0) {
  6594. var args = arguments;
  6595. if (args.length == 0) {
  6596. return this.legendPosition$0();
  6597. }
  6598. return this.legendPosition$1(a0);
  6599. }
  6600. });
  6601. /**
  6602. * Set preferred rectangle to the same position and size as the source rectangle.
  6603. * @param (rave['internal']['RectStruct']) t preferred rectangle
  6604. * @param (rave['internal']['RectStruct']) s Source rectangle
  6605. * @return (rave['internal']['RectStruct']) preferred rectangle
  6606. */
  6607. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect = function(t, s) {
  6608. t.x = s.x;
  6609. t.y = s.y;
  6610. t.width = s.width;
  6611. t.height = s.height;
  6612. return t;
  6613. };
  6614. /**
  6615. * 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.
  6616. * @param (rave['internal']['RectStruct']) r Rectangle
  6617. * @param (double) top Top inset in pixels
  6618. * @param (double) left Left inset in pixels
  6619. * @param (double) bottom Bottom inset in pixels
  6620. * @param (double) right Right inset in pixels
  6621. * @return (rave['internal']['RectStruct']) The rectangle
  6622. */
  6623. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset = function(r, top, left, bottom, right) {
  6624. var ileft = Math.max(0.0, left);
  6625. var iright = Math.max(0.0, right);
  6626. if (ileft + iright <= r.width) {
  6627. r.x += ileft;
  6628. r.width -= ileft + iright;
  6629. }
  6630. var itop = Math.max(0.0, top);
  6631. var ibottom = Math.max(0.0, bottom);
  6632. if (itop + ibottom <= r.height) {
  6633. r.y += itop;
  6634. r.height -= itop + ibottom;
  6635. }
  6636. return r;
  6637. };
  6638. /**
  6639. * 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.
  6640. * @param (Object) value The size
  6641. * @param (double) extent The extent in the dimension
  6642. * @param defValue The default to use if not parsable
  6643. * @return (double) Size in pixels
  6644. */
  6645. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize = function(value, extent) {
  6646. var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10.0);
  6647. var d = v != null ? v : 0;
  6648. return Math.max(0.0, Math.min(d, extent));
  6649. };
  6650. /** @expose */
  6651. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT = 0.4;
  6652. /** @expose */
  6653. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT_SINGLE_PER_ORIENTATION = 0.5;
  6654. /** @expose */
  6655. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT = 0.3;
  6656. /** @expose */
  6657. com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT_NO_AXIS = 0.5;
  6658. // $source: com/ibm/rave/bundles/components/ClipPathComponentImpl
  6659. /************************************************************************
  6660. ** IBM Confidential
  6661. **
  6662. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  6663. **
  6664. ** (C) Copyright IBM Corp. 2017
  6665. **
  6666. ** The source code for this program is not published or otherwise divested of its trade secrets,
  6667. ** irrespective of what has been deposited with the U.S. Copyright Office.
  6668. ************************************************************************/
  6669. // GENERATED
  6670. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  6671. /**
  6672. * 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>
  6673. */
  6674. var com_ibm_rave_bundles_components_ClipPathComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  6675. //_id : null,
  6676. //_clipRect : null,
  6677. constructor : function(id) {
  6678. this._clipRect = new rave['internal']['RectStruct'](0, 0, 100, 100);
  6679. /**
  6680. * 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.
  6681. * @param (String) id String ID that is unique <em>across the document</em>.
  6682. */
  6683. {
  6684. this._id = id;
  6685. }
  6686. },
  6687. /** @expose */
  6688. type : function() {
  6689. return "ClipPathComponent";
  6690. },
  6691. /**
  6692. * Set the rectangular clipping area. Make the _clipRect one pixel larger than requested to avoid the cut-off at bounds. TODO: why?!?
  6693. * @param (rave['internal']['RectStruct']) rect The rectangular bounds of the clipping area.
  6694. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  6695. */
  6696. /** @expose */
  6697. clipRect : function(rect) {
  6698. this._clipRect = new rave['internal']['RectStruct'](rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2);
  6699. return this;
  6700. },
  6701. /**
  6702. * Set the clip-path attribute on the provided selection.
  6703. * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
  6704. */
  6705. /** @expose */
  6706. applyTo : function(s) {
  6707. s.attr("clip-path", "url(" + this.url() + ")");
  6708. return this;
  6709. },
  6710. /**
  6711. * Retrieve the id assigned to this clip path.
  6712. */
  6713. /** @expose */
  6714. id : function() {
  6715. return this._id;
  6716. },
  6717. /**
  6718. * Retrieve the URL that can be used to reference this clip path.
  6719. */
  6720. /** @expose */
  6721. url : function() {
  6722. return "#" + this._id;
  6723. },
  6724. /** @expose */
  6725. execute : function(g) {
  6726. var clipPath = g.selectAll("#" + this._id).data([0]);
  6727. clipPath.enter().append("clipPath").attr("id", this._id).append("rect");
  6728. 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);
  6729. }
  6730. });
  6731. // $source: com/ibm/rave/bundles/components/LegendComponentImpl
  6732. /************************************************************************
  6733. ** IBM Confidential
  6734. **
  6735. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  6736. **
  6737. ** (C) Copyright IBM Corp. 2017
  6738. **
  6739. ** The source code for this program is not published or otherwise divested of its trade secrets,
  6740. ** irrespective of what has been deposited with the U.S. Copyright Office.
  6741. ************************************************************************/
  6742. // GENERATED
  6743. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  6744. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  6745. /**
  6746. * <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>
  6747. */
  6748. var com_ibm_rave_bundles_components_LegendComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  6749. /**
  6750. * Legend size property
  6751. */
  6752. //_size : null,
  6753. /**
  6754. * Color scale
  6755. */
  6756. //_colorPalette : null,
  6757. /**
  6758. * Orient, "horizontal" or "vertical"
  6759. */
  6760. //_orient : null,
  6761. /**
  6762. * Swatch size function
  6763. */
  6764. //_swatchSizeFunc : null,
  6765. /**
  6766. * Scale
  6767. */
  6768. //_scale : null,
  6769. /**
  6770. * Swatch symbol
  6771. */
  6772. //_shape : null,
  6773. /**
  6774. * Legend title
  6775. */
  6776. //_title : null,
  6777. /**
  6778. * Legend title styling
  6779. */
  6780. //_titleStyle : null,
  6781. /**
  6782. * Legend entry styling
  6783. */
  6784. //_entryStyle : null,
  6785. /**
  6786. * Custom formatter
  6787. */
  6788. //_labelFormat : null,
  6789. /**
  6790. * The swatch legend, created on demand
  6791. */
  6792. //_swatchLegend : null,
  6793. /**
  6794. * The continuous legend, created on demand
  6795. */
  6796. //_continuousLegend : null,
  6797. /**
  6798. * The legend type, either "SwatchLegend" or "ContinuousLegend"
  6799. */
  6800. //_legendType : null,
  6801. /**
  6802. * Is the legend visible
  6803. */
  6804. _visible : false,
  6805. /**
  6806. * Swatch size in square pixels
  6807. */
  6808. _swatchSize : 0,
  6809. /**
  6810. * Constructor; sets bound and, colorScale to null, all other properties to their default values.
  6811. */
  6812. /** @expose */
  6813. constructor : function() {
  6814. this._visible = true;
  6815. this._size = null;
  6816. this._colorPalette = null;
  6817. this._orient = "horizontal";
  6818. this._swatchSize = 16.0 * 16.0;
  6819. this._swatchSizeFunc = null;
  6820. this._scale = null;
  6821. this._shape = "square";
  6822. this._title = null;
  6823. this._titleStyle = {};
  6824. this._entryStyle = {};
  6825. this._labelFormat = null;
  6826. this._swatchLegend = null;
  6827. this._continuousLegend = null;
  6828. this._legendType = null;
  6829. },
  6830. /** @expose */
  6831. type : function() {
  6832. return "LegendComponent";
  6833. },
  6834. /** @expose */
  6835. execute : function(g) {
  6836. if (this._colorPalette) {
  6837. if ("continuous" == this._colorPalette.getType()) {
  6838. if (!this._continuousLegend) {
  6839. this._continuousLegend = (rave.capabilities.extension("legend")).continuous();
  6840. }
  6841. this._legendType = "ContinuousLegend";
  6842. } else {
  6843. if (!this._swatchLegend) {
  6844. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  6845. }
  6846. this._legendType = "SwatchLegend";
  6847. }
  6848. } else if (this._swatchSizeFunc) {
  6849. if (!this._swatchLegend) {
  6850. this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
  6851. }
  6852. this._legendType = "SwatchLegend";
  6853. } else {
  6854. this._legendType = null;
  6855. }
  6856. this.preExecute();
  6857. if (!this._visible || (!this._colorPalette && !this._swatchSizeFunc) || !this._size || this._size[0] <= 0 || this._size[1] <= 0) {
  6858. g.selectAll("*").remove();
  6859. return;
  6860. }
  6861. var fontChecker = rave.capabilities.extension("fontchecker");
  6862. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  6863. 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);
  6864. var legend = g.call(this._continuousLegend);
  6865. if (this._entryStyle) {
  6866. legend.selectAll(".legendLabel").style(this._entryStyle);
  6867. }
  6868. if (this._titleStyle) {
  6869. legend.selectAll(".legendTitle").style(this._titleStyle);
  6870. }
  6871. if (fontChecker) {
  6872. legend.selectAll(".legendLabel").call(fontChecker);
  6873. legend.selectAll(".legendTitle").call(fontChecker);
  6874. }
  6875. } else {
  6876. var insets = {};
  6877. insets["bottom"] = 5;
  6878. var swatchSize = this._swatchSize;
  6879. var scale = null;
  6880. var labelFormatter = this._labelFormat;
  6881. if (this._swatchSizeFunc && this._scale) {
  6882. swatchSize = this._swatchSizeFunc;
  6883. scale = this._scale;
  6884. }
  6885. if (this._colorPalette) {
  6886. scale = this._colorPalette.getScale();
  6887. var originalDomain = this._colorPalette.originalDomain();
  6888. if (originalDomain) {
  6889. scale.domain(originalDomain);
  6890. var f = this._colorPalette.originalDomainLabelAccessor();
  6891. if (this._labelFormat) {
  6892. var self = this;
  6893. labelFormatter = function(data, index, groupIndex) {
  6894. return self._labelFormat.call(this, f.call(this, data, index, groupIndex), index, groupIndex);
  6895. };
  6896. } else {
  6897. labelFormatter = f;
  6898. }
  6899. }
  6900. }
  6901. 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);
  6902. var legend = g.call(this._swatchLegend);
  6903. if (this._entryStyle) {
  6904. legend.selectAll(".legendLabel").style(this._entryStyle);
  6905. }
  6906. if (this._titleStyle) {
  6907. legend.selectAll(".legendTitle").style(this._titleStyle);
  6908. }
  6909. if (fontChecker) {
  6910. legend.selectAll(".legendLabel").call(fontChecker);
  6911. legend.selectAll(".legendTitle").call(fontChecker);
  6912. }
  6913. }
  6914. },
  6915. /** @expose */
  6916. legend : function() {
  6917. if ("ContinuousLegend" == this._legendType) {
  6918. return this._continuousLegend;
  6919. }
  6920. if ("SwatchLegend" == this._legendType) {
  6921. return this._swatchLegend;
  6922. }
  6923. return null;
  6924. },
  6925. /** @expose */
  6926. legendType : function() {
  6927. return this._legendType;
  6928. },
  6929. /**
  6930. * Set the visible property.
  6931. * @param (boolean) visible New visible
  6932. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  6933. */
  6934. /** @expose */
  6935. visible : function(visible) {
  6936. this._visible = visible;
  6937. return this;
  6938. },
  6939. /**
  6940. * see if the legend is visible
  6941. * @return (boolean) if its visible
  6942. */
  6943. /** @expose */
  6944. isVisible : function() {
  6945. return this._visible;
  6946. },
  6947. /**
  6948. * Set the size property.
  6949. * @param (Array) size New size
  6950. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  6951. */
  6952. /** @expose */
  6953. size : function(size) {
  6954. this._size = size;
  6955. return this;
  6956. },
  6957. /**
  6958. * Set the color scale property.
  6959. * @param (rave['library']['internal']['Palette']) colorPalette New color scale
  6960. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  6961. */
  6962. /** @expose */
  6963. colorPalette : function(colorPalette) {
  6964. this._colorPalette = colorPalette;
  6965. return this;
  6966. },
  6967. /**
  6968. * Set the orient property. If the argument is not "horizontal" or "vertical", it is ignored and the orient property is not changed.
  6969. * @param (String) orient New orient
  6970. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  6971. */
  6972. /** @expose */
  6973. orient : function(orient) {
  6974. if ("horizontal" == orient || "vertical" == orient) {
  6975. this._orient = orient;
  6976. }
  6977. return this;
  6978. },
  6979. /**
  6980. * 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".
  6981. * @param (String) position Legend position
  6982. * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
  6983. */
  6984. /** @expose */
  6985. position : function(position) {
  6986. return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
  6987. },
  6988. swatchSize$0 : function(swatchSize) {
  6989. if (swatchSize >= 0.0 && swatchSize != null) {
  6990. this._swatchSize = swatchSize;
  6991. }
  6992. return this;
  6993. },
  6994. /** @expose */
  6995. scale : function(scale) {
  6996. this._scale = scale;
  6997. return this;
  6998. },
  6999. swatchSize$1 : function(swatchSize) {
  7000. if (swatchSize) {
  7001. this._swatchSizeFunc = swatchSize;
  7002. }
  7003. return this;
  7004. },
  7005. /** @expose */
  7006. shape : function(shape) {
  7007. this._shape = shape;
  7008. return this;
  7009. },
  7010. /** @expose */
  7011. title : function(title) {
  7012. this._title = (title != null && title.length > 0) ? title : null;
  7013. return this;
  7014. },
  7015. /** @expose */
  7016. titleFill : function(titleFill) {
  7017. this._titleStyle["fill"] = titleFill;
  7018. return this;
  7019. },
  7020. /** @expose */
  7021. titleFontSize : function(titleFontSize) {
  7022. this._titleStyle["font-size"] = titleFontSize;
  7023. return this;
  7024. },
  7025. /** @expose */
  7026. titleFontFamily : function(titleFontFamily) {
  7027. this._titleStyle["font-family"] = titleFontFamily;
  7028. return this;
  7029. },
  7030. /** @expose */
  7031. labelFormat : function(labelFormat) {
  7032. this._labelFormat = labelFormat;
  7033. return this;
  7034. },
  7035. /** @expose */
  7036. titleFont : function(titleFontStyle) {
  7037. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(titleFontStyle);
  7038. return this;
  7039. },
  7040. /** @expose */
  7041. entryFont : function(entryFontStyle) {
  7042. this._entryStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(entryFontStyle);
  7043. return this;
  7044. },
  7045. /** @expose */
  7046. getSpaceUsed : function() {
  7047. if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
  7048. return this._continuousLegend.getUsedSize() + 2;
  7049. } else {
  7050. return this._swatchLegend.getUsedSize() + 2;
  7051. }
  7052. },
  7053. /** @expose */
  7054. swatchSize : function(a0) {
  7055. var args = arguments;
  7056. if (args.length == 1 && typeof a0 === "function") {
  7057. return this.swatchSize$1(a0);
  7058. }
  7059. return this.swatchSize$0(a0);
  7060. }
  7061. });
  7062. /**
  7063. * Get the orient for a position. "top" and "bottom" return "horizontal", anything else ("left", "right", or unknown/null) is "vertical".
  7064. * @param (String) position A position
  7065. * @return (String) "horizontal" or "vertical"
  7066. */
  7067. /** @expose */
  7068. com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf = function(position) {
  7069. if ("top" == position || "bottom" == position) {
  7070. return "horizontal";
  7071. }
  7072. return "vertical";
  7073. };
  7074. //com_ibm_rave_bundles_components_LegendComponentImpl.HORIZONTAL = "horizontal";
  7075. //com_ibm_rave_bundles_components_LegendComponentImpl.VERTICAL = "vertical";
  7076. com_ibm_rave_bundles_components_LegendComponentImpl.BAR_THINKNESS = 16;
  7077. com_ibm_rave_bundles_components_LegendComponentImpl.SWATCH_SIZE = 16;
  7078. /** @expose */
  7079. com_ibm_rave_bundles_components_LegendComponentImpl.TOP = "top";
  7080. /** @expose */
  7081. com_ibm_rave_bundles_components_LegendComponentImpl.BOTTOM = "bottom";
  7082. /** @expose */
  7083. com_ibm_rave_bundles_components_LegendComponentImpl.LEFT = "left";
  7084. /** @expose */
  7085. com_ibm_rave_bundles_components_LegendComponentImpl.RIGHT = "right";
  7086. /** @expose */
  7087. com_ibm_rave_bundles_components_LegendComponentImpl.ADJUSTABLE = -1;
  7088. // $source: com/ibm/rave/bundles/components/AxisComponentImpl
  7089. /************************************************************************
  7090. ** IBM Confidential
  7091. **
  7092. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  7093. **
  7094. ** (C) Copyright IBM Corp. 2018
  7095. **
  7096. ** The source code for this program is not published or otherwise divested of its trade secrets,
  7097. ** irrespective of what has been deposited with the U.S. Copyright Office.
  7098. ************************************************************************/
  7099. // GENERATED
  7100. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  7101. //@import com/ibm/rave/bundles/component/AxisComponent (runtime) // AxisComponent
  7102. //@import com/ibm/rave/bundles/utilities/TextCrossfader (runtime) // textCrossFade
  7103. //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
  7104. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  7105. /**
  7106. * <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>
  7107. */
  7108. var com_ibm_rave_bundles_components_AxisComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  7109. /**
  7110. * Axis - created on demand
  7111. */
  7112. //_axis : null,
  7113. /**
  7114. * Role, from the AxisComponent API
  7115. */
  7116. //_role : null,
  7117. /**
  7118. * CoordinateScale
  7119. */
  7120. //_scale : null,
  7121. /**
  7122. * Orient, always one of the four legal values
  7123. */
  7124. //_orient : null,
  7125. /**
  7126. * Size
  7127. */
  7128. //_bounds : null,
  7129. //_elementRect : null,
  7130. /**
  7131. * The title text; default null (nothing visible)
  7132. */
  7133. /** @expose */
  7134. _axisTitle : null,
  7135. /**
  7136. * The title style; defaults null (use the CSS styling)
  7137. */
  7138. /** @expose */
  7139. _titleStyle : null,
  7140. /**
  7141. * Axis line color; default null (use the CSS styling)
  7142. */
  7143. /** @expose */
  7144. _lineColor : null,
  7145. /**
  7146. * Axis tick color; default null (use the CSS styling)
  7147. */
  7148. /** @expose */
  7149. _tickColor : null,
  7150. /**
  7151. * Axis tick label style; defaults null (use the CSS styling)
  7152. */
  7153. /** @expose */
  7154. _labelStyle : null,
  7155. //_staggerRotate45Nodes : null,
  7156. //_staggerFirstNode : null,
  7157. //_staggerLastNode : null,
  7158. /**
  7159. * Axis tick label formatting
  7160. */
  7161. //_tickFormat : null,
  7162. //_dropOverlap : null,
  7163. /**
  7164. * Used to get the extension to enable axis label wrapping
  7165. */
  7166. //_textFlow : null,
  7167. /**
  7168. * Used to check the fonts on each label to make sure all characters are covered
  7169. */
  7170. //_fontChecker : null,
  7171. /**
  7172. * Run function that applies the properties to the axis line
  7173. */
  7174. //_axisLineProperties : null,
  7175. /**
  7176. * Run function that applies the properties to the axis ticks
  7177. */
  7178. //_axisTickProperties : null,
  7179. /**
  7180. * Run function that applies the properties to the axis tick labels
  7181. */
  7182. //_axisTickLabelProperties : null,
  7183. /**
  7184. * Run function that hides or displays the axis tick labels
  7185. */
  7186. //_displayHideLabels : null,
  7187. /**
  7188. * Run function that hides or displays the axis tick labels
  7189. */
  7190. //_panZoomLabels : null,
  7191. /**
  7192. * The tick handler registered with the axis; will get called during axis transition
  7193. */
  7194. //_tickHandler : null,
  7195. //_textTruncationIndicator : null,
  7196. /**
  7197. * Used when dealing with numeric scale on the vertical axis and the numbers don't fit
  7198. */
  7199. //_simplifiedTickFormat : null,
  7200. //_tickMagnitude : null,
  7201. /**
  7202. * Whether to display the axis title; default true
  7203. */
  7204. /** @expose */
  7205. _displayAxisTitle : false,
  7206. /**
  7207. * Whether to display the axis line; default true
  7208. */
  7209. /** @expose */
  7210. _displayAxisLine : false,
  7211. /**
  7212. * Whether to display the axis ticks; default true
  7213. */
  7214. /** @expose */
  7215. _displayTicks : false,
  7216. /**
  7217. * Whether to display the axis tick labels (conditional on show labels property); default true
  7218. */
  7219. /** @expose */
  7220. _displayTickLabels : false,
  7221. /**
  7222. * Whether to display the axis tick labels (conditional on pan-zoom hide property); default true
  7223. */
  7224. /** @expose */
  7225. _showPanZoomTickLabels : false,
  7226. /**
  7227. * Whether to rotate the axis tick labels; default false
  7228. */
  7229. _rotateLabels : false,
  7230. _staggerCellWidth : 0,
  7231. _staggerAlignFirstAtStart : false,
  7232. _staggerAlignLastAtEnd : false,
  7233. _layoutTimerId : 0,
  7234. _layoutTitleSize : 0,
  7235. _layoutLabelSize : 0,
  7236. _layoutLabelHeight : 0,
  7237. _layoutAverageDigitWidth : 0,
  7238. _layoutSpillOver : 0,
  7239. /**
  7240. * Whether to hide overlapping labels; default true
  7241. */
  7242. /** @expose */
  7243. _hideOverlappingLabels : false,
  7244. /**
  7245. * When true, don't start a new timer
  7246. */
  7247. _pendingLabelTimer : false,
  7248. /**
  7249. * The padding in px between tick axis line and tick label, and also between tick label and title. Default 16px.
  7250. */
  7251. _padding : 0,
  7252. /**
  7253. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  7254. */
  7255. _renderedShapes : false,
  7256. _layoutMode : -1,
  7257. _allowAutoAxisLayoutToChangeOrientaiton : true,
  7258. _lastAutomaticAxisLayoutOrientation : -1,
  7259. _allowStagger : false,
  7260. _allowRotate45 : false,
  7261. _allowRotate90 : false,
  7262. constructor : function() {
  7263. {
  7264. var self = this;
  7265. this._axisLineProperties = function(args) {
  7266. if (args !== null || arguments.length > 1){
  7267. args = Array.prototype.slice.call(arguments, 0);
  7268. }
  7269. {
  7270. var line = this.selectAll("path.domain");
  7271. if (self._lineColor != null) {
  7272. line.style("stroke", self._lineColor);
  7273. }
  7274. if (self._displayAxisLine) {
  7275. line.attr("visibility", null);
  7276. } else {
  7277. line.attr("visibility", "hidden");
  7278. }
  7279. return null;
  7280. }
  7281. };
  7282. this._axisTickProperties = function(args) {
  7283. if (args !== null || arguments.length > 1){
  7284. args = Array.prototype.slice.call(arguments, 0);
  7285. }
  7286. {
  7287. var tickLines = this.selectAll("line");
  7288. if (self._displayTicks) {
  7289. tickLines.attr("visibility", null);
  7290. } else {
  7291. tickLines.attr("visibility", "hidden");
  7292. }
  7293. if (self._lineColor != null) {
  7294. tickLines.style("stroke", self._tickColor);
  7295. }
  7296. return null;
  7297. }
  7298. };
  7299. this._axisTickLabelProperties = function(args) {
  7300. if (args !== null || arguments.length > 1){
  7301. args = Array.prototype.slice.call(arguments, 0);
  7302. }
  7303. {
  7304. var labels = this.selectAll("text");
  7305. labels.each(self._displayHideLabels);
  7306. labels.each(self._panZoomLabels);
  7307. labels.style(self._labelStyle);
  7308. self._axis.ticksHandler(null);
  7309. return null;
  7310. }
  7311. };
  7312. this._displayHideLabels = function(obj, group, index) {
  7313. if (self._displayTickLabels) {
  7314. if (this.rave_hasProperty("__tickLabelHidden__")) {
  7315. this.rave_removeProperty("__tickLabelHidden__");
  7316. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  7317. if (count <= 1) {
  7318. this.rave_removeProperty("__hiddenCount__");
  7319. this.removeAttribute("visibility");
  7320. } else {
  7321. this.rave_setProperty("__hiddenCount__", count - 1);
  7322. }
  7323. }
  7324. } else {
  7325. if (!(this.rave_hasProperty("__tickLabelHidden__"))) {
  7326. this.setAttribute("visibility", "hidden");
  7327. this.rave_setProperty("__tickLabelHidden__", "hidden");
  7328. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  7329. this.rave_setProperty("__hiddenCount__", count + 1);
  7330. }
  7331. }
  7332. };
  7333. this._panZoomLabels = function(obj, group, index) {
  7334. if (self._showPanZoomTickLabels) {
  7335. if (this.rave_hasProperty("__panZoomHidden__")) {
  7336. this.rave_removeProperty("__panZoomHidden__");
  7337. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  7338. if (count <= 1) {
  7339. this.rave_removeProperty("__hiddenCount__");
  7340. this.removeAttribute("visibility");
  7341. } else {
  7342. this.rave_setProperty("__hiddenCount__", count - 1);
  7343. }
  7344. }
  7345. } else {
  7346. if (!(this.rave_hasProperty("__panZoomHidden__"))) {
  7347. this.setAttribute("visibility", "hidden");
  7348. this.rave_setProperty("__panZoomHidden__", "hidden");
  7349. var count = ~~ (this.rave_getProperty("__hiddenCount__"));
  7350. this.rave_setProperty("__hiddenCount__", count + 1);
  7351. }
  7352. }
  7353. };
  7354. }
  7355. this._tickHandler = new com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler(this._axisTickLabelProperties, this._axisTickProperties);
  7356. /**
  7357. * Initialize properties to defaults
  7358. */
  7359. {
  7360. this._axis = null;
  7361. this._role = null;
  7362. this._scale = null;
  7363. this._orient = "bottom";
  7364. this._bounds = null;
  7365. this._displayAxisTitle = true;
  7366. this._axisTitle = null;
  7367. this._titleStyle = {};
  7368. this._displayAxisLine = true;
  7369. this._lineColor = null;
  7370. this._displayTicks = true;
  7371. this._tickColor = null;
  7372. this._displayTickLabels = true;
  7373. this._labelStyle = {};
  7374. this._rotateLabels = false;
  7375. this._hideOverlappingLabels = true;
  7376. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  7377. this._tickFormat = null;
  7378. this._showPanZoomTickLabels = true;
  7379. this._pendingLabelTimer = false;
  7380. this._padding = 16;
  7381. this._textFlow = rave.capabilities.extension("textflow");
  7382. this._fontChecker = rave.capabilities.extension("fontchecker");
  7383. this._renderedShapes = false;
  7384. }
  7385. },
  7386. /** @expose */
  7387. type : function() {
  7388. return com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE;
  7389. },
  7390. /** @expose */
  7391. role : function() {
  7392. return this._role;
  7393. },
  7394. /** @expose */
  7395. execute : function(g) {
  7396. this.preExecute();
  7397. if (!this._scale) {
  7398. g.selectAll("*").remove();
  7399. this._renderedShapes = false;
  7400. return;
  7401. }
  7402. this._renderedShapes = true;
  7403. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  7404. this._hideOverlappingLabels = false;
  7405. this._rotateLabels = true;
  7406. } else {
  7407. this._hideOverlappingLabels = true;
  7408. this._rotateLabels = true;
  7409. }
  7410. this.drawTitle(g);
  7411. this.drawAxis(g);
  7412. this.handleAxisText(g);
  7413. this.drawTitle(g);
  7414. },
  7415. /**
  7416. * This is one place where all the calls that affect the axis text happen in case of allowAutomaticAxisLayout the new behavior applies here
  7417. * @param (rave['internal']['Selector']) g
  7418. */
  7419. handleAxisText : function(g) {
  7420. this.stopLabelDroppingUpdate();
  7421. var duration = 0, delay = 0;
  7422. var g2 = rave.transition(g);
  7423. if (g2.isTransition()) {
  7424. var t2 = (g2);
  7425. duration = t2.duration();
  7426. delay = t2.delay();
  7427. }
  7428. var axisSelector = g.selectAll("g.axis");
  7429. var labels = axisSelector.selectAll("g.tick").filter(rave['library']['internal']['BundleUtils'].notExit).selectAll("text");
  7430. var fontChecker = rave.capabilities.extension("fontchecker");
  7431. labels.style(this._labelStyle);
  7432. if (fontChecker) {
  7433. labels.call(fontChecker);
  7434. }
  7435. var mode = this._allowAutoAxisLayoutToChangeOrientaiton ? this.determineWhichAutoMode(g) : this._lastAutomaticAxisLayoutOrientation;
  7436. this.configureStaggerData(g, mode);
  7437. this.handleLabelsRotationAndPosition(g, labels, mode);
  7438. this.hashingNumericScales(labels, this.labelExtent(g), mode);
  7439. if (duration == 0) {
  7440. this.doLabelWrapping(g, mode);
  7441. this.handleLabelsRotationAndPosition(g, labels, mode);
  7442. }
  7443. this._lastAutomaticAxisLayoutOrientation = mode;
  7444. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  7445. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  7446. var tick = axisSelector.append("g").classed("tick", true);
  7447. var tickText = tick.append("text");
  7448. if (labels.size() == 0) {
  7449. var singleValue = this._scale.scale().domain()[0];
  7450. var formatter = this._tickFormat;
  7451. if (!formatter) {
  7452. var tickFunc = this._scale.scale().tickFormat;
  7453. if (tickFunc) {
  7454. formatter = tickFunc.apply(tickFunc, [singleValue]);
  7455. }
  7456. }
  7457. var node = tickText[0][0];
  7458. var stringValue = formatter ? formatter.call(node, singleValue, 0, 0) : ""+(singleValue);
  7459. tickText.text(stringValue);
  7460. var dim = node.getBBox();
  7461. this._layoutLabelSize = isHorizontal ? dim.height : dim.width;
  7462. if (!isHorizontal || mode != 0) {
  7463. tickText.text(".0");
  7464. this._layoutLabelSize += node.getBBox().width;
  7465. }
  7466. }
  7467. if (!isHorizontal || mode != 0) {
  7468. tickText.text(".0");
  7469. var node = tickText[0][0];
  7470. var dim = node.getBBox();
  7471. this._layoutAverageDigitWidth = dim.width;
  7472. }
  7473. tick.remove();
  7474. }
  7475. if (this._hideOverlappingLabels && duration > 0) {
  7476. this.updateLabelDropping(labels, duration, delay);
  7477. }
  7478. if (duration > 0) {
  7479. this.doLabelWrappingAfterAnimation(g, labels, mode, duration, delay);
  7480. }
  7481. if (!this._displayTickLabels) {
  7482. this._layoutLabelSize = 0;
  7483. this._layoutAverageDigitWidth = 0;
  7484. }
  7485. },
  7486. /**
  7487. * 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
  7488. * @param (rave['internal']['Selector']) g selector
  7489. * @param (rave['internal']['Selector']) labels labels selector
  7490. * @param (int) mode one of HORIZONTAL, STAGGER, ROTATE90
  7491. */
  7492. handleLabelsRotationAndPosition : function(g, labels, mode) {
  7493. if (mode == 2 || mode == 1) {
  7494. if (this._orient == "bottom") {
  7495. this.rotateLabels(g, labels, "end", mode);
  7496. } else if (this._orient == "top") {
  7497. this.rotateLabels(g, labels, "start", mode);
  7498. } else {
  7499. this.rotateLabels(g, labels, "middle", mode);
  7500. }
  7501. } else {
  7502. if (this._orient == "bottom" || this._orient == "top") {
  7503. this.rotateLabels(g, labels, "middle", mode);
  7504. } else if (this._orient == "right") {
  7505. this.rotateLabels(g, labels, "start", mode);
  7506. } else {
  7507. this.rotateLabels(g, labels, "end", mode);
  7508. }
  7509. }
  7510. },
  7511. /**
  7512. * <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>
  7513. * @param (rave['internal']['Selector']) labels
  7514. */
  7515. hashingNumericScales : function(labels, extent, mode) {
  7516. if (!labels || !extent) {
  7517. return;
  7518. }
  7519. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  7520. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  7521. var tickSpace = mode == 1 ? extent[1] : extent[0];
  7522. this._textTruncationIndicator = "";
  7523. this._layoutLabelSize = 0;
  7524. for (var i = 0; i < labels.size(); ++i) {
  7525. var node = labels[i][0];
  7526. var dim = node.getBBox();
  7527. var width = dim.width;
  7528. var height = dim.height;
  7529. var size = !isHorizontal || mode == 1 ? width : height;
  7530. if (size > this._layoutLabelSize) {
  7531. this._layoutLabelSize = size;
  7532. }
  7533. if (width >= tickSpace) {
  7534. if (this._simplifiedTickFormat) {
  7535. var newText = this._simplifiedTickFormat.call(null, node.rave_getData(), 0, 0);
  7536. if (newText != null) {
  7537. node.rave_setText(newText);
  7538. }
  7539. if (node.getBBox().width >= tickSpace) {
  7540. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  7541. }
  7542. } else {
  7543. node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
  7544. }
  7545. }
  7546. }
  7547. }
  7548. },
  7549. /**
  7550. * @param (int) size The desired size of the string
  7551. * @param (String) ch The character to be repeated in the string
  7552. * @return (String) A string of the specified size containing repetition of the specified character
  7553. */
  7554. stringOfSize : function(size, ch) {
  7555. var returnString = "";
  7556. for (var i = 0; i < size; ++i) {
  7557. returnString += ch;
  7558. }
  7559. return returnString;
  7560. },
  7561. configureStaggerData : function(g, mode) {
  7562. if (mode == 3 || mode == 2) {
  7563. var horizontalDimensions = this.labelExtent(g);
  7564. var cellWidth = horizontalDimensions[0];
  7565. var axisSelector = g.selectAll("g.axis");
  7566. var labels = axisSelector.selectAll("text");
  7567. var domain = this._scale.scale().domain();
  7568. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  7569. this._staggerRotate45Nodes = [];
  7570. this._staggerFirstNode = null;
  7571. this._staggerLastNode = null;
  7572. for (var i = 0; i < labels.size(); ++i) {
  7573. var node = labels[0][i];
  7574. if (this.isValid(node.rave_getData())) {
  7575. var domainIndex = -1;
  7576. if (mode == 3) {
  7577. var domainLabel = !this._tickFormat ? node.rave_getText() : originalDataLabelAccessor.call(node, node.rave_getData(), 0, 0);
  7578. for (var index = 0; index < domain.length; ++index) {
  7579. if (domain[index].toString() == domainLabel) {
  7580. domainIndex = index;
  7581. break;
  7582. }
  7583. }
  7584. }
  7585. this._staggerRotate45Nodes.push(new com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex(node, domainIndex));
  7586. if (domainIndex == 0) {
  7587. this._staggerFirstNode = node;
  7588. }
  7589. if (domainIndex == domain.length - 1) {
  7590. this._staggerLastNode = node;
  7591. }
  7592. }
  7593. }
  7594. this._staggerCellWidth = cellWidth * 2;
  7595. this._staggerAlignFirstAtStart = this._staggerFirstNode ? this._staggerFirstNode.getBBox().width > cellWidth : false;
  7596. this._staggerAlignLastAtEnd = this._staggerLastNode ? this._staggerLastNode.getBBox().width > cellWidth : false;
  7597. }
  7598. },
  7599. getStaggerIndex : function(node) {
  7600. for (var index = 0; index < this._staggerRotate45Nodes.length; ++index) {
  7601. if (this._staggerRotate45Nodes[index].contains(node)) {
  7602. var domainIndex = this._staggerRotate45Nodes[index].getIndex();
  7603. return domainIndex == -1 ? 0 : domainIndex;
  7604. }
  7605. }
  7606. return -1;
  7607. },
  7608. getStaggerCount : function() {
  7609. var domain = this._scale.scale().domain();
  7610. return domain.length;
  7611. },
  7612. /**
  7613. * <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>
  7614. * @param (rave['internal']['Selector']) g
  7615. */
  7616. determineWhichAutoMode : function(g) {
  7617. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  7618. var axisSelector = g.selectAll("g.axis");
  7619. var labels = axisSelector.selectAll("text");
  7620. var dim = this.labelExtent(g);
  7621. var cellWidth = dim[0];
  7622. var cellWidth90 = dim[1];
  7623. var layoutLabelHeight = 0;
  7624. var layoutLabelWidth = 0;
  7625. var horizontalScore = 0;
  7626. var staggerScore = 0;
  7627. var rotate45Score = 0;
  7628. var rotate90Score = 0;
  7629. var validNodes = [];
  7630. for (var i = 0; i < labels.size(); ++i) {
  7631. var node = labels[0][i];
  7632. if (this.isValid(node.rave_getData())) {
  7633. validNodes.push(node);
  7634. }
  7635. }
  7636. var labelCount = validNodes.length;
  7637. if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
  7638. var mode = 0;
  7639. if (isHorizontal) {
  7640. mode = this._layoutMode == 1 ? 1 : 0;
  7641. var tick = axisSelector.append("g").classed("tick", true);
  7642. var tickText = tick.append("text");
  7643. tickText.style(this._labelStyle);
  7644. tickText.text(",0");
  7645. var node = tickText[0][0];
  7646. var zeroWidth = node.getBBox().width;
  7647. tick.remove();
  7648. var widestLabel = 0;
  7649. for (var i = 0; i < labelCount; ++i) {
  7650. node = validNodes[i];
  7651. var nodeRect = node.getBBox();
  7652. if (nodeRect.width > widestLabel) {
  7653. widestLabel = nodeRect.width;
  7654. }
  7655. if (nodeRect.height > this._layoutLabelHeight) {
  7656. this._layoutLabelHeight = nodeRect.height;
  7657. }
  7658. }
  7659. widestLabel += zeroWidth;
  7660. this._layoutSpillOver = mode == 1 ? this._layoutLabelHeight / 2 : widestLabel / 2 + 2;
  7661. } else {
  7662. for (var i = 0; i < labelCount; ++i) {
  7663. var node = validNodes[i];
  7664. var nodeRect = node.getBBox();
  7665. if (nodeRect.height > this._layoutLabelHeight) {
  7666. this._layoutLabelHeight = nodeRect.height;
  7667. }
  7668. }
  7669. this._layoutSpillOver = this._layoutLabelHeight / 2;
  7670. }
  7671. return mode;
  7672. }
  7673. var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
  7674. var staggerStringsWontMatch = this._tickFormat && !originalDataLabelAccessor;
  7675. var calcStagger = ((this._allowStagger && this._layoutMode == -1) || this._layoutMode == 3) && !staggerStringsWontMatch;
  7676. var calcRotate45 = (this._allowRotate45 && this._layoutMode == -1) || this._layoutMode == 2;
  7677. var calcRotate90 = (this._allowRotate90 && this._layoutMode == -1) || this._layoutMode == 1;
  7678. var spaceFor45Label = 0;
  7679. for (var i = 0; i < labelCount; ++i) {
  7680. var node = validNodes[i];
  7681. var nodeRect = node.getBBox();
  7682. layoutLabelHeight = nodeRect.height;
  7683. var labelWidth = nodeRect.width;
  7684. if (labelWidth > layoutLabelWidth) {
  7685. layoutLabelWidth = labelWidth;
  7686. }
  7687. horizontalScore += (labelWidth <= cellWidth ? 1 : cellWidth / labelWidth);
  7688. if (isHorizontal) {
  7689. if (calcStagger) {
  7690. var spaceForLabel = cellWidth * 2;
  7691. if (i == 0 && i == labelCount - 1) {
  7692. spaceForLabel *= 0.5;
  7693. } else if (i == 0 || i == labelCount - 1) {
  7694. spaceForLabel *= 0.75;
  7695. }
  7696. staggerScore += (labelWidth <= spaceForLabel ? 1 : spaceForLabel / labelWidth);
  7697. }
  7698. if (calcRotate45) {
  7699. if (spaceFor45Label == 0) {
  7700. spaceFor45Label = cellWidth90 / 0.7071 - layoutLabelHeight;
  7701. }
  7702. var space = this.calculate45DegreeSpace(node, spaceFor45Label);
  7703. rotate45Score += (labelWidth <= space ? 1 : space / labelWidth);
  7704. }
  7705. if (calcRotate90) {
  7706. rotate90Score += (labelWidth <= cellWidth90 ? 1 : cellWidth90 / labelWidth);
  7707. }
  7708. }
  7709. }
  7710. var mode = 0;
  7711. if (this._layoutMode == -1) {
  7712. if (isHorizontal && this._allowStagger) {
  7713. horizontalScore *= 1.1;
  7714. staggerScore *= 1.1;
  7715. }
  7716. if ((staggerScore > horizontalScore) && (staggerScore >= rotate45Score) && (staggerScore >= rotate90Score)) {
  7717. mode = 3;
  7718. } else if ((rotate45Score > horizontalScore) && (rotate45Score >= rotate90Score)) {
  7719. mode = 2;
  7720. } else if (rotate90Score > horizontalScore) {
  7721. mode = 1;
  7722. }
  7723. } else {
  7724. if ((this._layoutMode == 3 && staggerStringsWontMatch) || !isHorizontal) {
  7725. mode = 0;
  7726. } else {
  7727. mode = this._layoutMode;
  7728. }
  7729. }
  7730. if (isHorizontal) {
  7731. switch (mode) {
  7732. case 3:
  7733. this._layoutLabelSize = layoutLabelHeight * 2;
  7734. break;
  7735. case 2:
  7736. this._layoutLabelSize = (layoutLabelWidth + layoutLabelHeight) * 0.7071;
  7737. break;
  7738. case 1:
  7739. this._layoutLabelSize = layoutLabelWidth;
  7740. break;
  7741. case 0:
  7742. default:
  7743. this._layoutLabelSize = layoutLabelHeight;
  7744. break;
  7745. }
  7746. } else {
  7747. this._layoutLabelSize = layoutLabelWidth;
  7748. }
  7749. this._layoutLabelHeight = layoutLabelHeight;
  7750. return mode;
  7751. },
  7752. calculate45DegreeSpace : function(node, maxWidth) {
  7753. var width = maxWidth;
  7754. var tfm = node.rave_getParentNode().getAttribute("transform");
  7755. if (tfm != null) {
  7756. var tfmString = tfm.toString();
  7757. var indexOfTrans = tfmString.indexOf("translate(");
  7758. if (indexOfTrans != -1) {
  7759. indexOfTrans += 10;
  7760. var indexOfComma = tfmString.indexOf(",", indexOfTrans);
  7761. if (indexOfComma != -1) {
  7762. var xAmount = tfmString.substring(indexOfTrans, indexOfComma);
  7763. var xLabelPos = + (xAmount);
  7764. var width45Degrees = node.getBBox().width;
  7765. var xLabelWidth = width45Degrees * 0.7071;
  7766. var isBottom = this._orient == "bottom";
  7767. if (isBottom) {
  7768. xLabelPos -= node.getBBox().height / 4;
  7769. if (xLabelPos - xLabelWidth < this._bounds.x) {
  7770. xLabelWidth = xLabelPos - this._bounds.x;
  7771. width = xLabelWidth / 0.7071;
  7772. }
  7773. } else {
  7774. if (xLabelPos + xLabelWidth > this._bounds.x + this._bounds.width) {
  7775. xLabelWidth = (this._bounds.x + this._bounds.width) - xLabelPos;
  7776. width = xLabelWidth / 0.7071;
  7777. }
  7778. }
  7779. if (width > maxWidth) {
  7780. width = maxWidth;
  7781. }
  7782. }
  7783. }
  7784. }
  7785. return width;
  7786. },
  7787. /**
  7788. * @param (rave['internal']['Selector']) labels selector with all labels to be rotated
  7789. * @param (rave['internal']['Selector']) g The parent selector of labels
  7790. * @param (String) textAnchor The position of the anchor
  7791. * @param alignmentMode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  7792. */
  7793. rotateLabels : function(g, labels, textAnchor, mode) {
  7794. if (this._rotateLabels) {
  7795. var self = this;
  7796. var positioning = function(data, index, groupIndex) {
  7797. var x = 0;
  7798. var y = 0;
  7799. var rotation_cy = 0;
  7800. var isBottom = self._orient == "bottom";
  7801. if (mode == 3) {
  7802. var cellIndex = self.getStaggerIndex(this);
  7803. if (cellIndex != -1) {
  7804. if (cellIndex % 2 == 1) {
  7805. var staggerDirection = isBottom ? 1 : -1;
  7806. y += (self._layoutLabelHeight * staggerDirection);
  7807. }
  7808. if (cellIndex == 0 && self._staggerAlignFirstAtStart) {
  7809. x -= self._staggerCellWidth / 4;
  7810. } else if (cellIndex == self.getStaggerCount() - 1 && self._staggerAlignLastAtEnd) {
  7811. x += self._staggerCellWidth / 4;
  7812. }
  7813. }
  7814. } else if (mode == 2) {
  7815. if (isBottom) {
  7816. x -= self._layoutLabelHeight;
  7817. } else {
  7818. x += self._layoutLabelHeight / 2;
  7819. }
  7820. } else if (mode == 1) {
  7821. if (isBottom) {
  7822. x -= (this.getBBox().height / 2 + self._layoutLabelHeight / 4);
  7823. rotation_cy = ~~(self._padding / 4 + self._axis.tickSize());
  7824. } else {
  7825. x -= (this.getBBox().height / 2 - self._layoutLabelHeight);
  7826. rotation_cy = ~~-(self._padding / 4 + self._axis.tickSize());
  7827. }
  7828. }
  7829. var rotationDegrees = mode == 1 ? -90 : mode == 2 ? -45 : 0;
  7830. return "translate(" + x + "," + y + ") rotate(" + rotationDegrees + ",0," + rotation_cy + ")";
  7831. };
  7832. labels.attr("transform", positioning).style("text-anchor", textAnchor);
  7833. if (mode == 3) {
  7834. if (this._staggerAlignFirstAtStart) {
  7835. this._staggerFirstNode.rave_setStyle("text-anchor", "start");
  7836. }
  7837. if (this._staggerAlignLastAtEnd) {
  7838. this._staggerLastNode.rave_setStyle("text-anchor", "end");
  7839. }
  7840. }
  7841. }
  7842. },
  7843. /** @expose */
  7844. axis : function() {
  7845. return this._axis;
  7846. },
  7847. /**
  7848. * Draw the axis. The scale is non-null.
  7849. * @param (rave['internal']['Selector']) g Selector group into which the axis is drawn.
  7850. */
  7851. drawAxis : function(g) {
  7852. var axisSelector = g.selectAll("g.axis").data([0]);
  7853. axisSelector.enter().append("g").classed("axis", true).classed(this._orient, true);
  7854. if (!this._axis) {
  7855. this._axis = new rave['internal']['Axis']();
  7856. }
  7857. if (this._hideOverlappingLabels) {
  7858. this._textFlow.valignment("top").dropTextOnFail(false);
  7859. }
  7860. this._axis.ticksHandler(this._tickHandler);
  7861. this._axis.orient(this._orient);
  7862. this._axis.tickFormat(this._tickFormat);
  7863. this._axis.tickPadding(10.0);
  7864. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  7865. var labelHeight = 20.0;
  7866. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  7867. if (isHorizontal) {
  7868. labelHeight /= 0.7071;
  7869. }
  7870. var range = this._scale.scale().rangeExtent();
  7871. var extent = + (range[1]) - + (range[0]);
  7872. this._axis.ticks(extent / labelHeight);
  7873. } else {
  7874. if (this._tickMagnitude == null) {
  7875. this._axis.ticks(10.0);
  7876. } else {
  7877. this._axis.ticks.apply(this._axis, [10.0, this._scale.scale().getTickFormat(), this._tickMagnitude]);
  7878. }
  7879. }
  7880. var s = this._scale.scale();
  7881. if (this._scale.originalDomain()) {
  7882. var sOrdinal = s.copy();
  7883. sOrdinal.domain(this._scale.originalDomain());
  7884. s = sOrdinal;
  7885. var self = this;
  7886. var originalDataLabelAccessor = (self._scale).originalDomainLabelAccessor();
  7887. var tickFormatter;
  7888. if (originalDataLabelAccessor) {
  7889. if (this._tickFormat) {
  7890. tickFormatter = function(data, index, groupIndex) {
  7891. return self._tickFormat.call(this, originalDataLabelAccessor.call(this, data, index, groupIndex), index, groupIndex);
  7892. };
  7893. } else {
  7894. tickFormatter = originalDataLabelAccessor;
  7895. }
  7896. } else {
  7897. tickFormatter = this._tickFormat;
  7898. }
  7899. this._axis.tickFormat(tickFormatter);
  7900. }
  7901. this._axis.scale(s);
  7902. axisSelector.call(this._axis);
  7903. var g2 = rave.transition(axisSelector);
  7904. if (!(g2.isTransition())) {
  7905. axisSelector.selectAll("text").call(this._dropOverlap, this._hideOverlappingLabels);
  7906. }
  7907. axisSelector.selectAll("path.domain").classed("axis-line", true);
  7908. axisSelector.selectAll("g.tick line").classed("axis-tick", true);
  7909. if (this._fontChecker) {
  7910. axisSelector.selectAll("g.tick text").classed("axis-label", true).call(this._fontChecker);
  7911. } else {
  7912. axisSelector.selectAll("g.tick text").classed("axis-label", true);
  7913. }
  7914. axisSelector.call(this._axisLineProperties);
  7915. },
  7916. /**
  7917. * Draw the axis title.
  7918. * @param (rave['internal']['Selector']) g Selector group into which the title is drawn.
  7919. */
  7920. drawTitle : function(g) {
  7921. if (!this._displayAxisTitle || this._axisTitle == null || this._axisTitle.trim().length == 0 || !this._bounds) {
  7922. g.selectAll("text.axis-title." + this._orient).remove();
  7923. return;
  7924. }
  7925. var x = 0;
  7926. var y = 0;
  7927. var dy = "";
  7928. var transform;
  7929. if ("top" == this._orient) {
  7930. x = this._elementRect.x + this._elementRect.width / 2;
  7931. y = -this._bounds.height + this._padding / 4;
  7932. dy = "0.75em";
  7933. } else if ("bottom" == this._orient) {
  7934. x = this._elementRect.x + this._elementRect.width / 2;
  7935. y = this._bounds.height - this._padding / 4;
  7936. dy = "-0.25em";
  7937. } else if ("left" == this._orient) {
  7938. x = -this._elementRect.y - this._elementRect.height / 2;
  7939. y = -this._bounds.width + this._padding / 4;
  7940. dy = "0.75em";
  7941. transform = "rotate(-90)";
  7942. } else {
  7943. x = this._elementRect.y + this._elementRect.height / 2;
  7944. y = -this._bounds.width + this._padding / 4;
  7945. dy = "0.75em";
  7946. transform = "rotate(90)";
  7947. }
  7948. var fillOpacity;
  7949. {
  7950. var tmp = g.append("text").attr("class", "axis-title " + this._orient);
  7951. fillOpacity = tmp.style("fill-opacity");
  7952. tmp.remove();
  7953. } var label = g.selectAll("text.axis-title." + this._orient);
  7954. if (label.size() == 0) {
  7955. 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);
  7956. if (this._fontChecker) {
  7957. g.selectAll("text.axis-title." + this._orient).call(this._fontChecker);
  7958. }
  7959. }
  7960. 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);
  7961. },
  7962. getUnZoomedScale : function(scale) {
  7963. var s = scale.copy();
  7964. if (s.getZoomTransform()) {
  7965. s.getZoomTransform()(1, 0);
  7966. }
  7967. return s;
  7968. },
  7969. isValid : function(data) {
  7970. var s = this.getUnZoomedScale(this._axis.scale());
  7971. var v = + (s.call(null, data, 0, 0));
  7972. var range = this._axis.scale().range();
  7973. if (this._axis.scale().range().indexOf(v)> -1) {
  7974. return true;
  7975. }
  7976. if (range[0] < v && v < range[1]) {
  7977. return true;
  7978. }
  7979. if (range[0] > v && v > range[1]) {
  7980. return true;
  7981. }
  7982. return false;
  7983. },
  7984. /**
  7985. * Apply label wrapping if requested.
  7986. * @param (rave['internal']['Selector']) g
  7987. * @param (int) mode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
  7988. */
  7989. doLabelWrapping : function(g, mode) {
  7990. if (this._displayTickLabels) {
  7991. this._textFlow.valignment("top");
  7992. if (!this._hideOverlappingLabels) {
  7993. this._textFlow.dropTextOnFail(true);
  7994. }
  7995. var d = this.labelExtent(g);
  7996. if (!d || d[0] < 0 || d[1] < 0) {
  7997. return;
  7998. }
  7999. var w = ~~ (d[0]);
  8000. var h = ~~ (d[1]);
  8001. if (mode == 2) {
  8002. w = ~~(d[1] / 0.7071 - this._layoutLabelHeight);
  8003. h = ~~(this._layoutLabelHeight / 0.7071);
  8004. } else if (mode == 1) {
  8005. var tmp = w;
  8006. w = h;
  8007. h = tmp;
  8008. }
  8009. var allowWrap = mode == 1;
  8010. if (this._scale.isOrdinal() || this._scale.isClustered()) {
  8011. var hActual = ~~ (this._layoutLabelHeight * 1.2);
  8012. if (hActual > h) {
  8013. h = hActual;
  8014. }
  8015. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  8016. if (mode == 0 && !isHorizontal) {
  8017. allowWrap = true;
  8018. }
  8019. }
  8020. var self = this;
  8021. var cellWidth = w;
  8022. var cellHeight = h;
  8023. this._textFlow.wrap(allowWrap).truncate(true).textTruncateIndicator(this._textTruncationIndicator != null ? this._textTruncationIndicator : "...").spacing(1.2).extent(function(data, index, groupIndex) {
  8024. var width = cellWidth;
  8025. var height = cellHeight;
  8026. if (mode == 2) {
  8027. var cellIndex = self.getStaggerIndex(this);
  8028. if (cellIndex != -1) {
  8029. width = ~~self.calculate45DegreeSpace(this, cellWidth);
  8030. }
  8031. } else if (mode == 3) {
  8032. var cellIndex = self.getStaggerIndex(this);
  8033. if (cellIndex != -1) {
  8034. if (cellIndex == 0 && cellIndex == self.getStaggerCount() - 1) {
  8035. width = cellWidth;
  8036. } else if (cellIndex == 0 || cellIndex == self.getStaggerCount() - 1) {
  8037. width = cellWidth * 3 / 2;
  8038. } else {
  8039. width = cellWidth * 2;
  8040. }
  8041. height = cellHeight / 2;
  8042. }
  8043. }
  8044. return [width, height];
  8045. });
  8046. g.selectAll("g.tick > text").call(this._textFlow);
  8047. }
  8048. },
  8049. /**
  8050. * <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>
  8051. * @param (rave['internal']['Selector']) g Selector group for axis
  8052. * @return (Array) The extent of the axis label bounds
  8053. */
  8054. /** @expose */
  8055. labelExtent : function(g) {
  8056. var isHorizontal = this._orient == "bottom" || this._orient == "top";
  8057. var w = this._bounds.width;
  8058. var h = this._bounds.height;
  8059. if (this._scale.scale().rangeBand) {
  8060. var rangeBandValue = + (this._scale.scale().rangeBand());
  8061. if (isHorizontal) {
  8062. w = rangeBandValue;
  8063. } else {
  8064. h = rangeBandValue;
  8065. }
  8066. }
  8067. this.calcTitleExtent(g);
  8068. if (isHorizontal) {
  8069. h -= this._axis.tickSize();
  8070. h -= this._padding / 2;
  8071. if (this._layoutTitleSize != 0) {
  8072. h -= this._layoutTitleSize;
  8073. h -= this._padding / 2;
  8074. }
  8075. } else {
  8076. w -= this._axis.tickSize();
  8077. w -= this._padding / 2;
  8078. if (this._layoutTitleSize != 0) {
  8079. w -= this._layoutTitleSize;
  8080. w -= this._padding / 2;
  8081. }
  8082. }
  8083. return [w, h];
  8084. },
  8085. calcTitleExtent : function(g) {
  8086. this._layoutTitleSize = 0;
  8087. var title = g.selectAll("text.axis-title");
  8088. if (title.size() > 0) {
  8089. var textHeight = title[0][0].getBBox().height;
  8090. this._layoutTitleSize = textHeight;
  8091. }
  8092. },
  8093. /**
  8094. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  8095. * @param (String) role The new role
  8096. * @return (com.ibm.rave.bundles.components.AxisComponentImpl) This object
  8097. */
  8098. /** @expose */
  8099. setRole : function(role) {
  8100. this._role = role;
  8101. return this;
  8102. },
  8103. /**
  8104. * Set the ticks interval on the scale based on the magnitude. tickMagnitude represents power of 10. null value gives the default scale ticks.
  8105. * @param (Number) tickMagnitude
  8106. * @return (com.ibm.rave.bundles.component.AxisComponent) this
  8107. */
  8108. /** @expose */
  8109. scaleTickMagnitude : function(tickMagnitude) {
  8110. this._tickMagnitude = tickMagnitude;
  8111. return this;
  8112. },
  8113. /**
  8114. * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The new scale
  8115. */
  8116. /** @expose */
  8117. scale : function(scale) {
  8118. this._scale = scale ? scale : null;
  8119. return this;
  8120. },
  8121. /**
  8122. * Only legal values are accepted, otherwise the orient is unchanged.
  8123. * @param (String) orient The new orient
  8124. */
  8125. orient$0 : function(orient) {
  8126. if ("left" == orient || "bottom" == orient || "right" == orient || "top" == orient) {
  8127. this._orient = orient;
  8128. if (this._role == null) {
  8129. if ("left" == orient) {
  8130. this._role = "ROLE_Y1";
  8131. } else if ("bottom" == orient) {
  8132. this._role = "ROLE_X1";
  8133. } else if ("right" == orient) {
  8134. this._role = "ROLE_Y2";
  8135. } else {
  8136. this._role = "ROLE_X2";
  8137. }
  8138. }
  8139. }
  8140. return this;
  8141. },
  8142. /**
  8143. * Returns the current orientation string return The current orient
  8144. */
  8145. orient$1 : function() {
  8146. return this._orient;
  8147. },
  8148. /**
  8149. * @param (rave['internal']['RectStruct']) bounds The new bounds
  8150. */
  8151. /** @expose */
  8152. bounds : function(bounds) {
  8153. this._bounds = bounds;
  8154. return this;
  8155. },
  8156. /** @expose */
  8157. elementRect : function(elementRect) {
  8158. this._elementRect = elementRect;
  8159. return this;
  8160. },
  8161. tickFormat$0 : function(tickFormat) {
  8162. this._tickFormat = tickFormat;
  8163. return this;
  8164. },
  8165. tickFormat$1 : function() {
  8166. return this._tickFormat;
  8167. },
  8168. simplifiedTickFormat$0 : function(tickFormat) {
  8169. this._simplifiedTickFormat = tickFormat;
  8170. return this;
  8171. },
  8172. simplifiedTickFormat$1 : function() {
  8173. return this._simplifiedTickFormat;
  8174. },
  8175. /** @expose */
  8176. displayAxisTitle : function(displayAxisTitle) {
  8177. this._displayAxisTitle = displayAxisTitle;
  8178. return this;
  8179. },
  8180. /** @expose */
  8181. displayAxisLine : function(displayAxisLine) {
  8182. this._displayAxisLine = displayAxisLine;
  8183. return this;
  8184. },
  8185. /** @expose */
  8186. displayTicks : function(displayTicks) {
  8187. this._displayTicks = displayTicks;
  8188. return this;
  8189. },
  8190. /** @expose */
  8191. displayTickLabels : function(displayTickLabels) {
  8192. this._displayTickLabels = displayTickLabels;
  8193. return this;
  8194. },
  8195. /** @expose */
  8196. allowAutomaticAxisLayoutToChangeOrientation : function(state) {
  8197. this._allowAutoAxisLayoutToChangeOrientaiton = state;
  8198. return this;
  8199. },
  8200. /** @expose */
  8201. isAllowAutomaticAxisLayoutToChangeOrientation : function() {
  8202. return this._allowAutoAxisLayoutToChangeOrientaiton;
  8203. },
  8204. /** @expose */
  8205. showPanZoomTickLabels : function(showPanZoomTickLabels) {
  8206. this._showPanZoomTickLabels = showPanZoomTickLabels;
  8207. return this;
  8208. },
  8209. /** @expose */
  8210. axisTitle : function(axisTitle) {
  8211. this._axisTitle = axisTitle;
  8212. return this;
  8213. },
  8214. /** @expose */
  8215. axisColor : function(axisColor) {
  8216. this._lineColor = axisColor;
  8217. this._tickColor = axisColor;
  8218. return this;
  8219. },
  8220. /** @expose */
  8221. lineColor : function(lineColor) {
  8222. this._lineColor = lineColor;
  8223. return this;
  8224. },
  8225. /** @expose */
  8226. tickColor : function(tickColor) {
  8227. this._tickColor = tickColor;
  8228. return this;
  8229. },
  8230. /** @expose */
  8231. labelColor : function(labelColor) {
  8232. this._labelStyle["fill"] = labelColor;
  8233. return this;
  8234. },
  8235. labelStyle$0 : function(fill, fontSize, fontFamily) {
  8236. this._labelStyle["fill"] = fill;
  8237. this._labelStyle["font-size"] = fontSize;
  8238. this._labelStyle["font-family"] = fontFamily;
  8239. return this;
  8240. },
  8241. /** @expose */
  8242. titleColor : function(titleColor) {
  8243. this._titleStyle["fill"] = titleColor;
  8244. return this;
  8245. },
  8246. titleStyle$0 : function(fill, fontSize, fontFamily) {
  8247. this._titleStyle["fill"] = fill;
  8248. this._titleStyle["font-size"] = fontSize;
  8249. this._titleStyle["font-family"] = fontFamily;
  8250. return this;
  8251. },
  8252. /**
  8253. * @param (int) padding The new padding
  8254. */
  8255. /** @expose */
  8256. padding : function(padding) {
  8257. this._padding = padding;
  8258. return this;
  8259. },
  8260. /**
  8261. * @param mode LayoutMode for axis, one of: null (numeric axis), automatic, horizontal, stagger, rotate45, rotate90
  8262. */
  8263. /** @expose */
  8264. layoutMode : function(layoutMode) {
  8265. this._layoutMode = -1;
  8266. if (layoutMode != null) {
  8267. if (layoutMode == "horizontal") {
  8268. this._layoutMode = 0;
  8269. } else if (layoutMode == "stagger") {
  8270. this._layoutMode = 3;
  8271. } else if (layoutMode == "rotate45") {
  8272. this._layoutMode = 2;
  8273. } else if (layoutMode == "rotate90") {
  8274. this._layoutMode = 1;
  8275. }
  8276. }
  8277. return this;
  8278. },
  8279. /**
  8280. * @param (boolean) allow Enable Stagger to be considered in the automatic layout algorithm
  8281. */
  8282. /** @expose */
  8283. allowStagger : function(allow) {
  8284. this._allowStagger = allow;
  8285. return this;
  8286. },
  8287. /**
  8288. * @param (boolean) allow Enable Rotate 45 to be considered in the automatic layout algorithm
  8289. */
  8290. /** @expose */
  8291. allowRotate45 : function(allow) {
  8292. this._allowRotate45 = allow;
  8293. return this;
  8294. },
  8295. /**
  8296. * @param (boolean) allow Enable Rotate 90 to be considered in the automatic layout algorithm
  8297. */
  8298. /** @expose */
  8299. allowRotate90 : function(allow) {
  8300. this._allowRotate90 = allow;
  8301. return this;
  8302. },
  8303. /**
  8304. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  8305. */
  8306. renderedShapes : function() {
  8307. return this._renderedShapes;
  8308. },
  8309. labelStyle$1 : function(fontStyle) {
  8310. this._labelStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  8311. return this;
  8312. },
  8313. titleStyle$1 : function(fontStyle) {
  8314. this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
  8315. return this;
  8316. },
  8317. /**
  8318. * Determines whether the axis is swapped.
  8319. * @return (boolean) True if axis is swapped
  8320. */
  8321. isAxisSwapped : function() {
  8322. 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")));
  8323. },
  8324. /**
  8325. * <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>
  8326. * @param (String) indicator the string to be placed to indicated truncated text
  8327. * @return (com.ibm.rave.bundles.component.AxisComponent) This component
  8328. */
  8329. /** @expose */
  8330. textTruncateIndicator : function(indicator) {
  8331. this._textTruncationIndicator = indicator;
  8332. return this;
  8333. },
  8334. /**
  8335. * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
  8336. */
  8337. stopLabelDroppingUpdate : function() {
  8338. this._pendingLabelTimer = false;
  8339. },
  8340. /**
  8341. * 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.
  8342. * @param (rave['internal']['Selector']) labels the selection of valid labels for the end of the transition
  8343. * @param (double) duration of the transition. If 0, we don't do anything.
  8344. * @param (double) delay of the transition. Added to the duration to delay the updates.
  8345. */
  8346. updateLabelDropping : function(labels, duration, delay) {
  8347. var self = this;
  8348. var start = delay + duration;
  8349. var labelCollideCallback = function(elapsed) {
  8350. if (!self._pendingLabelTimer) {
  8351. return true;
  8352. }
  8353. labels.call(self._dropOverlap, self._hideOverlappingLabels);
  8354. if (elapsed >= start) {
  8355. self._pendingLabelTimer = false;
  8356. return true;
  8357. }
  8358. return false;
  8359. };
  8360. if (duration > 0) {
  8361. this._pendingLabelTimer = true;
  8362. rave.timer(labelCollideCallback, start);
  8363. }
  8364. },
  8365. doLabelWrappingAfterAnimation : function(g, labels, mode, duration, delay) {
  8366. this._layoutTimerId++;
  8367. var timerId = this._layoutTimerId;
  8368. var self = this;
  8369. var wrapCallback = function(elapsed) {
  8370. if (self._layoutTimerId == timerId) {
  8371. self.doLabelWrapping(g, mode);
  8372. self.handleLabelsRotationAndPosition(g, labels, mode);
  8373. }
  8374. return true;
  8375. };
  8376. rave.timer(wrapCallback, delay + duration);
  8377. },
  8378. /** @expose */
  8379. preLayout : function() {
  8380. this._layoutTitleSize = 0;
  8381. this._layoutLabelSize = 0;
  8382. this._layoutLabelHeight = 0;
  8383. this._layoutAverageDigitWidth = 0;
  8384. this._layoutSpillOver = 0;
  8385. },
  8386. /** @expose */
  8387. getSizableType : function() {
  8388. return this._scale.isOrdinal() || this._scale.isClustered() ? 1 : 0;
  8389. },
  8390. /** @expose */
  8391. getSizableOrientation : function() {
  8392. return this._orient;
  8393. },
  8394. /** @expose */
  8395. getPreferredSize : function() {
  8396. var layoutPaddingSize = 0;
  8397. if (this._axis) {
  8398. layoutPaddingSize = this._axis.tickSize();
  8399. if (this._layoutLabelSize != 0) {
  8400. layoutPaddingSize += this._padding / 2;
  8401. }
  8402. if (this._layoutTitleSize != 0) {
  8403. layoutPaddingSize += this._padding / 2;
  8404. }
  8405. }
  8406. return this._layoutLabelSize + this._layoutAverageDigitWidth + this._layoutTitleSize + layoutPaddingSize + 2;
  8407. },
  8408. /** @expose */
  8409. getSpillOverSize : function() {
  8410. return this._layoutSpillOver;
  8411. },
  8412. /** @expose */
  8413. orient : function(a0) {
  8414. var args = arguments;
  8415. if (args.length == 0) {
  8416. return this.orient$1();
  8417. }
  8418. return this.orient$0(a0);
  8419. },
  8420. /** @expose */
  8421. tickFormat : function(a0) {
  8422. var args = arguments;
  8423. if (args.length == 0) {
  8424. return this.tickFormat$1();
  8425. }
  8426. return this.tickFormat$0(a0);
  8427. },
  8428. /** @expose */
  8429. simplifiedTickFormat : function(a0) {
  8430. var args = arguments;
  8431. if (args.length == 0) {
  8432. return this.simplifiedTickFormat$1();
  8433. }
  8434. return this.simplifiedTickFormat$0(a0);
  8435. },
  8436. /** @expose */
  8437. labelStyle : function(a0, a1, a2) {
  8438. var args = arguments;
  8439. if (args.length == 1) {
  8440. return this.labelStyle$1(a0);
  8441. }
  8442. return this.labelStyle$0(a0, a1, a2);
  8443. },
  8444. /** @expose */
  8445. titleStyle : function(a0, a1, a2) {
  8446. var args = arguments;
  8447. if (args.length == 1) {
  8448. return this.titleStyle$1(a0);
  8449. }
  8450. return this.titleStyle$0(a0, a1, a2);
  8451. }
  8452. });
  8453. /**
  8454. * 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.
  8455. * @param (rave['internal']['RectStruct']) bounds Rectangle of the axis bounds
  8456. * @param (String) orient Orient, "top", "bottom", "left", "right"; if not valid, "bottom" used
  8457. * @return (double[]) Translation [x,y]
  8458. */
  8459. /** @expose */
  8460. com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation = function(bounds, orient) {
  8461. if ("left" == orient) {
  8462. return [bounds.x + bounds.width, 0.0];
  8463. }
  8464. if ("right" == orient) {
  8465. return [bounds.x, 0.0];
  8466. }
  8467. if ("top" == orient) {
  8468. return [0.0, bounds.y + bounds.height];
  8469. }
  8470. return [0.0, bounds.y];
  8471. };
  8472. com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex = rave['internal']['Declare']({
  8473. //_node : null,
  8474. _domainIndex : 0,
  8475. /** @expose */
  8476. constructor : function(node, domainIndex) {
  8477. this._node = node;
  8478. this._domainIndex = domainIndex;
  8479. },
  8480. /** @expose */
  8481. contains : function(node) {
  8482. return node == this._node;
  8483. },
  8484. /** @expose */
  8485. getIndex : function() {
  8486. return this._domainIndex;
  8487. }
  8488. });
  8489. /**
  8490. * Tick Handler for the axis. This will get called as the core axis is transitioned.
  8491. */
  8492. com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler = rave['internal']['Declare'](rave['internal']['AbstractTickHandler'], {
  8493. //_label : null,
  8494. //_tick : null,
  8495. _$functionClassMethod : function() {
  8496. var _$self = function(args) {
  8497. if (args !== null || arguments.length > 1){
  8498. args = Array.prototype.slice.call(arguments, 0);
  8499. }
  8500. {
  8501. _$self.handle(args[0]);
  8502. return null;
  8503. }
  8504. };
  8505. return _$self;
  8506. },
  8507. constructor : function(label, tick) {
  8508. this._label = label;
  8509. this._tick = tick;
  8510. },
  8511. /** @expose */
  8512. handle : function(ticks) {
  8513. ticks.call(this._tick);
  8514. ticks.call(this._label);
  8515. }
  8516. });
  8517. //com_ibm_rave_bundles_components_AxisComponentImpl.VISIBILITY = "visibility";
  8518. //com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN = "hidden";
  8519. /** @expose */
  8520. com_ibm_rave_bundles_components_AxisComponentImpl.LABEL_HIDDEN_FLAG = "__tickLabelHidden__";
  8521. /** @expose */
  8522. com_ibm_rave_bundles_components_AxisComponentImpl.PANZOOM_HIDDEN_FLAG = "__panZoomHidden__";
  8523. /** @expose */
  8524. com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN_COUNT = "__hiddenCount__";
  8525. /** @expose */
  8526. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_SPACE_PER_TICK = 20;
  8527. /** @expose */
  8528. com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_TICK_COUNT = 10;
  8529. /** @expose */
  8530. com_ibm_rave_bundles_components_AxisComponentImpl.TICK_PADDING = 10;
  8531. //com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL_WEIGHT = 1.1;
  8532. com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL = 0;
  8533. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE90 = 1;
  8534. com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE45 = 2;
  8535. com_ibm_rave_bundles_components_AxisComponentImpl.STAGGER = 3;
  8536. /**
  8537. * Constant used for text flow spacing
  8538. */
  8539. com_ibm_rave_bundles_components_AxisComponentImpl.TEXTFLOW_SPACING = 1.2;
  8540. /**
  8541. * Bottom axis orientation string.
  8542. */
  8543. /** @expose */
  8544. com_ibm_rave_bundles_components_AxisComponentImpl.BOTTOM_ORIENTATION = "bottom";
  8545. /**
  8546. * Top axis orientation string.
  8547. */
  8548. /** @expose */
  8549. com_ibm_rave_bundles_components_AxisComponentImpl.TOP_ORIENTATION = "top";
  8550. /**
  8551. * Left axis orientation string.
  8552. */
  8553. /** @expose */
  8554. com_ibm_rave_bundles_components_AxisComponentImpl.LEFT_ORIENTATION = "left";
  8555. /**
  8556. * Right axis orientation string.
  8557. */
  8558. /** @expose */
  8559. com_ibm_rave_bundles_components_AxisComponentImpl.RIGHT_ORIENTATION = "right";
  8560. com_ibm_rave_bundles_components_AxisComponentImpl.AUTOMODE = -1;
  8561. // $source: com/ibm/rave/bundles/components/GridComponentImpl
  8562. /************************************************************************
  8563. ** IBM Confidential
  8564. **
  8565. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  8566. **
  8567. ** (C) Copyright IBM Corp. 2017
  8568. **
  8569. ** The source code for this program is not published or otherwise divested of its trade secrets,
  8570. ** irrespective of what has been deposited with the U.S. Copyright Office.
  8571. ************************************************************************/
  8572. // GENERATED
  8573. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  8574. //@import com/ibm/rave/bundles/components/StyleStructs (runtime) // new
  8575. //@import com/ibm/rave/bundles/component/GridComponent (runtime) // GridComponent
  8576. /**
  8577. * <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>
  8578. */
  8579. var com_ibm_rave_bundles_components_GridComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  8580. /**
  8581. * The axis property
  8582. */
  8583. //_axis : null,
  8584. /**
  8585. * Role, from the AxisComponent API
  8586. */
  8587. //_role : null,
  8588. /**
  8589. * The orientation
  8590. */
  8591. //_orient : null,
  8592. /**
  8593. * The bounds
  8594. */
  8595. //_bounds : null,
  8596. /**
  8597. * Style of gridlines
  8598. */
  8599. //_gridlineStyle : null,
  8600. /**
  8601. * Whether to display gridlines
  8602. */
  8603. _displayGridlines : false,
  8604. /**
  8605. * After calling the component, this is true if shapes were rendered, false if they were cleared.
  8606. */
  8607. _renderedShapes : false,
  8608. /**
  8609. * Construct, with all properties the defaults.
  8610. */
  8611. /** @expose */
  8612. constructor : function() {
  8613. this._axis = null;
  8614. this._role = null;
  8615. this._orient = "bottom";
  8616. this._bounds = null;
  8617. this._displayGridlines = true;
  8618. this._gridlineStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
  8619. this._renderedShapes = false;
  8620. },
  8621. /** @expose */
  8622. type : function() {
  8623. return com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE;
  8624. },
  8625. /** @expose */
  8626. role : function() {
  8627. return this._role;
  8628. },
  8629. /** @expose */
  8630. execute : function(g) {
  8631. this.preExecute();
  8632. if (!this._displayGridlines || !this._axis || !this._bounds) {
  8633. g.selectAll("*").remove();
  8634. this._renderedShapes = false;
  8635. return;
  8636. }
  8637. this._renderedShapes = true;
  8638. var size = ("bottom" == this._orient || "top" == this._orient) ? this._bounds.height : this._bounds.width;
  8639. var ticksHandler = this._axis.ticksHandler();
  8640. var tickSize = this._axis.tickSize();
  8641. var outerTickSize = this._axis.outerTickSize();
  8642. var tickFormat = this._axis.tickFormat();
  8643. var ax = this._axis.tickSize(-size, 0).tickFormat("").ticksHandler(null);
  8644. g.call(ax);
  8645. this._axis.tickSize(tickSize, outerTickSize).tickFormat(tickFormat).ticksHandler(ticksHandler);
  8646. g.selectAll("g.tick line").classed("grid-tick", true);
  8647. g.selectAll(".grid-tick").style("stroke", this._gridlineStyle._stroke).style("stroke-dasharray", (this._gridlineStyle._dashArray));
  8648. g.selectAll("path.domain").remove();
  8649. },
  8650. /**
  8651. * @param (rave['internal']['Axis']) axis The new axis
  8652. */
  8653. /** @expose */
  8654. axis : function(axis) {
  8655. this._axis = axis;
  8656. return this;
  8657. },
  8658. /**
  8659. * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
  8660. * @param (String) role The new role
  8661. * @return (com.ibm.rave.bundles.components.GridComponentImpl) This object
  8662. */
  8663. /** @expose */
  8664. setRole : function(role) {
  8665. this._role = role;
  8666. return this;
  8667. },
  8668. /**
  8669. * Only legal values are accepted, otherwise the orient is unchanged.
  8670. * @param (String) orient The new orient
  8671. */
  8672. orient$0 : function(orient) {
  8673. if ("left" == orient || "right" == orient || "bottom" == orient || "top" == orient) {
  8674. this._orient = orient;
  8675. }
  8676. return this;
  8677. },
  8678. /**
  8679. * @param (rave['internal']['RectStruct']) bounds The new bounds
  8680. */
  8681. /** @expose */
  8682. bounds : function(bounds) {
  8683. this._bounds = bounds;
  8684. return this;
  8685. },
  8686. displayGridlines$0 : function(displayGridlines) {
  8687. this._displayGridlines = displayGridlines;
  8688. return this;
  8689. },
  8690. /** @expose */
  8691. gridlineStyle : function(gridlineColor, dashArray) {
  8692. this.gridlineColor(gridlineColor);
  8693. this.dashArray(dashArray);
  8694. return this;
  8695. },
  8696. gridlineColor$0 : function(gridlineColor) {
  8697. this._gridlineStyle._stroke = (gridlineColor != null && gridlineColor.length > 0) ? gridlineColor : null;
  8698. return this;
  8699. },
  8700. dashArray$0 : function(dashArray) {
  8701. this._gridlineStyle._dashArray = (dashArray != null && dashArray.length > 0) ? dashArray : null;
  8702. return this;
  8703. },
  8704. /**
  8705. * @return (String) The orientation of the gridline.
  8706. */
  8707. orient$1 : function() {
  8708. return this._orient;
  8709. },
  8710. displayGridlines$1 : function() {
  8711. return this._displayGridlines;
  8712. },
  8713. gridlineColor$1 : function() {
  8714. return this._gridlineStyle._stroke;
  8715. },
  8716. dashArray$1 : function() {
  8717. return this._gridlineStyle._dashArray;
  8718. },
  8719. /**
  8720. * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
  8721. */
  8722. renderedShapes : function() {
  8723. return this._renderedShapes;
  8724. },
  8725. /** @expose */
  8726. orient : function(a0) {
  8727. var args = arguments;
  8728. if (args.length == 0) {
  8729. return this.orient$1();
  8730. }
  8731. return this.orient$0(a0);
  8732. },
  8733. /** @expose */
  8734. displayGridlines : function(a0) {
  8735. var args = arguments;
  8736. if (args.length == 0) {
  8737. return this.displayGridlines$1();
  8738. }
  8739. return this.displayGridlines$0(a0);
  8740. },
  8741. /** @expose */
  8742. gridlineColor : function(a0) {
  8743. var args = arguments;
  8744. if (args.length == 0) {
  8745. return this.gridlineColor$1();
  8746. }
  8747. return this.gridlineColor$0(a0);
  8748. },
  8749. /** @expose */
  8750. dashArray : function(a0) {
  8751. var args = arguments;
  8752. if (args.length == 0) {
  8753. return this.dashArray$1();
  8754. }
  8755. return this.dashArray$0(a0);
  8756. }
  8757. });
  8758. // $source: com/ibm/rave/bundles/components/KeyedBundleComponentImpl
  8759. /************************************************************************
  8760. ** IBM Confidential
  8761. **
  8762. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  8763. **
  8764. ** (C) Copyright IBM Corp. 2017
  8765. **
  8766. ** The source code for this program is not published or otherwise divested of its trade secrets,
  8767. ** irrespective of what has been deposited with the U.S. Copyright Office.
  8768. ************************************************************************/
  8769. // GENERATED
  8770. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  8771. /**
  8772. * 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.
  8773. * @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>
  8774. */
  8775. var com_ibm_rave_bundles_components_KeyedBundleComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  8776. //keyFunction : null,
  8777. /**
  8778. * Set the key function this component should use when joining data to scene nodes.
  8779. * @param (rave['internal']['SingleValueFunction']) keyFunction This function will be passed each datum individually and must return a unique value (a key).
  8780. * @return (com.ibm.rave.bundles.components.KeyedBundleComponentImpl) This.
  8781. */
  8782. /** @expose */
  8783. key : function(keyFunction) {
  8784. this.keyFunction = keyFunction;
  8785. return this;
  8786. },
  8787. /**
  8788. * Returns a {@link (rave['internal']['ValueFunction']) ValueFunction} that wraps the provided key function.
  8789. */
  8790. /** @expose */
  8791. getKey : function() {
  8792. if (!this.keyFunction) {
  8793. return null;
  8794. }
  8795. var self = this;
  8796. return function(datum, index, groupIndex) {
  8797. return self.keyFunction(datum);
  8798. };
  8799. }
  8800. });
  8801. // $source: com/ibm/rave/bundles/components/IntervalComponentImpl
  8802. /************************************************************************
  8803. ** IBM Confidential
  8804. **
  8805. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  8806. **
  8807. ** (C) Copyright IBM Corp. 2017
  8808. **
  8809. ** The source code for this program is not published or otherwise divested of its trade secrets,
  8810. ** irrespective of what has been deposited with the U.S. Copyright Office.
  8811. ************************************************************************/
  8812. // GENERATED
  8813. //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
  8814. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  8815. //@import com/ibm/rave/bundles/component/IntervalComponent (runtime) // IntervalComponent
  8816. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  8817. //@import com/ibm/rave/bundles/utilities/LabelStyleUtil (runtime) // new
  8818. /**
  8819. * <p> A component to draw interval charts. The component puts its shapes into the selector passed to its execute method. Intervals are rectangular regions bounded by ranges in the dependent and independent dimensions. </p> <p> The data array passed to the component has one entry per interval to be drawn. Each entry has six properties. Accessors are used to get these properties from the object, and scales to convert them to a graphical property. If a property is not defined (either no accessor or no scale), a default value is used for the property. The six properties are: </p> <ul> <li> <b>dependent1</b>: The first endpoint of the dependent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>dependent2</b>: The second endpoint of the dependent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>independent1</b>: The first endpoint of the independent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>independent2</b>: The second endpoint of the independent coordinate interval. If not defined the interval is not drawn.</li> <li> <b>color</b>: Used for the fill color of the intervals. If not defined the fill is a default value set with a property.</li> <li> <b>label</b>: Label for the interval. If not defined the interval is not labeled. The interval component does not do internationalization, and this string is the value displayed.</li> </ul> <p> Intervals in general do not distinguish between the dependent and independent variables, although in bar charts they do. The names are used here for compatibility with other two-axis plots such as the line and point. </p> <p> The component properties are: </p> <p> <b>data</b>: An array with one entry per point. If null, no points are drawn. </p> <p> <b>independent1Accessor</b>: A value function applied to a data object to get the independent1 value. If null, the interval is not drawn. The default is null. </p> <p> <b>independent2Accessor</b>:A value function applied to a data object to get the independent2 value. If null, the interval is not drawn. The default is null. </p> <p> <b>independentScale</b>: A scale applied to the independent values to get the pixel coordinate for drawing the line. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>dependentAccessor1</b>: A value function applied to a data object to get the dependent1 value. If null, the interval is not drawn. The default is null. </p> <p> <b>dependentAccessor2</b>: A value function applied to a data object to get the dependent2 value. If null, the interval is not drawn. The default is null. </p> <p> <b>dependentScale</b>: A scale applied to the dependent value to get the pixel coordinate for drawing the line. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>colorAccessor</b>: A value function applied to a data object to get the color value. If null, the point is drawn in the primary color. The default is null. </p> <p> <b>colorPalette</b>: A palette applied to the color value to get a color value for drawing the point. If null or if it returns null, the point is drawn in the primary color. </p> <p> <b>labelAccessor</b>: A value function applied to a data object to get the label. If null, the point is not labeled. The default is null. </p> <p> <b>labelFormatter</b>: A value function applied to the data label (as returned by the labelAccessor) to get the formatted text string used in the chart. If null, the data label is coerced to a string and used as the formatted text string. The default is null. The method is not called when the data label is null. </p> <p> <b>valueAccessor</b>: A value function applied to a data object to get the data value that the interval represents. If null, the interval is not drawn. </p> <p> <b>transpose</b>: A boolean. If false the independent data is shown on the X axis and the dependent data on the Y; if true they are swapped. Default false. </p> <p> <b>primaryColor</b>: The color used to fill the interval when the interval has no color value or there is no color scale. If null, the point is drawn but not colored, and the CSS style will be used. </p> <p> <b>itemLabel</b>: A boolean. If true and if the label accessor is defined, the label is shown on each item. Default true. </p> <p> <b>itemLabelPosition</b>: A value function applied to a data object to get the item label position. If null, the label is centered. </p>
  8820. */
  8821. var com_ibm_rave_bundles_components_IntervalComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
  8822. /**
  8823. * Data
  8824. */
  8825. //_data : null,
  8826. /**
  8827. * Accessor for key variable
  8828. */
  8829. //_keyAccessor : null,
  8830. /**
  8831. * Accessor for independent1 variable
  8832. */
  8833. //_independent1Accessor : null,
  8834. /**
  8835. * Accessor for independent2 variable
  8836. */
  8837. //_independent2Accessor : null,
  8838. /**
  8839. * Independent variable scale
  8840. */
  8841. //_independentScale : null,
  8842. /**
  8843. * Accessor for dependent1 variable
  8844. */
  8845. //_dependent1Accessor : null,
  8846. /**
  8847. * Accessor for dependent2 variable
  8848. */
  8849. //_dependent2Accessor : null,
  8850. /**
  8851. * Dependent scale
  8852. */
  8853. //_dependentScale : null,
  8854. /**
  8855. * Color scale
  8856. */
  8857. //_colorPalette : null,
  8858. /**
  8859. * Accessor for label role
  8860. */
  8861. //_labelAccessor : null,
  8862. /**
  8863. * Accessor for data values
  8864. */
  8865. //_valueAccessor : null,
  8866. /**
  8867. * Label formatter, may be null
  8868. */
  8869. //_labelFormatter : null,
  8870. //_dropOverlap : null,
  8871. /**
  8872. * Show label
  8873. */
  8874. //_itemLabelPosition : null,
  8875. /**
  8876. * border width
  8877. */
  8878. //_borderWidth : null,
  8879. //_borderColor : null,
  8880. /**
  8881. * Effect
  8882. */
  8883. //_specialTransition : null,
  8884. //_delay : null,
  8885. //_labelFontStyle : null,
  8886. //_bounds : null,
  8887. //_labelStyleUtil : null,
  8888. /**
  8889. * Transpose
  8890. */
  8891. _transpose : false,
  8892. /**
  8893. * Show label
  8894. */
  8895. _itemLabel : false,
  8896. /**
  8897. * Drop overlapping labels
  8898. */
  8899. _itemOverlap : true,
  8900. _labelLayerClass : ".element-label-group",
  8901. _elementLayerClass : ".element-group",
  8902. _labelContrast : false,
  8903. _labelShadow : false,
  8904. constructor : function() {
  8905. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  8906. this._delay = function(data, index, groupIndex) {
  8907. return 0;
  8908. };
  8909. this._labelFontStyle = {};
  8910. {
  8911. this._labelStyleUtil = new com_ibm_rave_bundles_utilities_LabelStyleUtil();
  8912. }
  8913. },
  8914. /** @expose */
  8915. type : function() {
  8916. return com_ibm_rave_bundles_component_IntervalComponent.COMPONENT_TYPE;
  8917. },
  8918. /** @expose */
  8919. execute : function(g) {
  8920. this.preExecute();
  8921. var elementGroupSelector = g.selectAll(this._elementLayerClass);
  8922. var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
  8923. if (g.classed(this._elementLayerClass) || elementGroupSelector.size() == 0 || elementLabelGroupSelector.size() == 0) {
  8924. elementGroupSelector = g;
  8925. elementLabelGroupSelector = g;
  8926. }
  8927. if (!this._data || !this._independent1Accessor || !this._independent2Accessor || !this._independentScale || !this._dependent1Accessor || !this._dependent2Accessor || !this._dependentScale) {
  8928. elementGroupSelector.selectAll("*").remove();
  8929. elementLabelGroupSelector.selectAll("*").remove();
  8930. return;
  8931. }
  8932. var self = this;
  8933. var labelText = !this._labelFormatter ? function(data, index, groupIndex) {
  8934. if (Math.max(+ (self._dependentScale.upper(self._dependent1Accessor(data))), + (self._dependentScale.upper(self._dependent2Accessor(data)))) - Math.min(+ (self._dependentScale.lower(self._dependent1Accessor(data))), + (self._dependentScale.lower(self._dependent2Accessor(data)))) < 0.001) {
  8935. return null;
  8936. }
  8937. return self._labelAccessor(data);
  8938. } : function(data, index, groupIndex) {
  8939. var v = self._labelAccessor(data);
  8940. return v == null ? null : self._labelFormatter.call(this, v, index, groupIndex);
  8941. };
  8942. var keyFunction = !this._keyAccessor ? null : function(datum, ix, gix) {
  8943. return self._keyAccessor(datum);
  8944. };
  8945. var labelsOn = this._itemLabel && this._labelAccessor;
  8946. if (!labelsOn) {
  8947. g.selectAll("text.element-label").remove();
  8948. }
  8949. var elementSelector = elementGroupSelector.selectAll(".element").data(this._data, this.getKey() ? this.getKey() : keyFunction);
  8950. elementSelector.exit().remove();
  8951. var elementEnter = elementSelector.enter().append("g").attr("class", "element");
  8952. elementEnter.append("rect").attr("class", "element-shape").attr("x", this._specialTransition == null ? this.rectangleCoord$0(true, true, true) : this.rectangleCoord$0(true, false, true)).attr("width", this._specialTransition == null ? this.rectangleSize(true, true, true) : this.rectangleSize(true, false, true)).attr("y", this.rectangleCoord$0(false, true, true)).attr("height", 0).style("fill", this._colorPalette);
  8953. if (labelsOn) {
  8954. var elementLabelSelector = elementLabelGroupSelector.selectAll(".element-label").data(this._data, this.getKey() ? this.getKey() : keyFunction);
  8955. elementLabelSelector.exit().remove();
  8956. elementLabelSelector.enter().append("text").attr("class", "element-label");
  8957. this.addLabels(elementLabelSelector).text(labelText);
  8958. }
  8959. var shapes = elementSelector.select(".element-shape");
  8960. var t = rave.transition(shapes);
  8961. if (t != shapes && this._delay) {
  8962. (t).delay(this._delay);
  8963. }
  8964. t.style("fill", this._colorPalette);
  8965. this.updateBorder(t, this._borderWidth, this._borderColor);
  8966. var fontChecker = rave.capabilities.extension("fontchecker");
  8967. if (this._specialTransition == null) {
  8968. t.attr("x", this.rectangleCoord$0(true, false, false)).attr("width", this.rectangleSize(true, false, false)).attr("y", this.rectangleCoord$0(false, false, false)).attr("height", this.rectangleSize(false, false, false));
  8969. } else if (this.isXYanimation()) {
  8970. t.attr("y", this.rectangleCoord$0(false, false, false)).attr("height", this.rectangleSize(false, false, false)).transition().attr("x", this.rectangleCoord$0(true, false, false)).attr("width", this.rectangleSize(true, false, false));
  8971. } else {
  8972. t.attr("x", this.rectangleCoord$0(true, false, false)).attr("width", this.rectangleSize(true, false, false)).transition().attr("y", this.rectangleCoord$0(false, false, false)).attr("height", this.rectangleSize(false, false, false));
  8973. }
  8974. if (this._renderCallback) {
  8975. t.call(this._renderCallback, "elements");
  8976. }
  8977. if (labelsOn) {
  8978. var labels = g.selectAll(".element-label");
  8979. var t2 = rave.transition(labels);
  8980. if (fontChecker) {
  8981. labels.call(fontChecker);
  8982. }
  8983. if (t2 != labels && this._delay) {
  8984. (t2).delay(this._delay);
  8985. }
  8986. t2.attr("x", this.getXPosition()).attr("dx", this.getXOffset()).attr("y", this.getYPosition()).attr("dy", this.getYOffset()).style("text-anchor", this.getAnchor());
  8987. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  8988. this._labelStyleUtil.labelFont(this._labelFontStyle).labelFillColor(this._labelContrast ? this.getLabelFill() : function(data, index, groupIndex) {
  8989. return labelColor;
  8990. }).labelShadow(this._labelShadow);
  8991. labels.call(this._labelStyleUtil);
  8992. t2.text(labelText);
  8993. this._dropOverlap.configureForDataLabels(this._bounds);
  8994. t2.call(this._dropOverlap, this._itemOverlap);
  8995. }
  8996. },
  8997. /**
  8998. * Add a &lt;text g=element-label"&gt; to each node in the selection s, setting the text properties to the usual defaults.
  8999. * @param (rave['internal']['Selector']) s Selector
  9000. * @return (rave['internal']['Selector']) Selector for the added labels
  9001. */
  9002. addLabels : function(s) {
  9003. return s.selectAll("element-label").attr("x", this.rectangleCenter(true, true, true)).attr("y", this.rectangleCenter(false, true, true)).attr("dy", ".3em").style("text-anchor", "middle");
  9004. },
  9005. getAnchor : function() {
  9006. var self = this;
  9007. return function(data, index, groupIndex) {
  9008. if (!self._transpose || (!self._itemLabelPosition)) {
  9009. return "middle";
  9010. }
  9011. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  9012. if (0 == labelPosition) {
  9013. return "start";
  9014. } else if (1 == labelPosition) {
  9015. return "middle";
  9016. } else {
  9017. return "end";
  9018. }
  9019. };
  9020. },
  9021. getLabelFill : function() {
  9022. var self = this;
  9023. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  9024. return function(data, index, groupIndex) {
  9025. if (!self._itemLabelPosition) {
  9026. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._colorPalette.call(this, data, index, groupIndex), labelColor).toString();
  9027. }
  9028. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  9029. if (1 == labelPosition) {
  9030. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._colorPalette.call(this, data, index, groupIndex), labelColor).toString();
  9031. }
  9032. return labelColor;
  9033. };
  9034. },
  9035. getXOffset : function() {
  9036. var self = this;
  9037. return function(data, index, groupIndex) {
  9038. if (!self._transpose || (!self._itemLabelPosition)) {
  9039. return "0em";
  9040. }
  9041. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  9042. if (0 == labelPosition) {
  9043. return ".3em";
  9044. } else if (1 == labelPosition) {
  9045. return "0em";
  9046. } else {
  9047. return "-.3em";
  9048. }
  9049. };
  9050. },
  9051. getYOffset : function() {
  9052. var self = this;
  9053. return function(data, index, groupIndex) {
  9054. if (self._transpose || (!self._itemLabelPosition)) {
  9055. return ".3em";
  9056. }
  9057. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  9058. if (0 == labelPosition) {
  9059. return "-.3em";
  9060. } else if (1 == labelPosition) {
  9061. return ".3em";
  9062. } else {
  9063. return "1.1em";
  9064. }
  9065. };
  9066. },
  9067. getXPosition : function() {
  9068. var self = this;
  9069. return function(data, index, groupIndex) {
  9070. if (!self._transpose || (!self._itemLabelPosition)) {
  9071. return self.rectangleCenter(true, false, false).call(this, data, index, groupIndex);
  9072. }
  9073. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  9074. if (0 == labelPosition) {
  9075. return self.rectangleCoord$1(true, false, false, true).call(this, data, index, groupIndex);
  9076. } else if (1 == labelPosition) {
  9077. return self.rectangleCenter(true, false, false).call(this, data, index, groupIndex);
  9078. } else {
  9079. return self.rectangleCoord$1(true, false, false, false).call(this, data, index, groupIndex);
  9080. }
  9081. };
  9082. },
  9083. getYPosition : function() {
  9084. var self = this;
  9085. return function(data, index, groupIndex) {
  9086. if (self._transpose || (!self._itemLabelPosition)) {
  9087. return self.rectangleCenter(false, false, false).call(this, data, index, groupIndex);
  9088. }
  9089. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  9090. if (0 == labelPosition) {
  9091. return self.rectangleCoord$1(false, false, false, false).call(this, data, index, groupIndex);
  9092. } else if (1 == labelPosition) {
  9093. return self.rectangleCenter(false, false, false).call(this, data, index, groupIndex);
  9094. } else {
  9095. return self.rectangleCoord$1(false, false, false, true).call(this, data, index, groupIndex);
  9096. }
  9097. };
  9098. },
  9099. /**
  9100. * Return a value function that gives the "x" or "y" coordinate of a rectangle.
  9101. * @param (boolean) xdim Whether "x" (true) or "y" (false) is requested
  9102. * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns the coordinate for value 0.0
  9103. * @param (boolean) enter Whether the coordinate is for an enter transition
  9104. * @return (rave['internal']['ValueFunction']) Value function for that coordinate
  9105. */
  9106. rectangleCoord$0 : function(xdim, fromBase, enter) {
  9107. return this.rectangleCoord$1(xdim, fromBase, enter, false);
  9108. },
  9109. rectangleCoord$1 : function(xdim, fromBase, enter, useMax) {
  9110. var useDependent = xdim == this._transpose;
  9111. var scale = useDependent ? this._dependentScale : this._independentScale;
  9112. if (fromBase && useDependent && this._dependentScale.isLinear()) {
  9113. var value = scale.lower(0.0);
  9114. return function(data, index, groupIndex) {
  9115. return value;
  9116. };
  9117. }
  9118. var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
  9119. var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
  9120. if (enter && this.isCTShandling()) {
  9121. return function(data, index, groupIndex) {
  9122. return scale.center(a1(data));
  9123. };
  9124. }
  9125. return function(data, index, groupIndex) {
  9126. if (useMax) {
  9127. return Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data))));
  9128. } else {
  9129. return Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data))));
  9130. }
  9131. };
  9132. },
  9133. /**
  9134. * Return a value function that gives the "height" or "width" coordinate of a rectangle.
  9135. * @param (boolean) xdim Whether "width" (true) or "height" (false) is requested
  9136. * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns 0.001
  9137. * @param (boolean) enter Whether the size is for an enter transition
  9138. * @return (rave['internal']['ValueFunction']) Value function for that coordinate
  9139. */
  9140. rectangleSize : function(xdim, fromBase, enter) {
  9141. var useDependent = xdim == this._transpose;
  9142. var scale = useDependent ? this._dependentScale : this._independentScale;
  9143. if ((fromBase && useDependent && this._dependentScale.isLinear()) || (enter && this.isCTShandling())) {
  9144. return function(data, index, groupIndex) {
  9145. return 0.001;
  9146. };
  9147. }
  9148. var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
  9149. var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
  9150. return function(data, index, groupIndex) {
  9151. return Math.max(0.001, Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data)))) - Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data)))));
  9152. };
  9153. },
  9154. /**
  9155. * @return (boolean) Whether the XY animation (shift X, then Y) should be used
  9156. */
  9157. isXYanimation : function() {
  9158. return "XY_CTS" == this._specialTransition || "XY_STC" == this._specialTransition;
  9159. },
  9160. /**
  9161. * @return (boolean) Whether the data handling changed from clustered to stacked
  9162. */
  9163. isCTShandling : function() {
  9164. return "XY_CTS" == this._specialTransition || "YX_CTS" == this._specialTransition;
  9165. },
  9166. /**
  9167. * Return a value function that gives the x or y center coordinate of a rectangle.
  9168. * @param (boolean) xdim Whether the x (true) or y (false) is requested
  9169. * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns the scaled 0.0
  9170. * @param (boolean) enter Whether the center is for an enter transition
  9171. * @return (rave['internal']['ValueFunction']) Value function for that coordinate
  9172. */
  9173. rectangleCenter : function(xdim, fromBase, enter) {
  9174. var useDependent = xdim == this._transpose;
  9175. var scale = useDependent ? this._dependentScale : this._independentScale;
  9176. if (fromBase && useDependent && this._dependentScale.isLinear()) {
  9177. var value = scale.lower(0.0);
  9178. return function(data, index, groupIndex) {
  9179. return value;
  9180. };
  9181. }
  9182. var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
  9183. var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
  9184. if (enter && this.isCTShandling()) {
  9185. return function(data, index, groupIndex) {
  9186. return + (scale.center(a1(data)));
  9187. };
  9188. }
  9189. return function(data, index, groupIndex) {
  9190. var val = (Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data)))) + Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data))))) / 2.0;
  9191. if (isNaN(val)) {
  9192. val = 0;
  9193. }
  9194. return val;
  9195. };
  9196. },
  9197. /**
  9198. * @param (java.lang.Object[]) data The new data
  9199. */
  9200. /** @expose */
  9201. data : function(data) {
  9202. this._data = data;
  9203. return this;
  9204. },
  9205. /**
  9206. * @param (rave['internal']['SingleValueFunction']) keyAccessor The new key accessor
  9207. */
  9208. /** @expose */
  9209. keyAccessor : function(keyAccessor) {
  9210. this._keyAccessor = keyAccessor;
  9211. return this;
  9212. },
  9213. /**
  9214. * @param (rave['internal']['SingleValueFunction']) independent1Accessor The new independent1 accessor
  9215. */
  9216. /** @expose */
  9217. independent1Accessor : function(independent1Accessor) {
  9218. this._independent1Accessor = independent1Accessor;
  9219. return this;
  9220. },
  9221. /**
  9222. * @param (rave['internal']['SingleValueFunction']) independent2Accessor The new independent1 accessor
  9223. */
  9224. /** @expose */
  9225. independent2Accessor : function(independent2Accessor) {
  9226. this._independent2Accessor = independent2Accessor;
  9227. return this;
  9228. },
  9229. /**
  9230. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
  9231. */
  9232. /** @expose */
  9233. independentScale : function(independentScale) {
  9234. this._independentScale = independentScale;
  9235. return this;
  9236. },
  9237. /**
  9238. * @param (rave['internal']['SingleValueFunction']) dependent1Accessor The new dependent1 accessor
  9239. */
  9240. /** @expose */
  9241. dependent1Accessor : function(dependent1Accessor) {
  9242. this._dependent1Accessor = dependent1Accessor;
  9243. return this;
  9244. },
  9245. /**
  9246. * @param (rave['internal']['SingleValueFunction']) dependent2Accessor The new dependent2 accessor
  9247. */
  9248. /** @expose */
  9249. dependent2Accessor : function(dependent2Accessor) {
  9250. this._dependent2Accessor = dependent2Accessor;
  9251. return this;
  9252. },
  9253. /**
  9254. * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
  9255. */
  9256. /** @expose */
  9257. dependentScale : function(dependentScale) {
  9258. this._dependentScale = dependentScale;
  9259. return this;
  9260. },
  9261. /**
  9262. * @param (rave['library']['internal']['Palette']) colorPalette The new colorPalette
  9263. */
  9264. /** @expose */
  9265. colorPalette : function(colorPalette) {
  9266. this._colorPalette = colorPalette;
  9267. return this;
  9268. },
  9269. /**
  9270. * @param (rave['internal']['SingleValueFunction']) labelAccessor The new labelAccessor
  9271. */
  9272. /** @expose */
  9273. labelAccessor : function(labelAccessor) {
  9274. this._labelAccessor = labelAccessor;
  9275. return this;
  9276. },
  9277. /**
  9278. * @param (rave['internal']['ValueFunction']) labelFormatter The new labelFormatter
  9279. */
  9280. /** @expose */
  9281. labelFormatter : function(labelFormatter) {
  9282. this._labelFormatter = labelFormatter;
  9283. return this;
  9284. },
  9285. /**
  9286. * @param (boolean) transpose The new transpose
  9287. */
  9288. /** @expose */
  9289. transpose : function(transpose) {
  9290. this._transpose = transpose;
  9291. return this;
  9292. },
  9293. /**
  9294. * @param (boolean) itemLabel The new itemLabel
  9295. */
  9296. /** @expose */
  9297. itemLabel : function(itemLabel) {
  9298. this._itemLabel = itemLabel;
  9299. return this;
  9300. },
  9301. /**
  9302. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  9303. */
  9304. /** @expose */
  9305. itemLabelPosition : function(labelPosition) {
  9306. this._itemLabelPosition = labelPosition;
  9307. return this;
  9308. },
  9309. /**
  9310. * @param itemOverlap drop or show overlap labels
  9311. */
  9312. /** @expose */
  9313. itemOverlap : function(_itemOverlap) {
  9314. this._itemOverlap = _itemOverlap;
  9315. return this;
  9316. },
  9317. /** @expose */
  9318. valueAccessor : function(valueAccessor) {
  9319. this._valueAccessor = valueAccessor;
  9320. return this;
  9321. },
  9322. /**
  9323. * Set the special transition used for clustered-to-stacked. Allowed values are: <ul> <li> "YX_CTS": The data handling changed from clustered to stacked, and the animation is to change the Y values then the X values </li> <li> "XY_CTS": The data handling changed from clustered to stacked, and the animation is to change the X values then the Y values </li> <li> "YX_STC": The data handling changed from stacked to clustered, and the animation is to change the Y values then the X values </li> <li> "XY_STC": The data handling changed from stacked to clustered, and the animation is to change the X values then the Y values </li> <li> null: No special transition </li> </ul>
  9324. * @param (String) specialTransition Transition
  9325. * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) This object
  9326. */
  9327. /** @expose */
  9328. specialTransition : function(specialTransition) {
  9329. this._specialTransition = specialTransition;
  9330. return this;
  9331. },
  9332. /** @expose */
  9333. delay : function(delayFunction) {
  9334. this._delay = delayFunction;
  9335. return this;
  9336. },
  9337. /** @expose */
  9338. borderWidth : function(width) {
  9339. this._borderWidth = width;
  9340. return this;
  9341. },
  9342. /** @expose */
  9343. borderColor : function(color) {
  9344. this._borderColor = color;
  9345. return this;
  9346. },
  9347. /** @expose */
  9348. labelFont : function(labelFontStyle) {
  9349. this._labelFontStyle = labelFontStyle;
  9350. return this;
  9351. },
  9352. /**
  9353. * @param (rave['internal']['RectStruct']) bounds The bounds of the chart area, used for label collision.
  9354. */
  9355. /** @expose */
  9356. bounds : function(bounds) {
  9357. this._bounds = bounds;
  9358. return this;
  9359. },
  9360. /**
  9361. * @param (String) className - the class name for labelslayer. If not set, the default is ".element-label-group" return this
  9362. */
  9363. /** @expose */
  9364. labelLayerClassName : function(className) {
  9365. this._labelLayerClass = className;
  9366. return this;
  9367. },
  9368. /**
  9369. * @param (String) className - the class name for elementslayer. If not set, the default is ".element-group" return this
  9370. */
  9371. /** @expose */
  9372. elementLayerClassName : function(className) {
  9373. this._elementLayerClass = className;
  9374. return this;
  9375. },
  9376. /**
  9377. * @param (boolean) labelContrast {boolean} whether to contrast the label color with background/background element color.
  9378. * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) this
  9379. */
  9380. /** @expose */
  9381. labelContrast : function(labelContrast) {
  9382. this._labelContrast = labelContrast;
  9383. return this;
  9384. },
  9385. /**
  9386. * @param (boolean) labelShadow {boolean} whether to show a label shadow with a contrast label color.
  9387. * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) this
  9388. */
  9389. /** @expose */
  9390. labelShadow : function(labelShadow) {
  9391. this._labelShadow = labelShadow;
  9392. return this;
  9393. },
  9394. rectangleCoord : function(a0, a1, a2, a3) {
  9395. var args = arguments;
  9396. if (args.length == 3) {
  9397. return this.rectangleCoord$0(a0, a1, a2);
  9398. }
  9399. return this.rectangleCoord$1(a0, a1, a2, a3);
  9400. }
  9401. });
  9402. /** @expose */
  9403. com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_TOP = 0;
  9404. /** @expose */
  9405. com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_CENTER = 1;
  9406. /** @expose */
  9407. com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_BOTTOM = 2;
  9408. // $source: com/ibm/rave/bundles/components/FilterComponentImpl
  9409. /************************************************************************
  9410. ** IBM Confidential
  9411. **
  9412. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  9413. **
  9414. ** (C) Copyright IBM Corp. 2017
  9415. **
  9416. ** The source code for this program is not published or otherwise divested of its trade secrets,
  9417. ** irrespective of what has been deposited with the U.S. Copyright Office.
  9418. ************************************************************************/
  9419. // GENERATED
  9420. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  9421. var com_ibm_rave_bundles_components_FilterComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  9422. //_id : null,
  9423. //color : null,
  9424. offset_x : 0,
  9425. offset_y : 0,
  9426. blur_radius : 0,
  9427. /** @expose */
  9428. constructor : function(id) {
  9429. this._id = id;
  9430. },
  9431. /** @expose */
  9432. setDropshadow : function(offset_x, offset_y, radius, rgb) {
  9433. this.offset_x = this.getValue(offset_x);
  9434. this.offset_y = this.getValue(offset_y);
  9435. this.blur_radius = this.getValue(radius);
  9436. this.color = rgb;
  9437. },
  9438. getValue : function(s) {
  9439. if (s == null) {
  9440. return 0;
  9441. }
  9442. return + (s.substring(0, s.length - 2));
  9443. },
  9444. /** @expose */
  9445. execute : function(g) {
  9446. var s = g.selectAll("#" + this._id).data([0]);
  9447. var filter = s.enter().append("filter").attr("id", this._id).attr("height", "500%").attr("width", "500%");
  9448. filter.append("feGaussianBlur").attr("in", "SourceAlpha");
  9449. filter.append("feOffset").attr("result", "offsetBlur");
  9450. filter.append("feFlood");
  9451. filter.append("feComposite").attr("in2", "offsetBlur").attr("operator", "in");
  9452. var merge = filter.append("feMerge");
  9453. merge.append("feMergeNode");
  9454. merge.append("feMergeNode").attr("in", "SourceGraphic");
  9455. s.select("feGaussianBlur").attr("stdDeviation", this.blur_radius);
  9456. s.select("feOffset").attr("dx", this.offset_x).attr("dy", this.offset_y);
  9457. s.select("feFlood").attr("flood-color", !this.color ? "black" : this.color);
  9458. },
  9459. /** @expose */
  9460. type : function() {
  9461. return "FilterComponent";
  9462. },
  9463. /** @expose */
  9464. getId : function() {
  9465. return this._id;
  9466. }
  9467. });
  9468. // $source: com/ibm/rave/bundles/components/LabelCollisionComponentImpl
  9469. /************************************************************************
  9470. ** IBM Confidential
  9471. **
  9472. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  9473. **
  9474. ** (C) Copyright IBM Corp. 2017
  9475. **
  9476. ** The source code for this program is not published or otherwise divested of its trade secrets,
  9477. ** irrespective of what has been deposited with the U.S. Copyright Office.
  9478. ************************************************************************/
  9479. // GENERATED
  9480. //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
  9481. //@import com/ibm/rave/bundles/component/LabelCollisionComponent (runtime) // LabelCollisionComponent
  9482. /**
  9483. * <p> A component to handle label collisions, either by dropping labels or moving them. This requires that: </p> <li> 1) Labels be classed as the labelClass provided. The default is ".element-label" </li> <li> 2) Labels must be positioned by X and Y, not by transform. Although it is possible to read the transform attribute, this would force repetitive string parsing. </li> <li> 3) The label collisions MUST NOT run while any other updates are running. If the do, the label collision code and the update will fight over the position of the labels, with defective results. So, the label collisions must be started after all transitions are complete, and must be stopped before any updates are made to the chart. The label collisions may be stopped by calling labelResolution("none"). </li> <p> The component calls the LabelPositioning utility in capabilities. </p>
  9484. */
  9485. var com_ibm_rave_bundles_components_LabelCollisionComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
  9486. /**
  9487. * Handle label collisions method, move overlapping labels vs drop overlapping
  9488. */
  9489. //_handleLabelCollisions : null,
  9490. //_labelPositioning : null,
  9491. /**
  9492. * Rectangle for the drawing bounds
  9493. */
  9494. //_bounds : null,
  9495. /**
  9496. * Handle label collisions method, move overlapping labels vs drop overlapping
  9497. */
  9498. _labelClass : ".element-label",
  9499. /**
  9500. * Number of sweeps performed by the labelPositioning call
  9501. */
  9502. _numberOfSweeps : 1000,
  9503. /** @expose */
  9504. execute : function(chart) {
  9505. var labels = chart.selectAll(this._labelClass);
  9506. if (this._handleLabelCollisions == "Move Labels") {
  9507. this.resolveLabelCollisions(labels);
  9508. } else if (this._handleLabelCollisions == "Drop Labels") {
  9509. this.dropLabels(labels);
  9510. } else {
  9511. this.resetLabels(labels);
  9512. }
  9513. },
  9514. /** @expose */
  9515. type : function() {
  9516. return com_ibm_rave_bundles_component_LabelCollisionComponent.COMPONENT_TYPE;
  9517. },
  9518. resetLabels : function(labels) {
  9519. var position = rave.capabilities.extension("position");
  9520. position.drop().reset(labels);
  9521. },
  9522. dropLabels : function(labels) {
  9523. var position = rave.capabilities.extension("position");
  9524. var drop = position.drop();
  9525. if (this._bounds) {
  9526. var ex = [[this._bounds.x, this._bounds.y], [this._bounds.x + this._bounds.width, this._bounds.y + this._bounds.height]];
  9527. drop.extent(ex);
  9528. }
  9529. drop.remove(false);
  9530. drop.noClipping();
  9531. drop.dropOverlap(labels);
  9532. },
  9533. /**
  9534. * @param (rave['internal']['Selector']) labels
  9535. */
  9536. resolveLabelCollisions : function(labels) {
  9537. var self = this;
  9538. var labelBoxes = [];
  9539. var anchorPoints = [];
  9540. labels.each(function(data, index, groupIndex) {
  9541. var labelBox = {};
  9542. labelBox["x"] = + (this.getAttribute("x"));
  9543. labelBox["y"] = + (this.getAttribute("y"));
  9544. labelBox["width"] = + (this.getBBox().width);
  9545. labelBox["height"] = + (this.getBBox().height);
  9546. labelBoxes.push(labelBox);
  9547. var anchorPoint = {};
  9548. anchorPoint["x"] = labelBox["x"];
  9549. anchorPoint["y"] = labelBox["y"];
  9550. anchorPoint["r"] = 5;
  9551. anchorPoints.push(anchorPoint);
  9552. });
  9553. labels.data(labelBoxes);
  9554. var position = rave.capabilities.extension("position");
  9555. var repositionLabels = function(args) {
  9556. if (args !== null || arguments.length > 1){
  9557. args = Array.prototype.slice.call(arguments, 0);
  9558. }
  9559. {
  9560. if (self._handleLabelCollisions == "Move Labels") {
  9561. labels.transition().duration(110).attr("x", function(data, index, groupIndex) {
  9562. return (data)["x"];
  9563. }).attr("y", function(data, index, groupIndex) {
  9564. return (data)["y"];
  9565. });
  9566. }
  9567. return this;
  9568. }
  9569. };
  9570. this._labelPositioning = position.place().label(labelBoxes);
  9571. this._labelPositioning.anchor(anchorPoints).width(this._bounds.width).height(this._bounds.height).numberOfSweeps(this._numberOfSweeps).start().on("tick", repositionLabels);
  9572. },
  9573. /**
  9574. * @param (String) className - the class name for labels. If not set, the default is ".element-label" return this
  9575. */
  9576. /** @expose */
  9577. labelClassName : function(className) {
  9578. this._labelClass = className;
  9579. return this;
  9580. },
  9581. /**
  9582. * @param (String) resolve - if true, we resolve label collisions return this
  9583. */
  9584. /** @expose */
  9585. labelResolution : function(resolve) {
  9586. this._handleLabelCollisions = resolve;
  9587. if (this._labelPositioning && this._handleLabelCollisions != null) {
  9588. this._labelPositioning.stop();
  9589. }
  9590. return this;
  9591. },
  9592. /**
  9593. * @param (rave['internal']['RectStruct']) bounds The new bounds
  9594. */
  9595. /** @expose */
  9596. bounds : function(bounds) {
  9597. this._bounds = bounds;
  9598. return this;
  9599. },
  9600. /**
  9601. * @param (int) numberOfSweeps The number of sweeps performed by the labelPositioning code
  9602. */
  9603. /** @expose */
  9604. numberOfSweeps : function(numberOfSweeps) {
  9605. this._numberOfSweeps = numberOfSweeps;
  9606. return this;
  9607. }
  9608. });
  9609. /** @expose */
  9610. com_ibm_rave_bundles_components_LabelCollisionComponentImpl.MOVE_LABELS = "Move Labels";
  9611. /** @expose */
  9612. com_ibm_rave_bundles_components_LabelCollisionComponentImpl.DROP_LABELS = "Drop Labels";
  9613. /** @expose */
  9614. com_ibm_rave_bundles_components_LabelCollisionComponentImpl.NONE = "none";
  9615. // $source: com/ibm/rave/bundles/components/AbstractPathComponent
  9616. /************************************************************************
  9617. ** IBM Confidential
  9618. **
  9619. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  9620. **
  9621. ** (C) Copyright IBM Corp. 2017
  9622. **
  9623. ** The source code for this program is not published or otherwise divested of its trade secrets,
  9624. ** irrespective of what has been deposited with the U.S. Copyright Office.
  9625. ************************************************************************/
  9626. // GENERATED
  9627. //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
  9628. //@import com/ibm/rave/bundles/utilities/PathUtils (runtime) // fadeOutIn
  9629. /**
  9630. * Base class for Line and Area components, both of which create similar path-based elements.
  9631. */
  9632. var com_ibm_rave_bundles_components_AbstractPathComponent = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
  9633. /**
  9634. * Interpolation Mode (Smoothness of the line)
  9635. */
  9636. /** @expose */
  9637. _interpolateMode : null,
  9638. /**
  9639. * Keep track of the previous Interpolation Mode
  9640. */
  9641. /** @expose */
  9642. _previousInterpolateMode : null,
  9643. constructor : function() {
  9644. this._interpolateMode = rave['internal']['SVGLine'].r2_svg_lineLinear.getKey();
  9645. this._previousInterpolateMode = this._interpolateMode;
  9646. },
  9647. /** @expose */
  9648. updatePath : function(updateSelection, pathFunction) {
  9649. if (this._interpolateMode != null && !(this._interpolateMode == this._previousInterpolateMode)) {
  9650. com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn(updateSelection, pathFunction);
  9651. } else {
  9652. updateSelection.attr("d", pathFunction);
  9653. }
  9654. this._previousInterpolateMode = this._interpolateMode;
  9655. }
  9656. });
  9657. // $source: com/ibm/rave/bundles/components/LineComponentImpl
  9658. /************************************************************************
  9659. ** IBM Confidential
  9660. **
  9661. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  9662. **
  9663. ** (C) Copyright IBM Corp. 2017
  9664. **
  9665. ** The source code for this program is not published or otherwise divested of its trade secrets,
  9666. ** irrespective of what has been deposited with the U.S. Copyright Office.
  9667. ************************************************************************/
  9668. // GENERATED
  9669. //@import com/ibm/rave/bundles/components/AbstractPathComponent (loadtime) // superclass
  9670. //@import com/ibm/rave/bundles/component/LineComponent (runtime) // LineComponent
  9671. /**
  9672. * <p> A component to draw line 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> <ul> <li> <b>points</b>: Required, an array (ArrayEx). This array is passed to a line path generator, so each entry is a point in the line. The default line path accessors may be used (each entry is an array of x,y); the line component has optional accessors for these two properties. </li> <li> <b>color</b>: A color value. Optional, a single value which if defined is used with the color scale to color the lines. </li> </ul> <p> The component properties are: </p> <p> <b>data</b>: An array with one entry per line, structured as described above. If null, no lines are drawn. </p> <p> <b>pointsAccessor</b>: A value function applied to an entry in the data array, returning the value of the <b>points</b> role (the array of points). If null, no lines are drawn. The default implementation assumes the entry is an object (OMap) and gets and gets the "points" property of the object. </p> <p> <b>colorAccessor</b>: A value function applied to an entry in the data array, returning the value for the <b>color</b> role. If null, the line is drawn but not colored. The default implementation assumes the entry is an object (OMap) and gets the "color" property of the object. </p> <p> <b>independentAccessor</b>: A value function applied to a point object to get the independent value. If null, no lines are drawn. The default implementation assumes each point is an array and returns the first object (as in the default line generator). </p> <p> <b>independentScale</b>: A scale applied to the independent value of the point to get the pixel coordinate for drawing the line. If null, no lines are drawn. The default is null. </p> <p> <b>dependentAccessor</b>: A value function applied to a point object to get the dependent value. If null, no lines are drawn. The default implementation assumes each point is an array and returns the second object (as in the default line generator). </p> <p> <b>dependentScale</b>: A scale applied to the dependent value of the point to get the pixel coordinate for drawing the line. If null, no lines are drawn. The default is null. </p> <p> <b>colorScale</b>: A scale applied to the value in the <b>color</b> role to get a color value for drawing the line. If null or if it returns null, the line is drawn in the primary color. </p> <p> <b>primaryColor</b>: The color used to draw the line when the line has no color or there is no color scale. If null, the line is drawn but not colored, and the CSS style will be used. </p> <p> <b>transpose</b>: A boolean. If false the categorical data is shown on the X axis and the linear data on the Y; if true they are swapped. Default false. </p> <p> <b>effect</b>: A string. If non-null, requests an entrance effect. The only supported entrance effect is "fromBase", where the line grows up from the dependent axis zero; any other value is treated as null. This property is cleared to null on each render, for convenience in setting up zooming. Default null. </p>
  9673. */
  9674. var com_ibm_rave_bundles_components_LineComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_AbstractPathComponent, {
  9675. /**
  9676. * Data
  9677. */
  9678. //_data : null,
  9679. /**
  9680. * Accessor for points role
  9681. */
  9682. //_pointsAccessor : null,
  9683. /**
  9684. * Accessor for color role
  9685. */
  9686. //_groupAccessor : null,
  9687. /**
  9688. * Accessor for independent variable from a point
  9689. */
  9690. //_independentAccessor : null,
  9691. /**
  9692. * Independent variable scale
  9693. */
  9694. //_independentScale : null,
  9695. /**
  9696. * Accessor for dependent variable from a point
  9697. */
  9698. //_dependentAccessor : null,
  9699. /**
  9700. * Dependent scale
  9701. */
  9702. //_dependentScale : null,
  9703. /**
  9704. * Color scale
  9705. */
  9706. //_colorPalette : null,
  9707. /**
  9708. * Effect, only "fromBase" supported
  9709. */
  9710. //_effect : null,
  9711. /**
  9712. * Accessor for checking to see if Y value is null
  9713. */
  9714. //_definedAccessor : null,
  9715. /**
  9716. * Transpose
  9717. */
  9718. _transpose : false,
  9719. /**
  9720. * Show gaps for missing data
  9721. */
  9722. _showMissingAsGap : false,
  9723. /**
  9724. * Initialize all properties to default values.
  9725. */
  9726. /** @expose */
  9727. constructor : function() {
  9728. this._data = null;
  9729. this._interpolateMode = null;
  9730. this._pointsAccessor = function(data) {
  9731. return (data)["points"];
  9732. };
  9733. this._groupAccessor = null;
  9734. this._independentAccessor = function(data) {
  9735. return (data)[0];
  9736. };
  9737. this._independentScale = null;
  9738. this._dependentAccessor = function(data) {
  9739. return (data)[1];
  9740. };
  9741. var self = this;
  9742. this._definedAccessor = function(data) {
  9743. return (self._dependentAccessor(data) != null) && (self._independentAccessor(data) != null);
  9744. };
  9745. this._dependentScale = null;
  9746. this._colorPalette = null;
  9747. this._transpose = false;
  9748. this._effect = null;
  9749. this._showMissingAsGap = true;
  9750. },
  9751. /** @expose */
  9752. type : function() {
  9753. return com_ibm_rave_bundles_component_LineComponent.COMPONENT_TYPE;
  9754. },
  9755. /** @expose */
  9756. execute : function(g) {
  9757. this.preExecute();
  9758. if (!this._data || !this._pointsAccessor || !this._independentAccessor || !this._independentScale || !this._dependentAccessor || !this._dependentScale) {
  9759. g.selectAll("*").remove();
  9760. return;
  9761. }
  9762. var self = this;
  9763. var independent = function(data, index, groupIndex) {
  9764. return self._independentScale.center(self._independentAccessor(data));
  9765. };
  9766. var dependent = function(data, index, groupIndex) {
  9767. return self._dependentScale.center(self._dependentAccessor(data));
  9768. };
  9769. var definedAccessorY = function(data, index, groupIndex) {
  9770. return (self._definedAccessor(data));
  9771. };
  9772. var line = rave.svg.line().x(this._transpose ? dependent : independent).y(this._transpose ? independent : dependent).showMissingAsGap(this._showMissingAsGap);
  9773. var lineFunction = function(d, index, groupIndex) {
  9774. return line.call(this, self._pointsAccessor(d), index, groupIndex);
  9775. };
  9776. line.defined(definedAccessorY);
  9777. line.interpolate(this._interpolateMode);
  9778. var lines = g.selectAll("path.element-shape").data(this._data, this._groupAccessor ? function(data, index, groupIndex) {
  9779. return self._groupAccessor(data);
  9780. } : null);
  9781. lines.exit().remove();
  9782. var enter = lines.enter();
  9783. if (enter.size() > 0) {
  9784. enter = enter.append("path").attr("class", "element-shape").style("stroke", this._colorPalette);
  9785. if ("fromBase" == this._effect) {
  9786. var dependentZero = function(data, index, groupIndex) {
  9787. return self._dependentScale.center(0.0);
  9788. };
  9789. var zeroLine = rave.svg.line().x(this._transpose ? dependentZero : independent).y(this._transpose ? independent : dependentZero);
  9790. zeroLine.defined(definedAccessorY);
  9791. enter.attr("d", function(d, index, groupIndex) {
  9792. return zeroLine.call(this, self._pointsAccessor(d), index, groupIndex);
  9793. });
  9794. } else {
  9795. enter.attr("d", lineFunction);
  9796. }
  9797. }
  9798. var linesUpdate = rave.transition(lines).style("stroke", this._colorPalette);
  9799. this.updatePath(linesUpdate, lineFunction);
  9800. this._effect = null;
  9801. },
  9802. /**
  9803. * @param (java.lang.Object[]) data The new data
  9804. */
  9805. /** @expose */
  9806. data : function(data) {
  9807. this._data = data;
  9808. return this;
  9809. },
  9810. /**
  9811. * @param (rave['internal']['SingleValueFunction']) pointsAccessor The new pointsAccessor
  9812. */
  9813. /** @expose */
  9814. pointsAccessor : function(pointsAccessor) {
  9815. this._pointsAccessor = pointsAccessor;
  9816. return this;
  9817. },
  9818. /**
  9819. * @param (rave['internal']['SingleValueFunction']) groupAccessor The new groupAccessor
  9820. */
  9821. /** @expose */
  9822. groupAccessor : function(groupAccessor) {
  9823. this._groupAccessor = groupAccessor;
  9824. return this;
  9825. },
  9826. /**
  9827. * @param (rave['internal']['SingleValueFunction']) independentAccessor The new independent accessor
  9828. */
  9829. /** @expose */
  9830. independentAccessor : function(independentAccessor) {
  9831. this._independentAccessor = independentAccessor;
  9832. return this;
  9833. },
  9834. /**
  9835. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
  9836. */
  9837. /** @expose */
  9838. independentScale : function(independentScale) {
  9839. this._independentScale = independentScale;
  9840. return this;
  9841. },
  9842. /**
  9843. * @param (rave['internal']['SingleValueFunction']) dependentAccessor The new dependent accessor
  9844. */
  9845. /** @expose */
  9846. dependentAccessor : function(dependentAccessor) {
  9847. this._dependentAccessor = dependentAccessor;
  9848. return this;
  9849. },
  9850. /**
  9851. * @param (rave['internal']['SingleValueFunction']) definedAccessor The new defined accessor
  9852. */
  9853. /** @expose */
  9854. definedAccessor : function(definedAccessor) {
  9855. this._definedAccessor = definedAccessor;
  9856. return this;
  9857. },
  9858. /**
  9859. * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
  9860. */
  9861. /** @expose */
  9862. dependentScale : function(dependentScale) {
  9863. this._dependentScale = dependentScale;
  9864. return this;
  9865. },
  9866. /**
  9867. * @param (rave['library']['internal']['Palette']) colorPalette The new color palette
  9868. */
  9869. /** @expose */
  9870. colorPalette : function(colorPalette) {
  9871. this._colorPalette = colorPalette ? colorPalette : null;
  9872. return this;
  9873. },
  9874. /**
  9875. * @param (boolean) transpose The new transpose
  9876. */
  9877. /** @expose */
  9878. transpose : function(transpose) {
  9879. this._transpose = transpose;
  9880. return this;
  9881. },
  9882. /**
  9883. * @param (String) effect The new effect
  9884. */
  9885. /** @expose */
  9886. effect : function(effect) {
  9887. this._effect = effect;
  9888. return this;
  9889. },
  9890. /**
  9891. * Configure whether lines generated should show a gap (line break) if a value is missing
  9892. * @param (boolean) state true (default) for a gap, false for a line across missing values
  9893. */
  9894. /** @expose */
  9895. showMissingAsGap : function(state) {
  9896. this._showMissingAsGap = state;
  9897. return this;
  9898. },
  9899. /**
  9900. * @param (String) mode sets the interpolation mode that makes the line of the area chart smooth or jagged.
  9901. */
  9902. /** @expose */
  9903. interpolate : function(mode) {
  9904. this._interpolateMode = mode;
  9905. return this;
  9906. }
  9907. });
  9908. // $source: com/ibm/rave/bundles/components/PointComponentImpl
  9909. /************************************************************************
  9910. ** IBM Confidential
  9911. **
  9912. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  9913. **
  9914. ** (C) Copyright IBM Corp. 2017
  9915. **
  9916. ** The source code for this program is not published or otherwise divested of its trade secrets,
  9917. ** irrespective of what has been deposited with the U.S. Copyright Office.
  9918. ************************************************************************/
  9919. // GENERATED
  9920. //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
  9921. //@import com/ibm/rave/bundles/component/PointComponent (runtime) // PointComponent
  9922. //@import com/ibm/rave/bundles/utilities/PathUtils (runtime) // fadeOutIn
  9923. //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
  9924. //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
  9925. //@import com/ibm/rave/bundles/utilities/LabelStyleUtil (runtime) // new
  9926. /**
  9927. * <p> A component to draw point charts. The component puts its shapes into the selector passed to its execute method. </p> <p> The data array passed to the component has one entry per point to be drawn. Each entry has five properties. Accessors are used to get these properties from the object, and scales to convert them to a graphical property. If a property is not defined (either no accessor or no scale), a default value is used for the property. The five properties are: </p> <ul> <li> <b>dependent</b>: One of the two coordinate variables for the points. If not defined the coordinate is the midpoint of the chart dimension. </li> <li> <b>independent</b>: One of the two coordinate variables for the points. If not defined the coordinate is the midpoint of the chart dimension. </li> <li> <b>color</b>: Used for the fill color of the points. If not defined the fill is a default value set with a property. </li> <li> <b>size</b>: Used to size the points. If not defined the point is sized to a default value set with a property. </li> <li> <b>label</b>: Label for the point. If not defined the point is not labeled. The point component does not do internationalization, and this string is the value displayed. </li> </ul> <p> Scatterplots in general do not distinguish between the dependent and independent variables. The names are used here for compatibility with other two-axis plots such as the line and column. </p> <p> The component properties are: </p> <p> <b>data</b>: An array with one entry per point. If null, no points are drawn. </p> <p> <b>independentAccessor</b>: A value function applied to a data object to get the independent value. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>independentScale</b>: A scale applied to the independent value to get the pixel coordinate for drawing the line. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>dependentAccessor</b>: A value function applied to a data object to get the dependent value. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>dependentScale</b>: A scale applied to the dependent value to get the pixel coordinate for drawing the line. If null, the midpoint of the coordinate range is used. The default is null. </p> <p> <b>colorAccessor</b>: A value function applied to a data object to get the color value. If null, the point is drawn in the primary color. The default is null. </p> <p> <b>colorPalette</b>: A palette applied to the color value to get a color value for drawing the point. If null or if it returns null, the point is drawn in the primary color. </p> <p> <b>sizeAccessor</b>: A value function applied to a data object to get the size value used for the point size. If null, the point is drawn with the default size. The default is null. </p> <p> <b>sizeScale</b>: A scale applied to the size value to get the size for drawing for drawing the line. If null or if it returns null, the point is drawn with the default size. The default is null. </p> <p> <b>labelAccessor</b>: A value function applied to a data object to get the label. If null, the point is not labeled. The default is null. </p> <p> <b>labelFormatter</b>: A value function applied to the data label (as returned by the labelAccessor) to get the formatted text string used in the chart. If null, the data label is coerced to a string and used as the formatted text string. The default is null. The method is not called when the data label is null. </p> <p> <b>bounds</b>: The bounding rectangle of the component, used to find the midpoints of the coordinates when the independent or dependent variables are not defined. If either of those variables is not defined and the bounds is null, no points are drawn. The default is null. </p> <p> <b>transpose</b>: A boolean. If false the independent data is shown on the X axis and the dependent data on the Y; if true they are swapped. Default false. </p> <p> <b>primaryColor</b>: The color used to draw the point when the point has no color value or there is no color scale. If null, the point is drawn but not colored, and the CSS style will be used. </p> <p> <b>symbol</b>: The symbol used to draw the shape, which must be one of the RAVE/D3 symbol generator names or "rectangle". If null, the point is drawn as a circle. </p> <p> <b>defaultSize</b>: The size used to draw the point when the point has no size value or there is no size scale. The default is 100 and the value cannot be set to less than 0. Note that this uses the RAVE/D3 convention, where the size is in square pixels. </p> <p> <b>itemLabel</b>: A boolean. If true and if the label accessor is defined, the label is shown on each item. Default true. </p> <p> <b>itemOverlap</b>: A boolean. If true, overlapping labels are removed. Default is true. </p> <p> <b>effect</b>: A string. Requests an entrance effect; if null or not a supported effect, no entrance effect is used. Default null. The supported effects are: </p> <ul> <li> "grow": Shapes start at size zero and grow to full size. </li> <li> "fromBase": Shapes start at dependent coordinate 0 and move to final position. Only used when the dependent scale is non-ordinal. </li> <li> "grow+fromBase": Combines the grow and fromBase effects. </li> </ul>
  9928. */
  9929. var com_ibm_rave_bundles_components_PointComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
  9930. /**
  9931. * Data
  9932. */
  9933. //_data : null,
  9934. /**
  9935. * Accessor for independent variable
  9936. */
  9937. //_independentAccessor : null,
  9938. /**
  9939. * Independent variable scale
  9940. */
  9941. //_independentScale : null,
  9942. /**
  9943. * Accessor for dependent variable
  9944. */
  9945. //_dependentAccessor : null,
  9946. /**
  9947. * Dependent scale
  9948. */
  9949. //_dependentScale : null,
  9950. /**
  9951. * Color scale
  9952. */
  9953. //_colorPalette : null,
  9954. /**
  9955. * Accessor for size role
  9956. */
  9957. //_sizeAccessor : null,
  9958. /**
  9959. * Size scale
  9960. */
  9961. //_sizeScale : null,
  9962. /**
  9963. * Accessor for label role
  9964. */
  9965. //_labelAccessor : null,
  9966. /**
  9967. * Label formatter, may be null
  9968. */
  9969. //_labelFormatter : null,
  9970. //_labelFontStyle : null,
  9971. /**
  9972. * Bounds
  9973. */
  9974. //_bounds : null,
  9975. /**
  9976. * Symbol
  9977. */
  9978. //_symbol : null,
  9979. /**
  9980. * Previous symbol: allows better transitions between symbols
  9981. */
  9982. //_prevSymbol : null,
  9983. //_dropOverlap : null,
  9984. /**
  9985. * Effect
  9986. */
  9987. //_effect : null,
  9988. //_borderWidth : null,
  9989. //_borderColor : null,
  9990. //_itemLabelPosition : null,
  9991. //_labelStyleUtil : null,
  9992. /**
  9993. * Transpose
  9994. */
  9995. _transpose : false,
  9996. /**
  9997. * Default size
  9998. */
  9999. _defaultSize : 0,
  10000. /**
  10001. * Show label
  10002. */
  10003. _itemLabel : false,
  10004. /**
  10005. * Drop overlapping labels
  10006. */
  10007. _itemOverlap : false,
  10008. _labelLayerClass : ".element-label-group",
  10009. _elementLayerClass : ".element-group",
  10010. _labelContrast : false,
  10011. _labelShadow : false,
  10012. constructor : function() {
  10013. this._labelFontStyle = {};
  10014. {
  10015. this._data = null;
  10016. this._independentAccessor = null;
  10017. this._independentScale = null;
  10018. this._dependentAccessor = null;
  10019. this._dependentScale = null;
  10020. this._colorPalette = null;
  10021. this._sizeAccessor = null;
  10022. this._sizeScale = null;
  10023. this._labelAccessor = null;
  10024. this._labelFormatter = null;
  10025. this._bounds = null;
  10026. this._transpose = false;
  10027. this._defaultSize = 400.0;
  10028. this._symbol = null;
  10029. this._prevSymbol = null;
  10030. this._itemLabel = true;
  10031. this._itemOverlap = true;
  10032. this._effect = null;
  10033. this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
  10034. this._borderWidth = null;
  10035. this._borderColor = null;
  10036. this._labelStyleUtil = new com_ibm_rave_bundles_utilities_LabelStyleUtil();
  10037. if (!(rave.svg.symbolTypes.indexOf("donutPlus")> -1)) {
  10038. rave.svg.symbolCreator("donutPlus", rave['library']['internal']['CommonPropertyConstants'].DONUT_PLUS);
  10039. }
  10040. if (!(rave.svg.symbolTypes.indexOf("donut-thin")> -1)) {
  10041. rave.svg.symbolCreator("donut-thin", rave['library']['internal']['CommonPropertyConstants'].DONUT_THIN);
  10042. }
  10043. }
  10044. },
  10045. /** @expose */
  10046. type : function() {
  10047. return com_ibm_rave_bundles_component_PointComponent.COMPONENT_TYPE;
  10048. },
  10049. /** @expose */
  10050. execute : function(g) {
  10051. this.preExecute();
  10052. var elementGroupSelector = g.selectAll(this._elementLayerClass);
  10053. var labelGroupSelector = g.selectAll(this._labelLayerClass);
  10054. if (g.classed(this._elementLayerClass) || elementGroupSelector.size() == 0 || labelGroupSelector.size() == 0) {
  10055. elementGroupSelector = g;
  10056. labelGroupSelector = g;
  10057. }
  10058. if (!this._data || (!this._bounds && (!this._independentAccessor || !this._independentScale || !this._dependentAccessor || !this._dependentScale))) {
  10059. elementGroupSelector.selectAll("*").remove();
  10060. labelGroupSelector.selectAll("*").remove();
  10061. return;
  10062. }
  10063. elementGroupSelector.selectAll("*").remove();
  10064. labelGroupSelector.selectAll("*").remove();
  10065. var self = this;
  10066. var enterTransform = this.pointTransform(true);
  10067. var finalTransform = this.pointTransform(false);
  10068. var symbols = [];
  10069. if (this._symbol == null) {
  10070. elementGroupSelector.selectAll("*").remove();
  10071. } else if (this._symbol == "donutPlus") {
  10072. var s = new rave['internal']['Symbol']().type("circle");
  10073. symbols.push(s);
  10074. s = new rave['internal']['Symbol']().type("donut-thin");
  10075. symbols.push(s);
  10076. } else {
  10077. var s = new rave['internal']['Symbol']().type(this._symbol);
  10078. symbols.push(s);
  10079. elementGroupSelector.selectAll("." + com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT).remove();
  10080. }
  10081. for (var i = 0; i < symbols.length; ++i) {
  10082. var type = i == 0 ? "element-shape" : com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT;
  10083. var shapes = elementGroupSelector.selectAll("." + type).data(this._data, this.getKey());
  10084. shapes.exit().remove();
  10085. var symbol = symbols[i];
  10086. var fillStyle = this.symbolFill(type);
  10087. shapes.enter().append("path").attr("class", type).attr("transform", enterTransform).attr("d", symbol.size(this.enterSize(this._defaultSize, type))).style("fill", fillStyle).style("stroke", fillStyle).style("stroke-width", "0px");
  10088. var s = rave.transition(shapes).attr("transform", finalTransform).style("fill", fillStyle);
  10089. this.updateBorder(s, this._borderWidth, this._borderColor);
  10090. symbol.size(this.finalSize(this._defaultSize, type));
  10091. if (this._prevSymbol != null && !(this._prevSymbol == this._symbol)) {
  10092. com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn(s, symbol);
  10093. } else {
  10094. s.attr("d", symbol);
  10095. }
  10096. }
  10097. if (this._itemLabel && this._labelAccessor) {
  10098. var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
  10099. if (elementLabelGroupSelector.size() == 0) {
  10100. elementLabelGroupSelector = g;
  10101. }
  10102. var labels = elementLabelGroupSelector.selectAll("element-label").data(this._data, this.getKey());
  10103. labels.exit().remove();
  10104. var labelText = !this._labelFormatter ? function(data, index, groupIndex) {
  10105. return self._labelAccessor(data);
  10106. } : function(data, index, groupIndex) {
  10107. var v = self._labelAccessor(data);
  10108. return v == null ? null : self._labelFormatter.call(this, v, index, groupIndex);
  10109. };
  10110. var fontChecker = rave.capabilities.extension("fontchecker");
  10111. labels.enter().append("text").attr("class", "element-label").attr("x", this.positionX(true)).attr("y", this.positionY(true)).attr("dx", this.getXOffset()).attr("dy", this.getYOffset()).style("text-anchor", this.getAnchor()).text(labelText);
  10112. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  10113. this._labelStyleUtil.labelFont(this._labelFontStyle).labelFillColor(this._labelContrast ? this.getLabelFill() : function(data, index, groupIndex) {
  10114. return labelColor;
  10115. }).labelShadow(this._labelShadow);
  10116. labels.call(this._labelStyleUtil);
  10117. if (fontChecker) {
  10118. labels.call(fontChecker);
  10119. }
  10120. var labelTransition = rave.transition(labels).attr("x", this.positionX(false)).attr("y", this.positionY(false)).attr("dx", this.getXOffset()).attr("dy", this.getYOffset()).style("text-anchor", this.getAnchor()).text(labelText);
  10121. this._dropOverlap.configureForDataLabels(this._bounds);
  10122. labelTransition.call(this._dropOverlap, this._itemOverlap);
  10123. } else {
  10124. var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
  10125. if (elementLabelGroupSelector.size() == 0) {
  10126. elementLabelGroupSelector = g;
  10127. }
  10128. elementLabelGroupSelector.selectAll("text.element-label").remove();
  10129. }
  10130. },
  10131. symbolFill : function(type) {
  10132. var self = this;
  10133. return function(d, index, groupIndex) {
  10134. if (self._symbol == "donutPlus" && type == com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT) {
  10135. return "white";
  10136. }
  10137. return !self._colorPalette ? null : self._colorPalette.call(null, d, 0, 0);
  10138. };
  10139. },
  10140. /**
  10141. * Get the enter transform of a shape, for the argument to attr("transform",v). If the effect requires from-base movement, this is a translate where the independent coordinate starts at the scale zero. Otherwise it is the same as finalTransform(). This should only be called if either bounds is non-null, or the dependent and independent accessors and scales are all non-null. The result depends on the transpose, on which accessors and scales are defined, on the bounds, and on the effect.
  10142. * @return (rave['internal']['ValueFunction']) Transform value function
  10143. */
  10144. pointTransform : function(enter) {
  10145. var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
  10146. var dependent = useDependentZero ? this.dependentZero() : this.dependent();
  10147. var independent = this.independent();
  10148. if (this._transpose) {
  10149. return function(data, index, groupIndex) {
  10150. return "translate(" + dependent.call(this, data, index, groupIndex) + "," + independent.call(this, data, index, groupIndex) + ")";
  10151. };
  10152. }
  10153. return function(data, index, groupIndex) {
  10154. return "translate(" + independent.call(this, data, index, groupIndex) + "," + dependent.call(this, data, index, groupIndex) + ")";
  10155. };
  10156. },
  10157. /**
  10158. * Get the enter x of a label, for the argument to attr("x",v). If the effect requires from-base movement, this is a translate where the independent coordinate starts at the scale zero. Otherwise it is the same as finalTransform(). This should only be called if either bounds is non-null, or the dependent and independent accessors and scales are all non-null. The result depends on the transpose, on which accessors and scales are defined, on the bounds, and on the effect.
  10159. * @return (rave['internal']['ValueFunction']) X value function
  10160. */
  10161. positionX : function(enter) {
  10162. var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
  10163. var dependent = useDependentZero ? this.dependentZero() : this.dependent();
  10164. var independent = this.independent();
  10165. if (this._transpose) {
  10166. return function(data, index, groupIndex) {
  10167. return dependent.call(this, data, index, groupIndex);
  10168. };
  10169. }
  10170. return function(data, index, groupIndex) {
  10171. return independent.call(this, data, index, groupIndex);
  10172. };
  10173. },
  10174. /**
  10175. * Get the enter y of a label, for the argument to attr("y",v). If the effect requires from-base movement, this is a translate where the independent coordinate starts at the scale zero. Otherwise it is the same as finalTransform(). This should only be called if either bounds is non-null, or the dependent and independent accessors and scales are all non-null. The result depends on the transpose, on which accessors and scales are defined, on the bounds, and on the effect.
  10176. * @return (rave['internal']['ValueFunction']) Y value function
  10177. */
  10178. positionY : function(enter) {
  10179. var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
  10180. var dependent = useDependentZero ? this.dependentZero() : this.dependent();
  10181. var independent = this.independent();
  10182. if (this._transpose) {
  10183. return function(data, index, groupIndex) {
  10184. return independent.call(this, data, index, groupIndex);
  10185. };
  10186. }
  10187. return function(data, index, groupIndex) {
  10188. return dependent.call(this, data, index, groupIndex);
  10189. };
  10190. },
  10191. /**
  10192. * Get a value function that returns the scaled independent coordinate. It should be called only if bounds is defined, or if the independent accessor and scale are both defined.
  10193. * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
  10194. */
  10195. independent : function() {
  10196. if (this._independentAccessor && this._independentScale) {
  10197. var self = this;
  10198. return function(data, index, groupIndex) {
  10199. return self._independentScale.center(self._independentAccessor(data));
  10200. };
  10201. }
  10202. var midpoint = this._transpose ? this._bounds.y + this._bounds.height / 2.0 : this._bounds.x + this._bounds.width / 2.0;
  10203. return function(data, index, groupIndex) {
  10204. return midpoint;
  10205. };
  10206. },
  10207. /**
  10208. * Get a value function that returns the scaled independent coordinate. It should be called only if bounds is defined, or if the dependent accessor and scale are both defined.
  10209. * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
  10210. */
  10211. dependent : function() {
  10212. if (this._dependentAccessor && this._dependentScale) {
  10213. var self = this;
  10214. return function(data, index, groupIndex) {
  10215. return self._dependentScale.center(self._dependentAccessor(data));
  10216. };
  10217. }
  10218. var midpoint = this._transpose ? this._bounds.x + this._bounds.width / 2.0 : this._bounds.y + this._bounds.height / 2.0;
  10219. return function(data, index, groupIndex) {
  10220. return midpoint;
  10221. };
  10222. },
  10223. /**
  10224. * Get a value function that returns the scaled independent zero. If the independent scale is ordinal, this returns the same thing as dependent(); otherwise it returns the scaled zero of the dependent scale.
  10225. * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
  10226. */
  10227. dependentZero : function() {
  10228. if (!this._dependentScale || !(this._dependentScale.isLinear())) {
  10229. return this.dependent();
  10230. }
  10231. var self = this;
  10232. return function(data, index, groupIndex) {
  10233. return self._dependentScale.center(0.0);
  10234. };
  10235. },
  10236. /**
  10237. * Get the initial size of a shape, for the argument to BundleSymbol#size(). If the effect requires shape-grow, this is 0.0. Otherwise it is the final size.
  10238. * @return (rave['internal']['ValueFunction']) Size value function
  10239. */
  10240. enterSize : function(size, type) {
  10241. if ("grow" == this._effect || "growfromBase" == this._effect) {
  10242. return function(data, index, groupIndex) {
  10243. return 0.0;
  10244. };
  10245. }
  10246. return this.finalSize(size, type);
  10247. },
  10248. /**
  10249. * Get the final size of a shape, for the argument to BundleSymbol#size(). If the size accessor and size scale are both defined, the size comes from the scale applied to the accessor value (using the default size for a null accessor value); otherwise it is the default size.
  10250. * @return (rave['internal']['ValueFunction']) Size value function
  10251. */
  10252. finalSize : function(size, type) {
  10253. var self = this;
  10254. var ratio = self._symbol == "donutPlus" && type == com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT ? 0.6 : 1;
  10255. if (this._sizeAccessor && this._sizeScale) {
  10256. return function(d, index, groupIndex) {
  10257. var v = self._sizeAccessor(d);
  10258. return v != null ? + (self._sizeScale.call(null, v, 0, 0)) * ratio : size * ratio;
  10259. };
  10260. }
  10261. return function(d, index, groupIndex) {
  10262. return size * ratio;
  10263. };
  10264. },
  10265. getAnchor : function() {
  10266. var self = this;
  10267. return function(data, index, groupIndex) {
  10268. if (!self._itemLabelPosition) {
  10269. return "middle";
  10270. }
  10271. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  10272. if (0 == labelPosition || 2 == labelPosition || 1 == labelPosition) {
  10273. return "middle";
  10274. } else if (3 == labelPosition) {
  10275. return "end";
  10276. } else if (4 == labelPosition || 5 == labelPosition) {
  10277. return "start";
  10278. }
  10279. return "middle";
  10280. };
  10281. },
  10282. getLabelFill : function() {
  10283. var self = this;
  10284. var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
  10285. return function(data, index, groupIndex) {
  10286. if (!self._colorPalette || !self._itemLabelPosition) {
  10287. return labelColor;
  10288. }
  10289. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  10290. if (1 == labelPosition) {
  10291. var elementColor = self._colorPalette.call(this, data, index, groupIndex);
  10292. if (elementColor != null) {
  10293. return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(elementColor, labelColor).toString();
  10294. }
  10295. }
  10296. return labelColor;
  10297. };
  10298. },
  10299. getXOffset : function() {
  10300. var self = this;
  10301. return function(data, index, groupIndex) {
  10302. var padding = 5;
  10303. if ((!self._itemLabelPosition)) {
  10304. return "0em";
  10305. }
  10306. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  10307. if (3 == labelPosition) {
  10308. return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
  10309. }
  10310. if (4 == labelPosition) {
  10311. return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
  10312. }
  10313. if (5 == labelPosition) {
  10314. return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2) + "px";
  10315. }
  10316. return "0em";
  10317. };
  10318. },
  10319. getYOffset : function() {
  10320. var self = this;
  10321. return function(data, index, groupIndex) {
  10322. var padding = 5;
  10323. if ((!self._itemLabelPosition)) {
  10324. return "0.3em";
  10325. }
  10326. var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
  10327. if (0 == labelPosition) {
  10328. return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
  10329. }
  10330. if (2 == labelPosition) {
  10331. var fontHeight = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber("1em", 100.0, 10.0);
  10332. return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + fontHeight + padding) + "px";
  10333. }
  10334. if (5 == labelPosition) {
  10335. return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2) + "px";
  10336. }
  10337. return "0.3em";
  10338. };
  10339. },
  10340. /**
  10341. * @param (java.lang.Object[]) data The new data
  10342. */
  10343. /** @expose */
  10344. data : function(data) {
  10345. this._data = data;
  10346. return this;
  10347. },
  10348. /**
  10349. * @param (rave['internal']['SingleValueFunction']) independentAccessor The new independent accessor
  10350. */
  10351. /** @expose */
  10352. independentAccessor : function(independentAccessor) {
  10353. this._independentAccessor = independentAccessor;
  10354. return this;
  10355. },
  10356. /**
  10357. * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
  10358. */
  10359. /** @expose */
  10360. independentScale : function(independentScale) {
  10361. this._independentScale = independentScale;
  10362. return this;
  10363. },
  10364. /**
  10365. * @param (rave['internal']['SingleValueFunction']) dependentAccessor The new dependent accessor
  10366. */
  10367. /** @expose */
  10368. dependentAccessor : function(dependentAccessor) {
  10369. this._dependentAccessor = dependentAccessor;
  10370. return this;
  10371. },
  10372. /**
  10373. * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
  10374. */
  10375. /** @expose */
  10376. dependentScale : function(dependentScale) {
  10377. this._dependentScale = dependentScale;
  10378. return this;
  10379. },
  10380. /**
  10381. * @param (rave['library']['internal']['Palette']) colorPalette The new colorPalette
  10382. */
  10383. /** @expose */
  10384. colorPalette : function(colorPalette) {
  10385. this._colorPalette = colorPalette;
  10386. return this;
  10387. },
  10388. /**
  10389. * @param (rave['internal']['SingleValueFunction']) sizeAccessor The new sizeAccessor
  10390. */
  10391. /** @expose */
  10392. sizeAccessor : function(sizeAccessor) {
  10393. this._sizeAccessor = sizeAccessor;
  10394. return this;
  10395. },
  10396. /**
  10397. * @param (rave['internal']['AbstractScale']) sizeScale The new sizeScale
  10398. */
  10399. /** @expose */
  10400. sizeScale : function(sizeScale) {
  10401. this._sizeScale = sizeScale;
  10402. return this;
  10403. },
  10404. /**
  10405. * @param (rave['internal']['SingleValueFunction']) labelAccessor The new labelAccessor
  10406. */
  10407. /** @expose */
  10408. labelAccessor : function(labelAccessor) {
  10409. this._labelAccessor = labelAccessor;
  10410. return this;
  10411. },
  10412. /**
  10413. * @param (rave['internal']['ValueFunction']) labelFormatter The new labelFormatter
  10414. */
  10415. /** @expose */
  10416. labelFormatter : function(labelFormatter) {
  10417. this._labelFormatter = labelFormatter;
  10418. return this;
  10419. },
  10420. /**
  10421. * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
  10422. */
  10423. /** @expose */
  10424. itemLabelPosition : function(labelPosition) {
  10425. this._itemLabelPosition = labelPosition;
  10426. return this;
  10427. },
  10428. /**
  10429. * @param (rave['internal']['RectStruct']) bounds The new bounds
  10430. */
  10431. /** @expose */
  10432. bounds : function(bounds) {
  10433. this._bounds = bounds;
  10434. return this;
  10435. },
  10436. /**
  10437. * @param (boolean) transpose The new transpose
  10438. */
  10439. /** @expose */
  10440. transpose : function(transpose) {
  10441. this._transpose = transpose;
  10442. return this;
  10443. },
  10444. /**
  10445. * @param (double) defaultSize The new defaultSize
  10446. */
  10447. /** @expose */
  10448. defaultSize : function(defaultSize) {
  10449. this._defaultSize = defaultSize;
  10450. return this;
  10451. },
  10452. /** @expose */
  10453. itemLabel : function(itemLabel) {
  10454. this._itemLabel = itemLabel;
  10455. return this;
  10456. },
  10457. /** @expose */
  10458. labelFont : function(labelFont) {
  10459. this._labelFontStyle = labelFont;
  10460. return this;
  10461. },
  10462. /**
  10463. * @param (boolean) itemOverlap The new itemOverlap
  10464. */
  10465. /** @expose */
  10466. itemOverlap : function(itemOverlap) {
  10467. this._itemOverlap = itemOverlap;
  10468. return this;
  10469. },
  10470. /**
  10471. * @param (String) symbol The new symbol
  10472. */
  10473. /** @expose */
  10474. symbol : function(symbol) {
  10475. this._prevSymbol = this._symbol;
  10476. this._symbol = symbol;
  10477. return this;
  10478. },
  10479. /**
  10480. * @param (String) effect The new effect
  10481. */
  10482. /** @expose */
  10483. effect : function(effect) {
  10484. this._effect = effect;
  10485. return this;
  10486. },
  10487. /** @expose */
  10488. borderWidth : function(borderWidth) {
  10489. this._borderWidth = borderWidth;
  10490. return this;
  10491. },
  10492. /** @expose */
  10493. borderColor : function(borderColor) {
  10494. this._borderColor = borderColor;
  10495. return this;
  10496. },
  10497. /**
  10498. * @param (String) className - the class name for labelslayer. If not set, the default is ".element-label-group" return this
  10499. */
  10500. /** @expose */
  10501. labelLayerClassName : function(className) {
  10502. this._labelLayerClass = className;
  10503. return this;
  10504. },
  10505. /**
  10506. * @param (String) className - the class name for elementslayer. If not set, the default is ".element-group" return this
  10507. */
  10508. /** @expose */
  10509. elementLayerClassName : function(className) {
  10510. this._elementLayerClass = className;
  10511. return this;
  10512. },
  10513. /**
  10514. * @param (boolean) labelContrast {boolean} whether to contrast the label color with background/background element color.
  10515. * @return (com.ibm.rave.bundles.components.PointComponentImpl) this
  10516. */
  10517. /** @expose */
  10518. labelContrast : function(labelContrast) {
  10519. this._labelContrast = labelContrast;
  10520. return this;
  10521. },
  10522. /**
  10523. * @param (boolean) labelShadow {boolean} whether to show a label shadow with a contrast label color.
  10524. * @return (com.ibm.rave.bundles.components.PointComponentImpl) this
  10525. */
  10526. /** @expose */
  10527. labelShadow : function(labelShadow) {
  10528. this._labelShadow = labelShadow;
  10529. return this;
  10530. }
  10531. });
  10532. /** @expose */
  10533. com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT = "element-shape-secondary";
  10534. /** @expose */
  10535. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_TOP = 0;
  10536. /** @expose */
  10537. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_CENTER = 1;
  10538. /** @expose */
  10539. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_BOTTOM = 2;
  10540. /** @expose */
  10541. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_LEFT = 3;
  10542. /** @expose */
  10543. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_RIGHT = 4;
  10544. /** @expose */
  10545. com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_TOP_RIGHT = 5;
  10546. })();
  10547. },{"./configuration/configuration.json":1,"./i18n/messages_en.json":2,"./vizlibrary-composite.css":4,"./vizlibrary.css":5}],4:[function(require,module,exports){
  10548. var css = ".vizlibrary-composite g.element-column .element-shape {\n fill: #ccc;\n fill-opacity: 1.0;\n stroke-width: 0.0px;\n shape-rendering: crispEdges;\n}\n.vizlibrary-composite g.element-line path.element-shape {\n fill: none;\n stroke: black;\n stroke-width: 2;\n stroke-opacity: 1;\n}\n.vizlibrary-composite g.element-column .element-shape.dim {\n fill-opacity: 0.3;\n stroke-width: 0.0px;\n}\n.vizlibrary-composite g.element-line path.element-shape.dim {\n stroke-width: 2;\n stroke-opacity: 0.3;\n}\n.vizlibrary-composite .element-label {\n pointer-events: none;\n}\n.vizlibrary-composite .element-shape-secondary {\n pointer-events: none;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-composite/node/rave-library-composite/vizlibrary-composite.css"})); module.exports = css;
  10549. },{"browserify-css":6}],5:[function(require,module,exports){
  10550. 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-composite/node/rave-library-composite/vizlibrary.css"})); module.exports = css;
  10551. },{"browserify-css":6}],6:[function(require,module,exports){
  10552. 'use strict';
  10553. // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
  10554. module.exports = {
  10555. // Create a <link> tag with optional data attributes
  10556. createLink: function(href, attributes) {
  10557. var head = document.head || document.getElementsByTagName('head')[0];
  10558. var link = document.createElement('link');
  10559. link.href = href;
  10560. link.rel = 'stylesheet';
  10561. for (var key in attributes) {
  10562. if ( ! attributes.hasOwnProperty(key)) {
  10563. continue;
  10564. }
  10565. var value = attributes[key];
  10566. link.setAttribute('data-' + key, value);
  10567. }
  10568. head.appendChild(link);
  10569. },
  10570. // Create a <style> tag with optional data attributes
  10571. createStyle: function(cssText, attributes) {
  10572. var head = document.head || document.getElementsByTagName('head')[0],
  10573. style = document.createElement('style');
  10574. style.type = 'text/css';
  10575. for (var key in attributes) {
  10576. if ( ! attributes.hasOwnProperty(key)) {
  10577. continue;
  10578. }
  10579. var value = attributes[key];
  10580. style.setAttribute('data-' + key, value);
  10581. }
  10582. if (style.sheet) { // for jsdom and IE9+
  10583. style.innerHTML = cssText;
  10584. style.sheet.cssText = cssText;
  10585. head.appendChild(style);
  10586. } else if (style.styleSheet) { // for IE8 and below
  10587. head.appendChild(style);
  10588. style.styleSheet.cssText = cssText;
  10589. } else { // for Chrome, Firefox, and Safari
  10590. style.appendChild(document.createTextNode(cssText));
  10591. head.appendChild(style);
  10592. }
  10593. }
  10594. };
  10595. },{}]},{},[3]);
  10596. return rave.library.bundle.extension('compositeBundle');
  10597. }));