123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631 |
- ;(function(root, factory) {
- if (typeof define === 'function' && define.amd) {
- define(['rave', 'rave-library', 'rave-utilities', 'rave-layouts', 'rave-legends'], factory);
- } else if (typeof exports === 'object') {
- module.exports = factory(require('rave'), require('rave-library'), require('rave-utilities'), require('rave-layouts'), require('rave-legends'));
- } else {
- root.raveLibraryComposite = factory(root.rave, root.raveLibrary, root.raveUtilities, root.raveLayouts, root.raveLegends);
- }
- }(this, function(rave, raveLibrary, raveUtilities, raveLayouts, raveLegends) {
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
- module.exports=[{"previews":{"image":[{"file":"resources\/preview_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"}}]
- },{}],2:[function(require,module,exports){
- module.exports={
- "actions.applyHighlight.description": "Highlights a node.",
- "actions.applyHighlight.label": "Apply highlight action",
- "actions.applySelection.description": "Selects a node.",
- "actions.applySelection.label": "Apply selection action",
- "actions.args.attributes.description": "Optional map of attribute to value that is applied during the action.",
- "actions.args.attributes.label": "Optional attributes function argument",
- "actions.args.primaryAttributes.description": "Optional map of primary attributes that are applied during the action.",
- "actions.args.primaryAttributes.label": "Optional primary attributes function argument",
- "actions.args.primarySelector.description": "Primary selector for the nodes that the action is to apply to.",
- "actions.args.primarySelector.label": "Primary selector function argument",
- "actions.args.secondaryAttributes.description": "Optional map of secondary attributes that are applied during the action.",
- "actions.args.secondaryAttributes.label": "Optional secondary attributes function argument",
- "actions.args.secondarySelector.description": "Secondary selector for the nodes that the action is to apply to.",
- "actions.args.secondarySelector.label": "Secondary selector function argument",
- "actions.args.selector.description": "Selector of the node that the action will apply to.",
- "actions.args.selector.label": "Selector function argument",
- "actions.breadCrumb.description": "Navigates up and down in detail through a bread crumb.",
- "actions.breadCrumb.label": "Bread crumb navigation action",
- "actions.chord.selector.description": "Selector for the chords that the action will apply to.",
- "actions.chord.selector.label": "Selector function argument for chords",
- "actions.chord.toggleSelect.description": "Toggles selection on a chord.",
- "actions.chord.toggleSelect.label": "Toggle select on chord action",
- "actions.chordGroup.highlight.description": "Highlights a chord group and everything that is connected to it.",
- "actions.chordGroup.highlight.label": "Chord group highlight action",
- "actions.chordGroup.removeHighlight.description": "Removes highlights from a chord group and everything connected to it.",
- "actions.chordGroup.removeHighlight.label": "Chord group remove highlight action",
- "actions.chordGroup.selector.description": "Selector for the chord groups that the action will apply to.",
- "actions.chordGroup.selector.label": "Selector function argument for chord groups",
- "actions.drillDown.description": "Drills down to the next level of detail.",
- "actions.drillDown.label": "Drill down action",
- "actions.removeAllSelect.description": "Removes all selections from all nodes.",
- "actions.removeAllSelect.label": "Remove all selections action",
- "actions.removeHighlight.description": "Removes a highlight from a node.",
- "actions.removeHighlight.label": "Remove highlight action",
- "actions.removeSelection.description": "Removes a selection from a node.",
- "actions.removeSelection.label": "Remove selection action",
- "actions.toggleSelect.description": "Toggles the selection on a node.",
- "actions.toggleSelect.label": "Toggle selection action",
- "actions.zoom.args.panX.description": "The amount to pan in the x direction.",
- "actions.zoom.args.panX.label": "Zoom x pan amount function argument",
- "actions.zoom.args.panY.description": "The amount to pan in the y direction.",
- "actions.zoom.args.panY.label": "Zoom y pan amount function argument",
- "actions.zoom.args.scale.description": "The scale amount for the zoom action.",
- "actions.zoom.args.scale.label": "Zoom scale function argument",
- "actions.zoom.description": "Zoom action",
- "actions.zoom.label": "Zoom action",
- "actions.zoomPackedBubble.description": "Zoom for a packed bubble.",
- "actions.zoomPackedBubble.label": "Zoom packed bubble action",
- "alignAxes.description": "Aligns the grid lines of dependent axes.",
- "alignAxes.falseLabel": "Do not align",
- "alignAxes.name": "Align dependent axes on grid",
- "alignAxes.trueLabel": "Align",
- "axis.labels.truncationText.description": "The text that is placed at the end of labels to indicate truncation.",
- "axis.labels.truncationText.name": "Axis truncation text",
- "axis.x.gridlines.display.description": "Shows or hides the X-axis gridlines.",
- "axis.x.gridlines.display.falseLabel": "Hide",
- "axis.x.gridlines.display.name": "Show gridlines",
- "axis.x.gridlines.display.trueLabel": "Show",
- "axis.x.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the X-axis gridlines.",
- "axis.x.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
- "axis.x.gridlines.style.stroke.description": "The color of the X-axis gridline.",
- "axis.x.gridlines.style.stroke.name": "Gridline color",
- "axis.x.labels.allowRotate45.description": "Enables or disables the rotate45 option for labels automatic layout.",
- "axis.x.labels.allowRotate45.falseLabel": "Disable rotate45 option",
- "axis.x.labels.allowRotate45.name": "Allow rotate 45",
- "axis.x.labels.allowRotate45.trueLabel": "Enable rotate45 option",
- "axis.x.labels.allowRotate90.description": "Enables or disables the rotate90 option for labels automatic layout.",
- "axis.x.labels.allowRotate90.falseLabel": "Disable rotate90 option",
- "axis.x.labels.allowRotate90.name": "Allow rotate 90",
- "axis.x.labels.allowRotate90.trueLabel": "Enable rotate90 option",
- "axis.x.labels.allowStagger.description": "Allows the stagger option for labels automatic layout.",
- "axis.x.labels.allowStagger.falseLabel": "X-axis do not allow stagger",
- "axis.x.labels.allowStagger.name": "Allow stagger",
- "axis.x.labels.allowStagger.trueLabel": "X-axis allow stagger",
- "axis.x.labels.display.description": "Shows or hides the X-axis labels.",
- "axis.x.labels.display.falseLabel": "Hide",
- "axis.x.labels.display.name": "Show labels",
- "axis.x.labels.display.trueLabel": "Show",
- "axis.x.labels.layoutMode.description": "Configure the layout mode for the X-axis labels.",
- "axis.x.labels.layoutMode.name": "Layout Mode",
- "axis.x.labels.layoutMode.options.automatic": "Automatic",
- "axis.x.labels.layoutMode.options.horizontal": "Horizontal",
- "axis.x.labels.layoutMode.options.rotate45": "Rotated 45 degrees",
- "axis.x.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
- "axis.x.labels.layoutMode.options.stagger": "Stagger",
- "axis.x.labels.style.fill.description": "The color of X-axis labels.",
- "axis.x.labels.style.fill.name": "Label color",
- "axis.x.labels.style.font-family.description": "The font families of the X-axis labels.",
- "axis.x.labels.style.font-family.name": "Label font families",
- "axis.x.labels.style.font-size.description": "The size of X-axis labels (CSS size).",
- "axis.x.labels.style.font-size.name": "Label font size",
- "axis.x.labels.style.font.description": "The font properties of X-axis labels (CSS styles).",
- "axis.x.labels.style.font.name": "Label font",
- "axis.x.labels.zoomPan.description": "Shows or hides X-axis labels when panning and zooming.",
- "axis.x.labels.zoomPan.falseLabel": "Show",
- "axis.x.labels.zoomPan.name": "Label pan-zoom",
- "axis.x.labels.zoomPan.trueLabel": "Hide",
- "axis.x.line.display.description": "Shows or hides the X-axis line.",
- "axis.x.line.display.falseLabel": "Hide",
- "axis.x.line.display.name": "Show line",
- "axis.x.line.display.trueLabel": "Show",
- "axis.x.line.style.stroke.description": "The color of the X-axis line.",
- "axis.x.line.style.stroke.name": "Line color",
- "axis.x.scale.includeZero.description": "When set to Yes, includes 0 on the X-axis.",
- "axis.x.scale.includeZero.falseLabel": "Do not include",
- "axis.x.scale.includeZero.name": "Includes zero",
- "axis.x.scale.includeZero.trueLabel": "Include",
- "axis.x.scale.max.description": "The maximum value that appears on the X-axis.",
- "axis.x.scale.max.name": "Maximum value",
- "axis.x.scale.min.description": "The minimum value that appears on the X-axis.",
- "axis.x.scale.min.name": "Minimum value",
- "axis.x.scale.nice.description": "When set to Yes, uses nice endpoint values on the X-axis.",
- "axis.x.scale.nice.falseLabel": "Do not nice",
- "axis.x.scale.nice.name": "Nicing",
- "axis.x.scale.nice.trueLabel": "Apply nicing",
- "axis.x.ticks.display.description": "Shows or hides the X-axis tick marks.",
- "axis.x.ticks.display.falseLabel": "Hide",
- "axis.x.ticks.display.name": "Show ticks",
- "axis.x.ticks.display.trueLabel": "Show",
- "axis.x.ticks.style.stroke.description": "The color of the X-axis ticks.",
- "axis.x.ticks.style.stroke.name": "Tick color",
- "axis.x.title.display.description": "Shows or hides the X-axis title.",
- "axis.x.title.display.falseLabel": "Hide",
- "axis.x.title.display.name": "Show title",
- "axis.x.title.display.trueLabel": "Show",
- "axis.x.title.style.fill.description": "The color of the X-axis title.",
- "axis.x.title.style.fill.name": "Title color",
- "axis.x.title.style.font-family.description": "The font family names of the X-axis title.",
- "axis.x.title.style.font-family.name": "Title font families",
- "axis.x.title.style.font-size.description": "The X-axis title font size (CSS size).",
- "axis.x.title.style.font-size.name": "Title font size",
- "axis.x.title.style.font.description": "The X-axis title font properties (CSS style).",
- "axis.x.title.style.font.name": "Title font",
- "axis.x.title.text.description": "The title of the X-axis.",
- "axis.x.title.text.name": "Title",
- "axis.y.gridlines.display.description": "Shows or hides the column chart Y-axis gridlines.",
- "axis.y.gridlines.display.falseLabel": "Hide",
- "axis.y.gridlines.display.name": "Y-axis (column) show gridlines",
- "axis.y.gridlines.display.trueLabel": "Show",
- "axis.y.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the column chart Y-axis gridlines.",
- "axis.y.gridlines.style.stroke-dasharray.name": "Y-axis (column) gridline dash pattern",
- "axis.y.gridlines.style.stroke.description": "The color of the column chart Y-axis gridline.",
- "axis.y.gridlines.style.stroke.name": "Y-axis (column) gridline color",
- "axis.y.labels.display.description": "Shows or hides the column chart Y-axis labels.",
- "axis.y.labels.display.falseLabel": "Hide",
- "axis.y.labels.display.name": "Y-axis (column) show labels",
- "axis.y.labels.display.trueLabel": "Show",
- "axis.y.labels.hideOverlap.description": "Shows or hides overlapping labels on the column chart Y-axis.",
- "axis.y.labels.hideOverlap.falseLabel": "Do not hide",
- "axis.y.labels.hideOverlap.name": "Y-axis (column) hide overlapping labels",
- "axis.y.labels.hideOverlap.trueLabel": "Hide",
- "axis.y.labels.layoutMode.description": "Configure the layout mode for the Y-axis labels.",
- "axis.y.labels.layoutMode.name": "Layout Mode",
- "axis.y.labels.layoutMode.options.horizontal": "Horizontal",
- "axis.y.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
- "axis.y.labels.rotation.description": "Rotates the column chart Y-axis labels.",
- "axis.y.labels.rotation.name": "Y-axis (column) label rotation",
- "axis.y.labels.style.fill.description": "The color of the column chart Y-axis labels.",
- "axis.y.labels.style.fill.name": "Y-axis (column) label color",
- "axis.y.labels.style.font-family.description": "The font families of the column chart Y-axis labels.",
- "axis.y.labels.style.font-family.name": "Y-axis (column) label font families",
- "axis.y.labels.style.font-size.description": "The size of the column chart Y-axis labels (CSS size).",
- "axis.y.labels.style.font-size.name": "Y-axis (column) label font size",
- "axis.y.labels.style.font.description": "The font properties of the column chart Y-axis labels (CSS styles).",
- "axis.y.labels.style.font.name": "Y-axis (column) label font",
- "axis.y.labels.style.text-anchor.description": "The text anchor position of the column chart Y-axis labels.",
- "axis.y.labels.style.text-anchor.name": "Y-axis (column) label text anchor",
- "axis.y.labels.style.text-anchor.options.end": "End",
- "axis.y.labels.style.text-anchor.options.middle": "Middle",
- "axis.y.labels.style.text-anchor.options.start": "Start",
- "axis.y.labels.wrap.description": "Enables or disables label wrapping on the column chart Y-axis.",
- "axis.y.labels.wrap.falseLabel": "Do not wrap",
- "axis.y.labels.wrap.name": "Y-axis (column) label wrap",
- "axis.y.labels.wrap.trueLabel": "Wrap",
- "axis.y.labels.wrapValignment.description": "Vertically aligns the column chart Y-axis labels.",
- "axis.y.labels.wrapValignment.name": "Y-axis (column) wrapped label alignment",
- "axis.y.labels.wrapValignment.options.bottom": "Bottom",
- "axis.y.labels.wrapValignment.options.middle": "Middle",
- "axis.y.labels.wrapValignment.options.top": "Top",
- "axis.y.labels.zoomPan.description": "Shows or hides the column chart Y-axis labels when panning and zooming.",
- "axis.y.labels.zoomPan.falseLabel": "Show",
- "axis.y.labels.zoomPan.name": "Y-axis (column) label hide pan-zoom",
- "axis.y.labels.zoomPan.trueLabel": "Hide",
- "axis.y.line.display.description": "Shows or hides the column chart Y-axis line.",
- "axis.y.line.display.falseLabel": "Hide",
- "axis.y.line.display.name": "Y-axis (column) show line",
- "axis.y.line.display.trueLabel": "Show",
- "axis.y.line.style.stroke.description": "The color of the column chart Y-axis line.",
- "axis.y.line.style.stroke.name": "Y-axis (column) line color",
- "axis.y.scale.includeZero.description": "When set to Yes, includes 0 on the column chart Y-axis.",
- "axis.y.scale.includeZero.falseLabel": "Do not include",
- "axis.y.scale.includeZero.name": "Y-axis (column) includes zero",
- "axis.y.scale.includeZero.trueLabel": "Include",
- "axis.y.scale.max.description": "The maximum value that appears on the column chart Y-axis.",
- "axis.y.scale.max.name": "Y-axis (column) maximum value",
- "axis.y.scale.min.description": "The minimum value that appears on the column chart Y-axis.",
- "axis.y.scale.min.name": "Y-axis (column) minimum value",
- "axis.y.scale.nice.description": "When set to Yes, uses nice endpoint values on the column chart Y-axis.",
- "axis.y.scale.nice.falseLabel": "Do not nice",
- "axis.y.scale.nice.name": "Y-axis (column) nicing",
- "axis.y.scale.nice.trueLabel": "Apply nicing",
- "axis.y.ticks.display.description": "Shows or hides the column Y-axis tick marks.",
- "axis.y.ticks.display.falseLabel": "Hide",
- "axis.y.ticks.display.name": "Y-axis (column) show ticks",
- "axis.y.ticks.display.trueLabel": "Show",
- "axis.y.ticks.style.stroke.description": "The color of the column chart Y-axis ticks.",
- "axis.y.ticks.style.stroke.name": "Y-axis (column) tick color",
- "axis.y.title.display.description": "Shows or hides the column chart Y-axis title.",
- "axis.y.title.display.falseLabel": "Hide",
- "axis.y.title.display.name": "Y-axis (column) show title",
- "axis.y.title.display.trueLabel": "Show",
- "axis.y.title.style.fill.description": "The color of the column chart Y-axis title.",
- "axis.y.title.style.fill.name": "Y-axis (column) title color",
- "axis.y.title.style.font-family.description": "The font family names of the column chart Y-axis title.",
- "axis.y.title.style.font-family.name": "Y-axis (column) title font families",
- "axis.y.title.style.font-size.description": "The size of the column chart Y-axis title font (CSS size).",
- "axis.y.title.style.font-size.name": "Y-axis (column) title font size",
- "axis.y.title.style.font.description": "The font properties of the column chart Y-axis title (CSS styles).",
- "axis.y.title.style.font.name": "Y-axis (column) title font",
- "axis.y.title.text.description": "The title of the column chart Y-axis.",
- "axis.y.title.text.name": "Y-axis (column) title",
- "axis.y2.gridlines.display.description": "Shows or hides the line chart Y-axis gridlines.",
- "axis.y2.gridlines.display.falseLabel": "Hide",
- "axis.y2.gridlines.display.name": "Y-axis (line) show gridlines",
- "axis.y2.gridlines.display.trueLabel": "Show",
- "axis.y2.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the line chart Y-axis gridlines.",
- "axis.y2.gridlines.style.stroke-dasharray.name": "Y-axis (line) gridline dash pattern",
- "axis.y2.gridlines.style.stroke.description": "The color of the line chart Y-axis gridline.",
- "axis.y2.gridlines.style.stroke.name": "Y-axis (line) gridline color",
- "axis.y2.labels.display.description": "Shows or hides the line chart Y-axis labels.",
- "axis.y2.labels.display.falseLabel": "Hide",
- "axis.y2.labels.display.name": "Y-axis (line) show labels",
- "axis.y2.labels.display.trueLabel": "Show",
- "axis.y2.labels.hideOverlap.description": "Shows or hides overlapping labels on the line chart Y-axis.",
- "axis.y2.labels.hideOverlap.falseLabel": "Do not hide",
- "axis.y2.labels.hideOverlap.name": "Y-axis (line) hide overlapping labels",
- "axis.y2.labels.hideOverlap.trueLabel": "Hide",
- "axis.y2.labels.layoutMode.description": "Configure the layout mode for the Y2-axis labels.",
- "axis.y2.labels.layoutMode.name": "Layout Mode",
- "axis.y2.labels.layoutMode.options.horizontal": "Horizontal",
- "axis.y2.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
- "axis.y2.labels.rotation.description": "Rotates the line chart Y-axis labels.",
- "axis.y2.labels.rotation.name": "Y-axis (line) label rotation",
- "axis.y2.labels.style.fill.description": "The color of the line chart Y-axis labels.",
- "axis.y2.labels.style.fill.name": "Y-axis (line) label color",
- "axis.y2.labels.style.font-family.description": "The font families of the line chart Y-axis labels.",
- "axis.y2.labels.style.font-family.name": "Y-axis (line) label font families",
- "axis.y2.labels.style.font-size.description": "The size of the line chart Y-axis labels (CSS size).",
- "axis.y2.labels.style.font-size.name": "Y-axis (line) label font size",
- "axis.y2.labels.style.font.description": "The font properties of the line chart Y-axis labels (CSS styles).",
- "axis.y2.labels.style.font.name": "Y-axis (line) label font",
- "axis.y2.labels.style.text-anchor.description": "The text anchor position of the line chart Y-axis labels.",
- "axis.y2.labels.style.text-anchor.name": "Y-axis (line) label text anchor",
- "axis.y2.labels.style.text-anchor.options.end": "End",
- "axis.y2.labels.style.text-anchor.options.middle": "Middle",
- "axis.y2.labels.style.text-anchor.options.start": "Start",
- "axis.y2.labels.wrap.description": "Enables or disables label wrapping on the line chart Y-axis.",
- "axis.y2.labels.wrap.falseLabel": "Do not wrap",
- "axis.y2.labels.wrap.name": "Y-axis (line) label wrap",
- "axis.y2.labels.wrap.trueLabel": "Wrap",
- "axis.y2.labels.wrapValignment.description": "Vertically aligns the line chart Y-axis labels.",
- "axis.y2.labels.wrapValignment.name": "Y-axis (line) wrapped label alignment",
- "axis.y2.labels.wrapValignment.options.bottom": "Bottom",
- "axis.y2.labels.wrapValignment.options.middle": "Middle",
- "axis.y2.labels.wrapValignment.options.top": "Top",
- "axis.y2.labels.zoomPan.description": "Shows or hides the line chart Y-axis labels when panning and zooming.",
- "axis.y2.labels.zoomPan.falseLabel": "Show",
- "axis.y2.labels.zoomPan.name": "Y-axis (line) label hide pan-zoom",
- "axis.y2.labels.zoomPan.trueLabel": "Hide",
- "axis.y2.line.display.description": "Shows or hides the line Y-axis line.",
- "axis.y2.line.display.falseLabel": "Hide",
- "axis.y2.line.display.name": "Y-axis (line) show line",
- "axis.y2.line.display.trueLabel": "Show",
- "axis.y2.line.style.stroke.description": "The color of the line chart Y-axis line.",
- "axis.y2.line.style.stroke.name": "Y-axis (line) line color",
- "axis.y2.scale.includeZero.description": "When set to Yes, includes 0 on the line chart Y-axis.",
- "axis.y2.scale.includeZero.falseLabel": "Do not include",
- "axis.y2.scale.includeZero.name": "Y-axis (line) includes zero",
- "axis.y2.scale.includeZero.trueLabel": "Include",
- "axis.y2.scale.max.description": "The maximum value that appears on the line Y-axis",
- "axis.y2.scale.max.name": "Y-axis (line) maximum value",
- "axis.y2.scale.min.description": "The minimum value that appears on the line chart Y-axis.",
- "axis.y2.scale.min.name": "Y-axis (line) minimum value",
- "axis.y2.scale.nice.description": "When set to Yes, uses nice endpoint values on the line chart Y-axis.",
- "axis.y2.scale.nice.falseLabel": "Do not nice",
- "axis.y2.scale.nice.name": "Y-axis (line) nicing",
- "axis.y2.scale.nice.trueLabel": "Apply nicing",
- "axis.y2.ticks.display.description": "Shows or hides the line chart Y-axis tick marks.",
- "axis.y2.ticks.display.falseLabel": "Hide",
- "axis.y2.ticks.display.name": "Y-axis (line) show ticks",
- "axis.y2.ticks.display.trueLabel": "Show",
- "axis.y2.ticks.style.stroke.description": "The color of the line chart Y-axis ticks.",
- "axis.y2.ticks.style.stroke.name": "Y-axis (line) tick color",
- "axis.y2.title.display.description": "Shows or hides the line chart Y-axis title.",
- "axis.y2.title.display.falseLabel": "Hide",
- "axis.y2.title.display.name": "Y-axis (line) show title",
- "axis.y2.title.display.trueLabel": "Show",
- "axis.y2.title.style.fill.description": "The color of the line chart Y-axis title.",
- "axis.y2.title.style.fill.name": "Y-axis (line) title color",
- "axis.y2.title.style.font-family.description": "The font family names of the line chart Y-axis title.",
- "axis.y2.title.style.font-family.name": "Y-axis (line) title font families",
- "axis.y2.title.style.font-size.description": "The size of the line chart Y-axis title font (CSS size).",
- "axis.y2.title.style.font-size.name": "Y-axis (line) title font size",
- "axis.y2.title.style.font.description": "The font properties of the line chart Y-axis title (CSS styles).",
- "axis.y2.title.style.font.name": "Y-axis (line) title font",
- "axis.y2.title.text.description": "The title of the line chart Y-axis.",
- "axis.y2.title.text.name": "Y-axis (line) title",
- "background.chart.color.description": "The background color of the chart.",
- "background.chart.color.name": "Background color",
- "background.color.description": "The background color of the chart.",
- "background.elements.color.description": "The background color behind the elements of the chart.",
- "background.elements.color.name": "Elements background color",
- "color.null.description": "The color that is used for null values in the column chart.",
- "color.null.name": "Null color for columns",
- "color.palette.column.description": "The color palette to use for the column chart.",
- "color.palette.column.name": "Column color palette",
- "color.palette.line.description": "The color palette to use for the line chart.",
- "color.palette.line.name": "Line color palette",
- "column.applysize.description": "When set to Yes, the size of the columns is controlled by ordinal scales.",
- "column.applysize.name": "Apply size to ordinal columns",
- "column.borderColor.description": "The color of borders in the column chart.",
- "column.borderColor.name": "Column border color",
- "column.borderWidth.description": "The width of the borders in the column chart.",
- "column.borderWidth.name": "Column border width",
- "column.size.description": "The width (transposed height) of the columns when continuous data is used.",
- "column.size.name": "Column size",
- "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.",
- "composite.config.composite.label": "Advanced line and column",
- "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.",
- "composite.config.compositeOneDataSet.label": "Simple line and column",
- "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.",
- "composite.config.compositeSmoothOneDataSet.label": "Line and column",
- "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.",
- "composite.falseLabel.applySize": "Do not apply size",
- "composite.falseLabel.columnLegend": "Hide",
- "composite.falseLabel.delay": "No stagger",
- "composite.falseLabel.itemLabel": "Hide",
- "composite.falseLabel.lineLegend": "Hide",
- "composite.falseLabel.lineOnly": "Line only",
- "composite.falseLabel.sortX": "Do not sort lines (use data ordering)",
- "composite.label": "Composite",
- "composite.propertyPresentation.advanced.compositeSpecificProperties.description": "Composite-specific properties",
- "composite.propertyPresentation.advanced.compositeSpecificProperties.label": "Composite",
- "composite.propertyPresentation.advanced.y2AxisProperties.description": "The properties of the second Y axis.",
- "composite.propertyPresentation.advanced.y2AxisProperties.label": "Y2-axis",
- "composite.trueLabel.applySize": "Apply size",
- "composite.trueLabel.columnLegend": "Show",
- "composite.trueLabel.delay": "Use stagger",
- "composite.trueLabel.itemLabel": "Show",
- "composite.trueLabel.lineLegend": "Show",
- "composite.trueLabel.lineWithPoints": "Line with points",
- "composite.trueLabel.sortX": "Sort lines by x value",
- "contrast.label.color.description": "Adjust the label color to contrast with background.",
- "contrast.label.color.name": "Contrast label color with background",
- "data.handling.description": "The configuration that is used to plot the data.",
- "data.handling.name": "Configuration",
- "data.handling.options.Clustered": "Clustered",
- "data.handling.options.None": "None",
- "data.handling.options.Stacked": "Stacked",
- "data.handling.options.Stacked100": "Stacked 100%",
- "data.label.display.description": "Shows or hides data labels.",
- "data.label.display.name": "Data label",
- "data.label.type.description": "Type of data labels to display.",
- "data.label.type.name": "Data label type",
- "data.label.type.options.percentByCategory": "Percentage of category",
- "data.label.type.options.percentByColor": "Percentage of color (series)",
- "data.label.type.options.value": "Value",
- "datamodel.hierarchial.label": "Hierarchical data model",
- "datamodel.simple.description": "The data model for the simple composite chart.",
- "datamodel.simple.label": "Simple composite chart data model",
- "datamodel.tabular.composite.description": "The composite data model, providing separate column and line data sets.",
- "datamodel.tabular.label": "Tabular data model",
- "dataset.composite.description": "The data set for the composite chart.",
- "dataset.composite.label": "Tabular data sets - line and column",
- "dataset.hierarchial.label": "Hierarchical data set",
- "dataset.tabular.composite.column.description": "The tabular data set for the columns.",
- "dataset.tabular.composite.column.label": "Column tabular data set",
- "dataset.tabular.composite.line.description": "The tabular data set for the lines.",
- "dataset.tabular.composite.line.label": "Line tabular data set",
- "dataset.tabular.description": "The tabular data set of rows and columns.",
- "dataset.tabular.label": "Tabular data set",
- "dataset.tabular.link.description": "Determines the links between the nodes.",
- "dataset.tabular.link.label": "Tabular links data set",
- "dataset.tabular.node.description": "The tabular data set that defines the nodes.",
- "dataset.tabular.node.label": "Tabular node data set",
- "dataslost.label.composite.column.description": "The label for the columns.",
- "dataslot.categories.label": "Categories",
- "dataslot.category.label": "Category",
- "dataslot.children.description": "When applied to a tree node, returns the children of that node as an array-list.",
- "dataslot.children.label": "Children",
- "dataslot.color.composite.description": "The color of the columns.",
- "dataslot.color.composite.line.description": "The color of the lines.",
- "dataslot.color.description": "Determines the color of the shape.",
- "dataslot.color.label": "Color",
- "dataslot.colorLine.composite.line.description": "The color of the line.",
- "dataslot.colorLine.label": "Color line",
- "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.",
- "dataslot.key.description": "Called for each row to match elements. Primarily used for transitions.",
- "dataslot.key.label": "Key",
- "dataslot.keyLine.description": "The key for the line.",
- "dataslot.keyLine.label": "Key line",
- "dataslot.label.composite.line.description": "If defined, the label of the point (not the line).",
- "dataslot.label.description": "Determines the label of the shape.",
- "dataslot.label.label": "Label",
- "dataslot.labelLine.composite.line.description": "The label for the line.",
- "dataslot.labelLine.label": "Label line",
- "dataslot.maximumValue.label": "Maximum value",
- "dataslot.source.label": "Source",
- "dataslot.sourceValue.label": "Source value",
- "dataslot.tabular.id.description": "The identifier for the nodes.",
- "dataslot.tabular.id.label": "Identifier",
- "dataslot.tabular.size.description": "Determines the size of the shape.",
- "dataslot.tabular.size.label": "Size",
- "dataslot.target.label": "Target",
- "dataslot.targetValue.label": "Target value",
- "dataslot.value.label": "Value",
- "dataslot.x.composite.description": "The X coordinate of the column. The value can be a number, string, or date.",
- "dataslot.x.label": "X axis",
- "dataslot.y.composite.description": "The Y value (extent) of the column. The value must be a number.",
- "dataslot.y.label": "Y axis",
- "dataslot.yColumn.composite.description": "The Y value (extent) of the column. The value must be a number.",
- "dataslot.yColumn.label": "Column value",
- "dataslot.yLine.composite.description": "The Y value (extent) of the line. The value must be a number.",
- "dataslot.yLine.label": "Line value",
- "dataslot.yStart.composite.description": "The start position of the column on the Y scale.",
- "dataslot.yStart.composite.label": "Y start",
- "defaultPalette.description": "Rave2 default description",
- "defaultPalette.label": "Rave2 default",
- "effect.delay.description": "Staggers (delays) the transitions along the X coordinate.",
- "effect.delay.name": "Stagger transition",
- "effect.duration.description": "The animation duration, in ms.",
- "effect.duration.name": "Animation duration (ms)",
- "effect.name.description": "The effect that is used when the chart is drawn.",
- "effect.name.name": "Animation",
- "effect.name.options.none": "None",
- "effect.name.options.transition": "Transition",
- "item.label.description": "Shows or hides item labels.",
- "item.label.name": "Item labels",
- "label.shadow.description": "Show or hide shadow for labels.",
- "label.shadow.name": "Label shadow",
- "labelResolution.description": "The method to use to resolve label overlaps.",
- "labelResolution.name": "Label resolution",
- "labelResolution.options.DropLabels": "Drop labels",
- "labelResolution.options.MoveLabels": "Move labels",
- "labelResolution.options.none": "None",
- "labelstyle.font.description": "Font styles for the item labels",
- "labelstyle.font.name": "Item label font",
- "layout.axissize.bottom.max.description": "The maximum size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.max.name": "Bottom axis maximum size",
- "layout.axissize.bottom.min.description": "The minimum size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.min.name": "Bottom axis minimum size",
- "layout.axissize.bottom.preferred.description": "The preferred size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.preferred.name": "Bottom axis preferred size",
- "layout.axissize.left.max.description": "The maximum size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.max.name": "Left axis maximum size",
- "layout.axissize.left.min.description": "The minimum size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.min.name": "Left axis minimum size",
- "layout.axissize.left.preferred.description": "The preferred size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.preferred.name": "Left axis preferred size",
- "layout.axissize.right.max.description": "The maximum size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.max.name": "Right axis maximum size",
- "layout.axissize.right.min.description": "The minimum size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.min.name": "Right axis minimum size",
- "layout.axissize.right.preferred.description": "The preferred size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.preferred.name": "Right axis preferred size",
- "layout.axissize.top.max.description": "The maximum size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.max.name": "Top axis maximum size",
- "layout.axissize.top.min.description": "The minimum size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.min.name": "Top axis minimum size",
- "layout.axissize.top.preferred.description": "The preferred size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.preferred.name": "Top axis preferred size",
- "layout.chart.padding.bottom.description": "The bottom padding for the chart.",
- "layout.chart.padding.bottom.name": "Bottom padding",
- "layout.chart.padding.left.description": "The left padding for the chart.",
- "layout.chart.padding.left.name": "Left padding",
- "layout.chart.padding.right.description": "Right padding for the chart.",
- "layout.chart.padding.right.name": "Right padding",
- "layout.chart.padding.top.description": "The top padding for the chart.",
- "layout.chart.padding.top.name": "Top padding",
- "layout.legendchart.align.description": "Whether to align the legend to the interior of the chart.",
- "layout.legendchart.align.name": "Align legend to chart",
- "layout.legendchart.gap.description": "Space between the chart and the legend, as a CSS size or percentage.",
- "layout.legendchart.gap.name": "Space between legend and chart",
- "layout.legendsize.max.description": "The maximum size of the legend, as a CSS size or percentage.",
- "layout.legendsize.max.name": "Maximum size",
- "layout.legendsize.min.description": "The minimum size of the legend, as a CSS size or percentage.",
- "layout.legendsize.min.name": "Minimum size",
- "layout.legendsize.preferred.description": "The preferred size of the legend, as a CSS size or percentage.",
- "layout.legendsize.preferred.name": "Preferred size",
- "layout.padding.description": "The padding around the chart and legend.",
- "layout.padding.name": "Padding",
- "legend.column.display.description": "Shows or hides the legend for the column chart.",
- "legend.column.display.name": "Show column legend",
- "legend.column.entrystyle.font.description": "The font style of the column chart legend entries.",
- "legend.column.entrystyle.font.name": "Column legend entry font",
- "legend.column.title.description": "The title of the column chart legend.",
- "legend.column.title.name": "Column legend title",
- "legend.column.titlestyle.fill.description": "The color of the column chart legend title.",
- "legend.column.titlestyle.fill.name": "Column legend title color",
- "legend.column.titlestyle.font.description": "The font style of the column chart legend title.",
- "legend.column.titlestyle.font.name": "Column legend title font",
- "legend.column.titlestyle.fontfamily.description": "The font family of the column chart legend title.",
- "legend.column.titlestyle.fontfamily.name": "Column legend title font family",
- "legend.column.titlestyle.fontsize.description": "The font size of the column chart legend title.",
- "legend.column.titlestyle.fontsize.name": "Column legend title font size",
- "legend.display.description": "Shows or hides the legend.",
- "legend.display.falseLabel": "Hide",
- "legend.display.name": "Show legend",
- "legend.display.trueLabel": "Show",
- "legend.entrystyle.font.description": "The font properties of the legend entry.",
- "legend.entrystyle.font.name": "Entry font",
- "legend.line.display.description": "Shows or hides the line chart legend.",
- "legend.line.display.name": "Show line legend",
- "legend.line.entrystyle.font.description": "The font style of the line chart legend entries.",
- "legend.line.entrystyle.font.name": "Line legend entry font",
- "legend.line.title.description": "The title of the line chart legend.",
- "legend.line.title.name": "Line legend title",
- "legend.line.titlestyle.fill.description": "The color of the line chart legend title.",
- "legend.line.titlestyle.fill.name": "Line legend title color",
- "legend.line.titlestyle.font.description": "The font style of the line chart legend title.",
- "legend.line.titlestyle.font.name": "Line legend title font",
- "legend.line.titlestyle.fontfamily.description": "The font family of the line chart legend title.",
- "legend.line.titlestyle.fontfamily.name": "Line legend title font family",
- "legend.line.titlestyle.fontsize.description": "The font size of the line chart legend title.",
- "legend.line.titlestyle.fontsize.name": "Line legend title font size",
- "legend.position.description": "The position of the legend in the chart.",
- "legend.position.name": "Legend position",
- "legend.position.options.bottom": "Bottom",
- "legend.position.options.left": "Left",
- "legend.position.options.right": "Right",
- "legend.position.options.top": "Top",
- "legend.title.description": "The title of the legend.",
- "legend.title.name": "Title",
- "legend.titlestyle.fill.description": "The color of the legend title.",
- "legend.titlestyle.fill.name": "Title color",
- "legend.titlestyle.font.description": "The font properties of the legend title.",
- "legend.titlestyle.font.name": "Title font",
- "legend.titlestyle.fontfamily.description": "The font family of the legend title.",
- "legend.titlestyle.fontfamily.name": "Title font family",
- "legend.titlestyle.fontsize.description": "The font size of the legend title.",
- "legend.titlestyle.fontsize.name": "Title font size",
- "lineWithPoints.display.description": "In the line chart, shows line and points, line only, or points only.",
- "lineWithPoints.display.name": "Line chart display mode",
- "lineWithPoints.display.options.line": "Line(s) only",
- "lineWithPoints.display.options.linePoints": "Line and points",
- "lineWithPoints.display.options.points": "Points only",
- "lineWithPoints.interpolate.description": "Controls how the line in the line chart is drawn.",
- "lineWithPoints.interpolate.name": "Interpolation mode",
- "lineWithPoints.interpolate.options.basis": "Basis",
- "lineWithPoints.interpolate.options.basis-open": "Basis-open",
- "lineWithPoints.interpolate.options.cardinal": "Cardinal",
- "lineWithPoints.interpolate.options.cardinal-open": "Cardinal-open",
- "lineWithPoints.interpolate.options.linear": "Linear",
- "lineWithPoints.interpolate.options.monotone": "Monotone",
- "lineWithPoints.interpolate.options.step": "Step",
- "lineWithPoints.interpolate.options.step-after": "Step-after",
- "lineWithPoints.interpolate.options.step-before": "Step-before",
- "lineWithPoints.showMissingAsGap.description": "Show missing data as gap instead of interpolating a line across the missing data",
- "lineWithPoints.showMissingAsGap.name": "Show missing data as gap",
- "lineWithPoints.size.description": "The size, in square pixels, of the line-with-points symbol.",
- "lineWithPoints.size.name": "Line-with-points size",
- "lineWithPoints.symbol.description": "The shape that is used for the line-with-points symbol.",
- "lineWithPoints.symbol.name": "Line-with-points symbol",
- "lineWithPoints.symbol.options.circle": "Circle",
- "lineWithPoints.symbol.options.cross": "Cross",
- "lineWithPoints.symbol.options.diamond": "Diamond",
- "lineWithPoints.symbol.options.donut": "Donut",
- "lineWithPoints.symbol.options.donut-plus": "Donut-plus",
- "lineWithPoints.symbol.options.horizontal-rectangle": "Horizontal-rectangle",
- "lineWithPoints.symbol.options.rectangle": "Rectangle",
- "lineWithPoints.symbol.options.square": "Square",
- "lineWithPoints.symbol.options.star": "Star",
- "lineWithPoints.symbol.options.triangle-down": "Triangle-down",
- "lineWithPoints.symbol.options.triangle-left": "Triangle-left",
- "lineWithPoints.symbol.options.triangle-right": "Triangle-right",
- "lineWithPoints.symbol.options.triangle-up": "Triangle-up",
- "lineWithPoints.symbol.options.vertical-rectangle": "Vertical-rectangle",
- "propertyPresentation.advanced.axisSizeProperties.description": "Axis size properties.",
- "propertyPresentation.advanced.axisSizeProperties.label": "Axis size",
- "propertyPresentation.advanced.clientBehaviorProperties.description": "Client side properties.",
- "propertyPresentation.advanced.clientBehaviorProperties.label": "Client behavior",
- "propertyPresentation.advanced.commonProperties.description": "Common properties.",
- "propertyPresentation.advanced.commonProperties.label": "Common",
- "propertyPresentation.advanced.description": "Advanced list of all properties in a grouped structure.",
- "propertyPresentation.advanced.label": "Advanced",
- "propertyPresentation.advanced.labelProperties.description": "Label properties",
- "propertyPresentation.advanced.labelProperties.label": "Label",
- "propertyPresentation.advanced.legendProperties.description": "Legend properties.",
- "propertyPresentation.advanced.legendProperties.label": "Legend",
- "propertyPresentation.advanced.xAxisProperties.description": "X-axis properties.",
- "propertyPresentation.advanced.xAxisProperties.label": "X-axis",
- "propertyPresentation.advanced.yAxisProperties.description": "Y-axis properties.",
- "propertyPresentation.advanced.yAxisProperties.label": "Y-axis",
- "propertyPresentation.simple.description": "Simple list of the most common properties.",
- "propertyPresentation.simple.label": "Simple",
- "rave2.colorpalette.blueContinuousSequential.description": "Blue continuous sequential description",
- "rave2.colorpalette.blueContinuousSequential.label": "Blue continuous sequential",
- "rave2.colorpalette.blueDiscreteSequential.description": "Blue discrete sequential description",
- "rave2.colorpalette.blueDiscreteSequential.label": "Blue discrete sequential",
- "rave2.colorpalette.blueGreenContinuousDivergent.description": "Blue green continuous divergent description",
- "rave2.colorpalette.blueGreenContinuousDivergent.label": "Blue green continuous divergent",
- "rave2.colorpalette.blueGreenDiscreteDivergent.description": "Blue green discrete divergent description",
- "rave2.colorpalette.blueGreenDiscreteDivergent.label": "Blue green discrete divergent",
- "rave2.colorpalette.dark.description": "Dark description",
- "rave2.colorpalette.dark.label": "Dark",
- "rave2.colorpalette.financial.description": "Financial description",
- "rave2.colorpalette.financial.label": "Financial",
- "rave2.colorpalette.greenContinuousSequential.description": "Green continuous sequential description",
- "rave2.colorpalette.greenContinuousSequential.label": "Green continuous sequential",
- "rave2.colorpalette.greenDiscreteSequential.description": "Green discrete sequential description",
- "rave2.colorpalette.greenDiscreteSequential.label": "Green discrete sequential",
- "rave2.colorpalette.light.description": "Light description",
- "rave2.colorpalette.light.label": "Light",
- "rave2.colorpalette.medical.description": "Medical description",
- "rave2.colorpalette.medical.label": "Medical",
- "rave2.colorpalette.orangeContinuousSequential.description": "Orange continuous sequential description",
- "rave2.colorpalette.orangeContinuousSequential.label": "Orange continuous sequential",
- "rave2.colorpalette.orangeDiscreteSequential.description": "Orange discrete sequential description",
- "rave2.colorpalette.orangeDiscreteSequential.label": " Orange discrete sequential",
- "rave2.colorpalette.purpleContinuousSequential.description": "Purple continuous sequential description",
- "rave2.colorpalette.purpleContinuousSequential.label": "Purple continuous sequential",
- "rave2.colorpalette.purpleDiscreteSequential.description": "Purple discrete sequential description",
- "rave2.colorpalette.purpleDiscreteSequential.label": "Purple discrete sequential",
- "rave2.colorpalette.redBlueContinuousDivergent.description": "Red blue continuous divergent description",
- "rave2.colorpalette.redBlueContinuousDivergent.label": "Red blue continuous divergent",
- "rave2.colorpalette.redBlueDiscreteDivergent.description": "Red blue discrete divergent description",
- "rave2.colorpalette.redBlueDiscreteDivergent.label": "Red blue discrete divergent",
- "rave2.colorpalette.redBlueInverseContinuousDivergent.description": "Red blue inverse continuous divergent description",
- "rave2.colorpalette.redBlueInverseContinuousDivergent.label": "Red blue inverse continuous divergent",
- "rave2.colorpalette.redBlueInverseDiscreteDivergent.description": "Red blue inverse discrete divergent description",
- "rave2.colorpalette.redBlueInverseDiscreteDivergent.label": "Red blue inverse discrete divergent",
- "rave2.colorpalette.redContinuousSequential.description": "Red continuous sequential description",
- "rave2.colorpalette.redContinuousSequential.label": "Red continuous sequential",
- "rave2.colorpalette.redDiscreteSequential.description": "Red discrete sequential description",
- "rave2.colorpalette.redDiscreteSequential.label": " Red discrete sequential",
- "rave2.colorpalette.redGreenContinuousDivergent.description": "Red green continuous divergent description",
- "rave2.colorpalette.redGreenContinuousDivergent.label": "Red green continuous divergent",
- "rave2.colorpalette.redGreenDiscreteDivergent.description": "Red green discrete divergent description",
- "rave2.colorpalette.redGreenDiscreteDivergent.label": "Red green discrete divergent",
- "rave2.colorpalette.redGreenInverseContinuousDivergent.description": "Red green inverse continuous divergent description",
- "rave2.colorpalette.redGreenInverseContinuousDivergent.label": "Red green inverse continuous divergent",
- "rave2.colorpalette.redGreenInverseDiscreteDivergent.description": "Red green inverse discrete divergent description",
- "rave2.colorpalette.redGreenInverseDiscreteDivergent.label": "Red green inverse discrete divergent",
- "rave2.colorpalette.tealContinuousSequential.description": "Teal continuous sequential description",
- "rave2.colorpalette.tealContinuousSequential.label": "Teal continuous sequential",
- "rave2.colorpalette.tealDiscreteSequential.description": "Teal discrete sequential description",
- "rave2.colorpalette.tealDiscreteSequential.label": "Teal discrete sequential",
- "rave2.colorpalette.tealPurpleContinuousDivergent.description": "Teal purple continuous divergent description",
- "rave2.colorpalette.tealPurpleContinuousDivergent.label": "Teal purple continuous divergent",
- "rave2.colorpalette.tealPurpleDiscreteDivergent.description": "Teal purple discrete divergent description",
- "rave2.colorpalette.tealPurpleDiscreteDivergent.label": "Teal purple discrete divergent",
- "rave2.colorpalette.violetContinuousSequential.description": "Violet continuous sequential description",
- "rave2.colorpalette.violetContinuousSequential.label": "Violet continuous sequential",
- "rave2.colorpalette.violetDiscreteSequential.description": "Violet discrete sequential description",
- "rave2.colorpalette.violetDiscreteSequential.label": "Violet discrete sequential",
- "rave2.colorpalette.yellowContinuousSequential.description": "Yellow continuous sequential description",
- "rave2.colorpalette.yellowContinuousSequential.label": "Yellow continuous sequential",
- "rave2.colorpalette.yellowDiscreteSequential.description": "Yellow discrete sequential description",
- "rave2.colorpalette.yellowDiscreteSequential.label": "Yellow discrete sequential",
- "sortX.description": "Sorts the line points by x.",
- "sortX.name": "Sort points by x",
- "swapLineColumn.description": "When set to Yes, shows the line chart axis on the left and the column chart axis on the right.",
- "swapLineColumn.falseLabel": "Do not switch",
- "swapLineColumn.name": "Switch line and column axes",
- "swapLineColumn.trueLabel": "Switch",
- "transpose.description": "When set to Yes, the Y-axis shows the independent scale and the X-axis shows the dependent scale.",
- "transpose.falseLabel": "Do not transpose",
- "transpose.name": "Switch X and Y axes",
- "transpose.trueLabel": "Transpose",
- "zoom.description": "Zooms the chart in the X, Y, Y2, or in all directions.",
- "zoom.name": "Zoom",
- "zoom.options.all": "All",
- "zoom.options.none": "None",
- "zoom.options.x": "X",
- "zoom.options.y": "Y",
- "zoom.options.y2": "Y2"
- }
- },{}],3:[function(require,module,exports){
- (function() {
- var $ = {};
- // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModuleHeader
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2015
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- var com_ibm_rave_library_Library = rave["library"];
- rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
- rave["internal"]["CSSUtil"]= rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
- // $source: com/ibm/rave/bundles/RaveBundle
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader (runtime) // new
- /**
- * A RaveBundle extends the regular Bundle abstract class but includes common functionality for Rave-made bundles that aren't for general use.
- */
- var com_ibm_rave_bundles_RaveBundle = rave['internal']['Declare'](rave['library']['internal']['Bundle'], {
- /** @expose */
- loader : null,
- /** @expose */
- constructor : function() {
- ;
- ;
- ;
- ;
- ;
- ;
- this.loader = new com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader("/com/ibm/rave/bundles/" + this.getName());
- },
- /**
- * Load extra resources required for this bundle. Currently the compiled configuration.json file. And .css.
- */
- /** @expose */
- loadResources : function() {
- this.setMessageCatalog(rave['library']['internal']['Bundle'].DEFAULT_LOCALE, require("./i18n/messages_en.json"));
- var array = require("./configuration/configuration.json");
- if (array) {
- for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var artifact = __exp_enFor0[__i_enFor0];
- this.initialize(artifact);
- }
- }
- require("./vizlibrary.css");
- }
- });
- //com_ibm_rave_bundles_RaveBundle.CONFIGURATION_FILE = "./configuration/configuration.json";
- // $source: com/ibm/rave/bundles/internal/nativeImpl/RaveBundleResourceLoader
- // Intentionally empty - everything in this file is inlined
- var com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader = function(){};
- // $source: com/ibm/rave/bundles/views/BundleView
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BackgroundComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/ChartLayoutComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/LegendsManager (runtime) // new
- //@import com/ibm/rave/bundles/components/AxesManager (runtime) // new
- //@import com/ibm/rave/library/Library (runtime) // Library
- //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities
- //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
- //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
- //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
- var com_ibm_rave_bundles_views_BundleView = rave['internal']['Declare'](rave['library']['internal']['AbstractView'], {
- /**
- * Background component
- */
- /** @expose */
- _backgroundComponent : null,
- /**
- * Layout component
- */
- /** @expose */
- _layoutComponent : null,
- /**
- * Clip component
- */
- /** @expose */
- _clip : null,
- /**
- * Axes manager
- */
- /** @expose */
- _axes : null,
- /**
- * Legends manager
- */
- /** @expose */
- _legends : null,
- //_groupStructure : null,
- /** @expose */
- _chart : null,
- /** @expose */
- dataModel : null,
- /** @expose */
- _zoomP : null,
- /** @expose */
- _zoomS : null,
- /** @expose */
- constructor : function(context) {
- },
- /** @expose */
- getGroupStructure : function() {},
- /** @expose */
- setup : function() {
- rave['library']['internal']['AbstractView'].prototype.setup.call(this);
- this._backgroundComponent = new com_ibm_rave_bundles_components_BackgroundComponentImpl();
- this._layoutComponent = new com_ibm_rave_bundles_components_ChartLayoutComponentImpl();
- this._clip = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this.context.instanceId() + "clipViewport");
- if (this.isZoomSupported()) {
- this.resetZoom();
- }
- this._legends = new com_ibm_rave_bundles_components_LegendsManager(this.context, this.getLegendCount());
- if (this.isAxesManagerRequired()) {
- this._axes = new com_ibm_rave_bundles_components_AxesManager(this.context);
- }
- this._groupStructure = this.getGroupStructure();
- },
- /** @expose */
- preDraw : function(chartId) {
- this.cancelTransitions();
- rave['library']['internal']['AbstractView'].createGroupStructure(this.context.node, this._groupStructure);
- this._chart = this.context.node.selectAll(chartId);
- },
- /** @expose */
- resetZoom : function() {
- this._zoomP = [0, 0, 0, 0];
- this._zoomS = [1, 1, 1, 1];
- },
- /** @expose */
- validateDataModel : function(elementsToRemove) {
- if (elementsToRemove !== null || arguments.length > 1){
- elementsToRemove = Array.prototype.slice.call(arguments);
- }
- {
- this.dataModel = this.context.dataModel();
- if (!(this.dataValid())) {
- for (var __i_enFor0 = 0, __len_enFor0 = elementsToRemove.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var e = elementsToRemove[__i_enFor0];
- this._chart.selectAll(e).selectAll("*").remove();
- }
- this._legends.visible(false).draw();
- return false;
- }
- return true;
- }
- },
- /** @expose */
- dataValid : function() {
- return this.dataModel.validate();
- },
- /** @expose */
- getLegendCount : function() {
- return 1;
- },
- /** @expose */
- isAxesManagerRequired : function() {
- return false;
- },
- /** @expose */
- isZoomSupported : function() {
- return true;
- },
- /** @expose */
- getProperty : function(s) {
- return this.context.getPropertyValue(s);
- },
- /** @expose */
- getPropertyDefault : function(s) {
- return this.context.getPropertyDefault(s);
- },
- /** @expose */
- getBooleanProperty : function(s) {
- var obj = this.getProperty(s);
- return (obj);
- },
- /** @expose */
- getDoubleProperty : function(s) {
- var obj = this.getProperty(s);
- return + (obj);
- },
- /** @expose */
- getIntProperty : function(s) {
- var obj = this.getProperty(s);
- return ~~ (obj);
- },
- /**
- * @param (String) id Property ID
- * @return (String) Property value as a string
- */
- /** @expose */
- getStringProperty : function(id) {
- var obj = this.getProperty(id);
- return (obj == null) ? null : ""+(obj);
- },
- /**
- * @param (String) id Property ID
- * @return (String) Property value as a string, returning null for the empty string
- */
- /** @expose */
- getStringPropertyEmptyAsNull : function(id) {
- var s = this.getStringProperty(id);
- return (s == null || s.length == 0) ? null : s;
- },
- /**
- * @param (String) id Property ID
- * @return (Number) Property value as a string, containing size as the number of pixels
- */
- /** @expose */
- getCSSSizeToPixelNumber : function(id) {
- var cssSize = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.context.getPropertyValue(id), 100.0, 10.0);
- return (cssSize == null) ? 0.0 : cssSize;
- },
- /**
- * Based on effect duration and effect property, determine the effect duration in ms.
- * @param (String) effect Effect name, one of the options available from EFFECT_OPTIONS.
- * @return (int) Effect duration in ms.
- */
- /** @expose */
- getEffectDuration : function(effect) {
- var duration = this.getIntProperty("effect.duration");
- if ((duration < 0) || (effect == null) || "none" == effect) {
- duration = 0;
- }
- return duration;
- },
- /** @expose */
- getTopPadding : function() {
- return this.getProperty("layout.chart.padding.top");
- },
- /** @expose */
- getLeftPadding : function() {
- return this.getProperty("layout.chart.padding.left");
- },
- /** @expose */
- getBottomPadding : function() {
- return this.getProperty("layout.chart.padding.bottom");
- },
- /** @expose */
- getRightPadding : function() {
- return this.getProperty("layout.chart.padding.right");
- },
- /** @expose */
- getLayoutPadding : function() {
- return this.getProperty("layout.padding");
- },
- /** @expose */
- getLegendChartGap : function() {
- return this.getProperty("layout.legendchart.gap");
- },
- /** @expose */
- getLegendChartAlign : function() {
- return this.getBooleanProperty("layout.legendchart.align");
- },
- /** @expose */
- getLegendPosition : function() {
- return this.getStringProperty("legend.position");
- },
- getPalette$0 : function() {
- return this.getPalette$1("color.palette");
- },
- getPalette$1 : function(paletteID) {
- var id = this.getStringProperty(paletteID);
- var colorPalette = com_ibm_rave_library_Library.palettes.getPalette(id);
- return (!colorPalette) ? com_ibm_rave_library_Library.palettes.getDefaultPalette() : colorPalette;
- },
- getDynamicPalette$0 : function() {
- return this.getDynamicPalette$1("color.palette", "color.dynamicPalette.min", "color.dynamicPalette.mid", "color.dynamicPalette.max");
- },
- /**
- * Get a palette. If the fills array is non-null, has at least two entries, and all entries are non-null and non-"", a continuous normalized palette will be created using the fill values as stops. For example if the fills array is ["red","white","green"], the palette will have stops at 0.0 red, 0.5 white, 1.0 green. Otherwise the paletteID is looked up in Library.palettes and returned. If the paletteID is not found, the default palette is returned.
- * @param (String) paletteID The palette ID
- * @return (rave['library']['internal']['Palette']) Palette
- */
- getDynamicPalette$1 : function(paletteID, minId, midId, maxId) {
- var colorPalette;
- var min = this.getStringProperty(minId);
- if (min != null) {
- var mid = this.getStringProperty(midId);
- if (mid != null) {
- var max = this.getStringProperty(maxId);
- if (max != null) {
- var fills = [min, mid, max];
- colorPalette = rave['library']['internal']['AbstractView'].getFillPalette(fills);
- }
- }
- }
- return (!colorPalette) ? this.getPalette(paletteID) : colorPalette;
- },
- /** @expose */
- prepareLayoutComponent : function() {
- this._layoutComponent.setPreExecute(this.context.getPreExecute()).overall(new rave['internal']['RectStruct'](0, 0, this.context.size.w, this.context.size.h)).legendPosition(this.getLegendPosition()).padding(this.getLayoutPadding()).chartPadding(this.getTopPadding(), this.getLeftPadding(), this.getBottomPadding(), this.getRightPadding()).legendChartGap(this.getLegendChartGap()).legendChartAlign(this.getLegendChartAlign());
- },
- /** @expose */
- prepareLayoutSizables : function(layoutComponent, useX2, useY1, useX1, useY2, useLegend) {
- layoutComponent.removeAxisSizables();
- if (useX1) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(0));
- }
- if (useY1) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(2));
- }
- if (useX2) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(1));
- }
- if (useY2) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(3));
- }
- layoutComponent.legendSize(useLegend ? this._legends : null);
- },
- /** @expose */
- resetUpdate : function() {
- this.updateType = 4;
- },
- /** @expose */
- isUpdateNothing : function() {
- return this.updateType == 4;
- },
- /** @expose */
- isShowLegend : function() {
- return this.getBooleanProperty("legend.display");
- },
- cancelTransitions : function() {
- this.context.node.selectAll("*").interrupt();
- },
- /** @expose */
- setBackgroundProperties : function(elementRect, duration) {
- this._backgroundComponent.setPreExecute(this.context.getPreExecute()).size(this.context.size).backgroundColor(this.getStringProperty("background.chart.color"));
- this.context.node.selectAll("rect.background.chart").transition().duration(duration).call(this._backgroundComponent);
- this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(elementRect).backgroundColor(this.getStringProperty("background.elements.color"));
- this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
- },
- /** @expose */
- isShowDataLabels : function() {
- return this.getBooleanProperty("data.label.display");
- },
- /** @expose */
- isShowDataLabelsAsPercentageOfColor : function() {
- var dataLabel = this.getStringProperty("data.label.type");
- return "PercentOfColor" == dataLabel;
- },
- /** @expose */
- isShowDataLabelsAsPercentageOfCategory : function() {
- var dataLabel = this.getStringProperty("data.label.type");
- return "PercentOfCategory" == dataLabel;
- },
- /** @expose */
- getlDataLabelAccessor : function(dataSet, slot, isInterval) {
- var labelAccessor;
- var labelEntry = dataSet.slot(slot).entry();
- if (!labelEntry) {
- if (this.isShowDataLabelsAsPercentageOfCategory()) {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR;
- } else if (this.isShowDataLabelsAsPercentageOfColor()) {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR;
- } else {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR;
- }
- } else {
- labelAccessor = rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelEntry));
- }
- return labelAccessor;
- },
- /** @expose */
- getEntryForDataLabelFormatter : function(dataSet, labelSlot, defaultSlot) {
- var labelEntry = dataSet.slot(labelSlot).entry();
- return labelEntry ? labelEntry : dataSet.slot(defaultSlot).entry();
- },
- /** @expose */
- getBackgroundConstrastLabelStyle : function() {
- var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
- if (this.getBooleanProperty("contrast.label.color") == false) {
- return labelFontStyle;
- }
- var defaultFillColor;
- if (labelFontStyle) {
- defaultFillColor = labelFontStyle["fill"];
- if (defaultFillColor == null) {
- defaultFillColor = labelFontStyle["color"];
- }
- } else {
- labelFontStyle = {};
- }
- if (defaultFillColor == null) {
- defaultFillColor = "#000000";
- }
- labelFontStyle["fill"] = com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(this.getStringProperty("background.elements.color"), defaultFillColor);
- return labelFontStyle;
- },
- /** @expose */
- getPalette : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.getPalette$0();
- }
- if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
- return this.getPalette$1(a0);
- }
- return rave['library']['internal']['AbstractView'].prototype.getPalette.apply(this, args);
- },
- /** @expose */
- getDynamicPalette : function(a0, a1, a2, a3) {
- var args = arguments;
- if (args.length == 0) {
- return this.getDynamicPalette$0();
- }
- return this.getDynamicPalette$1(a0, a1, a2, a3);
- }
- });
- // $source: com/ibm/rave/bundles/components/BundleComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_components_BundleComponentImpl = rave['internal']['Declare']({
- /**
- * The pre-execution callback.
- */
- //_preExecuteCallback : null,
- /**
- * The render callback.
- */
- /** @expose */
- _renderCallback : null,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var self = _$self;
- this.each(function(data, index, groupIndex) {
- self.execute(rave.select(this));
- });
- return null;
- }
- };
- return _$self;
- },
- /**
- * Execute the component logic. In general, the execute function will append, modify, and/or remove items contained in the provided selector (g). There are no set rules regarding what the execute function can or can not do. However, it is extremely bad form if a component modifies and/or removes items created by another component.
- * @param (rave['internal']['Selector']) g <g> node that this component will be applied to.
- */
- /** @expose */
- execute : function(g) {},
- /**
- * Set the pre-execute callback for this component.
- * @param (rave['library']['internal']['ComponentCallback']) callback The callback
- */
- /** @expose */
- setPreExecute : function(callback) {
- this._preExecuteCallback = callback;
- return this;
- },
- /**
- * If the pre-execute component is non-null, call it with this object. Note that this object must also implement BundleComponent.
- */
- /** @expose */
- preExecute : function() {
- if (this._preExecuteCallback) {
- this._preExecuteCallback(this);
- }
- },
- /**
- * Set the render callback for this component.
- * @param (rave['internal']['RunFunction']) callback The callback
- */
- /** @expose */
- setRenderCallback : function(callback) {
- this._renderCallback = callback;
- return this;
- },
- /**
- * Abstract method for Swift translation purposes. Swift does not support abstract classes, so translator generates a non-abstract class. By adding the following 'abstract' method, Swift class will satisfy interface requirements.
- */
- /** @expose */
- type : function() {},
- /** @expose */
- updateBorder : function(s, borderWidth, borderColor) {
- if (borderWidth != null) {
- s.each(function(data, index, groupIndex) {
- if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
- this.rave_setStyle("stroke-width", borderWidth, "");
- }
- });
- }
- if (borderColor != null) {
- s.each(function(data, index, groupIndex) {
- if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
- this.rave_setStyle("stroke", borderColor, "");
- }
- });
- }
- },
- /** @expose */
- getDefaultLabelColor : function(_labelStyle) {
- if (!_labelStyle) {
- return "#000000";
- }
- var defaultFillColor;
- if (_labelStyle) {
- defaultFillColor = _labelStyle["fill"];
- if (defaultFillColor == null) {
- defaultFillColor = _labelStyle["color"];
- }
- }
- if (defaultFillColor == null) {
- defaultFillColor = "#000000";
- }
- return defaultFillColor.toString();
- }
- });
- // $source: com/ibm/rave/bundles/component/BackgroundComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders the background to the chart. The {@link #this.type()} method returns "BackgroundComponent". </p>
- */
- var com_ibm_rave_bundles_component_BackgroundComponent = rave['internal']['Declare'].implement(
- /**
- * Get the background color.
- * @return (String) The background color
- */
- //backgroundColor : function() {},
- /**
- * Set the background color. If the color is null, white is used.
- * @param (String) backgroundColor The new background color
- * @return (com.ibm.rave.bundles.component.BackgroundComponent) This object
- */
- //backgroundColor : function(backgroundColor) {}
- );
- /**
- * The string returned by {@link #this.type()} is "BackgroundComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE = "BackgroundComponent";
- // $source: com/ibm/rave/bundles/component/ChartLayoutComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that does the layout for a bundle chart. The {@link #this.type()} method returned "ChartLayoutComponent". </p> <h3>Layout Properties</h3> <p> Chart layout is controlled by the following properties: </p> <ul> <li>The padding: a string containing up to 4 CSS sizes for left, top, right, bottom padding (eg. "padding-left:10px;padding-top:10%").</li> <li>The legend chart gap: a single CSS size.</li> <li>The legends position: a string, one of "top", "bottom", "left", or "right".</li> <li>The legends size: a {@link (com.ibm.rave.bundles.component.ChartLayoutSizable) ChartLayoutSizable} .</li> <li>The four axis sizes for top, bottom, left, and right: each a {@link (com.ibm.rave.bundles.component.ChartLayoutSizable) ChartLayoutSizable} .</li> </ul>
- */
- var com_ibm_rave_bundles_component_ChartLayoutComponent = rave['internal']['Declare'].implement(
- //padding : function() {},
- //topPadding : function() {},
- //leftPadding : function() {},
- //bottomPadding : function() {},
- //rightPadding : function() {},
- //legendChartAlign : function() {},
- //legendPosition : function() {},
- //legendChartGap : function() {},
- //legendPosition : function(position) {},
- //topPadding : function(value) {},
- //leftPadding : function(value) {},
- //bottomPadding : function(value) {},
- //rightPadding : function(value) {},
- /**
- * Sets the padding around the outside of the chart/legend.
- * @param (Object) value a string containing up to 4 CSS sizes for left, top, right, bottom padding (eg. "padding-left:10px;padding-top:10%"). Null is treated as 0.
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //padding : function(value) {},
- /**
- * Sets all chart paddings. Null values are treated as 0.
- * @param (Object) top New top padding
- * @param (Object) left New left padding
- * @param (Object) bottom New bottom padding
- * @param (Object) right New right padding
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- * @deprecated Please use {@link #this.padding(Object)} and {@link #this.legendChartGap(Object)}
- */
- //chartPadding : function(top, left, bottom, right) {},
- /**
- * Sets whether the legend should align with the chart "body".
- * @param (boolean) legendChartAlign the boolean state
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //legendChartAlign : function(legendChartAlign) {},
- /**
- * Set the space for the gap between chart and legend
- * @param (Object) value the gap distance (css length)
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //legendChartGap : function(value) {},
- /**
- * Set the size information for the legend. Null value is treated as no visible legend.
- * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //legendSize : function(sizable) {},
- /**
- * Reset list of axis sizables to 0
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //removeAxisSizables : function() {},
- /**
- * Add an axis to be considered in layout operation.
- * @param (com.ibm.rave.bundles.component.ChartLayoutSizable) sizable An object that implements the ChartLayoutSizable interface
- * @return (com.ibm.rave.bundles.component.ChartLayoutComponent) This object
- */
- //addAxisSizable : function(sizable) {}
- );
- /**
- * The string returned by {@link #this.type()} is "ChartLayoutComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE = "ChartLayoutComponent";
- // $source: com/ibm/rave/bundles/components/LegendsManager
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/LegendComponentImpl (runtime) // new, orientationOf
- /**
- * <p> Manages one or more legend components for a bundle. The number of legends N is fixed and declared in the constructor, and legends are identified by an array index number between 0 and N-1. (For now we don't need a dynamic collection, especially since we're generating the chart structure statically and each legend gets its own <g&;gt; node. If a chart sometimes needs one legend and sometimes two, it will create two nodes and construct the manager for two legends.) </p> <p> The manager has the following properties: </p> <ul> <li> A global visibility flag. If false, the legends are not drawn (all shapes are cleared from the groups). </li> <li> A rectangle in which the legends are positioned. If a bundle wants (for example) some legends on the left and some on the right of a chart, it should create two LegendsManagers. </li> <li> An orientation, either "horizontal" or "vertical" (the default). </li> <li> Whether to use a transition, and if so the transition duration. </li> <li> The pre-execute component callback. </li> </ul> <p> Each legend has the following properties: </p> <ul> <li> A group (<g> node) selector into which it draws. For correct behavior this should always be non-null and select the same chart group, since the legend is responsible for removing shapes when it is not shown. This should be an ordinary selector, not a transition. </li> <li> A color palette. If the palette is null the legend is not visible. </li> <li> A swatch shape. If null, square is used. This only applies to swatch legends. </li> <li> A title. If null the legend has no title. </li> <li> A custom formatter for the labels. If null the default format is used. </li> </ul> <p> The general pattern of use is to create the LegendsManager in the view's constructor or setup method, allocating the maximum number of legends that will ever be needed. The chart structure will have corresponding <g> nodes, and in the view's draw method all the legend selectors are set to the corresponding group. The legend palettes, titles, and formatters will usually be set next, making sure to set the palettes of any unused legends to null, and {@link #this.anyVisible()} used to find if any rectangles need to be drawn so the overall chart may be laid out. The rectangle, orientation, and transition information can then be set and {@link #this.draw()} called. </p> <p> The visible legends (those with palettes) divide the rectangle equally along the orientation. For example if there are three legends in horizontal orientation and two are visible, they will split the rectangle vertically in half. Legends are drawn left-to-right for horizontal orientation, and top-to-bottom for vertical orientation, in index order. </p> <p> If a transition is requested and the duration is non-negative, a transition is created from the legend's selector; otherwise the selector is used. However, in order to give a somewhat better appearance, a transition is <I>not</I> used if the legend was not visible (no shapes rendered) the last time it was drawn. </p>
- */
- var com_ibm_rave_bundles_components_LegendsManager = rave['internal']['Declare']({
- /**
- * Bundle context
- */
- //_context : null,
- /**
- * Component used to draw all legends
- */
- //_comp : null,
- /**
- * Global visibility; if false no legends are drawn
- */
- //_visible : null,
- /**
- * Rectangle containing all legends
- */
- //_rectangle : null,
- /**
- * Legend orientation
- */
- //_orient : null,
- /**
- * Pre-execute component callback
- */
- //_preExecute : null,
- /**
- * Selectors for each legend
- */
- //_selectors : null,
- /**
- * Palettes for each legend
- */
- //_palettes : null,
- /**
- * Scale size functions for each legend
- */
- //_scale : null,
- /**
- * Swatch size functions for each legend
- */
- //_swatchSizes : null,
- /**
- * Shapes for each legend
- */
- //_shapes : null,
- /**
- * Titles for each legend
- */
- //_titles : null,
- /**
- * Title fonts for each legend
- */
- //_titleFonts : null,
- /**
- * Title fills for each legend
- */
- //_titleFills : null,
- /**
- * Title font sizes for each legend
- */
- //_titleFontSizes : null,
- /**
- * Title font families for each legend
- */
- //_titleFontFamilies : null,
- /**
- * Entry fonts for each legend
- */
- //_entryFonts : null,
- /**
- * Custom formatters for each legend, created from the registered custom formatters
- */
- //_formatters : null,
- /**
- * Whether each legend was visible in the last draw
- */
- //_lastVisible : null,
- //_dataSlotEntries : null,
- /**
- * Number of legends
- */
- _numLegends : 0,
- /**
- * Whether to use a transition.
- */
- _doTransition : false,
- /**
- * Duration of the transition.
- */
- _duration : 0,
- _spaceUsed : 0,
- /**
- * Construct the manager.
- * @param (int) numLegends Number of legends, must be positive
- */
- /** @expose */
- constructor : function(context, numLegends) {
- this._context = context;
- this._numLegends = numLegends;
- this._comp = new com_ibm_rave_bundles_components_LegendComponentImpl();
- this._rectangle = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._orient = "vertical";
- this._preExecute = null;
- this._selectors = [];
- this._palettes = [];
- this._scale = [];
- this._swatchSizes = [];
- this._shapes = [];
- this._titles = [];
- this._titleFonts = [];
- this._titleFills = [];
- this._titleFontSizes = [];
- this._titleFontFamilies = [];
- this._entryFonts = [];
- this._formatters = [];
- this._lastVisible = [];
- this._visible = [];
- this._dataSlotEntries = [];
- for (var i = 0; i < this._numLegends; ++i) {
- this._selectors[i] = null;
- this._palettes[i] = null;
- this._swatchSizes[i] = null;
- this._shapes[i] = null;
- this._titles[i] = null;
- this._formatters[i] = null;
- this._lastVisible[i] = false;
- this._visible[i] = true;
- }
- },
- /**
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) The legend component used by this manager; for unit tests
- */
- getLegendComponent : function() {
- return this._comp;
- },
- /**
- * Set a specific legend visible
- * @param (int) legendIndex The index of the legend
- * @param (boolean) visible New value of visible flag
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- visible$0 : function(legendIndex, visible) {
- if (legendIndex < this._visible.length) {
- this._visible[legendIndex] = visible;
- }
- return this;
- },
- /**
- * Set all legend visible
- * @param (boolean) visible New value of visible flag
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- visible$1 : function(visible) {
- for (var i = 0; i < this._visible.length; ++i) {
- this._visible[i] = visible;
- }
- return this;
- },
- /**
- * Set the layout rectangle. The rectangle is copied. If it is null, the layout rectangle is unchanged.
- * @param (rave['internal']['RectStruct']) rect New layout rectangle
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- rectangle : function(rect) {
- if (rect) {
- this._rectangle = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
- }
- return this;
- },
- /**
- * Set the orient property. If the argument is not "horizontal" or "vertical", the orient property is not changed.
- * @param (String) orient New orient
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- orient : function(orient) {
- if ("horizontal" == orient || "vertical" == orient) {
- this._orient = orient;
- }
- return this;
- },
- /**
- * Set the orient property from a legend position. If the argument is "top" or "bottom", the orient is set to "horizontal". Otherwise it is set to "vertical".
- * @param (String) position Legend position
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- position : function(position) {
- return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
- },
- /**
- * Set the transition information. If the duration is negative, 0 is used.
- * @param (boolean) doTransition Whether to do a transition
- * @param (int) duration Duration of the transition when used
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- transition : function(doTransition, duration) {
- this._doTransition = doTransition;
- this._duration = (duration >= 0) ? duration : 0;
- return this;
- },
- /**
- * Set the pre-execute callback for all legends. The callback may be null.
- * @param (rave['library']['internal']['ComponentCallback']) callback The callback
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- setPreExecute : function(callback) {
- this._preExecute = callback;
- return this;
- },
- /**
- * Set the selector to be used when rendering a legend. If the index is out of range no selectors change.
- * @param (int) index Legend array index
- * @param (rave['internal']['Selector']) selector Selector, may be null (but this is not advisable)
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- selector : function(index, selector) {
- if (index >= 0 && index < this._numLegends) {
- this._selectors[index] = selector;
- }
- return this;
- },
- /**
- * Set the palette of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (rave['library']['internal']['Palette']) palette Palette, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- palette : function(index, palette) {
- if (index >= 0 && index < this._numLegends) {
- this._palettes[index] = palette;
- }
- return this;
- },
- /**
- * Set the shape of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) shape Shape, may be null (defaulting to square)
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- shape : function(index, shape) {
- if (index >= 0 && index < this._numLegends) {
- this._shapes[index] = shape;
- }
- return this;
- },
- /**
- * Set the title of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) title Title, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- title : function(index, title) {
- if (index >= 0 && index < this._numLegends) {
- this._titles[index] = title;
- }
- return this;
- },
- /**
- * Set the title font style of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFont Title font string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFont : function(index, titleFont) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFonts[index] = titleFont;
- }
- return this;
- },
- /**
- * Set the entry font style of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) entryFont Entry font string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- entryFont : function(index, entryFont) {
- if (index >= 0 && index < this._numLegends) {
- this._entryFonts[index] = entryFont;
- }
- return this;
- },
- /**
- * Set the title fill of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFill Fill color string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFill : function(index, titleFill) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFills[index] = titleFill;
- }
- return this;
- },
- /**
- * Set the title font size of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFontSize Font size string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFontSize : function(index, titleFontSize) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFontSizes[index] = titleFontSize;
- }
- return this;
- },
- /**
- * Set the title font family of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (String) titleFontFamily Font family string, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- titleFontFamily : function(index, titleFontFamily) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFontFamilies[index] = titleFontFamily;
- }
- return this;
- },
- /**
- * Set the scale of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (rave['internal']['AbstractScale']) scale Scale, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- scale : function(index, scale) {
- if (index >= 0 && index < this._numLegends) {
- this._scale[index] = scale;
- }
- return this;
- },
- /**
- * Set the swatch size function of a legend. If the index is out of range no information is changed.
- * @param (int) index Legend array index
- * @param (rave['internal']['ValueFunction']) swatchSize Swatch size function, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- swatchSize : function(index, swatchSize) {
- if (index >= 0 && index < this._numLegends) {
- this._swatchSizes[index] = swatchSize;
- }
- return this;
- },
- /**
- * Set the formatter for a legend. If the index is out of range no information is changed. The custom formatter is found using {@link this.BundleContext#this.getCustomFormatterWithFlag(, rave['library']['internal']['CustomFormatInfo'], rave['internal']['ValueFunction'], )} , searching for formatters in the order LEGEND and ALL, and using the given ValueFunction as the default if none are provided. The returned value function is set as the legend's formatter.
- * @param (int) index Legend array index
- * @param (Array) entries List of data slot entries, if null an empty list is used
- * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
- * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined, may be null
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- formatterList : function(index, entries, format, defaultFunction) {
- if (index >= 0 && index < this._numLegends) {
- this._formatters[index] = this._context.getCustomFormatterWithFlag(["legend", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("legend-label", "ROLE_NONE", format, entries), defaultFunction, false);
- }
- return this;
- },
- /**
- * Utility for the common case where there is only one data slot entry, using no special format or default function. Makes a list with the entry and calls {@link #this.formatterList(, Array, String, rave['internal']['ValueFunction'])} with FORMAT_NONE and a null default function.
- * @param (int) index Legend array index
- * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- formatter : function(index, entry) {
- var entries = [];
- if (entry) {
- entries.push(entry);
- }
- return this.formatterList(index, entries, "none", null);
- },
- /**
- * Test if any legends are visible. The global visible flag must be true, and at least one legend must have a palette. This is intended to help with layout of the whole chart; first set all the legend properties, then allocate space if any are visible.
- * @return (boolean) Whether any legend are visible (will be drawn)
- */
- /** @expose */
- anyVisible : function() {
- for (var i = 0; i < this._numLegends; ++i) {
- if (this._visible[i] == true && (this._palettes[i] || this._swatchSizes[i])) {
- return true;
- }
- }
- return false;
- },
- /**
- * Supply a data slot entry to be associated with the specified legend index. Note this method will call {@link #this.formatter(, rave['library']['internal']['DataSlotEntry'])} , which will handle a default formatter. For more info, see {@link #this.formatterList(, Array, String, rave['internal']['ValueFunction'])} .
- * @param (int) index Legend array index
- * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
- * @return (com.ibm.rave.bundles.components.LegendsManager) This LegendsManager
- */
- /** @expose */
- setDataSlot : function(index, entry) {
- if (index >= 0 && index < this._numLegends) {
- this._dataSlotEntries[index] = entry;
- }
- return this.formatter(index, entry);
- },
- preLayout$0 : function(layoutComponent) {
- this.preLayout$1(layoutComponent, true);
- return this;
- },
- preLayout$1 : function(layoutComponent, axesBeforeLegend) {
- var layoutTransition = this._doTransition;
- var layoutDuration = this._duration;
- this._doTransition = false;
- this._duration = 0;
- var children = [];
- for (var i = 0; i < this._numLegends; ++i) {
- children[i] = "g.layoutLegend-" + i;
- }
- rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.legends-layout"), children);
- var layoutSelectors = [];
- var layoutLastVisible = [];
- for (var i = 0; i < this._numLegends; ++i) {
- layoutSelectors[i] = this._selectors[i];
- layoutLastVisible[i] = this._lastVisible[i];
- this._lastVisible[i] = false;
- if (this._selectors[i]) {
- this._selectors[i] = this._context.node.select("g.layoutLegend-" + i);
- }
- }
- layoutComponent.preLayout(true, !axesBeforeLegend);
- this.rectangle(layoutComponent.legendRect());
- this.draw();
- this._doTransition = layoutTransition;
- this._duration = layoutDuration;
- this._context.node.select("g.legends-layout").selectAll("*").remove();
- for (var i = 0; i < this._numLegends; ++i) {
- this._lastVisible[i] = layoutLastVisible[i];
- this._selectors[i] = layoutSelectors[i];
- }
- return this;
- },
- /**
- * Render the legends using the current global and per-legend settings.
- * @return (com.ibm.rave.bundles.components.LegendsManager) This object
- */
- /** @expose */
- draw : function() {
- var nVisible = 0;
- for (var i = 0; i < this._numLegends; ++i) {
- if ((this._swatchSizes[i] || this._palettes[i]) && this._visible[i]) {
- nVisible++;
- }
- }
- var x = this._rectangle.x;
- var y = this._rectangle.y;
- var dx;
- var dy;
- var size;
- if (nVisible == 0) {
- dx = 0;
- dy = 0;
- size = [this._rectangle.width, this._rectangle.height];
- } else if ("horizontal" == this._orient) {
- dx = this._rectangle.width / nVisible;
- dy = 0;
- size = [dx, this._rectangle.height];
- } else {
- dx = 0;
- dy = this._rectangle.height / nVisible;
- size = [this._rectangle.width, dy];
- }
- this._comp.orient(this._orient).size(size);
- this._spaceUsed = 0;
- for (var i = 0; i < this._numLegends; ++i) {
- if (this._selectors[i]) {
- var visible = this._visible[i] && (this._palettes[i] || this._swatchSizes[i]);
- this._comp.visible(visible).colorPalette(this._palettes[i]).orient(this._orient).setPreExecute(this._preExecute).shape(this._shapes[i] != null ? this._shapes[i] : "square").title(this._titles[i]).titleFill(this._titleFills[i]).titleFontSize(this._titleFontSizes[i]).titleFontFamily(this._titleFontFamilies[i]).labelFormat(this._formatters[i]).swatchSize(this._swatchSizes[i]).scale(this._scale[i]);
- var fontStyle = this._context.getPropertyValue("legend.titlestyle.font");
- if (this._titleFonts[i] != null && !(this._titleFonts[i] == "")) {
- this._comp.titleFont(this._titleFonts[i]);
- } else if (fontStyle != null && !(fontStyle == "")) {
- this._comp.titleFont(this._context.getPropertyValue("legend.titlestyle.font"));
- }
- fontStyle = this._context.getPropertyValue("legend.entrystyle.font");
- if (this._entryFonts[i] != null) {
- this._comp.entryFont(this._entryFonts[i]);
- } else if (fontStyle != null && !(fontStyle == "")) {
- this._comp.entryFont(this._context.getPropertyValue("legend.entrystyle.font"));
- }
- var s = (this._doTransition && this._lastVisible[i]) ? this._selectors[i].transition("transition").duration(this._duration) : this._selectors[i];
- s.attr("transform", "translate(" + x + "," + y + ")").call(this._comp);
- var dataSlotEntries = [];
- if (this._dataSlotEntries[i]) {
- dataSlotEntries.push(this._dataSlotEntries[i]);
- }
- this._selectors[i].selectAll(".legendTitle").property("dataSlots", dataSlotEntries);
- if (visible) {
- x += dx;
- y += dy;
- if (this._comp.getSpaceUsed() > this._spaceUsed) {
- this._spaceUsed = this._comp.getSpaceUsed();
- }
- }
- this._lastVisible[i] = visible;
- } else {
- this._lastVisible[i] = false;
- }
- }
- return this;
- },
- /** @expose */
- getSizableType : function() {
- return 2;
- },
- /** @expose */
- getSizableOrientation : function() {
- return this._orient;
- },
- /** @expose */
- getPreferredSize : function() {
- return this._spaceUsed;
- },
- /** @expose */
- getSpillOverSize : function() {
- return 0;
- },
- /** @expose */
- visible : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.visible$1(a0);
- }
- return this.visible$0(a0, a1);
- },
- /** @expose */
- preLayout : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.preLayout$0(a0);
- }
- return this.preLayout$1(a0, a1);
- }
- });
- // $source: com/ibm/rave/bundles/utilities/FontPropertyParser
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_utilities_FontPropertyParser = rave['internal']['Declare']({
- });
- /**
- * Method to parse the css font styles and return a style map.
- * @param (String) fontStyle CSS string (eg. "font-family: courier; font-size: 22; fill: red")
- * @return (Object) Font Style Map
- */
- /** @expose */
- com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont = function(fontStyle) {
- if (fontStyle != null && fontStyle.length > 0) {
- var properties = fontStyle.split(new RegExp(";"));
- var fontStyles = {};
- for (var __i_enFor0 = 0, __len_enFor0 = properties.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var property = properties[__i_enFor0];
- var fontMap = property.split(new RegExp(":"));
- if (fontMap.length == 2) {
- var key = fontMap[0].trim();
- fontStyles[key == "color" ? "fill" : key] = fontMap[1].trim();
- }
- }
- return fontStyles;
- }
- return null;
- };
- // $source: com/ibm/rave/bundles/components/AxesManager
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/AxisComponentImpl (runtime) // new, getTranslation
- //@import com/ibm/rave/bundles/components/GridComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/ClipPathComponentImpl (runtime) // new
- /**
- * <p> Managers the axes and gridlines for a bundle. The manager handles rectangular axes, where the axes are drawn to the top, bottom, left, and/or right of a central chart. The manager does not do the layout of axes or the setup of scales. Bundle views will normally create an instance in the setup method, then set properties in their draw method and call {@link #this.draw()} to render all the axes and gridlines (including setting the transforms and clip paths on the groups). </p> <p> The manager has four axes and four gridlines, identified by the logical roles X1, X2, Y1, Y2. These corresponding to the constants in the {@link (com.ibm.rave.bundles.component.AxisComponent) AxisComponent} API. The X roles are the independent axes and the Y roles are the dependent axes. The manager will create an instance of the {@link (com.ibm.rave.bundles.components.AxisComponentImpl) AxisComponentImpl} or {@link (com.ibm.rave.bundles.components.GridComponentImpl) GridComponentImpl} for each role as it is required. </p> <p> The manager has four group (<g>) selectors for axes and four for gridlines, identified by their geometric positions top, bottom, left, and right. In bundles the group structure is created when the bundle first runs, so these selectors can in theory be set just once. </p> <p> Note that the axes and grids are identified logically, while the groups are identified geometrically. By default X1 is the bottom group, X2 the top, Y1 the left, and Y2 the right. This association is controlled by properties which transpose and/or flip the assignments. This is in part a RAVE/D3 requirement, since the core Axis examines the shapes in the group to generate transitions. </p> <p> The group selectors should be ordinary selectors. If a transition is requested and the transition duration is non-negative, the manager creates transitions from the selectors. However in order to give a somewhat better appearance, the manager keeps track of whether shapes were drawn into the group on the previous execution, and a transition is not used if the group was not used. </p> <h3>Properties</h3> <p> The manager has the following overall properties: </p> <ul> <li> The bundle context, set by the constructor. This is used to get the pre-execution callbacks and the custom formatters. </li> <li> A global visibility flag. If false, the axes and grids are not drawn (all shapes are cleared from all groups). </li> <li> Whether to use a transition and the transition duration. </li> <li> A selector for the definitions node used to create clip paths. </li> <li> The elements rectangle. This is the rectangle for the center area surrounded by the axis rectangles. </li> </ul> <p> The manager has the following per-<I>role</I> (X1, X2, Y1, Y2) properties: </p> <ul> <li> The scale for that role. If null, neither the axis nor the grid can be drawn and any shapes in the groups will be removed. </li> <li> Whether to suppress (not draw) labels for that role when redrawing during a pan. By default this is false for all axes. TODO: change defaults depending on story 24882. </li> <li> An {@link (com.ibm.rave.bundles.components.AxisComponentImpl) AxisComponentImpl} for the role. Views use this component to set the axis drawing properties (see below). This is created on-demand, generally when a view first requests it, and the same component will be reused for that role thereafter. </li> <li> An {@link (com.ibm.rave.bundles.components.GridComponentImpl) GridComponentImpl} for the role. Views use this component to set the grid drawing properties (see below). This is created on-demand, generally when a view first requests it, and the same component will be reused for that role thereafter. </li> </ul> <p> The manager has the following per-<I>position</I> (bottom, top, left, right) properties: </p> <li> A group (<g> node) selector for the axis. If null, neither the axis nor the corresponding grid are drawn. </li> <li> The bounds rectangle for the axis. </li> <li> A group (<g> node) selector for the grid. If null, the corresponding grid is not drawn. </li> </ul> <h3>Components</h3> <p> An {@link (com.ibm.rave.bundles.components.AxisComponentImpl) AxisComponentImpl} and {@link (com.ibm.rave.bundles.components.GridComponentImpl) GridComponentImpl} can be obtained for each role. These instances are created on demand, usually when a view requests the instance, but also if the manager is drawing and detects that the instance is needed. Once created the instance will be used by the manager thereafter. </p> <p> Views should use these instances to configure the appearance properties of the axes and grids. </p> <p> All other properties (such as scale, bounds, orient, role, and pre-execution callback) are set by the AxesManager. Views can set these properties but the manager's {@link #this.draw()} method will change the settings. Values for some of these properties (e.g. scale and bounds) are set in the manager by the view, and the others are found automatically by the manager. </p>
- */
- var com_ibm_rave_bundles_components_AxesManager = rave['internal']['Declare']({
- /**
- * Bundle context
- */
- //_context : null,
- /**
- * Selector for the bundle defs node. If null, no clip paths will be defined.
- */
- //_defs : null,
- /**
- * Scales for the axes, indexed by X1, X2, Y1, Y2
- */
- //_scales : null,
- /**
- * Whether to suppress labels when panning, indexed by X1, X2, Y1, Y2.
- */
- //_suppressPanLabels : null,
- /**
- * Value of the axis drawAxisLabels, set when axis is drawn, indexed by X1, X2, Y1, Y2.
- */
- //_drawAxisLabels : null,
- /**
- * Axis components created on demand, indexed by X1, X2, Y1, Y2
- */
- //_axisComponents : null,
- /**
- * When last drawn, the selector used for each axis role, indexed by X1, X2, Y1, Y2; used for redraws.
- */
- //_lastAxisDrawSelectors : null,
- /**
- * Grid components created on demand, indexed by X1, X2, Y1, Y2
- */
- //_gridComponents : null,
- /**
- * When last drawn, the selector used for each grid role, indexed by X1, X2, Y1, Y2; used for redraws.
- */
- //_lastGridDrawSelectors : null,
- /**
- * For clearing axis
- */
- //_clearAxis : null,
- /**
- * For clearing grid
- */
- //_clearGrid : null,
- /**
- * Selectors for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_axisSelectors : null,
- /**
- * Selectors for the grid groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_gridSelectors : null,
- /**
- * Bounding rectangles for the axis groups, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_axisRects : null,
- /**
- * Center elements bounds, also the grid bounds.
- */
- //_elementRect : null,
- /**
- * Whether anything was drawn into the axis group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_lastAxisDrew : null,
- /**
- * Whether anything was drawn into the grid group last time, indexed by TOP, BOTTOM, LEFT, RIGHT.
- */
- //_lastGridDrew : null,
- //_dataSlotEntries : null,
- //_layoutAxisOrder : null,
- /**
- * On the first draw, no transitions are used.
- */
- _firstDraw : false,
- /**
- * Whether to draw the axes and grids.
- */
- _visible : true,
- /**
- * Transition duration, ms
- */
- _duration : 0,
- /**
- * Transpose the axes (assign X to left/right and Y to top/bottom)
- */
- _transpose : false,
- /**
- * Switch the independent (X) axes, drawing X1 where X2 normally goes and vice-versa
- */
- _swapX : false,
- /**
- * Switch the dependent (Y) axes, drawing Y1 where Y2 normally goes and vice-versa
- */
- _swapY : false,
- _layoutInProgress : false,
- _layoutMaxWidth : 0,
- _layoutMaxHeight : 0,
- _xPadding : 0, _xOuterPadding : 0, _yPadding : 0, _yOuterPadding : 0,
- _xPixelPad : 0, _yPixelPad : 0,
- /**
- * Hack to allow heatmap in "unit cell" mode to disable stagger because of the post scaling that messes up axis layout
- */
- _preventStaggerRotate45 : false,
- constructor : function(context) {
- this._scales = [];
- this._suppressPanLabels = [];
- this._drawAxisLabels = [];
- this._axisComponents = [];
- this._lastAxisDrawSelectors = [];
- this._gridComponents = [];
- this._lastGridDrawSelectors = [];
- this._clearAxis = new com_ibm_rave_bundles_components_AxisComponentImpl();
- this._clearGrid = new com_ibm_rave_bundles_components_GridComponentImpl();
- this._axisSelectors = [];
- this._gridSelectors = [];
- this._axisRects = [];
- this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._lastAxisDrew = [];
- this._lastGridDrew = [];
- this._dataSlotEntries = [];
- this._layoutAxisOrder = [];
- /**
- * Construct and initialize. No axis scales or selector groups are defined.
- * @param (rave['library']['internal']['BundleContext']) context The bundle context
- */
- {
- this._context = context;
- for (var i = 0; i < 4; ++i) {
- this._scales[i] = null;
- this._suppressPanLabels[i] = false;
- this._axisComponents[i] = null;
- this._lastAxisDrawSelectors[i] = null;
- this._gridComponents[i] = null;
- this._lastGridDrawSelectors[i] = null;
- this._axisSelectors[i] = null;
- this._gridSelectors[i] = null;
- this._axisRects[i] = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._lastAxisDrew[i] = false;
- this._lastGridDrew[i] = false;
- this._dataSlotEntries[i] = [];
- }
- }
- },
- /** @expose */
- preLayout : function(layoutComponent, axesBeforeLegend, xPadding, xOuterPadding, xPixelPad, yPadding, yOuterPadding, yPixelPad) {
- this._xPadding = xPadding;
- this._xOuterPadding = xOuterPadding;
- this._xPixelPad = xPixelPad;
- this._yPadding = yPadding;
- this._yOuterPadding = yOuterPadding;
- this._yPixelPad = yPixelPad;
- this._layoutInProgress = true;
- var layoutDuration = this._duration;
- this._duration = 0;
- var children = ["g.layoutAxis-bottom", "g.layoutAxis-top", "g.layoutAxis-left", "g.layoutAxis-right", "g.layoutGrid-bottom", "g.layoutGrid-top", "g.layoutGrid-left", "g.layoutGrid-right"];
- rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.axes-layout"), children);
- var layoutAxisSelectors = [];
- var layoutGridSelectors = [];
- var layoutLastAxisDrew = [];
- for (var position = 0; position < 4; ++position) {
- if (this._axisComponents[position]) {
- this._axisComponents[position].preLayout();
- }
- layoutAxisSelectors[position] = this._axisSelectors[position];
- layoutGridSelectors[position] = this._gridSelectors[position];
- layoutLastAxisDrew[position] = this._lastAxisDrew[position];
- if (this._axisSelectors[position]) {
- this.axisSelector(position, this._context.node.select("g.layoutAxis-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
- }
- if (this._gridSelectors[position]) {
- this.gridSelector(position, this._context.node.select("g.layoutGrid-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
- }
- }
- layoutComponent.preLayout(axesBeforeLegend, true);
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutComponent.elementRect());
- var countHorz = 0;
- var countVert = 0;
- var axes = [];
- for (var position = 0; position < 4; ++position) {
- var role = this.positionToRole(position);
- var isHorz = position == 1 || position == 0;
- if (this._axisSelectors[position] && this._scales[role]) {
- if (isHorz) {
- countHorz++;
- } else {
- countVert++;
- }
- if (this._scales[role].isOrdinal() || this._scales[role].isClustered()) {
- var score = isHorz ? 4 : 2;
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
- } else {
- var score = isHorz ? 3 : 1;
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
- }
- } else {
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, 5));
- }
- }
- axes.sort(function(a1, a2) {
- var a1value = a1.score;
- var a2value = a2.score;
- return a1value < a2value ? -1 : a1value > a2value ? 1 : 0;
- });
- this._layoutAxisOrder = [];
- for (var i = 0; i < 4; ++i) {
- this._layoutAxisOrder[i] = axes[i].position;
- }
- this._layoutMaxWidth = this._elementRect.width * (countVert > 1 ? 0.5 : 0.4);
- this._layoutMaxHeight = this._elementRect.height * (countHorz > 1 ? 0.5 : 0.4);
- for (var index = 0; index < 4; ++index) {
- var position = this._layoutAxisOrder[index];
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], this._elementRect);
- }
- this.draw();
- this._duration = layoutDuration;
- this._context.node.select("g.axes-layout").selectAll("*").remove();
- for (var position = 0; position < 4; ++position) {
- this._lastAxisDrew[position] = layoutLastAxisDrew[position];
- this._axisSelectors[position] = layoutAxisSelectors[position];
- this._gridSelectors[position] = layoutGridSelectors[position];
- }
- this._layoutInProgress = false;
- return this;
- },
- getPositionToDraw : function(index) {
- return this._layoutInProgress ? this._layoutAxisOrder[index] : index;
- },
- preDrawAxis : function(index) {
- if (this._layoutInProgress) {
- var position = this._layoutAxisOrder[index];
- var role = this.positionToRole(position);
- if (role == 0 || role == 1) {
- this.setScaleRangePadded(this._scales[role], false, this._xPadding, this._xOuterPadding, this._xPixelPad);
- } else {
- this.setScaleRangePadded(this._scales[role], true, this._yPadding, this._yOuterPadding, this._yPixelPad);
- }
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(true);
- }
- },
- postDrawAxis : function(index) {
- if (this._layoutInProgress) {
- var position = this._layoutAxisOrder[index];
- var role = this.positionToRole(position);
- var axis = this._axisComponents[role];
- var size = axis.getPreferredSize();
- if (position == 1 || position == 0) {
- if (size > this._layoutMaxHeight) {
- size = this._layoutMaxHeight;
- }
- this._elementRect.height -= size;
- if (position == 1) {
- this._elementRect.y += size;
- }
- } else {
- if (size > this._layoutMaxWidth) {
- size = this._layoutMaxWidth;
- }
- this._elementRect.width -= size;
- if (position == 2) {
- this._elementRect.x += size;
- }
- }
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
- }
- },
- /**
- * Draw the axes and grids. This will set all the properties of the axes and grids, including the transforms and clip paths, then draw the shapes using a transition if required. Use {@link #this.redraw()} to simply re-render the shapes, for example when zooming.
- */
- /** @expose */
- draw : function() {
- for (var role = 0; role < 4; ++role) {
- this._lastAxisDrawSelectors[role] = null;
- this._lastGridDrawSelectors[role] = null;
- }
- for (var index = 0; index < 4; ++index) {
- var position = this.getPositionToDraw(index);
- var role = this.positionToRole(position);
- if (!this._visible || !this._axisSelectors[position] || !this._scales[role]) {
- this.clearAxis(position);
- this.clearGrid(position);
- } else {
- this.preDrawAxis(index);
- this.drawAxis(position, role);
- this.postDrawAxis(index);
- if (this._gridSelectors[position]) {
- this.drawGrid(position, role);
- }
- }
- }
- this._firstDraw = false;
- },
- /**
- * @return (boolean) true if we are hiding any labels during pan-zoom.
- */
- /** @expose */
- hideAnyPanZoom : function() {
- return (this._suppressPanLabels[0] || this._suppressPanLabels[1] || this._suppressPanLabels[2] || this._suppressPanLabels[3]);
- },
- /**
- * Redraw all the axes and grids used in the last call to {@link #this.draw()} , rendering the shapes into the same selector groups as used then. The component properties, transforms, and clip paths are not reset, and no transitions are used. This should be used for pan-zoom and may be used for other redraw events.
- * @param (boolean) panning Whether this is a pan in-progress; use false otherwise including when pan-zoom ends.
- */
- /** @expose */
- redraw : function(panning) {
- for (var role = 0; role < 4; ++role) {
- if (this._axisComponents[role] && this._lastAxisDrawSelectors[role]) {
- this._axisComponents[role].displayTickLabels(this._drawAxisLabels[role]);
- this._axisComponents[role].showPanZoomTickLabels(!panning || !this._suppressPanLabels[role]);
- var isAllow = this._axisComponents[role].isAllowAutomaticAxisLayoutToChangeOrientation();
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
- this._lastAxisDrawSelectors[role].call(this._axisComponents[role]);
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(isAllow);
- }
- if (this._gridComponents[role] && this._lastGridDrawSelectors[role]) {
- this._lastGridDrawSelectors[role].call(this._gridComponents[role]);
- }
- }
- },
- /** @expose */
- preventStaggerRotate45 : function(preventStaggerRotate45) {
- this._preventStaggerRotate45 = preventStaggerRotate45;
- },
- /**
- * Draw the axis for the given role into the axis group for the given position. When called, the selector for the position and the scale for the role are non-null. This also sets the transform for the group and defines and sets the clip path for the axis.
- * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
- * @param (int) role The axis role, X1, X2, Y1, or Y2
- */
- drawAxis : function(position, role) {
- var axisGroup = this._axisSelectors[position];
- this._lastAxisDrawSelectors[role] = axisGroup;
- var comp = this.axisComponent(role);
- var layoutModeID = role == 2 ? "axis.y.labels.layoutMode" : role == 3 ? "axis.y2.labels.layoutMode" : "axis.x.labels.layoutMode";
- var allowStaggerID = role == 2 ? "axis.y.labels.allowStagger" : role == 3 ? "axis.y2.labels.allowStagger" : "axis.x.labels.allowStagger";
- var allowRotate45ID = role == 2 ? "axis.y.labels.allowRotate45" : role == 3 ? "axis.y2.labels.allowRotate45" : "axis.x.labels.allowRotate45";
- var allowRotate90ID = role == 2 ? "axis.y.labels.allowRotate90" : role == 3 ? "axis.y2.labels.allowRotate90" : "axis.x.labels.allowRotate90";
- var layoutMode = ""+(this._context.getPropertyValue(layoutModeID));
- var allowStagger = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowStaggerID));
- var allowRotate45 = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowRotate45ID));
- var allowRotate90 = (this._context.getPropertyValue(allowRotate90ID));
- var textTruncateIndicator = (this._context.getPropertyValue("axis.labels.truncationText"));
- var axisBounds = this._axisRects[position];
- var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
- var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
- var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
- comp.scale(this._scales[role]).setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).bounds(axisBounds).elementRect(this._elementRect).orient(orient).layoutMode(layoutMode).allowStagger(allowStagger).allowRotate45(allowRotate45).allowRotate90(allowRotate90).setPreExecute(this._context.getPreExecute()).textTruncateIndicator(textTruncateIndicator);
- this._drawAxisLabels[role] = comp._displayTickLabels;
- var axisGroupUpdate = axisGroup;
- if (this._duration > 0 && !this._firstDraw && this._lastAxisDrew[position]) {
- axisGroupUpdate = axisGroup.transition().duration(this._duration);
- }
- axisGroupUpdate.attr("transform", axisTransform);
- axisGroupUpdate.call(comp);
- var dataSlotEntryList = this._dataSlotEntries[role];
- axisGroup.selectAll(".axis-title").property("dataSlots", dataSlotEntryList);
- this._lastAxisDrew[position] = comp.renderedShapes();
- if (this._defs) {
- var clipAxis = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this._context.instanceId() + "clip" + orient);
- var text = axisGroup.append("text").text("000,000");
- var bbox = text.node().getBBox();
- var w = bbox.width;
- var h = bbox.height;
- text.remove();
- var clipRect;
- if (position == 0 || position == 1) {
- var leftEdge = axisBounds.x + transform[0] * -1;
- var rightEdge = leftEdge + axisBounds.width;
- if (!(this._scales[role].isOrdinal()) && !(this._scales[role].isClustered())) {
- var numericLeftEdge = this._elementRect.x - w + transform[0] * -1;
- var numericRightEdge = numericLeftEdge + this._elementRect.width + w * 2;
- if (numericLeftEdge < leftEdge) {
- leftEdge = numericLeftEdge;
- }
- if (numericRightEdge > rightEdge) {
- rightEdge = numericRightEdge;
- }
- }
- clipRect = new rave['internal']['RectStruct'](leftEdge, axisBounds.y + transform[1] * -1, rightEdge - leftEdge, axisBounds.height);
- } else {
- clipRect = new rave['internal']['RectStruct'](axisBounds.x + transform[0] * -1, this._elementRect.y - h / 2 + transform[1] * -1, axisBounds.width, this._elementRect.height + h);
- }
- clipAxis.clipRect(clipRect).applyTo(axisGroup.select(".axis." + orient)).call(this._defs);
- }
- },
- /**
- * If the axis selector for the position is defined, clear the shapes from the axis group.
- * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
- */
- clearAxis : function(position) {
- if (this._axisSelectors[position]) {
- this._clearAxis.scale(null);
- this._axisSelectors[position].call(this._clearAxis);
- }
- this._lastAxisDrew[position] = false;
- },
- /**
- * Draw the grid for the given role into the axis group for the given position. When called, the selector for the role is non-null, and axis component has just been used to draw the axis shapes. This also sets the transform for the group.
- * @param (int) position The axis position, BOTTOM, TOP, LEFT, RIGHT
- * @param (int) role The axis role, X1, X2, Y1, or Y2
- */
- drawGrid : function(position, role) {
- var gridGroup = this._gridSelectors[position];
- this._lastGridDrawSelectors[role] = gridGroup;
- var comp = this.gridComponent(role);
- var axisBounds = this._axisRects[position];
- var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
- var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
- var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
- comp.setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).orient(orient).setPreExecute(this._context.getPreExecute()).bounds(this._elementRect).axis(this._axisComponents[role].axis());
- if (this._duration <= 0 || this._firstDraw || !this._lastAxisDrew[position]) {
- gridGroup.attr("transform", axisTransform).call(comp);
- } else {
- gridGroup.transition().duration(this._duration).attr("transform", axisTransform).call(comp);
- }
- this._lastGridDrew[position] = comp.renderedShapes();
- },
- /**
- * If the grid selector for the position is defined, clear the shapes from the grid group.
- * @param (int) position The grid position, BOTTOM, TOP, LEFT, RIGHT
- */
- clearGrid : function(position) {
- if (this._gridSelectors[position]) {
- this._clearGrid.axis(null);
- this._gridSelectors[position].call(this._clearGrid);
- }
- this._lastGridDrew[position] = false;
- },
- /**
- * @param (boolean) visible Whether the manager should draw axes
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- visible : function(visible) {
- this._visible = visible;
- return this;
- },
- /**
- * @param (int) duration The transition duration; if <= 0, no transition is used.
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- duration : function(duration) {
- this._duration = duration;
- return this;
- },
- /**
- * @param (boolean) transpose Whether to transpose the chart (switch the positions of the X and Y axis)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- transpose : function(transpose) {
- this._transpose = transpose;
- return this;
- },
- /**
- * @param (boolean) swapX Whether to switch the postitions of the X1 and X2 axes
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- swapX : function(swapX) {
- this._swapX = swapX;
- return this;
- },
- /**
- * @param (boolean) swapY Whether to switch the postitions of the Y1 and Y2 axes
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- swapY : function(swapY) {
- this._swapY = swapY;
- return this;
- },
- /**
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The coordinate scale for that role, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- scale : function(role, scale) {
- this._scales[role] = scale;
- return this;
- },
- /**
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (boolean) suppressLabels Whether to suppress the labels when panning the axis
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- suppressPanLabels : function(role, suppressLabels) {
- this._suppressPanLabels[role] = suppressLabels;
- return this;
- },
- /**
- * Get the AxisComponentImpl used to render a role. Views should use this to set the appearance properties of the axis. Other properties are handled by the manager.
- * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @return (com.ibm.rave.bundles.components.AxisComponentImpl) The component for the role
- */
- /** @expose */
- axisComponent : function(role) {
- if (!this._axisComponents[role]) {
- this._axisComponents[role] = new com_ibm_rave_bundles_components_AxisComponentImpl();
- }
- return this._axisComponents[role];
- },
- /**
- * Get the GridComponentImpl used to render a role. Views should use this to set the appearance properties of the grid. Other properties are handled by the manager.
- * @param (int) role The role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @return (com.ibm.rave.bundles.components.GridComponentImpl) The component for the role
- */
- /** @expose */
- gridComponent : function(role) {
- if (!this._gridComponents[role]) {
- this._gridComponents[role] = new com_ibm_rave_bundles_components_GridComponentImpl();
- }
- return this._gridComponents[role];
- },
- /**
- * Set the bundle <defs> node. Clip paths will be defined in this node.
- * @param (rave['internal']['Selector']) defs The defs node
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- defsSelector : function(defs) {
- this._defs = com_ibm_rave_bundles_components_AxesManager.checkSelector(defs);
- return this;
- },
- /**
- * Set the selector for an axis group node.
- * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
- * @param (rave['internal']['Selector']) axisGroup The axis group node, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- axisSelector : function(position, axisGroup) {
- this._axisSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(axisGroup);
- return this;
- },
- /**
- * Set the selector for a grid group node.
- * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
- * @param (rave['internal']['Selector']) gridGroup The grid group node, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- gridSelector : function(position, gridGroup) {
- this._gridSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(gridGroup);
- return this;
- },
- /**
- * Set the element (grid) bounds rectangle to a copy of the given rectangle.
- * @param (rave['internal']['RectStruct']) elementRect The rectangle, if null the bounds are set to 0,0,0,0
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- elementRect : function(elementRect) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, elementRect);
- return this;
- },
- /**
- * Set an axis bounds rectangle to a copy of the given rectangle.
- * @param (int) position The position, one of BOTTOM, TOP, LEFT, RIGHT
- * @param (rave['internal']['RectStruct']) axisRect The axis bounds, if null the bounds are set to 0,0,0,0
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- axisRect : function(position, axisRect) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], axisRect);
- return this;
- },
- /**
- * Convenience method. Set all the selectors using context.node as the root of a selection, and assuming the default chart structure: the defs node is the "defs" selection, the left axis is "g.axis.left", and so on.
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultSelectors : function() {
- this.defsSelector(this._context.node.select("defs"));
- this.axisSelector(0, this._context.node.select("g.axisTransform.bottom"));
- this.axisSelector(1, this._context.node.select("g.axisTransform.top"));
- this.axisSelector(2, this._context.node.select("g.axisTransform.left"));
- this.axisSelector(3, this._context.node.select("g.axisTransform.right"));
- this.gridSelector(0, this._context.node.select("g.grid.bottom"));
- this.gridSelector(1, this._context.node.select("g.grid.top"));
- this.gridSelector(2, this._context.node.select("g.grid.left"));
- this.gridSelector(3, this._context.node.select("g.grid.right"));
- return this;
- },
- /**
- * Convenience method: Set the element rectangle and axis rectangles from the rectangles in the layout.
- * @param (com.ibm.rave.bundles.components.ChartLayoutComponentImpl) layoutInfo Layout information
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useBoundsFromLayout : function(layoutInfo) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutInfo.elementRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[0], layoutInfo.bottomRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[1], layoutInfo.topRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[2], layoutInfo.leftRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[3], layoutInfo.rightRect());
- return this;
- },
- /**
- * Convenience method: Set the X1 axis and grid appearance properties from the context, using the usual {@link (rave['library']['internal']['CommonPropertyIDs']) CommonPropertyIDs} . Sets the the padding to the default 16. This does not set the tick format.
- * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultX1Properties : function(setGridParameters) {
- this.axisComponent(0).padding(16).displayAxisTitle(((this._context.getPropertyValue("axis.x.title.display")))).axisTitle(this._context.getDataSlotLabel("axis.x.title.text", this._dataSlotEntries[0])).displayAxisLine(((this._context.getPropertyValue("axis.x.line.display")))).lineColor((this._context.getPropertyValue("axis.x.line.style.stroke"))).displayTicks(((this._context.getPropertyValue("axis.x.ticks.display")))).tickColor((this._context.getPropertyValue("axis.x.ticks.style.stroke"))).displayTickLabels(((this._context.getPropertyValue("axis.x.labels.display"))));
- var titleFontStyle = (this._context.getPropertyValue("axis.x.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.x.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(0).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(0).labelStyle((this._context.getPropertyValue("axis.x.labels.style.fill")), (this._context.getPropertyValue("axis.x.labels.style.font-size")), (this._context.getPropertyValue("axis.x.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(0).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(0).titleStyle((this._context.getPropertyValue("axis.x.title.style.fill")), (this._context.getPropertyValue("axis.x.title.style.font-size")), (this._context.getPropertyValue("axis.x.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(0).displayGridlines(((this._context.getPropertyValue("axis.x.gridlines.display")))).gridlineStyle((this._context.getPropertyValue("axis.x.gridlines.style.stroke")), (this._context.getPropertyValue("axis.x.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(0, (this._context.getPropertyValue("axis.x.labels.zoomPan")));
- return this;
- },
- /**
- * Convenience method: Set the Y1 axis and grid appearance properties from the context, using the usual {@link (rave['library']['internal']['CommonPropertyIDs']) CommonPropertyIDs} . Sets the the padding to the default 16. This does not set the tick format.
- * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultY1Properties : function(setGridParameters) {
- this.axisComponent(2).padding(16).displayAxisTitle((this._context.getPropertyValue("axis.y.title.display"))).axisTitle(this._context.getDataSlotLabel("axis.y.title.text", this._dataSlotEntries[2])).displayAxisLine((this._context.getPropertyValue("axis.y.line.display"))).lineColor((this._context.getPropertyValue("axis.y.line.style.stroke"))).displayTicks((this._context.getPropertyValue("axis.y.ticks.display"))).tickColor((this._context.getPropertyValue("axis.y.ticks.style.stroke"))).displayTickLabels((this._context.getPropertyValue("axis.y.labels.display")));
- var titleFontStyle = (this._context.getPropertyValue("axis.y.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.y.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(2).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(2).labelStyle((this._context.getPropertyValue("axis.y.labels.style.fill")), (this._context.getPropertyValue("axis.y.labels.style.font-size")), (this._context.getPropertyValue("axis.y.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(2).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(2).titleStyle((this._context.getPropertyValue("axis.y.title.style.fill")), (this._context.getPropertyValue("axis.y.title.style.font-size")), (this._context.getPropertyValue("axis.y.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(2).displayGridlines((this._context.getPropertyValue("axis.y.gridlines.display"))).gridlineStyle((this._context.getPropertyValue("axis.y.gridlines.style.stroke")), (this._context.getPropertyValue("axis.y.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(2, (this._context.getPropertyValue("axis.y.labels.zoomPan")));
- return this;
- },
- /**
- * Convenience method: Set the Y2 axis and grid appearance properties from the context, using the usual {@link (rave['library']['internal']['CommonPropertyIDs']) CommonPropertyIDs} . Sets the the padding to the default 16. This does not set the tick format.
- * @param (boolean) setGridParameters Whether to set the grid parameters (do not use if chart does not define grid)
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- useDefaultY2Properties : function(setGridParameters) {
- this.axisComponent(3).padding(16).displayAxisTitle((this._context.getPropertyValue("axis.y2.title.display"))).axisTitle(this._context.getDataSlotLabel("axis.y2.title.text", this._dataSlotEntries[3])).displayAxisLine((this._context.getPropertyValue("axis.y2.line.display"))).lineColor((this._context.getPropertyValue("axis.y2.line.style.stroke"))).displayTicks((this._context.getPropertyValue("axis.y2.ticks.display"))).tickColor((this._context.getPropertyValue("axis.y2.ticks.style.stroke"))).displayTickLabels((this._context.getPropertyValue("axis.y2.labels.display")));
- var titleFontStyle = (this._context.getPropertyValue("axis.y2.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.y2.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(3).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(3).labelStyle((this._context.getPropertyValue("axis.y2.labels.style.fill")), (this._context.getPropertyValue("axis.y2.labels.style.font-size")), (this._context.getPropertyValue("axis.y2.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(3).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(3).titleStyle((this._context.getPropertyValue("axis.y2.title.style.fill")), (this._context.getPropertyValue("axis.y2.title.style.font-size")), (this._context.getPropertyValue("axis.y2.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(3).displayGridlines((this._context.getPropertyValue("axis.y2.gridlines.display"))).gridlineStyle((this._context.getPropertyValue("axis.y2.gridlines.style.stroke")), (this._context.getPropertyValue("axis.y2.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(3, (this._context.getPropertyValue("axis.y2.labels.zoomPan")));
- return this;
- },
- /**
- * Set the tick formatting function for the given axis role. The custom formatter is found using {@link this.BundleContext#this.getCustomFormatterWithFlag(, rave['library']['internal']['CustomFormatInfo'], rave['internal']['ValueFunction'], )} , searching for formatters in the order role, position of role, AXIS, and ALL, and using the given ValueFunction as the default if none are provided. The returned value function is set as the axis component's tick format. This must be called after setting the transpose, swapX, and swapY properties, since the position of the role depends on those properties.
- * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (Array) entries Non-null list of data slot entries
- * @param (String) format One of {@link this.CustomFormatInfo#"none"} or {@link this.CustomFormatInfo#"percent"}
- * @param (rave['internal']['ValueFunction']) defaultFunction Default function to use if no custom formatter is defined for the axis, may be null
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setTickFormatterList : function(role, entries, format, defaultFunction) {
- var fmtRole;
- switch (role) {
- case 2:
- fmtRole = "ROLE_Y1";
- break;
- case 1:
- fmtRole = "ROLE_X2";
- break;
- case 3:
- fmtRole = "ROLE_Y2";
- break;
- case 0:
- default:
- fmtRole = "ROLE_X1";
- break;
- }
- var fmt = this._context.getCustomFormatterWithFlag([com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS[role], com_ibm_rave_bundles_components_AxesManager.FORMATTERS[this.roleToPosition(role)], "axis", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("axis-label", fmtRole, format, entries), defaultFunction, false);
- this.axisComponent(role).tickFormat(fmt);
- var simplefmt = this._context.getCustomFormatterWithFlag([com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS[role], com_ibm_rave_bundles_components_AxesManager.FORMATTERS[this.roleToPosition(role)], "axis", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("axis-label", fmtRole, format, entries), defaultFunction, true);
- this.axisComponent(role).simplifiedTickFormat(simplefmt);
- return this;
- },
- /**
- * Utility for the common case where there is only one data slot entry and no special formatting or default. Makes a list of the entry and calls {@link #this.setTickFormatterList(, Array, String, rave['internal']['ValueFunction'])} with the "none" format and a null default function.
- * @param (int) role One of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (rave['library']['internal']['DataSlotEntry']) entry Data slot entry, if null it is not added to the list
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setTickFormatter : function(role, entry) {
- var entries = [];
- if (entry) {
- entries.push(entry);
- }
- return this.setTickFormatterList(role, entries, "none", null);
- },
- /**
- * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined scale.
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setIndependentScaleRanges(padding, outerPadding, pixelPad);
- this.setDependentScaleRanges(padding, outerPadding, pixelPad);
- return this;
- },
- /**
- * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setIndependentScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setScaleRangePadded(this._scales[0], false, padding, outerPadding, pixelPad);
- this.setScaleRangePadded(this._scales[1], false, padding, outerPadding, pixelPad);
- return this;
- },
- /**
- * Calls {@link #this.setScaleRangePadded(rave['library']['internal']['CoordinateScaleImpl'], , Number, Number, )} for each defined independent scale.
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- * @return (com.ibm.rave.bundles.components.AxesManager) This object
- */
- /** @expose */
- setDependentScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setScaleRangePadded(this._scales[2], true, padding, outerPadding, pixelPad);
- this.setScaleRangePadded(this._scales[3], true, padding, outerPadding, pixelPad);
- return this;
- },
- /**
- * Set a data slot entry that will be associated with the specified axis role. <br /><br /> To associate multiple data slots with an axis role, see {@link #this.setDataSlot(, Array)} .
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (rave['library']['internal']['DataSlotEntry']) slot DataSlotEntry to be associated with the axis role.
- */
- setDataSlot$0 : function(role, slot) {
- this.setDataSlot$1(role, [slot]);
- return this;
- },
- /**
- * Set a list of data slot entries that will be associated with the specified axis role.
- * @param (int) role An axis role, one of {@link this.AxesManager#0} , {@link this.AxesManager#1} , {@link this.AxesManager#2} , {@link this.AxesManager#3} .
- * @param (Array) slots List of DataSlotEntry to be associated with the axis role.
- */
- setDataSlot$1 : function(role, slots) {
- if (role < 4 && role >= 0) {
- this._dataSlotEntries[role].length = 0;
- if (slots) {
- for (var __i_enFor0 = 0, __exp_enFor0 = slots, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var slot = __exp_enFor0[__i_enFor0];
- this._dataSlotEntries[role].push(slot);
- }
- }
- }
- return this;
- },
- /**
- * </p> Set the coordinate range of a scale. This should be used only after the transpose and center rectangle have been set. Transpose and dependent are used to choose either the X or Y extent of the center rectangle. The extent is padded by pixelPad pixels at each end, so the smallest value of the domain will map to the extent's start+pixelPadding, and the largest value of the domain to the extent's end-pixelPadding. </p> TODO: This would be a good place for scale reverse.
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale Bundle independent scale
- * @param (boolean) dependent Whether this is the dependent scale
- * @param (Number) padding Padding, relevant only for ordinal scales
- * @param (Number) outerPadding Outer padding, relevant only for ordinal scales
- * @param (int) pixelPad Pixel padding at each end
- */
- setScaleRangePadded : function(scale, dependent, padding, outerPadding, pixelPad) {
- if (scale) {
- var min, max;
- if (dependent == this._transpose) {
- min = this._elementRect.x + pixelPad;
- max = this._elementRect.x + this._elementRect.width - pixelPad;
- } else {
- if (scale.isContinuous()) {
- min = this._elementRect.y + this._elementRect.height - pixelPad;
- max = this._elementRect.y + pixelPad;
- } else {
- min = this._elementRect.y + pixelPad;
- max = this._elementRect.y + this._elementRect.height - pixelPad;
- }
- }
- scale.range(min, max, padding, outerPadding);
- }
- },
- /**
- * Given a geometric position BOTTOM, TOP, LEFT, or RIGHT, return the role X1, X2, Y1, or Y2 used by that role.
- * @param (int) position The position index
- * @return (int) The role index
- */
- positionToRole : function(position) {
- var r = position;
- if (this._transpose) {
- r = (r + 2) % 4;
- }
- if (this._swapX && r < 2) {
- r = 1 - r;
- }
- if (this._swapY && r > 1) {
- r = 5 - r;
- }
- return r;
- },
- /**
- * Given a role X1, X2, Y1, or Y2, return the geometric position BOTTOM, TOP, LEFT, or RIGHT for that role.
- * @param (int) role The role index
- * @return (int) The position index
- */
- roleToPosition : function(role) {
- var p = role;
- if (this._swapX && role < 2) {
- p = 1 - p;
- }
- if (this._swapY && p > 1) {
- p = 5 - p;
- }
- if (this._transpose) {
- p = (p + 2) % 4;
- }
- return p;
- },
- /**
- * Sets the magnitude for the tick interval.
- * @param (int) role role index of the axis
- * @param (Number) tickMagnitude power of 10
- * @return (com.ibm.rave.bundles.components.AxesManager) this
- */
- /** @expose */
- scaleTickMagnitude : function(role, tickMagnitude) {
- this.axisComponent(role).scaleTickMagnitude(tickMagnitude);
- return this;
- },
- /** @expose */
- setDataSlot : function(a0, a1) {
- var args = arguments;
- if (args.length == 2 && typeof a1 === "function") {
- return this.setDataSlot$0(a0, a1);
- }
- return this.setDataSlot$1(a0, a1);
- }
- });
- /**
- * @param (rave['internal']['Selector']) s A selector
- * @return (rave['internal']['Selector']) s if it is non-null and has at least one node, null otherwise
- */
- com_ibm_rave_bundles_components_AxesManager.checkSelector = function(s) {
- return s && !(s.empty()) ? s : null;
- };
- /**
- * Set a rectangle to a copy of another. If the source is null, the target is set to 0,0,0,0
- * @param (rave['internal']['RectStruct']) target A non-null rectangle
- * @param (rave['internal']['RectStruct']) source A possibly-null rectnalge
- */
- com_ibm_rave_bundles_components_AxesManager.setRect = function(target, source) {
- if (source) {
- target.x = source.x;
- target.y = source.y;
- target.width = source.width;
- target.height = source.height;
- } else {
- target.x = 0;
- target.y = 0;
- target.width = 0;
- target.height = 0;
- }
- };
- /**
- * A ValueFunction that appends '%' to the value.
- * @param (int) n Number of digits
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.percentFormat = function(n) {
- var digits = "." + n + "f";
- var format = rave.format(digits);
- return function(value, ix, gix) {
- return format.call(null, value, 0, 0) + "%";
- };
- };
- /**
- * Called prior to chart layout. Axes are configured with no real bounding constraints to calculate their preferred size.
- */
- com_ibm_rave_bundles_components_AxesManager.AxisLayout = rave['internal']['Declare']({
- /** @expose */
- position : 0,
- /** @expose */
- score : 0,
- constructor : function(position, score) {
- this.position = position;
- this.score = score;
- }
- });
- /**
- * Logical first X (independent) axis, default position bottom
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.X1 = 0;
- /**
- * Logical second X (independent) axis, default position top
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.X2 = 1;
- /**
- * Logical first Y (dependent) axis, default position left
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.Y1 = 2;
- /**
- * Logical first Y (dependent) axis, default position right
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.Y2 = 3;
- /**
- * Geometric group on bottom
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.BOTTOM = 0;
- /**
- * Geometric group on top
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.TOP = 1;
- /**
- * Geometric group on left
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.LEFT = 2;
- /**
- * Geometric group on right
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxesManager.RIGHT = 3;
- /**
- * Maps the role indexes to the role strings used by the components API
- */
- com_ibm_rave_bundles_components_AxesManager.ROLES = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
- /**
- * Maps the role indexes to the role strings used by the custom formatter API. TODO: Unify the strings
- */
- com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
- /**
- * Maps the position indexes to the orient strings used by D3
- */
- com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS = ["bottom", "top", "left", "right"];
- /**
- * Maps the position indexes to the custom formatter strings
- */
- com_ibm_rave_bundles_components_AxesManager.FORMATTERS = ["bottom", "top", "left", "right"];
- // $source: com/ibm/rave/bundles/component/AxisComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders an axis (RAVE core Axis) with an optional title in an XY axis chart. The {@link #this.type()} method returns "AxisComponent". </p> <p> The {@link #this.role()} method is used to identify the axis. Most charts with axes will use only the {@link #"ROLE_X1"} and {@link #"ROLE_Y1"} roles. The composite bundle also uses {@link #"ROLE_Y2"} . {@link #"ROLE_X2"} is not currently used by any chart. </p> <p> The axis component uses a RAVE capability axis, available with {@link #this.axis()} . When used with a pre-execution callback, the axis is only valid for the duration of the callback (do not use the reference outside the callback). Properties of the capability axis may be set by the pre-execution callback, but note that many properties are set by the AxisComponent after the callback. To change those properties, use the methods of this class to change the AxisComponent, which will then set the capability axis properties. </p>
- */
- var com_ibm_rave_bundles_component_AxisComponent = rave['internal']['Declare'].implement(
- /**
- * @return (String) The role of the axis in the chart
- */
- //role : function() {},
- /**
- * @return (rave['internal']['Axis']) The capability Axis used by this AxisComponent
- */
- //axis : function() {},
- /**
- * The tickFormat is applied to the values of the ticks to create the string that is displayed.
- * @param (rave['internal']['ValueFunction']) tickFormat The new tickFormat
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //tickFormat : function(tickFormat) {},
- /**
- * Get the tickFormat function used by this component. May be null.
- * @return (rave['internal']['ValueFunction']) Format function, or null
- */
- //tickFormat : function() {},
- /**
- * Set the indicator to be used for truncated text ex: indicator set to "..." , results in helloworld - > hello...
- * @param (String) indicator the string to be placed to indicated truncated text
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //textTruncateIndicator : function(indicator) {},
- /**
- * Whether to display the axis title.
- * @param (boolean) displayAxisTitle true to display the axis title, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayAxisTitle : function(displayAxisTitle) {},
- /**
- * Whether to display the axis line.
- * @param (boolean) displayAxisLine true to display the axis line, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayAxisLine : function(displayAxisLine) {},
- /**
- * Whether to display the axis tick marks.
- * @param (boolean) displayTicks true to display the axis ticks, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayTicks : function(displayTicks) {},
- /**
- * Whether to display the axis labels, as set by the show axis labels property
- * @param (boolean) displayTickLabels true to display the axis tick labels, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //displayTickLabels : function(displayTickLabels) {},
- /**
- * Whether to display the axis labels, as set by the hide pan-zoom labels property
- * @param (boolean) showPanZoomTickLabels true to display the axis tick labels, false otherwise
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //showPanZoomTickLabels : function(showPanZoomTickLabels) {},
- /**
- * @param (String) axisTitle The new axisTitle
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //axisTitle : function(axisTitle) {},
- /**
- * The color used to draw the axis line and ticks. This is equivalent to calling both {@link #this.lineColor(String)} and {@link #this.tickColor(String)} .
- * @param (String) axisColor The new line and tick color
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //axisColor : function(axisColor) {},
- /**
- * The color used to draw the axis line.
- * @param (String) lineColor The new lineColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //lineColor : function(lineColor) {},
- /**
- * The color used to draw the axis ticks.
- * @param (String) tickColor The new tickColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //tickColor : function(tickColor) {},
- /**
- * The color used to draw the axis labels.
- * @param (String) labelColor The new labelColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //labelColor : function(labelColor) {},
- /**
- * The style for the axis labels.
- * @param (String) fontStyle CSS string of font properties
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //labelStyle : function(fontStyle) {},
- /**
- * The style for the axis labels.
- * @param (String) fill The color used to draw the labels
- * @param (String) fontSize CSS font size
- * @param (String) fontFamily CSS font-families list
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //labelStyle : function(fill, fontSize, fontFamily) {},
- /**
- * The color used to draw the axis title.
- * @param (String) titleColor The new titleColor
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //titleColor : function(titleColor) {},
- /**
- * The style for the axis title.
- * @param (String) fontStyle CSS string of font properties
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //titleStyle : function(fontStyle) {},
- /**
- * The style for the axis title.
- * @param (String) fill The color used to draw the title
- * @param (String) fontSize CSS font size
- * @param (String) fontFamily CSS font-families list
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- //titleStyle : function(fill, fontSize, fontFamily) {}
- );
- /**
- * The string returned by {@link #this.type()} is "AxisComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE = "AxisComponent";
- /**
- * Returned by {@link #this.role()} for the first independent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_X1 = "ROLE_X1";
- /**
- * Returned by {@link #this.role()} for the first dependent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_Y1 = "ROLE_Y1";
- /**
- * Returned by {@link #this.role()} for the second independent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_X2 = "ROLE_X2";
- /**
- * Returned by {@link #this.role()} for the second dependent axis.
- */
- /** @expose */
- com_ibm_rave_bundles_component_AxisComponent.ROLE_Y2 = "ROLE_Y2";
- // $source: com/ibm/rave/bundles/utilities/TextCrossfader
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> Utility class for setting up a cross-fade of a single text node. This could be extended to a multiple-node selection (e.g. using value functions to return the text strings for each node in the selection), but that is not yet needed in the bundles. However use this with care, since if the transition does select multiple texts, they will all change to the new text string. </p> <p> Any other text properties that are changing, for example the color or position, can be set up in the transition either before or after calling the utility method. </p>
- */
- var com_ibm_rave_bundles_utilities_TextCrossfader = rave['internal']['Declare']({
- });
- /**
- * <p> Perform a text cross fade for a single text node. The selection holds that node. If it is not a transition, the new text is set; otherwise the cross-fade transition is done using tweeners on the "text" and "fill-opacity" attributes. </p> <p> The "text" attribute tweener uses the oldText before transition time 0.5, and the new text thereafter. (Note this assumes that the old text is in fact the node's text; if not, the displayed text will change to the "old" text when the transition begins, then to the new text halfway through the transition.) </p> <p> The text is optionally faded out and back in, disappearing completely at time 0.5, by setting the "fill-opacity" style attribute. The fading is controlled by the delay argument, which is clamped to the range [0.0, 0.5]. If the clamped delay is 0.5, or if the text does not actually change, no crossfade is used. Otherwise the opacity is full for transition times less than the delay or greater than 1-delay, fading to 0.0 at time 0.5. For example if the delay is 0.2, the opacity will be full from transition time 0.0 to 0.2, fade out linearly to 0 at time 0.5, fade in linearly to full at time 0.8, and be full from time 0.8 to 1.0. </p> <p> The old and new texts and the full opacity are all passed as arguments, because it is generally not safe to try to find the values when the method runs. In particular, if we run this method while a transition (such as a previous cross-fade) is already in progress, we may pick up an intermediate fill-opacity value, perhaps even 0.0, and set the text opacity to that value!
- * @param (rave['internal']['Selection']) selection Selection containing the single text node, may be a transition
- * @param (String) oldText Old value of the text string, may be null
- * @param (String) newText New value of the text string, may be null
- * @param (Object) fillOpacity Fill opacity, may be null (in which case 1.0 is assumed)
- * @param (double) delay Number between 0 and 0.5 controlling the timing of the fade
- * @return (rave['internal']['Selection']) The selection, modified by the new text and fill-opacity
- */
- /** @expose */
- com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade = function(selection, oldText, newText, fillOpacity, delay) {
- if (!(selection.isTransition())) {
- return selection.text(newText);
- }
- var _t = (selection).tween("text", function(data, index, groupIndex) {
- return function(t) {
- this.rave_setText(t < 0.5 ? oldText : newText);
- };
- });
- var t0 = Math.max(0.0, Math.min(0.5, delay));
- if (t0 == 0.5 || (oldText == null && newText == null) || (oldText != null && oldText == newText)) {
- return selection;
- }
- var opacity = fillOpacity == null ? 1.0 : + (fillOpacity);
- var tf = 1.0 / (0.5 - t0);
- return _t.tween("fill-opacity", function(data, index, groupIndex) {
- return function(t) {
- if (t <= t0 || t >= (1.0 - t0)) {
- this.rave_setStyle("fill-opacity", fillOpacity);
- } else {
- this.rave_setStyle("fill-opacity", opacity * Math.abs(t - 0.5) * tf);
- }
- };
- });
- };
- // $source: com/ibm/rave/bundles/utilities/BundleLabelDropper
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_utilities_BundleLabelDropper = rave['internal']['Declare']({
- //_dropOverlap : null,
- labelCount : 0,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- _$self.drop(args[0], ((args[1])));
- return null;
- }
- };
- return _$self;
- },
- /** @expose */
- constructor : function() {
- this._dropOverlap = (rave.capabilities.extension("position")).drop().remove(false);
- this._dropOverlap.setOverlapGap(4.0);
- },
- /**
- * Drop the overlapping labels or reset the overlap.
- * @param (rave['internal']['Selection']) labels The selector for the labels
- * @param (boolean) removeOverlap true to remove the overlapping labels, false to reset
- */
- /** @expose */
- drop : function(labels, removeOverlap) {
- if (!(labels.isTransition())) {
- this.applyLabelDrop(labels, removeOverlap);
- } else {
- var steps = [0, 25, 75];
- var self = this;
- (labels).tween("__pointLabelDrop__", function(data, index, groupIndex) {
- if (index == 0) {
- return function(t) {
- var currentStep = Math.floor(t * 100);
- if (steps.length > 0 && currentStep < 100 && currentStep >= steps[0]) {
- steps.splice(0, 1);
- self.applyLabelDrop(labels, removeOverlap);
- }
- };
- }
- return null;
- });
- this.labelCount = 0;
- (labels).each(function(data, index, groupIndex) {
- ++self.labelCount;
- }).each("end", function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- if (--self.labelCount == 0) {
- self.applyLabelDrop(labels, removeOverlap);
- }
- return null;
- }
- });
- }
- },
- applyLabelDrop : function(labels, removeOverlap) {
- if (removeOverlap) {
- labels.call(this._dropOverlap);
- } else {
- this._dropOverlap.reset(labels);
- }
- },
- /** @expose */
- configureForDataLabels : function(rect) {
- if (rect) {
- var ex = [[rect.x, rect.y], [rect.x + rect.width, rect.y + rect.height]];
- this._dropOverlap.extent(ex);
- }
- this._dropOverlap.noClipping();
- }
- });
- /**
- * Drop overlap extension
- */
- //com_ibm_rave_bundles_utilities_BundleLabelDropper.POSITION_EXTENSION = "position";
- /**
- * space between labels during overlap testing
- */
- com_ibm_rave_bundles_utilities_BundleLabelDropper.OVERLAP_GAP = 4;
- // $source: com/ibm/rave/bundles/components/StyleStructs
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * Struct classes to hold style properties.
- */
- var com_ibm_rave_bundles_components_StyleStructs = rave['internal']['Declare']({
- });
- /**
- * Filled shape style properties.
- */
- com_ibm_rave_bundles_components_StyleStructs.ShapeStyle = function() {
- this._fill = null;
- this._stroke = null;
- this._strokeWidth = null;
- };
- /**
- * Line style properties.
- */
- com_ibm_rave_bundles_components_StyleStructs.LineStyle = function() {
- this._stroke = null;
- this._strokeWidth = null;
- this._dashArray = null;
- };
- // $source: com/ibm/rave/bundles/component/GridComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders gridlines in an XY axis chart. The {@link #this.type()} method returns "GridComponent". </p> <p> The {@link #this.role()} method is used to identify the grid. The return values are defined in {@link (com.ibm.rave.bundles.component.AxisComponent) AxisComponent} : {@link this.AxisComponent#"ROLE_X1"} , {@link this.AxisComponent#"ROLE_Y1"} , and so on. </p>
- */
- var com_ibm_rave_bundles_component_GridComponent = rave['internal']['Declare'].implement(
- /**
- * @return (String) The role of the grid in the chart
- */
- //role : function() {},
- /**
- * Whether to display the gridlines.
- * @param (boolean) displayGridlines The new displayGridlines
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //displayGridlines : function(displayGridlines) {},
- /**
- * Set the line styling. Equivalent to calling {@link #this.gridlineColor(String)} and {@link #this.dashArray(String)} .
- * @param (String) stroke The stroke color
- * @param (String) dashArray The stroke-dasharray
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //gridlineStyle : function(stroke, dashArray) {},
- /**
- * The color used to draw the gridlines.
- * @param (String) gridlineColor The new stroke color
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //gridlineColor : function(gridlineColor) {},
- /**
- * The dashing used to draw the gridlines. The argument is a string, giving a comma-separated list of numbers as used with the SVG "stroke-dasharray" style.
- * @param (String) dashArray The new dash array
- * @return (com.ibm.rave.bundles.component.GridComponent) This component
- */
- //dashArray : function(dashArray) {}
- );
- /**
- * The string returned by {@link #this.type()} is "GridComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE = "GridComponent";
- // $source: com/ibm/rave/bundles/components/IntervalDataUtilities
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * A structure for holding interval data (IntervalData}, and utilities for building an array of the data from the tabular data and accessors objects. The array has one entry per entry in the tabular data, and the array entries are in the same order as the datum rows for joining by selectors.
- */
- var com_ibm_rave_bundles_components_IntervalDataUtilities = rave['internal']['Declare']({
- });
- /**
- * <p> Create intervals for a simple bar chart. The intervals come directly from the data, with the independent interval the independent value (for both ends) and the dependent interval 0.0 to the dependent value. The group and label are copied from the datum. The callout independent is the independent value, and the callout dependent is the dependent value (the bar extent). </p> <p> If the xScale is non-null and returns null for an independent (X) value, the data is skipped. </p>
- * @param (Array) data Data array
- * @param (rave['internal']['SingleValueFunction']) x X accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) xScale Function to check if the X value is valid
- * @param (rave['internal']['SingleValueFunction']) y Y accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
- * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
- * @return (Array) Array of intervals for the data
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars = function(data, x, xScale, y, yStart, color, label) {
- var result = [];
- if (!data || data.length == 0 || !x || !y) {
- return result;
- }
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- var yvStart = !yStart ? 0 : yStart(d);
- if (yv != null && yvStart != null) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = r.ind1;
- r.cind = r.ind1;
- r.dep1 = yvStart;
- r.dep2 = yv;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = r.dep2;
- r._originalData = d;
- r.valueAsPercentOfCategory = 100;
- result.push(r);
- }
- }
- return null;
- });
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- if (sum != 0) {
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- return result;
- };
- /**
- * Create intervals for bars in a clustered chart. This is similar to the simple bars, except the independent values are an array of accessors.
- * @param (Array) data Data array
- * @param (Array) x Independent accessor array, should not be null and no entries should be null
- * @param (Array) xScale Array of possibly-null functions to check if X values are in domain; array should not be null, and should be same length as x
- * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
- * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
- * @return (Array) Array of intervals for the data
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars = function(data, x, xScale, y, yStart, color, label) {
- var result = [];
- if (!data || data.length == 0 || !x || x.length == 0 || !y) {
- return result;
- }
- var len = x.length;
- var categories = {};
- var colors = {};
- data.forEach(function(d, ix, list) {
- var OK = true;
- var ind = [];
- for (var i = 0; i < len; ++i) {
- var xv = x[i](d);
- if (xv == null || (xScale[i] && xScale[i](xv) == null)) {
- OK = false;
- break;
- }
- ind.push(xv);
- if (i == 0) {
- if (!(categories.hasOwnProperty(xv))) {
- categories[""+(xv)] = 1;
- }
- } else if (!(colors.hasOwnProperty(xv))) {
- colors[""+(xv)] = 1;
- }
- }
- var dep = y(d);
- var depStart = !yStart ? 0 : yStart(d);
- if (OK && dep != null && depStart != null) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = ind;
- r.ind2 = ind;
- r.cind = ind;
- r.dep1 = depStart;
- r.dep2 = dep;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = r.dep2;
- r._originalData = d;
- result.push(r);
- }
- return null;
- });
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == (iData.ind1)[0]) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == (iData.ind1)[0]) {
- var value = + (iData.value);
- iData.valueAsPercentOfCategory = value / sum * 100;
- }
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- }
- return result;
- };
- /**
- * Create intervals for an stacked bar chart. The data is formed into stacks by the unique values of the independent data. The independent interval is the independent value (for both ends), and the dependent interval is from the stacking with the extent equal to the dependent value. The callout independent is the independent value, and the callout dependent is the dependent value (the bar extent). If percent is true, the bars are rescaled so the total height of each stack is 1.0. If xScale is non-null and returns null for an x value, that bar is skipped.
- * @param (Array) data Data array
- * @param (rave['internal']['SingleValueFunction']) x Independent accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) xScale Possibly-null function to check if X values are in domain
- * @param (rave['internal']['SingleValueFunction']) y Dependent accessor, should not be null
- * @param (rave['internal']['SingleValueFunction']) color Color accessor, may be null
- * @param (rave['internal']['SingleValueFunction']) label Label accessor, may be null
- * @param (boolean) percent If true, create percent bars
- * @return (Array) Array of intervals for the data
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars = function(data, x, xScale, y, color, label, percent) {
- var result = [];
- if (!data || data.length == 0 || !x || !y) {
- return result;
- }
- var stacks = {};
- var categories = {};
- var colors = {};
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- if (yv != null) {
- var stack = stacks[xv];
- if (!stack) {
- stack = new com_ibm_rave_bundles_components_IntervalDataUtilities.Stack();
- stacks[xv] = stack;
- }
- var dVal = + (yv);
- if (!percent) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = xv;
- r.cind = xv;
- var sum = dVal < 0.0 ? stack.negativeSum : stack.positiveSum;
- r.dep1 = sum;
- r.dep2 = sum + dVal;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = dVal;
- r._originalData = d;
- result.push(r);
- }
- if (dVal < 0.0) {
- stack.negativeSum += dVal;
- } else {
- stack.positiveCount++;
- stack.positiveSum += dVal;
- }
- if (!(categories.hasOwnProperty(xv))) {
- categories[""+(xv)] = 1;
- }
- if (color) {
- var o = color(d);
- if ((o != null) && !(colors.hasOwnProperty(o))) {
- colors[""+(o)] = 1;
- }
- }
- }
- }
- return null;
- });
- if (percent) {
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- if (yv != null) {
- var stack = stacks[xv];
- var dVal = + (yv);
- var percent;
- if (dVal < 0.0) {
- percent = -100.0 * dVal / stack.negativeSum;
- } else if (stack.positiveSum > 0) {
- percent = 100.0 * dVal / stack.positiveSum;
- } else {
- percent = 100.0 / stack.positiveCount;
- }
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = xv;
- r.cind = xv;
- var sum = dVal < 0.0 ? stack.negativePercent : stack.positivePercent;
- r.dep1 = sum;
- r.dep2 = sum + percent;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = dVal;
- r.valueAsPercentOfCategory = percent;
- r._originalData = d;
- result.push(r);
- if (dVal < 0.0) {
- stack.negativePercent += percent;
- } else {
- stack.positivePercent += percent;
- }
- }
- }
- return null;
- });
- } else {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.ind1) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.ind1) {
- var value = + (iData.value);
- iData.valueAsPercentOfCategory = value / sum * 100;
- }
- }
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- }
- return result;
- };
- /**
- * Structure class holding interval information.
- */
- com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData = rave['internal']['Declare']({
- /**
- * Key value; for now this is the data index
- */
- /** @expose */
- key : null,
- /**
- * First independent value
- */
- /** @expose */
- ind1 : null,
- /**
- * Second independent value (in all current uses, same as ind1)
- */
- /** @expose */
- ind2 : null,
- /**
- * First dependent value
- */
- /** @expose */
- dep1 : null,
- /**
- * Second dependent value
- */
- /** @expose */
- dep2 : null,
- /**
- * The data value that the interval represents. Not the pixel value. Used in stacked chart
- */
- /** @expose */
- value : null,
- /**
- * Color value
- */
- /** @expose */
- color : null,
- /**
- * Label value
- */
- /** @expose */
- label : null,
- /**
- * Callout independent value (in all current uses, same as ind1)
- */
- /** @expose */
- cind : null,
- /**
- * Callout dependent value (dependent extent)
- */
- /** @expose */
- cdep : null,
- /** @expose */
- _originalData : null,
- /**
- * The data value (in percentage) for specific category
- */
- /** @expose */
- valueAsPercentOfCategory : NaN,
- /**
- * The data value (in percentage) across all categories
- */
- /** @expose */
- valueAsPercentOfColor : NaN,
- /** @expose */
- originalData : function() {
- return this._originalData;
- },
- /** @expose */
- originalDataList : function() {
- var list = [];
- list.push(this._originalData);
- return list;
- }
- });
- com_ibm_rave_bundles_components_IntervalDataUtilities.Stack = function() {
- this.positiveCount = 0;
- this.positiveSum = 0;
- this.negativeSum = 0;
- this.positivePercent = 0;
- this.negativePercent = 0;
- };
- /**
- * Accessor for the callout dependent value
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_DEPENDENT_ACCESSOR = function(data) {
- return (data).cdep;
- };
- /**
- * Accessor for the callout independent value
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_INDEPENDENT_ACCESSOR = function(data) {
- return (data).cind;
- };
- /**
- * Accessor for the data value
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR = function(data) {
- return (data).value;
- };
- /**
- * Accessor for data value as percent of category
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(data) {
- var percent = (data).valueAsPercentOfCategory;
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- /**
- * Accessor for data value as percent of color (series)
- */
- /** @expose */
- com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(data) {
- var percent = (data).valueAsPercentOfColor;
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- // $source: com/ibm/rave/bundles/data/PointDataUtilities
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * Utility class for building arrays of point datum objects from tabular data.
- */
- var com_ibm_rave_bundles_data_PointDataUtilities = rave['internal']['Declare']({
- });
- /**
- * <p> Filter the input data list-array and return a list-array of PointData objects in the same order. If the data is null, an empty list is returned. Any null object in the data is skipped. </p> <p> If an accessor is null, the X or Y value in the returned PointData objects is always null. If the accessor is non-null, points for which the accessor returns null are not included in the result; if the scale is also non-null, points for which the scale applied to the value returns null are not included in the result. </p> <p> The returned PointDatum objects have the X accessor and Y accessor values (so may be null), and the original datum set to the object from the data. </p>
- * @param (Array) data Input data, list of arbitrary objects
- * @param (rave['internal']['SingleValueFunction']) xAccessor X accessor function, may be null
- * @param (rave['internal']['SingleValueFunction']) xScale Scale to test if the X value should be included, may be null
- * @param (rave['internal']['SingleValueFunction']) yAccessor Y accessor function, may be null
- * @param (rave['internal']['SingleValueFunction']) yScale Scale to test if the Y value should be included, may be null
- * @return (Array) List of PointData objects
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.buildPoints = function(data, xAccessor, xScale, yAccessor, yScale) {
- var result = [];
- if (data) {
- for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- if (o != null) {
- var xv = null;
- if (xAccessor) {
- xv = xAccessor(o);
- if (xv == null || (xScale && xScale(xv) == null)) {
- continue;
- }
- }
- var yv = null;
- if (yAccessor) {
- yv = yAccessor(o);
- if (yv == null || (yScale && yScale(yv) == null)) {
- continue;
- }
- }
- var datum = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
- datum._x = xv;
- datum._y = yv;
- datum._originalData = o;
- result.push(datum);
- }
- }
- }
- return result;
- };
- /**
- * Datum object representing a point with X and Y values. Either X or Y may be null, depending on how the point is used, for example in a scatterplot.
- */
- com_ibm_rave_bundles_data_PointDataUtilities.PointDatum = rave['internal']['Declare']({
- /**
- * The X value
- */
- /** @expose */
- _x : null,
- /**
- * The Y value
- */
- /** @expose */
- _y : null,
- /**
- * The data value (in percentage) that the point represents
- */
- /** @expose */
- _yAsPercentOfCategory : null,
- /**
- * The data value (in percentage) that the point represents
- */
- /** @expose */
- _yAsPercentOfColor : null,
- /**
- * The original data
- */
- /** @expose */
- _originalData : null,
- /** @expose */
- originalData : function() {
- return this._originalData;
- },
- /** @expose */
- originalDataList : function() {
- var list = [];
- list.push(this._originalData);
- return list;
- }
- });
- /**
- * Accessor returning the _x property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR = function(d) {
- return (d)._x;
- };
- /**
- * Accessor returning the _y property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR = function(d) {
- return (d)._y;
- };
- /**
- * Accessor returning the _yAsPercentOfCategory property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(d) {
- var percent = + ((d)._yAsPercentOfCategory);
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- /**
- * Accessor returning the _yAsPercentOfColor property of a PointDatum.
- */
- /** @expose */
- com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(d) {
- var percent = + ((d)._yAsPercentOfColor);
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- // $source: com/ibm/rave/bundles/utilities/ColorUtil
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_utilities_ColorUtil = rave['internal']['Declare']({
- });
- /**
- * It is used to get a foreground color which has atleast a 4.5 contrast ratio with the background color.
- * @param (Object) bg bakground color
- * @param (Object) fg foreground color
- * @return (Object) a color ( darker/ligher/same fg color ) which contrast with background.
- */
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0 = function(bg, fg) {
- var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(bg, fg);
- if (contrastRatio < 4.5) {
- var bgHSL = rave.hsl(bg);
- var fgHSL = rave.hsl(fg);
- var brightness = 0.33 * (rave.rgb(bg).getR() / 255.0) + 0.5 * (rave.rgb(bg).getG() / 255.0) + 0.16 * (rave.rgb(bg).getB() / 255.0);
- if (brightness > 0.5) {
- if (bgHSL.getL() > 0.5) {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), bgHSL.getL() - 0.4));
- } else {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), 0.1));
- }
- } else {
- if (bgHSL.getL() < 0.5) {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), bgHSL.getL() + 0.4));
- } else {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), 0.9));
- }
- }
- }
- return fg;
- };
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1 = function(labelColor) {
- var labelRGB = rave.rgb(labelColor);
- return labelRGB.contrastShift(21);
- };
- /** @expose */
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio = function(colorA, colorB) {
- var foregroundLuminance = rave.rgb(colorA).getLuminance();
- var backgroundLuminance = rave.rgb(colorB).getLuminance();
- var contrastRatio = (foregroundLuminance >= backgroundLuminance) ? (foregroundLuminance + 0.05) / (backgroundLuminance + 0.05) : (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
- return contrastRatio;
- };
- /** @expose */
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor = function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1(a0);
- }
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0(a0, a1);
- };
- // $source: com/ibm/rave/bundles/component/IntervalComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders 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>
- */
- var com_ibm_rave_bundles_component_IntervalComponent = rave['internal']['Declare'].implement(
- /**
- * Turn labels on or off. If labels are on but there is no label data, empty text nodes will be created.
- * @param (boolean) itemLabel Whether to use labels
- * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
- */
- //itemLabel : function(itemLabel) {},
- /**
- * @param (boolean) _itemOverlap Whether to show/hide overlap labels
- * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
- */
- //itemOverlap : function(_itemOverlap) {},
- /**
- * Sets function that will specify position of item label for given chart element.
- * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
- * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
- */
- //itemLabelPosition : function(labelPosition) {},
- /**
- * Set the border width, which is also the stroke width.
- * @param (String) width
- * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
- */
- //borderWidth : function(width) {},
- /**
- * Set the border color.
- * @param (String) borderColor
- * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
- */
- //borderColor : function(borderColor) {},
- /**
- * Set the classname of the labellayer
- * @param (String) string
- * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
- */
- //labelLayerClassName : function(string) {},
- /**
- * Set the classname of the elementlayer
- * @param (String) string
- * @return (com.ibm.rave.bundles.component.IntervalComponent) This object
- */
- //elementLayerClassName : function(string) {},
- /**
- * @param bounds The bounds of the chart area.
- */
- //bounds : function(chartRect) {}
- );
- /**
- * The string returned by {@link #this.type()} is "IntervalComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_IntervalComponent.COMPONENT_TYPE = "IntervalComponent";
- // $source: com/ibm/rave/bundles/utilities/LabelStyleUtil
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/FilterComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor, getContrastRatio
- /**
- * This class can be used to apply styles on labels. Eg: when we need to overrule the given label style properties.
- */
- var com_ibm_rave_bundles_utilities_LabelStyleUtil = rave['internal']['Declare']({
- //_labelFontStyle : null,
- //_contrastLabelColorfilter : null,
- //_sameLabelColorfilter : null,
- /**
- * eg: apply contrast label color with background. apply different font size for each level label. apply a contrast shadow for a label.
- */
- //_labelFillColor : null,
- //_labelFontSize : null,
- _labelShadow : false,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- if (_$self._labelFontStyle) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(_$self._labelFontStyle), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var stylenName = __exp_enFor0[__i_enFor0];
- if ((stylenName == "fill" || stylenName == "color" && _$self._labelFillColor) || (stylenName == "font-size" && _$self._labelFontSize) || (stylenName == "text-shadow" && _$self._labelShadow == true)) {
- continue;
- }
- this.style(stylenName, _$self._labelFontStyle[stylenName]);
- }
- }
- if (_$self._labelFillColor) {
- this.style("fill", _$self._labelFillColor);
- }
- if (_$self._labelFontSize) {
- this.style("font-size", _$self._labelFontSize);
- }
- var labels = this.selectAll("*");
- if (labels.length == 0) {
- labels = this;
- }
- if (_$self._labelShadow) {
- var self = _$self;
- var defaultLabelFill = _$self.getDefaultLabelColor(_$self._labelFontStyle);
- _$self._contrastLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("contrast_label_drop_shadow");
- _$self._contrastLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill)));
- _$self._sameLabelColorfilter = new com_ibm_rave_bundles_components_FilterComponentImpl("same_label_drop_shadow");
- _$self._sameLabelColorfilter.setDropshadow("1px", "1px", "0px", rave.rgb(defaultLabelFill));
- var owner = this.node().rave_getOwner();
- rave.select(owner).select("defs").call(_$self._contrastLabelColorfilter);
- rave.select(owner).select("defs").call(_$self._sameLabelColorfilter);
- this.each(function(data, index, groupIndex) {
- if (self._labelFillColor) {
- var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(rave.rgb(self._labelFillColor.call(this, data, index, groupIndex)), defaultLabelFill);
- if (contrastRatio < 4.5) {
- this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
- } else {
- this.setAttribute("filter", "url(#" + self._sameLabelColorfilter.getId() + ")");
- }
- } else {
- this.setAttribute("filter", "url(#" + self._contrastLabelColorfilter.getId() + ")");
- }
- });
- labels.each(function(data, index, groupIndex) {
- if (self._labelFillColor) {
- this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._labelFillColor.call(this, data, index, groupIndex)).toString());
- } else {
- this.rave_setProperty("_rave_drop_shadow", "1px 1px 0px " + com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(defaultLabelFill).toString());
- }
- });
- } else {
- labels.each(function(data, index, groupIndex) {
- this.rave_setProperty("_rave_drop_shadow", null);
- });
- this.attr("filter", null);
- }
- return null;
- }
- };
- return _$self;
- },
- /** @expose */
- labelFont : function(labelFontStyle) {
- this._labelFontStyle = labelFontStyle;
- return this;
- },
- /** @expose */
- labelFillColor : function(_labelFillColor) {
- this._labelFillColor = _labelFillColor;
- return this;
- },
- /** @expose */
- labelFontSize : function(_labelFontSize) {
- this._labelFontSize = _labelFontSize;
- return this;
- },
- /** @expose */
- labelShadow : function(labelShadow) {
- this._labelShadow = labelShadow;
- return this;
- },
- /** @expose */
- getDefaultLabelColor : function(_labelStyle) {
- if (!_labelStyle) {
- return "#000000";
- }
- var defaultFillColor;
- if (_labelStyle) {
- defaultFillColor = _labelStyle["fill"];
- if (defaultFillColor == null) {
- defaultFillColor = _labelStyle["color"];
- }
- }
- if (defaultFillColor == null) {
- defaultFillColor = "#000000";
- }
- return defaultFillColor.toString();
- }
- });
- // $source: com/ibm/rave/bundles/component/LabelCollisionComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- */
- var com_ibm_rave_bundles_component_LabelCollisionComponent = rave['internal']['Declare'].implement(
- );
- /**
- * The string returned by {@link #this.type()} is "LabelCollisionComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_LabelCollisionComponent.COMPONENT_TYPE = "LabelCollisionComponent";
- // $source: com/ibm/rave/bundles/utilities/PathUtils
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- var com_ibm_rave_bundles_utilities_PathUtils = rave['internal']['Declare']({
- });
- /**
- * 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.
- * @param (rave['internal']['Selection']) selection A selection (either Selector or Transition) containing "path" elements.
- * @param (rave['internal']['ValueFunction']) pathFunction The path string generator function, e.g. Rave.svg.line().
- */
- /** @expose */
- com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn = function(selection, pathFunction) {
- if (selection.isTransition()) {
- var transition = selection;
- transition.ease("linear").styleTween("opacity", function(data, index, value) {
- var path = rave.select(this);
- if (!(this.rave_hasProperty("__rave_originalOpacity__"))) {
- this.rave_setProperty("__rave_originalOpacity__", path.style("opacity"));
- }
- var styleOpacity = this.rave_getProperty("__rave_originalOpacity__");
- var opacity = styleOpacity != null ? parseFloat(""+(styleOpacity)) : 1.0;
- var mid1 = 0.45, mid2 = 0.55;
- var s = rave.scale.linear().domain([0.0, mid1, mid2, 1.0]).range([opacity, 0.0, 0.0, opacity]);
- var setPath = [];
- setPath[0] = false;
- return function(t) {
- if (t > mid1 && !setPath[0]) {
- path.attr("d", pathFunction);
- setPath[0] = true;
- }
- return + (s.call(null, t, 0, 0));
- };
- });
- transition.each("end", function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- this.rave_removeProperty("__rave_originalOpacity__");
- return null;
- }
- });
- } else {
- selection.attr("d", pathFunction);
- }
- };
- //com_ibm_rave_bundles_utilities_PathUtils.OPACITY = "opacity";
- //com_ibm_rave_bundles_utilities_PathUtils.ORIGINAL_OPACITY = "__rave_originalOpacity__";
- //com_ibm_rave_bundles_utilities_PathUtils.PATH_DATA = "d";
- //com_ibm_rave_bundles_utilities_PathUtils.EASE_LINEAR = "linear";
- // $source: com/ibm/rave/bundles/component/LineComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders 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>
- */
- var com_ibm_rave_bundles_component_LineComponent = rave['internal']['Declare'].implement(
- /**
- * The interpolation modes are from the RAVE core line path generator, for example "linear", "cardinal".
- * @param (String) interpolate The interpolation mode
- * @return (com.ibm.rave.bundles.component.LineComponent) This component
- */
- //interpolate : function(interpolate) {}
- );
- /**
- * The string returned by {@link #this.type()} is "LineComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_LineComponent.COMPONENT_TYPE = "LineComponent";
- // $source: com/ibm/rave/bundles/data/LineDataUtilities
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // new
- /**
- * <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>
- */
- var com_ibm_rave_bundles_data_LineDataUtilities = rave['internal']['Declare']({
- });
- /**
- * <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>
- * @param (Array) data Array of data objects
- * @param (rave['internal']['SingleValueFunction']) xAccessor Non-null X accessor function
- * @param (rave['internal']['SingleValueFunction']) xScale Value function used to check if X value is in domain
- * @param (rave['internal']['SingleValueFunction']) yAccessor Non-null Y accessor function
- * @param (rave['internal']['SingleValueFunction']) groupAccessor Possibly-null group accessor function
- * @return (Array) Non-null but possibly empty array of LineData items, one per distinct group value
- */
- /** @expose */
- com_ibm_rave_bundles_data_LineDataUtilities.buildLines = function(data, xAccessor, xScale, yAccessor, groupAccessor) {
- var result = [];
- if (!data || data.length == 0) {
- return result;
- }
- var categories = {};
- var noGroup;
- var lines = {};
- for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var datum = __exp_enFor0[__i_enFor0];
- if (datum == null) {
- continue;
- }
- var xValue = xAccessor(datum);
- if (xValue != null && (!xScale || xScale(xValue) != null)) {
- if (!(categories.hasOwnProperty(xValue))) {
- categories[""+(xValue)] = 1;
- }
- var group = groupAccessor ? (groupAccessor(datum)) : null;
- var line;
- if (group == null) {
- if (!noGroup) {
- noGroup = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(null);
- result.push(noGroup);
- }
- line = noGroup;
- } else {
- line = lines[group];
- if (!line) {
- line = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(group);
- lines[group] = line;
- result.push(line);
- }
- }
- line.addPoint(datum, xValue, yAccessor(datum));
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(categories), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var lineDatum = result[i];
- for (var j = 0; j < lineDatum._pointData.length; ++j) {
- var pointDatum = lineDatum._pointData[j];
- if (s == pointDatum._x) {
- pointDatum._yAsPercentOfCategory = NaN;
- var value = + (pointDatum._y);
- sum += Math.abs(value);
- }
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var lineDatum = result[i];
- for (var j = 0; j < lineDatum._pointData.length; ++j) {
- var pointDatum = lineDatum._pointData[j];
- if (s == pointDatum._x) {
- var value = + (pointDatum._y);
- pointDatum._yAsPercentOfCategory = value / sum * 100;
- }
- }
- }
- }
- for (var i = 0; i < result.length; ++i) {
- var sum = 0;
- var lineDatum = result[i];
- for (var j = 0; j < lineDatum._pointData.length; ++j) {
- var pointDatum = lineDatum._pointData[j];
- pointDatum._yAsPercentOfColor = NaN;
- var value = + (pointDatum._y);
- sum += Math.abs(value);
- }
- if (sum != 0) {
- for (var j = 0; j < lineDatum._pointData.length; ++j) {
- var pointDatum = lineDatum._pointData[j];
- var value = + (pointDatum._y);
- pointDatum._yAsPercentOfColor = value / sum * 100;
- }
- }
- }
- return result;
- };
- com_ibm_rave_bundles_data_LineDataUtilities.get = function(val, data) {
- for (var i = 0; i < data.length; ++i) {
- var entry = data[i];
- if (entry.key===val) {
- return entry;
- }
- }
- return null;
- };
- /** @expose */
- com_ibm_rave_bundles_data_LineDataUtilities.buildLinesForStacking = function(data, xAccessor, yAccessor, groupAccessor) {
- if (!data || data.length == 0) {
- return [];
- }
- var keyToOriginalValue = {};
- var stacks = [];
- var nest = rave.nest();
- nest.key(function(d) {
- var keyValue = xAccessor(d);
- var strKeyValue = (keyValue);
- keyToOriginalValue[strKeyValue] = keyValue;
- return strKeyValue;
- });
- nest.key(function(d) {
- var stack = groupAccessor(d).toString();
- if (!(stacks.indexOf(stack)> -1)) {
- stacks.push(stack);
- }
- return stack;
- });
- var result = nest.entries(data);
- var missingValue = new Number(0);
- var stackData = stacks.map(function(name, index, array) {
- var line = new com_ibm_rave_bundles_data_LineDataUtilities.LineDatum(array[index].valueOf());
- result.forEach(function(currentValue, index, array) {
- var values = currentValue.values;
- var currentElement = com_ibm_rave_bundles_data_LineDataUtilities.get(line.group, values);
- var datum = null;
- var yValue = null;
- if (!currentElement) {
- yValue = missingValue;
- } else {
- datum = (currentElement.values)[0];
- yValue = yAccessor(datum);
- if (yValue == null) {
- yValue = missingValue;
- }
- }
- line.addPoint(datum, keyToOriginalValue[currentValue.key], yValue);
- return null;
- });
- return line;
- });
- return stackData;
- };
- /**
- * <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>
- * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale A non-null scale
- */
- /** @expose */
- com_ibm_rave_bundles_data_LineDataUtilities.sortLines = function(lines, scale) {
- var comp = function(a, b) {
- var av = scale.center(a._x);
- if (av == null) {
- return 1;
- }
- var bv = scale.center(b._x);
- if (bv == null) {
- return -1;
- }
- var v = av - bv;
- return v < 0 ? -1 : v > 0 ? 1 : 0;
- };
- for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var line = __exp_enFor0[__i_enFor0];
- line.sort(comp);
- }
- };
- /**
- * 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.
- * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
- * @return (Array) Array of PointDatum for points where X and Y are both non-null
- */
- /** @expose */
- com_ibm_rave_bundles_data_LineDataUtilities.getLineWithPoints = function(lines) {
- var result = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var line = __exp_enFor0[__i_enFor0];
- line.getLineWithPoints(result);
- }
- return result;
- };
- /**
- * 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.
- * @param (Array) lines A non-null array of LineDatum objects, such as produced by buildLines
- * @return (Array) Array of PointDatum for points meeting the null-point-null criterion
- */
- /** @expose */
- com_ibm_rave_bundles_data_LineDataUtilities.getNPNPoints = function(lines) {
- var result = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = lines, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var line = __exp_enFor0[__i_enFor0];
- line.getNPNPoints(result);
- }
- return result;
- };
- /**
- * <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>
- */
- com_ibm_rave_bundles_data_LineDataUtilities.LineDatum = rave['internal']['Declare']({
- /**
- * Group key, may be null
- */
- /** @expose */
- group : null,
- /**
- * Array of line-generator points in data space, non-null but may be empty
- */
- /** @expose */
- points : null,
- /**
- * Array of point datum objects, non-null but may be empty.
- */
- //_pointData : null,
- /**
- * Original data, non-null but may be empty.
- */
- //_originalData : null,
- /**
- * Construct.
- * @param (String) group The line's group.
- */
- constructor : function(group) {
- this.group = group;
- this.points = [];
- this._pointData = [];
- this._originalData = [];
- },
- /** @expose */
- originalData : function() {
- return this._originalData;
- },
- /** @expose */
- originalDataList : function() {
- return this._originalData;
- },
- /**
- * Add a point to the line.
- * @param (Object) originalData Original data for this point
- * @param (Object) x X value, must not be null
- * @param (Object) y Y value, may be null (for line/non-stacking area charts with gaps for null Y)
- */
- addPoint : function(originalData, x, y) {
- var point = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
- point._x = x;
- point._y = y;
- point._originalData = originalData;
- this.points.push([x, y]);
- this._pointData.push(point);
- this._originalData.push(originalData);
- },
- /**
- * 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.
- * @param (rave['internal']['Comparator']) comp Comparator that takes PointDatum arguments and sorts by X value
- */
- sort : function(comp) {
- this._pointData.sort(comp);
- var N = this._pointData.length;
- for (var i = 0; i < N; ++i) {
- var d = this._pointData[i];
- var p = this.points[i];
- p[0] = d._x;
- p[1] = d._y;
- this._originalData[i] = d._originalData;
- }
- },
- /**
- * Add all PointDatum objects where X and Y are non-null to the array. For efficiency this assumes the X values are non-null.
- * @param (Array) result Array collecting points
- */
- getLineWithPoints : function(result) {
- for (var __i_enFor0 = 0, __exp_enFor0 = this._pointData, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var point = __exp_enFor0[__i_enFor0];
- if (point._y != null) {
- result.push(point);
- }
- }
- },
- /**
- * Add all PointDatum objects that meet the "null-point-null" criterion to the array. For efficiency this assumes the X values are non-null.
- * @param (Array) result Array collecting points
- */
- getNPNPoints : function(result) {
- var N = this._pointData.length;
- var lastY;
- for (var i = 0; i < N; ++i) {
- var point = this._pointData[i];
- if (point._y != null) {
- var nextY = (i < N - 1) ? this._pointData[i + 1]._y : null;
- if (lastY == null && nextY == null) {
- result.push(point);
- }
- }
- lastY = point._y;
- }
- }
- });
- /**
- * A value function that takes a LineData as argument and returns the group.
- */
- /** @expose */
- com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR = function(d) {
- return (d).group;
- };
- /**
- * A value function that takes a LineData as argument and returns theoints.
- */
- /** @expose */
- com_ibm_rave_bundles_data_LineDataUtilities.POINTS_ACCESSOR = function(d) {
- return (d).points;
- };
- // $source: com/ibm/rave/bundles/component/PointComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * <p> A component that renders 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>
- */
- var com_ibm_rave_bundles_component_PointComponent = rave['internal']['Declare'].implement(
- /**
- * The default size used for a point, when no size scale is used or when the size data for the element is null.
- * @param (double) defaultSize The new defaultSize
- * @return (com.ibm.rave.bundles.component.PointComponent) This component
- */
- //defaultSize : function(defaultSize) {},
- /**
- * Turn labels on or off. If labels are on but there is no label data, empty text nodes will be created.
- * @param (boolean) itemLabel Whether to use labels
- * @return (com.ibm.rave.bundles.component.PointComponent) This component
- */
- //itemLabel : function(itemLabel) {},
- /**
- * Whether to drop overlapping labels.
- * @param (boolean) itemOverlap The new itemOverlap
- * @return (com.ibm.rave.bundles.component.PointComponent) This component
- */
- //itemOverlap : function(itemOverlap) {},
- /**
- * The symbol to be used for the points.
- * @param (String) symbol The new symbol
- * @return (com.ibm.rave.bundles.component.PointComponent) This component
- */
- //symbol : function(symbol) {},
- /**
- * Set the width of border
- * @param (String) borderWidth CSS value
- * @return (com.ibm.rave.bundles.component.PointComponent) This component
- */
- //borderWidth : function(borderWidth) {},
- /**
- * Set the color of border
- * @param (String) borderColor
- * @return (com.ibm.rave.bundles.component.PointComponent) This component
- */
- //borderColor : function(borderColor) {},
- /**
- * Set the classname of the labellayer
- * @param string
- * @return (com.ibm.rave.bundles.component.PointComponent) This object
- */
- //labelLayerClassName : function(className) {},
- /**
- * Set the classname of the elementlayer
- * @param string
- * @return (com.ibm.rave.bundles.component.PointComponent) This object
- */
- //elementLayerClassName : function(className) {},
- /**
- * Sets function that will specify position of item label for given chart element.
- * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
- * @return (com.ibm.rave.bundles.component.PointComponent) This object
- */
- //itemLabelPosition : function(labelPosition) {}
- );
- /**
- * The string returned by {@link #this.type()} is "PointComponent".
- */
- /** @expose */
- com_ibm_rave_bundles_component_PointComponent.COMPONENT_TYPE = "PointComponent";
- // $source: com/ibm/rave/bundles/components/AlignAxisTicksComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * 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.
- */
- var com_ibm_rave_bundles_components_AlignAxisTicksComponent = rave['internal']['Declare']({
- });
- /**
- * 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.
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale1 the scale for the first axis
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale2 the scale for the second axis
- */
- /** @expose */
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignAxisScales = function(scale1, scale2) {
- if (scale1.isLinear() && scale2.isLinear()) {
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScaleZero(scale1, scale2);
- var count1 = com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale1, null);
- var count2 = com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale2, null);
- if (count1 > count2) {
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale2, count1);
- } else if (count1 < count2) {
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale(scale1, count2);
- }
- }
- };
- /**
- * 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.
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale1 the scale for the first axis
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale2 the scale for the second axis
- */
- /** @expose */
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScaleZero = function(scale1, scale2) {
- var extent1 = rave['internal']['AbstractScale'].scaleExtent(scale1.scale().domain());
- var extent2 = rave['internal']['AbstractScale'].scaleExtent(scale2.scale().domain());
- var min1 = + (extent1[0]);
- var min2 = + (extent2[0]);
- if (min1 >= 0.0 && min2 >= 0.0) {
- return;
- }
- var max1 = + (extent1[1]);
- var max2 = + (extent2[1]);
- if (max1 <= 0.0 && max2 <= 0.0) {
- return;
- }
- var ratio1 = 0;
- var ratio2 = 0;
- if (min1 < 0.0) {
- ratio1 = max1 / Math.abs(min1);
- if (min2 < 0.0) {
- ratio2 = max2 / Math.abs(min2);
- if (ratio1 > ratio2) {
- extent2[1] = Math.abs(min2) * ratio1;
- }
- if (ratio2 > ratio1) {
- extent1[1] = Math.abs(min1) * ratio2;
- }
- } else {
- if (ratio1 > 0.0) {
- extent2[0] = -max2 / ratio1;
- } else {
- ratio1 = Math.abs(min1) / max2;
- ratio1 = ratio1 > 4.0 ? 4.0 : ratio1;
- ratio1 = ratio1 < 0.25 ? 0.25 : ratio1;
- extent1[1] = -min1 / ratio1;
- extent2[0] = -max2 * ratio1;
- }
- }
- } else if (min2 < 0.0) {
- if (max2 > 0) {
- ratio2 = max2 / Math.abs(min2);
- extent1[0] = -max1 / ratio2;
- } else {
- ratio2 = Math.abs(min2) / max1;
- ratio2 = ratio2 > 4.0 ? 4.0 : ratio2;
- ratio2 = ratio2 < 0.25 ? 0.25 : ratio2;
- extent2[1] = -min2 / ratio2;
- extent1[0] = -max1 * ratio2;
- }
- }
- var exList = [];
- exList.splice(0, 0, extent2[0]);
- exList.splice(1, 0, extent2[1]);
- scale2.scale().domain(exList);
- exList.length = 0;
- exList.splice(0, 0, extent1[0]);
- exList.splice(1, 0, extent1[1]);
- scale1.scale().domain(exList);
- };
- /**
- * 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.
- * @param (rave['library']['internal']['CoordinateScaleImpl']) coordScale the original scale
- * @param (Number) tickCount the tickCount we wish to expand the scale to
- * @return (double) the number of ticks of the scale
- */
- /** @expose */
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignScale = function(coordScale, tickCount) {
- var m = 10;
- var extent = rave['internal']['AbstractScale'].scaleExtent(coordScale.scale().domain());
- var span = + (extent[1]) - + (extent[0]);
- var step = Math.pow(10, Math.floor(Math.log(span / m) / Math.log(10)));
- var err = m / span * step;
- if (err <= 0.15) {
- step *= 10;
- } else if (err <= 0.35) {
- step *= 5;
- } else if (err <= 0.75) {
- step *= 2;
- }
- var min = + (extent[0]);
- var max = + (extent[1]);
- var numSteps = (max - min) / step;
- if (tickCount != null && numSteps < tickCount) {
- var negSteps = 0.0;
- if (min < 0.0) {
- negSteps = Math.abs(min) / step;
- }
- var posSteps = max / step;
- negSteps = negSteps * tickCount / numSteps;
- posSteps = posSteps * tickCount / numSteps;
- var exList = [];
- exList.splice(0, 0, -negSteps * step);
- exList.splice(1, 0, posSteps * step);
- coordScale.scale().domain(exList);
- numSteps = tickCount;
- }
- return numSteps;
- };
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.LINEAR_DEFAULT_TICKS = 10;
- // $source: com/ibm/rave/bundles/components/ComponentConfiguration
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- /**
- * Utility class 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"} .
- */
- var com_ibm_rave_bundles_components_ComponentConfiguration = rave['internal']['Declare']({
- //constructor : function() {}
- });
- /**
- * <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>
- * @param (rave['internal']['Selection']) chart Selection on which to run the zoom, may be null
- * @param (rave['internal']['Zoom']) zoom The Zoom; if null one is created and returned
- * @param (rave['library']['internal']['CoordinateScaleImpl']) xScale X dimension scale, may be null
- * @param (rave['library']['internal']['CoordinateScaleImpl']) yScale Y dimension scale, may be null
- * @param (rave['library']['internal']['CoordinateScaleImpl']) x2Scale X2 dimension scale, may be null
- * @param (rave['library']['internal']['CoordinateScaleImpl']) y2Scale Y2 dimension scale, may be null
- * @param (Array) scaleExtent Scale extent, may be null; if null the range 0.2 to 5.0 is used
- * @param (rave['internal']['RectStruct']) chartRect The rectangle of the chart
- * @param (double[]) p the zoom translate position (x, y, x2, y2)
- * @param (double[]) s the zoom scale (x, y, x2, y2)
- * @param (String) zoomOps The zoom operation (x|y|x2|y2|all)
- * @param (rave['internal']['RunFunction']) callback Callback on each zoom event, must not be null
- * @return (rave['internal']['Zoom']) The zoom
- */
- /** @expose */
- com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom = function(chart, zoom, xScale, yScale, x2Scale, y2Scale, scaleExtent, chartRect, p, s, zoomOps, callback) {
- var z = zoom ? zoom : rave.behavior.zoom();
- var z1 = (x2Scale || y2Scale) && zoomOps == "all" ? rave.behavior.zoom() : null;
- var dummyScale = (rave.scale.linear());
- z.x(dummyScale);
- z.y(dummyScale);
- if (xScale && zoomOps == "x") {
- z.x(xScale.scale());
- z.scale(s[0]);
- z.translate([p[0], 0]);
- }
- if (yScale && zoomOps == "y") {
- z.y(yScale.scale());
- z.scale(s[1]);
- z.translate([0, p[1]]);
- }
- if (x2Scale && zoomOps == "x2") {
- z.x(x2Scale.scale());
- z.scale(s[2]);
- z.translate([p[2], 0]);
- }
- if (y2Scale && zoomOps == "y2") {
- z.y(y2Scale.scale());
- z.scale(s[3]);
- z.translate([0, p[3]]);
- }
- if (zoomOps == "all") {
- if (xScale) {
- z.x(xScale.scale());
- }
- if (yScale) {
- z.y(yScale.scale());
- }
- z.scale(1);
- z.translate([0, 0]);
- if (z1) {
- if (x2Scale) {
- z1.x(x2Scale.scale());
- }
- if (y2Scale) {
- z1.y(y2Scale.scale());
- }
- z1.scale(1);
- z1.translate([0, 0]);
- }
- }
- z.scaleExtent(scaleExtent ? scaleExtent : [1, Infinity]).on("zoom.default", function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var event = args[3];
- var scale = event.scale;
- var translate = event.translate;
- var scaledX = chartRect.x * (scale - 1);
- var scaledXExtent = (chartRect.width * (1 - scale)) - scaledX;
- translate[0] = Math.min(-scaledX, Math.max(scaledXExtent, translate[0]));
- var scaledY = chartRect.y * (scale - 1);
- var scaledYExtent = (chartRect.height * (1 - scale)) - scaledY;
- translate[1] = Math.min(-scaledY, Math.max(scaledYExtent, translate[1]));
- z.translate([translate[0], translate[1]]);
- if (z1) {
- z1.translate([translate[0], translate[1]]);
- z1.scale(scale);
- }
- if (zoomOps == "x") {
- p[0] = translate[0];
- s[0] = scale;
- } else if (zoomOps == "y") {
- p[1] = translate[1];
- s[1] = scale;
- } else if (zoomOps == "x2") {
- p[2] = translate[0];
- s[2] = scale;
- } else if (zoomOps == "y2") {
- p[3] = translate[1];
- s[3] = scale;
- } else if (zoomOps == "all") {
- p[0] = translate[0];
- p[1] = translate[1];
- p[2] = translate[0];
- p[3] = translate[1];
- s[0] = scale;
- s[1] = scale;
- s[2] = scale;
- s[3] = scale;
- }
- return callback.apply(this, args);
- }
- });
- return z;
- };
- // $source: com/ibm/rave/bundles/internal/nativeImpl/BundleModule
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2015
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // Must be the first import
- // @import ./BundleModuleHeader
- // expose DataFormatter to the global variable rave
- //rave["library"]["CustomFormatter"]=com_ibm_rave_library_framework_CustomFormatter;
- // $source: com/ibm/rave/bundles/compositeBundle/CompositeBundle
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/library/Library (static) // Library
- //@import com/ibm/rave/bundles/RaveBundle (loadtime) // superclass
- //@import com/ibm/rave/bundles/compositeBundle/CompositeView (runtime) // new
- var com_ibm_rave_bundles_compositeBundle_CompositeBundle = rave['internal']['Declare'](com_ibm_rave_bundles_RaveBundle, {
- /** @expose */
- getName : function() {
- return com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME;
- },
- /** @expose */
- createView : function(ctx) {
- return new com_ibm_rave_bundles_compositeBundle_CompositeView(ctx);
- }
- //constructor : function() {}
- });
- /**
- * Register the bundle factory with the library. The bundle will not be made available if this method is not called.
- */
- /** @expose */
- com_ibm_rave_bundles_compositeBundle_CompositeBundle.init = function() {
- if (!(com_ibm_rave_library_Library.bundle.isRegistered(com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME))) {
- var bundle;
- com_ibm_rave_library_Library.bundle.extension(com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME, function() {
- if (!bundle) {
- bundle = new com_ibm_rave_bundles_compositeBundle_CompositeBundle();
- bundle.loadResources();
- require("./vizlibrary-composite.css");
- }
- return bundle;
- });
- }
- return com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME;
- };
- com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME = "compositeBundle";
- // Auto initialization
- com_ibm_rave_bundles_compositeBundle_CompositeBundle.init();
- if (!com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME]) {
- com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_compositeBundle_CompositeBundle.BUNDLE_NAME] = function() {
- if (!bundle) {
- bundle = new com_ibm_rave_bundles_compositeBundle_CompositeBundle();
- bundle.loadResources();
- require("./vizlibrary-composite.css");
- }
- return bundle;
- };
- } else {
- console.log("Could not register extension: CompositeBundle");
- }
- // $source: com/ibm/rave/bundles/views/AbstractColumnView
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/views/BundleView (loadtime) // superclass
- //@import com/ibm/rave/bundles/components/IntervalComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/IntervalDataUtilities (runtime) // IntervalDataUtilities, simpleBars, clusteredBars, stackedBars
- //@import com/ibm/rave/library/Library (runtime) // logError
- //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
- /**
- * 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.
- */
- var com_ibm_rave_bundles_views_AbstractColumnView = rave['internal']['Declare'](com_ibm_rave_bundles_views_BundleView, {
- /** @expose */
- datasetId : null,
- /**
- * Interval component, created in setup
- */
- /** @expose */
- _intervalComponent : null,
- /** @expose */
- constructor : function(context) {
- this.datasetId = "data";
- },
- /** @expose */
- setup : function() {
- com_ibm_rave_bundles_views_BundleView.prototype.setup.call(this);
- this._intervalComponent = new com_ibm_rave_bundles_components_IntervalComponentImpl();
- this._intervalComponent.keyAccessor(function(data) {
- return (data).key;
- }).independent1Accessor(function(data) {
- return (data).ind1;
- }).independent2Accessor(function(data) {
- return (data).ind2;
- }).dependent1Accessor(function(data) {
- return (data).dep1;
- }).dependent2Accessor(function(data) {
- return (data).dep2;
- }).valueAccessor(com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR);
- },
- /** @expose */
- dataValid : function() {
- if (!(this.dataModel.validate())) {
- return false;
- }
- var dataHandling = this.getStringProperty("data.handling");
- var dataSet = this.dataModel.dataset(this.datasetId);
- var yAccessor = dataSet.slot("y").entry();
- var yStart = dataSet.slot("yStart");
- var yStartAccessor = yStart ? yStart.entry() : null;
- if (dataHandling == "Stacked" || dataHandling == "Stacked100") {
- if (yStartAccessor || yAccessor.type() == "date") {
- com_ibm_rave_library_Library.logError(408, "Column chart isn't stackable when ystart is defined or y is date");
- return false;
- }
- }
- if (yStartAccessor && !(yStartAccessor.type() == yAccessor.type())) {
- com_ibm_rave_library_Library.logError(409, "y and ystart slot must have the same data type in Column data");
- return false;
- }
- return true;
- },
- /**
- * Convert data model into array of IntervalData structures, based on the group handling. See {@link (com.ibm.rave.bundles.components.IntervalDataUtilities) IntervalDataUtilities} .
- * @return (Array) Array of intervals
- */
- /** @expose */
- makeData : function(dataModel, _data) {
- if (!_data || _data.length == 0) {
- return [];
- }
- var dataSet = dataModel.dataset(this.datasetId);
- var xAccessor = dataSet.slot("x").entry();
- var yAccessor = dataSet.slot("y").entry();
- var colorAccessor = dataSet.slot("color").entry();
- var labelAccessor = dataSet.slot("label").entry();
- var yStart = dataSet.slot("yStart");
- var yStartAccessor = yStart ? yStart.entry() : null;
- var dataHandling = this.getStringProperty("data.handling");
- if ("Clustered" == dataHandling && colorAccessor) {
- 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);
- }
- if ("Stacked" == dataHandling) {
- return com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, colorAccessor, labelAccessor, false);
- }
- if ("Stacked100" == dataHandling) {
- return com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, colorAccessor, labelAccessor, true);
- }
- return com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars(_data, xAccessor, rave['library']['internal']['AbstractView'].domainCheckerOf(_data, xAccessor), yAccessor, yStartAccessor, colorAccessor, labelAccessor);
- },
- /** @expose */
- configureDataLabels : function(dataSet, colorDataSlotEntry) {
- if (!(this.isShowDataLabels())) {
- this._intervalComponent.itemLabel(false);
- this._intervalComponent.itemLabelPosition(null);
- this._intervalComponent.labelFont(null);
- this._intervalComponent.labelAccessor(null);
- this._intervalComponent.labelFormatter(null);
- return;
- }
- var dataHandling = this.getStringProperty("data.handling");
- var isStacked = (colorDataSlotEntry) && ("Stacked" == dataHandling || "Stacked100" == dataHandling);
- var dataLabelPosition = function(data, index, groupIndex) {
- if (isStacked) {
- return 1;
- } else {
- var iData = data;
- var value = + (iData.value);
- return (value >= 0) ? 0 : 2;
- }
- };
- var labelAccessor = this.getlDataLabelAccessor(dataSet, "label", true);
- var labelEntry = this.getEntryForDataLabelFormatter(dataSet, "label", "y");
- this._intervalComponent.itemLabel(true);
- this._intervalComponent.itemOverlap(true);
- this._intervalComponent.itemLabelPosition(dataLabelPosition);
- var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
- if (!isStacked) {
- labelFontStyle = this.getBackgroundConstrastLabelStyle();
- }
- this._intervalComponent.labelFont(labelFontStyle);
- this._intervalComponent.labelAccessor(labelAccessor);
- this._intervalComponent.labelContrast(this.getBooleanProperty("contrast.label.color"));
- this._intervalComponent.labelFormatter(this.context.getCustomFormatterForElementLabels(labelEntry, (dataSet.slot("label").entry()) ? "ROLE_NONE" : "ROLE_Y1"));
- this._intervalComponent.labelContrast(this.getBooleanProperty("contrast.label.color"));
- this._intervalComponent.labelShadow(this.getBooleanProperty("label.shadow"));
- }
- });
- /** @expose */
- com_ibm_rave_bundles_views_AbstractColumnView.DATAMODEL_TABULAR = "tabular";
- /** @expose */
- com_ibm_rave_bundles_views_AbstractColumnView.DATASET_DATA = "data";
- /** @expose */
- com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_X = "x";
- /** @expose */
- com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_Y = "y";
- /** @expose */
- com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_Y_START = "yStart";
- /** @expose */
- com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_COLOR = "color";
- /** @expose */
- com_ibm_rave_bundles_views_AbstractColumnView.DATASLOT_LABEL = "label";
- // $source: com/ibm/rave/bundles/compositeBundle/CompositeView
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/views/AbstractColumnView (loadtime) // superclass
- //@import com/ibm/rave/bundles/components/LabelCollisionComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/components/LineComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/data/LineDataUtilities (runtime) // getNPNPoints, buildLines, sortLines, LineDataUtilities, getLineWithPoints
- //@import com/ibm/rave/bundles/components/PointComponentImpl (runtime) // new
- //@import com/ibm/rave/bundles/data/PointDataUtilities (runtime) // PointDataUtilities
- //@import com/ibm/rave/bundles/components/AxesManager (runtime) // percentFormat
- //@import com/ibm/rave/bundles/components/AlignAxisTicksComponent (runtime) // alignAxisScales
- //@import com/ibm/rave/bundles/components/ComponentConfiguration (runtime) // configureZoom
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * <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>
- */
- var com_ibm_rave_bundles_compositeBundle_CompositeView = rave['internal']['Declare'](com_ibm_rave_bundles_views_AbstractColumnView, {
- /**
- * Line component, created in setup
- */
- //_lineComponent : null,
- /**
- * Point component, created when first needed
- */
- //_pointComponent : null,
- /**
- * Column data
- */
- //_intervalData : null,
- /**
- * Line data
- */
- //_lineData : null,
- /**
- * Point data; the line points which have non-null X and Y
- */
- //_pointData : null,
- /**
- * Null-point data; the line points which have non-null X and Y, and are flanked by points with null Y
- */
- //_pointNPNData : null,
- //_independentScale : null, //_intervalDependentScale : null, //_lineDependentScale : null,
- //zoomendedTimer : null,
- /**
- * color accessor for the column portion of the composite bundle
- */
- //_columnColorAccessor : null,
- //indepScale : null, //intervalScale : null, //lineScale : null,
- /**
- * Label collision component, created in setup
- */
- /** @expose */
- _labelCollisionComponent : null,
- _transpose : false,
- /**
- * When true, don't start a new timer
- */
- _pendingLabelTimer : false,
- /**
- * Counts the number of label collision timers to kill
- */
- _cancelLabelTimers : 0,
- /** @expose */
- constructor : function(context) {
- this.datasetId = "column";
- this._columnColorAccessor = function(data) {
- return (data).color;
- };
- },
- /** @expose */
- getLegendCount : function() {
- return 2;
- },
- /** @expose */
- isAxesManagerRequired : function() {
- return true;
- },
- /** @expose */
- setup : function() {
- com_ibm_rave_bundles_views_AbstractColumnView.prototype.setup.call(this);
- this._pendingLabelTimer = false;
- this._cancelLabelTimers = 0;
- this._labelCollisionComponent = new com_ibm_rave_bundles_components_LabelCollisionComponentImpl();
- rave['library']['internal']['BundleUtils'].setupDefaultActions(this.context, ".chart ." + "element-shape", null);
- this._lineComponent = new com_ibm_rave_bundles_components_LineComponentImpl();
- this._lineComponent.pointsAccessor(function(data) {
- return (data).points;
- }).groupAccessor(com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR);
- this._pointComponent = new com_ibm_rave_bundles_components_PointComponentImpl();
- this._pointComponent.independentAccessor(com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR).dependentAccessor(com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR);
- },
- /** @expose */
- draw : function() {
- if (this.isUpdateNothing()) {
- return;
- }
- this.preDraw("g.vizlibrary-composite");
- this.dataModel = this.context.dataModel();
- if (this.dataModel.getDescriptor().id() == com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE) {
- this.datasetId = "composite";
- } else {
- this.datasetId = "column";
- }
- if (!(this.validateDataModel("g.element-group", "g.grid", "g.axis"))) {
- return;
- }
- this.setActionsWithBorder();
- this.stopLabelCollisions();
- var columnDataSet;
- var lineDataSet;
- if (this.dataModel.getDescriptor().id() == com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE) {
- columnDataSet = this.dataModel.dataset("composite");
- lineDataSet = this.dataModel.dataset("composite");
- } else {
- columnDataSet = this.dataModel.dataset(this.datasetId);
- lineDataSet = this.dataModel.dataset("line");
- }
- if (!(this.compatibleDomains(columnDataSet, lineDataSet))) {
- this._chart.selectAll("g.element-group").selectAll("*").remove();
- this._chart.selectAll("g.element-label-group").selectAll("*").remove();
- this._chart.selectAll("g.grid").selectAll("*").remove();
- this._chart.selectAll("g.axis").selectAll("*").remove();
- this._legends.visible(false).draw();
- }
- var effect = this.getStringProperty("effect.name");
- var duration = this.getEffectDuration(effect);
- this._transpose = this.getBooleanProperty("transpose");
- var columnData = (columnDataSet.data());
- var lineModelData = (lineDataSet.data());
- var useLineLegend = this.getBooleanProperty("legend.line.display");
- var useColumnLegend = this.getBooleanProperty("legend.column.display");
- var legendPosition = this.getLegendPosition();
- var columnXDataSlotEntry = columnDataSet.slot("x").entry();
- var columnYDataSlotEntry = columnDataSet.slot("y").entry();
- var columnColorDataSlotEntry = columnDataSet.slot("color").entry();
- if (!columnColorDataSlotEntry && columnYDataSlotEntry) {
- columnDataSet.slot("color").overrideLabel(columnYDataSlotEntry.label());
- }
- var lineXDataSlotEntry = lineDataSet.slot("x").entry();
- var lineYDataSlotEntry;
- var lineColorDataSlotEntry;
- var lineYSlotName = "y";
- var lineColorSlotName = "color";
- if (this.dataModel.getDescriptor().id() == com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE) {
- lineYSlotName += "Line";
- lineColorSlotName += "Line";
- }
- lineYDataSlotEntry = lineDataSet.slot(lineYSlotName).entry();
- lineColorDataSlotEntry = lineDataSet.slot(lineColorSlotName).entry();
- if (!lineColorDataSlotEntry && lineYDataSlotEntry) {
- lineDataSet.slot(lineColorSlotName).overrideLabel(lineYDataSlotEntry.label());
- }
- if (this.updateType == 0) {
- this._intervalData = this.makeData(this.dataModel, columnData);
- 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));
- this.context.actions.action("deselectAll")(this.context.node.selectAll("." + "element-shape"));
- }
- var columnColorPalette = this.getPalette("color.palette.column");
- columnColorPalette.setData(columnDataSet, "color");
- columnColorPalette.setAccessor(this._columnColorAccessor);
- columnColorPalette.setNullColor(this.getStringProperty("color.null"));
- var swap = this.getBooleanProperty("swapLineColumn");
- var lineColorPalette = this.getPalette("color.palette.line");
- lineColorPalette.setData(lineDataSet, lineColorSlotName);
- lineColorPalette.setAccessor(com_ibm_rave_bundles_data_LineDataUtilities.GROUP_ACCESSOR);
- var drawLineOrPoints = this.getStringProperty("lineWithPoints.display");
- var drawPoints = ("line_points" == drawLineOrPoints || "points" == drawLineOrPoints);
- var drawLine = ("line_points" == drawLineOrPoints || "line" == drawLineOrPoints);
- this.configureLegends(effect, duration, useLineLegend, useColumnLegend, legendPosition, columnColorDataSlotEntry, lineColorDataSlotEntry, columnColorPalette, lineColorPalette, drawPoints);
- this.doLayout(columnDataSet, lineDataSet, duration, lineModelData, columnXDataSlotEntry, columnYDataSlotEntry, lineXDataSlotEntry, lineYDataSlotEntry, swap);
- if (this.updateType == 0 && this._independentScale && this.getBooleanProperty("sortX")) {
- com_ibm_rave_bundles_data_LineDataUtilities.sortLines(this._lineData, this._independentScale);
- }
- if (this.updateType == 0) {
- this._pointData = com_ibm_rave_bundles_data_LineDataUtilities.getLineWithPoints(this._lineData);
- this._pointNPNData = com_ibm_rave_bundles_data_LineDataUtilities.getNPNPoints(this._lineData);
- }
- var elementRect = this._layoutComponent.elementRect();
- this._clip.clipRect(elementRect).applyTo(this._chart.select(".content1")).call(this.context.node.select("defs"));
- this._clip.clipRect(elementRect).applyTo(this._chart.select(".content2")).call(this.context.node.select("defs"));
- this._chart.select("rect.background.elements").attr("x", elementRect.x).attr("y", elementRect.y).attr("width", elementRect.width).attr("height", elementRect.height);
- this._legends.rectangle(this._layoutComponent.legendRect());
- this.setBackgroundProperties(elementRect, duration);
- this.configureDataLabels(columnDataSet, columnColorDataSlotEntry);
- this.drawLinesAndPoints(columnDataSet, lineDataSet, effect, duration, lineColorDataSlotEntry, lineColorSlotName, columnColorPalette, lineColorPalette, drawPoints, drawLine, elementRect);
- this.drawAxes(duration, columnXDataSlotEntry, columnYDataSlotEntry, lineYDataSlotEntry);
- this._legends.draw();
- this.zoom(swap, elementRect);
- this.runLabelCollisions(this._chart, elementRect, duration, this.delayFunction(duration, this._independentScale));
- this.resetUpdate();
- this._chart.selectAll(".element-shape").classed("bundle-shape", true);
- this._chart.selectAll(".legendShape").classed("bundle-shape", true);
- },
- drawAxes : function(duration, columnXDataSlotEntry, columnYDataSlotEntry, lineYDataSlotEntry) {
- var stacked100 = "Stacked100" == this.getStringProperty("data.handling");
- var subDomainDivisionColumn = columnYDataSlotEntry.subDomainDivision();
- var scaleDivisionColumn = subDomainDivisionColumn == null ? null : + (subDomainDivisionColumn);
- var subDomainDivisionLine = lineYDataSlotEntry.subDomainDivision();
- var scaleDivisionLine = subDomainDivisionLine == null ? null : + (subDomainDivisionLine);
- 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);
- this._axes.draw();
- },
- doLayout : function(columnDataSet, lineDataSet, duration, lineModelData, columnXDataSlotEntry, columnYDataSlotEntry, lineXDataSlotEntry, lineYDataSlotEntry, swap) {
- var legendPosition;
- if (this.updateType <= 1) {
- this._independentScale = this.makeIndependentScale(columnDataSet, lineDataSet);
- this._intervalDependentScale = this.makeIntervalDependentScale(columnDataSet.slot("y").entry(), this._intervalData);
- this._lineDependentScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(lineModelData, lineYDataSlotEntry);
- var subDomainDivisionColumn = columnYDataSlotEntry.subDomainDivision();
- var scaleDivisionColumn = subDomainDivisionColumn == null ? null : + (subDomainDivisionColumn);
- var subDomainDivisionLine = lineYDataSlotEntry.subDomainDivision();
- var scaleDivisionLine = subDomainDivisionLine == null ? null : + (subDomainDivisionLine);
- 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);
- this.prepareLayoutComponent();
- this.prepareLayoutSizables(this._layoutComponent, false, true, true, true, this._legends.anyVisible());
- legendPosition = this._layoutComponent.legendPosition();
- var isLegendLeftOrRight = "left" == legendPosition || "right" == legendPosition;
- if (isLegendLeftOrRight) {
- this._legends.preLayout(this._layoutComponent, false);
- this._axes.preLayout(this._layoutComponent, false, 0.1, 0.05, 0, 0.1, 0.0, 0);
- } else {
- this._axes.preLayout(this._layoutComponent, true, 0.1, 0.05, 0, 0.1, 0.0, 0);
- this._legends.preLayout(this._layoutComponent, true);
- }
- this._layoutComponent.layout();
- this._legends.position(legendPosition);
- this._axes.useBoundsFromLayout(this._layoutComponent).setIndependentScaleRanges(0.1, 0.05, 0).setDependentScaleRanges(0.1, 0.0, 0);
- if (this._independentScale) {
- var csize = this.getCSSSizeToPixelNumber("column.size");
- this._independentScale.setWidth(csize);
- this._independentScale.applyWidth(this.getBooleanProperty("column.applysize"));
- this._independentScale.expandZeroExtent(false);
- this._independentScale.expandPixels(csize / 2.0 + 1.0, false);
- if (this.getBooleanProperty("axis.x.scale.nice")) {
- this._independentScale.nice();
- }
- if (this.getBooleanProperty("axis.x.scale.includeZero")) {
- this._independentScale.includeZero();
- }
- this.indepScale = this._independentScale.scale().copy();
- }
- var intervalDomainmax = 0.0;
- if (this._intervalDependentScale) {
- intervalDomainmax = + (this._intervalDependentScale.scale().domain()[1]);
- if (this.getBooleanProperty("axis.y.scale.includeZero")) {
- this._intervalDependentScale.includeZero();
- }
- this._intervalDependentScale.expandZeroExtent(true);
- if (this.getBooleanProperty("axis.y.scale.nice")) {
- this._intervalDependentScale.nice(scaleDivisionColumn);
- }
- }
- var lineDomainmax = 0.0;
- if (this._lineDependentScale) {
- lineDomainmax = + (this._lineDependentScale.scale().domain()[1]);
- if (this.getBooleanProperty("axis.y2.scale.includeZero")) {
- this._lineDependentScale.includeZero();
- }
- this._lineDependentScale.expandZeroExtent(true);
- if (this.getBooleanProperty("axis.y2.scale.nice")) {
- this._lineDependentScale.nice(scaleDivisionLine);
- }
- }
- var isLineOnly = "line" == this.getStringProperty("lineWithPoints.display");
- var linePadding = isLineOnly ? 2.0 : Math.max(2.0, 2 + Math.sqrt(this.getCSSSizeToPixelNumber("lineWithPoints.size")));
- var intervalPadding = 2.0;
- if (this.getBooleanProperty("data.label.display")) {
- if (this._lineDependentScale) {
- var lineNiceScaleDomain = this._lineDependentScale.scale().domain();
- var lineRange = this._lineDependentScale.scale().range();
- var pixelPerUnit = Math.abs(+ (lineRange[1]) - + (lineRange[0])) / Math.abs(+ (lineNiceScaleDomain[1]) - + (lineNiceScaleDomain[0]));
- linePadding = 20 - (Math.abs(+ (lineNiceScaleDomain[1]) - lineDomainmax) * pixelPerUnit);
- }
- var columnColorDataSlotEntry = columnDataSet.slot("color").entry();
- var dataHandling = this.getStringProperty("data.handling");
- var isStacked = (columnColorDataSlotEntry) && ("Stacked" == dataHandling || "Stacked100" == dataHandling);
- if (this._intervalDependentScale && !isStacked) {
- var intervalNiceScaleDomain = this._intervalDependentScale.scale().domain();
- var intervalRange = this._intervalDependentScale.scale().range();
- var dependentScaleLengthPx = Math.abs(+ (intervalRange[1]) - + (intervalRange[0]));
- var intervalPixelPerUnit = dependentScaleLengthPx / Math.abs(+ (intervalNiceScaleDomain[1]) - + (intervalNiceScaleDomain[0]));
- var paddingNeeded = 20;
- if (this._transpose && (""+(intervalDomainmax)).length * 12 < dependentScaleLengthPx / 4) {
- paddingNeeded = (""+(intervalDomainmax)).length * 12;
- }
- intervalPadding = paddingNeeded - Math.abs(+ (intervalNiceScaleDomain[1]) - intervalDomainmax) * intervalPixelPerUnit;
- }
- }
- if (this._intervalDependentScale && this._lineDependentScale && this.getBooleanProperty("alignAxes")) {
- com_ibm_rave_bundles_components_AlignAxisTicksComponent.alignAxisScales(this._intervalDependentScale, this._lineDependentScale);
- }
- if (this.isSameDomain() || this.getBooleanProperty("alignAxes")) {
- this._intervalDependentScale.expandPixels(Math.max(linePadding, intervalPadding), true);
- this._lineDependentScale.expandPixels(Math.max(linePadding, intervalPadding), true);
- } else {
- if (this._intervalDependentScale) {
- this._intervalDependentScale.expandPixels(intervalPadding, true);
- }
- if (this._lineDependentScale) {
- this._lineDependentScale.expandPixels(linePadding, true);
- }
- }
- if (this._intervalDependentScale) {
- this.intervalScale = this._intervalDependentScale.scale().copy();
- }
- if (this._lineDependentScale) {
- this.lineScale = this._lineDependentScale.scale().copy();
- }
- this.resetZoom();
- }
- },
- isSameDomain : function() {
- if ((!this._intervalDependentScale) || (!this._lineDependentScale)) {
- return false;
- }
- var y1Domain = this._intervalDependentScale.scale().domain();
- var y1Min = Math.floor(+ (y1Domain[0]));
- var y1Max = Math.ceil(+ (y1Domain[1]));
- var y2Domain = this._lineDependentScale.scale().domain();
- var y2Min = Math.floor(+ (y2Domain[0]));
- var y2Max = Math.ceil(+ (y2Domain[1]));
- var minDifferent = (y1Min < y2Min) || (y1Min > y2Min);
- var maxDifferent = (y1Max < y2Max) || (y1Max > y2Max);
- return (minDifferent || maxDifferent) ? false : true;
- },
- zoom : function(swap, elementRect) {
- if (this.updateType <= 2) {
- var ops = this.getStringProperty("zoom");
- if (this._independentScale && (ops == "all" || ops == "x")) {
- (this._independentScale.scale()).domain(this.indepScale.domain());
- }
- if (this._intervalDependentScale && (ops == "all" || ops == "y")) {
- (this._intervalDependentScale.scale()).domain(this.intervalScale.domain());
- }
- if (this._lineDependentScale && (ops == "all" || ops == "y2")) {
- (this._lineDependentScale.scale()).domain(this.lineScale.domain());
- }
- var xScale = this._transpose ? (swap ? this._lineDependentScale : this._intervalDependentScale) : this._independentScale;
- var x2Scale = this._transpose ? (swap ? this._intervalDependentScale : this._lineDependentScale) : null;
- var yScale = this._transpose ? this._independentScale : (swap ? this._lineDependentScale : this._intervalDependentScale);
- var y2Scale = this._transpose ? null : this._lineDependentScale;
- var self = this;
- var zoom = this.context.actions.action("zoom").get("zoom");
- 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) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- self._chart.selectAll("g.element-column").call(self._intervalComponent);
- self._chart.selectAll("g.element-line").call(self._lineComponent);
- if (self._pointComponent) {
- self._chart.selectAll("g.element-point").call(self._pointComponent);
- }
- self._axes.redraw(true);
- self._chart.call(self._labelCollisionComponent);
- return self._chart;
- }
- });
- zoom.on("zoomend.hideLabels", function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- if (self._axes.hideAnyPanZoom()) {
- if (self.zoomendedTimer != null) {
- clearTimeout(self.zoomendedTimer);
- }
- self.zoomendedTimer = setTimeout(function() {
- self.zoomendedTimer = null;
- self._axes.redraw(false);
- self._chart.call(self._labelCollisionComponent);
- }, 300);
- }
- return null;
- }
- });
- }
- },
- drawLinesAndPoints : function(columnDataSet, lineDataSet, effect, duration, lineColorDataSlotEntry, lineColorSlotName, columnColorPalette, lineColorPalette, drawPoints, drawLine, elementRect) {
- 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());
- this._chart.selectAll("g.element-column").transition("transition").duration(duration).call(this._intervalComponent);
- var lineKeyDataSlotEntry = lineDataSet.slot("key").entry();
- if (drawLine) {
- this._lineComponent.data(this._lineData);
- } else {
- this._lineComponent.data(null);
- }
- var showMissingAsGap = this.getBooleanProperty("lineWithPoints.showMissingAsGap");
- 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"));
- this._chart.selectAll("g.element-line").transition("transition").duration(duration).call(this._lineComponent);
- if (drawPoints || this.isShowDataLabels()) {
- this._pointComponent.data(this._pointData);
- } else {
- this._pointComponent.data(showMissingAsGap ? this._pointNPNData : null);
- }
- this.configureLineDataLabels(lineDataSet);
- var pointsColorPalette = this.getPalette("color.palette.line");
- pointsColorPalette.setData(lineDataSet, lineColorSlotName);
- pointsColorPalette.setAccessor(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(lineColorDataSlotEntry)));
- 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);
- this._chart.selectAll("g.element-point").transition("transition").duration(duration).call(this._pointComponent);
- },
- configureLegends : function(effect, duration, useLineLegend, useColumnLegend, legendPosition, columnColorDataSlotEntry, lineColorDataSlotEntry, columnColorPalette, lineColorPalette, drawPoints) {
- var lineTitleString = (this.context.getPropertyValue("legend.line.titlestyle.font"));
- if (lineTitleString != null) {
- this._legends.titleFont(0, lineTitleString);
- }
- var lineEntryString = (this.context.getPropertyValue("legend.line.entrystyle.font"));
- if (lineEntryString != null) {
- this._legends.entryFont(0, lineEntryString);
- }
- var columnTitleString = (this.context.getPropertyValue("legend.column.titlestyle.font"));
- if (columnTitleString != null) {
- this._legends.titleFont(1, columnTitleString);
- }
- var columnEntryString = (this.context.getPropertyValue("legend.column.entrystyle.font"));
- if (columnEntryString != null) {
- this._legends.entryFont(1, columnEntryString);
- }
- 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);
- },
- /**
- * 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.
- * @param dataModel Data model to be checked
- * @return (boolean) True if X accessors are the same type, false otherwise
- */
- compatibleDomains : function(columnDataSet, lineDataSet) {
- var columnDataSlotEntry = columnDataSet.slot("x").entry();
- var lineDataSlotEntry = lineDataSet.slot("x").entry();
- if (columnDataSlotEntry && lineDataSlotEntry && !(columnDataSlotEntry.type() == lineDataSlotEntry.type())) {
- com_ibm_rave_library_Library.logError(101, "The column bundle X accessors must be the same type");
- return false;
- }
- return true;
- },
- /**
- * 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.
- * @return (rave['library']['internal']['CoordinateScaleImpl']) Coordinate scale for the independent values
- */
- makeIndependentScale : function(columnDataSet, lineDataSet) {
- var columnData = (columnDataSet.data());
- var lineData = (lineDataSet.data());
- var columnXAccessor = columnDataSet.slot("x").entry();
- var lineXAccessor = lineDataSet.slot("x").entry();
- if (!columnXAccessor || !lineXAccessor) {
- return null;
- }
- var columnScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(columnData, columnXAccessor);
- var lineScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(lineData, lineXAccessor);
- var isClustered = "Clustered" == this.getStringProperty("data.handling");
- if (isClustered || "string" == columnXAccessor.type()) {
- var intervalDomain = (rave['library']['internal']['ScaleManager'].ordinalDomain(columnData, columnXAccessor));
- var lineDomain = (rave['library']['internal']['ScaleManager'].ordinalDomain(lineData, lineXAccessor));
- var uniqueValues = [];
- var originalDomainMap = rave['internal']['ES6Map'].create();
- if (intervalDomain) {
- for (var __i_enFor0 = 0, __exp_enFor0 = intervalDomain, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var v = __exp_enFor0[__i_enFor0];
- if (v != null) {
- var datum = originalDomainMap.get(v);
- if (!datum) {
- uniqueValues.push(v);
- datum = originalDomainMap.set(v, new rave['library']['internal']['OrdinalCoordinateScaleDatum'](v));
- }
- }
- }
- }
- if (lineDomain) {
- for (var __i_enFor1 = 0, __exp_enFor1 = lineDomain, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var v = __exp_enFor1[__i_enFor1];
- if (v != null) {
- var datum = originalDomainMap.get(v);
- if (!datum) {
- uniqueValues.push(v);
- datum = originalDomainMap.set(v, new rave['library']['internal']['OrdinalCoordinateScaleDatum'](v));
- }
- }
- }
- }
- for (var __i_enFor2 = 0, __exp_enFor2 = columnData, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var o = __exp_enFor2[__i_enFor2];
- var key = columnXAccessor(o);
- var datum = originalDomainMap.get(key);
- if (datum) {
- datum.push(o);
- }
- }
- for (var __i_enFor3 = 0, __exp_enFor3 = lineData, __len_enFor3 = __exp_enFor3.length;
- __i_enFor3 < __len_enFor3; ++__i_enFor3) {
- var o = __exp_enFor3[__i_enFor3];
- var key = lineXAccessor(o);
- var datum = originalDomainMap.get(key);
- if (datum) {
- datum.push(o);
- }
- }
- var originalDomain = [];
- for (var __i_enFor4 = 0, __exp_enFor4 = uniqueValues, __len_enFor4 = __exp_enFor4.length;
- __i_enFor4 < __len_enFor4; ++__i_enFor4) {
- var d = __exp_enFor4[__i_enFor4];
- originalDomain.push(originalDomainMap.get(d));
- }
- if (isClustered) {
- var colorAccessor = columnDataSet.slot("color").entry();
- var domains = [];
- domains.push(uniqueValues);
- domains.push(rave['library']['internal']['ScaleManager'].ordinalDomain(columnData, colorAccessor));
- columnScale = rave['library']['internal']['ClusteredCoordinateScale'].create(domains, originalDomain);
- } else {
- columnScale = rave['library']['internal']['OrdinalCoordinateScale'].create(uniqueValues, originalDomain);
- }
- } else {
- var intervalDomain = columnScale.scale().domain();
- var lineDomain = lineScale.scale().domain();
- if (intervalDomain.length == 0 && !lineDomain) {
- return null;
- }
- var domain;
- if (intervalDomain.length == 0 && lineDomain) {
- domain = (lineDomain);
- } else if (!lineDomain && intervalDomain.length > 0) {
- domain = (intervalDomain);
- } else {
- domain = [rave.min([intervalDomain[0], lineDomain[0]]), rave.max([intervalDomain[1], lineDomain[1]])];
- }
- var type = lineXAccessor.type();
- if ("numeric" == type) {
- columnScale = rave['library']['internal']['LinearCoordinateScale'].create(domain);
- } else {
- columnScale = rave['library']['internal']['TimeCoordinateScale'].create(domain);
- }
- }
- if (columnScale) {
- columnScale.originalDomainLabelAccessor(function(data, index, groupIndex) {
- var key = (data).key();
- return ""+(key);
- });
- }
- return columnScale;
- },
- /**
- * 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.
- * @param (Array) data Data array
- * @return (rave['library']['internal']['CoordinateScaleImpl']) Coordinate scale for the range of values
- */
- makeIntervalDependentScale : function(columnYDataSlotEntry, data) {
- var domain = columnYDataSlotEntry.domain();
- if (domain) {
- return rave['library']['internal']['LinearCoordinateScale'].create(domain);
- }
- var omax = rave.max(data, function(data, ix, gix) {
- var dep1 = + (((data).dep1));
- var dep2 = + (((data).dep2));
- return dep1 != 0 ? Math.max(dep1, dep2) : dep2;
- });
- if (omax == null) {
- return null;
- }
- var omin = rave.min(data, function(data, ix, gix) {
- var dep1 = + (((data).dep1));
- var dep2 = + (((data).dep2));
- return dep1 != 0 ? Math.min(dep1, dep2) : dep2;
- });
- var scale = rave['library']['internal']['LinearCoordinateScale'].create([omin, omax]);
- return scale;
- },
- /** @expose */
- getCoordinateScale : function(role) {
- if ("ROLE_X1" == role) {
- return this._independentScale;
- }
- if ("ROLE_Y1" == role) {
- return this._intervalDependentScale;
- }
- if ("ROLE_Y2" == role) {
- return this._lineDependentScale;
- }
- return null;
- },
- /**
- * 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.
- * @param (boolean) swap true if we are swapping the dependent axes
- * @return (String) the proper zoom code
- */
- convertZoomOps : function(swap) {
- var zoom = this.getStringProperty("zoom");
- if (this._transpose) {
- if ("x" == zoom) {
- zoom = "y";
- } else if ("y" == zoom) {
- if (swap) {
- zoom = "x2";
- } else {
- zoom = "x";
- }
- } else if ("y2" == zoom) {
- if (swap) {
- zoom = "x";
- } else {
- zoom = "x2";
- }
- }
- }
- return zoom;
- },
- /**
- * 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.
- * @param (int) duration
- * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale
- * @return (rave['internal']['ValueFunction'])
- */
- delayFunction : function(duration, independentScale) {
- if (duration > 0 && independentScale && this.getBooleanProperty("effect.delay")) {
- var range = independentScale.scale().range();
- if (range && range.length > 1) {
- var rmin = (+ (range[0]));
- var rmax = (+ (range[range.length - 1]));
- if (rmin != rmax) {
- var scaling = duration / (rmax - rmin);
- return function(data, index, groupIndex) {
- return (+ (independentScale.center((data).ind1)) - rmin) * scaling;
- };
- }
- }
- }
- return null;
- },
- /** @expose */
- requireUpdate : function(property) {
- if (property == "axis.y2.title.text" && !(this.getBooleanProperty("axis.y2.title.display"))) {
- return 4;
- }
- if (property == "legend.title.column" && !(this.isShowLegend())) {
- return 4;
- }
- if (property == "legend.title.line" && !(this.isShowLegend())) {
- return 4;
- }
- if (property == "swapLineColumn") {
- return 1;
- }
- return rave['library']['internal']['AbstractView'].prototype.requireUpdate.call(this, property);
- },
- /**
- * Set up all actions, taking into account the settings for the border width and color.
- */
- /** @expose */
- setActionsWithBorder : function() {
- var self = this;
- var borderWidth = this.context.convertCSSSizeToPixels(this.context.getPropertyValue("column.borderWidth"));
- var v = this.getProperty("column.borderColor");
- var borderColor = v == null ? null : ""+(v);
- var style = {};
- style["stroke-width"] = borderWidth;
- style["stroke"] = borderColor;
- var highlightAction = this.context.actions.action("highlight");
- var unhighlightAction = this.context.actions.action("unhighlight");
- var deselectAllAction = this.context.actions.action("deselectAll");
- var lineHighlightEventListener = function(data, index, groupIndex, event) {
- if (this.rave_getParentNode().rave_containsClass("element-line") && this.rave_containsClass("element-shape")) {
- rave.select(this).style("stroke-width", 4);
- } else {
- highlightAction(rave.select(this));
- }
- };
- highlightAction.setBindFn(rave['library']['internal']['BundleUtils'].bindOrUnbindActionFunctionCreater(this.context, ".element-point .element-shape, .element-line .element-shape, .element-column .element-shape", ["mouseenter.default"], lineHighlightEventListener));
- var unhighlightEventListener = function(data, index, groupIndex, event) {
- if (this.rave_getParentNode().rave_containsClass("element-line") && this.rave_containsClass("element-shape")) {
- rave.select(this).style("stroke-width", 2);
- } else if (this.rave_getParentNode().rave_containsClass("element-point") && this.rave_containsClass("element-shape")) {
- rave.select(this).style("stroke-width", 0);
- } else if (this.rave_getParentNode().rave_getParentNode().rave_containsClass("element-column") && this.rave_containsClass("element-shape")) {
- highlightAction(rave.select(this), style);
- }
- };
- unhighlightAction.setBindFn(rave['library']['internal']['BundleUtils'].bindOrUnbindActionFunctionCreater(this.context, ".element-point .element-shape, .element-line .element-shape, .element-column .element-shape", ["mouseout.default"], unhighlightEventListener));
- var deselectAllEventListener = function(data, index, groupIndex, event) {
- self.context.node.selectAll(".element-point .element-shape").style("stroke-width", 0).style("opacity", 1).property("selected", null);
- self.context.node.selectAll(".element-line .element-shape").style("stroke-width", 2).style("opacity", 1).property("selected", null);
- self.context.node.selectAll(".element-column .element-shape").style(style).style("opacity", 1).property("selected", null);
- };
- deselectAllAction.setBindFn(rave['library']['internal']['BundleUtils'].bindOrUnbindActionFunctionCreater(this.context, ".background", ["click.default", "touchstart.default"], deselectAllEventListener));
- },
- /** @expose */
- configureLineDataLabels : function(dataSet) {
- if (!(this.isShowDataLabels())) {
- this._pointComponent.itemLabel(false);
- this._pointComponent.itemLabelPosition(null);
- this._pointComponent.labelFont(null);
- this._pointComponent.labelAccessor(null);
- this._pointComponent.labelFormatter(null);
- return;
- }
- var self = this;
- var dataLabelPosition = function(data, index, groupIndex) {
- var currentData = data;
- var prevData = (index == 0) ? null : self._pointData[index - 1];
- var nextData = (index == self._pointData.length - 1) ? null : self._pointData[index + 1];
- if (!prevData || !nextData) {
- return 0;
- }
- var angleWithPreviousPoint = Math.atan2(self._lineDependentScale.center(prevData._y) - self._lineDependentScale.center(currentData._y), self._independentScale.center(prevData._x) - self._independentScale.center(currentData._x));
- var angleWithNextPoint = Math.atan2(self._lineDependentScale.center(nextData._y) - self._lineDependentScale.center(currentData._y), self._independentScale.center(nextData._x) - self._independentScale.center(currentData._x));
- if (angleWithNextPoint <= 0 && angleWithPreviousPoint <= 0) {
- return 2;
- }
- if ((angleWithNextPoint >= 0 && angleWithPreviousPoint >= 0) || ((180 - Math.abs(angleWithPreviousPoint * (180 / Math.PI)) < 30) && Math.abs(angleWithNextPoint * (180 / Math.PI)) < 30)) {
- return 0;
- }
- if (180 - Math.abs(angleWithPreviousPoint * (180 / Math.PI)) > 30) {
- return 3;
- }
- return 4;
- };
- var labelAccessor = this.getlDataLabelAccessor(dataSet, "label", false);
- var labelEntry = this.getEntryForDataLabelFormatter(dataSet, "label", "y");
- this._pointComponent.itemLabel(true);
- this._pointComponent.labelFont(this.getBackgroundConstrastLabelStyle());
- this._pointComponent.labelFormatter(this.context.getCustomFormatterForElementLabels(labelEntry, (dataSet.slot("label").entry()) ? "ROLE_NONE" : "ROLE_Y2"));
- this._pointComponent.labelAccessor(labelAccessor);
- this._pointComponent.itemLabelPosition(dataLabelPosition);
- },
- /**
- * 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.
- * @param (rave['internal']['Selector']) chart the entire chart
- * @param (rave['internal']['RectStruct']) chartRect the center rectangle for the chart area, without axes or legends
- * @param (Object) delayFunction if null, there are no staggered transitions
- */
- /** @expose */
- runLabelCollisions : function(chart, chartRect, duration, delayFunction) {
- if (!(this.isShowDataLabels())) {
- return;
- }
- var self = this;
- var staggeredTransitions = delayFunction == null ? false : true;
- this._pendingLabelTimer = true;
- var labelCollideCallback = function(elapsed) {
- if (self._cancelLabelTimers > 0) {
- self._cancelLabelTimers--;
- return true;
- }
- self._labelCollisionComponent.bounds(chartRect).numberOfSweeps(1000).labelResolution("Drop Labels");
- chart.call(self._labelCollisionComponent);
- self._pendingLabelTimer = false;
- return true;
- };
- if (staggeredTransitions) {
- rave.timer(labelCollideCallback, duration * 2.0);
- } else {
- rave.timer(labelCollideCallback, duration);
- }
- },
- /**
- * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
- */
- /** @expose */
- stopLabelCollisions : function() {
- this._labelCollisionComponent.labelResolution("none");
- if (this._pendingLabelTimer) {
- this._cancelLabelTimers++;
- }
- },
- /** @expose */
- getGroupStructure : function() {
- 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", ")", ")"];
- }
- });
- com_ibm_rave_bundles_compositeBundle_CompositeView.SCALE_PADDING = 2.0;
- //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASET_COLUMNDATA = "column";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASET_LINEDATA = "line";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASLOT_GROUP = "color";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.DATASLOT_KEY = "key";
- /**
- * CSS class for shapes inside an element.
- */
- //com_ibm_rave_bundles_compositeBundle_CompositeView.ELEMENT_SHAPE_CLASSES = "element-shape";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_WITH_POINTS_SYMBOL = "lineWithPoints.symbol";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_OR_POINTS_DISPLAY = "lineWithPoints.display";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_DISPLAY = "line";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.POINTS_DISPLAY = "points";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_WITH_POINTS_DISPLAY = "line_points";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.COLUMN_BORDER_WIDTH = "column.border.width";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.COLUMN_BORDER_COLOR = "column.border.color";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_WITH_POINTS_SIZE = "lineWithPoints.size";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.COLOR_PALLETTE_COLUMN = "color.palette.column";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.COLOR_PALLETTE_LINE = "color.palette.line";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.AXIS_LINE_COLUMN_SWAP = "swapLineColumn";
- /** @expose */
- com_ibm_rave_bundles_compositeBundle_CompositeView.GRID_ALIGN_DEPENDENT_AXES = "alignAxes";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_INTERPOLATE_PROPERTY = "lineWithPoints.interpolate";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LINE_MISSING_AS_GAP_PROPERTY = "lineWithPoints.showMissingAsGap";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_DISPLAY = "legend.line.display";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLE = "legend.line.title";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FONT = "legend.line.titlestyle.font";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_ENTRYSTYLE_FONT = "legend.line.entrystyle.font";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FILL = "legend.line.titlestyle.fill";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FONTSIZE = "legend.line.titlestyle.fontsize";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_LINE_TITLESTYLE_FONTFAMILY = "legend.line.titlestyle.fontfamily";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_DISPLAY = "legend.column.display";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLE = "legend.column.title";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FONT = "legend.column.titlestyle.font";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_ENTRYSTYLE_FONT = "legend.column.entrystyle.font";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FILL = "legend.column.titlestyle.fill";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FONTSIZE = "legend.column.titlestyle.fontsize";
- //com_ibm_rave_bundles_compositeBundle_CompositeView.LEGEND_COLUMN_TITLESTYLE_FONTFAMILY = "legend.column.titlestyle.fontfamily";
- com_ibm_rave_bundles_compositeBundle_CompositeView.DATASET_COMPOSITE = "composite";
- com_ibm_rave_bundles_compositeBundle_CompositeView.DATAMODEL_SIMPLE = "simple";
- // $source: com/ibm/rave/bundles/components/BackgroundComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/BackgroundComponent (runtime) // BackgroundComponent
- /**
- * <p> Component to set the background color of a bundle. The component properties are: </p> <ul> <li> <b>backgroundColor</b>: The background color, null by default. </li> <li> <b>size</b>: The size of the bundle, from the context node, null by default. </li> </ul> <p> The component assumes that the selector on which it is executed is a "rect" shape which lies below the chart. If the size property is non-null, it sets the geometry of this rectangle to be the given size, with upper-left corner at 0,0. If the size is null, the rectangle is not resized. </p> <p> The rectangle fill is set to the backgroundColor property. If the property is null, white (#FFFFFF) is used. TODO. Should we set it to null, so the CSS style can also be used to set the background? </p>
- */
- var com_ibm_rave_bundles_components_BackgroundComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //_backgroundColor : null,
- //_rect : null,
- /** @expose */
- constructor : function() {
- this._rect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- g.style("fill", this._backgroundColor != null ? this._backgroundColor : "#FFFFFF").style("fill-opacity", 1.0);
- g.attr("x", this._rect.x).attr("y", this._rect.y).attr("width", this._rect.width).attr("height", this._rect.height);
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE;
- },
- backgroundColor$0 : function() {
- return this._backgroundColor;
- },
- backgroundColor$1 : function(backgroundColor) {
- this._backgroundColor = backgroundColor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['ContextSize']) size New value of size property
- * @return (com.ibm.rave.bundles.components.BackgroundComponentImpl) This component
- */
- /** @expose */
- size : function(size) {
- this._rect.x = 0;
- this._rect.y = 0;
- this._rect.width = size.w;
- this._rect.height = size.h;
- return this;
- },
- /** @expose */
- rect : function(rect) {
- var r = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
- this._rect = r;
- return this;
- },
- /** @expose */
- backgroundColor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.backgroundColor$0();
- }
- return this.backgroundColor$1(a0);
- }
- });
- // $source: com/ibm/rave/bundles/components/ChartLayoutComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/ChartLayoutComponent (runtime) // ChartLayoutComponent
- /**
- * <p> Implementation of the chart layout component API. General sequence in a bundle view: </p> <ul> <li> Configure the layout component by setting component properties from bundle properties and/or using the utility methods. </li> <li> Run the layout either by calling {@link #this.layout()} , or using a selector to call the layout. The selector is irrelevant, and {@link #this.execute(rave['internal']['Selector'])} ignores its argument and simply calls {@link #this.layout()} . Running the layout makes the pre-execute callback, allowing the integrator to change layout properties. </li> <li> On return, use the rectangles to position other components. Note that the integrator can change the properties, so the view should update its values; in particular the legendPosition could be changed, so the legend component should use the position after running the layout. </li> </ul>
- */
- var com_ibm_rave_bundles_components_ChartLayoutComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //_padding : null,
- //_legendChartGap : null,
- //_topChartPadding : null,
- //_leftChartPadding : null,
- //_bottomChartPadding : null,
- //_rightChartPadding : null,
- //_legendPosition : null,
- //_legendSizable : null,
- //_axisSizables : null,
- //_overallRect : null,
- //_legendRect : null,
- //_chartRect : null,
- //_topRect : null,
- //_leftRect : null,
- //_bottomRect : null,
- //_rightRect : null,
- //_elementRect : null,
- _leftPadding : 0, _topPadding : 0, _rightPadding : 0, _bottomPadding : 0,
- _legendChartAlign : false,
- _preLegendAtMax : false,
- _preAxesAtZero : false,
- constructor : function() {
- this._axisSizables = [];
- /**
- * Construct. All padding is 0, legendPosition is "right", all slices have a size of 0 (value of null).
- */
- {
- this._padding = 0.0;
- this._topPadding = 0;
- this._leftPadding = 0;
- this._bottomPadding = 0;
- this._rightPadding = 0;
- this._topChartPadding = 0.0;
- this._leftChartPadding = 0.0;
- this._bottomChartPadding = 0.0;
- this._rightChartPadding = 0.0;
- this._legendChartGap = 0.0;
- this._legendPosition = "right";
- this._overallRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._legendRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._chartRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._topRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._leftRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._bottomRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._rightRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._legendChartAlign = true;
- }
- },
- /** @expose */
- execute : function(g) {
- this.layout();
- },
- /**
- * Calculates rectangles during preliminary layout
- * @param (boolean) legendAtMax true if legend is given max size; false if legend is asked for its preferred size
- * @param (boolean) axesAtZero true if axes are given a size of 0; false if axes are asked for their preferred size
- */
- /** @expose */
- preLayout : function(legendAtMax, axesAtZero) {
- this._preLegendAtMax = legendAtMax;
- this._preAxesAtZero = axesAtZero;
- this.layout();
- this._preLegendAtMax = false;
- this._preAxesAtZero = false;
- },
- /**
- * Calls preExecute, then does the layout with the property values, updating the chart, legend, axis, and elements rectangles.
- */
- /** @expose */
- layout : function() {
- this.preExecute();
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._chartRect, this._overallRect);
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._legendRect, this._overallRect);
- var x = this._overallRect.x;
- var y = this._overallRect.y;
- var w = this._overallRect.width;
- var h = this._overallRect.height;
- var maxWH = Math.max(w, h);
- var tbLegend = "top" == this._legendPosition || "bottom" == this._legendPosition;
- var legendPercent = this._axisSizables.length == 0 ? 0.5 : 0.3;
- var legendMaxSize = (tbLegend ? this._legendRect.height : this._legendRect.width) * legendPercent;
- var legendDynamicSize = this._legendSizable ? (this._preLegendAtMax ? maxWH : this._legendSizable.getPreferredSize()) : 0;
- if (legendDynamicSize > legendMaxSize) {
- legendDynamicSize = legendMaxSize;
- }
- var isLegendTop = false;
- var isLegendBottom = false;
- var isLegendLeft = false;
- var isLegendRight = false;
- if ("top" == this._legendPosition) {
- this._legendRect.height = legendDynamicSize;
- this._chartRect.height -= this._legendRect.height;
- this._chartRect.y += this._legendRect.height;
- isLegendTop = true;
- } else if ("bottom" == this._legendPosition) {
- this._legendRect.height = legendDynamicSize;
- this._chartRect.height -= this._legendRect.height;
- this._legendRect.y = y + h - this._legendRect.height;
- isLegendBottom = true;
- } else if ("left" == this._legendPosition) {
- this._legendRect.width = legendDynamicSize;
- this._chartRect.width -= this._legendRect.width;
- this._chartRect.x += this._legendRect.width;
- isLegendLeft = true;
- } else {
- this._legendRect.width = legendDynamicSize;
- this._chartRect.width -= this._legendRect.width;
- this._legendRect.x = x + w - this._legendRect.width;
- isLegendRight = true;
- }
- if (this.evaluatePadding(this._padding, w, h)) {
- var lrgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, w);
- var tbgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, h);
- var chartTop = isLegendTop && this._legendSizable ? tbgap : this._topPadding;
- var chartLeft = isLegendLeft && this._legendSizable ? lrgap : this._leftPadding;
- var chartBottom = isLegendBottom && this._legendSizable ? tbgap : this._bottomPadding;
- var chartRight = isLegendRight && this._legendSizable ? lrgap : this._rightPadding;
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
- } else {
- var lrpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, w);
- var tbpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, h);
- var chartTop = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);
- var chartLeft = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding, w);
- var chartBottom = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding, h);
- var chartRight = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._rightChartPadding, w);
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
- this._topPadding = tbpadding;
- this._leftPadding = lrpadding;
- this._bottomPadding = tbpadding;
- this._rightPadding = lrpadding;
- }
- if (this._legendSizable) {
- if (isLegendRight) {
- this._legendRect.x -= this._rightPadding;
- this._chartRect.width -= this._rightPadding;
- this._legendRect.y += this._topPadding;
- this._legendRect.height -= (this._topPadding + this._bottomPadding);
- } else if (isLegendLeft) {
- this._legendRect.x += this._leftPadding;
- this._chartRect.x += this._leftPadding;
- this._chartRect.width -= this._leftPadding;
- this._legendRect.y += this._topPadding;
- this._legendRect.height -= (this._topPadding + this._bottomPadding);
- } else if (isLegendTop) {
- this._legendRect.y += this._topPadding;
- this._chartRect.y += this._topPadding;
- this._chartRect.height -= this._topPadding;
- this._legendRect.x += this._leftPadding;
- this._legendRect.width -= (this._leftPadding + this._rightPadding);
- } else {
- this._legendRect.y -= this._bottomPadding;
- this._chartRect.height -= this._bottomPadding;
- this._legendRect.x += this._leftPadding;
- this._legendRect.width -= (this._leftPadding + this._rightPadding);
- }
- }
- x = this._chartRect.x;
- y = this._chartRect.y;
- w = this._chartRect.width;
- h = this._chartRect.height;
- var bottomH = 0;
- var topH = 0;
- var leftW = 0;
- var rightW = 0;
- var tbSO = 0;
- var lrSO = 0;
- if (!this._preAxesAtZero) {
- var countHorz = 0;
- var countVert = 0;
- for (var i = 0; i < this._axisSizables.length; ++i) {
- var sizable = this._axisSizables[i];
- if (sizable) {
- var orientation = sizable.getSizableOrientation();
- if ("top" == orientation || "bottom" == orientation) {
- countHorz++;
- } else {
- countVert++;
- }
- }
- }
- for (var i = 0; i < this._axisSizables.length; ++i) {
- var sizable = this._axisSizables[i];
- if (sizable) {
- var orientation = sizable.getSizableOrientation();
- var tbAxis = "top" == orientation || "bottom" == orientation;
- var axisDynamicSize = sizable.getPreferredSize();
- var spillOver = sizable.getSpillOverSize();
- if (tbAxis) {
- var axisPercent = countHorz > 1 ? 0.4 : 0.5;
- if (axisDynamicSize > this._chartRect.height * axisPercent) {
- axisDynamicSize = this._chartRect.height * axisPercent;
- }
- if ("top" == orientation) {
- topH = axisDynamicSize;
- } else {
- bottomH = axisDynamicSize;
- }
- if (spillOver > lrSO) {
- lrSO = spillOver;
- }
- } else {
- var axisPercent = countVert > 1 ? 0.4 : 0.5;
- if (axisDynamicSize > this._chartRect.width * axisPercent) {
- axisDynamicSize = this._chartRect.width * axisPercent;
- }
- if ("left" == orientation) {
- leftW = axisDynamicSize;
- } else {
- rightW = axisDynamicSize;
- }
- if (spillOver > tbSO) {
- tbSO = spillOver;
- }
- }
- }
- }
- }
- if (lrSO > leftW) {
- leftW = lrSO;
- }
- if (lrSO > rightW) {
- rightW = lrSO;
- }
- if (tbSO > topH) {
- topH = tbSO;
- }
- if (tbSO > bottomH) {
- bottomH = tbSO;
- }
- this._leftRect.x = x;
- this._leftRect.width = leftW;
- this._leftRect.y = y;
- this._leftRect.height = h;
- this._rightRect.x = x + w - rightW;
- this._rightRect.width = rightW;
- this._rightRect.y = y;
- this._rightRect.height = h;
- this._topRect.y = y;
- this._topRect.height = topH;
- this._topRect.x = x;
- this._topRect.width = w;
- this._bottomRect.y = y + h - bottomH;
- this._bottomRect.height = bottomH;
- this._bottomRect.x = x;
- this._bottomRect.width = w;
- this._elementRect.x = x + leftW;
- this._elementRect.y = y + topH;
- this._elementRect.width = w - (leftW + rightW);
- this._elementRect.height = h - (topH + bottomH);
- if (this._legendSizable && this._legendChartAlign) {
- if (tbLegend) {
- this._legendRect.x = this._elementRect.x;
- this._legendRect.width = this._elementRect.width;
- } else {
- this._legendRect.y = this._elementRect.y;
- this._legendRect.height = this._elementRect.height;
- }
- }
- },
- evaluatePadding : function(padding, horizontalExtent, verticalExtent) {
- if (padding == null) {
- return false;
- }
- var paddingString = (padding) + "";
- if (paddingString.length == 0) {
- return false;
- }
- this._topPadding = 0;
- this._leftPadding = 0;
- this._bottomPadding = 0;
- this._rightPadding = 0;
- var items = paddingString.split(new RegExp(";"));
- for (var __i_enFor0 = 0, __len_enFor0 = items.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var item = items[__i_enFor0];
- var parts = item.split(new RegExp(":"));
- if (items.length == 1 && parts.length != 2) {
- return false;
- }
- if (parts.length == 2) {
- if (0 <= parts[0].indexOf("top")) {
- this._topPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
- } else if (0 <= parts[0].indexOf("left")) {
- this._leftPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
- } else if (0 <= parts[0].indexOf("bottom")) {
- this._bottomPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
- } else if (0 <= parts[0].indexOf("right")) {
- this._rightPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
- }
- }
- }
- return true;
- },
- /**
- * @return (rave['internal']['RectStruct']) Legend rectangle
- */
- /** @expose */
- legendRect : function() {
- return this._legendRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Chart (elements plus axes) rectangle
- */
- /** @expose */
- chartRect : function() {
- return this._chartRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Top axis rectangle
- */
- /** @expose */
- topRect : function() {
- return this._topRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Left axis rectangle
- */
- /** @expose */
- leftRect : function() {
- return this._leftRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Bottom axis rectangle
- */
- /** @expose */
- bottomRect : function() {
- return this._bottomRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Right axis rectangle
- */
- /** @expose */
- rightRect : function() {
- return this._rightRect;
- },
- /**
- * @return (rave['internal']['RectStruct']) Legend rectangle
- */
- /** @expose */
- elementRect : function() {
- return this._elementRect;
- },
- /**
- * Set the overall rectangle. This should be called before doing the layout.
- * @param (rave['internal']['RectStruct']) overall The overall rectangle
- */
- /** @expose */
- overall : function(overall) {
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._overallRect, overall);
- return this;
- },
- padding$0 : function() {
- return this._padding;
- },
- legendChartAlign$0 : function() {
- return this._legendChartAlign;
- },
- legendChartGap$0 : function() {
- return this._legendChartGap;
- },
- topPadding$0 : function() {
- return this._topChartPadding;
- },
- leftPadding$0 : function() {
- return this._leftChartPadding;
- },
- bottomPadding$0 : function() {
- return this._bottomChartPadding;
- },
- rightPadding$0 : function() {
- return this._rightChartPadding;
- },
- legendPosition$0 : function() {
- return this._legendPosition;
- },
- topPadding$1 : function(padding) {
- this._topChartPadding = padding;
- return this;
- },
- leftPadding$1 : function(padding) {
- this._leftChartPadding = padding;
- return this;
- },
- bottomPadding$1 : function(padding) {
- this._bottomChartPadding = padding;
- return this;
- },
- rightPadding$1 : function(padding) {
- this._rightChartPadding = padding;
- return this;
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE;
- },
- padding$1 : function(value) {
- this._padding = value;
- return this;
- },
- /** @expose */
- chartPadding : function(top, left, bottom, right) {
- this._topChartPadding = top;
- this._leftChartPadding = left;
- this._bottomChartPadding = bottom;
- this._rightChartPadding = right;
- return this;
- },
- legendChartAlign$1 : function(legendChartAlign) {
- this._legendChartAlign = legendChartAlign;
- return this;
- },
- legendChartGap$1 : function(value) {
- this._legendChartGap = value;
- return this;
- },
- legendPosition$1 : function(position) {
- if ("top" == position || "bottom" == position || "left" == position || "right" == position) {
- this._legendPosition = position;
- }
- return this;
- },
- /** @expose */
- legendSize : function(sizable) {
- this._legendSizable = sizable;
- return this;
- },
- /** @expose */
- removeAxisSizables : function() {
- this._axisSizables.length = 0;
- return this;
- },
- /** @expose */
- addAxisSizable : function(sizable) {
- this._axisSizables.push(sizable);
- return this;
- },
- /** @expose */
- padding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.padding$0();
- }
- return this.padding$1(a0);
- },
- /** @expose */
- legendChartAlign : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendChartAlign$0();
- }
- return this.legendChartAlign$1(a0);
- },
- /** @expose */
- legendChartGap : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendChartGap$0();
- }
- return this.legendChartGap$1(a0);
- },
- /** @expose */
- topPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.topPadding$0();
- }
- return this.topPadding$1(a0);
- },
- /** @expose */
- leftPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.leftPadding$0();
- }
- return this.leftPadding$1(a0);
- },
- /** @expose */
- bottomPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.bottomPadding$0();
- }
- return this.bottomPadding$1(a0);
- },
- /** @expose */
- rightPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.rightPadding$0();
- }
- return this.rightPadding$1(a0);
- },
- /** @expose */
- legendPosition : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendPosition$0();
- }
- return this.legendPosition$1(a0);
- }
- });
- /**
- * Set preferred rectangle to the same position and size as the source rectangle.
- * @param (rave['internal']['RectStruct']) t preferred rectangle
- * @param (rave['internal']['RectStruct']) s Source rectangle
- * @return (rave['internal']['RectStruct']) preferred rectangle
- */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect = function(t, s) {
- t.x = s.x;
- t.y = s.y;
- t.width = s.width;
- t.height = s.height;
- return t;
- };
- /**
- * Inset a rectangle, modifying its x,y,width,height. If that would reduce the rectangle to less than 0 in a dimension, it is not inset in that dimension. If the requested inset is <= 0, 0 is used.
- * @param (rave['internal']['RectStruct']) r Rectangle
- * @param (double) top Top inset in pixels
- * @param (double) left Left inset in pixels
- * @param (double) bottom Bottom inset in pixels
- * @param (double) right Right inset in pixels
- * @return (rave['internal']['RectStruct']) The rectangle
- */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset = function(r, top, left, bottom, right) {
- var ileft = Math.max(0.0, left);
- var iright = Math.max(0.0, right);
- if (ileft + iright <= r.width) {
- r.x += ileft;
- r.width -= ileft + iright;
- }
- var itop = Math.max(0.0, top);
- var ibottom = Math.max(0.0, bottom);
- if (itop + ibottom <= r.height) {
- r.y += itop;
- r.height -= itop + ibottom;
- }
- return r;
- };
- /**
- * Evaluate a size, which may be a number, CSS size, or pecentage, and return the size in pixels. If the size is null or can't be parsed, returns defValue. The value is clamped to the range 0 to extent.
- * @param (Object) value The size
- * @param (double) extent The extent in the dimension
- * @param defValue The default to use if not parsable
- * @return (double) Size in pixels
- */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize = function(value, extent) {
- var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10.0);
- var d = v != null ? v : 0;
- return Math.max(0.0, Math.min(d, extent));
- };
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT = 0.4;
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT_SINGLE_PER_ORIENTATION = 0.5;
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT = 0.3;
- /** @expose */
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT_NO_AXIS = 0.5;
- // $source: com/ibm/rave/bundles/components/ClipPathComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- /**
- * ClipPathComponent This component handles creation of a clipPath element, as well as applying that clip path to a given selection. There is a one-to-one relationship between a ClipPathComponent and a clipPath element that is appended to the document. To create multiple clipPath elements, you must create multiple ClipPathComponent instances. Example usage: <pre> _clip.clipRect(new RectStruct(50, 50, 200, 200)) // Set the clipping rectangle .applyTo(chart.select(".content")) // Apply the clip-path attribute to a graphical element. This can be called repeatedly on different selections. .applyTo(chart.select(".otherContent")) .run(context.node.select("defs")); // ClipPathComponent creates a clipPath element within the provided node. This component should be executed on a single "defs" node, however there is no restriction. </pre>
- */
- var com_ibm_rave_bundles_components_ClipPathComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //_id : null,
- //_clipRect : null,
- constructor : function(id) {
- this._clipRect = new rave['internal']['RectStruct'](0, 0, 100, 100);
- /**
- * Initializes the component. The provided id will be used as the "id" attribute for the clipPath element created by this component. Recall that an "id" in an SVG/HTML document must be <em>unique across the entire document</em>. If you create multiple clipPath elements with the same id, then all elements referencing one of these clip paths will not be resolved as you expected.
- * @param (String) id String ID that is unique <em>across the document</em>.
- */
- {
- this._id = id;
- }
- },
- /** @expose */
- type : function() {
- return "ClipPathComponent";
- },
- /**
- * Set the rectangular clipping area. Make the _clipRect one pixel larger than requested to avoid the cut-off at bounds. TODO: why?!?
- * @param (rave['internal']['RectStruct']) rect The rectangular bounds of the clipping area.
- * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
- */
- /** @expose */
- clipRect : function(rect) {
- this._clipRect = new rave['internal']['RectStruct'](rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2);
- return this;
- },
- /**
- * Set the clip-path attribute on the provided selection.
- * @return (com.ibm.rave.bundles.components.ClipPathComponentImpl) This ClipPathComponent.
- */
- /** @expose */
- applyTo : function(s) {
- s.attr("clip-path", "url(" + this.url() + ")");
- return this;
- },
- /**
- * Retrieve the id assigned to this clip path.
- */
- /** @expose */
- id : function() {
- return this._id;
- },
- /**
- * Retrieve the URL that can be used to reference this clip path.
- */
- /** @expose */
- url : function() {
- return "#" + this._id;
- },
- /** @expose */
- execute : function(g) {
- var clipPath = g.selectAll("#" + this._id).data([0]);
- clipPath.enter().append("clipPath").attr("id", this._id).append("rect");
- rave.transition(clipPath.select("rect")).attr("x", this._clipRect.x).attr("y", this._clipRect.y).attr("width", this._clipRect.width).attr("height", this._clipRect.height);
- }
- });
- // $source: com/ibm/rave/bundles/components/LegendComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
- /**
- * <p> A component to draw a legend, using a RAVE capability swatch legend. In JavaScript the RAVE legend and layout extensions must be loaded. The legend puts its shapes into the selector passed to its execute method, so that selector should choose a group node. </p> <p> Most of the component properties are passed directly to the RAVE legend. The properties are: </p> <p> <b>visible</b>: If true, the legend is drawn; otherwise it is cleared (all shapes are removed from the legend). The default is true. </p> <p> <b>size</b>: A Dim with the size of the legend in the chart coordinate system. If null or zero-sized, the legend is cleared. This is passed to the swatch legend. </p> <p> <b>colorScale</b>: A scale (OrdinalScale) used as the RAVE legend scale. If null, the legend is cleared. The legend currently only supports a single ordinal color scale. </p> <p> <b>orient</b>: The RAVE legend orient, either "horizontal" or "vertical". The default is "vertical". </p> <p> <b>swatchSize</b>: The RAVE legend size. Note that this is in square pixels. The default is 20*20. </p> <p> <b>shape</b>: The RAVE legend shape. The default is "square". </p> <p> <b>title</b>: The RAVE legend title. The default is null. </p> <p> <b>titleFill</b>: The legend title color. The default is null. </p> <p> <b>titleFontSize</b>: The legend title font size. The default is null. </p> <p> <b>titleFontFamily</b>: The legend title font family. The default is null. </p> <p> <b>borderColor</b>: The RAVE legend borderColor. The default is "black". </p> <p> <b>labelFormat</b>: The RAVE legend labelFormat. The default is null. </p>
- */
- var com_ibm_rave_bundles_components_LegendComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- /**
- * Legend size property
- */
- //_size : null,
- /**
- * Color scale
- */
- //_colorPalette : null,
- /**
- * Orient, "horizontal" or "vertical"
- */
- //_orient : null,
- /**
- * Swatch size function
- */
- //_swatchSizeFunc : null,
- /**
- * Scale
- */
- //_scale : null,
- /**
- * Swatch symbol
- */
- //_shape : null,
- /**
- * Legend title
- */
- //_title : null,
- /**
- * Legend title styling
- */
- //_titleStyle : null,
- /**
- * Legend entry styling
- */
- //_entryStyle : null,
- /**
- * Custom formatter
- */
- //_labelFormat : null,
- /**
- * The swatch legend, created on demand
- */
- //_swatchLegend : null,
- /**
- * The continuous legend, created on demand
- */
- //_continuousLegend : null,
- /**
- * The legend type, either "SwatchLegend" or "ContinuousLegend"
- */
- //_legendType : null,
- /**
- * Is the legend visible
- */
- _visible : false,
- /**
- * Swatch size in square pixels
- */
- _swatchSize : 0,
- /**
- * Constructor; sets bound and, colorScale to null, all other properties to their default values.
- */
- /** @expose */
- constructor : function() {
- this._visible = true;
- this._size = null;
- this._colorPalette = null;
- this._orient = "horizontal";
- this._swatchSize = 16.0 * 16.0;
- this._swatchSizeFunc = null;
- this._scale = null;
- this._shape = "square";
- this._title = null;
- this._titleStyle = {};
- this._entryStyle = {};
- this._labelFormat = null;
- this._swatchLegend = null;
- this._continuousLegend = null;
- this._legendType = null;
- },
- /** @expose */
- type : function() {
- return "LegendComponent";
- },
- /** @expose */
- execute : function(g) {
- if (this._colorPalette) {
- if ("continuous" == this._colorPalette.getType()) {
- if (!this._continuousLegend) {
- this._continuousLegend = (rave.capabilities.extension("legend")).continuous();
- }
- this._legendType = "ContinuousLegend";
- } else {
- if (!this._swatchLegend) {
- this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
- }
- this._legendType = "SwatchLegend";
- }
- } else if (this._swatchSizeFunc) {
- if (!this._swatchLegend) {
- this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
- }
- this._legendType = "SwatchLegend";
- } else {
- this._legendType = null;
- }
- this.preExecute();
- if (!this._visible || (!this._colorPalette && !this._swatchSizeFunc) || !this._size || this._size[0] <= 0 || this._size[1] <= 0) {
- g.selectAll("*").remove();
- return;
- }
- var fontChecker = rave.capabilities.extension("fontchecker");
- if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
- this._continuousLegend.shapeRectSize("horizontal" == this._orient ? [-1.0, 16.0] : [16.0, -1.0]).size(this._size).scale(this._colorPalette.getScale()).orient(this._orient).title(this._title).titleFill(this._titleStyle["fill"]).titleFontSize(this._titleStyle["font-size"]).titleFontFamily(this._titleStyle["font-Family"]).titleAlignment("start").labelFormat(this._labelFormat);
- var legend = g.call(this._continuousLegend);
- if (this._entryStyle) {
- legend.selectAll(".legendLabel").style(this._entryStyle);
- }
- if (this._titleStyle) {
- legend.selectAll(".legendTitle").style(this._titleStyle);
- }
- if (fontChecker) {
- legend.selectAll(".legendLabel").call(fontChecker);
- legend.selectAll(".legendTitle").call(fontChecker);
- }
- } else {
- var insets = {};
- insets["bottom"] = 5;
- var swatchSize = this._swatchSize;
- var scale = null;
- var labelFormatter = this._labelFormat;
- if (this._swatchSizeFunc && this._scale) {
- swatchSize = this._swatchSizeFunc;
- scale = this._scale;
- }
- if (this._colorPalette) {
- scale = this._colorPalette.getScale();
- var originalDomain = this._colorPalette.originalDomain();
- if (originalDomain) {
- scale.domain(originalDomain);
- var f = this._colorPalette.originalDomainLabelAccessor();
- if (this._labelFormat) {
- var self = this;
- labelFormatter = function(data, index, groupIndex) {
- return self._labelFormat.call(this, f.call(this, data, index, groupIndex), index, groupIndex);
- };
- } else {
- labelFormatter = f;
- }
- }
- }
- this._swatchLegend.labelPadding(8).size(this._size).scale(scale).orient(this._orient).swatchSize(swatchSize).shape(this._shape).title(this._title).titleFill(this._titleStyle["fill"]).titleFontSize(this._titleStyle["font-size"]).titleFontFamily(this._titleStyle["font-family"]).titleAlignment("start").labelFormat(labelFormatter).titleInsets(insets);
- var legend = g.call(this._swatchLegend);
- if (this._entryStyle) {
- legend.selectAll(".legendLabel").style(this._entryStyle);
- }
- if (this._titleStyle) {
- legend.selectAll(".legendTitle").style(this._titleStyle);
- }
- if (fontChecker) {
- legend.selectAll(".legendLabel").call(fontChecker);
- legend.selectAll(".legendTitle").call(fontChecker);
- }
- }
- },
- /** @expose */
- legend : function() {
- if ("ContinuousLegend" == this._legendType) {
- return this._continuousLegend;
- }
- if ("SwatchLegend" == this._legendType) {
- return this._swatchLegend;
- }
- return null;
- },
- /** @expose */
- legendType : function() {
- return this._legendType;
- },
- /**
- * Set the visible property.
- * @param (boolean) visible New visible
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- visible : function(visible) {
- this._visible = visible;
- return this;
- },
- /**
- * see if the legend is visible
- * @return (boolean) if its visible
- */
- /** @expose */
- isVisible : function() {
- return this._visible;
- },
- /**
- * Set the size property.
- * @param (Array) size New size
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- size : function(size) {
- this._size = size;
- return this;
- },
- /**
- * Set the color scale property.
- * @param (rave['library']['internal']['Palette']) colorPalette New color scale
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- colorPalette : function(colorPalette) {
- this._colorPalette = colorPalette;
- return this;
- },
- /**
- * Set the orient property. If the argument is not "horizontal" or "vertical", it is ignored and the orient property is not changed.
- * @param (String) orient New orient
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- orient : function(orient) {
- if ("horizontal" == orient || "vertical" == orient) {
- this._orient = orient;
- }
- return this;
- },
- /**
- * Set the orient property from a legend position. If the argument is "top" or "bottom", the orient is set to "horizontal". Otherwise it is set to "vertical".
- * @param (String) position Legend position
- * @return (com.ibm.rave.bundles.components.LegendComponentImpl) This object
- */
- /** @expose */
- position : function(position) {
- return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
- },
- swatchSize$0 : function(swatchSize) {
- if (swatchSize >= 0.0 && swatchSize != null) {
- this._swatchSize = swatchSize;
- }
- return this;
- },
- /** @expose */
- scale : function(scale) {
- this._scale = scale;
- return this;
- },
- swatchSize$1 : function(swatchSize) {
- if (swatchSize) {
- this._swatchSizeFunc = swatchSize;
- }
- return this;
- },
- /** @expose */
- shape : function(shape) {
- this._shape = shape;
- return this;
- },
- /** @expose */
- title : function(title) {
- this._title = (title != null && title.length > 0) ? title : null;
- return this;
- },
- /** @expose */
- titleFill : function(titleFill) {
- this._titleStyle["fill"] = titleFill;
- return this;
- },
- /** @expose */
- titleFontSize : function(titleFontSize) {
- this._titleStyle["font-size"] = titleFontSize;
- return this;
- },
- /** @expose */
- titleFontFamily : function(titleFontFamily) {
- this._titleStyle["font-family"] = titleFontFamily;
- return this;
- },
- /** @expose */
- labelFormat : function(labelFormat) {
- this._labelFormat = labelFormat;
- return this;
- },
- /** @expose */
- titleFont : function(titleFontStyle) {
- this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(titleFontStyle);
- return this;
- },
- /** @expose */
- entryFont : function(entryFontStyle) {
- this._entryStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(entryFontStyle);
- return this;
- },
- /** @expose */
- getSpaceUsed : function() {
- if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
- return this._continuousLegend.getUsedSize() + 2;
- } else {
- return this._swatchLegend.getUsedSize() + 2;
- }
- },
- /** @expose */
- swatchSize : function(a0) {
- var args = arguments;
- if (args.length == 1 && typeof a0 === "function") {
- return this.swatchSize$1(a0);
- }
- return this.swatchSize$0(a0);
- }
- });
- /**
- * Get the orient for a position. "top" and "bottom" return "horizontal", anything else ("left", "right", or unknown/null) is "vertical".
- * @param (String) position A position
- * @return (String) "horizontal" or "vertical"
- */
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf = function(position) {
- if ("top" == position || "bottom" == position) {
- return "horizontal";
- }
- return "vertical";
- };
- //com_ibm_rave_bundles_components_LegendComponentImpl.HORIZONTAL = "horizontal";
- //com_ibm_rave_bundles_components_LegendComponentImpl.VERTICAL = "vertical";
- com_ibm_rave_bundles_components_LegendComponentImpl.BAR_THINKNESS = 16;
- com_ibm_rave_bundles_components_LegendComponentImpl.SWATCH_SIZE = 16;
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.TOP = "top";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.BOTTOM = "bottom";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.LEFT = "left";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.RIGHT = "right";
- /** @expose */
- com_ibm_rave_bundles_components_LegendComponentImpl.ADJUSTABLE = -1;
- // $source: com/ibm/rave/bundles/components/AxisComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2018
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/AxisComponent (runtime) // AxisComponent
- //@import com/ibm/rave/bundles/utilities/TextCrossfader (runtime) // textCrossFade
- //@import com/ibm/rave/bundles/utilities/FontPropertyParser (runtime) // parseCSSFont
- //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
- /**
- * <p> Component to draw an axis and title. The component is drawn into a Selector group, and the user of the component must translate the group to the axis position and set up the axis scale for the correct number of pixels. </p> <p> The component uses a RAVE core Axis for drawing the axis. Most component properties are passed to the axis. The component properties are: </p> <p> <b>scale</b>: The axis scale. This must be set up with the domain and range (pixels) of the axis. If null the axis does not render, and removes all axis shapes from the selector. Default null. </p> <p> <b>orient</b>: The axis orient, "top", "bottom", "left", or "right". Default "bottom". </p> <p> <b>bounds</b>: The bounding box for the axis, used to position the title and to wrap/truncate axis labels. If null the title is placed 50 pixels from the axis line and text is not wrapped. </p> <p> <b>tickFormat</b>: A value function passed to the axis to format tick labels. Default null, meaning the RAVE default formatting is used. </p> <p> <b>displayAxisTitle</b>: Whether to display the axis title. Default true. </p> <p> <b>axisTitle</b>: The title to display on the axis. It is centered on the axis range, and the size property is used to find the distance from the axis. Default null. </p> <p> <b>axisColor</b>: A color-string for the axis line. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>tickColor</b>: A color-string for the axis ticks. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>labelColor</b>: A color-string for the axis tick labels. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>titleColor</b>: A color-string for the axis title. If null, no color is applied and the CSS defaults are used. Default null. </p> <p> <b>displayAxisLine</b>: Whether to display the axis line. Default true. </p> <p> <b>displayAxisTicks</b>: Whether to display the axis ticks. Default true. </p> <p> <b>displayAxisTickLabels</b>: Whether to display the axis tick labels. Default true. </p>
- */
- var com_ibm_rave_bundles_components_AxisComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- /**
- * Axis - created on demand
- */
- //_axis : null,
- /**
- * Role, from the AxisComponent API
- */
- //_role : null,
- /**
- * CoordinateScale
- */
- //_scale : null,
- /**
- * Orient, always one of the four legal values
- */
- //_orient : null,
- /**
- * Size
- */
- //_bounds : null,
- //_elementRect : null,
- /**
- * The title text; default null (nothing visible)
- */
- /** @expose */
- _axisTitle : null,
- /**
- * The title style; defaults null (use the CSS styling)
- */
- /** @expose */
- _titleStyle : null,
- /**
- * Axis line color; default null (use the CSS styling)
- */
- /** @expose */
- _lineColor : null,
- /**
- * Axis tick color; default null (use the CSS styling)
- */
- /** @expose */
- _tickColor : null,
- /**
- * Axis tick label style; defaults null (use the CSS styling)
- */
- /** @expose */
- _labelStyle : null,
- //_staggerRotate45Nodes : null,
- //_staggerFirstNode : null,
- //_staggerLastNode : null,
- /**
- * Axis tick label formatting
- */
- //_tickFormat : null,
- //_dropOverlap : null,
- /**
- * Used to get the extension to enable axis label wrapping
- */
- //_textFlow : null,
- /**
- * Used to check the fonts on each label to make sure all characters are covered
- */
- //_fontChecker : null,
- /**
- * Run function that applies the properties to the axis line
- */
- //_axisLineProperties : null,
- /**
- * Run function that applies the properties to the axis ticks
- */
- //_axisTickProperties : null,
- /**
- * Run function that applies the properties to the axis tick labels
- */
- //_axisTickLabelProperties : null,
- /**
- * Run function that hides or displays the axis tick labels
- */
- //_displayHideLabels : null,
- /**
- * Run function that hides or displays the axis tick labels
- */
- //_panZoomLabels : null,
- /**
- * The tick handler registered with the axis; will get called during axis transition
- */
- //_tickHandler : null,
- //_textTruncationIndicator : null,
- /**
- * Used when dealing with numeric scale on the vertical axis and the numbers don't fit
- */
- //_simplifiedTickFormat : null,
- //_tickMagnitude : null,
- /**
- * Whether to display the axis title; default true
- */
- /** @expose */
- _displayAxisTitle : false,
- /**
- * Whether to display the axis line; default true
- */
- /** @expose */
- _displayAxisLine : false,
- /**
- * Whether to display the axis ticks; default true
- */
- /** @expose */
- _displayTicks : false,
- /**
- * Whether to display the axis tick labels (conditional on show labels property); default true
- */
- /** @expose */
- _displayTickLabels : false,
- /**
- * Whether to display the axis tick labels (conditional on pan-zoom hide property); default true
- */
- /** @expose */
- _showPanZoomTickLabels : false,
- /**
- * Whether to rotate the axis tick labels; default false
- */
- _rotateLabels : false,
- _staggerCellWidth : 0,
- _staggerAlignFirstAtStart : false,
- _staggerAlignLastAtEnd : false,
- _layoutTimerId : 0,
- _layoutTitleSize : 0,
- _layoutLabelSize : 0,
- _layoutLabelHeight : 0,
- _layoutAverageDigitWidth : 0,
- _layoutSpillOver : 0,
- /**
- * Whether to hide overlapping labels; default true
- */
- /** @expose */
- _hideOverlappingLabels : false,
- /**
- * When true, don't start a new timer
- */
- _pendingLabelTimer : false,
- /**
- * The padding in px between tick axis line and tick label, and also between tick label and title. Default 16px.
- */
- _padding : 0,
- /**
- * After calling the component, this is true if shapes were rendered, false if they were cleared.
- */
- _renderedShapes : false,
- _layoutMode : -1,
- _allowAutoAxisLayoutToChangeOrientaiton : true,
- _lastAutomaticAxisLayoutOrientation : -1,
- _allowStagger : false,
- _allowRotate45 : false,
- _allowRotate90 : false,
- constructor : function() {
- {
- var self = this;
- this._axisLineProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var line = this.selectAll("path.domain");
- if (self._lineColor != null) {
- line.style("stroke", self._lineColor);
- }
- if (self._displayAxisLine) {
- line.attr("visibility", null);
- } else {
- line.attr("visibility", "hidden");
- }
- return null;
- }
- };
- this._axisTickProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var tickLines = this.selectAll("line");
- if (self._displayTicks) {
- tickLines.attr("visibility", null);
- } else {
- tickLines.attr("visibility", "hidden");
- }
- if (self._lineColor != null) {
- tickLines.style("stroke", self._tickColor);
- }
- return null;
- }
- };
- this._axisTickLabelProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var labels = this.selectAll("text");
- labels.each(self._displayHideLabels);
- labels.each(self._panZoomLabels);
- labels.style(self._labelStyle);
- self._axis.ticksHandler(null);
- return null;
- }
- };
- this._displayHideLabels = function(obj, group, index) {
- if (self._displayTickLabels) {
- if (this.rave_hasProperty("__tickLabelHidden__")) {
- this.rave_removeProperty("__tickLabelHidden__");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- if (count <= 1) {
- this.rave_removeProperty("__hiddenCount__");
- this.removeAttribute("visibility");
- } else {
- this.rave_setProperty("__hiddenCount__", count - 1);
- }
- }
- } else {
- if (!(this.rave_hasProperty("__tickLabelHidden__"))) {
- this.setAttribute("visibility", "hidden");
- this.rave_setProperty("__tickLabelHidden__", "hidden");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- this.rave_setProperty("__hiddenCount__", count + 1);
- }
- }
- };
- this._panZoomLabels = function(obj, group, index) {
- if (self._showPanZoomTickLabels) {
- if (this.rave_hasProperty("__panZoomHidden__")) {
- this.rave_removeProperty("__panZoomHidden__");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- if (count <= 1) {
- this.rave_removeProperty("__hiddenCount__");
- this.removeAttribute("visibility");
- } else {
- this.rave_setProperty("__hiddenCount__", count - 1);
- }
- }
- } else {
- if (!(this.rave_hasProperty("__panZoomHidden__"))) {
- this.setAttribute("visibility", "hidden");
- this.rave_setProperty("__panZoomHidden__", "hidden");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- this.rave_setProperty("__hiddenCount__", count + 1);
- }
- }
- };
- }
- this._tickHandler = new com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler(this._axisTickLabelProperties, this._axisTickProperties);
- /**
- * Initialize properties to defaults
- */
- {
- this._axis = null;
- this._role = null;
- this._scale = null;
- this._orient = "bottom";
- this._bounds = null;
- this._displayAxisTitle = true;
- this._axisTitle = null;
- this._titleStyle = {};
- this._displayAxisLine = true;
- this._lineColor = null;
- this._displayTicks = true;
- this._tickColor = null;
- this._displayTickLabels = true;
- this._labelStyle = {};
- this._rotateLabels = false;
- this._hideOverlappingLabels = true;
- this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
- this._tickFormat = null;
- this._showPanZoomTickLabels = true;
- this._pendingLabelTimer = false;
- this._padding = 16;
- this._textFlow = rave.capabilities.extension("textflow");
- this._fontChecker = rave.capabilities.extension("fontchecker");
- this._renderedShapes = false;
- }
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE;
- },
- /** @expose */
- role : function() {
- return this._role;
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- if (!this._scale) {
- g.selectAll("*").remove();
- this._renderedShapes = false;
- return;
- }
- this._renderedShapes = true;
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- this._hideOverlappingLabels = false;
- this._rotateLabels = true;
- } else {
- this._hideOverlappingLabels = true;
- this._rotateLabels = true;
- }
- this.drawTitle(g);
- this.drawAxis(g);
- this.handleAxisText(g);
- this.drawTitle(g);
- },
- /**
- * This is one place where all the calls that affect the axis text happen in case of allowAutomaticAxisLayout the new behavior applies here
- * @param (rave['internal']['Selector']) g
- */
- handleAxisText : function(g) {
- this.stopLabelDroppingUpdate();
- var duration = 0, delay = 0;
- var g2 = rave.transition(g);
- if (g2.isTransition()) {
- var t2 = (g2);
- duration = t2.duration();
- delay = t2.delay();
- }
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("g.tick").filter(rave['library']['internal']['BundleUtils'].notExit).selectAll("text");
- var fontChecker = rave.capabilities.extension("fontchecker");
- labels.style(this._labelStyle);
- if (fontChecker) {
- labels.call(fontChecker);
- }
- var mode = this._allowAutoAxisLayoutToChangeOrientaiton ? this.determineWhichAutoMode(g) : this._lastAutomaticAxisLayoutOrientation;
- this.configureStaggerData(g, mode);
- this.handleLabelsRotationAndPosition(g, labels, mode);
- this.hashingNumericScales(labels, this.labelExtent(g), mode);
- if (duration == 0) {
- this.doLabelWrapping(g, mode);
- this.handleLabelsRotationAndPosition(g, labels, mode);
- }
- this._lastAutomaticAxisLayoutOrientation = mode;
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var tick = axisSelector.append("g").classed("tick", true);
- var tickText = tick.append("text");
- if (labels.size() == 0) {
- var singleValue = this._scale.scale().domain()[0];
- var formatter = this._tickFormat;
- if (!formatter) {
- var tickFunc = this._scale.scale().tickFormat;
- if (tickFunc) {
- formatter = tickFunc.apply(tickFunc, [singleValue]);
- }
- }
- var node = tickText[0][0];
- var stringValue = formatter ? formatter.call(node, singleValue, 0, 0) : ""+(singleValue);
- tickText.text(stringValue);
- var dim = node.getBBox();
- this._layoutLabelSize = isHorizontal ? dim.height : dim.width;
- if (!isHorizontal || mode != 0) {
- tickText.text(".0");
- this._layoutLabelSize += node.getBBox().width;
- }
- }
- if (!isHorizontal || mode != 0) {
- tickText.text(".0");
- var node = tickText[0][0];
- var dim = node.getBBox();
- this._layoutAverageDigitWidth = dim.width;
- }
- tick.remove();
- }
- if (this._hideOverlappingLabels && duration > 0) {
- this.updateLabelDropping(labels, duration, delay);
- }
- if (duration > 0) {
- this.doLabelWrappingAfterAnimation(g, labels, mode, duration, delay);
- }
- if (!this._displayTickLabels) {
- this._layoutLabelSize = 0;
- this._layoutAverageDigitWidth = 0;
- }
- },
- /**
- * Rotates the text and shifts it to compensate for the rotation Needs to be called twice once before wrapping in order to have text in correct position for wrap then after to know the correct height of wrapped text in order to shift it correct TODO: find a better way to do this
- * @param (rave['internal']['Selector']) g selector
- * @param (rave['internal']['Selector']) labels labels selector
- * @param (int) mode one of HORIZONTAL, STAGGER, ROTATE90
- */
- handleLabelsRotationAndPosition : function(g, labels, mode) {
- if (mode == 2 || mode == 1) {
- if (this._orient == "bottom") {
- this.rotateLabels(g, labels, "end", mode);
- } else if (this._orient == "top") {
- this.rotateLabels(g, labels, "start", mode);
- } else {
- this.rotateLabels(g, labels, "middle", mode);
- }
- } else {
- if (this._orient == "bottom" || this._orient == "top") {
- this.rotateLabels(g, labels, "middle", mode);
- } else if (this._orient == "right") {
- this.rotateLabels(g, labels, "start", mode);
- } else {
- this.rotateLabels(g, labels, "end", mode);
- }
- }
- },
- /**
- * <p> Numeric scales cannot be truncated or wrapped, if a number doesn't fit the allowed space the number should be hashed</p> <p> ex: 12345 -> ##### </p> <p>This method should be called before {@link #this.doLabelWrapping(rave['internal']['Selector'])} , truncation must be set to off in case of numeric scale</p>
- * @param (rave['internal']['Selector']) labels
- */
- hashingNumericScales : function(labels, extent, mode) {
- if (!labels || !extent) {
- return;
- }
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var tickSpace = mode == 1 ? extent[1] : extent[0];
- this._textTruncationIndicator = "";
- this._layoutLabelSize = 0;
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[i][0];
- var dim = node.getBBox();
- var width = dim.width;
- var height = dim.height;
- var size = !isHorizontal || mode == 1 ? width : height;
- if (size > this._layoutLabelSize) {
- this._layoutLabelSize = size;
- }
- if (width >= tickSpace) {
- if (this._simplifiedTickFormat) {
- var newText = this._simplifiedTickFormat.call(null, node.rave_getData(), 0, 0);
- if (newText != null) {
- node.rave_setText(newText);
- }
- if (node.getBBox().width >= tickSpace) {
- node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
- }
- } else {
- node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
- }
- }
- }
- }
- },
- /**
- * @param (int) size The desired size of the string
- * @param (String) ch The character to be repeated in the string
- * @return (String) A string of the specified size containing repetition of the specified character
- */
- stringOfSize : function(size, ch) {
- var returnString = "";
- for (var i = 0; i < size; ++i) {
- returnString += ch;
- }
- return returnString;
- },
- configureStaggerData : function(g, mode) {
- if (mode == 3 || mode == 2) {
- var horizontalDimensions = this.labelExtent(g);
- var cellWidth = horizontalDimensions[0];
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("text");
- var domain = this._scale.scale().domain();
- var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
- this._staggerRotate45Nodes = [];
- this._staggerFirstNode = null;
- this._staggerLastNode = null;
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[0][i];
- if (this.isValid(node.rave_getData())) {
- var domainIndex = -1;
- if (mode == 3) {
- var domainLabel = !this._tickFormat ? node.rave_getText() : originalDataLabelAccessor.call(node, node.rave_getData(), 0, 0);
- for (var index = 0; index < domain.length; ++index) {
- if (domain[index].toString() == domainLabel) {
- domainIndex = index;
- break;
- }
- }
- }
- this._staggerRotate45Nodes.push(new com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex(node, domainIndex));
- if (domainIndex == 0) {
- this._staggerFirstNode = node;
- }
- if (domainIndex == domain.length - 1) {
- this._staggerLastNode = node;
- }
- }
- }
- this._staggerCellWidth = cellWidth * 2;
- this._staggerAlignFirstAtStart = this._staggerFirstNode ? this._staggerFirstNode.getBBox().width > cellWidth : false;
- this._staggerAlignLastAtEnd = this._staggerLastNode ? this._staggerLastNode.getBBox().width > cellWidth : false;
- }
- },
- getStaggerIndex : function(node) {
- for (var index = 0; index < this._staggerRotate45Nodes.length; ++index) {
- if (this._staggerRotate45Nodes[index].contains(node)) {
- var domainIndex = this._staggerRotate45Nodes[index].getIndex();
- return domainIndex == -1 ? 0 : domainIndex;
- }
- }
- return -1;
- },
- getStaggerCount : function() {
- var domain = this._scale.scale().domain();
- return domain.length;
- },
- /**
- * <p> The method is responsible for determining which mode to be used with the label positioning if {@link com_ibm_rave_bundles_components_AxisComponentImpl._allowAutomaticLayout} flag is enabled </p>
- * @param (rave['internal']['Selector']) g
- */
- determineWhichAutoMode : function(g) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("text");
- var dim = this.labelExtent(g);
- var cellWidth = dim[0];
- var cellWidth90 = dim[1];
- var layoutLabelHeight = 0;
- var layoutLabelWidth = 0;
- var horizontalScore = 0;
- var staggerScore = 0;
- var rotate45Score = 0;
- var rotate90Score = 0;
- var validNodes = [];
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[0][i];
- if (this.isValid(node.rave_getData())) {
- validNodes.push(node);
- }
- }
- var labelCount = validNodes.length;
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var mode = 0;
- if (isHorizontal) {
- mode = this._layoutMode == 1 ? 1 : 0;
- var tick = axisSelector.append("g").classed("tick", true);
- var tickText = tick.append("text");
- tickText.style(this._labelStyle);
- tickText.text(",0");
- var node = tickText[0][0];
- var zeroWidth = node.getBBox().width;
- tick.remove();
- var widestLabel = 0;
- for (var i = 0; i < labelCount; ++i) {
- node = validNodes[i];
- var nodeRect = node.getBBox();
- if (nodeRect.width > widestLabel) {
- widestLabel = nodeRect.width;
- }
- if (nodeRect.height > this._layoutLabelHeight) {
- this._layoutLabelHeight = nodeRect.height;
- }
- }
- widestLabel += zeroWidth;
- this._layoutSpillOver = mode == 1 ? this._layoutLabelHeight / 2 : widestLabel / 2 + 2;
- } else {
- for (var i = 0; i < labelCount; ++i) {
- var node = validNodes[i];
- var nodeRect = node.getBBox();
- if (nodeRect.height > this._layoutLabelHeight) {
- this._layoutLabelHeight = nodeRect.height;
- }
- }
- this._layoutSpillOver = this._layoutLabelHeight / 2;
- }
- return mode;
- }
- var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
- var staggerStringsWontMatch = this._tickFormat && !originalDataLabelAccessor;
- var calcStagger = ((this._allowStagger && this._layoutMode == -1) || this._layoutMode == 3) && !staggerStringsWontMatch;
- var calcRotate45 = (this._allowRotate45 && this._layoutMode == -1) || this._layoutMode == 2;
- var calcRotate90 = (this._allowRotate90 && this._layoutMode == -1) || this._layoutMode == 1;
- var spaceFor45Label = 0;
- for (var i = 0; i < labelCount; ++i) {
- var node = validNodes[i];
- var nodeRect = node.getBBox();
- layoutLabelHeight = nodeRect.height;
- var labelWidth = nodeRect.width;
- if (labelWidth > layoutLabelWidth) {
- layoutLabelWidth = labelWidth;
- }
- horizontalScore += (labelWidth <= cellWidth ? 1 : cellWidth / labelWidth);
- if (isHorizontal) {
- if (calcStagger) {
- var spaceForLabel = cellWidth * 2;
- if (i == 0 && i == labelCount - 1) {
- spaceForLabel *= 0.5;
- } else if (i == 0 || i == labelCount - 1) {
- spaceForLabel *= 0.75;
- }
- staggerScore += (labelWidth <= spaceForLabel ? 1 : spaceForLabel / labelWidth);
- }
- if (calcRotate45) {
- if (spaceFor45Label == 0) {
- spaceFor45Label = cellWidth90 / 0.7071 - layoutLabelHeight;
- }
- var space = this.calculate45DegreeSpace(node, spaceFor45Label);
- rotate45Score += (labelWidth <= space ? 1 : space / labelWidth);
- }
- if (calcRotate90) {
- rotate90Score += (labelWidth <= cellWidth90 ? 1 : cellWidth90 / labelWidth);
- }
- }
- }
- var mode = 0;
- if (this._layoutMode == -1) {
- if (isHorizontal && this._allowStagger) {
- horizontalScore *= 1.1;
- staggerScore *= 1.1;
- }
- if ((staggerScore > horizontalScore) && (staggerScore >= rotate45Score) && (staggerScore >= rotate90Score)) {
- mode = 3;
- } else if ((rotate45Score > horizontalScore) && (rotate45Score >= rotate90Score)) {
- mode = 2;
- } else if (rotate90Score > horizontalScore) {
- mode = 1;
- }
- } else {
- if ((this._layoutMode == 3 && staggerStringsWontMatch) || !isHorizontal) {
- mode = 0;
- } else {
- mode = this._layoutMode;
- }
- }
- if (isHorizontal) {
- switch (mode) {
- case 3:
- this._layoutLabelSize = layoutLabelHeight * 2;
- break;
- case 2:
- this._layoutLabelSize = (layoutLabelWidth + layoutLabelHeight) * 0.7071;
- break;
- case 1:
- this._layoutLabelSize = layoutLabelWidth;
- break;
- case 0:
- default:
- this._layoutLabelSize = layoutLabelHeight;
- break;
- }
- } else {
- this._layoutLabelSize = layoutLabelWidth;
- }
- this._layoutLabelHeight = layoutLabelHeight;
- return mode;
- },
- calculate45DegreeSpace : function(node, maxWidth) {
- var width = maxWidth;
- var tfm = node.rave_getParentNode().getAttribute("transform");
- if (tfm != null) {
- var tfmString = tfm.toString();
- var indexOfTrans = tfmString.indexOf("translate(");
- if (indexOfTrans != -1) {
- indexOfTrans += 10;
- var indexOfComma = tfmString.indexOf(",", indexOfTrans);
- if (indexOfComma != -1) {
- var xAmount = tfmString.substring(indexOfTrans, indexOfComma);
- var xLabelPos = + (xAmount);
- var width45Degrees = node.getBBox().width;
- var xLabelWidth = width45Degrees * 0.7071;
- var isBottom = this._orient == "bottom";
- if (isBottom) {
- xLabelPos -= node.getBBox().height / 4;
- if (xLabelPos - xLabelWidth < this._bounds.x) {
- xLabelWidth = xLabelPos - this._bounds.x;
- width = xLabelWidth / 0.7071;
- }
- } else {
- if (xLabelPos + xLabelWidth > this._bounds.x + this._bounds.width) {
- xLabelWidth = (this._bounds.x + this._bounds.width) - xLabelPos;
- width = xLabelWidth / 0.7071;
- }
- }
- if (width > maxWidth) {
- width = maxWidth;
- }
- }
- }
- }
- return width;
- },
- /**
- * @param (rave['internal']['Selector']) labels selector with all labels to be rotated
- * @param (rave['internal']['Selector']) g The parent selector of labels
- * @param (String) textAnchor The position of the anchor
- * @param alignmentMode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
- */
- rotateLabels : function(g, labels, textAnchor, mode) {
- if (this._rotateLabels) {
- var self = this;
- var positioning = function(data, index, groupIndex) {
- var x = 0;
- var y = 0;
- var rotation_cy = 0;
- var isBottom = self._orient == "bottom";
- if (mode == 3) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- if (cellIndex % 2 == 1) {
- var staggerDirection = isBottom ? 1 : -1;
- y += (self._layoutLabelHeight * staggerDirection);
- }
- if (cellIndex == 0 && self._staggerAlignFirstAtStart) {
- x -= self._staggerCellWidth / 4;
- } else if (cellIndex == self.getStaggerCount() - 1 && self._staggerAlignLastAtEnd) {
- x += self._staggerCellWidth / 4;
- }
- }
- } else if (mode == 2) {
- if (isBottom) {
- x -= self._layoutLabelHeight;
- } else {
- x += self._layoutLabelHeight / 2;
- }
- } else if (mode == 1) {
- if (isBottom) {
- x -= (this.getBBox().height / 2 + self._layoutLabelHeight / 4);
- rotation_cy = ~~(self._padding / 4 + self._axis.tickSize());
- } else {
- x -= (this.getBBox().height / 2 - self._layoutLabelHeight);
- rotation_cy = ~~-(self._padding / 4 + self._axis.tickSize());
- }
- }
- var rotationDegrees = mode == 1 ? -90 : mode == 2 ? -45 : 0;
- return "translate(" + x + "," + y + ") rotate(" + rotationDegrees + ",0," + rotation_cy + ")";
- };
- labels.attr("transform", positioning).style("text-anchor", textAnchor);
- if (mode == 3) {
- if (this._staggerAlignFirstAtStart) {
- this._staggerFirstNode.rave_setStyle("text-anchor", "start");
- }
- if (this._staggerAlignLastAtEnd) {
- this._staggerLastNode.rave_setStyle("text-anchor", "end");
- }
- }
- }
- },
- /** @expose */
- axis : function() {
- return this._axis;
- },
- /**
- * Draw the axis. The scale is non-null.
- * @param (rave['internal']['Selector']) g Selector group into which the axis is drawn.
- */
- drawAxis : function(g) {
- var axisSelector = g.selectAll("g.axis").data([0]);
- axisSelector.enter().append("g").classed("axis", true).classed(this._orient, true);
- if (!this._axis) {
- this._axis = new rave['internal']['Axis']();
- }
- if (this._hideOverlappingLabels) {
- this._textFlow.valignment("top").dropTextOnFail(false);
- }
- this._axis.ticksHandler(this._tickHandler);
- this._axis.orient(this._orient);
- this._axis.tickFormat(this._tickFormat);
- this._axis.tickPadding(10.0);
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- var labelHeight = 20.0;
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- if (isHorizontal) {
- labelHeight /= 0.7071;
- }
- var range = this._scale.scale().rangeExtent();
- var extent = + (range[1]) - + (range[0]);
- this._axis.ticks(extent / labelHeight);
- } else {
- if (this._tickMagnitude == null) {
- this._axis.ticks(10.0);
- } else {
- this._axis.ticks.apply(this._axis, [10.0, this._scale.scale().getTickFormat(), this._tickMagnitude]);
- }
- }
- var s = this._scale.scale();
- if (this._scale.originalDomain()) {
- var sOrdinal = s.copy();
- sOrdinal.domain(this._scale.originalDomain());
- s = sOrdinal;
- var self = this;
- var originalDataLabelAccessor = (self._scale).originalDomainLabelAccessor();
- var tickFormatter;
- if (originalDataLabelAccessor) {
- if (this._tickFormat) {
- tickFormatter = function(data, index, groupIndex) {
- return self._tickFormat.call(this, originalDataLabelAccessor.call(this, data, index, groupIndex), index, groupIndex);
- };
- } else {
- tickFormatter = originalDataLabelAccessor;
- }
- } else {
- tickFormatter = this._tickFormat;
- }
- this._axis.tickFormat(tickFormatter);
- }
- this._axis.scale(s);
- axisSelector.call(this._axis);
- var g2 = rave.transition(axisSelector);
- if (!(g2.isTransition())) {
- axisSelector.selectAll("text").call(this._dropOverlap, this._hideOverlappingLabels);
- }
- axisSelector.selectAll("path.domain").classed("axis-line", true);
- axisSelector.selectAll("g.tick line").classed("axis-tick", true);
- if (this._fontChecker) {
- axisSelector.selectAll("g.tick text").classed("axis-label", true).call(this._fontChecker);
- } else {
- axisSelector.selectAll("g.tick text").classed("axis-label", true);
- }
- axisSelector.call(this._axisLineProperties);
- },
- /**
- * Draw the axis title.
- * @param (rave['internal']['Selector']) g Selector group into which the title is drawn.
- */
- drawTitle : function(g) {
- if (!this._displayAxisTitle || this._axisTitle == null || this._axisTitle.trim().length == 0 || !this._bounds) {
- g.selectAll("text.axis-title." + this._orient).remove();
- return;
- }
- var x = 0;
- var y = 0;
- var dy = "";
- var transform;
- if ("top" == this._orient) {
- x = this._elementRect.x + this._elementRect.width / 2;
- y = -this._bounds.height + this._padding / 4;
- dy = "0.75em";
- } else if ("bottom" == this._orient) {
- x = this._elementRect.x + this._elementRect.width / 2;
- y = this._bounds.height - this._padding / 4;
- dy = "-0.25em";
- } else if ("left" == this._orient) {
- x = -this._elementRect.y - this._elementRect.height / 2;
- y = -this._bounds.width + this._padding / 4;
- dy = "0.75em";
- transform = "rotate(-90)";
- } else {
- x = this._elementRect.y + this._elementRect.height / 2;
- y = -this._bounds.width + this._padding / 4;
- dy = "0.75em";
- transform = "rotate(90)";
- }
- var fillOpacity;
- {
- var tmp = g.append("text").attr("class", "axis-title " + this._orient);
- fillOpacity = tmp.style("fill-opacity");
- tmp.remove();
- } var label = g.selectAll("text.axis-title." + this._orient);
- if (label.size() == 0) {
- label.data([0]).enter().append("text").attr("class", "axis-title " + this._orient).style("text-anchor", "middle").attr("x", x).attr("y", y).attr("transform", transform).attr("dy", dy).style(this._titleStyle).text(this._axisTitle);
- if (this._fontChecker) {
- g.selectAll("text.axis-title." + this._orient).call(this._fontChecker);
- }
- }
- com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade(rave.transition(label), label.text(), this._axisTitle, fillOpacity, 0.25).style("text-anchor", "middle").attr("x", x).attr("y", y).attr("transform", transform).attr("dy", dy).style(this._titleStyle);
- },
- getUnZoomedScale : function(scale) {
- var s = scale.copy();
- if (s.getZoomTransform()) {
- s.getZoomTransform()(1, 0);
- }
- return s;
- },
- isValid : function(data) {
- var s = this.getUnZoomedScale(this._axis.scale());
- var v = + (s.call(null, data, 0, 0));
- var range = this._axis.scale().range();
- if (this._axis.scale().range().indexOf(v)> -1) {
- return true;
- }
- if (range[0] < v && v < range[1]) {
- return true;
- }
- if (range[0] > v && v > range[1]) {
- return true;
- }
- return false;
- },
- /**
- * Apply label wrapping if requested.
- * @param (rave['internal']['Selector']) g
- * @param (int) mode One of HORIZONTAL, STAGGER, ROTATE45, ROTATE90
- */
- doLabelWrapping : function(g, mode) {
- if (this._displayTickLabels) {
- this._textFlow.valignment("top");
- if (!this._hideOverlappingLabels) {
- this._textFlow.dropTextOnFail(true);
- }
- var d = this.labelExtent(g);
- if (!d || d[0] < 0 || d[1] < 0) {
- return;
- }
- var w = ~~ (d[0]);
- var h = ~~ (d[1]);
- if (mode == 2) {
- w = ~~(d[1] / 0.7071 - this._layoutLabelHeight);
- h = ~~(this._layoutLabelHeight / 0.7071);
- } else if (mode == 1) {
- var tmp = w;
- w = h;
- h = tmp;
- }
- var allowWrap = mode == 1;
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- var hActual = ~~ (this._layoutLabelHeight * 1.2);
- if (hActual > h) {
- h = hActual;
- }
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- if (mode == 0 && !isHorizontal) {
- allowWrap = true;
- }
- }
- var self = this;
- var cellWidth = w;
- var cellHeight = h;
- this._textFlow.wrap(allowWrap).truncate(true).textTruncateIndicator(this._textTruncationIndicator != null ? this._textTruncationIndicator : "...").spacing(1.2).extent(function(data, index, groupIndex) {
- var width = cellWidth;
- var height = cellHeight;
- if (mode == 2) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- width = ~~self.calculate45DegreeSpace(this, cellWidth);
- }
- } else if (mode == 3) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- if (cellIndex == 0 && cellIndex == self.getStaggerCount() - 1) {
- width = cellWidth;
- } else if (cellIndex == 0 || cellIndex == self.getStaggerCount() - 1) {
- width = cellWidth * 3 / 2;
- } else {
- width = cellWidth * 2;
- }
- height = cellHeight / 2;
- }
- }
- return [width, height];
- });
- g.selectAll("g.tick > text").call(this._textFlow);
- }
- },
- /**
- * <p> Get the extent of the axis label bounds. If the axis bounds are non-null they are used as the axis bounds; otherwise the scale range and AXIS_LABEL_EXTENT_CONSTANT are used as the bounds. </p> <p> If the axis scale has range bands, the label bounds are the size of the range bands in the dimension parallel to the axis and the size of the axis bounds in the other dimension. Otherwise the label bounds are the axis bounds. </p> <p> If a title with non-empty text was created, the label bounds are reduced by the title font height in the dimension perpendicular to the axis (since the title is always placed at the edge of the bounds). </p>
- * @param (rave['internal']['Selector']) g Selector group for axis
- * @return (Array) The extent of the axis label bounds
- */
- /** @expose */
- labelExtent : function(g) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var w = this._bounds.width;
- var h = this._bounds.height;
- if (this._scale.scale().rangeBand) {
- var rangeBandValue = + (this._scale.scale().rangeBand());
- if (isHorizontal) {
- w = rangeBandValue;
- } else {
- h = rangeBandValue;
- }
- }
- this.calcTitleExtent(g);
- if (isHorizontal) {
- h -= this._axis.tickSize();
- h -= this._padding / 2;
- if (this._layoutTitleSize != 0) {
- h -= this._layoutTitleSize;
- h -= this._padding / 2;
- }
- } else {
- w -= this._axis.tickSize();
- w -= this._padding / 2;
- if (this._layoutTitleSize != 0) {
- w -= this._layoutTitleSize;
- w -= this._padding / 2;
- }
- }
- return [w, h];
- },
- calcTitleExtent : function(g) {
- this._layoutTitleSize = 0;
- var title = g.selectAll("text.axis-title");
- if (title.size() > 0) {
- var textHeight = title[0][0].getBBox().height;
- this._layoutTitleSize = textHeight;
- }
- },
- /**
- * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
- * @param (String) role The new role
- * @return (com.ibm.rave.bundles.components.AxisComponentImpl) This object
- */
- /** @expose */
- setRole : function(role) {
- this._role = role;
- return this;
- },
- /**
- * Set the ticks interval on the scale based on the magnitude. tickMagnitude represents power of 10. null value gives the default scale ticks.
- * @param (Number) tickMagnitude
- * @return (com.ibm.rave.bundles.component.AxisComponent) this
- */
- /** @expose */
- scaleTickMagnitude : function(tickMagnitude) {
- this._tickMagnitude = tickMagnitude;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) scale The new scale
- */
- /** @expose */
- scale : function(scale) {
- this._scale = scale ? scale : null;
- return this;
- },
- /**
- * Only legal values are accepted, otherwise the orient is unchanged.
- * @param (String) orient The new orient
- */
- orient$0 : function(orient) {
- if ("left" == orient || "bottom" == orient || "right" == orient || "top" == orient) {
- this._orient = orient;
- if (this._role == null) {
- if ("left" == orient) {
- this._role = "ROLE_Y1";
- } else if ("bottom" == orient) {
- this._role = "ROLE_X1";
- } else if ("right" == orient) {
- this._role = "ROLE_Y2";
- } else {
- this._role = "ROLE_X2";
- }
- }
- }
- return this;
- },
- /**
- * Returns the current orientation string return The current orient
- */
- orient$1 : function() {
- return this._orient;
- },
- /**
- * @param (rave['internal']['RectStruct']) bounds The new bounds
- */
- /** @expose */
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- /** @expose */
- elementRect : function(elementRect) {
- this._elementRect = elementRect;
- return this;
- },
- tickFormat$0 : function(tickFormat) {
- this._tickFormat = tickFormat;
- return this;
- },
- tickFormat$1 : function() {
- return this._tickFormat;
- },
- simplifiedTickFormat$0 : function(tickFormat) {
- this._simplifiedTickFormat = tickFormat;
- return this;
- },
- simplifiedTickFormat$1 : function() {
- return this._simplifiedTickFormat;
- },
- /** @expose */
- displayAxisTitle : function(displayAxisTitle) {
- this._displayAxisTitle = displayAxisTitle;
- return this;
- },
- /** @expose */
- displayAxisLine : function(displayAxisLine) {
- this._displayAxisLine = displayAxisLine;
- return this;
- },
- /** @expose */
- displayTicks : function(displayTicks) {
- this._displayTicks = displayTicks;
- return this;
- },
- /** @expose */
- displayTickLabels : function(displayTickLabels) {
- this._displayTickLabels = displayTickLabels;
- return this;
- },
- /** @expose */
- allowAutomaticAxisLayoutToChangeOrientation : function(state) {
- this._allowAutoAxisLayoutToChangeOrientaiton = state;
- return this;
- },
- /** @expose */
- isAllowAutomaticAxisLayoutToChangeOrientation : function() {
- return this._allowAutoAxisLayoutToChangeOrientaiton;
- },
- /** @expose */
- showPanZoomTickLabels : function(showPanZoomTickLabels) {
- this._showPanZoomTickLabels = showPanZoomTickLabels;
- return this;
- },
- /** @expose */
- axisTitle : function(axisTitle) {
- this._axisTitle = axisTitle;
- return this;
- },
- /** @expose */
- axisColor : function(axisColor) {
- this._lineColor = axisColor;
- this._tickColor = axisColor;
- return this;
- },
- /** @expose */
- lineColor : function(lineColor) {
- this._lineColor = lineColor;
- return this;
- },
- /** @expose */
- tickColor : function(tickColor) {
- this._tickColor = tickColor;
- return this;
- },
- /** @expose */
- labelColor : function(labelColor) {
- this._labelStyle["fill"] = labelColor;
- return this;
- },
- labelStyle$0 : function(fill, fontSize, fontFamily) {
- this._labelStyle["fill"] = fill;
- this._labelStyle["font-size"] = fontSize;
- this._labelStyle["font-family"] = fontFamily;
- return this;
- },
- /** @expose */
- titleColor : function(titleColor) {
- this._titleStyle["fill"] = titleColor;
- return this;
- },
- titleStyle$0 : function(fill, fontSize, fontFamily) {
- this._titleStyle["fill"] = fill;
- this._titleStyle["font-size"] = fontSize;
- this._titleStyle["font-family"] = fontFamily;
- return this;
- },
- /**
- * @param (int) padding The new padding
- */
- /** @expose */
- padding : function(padding) {
- this._padding = padding;
- return this;
- },
- /**
- * @param mode LayoutMode for axis, one of: null (numeric axis), automatic, horizontal, stagger, rotate45, rotate90
- */
- /** @expose */
- layoutMode : function(layoutMode) {
- this._layoutMode = -1;
- if (layoutMode != null) {
- if (layoutMode == "horizontal") {
- this._layoutMode = 0;
- } else if (layoutMode == "stagger") {
- this._layoutMode = 3;
- } else if (layoutMode == "rotate45") {
- this._layoutMode = 2;
- } else if (layoutMode == "rotate90") {
- this._layoutMode = 1;
- }
- }
- return this;
- },
- /**
- * @param (boolean) allow Enable Stagger to be considered in the automatic layout algorithm
- */
- /** @expose */
- allowStagger : function(allow) {
- this._allowStagger = allow;
- return this;
- },
- /**
- * @param (boolean) allow Enable Rotate 45 to be considered in the automatic layout algorithm
- */
- /** @expose */
- allowRotate45 : function(allow) {
- this._allowRotate45 = allow;
- return this;
- },
- /**
- * @param (boolean) allow Enable Rotate 90 to be considered in the automatic layout algorithm
- */
- /** @expose */
- allowRotate90 : function(allow) {
- this._allowRotate90 = allow;
- return this;
- },
- /**
- * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
- */
- renderedShapes : function() {
- return this._renderedShapes;
- },
- labelStyle$1 : function(fontStyle) {
- this._labelStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
- return this;
- },
- titleStyle$1 : function(fontStyle) {
- this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
- return this;
- },
- /**
- * Determines whether the axis is swapped.
- * @return (boolean) True if axis is swapped
- */
- isAxisSwapped : function() {
- return (((this._role == "ROLE_Y1" || this._role == "ROLE_Y2") && (this._orient == "top" || this._orient == "bottom")) || ((this._role == "ROLE_X1" || this._role == "ROLE_X2") && (this._orient == "right" || this._orient == "left")));
- },
- /**
- * <p> Set the indicator to be used for truncated text </p> <p> ex: indicator set to "..." , results in helloworld - > hello... </p> <p> If the indicator is not set the default indicator "..." is used </p>
- * @param (String) indicator the string to be placed to indicated truncated text
- * @return (com.ibm.rave.bundles.component.AxisComponent) This component
- */
- /** @expose */
- textTruncateIndicator : function(indicator) {
- this._textTruncationIndicator = indicator;
- return this;
- },
- /**
- * If at least one label collision request is pending we stop the label collision component, and shut down the label collision timer event.
- */
- stopLabelDroppingUpdate : function() {
- this._pendingLabelTimer = false;
- },
- /**
- * Start Rave timers with a delay of half the transition duration and the full transition duration. This will fire the label dropping at the halfway mark and at the end.
- * @param (rave['internal']['Selector']) labels the selection of valid labels for the end of the transition
- * @param (double) duration of the transition. If 0, we don't do anything.
- * @param (double) delay of the transition. Added to the duration to delay the updates.
- */
- updateLabelDropping : function(labels, duration, delay) {
- var self = this;
- var start = delay + duration;
- var labelCollideCallback = function(elapsed) {
- if (!self._pendingLabelTimer) {
- return true;
- }
- labels.call(self._dropOverlap, self._hideOverlappingLabels);
- if (elapsed >= start) {
- self._pendingLabelTimer = false;
- return true;
- }
- return false;
- };
- if (duration > 0) {
- this._pendingLabelTimer = true;
- rave.timer(labelCollideCallback, start);
- }
- },
- doLabelWrappingAfterAnimation : function(g, labels, mode, duration, delay) {
- this._layoutTimerId++;
- var timerId = this._layoutTimerId;
- var self = this;
- var wrapCallback = function(elapsed) {
- if (self._layoutTimerId == timerId) {
- self.doLabelWrapping(g, mode);
- self.handleLabelsRotationAndPosition(g, labels, mode);
- }
- return true;
- };
- rave.timer(wrapCallback, delay + duration);
- },
- /** @expose */
- preLayout : function() {
- this._layoutTitleSize = 0;
- this._layoutLabelSize = 0;
- this._layoutLabelHeight = 0;
- this._layoutAverageDigitWidth = 0;
- this._layoutSpillOver = 0;
- },
- /** @expose */
- getSizableType : function() {
- return this._scale.isOrdinal() || this._scale.isClustered() ? 1 : 0;
- },
- /** @expose */
- getSizableOrientation : function() {
- return this._orient;
- },
- /** @expose */
- getPreferredSize : function() {
- var layoutPaddingSize = 0;
- if (this._axis) {
- layoutPaddingSize = this._axis.tickSize();
- if (this._layoutLabelSize != 0) {
- layoutPaddingSize += this._padding / 2;
- }
- if (this._layoutTitleSize != 0) {
- layoutPaddingSize += this._padding / 2;
- }
- }
- return this._layoutLabelSize + this._layoutAverageDigitWidth + this._layoutTitleSize + layoutPaddingSize + 2;
- },
- /** @expose */
- getSpillOverSize : function() {
- return this._layoutSpillOver;
- },
- /** @expose */
- orient : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.orient$1();
- }
- return this.orient$0(a0);
- },
- /** @expose */
- tickFormat : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.tickFormat$1();
- }
- return this.tickFormat$0(a0);
- },
- /** @expose */
- simplifiedTickFormat : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.simplifiedTickFormat$1();
- }
- return this.simplifiedTickFormat$0(a0);
- },
- /** @expose */
- labelStyle : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.labelStyle$1(a0);
- }
- return this.labelStyle$0(a0, a1, a2);
- },
- /** @expose */
- titleStyle : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.titleStyle$1(a0);
- }
- return this.titleStyle$0(a0, a1, a2);
- }
- });
- /**
- * Given the bounds for the axis and the orientation, return the [x,y] translation for the group containing the axis. These are the usual settings for d3 (RAVE core) axes, where the axis range (pixels) is in the global coordinates, then the axis is moved perpendicular to that to place it next to the chart.
- * @param (rave['internal']['RectStruct']) bounds Rectangle of the axis bounds
- * @param (String) orient Orient, "top", "bottom", "left", "right"; if not valid, "bottom" used
- * @return (double[]) Translation [x,y]
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation = function(bounds, orient) {
- if ("left" == orient) {
- return [bounds.x + bounds.width, 0.0];
- }
- if ("right" == orient) {
- return [bounds.x, 0.0];
- }
- if ("top" == orient) {
- return [0.0, bounds.y + bounds.height];
- }
- return [0.0, bounds.y];
- };
- com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex = rave['internal']['Declare']({
- //_node : null,
- _domainIndex : 0,
- /** @expose */
- constructor : function(node, domainIndex) {
- this._node = node;
- this._domainIndex = domainIndex;
- },
- /** @expose */
- contains : function(node) {
- return node == this._node;
- },
- /** @expose */
- getIndex : function() {
- return this._domainIndex;
- }
- });
- /**
- * Tick Handler for the axis. This will get called as the core axis is transitioned.
- */
- com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler = rave['internal']['Declare'](rave['internal']['AbstractTickHandler'], {
- //_label : null,
- //_tick : null,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- _$self.handle(args[0]);
- return null;
- }
- };
- return _$self;
- },
- constructor : function(label, tick) {
- this._label = label;
- this._tick = tick;
- },
- /** @expose */
- handle : function(ticks) {
- ticks.call(this._tick);
- ticks.call(this._label);
- }
- });
- //com_ibm_rave_bundles_components_AxisComponentImpl.VISIBILITY = "visibility";
- //com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN = "hidden";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.LABEL_HIDDEN_FLAG = "__tickLabelHidden__";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.PANZOOM_HIDDEN_FLAG = "__panZoomHidden__";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN_COUNT = "__hiddenCount__";
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_SPACE_PER_TICK = 20;
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_TICK_COUNT = 10;
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.TICK_PADDING = 10;
- //com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL_WEIGHT = 1.1;
- com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL = 0;
- com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE90 = 1;
- com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE45 = 2;
- com_ibm_rave_bundles_components_AxisComponentImpl.STAGGER = 3;
- /**
- * Constant used for text flow spacing
- */
- com_ibm_rave_bundles_components_AxisComponentImpl.TEXTFLOW_SPACING = 1.2;
- /**
- * Bottom axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.BOTTOM_ORIENTATION = "bottom";
- /**
- * Top axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.TOP_ORIENTATION = "top";
- /**
- * Left axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.LEFT_ORIENTATION = "left";
- /**
- * Right axis orientation string.
- */
- /** @expose */
- com_ibm_rave_bundles_components_AxisComponentImpl.RIGHT_ORIENTATION = "right";
- com_ibm_rave_bundles_components_AxisComponentImpl.AUTOMODE = -1;
- // $source: com/ibm/rave/bundles/components/GridComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/components/StyleStructs (runtime) // new
- //@import com/ibm/rave/bundles/component/GridComponent (runtime) // GridComponent
- /**
- * <p> Component to draw gridlines for an axis. The component is drawn into a Selector group, and the user of the component must translate the group to the axis position. Gridlines are created using the axis, setting the tick size to the dimension of the gridline space. For correct behavior the gridline component should be called after the axis has been called. </p> <p> The properties are: </p> <p> <b>axis</b>: The axis to use. If null, no gridlines are drawn. Default null. </p> <p> <b>orient</b>: The axis orientation, one of "top", "bottom", "left", "right". Default "bottom". </p> <p> <b>bounds</b>: A rectangle bounding the gridline area, used to find the line length. If null, no gridlines are drawn. Default null. </p> <p> <b>displayGridlines</b>: Whether to draw the gridlines. Default false. </p> <p> <b>gridlineColor</b>: A color-string for the grid lines. If null, no color is applied and the CSS defaults are used. Default null. </p>
- */
- var com_ibm_rave_bundles_components_GridComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- /**
- * The axis property
- */
- //_axis : null,
- /**
- * Role, from the AxisComponent API
- */
- //_role : null,
- /**
- * The orientation
- */
- //_orient : null,
- /**
- * The bounds
- */
- //_bounds : null,
- /**
- * Style of gridlines
- */
- //_gridlineStyle : null,
- /**
- * Whether to display gridlines
- */
- _displayGridlines : false,
- /**
- * After calling the component, this is true if shapes were rendered, false if they were cleared.
- */
- _renderedShapes : false,
- /**
- * Construct, with all properties the defaults.
- */
- /** @expose */
- constructor : function() {
- this._axis = null;
- this._role = null;
- this._orient = "bottom";
- this._bounds = null;
- this._displayGridlines = true;
- this._gridlineStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
- this._renderedShapes = false;
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE;
- },
- /** @expose */
- role : function() {
- return this._role;
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- if (!this._displayGridlines || !this._axis || !this._bounds) {
- g.selectAll("*").remove();
- this._renderedShapes = false;
- return;
- }
- this._renderedShapes = true;
- var size = ("bottom" == this._orient || "top" == this._orient) ? this._bounds.height : this._bounds.width;
- var ticksHandler = this._axis.ticksHandler();
- var tickSize = this._axis.tickSize();
- var outerTickSize = this._axis.outerTickSize();
- var tickFormat = this._axis.tickFormat();
- var ax = this._axis.tickSize(-size, 0).tickFormat("").ticksHandler(null);
- g.call(ax);
- this._axis.tickSize(tickSize, outerTickSize).tickFormat(tickFormat).ticksHandler(ticksHandler);
- g.selectAll("g.tick line").classed("grid-tick", true);
- g.selectAll(".grid-tick").style("stroke", this._gridlineStyle._stroke).style("stroke-dasharray", (this._gridlineStyle._dashArray));
- g.selectAll("path.domain").remove();
- },
- /**
- * @param (rave['internal']['Axis']) axis The new axis
- */
- /** @expose */
- axis : function(axis) {
- this._axis = axis;
- return this;
- },
- /**
- * Set the role to one of the constants ROLE_X1 etc. defined in AxisComponent.
- * @param (String) role The new role
- * @return (com.ibm.rave.bundles.components.GridComponentImpl) This object
- */
- /** @expose */
- setRole : function(role) {
- this._role = role;
- return this;
- },
- /**
- * Only legal values are accepted, otherwise the orient is unchanged.
- * @param (String) orient The new orient
- */
- orient$0 : function(orient) {
- if ("left" == orient || "right" == orient || "bottom" == orient || "top" == orient) {
- this._orient = orient;
- }
- return this;
- },
- /**
- * @param (rave['internal']['RectStruct']) bounds The new bounds
- */
- /** @expose */
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- displayGridlines$0 : function(displayGridlines) {
- this._displayGridlines = displayGridlines;
- return this;
- },
- /** @expose */
- gridlineStyle : function(gridlineColor, dashArray) {
- this.gridlineColor(gridlineColor);
- this.dashArray(dashArray);
- return this;
- },
- gridlineColor$0 : function(gridlineColor) {
- this._gridlineStyle._stroke = (gridlineColor != null && gridlineColor.length > 0) ? gridlineColor : null;
- return this;
- },
- dashArray$0 : function(dashArray) {
- this._gridlineStyle._dashArray = (dashArray != null && dashArray.length > 0) ? dashArray : null;
- return this;
- },
- /**
- * @return (String) The orientation of the gridline.
- */
- orient$1 : function() {
- return this._orient;
- },
- displayGridlines$1 : function() {
- return this._displayGridlines;
- },
- gridlineColor$1 : function() {
- return this._gridlineStyle._stroke;
- },
- dashArray$1 : function() {
- return this._gridlineStyle._dashArray;
- },
- /**
- * @return (boolean) True if on the last call the axis rendered shapes, false otherwise
- */
- renderedShapes : function() {
- return this._renderedShapes;
- },
- /** @expose */
- orient : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.orient$1();
- }
- return this.orient$0(a0);
- },
- /** @expose */
- displayGridlines : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.displayGridlines$1();
- }
- return this.displayGridlines$0(a0);
- },
- /** @expose */
- gridlineColor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.gridlineColor$1();
- }
- return this.gridlineColor$0(a0);
- },
- /** @expose */
- dashArray : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.dashArray$1();
- }
- return this.dashArray$0(a0);
- }
- });
- // $source: com/ibm/rave/bundles/components/KeyedBundleComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- /**
- * 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.
- * @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>
- */
- var com_ibm_rave_bundles_components_KeyedBundleComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //keyFunction : null,
- /**
- * Set the key function this component should use when joining data to scene nodes.
- * @param (rave['internal']['SingleValueFunction']) keyFunction This function will be passed each datum individually and must return a unique value (a key).
- * @return (com.ibm.rave.bundles.components.KeyedBundleComponentImpl) This.
- */
- /** @expose */
- key : function(keyFunction) {
- this.keyFunction = keyFunction;
- return this;
- },
- /**
- * Returns a {@link (rave['internal']['ValueFunction']) ValueFunction} that wraps the provided key function.
- */
- /** @expose */
- getKey : function() {
- if (!this.keyFunction) {
- return null;
- }
- var self = this;
- return function(datum, index, groupIndex) {
- return self.keyFunction(datum);
- };
- }
- });
- // $source: com/ibm/rave/bundles/components/IntervalComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
- //@import com/ibm/rave/bundles/component/IntervalComponent (runtime) // IntervalComponent
- //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
- //@import com/ibm/rave/bundles/utilities/LabelStyleUtil (runtime) // new
- /**
- * <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>
- */
- var com_ibm_rave_bundles_components_IntervalComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
- /**
- * Data
- */
- //_data : null,
- /**
- * Accessor for key variable
- */
- //_keyAccessor : null,
- /**
- * Accessor for independent1 variable
- */
- //_independent1Accessor : null,
- /**
- * Accessor for independent2 variable
- */
- //_independent2Accessor : null,
- /**
- * Independent variable scale
- */
- //_independentScale : null,
- /**
- * Accessor for dependent1 variable
- */
- //_dependent1Accessor : null,
- /**
- * Accessor for dependent2 variable
- */
- //_dependent2Accessor : null,
- /**
- * Dependent scale
- */
- //_dependentScale : null,
- /**
- * Color scale
- */
- //_colorPalette : null,
- /**
- * Accessor for label role
- */
- //_labelAccessor : null,
- /**
- * Accessor for data values
- */
- //_valueAccessor : null,
- /**
- * Label formatter, may be null
- */
- //_labelFormatter : null,
- //_dropOverlap : null,
- /**
- * Show label
- */
- //_itemLabelPosition : null,
- /**
- * border width
- */
- //_borderWidth : null,
- //_borderColor : null,
- /**
- * Effect
- */
- //_specialTransition : null,
- //_delay : null,
- //_labelFontStyle : null,
- //_bounds : null,
- //_labelStyleUtil : null,
- /**
- * Transpose
- */
- _transpose : false,
- /**
- * Show label
- */
- _itemLabel : false,
- /**
- * Drop overlapping labels
- */
- _itemOverlap : true,
- _labelLayerClass : ".element-label-group",
- _elementLayerClass : ".element-group",
- _labelContrast : false,
- _labelShadow : false,
- constructor : function() {
- this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
- this._delay = function(data, index, groupIndex) {
- return 0;
- };
- this._labelFontStyle = {};
- {
- this._labelStyleUtil = new com_ibm_rave_bundles_utilities_LabelStyleUtil();
- }
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_IntervalComponent.COMPONENT_TYPE;
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- var elementGroupSelector = g.selectAll(this._elementLayerClass);
- var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
- if (g.classed(this._elementLayerClass) || elementGroupSelector.size() == 0 || elementLabelGroupSelector.size() == 0) {
- elementGroupSelector = g;
- elementLabelGroupSelector = g;
- }
- if (!this._data || !this._independent1Accessor || !this._independent2Accessor || !this._independentScale || !this._dependent1Accessor || !this._dependent2Accessor || !this._dependentScale) {
- elementGroupSelector.selectAll("*").remove();
- elementLabelGroupSelector.selectAll("*").remove();
- return;
- }
- var self = this;
- var labelText = !this._labelFormatter ? function(data, index, groupIndex) {
- 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) {
- return null;
- }
- return self._labelAccessor(data);
- } : function(data, index, groupIndex) {
- var v = self._labelAccessor(data);
- return v == null ? null : self._labelFormatter.call(this, v, index, groupIndex);
- };
- var keyFunction = !this._keyAccessor ? null : function(datum, ix, gix) {
- return self._keyAccessor(datum);
- };
- var labelsOn = this._itemLabel && this._labelAccessor;
- if (!labelsOn) {
- g.selectAll("text.element-label").remove();
- }
- var elementSelector = elementGroupSelector.selectAll(".element").data(this._data, this.getKey() ? this.getKey() : keyFunction);
- elementSelector.exit().remove();
- var elementEnter = elementSelector.enter().append("g").attr("class", "element");
- 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);
- if (labelsOn) {
- var elementLabelSelector = elementLabelGroupSelector.selectAll(".element-label").data(this._data, this.getKey() ? this.getKey() : keyFunction);
- elementLabelSelector.exit().remove();
- elementLabelSelector.enter().append("text").attr("class", "element-label");
- this.addLabels(elementLabelSelector).text(labelText);
- }
- var shapes = elementSelector.select(".element-shape");
- var t = rave.transition(shapes);
- if (t != shapes && this._delay) {
- (t).delay(this._delay);
- }
- t.style("fill", this._colorPalette);
- this.updateBorder(t, this._borderWidth, this._borderColor);
- var fontChecker = rave.capabilities.extension("fontchecker");
- if (this._specialTransition == null) {
- 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));
- } else if (this.isXYanimation()) {
- 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));
- } else {
- 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));
- }
- if (this._renderCallback) {
- t.call(this._renderCallback, "elements");
- }
- if (labelsOn) {
- var labels = g.selectAll(".element-label");
- var t2 = rave.transition(labels);
- if (fontChecker) {
- labels.call(fontChecker);
- }
- if (t2 != labels && this._delay) {
- (t2).delay(this._delay);
- }
- t2.attr("x", this.getXPosition()).attr("dx", this.getXOffset()).attr("y", this.getYPosition()).attr("dy", this.getYOffset()).style("text-anchor", this.getAnchor());
- var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
- this._labelStyleUtil.labelFont(this._labelFontStyle).labelFillColor(this._labelContrast ? this.getLabelFill() : function(data, index, groupIndex) {
- return labelColor;
- }).labelShadow(this._labelShadow);
- labels.call(this._labelStyleUtil);
- t2.text(labelText);
- this._dropOverlap.configureForDataLabels(this._bounds);
- t2.call(this._dropOverlap, this._itemOverlap);
- }
- },
- /**
- * Add a <text g=element-label"> to each node in the selection s, setting the text properties to the usual defaults.
- * @param (rave['internal']['Selector']) s Selector
- * @return (rave['internal']['Selector']) Selector for the added labels
- */
- addLabels : function(s) {
- 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");
- },
- getAnchor : function() {
- var self = this;
- return function(data, index, groupIndex) {
- if (!self._transpose || (!self._itemLabelPosition)) {
- return "middle";
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (0 == labelPosition) {
- return "start";
- } else if (1 == labelPosition) {
- return "middle";
- } else {
- return "end";
- }
- };
- },
- getLabelFill : function() {
- var self = this;
- var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
- return function(data, index, groupIndex) {
- if (!self._itemLabelPosition) {
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._colorPalette.call(this, data, index, groupIndex), labelColor).toString();
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (1 == labelPosition) {
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(self._colorPalette.call(this, data, index, groupIndex), labelColor).toString();
- }
- return labelColor;
- };
- },
- getXOffset : function() {
- var self = this;
- return function(data, index, groupIndex) {
- if (!self._transpose || (!self._itemLabelPosition)) {
- return "0em";
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (0 == labelPosition) {
- return ".3em";
- } else if (1 == labelPosition) {
- return "0em";
- } else {
- return "-.3em";
- }
- };
- },
- getYOffset : function() {
- var self = this;
- return function(data, index, groupIndex) {
- if (self._transpose || (!self._itemLabelPosition)) {
- return ".3em";
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (0 == labelPosition) {
- return "-.3em";
- } else if (1 == labelPosition) {
- return ".3em";
- } else {
- return "1.1em";
- }
- };
- },
- getXPosition : function() {
- var self = this;
- return function(data, index, groupIndex) {
- if (!self._transpose || (!self._itemLabelPosition)) {
- return self.rectangleCenter(true, false, false).call(this, data, index, groupIndex);
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (0 == labelPosition) {
- return self.rectangleCoord$1(true, false, false, true).call(this, data, index, groupIndex);
- } else if (1 == labelPosition) {
- return self.rectangleCenter(true, false, false).call(this, data, index, groupIndex);
- } else {
- return self.rectangleCoord$1(true, false, false, false).call(this, data, index, groupIndex);
- }
- };
- },
- getYPosition : function() {
- var self = this;
- return function(data, index, groupIndex) {
- if (self._transpose || (!self._itemLabelPosition)) {
- return self.rectangleCenter(false, false, false).call(this, data, index, groupIndex);
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (0 == labelPosition) {
- return self.rectangleCoord$1(false, false, false, false).call(this, data, index, groupIndex);
- } else if (1 == labelPosition) {
- return self.rectangleCenter(false, false, false).call(this, data, index, groupIndex);
- } else {
- return self.rectangleCoord$1(false, false, false, true).call(this, data, index, groupIndex);
- }
- };
- },
- /**
- * Return a value function that gives the "x" or "y" coordinate of a rectangle.
- * @param (boolean) xdim Whether "x" (true) or "y" (false) is requested
- * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns the coordinate for value 0.0
- * @param (boolean) enter Whether the coordinate is for an enter transition
- * @return (rave['internal']['ValueFunction']) Value function for that coordinate
- */
- rectangleCoord$0 : function(xdim, fromBase, enter) {
- return this.rectangleCoord$1(xdim, fromBase, enter, false);
- },
- rectangleCoord$1 : function(xdim, fromBase, enter, useMax) {
- var useDependent = xdim == this._transpose;
- var scale = useDependent ? this._dependentScale : this._independentScale;
- if (fromBase && useDependent && this._dependentScale.isLinear()) {
- var value = scale.lower(0.0);
- return function(data, index, groupIndex) {
- return value;
- };
- }
- var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
- var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
- if (enter && this.isCTShandling()) {
- return function(data, index, groupIndex) {
- return scale.center(a1(data));
- };
- }
- return function(data, index, groupIndex) {
- if (useMax) {
- return Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data))));
- } else {
- return Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data))));
- }
- };
- },
- /**
- * Return a value function that gives the "height" or "width" coordinate of a rectangle.
- * @param (boolean) xdim Whether "width" (true) or "height" (false) is requested
- * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns 0.001
- * @param (boolean) enter Whether the size is for an enter transition
- * @return (rave['internal']['ValueFunction']) Value function for that coordinate
- */
- rectangleSize : function(xdim, fromBase, enter) {
- var useDependent = xdim == this._transpose;
- var scale = useDependent ? this._dependentScale : this._independentScale;
- if ((fromBase && useDependent && this._dependentScale.isLinear()) || (enter && this.isCTShandling())) {
- return function(data, index, groupIndex) {
- return 0.001;
- };
- }
- var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
- var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
- return function(data, index, groupIndex) {
- 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)))));
- };
- },
- /**
- * @return (boolean) Whether the XY animation (shift X, then Y) should be used
- */
- isXYanimation : function() {
- return "XY_CTS" == this._specialTransition || "XY_STC" == this._specialTransition;
- },
- /**
- * @return (boolean) Whether the data handling changed from clustered to stacked
- */
- isCTShandling : function() {
- return "XY_CTS" == this._specialTransition || "YX_CTS" == this._specialTransition;
- },
- /**
- * Return a value function that gives the x or y center coordinate of a rectangle.
- * @param (boolean) xdim Whether the x (true) or y (false) is requested
- * @param (boolean) fromBase If true and the scale is non-ordinal, the function returns the scaled 0.0
- * @param (boolean) enter Whether the center is for an enter transition
- * @return (rave['internal']['ValueFunction']) Value function for that coordinate
- */
- rectangleCenter : function(xdim, fromBase, enter) {
- var useDependent = xdim == this._transpose;
- var scale = useDependent ? this._dependentScale : this._independentScale;
- if (fromBase && useDependent && this._dependentScale.isLinear()) {
- var value = scale.lower(0.0);
- return function(data, index, groupIndex) {
- return value;
- };
- }
- var a1 = useDependent ? this._dependent1Accessor : this._independent1Accessor;
- var a2 = useDependent ? this._dependent2Accessor : this._independent2Accessor;
- if (enter && this.isCTShandling()) {
- return function(data, index, groupIndex) {
- return + (scale.center(a1(data)));
- };
- }
- return function(data, index, groupIndex) {
- var val = (Math.max(+ (scale.upper(a1(data))), + (scale.upper(a2(data)))) + Math.min(+ (scale.lower(a1(data))), + (scale.lower(a2(data))))) / 2.0;
- if (isNaN(val)) {
- val = 0;
- }
- return val;
- };
- },
- /**
- * @param (java.lang.Object[]) data The new data
- */
- /** @expose */
- data : function(data) {
- this._data = data;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) keyAccessor The new key accessor
- */
- /** @expose */
- keyAccessor : function(keyAccessor) {
- this._keyAccessor = keyAccessor;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) independent1Accessor The new independent1 accessor
- */
- /** @expose */
- independent1Accessor : function(independent1Accessor) {
- this._independent1Accessor = independent1Accessor;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) independent2Accessor The new independent1 accessor
- */
- /** @expose */
- independent2Accessor : function(independent2Accessor) {
- this._independent2Accessor = independent2Accessor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
- */
- /** @expose */
- independentScale : function(independentScale) {
- this._independentScale = independentScale;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) dependent1Accessor The new dependent1 accessor
- */
- /** @expose */
- dependent1Accessor : function(dependent1Accessor) {
- this._dependent1Accessor = dependent1Accessor;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) dependent2Accessor The new dependent2 accessor
- */
- /** @expose */
- dependent2Accessor : function(dependent2Accessor) {
- this._dependent2Accessor = dependent2Accessor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
- */
- /** @expose */
- dependentScale : function(dependentScale) {
- this._dependentScale = dependentScale;
- return this;
- },
- /**
- * @param (rave['library']['internal']['Palette']) colorPalette The new colorPalette
- */
- /** @expose */
- colorPalette : function(colorPalette) {
- this._colorPalette = colorPalette;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) labelAccessor The new labelAccessor
- */
- /** @expose */
- labelAccessor : function(labelAccessor) {
- this._labelAccessor = labelAccessor;
- return this;
- },
- /**
- * @param (rave['internal']['ValueFunction']) labelFormatter The new labelFormatter
- */
- /** @expose */
- labelFormatter : function(labelFormatter) {
- this._labelFormatter = labelFormatter;
- return this;
- },
- /**
- * @param (boolean) transpose The new transpose
- */
- /** @expose */
- transpose : function(transpose) {
- this._transpose = transpose;
- return this;
- },
- /**
- * @param (boolean) itemLabel The new itemLabel
- */
- /** @expose */
- itemLabel : function(itemLabel) {
- this._itemLabel = itemLabel;
- return this;
- },
- /**
- * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
- */
- /** @expose */
- itemLabelPosition : function(labelPosition) {
- this._itemLabelPosition = labelPosition;
- return this;
- },
- /**
- * @param itemOverlap drop or show overlap labels
- */
- /** @expose */
- itemOverlap : function(_itemOverlap) {
- this._itemOverlap = _itemOverlap;
- return this;
- },
- /** @expose */
- valueAccessor : function(valueAccessor) {
- this._valueAccessor = valueAccessor;
- return this;
- },
- /**
- * 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>
- * @param (String) specialTransition Transition
- * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) This object
- */
- /** @expose */
- specialTransition : function(specialTransition) {
- this._specialTransition = specialTransition;
- return this;
- },
- /** @expose */
- delay : function(delayFunction) {
- this._delay = delayFunction;
- return this;
- },
- /** @expose */
- borderWidth : function(width) {
- this._borderWidth = width;
- return this;
- },
- /** @expose */
- borderColor : function(color) {
- this._borderColor = color;
- return this;
- },
- /** @expose */
- labelFont : function(labelFontStyle) {
- this._labelFontStyle = labelFontStyle;
- return this;
- },
- /**
- * @param (rave['internal']['RectStruct']) bounds The bounds of the chart area, used for label collision.
- */
- /** @expose */
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- /**
- * @param (String) className - the class name for labelslayer. If not set, the default is ".element-label-group" return this
- */
- /** @expose */
- labelLayerClassName : function(className) {
- this._labelLayerClass = className;
- return this;
- },
- /**
- * @param (String) className - the class name for elementslayer. If not set, the default is ".element-group" return this
- */
- /** @expose */
- elementLayerClassName : function(className) {
- this._elementLayerClass = className;
- return this;
- },
- /**
- * @param (boolean) labelContrast {boolean} whether to contrast the label color with background/background element color.
- * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) this
- */
- /** @expose */
- labelContrast : function(labelContrast) {
- this._labelContrast = labelContrast;
- return this;
- },
- /**
- * @param (boolean) labelShadow {boolean} whether to show a label shadow with a contrast label color.
- * @return (com.ibm.rave.bundles.components.IntervalComponentImpl) this
- */
- /** @expose */
- labelShadow : function(labelShadow) {
- this._labelShadow = labelShadow;
- return this;
- },
- rectangleCoord : function(a0, a1, a2, a3) {
- var args = arguments;
- if (args.length == 3) {
- return this.rectangleCoord$0(a0, a1, a2);
- }
- return this.rectangleCoord$1(a0, a1, a2, a3);
- }
- });
- /** @expose */
- com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_TOP = 0;
- /** @expose */
- com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_CENTER = 1;
- /** @expose */
- com_ibm_rave_bundles_components_IntervalComponentImpl.LABEL_POSITION_BOTTOM = 2;
- // $source: com/ibm/rave/bundles/components/FilterComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- var com_ibm_rave_bundles_components_FilterComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- //_id : null,
- //color : null,
- offset_x : 0,
- offset_y : 0,
- blur_radius : 0,
- /** @expose */
- constructor : function(id) {
- this._id = id;
- },
- /** @expose */
- setDropshadow : function(offset_x, offset_y, radius, rgb) {
- this.offset_x = this.getValue(offset_x);
- this.offset_y = this.getValue(offset_y);
- this.blur_radius = this.getValue(radius);
- this.color = rgb;
- },
- getValue : function(s) {
- if (s == null) {
- return 0;
- }
- return + (s.substring(0, s.length - 2));
- },
- /** @expose */
- execute : function(g) {
- var s = g.selectAll("#" + this._id).data([0]);
- var filter = s.enter().append("filter").attr("id", this._id).attr("height", "500%").attr("width", "500%");
- filter.append("feGaussianBlur").attr("in", "SourceAlpha");
- filter.append("feOffset").attr("result", "offsetBlur");
- filter.append("feFlood");
- filter.append("feComposite").attr("in2", "offsetBlur").attr("operator", "in");
- var merge = filter.append("feMerge");
- merge.append("feMergeNode");
- merge.append("feMergeNode").attr("in", "SourceGraphic");
- s.select("feGaussianBlur").attr("stdDeviation", this.blur_radius);
- s.select("feOffset").attr("dx", this.offset_x).attr("dy", this.offset_y);
- s.select("feFlood").attr("flood-color", !this.color ? "black" : this.color);
- },
- /** @expose */
- type : function() {
- return "FilterComponent";
- },
- /** @expose */
- getId : function() {
- return this._id;
- }
- });
- // $source: com/ibm/rave/bundles/components/LabelCollisionComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/BundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/LabelCollisionComponent (runtime) // LabelCollisionComponent
- /**
- * <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>
- */
- var com_ibm_rave_bundles_components_LabelCollisionComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
- /**
- * Handle label collisions method, move overlapping labels vs drop overlapping
- */
- //_handleLabelCollisions : null,
- //_labelPositioning : null,
- /**
- * Rectangle for the drawing bounds
- */
- //_bounds : null,
- /**
- * Handle label collisions method, move overlapping labels vs drop overlapping
- */
- _labelClass : ".element-label",
- /**
- * Number of sweeps performed by the labelPositioning call
- */
- _numberOfSweeps : 1000,
- /** @expose */
- execute : function(chart) {
- var labels = chart.selectAll(this._labelClass);
- if (this._handleLabelCollisions == "Move Labels") {
- this.resolveLabelCollisions(labels);
- } else if (this._handleLabelCollisions == "Drop Labels") {
- this.dropLabels(labels);
- } else {
- this.resetLabels(labels);
- }
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_LabelCollisionComponent.COMPONENT_TYPE;
- },
- resetLabels : function(labels) {
- var position = rave.capabilities.extension("position");
- position.drop().reset(labels);
- },
- dropLabels : function(labels) {
- var position = rave.capabilities.extension("position");
- var drop = position.drop();
- if (this._bounds) {
- var ex = [[this._bounds.x, this._bounds.y], [this._bounds.x + this._bounds.width, this._bounds.y + this._bounds.height]];
- drop.extent(ex);
- }
- drop.remove(false);
- drop.noClipping();
- drop.dropOverlap(labels);
- },
- /**
- * @param (rave['internal']['Selector']) labels
- */
- resolveLabelCollisions : function(labels) {
- var self = this;
- var labelBoxes = [];
- var anchorPoints = [];
- labels.each(function(data, index, groupIndex) {
- var labelBox = {};
- labelBox["x"] = + (this.getAttribute("x"));
- labelBox["y"] = + (this.getAttribute("y"));
- labelBox["width"] = + (this.getBBox().width);
- labelBox["height"] = + (this.getBBox().height);
- labelBoxes.push(labelBox);
- var anchorPoint = {};
- anchorPoint["x"] = labelBox["x"];
- anchorPoint["y"] = labelBox["y"];
- anchorPoint["r"] = 5;
- anchorPoints.push(anchorPoint);
- });
- labels.data(labelBoxes);
- var position = rave.capabilities.extension("position");
- var repositionLabels = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- if (self._handleLabelCollisions == "Move Labels") {
- labels.transition().duration(110).attr("x", function(data, index, groupIndex) {
- return (data)["x"];
- }).attr("y", function(data, index, groupIndex) {
- return (data)["y"];
- });
- }
- return this;
- }
- };
- this._labelPositioning = position.place().label(labelBoxes);
- this._labelPositioning.anchor(anchorPoints).width(this._bounds.width).height(this._bounds.height).numberOfSweeps(this._numberOfSweeps).start().on("tick", repositionLabels);
- },
- /**
- * @param (String) className - the class name for labels. If not set, the default is ".element-label" return this
- */
- /** @expose */
- labelClassName : function(className) {
- this._labelClass = className;
- return this;
- },
- /**
- * @param (String) resolve - if true, we resolve label collisions return this
- */
- /** @expose */
- labelResolution : function(resolve) {
- this._handleLabelCollisions = resolve;
- if (this._labelPositioning && this._handleLabelCollisions != null) {
- this._labelPositioning.stop();
- }
- return this;
- },
- /**
- * @param (rave['internal']['RectStruct']) bounds The new bounds
- */
- /** @expose */
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- /**
- * @param (int) numberOfSweeps The number of sweeps performed by the labelPositioning code
- */
- /** @expose */
- numberOfSweeps : function(numberOfSweeps) {
- this._numberOfSweeps = numberOfSweeps;
- return this;
- }
- });
- /** @expose */
- com_ibm_rave_bundles_components_LabelCollisionComponentImpl.MOVE_LABELS = "Move Labels";
- /** @expose */
- com_ibm_rave_bundles_components_LabelCollisionComponentImpl.DROP_LABELS = "Drop Labels";
- /** @expose */
- com_ibm_rave_bundles_components_LabelCollisionComponentImpl.NONE = "none";
- // $source: com/ibm/rave/bundles/components/AbstractPathComponent
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/utilities/PathUtils (runtime) // fadeOutIn
- /**
- * Base class for Line and Area components, both of which create similar path-based elements.
- */
- var com_ibm_rave_bundles_components_AbstractPathComponent = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
- /**
- * Interpolation Mode (Smoothness of the line)
- */
- /** @expose */
- _interpolateMode : null,
- /**
- * Keep track of the previous Interpolation Mode
- */
- /** @expose */
- _previousInterpolateMode : null,
- constructor : function() {
- this._interpolateMode = rave['internal']['SVGLine'].r2_svg_lineLinear.getKey();
- this._previousInterpolateMode = this._interpolateMode;
- },
- /** @expose */
- updatePath : function(updateSelection, pathFunction) {
- if (this._interpolateMode != null && !(this._interpolateMode == this._previousInterpolateMode)) {
- com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn(updateSelection, pathFunction);
- } else {
- updateSelection.attr("d", pathFunction);
- }
- this._previousInterpolateMode = this._interpolateMode;
- }
- });
- // $source: com/ibm/rave/bundles/components/LineComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/AbstractPathComponent (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/LineComponent (runtime) // LineComponent
- /**
- * <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>
- */
- var com_ibm_rave_bundles_components_LineComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_AbstractPathComponent, {
- /**
- * Data
- */
- //_data : null,
- /**
- * Accessor for points role
- */
- //_pointsAccessor : null,
- /**
- * Accessor for color role
- */
- //_groupAccessor : null,
- /**
- * Accessor for independent variable from a point
- */
- //_independentAccessor : null,
- /**
- * Independent variable scale
- */
- //_independentScale : null,
- /**
- * Accessor for dependent variable from a point
- */
- //_dependentAccessor : null,
- /**
- * Dependent scale
- */
- //_dependentScale : null,
- /**
- * Color scale
- */
- //_colorPalette : null,
- /**
- * Effect, only "fromBase" supported
- */
- //_effect : null,
- /**
- * Accessor for checking to see if Y value is null
- */
- //_definedAccessor : null,
- /**
- * Transpose
- */
- _transpose : false,
- /**
- * Show gaps for missing data
- */
- _showMissingAsGap : false,
- /**
- * Initialize all properties to default values.
- */
- /** @expose */
- constructor : function() {
- this._data = null;
- this._interpolateMode = null;
- this._pointsAccessor = function(data) {
- return (data)["points"];
- };
- this._groupAccessor = null;
- this._independentAccessor = function(data) {
- return (data)[0];
- };
- this._independentScale = null;
- this._dependentAccessor = function(data) {
- return (data)[1];
- };
- var self = this;
- this._definedAccessor = function(data) {
- return (self._dependentAccessor(data) != null) && (self._independentAccessor(data) != null);
- };
- this._dependentScale = null;
- this._colorPalette = null;
- this._transpose = false;
- this._effect = null;
- this._showMissingAsGap = true;
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_LineComponent.COMPONENT_TYPE;
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- if (!this._data || !this._pointsAccessor || !this._independentAccessor || !this._independentScale || !this._dependentAccessor || !this._dependentScale) {
- g.selectAll("*").remove();
- return;
- }
- var self = this;
- var independent = function(data, index, groupIndex) {
- return self._independentScale.center(self._independentAccessor(data));
- };
- var dependent = function(data, index, groupIndex) {
- return self._dependentScale.center(self._dependentAccessor(data));
- };
- var definedAccessorY = function(data, index, groupIndex) {
- return (self._definedAccessor(data));
- };
- var line = rave.svg.line().x(this._transpose ? dependent : independent).y(this._transpose ? independent : dependent).showMissingAsGap(this._showMissingAsGap);
- var lineFunction = function(d, index, groupIndex) {
- return line.call(this, self._pointsAccessor(d), index, groupIndex);
- };
- line.defined(definedAccessorY);
- line.interpolate(this._interpolateMode);
- var lines = g.selectAll("path.element-shape").data(this._data, this._groupAccessor ? function(data, index, groupIndex) {
- return self._groupAccessor(data);
- } : null);
- lines.exit().remove();
- var enter = lines.enter();
- if (enter.size() > 0) {
- enter = enter.append("path").attr("class", "element-shape").style("stroke", this._colorPalette);
- if ("fromBase" == this._effect) {
- var dependentZero = function(data, index, groupIndex) {
- return self._dependentScale.center(0.0);
- };
- var zeroLine = rave.svg.line().x(this._transpose ? dependentZero : independent).y(this._transpose ? independent : dependentZero);
- zeroLine.defined(definedAccessorY);
- enter.attr("d", function(d, index, groupIndex) {
- return zeroLine.call(this, self._pointsAccessor(d), index, groupIndex);
- });
- } else {
- enter.attr("d", lineFunction);
- }
- }
- var linesUpdate = rave.transition(lines).style("stroke", this._colorPalette);
- this.updatePath(linesUpdate, lineFunction);
- this._effect = null;
- },
- /**
- * @param (java.lang.Object[]) data The new data
- */
- /** @expose */
- data : function(data) {
- this._data = data;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) pointsAccessor The new pointsAccessor
- */
- /** @expose */
- pointsAccessor : function(pointsAccessor) {
- this._pointsAccessor = pointsAccessor;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) groupAccessor The new groupAccessor
- */
- /** @expose */
- groupAccessor : function(groupAccessor) {
- this._groupAccessor = groupAccessor;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) independentAccessor The new independent accessor
- */
- /** @expose */
- independentAccessor : function(independentAccessor) {
- this._independentAccessor = independentAccessor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
- */
- /** @expose */
- independentScale : function(independentScale) {
- this._independentScale = independentScale;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) dependentAccessor The new dependent accessor
- */
- /** @expose */
- dependentAccessor : function(dependentAccessor) {
- this._dependentAccessor = dependentAccessor;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) definedAccessor The new defined accessor
- */
- /** @expose */
- definedAccessor : function(definedAccessor) {
- this._definedAccessor = definedAccessor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
- */
- /** @expose */
- dependentScale : function(dependentScale) {
- this._dependentScale = dependentScale;
- return this;
- },
- /**
- * @param (rave['library']['internal']['Palette']) colorPalette The new color palette
- */
- /** @expose */
- colorPalette : function(colorPalette) {
- this._colorPalette = colorPalette ? colorPalette : null;
- return this;
- },
- /**
- * @param (boolean) transpose The new transpose
- */
- /** @expose */
- transpose : function(transpose) {
- this._transpose = transpose;
- return this;
- },
- /**
- * @param (String) effect The new effect
- */
- /** @expose */
- effect : function(effect) {
- this._effect = effect;
- return this;
- },
- /**
- * Configure whether lines generated should show a gap (line break) if a value is missing
- * @param (boolean) state true (default) for a gap, false for a line across missing values
- */
- /** @expose */
- showMissingAsGap : function(state) {
- this._showMissingAsGap = state;
- return this;
- },
- /**
- * @param (String) mode sets the interpolation mode that makes the line of the area chart smooth or jagged.
- */
- /** @expose */
- interpolate : function(mode) {
- this._interpolateMode = mode;
- return this;
- }
- });
- // $source: com/ibm/rave/bundles/components/PointComponentImpl
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2017
- **
- ** The source code for this program is not published or otherwise divested of its trade secrets,
- ** irrespective of what has been deposited with the U.S. Copyright Office.
- ************************************************************************/
- // GENERATED
- //@import com/ibm/rave/bundles/components/KeyedBundleComponentImpl (loadtime) // superclass
- //@import com/ibm/rave/bundles/component/PointComponent (runtime) // PointComponent
- //@import com/ibm/rave/bundles/utilities/PathUtils (runtime) // fadeOutIn
- //@import com/ibm/rave/bundles/utilities/ColorUtil (runtime) // getContrastColor
- //@import com/ibm/rave/bundles/utilities/BundleLabelDropper (runtime) // new
- //@import com/ibm/rave/bundles/utilities/LabelStyleUtil (runtime) // new
- /**
- * <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>
- */
- var com_ibm_rave_bundles_components_PointComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
- /**
- * Data
- */
- //_data : null,
- /**
- * Accessor for independent variable
- */
- //_independentAccessor : null,
- /**
- * Independent variable scale
- */
- //_independentScale : null,
- /**
- * Accessor for dependent variable
- */
- //_dependentAccessor : null,
- /**
- * Dependent scale
- */
- //_dependentScale : null,
- /**
- * Color scale
- */
- //_colorPalette : null,
- /**
- * Accessor for size role
- */
- //_sizeAccessor : null,
- /**
- * Size scale
- */
- //_sizeScale : null,
- /**
- * Accessor for label role
- */
- //_labelAccessor : null,
- /**
- * Label formatter, may be null
- */
- //_labelFormatter : null,
- //_labelFontStyle : null,
- /**
- * Bounds
- */
- //_bounds : null,
- /**
- * Symbol
- */
- //_symbol : null,
- /**
- * Previous symbol: allows better transitions between symbols
- */
- //_prevSymbol : null,
- //_dropOverlap : null,
- /**
- * Effect
- */
- //_effect : null,
- //_borderWidth : null,
- //_borderColor : null,
- //_itemLabelPosition : null,
- //_labelStyleUtil : null,
- /**
- * Transpose
- */
- _transpose : false,
- /**
- * Default size
- */
- _defaultSize : 0,
- /**
- * Show label
- */
- _itemLabel : false,
- /**
- * Drop overlapping labels
- */
- _itemOverlap : false,
- _labelLayerClass : ".element-label-group",
- _elementLayerClass : ".element-group",
- _labelContrast : false,
- _labelShadow : false,
- constructor : function() {
- this._labelFontStyle = {};
- {
- this._data = null;
- this._independentAccessor = null;
- this._independentScale = null;
- this._dependentAccessor = null;
- this._dependentScale = null;
- this._colorPalette = null;
- this._sizeAccessor = null;
- this._sizeScale = null;
- this._labelAccessor = null;
- this._labelFormatter = null;
- this._bounds = null;
- this._transpose = false;
- this._defaultSize = 400.0;
- this._symbol = null;
- this._prevSymbol = null;
- this._itemLabel = true;
- this._itemOverlap = true;
- this._effect = null;
- this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
- this._borderWidth = null;
- this._borderColor = null;
- this._labelStyleUtil = new com_ibm_rave_bundles_utilities_LabelStyleUtil();
- if (!(rave.svg.symbolTypes.indexOf("donutPlus")> -1)) {
- rave.svg.symbolCreator("donutPlus", rave['library']['internal']['CommonPropertyConstants'].DONUT_PLUS);
- }
- if (!(rave.svg.symbolTypes.indexOf("donut-thin")> -1)) {
- rave.svg.symbolCreator("donut-thin", rave['library']['internal']['CommonPropertyConstants'].DONUT_THIN);
- }
- }
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_bundles_component_PointComponent.COMPONENT_TYPE;
- },
- /** @expose */
- execute : function(g) {
- this.preExecute();
- var elementGroupSelector = g.selectAll(this._elementLayerClass);
- var labelGroupSelector = g.selectAll(this._labelLayerClass);
- if (g.classed(this._elementLayerClass) || elementGroupSelector.size() == 0 || labelGroupSelector.size() == 0) {
- elementGroupSelector = g;
- labelGroupSelector = g;
- }
- if (!this._data || (!this._bounds && (!this._independentAccessor || !this._independentScale || !this._dependentAccessor || !this._dependentScale))) {
- elementGroupSelector.selectAll("*").remove();
- labelGroupSelector.selectAll("*").remove();
- return;
- }
- elementGroupSelector.selectAll("*").remove();
- labelGroupSelector.selectAll("*").remove();
- var self = this;
- var enterTransform = this.pointTransform(true);
- var finalTransform = this.pointTransform(false);
- var symbols = [];
- if (this._symbol == null) {
- elementGroupSelector.selectAll("*").remove();
- } else if (this._symbol == "donutPlus") {
- var s = new rave['internal']['Symbol']().type("circle");
- symbols.push(s);
- s = new rave['internal']['Symbol']().type("donut-thin");
- symbols.push(s);
- } else {
- var s = new rave['internal']['Symbol']().type(this._symbol);
- symbols.push(s);
- elementGroupSelector.selectAll("." + com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT).remove();
- }
- for (var i = 0; i < symbols.length; ++i) {
- var type = i == 0 ? "element-shape" : com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT;
- var shapes = elementGroupSelector.selectAll("." + type).data(this._data, this.getKey());
- shapes.exit().remove();
- var symbol = symbols[i];
- var fillStyle = this.symbolFill(type);
- 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");
- var s = rave.transition(shapes).attr("transform", finalTransform).style("fill", fillStyle);
- this.updateBorder(s, this._borderWidth, this._borderColor);
- symbol.size(this.finalSize(this._defaultSize, type));
- if (this._prevSymbol != null && !(this._prevSymbol == this._symbol)) {
- com_ibm_rave_bundles_utilities_PathUtils.fadeOutIn(s, symbol);
- } else {
- s.attr("d", symbol);
- }
- }
- if (this._itemLabel && this._labelAccessor) {
- var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
- if (elementLabelGroupSelector.size() == 0) {
- elementLabelGroupSelector = g;
- }
- var labels = elementLabelGroupSelector.selectAll("element-label").data(this._data, this.getKey());
- labels.exit().remove();
- var labelText = !this._labelFormatter ? function(data, index, groupIndex) {
- return self._labelAccessor(data);
- } : function(data, index, groupIndex) {
- var v = self._labelAccessor(data);
- return v == null ? null : self._labelFormatter.call(this, v, index, groupIndex);
- };
- var fontChecker = rave.capabilities.extension("fontchecker");
- 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);
- var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
- this._labelStyleUtil.labelFont(this._labelFontStyle).labelFillColor(this._labelContrast ? this.getLabelFill() : function(data, index, groupIndex) {
- return labelColor;
- }).labelShadow(this._labelShadow);
- labels.call(this._labelStyleUtil);
- if (fontChecker) {
- labels.call(fontChecker);
- }
- 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);
- this._dropOverlap.configureForDataLabels(this._bounds);
- labelTransition.call(this._dropOverlap, this._itemOverlap);
- } else {
- var elementLabelGroupSelector = g.selectAll(this._labelLayerClass);
- if (elementLabelGroupSelector.size() == 0) {
- elementLabelGroupSelector = g;
- }
- elementLabelGroupSelector.selectAll("text.element-label").remove();
- }
- },
- symbolFill : function(type) {
- var self = this;
- return function(d, index, groupIndex) {
- if (self._symbol == "donutPlus" && type == com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT) {
- return "white";
- }
- return !self._colorPalette ? null : self._colorPalette.call(null, d, 0, 0);
- };
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) Transform value function
- */
- pointTransform : function(enter) {
- var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
- var dependent = useDependentZero ? this.dependentZero() : this.dependent();
- var independent = this.independent();
- if (this._transpose) {
- return function(data, index, groupIndex) {
- return "translate(" + dependent.call(this, data, index, groupIndex) + "," + independent.call(this, data, index, groupIndex) + ")";
- };
- }
- return function(data, index, groupIndex) {
- return "translate(" + independent.call(this, data, index, groupIndex) + "," + dependent.call(this, data, index, groupIndex) + ")";
- };
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) X value function
- */
- positionX : function(enter) {
- var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
- var dependent = useDependentZero ? this.dependentZero() : this.dependent();
- var independent = this.independent();
- if (this._transpose) {
- return function(data, index, groupIndex) {
- return dependent.call(this, data, index, groupIndex);
- };
- }
- return function(data, index, groupIndex) {
- return independent.call(this, data, index, groupIndex);
- };
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) Y value function
- */
- positionY : function(enter) {
- var useDependentZero = enter && ("fromBase" == this._effect || "growfromBase" == this._effect);
- var dependent = useDependentZero ? this.dependentZero() : this.dependent();
- var independent = this.independent();
- if (this._transpose) {
- return function(data, index, groupIndex) {
- return independent.call(this, data, index, groupIndex);
- };
- }
- return function(data, index, groupIndex) {
- return dependent.call(this, data, index, groupIndex);
- };
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
- */
- independent : function() {
- if (this._independentAccessor && this._independentScale) {
- var self = this;
- return function(data, index, groupIndex) {
- return self._independentScale.center(self._independentAccessor(data));
- };
- }
- var midpoint = this._transpose ? this._bounds.y + this._bounds.height / 2.0 : this._bounds.x + this._bounds.width / 2.0;
- return function(data, index, groupIndex) {
- return midpoint;
- };
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
- */
- dependent : function() {
- if (this._dependentAccessor && this._dependentScale) {
- var self = this;
- return function(data, index, groupIndex) {
- return self._dependentScale.center(self._dependentAccessor(data));
- };
- }
- var midpoint = this._transpose ? this._bounds.x + this._bounds.width / 2.0 : this._bounds.y + this._bounds.height / 2.0;
- return function(data, index, groupIndex) {
- return midpoint;
- };
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) Value function for scaled independent coordinate
- */
- dependentZero : function() {
- if (!this._dependentScale || !(this._dependentScale.isLinear())) {
- return this.dependent();
- }
- var self = this;
- return function(data, index, groupIndex) {
- return self._dependentScale.center(0.0);
- };
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) Size value function
- */
- enterSize : function(size, type) {
- if ("grow" == this._effect || "growfromBase" == this._effect) {
- return function(data, index, groupIndex) {
- return 0.0;
- };
- }
- return this.finalSize(size, type);
- },
- /**
- * 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.
- * @return (rave['internal']['ValueFunction']) Size value function
- */
- finalSize : function(size, type) {
- var self = this;
- var ratio = self._symbol == "donutPlus" && type == com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT ? 0.6 : 1;
- if (this._sizeAccessor && this._sizeScale) {
- return function(d, index, groupIndex) {
- var v = self._sizeAccessor(d);
- return v != null ? + (self._sizeScale.call(null, v, 0, 0)) * ratio : size * ratio;
- };
- }
- return function(d, index, groupIndex) {
- return size * ratio;
- };
- },
- getAnchor : function() {
- var self = this;
- return function(data, index, groupIndex) {
- if (!self._itemLabelPosition) {
- return "middle";
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (0 == labelPosition || 2 == labelPosition || 1 == labelPosition) {
- return "middle";
- } else if (3 == labelPosition) {
- return "end";
- } else if (4 == labelPosition || 5 == labelPosition) {
- return "start";
- }
- return "middle";
- };
- },
- getLabelFill : function() {
- var self = this;
- var labelColor = this.getDefaultLabelColor(this._labelFontStyle);
- return function(data, index, groupIndex) {
- if (!self._colorPalette || !self._itemLabelPosition) {
- return labelColor;
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (1 == labelPosition) {
- var elementColor = self._colorPalette.call(this, data, index, groupIndex);
- if (elementColor != null) {
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(elementColor, labelColor).toString();
- }
- }
- return labelColor;
- };
- },
- getXOffset : function() {
- var self = this;
- return function(data, index, groupIndex) {
- var padding = 5;
- if ((!self._itemLabelPosition)) {
- return "0em";
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (3 == labelPosition) {
- return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
- }
- if (4 == labelPosition) {
- return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
- }
- if (5 == labelPosition) {
- return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2) + "px";
- }
- return "0em";
- };
- },
- getYOffset : function() {
- var self = this;
- return function(data, index, groupIndex) {
- var padding = 5;
- if ((!self._itemLabelPosition)) {
- return "0.3em";
- }
- var labelPosition = self._itemLabelPosition.call(this, data, index, groupIndex);
- if (0 == labelPosition) {
- return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + padding) + "px";
- }
- if (2 == labelPosition) {
- var fontHeight = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber("1em", 100.0, 10.0);
- return "" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2 + fontHeight + padding) + "px";
- }
- if (5 == labelPosition) {
- return "-" + (Math.sqrt(self.finalSize(self._defaultSize, self._symbol).call(this, data, index, groupIndex)) / 2) + "px";
- }
- return "0.3em";
- };
- },
- /**
- * @param (java.lang.Object[]) data The new data
- */
- /** @expose */
- data : function(data) {
- this._data = data;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) independentAccessor The new independent accessor
- */
- /** @expose */
- independentAccessor : function(independentAccessor) {
- this._independentAccessor = independentAccessor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) independentScale The new independent scale
- */
- /** @expose */
- independentScale : function(independentScale) {
- this._independentScale = independentScale;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) dependentAccessor The new dependent accessor
- */
- /** @expose */
- dependentAccessor : function(dependentAccessor) {
- this._dependentAccessor = dependentAccessor;
- return this;
- },
- /**
- * @param (rave['library']['internal']['CoordinateScaleImpl']) dependentScale The new dependent scale
- */
- /** @expose */
- dependentScale : function(dependentScale) {
- this._dependentScale = dependentScale;
- return this;
- },
- /**
- * @param (rave['library']['internal']['Palette']) colorPalette The new colorPalette
- */
- /** @expose */
- colorPalette : function(colorPalette) {
- this._colorPalette = colorPalette;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) sizeAccessor The new sizeAccessor
- */
- /** @expose */
- sizeAccessor : function(sizeAccessor) {
- this._sizeAccessor = sizeAccessor;
- return this;
- },
- /**
- * @param (rave['internal']['AbstractScale']) sizeScale The new sizeScale
- */
- /** @expose */
- sizeScale : function(sizeScale) {
- this._sizeScale = sizeScale;
- return this;
- },
- /**
- * @param (rave['internal']['SingleValueFunction']) labelAccessor The new labelAccessor
- */
- /** @expose */
- labelAccessor : function(labelAccessor) {
- this._labelAccessor = labelAccessor;
- return this;
- },
- /**
- * @param (rave['internal']['ValueFunction']) labelFormatter The new labelFormatter
- */
- /** @expose */
- labelFormatter : function(labelFormatter) {
- this._labelFormatter = labelFormatter;
- return this;
- },
- /**
- * @param (rave['internal']['ValueFunction']) labelPosition Function to be used to determine label position
- */
- /** @expose */
- itemLabelPosition : function(labelPosition) {
- this._itemLabelPosition = labelPosition;
- return this;
- },
- /**
- * @param (rave['internal']['RectStruct']) bounds The new bounds
- */
- /** @expose */
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- /**
- * @param (boolean) transpose The new transpose
- */
- /** @expose */
- transpose : function(transpose) {
- this._transpose = transpose;
- return this;
- },
- /**
- * @param (double) defaultSize The new defaultSize
- */
- /** @expose */
- defaultSize : function(defaultSize) {
- this._defaultSize = defaultSize;
- return this;
- },
- /** @expose */
- itemLabel : function(itemLabel) {
- this._itemLabel = itemLabel;
- return this;
- },
- /** @expose */
- labelFont : function(labelFont) {
- this._labelFontStyle = labelFont;
- return this;
- },
- /**
- * @param (boolean) itemOverlap The new itemOverlap
- */
- /** @expose */
- itemOverlap : function(itemOverlap) {
- this._itemOverlap = itemOverlap;
- return this;
- },
- /**
- * @param (String) symbol The new symbol
- */
- /** @expose */
- symbol : function(symbol) {
- this._prevSymbol = this._symbol;
- this._symbol = symbol;
- return this;
- },
- /**
- * @param (String) effect The new effect
- */
- /** @expose */
- effect : function(effect) {
- this._effect = effect;
- return this;
- },
- /** @expose */
- borderWidth : function(borderWidth) {
- this._borderWidth = borderWidth;
- return this;
- },
- /** @expose */
- borderColor : function(borderColor) {
- this._borderColor = borderColor;
- return this;
- },
- /**
- * @param (String) className - the class name for labelslayer. If not set, the default is ".element-label-group" return this
- */
- /** @expose */
- labelLayerClassName : function(className) {
- this._labelLayerClass = className;
- return this;
- },
- /**
- * @param (String) className - the class name for elementslayer. If not set, the default is ".element-group" return this
- */
- /** @expose */
- elementLayerClassName : function(className) {
- this._elementLayerClass = className;
- return this;
- },
- /**
- * @param (boolean) labelContrast {boolean} whether to contrast the label color with background/background element color.
- * @return (com.ibm.rave.bundles.components.PointComponentImpl) this
- */
- /** @expose */
- labelContrast : function(labelContrast) {
- this._labelContrast = labelContrast;
- return this;
- },
- /**
- * @param (boolean) labelShadow {boolean} whether to show a label shadow with a contrast label color.
- * @return (com.ibm.rave.bundles.components.PointComponentImpl) this
- */
- /** @expose */
- labelShadow : function(labelShadow) {
- this._labelShadow = labelShadow;
- return this;
- }
- });
- /** @expose */
- com_ibm_rave_bundles_components_PointComponentImpl.SECONDARY_ELEMENT = "element-shape-secondary";
- /** @expose */
- com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_TOP = 0;
- /** @expose */
- com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_CENTER = 1;
- /** @expose */
- com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_BOTTOM = 2;
- /** @expose */
- com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_LEFT = 3;
- /** @expose */
- com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_RIGHT = 4;
- /** @expose */
- com_ibm_rave_bundles_components_PointComponentImpl.LABEL_POSITION_TOP_RIGHT = 5;
- })();
- },{"./configuration/configuration.json":1,"./i18n/messages_en.json":2,"./vizlibrary-composite.css":4,"./vizlibrary.css":5}],4:[function(require,module,exports){
- 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;
- },{"browserify-css":6}],5:[function(require,module,exports){
- var css = ".vizlibrary {\n font-family: Arial, Tahoma, 'Arial Unicode MS', 'Andale WT', 'MS UI Gothic', Gulim, SimSun, PMingLiU, Raghu8, sans-serif;\n font-style: normal;\n}\n/*\n * Chart background rectangle, transparent\n */\n.vizlibrary rect.background.elements {\n fill-opacity: 0.0;\n}\n/*\n * Axes.\n */\n.vizlibrary .axis .tick text {\n font-weight: 300;\n font-size: 14px;\n fill: #3c4646;\n}\n.vizlibrary .axis .tick line {\n fill: none;\n stroke: #eee;\n}\n.vizlibrary .axis path {\n fill: none;\n stroke: #eee;\n}\n/*Axis title\n*/\n.vizlibrary .axis .axislabel {\n font-weight: 500;\n font-size: 14px;\n fill: #323c3c;\n}\n/*\n * Axis callout.\n */\n.vizlibrary .axis-callout {\n pointer-events: none;\n /* Prevent the callout lines from intercepting mouseover events on the element shapes */\n}\n.vizlibrary .callout line {\n stroke: #3c4646;\n stroke-dasharray: 5,5;\n}\n.vizlibrary .callout .label path {\n fill: #3c4646;\n stroke-width: 0px;\n}\n.vizlibrary .callout .label text {\n font-weight: 300;\n font-size: 14px;\n fill: white;\n}\n/*Grid lines*/\n.vizlibrary g.grid g.tick {\n stroke: #dfe9e9;\n stroke-width: 1px;\n}\n/*Legend title*/\n.vizlibrary .legendTitle {\n font-weight: 500;\n font-size: 18px;\n fill: #323c3c;\n}\n/*Legend label*/\n.vizlibrary .legendLabel {\n font-weight: 300;\n font-size: 14px;\n fill: #3c4646;\n}\n.vizlibrary .legendBBox {\n pointer-events: none;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-composite/node/rave-library-composite/vizlibrary.css"})); module.exports = css;
- },{"browserify-css":6}],6:[function(require,module,exports){
- 'use strict';
- // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.
- module.exports = {
- // Create a <link> tag with optional data attributes
- createLink: function(href, attributes) {
- var head = document.head || document.getElementsByTagName('head')[0];
- var link = document.createElement('link');
- link.href = href;
- link.rel = 'stylesheet';
- for (var key in attributes) {
- if ( ! attributes.hasOwnProperty(key)) {
- continue;
- }
- var value = attributes[key];
- link.setAttribute('data-' + key, value);
- }
- head.appendChild(link);
- },
- // Create a <style> tag with optional data attributes
- createStyle: function(cssText, attributes) {
- var head = document.head || document.getElementsByTagName('head')[0],
- style = document.createElement('style');
- style.type = 'text/css';
- for (var key in attributes) {
- if ( ! attributes.hasOwnProperty(key)) {
- continue;
- }
- var value = attributes[key];
- style.setAttribute('data-' + key, value);
- }
-
- if (style.sheet) { // for jsdom and IE9+
- style.innerHTML = cssText;
- style.sheet.cssText = cssText;
- head.appendChild(style);
- } else if (style.styleSheet) { // for IE8 and below
- head.appendChild(style);
- style.styleSheet.cssText = cssText;
- } else { // for Chrome, Firefox, and Safari
- style.appendChild(document.createTextNode(cssText));
- head.appendChild(style);
- }
- }
- };
- },{}]},{},[3]);
- return rave.library.bundle.extension('compositeBundle');
- }));
|