12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524 |
- ;(function(root, factory) {
- if (typeof define === 'function' && define.amd) {
- define(['rave'], factory);
- } else if (typeof exports === 'object') {
- module.exports = factory(require('rave'));
- } else {
- root.raveLibrary = factory(root.rave);
- }
- }(this, function(rave) {
- (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={
- "paletteConfiguration": {
- "palettes" : [
- {
- "id": "rave2.colorpalette.default",
- "label": "defaultPalette.label",
- "description": "defaultPalette.description",
- "icon": "",
- "fillType": "simple",
- "fills":[
- "#5aaafa",
- "#4178be",
- "#af6ee8",
- "#a6266e",
- "#d74108",
- "#ff7832",
- "#fdd600",
- "#00b4a0",
- "#008571",
- "#264a60",
- "#7cc7ff",
- "#7c1c58",
- "#ff3ca0",
- "#ff71d4",
- "#e71d32",
- "#a53725",
- "#efc100",
- "#be9b00",
- "#8cd211",
- "#4b8400"
- ]
- },
- {
- "id": "rave2.colorpalette.dark",
- "label": "rave2.colorpalette.dark.label",
- "description": "rave2.colorpalette.dark.description",
- "icon": "",
- "fillType": "simple",
- "fills":[
- "#166888",
- "#045272",
- "#524d71",
- "#64144f",
- "#8f3022",
- "#8f5515",
- "#978126",
- "#00625e",
- "#004844",
- "#012e47",
- "#507b91",
- "#4b184a",
- "#8c2658",
- "#915268",
- "#7c131a",
- "#6d2b17",
- "#956c0e",
- "#616020",
- "#537627",
- "#005232"
- ]
- },
- {
- "id": "rave2.colorpalette.light",
- "label": "rave2.colorpalette.light.label",
- "description": "rave2.colorpalette.light.description",
- "icon": "",
- "fillType": "simple",
- "fills":[
- "#a7def4",
- "#9bd0e5",
- "#d0cce4",
- "#dca6cd",
- "#f9b9b0",
- "#f8d2a7",
- "#feefb2",
- "#99dad8",
- "#99c9c7",
- "#99b7c9",
- "#b9d3e0",
- "#cba9cb",
- "#f6b3d3",
- "#facfde",
- "#eba6ab",
- "#e1b6a8",
- "#fce1a2",
- "#d9d9af",
- "#d0e7b3",
- "#99d0ba"
- ]
- },
- {
- "id": "rave2.colorpalette.medical",
- "label": "rave2.colorpalette.medical.label",
- "description": "rave2.colorpalette.medical.description",
- "icon": "",
- "fillType": "simple",
- "fills":[
- "#1ec0d7",
- "#0992da",
- "#aeb6b6",
- "#1dcdd8",
- "#72b8f1",
- "#e4ae80",
- "#eccab7",
- "#6b9bb3",
- "#99d0dc",
- "#c5baae",
- "#1eadc8",
- "#de9f5b",
- "#ebac92",
- "#e09085",
- "#a8662d",
- "#0193b8",
- "#417380",
- "#8fcbfd",
- "#148fd3",
- "#00b4a0"
- ]
- },
- {
- "id": "rave2.colorpalette.financial",
- "label": "rave2.colorpalette.financial.label",
- "description": "rave2.colorpalette.financial.description",
- "icon": "",
- "fillType": "simple",
- "fills":[
- "#4d7aad",
- "#86a9d9",
- "#ce202c",
- "#264a60",
- "#5596e6",
- "#959595",
- "#464646",
- "#4178be",
- "#6d120f",
- "#aeaeae",
- "#645a5a",
- "#dec0b2",
- "#4178be",
- "#a53725",
- "#c7c7c7",
- "#8c7300",
- "#734098",
- "#264a60",
- "#739433",
- "#1896bc"
- ]
- },
- {
- "id": "rave2.colorpalette.redDiscreteSequential",
- "label" : "rave2.colorpalette.redDiscreteSequential.label",
- "description" : "rave2.colorpalette.redDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#8c101c",
- "at" : 0.0
- },
- {
- "fill" : "#ad1625",
- "at" : 0.143
- },
- {
- "fill" : "#e71d32",
- "at" : 0.286
- },
- {
- "fill" : "#ff5050",
- "at" : 0.429
- },
- {
- "fill" : "#ff7d87",
- "at" : 0.572
- },
- {
- "fill" : "#ffa5b4",
- "at" : 0.715
- },
- {
- "fill" : "#ffd2dd",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.orangeDiscreteSequential",
- "label" : "rave2.colorpalette.orangeDiscreteSequential.label",
- "description" : "rave2.colorpalette.orangeDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#872a0f",
- "at" : 0.0
- },
- {
- "fill" : "#a53725",
- "at" : 0.143
- },
- {
- "fill" : "#d74108",
- "at" : 0.286
- },
- {
- "fill" : "#ff5003",
- "at" : 0.429
- },
- {
- "fill" : "#ff7832",
- "at" : 0.572
- },
- {
- "fill" : "#ffa573",
- "at" : 0.715
- },
- {
- "fill" : "#ffd4a0",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.yellowDiscreteSequential",
- "label" : "rave2.colorpalette.yellowDiscreteSequential.label",
- "description" : "rave2.colorpalette.yellowDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#574a00",
- "at" : 0.0
- },
- {
- "fill" : "#735f00",
- "at" : 0.143
- },
- {
- "fill" : "#8c7300",
- "at" : 0.286
- },
- {
- "fill" : "#be9b00",
- "at" : 0.429
- },
- {
- "fill" : "#efc100",
- "at" : 0.572
- },
- {
- "fill" : "#fdd600",
- "at" : 0.715
- },
- {
- "fill" : "#fde876",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.greenDiscreteSequential",
- "label" : "rave2.colorpalette.greenDiscreteSequential.label",
- "description" : "rave2.colorpalette.greenDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#144d14",
- "at" : 0.0
- },
- {
- "fill" : "#2d660a",
- "at" : 0.143
- },
- {
- "fill" : "#4b8400",
- "at" : 0.286
- },
- {
- "fill" : "#5aa700",
- "at" : 0.429
- },
- {
- "fill" : "#8cd211",
- "at" : 0.572
- },
- {
- "fill" : "#b4e051",
- "at" : 0.715
- },
- {
- "fill" : "#c8f08f",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.tealDiscreteSequential",
- "label" : "rave2.colorpalette.tealDiscreteSequential.label",
- "description" : "rave2.colorpalette.tealDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#005448",
- "at" : 0.0
- },
- {
- "fill" : "#006d5d",
- "at" : 0.143
- },
- {
- "fill" : "#008571",
- "at" : 0.286
- },
- {
- "fill" : "#00b4a0",
- "at" : 0.429
- },
- {
- "fill" : "#41d6c3",
- "at" : 0.572
- },
- {
- "fill" : "#6eedd8",
- "at" : 0.715
- },
- {
- "fill" : "#a7fae6",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.blueDiscreteSequential",
- "label" : "rave2.colorpalette.blueDiscreteSequential.label",
- "description" : "rave2.colorpalette.blueDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#264a60",
- "at" : 0.0
- },
- {
- "fill" : "#325c80",
- "at" : 0.143
- },
- {
- "fill" : "#4178be",
- "at" : 0.286
- },
- {
- "fill" : "#5596e6",
- "at" : 0.429
- },
- {
- "fill" : "#5aaafa",
- "at" : 0.572
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.715
- },
- {
- "fill" : "#c0e6ff",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.purpleDiscreteSequential",
- "label" : "rave2.colorpalette.purpleDiscreteSequential.label",
- "description" : "rave2.colorpalette.purpleDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#562f72",
- "at" : 0.0
- },
- {
- "fill" : "#734098",
- "at" : 0.143
- },
- {
- "fill" : "#9855d4",
- "at" : 0.286
- },
- {
- "fill" : "#af6ee8",
- "at" : 0.429
- },
- {
- "fill" : "#ba8ff7",
- "at" : 0.572
- },
- {
- "fill" : "#d7aaff",
- "at" : 0.715
- },
- {
- "fill" : "#eed2ff",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.violetDiscreteSequential",
- "label" : "rave2.colorpalette.violetDiscreteSequential.label",
- "description" : "rave2.colorpalette.violetDiscreteSequential.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#7c1c58",
- "at" : 0.0
- },
- {
- "fill" : "#a6266e",
- "at" : 0.143
- },
- {
- "fill" : "#db2780",
- "at" : 0.286
- },
- {
- "fill" : "#ff3ca0",
- "at" : 0.429
- },
- {
- "fill" : "#ff71d4",
- "at" : 0.572
- },
- {
- "fill" : "#ff9eee",
- "at" : 0.715
- },
- {
- "fill" : "#ffd2ff",
- "at" : 0.858
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redContinousSequential",
- "label" : "rave2.colorpalette.redContinuousSequential.label",
- "description" : "rave2.colorpalette.redContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#8c101c",
- "at" : 0.0
- },
- {
- "fill" : "#ad1625",
- "at" : 0.167
- },
- {
- "fill" : "#e71d32",
- "at" : 0.334
- },
- {
- "fill" : "#ff5050",
- "at" : 0.501
- },
- {
- "fill" : "#ff7d87",
- "at" : 0.668
- },
- {
- "fill" : "#ffa5b4",
- "at" : 0.835
- },
- {
- "fill" : "#ffd2dd",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.orangeContinuousSequential",
- "label" : "rave2.colorpalette.orangeContinuousSequential.label",
- "description" : "rave2.colorpalette.orangeContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#872a0f",
- "at" : 0.0
- },
- {
- "fill" : "#a53725",
- "at" : 0.167
- },
- {
- "fill" : "#d74108",
- "at" : 0.334
- },
- {
- "fill" : "#ff5003",
- "at" : 0.501
- },
- {
- "fill" : "#ff7832",
- "at" : 0.668
- },
- {
- "fill" : "#ffa573",
- "at" : 0.835
- },
- {
- "fill" : "#ffd4a0",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.yellowContinuousSequential",
- "label" : "rave2.colorpalette.yellowContinuousSequential.label",
- "description" : "rave2.colorpalette.yellowContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#574a00",
- "at" : 0.0
- },
- {
- "fill" : "#735f00",
- "at" : 0.167
- },
- {
- "fill" : "#8c7300",
- "at" : 0.334
- },
- {
- "fill" : "#be9b00",
- "at" : 0.501
- },
- {
- "fill" : "#efc100",
- "at" : 0.668
- },
- {
- "fill" : "#fdd600",
- "at" : 0.835
- },
- {
- "fill" : "#fde876",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.greenContinuousSequential",
- "label" : "rave2.colorpalette.greenContinuousSequential.label",
- "description" : "rave2.colorpalette.greenContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#144d14",
- "at" : 0.0
- },
- {
- "fill" : "#2d660a",
- "at" : 0.167
- },
- {
- "fill" : "#4b8400",
- "at" : 0.334
- },
- {
- "fill" : "#5aa700",
- "at" : 0.501
- },
- {
- "fill" : "#8cd211",
- "at" : 0.668
- },
- {
- "fill" : "#b4e051",
- "at" : 0.835
- },
- {
- "fill" : "#c8f08f",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.tealContinuousSequential",
- "label" : "rave2.colorpalette.tealContinuousSequential.label",
- "description" : "rave2.colorpalette.tealContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#005448",
- "at" : 0.0
- },
- {
- "fill" : "#006d5d",
- "at" : 0.167
- },
- {
- "fill" : "#008571",
- "at" : 0.334
- },
- {
- "fill" : "#00b4a0",
- "at" : 0.501
- },
- {
- "fill" : "#41d6c3",
- "at" : 0.668
- },
- {
- "fill" : "#6eedd8",
- "at" : 0.835
- },
- {
- "fill" : "#a7fae6",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.blueContinuousSequential",
- "label" : "rave2.colorpalette.blueContinuousSequential.label",
- "description" : "rave2.colorpalette.blueContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#264a60",
- "at" : 0.0
- },
- {
- "fill" : "#325c80",
- "at" : 0.167
- },
- {
- "fill" : "#4178be",
- "at" : 0.334
- },
- {
- "fill" : "#5596e6",
- "at" : 0.501
- },
- {
- "fill" : "#5aaafa",
- "at" : 0.668
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.835
- },
- {
- "fill" : "#c0e6ff",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.purpleContinousSequential",
- "label" : "rave2.colorpalette.purpleContinuousSequential.label",
- "description" : "rave2.colorpalette.purpleContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#562f72",
- "at" : 0.0
- },
- {
- "fill" : "#734098",
- "at" : 0.167
- },
- {
- "fill" : "#9855d4",
- "at" : 0.334
- },
- {
- "fill" : "#af6ee8",
- "at" : 0.501
- },
- {
- "fill" : "#ba8ff7",
- "at" : 0.668
- },
- {
- "fill" : "#d7aaff",
- "at" : 0.835
- },
- {
- "fill" : "#eed2ff",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.violetContinuousSequential",
- "label" : "rave2.colorpalette.violetContinuousSequential.label",
- "description" : "rave2.colorpalette.violetContinuousSequential.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#7c1c58",
- "at" : 0.0
- },
- {
- "fill" : "#a6266e",
- "at" : 0.167
- },
- {
- "fill" : "#db2780",
- "at" : 0.334
- },
- {
- "fill" : "#ff3ca0",
- "at" : 0.501
- },
- {
- "fill" : "#ff71d4",
- "at" : 0.668
- },
- {
- "fill" : "#ff9eee",
- "at" : 0.835
- },
- {
- "fill" : "#ffd2ff",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redGreenDiscreteDivergent",
- "label" : "rave2.colorpalette.redGreenDiscreteDivergent.label",
- "description" : "rave2.colorpalette.redGreenDiscreteDivergent.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ce202c",
- "at" : 0.0
- },
- {
- "fill" : "#ff5050",
- "at" : 0.11
- },
- {
- "fill" : "#f79d9d",
- "at" : 0.22
- },
- {
- "fill" : "#e8bfc9",
- "at" : 0.33
- },
- {
- "fill" : "#e9e0e0",
- "at" : 0.44
- },
- {
- "fill" : "#bbe085",
- "at" : 0.55
- },
- {
- "fill" : "#8cd211",
- "at" : 0.66
- },
- {
- "fill" : "#5aa700",
- "at" : 0.77
- },
- {
- "fill" : "#4b8400",
- "at" : 0.88
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redBlueDiscreteDivergent",
- "label" : "rave2.colorpalette.redBlueDiscreteDivergent.label",
- "description" : "rave2.colorpalette.redBlueDiscreteDivergent.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ce202c",
- "at" : 0.0
- },
- {
- "fill" : "#ff5050",
- "at" : 0.11
- },
- {
- "fill" : "#f79d9d",
- "at" : 0.22
- },
- {
- "fill" : "#e8bfc9",
- "at" : 0.33
- },
- {
- "fill" : "#e9e0e0",
- "at" : 0.44
- },
- {
- "fill" : "#b4d8f0",
- "at" : 0.55
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.66
- },
- {
- "fill" : "#5596e6",
- "at" : 0.77
- },
- {
- "fill" : "#4178be",
- "at" : 0.88
- }
- ]
- },
- {
- "id": "rave2.colorpalette.blueGreenDiscreteDivergent",
- "label" : "rave2.colorpalette.blueGreenDiscreteDivergent.label",
- "description" : "rave2.colorpalette.blueGreenDiscreteDivergent.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#4178be",
- "at" : 0.0
- },
- {
- "fill" : "#5596e6",
- "at" : 0.11
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.22
- },
- {
- "fill" : "#b4d8f0",
- "at" : 0.33
- },
- {
- "fill" : "#dfe9e9",
- "at" : 0.44
- },
- {
- "fill" : "#bbe085",
- "at" : 0.55
- },
- {
- "fill" : "#8cd211",
- "at" : 0.66
- },
- {
- "fill" : "#5aa700",
- "at" : 0.77
- },
- {
- "fill" : "#4b8400",
- "at" : 0.88
- }
- ]
- },
- {
- "id": "rave2.colorpalette.tealPurpleDiscreteDivergent",
- "label" : "rave2.colorpalette.tealPurpleDiscreteDivergent.label",
- "description" : "rave2.colorpalette.tealPurpleDiscreteDivergent.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#008571",
- "at" : 0.0
- },
- {
- "fill" : "#00b4a0",
- "at" : 0.11
- },
- {
- "fill" : "#41d6c3",
- "at" : 0.22
- },
- {
- "fill" : "#65dbc7",
- "at" : 0.33
- },
- {
- "fill" : "#dfe9e9",
- "at" : 0.44
- },
- {
- "fill" : "#d7aaff",
- "at" : 0.55
- },
- {
- "fill" : "#ba8ff7",
- "at" : 0.66
- },
- {
- "fill" : "#af6ee8",
- "at" : 0.77
- },
- {
- "fill" : "#9855d4",
- "at" : 0.88
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redGreenInverseDiscreteDivergent",
- "label" : "rave2.colorpalette.redGreenInverseDiscreteDivergent.label",
- "description" : "rave2.colorpalette.redGreenInverseDiscreteDivergent.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ffd2dd",
- "at" : 0.0
- },
- {
- "fill" : "#ffa5b4",
- "at" : 0.11
- },
- {
- "fill" : "#ff5050",
- "at" : 0.22
- },
- {
- "fill" : "#ce202c",
- "at" : 0.33
- },
- {
- "fill" : "#a53725",
- "at" : 0.44
- },
- {
- "fill" : "#4b8400",
- "at" : 0.55
- },
- {
- "fill" : "#5aa700",
- "at" : 0.66
- },
- {
- "fill" : "#8cd211",
- "at" : 0.77
- },
- {
- "fill" : "#bbe085",
- "at" : 0.88
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redBlueInverseDiscreteDivergent",
- "label" : "rave2.colorpalette.redBlueInverseDiscreteDivergent.label",
- "description" : "rave2.colorpalette.redBlueInverseDiscreteDivergent.description",
- "icon" : "",
- "fillType": "discrete",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ffd2dd",
- "at" : 0.0
- },
- {
- "fill" : "#ffa5b4",
- "at" : 0.11
- },
- {
- "fill" : "#ff5050",
- "at" : 0.22
- },
- {
- "fill" : "#e71d32",
- "at" : 0.33
- },
- {
- "fill" : "#734098",
- "at" : 0.44
- },
- {
- "fill" : "#4178be",
- "at" : 0.55
- },
- {
- "fill" : "#5596e6",
- "at" : 0.66
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.77
- },
- {
- "fill" : "#c0e6ff",
- "at" : 0.88
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redGreenContinuousDivergent",
- "label" : "rave2.colorpalette.redGreenContinuousDivergent.label",
- "description" : "rave2.colorpalette.redGreenContinuousDivergent.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ce202c",
- "at" : 0.0
- },
- {
- "fill" : "#ff5050",
- "at" : 0.125
- },
- {
- "fill" : "#f79d9d",
- "at" : 0.25
- },
- {
- "fill" : "#e8bfc9",
- "at" : 0.375
- },
- {
- "fill" : "#e9e0e0",
- "at" : 0.5
- },
- {
- "fill" : "#bbe085",
- "at" : 0.625
- },
- {
- "fill" : "#8cd211",
- "at" : 0.75
- },
- {
- "fill" : "#5aa700",
- "at" : 0.875
- },
- {
- "fill" : "#4b8400",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redBlueContinuousDivergent",
- "label" : "rave2.colorpalette.redBlueContinuousDivergent.label",
- "description" : "rave2.colorpalette.redBlueContinuousDivergent.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ce202c",
- "at" : 0.0
- },
- {
- "fill" : "#ff5050",
- "at" : 0.125
- },
- {
- "fill" : "#f79d9d",
- "at" : 0.25
- },
- {
- "fill" : "#e8bfc9",
- "at" : 0.375
- },
- {
- "fill" : "#e9e0e0",
- "at" : 0.5
- },
- {
- "fill" : "#b4d8f0",
- "at" : 0.625
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.75
- },
- {
- "fill" : "#5596e6",
- "at" : 0.875
- },
- {
- "fill" : "#4178be",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.blueGreenContinuousDivergent",
- "label" : "rave2.colorpalette.blueGreenContinuousDivergent.label",
- "description" : "rave2.colorpalette.blueGreenContinuousDivergent.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#4178be",
- "at" : 0.0
- },
- {
- "fill" : "#5596e6",
- "at" : 0.125
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.25
- },
- {
- "fill" : "#b4d8f0",
- "at" : 0.375
- },
- {
- "fill" : "#dfe9e9",
- "at" : 0.5
- },
- {
- "fill" : "#bbe085",
- "at" : 0.625
- },
- {
- "fill" : "#8cd211",
- "at" : 0.75
- },
- {
- "fill" : "#5aa700",
- "at" : 0.875
- },
- {
- "fill" : "#4b8400",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.tealPurpleContinuousDivergent",
- "label" : "rave2.colorpalette.tealPurpleContinuousDivergent.label",
- "description" : "rave2.colorpalette.tealPurpleContinuousDivergent.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#008571",
- "at" : 0.0
- },
- {
- "fill" : "#00b4a0",
- "at" : 0.125
- },
- {
- "fill" : "#41d6c3",
- "at" : 0.25
- },
- {
- "fill" : "#65dbc7",
- "at" : 0.375
- },
- {
- "fill" : "#dfe9e9",
- "at" : 0.5
- },
- {
- "fill" : "#d7aaff",
- "at" : 0.625
- },
- {
- "fill" : "#ba8ff7",
- "at" : 0.75
- },
- {
- "fill" : "#af6ee8",
- "at" : 0.875
- },
- {
- "fill" : "#9855d4",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redGreenInverseContinuousDivergent",
- "label" : "rave2.colorpalette.redGreenInverseContinuousDivergent.label",
- "description" : "rave2.colorpalette.redGreenInverseContinuousDivergent.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ffd2dd",
- "at" : 0.0
- },
- {
- "fill" : "#ffa5b4",
- "at" : 0.125
- },
- {
- "fill" : "#ff5050",
- "at" : 0.25
- },
- {
- "fill" : "#ce202c",
- "at" : 0.375
- },
- {
- "fill" : "#a53725",
- "at" : 0.5
- },
- {
- "fill" : "#4b8400",
- "at" : 0.625
- },
- {
- "fill" : "#5aa700",
- "at" : 0.75
- },
- {
- "fill" : "#8cd211",
- "at" : 0.875
- },
- {
- "fill" : "#bbe085",
- "at" : 1.0
- }
- ]
- },
- {
- "id": "rave2.colorpalette.redBlueInverseContinuousDivergent",
- "label" : "rave2.colorpalette.redBlueInverseContinuousDivergent.label",
- "description" : "rave2.colorpalette.redBlueInverseContinuousDivergent.description",
- "icon" : "",
- "fillType": "continuous",
- "valueType": "normalized",
- "fills": [
- {
- "fill" : "#ffd2dd",
- "at" : 0.0
- },
- {
- "fill" : "#ffa5b4",
- "at" : 0.125
- },
- {
- "fill" : "#ff5050",
- "at" : 0.25
- },
- {
- "fill" : "#e71d32",
- "at" : 0.375
- },
- {
- "fill" : "#734098",
- "at" : 0.5
- },
- {
- "fill" : "#4178be",
- "at" : 0.625
- },
- {
- "fill" : "#5596e6",
- "at" : 0.75
- },
- {
- "fill" : "#7cc7ff",
- "at" : 0.875
- },
- {
- "fill" : "#c0e6ff",
- "at" : 1.0
- }
- ]
- }
- ],
- "defaultPaletteID" : "rave2.colorpalette.default"
- }
- }
- },{}],2:[function(require,module,exports){
- (function() {
- var $ = {};
- // $source: com/ibm/rave/library/internal/nativeImpl/ModuleHeader
- /************************************************************************
- ** 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_core_RegistryService = rave["internal"]["RegistryService"];
- rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
- var rave_library_externs={};
- rave["internal"]["CSSUtil"] = rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
- // $source: com/ibm/rave/library/service/ErrorDispatcher
- /************************************************************************
- ** 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/service/LibraryError (runtime) // create
- var com_ibm_rave_library_service_ErrorDispatcher = rave['internal']['Declare']({
- getReporter : function() {
- return rave['internal']['RaveContextManager'].INSTANCE.getRaveContext().getData("ERROR_REPORTER_KEY");
- },
- /** @expose */
- setReporter : function(reporter) {
- rave['internal']['RaveContextManager'].INSTANCE.getRaveContext().putData("ERROR_REPORTER_KEY", reporter);
- },
- /**
- * Dispatch error
- * @param (com.ibm.rave.library.service.LibraryError) error
- */
- /** @expose */
- error : function(error) {
- var reporter = this.getReporter();
- if (reporter) {
- reporter(error);
- }
- },
- /**
- * Log an error with the given code, and null location and bundle name.
- * @param (int) code Error code
- */
- logError$0 : function(code) {
- this.error(com_ibm_rave_library_service_LibraryError.create(code));
- },
- /**
- * Log an error with the given code and location, and null bundle name.
- * @param (int) code Error code
- * @param (String) location Error location
- */
- logError$1 : function(code, location) {
- this.error(com_ibm_rave_library_service_LibraryError.create(code, location));
- },
- /**
- * Log an error with the given code, location, and bundle name.
- * @param (int) code Error code
- * @param (String) location Error code
- * @param (String) bundleName Bundle name
- */
- logError$2 : function(code, location, bundleName) {
- this.error(com_ibm_rave_library_service_LibraryError.create(code, location, bundleName));
- },
- /** @expose */
- logError : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.logError$0(a0);
- }
- if (args.length == 2) {
- return this.logError$1(a0, a1);
- }
- return this.logError$2(a0, a1, a2);
- }
- //constructor : function() {}
- });
- //com_ibm_rave_library_service_ErrorDispatcher.ERROR_REPORTER_KEY = "ERROR_REPORTER_KEY";
- /** @expose */
- com_ibm_rave_library_service_ErrorDispatcher.INSTANCE = new com_ibm_rave_library_service_ErrorDispatcher();
- // $source: com/ibm/rave/library/service/LibraryError
- /************************************************************************
- ** 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
- /**
- * LibraryError This class is intended as a replacement for exceptions, which are not supported in some of our target languages (i.e. Swift) and which we are trying to avoid. Each time an error needs to be reported a new instance of this class is created and using the {@link this.Library#this.logError()} function you can set an error code. The corresponding error message is adding by a lookup into the OMap. Two Interface classes are defined here in order to allow callbacks to be invoked set by the user.
- */
- var com_ibm_rave_library_service_LibraryError = rave['internal']['Declare']({
- //errorMessage : null,
- //errorLocation : null,
- //bundlename : null,
- errorCode : 0,
- /**
- * @param (int) code Error code
- * @param (String) location Error location, may be null
- * @param (String) bundleName Bundle name, may be null
- * @return (void) Library error with that code, location, and bundle name
- */
- constructor : function(code, location, bundleName) {
- this.errorCode = code;
- this.errorMessage = com_ibm_rave_library_service_LibraryError.errorMap[code];
- this.errorLocation = location;
- this.bundlename = bundleName;
- },
- /**
- * @return (int) a value to indicate the error type
- */
- /** @expose */
- code : function() {
- return this.errorCode;
- },
- /**
- * @return (String) a message describing the error
- */
- /** @expose */
- message : function() {
- return this.errorMessage;
- },
- /**
- * @param (String) bundleName - the bundle name the error occurred in
- */
- /** @expose */
- setBundlename : function(bundleName) {
- this.bundlename = bundleName;
- },
- /**
- * @return (String) the bundle name the error occurred in
- */
- /** @expose */
- getBundlename : function() {
- return this.bundlename;
- },
- /**
- * @return (String) the method or stack where the error occurs
- */
- /** @expose */
- location : function() {
- return this.errorLocation;
- }
- });
- /**
- * @param (int) code Error code
- * @return (com.ibm.rave.library.service.LibraryError) LibraryError with that code and a null location and bundle name
- */
- com_ibm_rave_library_service_LibraryError.create$0 = function(code) {
- return new com_ibm_rave_library_service_LibraryError(code, null, null);
- };
- /**
- * @param (int) code Error code
- * @param (String) location Error location
- * @return (com.ibm.rave.library.service.LibraryError) LibraryError with that code and location and a null bundle name
- */
- com_ibm_rave_library_service_LibraryError.create$1 = function(code, location) {
- return new com_ibm_rave_library_service_LibraryError(code, location, null);
- };
- /**
- * @param (int) code Error code
- * @param (String) location Error location
- * @param (String) bundleName Bundle name
- * @return (com.ibm.rave.library.service.LibraryError) LibraryError with that code, location, and bundle name
- */
- com_ibm_rave_library_service_LibraryError.create$2 = function(code, location, bundleName) {
- return new com_ibm_rave_library_service_LibraryError(code, location, bundleName);
- };
- com_ibm_rave_library_service_LibraryError.populateErrorMap = function() {
- var errorMap = {};
- errorMap[300] = "No metadata about the bundle could be found in the json file.";
- errorMap[301] = "The specified info does not exist";
- errorMap[302] = "Preview format is not supported. It is either svg or img";
- errorMap[201] = "Unable to load bundle";
- errorMap[206] = "Manifest not available for this bundle";
- errorMap[207] = "Bower not available for this bundle";
- errorMap[204] = "Requested configuration ID not available for this bundle";
- errorMap[4] = "PropertyNativeUtils parse";
- errorMap[5] = "Palettes must have a unique id with at least 1 character. PaletteSet add";
- errorMap[205] = "Configuration file load error ";
- errorMap[101] = "Data model Error";
- errorMap[203] = "NLS catalog file load error ";
- errorMap[1] = "A property error has occurred.";
- errorMap[104] = "No datamodels defined";
- errorMap[105] = "Data model not found";
- errorMap[106] = "Data set not found";
- errorMap[107] = "Data slot not found";
- errorMap[108] = "Accessor is not of a type allowed for the data slot";
- errorMap[409] = "Mismatched data type";
- errorMap[109] = "No data has been assigned to a required data set";
- errorMap[110] = "No accessor has been assigned to a required data slot";
- errorMap[401] = "Missing ImportData or required ImportData property (visJSONData, index, dataSetId), or JSON parse error. Please check input data.";
- errorMap[402] = "ImportData index out of range";
- errorMap[403] = "selected table is null or has no fields";
- errorMap[404] = "ImportData dataSetId is not valid";
- errorMap[405] = "map has an invalid data slot ID";
- errorMap[406] = "ImportData dataSetId is not of the correct type (tabular or hierarchical)";
- errorMap[407] = "ImportData levels uses an ID which is not a field ID";
- errorMap[6] = "The numeric value given is NaN";
- errorMap[7] = "The value given does not exist in the specified list";
- errorMap[8] = "The value given is less than the minimum specified";
- errorMap[9] = "The value given is greater than the maximum specified";
- errorMap[10] = "value of minimum is negative";
- errorMap[11] = "value of maximum is negative";
- errorMap[12] = "The minmum value is greater than the maximum value";
- errorMap[13] = "Options array is empty.";
- errorMap[14] = "Option array for string property are not unique.";
- errorMap[15] = "The property must be string.";
- errorMap[16] = "The property must be numeric.";
- errorMap[17] = "The property must be boolean.";
- errorMap[18] = "The property must be an array.";
- errorMap[19] = "The property must be an object.";
- errorMap[20] = "The value must be an integer.";
- errorMap[21] = "Property simple id is null";
- errorMap[22] = "Property simple id is invalid";
- errorMap[23] = "Property entry type is invalid";
- errorMap[24] = "Property entry is null";
- errorMap[25] = "Property entry type is not an object";
- errorMap[26] = "Property entry type is not a string";
- errorMap[27] = "Property entry has no type";
- errorMap[28] = "Property entry has no properties";
- errorMap[29] = "Property entry has unknown type";
- errorMap[30] = "Found duplicate property entries with the same id but of different types";
- errorMap[31] = "value being set is not a JSON object";
- errorMap[32] = "value object has an unknown property";
- errorMap[33] = "Both the true and false label must be provided";
- errorMap[34] = "Value is not part of enum.";
- errorMap[35] = "Can't change value of unmodifiable property";
- errorMap[36] = "A property in value object does not exist.";
- errorMap[37] = "String does not match regular expression";
- errorMap[38] = "Can not set value for unknown type";
- errorMap[39] = "A required property has no default value";
- errorMap[40] = "Can't set a required property with no default to null";
- errorMap[41] = "Missing enum options array";
- errorMap[42] = "Invalid Enum. Entry: missing enum/enumLabel";
- errorMap[43] = "Duplicate enum value";
- errorMap[408] = "Stacking isn't allowed";
- return errorMap;
- };
- /** @expose */
- com_ibm_rave_library_service_LibraryError.create = function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return com_ibm_rave_library_service_LibraryError.create$0(a0);
- }
- if (args.length == 2) {
- return com_ibm_rave_library_service_LibraryError.create$1(a0, a1);
- }
- return com_ibm_rave_library_service_LibraryError.create$2(a0, a1, a2);
- };
- com_ibm_rave_library_service_LibraryError.errorMap = com_ibm_rave_library_service_LibraryError.populateErrorMap();
- // $source: com/ibm/rave/library/service/BundleService
- /************************************************************************
- ** 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/core/RegistryService (loadtime) // superclass
- /**
- * A registry service for bundles.
- */
- var com_ibm_rave_library_service_BundleService = rave['internal']['Declare'](com_ibm_rave_core_RegistryService, {
- /** @expose */
- getServiceId : function() {
- return "BundleService";
- }
- /**
- * singleton
- */
- //constructor : function() {}
- });
- /** @expose */
- com_ibm_rave_library_service_BundleService.INSTANCE = new com_ibm_rave_library_service_BundleService();
- // $source: com/ibm/rave/library/service/LibraryExtensionService
- /************************************************************************
- ** 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/core/RegistryService (loadtime) // superclass
- /**
- * A registry service for library extensions. The INSTANCE is available through Library.extensions.
- */
- var com_ibm_rave_library_service_LibraryExtensionService = rave['internal']['Declare'](com_ibm_rave_core_RegistryService, {
- /** @expose */
- getServiceId : function() {
- return "LibraryExtensionService";
- }
- /**
- * singleton
- */
- //constructor : function() {}
- });
- /** @expose */
- com_ibm_rave_library_service_LibraryExtensionService.INSTANCE = new com_ibm_rave_library_service_LibraryExtensionService();
- // $source: com/ibm/rave/library/palette/internal/PaletteManager
- /************************************************************************
- ** 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/palette/internal/PaletteSet (runtime) // new
- /**
- * <p> The library level manager of all palettes. the palette manager will request the library config in order to read in all the palette files defined at the libaray level as well as the default palette to use and set them on itself for use by all bundles </p> <p> The loader gets the contents of the JSON configuration files and saves them in the config. We then add a call back to the loader so once it's done loading the resources we can setup the palettes and defualt id to use </p>
- */
- var com_ibm_rave_library_palette_internal_PaletteManager = rave['internal']['Declare']({
- //obj : null,
- //paletteConfig : null,
- getPaletteManagerData : function() {
- var paletteManagerData = rave['internal']['RaveContextManager'].INSTANCE.getRaveContext().getData("PALETTE_MANAGER_DATA_KEY");
- if (!paletteManagerData) {
- paletteManagerData = new com_ibm_rave_library_palette_internal_PaletteManager.PaletteManagerData();
- rave['internal']['RaveContextManager'].INSTANCE.getRaveContext().putData("PALETTE_MANAGER_DATA_KEY", paletteManagerData);
- this.populate(this.obj);
- }
- return paletteManagerData;
- },
- constructor : function() {
- this.obj = require("./configuration/configuration.json");
- },
- /**
- * Populate the palette manager from a JSON configuration object. This object must contain a "paletteConfiguration" property that contains a "palettes" property containing an array of palette information.
- * @param (Object) config JSON configuration containing palette information.
- */
- populate : function(config) {
- if (config) {
- this.paletteConfig = config["paletteConfiguration"];
- if (this.paletteConfig) {
- this.getPaletteManagerData().palettes.populate(this.paletteConfig["palettes"]);
- var defaultPaletteId = this.paletteConfig["defaultPaletteID"];
- if (defaultPaletteId != null) {
- this.getPaletteManagerData().defaultPalette = ""+(defaultPaletteId);
- }
- }
- }
- },
- /**
- * Set the default palette
- * @param (String) paletteId The default palette id
- */
- setDefaultPalette : function(paletteId) {
- this.getPaletteManagerData().defaultPalette = paletteId;
- },
- /**
- * get the default id
- * @return (String) the default palette id
- */
- getDefaultId : function() {
- return this.getPaletteManagerData().defaultPalette;
- },
- /**
- * get the default palette object
- * @return (com.ibm.rave.library.palette.Palette) the default palette object
- */
- getDefaultPalette : function() {
- var paletteManagerData = this.getPaletteManagerData();
- return paletteManagerData.palettes.get(paletteManagerData.defaultPalette);
- },
- /**
- * get the default with the given id
- * @return (com.ibm.rave.library.palette.Palette) the default palette object with the given id
- */
- getPalette : function(paletteId) {
- return this.getPaletteManagerData().palettes.get(paletteId);
- },
- /**
- * Creates a palette with colors adjusted by the adjustment amount This is useful when a slightly darker or lighter color is needed for a border or stroke
- * @param (String) paletteId Palette to start with
- * @param (double) adjustment Percentage to adjust the color, negative is darker, positive is lighter
- * @return (com.ibm.rave.library.palette.Palette) adjusted palette
- */
- getAdjustedColorPalette : function(paletteId, adjustment) {
- var originalPalette = this.getPaletteManagerData().palettes.getPaletteJSON(paletteId);
- var adjustedPaletteId = originalPalette["id"] + "_" + adjustment;
- var adjustedPalette = this.getPaletteManagerData().palettes.get(adjustedPaletteId);
- if (!adjustedPalette) {
- var adjustedPaletteClone = {};
- adjustedPaletteClone["id"] = adjustedPaletteId;
- adjustedPaletteClone["valueType"] = originalPalette["valueType"];
- var fillType = originalPalette["fillType"];
- adjustedPaletteClone["fillType"] = fillType;
- var simpleFill = fillType.localeCompare("simple") == 0 ? true : false;
- var originalFills = originalPalette["fills"];
- var newFills = [];
- adjustedPaletteClone["fills"] = newFills;
- for (var i = 0; i < originalFills.length; ++i) {
- if (simpleFill) {
- var fill = originalFills[i];
- if (adjustment < 0) {
- fill = rave.rgb(fill).darker(adjustment * -1).toString();
- } else {
- fill = rave.rgb(fill).brighter(adjustment).toString();
- }
- newFills.push(fill);
- } else {
- var oFill = originalFills[i];
- var fill = oFill["fill"];
- if (adjustment < 0) {
- fill = rave.rgb(fill).darker(adjustment * -1).toString();
- } else {
- fill = rave.rgb(fill).brighter(adjustment).toString();
- }
- var newFill = {};
- newFill["at"] = (oFill["at"]);
- newFill["fill"] = fill;
- newFills.push(newFill);
- }
- }
- this.getPaletteManagerData().palettes.add(adjustedPaletteClone);
- adjustedPalette = this.getPaletteManagerData().palettes.get(adjustedPaletteId);
- }
- return adjustedPalette;
- },
- /**
- * add a new palette to the palette manager
- * @param (Object) palette the json representation of the palette
- */
- addPalette : function(palette) {
- this.getPaletteManagerData().palettes.add(palette);
- },
- /**
- * remove a new palette from the palette manager
- * @param (String) paletteId the id of the palette
- * @param (com.ibm.rave.library.service.LibraryError) error the library error
- */
- removePalette : function(paletteId, error) {
- this.getPaletteManagerData().palettes.remove(paletteId, error);
- },
- /**
- * add an array of new palette to the palette manager
- * @param (Array) palettes the json representation of an array of palettes
- */
- addPalettes : function(palettes) {
- var paletteSet = this.getPaletteManagerData().palettes;
- for (var __i_enFor0 = 0, __exp_enFor0 = palettes, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var palette = __exp_enFor0[__i_enFor0];
- paletteSet.add(palette);
- }
- },
- /**
- * get every palette in the palette manager
- * @return (Array) an array of palettes
- */
- getAllPalettes : function() {
- return this.getPaletteManagerData().palettes.getAll();
- },
- /**
- * get every palette id in the palette manager
- * @return (Array) an array of palettes ids
- */
- getAllPaletteIds : function() {
- return this.getPaletteManagerData().palettes.getAllIds();
- },
- /**
- * Get the JSON definition of a palette as JSON
- */
- getJSONPalette : function(id) {
- return this.getPaletteManagerData().palettes.getPaletteJSON(id);
- }
- });
- com_ibm_rave_library_palette_internal_PaletteManager.PaletteManagerData = rave['internal']['Declare']({
- /**
- * PaletteSet to hold the library level palettes
- */
- //palettes : null,
- /**
- * The default palette id
- */
- //defaultPalette : null,
- constructor : function() {
- this.palettes = new com_ibm_rave_library_palette_internal_PaletteSet();
- }
- });
- //com_ibm_rave_library_palette_internal_PaletteManager.PALETTE_MANAGER_DATA_KEY = "PALETTE_MANAGER_DATA_KEY";
- // $source: com/ibm/rave/library/palette/internal/PaletteSet
- /************************************************************************
- ** 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/internal/nativeImpl/PropertyNativeUtils (runtime) // isJSONObject
- //@import com/ibm/rave/library/Library (runtime) // logError
- //@import com/ibm/rave/library/palette/internal/CategoricalPalette (runtime) // new
- //@import com/ibm/rave/library/palette/internal/ContinuousPalette (runtime) // new
- //@import com/ibm/rave/library/palette/internal/ConditionalPalette (runtime) // new
- /**
- * <p> This class allows for the creation of an set of palettes, and allows a new Palette to be added and an existing Palette to be retrieved by providing its id. </p> <p> Each {@link (com.ibm.rave.library.palette.Palette) Palette} is created from a JSONObject in the JSONArray passed in as an argument to the constructor. Also passed in is a {@link (com.ibm.rave.library.service.LibraryError) LibraryError} object which will record the specifics of any error that occurs. Any error triggers the end of the creation of the palettes in the constructor. </p> <p> The ids of the palettes are mapped to the palettes themselves so that palettes can be retrieved using {@link #this.get(String this.id)} with their matching id. </p>
- */
- var com_ibm_rave_library_palette_internal_PaletteSet = rave['internal']['Declare']({
- //palettes : null,
- /**
- * Create an empty Palette set. See {@link #this.populate(Array)} to populate the set with palettes.
- */
- constructor : function() {
- this.palettes = {};
- },
- /**
- * Creates the palettes based upon the contents of the palettes array. If an error occurs, the creation of the palettes will stop immediately and the cause of the error will be stored in the error object.
- * @param (Array) palettes A JSONArray of palettes as JSONObjects
- */
- populate : function(palettes) {
- if (!palettes) {
- return;
- }
- for (var i = 0; i < palettes.length; ++i) {
- var obj = palettes[i];
- if (com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONObject(obj)) {
- var jsonPalette = obj;
- var passed = this.add(jsonPalette);
- if (!passed) {
- return;
- }
- }
- }
- },
- /**
- * Adds a new Palette, or if one of that id already exists, replaces it. If there is no id, we set the error.
- * @param (Object) palette The new Palette
- * @return (boolean) The new Palette
- */
- add : function(palette) {
- var id = ""+(palette["id"]);
- if (id != null && id.length > 0) {
- this.palettes[id] = palette;
- return true;
- }
- com_ibm_rave_library_Library.logError(5);
- return false;
- },
- /**
- * Remove a Palette. If there is no id, we set the error.
- * @param (String) paletteId The Palette to remove
- * @param (com.ibm.rave.library.service.LibraryError) error indicates if an error occurs, and what the error was
- */
- remove : function(paletteId, error) {
- if (paletteId != null && paletteId.length > 0) {
- delete this.palettes[paletteId];
- } else {
- com_ibm_rave_library_Library.logError(5, "PaletteSet remove");
- }
- },
- /**
- * Return the JSON representation of a palette
- * @param (String) paletteId
- * @return (Object) palette
- */
- getPaletteJSON : function(paletteId) {
- return this.palettes[paletteId];
- },
- /**
- * This method returns the Palette with the corresponding id.
- * @param (String) id The id to match
- * @return (com.ibm.rave.library.palette.Palette) the Palette with the matching id
- */
- get : function(id) {
- var palette;
- if (id != null) {
- var jsonPalette = this.palettes[id];
- if (jsonPalette) {
- if ("simple" == jsonPalette["fillType"]) {
- palette = new com_ibm_rave_library_palette_internal_CategoricalPalette(jsonPalette);
- } else if ("continuous" == jsonPalette["fillType"] || "discrete" == jsonPalette["fillType"]) {
- palette = new com_ibm_rave_library_palette_internal_ContinuousPalette(jsonPalette);
- } else if ("conditional" == jsonPalette["fillType"]) {
- palette = new com_ibm_rave_library_palette_internal_ConditionalPalette(jsonPalette);
- }
- }
- }
- return palette;
- },
- /**
- * Retrieve all palettes as an array. Note, this constructs a <em>new array</em> containing the palettes in this set.
- * @return (Array) All palettes
- */
- getAll : function() {
- var paletteArray = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this.palettes), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- paletteArray.push(this.get(key));
- }
- return paletteArray;
- },
- /**
- * Retrieve all palette Ids as an array. Note, this constructs a <em>new array</em> containing the palette Ids in this set.
- * @return (Array) All palettes Ids
- */
- getAllIds : function() {
- var paletteIds = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this.palettes), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- paletteIds.push(key);
- }
- return paletteIds;
- }
- });
- // $source: com/ibm/rave/library/internal/nativeImpl/PropertyNativeUtils
- /************************************************************************
- ** 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_internal_nativeImpl_PropertyNativeUtils = (function() {
- //constructor : function() {}
- });
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.parse = function(jString) {
- var json = null;
- try {
- json = JSON.parse(jString);
- } catch (e) {
- com_ibm_rave_library_Library.logError(com_ibm_rave_library_LibraryError.PROPERTY_JSON_PARSE_ERROR, "PropertyNativeUtils parse");
- }
- return json;
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONObject = function(obj) {
- return (obj != null && obj instanceof Object && !com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONArray(obj));
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONArray = function(obj) {
- return (obj instanceof Array);
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isNumber = function(object) {
- return (typeof object == 'number' || object instanceof Number);
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isString = function(object) {
- return (typeof object == 'string' || object instanceof String);
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isBoolean = function(object) {
- return (typeof object == 'boolean' || object instanceof Boolean);
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.stringMatchesRexExp = function(str, regexp) {
- var re = new RegExp(regexp);
- var match = re.exec(str);
- if (match[0] == str) {
- return true;
- }
- return false;
- };
- // $source: com/ibm/rave/library/palette/Palette
- /************************************************************************
- ** 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/framework/internal/ScaleManager (runtime) // ordinalDomain
- //@import com/ibm/rave/library/framework/internal/OrdinalCoordinateScaleDatum (runtime) // new
- /**
- * A palette class the palette will hold colors to be used by the bundles
- */
- var com_ibm_rave_library_palette_Palette = rave_library_externs["Palette"] = rave['internal']['Declare']({
- /**
- * The palette id
- */
- //_id : null,
- /**
- * The palette label
- */
- //_label : null,
- /**
- * The palette description
- */
- //_description : null,
- /**
- * The palette icon
- */
- //_icon : null,
- /**
- * null value color
- */
- /** @expose */
- nullColor : null,
- /**
- * The accessor function to get the data for the palette
- */
- /** @expose */
- dataAccessor : null,
- /**
- * The palette type
- */
- /** @expose */
- type : null,
- /**
- * TODO:
- */
- //_originalDomain : null,
- //_originalDomainLabelAccessor : null,
- /**
- * the validity of the domain
- */
- _domainValidity : 0,
- /**
- * Palette constructor which takes a json representation of the palette
- * @param (Object) jsonPalette the json representation of the palette
- */
- /** @expose */
- constructor : function(jsonPalette) {
- this._id = (jsonPalette["id"]);
- this._label = (jsonPalette["label"]);
- this._description = (jsonPalette["description"]);
- this._icon = (jsonPalette["icon"]);
- this.nullColor = null;
- this._domainValidity = com_ibm_rave_library_palette_Palette.VALID_DOMAIN;
- this.dataAccessor = function(data) {
- return data;
- };
- },
- /**
- * Get the palettes id
- * @return (String) the id
- */
- /** @expose */
- getId : function() {
- return this._id;
- },
- /**
- * Get the palettes label
- * @return (String) the label
- */
- /** @expose */
- getLabel : function() {
- return this._label;
- },
- /**
- * Get the palettes description
- * @return (String) the description
- */
- /** @expose */
- getDescription : function() {
- return this._description;
- },
- /**
- * Get the palettes icon
- * @return (String) the icon
- */
- /** @expose */
- getIcon : function() {
- return this._icon;
- },
- /**
- * Get the palettes type
- * @return (String) the type
- */
- /** @expose */
- getType : function() {
- return this.type;
- },
- /**
- * @return (int) the _domainValidity
- */
- /** @expose */
- getDomainValidity : function() {
- return this._domainValidity;
- },
- /**
- * Set the data accessor function
- * @param (rave['internal']['SingleValueFunction']) singleValueFunction value function
- */
- /** @expose */
- setAccessor : function(singleValueFunction) {
- this.dataAccessor = singleValueFunction;
- },
- /**
- * set the data for the palette with the included domain
- * @param (Array) domain the data domain
- * @param (com.ibm.rave.library.datamodel.DataSet) dataSet the data set to be used in the palette's domain
- * @param (String) slot the data slot in the data set
- */
- setData$0 : function(domain, dataSet, slot) {
- var dataSlot = dataSet.slot(slot);
- this.setDomain(domain, dataSlot ? dataSlot.entry() : null, null, null);
- },
- /**
- * set the data for the palette from the data set
- * @param (com.ibm.rave.library.datamodel.DataSet) dataSet the data set to be used in the palette's domain
- * @param (String) slot the data slot in the data set
- */
- setData$1 : function(dataSet, slot) {
- var dataSlot = dataSet.slot(slot);
- var colorAccessor = dataSlot ? dataSlot.entry() : null;
- var data = dataSet.data();
- var originalDomain;
- var originalDomainLabelAccessor;
- var domain;
- if (colorAccessor) {
- if ("numeric" == colorAccessor.type$0()) {
- domain = com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$0(data, colorAccessor, true);
- } else {
- domain = com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$0(data, colorAccessor, false);
- }
- if (domain) {
- var originalDomainMap = rave['internal']['ES6Map'].create();
- for (var __i_enFor0 = 0, __exp_enFor0 = domain, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- originalDomainMap.set(key, new com_ibm_rave_library_framework_internal_OrdinalCoordinateScaleDatum(key));
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = data, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var key = colorAccessor(o);
- var datum = originalDomainMap.get(key);
- if (datum) {
- datum.push(o);
- }
- }
- originalDomain = [];
- for (var __i_enFor2 = 0, __exp_enFor2 = domain, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var d = __exp_enFor2[__i_enFor2];
- originalDomain.push(originalDomainMap.get(d));
- }
- originalDomainLabelAccessor = function(data, index, groupIndex) {
- var key = (data).key();
- return ""+(key);
- };
- }
- }
- this.setDomain(domain, colorAccessor, originalDomain, originalDomainLabelAccessor);
- },
- /**
- * validate the domain and set it accordingly
- * @param (Array) domain the data domain
- * @param label the label for the data if no valid domain is used
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) colorAccessor the accessor for the color slot
- */
- setDomain : function(domain, colorAccessor, originalDomain, originalDomainLabelAccessor) {
- if (!domain) {
- this._domainValidity = com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_NULL;
- this.invalidateDomain();
- } else if (domain.length <= 0) {
- this._domainValidity = com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_EMPTY;
- this.invalidateDomain();
- } else if (!(this.canHandleDataType(colorAccessor ? colorAccessor.type$0() : null))) {
- this._domainValidity = com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_DATATYPE;
- this.invalidateDomain();
- } else {
- this._domainValidity = com_ibm_rave_library_palette_Palette.VALID_DOMAIN;
- this.domain(domain);
- this._originalDomain = originalDomain;
- this._originalDomainLabelAccessor = originalDomainLabelAccessor;
- }
- },
- /**
- * set the palettes null value color
- * @param (String) color the null color
- */
- /** @expose */
- setNullColor : function(color) {
- this.nullColor = color;
- },
- /**
- * Adds a single color into the palette
- * @param (Object) color a json object representing a color
- */
- /** @expose */
- addColor : function(color) {},
- /**
- * Adds an array of colors into the palette
- * @param (Array) colors a json object representing a color
- */
- /** @expose */
- addAllColors : function(colors) {},
- /**
- * removed a single color from the palette
- * @param (Object) color a json object representing a color to remove
- */
- /** @expose */
- removeColor : function(color) {},
- /**
- * set the domain of the palette
- * @param (Array) domain the domain to be set on the palette
- */
- /** @expose */
- domain : function(domain) {},
- /**
- * Set domain to be invalid
- */
- /** @expose */
- invalidateDomain : function() {},
- /**
- * get the scale for the palette
- * @return (rave['internal']['AbstractScale']) the scale
- */
- /** @expose */
- getScale : function() {},
- /**
- * Can the palette handle the data type
- * @return (boolean) whether the palette can handle the data type
- */
- /** @expose */
- canHandleDataType : function(type) {},
- /**
- * TODO:
- */
- /** @expose */
- originalDomain : function() {
- return this._originalDomain;
- },
- /**
- * TODO: Copied from OrdinalCoordinateScale Set a label accessor function to be used with an "original domain" (See {@link #this.originalDomain()} ). The provided format function should return a String when provided with an original data value.
- */
- originalDomainLabelAccessor$0 : function(format) {
- this._originalDomainLabelAccessor = format;
- },
- /**
- * TODO: Copied from OrdinalCoordinateScale Retrieve the label accessor function. May be null if no accessor was supplied through {@link #this.originalDomainLabelAccessor(rave['internal']['ValueFunction'])} .
- */
- originalDomainLabelAccessor$1 : function() {
- return this._originalDomainLabelAccessor;
- },
- /** @expose */
- setData : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 2) {
- return this.setData$1(a0, a1);
- }
- return this.setData$0(a0, a1, a2);
- },
- /** @expose */
- originalDomainLabelAccessor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.originalDomainLabelAccessor$1();
- }
- return this.originalDomainLabelAccessor$0(a0);
- }
- });
- /**
- * numeric data type
- */
- //com_ibm_rave_library_palette_Palette.DATATYPE_NUMERIC = "numeric";
- /**
- * string data type
- */
- //com_ibm_rave_library_palette_Palette.DATATYPE_STRING = "string";
- /**
- * valid domain
- */
- /** @expose */
- com_ibm_rave_library_palette_Palette.VALID_DOMAIN = 0;
- /**
- * the reason for the invalid domain is the datatype
- */
- /** @expose */
- com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_DATATYPE = 1;
- /**
- * the reason for the invalid domain is its empty
- */
- /** @expose */
- com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_EMPTY = 2;
- /**
- * the reason for the invalid domain is it is null. Null domain means color slot isn't defined in data. Empty domain means color slot is defined, but returns null in all cases.
- */
- /** @expose */
- com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_NULL = 3;
- // $source: com/ibm/rave/library/framework/internal/CoordinateScaleImpl
- /************************************************************************
- ** 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
- /**
- * <p> A CoordinateScaleImpl simplifies using scales for coordinates where the data values may be ordinal or non-ordinal. It wraps a RAVE core scale and delegates to that scale. Instances are obtained from the factory methods. </p> <p> The scale is not an AbstractScale. The {@link #this.scale()} method gives access to the internal scale, so that it can be used with axes and related core code. This scale should not be directly modified, although it is safe to use it in pan-zoom. </p> <p> Conceptually each input value is scaled to a band of output pixel coordinates using the {@link #this.range(, , Number, Number)} . All bands are the same width. The coordinate methods {@link #this.center(Object)} , {@link #this.lower(Object)} , and {@link #this.upper(Object)} give the center and two endpoints of these bands, and {@link #this.width()} gives the band width. For continuous scales the width is by default 0, and the coordinate methods all return the center; however the width can be changed by the bundle, for example by setting the column width. </p> <p> For example, a point component can use either ordinal or non-ordinal scales on the two axes. The point component is passed the two CoordinateScales wrapping those scales, and uses {@link #this.center(Object)} to get the coordinate of the center of the point element. An interval element would similarly use the {@link #this.lower(Object)} and {@link #this.upper(Object)} for the span of the interval. </p> <p> Methods are also provided to modify the input domain by including zero or by expanding the domain by a percentage or by pixels. These methods only modify continuous scales. </p>
- */
- var com_ibm_rave_library_framework_internal_CoordinateScaleImpl = rave['internal']['Declare']({
- /**
- * Returns the internal scale used by the coordinate scale; for clustered scales this is the first scale. This may be used for axes and pan-zoom. Changing the domain or range of this scale may have unexpected effects.
- * @return (rave['internal']['AbstractScale']) The scale passed to the factory method
- */
- /** @expose */
- scale : function() {},
- /**
- * Base class returns false.
- * @return (boolean) Whether the scale is continuous (linear or time)
- */
- isContinuous : function() {
- return false;
- },
- /**
- * Base class returns false.
- * @return (boolean) Whether the scale is the ordinal subclass
- */
- /** @expose */
- isOrdinal : function() {
- return false;
- },
- /**
- * Base class returns false.
- * @return (boolean) Whether the scale is the linear subclass
- */
- /** @expose */
- isLinear : function() {
- return false;
- },
- /**
- * Base class returns false.
- * @return (boolean) Whether the scale is the time subclass
- */
- /** @expose */
- isTime : function() {
- return false;
- },
- /**
- * Base class returns false.
- * @return (boolean) Whether the scale is the clustered subclass
- */
- /** @expose */
- isClustered : function() {
- return false;
- },
- /**
- * <p> Expands the domain of a non-ordinal scale by the given fraction at both ends. For example if the domain is [0,10] and the fraction is 0.10, the domain becomes [-1,11]. If the domain has more than two values, only the end values are changed. Ordinal and clustered scales are not changed. </p> <p> If keepZero is true, any endpoint with value zero will not be changed. In the above example with domain [0,10], if keepZero is true the domain becomes [0,11]. </p> <p> The base class implementation does nothing. </p>
- * @param (double) fraction Fraction of the current domain by which to expand the domain
- * @param (boolean) keepZero If true, a zero value is not modified by the expansion
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) This scale
- */
- expandFraction : function(fraction, keepZero) {
- return this;
- },
- /**
- * <p> Expands the domain of a non-ordinal scale at both ends so that the original endpoints of the domain are the given number of pixels from the ends of the range. The range of the scale must be set before calling this method. For example if the original domain was [0,10] with range [0,500] and pixels is 50, the domain becomes [-1.25,11.25] (since that now maps 0 to 50 and 10 to 450). </p> <p> If keepZero is true, any endpoint with value zero will not be changed. In the above example with domain [0,10], if keepZero is true the domain becomes [0,11.111]; domain 0.0 still maps to range 0.0, and domain 10.0 now maps to range 450. </p> <p> The domain is not changed if pixels is non-positive, or if the range is too small to allow the expansion. Ordinal and clustered scales are not changed. </p> <p> The base class implementation does nothing. </p>
- * @param (double) pixels Number of pixels on the ends of the domain
- * @param (boolean) keepZero If true and an endpoint is zero, the endpoint is not changed
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) This scale
- */
- expandPixels : function(pixels, keepZero) {
- return this;
- },
- /**
- * <p> Expands the domain of a non-ordinal scale to include zero. If the domain has more than two values, only the end values are changed. The domain is not changed if it already includes zero. Ordinal and clustered scales are not changed. </p> <p> The base class implementation does nothing. </p>
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) This scale
- */
- includeZero : function() {
- return this;
- },
- /**
- * <p> If the domain is continuous and has zero extent (e.g. [X,X]), expands the extent so the domain is valid for use with an axis. The new domain contains X. </p> <p> If keepZero is true and the domain is [0,0] (only possible with numbers), the domain becomes [0,1]; this is mostly for charts that have included zero, where the expectation is that 0 will remain at one end of the domain. </p> <p> The base class implementation does nothing. </p>
- * @param (boolean) keepZero
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) this
- */
- expandZeroExtent : function(keepZero) {
- return this;
- },
- /**
- * <p> Extends the domain so that it starts and ends on nice round values of multiple of 10 ^ tickMagnitude. This method typically modifies the scale's domain, and may only extend the bounds to the nearest round value considering the tick magnitude. </p> <p> The base class implementation does nothing. </p>
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) This scale
- */
- nice$0 : function(tickMagnitude) {
- return this;
- },
- /**
- * <p> Extends the domain so that it starts and ends on nice round values. This method typically modifies the scale's domain, and may only extend the bounds to the nearest round value. </p> <p> The base class implementation does nothing. </p>
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) This scale
- */
- nice$1 : function() {
- return this;
- },
- /**
- * <p> Get the center value for the data. If the internal scale is ordinal or clustered, this is the center of the range band for the data. Otherwise it is the value of the scale for the data. The method can return null. </p>
- * @param (Object) data Value to be scaled
- * @return (Number) Coordinate for the center of that value
- */
- /** @expose */
- center : function(data) {},
- /**
- * <p> Get the lower value for the data. If the internal scale is ordinal or clustered, this is the start of the range band for the data. Otherwise it is the value of the scale for the data. The method can return null. This value is always less than or equal to the center value, even if the scale is configured with a reverse pixel range. </p>
- * @param (Object) data Value to be scaled
- * @return (Number) Coordinate for the lower end of that value
- */
- /** @expose */
- lower : function(data) {},
- /**
- * <p> Get the upper value for the data. If the internal scale is ordinal or clustered, this is the end of the range band for the data. Otherwise it is the value of the scale for the data. The method can return null. This value is always greater than or equal to the center value, even if the scale is configured with a reverse pixel range. </p>
- * @param (Object) data Value to be scaled
- * @return (Number) Coordinate for the lower end of that value
- */
- /** @expose */
- upper : function(data) {},
- /**
- * <p> Get the width in pixels of the band for the data. As the core scales are not configured with variable widths (yet), this is the same for all data values. It is the difference of the {@link #this.upper(Object)} and {@link #this.lower(Object)} values, with the {@link #this.center(Object)} halfway between. </p> <p> For ordinal scales, this is the width allocated to each value by the core scale range bands. For continuous scales it is the width set by {@link #this.setWidth()} . </p>
- */
- /** @expose */
- width : function() {},
- /**
- * <p> Set the width in pixels of the band for the data. This is the difference of the {@link #this.upper(Object)} and {@link #this.lower(Object)} values, with the {@link #this.center(Object)} halfway between. </p> <p> For ordinal scales this does nothing unless {@link #this.applyWidth()} is called with true, since the band widths are fixed by default by the range bands of the core scales. Ordinal scales will also revert to default behavior if the value passed in here is 0 or less. </p> <p> For continuous scales, if the argument width is negative the scale's width is not changed. </p> <p> The base class implementation does nothing. </p>
- * @param (double) w The width
- */
- setWidth : function(w) {},
- /**
- * <p> Allow the width set in {@link #this.setWidth()} to affect even ordinal scales. If this is false, or it is never called, ordinal scales will not be affected by the width, which is their default behavior. </p> <p> This affects only ordinal scales, and does nothing for continuous scales. </p> <p> The base class implementation does nothing. </p>
- * @param (boolean) apply
- */
- applyWidth : function(apply) {},
- /**
- * Retrieve the list of client data that this scale's domain is based upon. Will return null if the scale is not Ordinal or Clustered, or was not constructed from external client data.
- */
- originalDomain : function() {
- return null;
- },
- /**
- * Set a label accessor function to be used with an "original domain" (See {@link #this.originalDomain()} ). The provided format function should return a String when provided with an original data value. Note this only effects Ordinal and Clustered Coordinate scales. Numeric scales do not support original data domains.
- */
- originalDomainLabelAccessor$0 : function(format) {},
- /**
- * Retrieve the label accessor function. May be null if no accessor was supplied through {@link #this.originalDomainLabelAccessor(rave['internal']['ValueFunction'])} . Note this only effects Ordinal and Clustered Coordinate scales. Numeric scales do not support original data domains.
- */
- originalDomainLabelAccessor$1 : function() {
- return null;
- },
- nice : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.nice$1();
- }
- return this.nice$0(a0);
- },
- originalDomainLabelAccessor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.originalDomainLabelAccessor$1();
- }
- return this.originalDomainLabelAccessor$0(a0);
- }
- /**
- * Set the coordinate range of the scale to the given interval [v1,v2] with padding arguments as used with a core ordinal scale. If the internal scale is non-ordinal these arguments are ignored.
- * @param (double) v1 First end of range
- * @param (double) v2 Second end of range
- * @param (Number) padding Padding, see OrdinalScale documentation
- * @param (Number) outerPadding Outer padding, see OrdinalScale documentation
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) This scale
- */
- //range : function(v1, v2, padding, outerPadding) {}
- });
- /**
- * Determines if rangeRoundBands should be used in favor or rangeBands for ordinal coordinate scales (i.e. OrdinalCoordinateScale, ClusteredCoordinateScale).
- * @param (double) v1 Interval starting value. Note, this need not be the "minimum" value.
- * @param (double) v2 Interval ending value. Note, this need not be the "maximum" value.
- * @param (int) domainSize The number of data values to be represented in the provided interval range (e.g. the length of an ordinal scale's domain array).
- * @param (Number) padding Padding percentage. See OrdinalScale#rangeBands for more detail.
- * @param (Number) outerPadding Outer padding percentage. See OrdinalScale#rangeBands for more detail.
- * @return (boolean) True if range rounding should be used. False otherwise.
- */
- com_ibm_rave_library_framework_internal_CoordinateScaleImpl.useRounding = function(v1, v2, domainSize, padding, outerPadding) {
- var pad = padding != null ? padding : 0.0;
- var oPad = outerPadding != null ? outerPadding : 0.0;
- return (Math.abs(v2 - v1) / (domainSize - pad + 2 * oPad)) >= 10.0;
- };
- com_ibm_rave_library_framework_internal_CoordinateScaleImpl.ROUND_TOLERANCE = 10;
- // $source: com/ibm/rave/library/framework/internal/OrdinalCoordinateScaleDatum
- /************************************************************************
- ** 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 data object to be attached to ordinal axis ticks. Example usage: <pre> bundleInstance .node("#bundleNode") .render(); rave.select("#bundleNode") .selectAll(".axis.bottom .tick") .on("click", function(d) { console.log(d.originalData()); }); </pre> The resulting output is an array containing all data values associated with the category of the "clicked" axis tick.
- */
- var com_ibm_rave_library_framework_internal_OrdinalCoordinateScaleDatum = rave['internal']['Declare']({
- //_key : null,
- //_values : null,
- /**
- * Construct a new datum for the given key value. The key is the value that will be converted to a string and displayed as the axis tick label.
- */
- constructor : function(key) {
- this._key = key;
- this._values = [];
- },
- /**
- * Add a value to the list of client values associated with this datum's key (category).
- */
- push : function(v) {
- this._values.push(v);
- },
- /**
- * Retrieve this datum's key value.
- */
- key : function() {
- return this._key;
- },
- originalData : function() {
- return this._values;
- },
- originalDataList : function() {
- return this._values;
- },
- toString : function() {
- return this._key.toString();
- }
- });
- // $source: com/ibm/rave/library/action/ActionOperation
- /************************************************************************
- ** 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_library_action_ActionOperation = rave_library_externs["ActionOperation"] = rave['internal']['Declare']({
- /**
- * Returns useful state information from the action(Should the information exist), such as the zoom behavior object in the case of the pan/zoom operation.
- * @param (String) id the ID of the object
- * @return (Object) the state object for the operation.
- */
- /** @expose */
- get : function(id) {
- return null;
- }
- });
- // $source: com/ibm/rave/library/action/FiltersUtil
- /************************************************************************
- ** 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_library_action_FiltersUtil = rave_library_externs["FiltersUtil"] = rave['internal']['Declare']({
- /**
- * Selection filter utility, This is used to filter out elements with the "selected" flag from the rest of the elements, keeping them in the "selected" state intead of allowing them to fade out with the background elements.
- * @param (rave['internal']['Selector']) context All the other element in the context.
- * @param (boolean) flag a boolean to decide whether the return should be selected/unselected elements true: unselected, false: selected.
- * @return (rave['internal']['Selector']) Filtered Selection (selected elements.)
- */
- /** @expose */
- selectionFilter : function(context, flag) {
- return context.filter(flag ? function(data, i, groupIndext) {
- var selected = rave.select(this).property("selected");
- return (selected == null);
- } : function(data, i, groupIndext) {
- var selected = rave.select(this).property("selected");
- return ((selected) == true);
- });
- }
- });
- /** @expose */
- com_ibm_rave_library_action_FiltersUtil.INSTANCE = new com_ibm_rave_library_action_FiltersUtil();
- // $source: com/ibm/rave/library/property/PropertySet
- /************************************************************************
- ** 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/property/PropertyProcessor (runtime) // processProperties
- //@import com/ibm/rave/library/property/ObjectPropertyImpl (runtime) // new
- //@import com/ibm/rave/library/property/PropertyImpl (runtime) // new
- /**
- * <p> This class allows for the creation of an set of properties, and allows a new property to be added and an existing property to be retrieved by providing its id. </p> <p> Each {@link (com.ibm.rave.library.property.PropertyImpl) PropertyImpl} is created from a JSONObject in the containing properties JSONObject passed in as an argument to the populate method, or from a each of properties meta types in the passed list. </p> <p> The fully qualified ids of the properties are mapped to the properties themselves so that properties can be retrieved using {@link #this.property(String this.id)} with their matching fully qualified id. </p>
- */
- var com_ibm_rave_library_property_PropertySet = rave_library_externs["PropertySet"] = rave['internal']['Declare']({
- /**
- * Map containing all property definitions.
- */
- //_flattennedPropMap : null,
- /**
- * List containing all visible (public API) property definitions; null when it needs to be re-created.
- */
- //_visibleProperties : null,
- /**
- * List containing all visible (public API) property metainformation; null when it needs to be re-created.
- */
- //_visibleMeta : null,
- /**
- * Create an empty property set. See {@link #this.populate(Array)} and {@link #this.populate(Object, com_ibm_rave_library_i18n_MessagesRegistry, )} to populate the set with properties.
- */
- /** @expose */
- constructor : function() {
- this._flattennedPropMap = {};
- this._visibleProperties = null;
- this._visibleMeta = null;
- },
- populate$0 : function(properties) {
- for (var __i_enFor0 = 0, __exp_enFor0 = properties, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyMeta = __exp_enFor0[__i_enFor0];
- this.addTopLevelProperty(propertyMeta.copy(null));
- }
- this._visibleProperties = null;
- this._visibleMeta = null;
- },
- /**
- * Creates the properties based upon the contents of the props array. If an error occurs, the creation of the properties will stop immediately and the cause of the error will be stored in the error object.
- * @param (Object) props A JSONArray of properties as JSONObjects
- * @param (boolean) validate Whether or not validation is on.
- */
- populate$1 : function(props, messages, validate) {
- var info = com_ibm_rave_library_property_PropertyProcessor.processProperties(props, messages, validate);
- this.populate$0(info.properties);
- },
- addTopLevelProperty : function(propertyType) {
- var prop = this._flattennedPropMap[propertyType.id()];
- if (!prop) {
- this.addProperty(propertyType, null);
- } else {
- this.mergeProperty(prop, propertyType, null);
- }
- },
- addProperty : function(propertyType, parent) {
- var newProperty;
- if (propertyType.typeId() == 21) {
- var objPropType = propertyType;
- newProperty = new com_ibm_rave_library_property_ObjectPropertyImpl(objPropType, parent);
- this._flattennedPropMap[propertyType.id()] = newProperty;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(objPropType._childProperties), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- var childProperty = objPropType._childProperties[key];
- this.addProperty(childProperty, newProperty);
- }
- } else {
- newProperty = new com_ibm_rave_library_property_PropertyImpl(propertyType, parent);
- this._flattennedPropMap[propertyType.id()] = newProperty;
- }
- if (parent && parent.meta().typeId() == 21) {
- (parent).childProperties()[newProperty.meta().simpleId()] = newProperty;
- }
- },
- mergeProperty : function(existingProperty, newPropertyType, parent) {
- if (existingProperty.meta().typeId() == 21 && newPropertyType.typeId() == 21) {
- var existingObj = existingProperty;
- var newObjType = newPropertyType;
- var newObjectTypeChildIds = {};
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(newObjType._childProperties), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- newObjectTypeChildIds[key] = 1;
- var newChildPropertyType = newObjType._childProperties[key];
- var existingChildProperty = existingObj.childProperties()[key];
- if (existingChildProperty) {
- this.mergeProperty(existingChildProperty, newChildPropertyType, existingObj);
- } else {
- this.fuseProperty(newChildPropertyType, existingObj);
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(newObjectTypeChildIds), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- delete newObjType._childProperties[""+(key)];
- }
- } else {
- this.overwriteProperty(existingProperty, newPropertyType, parent);
- }
- },
- overwriteProperty : function(existingProperty, newPropertyType, parent) {
- if (existingProperty.meta().typeId() == 21) {
- var objProperty = existingProperty;
- var children = objProperty.childProperties();
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(children), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- var childProperty = children[propertyId];
- this.removePropertyFromFlatMap(childProperty);
- }
- }
- if (parent && parent.meta().typeId() == 21) {
- this.fuseProperty(newPropertyType, parent);
- } else {
- newPropertyType._parent = (existingProperty.meta())._parent;
- this.addProperty(newPropertyType, parent);
- }
- (existingProperty.meta())._parent = null;
- },
- fuseProperty : function(newChildPropertyType, existingParentObj) {
- this.addProperty(newChildPropertyType, existingParentObj);
- var existingParentObjType = existingParentObj.meta();
- existingParentObjType._childProperties[newChildPropertyType.simpleId()] = newChildPropertyType;
- newChildPropertyType._parent = existingParentObjType;
- var defaultInstance = existingParentObj.meta().defaultValue();
- defaultInstance[newChildPropertyType.simpleId()] = newChildPropertyType.defaultValue();
- var valueInstance = existingParentObj.value();
- valueInstance[newChildPropertyType.simpleId()] = newChildPropertyType.defaultValue();
- },
- removePropertyFromFlatMap : function(property) {
- delete this._flattennedPropMap[property.meta().id()];
- if (property.meta().typeId() == 21) {
- var objProperty = property;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(objProperty.childProperties()).arrayIterator(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- var childProperty = objProperty.childProperties()[propertyId];
- this.removePropertyFromFlatMap(childProperty);
- }
- }
- },
- /**
- * <p> Configure properties from the given JSON. If it does not have a "properties" property, nothing is done. </p> <p> Otherwise, the "properties" is an array of objects describing the properties configuration, as in the schema. The array is traversed and used to set initial property values and to mark properties hidden and readonly. </p>
- */
- /** @expose */
- configure : function(json) {
- var v = json["properties"];
- if (v != null) {
- for (var __i_enFor0 = 0, __exp_enFor0 = v, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var config = o;
- var prop = this._flattennedPropMap[""+(config["id"])];
- if (prop) {
- var value = config["value"];
- if (value != null && !(prop._readonly)) {
- prop.value(value);
- prop.meta().setDefaultValue(value);
- }
- var b = (config["hidden"]);
- if (b != null && b) {
- prop.setHidden();
- }
- b = (config["readonly"]);
- if (b != null && b) {
- prop.setReadonly();
- }
- }
- }
- this._visibleProperties = null;
- this._visibleMeta = null;
- }
- },
- /**
- * This method returns the property with the corresponding id, or null if there is no such id.
- * @param (String) id The id to match
- * @return (com.ibm.rave.library.property.Property) the property with the matching id
- */
- /** @expose */
- property : function(id) {
- if (id != null) {
- return this._flattennedPropMap[id];
- }
- return null;
- },
- /**
- * Get a list of all visible (public API) properties.
- * @return (Array) List of visible properties
- */
- /** @expose */
- properties : function() {
- if (!this._visibleProperties) {
- this.buildVisibleProperties();
- }
- return this._visibleProperties;
- },
- /**
- * Get a list of all visible (public API) property meta.
- * @return (Array) List of visible property metadata
- */
- /** @expose */
- meta : function() {
- if (!this._visibleMeta) {
- this.buildVisibleProperties();
- }
- return this._visibleMeta;
- },
- /**
- * Builds _visibleProperties and _visibleMeta. Both contain only the leaf properties that are not hidden.
- */
- buildVisibleProperties : function() {
- this._visibleProperties = [];
- this._visibleMeta = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this._flattennedPropMap), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var id = __exp_enFor0[__i_enFor0];
- var prop = this._flattennedPropMap[id];
- if (prop.meta().typeId() != 21 && !(prop._hidden)) {
- this._visibleProperties.push(prop);
- this._visibleMeta.push(prop.meta());
- }
- }
- },
- /** @expose */
- populate : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.populate$0(a0);
- }
- return this.populate$1(a0, a1, a2);
- }
- });
- /**
- * Given a list of meta type loaded from different JSON files, the merge method will try to perform a very simple merge of these properties if it detects a fully qualified id collision amongst them. The rules of the simple merge are as follows: 1- If the colliding properties are both objects, then the child properties of the object that shows up later in the list will be added to the children of the object that showed up earlier, resolving collision amongst those children recursively using the same rules. The meta type of both objects and their properties will change as well in order to maintain the parent child relationship amongst them. 2- If at lease one of the properties is not an object, then the property that comes later in the list will completely overwrite the previous one. It is important to keep in mind that in case of collision, the passed properties will change structurally in terms of their parent-child relationship. Also, it is important to keep in mind that the order of meta properties affect the final result.
- * @param (Array) properties the list of meta properties to merge
- * @return (Array) a new list of the merged properties. In case of no collision then the returned list have the exact same properties as the passed list.
- */
- /** @expose */
- com_ibm_rave_library_property_PropertySet.merge = function(properties) {
- var propertySet = new com_ibm_rave_library_property_PropertySet();
- propertySet.populate(properties);
- var props = propertySet.properties();
- var mergedMeta = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = props, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var p = __exp_enFor0[__i_enFor0];
- mergedMeta.push(p.meta());
- }
- return mergedMeta;
- };
- // $source: com/ibm/rave/library/property/PropertyProcessingInfo
- /************************************************************************
- ** 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
- /**
- * When parsing a JSON properties file to create meta properties, the PropertyProcesser return this structure as a result
- */
- var com_ibm_rave_library_property_PropertyProcessingInfo = rave_library_externs["PropertyProcessingInfo"] = rave['internal']['Declare']({
- /**
- * The list of top level meta properties that got processed from the properties JSON file
- */
- /** @expose */
- properties : null,
- //error : null,
- /**
- * Indicates whether any of the properties processed from the JSON file is invalid
- */
- /** @expose */
- hasInvalidProperties : false,
- /**
- * Indicates whether the PropertyProcessor generated this info while validating the properties JSON file
- */
- /** @expose */
- validate : false,
- constructor : function(validate) {
- this.properties = [];
- {
- this.validate = validate;
- }
- },
- processError : function() {
- this.hasInvalidProperties = true;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyUtil
- /************************************************************************
- ** 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 (runtime) // logError
- //@import com/ibm/rave/library/internal/nativeImpl/PropertyNativeUtils (runtime) // isBoolean, isJSONArray, isNumber, isString, isJSONObject
- /**
- */
- var com_ibm_rave_library_property_PropertyUtil = rave['internal']['Declare']({
- constructor : function() {
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["string"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["boolean"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["numeric"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["enum"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["font"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["color"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["array"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["palette"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["length"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["padding"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["dasharray"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["object"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["jsonobject"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["geojson"] = 1;
- com_ibm_rave_library_property_PropertyUtil.propertyTypes["shadow"] = 1;
- },
- validateNumeric : function(obj, decimal) {
- if (!(this.validateBasicType(obj, 11))) {
- return false;
- }
- var num = + (obj);
- if (isNaN(num)) {
- com_ibm_rave_library_Library.logError(6, "Property Validator");
- return false;
- }
- if (!decimal) {
- return this.validateIsInteger(num);
- }
- return true;
- },
- validateObjectExistInList : function(list, value) {
- if (list.indexOf(value) == -1) {
- com_ibm_rave_library_Library.logError(7, "Property Validator");
- return false;
- }
- return true;
- },
- validateNumericProperties : function(_options, value, decimal) {
- if (_options.length == 0) {
- return true;
- }
- for (var i = 0; i < _options.length; ++i) {
- var listVal = _options[i];
- if (decimal) {
- if (listVal.value() == value) {
- return true;
- }
- } else {
- if (listVal.value() == value) {
- return true;
- }
- }
- }
- com_ibm_rave_library_Library.logError(7, "Property Validator");
- return false;
- },
- validateMinMaxPropertyValue : function(min, max, decimal, value) {
- if (value != null) {
- if (!decimal) {
- if (!(this.validateIsInteger(value))) {
- return false;
- }
- }
- if (min != null && min > value) {
- com_ibm_rave_library_Library.logError(8, "Property Validator");
- return false;
- }
- if (max != null && max < value) {
- com_ibm_rave_library_Library.logError(9, "Property Validator");
- return false;
- }
- }
- return true;
- },
- validateMinMaxProperties : function(minObj, maxObj, decimal, allowNegatives) {
- var min;
- var max;
- if (minObj != null) {
- if (!(this.validateNumeric(minObj, decimal))) {
- return false;
- }
- min = + (minObj);
- if (!allowNegatives) {
- if (min < 0) {
- com_ibm_rave_library_Library.logError(10, "Property Validator");
- return false;
- }
- }
- }
- if (maxObj != null) {
- if (!(this.validateNumeric(maxObj, decimal))) {
- return false;
- }
- max = + (maxObj);
- if (!allowNegatives) {
- if (max < 0) {
- com_ibm_rave_library_Library.logError(11, "Property Validator");
- return false;
- }
- }
- if (min != null && min > max) {
- com_ibm_rave_library_Library.logError(12, "Property Validator");
- return false;
- }
- }
- return true;
- },
- validateSimpleOptions : function(optionsArray, property) {
- var len = optionsArray.length;
- if (len == 0) {
- com_ibm_rave_library_Library.logError(13, "Property Validator");
- return false;
- }
- var optionsSet = {};
- for (var i = 0; i < len; ++i) {
- var obj = optionsArray[i];
- if (optionsSet.hasOwnProperty(obj)) {
- com_ibm_rave_library_Library.logError(14, "Property Validator");
- return false;
- }
- optionsSet[obj] = 1;
- if (!(property.validateValue(obj))) {
- return false;
- }
- }
- return true;
- },
- validateStringOptions : function(optionsArray, property) {
- var len = optionsArray.length;
- if (len == 0) {
- com_ibm_rave_library_Library.logError(13, "Property Validator");
- return false;
- }
- var optionsSet = {};
- for (var i = 0; i < len; ++i) {
- var value = (optionsArray[i])["value"];
- if (optionsSet.hasOwnProperty(value)) {
- com_ibm_rave_library_Library.logError(14, "Property Validator");
- return false;
- }
- optionsSet[value] = 1;
- if (!(property.validateValue(value))) {
- return false;
- }
- }
- return true;
- },
- validateBasicType : function(obj, typeId) {
- switch (typeId) {
- case 10:
- {
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isString(obj))) {
- com_ibm_rave_library_Library.logError(15, "Property Validator");
- return false;
- }
- return true;
- } case 11:
- {
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isNumber(obj))) {
- com_ibm_rave_library_Library.logError(16, "Property Validator");
- return false;
- }
- return true;
- } case 12:
- {
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isBoolean(obj))) {
- com_ibm_rave_library_Library.logError(17, "Property Validator");
- return false;
- }
- return true;
- } case 20:
- {
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONArray(obj))) {
- com_ibm_rave_library_Library.logError(18, "Property Validator");
- return false;
- }
- return true;
- } case 21:
- {
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONObject(obj))) {
- com_ibm_rave_library_Library.logError(19, "Property Validator");
- return false;
- }
- return true;
- } default:
- {
- return false;
- } }
- },
- validateIsInteger : function(num) {
- if ((~~ (num) != num)) {
- com_ibm_rave_library_Library.logError(20, "Property Validator");
- return false;
- }
- return true;
- },
- validatePropertySimpleId : function(simpleId) {
- if (simpleId == null) {
- com_ibm_rave_library_Library.logError(21, "PropertySet.populate");
- return false;
- }
- if (simpleId.indexOf(".") != -1) {
- com_ibm_rave_library_Library.logError(22, "PropertySet.populate");
- return false;
- }
- return true;
- },
- validType : function(type) {
- if (!(com_ibm_rave_library_property_PropertyUtil.propertyTypes.hasOwnProperty(type))) {
- com_ibm_rave_library_Library.logError(23, "PropertySet.populate");
- return false;
- }
- return true;
- },
- propertyEntry : function(propertyJSON, propertyId) {
- var propertyEntry = propertyJSON[propertyId];
- if (propertyEntry == null) {
- com_ibm_rave_library_Library.logError(24, "PropertySet.populate");
- return null;
- }
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONObject(propertyEntry))) {
- com_ibm_rave_library_Library.logError(25, "PropertySet.populate");
- return null;
- }
- return propertyEntry;
- },
- type : function(propertyJSON) {
- var type = propertyJSON["type"];
- if (type == null) {
- com_ibm_rave_library_Library.logError(26, "PropertySet.populate");
- return null;
- }
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isString(type))) {
- com_ibm_rave_library_Library.logError(27, "PropertySet.populate");
- return null;
- }
- var typeStr = ""+(type);
- if (!(this.validType(typeStr))) {
- return null;
- }
- return typeStr;
- }
- });
- com_ibm_rave_library_property_PropertyUtil.propertyTypes = {};
- com_ibm_rave_library_property_PropertyUtil.INSTANCE = new com_ibm_rave_library_property_PropertyUtil();
- // $source: com/ibm/rave/library/framework/meta/PropertyMeta
- /************************************************************************
- ** 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
- /**
- * Interface to meta data for a bundle Property.
- * @param < (java.lang.Object) E > The type of options this property accepts.
- */
- var com_ibm_rave_library_framework_meta_PropertyMeta = rave_library_externs["PropertyMeta"] = rave['internal']['Declare']({
- /**
- * The fully qualified id of the property (starting from its parent if any). When requesting a property, this is the field you query by.
- * @return (String) the Property ID.
- */
- /** @expose */
- id : function() {},
- /**
- * The simple (non-qualified) id of the property. This is how the property's parent refers to it. If the property has no parent, then this would be equivalent to its fully qualified id
- * @return (String) (non-qualified) property id
- */
- /** @expose */
- simpleId : function() {},
- /**
- * @return (String) the Property Name. This name is used as a label for some properties--for example, in labelled PropertyArrayTypes.
- */
- /** @expose */
- name : function() {},
- /**
- * @return (String) the Property Description
- */
- /** @expose */
- description : function() {},
- /**
- * @return (String) the Property Icon string, which is the URL of the icon file used in the property editor
- */
- /** @expose */
- icon : function() {},
- /**
- * Gets the parent's property if any
- * @return (com.ibm.rave.library.framework.meta.PropertyMeta) the parent property, or null if this is a top level property
- */
- /** @expose */
- parent : function() {},
- /**
- * @return (String) the property type as string
- */
- /** @expose */
- type : function() {},
- /**
- * @return (int) the property type as an integer
- */
- /** @expose */
- typeId : function() {},
- /**
- * Indicates if this property is required.
- * @return (boolean) true if it is required, false otherwise
- */
- /** @expose */
- required : function() {},
- /**
- * @return (Object) the default value of the property
- */
- /** @expose */
- defaultValue : function() {},
- /**
- * @param (Object) defaultValue the default value of the property
- */
- /** @expose */
- setDefaultValue : function(defaultValue) {},
- /**
- * @return (Array) list of property options.
- */
- /** @expose */
- options : function() {},
- /**
- * Validates if the passed object meets all the constraints imposed on this property
- * @param (Object) obj the value to validate
- * @return (boolean) true if the object is valid, false otherwise
- */
- /** @expose */
- validateValue : function(obj) {},
- /**
- * Does the change of property value require resetting the view? Resetting view means recalculating data and redrawing components. Some properties change the layout/scales, for instance, layout padding. Some properties involve no data change but need redrawing the components. For instance, background color.
- * @return (String) one of 3 values: data---need to recalculate data and redraw components layout---no data recalculation is required, but need to reset layout/scales and redraw components none----no data or layout/scales change, but redraw components to show style changes
- */
- /** @expose */
- resetView : function() {},
- /**
- * Performs a deep copy of this property meta. Changing anything on the copy will not affect this object.
- * @return (com.ibm.rave.library.framework.meta.PropertyMeta) a deep copy of this property meta.
- */
- /** @expose */
- copy : function(parent) {},
- /**
- * Get the tags from the property
- */
- /** @expose */
- tags : function() {}
- });
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.STRING = "string";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.BOOLEAN = "boolean";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.NUMERIC = "numeric";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.ENUM = "enum";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.FONT = "font";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.COLOR = "color";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.PALETTE = "palette";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.LENGTH = "length";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.PADDING = "padding";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.DASHARRAY = "dasharray";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.ARRAY = "array";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.OBJECT = "object";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.JSONOBJECT = "jsonobject";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.GEOJSON = "geojson";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.SHADOW = "shadow";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.UNKNOWN_TYPE = "UNKNOWN_TYPE";
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.STRING_ID = 10;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.NUMERIC_ID = 11;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.BOOLEAN_ID = 12;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.ENUM_ID = 13;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.FONT_ID = 14;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.COLOR_ID = 15;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.PALETTE_ID = 16;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.LENGTH_ID = 17;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.PADDING_ID = 18;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.DASHARRAY_ID = 19;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.ARRAY_ID = 20;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.OBJECT_ID = 21;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.JSONOBJECT_ID = 22;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.GEOJSON_ID = 23;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.SHADOW_ID = 24;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.NONE = -1;
- /** @expose */
- com_ibm_rave_library_framework_meta_PropertyMeta.UNKNOWN_TYPE_ID = -1;
- // $source: com/ibm/rave/library/property/EnumPropertyOption
- /************************************************************************
- ** 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 property option value for enum properties. The value of the property is the enum integer value, and the label is the uninternationalized enum label. If the label is ever internationalized (i.e. the label becomes a message ID), the only modification needed will be in the label() method, to look up the message ID in the messages. </p>
- */
- var com_ibm_rave_library_property_EnumPropertyOption = rave_library_externs["EnumPropertyOption"] = rave['internal']['Declare']({
- //_value : null,
- //_label : null,
- //_messages : null,
- /**
- * Construct.
- * @param (Number) value The value of the option
- * @param (String) label The label of the option
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages Messages map
- */
- /** @expose */
- constructor : function(value, label, messages) {
- this._value = value;
- this._label = label;
- this._messages = messages;
- },
- /** @expose */
- value : function() {
- return this._value;
- },
- /** @expose */
- id : function() {
- return this._value;
- },
- /** @expose */
- label : function() {
- return this._label;
- }
- });
- // $source: com/ibm/rave/library/property/NumberPropertyOption
- /************************************************************************
- ** 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 property option value that is a number. The option is created with the numeric value as used in the code. The label is the number as a string; the messages map is not used. Example JSON: <code> "options": [ 0, 2.2, 10.0 ] </code>
- */
- var com_ibm_rave_library_property_NumberPropertyOption = rave_library_externs["NumberPropertyOption"] = rave['internal']['Declare']({
- //_value : null,
- /**
- * Construct.
- * @param (Number) value The property value as used in the code
- */
- /** @expose */
- constructor : function(value) {
- this._value = value;
- },
- /** @expose */
- value : function() {
- return this._value;
- },
- /** @expose */
- id : function() {
- return this._value;
- },
- /** @expose */
- label : function() {
- return ""+(this._value);
- }
- });
- // $source: com/ibm/rave/library/property/PalettePropertyOption
- /************************************************************************
- ** 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 string property option value for use in palette properties. The "options" in the palette property JSON is an array of palette types, but the options stored in the property itself are the palette IDs for those types. Palettes are not yet internationalized, so the option label is the palette's label and the messages are not used. They are included in the constructor so that the signature of this class is the same as StringPropertyOption, and if palette labels are ever internationalized this class can be replaced with the StringPropertyOption.
- */
- var com_ibm_rave_library_property_PalettePropertyOption = rave_library_externs["PalettePropertyOption"] = rave['internal']['Declare']({
- //_value : null,
- //_label : null,
- //_messages : null,
- /**
- * Construct.
- * @param (String) value The value of the option
- * @param (String) label The label of the option
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages Messages map, unused (but included so the constructor signature is that of StringPropertyOption)
- */
- /** @expose */
- constructor : function(value, label, messages) {
- this._value = value;
- this._label = label;
- this._messages = messages;
- },
- /** @expose */
- value : function() {
- return this._value;
- },
- /** @expose */
- id : function() {
- return this._value;
- },
- /** @expose */
- label : function() {
- return this._messages._nls(this._label, this._label);
- }
- });
- // $source: com/ibm/rave/library/property/StringPropertyOption
- /************************************************************************
- ** 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 property option value that is a string. The option is created with the string value as used in the code, and with a message ID and messages map. The label is the result of looking up the message ID in the messages, using the value as the alternate/default if the message ID is not found.
- */
- var com_ibm_rave_library_property_StringPropertyOption = rave_library_externs["StringPropertyOption"] = rave['internal']['Declare']({
- //_value : null,
- //_messageID : null,
- //_messages : null,
- /**
- * Construct.
- * @param (String) value The property value as used in the code
- * @param (String) messageID The message ID used to look up the property label
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages Messages map
- */
- /** @expose */
- constructor : function(value, messageID, messages) {
- this._value = value;
- this._messageID = messageID;
- this._messages = messages;
- },
- /** @expose */
- value : function() {
- return this._value;
- },
- /** @expose */
- label : function() {
- return this._messages._nls(this._messageID, this._value);
- },
- /** @expose */
- id : function() {
- return this.value();
- }
- });
- // $source: com/ibm/rave/library/framework/Bundle
- /************************************************************************
- ** 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/framework/meta/internal/GenericMetadataImpl (runtime) // new
- //@import com/ibm/rave/library/framework/meta/internal/PreviewsMetadataImpl (runtime) // new
- //@import com/ibm/rave/library/datamodel/internal/BundleDataModels (runtime) // new
- //@import com/ibm/rave/library/framework/meta/internal/BundleConfigurationManager (runtime) // new
- //@import com/ibm/rave/library/i18n/MessagesRegistry (runtime) // new
- //@import com/ibm/rave/library/internal/nativeImpl/LoaderNativeUtils (runtime) // getMessagesPath
- //@import com/ibm/rave/library/framework/internal/AbstractController (runtime) // new
- //@import com/ibm/rave/library/Library (runtime) // logError, _generateId, Library
- //@import com/ibm/rave/library/framework/internal/BundleContext (runtime) // new
- //@import com/ibm/rave/library/framework/meta/ActionMeta (runtime) // parse
- //@import com/ibm/rave/library/framework/meta/internal/PropertyPresentationMetaImpl (runtime) // new
- //@import com/ibm/rave/library/property/PropertyProcessor (runtime) // processProperties
- //@import com/ibm/rave/library/property/PropertySet (runtime) // merge
- //@import com/ibm/rave/library/i18n/Messages (runtime) // createFromCatalog
- //@import com/ibm/rave/library/framework/BundleInfo (runtime)
- /**
- * Access point for Bundle metadata and creation of visualization instances. <br /> Bundle meta data can be accessed through the {@link this.Bundle#this.info()} API. <br /> Bundle visualization instances can be created through {@link this.Bundle#this.create()} .
- */
- var com_ibm_rave_library_framework_Bundle = rave_library_externs["Bundle"] = rave['internal']['Declare']({
- /**
- * Metadata (using same class as in an instance)
- */
- //_metadata : null,
- //_previewsMeta : null,
- /**
- * Property metadata
- */
- //_properties : null,
- /**
- * Property presentations metadata
- */
- //_propertyPresentations : null,
- /**
- * Actions metadata
- */
- //_actions : null,
- /**
- * Data models metadata (using same class as in an instance)
- */
- //_dataModels : null,
- /**
- * Configurations available in the bundle
- */
- //_configurations : null,
- /**
- * Bundle information API (metadata, properties, actions, data models, configurations)
- */
- //_info : null,
- /**
- * Default localization messages
- */
- //_messages : null,
- //_locale : null,
- /**
- * Copy of the messages manifest for the bundle
- */
- /** @expose */
- _manifest : null,
- /**
- * Need to hang on to this for Swift.
- */
- //messageXhr : null,
- /**
- * Bundle version
- */
- _version : "0.0.0",
- /**
- * Bundle build
- */
- _build : "development",
- /**
- * Bundle Path -- used to load messages
- */
- _path : "development",
- constructor : function() {
- this._metadata = new com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl();
- this._previewsMeta = new com_ibm_rave_library_framework_meta_internal_PreviewsMetadataImpl();
- this._properties = [];
- this._propertyPresentations = [];
- this._actions = [];
- this._dataModels = new com_ibm_rave_library_datamodel_internal_BundleDataModels();
- this._configurations = new com_ibm_rave_library_framework_meta_internal_BundleConfigurationManager();
- this._messages = new com_ibm_rave_library_i18n_MessagesRegistry();
- this._locale = com_ibm_rave_library_framework_Bundle.DEFAULT_LOCALE;
- /**
- * Only used by subclasses.
- */
- {
- var self = this;
- this._info = new (rave['internal']['Declare']({
- meta : function() {
- return self._metadata;
- },
- properties : function() {
- return self._properties;
- },
- propertyPresentations : function() {
- return self._propertyPresentations;
- },
- actions : function() {
- return self._actions;
- },
- dataModels : function() {
- return self._dataModels.getDataModels();
- },
- getPreview$2 : function(format, tags) {
- return self._previewsMeta.getPreview(format, tags);
- },
- getPreviewTags : function() {
- return self._previewsMeta.getAllTags();
- },
- getPreviews$1 : function(format) {
- return self._previewsMeta.getPreviews(format);
- },
- getPreview$1 : function(format) {
- return self._previewsMeta.getPreview(format, null);
- },
- getPreview$0 : function() {
- return self._previewsMeta.getPreview("svg", null);
- },
- getPreviews$0 : function() {
- return self._previewsMeta.getPreviews("svg");
- },
- previews : function() {
- return self._previewsMeta;
- },
- getPreview : function(a0, a1) {
- var args = arguments;
- if (args.length == 0) {
- return this.getPreview$0();
- }
- if (args.length == 1) {
- return this.getPreview$1(a0);
- }
- return this.getPreview$2(a0, a1);
- },
- getPreviews : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.getPreviews$0();
- }
- return this.getPreviews$1(a0);
- }
- }))();
- this._configurations.setBundleInfo(this, this._info);
- }
- },
- /**
- * @return (com.ibm.rave.library.framework.BundleInfo) Access point to bundle meta data information.
- */
- /** @expose */
- info : function() {
- return this._info;
- },
- /**
- * @return (String) The version of this bundle.
- */
- /** @expose */
- version : function() {
- return this._version;
- },
- /**
- * @return (String) The build label of this bundle.
- */
- /** @expose */
- build : function() {
- return this._build;
- },
- /**
- * A bundle instance ( {@link (com.ibm.rave.library.framework.Controller) Controller} will always return a non-null but empty list.
- * @return (Array) List of all configurations this bundle provides.
- */
- /** @expose */
- configurations : function() {
- return this._configurations._configList;
- },
- /**
- * Create an instance of this bundle for rendering.
- * @return (com.ibm.rave.library.framework.Controller) A Controller interface to control the visualization.
- */
- create$0 : function() {
- return this.doCreate(null, true);
- },
- /**
- * Create an instance of this bundle for rendering, using the configuration with the given ID. If the ID is null no configuration is applied (it is the same as {@link #this.create()} ). If there is no configuration with the given ID an error is reported to the Library and null is returned.
- * @param (String) configID ID of the configuration
- * @return (com.ibm.rave.library.framework.Controller) A Controller interface to control the visualization.
- */
- create$1 : function(configID) {
- return this.doCreate(configID, true);
- },
- create$2 : function(configID, viewRequired) {
- return this.doCreate(configID, viewRequired);
- },
- /**
- * Returns the current default locale for the bundle. Any new bundle instances created will use this locale. <p> Defaults to 'en'.
- * @return (String) String representing the default locale for bundle.
- */
- locale$0 : function() {
- return this._locale;
- },
- /**
- * Sets the current default locale for the bundle. If never called, the locale defaults to 'en'.
- */
- locale$1 : function(locale) {
- this._locale = locale;
- },
- locale$2 : function(locale, url, userCallback) {
- var self = this;
- var path = com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.getMessagesPath(locale, url);
- if (self._messages.locale$0(locale)) {
- if (userCallback) {
- userCallback();
- }
- return;
- }
- self.messageXhr = rave.json(path, function(error, response) {
- if (!error) {
- self.setMessageCatalog(locale, (response));
- self._messages.locale(locale);
- if (userCallback) {
- userCallback();
- }
- }
- });
- },
- /**
- * This API is used to pass in configurations to the bundle. The bundle can use those configurations to tweak some settings including updating the properties dynamically prior to the bundle creation {@link #this.create()} . this method should be called and its callback function can be used to initialize the bundle etc. current expected properties for the configurations json "mapboxkey" : "your access token here" "mapboxaccountname" : "your account name here"
- * @param (Object) configurations A JSON object containing various settings for the bundle
- * @param (com.ibm.rave.library.framework.Controller.Callback) userCallback the function to be called after the configuration is completed
- */
- /** @expose */
- configure : function(configurations, userCallback) {
- if (configurations) {
- this._doConfigure(configurations, userCallback, this);
- } else if (userCallback) {
- userCallback();
- }
- },
- /**
- * This function will use the configurations object to setup a bundle based on the specific bundle implementation on this method by default this method does nothing and calls the passed in callback
- * @param (Object) configurations A JSON object containing required info that bundles may need
- * @param (com.ibm.rave.library.framework.Controller.Callback) userCallback the function to be called after the setup is completed
- */
- /** @expose */
- _doConfigure : function(configurations, userCallback, bundle) {
- if (userCallback) {
- userCallback();
- }
- },
- /**
- * Retrieve the String name for this bundle.
- */
- /** @expose */
- getName : function() {},
- /**
- * Create an instance of the View for this bundle.
- */
- /** @expose */
- createView : function(ctx) {},
- /**
- * A bundle author may override this method if a bundle requires its own controller implementation.
- * @param (String) bundleName String bundle identifier.
- * @param (com.ibm.rave.library.framework.internal.BundleContext) ctx The context instantiated from the Bundle metadata descriptions.
- * @param (com.ibm.rave.library.framework.internal.AbstractView) view A bundle view instance (see {@link this.Bundle#this.createView(com_ibm_rave_library_framework_internal_BundleContext)} ).
- * @return (com.ibm.rave.library.framework.internal.AbstractController) Visualization Controller instance.
- */
- /** @expose */
- createController : function(bundleName, ctx, view) {
- return new com_ibm_rave_library_framework_internal_AbstractController(bundleName, ctx, view);
- },
- /**
- * <p> Bundle instance creation. </p> <p> If the configuration ID is non-null and the requested configuration does not exist, an error is reported to the Library and null is returned. </p>
- * @param (String) configID ID of the configuration
- * @param messages The Messages catalog to assign to the visualization instance (this can be different from the messages currently assigned to this Bundle).
- * @return (com.ibm.rave.library.framework.Controller) Controller for the visualization instance.
- */
- doCreate : function(configID, viewRequired) {
- var instanceId = com_ibm_rave_library_Library._generateId();
- var ctx = this.createBundleContext(instanceId);
- if (configID != null) {
- var configuration = this._configurations.configuration(configID);
- if (!configuration) {
- com_ibm_rave_library_Library.logError(204, configID);
- return null;
- }
- var configJSON = configuration._json;
- (ctx._metadata).populate(configJSON);
- if (viewRequired) {
- ctx._metadata.configure(configJSON);
- }
- (ctx._previewsMeta).populate(configJSON);
- (ctx._metadata)._messages = this._messages;
- ctx.datamodels.configure(configJSON);
- ctx.properties.configure(configJSON);
- ctx.propertyPresentations.configure(configJSON);
- ctx.actions.configure(configJSON);
- this.validatePresentations(ctx);
- }
- var view = viewRequired ? this.createView(ctx) : null;
- return this.createController(this.getName(), ctx, view);
- },
- validatePresentations : function(ctx) {
- var presentations = ctx.propertyPresentations.meta();
- for (var __i_enFor0 = 0, __exp_enFor0 = presentations, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var p = __exp_enFor0[__i_enFor0];
- (p).validateProperties(ctx.properties);
- }
- },
- getMessageCatalog : function() {
- var catalog = this._messages.get(this._locale);
- if (!catalog) {
- catalog = this._messages.get(com_ibm_rave_library_framework_Bundle.DEFAULT_LOCALE);
- }
- return catalog;
- },
- createBundleContext : function(instanceId) {
- var ctx = new com_ibm_rave_library_framework_internal_BundleContext(instanceId, this._messages, this._dataModels.copy(), this._metadata.copy(), this._previewsMeta.copy());
- for (var __i_enFor0 = 0, __exp_enFor0 = this._propertyPresentations, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var property = __exp_enFor0[__i_enFor0];
- ctx.propertyPresentations.put((property).copy());
- }
- ctx.actions.populate$1(this._actions);
- ctx.properties.populate(this._properties);
- return ctx;
- },
- parseActions : function(list) {
- for (var i = 0; i < list.length; ++i) {
- var a = com_ibm_rave_library_framework_meta_ActionMeta.parse(list[i], this._messages);
- this._actions.push(a);
- }
- },
- parsePropertyPresentations : function(list) {
- for (var i = 0; i < list.length; ++i) {
- var PP = new com_ibm_rave_library_framework_meta_internal_PropertyPresentationMetaImpl(this._messages);
- this._propertyPresentations.push(PP.parse(list[i]));
- }
- },
- /**
- * Initialize this bundle using configuration information in a JSON object. See documentation for more details on valid property names and values.
- * @param (Object) config JSON object containing configuration information. See documentation for more details on valid property names and values.
- */
- /** @expose */
- initialize : function(config) {
- if (!config) {
- return;
- }
- this._metadata.populate(config);
- this._metadata._messages = this._messages;
- this._previewsMeta.populate(config);
- this._dataModels.populate(config, this._messages);
- var resourceObject = config["properties"];
- if (resourceObject) {
- var info = com_ibm_rave_library_property_PropertyProcessor.processProperties(resourceObject, this._messages, false);
- for (var __i_enFor0 = 0, __exp_enFor0 = info.properties, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var p = __exp_enFor0[__i_enFor0];
- this._properties.push(p);
- }
- }
- var resourceArray = config["propertyPresentations"];
- if (resourceArray) {
- this.parsePropertyPresentations(resourceArray);
- }
- resourceArray = config["actions"];
- if (resourceArray) {
- this.parseActions(resourceArray);
- }
- resourceArray = config["colorpalettes"];
- if (resourceArray) {
- com_ibm_rave_library_Library.palettes.addPalettes(resourceArray);
- }
- this._configurations.populate(config, this._messages);
- this._properties = com_ibm_rave_library_property_PropertySet.merge(this._properties);
- var version = ""+(config["version"]);
- if (version != null) {
- this._version = ""+(version);
- }
- var build = ""+(config["build"]);
- if (build != null) {
- this._build = ""+(build);
- }
- },
- /**
- * Populate this bundle with localized id->value key/value pairs of translated strings. All new instances of this bundle will inherit this set of translated strings. <p> 'en-us' is the default locale for all bundles.
- * @param (String) locale String representing the locale (ie 'en-us')
- * @param (Object) catalog JSONObject in the following format: <code>{ "id" : "Translated String", ... }</code>
- */
- /** @expose */
- setMessageCatalog : function(locale, catalog) {
- var message = com_ibm_rave_library_i18n_Messages.createFromCatalog(catalog, locale);
- this._messages.add(locale, message);
- },
- /** @expose */
- create : function(a0, a1) {
- var args = arguments;
- if (args.length == 0) {
- return this.create$0();
- }
- if (args.length == 1) {
- return this.create$1(a0);
- }
- return this.create$2(a0, a1);
- },
- /** @expose */
- locale : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 0) {
- return this.locale$0();
- }
- if (args.length == 1) {
- return this.locale$1(a0);
- }
- return this.locale$2(a0, a1, a2);
- }
- });
- /**
- * Default locale
- */
- /** @expose */
- com_ibm_rave_library_framework_Bundle.DEFAULT_LOCALE = "en";
- // $source: com/ibm/rave/library/framework/meta/internal/GenericMetadataImpl
- /************************************************************************
- ** 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> Implementation of GenericMetadata. An example of what a json file would look like for generic metadata: </p> <pre> { "genericMeta": { "id": "greatBundle", "label": "IDS_LABEL", "author": "Stephen D. Gibson", "createdOn": "2015-01-01", "version": 5, "description": "IDS_DESC", "tags": ["IDS_MAP", "IDS_RS"] } } </pre>
- */
- var com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl = rave['internal']['Declare']({
- /**
- * Map from key to value, does not include "tags"
- */
- //metadataInfo : null,
- /**
- * Tags, may include duplicates
- */
- //metadataTags : null,
- /**
- * Messages lookup required for internationalization
- */
- //_messages : null,
- constructor : function() {
- this.metadataInfo = rave['internal']['ES6Map'].create();
- this.metadataTags = [];
- },
- /** @expose */
- ids : function() {
- var keys = this.metadataInfo.keys();
- var keyArray = keys;
- for (var i = 0; i < keyArray.length; ++i) {
- keyArray[i] = this._messages._nls(keyArray[i], keyArray[i]);
- }
- return keyArray;
- },
- /** @expose */
- id : function(id) {
- var str = this.metadataInfo.get(id);
- if ("name" == id || "label" == id || "description" == id) {
- str = this._messages._nls(str, str);
- }
- return str;
- },
- /** @expose */
- tags : function() {
- var newTags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this.metadataTags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- newTags.push(this._messages._nls(tag, tag));
- }
- return newTags;
- },
- /**
- * Populate the metadata from the given object. If the object has a key "genericMeta", that is used to populate key-value pairs and tags; otherwise nothing is done.
- * @param (Object) o The object
- */
- populate : function(o) {
- this.process(o, true);
- },
- /**
- * Configure the metadata from the given object. This works exactly like populate, except that the "id" field cannot be changed. Any tags are appended to the existing array.
- * @param (Object) o The object
- */
- /** @expose */
- configure : function(o) {
- this.process(o, false);
- },
- /**
- * Set the message registry for displaying the meta data in the current locale.
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages - the MessagesRegistry
- */
- setMessages : function(messages) {
- this._messages = messages;
- },
- /**
- * Returns the message registry--needed for copying
- * @return (com.ibm.rave.library.i18n.MessagesRegistry) the MessagesRegistry
- */
- getMessages : function() {
- return this._messages;
- },
- /**
- * Do processing for populate and configure.
- * @param (Object) o JSON description of the meta
- * @param (boolean) isPopulate Whether this is for populate
- */
- process : function(o, isPopulate) {
- var genericMeta = o["genericMeta"];
- if (genericMeta) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(genericMeta), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var k = __exp_enFor0[__i_enFor0];
- var key = (k);
- if (key == "tags") {
- var tagsArray = genericMeta[key];
- if (tagsArray) {
- var l = tagsArray.length;
- for (var i = 0; i < l; ++i) {
- var tag = ""+(tagsArray[i]);
- if (!(this.metadataTags.indexOf(tag)> -1)) {
- this.metadataTags.push(tag);
- }
- }
- }
- } else {
- if (isPopulate || !("id" == key)) {
- var v = genericMeta[key];
- if (v != null) {
- this.metadataInfo.set(key, ""+(v));
- }
- }
- }
- }
- }
- },
- /**
- * Create a copy of this metadata. The collections (meta and tags) are deep-copied, so the copy's version can be modified without affecting the original.
- * @return (com.ibm.rave.library.framework.meta.internal.GenericMetadataImpl) Copy of the metadata
- */
- copy : function() {
- var c = new com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl();
- for (var __i_enFor0 = 0, __exp_enFor0 = this.metadataInfo.keys(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- c.metadataInfo.set(key, this.metadataInfo.get(key));
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = this.metadataTags, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var t = __exp_enFor1[__i_enFor1];
- c.metadataTags.push(t);
- }
- c._messages = this._messages;
- return c;
- }
- });
- //com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl.GENERIC_META = "genericMeta";
- //com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl.ID = "id";
- //com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl.NAME = "name";
- //com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl.LABEL = "label";
- //com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl.DESCRIPTION = "description";
- // $source: com/ibm/rave/library/framework/meta/internal/PreviewsMetadataImpl
- /************************************************************************
- ** 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/framework/meta/internal/PreviewMeta (runtime) // new
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * <p> An example of what a json file would look like for preview metadata: </p> <pre> "previews" : { "svg" : [ { "file": "resources/svgPreviewNoText.svg", "tags": [ "small", "notext" ] }, { "file": "resources/svgPreview.svg", "tags": [ "large", "text" ] } ], "image" : [ { "file": "resources/imageNoTextSmall.png", "tags": [ "small", "notext" ] }, { "file": "resources/imageLarge.png", "tags": [ "large", "text" ] } ] } </pre>
- */
- var com_ibm_rave_library_framework_meta_internal_PreviewsMetadataImpl = rave['internal']['Declare']({
- //svgPreview : null,
- //imgPreview : null,
- //allTags : null,
- constructor : function() {
- this.svgPreview = [];
- this.imgPreview = [];
- this.allTags = [];
- },
- populate : function(o) {
- this.svgPreview.length = 0;
- this.imgPreview.length = 0;
- var previews = o["previews"];
- if (previews) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(previews), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var k = __exp_enFor0[__i_enFor0];
- var key = (k);
- if (key == "svg") {
- var svgArray = previews[key];
- for (var __i_enFor1 = 0, __exp_enFor1 = svgArray, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var svg = __exp_enFor1[__i_enFor1];
- this.processPreview(svg, "svg");
- }
- } else {
- var imgArray = previews[key];
- for (var __i_enFor2 = 0, __exp_enFor2 = imgArray, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var img = __exp_enFor2[__i_enFor2];
- this.processPreview(img, "image");
- }
- }
- }
- }
- },
- processPreview : function(object, format) {
- var jsonObj = object;
- var file = ""+(jsonObj["file"]);
- var tagsArray = jsonObj["tags"];
- var tags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = tagsArray, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var t = __exp_enFor0[__i_enFor0];
- var tag = ""+(t);
- tags.push(tag);
- if (!(this.allTags.indexOf(tag)> -1)) {
- this.allTags.push(tag);
- }
- }
- if (format == "svg") {
- this.svgPreview.push(new com_ibm_rave_library_framework_meta_internal_PreviewMeta(file, tags, format));
- } else {
- this.imgPreview.push(new com_ibm_rave_library_framework_meta_internal_PreviewMeta(file, tags, format));
- }
- },
- /** @expose */
- configure : function(o) {
- this.populate(o);
- },
- /** @expose */
- getAllTags : function() {
- return this.allTags;
- },
- /** @expose */
- getPreviews : function(format) {
- var previews = format == "svg" ? this.svgPreview : this.imgPreview;
- var result = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = previews, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var view = __exp_enFor0[__i_enFor0];
- result.push(view.file());
- }
- return result;
- },
- /** @expose */
- getPreview : function(format, tags) {
- var previews;
- if (format == null || format == "svg") {
- previews = this.svgPreview;
- } else if (format == "image") {
- previews = this.imgPreview;
- }
- if (!previews) {
- com_ibm_rave_library_Library.logError(302);
- return null;
- }
- if (!tags) {
- return previews.length > 0 ? previews[0].file() : null;
- }
- var maxCount = -1;
- var result;
- for (var __i_enFor0 = 0, __exp_enFor0 = previews, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var meta = __exp_enFor0[__i_enFor0];
- var metaTags = meta.tags();
- var count = this.MatchTags(metaTags, tags);
- if (count > maxCount) {
- maxCount = count;
- result = meta;
- }
- }
- return !result ? null : result.file();
- },
- getSvgPreviewMeta : function() {
- var result = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this.svgPreview, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var view = __exp_enFor0[__i_enFor0];
- result.push(view);
- }
- return result;
- },
- MatchTags : function(available, expected) {
- var result = 0;
- for (var __i_enFor0 = 0, __exp_enFor0 = expected, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- if (available.indexOf(tag)> -1) {
- result++;
- }
- }
- return result;
- },
- copy : function() {
- var result = new com_ibm_rave_library_framework_meta_internal_PreviewsMetadataImpl();
- for (var __i_enFor0 = 0, __exp_enFor0 = this.allTags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var t = __exp_enFor0[__i_enFor0];
- result.allTags.push(t);
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = this.svgPreview, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var meta = __exp_enFor1[__i_enFor1];
- var m = meta.copy();
- result.svgPreview.push(m);
- }
- for (var __i_enFor2 = 0, __exp_enFor2 = this.imgPreview, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var meta = __exp_enFor2[__i_enFor2];
- var m = meta.copy();
- result.imgPreview.push(m);
- }
- return result;
- }
- });
- // $source: com/ibm/rave/library/framework/meta/internal/PreviewMeta
- /************************************************************************
- ** 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> Preview metadata stores information about the bundle. It consists of preview properties as well as an array of tags. </p>
- */
- var com_ibm_rave_library_framework_meta_internal_PreviewMeta = rave['internal']['Declare']({
- //_file : null,
- //_tags : null,
- //_format : null,
- constructor : function(file, tags, format) {
- this._file = file;
- this._tags = tags;
- this._format = format;
- },
- file : function() {
- return this._file;
- },
- tags : function() {
- return this._tags;
- },
- copy : function() {
- var tag = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this.tags(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var t = __exp_enFor0[__i_enFor0];
- tag.push(t);
- }
- var result = new com_ibm_rave_library_framework_meta_internal_PreviewMeta(this._file, tag, this._format);
- return result;
- }
- });
- // $source: com/ibm/rave/library/datamodel/internal/DataModelDescriptorImpl
- /************************************************************************
- ** 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/datamodel/internal/DataSetDescriptorImpl (runtime) // create
- /**
- * Implementation of the {@link DataModelDescriptor} . This is the only implementation of the interface used by VizLibrary.
- */
- var com_ibm_rave_library_datamodel_internal_DataModelDescriptorImpl = rave['internal']['Declare']({
- /**
- * The id, set in the constructor
- */
- //_id : null,
- /**
- * The label, set in the constructor
- */
- //_label : null,
- /**
- * The descriptor, set in the constructor
- */
- //_description : null,
- /**
- * The tags, set in the constructor; never null, empty array if no tags defined
- */
- //_tags : null,
- /**
- * The data sets, set in the constructor; never null, empty array if no sets defined
- */
- //_dataSets : null,
- /**
- * Map from set name to index
- */
- //_setIndexes : null,
- /**
- * Localization strings
- */
- //_messages : null,
- /**
- * Private constructor used by factory methods. The data sets array is allocated but empty.
- * @param (String) id The id
- * @param (String) label The label
- * @param (String) description The description
- * @param (Array) tags The array of tags
- */
- constructor : function(id, label, description, tags) {
- this._id = id;
- this._label = label;
- this._description = description;
- this._tags = tags;
- this._dataSets = [];
- this._setIndexes = {};
- },
- /**
- * Processes all data slot configurations from the configuration file, setting slots to be hidden and limiting their types if the model id matches this model and the set ids match any of the datasets for this model.
- * @param (Array) dataSlotConfigs The JSONArray of data slot configurations
- * @return (com.ibm.rave.library.datamodel.DataModelDescriptor) this DataModelDescriptor
- */
- configure : function(dataSlotConfigs) {
- for (var __i_enFor0 = 0, __exp_enFor0 = this._dataSets, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dataSet = __exp_enFor0[__i_enFor0];
- (dataSet).clearConfiguration();
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = dataSlotConfigs, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var configObj = __exp_enFor1[__i_enFor1];
- var config = configObj;
- if (this._id == config["dataModelId"]) {
- for (var __i_enFor2 = 0, __exp_enFor2 = this._dataSets, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var dataSet = __exp_enFor2[__i_enFor2];
- if (dataSet.id() == config["dataSetId"]) {
- (dataSet).configure(config);
- }
- }
- }
- }
- return this;
- },
- /**
- * Set the message registry for displaying the data in the current locale.
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages - the MessagesRegistry
- */
- setMessages : function(messages) {
- this._messages = messages;
- for (var __i_enFor0 = 0, __exp_enFor0 = this._dataSets, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var set = __exp_enFor0[__i_enFor0];
- (set).setMessages(messages);
- }
- },
- /** @expose */
- id : function() {
- return this._id;
- },
- /** @expose */
- label : function() {
- if (!this._messages) {
- return this._label;
- }
- return this._messages._nls(this._label, this._label);
- },
- /** @expose */
- description : function() {
- if (!this._messages) {
- return this._description;
- }
- return this._messages._nls(this._description, this._description);
- },
- /** @expose */
- tags : function() {
- if (!this._messages) {
- return this._tags;
- }
- var msgTags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this._tags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- msgTags.push(this._messages._nls(tag, tag));
- }
- return msgTags;
- },
- /** @expose */
- dataSets : function() {
- return this._dataSets;
- },
- copy : function() {
- var descriptor = new com_ibm_rave_library_datamodel_internal_DataModelDescriptorImpl(this._id, this._label, this._description, this._tags);
- var ct = 0;
- for (var __i_enFor0 = 0, __exp_enFor0 = this._dataSets, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var desc = __exp_enFor0[__i_enFor0];
- descriptor._dataSets.push(desc.copy());
- descriptor._setIndexes[desc.id()] = ct++;
- }
- descriptor.setMessages(this._messages);
- return descriptor;
- },
- /**
- * @param (String) dataSetId A set identifier
- * @return (Number) Index of that set in the descriptor array, or -1 if not defined
- */
- dataSetIndex : function(dataSetId) {
- return this._setIndexes[dataSetId];
- }
- });
- /**
- * Create the data model description from the JSON, which conforms to the schema for data models. This code assumes that the JSON has been checked against that schema and is valid (all required fields present, no illegal types or enum values, etc.).
- * @param (Object) json Description of data model
- */
- com_ibm_rave_library_datamodel_internal_DataModelDescriptorImpl.create = function(json) {
- var id = (json["id"]);
- var label = (json["label"]);
- var description = (json["description"]);
- var tags = [];
- var a = json["tags"];
- if (a) {
- var l = a.length;
- for (var i = 0; i < l; ++i) {
- tags.push(""+(a[i]));
- }
- }
- var dmd = new com_ibm_rave_library_datamodel_internal_DataModelDescriptorImpl(id, label, description, tags);
- a = json["datasets"];
- if (a) {
- var l = a.length;
- for (var i = 0; i < l; ++i) {
- var set = com_ibm_rave_library_datamodel_internal_DataSetDescriptorImpl.create(a[i]);
- dmd._dataSets.push(set);
- dmd._setIndexes[set._id] = i;
- }
- }
- return dmd;
- };
- // $source: com/ibm/rave/library/datamodel/DataSetDescriptor
- /************************************************************************
- ** 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> Metadata describing a data set within a {@link (com.ibm.rave.library.datamodel.DataModelDescriptor) DataModelDescriptor} . The data set represents a collection of related data. The data set properties include the id, label, description, icon, tags, type, cardinality, and data slots (see {@link (com.ibm.rave.library.datamodel.DataSlotDescriptor) DataSlotDescriptor} ). </p> <p> The type indicates what type of data is expected to be bound to this data set using {@link (com.ibm.rave.library.datamodel.DataModel) DataModel} . The data type is not checked when data is bound, but if the wrong type of data is bound an error will be raised when the chart is run. The supported types are integer constants in this file. </p>
- */
- var com_ibm_rave_library_datamodel_DataSetDescriptor = rave_library_externs["DataSetDescriptor"] = rave['internal']['Declare']({
- /**
- * The id is neither translatable nor intended for display to users. It identifies the data set within a model and is unique within the model. The id will never be null (it is a required property of the schema).
- * @return (String) Data set id
- */
- /** @expose */
- id : function() {},
- /**
- * The label is a translatable string that names or labels the data set, for display to end-users. The label may be null.
- * @return (String) Data set label
- */
- /** @expose */
- label : function() {},
- /**
- * The description is a translatable string with a brief description of the data set, for display to end-users. The description may be null.
- * @return (String) Data set description
- */
- /** @expose */
- description : function() {},
- /**
- * The tags are an array of strings that give various categories or classifiers for the data set, for display to the end-users. If the data set has no tags, an empty array is returned. Do not modify the array or its contents.
- * @return (Array) Data set tags
- */
- /** @expose */
- tags : function() {},
- /**
- * The icon is a reference to resources. TODO: What is the object type, and how would it be used by authors or integrators?
- * @return (Object) Data set icon.
- */
- /** @expose */
- icon : function() {},
- /**
- * The cardinality is one of {@link this.DataSetDescriptor#"0..1"} or {@link this.DataSetDescriptor#"1"} and defines whether data must be bound to the data set. This is a required property of the schema and there is no default value.
- * @return (String) Data set cardinality
- */
- /** @expose */
- cardinality : function() {},
- /**
- * The type is one of {@link this.DataSetDescriptor#"tabular"} or {@link this.DataSetDescriptor#"hierarchy"} , with other types to be implemented. This is a required property of the schema and there is no default value.
- * @return (String) Data set type
- */
- /** @expose */
- type : function() {},
- /**
- * Perform a true deep copy of this descriptor, creating and copying the contents to the new one.
- * @return (com.ibm.rave.library.datamodel.DataSetDescriptor) A copy of this DataSetDescriptor
- */
- /** @expose */
- copy : function() {},
- /**
- * The data slots are the data items of the data set. If the data set has no slots, an empty array is returned. Do not modify the array or its contents.
- * @return (Array) Data set data slots
- */
- /** @expose */
- dataSlots : function() {}
- });
- /**
- * Data set cardinality 0..1. The set takes 0 or 1 value, so is optional and does not have to be set in order to use the model.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSetDescriptor.OPTIONAL = "0..1";
- /**
- * Data slot cardinality 1. The slot takes 1 value, so is required and must be set in order to use the model.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSetDescriptor.REQUIRED = "1";
- /**
- * Data set type tabular. The Object bound to the data set with {@link this.DataModel#this.setData(String, Object)} must be an array of objects. Data slots in the data set are accessors to the objects in that array.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSetDescriptor.TABULAR = "tabular";
- /**
- * Data set type hierarchy. The Object bound to the data set with {@link this.DataModel#this.setData(String, Object)} is a hierarchical structure. The use of data slots in this type of data set is being developed.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSetDescriptor.HIERARCHY = "hierarchy";
- // $source: com/ibm/rave/library/datamodel/DataSlotDescriptor
- /************************************************************************
- ** 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> Metadata describing a data slot within a {@link (com.ibm.rave.library.datamodel.DataSetDescriptor) DataSetDescriptor} . The data slot properties include the id, label, description, icon, tags, permitted data types, and cardinality. </p> <p> The data types and cardinality are integer constants defined in this class, and determine the types and number of accessors which may be bound to the slot. </p>
- */
- var com_ibm_rave_library_datamodel_DataSlotDescriptor = rave_library_externs["DataSlotDescriptor"] = rave['internal']['Declare']({
- /**
- * The id is neither translatable nor intended for display to users. It identifies the data slot within a data set and is unique within the data set. The id is never null (it is a required property in the schema).
- * @return (String) Slot id
- */
- /** @expose */
- id : function() {},
- /**
- * The label is a translatable string that names or labels the data slot, for display to end-users. The label may be null.
- * @return (String) Slot label
- */
- /** @expose */
- label : function() {},
- /**
- * The description is a translatable string with a brief description of the data slot, for display to end-users. The description may be null.
- * @return (String) Slot description
- */
- /** @expose */
- description : function() {},
- /**
- * The tags are an array of strings that give various categories or classifiers for the data slot, for display to the end-users. If the slot has no tags, an empty array is returned. Do not modify the array or its contents.
- * @return (Array) Slot tags
- */
- /** @expose */
- tags : function() {},
- /**
- * The icon is a reference to resources. TODO: What is the object type, and how would it be used by authors or integrators?
- * @return (String) Slot icon.
- */
- /** @expose */
- icon : function(type) {},
- /**
- * The cardinality is one of {@link this.DataSlotDescriptor#"0..1"} , {@link this.DataSlotDescriptor#"1"} , {@link this.DataSlotDescriptor#"0..n"} , or {@link this.DataSlotDescriptor#"1..n"} and defines how many data values may/must be set in the data slot. This is a required property of the schema and there is no default value.
- * @return (String) Slot cardinality
- */
- /** @expose */
- cardinality : function() {},
- /**
- * Check if the slot is required, with cardinality {@link this.DataSlotDescriptor#"1"} or {@link this.DataSlotDescriptor#"1..n"}
- * @return (boolean) Whether the slot has required cardinality
- */
- /** @expose */
- isRequired : function() {},
- /**
- * Check if the slot allows multiple values, with cardinality {@link this.DataSlotDescriptor#"0..n"} or {@link this.DataSlotDescriptor#"1..n"}
- * @return (boolean) Whether the slot has multiple cardinality
- */
- /** @expose */
- isMultiple : function() {},
- /**
- * Check if the slot is hidden by the configuration. If so, it will be null and have no accessor.
- * @return (boolean) Whether the slot has multiple cardinality
- */
- /** @expose */
- isHidden : function() {},
- /**
- * The data types are {@link this.DataSlotDescriptor#"numeric"} , {@link this.DataSlotDescriptor#"string"} , {@link this.DataSlotDescriptor#"date"} , {@link this.DataSlotDescriptor#"object"} , and {@link this.DataSlotDescriptor#"array"} . The data slot can be set to any of the types in the array. Setting it to any other type will raise an error. This is a required property of the schema and must have at least one item, so the returned array will never be empty. Do not modify the array or its contents.
- * @return (Array) Allowed data types
- */
- /** @expose */
- dataTypes : function() {},
- /**
- * Create a new DataSlot and perform a deep copy into it
- * @return (com.ibm.rave.library.datamodel.DataSlotDescriptor) A copy of this DataSlotDescriptor
- */
- /** @expose */
- copy : function() {}
- });
- /**
- * Data slot cardinality 0..1. The slot takes 0 or 1 value, so is optional and does not have to be set in order to use the model.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.OPTIONAL = "0..1";
- /**
- * Data slot cardinality 1. The slot takes 1 value, so is required and must be set in order to use the model.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.REQUIRED = "1";
- /**
- * Data slot cardinality 0..n. The slot takes any number of values, and does not have to be set in order to use the model.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.MULTIPLE = "0..n";
- /**
- * Data slot cardinality 1..n. The slot takes any number of values, and must be set in order to use the model.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.MULTIPLE_REQUIRED = "1..n";
- /**
- * Data slot type numeric. The slot accessor returns a numeric value (Java Number) and nulls are allowed.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.NUMERIC = "numeric";
- /**
- * Data slot type string. The slot accessor returns a string value (Java String) and nulls are allowed.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.STRING = "string";
- /**
- * Data slot type date. The slot accessor returns a date value (Java {@link IDate} ) and nulls are allowed.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.DATE = "date";
- /**
- * Data slot type object. The slot accessor returns an object value (Java Object) and nulls are allowed. Requirements for the object are documented by the bundle.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.OBJECT = "object";
- /**
- * Data slot type array. The slot accessor returns an array value (Java List or ArrayEx) and nulls are allowed. Requirements for the array elements are documented by the bundle.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.ARRAY = "array";
- /**
- * Data slot type array. The slot accessor returns an array value (Java List or ArrayEx) and nulls are allowed. Requirements for the array elements are documented by the bundle.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.IMAGE = "image";
- /**
- * Data slot type array. The slot accessor returns an array value (Java List or ArrayEx) and nulls are allowed. Requirements for the array elements are documented by the bundle.
- */
- /** @expose */
- com_ibm_rave_library_datamodel_DataSlotDescriptor.SVG = "svg";
- // $source: com/ibm/rave/library/datamodel/internal/DataModelImpl
- /************************************************************************
- ** 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/datamodel/internal/DataSetImpl (runtime) // new
- //@import com/ibm/rave/library/Library (runtime) // error
- //@import com/ibm/rave/library/service/LibraryError (runtime) // create
- /**
- * <p> Implementation of the data model API. Instances are created by the Controller when an integrator or author requests a data model. The model is constructed with a {@link DataModelDescriptor} which defines the data sets and data slots of the model. </p> <p> In addition to the public API methods, the model has a data-changed flag which is set true when any of the data sets, slots, or entries change. I {@link #this.dataUpdated()} returns the value, and {@link #this.dataUpdated()} can be used to clear it.
- */
- var com_ibm_rave_library_datamodel_internal_DataModelImpl = rave['internal']['Declare']({
- /**
- * The data descriptor of the model.
- */
- //_descriptor : null,
- /**
- * The data sets of the model
- */
- //_dataSets : null,
- /**
- * Whether the data has been changed
- */
- _dataChanged : false,
- /**
- * <p> Construct the model from a descriptor. </p>
- * @param (com.ibm.rave.library.datamodel.DataModelDescriptor) descriptor Descriptor, may not be null
- */
- constructor : function(descriptor) {
- this._descriptor = descriptor;
- this._dataChanged = false;
- this._dataSets = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = descriptor.dataSets(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dsd = __exp_enFor0[__i_enFor0];
- this._dataSets.push(new com_ibm_rave_library_datamodel_internal_DataSetImpl(dsd, this));
- }
- },
- /** @expose */
- error : function(error) {
- com_ibm_rave_library_Library.error(error);
- },
- /** @expose */
- getDescriptor : function() {
- return this._descriptor;
- },
- /** @expose */
- dataset : function(dataSetId) {
- var ix = this._descriptor.dataSetIndex(dataSetId);
- if (ix == null) {
- this.error(com_ibm_rave_library_service_LibraryError.create(106, this._descriptor._id + "." + dataSetId));
- return null;
- }
- return this._dataSets[ix];
- },
- /** @expose */
- datasets : function() {
- return this._dataSets;
- },
- /** @expose */
- validate : function() {
- var OK = true;
- for (var __i_enFor0 = 0, __exp_enFor0 = this._dataSets, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var ds = __exp_enFor0[__i_enFor0];
- if (!((ds).validate())) {
- OK = false;
- }
- }
- return OK;
- },
- /** @expose */
- dataslot : function(dataSetId, dataSlotId) {
- var dataSet = this.dataset(dataSetId);
- return dataSet ? dataSet.slot(dataSlotId) : null;
- },
- /** @expose */
- setData : function(dataSetId, data) {
- var dataSet = this.dataset(dataSetId);
- if (dataSet) {
- dataSet.data(data);
- return true;
- }
- return false;
- },
- /** @expose */
- clearData : function(dataSetId) {
- var dataSet = this.dataset(dataSetId);
- if (dataSet) {
- dataSet.clear();
- return true;
- }
- return false;
- },
- /** @expose */
- getData : function(dataSetId) {
- var dataSet = this.dataset(dataSetId);
- return dataSet ? dataSet.data() : null;
- },
- setDataSlot$0 : function(dataSetId, dataSlotId, type, accessor, domain) {
- var slot = this.dataslot(dataSetId, dataSlotId);
- if (!slot) {
- return -1;
- }
- var entry = slot.push().type$1(type).accessor$1(accessor).domain$1(domain);
- if (!(entry.isValid())) {
- return -1;
- }
- return slot.size() - 1;
- },
- setDataSlot$1 : function(dataSetId, dataSlotId, type, accessor) {
- return this.setDataSlot$0(dataSetId, dataSlotId, type, accessor, null);
- },
- /** @expose */
- clearDataSlot : function(dataSetId, dataSlotId) {
- var slot = this.dataslot(dataSetId, dataSlotId);
- if (slot) {
- slot.clear();
- return true;
- }
- return false;
- },
- /** @expose */
- getDataSlotValue : function(dataSetId, dataSlotId) {
- var slot = this.dataslot(dataSetId, dataSlotId);
- return slot ? slot.entry() : null;
- },
- /** @expose */
- getDataSlotValues : function(dataSetId, dataSlotId) {
- var slot = this.dataslot(dataSetId, dataSlotId);
- return slot ? slot.entries() : null;
- },
- /**
- * Record that the data has changed. This is called by the data sets, slots, and entries belonging to the model.
- */
- dataModelDataChanged : function() {
- this._dataChanged = true;
- },
- /**
- * @return (boolean) The value of the data-changed flag
- */
- dataUpdated$0 : function() {
- return this._dataChanged;
- },
- /**
- * @param (boolean) b The new value of the data-changed flag
- */
- dataUpdated$1 : function(b) {
- this._dataChanged = b;
- },
- /** @expose */
- setDataSlot : function(a0, a1, a2, a3, a4) {
- var args = arguments;
- if (args.length == 4) {
- return this.setDataSlot$1(a0, a1, a2, a3);
- }
- return this.setDataSlot$0(a0, a1, a2, a3, a4);
- },
- dataUpdated : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.dataUpdated$0();
- }
- return this.dataUpdated$1(a0);
- }
- });
- // $source: com/ibm/rave/library/datamodel/internal/DataSetImpl
- /************************************************************************
- ** 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/datamodel/internal/DataSlotImpl (runtime) // new
- //@import com/ibm/rave/library/service/LibraryError (runtime) // create
- /**
- * Internal implementation of the {@link (com.ibm.rave.library.datamodel.DataSet) DataSet} API.
- */
- var com_ibm_rave_library_datamodel_internal_DataSetImpl = rave['internal']['Declare']({
- /**
- * The data model containing this entry
- */
- //_dataModel : null,
- /**
- * The descriptor
- */
- //_descriptor : null,
- /**
- * The array of data slots
- */
- //_slots : null,
- /**
- * The data set location "modelId.dataSetId" used for error reporting
- */
- //_errorLocation : null,
- /**
- * The data
- */
- //_data : null,
- /**
- * Construct a data set. No arguments may be null.
- * @param (com.ibm.rave.library.datamodel.DataSetDescriptor) descriptor Descriptor for the data set
- * @param (com.ibm.rave.library.datamodel.internal.DataModelImpl) dataModel Data model containing this data set
- */
- constructor : function(descriptor, dataModel) {
- this._dataModel = dataModel;
- this._descriptor = descriptor;
- this._slots = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = descriptor.dataSlots(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var slotDescriptor = __exp_enFor0[__i_enFor0];
- this._slots.push(new com_ibm_rave_library_datamodel_internal_DataSlotImpl(slotDescriptor, this._dataModel, this));
- }
- this._errorLocation = (this._dataModel ? this._dataModel._descriptor.id() : "null") + "." + this._descriptor._id;
- },
- /** @expose */
- descriptor : function() {
- return this._descriptor;
- },
- /** @expose */
- slot : function(dataSlotId) {
- var ix = this._descriptor.dataSlotIndex(dataSlotId);
- if (ix == null) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(107, this._errorLocation + "." + dataSlotId));
- return null;
- }
- return this._slots[ix];
- },
- /** @expose */
- slots : function() {
- return this._slots;
- },
- data$0 : function() {
- return this._data;
- },
- data$1 : function(data) {
- if (data != null) {
- this._data = data;
- this._dataModel.dataModelDataChanged();
- }
- return this;
- },
- /** @expose */
- clear : function() {
- this._data = null;
- this._dataModel.dataModelDataChanged();
- return this;
- },
- /**
- * Validate the data set. If it is required and does not have data, an error is reported. Each data slot is also validated.
- * @return (boolean) True if the data set and all slots are valid, false otherwise
- */
- validate : function() {
- var OK = true;
- if ("1" == this._descriptor._cardinality && this._data == null) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(109, this._errorLocation));
- OK = false;
- }
- for (var __i_enFor0 = 0, __exp_enFor0 = this._slots, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var ds = __exp_enFor0[__i_enFor0];
- if (!((ds).validate())) {
- OK = false;
- }
- }
- return OK;
- },
- /** @expose */
- data : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.data$0();
- }
- return this.data$1(a0);
- }
- });
- // $source: com/ibm/rave/library/datamodel/internal/DataSlotImpl
- /************************************************************************
- ** 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/datamodel/internal/DataSlotEntryImpl (runtime) // new
- //@import com/ibm/rave/library/service/LibraryError (runtime) // create
- /**
- * Implementation of the {@link DataSlot} API.
- */
- var com_ibm_rave_library_datamodel_internal_DataSlotImpl = rave['internal']['Declare']({
- /**
- * The data model containing this entry
- */
- //_dataModel : null,
- /**
- * The data set containing this entry
- */
- //_dataSet : null,
- /**
- * The descriptor
- */
- //_descriptor : null,
- /**
- * The array of entries
- */
- //_entries : null,
- /**
- * The data slot location "modelId.dataSetId.dataSlotId" used for error reporting
- */
- //_errorLocation : null,
- /**
- * Override label for data slot (used when meta label from descriptor is not useful)
- */
- //_overrideLabel : null,
- /**
- * Construct a data slot. No arguments may be null.
- * @param (com.ibm.rave.library.datamodel.DataSlotDescriptor) descriptor Descriptor for the data slot
- * @param (com.ibm.rave.library.datamodel.internal.DataModelImpl) dataModel Data model containing this slot
- * @param (com.ibm.rave.library.datamodel.internal.DataSetImpl) dataSet Data set containing this slot
- */
- constructor : function(descriptor, dataModel, dataSet) {
- this._descriptor = descriptor;
- this._dataModel = dataModel;
- this._dataSet = dataSet;
- this._entries = [];
- this._errorLocation = (this._dataModel ? this._dataModel._descriptor.id() : "null") + "." + (this._dataSet ? this._dataSet.descriptor().id() : "null") + "." + this._descriptor._id;
- if ((descriptor).isRequired()) {
- var defaultType = descriptor.dataTypes()[0];
- this._entries.push(new com_ibm_rave_library_datamodel_internal_DataSlotEntryImpl(this._descriptor, this._dataModel, this._dataSet, this, 0).type$1(defaultType).accessor$1(com_ibm_rave_library_datamodel_internal_DataSlotImpl.makeDefaultAccessor(descriptor.id(), defaultType)));
- }
- },
- overrideLabel$0 : function(label) {
- this._overrideLabel = label;
- },
- overrideLabel$1 : function() {
- return this._overrideLabel;
- },
- /** @expose */
- descriptor : function() {
- return this._descriptor;
- },
- /** @expose */
- push : function() {
- if (!(this._descriptor.isMultiple())) {
- this.clear();
- }
- var e = new com_ibm_rave_library_datamodel_internal_DataSlotEntryImpl(this._descriptor, this._dataModel, this._dataSet, this, this._entries.length);
- if (!(this._descriptor._hidden)) {
- this._entries.push(e);
- this._dataModel.dataModelDataChanged();
- }
- return e;
- },
- /** @expose */
- size : function() {
- return this._entries.length;
- },
- /** @expose */
- entries : function() {
- return this._entries;
- },
- entry$0 : function() {
- return this._entries.length > 0 ? this._entries[0] : null;
- },
- entry$1 : function(index) {
- return this._entries.length > index ? this._entries[index] : null;
- },
- /** @expose */
- clear : function() {
- this._entries.length = 0;
- this._dataModel.dataModelDataChanged();
- return this;
- },
- /**
- * Validate the data slot. If it is required and does not have entries, an error is reported. Each data entry is also validated.
- * @return (boolean) True if the data slot and all entries are valid, false otherwise
- */
- validate : function() {
- var OK = true;
- if (this._descriptor.isRequired() && this._entries.length == 0) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(110, this._errorLocation));
- OK = false;
- }
- for (var __i_enFor0 = 0, __exp_enFor0 = this._entries, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var entry = __exp_enFor0[__i_enFor0];
- if (!((entry).validate())) {
- OK = false;
- }
- }
- return OK;
- },
- /** @expose */
- overrideLabel : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.overrideLabel$1();
- }
- return this.overrideLabel$0(a0);
- },
- /** @expose */
- entry : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.entry$0();
- }
- return this.entry$1(a0);
- }
- });
- com_ibm_rave_library_datamodel_internal_DataSlotImpl.makeDefaultAccessor = function(dataslotId, type) {
- if ("numeric" == type) {
- return function(data) {
- if (data == null) {
- return null;
- }
- var v = (data)[dataslotId];
- return v == null ? null : + (v);
- };
- }
- if ("string" == type) {
- return function(data) {
- if (data == null) {
- return null;
- }
- var v = (data)[dataslotId];
- return v == null ? null : ""+(v);
- };
- }
- if ("date" == type) {
- return function(data) {
- if (data == null) {
- return null;
- }
- var v = (data)[dataslotId];
- return v == null ? null : new Date(v);
- };
- }
- return function(data) {
- return data == null ? null : (data)[dataslotId];
- };
- };
- // $source: com/ibm/rave/library/datamodel/internal/DataSlotEntryImpl
- /************************************************************************
- ** 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/library/service/LibraryError (runtime) // create
- /**
- * <p> Implementation of the {@link DataSlotEntry} API. </p> <p> In order to keep the original data model API while still allowing chained setters, the entry has a flag that is set when an invalid value is provided to a setter. </p>
- */
- var com_ibm_rave_library_datamodel_internal_DataSlotEntryImpl = rave['internal']['Declare']({
- /**
- * The data model containing this entry
- */
- //_dataModel : null,
- /**
- * The data set containing this entry
- */
- //_dataSet : null,
- /**
- * The data slot containing this entry
- */
- //_dataSlot : null,
- /**
- * The descriptor for the slot containing this entry
- */
- //_descriptor : null,
- /**
- * The data slot location "modelId.dataSetId.dataSlotId[entryIndex]".
- */
- //_qualifiedId : null,
- /**
- * The type
- */
- //_type : null,
- /**
- * The accessor function
- */
- //_accessor : null,
- /**
- * The domain
- */
- //_domain : null,
- /**
- * The sub domain division, 10 ^ _subDomainMagnitude
- */
- //_subDomainMagnitude : null,
- /**
- * The label
- */
- //_label : null,
- /**
- * The unit
- */
- //_unit : null,
- /**
- * The position index of this data slot entry within it's parent data slot.
- */
- _dataSlotIndex : 0,
- /**
- * Set true when a bad value is provided to a setter
- */
- _badValue : false,
- _$functionClassMethod : function() {
- var _$self = function(data) {
- return _$self._accessor ? _$self._accessor(data) : null;
- };
- return _$self;
- },
- /**
- * Construct; the type, accessor, and domain are undefined.
- * @param (com.ibm.rave.library.datamodel.internal.DataSlotDescriptorImpl) descriptor Descriptor of the slot
- * @param (com.ibm.rave.library.datamodel.internal.DataModelImpl) dataModel Data model containing this entry
- * @param (com.ibm.rave.library.datamodel.internal.DataSetImpl) dataSet Data set containing this entry
- * @param (com.ibm.rave.library.datamodel.internal.DataSlotImpl) dataSlot Data slot containing this entry
- * @param (int) index The position index of this entry in its parent data slot.
- */
- constructor : function(descriptor, dataModel, dataSet, dataSlot, index) {
- this._dataModel = dataModel;
- this._dataSet = dataSet;
- this._dataSlot = dataSlot;
- this._dataSlotIndex = index;
- this._descriptor = descriptor;
- this._qualifiedId = (this._dataModel ? this._dataModel._descriptor.id() : "null") + "." + (this._dataSet ? this._dataSet.descriptor().id() : "null") + "." + (this._dataSlot ? this._dataSlot._descriptor.id() : "null") + "[" + this._dataSlotIndex + "]";
- this._type = null;
- this._accessor = null;
- this._domain = null;
- this._label = null;
- this._unit = null;
- this._badValue = false;
- this._subDomainMagnitude = null;
- },
- /** @expose */
- dataModel : function() {
- return this._dataModel;
- },
- /** @expose */
- dataSet : function() {
- return this._dataSet;
- },
- /** @expose */
- dataSlot : function() {
- return this._dataSlot;
- },
- type$0 : function() {
- return this._type;
- },
- type$1 : function(type) {
- if (type == null) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(111, this._qualifiedId));
- this._badValue = true;
- } else if (!(this._descriptor.isValidType(type))) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(108, this._qualifiedId));
- this._badValue = true;
- } else {
- this._type = type;
- this._dataModel.dataModelDataChanged();
- }
- return this;
- },
- accessor$0 : function() {
- return this._accessor;
- },
- accessor$1 : function(accessor) {
- if (!accessor) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(111, this._qualifiedId));
- this._badValue = true;
- } else {
- this._accessor = accessor;
- this._dataModel.dataModelDataChanged();
- }
- return this;
- },
- domain$0 : function() {
- return this._domain;
- },
- /** @expose */
- subDomainDivision : function() {
- return this._subDomainMagnitude;
- },
- domain$1 : function(domain) {
- if (domain && domain.length == 0) {
- this._domain = null;
- } else {
- this._domain = domain;
- }
- this._dataModel.dataModelDataChanged();
- return this;
- },
- domain$2 : function(domain, subDomainDivision) {
- if (domain && domain.length == 0) {
- this._domain = null;
- } else {
- this._domain = domain;
- }
- this._subDomainMagnitude = subDomainDivision;
- this._dataModel.dataModelDataChanged();
- return this;
- },
- label$0 : function() {
- return this._label;
- },
- label$1 : function(label) {
- this._label = label;
- this._dataModel.dataModelDataChanged();
- return this;
- },
- unit$0 : function() {
- return this._unit;
- },
- unit$1 : function(unit) {
- this._unit = unit;
- this._dataModel.dataModelDataChanged();
- return this;
- },
- /** @expose */
- isValid : function() {
- var b = !this._badValue;
- this._badValue = false;
- return b;
- },
- /** @expose */
- qualifiedId : function() {
- return this._qualifiedId;
- },
- /**
- * Validate the data slot. If the required type or accessor is null, an error is reported. If the type is not valid for the slot, an error is reported.
- * @return (boolean) True if the entry is valid
- */
- validate : function() {
- if (this._type == null || !this._accessor) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(111, this._qualifiedId));
- return false;
- }
- if (!(this._descriptor.isValidType(this._type))) {
- this._dataModel.error(com_ibm_rave_library_service_LibraryError.create(108, this._qualifiedId));
- return false;
- }
- return true;
- },
- /** @expose */
- type : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.type$0();
- }
- return this.type$1(a0);
- },
- /** @expose */
- accessor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.accessor$0();
- }
- return this.accessor$1(a0);
- },
- /** @expose */
- domain : function(a0, a1) {
- var args = arguments;
- if (args.length == 0) {
- return this.domain$0();
- }
- if (args.length == 1) {
- return this.domain$1(a0);
- }
- return this.domain$2(a0, a1);
- },
- /** @expose */
- label : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.label$0();
- }
- return this.label$1(a0);
- },
- /** @expose */
- unit : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.unit$0();
- }
- return this.unit$1(a0);
- }
- });
- // $source: com/ibm/rave/library/framework/meta/internal/BundleConfigurationManager
- /************************************************************************
- ** 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/framework/meta/internal/BundleConfigurationImpl (runtime) // new
- /**
- * Stores the ConfigurationImpl objects defined for a bundle. Configurations are defined by JSON files.
- */
- var com_ibm_rave_library_framework_meta_internal_BundleConfigurationManager = rave['internal']['Declare']({
- //_bundle : null,
- /**
- * The BundleInfo for the bundle that owns these configurations
- */
- //_bundleInfo : null,
- /**
- * Map from id to defined configuration
- */
- //_configMap : null,
- /**
- * List of all defined configurations
- */
- //_configList : null,
- /**
- * Create the configuration manager. It has no configurations.
- */
- constructor : function() {
- this._configMap = {};
- this._configList = [];
- this._bundleInfo = null;
- },
- /**
- * Set the BundleInfo of the bundle which owns this configuration manager. This is not done in the constructor to avoid a circular initialization issue in JS.
- * @param (com.ibm.rave.library.framework.BundleInfo) bundleInfo The bundle's info
- */
- setBundleInfo : function(bundle, bundleInfo) {
- this._bundle = bundle;
- this._bundleInfo = bundleInfo;
- },
- /**
- * <p> Populate configurations from the given JSON, which may be a configuration schema. If it does not have a "configurations" property, nothing is done. </p> <p> Otherwise, the "configuration" property is taken as an array of objects describing data models, as in the schema. If the object "id" is already defined, it is skipped (no overwrite of existing configurations). Otherwise a new Configuration for the object is created and added to the collection. </p>
- * @param (Object) json The configuration JSON, not null
- */
- populate : function(json, messages) {
- var v = json["configurations"];
- if (v == null) {
- return;
- }
- for (var __i_enFor0 = 0, __exp_enFor0 = v, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- if (o == null) {
- continue;
- }
- var meta = (o)["genericMeta"];
- if (meta == null) {
- continue;
- }
- var id = ((meta)["id"]);
- if (id != null && !(this._configMap.hasOwnProperty(id))) {
- var config = new com_ibm_rave_library_framework_meta_internal_BundleConfigurationImpl(this._bundle, this._bundleInfo, o, messages);
- this._configMap[id] = config;
- this._configList.push(config);
- }
- }
- },
- /**
- * Get the list of all defined configurations. The order is that in which configurations were defined.
- * @return (Array) List of configurations
- */
- configurations : function() {
- return this._configList;
- },
- /**
- * Get a configuration by ID. If the ID is not known, returns null.
- * @param (String) id Configuration ID
- * @return (com.ibm.rave.library.framework.meta.BundleConfiguration) Configuration, or null
- */
- configuration : function(id) {
- return this._configMap[id];
- }
- });
- // $source: com/ibm/rave/library/framework/meta/internal/BundleConfigurationImpl
- /************************************************************************
- ** 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
- /**
- * Implementation of the BundleConfiguration.
- * @param < (java.lang.Object) S >
- */
- var com_ibm_rave_library_framework_meta_internal_BundleConfigurationImpl = rave['internal']['Declare']({
- /**
- * Configuration id
- */
- //_id : null,
- /**
- * Configuration name
- */
- //_label : null,
- /**
- * Configuration description
- */
- //_description : null,
- /**
- * JSON of the configuration
- */
- //_json : null,
- /**
- * Bundle that owns this configuration
- */
- //_bundle : null,
- /**
- * Bundle information for the bundle that owns this configuration
- */
- //_bundleInfo : null,
- /**
- * Non-renderable instance representing this configuration
- */
- //_configInstance : null,
- /**
- * metadata for the instance, computed when first requested
- */
- //_meta : null,
- //_previewsMeta : null,
- /**
- * List of visible property presentation IDs, computed when first requested
- */
- //_propertyPresentations : null,
- /**
- * List of visible data models for the instance, computed when first requested
- */
- //_dataModels : null,
- /**
- * List of modifications to dataSlots across dataModels
- */
- //_dataSlots : null,
- /**
- * List of enabled actions for the instance, computed when first requested
- */
- //_enabledActions : null,
- //_messages : null,
- /**
- * Construct the configuration from a JSON specification. The spec is non-null and assumed to conform to the schema.
- * @param (com.ibm.rave.library.framework.BundleInfo) bundleInfo The bundle info for the bundle that owns this configuration
- * @param (Object) json The configuration spec
- */
- constructor : function(bundle, bundleInfo, json, messages) {
- this._json = json;
- this._bundle = bundle;
- this._bundleInfo = bundleInfo;
- this._messages = messages;
- var meta = json["genericMeta"];
- this._id = (meta["id"]);
- this._label = (meta["label"]);
- this._description = (meta["description"]);
- this._configInstance = null;
- this._meta = null;
- this._previewsMeta = null;
- this._propertyPresentations = null;
- this._dataModels = null;
- this._enabledActions = null;
- },
- /** @expose */
- id : function() {
- return this._id;
- },
- /** @expose */
- name : function() {
- return this.label();
- },
- /** @expose */
- label : function() {
- return (!this._bundle) ? this._label : this.info().meta().id("label");
- },
- /** @expose */
- description : function() {
- return (!this._bundle) ? this._description : this.info().meta().id("description");
- },
- /**
- * @return (Object) The JSON of the configuration
- */
- json : function() {
- return this._json;
- },
- /** @expose */
- toJSON : function() {
- var meta = this.meta();
- var info = this.info();
- var json = {};
- json["bundleId"] = this._bundle._info.meta().id("id");
- var ids = meta.ids();
- for (var i = 0; i < ids.length; ++i) {
- json[ids[i]] = meta.id(ids[i]);
- }
- json["tags"] = this.convertStringArrayEx(meta.tags());
- var preview = info.previews();
- var imageMap = rave['internal']['ES6Map'].create();
- var svgMap = rave['internal']['ES6Map'].create();
- var a = [];
- var path;
- for (var __i_enFor0 = 0, __exp_enFor0 = preview.getAllTags(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var s = __exp_enFor0[__i_enFor0];
- a.length = 0;
- a.push(s);
- path = preview.getPreview("image", a);
- if (!(imageMap.has(path))) {
- imageMap.set(path, []);
- }
- imageMap.get(path).push(s);
- path = preview.getPreview("svg", a);
- if (!(svgMap.has(path))) {
- svgMap.set(path, []);
- }
- svgMap.get(path).push(s);
- }
- var jPreviews = {};
- json["previews"] = jPreviews;
- var images = [];
- var svg = [];
- jPreviews["images"] = images;
- jPreviews["svg"] = svg;
- for (var __i_enFor1 = 0, __exp_enFor1 = imageMap.entries(), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var entry = __exp_enFor1[__i_enFor1];
- var o = {};
- images.push(o);
- o["file"] = entry.key;
- o["tags"] = entry.value;
- }
- for (var __i_enFor2 = 0, __exp_enFor2 = svgMap.entries(), __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var entry = __exp_enFor2[__i_enFor2];
- var o = {};
- svg.push(o);
- o["file"] = entry.key;
- o["tags"] = entry.value;
- }
- var jDataModels = [];
- json["dataModels"] = jDataModels;
- for (var __i_enFor3 = 0, __exp_enFor3 = info.dataModels(), __len_enFor3 = __exp_enFor3.length;
- __i_enFor3 < __len_enFor3; ++__i_enFor3) {
- var dm = __exp_enFor3[__i_enFor3];
- var jDm = {};
- jDataModels.push(jDm);
- jDm["id"] = dm.id();
- jDm["label"] = dm.label();
- jDm["description"] = dm.description();
- jDm["tags"] = this.convertStringArrayEx(dm.tags());
- var jDss = [];
- jDm["dataSets"] = jDss;
- for (var __i_enFor4 = 0, __exp_enFor4 = dm.dataSets(), __len_enFor4 = __exp_enFor4.length;
- __i_enFor4 < __len_enFor4; ++__i_enFor4) {
- var ds = __exp_enFor4[__i_enFor4];
- var jDs = {};
- jDss.push(jDs);
- jDs["id"] = ds.id();
- jDs["label"] = ds.label();
- jDs["description"] = ds.description();
- jDs["cardinality"] = ds.cardinality();
- jDs["type"] = ds.type();
- jDs["tags"] = this.convertStringArrayEx(ds.tags());
- var jDataSlots = [];
- jDs["dataSlots"] = jDataSlots;
- var slots = ds.dataSlots();
- for (var __i_enFor5 = 0, __exp_enFor5 = slots, __len_enFor5 = __exp_enFor5.length;
- __i_enFor5 < __len_enFor5; ++__i_enFor5) {
- var dsD = __exp_enFor5[__i_enFor5];
- var jSlot = {};
- jDataSlots.push(jSlot);
- jSlot["id"] = dsD.id();
- jSlot["label"] = dsD.label();
- jSlot["description"] = dsD.description();
- jSlot["cardinality"] = dsD.cardinality();
- var o = {};
- jSlot["icon"] = o;
- o["image"] = dsD.icon("image");
- o["svg"] = dsD.icon("svg");
- jSlot["dataTypes"] = this.convertStringArrayEx(dsD.dataTypes());
- jSlot["tags"] = this.convertStringArrayEx(dsD.tags());
- }
- }
- }
- var ap = info.properties();
- var properties = rave['internal']['ES6Map'].create();
- for (var __i_enFor6 = 0, __exp_enFor6 = ap, __len_enFor6 = __exp_enFor6.length;
- __i_enFor6 < __len_enFor6; ++__i_enFor6) {
- var p = __exp_enFor6[__i_enFor6];
- properties.set(p.id(), p);
- }
- var jPps = [];
- json["propertyPresentations"] = jPps;
- for (var __i_enFor7 = 0, __exp_enFor7 = info.propertyPresentations(), __len_enFor7 = __exp_enFor7.length;
- __i_enFor7 < __len_enFor7; ++__i_enFor7) {
- var pp = __exp_enFor7[__i_enFor7];
- var o = {};
- jPps.push(o);
- o["id"] = pp.id();
- o["name"] = pp.name();
- o["description"] = pp.description();
- o["tags"] = this.convertStringArray(pp.tags());
- this.toJsonPresentationItems(properties, o, pp.presentationItems());
- }
- return json;
- },
- toJsonPresentationItems : function(properties, parent, items) {
- if (items.length > 0) {
- var array = [];
- parent["presentationItems"] = array;
- for (var i = 0; i < items.length; ++i) {
- var object = {};
- array.push(object);
- if (items[i].type().localeCompare("reference") == 0) {
- var p = properties.get(items[i].id());
- if (p) {
- var property = {};
- object["property"] = property;
- property["id"] = items[i].id();
- property["name"] = p.name();
- property["description"] = p.description();
- property["type"] = p.type();
- property["defaultValue"] = p.defaultValue();
- property["required"] = p.required();
- property["resetView"] = p.resetView();
- property["tags"] = this.convertStringArrayEx(p.tags());
- }
- } else if (items[i].type().localeCompare("group") == 0) {
- var group = {};
- object["propertyGroup"] = group;
- group["id"] = items[i].id();
- group["name"] = items[i].name();
- group["description"] = items[i].description();
- group["tags"] = this.convertStringArray(items[i].tags());
- this.toJsonPresentationItems(properties, group, items[i].presentationItems());
- }
- }
- }
- },
- /**
- * TODO: Currently used only for testing, so no messages are passed to the configure call. If this is ever used in production code, messages will have to be passed to the meta.configure call!
- */
- /** @expose */
- meta : function() {
- if (!this._bundle) {
- if (!this._meta) {
- this._meta = (this._bundleInfo.meta()).copy();
- (this._meta).populate(this._json);
- (this._meta)._messages = (this._bundleInfo.meta())._messages;
- }
- return this._meta;
- } else {
- return this.info().meta();
- }
- },
- previews : function() {
- if (!this._previewsMeta) {
- this._previewsMeta = (this._bundleInfo.previews()).copy();
- this._previewsMeta.configure(this._json);
- }
- return this._previewsMeta;
- },
- /** @expose */
- propertyPresentations : function() {
- if (!this._propertyPresentations) {
- this._propertyPresentations = [];
- var hidden = com_ibm_rave_library_framework_meta_internal_BundleConfigurationImpl.makeIdSet(this._json["propertyPresentations"], "hidden", true);
- for (var __i_enFor0 = 0, __exp_enFor0 = this._bundleInfo.propertyPresentations(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var pp = __exp_enFor0[__i_enFor0];
- if (!(hidden.hasOwnProperty((pp).id()))) {
- this._propertyPresentations.push((pp).id());
- }
- }
- }
- return this._propertyPresentations;
- },
- /** @expose */
- dataModels : function() {
- if (!this._dataModels) {
- this._dataModels = [];
- var hidden = com_ibm_rave_library_framework_meta_internal_BundleConfigurationImpl.makeIdSet(this._json["datamodels"], "hidden", true);
- for (var __i_enFor0 = 0, __exp_enFor0 = this._bundleInfo.dataModels(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dmd = __exp_enFor0[__i_enFor0];
- if (!(hidden.hasOwnProperty(dmd.id()))) {
- this._dataModels.push(dmd.id());
- }
- }
- }
- return this._dataModels;
- },
- /** @expose */
- dataSlots : function() {
- if (!this._dataSlots) {
- this._dataSlots = this._json["dataSlots"];
- }
- return this._dataSlots;
- },
- /** @expose */
- enabledActions : function() {
- if (!this._enabledActions) {
- this._enabledActions = [];
- var disabled = com_ibm_rave_library_framework_meta_internal_BundleConfigurationImpl.makeIdSet(this._json["actions"], "enabled", false);
- for (var __i_enFor0 = 0, __exp_enFor0 = this._bundleInfo.actions(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var a = __exp_enFor0[__i_enFor0];
- if (!(disabled.hasOwnProperty(a.id()))) {
- this._enabledActions.push(a.id());
- }
- }
- }
- return this._enabledActions;
- },
- /**
- * Return BundleInfo specific to this configuration. This information is populated 'on demand' when requested from the configuration. In general, this will be a subset of the information contained in the bundle (i.e. _bundleInfo)
- * @return (com.ibm.rave.library.framework.BundleInfo) BundleInfo specific to this configuration
- */
- /** @expose */
- info : function() {
- if (!this._bundle) {
- return null;
- }
- if (!this._configInstance) {
- this._configInstance = this._bundle.create(this._id, false);
- }
- return this._configInstance.info();
- },
- convertStringArrayEx : function(a) {
- var r = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = a, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var s = __exp_enFor0[__i_enFor0];
- r.push(s);
- }
- return r;
- },
- convertStringArray : function(a) {
- var r = [];
- for (var __i_enFor0 = 0, __len_enFor0 = a.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var s = a[__i_enFor0];
- r.push(s);
- }
- return r;
- }
- });
- /**
- * Traverse the array which may be null or empty. The objects have a string "id" property, and may have a boolean key property. Collect the IDs of all objects which have the given value as key.
- * @param (Array) array JSON array
- * @param (String) key Boolean-valued property
- * @param (boolean) value Whether the key must be true or false
- * @return (Object) Set of IDs for which the key has the given value
- */
- com_ibm_rave_library_framework_meta_internal_BundleConfigurationImpl.makeIdSet = function(array, key, value) {
- var result = {};
- if (array) {
- for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- if (o != null) {
- var id = ((o)["id"]);
- var v = ((o)[key] != null) ? ((o)[key]) : null;
- if (id != null && v != null && v == value) {
- result[id] = 1;
- }
- }
- }
- }
- return result;
- };
- // $source: com/ibm/rave/library/internal/nativeImpl/LoaderNativeUtils
- /************************************************************************
- ** 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.
- ************************************************************************/
- //@import com/ibm/rave/library/service/LibraryError (runtime) // new
- var com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils = (function () { /* no code, all static */ });
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.loadBundleCode = function(
- /* String */ uri,
- /* list of string uris in prerequisite order */ dependencies,
- /* LibraryError.ReportError */ errorReporter) {
- com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.loadPrerequisites(uri, dependencies, errorReporter);
- };
- com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.loadBundle = function(
- /* String */ uri,
- /* LibraryError.ReportError */ errorReporter) {
- insertScript(uri, null,
- // On successful load, errorReporter with no error
- function() {
- errorReporter(null);
- },
- // On failure load, errorReporter with the error message
- function(e) {
- com_ibm_rave_library_Library.logError(com_ibm_rave_library_service_LibraryError.BUNDLE_LOAD_ERROR, "loading " + uri);
- }
- );
- };
- com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.loadPrerequisites = function(
- /* String */ uri,
- /* list of string uris in prerequisite order */ dependencies,
- /* LibraryError.ReportError */errorReporter) {
- // recursive load
- function load(index) {
- // bottom of the dependencies stack
- if (!dependencies || dependencies.length == index){
- com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.loadBundle(uri,errorReporter );
- return;
- }
- insertScript(dependencies[index], false,
- function() {
- load(index + 1);
- },
- // On failure load, errorReporter with the error message
- function(e) {
- com_ibm_rave_library_Library.logError(com_ibm_rave_library_service_LibraryError.BUNDLE_LOAD_ERROR, "loading " + uri);
- }
- );
- }
- load(0);
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.loadBundleStylesheet = function(
- /*String*/ uri,
- /*LibraryError.ReportError*/ errorReporter) {
- // Add a <link> tag to the document, otherwise similar to loading the code
- var link = document.createElement("link");
- link.setAttribute("rel", "stylesheet");
- link.setAttribute("href", uri);
- link.onload = function() {
- errorReporter(null);
- };
- link.onerror = function(e) {
- com_ibm_rave_library_Library.logError(com_ibm_rave_library_service_LibraryError.BUNDLE_LOAD_ERROR, "loading " + uri);
- };
- document.head.appendChild(link);
- };
- /** @expose */
- com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.getMessagesPath = function(
- /*String*/ locale,
- /*String*/ url) {
- return url + "/i18n/messages_" + locale + ".json";
- };
- var _cachedScripts = [];
- function insertScript(src, async, onLoadFunction, onErrorFunction) {
- var cachedScript = _cachedScripts[src];
- if (!cachedScript) {
- // cache the entry
- _cachedScripts[src] = {status: "loading", onload: [onLoadFunction], onerror: [onErrorFunction]};
-
- // wrap the onLoad and onError
- var onload = function() {
- // mark script as loaded
- var cached = _cachedScripts[src];
- cached.status = "loaded";
- // run all onLoad functions associated with this script, then remove from stack
- while (cached.onload.length > 0) {
- cached.onload.pop()();
- }
- };
- var onerror = function() {
- // mark script as error
- var cached = _cachedScripts[src];
- cached.status = "error";
- // run all onError functions associated with this script, then remove from stack
- while (cached.onerror.length > 0) {
- cached.onerror.pop()();
- }
- };
- // insert script
- createScriptNode(src, async, onload, onerror);
- } else {
- if (cachedScript.status == "loaded") {
- // the script loaded successfully, run the onLoad function
- onLoadFunction();
- } else if (cachedScript.status == "loading") {
- // the cached script is still loading, save the onLoad and onError functions
- cachedScript.onload.push(onLoadFunction);
- cachedScript.onerror.push(onErrorFunction);
- } else if (cachedScript.status == "error") {
- // the script didn't load, run the onError function
- onErrorFunction();
- }
- }
- };
- function createScriptNode(uri, async, onLoadFunction, onErrorFunction) {
- // Add a <script> tag to the document
- var script = document.createElement("script");
- script.setAttribute("src", uri);
- script.setAttribute("charset", "utf-8");
- script.type = 'text/javascript';
- script.async = async | false;
- script.onload = onLoadFunction;
- script.onerror = onErrorFunction;
- // Add to document head
- document.head.appendChild(script);
- };
- // $source: com/ibm/rave/library/framework/internal/AbstractController
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2019
- **
- ** 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/framework/internal/TransitionsCompleteMonitor (runtime) // new
- //@import com/ibm/rave/library/i18n/Messages (runtime) // createFromCatalog
- //@import com/ibm/rave/library/internal/nativeImpl/LoaderNativeUtils (runtime) // getMessagesPath
- //@import com/ibm/rave/library/service/LibraryError (runtime) // create
- //@import com/ibm/rave/library/framework/BundleInfo (runtime)
- /**
- * TODO: JavaDoc
- */
- var com_ibm_rave_library_framework_internal_AbstractController = rave['internal']['Declare']({
- /**
- * The bundle name.
- */
- //_bundleName : null,
- /**
- * The bundle context (model of the model-view-controller)
- */
- //_context : null,
- /**
- * The bundle view
- */
- //_view : null,
- /**
- * The bundle metadata info
- */
- //_info : null,
- //_messages : null,
- /**
- * pointer to the callback function for use with LibraryError
- */
- //_errorReporter : null,
- /**
- * pointer that will be passed into various functions that will then call on the callback function to report an error
- */
- //reportError : null,
- //transitionCompleteMonitors : null,
- /**
- * Need to hang on to this for Swift.
- */
- //messageXhr : null,
- localeSet : false,
- constructor : function(bundleName, ctx, view) {
- this.transitionCompleteMonitors = [];
- {
- var self = this;
- this.reportError = function(liberror) {
- liberror.setBundlename(self._bundleName);
- if (self._errorReporter) {
- self._errorReporter(liberror);
- }
- };
- this._bundleName = bundleName;
- this._context = ctx;
- this._messages = ctx._messages;
- this._info = new (rave['internal']['Declare']({
- meta : function() {
- return self._context._metadata;
- },
- properties : function() {
- return self._context.properties.meta();
- },
- propertyPresentations : function() {
- return self._context.propertyPresentations.meta();
- },
- actions : function() {
- return self._context.actions._meta;
- },
- dataModels : function() {
- return self._context.datamodels.getDataModels();
- },
- getPreview$2 : function(format, tags) {
- return self._context._previewsMeta.getPreview(format, tags);
- },
- getPreviewTags : function() {
- return self._context._previewsMeta.getAllTags();
- },
- getPreviews$1 : function(format) {
- return self._context._previewsMeta.getPreviews(format);
- },
- getPreview$1 : function(format) {
- return self._context._previewsMeta.getPreview(format, null);
- },
- getPreview$0 : function() {
- return self._context._previewsMeta.getPreview("svg", null);
- },
- getPreviews$0 : function() {
- return self._context._previewsMeta.getPreviews("svg");
- },
- previews : function() {
- return self._context._previewsMeta;
- },
- getPreview : function(a0, a1) {
- var args = arguments;
- if (args.length == 0) {
- return this.getPreview$0();
- }
- if (args.length == 1) {
- return this.getPreview$1(a0);
- }
- return this.getPreview$2(a0, a1);
- },
- getPreviews : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.getPreviews$0();
- }
- return this.getPreviews$1(a0);
- }
- }))();
- this._view = view;
- if (this._view) {
- this._view.setup();
- }
- }
- },
- render$0 : function() {
- this.render$1(null);
- },
- render$1 : function(callback) {
- this.updateContextSize();
- if (this._view) {
- var dataModel = this._context.datamodels.dataModel();
- if (dataModel._dataChanged) {
- this._view.reset();
- dataModel._dataChanged = false;
- }
- if (!callback) {
- this._view.draw();
- } else {
- rave['internal']['TransitionCollector'].startCollectingTransitions();
- this._view.draw();
- var transitions = rave['internal']['TransitionCollector'].stopCollectingTransitions();
- if (transitions.length == 0) {
- callback();
- } else {
- var self = this;
- var tcc = function(tcm) {
- var i = self.transitionCompleteMonitors.indexOf(tcm);
- if (i >= 0) {
- self.transitionCompleteMonitors.splice(i, 1);
- }
- callback();
- };
- var m = new com_ibm_rave_library_framework_internal_TransitionsCompleteMonitor(tcc);
- this.transitionCompleteMonitors.push(m);
- m.monitor(transitions);
- }
- }
- }
- this.updateActionBindings();
- },
- /** @expose */
- info : function() {
- return this._info;
- },
- /** @expose */
- action : function(id) {
- return this._context.actions.action(id);
- },
- /** @expose */
- getDataModels : function() {
- return this._context.datamodels.getDataModels();
- },
- /** @expose */
- createDataModel : function(modelId) {
- this._view.reset();
- return this._context.datamodels.createDataModel(modelId);
- },
- /**
- * Get the current data model for this bundle.
- * @return (com.ibm.rave.library.datamodel.DataModel) The data model used for rendering
- */
- /** @expose */
- dataModel : function() {
- return this._context.datamodels.dataModel();
- },
- node$0 : function(svg) {
- this._context.node = svg;
- return this;
- },
- /** @expose */
- setMessageCatalog : function(locale, catalog) {
- var message = com_ibm_rave_library_i18n_Messages.createFromCatalog(catalog, locale);
- this._messages.add(locale, message);
- },
- /** @expose */
- setLocale : function(locale, url, userCallback) {
- var self = this;
- var path = com_ibm_rave_library_internal_nativeImpl_LoaderNativeUtils.getMessagesPath(locale, url);
- if (self._messages.locale(locale)) {
- if (userCallback) {
- userCallback();
- }
- return true;
- }
- self.messageXhr = rave.json(path, function(error, response) {
- if (!error) {
- self.setMessageCatalog(locale, (response));
- self.localeSet = self._messages.locale(locale);
- if (userCallback) {
- userCallback();
- }
- }
- });
- return this.localeSet;
- },
- node$1 : function() {
- return this._context.node;
- },
- property$0 : function(id, value) {
- var p = this._context.properties.property(id);
- if (!p) {
- this.reportError(com_ibm_rave_library_service_LibraryError.create(32, id, this._bundleName));
- } else {
- p.value(value);
- this._view.checkUpdate(id);
- }
- return this;
- },
- property$1 : function(id) {
- var prop = this._context.properties.property(id);
- if (prop) {
- return prop.value();
- }
- return null;
- },
- /**
- * Pass custom formatters to bundleContext, from where they are retrieved by bundle to format elements (axis, legend, etc) of View.
- */
- /** @expose */
- setCustomFormatter : function(target, formatter) {
- this._context.addCustomFormatter(target, formatter);
- this._view.resetRedraw();
- },
- /**
- * Retrieve the custom formatters defined by users.
- * @return (Object) map of custom formatters
- */
- /** @expose */
- getCustomFormatters : function() {
- return this._context._customFormatters;
- },
- /** @expose */
- removeCustomFormatter : function(target) {
- this._context.removeCustomFormatter(target);
- this._view.resetRedraw();
- },
- /**
- * Store a snapshot of the current width and height of the context scene node.
- */
- updateContextSize : function() {
- var _w = ""+(this._context.node.style("width")).replace("px", "");
- var _h = ""+(this._context.node.style("height")).replace("px", "");
- var w = + (_w);
- var h = + (_h);
- if (isNaN(w)) {
- w = 400.0;
- }
- if (isNaN(h)) {
- h = 400.0;
- }
- if (this._context.size.w != w || this._context.size.h != h) {
- this.node$1().attr("__rave_resize__", true).attr("__rave_resize__", null);
- this._view.resetLayout();
- }
- this._context.size.w = w;
- this._context.size.h = h;
- },
- /**
- * Apply all action bindings to the current visualization context.
- */
- updateActionBindings : function() {
- this._context.actions.applyBindings();
- },
- /** @expose */
- onError : function(errorReport) {
- this._errorReporter = errorReport;
- },
- /**
- * Pointer that holds the function that calls the callback function to report an error
- * @return (com.ibm.rave.library.service.LibraryError.ReportError) LibraryError.ReportError
- */
- errorReporter : function() {
- return this.reportError;
- },
- /**
- * Return locale for this bundle instance
- * @return (String) locale for this bundle instance
- */
- locale : function() {
- return this._context.locale();
- },
- /** @expose */
- preExecuteCallback : function(callback) {
- this._context._preExecuteCallback = callback;
- },
- /** @expose */
- preRenderCallback : function(callback) {
- this._context._prerenderCallback = callback;
- },
- /** @expose */
- renderCallback : function(callback) {
- this._context._renderCallback = callback;
- },
- /** @expose */
- postRenderCallback : function(callback) {
- this._context._postrenderCallback = callback;
- },
- /** @expose */
- getSVGImage : function(callback) {
- rave.getSVGImage(this._context.node.node(), callback);
- },
- /** @expose */
- getCoordinateScale : function(role) {
- return this._view ? this._view.getCoordinateScale(role) : null;
- },
- /** @expose */
- dispose : function() {
- if (this._context.node) {
- this._context.node.selectAll("*").interrupt().transition();
- }
- if (this._view) {
- this._view.dispose();
- }
- },
- /** @expose */
- on : function(eventName, callback) {
- if (this._view) {
- this._view.on(eventName, callback);
- }
- return this;
- },
- /** @expose */
- render : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.render$0();
- }
- return this.render$1(a0);
- },
- /** @expose */
- node : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.node$1();
- }
- return this.node$0(a0);
- },
- /** @expose */
- property : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.property$1(a0);
- }
- return this.property$0(a0, a1);
- }
- });
- com_ibm_rave_library_framework_internal_AbstractController.DEFAULT_SIZE_WIDTH = 400.0;
- com_ibm_rave_library_framework_internal_AbstractController.DEFAULT_SIZE_HEIGHT = 400.0;
- // $source: com/ibm/rave/library/framework/internal/TransitionsCompleteMonitor
- /************************************************************************
- ** 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_library_framework_internal_TransitionsCompleteMonitor = rave['internal']['Declare']({
- //_callback : null,
- monitoredTransitionsCount : 0,
- constructor : function(callback) {
- this._callback = callback;
- this.monitoredTransitionsCount = 0;
- },
- monitor : function(transitions) {
- for (var __i_enFor0 = 0, __exp_enFor0 = transitions, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var t = __exp_enFor0[__i_enFor0];
- var size = t.size();
- if (size > 0) {
- this.monitoredTransitionsCount++;
- var monitor = new com_ibm_rave_library_framework_internal_TransitionsCompleteMonitor.TransitionCompleteMonitor(this, size);
- t.transitionEndedCallback(monitor);
- }
- }
- if (this.monitoredTransitionsCount == 0) {
- this._callback(this);
- }
- },
- transitionComplete : function() {
- this.monitoredTransitionsCount--;
- if (this.monitoredTransitionsCount == 0) {
- this._callback(this);
- }
- }
- });
- com_ibm_rave_library_framework_internal_TransitionsCompleteMonitor.TransitionCompleteMonitor = rave['internal']['Declare']({
- //monitorsCollection : null,
- _count : 0,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- _$self._count--;
- if (_$self._count == 0) {
- _$self.monitorsCollection.transitionComplete();
- }
- return null;
- }
- };
- return _$self;
- },
- constructor : function(collection, count) {
- this._count = count;
- this.monitorsCollection = collection;
- }
- });
- // $source: com/ibm/rave/library/i18n/Messages
- /************************************************************************
- ** 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
- /**
- * NLS messages catalog
- */
- var com_ibm_rave_library_i18n_Messages = rave_library_externs["Messages"] = rave['internal']['Declare']({
- //catalog : null,
- //language : null,
- /**
- * Create empty messages catalog
- */
- /** @expose */
- constructor : function() {
- this.catalog = {};
- },
- /**
- * Return nls value for the message key
- * @param (String) key nls key
- * @return (String) nls value
- */
- /** @expose */
- _nls : function(key, alt) {
- var value = (this.catalog[key]);
- return value == null ? alt : value;
- },
- /**
- * Returns language tag (e.g. "fr", "jp", "en", etc)
- * @return (String) language tag
- */
- /** @expose */
- locale : function() {
- return this.language;
- }
- });
- /**
- * Creates a Messages container for a provided messages catalog.
- * @param (Object) messagesCatalog The messages catalog loaded from a bundle's resources.
- * @param (String) locale The language tag (e.g. "en", "fr", etc.) that the catalog contains.
- * @return (com.ibm.rave.library.i18n.Messages) A Messages container.
- */
- /** @expose */
- com_ibm_rave_library_i18n_Messages.createFromCatalog = function(messagesCatalog, locale) {
- var m = new com_ibm_rave_library_i18n_Messages();
- m.catalog = messagesCatalog;
- m.language = locale;
- return m;
- };
- /**
- * Default locale is a root locale
- */
- /** @expose */
- com_ibm_rave_library_i18n_Messages.DEFAULT = "root";
- /** @expose */
- com_ibm_rave_library_i18n_Messages.EMPTY_MESSAGES = new com_ibm_rave_library_i18n_Messages();
- // $source: com/ibm/rave/library/framework/BundleInfo
- /************************************************************************
- ** 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> Interface for retrieving meta data information from a bundle ( {@link (com.ibm.rave.library.framework.Bundle) Bundle} ) or bundle instance ( {@link (com.ibm.rave.library.framework.Controller) Controller} ). </p> <p> The BundleInfo reports the metadata, properties, actions, data models, and property presentations provided by the Bundle or Controller. The information from a Controller may differ from that in the Bundle, if a configuration was used to create the instance. </p> <p> When methods return lists, the list is non-null but may be empty. The caller must not modify the list. The sort order of the list is unspecified. </p>
- */
- var com_ibm_rave_library_framework_BundleInfo = rave_library_externs["BundleInfo"] = rave['internal']['Declare'].implement(
- /**
- * @return (com.ibm.rave.library.framework.meta.GenericMetadata) generic metadata information about the bundle (e.g. name, description, tags, previews).
- */
- //meta : function() {},
- /**
- * @return (Array) List of all properties this bundle or instance exposes.
- */
- //properties : function() {},
- /**
- * @return (Array) List of all property presentations this bundle or instance exposes.
- */
- //propertyPresentations : function() {},
- /**
- * @return (Array) List of all available actions, and their default bindings.
- */
- //actions : function() {},
- /**
- * @return (Array) List of all data models this bundle or instance exposes.
- */
- //dataModels : function() {},
- /**
- * @return (com.ibm.rave.library.framework.meta.PreviewsMetadata) generic metadata information about the bundle (e.g. name, description, tags, previews).
- */
- //previews : function() {},
- /**
- * @param (String) format Either 'svg' or 'image'. If this parameter is not set svg is assumed. If a value is provided that is not supported an error is returned.
- * @param (Array) tags A list of tags. Each preview may have one or more tags associated with it. The bundle will try to match the list of tags to the available previews for that format. The preview that matches the most tags will be returned. If it is a tie or if no tags are provided on the call, the first preview (or the first out of the matching tags) is returned.
- * @return (String) A string. If the requested format is svg, the string will be the SVG as a string. It is the contents of the file "resources/svgPreviewNoText.svg" or "resources/svgPreview.svg" depending on the tags. If the requested format is an image, the string will be the relative location of the appropriate image file. This location will be relative to the root of the bundle. In Java this location will be the resource location in the JAR file. In iOS the location will be in the resources of the library. For JavaScript this will be a file inside the bundle.
- */
- //getPreview$2 : function(format, tags) {},
- /**
- * Return a string that represents the preview for the given format.
- * @param (String) format Either "svg" or "image"
- * @return (String) A string represents the preview
- */
- //getPreview$1 : function(format) {},
- /**
- * Return a string that represents the svg preview. Same as getPreview("svg").
- * @return (String) A string represents the svg preview
- */
- //getPreview$0 : function() {},
- /**
- * This returns the union of all tags for all previews for this bundle. This allows integrators to know what tags are available
- * @return (Array) An array of tags.
- */
- //getPreviewTags : function() {},
- /**
- * @param (String) format Either "svg" or "image".
- * @return (Array) A collection of previews for the given format. Default to svg if no format is provided. Return an error if the format is not found.
- */
- //getPreviews$1 : function(format) {},
- /**
- * Same as getPreviews("svg")
- * @return (Array) a collection of svg previews.
- */
- //getPreviews$0 : function() {}
- );
- // $source: com/ibm/rave/library/framework/meta/ActionMeta
- /************************************************************************
- ** 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
- /**
- * Container for action meta data.
- */
- var com_ibm_rave_library_framework_meta_ActionMeta = rave['internal']['Declare']({
- //_id : null,
- //_label : null,
- //_description : null,
- //_icon : null,
- //_tags : null,
- //_options : null,
- //_defaultBindings : null,
- //_args : null,
- //_messages : null,
- /** @expose */
- id : function() {
- return this._id;
- },
- /** @expose */
- label : function() {
- return this._messages._nls(this._label, this._label);
- },
- /** @expose */
- description : function() {
- return this._messages._nls(this._description, this._description);
- },
- /** @expose */
- icon : function() {
- return this._icon;
- },
- /** @expose */
- tags : function() {
- var msgTags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this._tags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- msgTags.push(this._messages._nls(tag, tag));
- }
- return msgTags;
- },
- /** @expose */
- options : function() {
- return this._options;
- },
- /** @expose */
- defaultBindings : function() {
- return this._defaultBindings;
- }
- //constructor : function() {}
- });
- /**
- * Builds the action metadata structure defined by the provided action JSON definition.
- */
- /** @expose */
- com_ibm_rave_library_framework_meta_ActionMeta.parse = function(action, messages) {
- var a = new com_ibm_rave_library_framework_meta_ActionMeta();
- var bindings = action["binding"];
- var args = action["args"];
- a._id = (action["id"]);
- a._icon = (action["icon"]);
- a._label = (action["label"]);
- a._description = (action["description"]);
- a._tags = (action["tags"]);
- a._options = (action["options"]);
- a._args = [];
- if (args) {
- for (var i = 0; i < args.length; ++i) {
- a._args.push(com_ibm_rave_library_framework_meta_ActionMeta.ArgumentsMeta.parse(args[i], messages));
- }
- }
- a._defaultBindings = [];
- if (bindings) {
- for (var i = 0; i < bindings.length; ++i) {
- a._defaultBindings.push(com_ibm_rave_library_framework_meta_ActionMeta.BindingMeta.parse(bindings[i]));
- }
- }
- a._messages = messages;
- return a;
- };
- /**
- * Container for a single target-event pair.
- */
- com_ibm_rave_library_framework_meta_ActionMeta.BindingMeta = rave['internal']['Declare']({
- //_target : null,
- //_event : null,
- /** @expose */
- target : function() {
- return this._target;
- },
- /** @expose */
- event : function() {
- return this._event;
- }
- //constructor : function() {}
- });
- /** @expose */
- com_ibm_rave_library_framework_meta_ActionMeta.BindingMeta.parse = function(binding) {
- var b = new com_ibm_rave_library_framework_meta_ActionMeta.BindingMeta();
- b._target = ""+(binding["target"]);
- b._event = ""+(binding["event"]);
- return b;
- };
- /**
- * Container for a single target-event pair.
- */
- com_ibm_rave_library_framework_meta_ActionMeta.ArgumentsMeta = rave['internal']['Declare']({
- //_id : null,
- //_label : null,
- //_description : null,
- //_icon : null,
- //_tags : null,
- //_type : null,
- //_messages : null,
- /** @expose */
- id : function() {
- return this._id;
- },
- /** @expose */
- label : function() {
- return this._messages._nls(this._label, this._label);
- },
- /** @expose */
- description : function() {
- return this._messages._nls(this._description, this._description);
- },
- /** @expose */
- icon : function() {
- return this._icon;
- },
- /** @expose */
- tags : function() {
- var msgTags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this._tags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- msgTags.push(this._messages._nls(tag, tag));
- }
- return msgTags;
- },
- /** @expose */
- type : function() {
- return this._type;
- }
- //constructor : function() {}
- });
- /**
- * Populates the values for the action arguments.
- * @param (Object) args action arguments JSOn.
- * @return (com.ibm.rave.library.framework.meta.ActionMeta.ArgumentsMeta) action "ArgumentsMeta".
- */
- /** @expose */
- com_ibm_rave_library_framework_meta_ActionMeta.ArgumentsMeta.parse = function(args, msgs) {
- var a = new com_ibm_rave_library_framework_meta_ActionMeta.ArgumentsMeta();
- a._id = ""+(args["id"]);
- a._label = ""+(args["label"]);
- a._description = ""+(args["description"]);
- a._icon = ""+(args["icon"]);
- a._tags = (args["tags"]);
- a._type = ""+(args["type"]);
- a._messages = msgs;
- return a;
- };
- // $source: com/ibm/rave/library/framework/meta/internal/PropertyPresentationMetaImpl
- /************************************************************************
- ** 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/framework/meta/internal/PropertyReferenceMeta (runtime) // new
- //@import com/ibm/rave/library/framework/meta/internal/PropertyGroupMeta (runtime) // new
- //@import com/ibm/rave/library/i18n/MessagesRegistry (runtime) // EmptyRegistry
- /**
- * A property presentation is a list of properties you want to group together. The PropertyPresentationMeta API stores the given meta data for the property presentation in strings and object arrays which can then be used to present the grouped properties in a user interface. Property Presentations are under development and the API is subject to change.
- */
- var com_ibm_rave_library_framework_meta_internal_PropertyPresentationMetaImpl = rave['internal']['Declare']({
- /**
- * ID of the presentation
- */
- //_id : null,
- /**
- * Name of the presentation
- */
- //_name : null,
- /**
- * Description of the presentation
- */
- //_description : null,
- /**
- * String Tags of the presentation
- */
- //_tags : null,
- /**
- * Path to the image icon of the presentation
- */
- //_icon : null,
- /**
- * Localization messages registry
- */
- //messagesRegistry : null,
- /**
- * Object array that holds references to bundle property IDs as well as nested groups
- */
- //_presentationItems : null,
- constructor : function(registry) {
- this.messagesRegistry = registry;
- },
- /**
- * @return (String) Property presentation ID
- */
- /** @expose */
- id : function() {
- return this._id;
- },
- /**
- * @return (String) Property presentation Name
- */
- /** @expose */
- name : function() {
- return this.messagesRegistry._nls(this._name, this._name);
- },
- /**
- * @return (String) Property presentation Description
- */
- /** @expose */
- description : function() {
- return this.messagesRegistry._nls(this._description, this._description);
- },
- /**
- * @return (java.lang.String[]) Property presentation Tags
- */
- /** @expose */
- tags : function() {
- return this._tags;
- },
- /**
- * @return (String) Property presentation path to the image icon
- */
- /** @expose */
- icon : function() {
- return this._icon;
- },
- /**
- * @return (com.ibm.rave.library.framework.meta.PresentationItems[]) Property presentation Items Array
- */
- /** @expose */
- presentationItems : function() {
- var presentationItems = [];
- var i = 0;
- for (var __i_enFor0 = 0, __exp_enFor0 = this._presentationItems, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var item = __exp_enFor0[__i_enFor0];
- presentationItems[i++] = item;
- }
- return presentationItems;
- },
- /**
- * Builds the property presentation metadata structure defined by the provided JSON definition.
- * @param (Object) json JSON definition of a presentation
- * @return (com.ibm.rave.library.framework.meta.internal.PropertyPresentationMetaImpl) Property presentation
- */
- parse : function(json) {
- var pp = new com_ibm_rave_library_framework_meta_internal_PropertyPresentationMetaImpl(this.messagesRegistry);
- pp._id = ""+(json["id"]);
- pp._name = ""+(json["label"]);
- pp._description = ""+(json["description"]);
- var pTags = json["tags"];
- if (pTags) {
- var len = pTags.length;
- pp._tags = [];
- for (var i = 0; i < len; ++i) {
- pp._tags[i] = (pTags[i]);
- }
- } else {
- pp._tags = null;
- }
- pp._icon = (json["icon"]);
- var pItems = json["presentationItems"];
- if (pItems) {
- var len = pItems.length;
- pp._presentationItems = [];
- for (var i = 0; i < len; ++i) {
- var item = pItems[i];
- var propertyRef = (item["propertyID"]);
- if (propertyRef != null) {
- var property = new com_ibm_rave_library_framework_meta_internal_PropertyReferenceMeta();
- property.setID(propertyRef);
- pp._presentationItems.push(property);
- } else {
- var propertyGroup = new com_ibm_rave_library_framework_meta_internal_PropertyGroupMeta(this.messagesRegistry);
- var propertyGroupMeta = item["propertyGroup"];
- propertyGroup.setID((propertyGroupMeta["id"]));
- propertyGroup.setGroupName((propertyGroupMeta["label"]));
- propertyGroup.setGroupDescription((propertyGroupMeta["description"]));
- propertyGroup.setGroupIcon((propertyGroupMeta["icon"]));
- var groupTags = propertyGroupMeta["tags"];
- if (groupTags) {
- var glen = groupTags.length;
- var groupTagsArray = [];
- for (var j = 0; j < glen; ++j) {
- groupTagsArray[j] = (groupTags[j]);
- }
- propertyGroup.setGroupTags(groupTagsArray);
- } else {
- propertyGroup.setGroupTags(null);
- }
- var groupPItems = propertyGroupMeta["presentationItems"];
- propertyGroup.parse(groupPItems);
- pp._presentationItems.push(propertyGroup);
- }
- }
- } else {
- pp._presentationItems = null;
- }
- return pp;
- },
- /**
- * Perform a deep copy of this object.
- * @return (com.ibm.rave.library.framework.meta.internal.PropertyPresentationMetaImpl) deep copy.
- */
- copy : function() {
- var pp = new com_ibm_rave_library_framework_meta_internal_PropertyPresentationMetaImpl(com_ibm_rave_library_i18n_MessagesRegistry.EmptyRegistry());
- pp._id = this._id;
- pp._name = this._name;
- pp._description = this._description;
- pp._tags = [];
- pp._presentationItems = [];
- pp._icon = this._icon;
- var i = 0;
- for (var __i_enFor0 = 0, __exp_enFor0 = this._tags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- pp._tags[i++] = tag;
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = this._presentationItems, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var item = __exp_enFor1[__i_enFor1];
- if (item.type() == "reference") {
- pp._presentationItems.push(item);
- } else {
- pp._presentationItems.push((item).copy());
- }
- }
- return pp;
- },
- validateProperties : function(properties) {
- var itemsToRemove;
- for (var __i_enFor0 = 0, __exp_enFor0 = this._presentationItems, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var item = __exp_enFor0[__i_enFor0];
- if (item.type() == "reference") {
- var p = properties.property(item.id());
- if (p._hidden) {
- if (!itemsToRemove) {
- itemsToRemove = [];
- }
- itemsToRemove.push(item);
- }
- } else {
- (item).validateProperties(properties);
- }
- }
- if (itemsToRemove) {
- for (var __i_enFor1 = 0, __exp_enFor1 = itemsToRemove, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var item = __exp_enFor1[__i_enFor1];
- var index = this._presentationItems.indexOf(item);
- this._presentationItems.splice(index, 1);
- }
- }
- }
- });
- // $source: com/ibm/rave/library/framework/meta/internal/PropertyReferenceMeta
- /************************************************************************
- ** 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
- /**
- * The PresentationItems interface stores information about a particular property presentation item. Currently, there can be 2 types of property presentation items. PropertyReferenceMeta is one of those types. PropertyReferenceMeta stores the property ID of the property being presented in a group or individually. The type for this particular object is always 'reference'.
- */
- var com_ibm_rave_library_framework_meta_internal_PropertyReferenceMeta = rave['internal']['Declare']({
- /**
- * ID of the property
- */
- //propertyID : null,
- /** @expose */
- id : function() {
- return this.propertyID;
- },
- /** @expose */
- type : function() {
- return "reference";
- },
- /** @expose */
- name : function() {
- return null;
- },
- /** @expose */
- description : function() {
- return null;
- },
- /** @expose */
- tags : function() {
- return null;
- },
- /** @expose */
- icon : function() {
- return null;
- },
- /** @expose */
- presentationItems : function() {
- return null;
- },
- setID : function(id) {
- this.propertyID = id;
- }
- });
- // $source: com/ibm/rave/library/framework/meta/internal/PropertyGroupMeta
- /************************************************************************
- ** 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/framework/meta/internal/PropertyReferenceMeta (runtime) // new
- /**
- * The PresentationItems interface stores information about a particular property presentation item. Currently, there can be 2 types of property presentation items. PropertyGroupMeta is one of those types. PropertyGroupMeta stores meta information about a particular Presentation Item group (such as ID, description, etc) as well as a list of PresentationItems which can consist of Property References or more Groups. The type for this particular object is always 'group'. PropertyGroupMeta is particularly useful when you want to group a bunch of common properties together.
- */
- var com_ibm_rave_library_framework_meta_internal_PropertyGroupMeta = rave['internal']['Declare']({
- /**
- * ID of the presentation group
- */
- //groupID : null,
- /**
- * Name of the presentation group
- */
- //groupName : null,
- /**
- * Description of the presentation group
- */
- //groupDescription : null,
- /**
- * String Tags of the presentation group
- */
- //groupTags : null,
- /**
- * Path to the image icon of the presentation group
- */
- //groupIcon : null,
- /**
- * Localization messages registry
- */
- //messagesRegistry : null,
- /**
- * PresentationItems array that holds references to bundle property IDs as well as nested groups
- */
- //groupPresentationItems : null,
- constructor : function(registry) {
- this.messagesRegistry = registry;
- },
- /** @expose */
- id : function() {
- return this.groupID;
- },
- /** @expose */
- type : function() {
- return "group";
- },
- /** @expose */
- name : function() {
- return this.messagesRegistry._nls(this.groupName, this.groupName);
- },
- /** @expose */
- description : function() {
- return this.messagesRegistry._nls(this.groupDescription, this.groupDescription);
- },
- /** @expose */
- tags : function() {
- return this.groupTags;
- },
- /** @expose */
- icon : function() {
- return this.groupIcon;
- },
- /** @expose */
- presentationItems : function() {
- var presentationItems = [];
- var i = 0;
- for (var __i_enFor0 = 0, __exp_enFor0 = this.groupPresentationItems, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var item = __exp_enFor0[__i_enFor0];
- presentationItems[i++] = item;
- }
- return presentationItems;
- },
- setID : function(id) {
- this.groupID = id;
- },
- setGroupName : function(group) {
- this.groupName = group;
- },
- setGroupDescription : function(description) {
- this.groupDescription = description;
- },
- setGroupTags : function(tags) {
- this.groupTags = tags;
- },
- setGroupIcon : function(icon) {
- this.groupIcon = icon;
- },
- parse : function(pItems) {
- if (pItems) {
- var len = pItems.length;
- this.groupPresentationItems = [];
- for (var i = 0; i < len; ++i) {
- var item = pItems[i];
- var propertyRef = (item["propertyID"]);
- if (propertyRef != null) {
- var property = new com_ibm_rave_library_framework_meta_internal_PropertyReferenceMeta();
- property.setID(propertyRef);
- this.groupPresentationItems.push(property);
- } else {
- var propertyGroup = new com_ibm_rave_library_framework_meta_internal_PropertyGroupMeta(this.messagesRegistry);
- var propertyGroupMeta = item["propertyGroup"];
- propertyGroup.setID((propertyGroupMeta["id"]));
- propertyGroup.setGroupName((propertyGroupMeta["label"]));
- propertyGroup.setGroupDescription((propertyGroupMeta["description"]));
- propertyGroup.setGroupIcon((propertyGroupMeta["icon"]));
- var gTags = propertyGroupMeta["tags"];
- if (gTags) {
- var glen = gTags.length;
- var groupTagsArray = [];
- for (var j = 0; j < len; ++j) {
- groupTagsArray[i] = (gTags[i]);
- }
- propertyGroup.setGroupTags(groupTagsArray);
- } else {
- propertyGroup.setGroupTags(null);
- }
- var groupPItems = propertyGroupMeta["presentationItems"];
- propertyGroup.parse(groupPItems);
- this.groupPresentationItems.push(propertyGroup);
- }
- }
- } else {
- this.groupPresentationItems = null;
- }
- },
- copy : function() {
- var pgm = new com_ibm_rave_library_framework_meta_internal_PropertyGroupMeta(this.messagesRegistry);
- pgm.groupDescription = this.groupDescription;
- pgm.groupIcon = this.groupIcon;
- pgm.groupID = this.groupID;
- pgm.groupName = this.groupName;
- var i = 0;
- pgm.groupTags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this.groupTags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- pgm.groupTags[i++] = tag;
- }
- pgm.groupPresentationItems = [];
- for (var __i_enFor1 = 0, __exp_enFor1 = this.groupPresentationItems, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var item = __exp_enFor1[__i_enFor1];
- if (item.type() == "reference") {
- pgm.groupPresentationItems.push(item);
- } else {
- pgm.groupPresentationItems.push((item).copy());
- }
- }
- return pgm;
- },
- validateProperties : function(properties) {
- var itemsToRemove;
- for (var __i_enFor0 = 0, __exp_enFor0 = this.groupPresentationItems, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var item = __exp_enFor0[__i_enFor0];
- if (item.type() == "reference") {
- var p = properties.property(item.id());
- if (p._hidden) {
- if (!itemsToRemove) {
- itemsToRemove = [];
- }
- itemsToRemove.push(item);
- }
- } else {
- (item).validateProperties(properties);
- }
- }
- if (itemsToRemove) {
- for (var __i_enFor1 = 0, __exp_enFor1 = itemsToRemove, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var item = __exp_enFor1[__i_enFor1];
- var index = this.groupPresentationItems.indexOf(item);
- this.groupPresentationItems.splice(index, 1);
- }
- }
- }
- });
- // $source: com/ibm/rave/library/property/PropertyImpl
- /************************************************************************
- ** 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 (runtime) // logError
- /**
- * Property Validation Rules: id and type are required type must be one of the permitted values cardinality must be one of the permitted values
- */
- var com_ibm_rave_library_property_PropertyImpl = rave_library_externs["PropertyImpl"] = rave['internal']['Declare']({
- //_value : null,
- //_propertyType : null,
- //_parent : null,
- _readonly : false,
- _hidden : false,
- /** @expose */
- constructor : function(propertyType, parent) {
- this._propertyType = propertyType;
- this._parent = parent;
- if (propertyType.typeId() == 21) {
- this._value = {};
- } else {
- this._value = propertyType.defaultValue();
- }
- },
- /**
- * @return (boolean) Whether the property is readonly
- */
- readonly : function() {
- return this._readonly;
- },
- /**
- * Make the property readonly. It cannot be made writable again.
- */
- setReadonly : function() {
- this._readonly = true;
- },
- /**
- * @return (boolean) Whether the property is hidden
- */
- /** @expose */
- hidden : function() {
- return this._hidden;
- },
- /**
- * Make the property hidden. It cannot be made visible again.
- */
- setHidden : function() {
- this._hidden = true;
- },
- /** @expose */
- meta : function() {
- return this._propertyType;
- },
- /** @expose */
- parent : function() {
- return this._parent;
- },
- /** @expose */
- reset : function() {
- if (!(this._readonly)) {
- var defs = this._propertyType.defaultValue();
- if (defs != null) {
- this.setValue(defs);
- }
- }
- return this._value;
- },
- value$0 : function() {
- return this._value;
- },
- value$1 : function(obj) {
- if (this._readonly) {
- com_ibm_rave_library_Library.logError(35, "Property validate");
- return false;
- }
- if (obj == null) {
- if (this._propertyType.required()) {
- if (this._propertyType.defaultValue() == null) {
- com_ibm_rave_library_Library.logError(40, "Property validate");
- return false;
- }
- if (!(this._propertyType.validateValue(this._propertyType.defaultValue()))) {
- return false;
- }
- this.reset();
- return true;
- }
- } else {
- if (!(this._propertyType.validateValue(obj))) {
- return false;
- }
- }
- return this.setValue(obj);
- },
- setValue : function(obj) {
- this._value = this._propertyType.canonicalValue(obj);
- if (this._parent && this._parent.meta().typeId() == 21) {
- var valueInstance = this._parent.value();
- valueInstance[this._propertyType.simpleId()] = this._value;
- }
- return true;
- },
- /** @expose */
- value : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.value$0();
- }
- return this.value$1(a0);
- }
- });
- // $source: com/ibm/rave/library/action/internal/ActionsManager
- /************************************************************************
- ** 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/action/internal/BindingManager (runtime) // new
- //@import com/ibm/rave/library/framework/meta/ActionMeta (runtime) // parse
- //@import com/ibm/rave/library/action/internal/ActionImpl (runtime) // new
- /**
- * ActionManager handles parsing action JSON descriptors and creating corresponding instances. Action metadata is stored separately from the Action instances. Action instances can be retrieved by ID using the {@link #this.action(String)} method. <br /> Action bindings are also populated from the JSON descriptors.
- */
- var com_ibm_rave_library_action_internal_ActionsManager = rave['internal']['Declare']({
- /**
- * Map from action ID to implementation
- */
- //actionMap : null,
- /**
- * List of metadata for all defined actions
- */
- //_meta : null,
- //bindingManager : null,
- //bindingsToRemove : null,
- constructor : function() {
- this.actionMap = {};
- this._meta = [];
- this.bindingManager = new com_ibm_rave_library_action_internal_BindingManager();
- this.bindingsToRemove = [];
- },
- /**
- * Create action instances and record associated bindings for all actions defined in the provided JSON.
- * @param (Array) json JSON array of Action descriptors.
- */
- populate$0 : function(json, messages) {
- var actionList = [];
- for (var i = 0; i < json.length; ++i) {
- actionList.push(com_ibm_rave_library_framework_meta_ActionMeta.parse(json[i], messages));
- }
- this.populate$1(actionList);
- },
- populateFromMeta : function(info) {
- this.actionMap[info.id()] = new com_ibm_rave_library_action_internal_ActionImpl(info);
- if (info.defaultBindings()) {
- for (var j = 0; j < info.defaultBindings().length; ++j) {
- var b = info.defaultBindings()[j];
- this.bindingManager.addBinding(info.id(), b.target(), b.event());
- }
- }
- },
- /**
- * Populate this action manager from a list of existing ActionMeta object.
- * @param (Array) actions
- */
- populate$1 : function(actions) {
- for (var __i_enFor0 = 0, __exp_enFor0 = actions, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var action = __exp_enFor0[__i_enFor0];
- this.populateFromMeta(action);
- }
- this._meta = [];
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(this.actionMap), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- this._meta.push(this.actionMap[key].meta());
- }
- },
- /**
- * <p> Configure actions from the given JSON. If it does not have a "actions" property, nothing is done. </p> <p> Otherwise, the "actions" is an array of objects describing the actions configuration, as in the schema. The array is traversed and used to mark actions enabled or disabled. An action can be invoked in the following way: {@code Rave.selectAll(".element-shape").on("click", bundle.action("highlight").actionFunction().call(Object... args)} </p>
- */
- configure : function(json) {
- json["actions"];
- },
- /**
- * @return (Array) List of actions metadata
- */
- meta : function() {
- return this._meta;
- },
- /**
- * Retrieve an Action by id.
- * @param (String) id Action id (defined in Actions.json).
- * @return (com.ibm.rave.library.action.internal.ActionImpl) The Action, or null if none exists for the given id.
- */
- action : function(id) {
- return this.actionMap[id];
- },
- /**
- * Apply all bindings to the scene nodes contained in the provided selector. For each bindings, the action is registered as the event listener on each scene node captured by the binding's target selector. <br /> This method should be called after any bindings have been removed/added, in order to reflect that change in the existing visualization.
- */
- applyBindings : function() {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this.actionMap), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var actionKey = __exp_enFor0[__i_enFor0];
- if (this.actionMap[actionKey].autoBind$0()) {
- this.actionMap[actionKey].getBinding()();
- }
- }
- },
- populate : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.populate$1(a0);
- }
- return this.populate$0(a0, a1);
- }
- });
- // $source: com/ibm/rave/library/action/internal/BindingManager
- /************************************************************************
- ** 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/action/internal/Binding (runtime) // new
- /**
- * BindingManager maintains the mapping between actions and their triggers within the context of the visualization. Duplicate bindings are avoided. <br /> A binding maps an action to an event originating from a particular target. A target is any CSS selector, e.g. ".element-shape". The target must be contained by the visualization container element (i.e. the <svg> node), meaning that this API cannot be used to bind actions to elements outside the visualization.
- */
- var com_ibm_rave_library_action_internal_BindingManager = rave['internal']['Declare']({
- /**
- * The binding map structure follows this form: <pre> { "action_id" : { "target_selector" : [ "event_name1", "event_name2", ... ] }, "highlight" : { ".element-shape" : [ "click", "touch" ], ".legendEntry" : [ "mouseover" ] } } </pre> In the "highlight" example, the action with id "highlight" is bound to two targets: elements with class "element-shape", and elements with class "legendEntry". The "element-shape" target is bound to "click" and "touch" events, while the "legendEntry" target is bound to "mouseover" events. Note the list of events is actually a map, to ensure there are no duplicate events for a target. The mapping value is a flattened container for the full binding: <pre> {action: action_id, target: target_selector, event: event_name1}. </pre>
- */
- //bindingMap : null,
- constructor : function() {
- this.bindingMap = rave['internal']['ES6Map'].create();
- },
- /**
- * Create an entry that maps an action to an event on a particular target context. E.g. Bind the "highlight" action to the "click" event originating from the selection ".element-shape" (i.e. all elements with class "element-shape").
- * @param (String) action Action id.
- * @param (String) target Selector within context of the visualization. e.g. ".elements".
- * @param (String) event SVG event name, e.g. "click".
- */
- addBinding : function(action, target, event) {
- var actionBinding = this.bindingMap.get(action);
- if (!actionBinding) {
- actionBinding = rave['internal']['ES6Map'].create();
- this.bindingMap.set(action, actionBinding);
- }
- var targetEvents = actionBinding.get(target);
- if (!targetEvents) {
- targetEvents = rave['internal']['ES6Map'].create();
- actionBinding.set(target, targetEvents);
- }
- targetEvents.set(event, new com_ibm_rave_library_action_internal_Binding(action, target, event));
- },
- /**
- * Remove a binding.
- * @param (String) action Action id.
- * @param (String) target Selector within context of the visualization. e.g. ".elements".
- * @param (String) event SVG event name, e.g. "click".
- * @return (com.ibm.rave.library.action.internal.Binding) The removed binding info, or null if the binding did not exist.
- */
- removeBinding : function(action, target, event) {
- var existingBinding;
- var actionBinding = this.bindingMap.get(action);
- if (actionBinding) {
- var targetEvents = actionBinding.get(target);
- if (targetEvents) {
- existingBinding = targetEvents.get(event);
- targetEvents.remove(event);
- }
- }
- return existingBinding;
- },
- /**
- * @return (Array) List of <em>all</em> bindings, for all actions.
- */
- getBindings : function() {
- var bindings = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this.bindingMap.keys(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var action = __exp_enFor0[__i_enFor0];
- bindings = bindings.concat(this.getBindingsForAction(action));
- }
- return bindings;
- },
- /**
- * Returns a list of all bindings associated with the provided action id.
- * @param (String) action Action id.
- */
- getBindingsForAction : function(action) {
- var bindings = [];
- var targets = this.bindingMap.get(action);
- if (targets) {
- for (var __i_enFor0 = 0, __exp_enFor0 = targets.entries(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var target = __exp_enFor0[__i_enFor0];
- for (var __i_enFor1 = 0, __exp_enFor1 = target.value.entries(), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var event = __exp_enFor1[__i_enFor1];
- bindings.push(event.value);
- }
- }
- }
- return bindings;
- }
- });
- // $source: com/ibm/rave/library/action/internal/Binding
- /************************************************************************
- ** 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
- /**
- * Container for a single binding entry. This contains all information required to add an event listener using the Rave.core API: <pre> node.select(bindingInfo.target()) .on(bindingInfo.event() + "." + bindingInfo.action(), actionCallback); </pre>
- */
- var com_ibm_rave_library_action_internal_Binding = rave['internal']['Declare']({
- //_action : null, //_target : null, //_event : null,
- constructor : function(action, target, event) {
- this._action = action;
- this._target = target;
- this._event = event;
- },
- /**
- * Action id.
- */
- action : function() {
- return this._action;
- },
- /**
- * Target selector string (e.g. ".element-shape").
- */
- target : function() {
- return this._target;
- },
- /**
- * Event name which triggers the action.
- */
- event : function() {
- return this._event;
- }
- });
- // $source: com/ibm/rave/library/action/Action
- /************************************************************************
- ** 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
- /**
- * An Action executes a particular function within a bundle visualization. An action can be bound to an event using the Rave 2 event syntax, e.g: <br /><br /> {@code rave.selectAll(".element-shape").on("click", bundle.action("highlight")([args])} <br /><br /> where ".element-shape" references an element class defined by the bundle, "click" is the DOM event type, and bundle.action("highlight") retrieves the "highlight" action that is defined in the bundle.
- */
- var com_ibm_rave_library_action_Action = rave_library_externs["Action"] = rave['internal']['Declare']({
- /**
- * Sets whether automatic binding should be set within the action
- * @param (boolean) bind true to automatically bind action, false to not automatically bind action.
- */
- /** @expose */
- autoBind : function(bind) {},
- /**
- * Overrides the default operation attached to the action
- * @param (com.ibm.rave.library.action.ActionOperation) operation new action operation
- * @return (com.ibm.rave.library.action.Action) this
- */
- /** @expose */
- setOperation : function(operation) {},
- /**
- * @see ActionOperation#this.get(String) Delegates to the actionOperation's get method.
- */
- /** @expose */
- get : function(id) {}
- });
- // $source: com/ibm/rave/library/framework/internal/ContextSize
- /************************************************************************
- ** 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_library_framework_internal_ContextSize = function(){};
- // $source: com/ibm/rave/library/framework/internal/CustomFormatInfoImpl
- /************************************************************************
- ** 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
- /**
- * Internal implementing class for {@link (com.ibm.rave.library.framework.CustomFormatInfo) CustomFormatInfo} .
- */
- var com_ibm_rave_library_framework_internal_CustomFormatInfoImpl = rave['internal']['Declare']({
- /**
- * The type
- */
- //_type : null,
- /**
- * The role
- */
- //_role : null,
- /**
- * The format
- */
- //_format : null,
- /**
- * The array of entries
- */
- //_entries : null,
- /**
- * Constructor. The string arguments are not checked for validity, and all should be non-null. The strings should be allowed values as defined in CustomFormatInfo. If the list is null an empty list is used instead.
- * @param (String) type CustomFormatInfo type
- * @param (String) role CustomFormatInfo role
- * @param (String) format CustomFormatInfo format hint
- * @param (Array) entries Data slot entries associated with the data to be formatted
- */
- constructor : function(type, role, format, entries) {
- this._type = type;
- this._role = role;
- this._format = format;
- this._entries = entries ? entries : [];
- },
- /** @expose */
- type : function() {
- return this._type;
- },
- /** @expose */
- role : function() {
- return this._role;
- },
- /** @expose */
- format : function() {
- return this._format;
- },
- /** @expose */
- entries : function() {
- return this._entries;
- }
- });
- /**
- * Utility to construct a formatter for a single data slot entry, the common case. The string arguments are not checked for validity, and all should be non-null. A list of entries is created and if the entry is non-null, it is added.
- * @param (String) type CustomFormatInfo type
- * @param (String) role CustomFormatInfo role
- * @param (String) format CustomFormatInfo format hint
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) entry The single slot entry associated with the data to be formatted
- * @return (com.ibm.rave.library.framework.CustomFormatInfo) CustomFormatInfo with that information
- */
- com_ibm_rave_library_framework_internal_CustomFormatInfoImpl.makeForEntry = function(type, role, format, entry) {
- var entries = [];
- if (entry) {
- entries.push(entry);
- }
- return new com_ibm_rave_library_framework_internal_CustomFormatInfoImpl(type, role, format, entries);
- };
- // $source: com/ibm/rave/library/framework/internal/CSSConverter
- /************************************************************************
- ** 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
- /**
- * Utilities to convert CSS size to pixels, or to a formatted "px" string.
- */
- var com_ibm_rave_library_framework_internal_CSSConverter = rave['internal']['Declare']({
- });
- /**
- * Convert a value representing a CSSSize to a length in pixels. "%" depends on the extent, and "em" on the font height. Returns null for null or unparsable string.
- * @param (Object) value The value, may be null, number, or string
- * @param (double) extent Used for "%", the length in pixels for 100%
- * @param (double) em Used for "em", the length in pixels for 1em
- * @return (Number) Size as string ending with "px", or null
- */
- com_ibm_rave_library_framework_internal_CSSConverter.convertCSSSizeToPixelNumber = function(value, extent, em) {
- if (value == null) {
- return null;
- }
- var s = ""+(value);
- var l = s.length;
- if (l == 0) {
- return null;
- }
- var number = s;
- var found = false;
- var multiplier = 1.0;
- if (l > 2) {
- number = s.substring(0, l - 2);
- var u = s.substring(l - 2).toLowerCase();
- if ("px" == u) {
- found = true;
- multiplier = 1.0;
- } else if ("in" == u) {
- found = true;
- multiplier = 96.0;
- } else if ("pt" == u) {
- found = true;
- multiplier = 96.0 / 72.0;
- } else if ("pc" == u) {
- found = true;
- multiplier = 96.0 / 6.0;
- } else if ("em" == u) {
- found = true;
- multiplier = em;
- } else if ("cm" == u) {
- found = true;
- multiplier = 96.0 / 2.54;
- } else if ("mm" == u) {
- found = true;
- multiplier = 96.0 / 25.4;
- }
- }
- if (!found) {
- if (l > 1 && "%" == s.substring(l - 1)) {
- number = s.substring(0, l - 1);
- multiplier = extent / 100.0;
- } else {
- number = s;
- multiplier = 1.0;
- }
- }
- var v = + (number);
- if (isNaN(v)) {
- return null;
- }
- return v * multiplier;
- };
- /**
- * Convert a value representing a CSSSize to a string for the size with "px" units. For example, "0.5in" will become "48px". The number part is rounded to two digits. Returns null for null or an unparsable string.
- * @param (Object) value The value, may be null, number, or string
- * @param (double) extent Used for "%", the length in pixels for 100%
- * @param (double) em Used for "em", the length in pixels for 1em
- * @return (String) Size as string ending with "px", or null
- */
- com_ibm_rave_library_framework_internal_CSSConverter.convertCSSSizeToPixel = function(value, extent, em) {
- var v = com_ibm_rave_library_framework_internal_CSSConverter.convertCSSSizeToPixelNumber(value, extent, em);
- if (v == null) {
- return null;
- }
- return ""+((Math.round(100 * v) / 100.0)) + "px";
- };
- // $source: com/ibm/rave/library/framework/meta/internal/PropertyPresentationManager
- /************************************************************************
- ** 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/framework/meta/internal/PropertyPresentationMetaImpl (runtime) // new
- /**
- * Placeholder implementation for property presentation manager. Presentations are represented by PropertyPresentationMetaImpl
- */
- var com_ibm_rave_library_framework_meta_internal_PropertyPresentationManager = rave['internal']['Declare']({
- /**
- * Map from ID to presentation, with all defined property presentations
- */
- //_presentations : null,
- /**
- * Hidden presentation IDs
- */
- //_hiddenPresentations : null,
- /**
- * List of visible presentations, null when it must be created.
- */
- //_visiblePresentations : null,
- /**
- * Localization messages registry
- */
- //_messagesRegistry : null,
- /**
- * Construct. No presentations are defined.
- */
- constructor : function(registry) {
- this._presentations = {};
- this._hiddenPresentations = {};
- this._visiblePresentations = null;
- this._messagesRegistry = registry;
- },
- /**
- * <p> Populate presentations from the given JSON, which may define presentations. If it does not have a "propertyPresentations" property, nothing is done. </p> <p> Otherwise, the "propertyPresentations" property is taken as an array of objects describing presentations. If the object "id" is already defined, it is skipped (no overwrite of existing presentations). Otherwise a new presentation for the object is created and added to the collection. </p>
- * @param (Object) json JSON descriptor
- */
- populate : function(json) {
- var v = json["propertyPresentations"];
- if (v != null) {
- var ppMeta = new com_ibm_rave_library_framework_meta_internal_PropertyPresentationMetaImpl(this._messagesRegistry);
- for (var __i_enFor0 = 0, __exp_enFor0 = v, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var pp = o;
- var id = (pp["id"]);
- if (id != null && !(this._presentations.hasOwnProperty(id))) {
- this._presentations[id] = ppMeta.parse(pp);
- }
- }
- this._visiblePresentations = null;
- }
- },
- /**
- * Configure presentations from the given JSON. If it does not have a "propertyPresentations" property, nothing is done. Otherwise the the "propertyPresentations" property is taken as an array of of objects configuring presentations, with an "id" and "hidden" fields. Any ids with "hidden":true are hidden.
- * @param (Object) json JSON descriptor
- */
- configure : function(json) {
- var v = json["propertyPresentations"];
- if (v != null) {
- for (var __i_enFor0 = 0, __exp_enFor0 = v, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var pp = o;
- var id = (pp["id"]);
- var hidden = (pp["hidden"] != null) ? (pp["hidden"]) : null;
- if (id != null && hidden != null && hidden) {
- this._hiddenPresentations[id] = 1;
- }
- }
- this._visiblePresentations = null;
- }
- },
- /**
- * @return (Array) Metadata for visible property presentations.
- */
- meta : function() {
- if (!this._visiblePresentations) {
- this._visiblePresentations = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this._presentations), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var id = __exp_enFor0[__i_enFor0];
- if (!(this._hiddenPresentations.hasOwnProperty(id))) {
- this._visiblePresentations.push(this._presentations[id]);
- }
- }
- }
- return this._visiblePresentations;
- },
- /**
- * Add a new presentation meta object by ID to this manager. Will override any existing meta object with this ID.
- * @param (com.ibm.rave.library.framework.meta.internal.PropertyPresentationMetaImpl) presentation Presentation meta object.
- */
- put : function(presentation) {
- this._presentations[presentation.id()] = presentation;
- this._visiblePresentations = null;
- }
- });
- // $source: com/ibm/rave/library/framework/internal/HierarchyUtility
- /************************************************************************
- ** 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> Converts data in either of two forms to a tree of T nodes, where T is a subclass of HierarchyNode (ClusterNode, TreemapNode, etc.). The class instance is constructed with a factory that creates new instances of the T subclass. </p> <p> The buildHierarchy method traverses a tree of arbitrary Object nodes and builds a matching tree of T nodes. It is provided with two accessors, both applied to the arbitrary Object nodes. The children accessor is used to traverse the tree, and the value accessor is used to set the HierarchyNode value. </p> <p> The buildTabular method uses an array of arbitrary Object nodes and builds a two-level tree of T nodes. All objects in the array become children of the tree's root. The value accessor is used to set the HierarchyNode value. </p> <p> The result object has the T tree, the original Object tree, a flattened array-list of the T nodes, two flattened lists of the original Object nodes, and the range of values. The array-lists may be used by methods that need to scan all the nodes, for example to build a domain from data values. The tree depth and parent fields are set correctly. </p>
- */
- var com_ibm_rave_library_framework_internal_HierarchyUtility = rave['internal']['Declare']({
- /**
- * The factory passed to the constructor
- */
- //_factory : null,
- constructor : function(factory) {
- this._factory = factory;
- },
- /**
- * <p> Construct a HierarchyNode tree from the given Object tree. If the original root is null, a null tree is returned (the HierarchyNode root is null, all node lists are empty, and the min and max range values are both 1). Otherwise the returned HierarchyNode tree duplicates the structure of the Object tree. </p> <p> The childrenAccessor function is applied to an Object in the tree and returns an array-list of Object (it is simpler in the bundle framework to declare it as returning an Object). It may return null if the object has no children. This is used to traverse the Object tree. If it is null, the returned tree will have only the root node. </p> <p> The valueAccessor function is optional. If provided, it is applied to an Object in the tree and returns a Number (again it is simpler to declare it as returning Object), which is used as the HierarchyNode's value. If the accessor returns null or is null, the node's value is set to the defaultValue. </p> <p> The HierarchyNode data is set to the original node Object, and the parent and depth fields are set correctly. </p>
- * @param (Object) originalRoot Original root; if null, a null tree is returned
- * @param (rave['internal']['SingleValueFunction']) childrenAccessor Children accessor; if null, the returned tree has only the root
- * @param (rave['internal']['SingleValueFunction']) valueAccessor Optional value accessor
- * @param (double) defaultValue Default value if accessor returns null, or if there is no accessor
- * @return (com.ibm.rave.library.framework.internal.HierarchyUtility.HUResult) HUResult with the tree
- */
- buildHierarchy : function(originalRoot, childrenAccessor, valueAccessor, defaultValue) {
- var result = new com_ibm_rave_library_framework_internal_HierarchyUtility.HUResult();
- if (originalRoot == null) {
- result._minValue = 1.0;
- result._maxValue = 1.0;
- return result;
- }
- var vf = this.valueFunction(valueAccessor, defaultValue);
- result._root = this.make(result, originalRoot, vf, null);
- if (!childrenAccessor) {
- result._originalLeaves.push(originalRoot);
- return result;
- }
- this.processTree(result, result._root, childrenAccessor, vf);
- return result;
- },
- /**
- * Process a node to add its children to the tree, recursively processing each of those nodes. All arguments are non-null. The node may or may not have children. It has already been added to the result, but not to the leaf list in the result; it is added to that list only if it has no non-null children.
- * @param (com.ibm.rave.library.framework.internal.HierarchyUtility.HUResult) result Result being built
- * @param (Object) node The HierarchyNode being processed; its data is the Object from the original tree
- * @param (rave['internal']['SingleValueFunction']) childrenAccessor Non-null children accessor
- * @param (rave['internal']['SingleValueFunction']) valueAccessor Non-null value accessor
- */
- processTree : function(result, node, childrenAccessor, valueAccessor) {
- var oChildren = childrenAccessor(node["data"]);
- if (oChildren) {
- var children = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = oChildren, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var oChild = __exp_enFor0[__i_enFor0];
- if (oChild != null) {
- var child = this.make(result, oChild, valueAccessor, node);
- children.push(child);
- this.processTree(result, child, childrenAccessor, valueAccessor);
- }
- }
- if (children.length != 0) {
- node["children"] = children;
- }
- }
- if (!node["children"]) {
- result._originalLeaves.push(node["data"]);
- }
- },
- /**
- * <p> Construct a HierarchyNode tree from the given array-list of objects. If the array-list is null or empty, a null tree is returned (the HierarchyNode root is null, all node lists are empty, and the min and max range values are both 1). Otherwise the returned HierarchyNode tree is a single root node, with one child per non-null array entry. </p> <p> The valueAccessor function is optional. If provided, it is applied to an Object in the tree and returns a Number (again it is simpler to declare it as returning Object), which is used as the HierarchyNode's value. If the accessor returns null or is null, the node's value is set to the defaultValue. </p> <p> The HierarchyNode data is set to the original node Object, and the parent and depth fields are set correctly. The root has no data. </p>
- * @param (Array) objects Array-lis tof objects
- * @param (rave['internal']['SingleValueFunction']) valueAccessor Optional value accessor
- * @param (double) defaultValue Default value if accessor returns null, or if there is no accessor
- * @return (com.ibm.rave.library.framework.internal.HierarchyUtility.HUResult) HUResult with the tree
- */
- buildTabular : function(objects, valueAccessor, defaultValue) {
- var result = new com_ibm_rave_library_framework_internal_HierarchyUtility.HUResult();
- if (!objects || objects.length == 0) {
- result._minValue = 1.0;
- result._maxValue = 1.0;
- return result;
- }
- var vf = this.valueFunction(valueAccessor, defaultValue);
- var root = this._factory();
- result._root = root;
- root["data"] = null;
- root["value"] = defaultValue;
- root["parent"] = null;
- root["depth"] = 0;
- var children = [];
- root["children"] = children;
- for (var __i_enFor0 = 0, __exp_enFor0 = objects, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var oChild = __exp_enFor0[__i_enFor0];
- if (oChild != null) {
- var child = this.make(result, oChild, vf, root);
- children.push(child);
- result._originalLeaves.push(oChild);
- }
- }
- return result;
- },
- /**
- * Make a tree node for the given original node which must be non-null. The tree node's data is the object o, its value is the result of applying vf to o (the vf is one that does not return null), its parent is the given parent node, and its depth is the parent's depth plus 1 (0 if the parent is null). The node and original node are added to the lists in the result and the value range is updated.
- * @param (com.ibm.rave.library.framework.internal.HierarchyUtility.HUResult) result Result being build
- * @param (Object) o Original tree object
- * @param (rave['internal']['SingleValueFunction']) vf Value function
- * @param (Object) parent Parent node
- * @return (Object) Tree node for the object
- */
- make : function(result, o, vf, parent) {
- var node = this._factory();
- node["data"] = o;
- node["value"] = + (vf(o));
- node["parent"] = parent;
- node["depth"] = parent ? parent["depth"] + 1 : 0;
- node["children"] = null;
- result._nodes.push(node);
- result._originalNodes.push(o);
- result._minValue = Math.min(result._minValue, node["value"]);
- result._maxValue = Math.max(result._maxValue, node["value"]);
- return node;
- },
- /**
- * Returns an value function to set the values of tree nodes. If the value accessor is non-null, the function returns the accessor applied to the tree datum, returning defaultValue if the accessor returns null. If the value accessor is null, the function always returns defaultValue.
- * @param (rave['internal']['SingleValueFunction']) valueAccessor The value accessor to apply to the Object nodes
- * @param (double) defaultValue Default value to use
- * @return (rave['internal']['SingleValueFunction']) Non-null value function
- */
- valueFunction : function(valueAccessor, defaultValue) {
- if (valueAccessor) {
- return function(o) {
- var v = + (valueAccessor(o));
- return v != null ? v : defaultValue;
- };
- }
- return function(o) {
- return defaultValue;
- };
- }
- });
- /**
- * Factory class to create a new instance of the HierarchyNode subclass.
- */
- com_ibm_rave_library_framework_internal_HierarchyUtility.HUFactory = rave['internal']['Declare']({
- });
- /**
- * Result of calling build.
- */
- com_ibm_rave_library_framework_internal_HierarchyUtility.HUResult = rave['internal']['Declare']({
- /**
- * The tree of HierarchyNodes
- */
- //_root : null,
- /**
- * Array-list of all HierarchyNode in the tree
- */
- //_nodes : null,
- /**
- * Array-list of all Object nodes in the original tree or array
- */
- //_originalNodes : null,
- /**
- * Array-list of leaf Object nodes in the original tree
- */
- //_originalLeaves : null,
- /**
- * Minimum value assigned to any tree node
- */
- _minValue : 0,
- /**
- * Maximum value assigned to any tree node
- */
- _maxValue : 0,
- /**
- * Construct an instance. The hierarchy root is null, all lists are empty, and the range min/max are positive and negative infinity respectively.
- */
- constructor : function() {
- this._root = null;
- this._nodes = [];
- this._originalNodes = [];
- this._originalLeaves = [];
- this._minValue = Infinity;
- this._maxValue = -Infinity;
- }
- });
- // $source: com/ibm/rave/library/framework/CustomFormatter
- /************************************************************************
- ** 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> API for custom formatting functions. Formatting functions are used for the text items in a chart, generically called "labels". A label starts with a data value which may be numeric, string, or date, and must be converted into a string for use in the text item. The RAVE core has code to do this conversion. Integrators may define their own custom formatters to change the formatting behavior. </p> <p> Integrators implement this interface and register an instance using {@link this.Controller#this.setCustomFormatter(String, com_ibm_rave_library_framework_CustomFormatter)} . Java example: </p> <pre> chart.setCustomFormatter(CustomFormatterFunction.ALL, new CustomFormatterFunction() { public String getValue(Object context, Object value, int index, int group, CustomFormatInfo info) { // convert value to a string and return it } }); </pre> <p> In JavaScript the interface translates to a function which is invoked with the Java <code>context</code> argument as the <code>this</code> reference, and the other four Java arguments as function arguments. Example: </p> <pre> chart.setCustomFormatter("all", function(value, index, group, info) { // convert value to a string and return it }); </pre> <h3>Targets</h3> <p> The target strings are defined in this class. A custom formatter function may be registered for each possible target. At runtime, the chart searches the registered custom formatters to find the one which is to be used, given the context in which the formatted value is used. If no registered formatter applies, the default RAVE core formatter is used for the value. </p> <p> The targets are searched as follows. In each case the first non-null registered formatter found is used. </p> <dl> <dt>Element label</dt> <dd> {@link #"label"} , {@link #"all"} </dd> <dt>Axis title or axis tick label</dt> <dd> The axis has a logical <I>role</I> in the chart; it is the first X (independent) axis, or the first Y (dependent axis), etc. It also has a physical <I>position</I> in the chart; it is on the bottom, the left, etc. The search order is the role, the position, {@link #"axis"} , and finally {@link #"all"} . For example in a non-transposed scatterplot, the first X axis is on the bottom, so the search order is {@link #"ROLE_X1"} , {@link #"bottom"} , {@link #"axis"} , {@link #"all"} . </dd> <dt>Legend title or legend label</dt> <dd> {@link #"legend"} , {@link #"all"} </dd> </dl>
- */
- var com_ibm_rave_library_framework_CustomFormatter = rave_library_externs["CustomFormatter"] = rave['internal']['Declare']({
- });
- /**
- * Target: The first X (independent) axis.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.X1_AXIS = "ROLE_X1";
- /**
- * Target: The first Y (dependent) axis.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.Y1_AXIS = "ROLE_Y1";
- /**
- * Target: The second X (independent) axis. (Not currently used in any RAVE bundles.)
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.X2_AXIS = "ROLE_X2";
- /**
- * Target: The secon Y (dependent) axis. (Used in the composite bundle.)
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.Y2_AXIS = "ROLE_Y2";
- /**
- * Target: The axis at the bottom of the chart.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.BOTTOM_AXIS = "bottom";
- /**
- * Target: The axis at the top of the chart.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.TOP_AXIS = "top";
- /**
- * Target: The axis at the left of the chart.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.LEFT_AXIS = "left";
- /**
- * Target: The axis at the right of the chart.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.RIGHT_AXIS = "right";
- /**
- * Target: All axes.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.AXIS = "axis";
- /**
- * Target: An element label.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.LABEL = "label";
- /**
- * Target: A legend label.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.LEGEND = "legend";
- /**
- * Target: All labels.
- */
- /** @expose */
- com_ibm_rave_library_framework_CustomFormatter.ALL = "all";
- // $source: com/ibm/rave/library/bundleData/ChordBundleChordDatum
- /************************************************************************
- ** 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
- /**
- * Datum object representing a chord
- */
- var com_ibm_rave_library_bundleData_ChordBundleChordDatum = rave_library_externs["ChordBundleChordDatum"] = rave['internal']['Declare']({
- //_chordData : null,
- //_chordOriginalData : null,
- /** @expose */
- originalData : function() {
- return this._chordOriginalData;
- },
- /** @expose */
- originalDataList : function() {
- var list = [];
- list.push(this._chordOriginalData);
- return list;
- },
- /**
- * Set chord original data
- */
- /** @expose */
- setChordOriginalData : function(originalData) {
- this._chordOriginalData = originalData;
- },
- /**
- * Set the ChordData for this datum object
- */
- /** @expose */
- setChordData : function(chordData) {
- this._chordData = chordData;
- },
- /**
- * Get the ChordData from this datum object
- */
- /** @expose */
- getChordData : function() {
- return this._chordData;
- }
- });
- // $source: com/ibm/rave/library/framework/BundleConfigPropertyIDs
- /************************************************************************
- ** 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
- /**
- * Constant strings for the common property IDs defined in the object passed in to {@link this.Bundle#this.configure(Object, com_ibm_rave_library_framework_Controller.Callback)} The code uses these strings, so this file must be kept in sync with the JSON files declaring the properties. The convention used here is that the string constant name is the property ID in all-caps, with "_" between words
- */
- var com_ibm_rave_library_framework_BundleConfigPropertyIDs = rave_library_externs["BundleConfigPropertyIDs"] = rave['internal']['Declare']({
- });
- /**
- * They mapbox access token used for accessing styles on the account
- */
- /** @expose */
- com_ibm_rave_library_framework_BundleConfigPropertyIDs.MAPBOX_SECRET_TOKEN = "Mapbox.secretToken";
- /**
- * The Mapbox account token used for rendering mapbox
- */
- /** @expose */
- com_ibm_rave_library_framework_BundleConfigPropertyIDs.MAPBOX_TOKEN = "Mapbox.token";
- /**
- * The Mapbox account name used
- */
- /** @expose */
- com_ibm_rave_library_framework_BundleConfigPropertyIDs.MAPBOX_ACCOUNT_NAME = "Mapbox.accountName";
- // $source: com/ibm/rave/library/action/SelectionManager
- /************************************************************************
- ** 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
- /**
- * TODO: DOCS! Note: It is up to the client of this class to ensure that any selection passed to highlight/select/etc. contains scene nodes that are members of the provided context. If they are not, then this manager will not detect changes to "selected" or "deemphasized" states.
- */
- var com_ibm_rave_library_action_SelectionManager = rave_library_externs["SelectionManager"] = rave['internal']['Declare']({
- //_context : null,
- //_stateChangeCallback : null,
- constructor : function() {
- this._context = rave.selection();
- this._stateChangeCallback = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- return null;
- }
- };
- {}
- },
- /**
- * Set the selection of scene nodes which can be "highlighted" or "selected". If a scene changes (i.e. the set of highlightable/selectable nodes), and scene nodes are added/removed, then the context must be updated. Otherwise this selection manager will be using a stale selection of nodes which may or may not still exist in the scene.
- * @param (rave['internal']['Selection']) context Selection of scene nodes that can be highlighted/selected.
- */
- /** @expose */
- updateContext : function(context) {
- this._context = context;
- var selected = com_ibm_rave_library_action_SelectionManager.filterSelected(this._context, true);
- if (selected.empty()) {
- this._context.each(com_ibm_rave_library_action_SelectionManager.REMOVE_DEEMPHASIZED_STATE);
- } else {
- com_ibm_rave_library_action_SelectionManager.filterSelected(this._context, false).each(com_ibm_rave_library_action_SelectionManager.APPLY_DEEMPHASIZED_STATE);
- }
- this.stateChanged();
- return this;
- },
- /** @expose */
- onStateChange : function(callback) {
- this._stateChangeCallback = callback;
- return this;
- },
- /** @expose */
- highlight : function(selection) {
- selection.each(com_ibm_rave_library_action_SelectionManager.APPLY_HIGHLIGHTED_STATE);
- this.stateChanged();
- },
- /** @expose */
- unHighlight : function(selection) {
- selection.each(com_ibm_rave_library_action_SelectionManager.REMOVE_HIGHLIGHTED_STATE);
- this.stateChanged();
- },
- /** @expose */
- toggleHighlight : function(selection) {
- var self = this;
- selection.each(function(data, index, groupIndex) {
- var ctx = rave.select(this);
- if ((ctx.property(com_ibm_rave_library_action_SelectionManager.HIGHLIGHED_FLAG))) {
- self.unHighlight(selection);
- } else {
- self.highlight(selection);
- }
- });
- this.stateChanged();
- },
- /** @expose */
- select : function(selection) {
- var unSelected = com_ibm_rave_library_action_SelectionManager.filterSelected(this._context, false);
- unSelected.each(com_ibm_rave_library_action_SelectionManager.APPLY_DEEMPHASIZED_STATE);
- selection.each(com_ibm_rave_library_action_SelectionManager.APPLY_SELECTED_STATE).each(com_ibm_rave_library_action_SelectionManager.REMOVE_DEEMPHASIZED_STATE);
- this.stateChanged();
- },
- /** @expose */
- deSelect : function(selection) {
- selection.each(com_ibm_rave_library_action_SelectionManager.REMOVE_SELECTED_STATE);
- var selected = com_ibm_rave_library_action_SelectionManager.filterSelected(this._context, true);
- if (selected.empty()) {
- this._context.each(com_ibm_rave_library_action_SelectionManager.REMOVE_DEEMPHASIZED_STATE);
- } else {
- selection.each(com_ibm_rave_library_action_SelectionManager.APPLY_DEEMPHASIZED_STATE);
- }
- this.stateChanged();
- },
- /** @expose */
- toggleSelect : function(selection) {
- var self = this;
- selection.each(function(data, index, groupIndex) {
- if ((rave.select(this).property("selected"))) {
- self.deSelect(selection);
- } else {
- self.select(selection);
- }
- });
- this.stateChanged();
- },
- /** @expose */
- getHighlighted : function() {
- return com_ibm_rave_library_action_SelectionManager.filterHighlighted(this._context, true);
- },
- /** @expose */
- getSelected : function() {
- return com_ibm_rave_library_action_SelectionManager.filterSelected(this._context, true);
- },
- stateChanged : function() {
- this._context.call(this._stateChangeCallback);
- }
- });
- com_ibm_rave_library_action_SelectionManager.filterHighlighted = function(context, highlighted) {
- return context.filter(function(data, index, groupIndex) {
- return !!((rave.select(this).property(com_ibm_rave_library_action_SelectionManager.HIGHLIGHED_FLAG))) == highlighted;
- });
- };
- com_ibm_rave_library_action_SelectionManager.filterSelected = function(context, selected) {
- return context.filter(function(data, index, groupIndex) {
- return !!((rave.select(this).property("selected"))) == selected;
- });
- };
- /** @expose */
- com_ibm_rave_library_action_SelectionManager.HIGHLIGHED_FLAG = "highlighted";
- /** @expose */
- com_ibm_rave_library_action_SelectionManager.SELECTED_FLAG = "selected";
- /** @expose */
- com_ibm_rave_library_action_SelectionManager.DEEMPHASIZED_FLAG = "deemphasized";
- com_ibm_rave_library_action_SelectionManager.APPLY_HIGHLIGHTED_STATE = function(data, index, groupIndex) {
- rave.select(this).property(com_ibm_rave_library_action_SelectionManager.HIGHLIGHED_FLAG, true).classed(com_ibm_rave_library_action_SelectionManager.HIGHLIGHED_FLAG, true);
- };
- com_ibm_rave_library_action_SelectionManager.REMOVE_HIGHLIGHTED_STATE = function(data, index, groupIndex) {
- rave.select(this).property(com_ibm_rave_library_action_SelectionManager.HIGHLIGHED_FLAG, false).classed(com_ibm_rave_library_action_SelectionManager.HIGHLIGHED_FLAG, false);
- };
- com_ibm_rave_library_action_SelectionManager.APPLY_SELECTED_STATE = function(data, index, groupIndex) {
- rave.select(this).property("selected", true).classed("selected", true);
- };
- com_ibm_rave_library_action_SelectionManager.APPLY_DEEMPHASIZED_STATE = function(data, index, groupIndex) {
- rave.select(this).property(com_ibm_rave_library_action_SelectionManager.DEEMPHASIZED_FLAG, true).classed(com_ibm_rave_library_action_SelectionManager.DEEMPHASIZED_FLAG, true);
- };
- com_ibm_rave_library_action_SelectionManager.REMOVE_SELECTED_STATE = function(data, index, groupIndex) {
- rave.select(this).property("selected", false).classed("selected", false);
- };
- com_ibm_rave_library_action_SelectionManager.REMOVE_DEEMPHASIZED_STATE = function(data, index, groupIndex) {
- rave.select(this).property(com_ibm_rave_library_action_SelectionManager.DEEMPHASIZED_FLAG, false).classed(com_ibm_rave_library_action_SelectionManager.DEEMPHASIZED_FLAG, false);
- };
- // $source: com/ibm/rave/library/framework/internal/CommonPropertyIDs
- /************************************************************************
- ** 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
- /**
- * Constant strings for the common property IDs defined in the properties files. The code uses these strings, so this file must be kept in sync with the JSON files declaring the properties. The convention used here is that the string constant name is the property ID in all-caps, with "." replaced with "_".
- */
- var com_ibm_rave_library_framework_internal_CommonPropertyIDs = rave['internal']['Declare']({
- });
- /**
- * Overall padding, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_PADDING = "layout.padding";
- /**
- * Left chart padding, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_CHART_PADDING_LEFT = "layout.chart.padding.left";
- /**
- * Top chart padding, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_CHART_PADDING_TOP = "layout.chart.padding.top";
- /**
- * Right chart padding, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_CHART_PADDING_RIGHT = "layout.chart.padding.right";
- /**
- * Bottom chart padding, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_CHART_PADDING_BOTTOM = "layout.chart.padding.bottom";
- /**
- * Space between the chart and the legend, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_LEGEND_CHART_GAP = "layout.legendchart.gap";
- /**
- * Whether the legend should align with the chart elements, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_LEGEND_CHART_ALIGN = "layout.legendchart.align";
- /**
- * Legend minimum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_LEGENDSIZE_MIN = "layout.legendsize.min";
- /**
- * Legend preferred size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_LEGENDSIZE_PREFERRED = "layout.legendsize.preferred";
- /**
- * Legend maximum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_LEGENDSIZE_MAX = "layout.legendsize.max";
- /**
- * Top axis minimum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_TOP_MIN = "layout.axissize.top.min";
- /**
- * Top axis preferred size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_TOP_PREFERRED = "layout.axissize.top.preferred";
- /**
- * Top axis maximum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_TOP_MAX = "layout.axissize.top.max";
- /**
- * Left axis minimum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_LEFT_MIN = "layout.axissize.left.min";
- /**
- * Left axis preferred size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_LEFT_PREFERRED = "layout.axissize.left.preferred";
- /**
- * Left axis maximum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_LEFT_MAX = "layout.axissize.left.max";
- /**
- * Bottom axis minimum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_BOTTOM_MIN = "layout.axissize.bottom.min";
- /**
- * Bottom axis preferred size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_BOTTOM_PREFERRED = "layout.axissize.bottom.preferred";
- /**
- * Bottom axis maximum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_BOTTOM_MAX = "layout.axissize.bottom.max";
- /**
- * Right axis minimum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_RIGHT_MIN = "layout.axissize.right.min";
- /**
- * Right axis preferred size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_RIGHT_PREFERRED = "layout.axissize.right.preferred";
- /**
- * Right axis maximum size, defined in layoutProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LAYOUT_AXISSIZE_RIGHT_MAX = "layout.axissize.right.max";
- /**
- * Chart background color, defined in backgroundProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.BACKGROUND_CHART_COLOR = "background.chart.color";
- /**
- * Elements background color, defined in backgroundProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.BACKGROUND_ELEMENTS_COLOR = "background.elements.color";
- /**
- * Whether to transpose a two-axis chart, defined in dualAxisProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.TRANSPOSE = "transpose";
- /**
- * Whether to display the legend, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_DISPLAY = "legend.display";
- /**
- * Legend position, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_POSITION = "legend.position";
- /**
- * Legend title, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_TITLE = "legend.title";
- /**
- * Legend title fill, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_TITLESTYLE_FILL = "legend.titlestyle.fill";
- /**
- * Legend title font style, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_TITLESTYLE_FONT = "legend.titlestyle.font";
- /**
- * Legend entry font style, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_ENTRYSTYLE_FONT = "legend.entrystyle.font";
- /**
- * Legend title font size, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_TITLESTYLE_FONTSIZE = "legend.titlestyle.fontsize";
- /**
- * Legend title font family, defined in legendProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LEGEND_TITLESTYLE_FONTFAMILY = "legend.titlestyle.fontfamily";
- /**
- * Color palette ID, defined in colorProperties.json
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.COLOR_PALETTE = "color.palette";
- /**
- * null color for palettes
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.COLOR_NULL = "color.null";
- /**
- * Color for minimum data value in dynamic palettes
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.COLOR_DYNAMICPALETTE_MIN = "color.dynamicPalette.min";
- /**
- * Color for middle data value in dynamic palettes
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.COLOR_DYNAMICPALETTE_MID = "color.dynamicPalette.mid";
- /**
- * Color for maximum data value in dynamic palettes
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.COLOR_DYNAMICPALETTE_MAX = "color.dynamicPalette.max";
- /**
- * Size scale first value, defined in individual bundle property files (since the defaults differ)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.SIZESCALE_FIRST = "sizeScale.first";
- /**
- * Size scale second value, defined in individual bundle property files (since the defaults differ)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.SIZESCALE_SECOND = "sizeScale.second";
- /**
- * Effect name, defined in individual bundle property files (since the effect options differ)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.EFFECT_NAME = "effect.name";
- /**
- * Effect duration, defined in individual bundle property files (to keep it with the effect duration)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.EFFECT_DURATION = "effect.duration";
- /**
- * The font padding, defined in individual bundle property files (used for the word cloud)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.FONT_PADDING = "font.padding";
- /**
- * The font minimum size, defined in individual bundle property files (used for the word cloud)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.FONT_MIN_SIZE = "font.minSize";
- /**
- * The font maximum size, defined in individual bundle property files (used for the word cloud)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.FONT_MAX_SIZE = "font.maxSize";
- /**
- * The orientation of the words (used for the word cloud)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.WORD_ORIENTATION = "word.orientation";
- /**
- * The font family, defined in individual bundle property files
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.FONT_FAMILY = "font.family";
- /**
- * The way the data is used to build the chart (ie. simple, stacked, stack 100%, etc.)
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.DATA_HANDLING = "data.handling";
- /**
- * Zoom property. Zoom a chart for either axes, or both
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.ZOOM = "zoom";
- /**
- * sort property
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.SORT_PROPERTY_ID = "sort";
- /**
- * When we have a third axis, align the ticks
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.GRID_ALIGN_DEPENDENT_AXES = "grid.alignaxes";
- /**
- * Display shadow or not
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.SHADOW_DISPLAY = "shadow.display";
- /**
- * Shadow style
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.SHADOW_STYLE = "shadow.style";
- /**
- * Line pattern
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LINE_PATTERN = "line.pattern";
- /**
- * Font properties for item labels
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.LABEL_FONTSTYLE = "labelstyle.font";
- /**
- * Data labels
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.DATA_LABEL = "data.label.display";
- /**
- * Type of data labels
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.DATA_LABEL_TYPE = "data.label.type";
- /**
- * Type of data labels
- */
- //com_ibm_rave_library_framework_internal_CommonPropertyIDs.CONTRAST_LABEL_COLOR = "contrast.label.color";
- // $source: com/ibm/rave/library/datamodel/ext/Rave1Importer
- /************************************************************************
- ** 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/service/ErrorDispatcher (static) // ErrorDispatcher
- /**
- * <p> A base class for data importers which load a RAVE 1 data table (as JSONObject) into a data model data set. The methods are common code for working with the RAVE 1 <code>"data"</code> specification and creating data accessors. </p> <h3>The Map</h3> <p> Slots are set by the {@link #this.fieldToSlot(com_ibm_rave_library_datamodel_DataModel, String, Object, Object)} or {@link #this.slotToField(com_ibm_rave_library_datamodel_DataModel, String, Object, Object)} methods. These do not clear any slots. The map used by these methods defines how fields are assigned to slots. {@link #this.makeMap(com_ibm_rave_library_datamodel_DataModel, Object, , Object, com_ibm_rave_library_datamodel_DataSetDescriptor)} is used to make this map. </p> <p> The default mode for a RAVE 1 importer is to assign each VisJSON field to the data slot with the same ID. VisJSON fields that do not have a matching ID are ignored, and slots which do not have a matching field are not set. When used without an input map, makeMap creates a map to produce this behavior. </p> <p> makeMap may be passed an optional input map and reversed flag to modify this behavior. The map is from strings (IDs) to objects, which may be either strings or arrays of strings (ArrayEx<String> in Java). </p> <p> When the input map is non-null, each field ID is first looked up in the map; if the field ID is not in the map, it is not assigned to any slot. Otherwise the string(s) from the map are the IDs of data slots. The field accessor is bound to each of these slots in the order they appear in the array. If several field IDs include the same slot ID in their map value, they are all bound to the slot in the order in which the fields appear in the VisJSON. </p> <p> When a input map is non-null and the reversed flag is true, the map is instead treated as being from slot ID to field ID(s). Slots not appearing in the map are not assigned accessors. Those appearing in the map are assigned the accessors for the listed field(s), in the order in which the fields appear in the map. The reversed flag has no effect when the map is not used. </p> <h3>Field Conversion</h3> <p> Fields are converted to {@link DataSlotEntry} as follows: </p> <ul> <li> Fields with <code>"categories"</code> become string accessors, where the string value is found by looking up the data value in the categories array as done in RAVE 1. Null and out-of-range values become null strings. </li> <li> Fields with <code>"unit":"categorical"</code> become string accessors, where the string value is found by rounding the data value to and integer and converting the integer to string. Null and negative values become null strings (this approximately reproduces the RAVE 1 behavior). </li> <li> Fields with <code>"unit":"string"</code> become string accessors, where the string is the data value. With this unit, the value in the row is a string; null remains null, and anything else is converted to a string with the ObjectConverter. Note that this is <i>not</i> a supported unit in RAVE 1, nor is the <code>"rows"</code> syntax. </li> <li> Fields with <code>"unit":"timestamp"</code> or <code>"unit":"date"</code> become date accessors, where the is are found by treating the data value as seconds ("timestamp") or days ("date") after the epoch, as done in RAVE 1. Null values become null dates. </li> <li> Fields with <code>"unit":"object"</code> become object accessors, where the object is the data value. With this unit, the value in the row can be any JSON type (primitive, object, or array). Note that this is <i>not</i> a supported unit in RAVE 1, nor is the <code>"rows"</code> syntax. </li> <li> All other fields become numeric datum, where the number is the data value. Null values become null numbers. </li> </ul>
- */
- var com_ibm_rave_library_datamodel_ext_Rave1Importer = rave_library_externs["Rave1Importer"] = rave['internal']['Declare']({
- /** @expose */
- importData : function(model, data) {}
- });
- /**
- * <p> Build a map from keys to arrays of values, for use with the fieldToSlot and slotToField methods. If reversed is false, the map is from RAVE 1 field identifiers to slot identifiers and should be used If reversed is true, it is from slot identifiers to RAVE 1 field identifiers. </p> <p> If the input map is null, the result map keys are those IDs which are both field and data slot identifiers. Each key's value is an array of the single (same) ID. </p> <p> Otherwise the result map is build from the input map. The result map keys are the input map keys, and the result map values are the input map values as arrays of strings. Invalid field IDs are ignored, since a RAVE 1 table might not use the field; they are not included as keys or values. Invalid slot IDs raise errors. </p> <p> If an error is raised, null is returned. </p>
- * @param (com.ibm.rave.library.datamodel.DataModel) model The data model to which errors are reported
- * @param (Object) map The map between slots and fields, may be null
- * @param (boolean) reversed If true, the map is from slot names to fields; otherwise from fields to slots
- * @param (Object) raveTable RAVE 1 table
- * @param (com.ibm.rave.library.datamodel.DataSetDescriptor) setDescriptor Descriptor for the data set
- * @return (Object) Map of keys to arrays of values, or null
- */
- /** @expose */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeMap = function(model, map, reversed, raveTable, setDescriptor) {
- var result = {};
- var valueSet = {};
- for (var __i_enFor0 = 0, __exp_enFor0 = setDescriptor.dataSlots(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var s = __exp_enFor0[__i_enFor0];
- valueSet[s.id()] = 1;
- }
- var keySet = {};
- var fields = raveTable["fields"];
- var nFields = fields.length;
- for (var i = 0; i < nFields; ++i) {
- var field = fields[i];
- if (field) {
- var id = (field["id"]);
- if (id != null) {
- if (map) {
- keySet[id] = 1;
- } else {
- if (valueSet.hasOwnProperty(id)) {
- var values = [];
- values.push(id);
- result[id] = values;
- }
- }
- }
- }
- }
- if (!map) {
- return result;
- }
- if (reversed) {
- var t = keySet;
- keySet = valueSet;
- valueSet = t;
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(map), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- if (!(keySet.hasOwnProperty(key))) {
- if (reversed) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 405, key);
- return null;
- }
- } else {
- var values = com_ibm_rave_library_datamodel_ext_Rave1Importer.mapEntries(key, map);
- if (values) {
- if (!reversed) {
- for (var __i_enFor2 = 0, __exp_enFor2 = values, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var value = __exp_enFor2[__i_enFor2];
- if (!(valueSet.hasOwnProperty(value))) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 405, value);
- return null;
- }
- }
- }
- result[key] = values;
- }
- }
- }
- return result;
- };
- /**
- * Get the values associated with a key in the map, which is not null. The value in the map is either a single string or an array of strings, and is returned as an array of strings. If there are no entries, returns null (because of the way this method is used, that will happen only if a user adds a key with a null value).
- * @param (String) key Key
- * @param (Object) map Map
- * @return (Array) List of values, or null
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.mapEntries = function(key, map) {
- var o = map[key];
- if (o != null) {
- if ((typeof o === "string" || o instanceof String)) {
- var result = [];
- result.push((o));
- return result;
- }
- return o;
- }
- return null;
- };
- /**
- * Set the data slots. All arguments must be non-null and valid. All slots are first cleared. Each slot is then assigned fields using the map, which is one created by {@link #this.makeMap(com_ibm_rave_library_datamodel_DataModel, Object, , Object, com_ibm_rave_library_datamodel_DataSetDescriptor)} .
- * @param (com.ibm.rave.library.datamodel.DataModel) model The data model
- * @param (com.ibm.rave.library.datamodel.DataSetDescriptor) dataSet The data set descriptor
- * @param (Object) raveTable The RAVE 1 table
- * @param (Object) map The map from makeMap
- * @param (boolean) reversed Whether the map is reversed (the original import had a map and the reverseMap flag)
- * @return (boolean) Whether there was a failure when setting slots (usually a bad data type)
- */
- /** @expose */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.setSlots = function(model, dataSet, raveTable, map, reversed) {
- var dataSetId = dataSet.id();
- for (var __i_enFor0 = 0, __exp_enFor0 = dataSet.dataSlots(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dsd = __exp_enFor0[__i_enFor0];
- model.clearDataSlot(dataSetId, dsd.id());
- }
- return reversed ? com_ibm_rave_library_datamodel_ext_Rave1Importer.slotToField(model, dataSetId, raveTable, map) : com_ibm_rave_library_datamodel_ext_Rave1Importer.fieldToSlot(model, dataSetId, raveTable, map);
- };
- /**
- * Set the data slots. Each field is bound to one or more slots as given by the map.
- * @param (com.ibm.rave.library.datamodel.DataModel) model The data model
- * @param (String) dataSetId The ID of the data set
- * @param (Object) raveTable The RAVE 1 table from which fields are taken
- * @param (Object) map The map from field ID to data slots
- * @return (boolean) True for success, false for failure
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.fieldToSlot = function(model, dataSetId, raveTable, map) {
- var fields = raveTable["fields"];
- var nFields = fields.length;
- for (var i = 0; i < nFields; ++i) {
- var fieldSpec = fields[i];
- if (fieldSpec) {
- var fieldId = (fieldSpec["id"]);
- var values = map[fieldId];
- if (values) {
- var info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeAccessor(fieldSpec, i);
- for (var __i_enFor0 = 0, __exp_enFor0 = values, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var slotId = __exp_enFor0[__i_enFor0];
- var slotEntry = model.dataset(dataSetId).slot(slotId).push().type$1(info["type"]).accessor$1(info["accessor"]).label$1(info["label"]);
- if (!(slotEntry.isValid())) {
- return false;
- }
- }
- }
- }
- }
- return true;
- };
- /**
- * Set the data slots. Each slot is assigned one or more fields as given by the map.
- * @param (com.ibm.rave.library.datamodel.DataModel) model The data model
- * @param (String) dataSetId The ID of the data set
- * @param (Object) raveTable The RAVE 1 table from which fields are taken
- * @param (Object) map The map from field ID to data slots
- * @return (boolean) True for success, false for failure
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.slotToField = function(model, dataSetId, raveTable, map) {
- var fieldsMap = {};
- var fieldIdSet = {};
- var fields = raveTable["fields"];
- var nFields = fields.length;
- for (var i = 0; i < nFields; ++i) {
- var field = fields[i];
- if (field) {
- var id = (field["id"]);
- if (id != null) {
- fieldsMap[id] = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeAccessor(field, i);
- fieldIdSet[id] = 1;
- }
- }
- }
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(map), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var slotId = __exp_enFor0[__i_enFor0];
- var fieldIds = map[slotId];
- for (var __i_enFor1 = 0, __exp_enFor1 = fieldIds, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var fieldId = __exp_enFor1[__i_enFor1];
- var info = fieldsMap[fieldId];
- if (info) {
- var slotEntry = model.dataset(dataSetId).slot(slotId).push().type$1(info["type"]).accessor$1(info["accessor"]).label$1(info["label"]);
- if (!(slotEntry.isValid())) {
- return false;
- }
- }
- }
- }
- return true;
- };
- /**
- * Create an AccessorInfo for the given field specification, which is at index fieldIndex in the fields. The type of accessor is determined as in the class documentation.
- * @param (Object) fieldSpec VisJSON field specification
- * @param (int) fieldIndex Index of field
- * @return (Object) Datum for the field
- */
- /** @expose */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeAccessor = function(fieldSpec, fieldIndex) {
- var info;
- var categories = fieldSpec["categories"];
- var unit = (fieldSpec["unit"]);
- if (categories) {
- info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeCategoriesAccessor(fieldIndex, categories);
- } else if ("categorical" == unit) {
- info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeCategoricalAccessor(fieldIndex);
- } else if ("timestamp" == unit) {
- info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeDateAccessor(fieldIndex, 1000);
- } else if ("date" == unit) {
- info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeDateAccessor(fieldIndex, 86400 * 1000);
- } else if ("string" == unit) {
- info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeStringAccessor(fieldIndex);
- } else if ("object" == unit) {
- info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeObjectAccessor(fieldIndex);
- } else {
- info = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeNumericAccessor(fieldIndex);
- }
- info["label"] = (fieldSpec["label"]);
- return info;
- };
- /**
- * All accessors are applied to a row, which is a JSONArray. This method gets the value from the row, returning null for null rows or out-of-range indexes.
- * @param (Array) row The row
- * @param (int) fieldIndex Index of value in the row
- * @return (Object) The value
- */
- /** @expose */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue = function(row, fieldIndex) {
- return (row && fieldIndex < row.length) ? row[fieldIndex] : null;
- };
- /**
- * Return accessor info for a field with "categories".
- * @param (int) fieldIndex The field index
- * @param (Array) categories The categories array
- * @return (Object) Accessor info
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeCategoriesAccessor = function(fieldIndex, categories) {
- var result = {};
- result["type"] = "string";
- result["accessor"] = function(row) {
- if ((typeof row === "array" || row instanceof Array)) {
- var v = (com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue(row, fieldIndex));
- if (v == null) {
- return null;
- }
- var ix = ~~ (Math.round(v));
- return (ix < 0 || ix >= categories.length) ? null : ""+(categories[ix]);
- } else {
- return null;
- }
- };
- return result;
- };
- /**
- * Return accessor info for a field with "unit":"categorical".
- * @param (int) fieldIndex The field index
- * @return (Object) Accessor info
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeCategoricalAccessor = function(fieldIndex) {
- var result = {};
- result["type"] = "string";
- result["accessor"] = function(row) {
- var v = (com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue(row, fieldIndex));
- if (v == null) {
- return null;
- }
- var ix = ~~ (Math.round(v));
- return (ix < 0) ? null : ("" + ix);
- };
- return result;
- };
- /**
- * Return accessor info for a field with "unit":"timestamp" or "unit":"date.
- * @param (int) fieldIndex The field index
- * @param (long) msPer Milliseconds per unit
- * @return (Object) Accessor info
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeDateAccessor = function(fieldIndex, msPer) {
- var result = {};
- result["type"] = "date";
- result["accessor"] = function(row) {
- if ((typeof row === "array" || row instanceof Array)) {
- var v = (com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue(row, fieldIndex));
- return v != null ? new Date((v * msPer)) : null;
- } else {
- return null;
- }
- };
- return result;
- };
- /**
- * Return accessor info for a field with "unit":"string".
- * @param (int) fieldIndex The field index
- * @return (Object) Accessor info
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeStringAccessor = function(fieldIndex) {
- var result = {};
- result["type"] = "string";
- result["accessor"] = function(row) {
- if ((typeof row === "array" || row instanceof Array)) {
- var v = com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue(row, fieldIndex);
- return v != null ? ""+(v) : null;
- } else {
- return null;
- }
- };
- return result;
- };
- /**
- * Return accessor info for a field with "unit":"object".
- * @param (int) fieldIndex The field index
- * @return (Object) Accessor info
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeObjectAccessor = function(fieldIndex) {
- var result = {};
- result["type"] = "object";
- result["accessor"] = function(row) {
- if ((typeof row === "array" || row instanceof Array)) {
- return com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue(row, fieldIndex);
- } else {
- return null;
- }
- };
- return result;
- };
- /**
- * Return accessor info for a field which is numeric.
- * @param (int) fieldIndex The field index
- * @return (Object) Accessor info
- */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.makeNumericAccessor = function(fieldIndex) {
- var result = {};
- result["type"] = "numeric";
- result["accessor"] = function(row) {
- if ((typeof row === "array" || row instanceof Array)) {
- return com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue(row, fieldIndex);
- } else {
- return null;
- }
- };
- return result;
- };
- /**
- * Report an error with given code and location.
- * @param (com.ibm.rave.library.datamodel.DataModel) model The model
- * @param (int) code The error code
- * @param (String) location The location
- */
- /** @expose */
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError = function(model, code, location) {
- com_ibm_rave_library_service_ErrorDispatcher.INSTANCE.logError(code, location);
- };
- // $source: com/ibm/rave/library/datamodel/ext/Rave1TableImporter
- /************************************************************************
- ** 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/datamodel/ext/Rave1Importer (loadtime) // setSlots, superclass, reportError, makeMap
- /**
- * <p> An importer which loads a single RAVE 1 data table (as JSONObject) into a data model tabular data set. The importer may be used repeatedly to load all the tables in a VisJSON <code>"data"</code> section into data sets of a model. </p> <p> This importer can only handle simple data tables with fields and rows. If the table has no fields an error is raised. If it has fields but no rows, processing is normal and the data is empty. </p> <p> The converter is passed the data model to be populated and an {@link (Object) ImportData} which controls the conversion. The ImportData is annotated as JsonObject, so in JavaScript may be declared as a simple object. </p> <p> The {@link this.ImportData#this.visJSONData} is the <code>"data"</code> section of the VisJson specification, an array of objects. {@link this.ImportData#this.index} selects the table to be imported from the array, and {@link this.ImportData#this.dataSetId} selects the data set from the model. These ImportData fields are all required. </p> <p> For use of the ImportData map and reverseMap options, and for the conversion of VisJSON fields to data slot accessors, see the base class {@link (com.ibm.rave.library.datamodel.ext.Rave1Importer) Rave1Importer} documentation. </p> <p> The <code>"rows"</code> of the selected VisJSON table are bound as the data array of the selected data set, which must be tabular. All data slots are cleared. The map (see {@link (com.ibm.rave.library.datamodel.ext.Rave1Importer) Rave1Importer} ) is then used to define accessors for the data slots of the data set. </p> <h3>Return Value and Errors</h3> <p> The importer runs synchronously, returning either true for success or false for failure. Errors are reported through the data model, so passing a null data model returns false but no error is reported. </p> <p> Errors are raised if the ImportData does not have valid information, with code {@link this.ErrorCodes#102} and one of the error messages defined in the class; the location is either null or a slot ID. Errors can also be reported by the model when the importer assigns slot data, for example an invalid data type. </p>
- */
- var com_ibm_rave_library_datamodel_ext_Rave1TableImporter = rave_library_externs["Rave1TableImporter"] = rave['internal']['Declare'](com_ibm_rave_library_datamodel_ext_Rave1Importer, {
- /**
- * Construct.
- */
- /** @expose */
- constructor : function() {},
- /**
- * Import data into a model as described in the class documentation.
- * @param (com.ibm.rave.library.datamodel.DataModel) model The model
- * @param (Object) data The information controlling the import
- * @return (boolean) True for success, false if an error is raised
- */
- /** @expose */
- importData : function(model, data) {
- var idata = data;
- if (!model) {
- return false;
- }
- if (!idata || !idata["visJSONData"] || idata["index"] == null || idata["dataSetId"] == null) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 401, null);
- return false;
- }
- var index = idata["index"];
- if (index < 0 || index >= idata["visJSONData"].length) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 402, null);
- return false;
- }
- var raveTable = idata["visJSONData"][index];
- if (!raveTable || raveTable["fields"] == null) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 403, null);
- return false;
- }
- var modelDescriptor = model.getDescriptor();
- var setDescriptor;
- for (var __i_enFor0 = 0, __exp_enFor0 = modelDescriptor.dataSets(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dsd = __exp_enFor0[__i_enFor0];
- if (idata["dataSetId"] == dsd.id()) {
- setDescriptor = dsd;
- break;
- }
- }
- if (!setDescriptor) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 404, null);
- return false;
- }
- if (!("tabular" == setDescriptor.type())) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 406, null);
- return false;
- }
- var reversed = idata["map"] && idata["reverseMap"] != null && idata["reverseMap"];
- var map = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeMap(model, idata["map"], reversed, raveTable, setDescriptor);
- if (!map) {
- return false;
- }
- var rows = [];
- var specRows = raveTable["rows"];
- if (specRows) {
- var len = specRows.length;
- for (var i = 0; i < len; ++i) {
- rows.push(specRows[i]);
- }
- }
- model.setData(idata["dataSetId"], rows);
- return com_ibm_rave_library_datamodel_ext_Rave1Importer.setSlots(model, setDescriptor, raveTable, map, reversed);
- }
- });
- // $source: com/ibm/rave/library/datamodel/ext/Rave1HierarchyImporter
- /************************************************************************
- ** 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/datamodel/ext/Rave1Importer (loadtime) // setSlots, makeAccessor, getRowValue, superclass, reportError, makeMap
- /**
- * <p> An importer which loads a single RAVE 1 data table (as JSONObject) into a data model hierarchical data set. The importer may be used repeatedly to load all the tables in a VisJSON <code>"data"</code> section into data sets of a model. </p> <p> This importer can only handle simple data tables with fields and rows. If the table has no fields an error is raised. If it has fields but no rows, processing is normal and the data is empty. </p> <p> The converter is passed the data model to be populated and an {@link (Object) ImportData} which controls the conversion. The ImportData is annotated as JsonObject, so in JavaScript may be declared as a simple object. </p> <p> The {@link this.ImportData#this.visJSONData} is the <code>"data"</code> section of the VisJson specification, an array of objects. {@link this.ImportData#this.index} selects the table to be imported from the array, and {@link this.ImportData#this.dataSetId} selects the data set from the model. These ImportData fields are all required. The {@link this.ImportData#this.levels} field defines the levels used to construct the hierarchy as described below, and is also required. It must have at least one entry. </p> <p> For use of the ImportData map and reverseMap options, and for the conversion of VisJSON fields to data slot accessors, see the base class {@link (com.ibm.rave.library.datamodel.ext.Rave1Importer) Rave1Importer} documentation. </p> <h3>Hierarchical Structure</h3> <p> The <code>"rows"</code> of the selected VisJSON table are converted into a hierarchical structure. The hierarchy structure is defined by the required {@link this.ImportData#this.levels} , which is an array-list of VisJSON field names. If any of these fields are not defined an error is raised. The tree will have L+1 levels, where L is the number of entries in the levels array. All leaves are at the last level, and each row of data becomes a leaf. Internal leaves are created as necessary. </p> <p> The first level is the root. It has one child for each distinct value of the first levels field. Each of its children has a child for each distinct value of the second levels field (given the value of the first field from the child), and so on. At the last internal level L-1, the children are the leaf nodes with one per distinct value of the final levels field. If two rows of data have exactly the same values for all levels field, the second one is ignored and the leaf will be the first one. </p> <p> The data nodes in the hierarchy are JSONArrays. Each of the original rows becomes one of the leaf nodes, so in the scene tree the scene-node datum is the original row. Extra JSONArray objects are created for the internal nodes, so their scene-node datum objects do not appear in the original data. </p> <p> All the row JSONArrays have N+2 entries, where N is the number of VisJSON fields (the original rows are expanded to this length). The two extra entries are used to hold the row's level-key (the unique value of the level field for that node) and children. Leaf nodes have their original values in the first N entries of the array, a non-null level-key (from the last of the levels), and null children. Internal nodes have nulls in the first N entries (the VisJSON fields, for which no data is available), a non-null level-key (except for the root which is null), and non-null children. </p> <p> The resulting tree is bound as the data hierarchy of the selected data set, which must be hierarchical. All data slots are cleared. The map (see {@link (com.ibm.rave.library.datamodel.ext.Rave1Importer) Rave1Importer} ) is then used to define accessors for the data slots of the data set. Note that these will return null for all internal nodes, since the data values in the table are all null. </p> <p> The slot {@link this.ImportData#this.childrenSlotId} , default "children", is then set to an accessor that returns the children of the node as an array-list. If {@link this.ImportData#this.levelKeySlotIds} is defined, the data slot(s) in that array are each set to an accessor that returns the data value from the level-key (this may overwrite an accessor set from the fields). </p> <h3>Return Value and Errors</h3> <p> The importer runs synchronously, returning either true for success or false for failure. Errors are reported through the data model, so passing a null data model returns false but no error is reported. </p> <p> Errors are raised if the ImportData does not have valid information, with code {@link this.ErrorCodes#102} and one of the error messages defined in the class; the location is either null or a slot ID. Errors can also be reported by the model when the importer assigns slot data, for example an invalid data type. </p>
- */
- var com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter = rave_library_externs["Rave1HierarchyImporter"] = rave['internal']['Declare'](com_ibm_rave_library_datamodel_ext_Rave1Importer, {
- /**
- * Construct.
- */
- /** @expose */
- constructor : function() {},
- /**
- * Import data into a model as described in the class documentation.
- * @param (com.ibm.rave.library.datamodel.DataModel) model The model
- * @param (Object) data The information controlling the import
- * @return (boolean) True for success, false if an error is raised
- */
- /** @expose */
- importData : function(model, data) {
- var idata = data;
- if (!model) {
- return false;
- }
- if (!idata || !idata["visJSONData"] || idata["index"] == null || idata["dataSetId"] == null || !idata["levels"] || idata["levels"].length == 0) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 401, null);
- return false;
- }
- var index = idata["index"];
- if (index < 0 || index >= idata["visJSONData"].length) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 402, null);
- return false;
- }
- var raveTable = idata["visJSONData"][index];
- if (!raveTable || raveTable["fields"] == null) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 403, null);
- return false;
- }
- var modelDescriptor = model.getDescriptor();
- var setDescriptor;
- for (var __i_enFor0 = 0, __exp_enFor0 = modelDescriptor.dataSets(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dsd = __exp_enFor0[__i_enFor0];
- if (idata["dataSetId"] == dsd.id()) {
- setDescriptor = dsd;
- break;
- }
- }
- if (!setDescriptor) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 404, null);
- return false;
- }
- if (!("hierarchy" == setDescriptor.type())) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 406, null);
- return false;
- }
- var reversed = idata["map"] && idata["reverseMap"] != null && idata["reverseMap"];
- var map = com_ibm_rave_library_datamodel_ext_Rave1Importer.makeMap(model, idata["map"], reversed, raveTable, setDescriptor);
- if (!map) {
- return false;
- }
- var levels = com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.makeLevelsInfo(model, raveTable, idata["levels"]);
- if (!levels) {
- return false;
- }
- var numFields = (raveTable["fields"]).length;
- var root = com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.makeNode(null, numFields, null);
- var rows = raveTable["rows"];
- if (rows) {
- var numRows = rows.length;
- for (var i = 0; i < numRows; ++i) {
- var row = rows[i];
- var keyValues = com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.makeKeyValues(row, levels);
- if (keyValues) {
- com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.addNode(root, keyValues, row, numFields);
- }
- }
- }
- model.setData(idata["dataSetId"], root);
- var result = com_ibm_rave_library_datamodel_ext_Rave1Importer.setSlots(model, setDescriptor, raveTable, map, reversed);
- if (result) {
- var childrenSlotId = idata["childrenSlotId"] != null ? idata["childrenSlotId"] : "children";
- var childrenAccessor = function(row) {
- if ((typeof row === "array" || row instanceof Array)) {
- var children = com_ibm_rave_library_datamodel_ext_Rave1Importer.getRowValue(row, numFields + 1);
- if (!children) {
- return null;
- }
- var r = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = children, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- r.push(o);
- }
- return r;
- } else {
- return null;
- }
- };
- if (model.setDataSlot(idata["dataSetId"], childrenSlotId, "object", childrenAccessor) < 0) {
- result = false;
- }
- if (idata["levelKeySlotIds"]) {
- var levelKeyAccessor = function(row) {
- if ((typeof row === "array" || row instanceof Array)) {
- var r = (row);
- var o = null;
- if (r.length > numFields) {
- o = r[numFields];
- }
- return o;
- } else {
- return null;
- }
- };
- for (var __i_enFor0 = 0, __exp_enFor0 = idata["levelKeySlotIds"], __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- if (model.setDataSlot(idata["dataSetId"], key, "string", levelKeyAccessor) < 0) {
- result = false;
- }
- }
- }
- }
- return result;
- }
- });
- /**
- * Add a row from the RAVE 1 table to the tree. The keyValues are the values (data values, not RAVE 1 numbers) for the levels, and all are non-null. The row has not been extended to add the level-key and children.
- * @param (Array) root The root of the tree being built
- * @param (Array) keyValues Array of key values, all non-null
- * @param (Array) row The data row, non-null
- */
- com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.addNode = function(root, keyValues, row, numFields) {
- var currentNode = root;
- var numLevels = keyValues.length;
- for (var levelIndex = 0; levelIndex < numLevels; ++levelIndex) {
- var children = currentNode[numFields + 1];
- if (!children) {
- children = [];
- currentNode[numFields + 1] = children;
- }
- var child = null;
- var keyValue = keyValues[levelIndex];
- for (var cnum = 0; cnum < children.length; ++cnum) {
- if (keyValue == (children[cnum])[numFields]) {
- child = children[cnum];
- break;
- }
- }
- if (!child) {
- child = com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.makeNode(levelIndex == numLevels - 1 ? row : null, numFields, keyValue);
- children.push(child);
- }
- currentNode = child;
- }
- };
- /**
- * Build an array-list of AccessorInfo for the given levels and RAVE 1 table. If any of the levels are not the ID of a table field, raises an error through the model and returns null.
- * @param (com.ibm.rave.library.datamodel.DataModel) model Data model (used for error reporting)
- * @param (Object) raveTable The RAVE 1 table, known to be non-null and have non-null fields
- * @param (Array) levels The levels array, known to be non-null and have at least one entry
- * @return (Array) Array of accessors, or null
- */
- com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.makeLevelsInfo = function(model, raveTable, levels) {
- var fieldMap = {};
- var fields = raveTable["fields"];
- for (var i = 0; i < fields.length; ++i) {
- var field = fields[i];
- var id = (field) ? ""+(field["id"]) : null;
- if (id != null) {
- fieldMap[id] = i;
- }
- }
- var result = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = levels, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var level = __exp_enFor0[__i_enFor0];
- var index = fieldMap[level];
- if (index == null) {
- com_ibm_rave_library_datamodel_ext_Rave1Importer.reportError(model, 407, level);
- return null;
- }
- result.push(com_ibm_rave_library_datamodel_ext_Rave1Importer.makeAccessor(fields[index], index));
- }
- return result;
- };
- /**
- * Apply the accessors to the row and return the array of values. If the row is null or any accessor returns null, returns null. All accessors are non-null and valid. All vaues are coerced to strings.
- * @param (Array) row Data row from the RAVE 1 table
- * @param (Array) levels Accessors array
- * @return (Array) Array of values, or null
- */
- com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.makeKeyValues = function(row, levels) {
- if (!row) {
- return null;
- }
- var result = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = levels, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var info = __exp_enFor0[__i_enFor0];
- var value = info["accessor"](row);
- if (value == null) {
- return null;
- }
- result.push(""+(value));
- }
- return result;
- };
- /**
- * Create a new node, either by creating a new JSONArray for the node, or by extending an existing JSONArray (from the table rows). The array will have numFields+2 entries. The value at index numFields is keyValue; the value at index numFields+2, which is the children slot, is null.
- * @param (Array) array Either an existing array, or null if a new (internal) node is to be created
- * @param (int) numFields Number of fields in the RAVE 1 table; the returned array has numFields+2 entries
- * @param (Object) keyValue Value of the entry at index numFields
- * @return (Array) The array
- */
- com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter.makeNode = function(array, numFields, keyValue) {
- var result = (array) ? array : [];
- var targetLength = numFields + 2;
- while (result.length < targetLength) {
- result.push(null);
- }
- result[numFields] = keyValue;
- result[numFields + 1] = null;
- return result;
- };
- // $source: com/ibm/rave/library/Library
- /************************************************************************
- ** 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/service/ErrorDispatcher (static) // ErrorDispatcher
- //@import com/ibm/rave/library/datamodel/ext/Rave1TableImporter (static) // new
- //@import com/ibm/rave/library/datamodel/ext/Rave1HierarchyImporter (static) // new
- //@import com/ibm/rave/library/service/BundleService (static) // BundleService
- //@import com/ibm/rave/library/service/LibraryExtensionService (static) // LibraryExtensionService
- //@import com/ibm/rave/library/palette/internal/PaletteManager (static) // new
- /**
- * Service to manage loaded bundles and provide common utilities.
- */
- var com_ibm_rave_library_Library = rave['internal']['Declare']({
- //constructor : function() {}
- });
- com_ibm_rave_library_Library.getLibraryData = function() {
- var libraryData = rave['internal']['RaveContextManager'].INSTANCE.getRaveContext().getData("LIBRARY_DATA_KEY");
- if (!libraryData) {
- libraryData = new com_ibm_rave_library_Library.LibraryData();
- rave['internal']['RaveContextManager'].INSTANCE.getRaveContext().putData("LIBRARY_DATA_KEY", libraryData);
- }
- return libraryData;
- };
- /**
- * Set the error code and corresponding error message (using the standard error message for that error code).
- * @param (int) code Error code
- */
- com_ibm_rave_library_Library.logError$0 = function(code) {
- com_ibm_rave_library_service_ErrorDispatcher.INSTANCE.logError$0(code);
- };
- /**
- * Set the error code and corresponding error message, and the location.
- * @param (int) code Error code
- * @param (String) location Error location
- */
- com_ibm_rave_library_Library.logError$1 = function(code, location) {
- com_ibm_rave_library_service_ErrorDispatcher.INSTANCE.logError$1(code, location);
- };
- com_ibm_rave_library_Library.logError$2 = function(code, location, bundleName) {
- com_ibm_rave_library_service_ErrorDispatcher.INSTANCE.logError$2(code, location, bundleName);
- };
- /**
- * Retrieve a data importer that has been registered with the Library. DataImporter's are a convenience utility included with some bundles to enable specific data format conversions and/or input methods.
- */
- /** @expose */
- com_ibm_rave_library_Library.getDataImporter = function(importerName) {
- return com_ibm_rave_library_Library.getLibraryData()._dataImporters[importerName];
- };
- /**
- * Register a data importer with a given name.
- */
- /** @expose */
- com_ibm_rave_library_Library.registerDataImporter = function(importerName, dataImporter) {
- com_ibm_rave_library_Library.getLibraryData()._dataImporters[importerName] = dataImporter;
- };
- /**
- * Set an error handler callback. The provided callback function will be invoked when an error occurs
- * @param (com.ibm.rave.library.service.LibraryError.ReportError) errorReporter
- */
- /** @expose */
- com_ibm_rave_library_Library.onError = function(errorReporter) {
- com_ibm_rave_library_service_ErrorDispatcher.INSTANCE.setReporter(errorReporter);
- };
- /**
- * Dispatch error
- * @param (com.ibm.rave.library.service.LibraryError) error
- */
- /** @expose */
- com_ibm_rave_library_Library.error = function(error) {
- com_ibm_rave_library_service_ErrorDispatcher.INSTANCE.error(error);
- };
- /**
- * Builds the data importer map. Includes registration of data importers included with the library.
- */
- com_ibm_rave_library_Library.buildImporterMap = function() {
- var importers = {};
- importers["rave1"] = new com_ibm_rave_library_datamodel_ext_Rave1TableImporter();
- importers[com_ibm_rave_library_Library.RAVE1_HIERARCHY_IMPORTER_KEY] = new com_ibm_rave_library_datamodel_ext_Rave1HierarchyImporter();
- return importers;
- };
- /**
- * Utility method to generate a unique id. This will typically be used by the {@link this.Bundle#this.create()} method to generate an ID for each Bundle Instance.
- */
- /** @expose */
- com_ibm_rave_library_Library._generateId = function() {
- return "_raveLibId_" + (com_ibm_rave_library_Library.getLibraryData().idCounter++) + "_";
- };
- /** @expose */
- com_ibm_rave_library_Library.logError = function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return com_ibm_rave_library_Library.logError$0(a0);
- }
- if (args.length == 2) {
- return com_ibm_rave_library_Library.logError$1(a0, a1);
- }
- return com_ibm_rave_library_Library.logError$2(a0, a1, a2);
- };
- com_ibm_rave_library_Library.LibraryData = rave['internal']['Declare']({
- //_dataImporters : null,
- idCounter : 0,
- constructor : function() {
- this._dataImporters = com_ibm_rave_library_Library.buildImporterMap();
- }
- });
- com_ibm_rave_library_Library.RAVE1_TABULAR_IMPORTER_KEY = "rave1";
- com_ibm_rave_library_Library.RAVE1_HIERARCHY_IMPORTER_KEY = "rave1hierarchy";
- //com_ibm_rave_library_Library.LIBRARY_DATA_KEY = "LIBRARY_DATA_KEY";
- /**
- * Registry where loaded bundles are made accessible.
- */
- /** @expose */
- com_ibm_rave_library_Library.bundle = com_ibm_rave_library_service_BundleService.INSTANCE;
- /**
- * Registry where loaded extensions are made accessible.
- */
- /** @expose */
- com_ibm_rave_library_Library.extensions = com_ibm_rave_library_service_LibraryExtensionService.INSTANCE;
- /**
- * Manager for palette information.
- * @see (com.ibm.rave.library.palette.internal.PaletteManager) PaletteManager
- */
- /** @expose */
- com_ibm_rave_library_Library.palettes = new com_ibm_rave_library_palette_internal_PaletteManager();
- // $source: com/ibm/rave/library/palette/internal/CategoricalPalette
- /************************************************************************
- ** 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/palette/Palette (loadtime) // INVALID_DOMAIN_NULL, VALID_DOMAIN, superclass
- /**
- * A Simple palette object Colors are stored in a simple Array and the value returned us indexed by the data
- */
- var com_ibm_rave_library_palette_internal_CategoricalPalette = rave['internal']['Declare'](com_ibm_rave_library_palette_Palette, {
- /**
- * the scale for the color
- */
- //colors : null,
- /**
- * the domain to use when domain is invalid
- */
- invalidDomainEntry : "",
- _$functionClassMethod : function() {
- var _$self = /**
- * Get a color value for the given data will return null if the data is null
- * @param (rave['internal']['SceneNode']) this the context in which this method is invoked
- * @param (Object) data a data value, may be <code>null</code>
- * @param (int) index the index of the current scene node
- * @param (int) groupIndex the group index of the current scene node
- * @return (Object) a computed value
- */
- function(data, index, groupIndex) {
- var dataValue;
- if (_$self.getDomainValidity() == com_ibm_rave_library_palette_Palette.VALID_DOMAIN) {
- dataValue = _$self.dataAccessor(data);
- } else if (_$self.getDomainValidity() == com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_NULL) {
- dataValue = _$self.invalidDomainEntry;
- } else {
- dataValue = null;
- }
- return dataValue != null ? _$self.colors.call(this, dataValue, index, groupIndex) : _$self.nullColor;
- };
- return _$self;
- },
- /**
- * @param (Object) jsonPalette
- */
- constructor : function(jsonPalette) {
- this.type = com_ibm_rave_library_palette_internal_CategoricalPalette.Type;
- this.colors = rave.scale.ordinal();
- this.addAllColors(jsonPalette["fills"]);
- },
- /** @expose */
- addColor : function(color) {
- var range = this.colors.range();
- range.push(""+(color));
- this.colors.range(range);
- },
- /** @expose */
- removeColor : function(color) {
- var range = this.colors.range();
- var index = range.indexOf(""+(color));
- if (index != -1) {
- range.splice(index, 1);
- }
- this.colors.range(range);
- },
- /** @expose */
- addAllColors : function(colorArray) {
- var range = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = colorArray, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var color = __exp_enFor0[__i_enFor0];
- range.push(""+(color));
- }
- this.colors.range(range);
- },
- /** @expose */
- domain : function(domain) {
- this.colors.domain(domain);
- },
- /** @expose */
- getScale : function() {
- return this.colors;
- },
- setData$0 : function(domain, dataSet, slot) {
- this.setInvalidDomainEntry(dataSet, slot);
- com_ibm_rave_library_palette_Palette.prototype.setData$0.call(this, domain, dataSet, slot);
- },
- setData$1 : function(dataSet, slot) {
- this.setInvalidDomainEntry(dataSet, slot);
- com_ibm_rave_library_palette_Palette.prototype.setData$1.call(this, dataSet, slot);
- },
- /**
- * Set the invalid domain entry
- * @param (com.ibm.rave.library.datamodel.DataSet) dataSet the data set
- * @param (String) slot the slot name
- */
- setInvalidDomainEntry : function(dataSet, slot) {
- var dataSlot = dataSet.slot(slot);
- if (dataSlot) {
- this.invalidDomainEntry = dataSlot.overrideLabel();
- if (this.invalidDomainEntry == null) {
- this.invalidDomainEntry = dataSlot.descriptor().label();
- }
- } else {
- this.invalidDomainEntry = dataSet.descriptor().label();
- }
- },
- /** @expose */
- invalidateDomain : function() {
- this.domain([this.invalidDomainEntry]);
- },
- /**
- * Can the palette handle the data type
- * @return (boolean) whether the palette can handle the data type
- */
- /** @expose */
- canHandleDataType : function(type) {
- return true;
- },
- /** @expose */
- setData : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 2) {
- return this.setData$1(a0, a1);
- }
- return this.setData$0(a0, a1, a2);
- }
- });
- /**
- * the palette type
- */
- com_ibm_rave_library_palette_internal_CategoricalPalette.Type = "categorical";
- // $source: com/ibm/rave/library/framework/internal/LinearCoordinateScale
- /************************************************************************
- ** 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/library/framework/internal/CoordinateScaleImpl (loadtime) // superclass
- /**
- * <p> CoordinateScale implementation wrapping a linear scale with a numeric domain. The domain of the scale is passed to the constructor, and must be a non-null array of at least two numbers or the core scale will throw an exception. </p> <p> {@link #this.setWidth()} sets the band width, and {@link #this.width()} returns it. {@link #this.center(Object)} returns the value of the linear scale applied to the argument, and {@link #this.lower(Object)} and {@link #this.upper(Object)} return the center value minus or plus half the width. The domain-modification methods ( {@link #this.includeZero()} etc.) modify the domain. </p>
- */
- var com_ibm_rave_library_framework_internal_LinearCoordinateScale = rave['internal']['Declare'](com_ibm_rave_library_framework_internal_CoordinateScaleImpl, {
- /**
- * The internal linear scale
- */
- //_scale : null,
- /**
- * The width in pixels; <I>half</I> the value passed to setWidth, to speed scale calculations.
- */
- _width : 0,
- /**
- * Private, use factory method.
- */
- constructor : function(domain) {
- this._scale = rave.scale.linear().domain(domain);
- this._width = 0.0;
- },
- /** @expose */
- scale : function() {
- return this._scale;
- },
- isContinuous : function() {
- return true;
- },
- /** @expose */
- isLinear : function() {
- return true;
- },
- range : function(v1, v2, padding, outerPadding) {
- this._scale.range([v1, v2]);
- return this;
- },
- /** @expose */
- center : function(data) {
- return + (this._scale.call(null, data, 0, 0));
- },
- /** @expose */
- lower : function(data) {
- return + (this._scale.call(null, data, 0, 0)) - this._width;
- },
- /** @expose */
- upper : function(data) {
- return + (this._scale.call(null, data, 0, 0)) + this._width;
- },
- /** @expose */
- width : function() {
- return 2.0 * this._width;
- },
- setWidth : function(width) {
- if (width >= 0.0) {
- this._width = width / 2.0;
- }
- },
- expandFraction : function(fraction, keepZero) {
- if (fraction > 0.0) {
- var d = this._scale.domain();
- var d0 = (+ (d[0]));
- var d1 = (+ (d[d.length - 1]));
- var dd = fraction * (d1 - d0);
- if (!keepZero || (+ (d[0])) != 0.0) {
- d[0] = d0 - dd;
- }
- if (!keepZero || (+ (d[d.length - 1])) != 0.0) {
- d[d.length - 1] = d1 + dd;
- }
- this._scale.domain(d);
- }
- return this;
- },
- expandPixels : function(pixels, keepZero) {
- if (pixels > 0) {
- var r = this._scale.range();
- var dr = Math.abs((+ (r[0])) - (+ (r[r.length - 1])));
- var reduction = 2.0 * pixels;
- if (keepZero) {
- var d = this._scale.domain();
- if ((+ (d[0])) == 0.0 || (+ (d[d.length - 1])) == 0.0) {
- reduction = pixels;
- }
- }
- if (dr > reduction) {
- return this.expandFraction(pixels / (dr - reduction), keepZero);
- }
- }
- return this;
- },
- includeZero : function() {
- var d = this._scale.domain();
- var d0 = (+ (d[0]));
- var d1 = (+ (d[d.length - 1]));
- if (d0 * d1 > 0.0) {
- if (Math.abs(d0) <= Math.abs(d1)) {
- d[0] = 0.0;
- } else {
- d[d.length - 1] = 0.0;
- }
- this._scale.domain(d);
- }
- return this;
- },
- expandZeroExtent : function(keepZero) {
- var d = this._scale.domain();
- var extent = rave.extent(d);
- var d0 = (+ (extent[0]));
- var d1 = (+ (extent[1]));
- if (d0 == d1) {
- if (d0 == 0.0) {
- if (!keepZero) {
- d[0] = -1.0;
- }
- d[d.length - 1] = 1.0;
- } else {
- var del = Math.max(1.0, Math.abs(d0 / 100.0));
- d[0] = d0 - del;
- d[d.length - 1] = d0 + del;
- }
- this._scale.domain(d);
- }
- return this;
- },
- nice$1 : function() {
- this._scale.nice();
- return this;
- },
- nice$0 : function(magnitude) {
- if (magnitude == null) {
- this._scale.nice();
- } else {
- this._scale.nice(10, magnitude);
- }
- return this;
- },
- nice : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.nice$1();
- }
- return this.nice$0(a0);
- }
- });
- /**
- * Construct a CoordinateScale wrapping a linear scale with the given domain. The domain must be a non-empty array of numbers and have at least two values; otherwise a RAVE core exception will be thrown as the internal linear scale is constructed. If the domain is null, returns null.
- * @param (Array) domain The domain
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) Linear coordinate scale
- */
- com_ibm_rave_library_framework_internal_LinearCoordinateScale.create = function(domain) {
- return domain ? new com_ibm_rave_library_framework_internal_LinearCoordinateScale(domain) : null;
- };
- // $source: com/ibm/rave/library/framework/internal/OrdinalCoordinateScale
- /************************************************************************
- ** 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/framework/internal/CoordinateScaleImpl (loadtime) // useRounding, superclass
- /**
- * <p> CoordinateScale implementation wrapping an ordinal scale. The domain of the scale is passed to the constructor, and must be non-null. </p> <p> The scale is configured with bands, and the coordinate methods ( {@link #this.center(Object)} etc.) return the coordinates for those bands. The domain-modification methods ( {@link #this.includeZero()} etc.) do nothing. </p>
- */
- var com_ibm_rave_library_framework_internal_OrdinalCoordinateScale = rave['internal']['Declare'](com_ibm_rave_library_framework_internal_CoordinateScaleImpl, {
- /**
- * The internal ordinal scale
- */
- //_scale : null,
- //_originalDomain : null,
- //_originalDomainLabelAccessor : null,
- /**
- * The width in pixels; <I>half</I> the value passed to setWidth, to speed scale calculations.
- */
- _width : 0.0,
- /**
- * width has effect only if this is set true, otherwise we revert to default behavior
- */
- _applyWidth : false,
- /**
- * Private, use factory method.
- */
- constructor : function(domain, originalDomain) {
- this._scale = rave.scale.ordinal().domain(domain);
- this._originalDomain = originalDomain;
- },
- /** @expose */
- scale : function() {
- return this._scale;
- },
- /** @expose */
- isOrdinal : function() {
- return true;
- },
- range : function(v1, v2, padding, outerPadding) {
- if (com_ibm_rave_library_framework_internal_CoordinateScaleImpl.useRounding(v1, v2, this._scale.domain().length, padding, outerPadding)) {
- this._scale.rangeRoundBands([v1, v2], padding, outerPadding);
- } else {
- this._scale.rangeBands([v1, v2], padding, outerPadding);
- }
- return this;
- },
- /**
- * The center is actually the scale value plus half the rangeBand value.
- */
- /** @expose */
- center : function(data) {
- var v = (this._scale.call(null, data, 0, 0));
- if (v != null) {
- return v + + (this._scale.rangeBand()) / 2.0;
- }
- return v;
- },
- /**
- * If the width has been set (it is greater than 0) then we return the center minus the width (actually, half the width), otherwise, we return the scale value, which is actually at the bottom of the element.
- */
- /** @expose */
- lower : function(data) {
- var v = (this._scale.call(null, data, 0, 0) != null) ? + (this._scale.call(null, data, 0, 0)) : null;
- if (v != null) {
- if (this._applyWidth && this._width > 0.0) {
- return v + (+ (this._scale.rangeBand()) / 2.0) - this._width;
- }
- return (this._scale.call(null, data, 0, 0) != null) ? + (this._scale.call(null, data, 0, 0)) : null;
- }
- return v;
- },
- /**
- * If the width has been set (it is greater than 0) then we return the center plus the width (actually, half the width), otherwise, we return the scale value plus the rangeBand value.
- */
- /** @expose */
- upper : function(data) {
- var v = (this._scale.call(null, data, 0, 0));
- if (v != null) {
- if (this._applyWidth && this._width > 0.0) {
- return v + (+ (this._scale.rangeBand()) / 2.0) + this._width;
- }
- return v + + (this._scale.rangeBand());
- }
- return v;
- },
- /** @expose */
- width : function() {
- if (this._applyWidth && this._width > 0.0) {
- return 2.0 * this._width;
- }
- return + (this._scale.rangeBand());
- },
- setWidth : function(width) {
- if (width >= 0.0) {
- this._width = width / 2.0;
- } else {
- this._width = 0.0;
- }
- },
- applyWidth : function(apply) {
- this._applyWidth = apply;
- },
- originalDomain : function() {
- return this._originalDomain;
- },
- originalDomainLabelAccessor$0 : function(format) {
- this._originalDomainLabelAccessor = format;
- },
- originalDomainLabelAccessor$1 : function() {
- return this._originalDomainLabelAccessor;
- },
- originalDomainLabelAccessor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.originalDomainLabelAccessor$1();
- }
- return this.originalDomainLabelAccessor$0(a0);
- }
- });
- com_ibm_rave_library_framework_internal_OrdinalCoordinateScale.create$0 = function(domain, originalDomain) {
- return domain ? new com_ibm_rave_library_framework_internal_OrdinalCoordinateScale(domain, originalDomain) : null;
- };
- /**
- * Construct a CoordinateScale wrapping an ordinal scale with the given domain. If the domain is null, returns null.
- * @param (Array) domain The domain
- * @return (com.ibm.rave.library.framework.internal.OrdinalCoordinateScale) Ordinal coordinate scale
- */
- com_ibm_rave_library_framework_internal_OrdinalCoordinateScale.create$1 = function(domain) {
- return domain ? new com_ibm_rave_library_framework_internal_OrdinalCoordinateScale(domain, null) : null;
- };
- com_ibm_rave_library_framework_internal_OrdinalCoordinateScale.create = function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return com_ibm_rave_library_framework_internal_OrdinalCoordinateScale.create$1(a0);
- }
- return com_ibm_rave_library_framework_internal_OrdinalCoordinateScale.create$0(a0, a1);
- };
- // $source: com/ibm/rave/library/framework/internal/TimeCoordinateScale
- /************************************************************************
- ** 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/framework/internal/CoordinateScaleImpl (loadtime) // superclass
- /**
- * <p> CoordinateScale implementation wrapping a linear scale with a time domain. The domain of the scale is passed to the constructor, and must be a non-null array of at least two times or the core scale will throw an exception. </p> <p> {@link #this.setWidth()} sets the band width, and {@link #this.width()} returns it. {@link #this.center(Object)} returns the value of the linear scale applied to the argument, and {@link #this.lower(Object)} and {@link #this.upper(Object)} return the center value minus or plus half the width. </p> <p> {@link #this.expandPixels(, )} and {@link #this.expandFraction(, )} work by converting the dates to numbers with getTime(), expanding the number range, and constructing dates from the resulting times. The boolean keepZero argument does nothing in these methods since zero has no meaning in time data. {@link #this.includeZero()} does nothing, for the same reason. </p>
- */
- var com_ibm_rave_library_framework_internal_TimeCoordinateScale = rave['internal']['Declare'](com_ibm_rave_library_framework_internal_CoordinateScaleImpl, {
- /**
- * The internal linear time scale
- */
- //_scale : null,
- /**
- * The width in pixels; <I>half</I> the value passed to setWidth.
- */
- _width : 0,
- /**
- * Private, use factory method.
- */
- constructor : function(domain) {
- this._scale = rave.time.scale();
- this._scale.domain(domain);
- this._width = 0.0;
- },
- /** @expose */
- scale : function() {
- return this._scale;
- },
- isContinuous : function() {
- return true;
- },
- /** @expose */
- isTime : function() {
- return true;
- },
- range : function(v1, v2, padding, outerPadding) {
- this._scale.range([v1, v2]);
- return this;
- },
- /** @expose */
- center : function(data) {
- return + (this._scale.call(null, data, 0, 0));
- },
- /** @expose */
- lower : function(data) {
- return + (this._scale.call(null, data, 0, 0)) - this._width;
- },
- /** @expose */
- upper : function(data) {
- return + (this._scale.call(null, data, 0, 0)) + this._width;
- },
- /** @expose */
- width : function() {
- return 2.0 * this._width;
- },
- setWidth : function(width) {
- if (width >= 0.0) {
- this._width = width / 2.0;
- }
- },
- expandFraction : function(fraction, keepZero) {
- if (fraction > 0.0) {
- var d = this._scale.domain();
- var d0 = (d[0]).getTime();
- var d1 = (d[d.length - 1]).getTime();
- var dd = Math.round(fraction * (d1 - d0));
- d[0] = new Date(d0 - dd);
- d[d.length - 1] = new Date(d1 + dd);
- this._scale.domain(d);
- }
- return this;
- },
- expandPixels : function(pixels, keepZero) {
- if (pixels > 0) {
- var r = this._scale.range();
- var dr = Math.abs((+ (r[0])) - (+ (r[r.length - 1])));
- var reduction = 2.0 * pixels;
- if (dr > reduction) {
- return this.expandFraction(pixels / (dr - reduction), keepZero);
- }
- }
- return this;
- },
- expandZeroExtent : function(keepZero) {
- var d = this._scale.domain();
- var extent = rave.extent(d);
- var d0 = (extent[0]).getTime();
- var d1 = (extent[1]).getTime();
- if (d0 == d1) {
- d[0] = new Date(d0 - 1000);
- d[d.length - 1] = new Date(d0 + 1000);
- this._scale.domain(d);
- }
- return this;
- },
- nice : function() {
- this._scale.nice();
- return this;
- }
- });
- /**
- * Construct a CoordinateScale wrapping a linear time scale with the given domain. The domain must be a non-empty array of numbers and have at least two values; otherwise a RAVE core exception will be thrown as the internal linear scale is constructed. If the domain is null, returns null.
- * @param (Array) domain The domain
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) Linear coordinate scale
- */
- com_ibm_rave_library_framework_internal_TimeCoordinateScale.create = function(domain) {
- return domain ? new com_ibm_rave_library_framework_internal_TimeCoordinateScale(domain) : null;
- };
- // $source: com/ibm/rave/library/framework/internal/ScaleManager
- /************************************************************************
- ** 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/framework/internal/LinearCoordinateScale (static) // create
- //@import com/ibm/rave/library/framework/internal/OrdinalCoordinateScaleDatum (static) // new
- //@import com/ibm/rave/library/framework/internal/OrdinalCoordinateScale (runtime) // create
- //@import com/ibm/rave/library/framework/internal/TimeCoordinateScale (static) // create
- //@import com/ibm/rave/library/framework/internal/ClusteredCoordinateScale (runtime) // create
- var com_ibm_rave_library_framework_internal_ScaleManager = rave['internal']['Declare']({
- });
- /**
- * <p> Get the numeric domain of a value function applied to an array of data. The value function must be one that returns numbers or dates. </p> <p> If the data or value function is null, or if all values returned by applying the function to the data are null, returns null. </p> <p> Otherwise returns the pair [min,max] of minimum and maximum numbers or dates in the data. This is declared as an Object array to satisfy Java. </p>
- * @param (Array) data Data array
- * @param (rave['internal']['SingleValueFunction']) valueFunction Value function
- * @return (Array) Domain as [min,max], or null
- */
- com_ibm_rave_library_framework_internal_ScaleManager.numericDomainWithValueFunction = function(data, valueFunction) {
- if (!data || !valueFunction) {
- return null;
- }
- var vf = function(d, i, g) {
- return valueFunction(d);
- };
- var min = rave.min(data, vf);
- if (min != null) {
- return [min, rave.max(data, vf)];
- }
- return null;
- };
- /**
- * <p> Get the numeric domain of a DataAccessor applied to an array of data. </p> <p> If the data or accessor is null, or if the accessor type is not NUMERIC or TIME, or if all values returned by applying the accessor to the data are null, returns null. </p> <p> If the data accessor defines a domain, returns that domain. </p> <p> Otherwise returns the pair [min,max] of minimum and maximum numbers in the data. This is declared as an Object array to satisfy Java. </p>
- * @param (Array) data The data set's tabular data
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) accessor The typed accessor
- * @return (Array) Domain as [min,max], or null
- */
- com_ibm_rave_library_framework_internal_ScaleManager.numericDomain = function(data, accessor) {
- if (!data || !accessor || (!("numeric" == accessor.type$0()) && !("date" == accessor.type$0()))) {
- return null;
- }
- if (accessor.domain$0()) {
- return accessor.domain$0();
- }
- return com_ibm_rave_library_framework_internal_ScaleManager.numericDomainWithValueFunction(data, accessor.accessor$0());
- };
- /**
- * <p> Get the ordinal domain of a value function applied to an array of data. The value function must be one that returns numbers, strings, or date. The dataType indicates the type, one of "numeric", "string", or "date" </p> <p> If the data or value function is null, or if all values returned by applying the function to the data are null, returns null. </p> <p> Otherwise returns a list of unique non-null values returned by the accessor. If sort is true they are sorted by their natural sort order. </p>
- * @param (Array) data Data array
- * @param (String) dataType Data type, one of "numeric", "string", or "date"
- * @param (rave['internal']['SingleValueFunction']) valueFunction Value function
- * @param (boolean) sort Whether to sort the returned domain
- * @return (Array) list of values (possibly null)
- */
- com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomainWithValueFunction = function(data, dataType, valueFunction, sort) {
- if (!data || !valueFunction) {
- return null;
- }
- var set = {};
- var list = [];
- if ("date" == dataType) {
- 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];
- var v = valueFunction(o);
- if (v != null) {
- var t = (v).getTime();
- if (!(set.hasOwnProperty(t))) {
- set[t] = 1;
- list.push(v);
- }
- }
- }
- } else {
- for (var __i_enFor1 = 0, __exp_enFor1 = data, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var v = valueFunction(o);
- if (v != null && !(set.hasOwnProperty(v))) {
- set[v] = 1;
- list.push(v);
- }
- }
- }
- if (sort) {
- if ("numeric" == dataType) {
- list.sort(function(o1, o2) {
- return (+ (o1)) < (+ (o2)) ? -1 : 1;
- });
- } else if ("date" == dataType) {
- list.sort(function(o1, o2) {
- return (o1).getTime() < (o2).getTime() ? -1 : 1;
- });
- } else {
- list.sort();
- }
- }
- return list;
- };
- /**
- * <p> Get the ordinal domain of a DataAccessor applied to an array of data. </p> <p> If the data or accessor is null, or if the accessor type is not NUMERIC, STRING, or TIME, or if all values returned by applying the accessor to the data are null, returns null. </p> <p> If the DataAccessor defines a domain, returns that domain. </p> <p> Otherwise returns a list of unique non-null values returned by the accessor, sorted by their natural sort order. </p>
- * @param (Array) data The data
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) accessor The accessor
- * @param (boolean) sort If true sort the ordinal data
- * @return (Array) Domain as sorted unique non-null values, or null
- */
- com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$0 = function(data, accessor, sort) {
- if (!data || !accessor) {
- return null;
- }
- var type = accessor.type$0();
- if ("object" == type || "array" == type) {
- return null;
- }
- if (accessor.domain$0()) {
- return accessor.domain$0();
- }
- return com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomainWithValueFunction(data, type, accessor.accessor$0(), sort);
- };
- /**
- * Same as ordinalDomain(data, accessor, false).
- * @param (Array) data The data
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) accessor The accessor
- * @return (Array) Domain as sorted unique non-null values, or null
- */
- com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$1 = function(data, accessor) {
- return com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$0(data, accessor, false);
- };
- /**
- * <p> Create a CoordinateScale for a DataAccessor applied to a tabular data set. The data is the tabular array from the data set. </p> <p> If the data or accessor is null, or if the accessor type is not STRING, NUMERIC, or DATE, returns null. Otherwise the domain is obtained from the accessor. </p> <p> The domain is the accessor's {@link this.DataSlotEntry#this.domain()} if that is non-null. Otherwise it is obtained by applying the accessor all data values. For continuous (numeric and date) accessors this gives the [min,max] of the non-null values produced. For string accessors it gives the list of unique non-null values, optionally sorted. </p> <p> If the domain is empty (all values are null, or the data is an empty array) a null scale is returned. Otherwise a non-null scale using the domain is returned. If the accessor is numeric, the scale wraps a core linear scale; if the accessor is string, the scale wraps a core ordinal scale; if the accessor is date, the scale wraps a core time scale. </p>
- * @param (Array) data The tabular data
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) accessor The accessor
- * @param (boolean) sortOrdinalDomain If true, ordinal (string) domains are sorted
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) CoordinateScale for the data, or null
- */
- com_ibm_rave_library_framework_internal_ScaleManager.makeCoordinateScale$0 = function(data, accessor, sortOrdinalDomain) {
- if (!data || !accessor) {
- return null;
- }
- if ("numeric" == accessor.type$0()) {
- var domain = com_ibm_rave_library_framework_internal_ScaleManager.numericDomain(data, accessor);
- return domain ? com_ibm_rave_library_framework_internal_LinearCoordinateScale.create(domain) : null;
- }
- if ("string" == accessor.type$0()) {
- var domain = null;
- var originalDomain = null;
- if (data && accessor) {
- if (accessor.domain$0()) {
- domain = accessor.domain$0();
- var originalDomainMap = rave['internal']['ES6Map'].create();
- for (var __i_enFor0 = 0, __exp_enFor0 = domain, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- originalDomainMap.set(key, new com_ibm_rave_library_framework_internal_OrdinalCoordinateScaleDatum(key));
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = data, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var key = accessor(o);
- var datum = originalDomainMap.get(key);
- if (datum) {
- datum.push(o);
- }
- }
- originalDomain = [];
- for (var __i_enFor2 = 0, __exp_enFor2 = domain, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var d = __exp_enFor2[__i_enFor2];
- originalDomain.push(originalDomainMap.get(d));
- }
- } else {
- var set = {};
- var list = [];
- var originalDomainMap = rave['internal']['ES6Map'].create();
- for (var __i_enFor3 = 0, __exp_enFor3 = data, __len_enFor3 = __exp_enFor3.length;
- __i_enFor3 < __len_enFor3; ++__i_enFor3) {
- var o = __exp_enFor3[__i_enFor3];
- var v = accessor(o);
- if (v != null) {
- if (!(set.hasOwnProperty(v))) {
- set[v] = 1;
- list.push(v);
- originalDomainMap.set(v, new com_ibm_rave_library_framework_internal_OrdinalCoordinateScaleDatum(v));
- }
- originalDomainMap.get(v).push(o);
- }
- }
- if (sortOrdinalDomain) {
- list.sort();
- }
- domain = list;
- originalDomain = [];
- for (var __i_enFor4 = 0, __exp_enFor4 = domain, __len_enFor4 = __exp_enFor4.length;
- __i_enFor4 < __len_enFor4; ++__i_enFor4) {
- var d = __exp_enFor4[__i_enFor4];
- originalDomain.push(originalDomainMap.get(d));
- }
- }
- }
- var s = com_ibm_rave_library_framework_internal_OrdinalCoordinateScale.create$0(domain, originalDomain);
- s.originalDomainLabelAccessor$0(function(data, index, groupIndex) {
- var key = (data).key();
- return ""+(key);
- });
- return domain.length > 0 ? s : null;
- }
- if ("date" == accessor.type$0()) {
- var domain = com_ibm_rave_library_framework_internal_ScaleManager.numericDomain(data, accessor);
- return domain ? com_ibm_rave_library_framework_internal_TimeCoordinateScale.create(domain) : null;
- }
- return null;
- };
- /**
- * Same as makeCoordinateScale(data, accessor, false).
- * @param (Array) data The tabular data
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) accessor The accessor
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) CoordinateScale for the data, or null
- */
- com_ibm_rave_library_framework_internal_ScaleManager.makeCoordinateScale$1 = function(data, accessor) {
- return com_ibm_rave_library_framework_internal_ScaleManager.makeCoordinateScale$0(data, accessor, false);
- };
- /**
- * <p> Create a clustered CoordinateScale for an array of DataAccessors applied to a tabular data set. The data is the tabular array from the data set. The accessors are used to get ordinal domains for scales with {@link #this.ordinalDomain(Array, com_ibm_rave_library_datamodel_DataSlotEntry)} , and the clustered scale has one internal scale per accessor in order. </p> <p> If the data or accessor array is null, or if there are no non-null accessors, or if any accessor produces a null ordinal domain, returns null. </p> <p> TODO. This assumes that all accessors are for the same data set so we only need one data array. </p>
- * @param (Array) data The tabular data
- * @param (Array) accessors The accessors
- * @return (com.ibm.rave.library.framework.internal.CoordinateScaleImpl) CoordinateScale for the clustered data, or null
- */
- com_ibm_rave_library_framework_internal_ScaleManager.makeClusteredScale = function(data, accessors) {
- if (!data || !accessors || accessors.length == 0) {
- return null;
- }
- var domains = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = accessors, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var accessor = __exp_enFor0[__i_enFor0];
- var domain = com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$0(data, accessor, false);
- if (!domain || domain.length == 0) {
- return null;
- }
- domains.push(domain);
- }
- var domain = domains[0];
- var originalDomainMap = rave['internal']['ES6Map'].create();
- for (var __i_enFor1 = 0, __exp_enFor1 = domain, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- originalDomainMap.set(key, new com_ibm_rave_library_framework_internal_OrdinalCoordinateScaleDatum(key));
- }
- for (var __i_enFor2 = 0, __exp_enFor2 = data, __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var o = __exp_enFor2[__i_enFor2];
- var key = accessors[0](o);
- var datum = originalDomainMap.get(key);
- if (datum) {
- datum.push(o);
- }
- }
- var originalDomain = [];
- for (var __i_enFor3 = 0, __exp_enFor3 = domain, __len_enFor3 = __exp_enFor3.length;
- __i_enFor3 < __len_enFor3; ++__i_enFor3) {
- var key = __exp_enFor3[__i_enFor3];
- originalDomain.push(originalDomainMap.get(key));
- }
- var s = com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.create$1(domains, originalDomain);
- s.originalDomainLabelAccessor$0(function(data, index, groupIndex) {
- var key = (data).key();
- return ""+(key);
- });
- return s;
- };
- com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain = function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 2) {
- return com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$1(a0, a1);
- }
- return com_ibm_rave_library_framework_internal_ScaleManager.ordinalDomain$0(a0, a1, a2);
- };
- com_ibm_rave_library_framework_internal_ScaleManager.makeCoordinateScale = function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 2) {
- return com_ibm_rave_library_framework_internal_ScaleManager.makeCoordinateScale$1(a0, a1);
- }
- return com_ibm_rave_library_framework_internal_ScaleManager.makeCoordinateScale$0(a0, a1, a2);
- };
- // $source: com/ibm/rave/library/framework/internal/ClusteredCoordinateScale
- /************************************************************************
- ** 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/framework/internal/CoordinateScaleImpl (loadtime) // useRounding, superclass
- /**
- * <p> CoordinateScale implementation wrapping a series of ordinal scales. This creates a clustered or nested scale, where the first scale defines bands, then the second defines bands within each of those bands, and so forth. The data arguments for the scale methods are arrays of values, one per scale. </p> <p> For example if the scale is created with the domains ["A","B","C"] and ["Y","Z"], the first scale will split the range into three parts, then the second will split each of those parts into two parts, for a total of six parts. The data argument ["A","Y"] will return the first part, ["A","Z"] the second, ["B","Y"] the third, and so on. </p> <p> Any null domains passed to the constructor are ignored. If the scale has no non-null domains, it is created as a single-level scale with an empty domain and all coordinate methods will return null. (This is never used in the library because the domains are pre-filtered by the factory method in CoordinateScale.) </p> <p> The {@link #this.scale()} method returns the first of the scales. This must be used with care, but is safe to use with the pan-zoom methods. </p> <p> The {@link #this.range(, , Number, Number)} method configures each of the internal scales with range bands. The first scale is configured with the given range [v1,v2]. Each subsequent scale is configured with the range [0,width] where width is the width of the previous scale (this range is reversed to [width,0] if the original v1 > v2, so that all ordinal scales run in the same direction). </p> <p> The {@link #this.width()} method returns the width of the last or innermost scale. This is the width of all bands at that level. </p> <p> The coordinate methods ( {@link #this.center(Object)} etc. all expect that their argument is an array of ordinal values. Each input value is used, in order, to get the coordinate from the corresponding scale, and these coordinates are summed to get the result (if any are null, null is returned). If the number of input values is less than the number of scales, the returned result is for the last scale used. However, an empty array always produces null. </p> <p> For example, in the previous example with scales using ["A","B","C"] and ["Y","Z"] and creating three first-level and six second-level bands, center(["B","Z"]) will return the center point of the fourth of the second-level bands. center(["B"]) will return the center point of the second of the first-level bands. center([]) is null. </p> <p> Although all the scales are ordinal, {@link #this.isOrdinal()} returns false. This is because the argument to the coordinates methods must be an array (ArrayEx in Java) of values. </p> <p> The domain-modification methods ( {@link #this.includeZero()} etc.) do nothing. </p> <p> When the scale is pan-zoomed using the RAVE core Zoom behavior, the {@link #this.width()} method returns the zoomed width of the innermost bands, and the coordinate methods return the pan-zoomed lower, center, and upper coordinates. </p>
- */
- var com_ibm_rave_library_framework_internal_ClusteredCoordinateScale = rave['internal']['Declare'](com_ibm_rave_library_framework_internal_CoordinateScaleImpl, {
- /**
- * The scales.
- */
- //_scales : null,
- //_originalDomain : null,
- //_originalDomainLabelAccessor : null,
- /**
- * The initial width of the first scale when range was applied.
- */
- _firstWidth : 0,
- /**
- * Private, use factory method.
- */
- constructor : function(domains, originalDomain) {
- this._scales = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = domains, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var domain = __exp_enFor0[__i_enFor0];
- this._scales.push(rave.scale.ordinal().domain(domain));
- }
- this._originalDomain = originalDomain;
- this._firstWidth = 1.0;
- },
- /** @expose */
- scale : function() {
- return this._scales[0];
- },
- /** @expose */
- isClustered : function() {
- return true;
- },
- range : function(v1, v2, padding, outerPadding) {
- var scale = this._scales[0];
- if (com_ibm_rave_library_framework_internal_CoordinateScaleImpl.useRounding(v1, v2, scale.domain().length, padding, outerPadding)) {
- scale.rangeRoundBands([v1, v2], padding, outerPadding);
- } else {
- scale.rangeBands([v1, v2], padding, outerPadding);
- }
- var width = + (scale.rangeBand());
- this._firstWidth = width;
- var rev = v2 < v1;
- var s = this._scales.length;
- for (var i = 1; i < s; ++i) {
- scale = this._scales[i];
- if (com_ibm_rave_library_framework_internal_CoordinateScaleImpl.useRounding(0.0, width, scale.domain().length, padding, outerPadding)) {
- scale.rangeRoundBands(rev ? [width, 0] : [0, width], padding, outerPadding);
- } else {
- scale.rangeBands(rev ? [width, 0] : [0, width], padding, outerPadding);
- }
- width = + (scale.rangeBand());
- }
- return this;
- },
- /** @expose */
- center : function(data) {
- return this.getCoord(com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.toArray(data), 0.5);
- },
- /** @expose */
- lower : function(data) {
- return this.getCoord(com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.toArray(data), 0.0);
- },
- /** @expose */
- upper : function(data) {
- return this.getCoord(com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.toArray(data), 1.0);
- },
- /**
- * Used by coordinate methods; get the lower coordinate for the given array of input values, then add wmult times the width. If any scale along the way produces null, null is returned. This does work with prefixes, where there are fewer data values than scales; but returns null if the data array is empty or null.
- * @param (Array) data Array of data values
- * @param (double) wmult Width multiplier, using width of last scale applied
- * @return (Number) Scaled value
- */
- getCoord : function(data, wmult) {
- if (!data || data.length == 0) {
- return null;
- }
- var scale = this._scales[0];
- var sum = 0.0;
- var l = data.length < this._scales.length ? data.length : this._scales.length;
- var zoomFactor = + (this._scales[0].rangeBand()) / this._firstWidth;
- for (var i = 0; i < l; ++i) {
- scale = this._scales[i];
- var v = (scale.call(null, data[i], 0, 0) != null) ? + (scale.call(null, data[i], 0, 0)) : null;
- if (v == null) {
- return v;
- }
- sum += v * (i == 0 ? 1.0 : zoomFactor);
- }
- sum += wmult * + (scale.rangeBand()) * (data.length == 1 ? 1.0 : zoomFactor);
- return sum;
- },
- /** @expose */
- width : function() {
- var v = + (this._scales[this._scales.length - 1].rangeBand());
- if (this._scales.length > 1) {
- v *= + (this._scales[0].rangeBand()) / this._firstWidth;
- }
- return v;
- },
- originalDomain : function() {
- return this._originalDomain;
- },
- originalDomainLabelAccessor$0 : function(accessor) {
- this._originalDomainLabelAccessor = accessor;
- },
- originalDomainLabelAccessor$1 : function() {
- return this._originalDomainLabelAccessor;
- },
- originalDomainLabelAccessor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.originalDomainLabelAccessor$1();
- }
- return this.originalDomainLabelAccessor$0(a0);
- }
- });
- /**
- * Construct a CoordinateScale wrapping a clustered scale, using ordinal scales with the given domains. If the list is null or all the domains in the list are null, returns null.
- * @param (Array) domains The domains
- * @return (com.ibm.rave.library.framework.internal.ClusteredCoordinateScale) Clustered coordinate scale
- */
- com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.create$0 = function(domains) {
- return com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.create$1(domains, null);
- };
- com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.create$1 = function(domains, originalDomain) {
- if (!domains) {
- return null;
- }
- var nonNullDomains = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = domains, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var domain = __exp_enFor0[__i_enFor0];
- if (domain) {
- nonNullDomains.push(domain);
- }
- }
- return (nonNullDomains.length == 0) ? null : new com_ibm_rave_library_framework_internal_ClusteredCoordinateScale(nonNullDomains, originalDomain);
- };
- /**
- * Convert an object into a single element array (if it's not already a list). <p> For clustered single-element accessors (like lines). We are only concerned with the outer scale. Create a single element array from our single data point - this will be mapped to coordinates in the outer scale.
- */
- com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.toArray = function(data) {
- var arrayData;
- if (!((typeof data === "array" || data instanceof Array))) {
- arrayData = [];
- arrayData.push(data);
- } else {
- arrayData = data;
- }
- return arrayData;
- };
- com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.create = function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.create$0(a0);
- }
- return com_ibm_rave_library_framework_internal_ClusteredCoordinateScale.create$1(a0, a1);
- };
- // $source: com/ibm/rave/library/palette/internal/ContinuousPalette
- /************************************************************************
- ** 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/palette/Palette (loadtime) // INVALID_DOMAIN_NULL, INVALID_DOMAIN_EMPTY, superclass, INVALID_DOMAIN_DATATYPE
- /**
- * A continuous palette object The continuous palette will use either a linearscale or a threshold scale to interpolate the color value
- */
- var com_ibm_rave_library_palette_internal_ContinuousPalette = rave['internal']['Declare'](com_ibm_rave_library_palette_Palette, {
- /**
- * the scale for the color
- */
- //colorScale : null,
- /**
- * normalized or absolute value type
- */
- //valueType : null,
- /**
- * continuous or discrete fill type
- */
- //fillType : null,
- /**
- * upper color
- */
- //upper : null,
- /**
- * lower color
- */
- //lower : null,
- /**
- * the normalized values
- */
- //normalizedValues : null,
- /**
- * minimum value
- */
- minValue : 1.7976931348623157E308,
- /**
- * maximum value
- */
- maxValue : 4.9E-324,
- _$functionClassMethod : function() {
- var _$self = function(data, index, groupIndex) {
- var dataValue = _$self.dataAccessor ? _$self.dataAccessor(data) : null;
- if (_$self.getDomainValidity() == com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_NULL) {
- dataValue = 0.5;
- } else if (_$self.getDomainValidity() == com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_EMPTY) {
- dataValue = null;
- } else if (_$self.getDomainValidity() == com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_DATATYPE) {
- dataValue = (dataValue != null || _$self.nullColor == null) ? 0.5 : null;
- }
- if (dataValue != null) {
- var isContinuous = "continuous" == _$self.fillType;
- var doubleValue = + (dataValue);
- if (doubleValue < _$self.minValue && _$self.lower != null && isContinuous) {
- return _$self.lower;
- } else if (doubleValue > _$self.maxValue && _$self.upper != null) {
- return _$self.upper;
- } else if (doubleValue >= _$self.maxValue && !isContinuous) {
- return _$self.colorScale.range()[_$self.colorScale.range().length - 1];
- } else if (isContinuous && (doubleValue > _$self.maxValue)) {
- return _$self.colorScale.call(this, _$self.maxValue, index, groupIndex);
- } else if (isContinuous && (doubleValue < _$self.minValue)) {
- return _$self.colorScale.call(this, _$self.minValue, index, groupIndex);
- } else {
- return _$self.colorScale.call(this, doubleValue, index, groupIndex);
- }
- } else {
- return _$self.nullColor;
- }
- };
- return _$self;
- },
- constructor : function(jsonPalette) {
- this.valueType = "absolute";
- this.fillType = "continuous";
- this.normalizedValues = [];
- /**
- * Constructor for the continuous palette this constructor takes an array of colors represented by a json array
- */
- {
- var fType = ""+(jsonPalette["fillType"]);
- if ("discrete" == fType || "continuous" == fType) {
- this.fillType = fType;
- }
- this.type = this.fillType;
- if ("discrete" == this.fillType) {
- this.colorScale = rave.scale.threshold();
- } else {
- this.colorScale = rave.scale.linear();
- }
- var vType = (jsonPalette["valueType"]);
- if (vType != null) {
- this.valueType = vType;
- }
- if (this.colorScale) {
- this.addAllColors(jsonPalette["fills"]);
- }
- }
- },
- /**
- * @return (String) the valueType
- */
- getValueType : function() {
- return this.valueType;
- },
- /**
- * @param colors
- */
- setupColorScale : function(domain, range) {
- this.colorScale.range(range);
- this.colorScale.domain(domain);
- },
- /** @expose */
- addColor : function(color) {
- var domain = this.colorScale.domain();
- var range = this.colorScale.range();
- this.addColorImpl(color, domain, range);
- this.setupColorScale(domain, range);
- },
- addColorImpl : function(jsonColor, domain, range) {
- var atValue = jsonColor["at"];
- if ((typeof atValue === "string" || atValue instanceof String)) {
- if ("lower" == atValue) {
- this.lower = ""+(jsonColor["fill"]);
- } else if ("upper" == atValue) {
- this.upper = ""+(jsonColor["fill"]);
- }
- } else {
- var doubleAtValue = + (jsonColor["at"]);
- if (this.valueType == "absolute") {
- this.minValue = Math.min(this.minValue, doubleAtValue);
- this.maxValue = Math.max(this.maxValue, doubleAtValue);
- var previousIndex = 0;
- for (var __i_enFor0 = 0, __exp_enFor0 = domain, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var domainValue = + (o);
- if (doubleAtValue < domainValue) {
- break;
- } else {
- previousIndex++;
- }
- }
- range.splice(previousIndex, 0, jsonColor["fill"]);
- domain.splice(previousIndex, 0, doubleAtValue);
- } else {
- range.push(jsonColor["fill"]);
- domain.push(doubleAtValue);
- this.normalizedValues.push(doubleAtValue);
- }
- }
- },
- /** @expose */
- addAllColors : function(colors) {
- var domain = [];
- var range = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = colors, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var color = __exp_enFor0[__i_enFor0];
- this.addColorImpl(color, domain, range);
- }
- this.setupColorScale(domain, range);
- },
- /** @expose */
- removeColor : function(color) {
- var domain = this.colorScale.domain();
- var range = this.colorScale.range();
- var jsonColor = color;
- var atValue = jsonColor["at"];
- if ("lower" == atValue) {
- this.lower = null;
- } else if ("upper" == atValue) {
- this.upper = null;
- } else {
- var atIndex;
- if (this.valueType == "absolute") {
- atIndex = domain.indexOf(+ (atValue));
- } else {
- var value = + (atValue);
- atIndex = domain.indexOf(this.minValue + value * (this.maxValue - this.minValue));
- }
- if (atIndex != -1) {
- domain.splice(atIndex, 1);
- range.splice(atIndex, 1);
- this.minValue = + (rave.min(domain));
- this.maxValue = + (rave.max(domain));
- this.setupColorScale(domain, range);
- }
- }
- },
- /** @expose */
- domain : function(domain) {
- this.minValue = + (rave.min(domain));
- this.maxValue = + (rave.max(domain));
- if (this.valueType == "normalized") {
- var dm = [];
- var dmRange = this.maxValue - this.minValue;
- for (var i = 0; i < this.normalizedValues.length; ++i) {
- var domainValue = + (this.normalizedValues[i]);
- dm[i] = this.minValue + domainValue * dmRange;
- }
- this.colorScale.domain(dm);
- }
- },
- /** @expose */
- getScale : function() {
- return this.colorScale;
- },
- /**
- * Invalidate the domain which indicates we need to use the nullDomain and nullAccessor
- */
- /** @expose */
- invalidateDomain : function() {
- var domain = [];
- domain.push(0.0);
- domain.push(1.0);
- this.domain(domain);
- },
- /**
- * Can the palette handle the data type
- * @return (boolean) whether the palette can handle the data type
- */
- /** @expose */
- canHandleDataType : function(type) {
- return "numeric" == type;
- }
- });
- /**
- * Fill Types
- */
- //com_ibm_rave_library_palette_internal_ContinuousPalette.CONTINUOUS_TYPE = "continuous";
- //com_ibm_rave_library_palette_internal_ContinuousPalette.DISCRETE_TYPE = "discrete";
- //com_ibm_rave_library_palette_internal_ContinuousPalette.DATATYPE_NUMERIC = "numeric";
- /**
- * the domain to use when domain is invalid
- */
- com_ibm_rave_library_palette_internal_ContinuousPalette.INVALID_DOMAIN_START = 0.0;
- com_ibm_rave_library_palette_internal_ContinuousPalette.INVALID_DOMAIN_MID = 0.5;
- com_ibm_rave_library_palette_internal_ContinuousPalette.INVALID_DOMAIN_END = 1.0;
- /**
- * Value Types
- */
- //com_ibm_rave_library_palette_internal_ContinuousPalette.NORMALIZED_VALUE_TYPE = "normalized";
- //com_ibm_rave_library_palette_internal_ContinuousPalette.ABSOLUTE_VALUE_TYPE = "absolute";
- // $source: com/ibm/rave/library/palette/internal/ConditionalPalette
- /************************************************************************
- ** 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/palette/Palette (loadtime) // INVALID_DOMAIN_NULL, VALID_DOMAIN, superclass
- /**
- * <p> A Palette type which maps string values to colors, often called "Fred is red". Each value must be unique, but multiple values can be mapped to the same color. </p> An example of a JSON string for a conditional palette: { "id": "ConditionalPalette", "label" : "Conditional Palette", "description" : "A Conditional Palette.", "icon" : "someicon", "fillType": "conditional", "default" : "white", "fills": [ { "values": ["Fred", "Coke", "Canada" ], "fill": "red"}, { "values": [ "Sweden", "Moscow", "Molson" ], "fill" : "blue"}, { "values": ["Ireland", "Boston", "Ginger Ale"}, "fill" : "green"}, { "values": [ "Australia", "Miami", "Corona" ], "fill" : "yellow" } ] } <p> When creating a conditional palette using a JSONObject, the values and colors are added internally to a map, and both the domain and range are set for the OrdinalScale used by the palette. Adding or removing a color changes the map and the range and domain. </p> <p> When adding a new color, we pass in a JSON object like one of the fills in the JSON above, with an array of values and a fill color. The array of values may only have a single value. If a value already has a color, the value is not entered, and the color is not changed. If we wish to change an entry in the palette, we must remove and re-add it. </p> <p> When removing a color, we pass in a JSON object like one of the fills in the JSON above, with an array of values and a fill color. The array of values may only have a single value. If both the value and the color do not match the entry for that value, the color is not removed. Both must match for the value-color pair to be removed from the palette. </p>
- */
- var com_ibm_rave_library_palette_internal_ConditionalPalette = rave['internal']['Declare'](com_ibm_rave_library_palette_Palette, {
- //colors : null,
- //paletteMap : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * Get a color value for the given data will return null if the data is null
- * @param (rave['internal']['SceneNode']) this the context in which this method is invoked
- * @param (Object) data a data value, may be <code>null</code>
- * @param (int) index the index of the current scene node
- * @param (int) groupIndex the group index of the current scene node
- * @return (Object) a computed value
- */
- function(data, index, groupIndex) {
- var dataValue;
- if (_$self.getDomainValidity() == com_ibm_rave_library_palette_Palette.VALID_DOMAIN) {
- dataValue = _$self.dataAccessor(data);
- } else if (_$self.getDomainValidity() == com_ibm_rave_library_palette_Palette.INVALID_DOMAIN_NULL) {
- dataValue = "";
- } else {
- dataValue = null;
- }
- return dataValue != null ? _$self.paletteMap[dataValue] : _$self.nullColor;
- };
- return _$self;
- },
- /**
- * Sets up the internal mapping from string values to color, and sets up the range and domain of the OrdinalScale returned by getScale().
- * @param (Object) jsonPalette A JSONObject describing the palette
- */
- constructor : function(jsonPalette) {
- this.type = com_ibm_rave_library_palette_internal_ConditionalPalette.Type;
- this.paletteMap = {};
- this.colors = rave.scale.ordinal();
- this.addAllColors(jsonPalette["fills"]);
- },
- /** @expose */
- addAllColors : function(fills) {
- var domain = [];
- var range = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = fills, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var fill = __exp_enFor0[__i_enFor0];
- var color = ""+((fill)["fill"]);
- var values = (fill)["values"];
- for (var __i_enFor1 = 0, __exp_enFor1 = values, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var value = __exp_enFor1[__i_enFor1];
- if (!(this.paletteMap.hasOwnProperty(""+(value)))) {
- var strVal = ""+(value);
- this.paletteMap[strVal] = color;
- domain.push(strVal);
- range.push(color);
- }
- }
- }
- this.colors.domain(domain);
- this.colors.range(range);
- },
- /**
- * @param colors
- */
- setupColorScale : function(domain, range) {
- this.colors.domain(domain).range(range);
- },
- /** @expose */
- addColor : function(color) {
- var domain = this.colors.domain();
- var range = this.colors.range();
- this.addColorImpl(color, domain, range);
- this.setupColorScale(domain, range);
- },
- addColorImpl : function(jsonColor, domain, range) {
- var color = ""+(jsonColor["fill"]);
- var values = jsonColor["values"];
- for (var __i_enFor0 = 0, __exp_enFor0 = values, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var value = __exp_enFor0[__i_enFor0];
- if (!(this.paletteMap.hasOwnProperty(""+(value)))) {
- var strVal = ""+(value);
- this.paletteMap[strVal] = color;
- domain.push(strVal);
- range.push(color);
- }
- }
- },
- /** @expose */
- removeColor : function(colorObj) {
- var domain = this.colors.domain();
- var range = this.colors.range();
- var jsonColor = colorObj;
- var color = ""+(jsonColor["fill"]);
- var values = jsonColor["values"];
- for (var __i_enFor0 = 0, __exp_enFor0 = values, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var value = __exp_enFor0[__i_enFor0];
- var ind = domain.indexOf(value);
- if (ind > -1 && (""+(range[ind])) == color) {
- delete this.paletteMap[value];
- domain.splice(ind, 1);
- range.splice(ind, 1);
- }
- }
- this.setupColorScale(domain, range);
- },
- /** @expose */
- domain : function(domain) {},
- /** @expose */
- getScale : function() {
- return this.colors;
- },
- /**
- * Invalidate the domain
- */
- /** @expose */
- invalidateDomain : function() {},
- /**
- * Can the palette handle the data type
- * @return (boolean) whether the palette can handle the data type
- */
- /** @expose */
- canHandleDataType : function(type) {
- return true;
- }
- });
- /**
- * the domain to use when domain is invalid
- */
- com_ibm_rave_library_palette_internal_ConditionalPalette.INVALID_DOMAIN = "";
- com_ibm_rave_library_palette_internal_ConditionalPalette.Type = "conditional";
- // $source: com/ibm/rave/library/framework/internal/AbstractView
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2019
- **
- ** 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/action/internal/OperationsUtil (runtime) // unhighlight, deselectAll, toggleSelection
- //@import com/ibm/rave/library/Library (static) // Library
- //@import com/ibm/rave/library/palette/internal/ContinuousPalette (static) // new
- //@import com/ibm/rave/library/framework/internal/ScaleManager (runtime) // makeCoordinateScale
- /**
- * An abstract view class that handles common code between the bundle 'views'.
- */
- var com_ibm_rave_library_framework_internal_AbstractView = rave['internal']['Declare']({
- /**
- * The context (model) used by this view, as passed to the constructor.
- */
- //context : null,
- updateType : 0,
- /**
- * All subclasses must provide a constructor (used by the view's controller) that takes a BundleContext as its first argument.
- * @param (com.ibm.rave.library.framework.internal.BundleContext) context The bundle context (model) used by the view
- */
- constructor : function(context) {
- this.context = context;
- },
- /**
- * Override this method with any setup required for the view, e.g. retrieving properties for use in the draw() method. The base implementation does nothing.
- */
- setup : function() {},
- /**
- * Override this method with any teardown required for the view, e.g. destroying a map cache The base implementation does nothing.
- */
- dispose : function() {},
- /**
- * Get the coordinate scale for a given role (X1, Y1, etc.) in the chart. The scale is only valid after the chart has rendered. The method will return null if the chart does not have that role, or if the role was not used in the last render (for example in the bubble bundle, if the input data did not include the "x" or "y" slots and a hierarchical packed bubble was rendered). The roles are declared in AxisComponent. The base class always returns null and must be overridden in views that have coordinate scales.
- * @param (String) role ROLE_X1, ROLE_Y1, ROLE_X2, or ROLE_Y2 from AxisComponent
- * @return (com.ibm.rave.library.framework.CoordinateScale) A coordinate scale, or null
- */
- getCoordinateScale : function(role) {
- return null;
- },
- /**
- * Retrieve internationalized text message for the key, if not found use alternative value
- * @param (String) key nls key
- * @param (String) alt alternative value, if the key is not present in the catalog
- * @return (String) internationalized text message
- */
- message : function(key, alt) {
- return this.context.message(key, alt);
- },
- /**
- * Does the property change require redrawing the chart? It returns one of four values: 1) UPDATE_RESET_DATA --- recalculate data & scales and redraw components; 2) UPDATE_RESET_LAYOUT --- no data change, but need to recalculate layout (scales) and therefore redraw components; 3) UPDATE_REDRAW --- no data or scales recalculation but needs redrawing components; 4) UPDATE_NOTHING --- do nothing
- * @param (String) property The property name
- * @return (int) the type of update required
- */
- requireUpdate : function(property) {
- if (property == "axis.x.title.text" && this.isInvisible("axis.x.title.display")) {
- return 4;
- }
- if (property == "axis.y.title.text" && this.isInvisible("axis.y.title.display")) {
- return 4;
- }
- if (property == "axis.x.title.style.fill" && this.isInvisible("axis.x.title.display")) {
- return 4;
- }
- if (property == "axis.y.title.style.fill" && this.isInvisible("axis.y.title.display")) {
- return 4;
- }
- if ((property == "axis.y.gridlines.style.stroke" || property == "axis.y.gridlines.style.stroke-dasharray") && this.isInvisible("axis.y.gridlines.display")) {
- return 4;
- }
- if ((property == "axis.x.gridlines.style.stroke" || property == "axis.x.gridlines.style.stroke-dasharray") && this.isInvisible("axis.x.gridlines.display")) {
- return 4;
- }
- if ((property == "axis.y2.gridlines.style.stroke" || property == "axis.y2.gridlines.style.stroke-dasharray") && this.isInvisible("axis.y2.gridlines.display")) {
- return 4;
- }
- if (property == "legend.position" && this.isInvisible("legend.display")) {
- return 4;
- }
- if (property == "legend.title" && this.isInvisible("legend.display")) {
- return 4;
- }
- if (property == "effect.duration" || property == "effect.name") {
- return 4;
- }
- if (this.isInvisible("shadow.display") && property == "shadow.style") {
- return 4;
- }
- var p = this.context.properties.property(property);
- if (!p) {
- return 4;
- }
- var reset = p.meta().resetView();
- if (reset == "data") {
- return 0;
- } else if (reset == "layout") {
- return 1;
- } else {
- return (reset == "zoom" ? 2 : 3);
- }
- },
- isInvisible : function(id) {
- var obj = this.context.getPropertyValue(id);
- if (obj != null) {
- return !((obj));
- }
- return false;
- },
- /**
- * Set the minimum update level update that needs to be performed based on the property id.
- * @param (String) id The property id
- */
- checkUpdate : function(id) {
- this.updateType = Math.min(this.updateType, this.requireUpdate(id));
- },
- /**
- * Reset the update level to the lowest possible level.
- */
- reset : function() {
- this.updateType = 0;
- },
- /**
- * Reset the update level to redraw the chart.
- */
- resetRedraw : function() {
- this.updateType = 3;
- },
- /**
- * Register an event with the bundle view. This implementation will be mainly the same across all bundles, however any bundle that wishes to add additional event listeners may do so by extending this method. It's recommended that any extending class should call super, to ensure the default behaviours are maintained.
- * @param (String) eventName
- * @param (com.ibm.rave.library.framework.Controller.BundleEventCallback) callback
- */
- on : function(eventName, callback) {},
- /**
- * Reset the update level to reset the layout.
- */
- resetLayout : function() {
- this.updateType = 1;
- },
- setBorder : function(width, color) {
- var borderWidth = this.context.convertCSSSizeToPixels(this.context.getPropertyValue(width));
- var borderColor = (this.context.getPropertyValue(color));
- var style = {};
- style["stroke-width"] = borderWidth;
- style["stroke"] = borderColor;
- this.context.actions.action("unhighlight").setOperation(com_ibm_rave_library_action_internal_OperationsUtil.unhighlight(style));
- this.context.actions.action("deselectAll").setOperation(com_ibm_rave_library_action_internal_OperationsUtil.deselectAll(style));
- this.context.actions.action("toggleSelect").setOperation(com_ibm_rave_library_action_internal_OperationsUtil.toggleSelection(style));
- }
- /**
- * Implement this method to perform Rave 2 enter-update-exit pattern. The chart root node is the bundle context node, e.g. Selector updateSelection = context.node.data(context.data); Selector enterSelection = updateSelection.enter(); Selector exitSelection = updateSelection.exit();
- */
- //draw : function() {}
- });
- /**
- * <p> Create a structure of nodes in the given selector. The enter-append paradigm is used so the structure is created only as needed. A <defs> node is always created first. The structure is defined by an array of strings. </p> <p> A "(" indicates that the nodes are to be children of the last-created group node (using recursion), while ")" indicates return from the recursion. </p> <p> Other strings create a node as a child of the current node. The string specifies the node type-name, class-name(s), and id, all optional. The string is parsed as: <code><i>type-name</i>.<i>class-names</i>#<code>id</code>. </p> <p> The type-name, class-names, and id are all optional. If the type-name is missing or "", "g" is used. Class-names are separated by spaces. If the id is missing or "", the node's id is not set. If the class-name(s) are missing or "", the node's class is not set. Examples: </p> <ul> <li>"" creates <g></li> <li>".left" creates<g class="left"></li> <li>".axis left" creates <g class="axis left"></li> <li>"rect.background" creates <rect class="background"></li> <li>"rect.vizlibrary-background#background" creates <rect class="vizlibrary-background" id="background"></li> </ul> <p> Note that a "." begins the class-names, but class-names are separated by spaces. </p> <p> For example the array </p> <pre> "defs", ".vizlibrary", "(", ".vizlibrary-bubble", "(", "rect.background", ".axis left", ".axis bottom", ".element-group", ")", ".legend", ")" </pre> <p> would create, under the provided node, the structure </p> <pre> <defs></defs> <g class="vizlibrary"> <g class="vizlibrary-bubble"> <rect class="background"/> <g class="axis left"></g> <g class="axis bottom"></g> <g class="element-group"></g> </g> <g class="legend"></g> </g> </pre> <p> Three rules must be followed. If they are not, the code will run but the results are not defined. </p> <ol> <li> The "(" and ")" strings must form nested parentheses, except that it is not necessary to "close" all the ")" strings at the end although it makes the structure more readable. </li> <li> The string may have at most one "." and one "#". </li> <li> Do not use any CSS special characters including ".", ">", or "#" in the class-names. </li> <li> All children of a given node must have different combinations of type-name and class-names, and if a node has no classes there must be no other nodes of that type-name. </li> </ol> <p> As examples of the last rule, each of these arrays of strings should not be used: </p> <pre> [ ".left", ".left" ] [ "g.left", ".left" ] [ "rect", "rect." ] [ "rect", "rect.left" ] </pre> <p> The first requests two nodes with the type-name "g" and the class-name "left", as does the second. The third requests two nodes with the type-name "rect" and no class-name. The last requests a node with type-name "rect" and no class-name, so the other node with type-name "rect" is not allowed. </p>
- * @param (rave['internal']['Selector']) node The selector in which groups are created
- * @param (java.lang.String[]) list The list of strings defining the structure
- */
- com_ibm_rave_library_framework_internal_AbstractView.createGroupStructure = function(node, list) {
- com_ibm_rave_library_framework_internal_AbstractView.createGroupStructureRecursive(node, list, [0]);
- };
- /**
- * Worker method for createGroupStructure.
- * @param (rave['internal']['Selector']) node The selector in which groups are created
- * @param (java.lang.String[]) list The list of strings defining the structure
- * @param length The length of the list
- * @param (int[]) index The modifiable index (TODO: Should we mark this with UnwrapArray for JS? If so, how?)
- */
- com_ibm_rave_library_framework_internal_AbstractView.createGroupStructureRecursive = function(node, list, index) {
- var last = node;
- while (index[0] < list.length) {
- var cs = list[index[0]++];
- if (cs == null) {
- } else if ("(" == cs) {
- com_ibm_rave_library_framework_internal_AbstractView.createGroupStructureRecursive(last, list, index);
- } else if (")" == cs) {
- return;
- } else {
- var id = null;
- var p = cs.indexOf("#");
- if (p >= 0) {
- id = cs.substring(p + 1);
- if ("" == id) {
- id = null;
- }
- cs = cs.substring(0, p);
- }
- var classnames = null;
- p = cs.indexOf(".");
- if (p >= 0) {
- classnames = cs.substring(p + 1);
- if ("" == classnames) {
- classnames = null;
- }
- cs = cs.substring(0, p);
- }
- var type = cs;
- if ("" == type) {
- type = "g";
- }
- var s;
- if (classnames == null) {
- s = node.selectAll(type).data(com_ibm_rave_library_framework_internal_AbstractView.ONEDATA).enter().append(type);
- } else {
- s = node.selectAll(type + "." + classnames.replace(new RegExp(" ","g"), ".")).data(com_ibm_rave_library_framework_internal_AbstractView.ONEDATA).enter().append(type).attr("class", classnames);
- }
- if (id != null) {
- s.attr("id", id);
- }
- last = s;
- }
- }
- };
- /**
- * 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 fould, the default palette is returned.
- * @param (String) paletteID The palette ID
- * @param (Array) fills Array of colors
- * @return (com.ibm.rave.library.palette.Palette) Palette
- */
- com_ibm_rave_library_framework_internal_AbstractView.getPalette = function(paletteID, fills) {
- var colorPalette = com_ibm_rave_library_framework_internal_AbstractView.getFillPalette(fills);
- if (colorPalette) {
- return colorPalette;
- }
- colorPalette = com_ibm_rave_library_Library.palettes.getPalette(paletteID);
- if (colorPalette) {
- return colorPalette;
- }
- return com_ibm_rave_library_Library.palettes.getDefaultPalette();
- };
- /**
- * 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. If the fills array does not meet the criteria, null is returned.
- * @param (Array) fills Array of colors
- * @return (com.ibm.rave.library.palette.Palette) Palette, or null
- */
- com_ibm_rave_library_framework_internal_AbstractView.getFillPalette = function(fills) {
- if (!fills || fills.length < 2) {
- return null;
- }
- for (var __i_enFor0 = 0, __exp_enFor0 = fills, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var s = __exp_enFor0[__i_enFor0];
- if (s == null || "" == s) {
- return null;
- }
- }
- var paletteJSON = {};
- paletteJSON["fillType"] = "continuous";
- paletteJSON["valueType"] = "normalized";
- var nfills = fills.length;
- var fillsJSON = [];
- for (var i = 0; i < nfills; ++i) {
- var stop = {};
- stop["at"] = i / (nfills - 1.0);
- stop["fill"] = fills[i];
- fillsJSON.push(stop);
- }
- paletteJSON["fills"] = fillsJSON;
- return new com_ibm_rave_library_palette_internal_ContinuousPalette(paletteJSON);
- };
- /**
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) entry A data slot entry, possibly null
- * @return (rave['internal']['SingleValueFunction']) The accessor function of the accessor, or null if it is null
- */
- com_ibm_rave_library_framework_internal_AbstractView.accessorOf = function(entry) {
- return entry ? entry.accessor$0() : null;
- };
- /**
- * The data-processing utilities receive a SingleValueFunction to check that data is in the domain of a scale. If the function is null, or returns non-null when applied to the data value (as in a scale), the data is valid; otherwise it is not. This method returns null for null, numeric, and date data, and a value function using the slot's domain for string data. TODO: A Domain class available from the entry would allow some reuse.
- * @param (Array) data The data, used to compute domain when necessary
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) entry A data slot entry, possibly null
- * @return (rave['internal']['SingleValueFunction']) A validation function, possibly null
- */
- com_ibm_rave_library_framework_internal_AbstractView.domainCheckerOf = function(data, entry) {
- if (!entry) {
- return null;
- }
- if ("string" == entry.type$0()) {
- var scale = com_ibm_rave_library_framework_internal_ScaleManager.makeCoordinateScale$1(data, entry);
- if (scale) {
- scale.range(1.0, 2.0, null, null);
- var sscale = scale.scale();
- return function(d) {
- return sscale.call(null, d, 0, 0);
- };
- }
- return null;
- }
- return null;
- };
- /**
- * <p> Registers new symbols with Rave.svg for use by views and legends. This may be called repeatedly, and by different bundles. </p> <p> {@link #"compositeViewLegendLineSymbol"} : A zig-zag line resembling a line chart </p>
- */
- com_ibm_rave_library_framework_internal_AbstractView.registerBundleSymbols = function() {
- rave.svg.symbolCreator("compositeViewLegendLineSymbol", function(size) {
- var len = Math.sqrt(size) / 2.0;
- var l3 = len / 3;
- return "M" + (-len) + "," + (len) + "L" + (-l3) + "," + (-l3 + 1.5) + " " + (l3) + "," + (l3 + 1.5) + " " + (len) + "," + (-len + 3) + " " + (len) + "," + (-len) + " " + (l3) + "," + (l3 - 1.5) + " " + (-l3) + "," + (-l3 - 1.15) + " " + (-len) + "," + (len - 3) + "Z";
- });
- };
- /**
- * <p> Given a slot accessor that takes original (integrator) data objects as argument, returns an accessor function that takes a BundleDatum as argument and applies the slot accessor to the BundleDatum original data. If the argument BundleDatum is null or has null original data, the accessor returns null. </p> <p> If the original accessor is null, returns a null accessor. </p>
- * @param (rave['internal']['SingleValueFunction']) accessor Original-datum accessor
- * @return (rave['internal']['SingleValueFunction']) BundleDatum accessor, or null
- */
- com_ibm_rave_library_framework_internal_AbstractView.originalDatumAccessor = function(accessor) {
- return accessor ? function(datum) {
- var d = datum != null ? (datum).originalData() : null;
- return d != null ? accessor(d) : null;
- } : null;
- };
- /**
- * CSS class-name for the container of the whole visualization
- */
- //com_ibm_rave_library_framework_internal_AbstractView.VIZLIBRARY_CLASS = "vizlibrary";
- /**
- * CSS class-name for the elements containing the shapes.
- */
- //com_ibm_rave_library_framework_internal_AbstractView.ELEMENT_GROUP_CLASS = "element-group";
- /**
- * CSS class for shapes inside an element and legend.
- */
- //com_ibm_rave_library_framework_internal_AbstractView.BUNDLE_SHAPE_CLASS = "bundle-shape";
- /**
- * CSS class for shapes inside an element.
- */
- //com_ibm_rave_library_framework_internal_AbstractView.ELEMENT_SHAPE_CLASS = "element-shape";
- //com_ibm_rave_library_framework_internal_AbstractView.ELEMENT_LABEL_CLASS = "element-label";
- /**
- * CSS class for elements.
- */
- //com_ibm_rave_library_framework_internal_AbstractView.ELEMENT_CLASS = "element";
- /**
- * CSS class for elements that are lines
- */
- //com_ibm_rave_library_framework_internal_AbstractView.ELEMENT_LINE_CLASS = "element-line";
- /**
- * CSS class describing a 'dim' style (typically lowering the opacity?).
- */
- //com_ibm_rave_library_framework_internal_AbstractView.DIM_CLASS = "dim";
- /**
- * Symbol used by line-type legends. Before using in a legend, call registerLegendSymbols.
- */
- //com_ibm_rave_library_framework_internal_AbstractView.LEGENDLINESYMBOL = "compositeViewLegendLineSymbol";
- /**
- * Reset view of data (need to recalculate data and redraw components)
- */
- //com_ibm_rave_library_framework_internal_AbstractView.RESET_DATA = "data";
- /**
- * Reset view of layout (no data recalculation is required, but need to reset layout/scales and redraw components)
- */
- //com_ibm_rave_library_framework_internal_AbstractView.RESET_LAYOUT = "layout";
- /**
- * Reset zoom view
- */
- //com_ibm_rave_library_framework_internal_AbstractView.RESET_ZOOM = "zoom";
- /**
- * Common name for clip viewport.
- */
- //com_ibm_rave_library_framework_internal_AbstractView.CLIP_VIEWPORT_NAME = "clipViewport";
- com_ibm_rave_library_framework_internal_AbstractView.UPDATE_RESET_DATA = 0;
- com_ibm_rave_library_framework_internal_AbstractView.UPDATE_RESET_LAYOUT = 1;
- com_ibm_rave_library_framework_internal_AbstractView.UPDATE_ZOOM = 2;
- com_ibm_rave_library_framework_internal_AbstractView.UPDATE_REDRAW = 3;
- com_ibm_rave_library_framework_internal_AbstractView.UPDATE_NOTHING = 4;
- //com_ibm_rave_library_framework_internal_AbstractView.HIGHLIGHT_ACTION_NAME = "highlight";
- //com_ibm_rave_library_framework_internal_AbstractView.UNHIGHLIGHT_ACTION_NAME = "unhighlight";
- //com_ibm_rave_library_framework_internal_AbstractView.TRANSITION_NAME = "transition";
- /**
- * The array [0], for creating nodes with the enter-append paradigm.
- */
- com_ibm_rave_library_framework_internal_AbstractView.ONEDATA = [new Number(0)];
- // $source: com/ibm/rave/library/action/internal/SetAttributes
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- /**
- * Base class of the the setAttribute operation, The run function for this class assumes one selector, and may accept a map of attributes for said selector. Children of this class are: setAttributes HighlightOperation UnhighlightOperation
- */
- var com_ibm_rave_library_action_internal_SetAttributes = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //primaryStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * This is the run function for the operation it accepts multiple arguments but assumes the first argument to be a selector and the following argument(if provided), to be a map of styles(String attributeName: Object Value), and finally transition duration as the final argument (if provided.) to override the default transition duration.
- */
- function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- var selected = (args[0]);
- if ((selected.property("selected"))) {
- return;
- }
- var primaryStyles;
- primaryStyles = (args.length > 1 && args[1] != null && !((typeof args[1] === "number" || args[1] instanceof Number)) ? args[1] : _$self.primaryStyleDefault);
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 100;
- var t = (args[0]).transition("__rave_bundle_action_highlight__").duration(duration);
- var attr = primaryStyles;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(attr), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- t.style(key, attr[key]);
- }
- }
- };
- return _$self;
- },
- constructor : function() {
- this.primaryStyleDefault = {};
- }
- });
- // $source: com/ibm/rave/library/action/internal/HighlightOperation
- /************************************************************************
- ** 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/action/internal/SetAttributes (loadtime) // superclass
- var com_ibm_rave_library_action_internal_HighlightOperation = rave['internal']['Declare'](com_ibm_rave_library_action_internal_SetAttributes, {
- constructor : function() {
- this.primaryStyleDefault["stroke"] = function(data, index, groupIndex) {
- return rave.rgb(this.rave_getComputedStyle("fill")).darker(0.3);
- };
- this.primaryStyleDefault["stroke-width"] = "2px";
- }
- });
- // $source: com/ibm/rave/library/action/internal/UnhighlightOperation
- /************************************************************************
- ** 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/action/internal/SetAttributes (loadtime) // superclass
- var com_ibm_rave_library_action_internal_UnhighlightOperation = rave['internal']['Declare'](com_ibm_rave_library_action_internal_SetAttributes, {
- constructor : function(originalStyle) {
- if (originalStyle) {
- this.primaryStyleDefault = originalStyle;
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/ChordHighlightOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- //@import com/ibm/rave/library/action/FiltersUtil (runtime) // FiltersUtil
- /**
- * Chord Highlight is used to draw focus to all the chords that reach a specific chord segment. This operation is only active when there's no toggleselection operation in progress. Here we loop over all the chords and find ones that dont have either their target or source values equal to the current highlighted chord segment, then these chords are faded out
- */
- var com_ibm_rave_library_action_internal_ChordHighlightOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (args.length == 0) {
- return;
- }
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 100;
- var selected = (args[0]);
- var selectedItems = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(args[1], false);
- if (selectedItems.size() == 0) {
- (args[1]).filter(function(data, i, groupIndext) {
- var currentChord = (data).getChordData();
- var currentGroupSegmentData = selected.datum();
- if (((currentChord.source.datum).sourceID) == (currentGroupSegmentData.datum).label || ((currentChord.source.datum).targetID) == (currentGroupSegmentData.datum).label) {
- return false;
- }
- return true;
- }).transition().duration(duration).style("opacity", ".1");
- }
- }
- };
- return _$self;
- }
- //constructor : function() {}
- });
- // $source: com/ibm/rave/library/action/internal/ChordUnhighlightOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- //@import com/ibm/rave/library/action/FiltersUtil (runtime) // FiltersUtil
- /**
- * This operation is only active when there's no toggleselection in process. All chords will be returned to their original opacity
- */
- var com_ibm_rave_library_action_internal_ChordUnhighlightOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //_chordOriginalStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 100;
- var selectedItems = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(args[1], false);
- if (selectedItems.size() == 0) {
- (args[1]).property("stroke", null).transition().duration(duration).style("opacity", _$self._chordOriginalStyleDefault["opacity"]);
- }
- }
- };
- return _$self;
- },
- constructor : function(chordOriginalStyle, groupsOriginalStyle) {
- this._chordOriginalStyleDefault = {};
- {
- if (chordOriginalStyle) {
- this._chordOriginalStyleDefault = chordOriginalStyle;
- } else {
- this._chordOriginalStyleDefault["opacity"] = 0.8;
- }
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/ChordToggleSelectionOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- //@import com/ibm/rave/library/action/FiltersUtil (runtime) // FiltersUtil
- /**
- * Handles selection and unselection of chords in chord chat. When you select a chord its two ends which are segments are tagged and remain visible and emphasized with a stroke and a reference counter on its two related segments is incremented. All other chords and chord segments are faded out. If a chord is unselected it is faded out and the reference counter on its two segments is reduced if that reference counter reaches zero that means no other selected chords are reaching that segment therefore it will fade out. Finally if all chords are unselected. all chords return back to their original colors and all segments as well
- */
- var com_ibm_rave_library_action_internal_ChordToggleSelectionOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //primaryStyleDefault : null,
- //secondaryStyleDefault : null,
- //_chordsOriginalStyleDefault : null,
- //_groupsOriginalStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- var primaryStyles;
- var secondaryStyles;
- primaryStyles = (args.length > 2 && args[2] != null && !((typeof args[2] === "number" || args[2] instanceof Number)) ? args[2] : _$self.primaryStyleDefault);
- secondaryStyles = (args.length > 3 && args[3] != null && !((typeof args[3] === "number" || args[3] instanceof Number)) ? args[3] : _$self.secondaryStyleDefault);
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 50;
- var allShapes = (args[1]);
- var chordsSelection = allShapes.filter(".chord");
- var selectedChord = (args[0]);
- var chordData = (selectedChord.datum()).getChordData();
- var sourceStruct = chordData.source.datum;
- var targetStruct = chordData.target.datum;
- var allGroupsSelection = allShapes.filter(".groupPath");
- var filteredGroupsAttachedToSelectedChord = allGroupsSelection.filter(function(data, i, groupIndex) {
- var groupData = data;
- var groupLabel = ((groupData.datum).label);
- return (groupLabel == sourceStruct.sourceID || groupLabel == targetStruct.sourceID);
- });
- if ((selectedChord.property("selected"))) {
- selectedChord.property("selected", null);
- var selectedItems = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(chordsSelection, false);
- if (selectedItems.size() == 0) {
- var tAll = chordsSelection.transition(".transitionAllChords").duration(duration);
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(_$self._chordsOriginalStyleDefault), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- tAll.style(key, _$self._chordsOriginalStyleDefault[key]);
- }
- } else {
- var deselectSelectedChordTransition = selectedChord.transition(".deselectSelectedChordTransition").duration(duration);
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(secondaryStyles), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- deselectSelectedChordTransition.style(key, secondaryStyles[key]);
- }
- }
- filteredGroupsAttachedToSelectedChord.each(function(data, index, groupIndex) {
- var element = rave.select(this);
- var chordReferenceCounter;
- if (element.property("chordReferenceCounter") == null) {
- chordReferenceCounter = 0;
- } else {
- chordReferenceCounter = (element.property("chordReferenceCounter"));
- }
- if (chordReferenceCounter > 0) {
- element.property("chordReferenceCounter", (chordReferenceCounter - 1));
- }
- });
- } else {
- selectedChord.property("selected", true);
- var unselectedChords = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(chordsSelection, true);
- var applyDeselectionToUnselectedChordsTransition = unselectedChords.transition("deselect").duration(duration);
- var attr = secondaryStyles;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(attr), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- applyDeselectionToUnselectedChordsTransition.style(key, attr[key]);
- }
- var selectChordTransition = selectedChord.transition("selectChord").duration(duration);
- attr = primaryStyles;
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(attr), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- selectChordTransition.style(key, attr[key]);
- }
- filteredGroupsAttachedToSelectedChord.each(function(data, index, groupIndex) {
- var group = rave.select(this);
- var chordReferenceCounter;
- if (group.property("chordReferenceCounter") == null) {
- chordReferenceCounter = 0;
- } else {
- chordReferenceCounter = (group.property("chordReferenceCounter"));
- }
- group.property("chordReferenceCounter", (chordReferenceCounter + 1));
- });
- }
- var selectedChords = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(chordsSelection, false);
- if (selectedChords.size() == 0) {
- var originalT = allGroupsSelection.transition(".originalT").duration(duration);
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(_$self._groupsOriginalStyleDefault), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- originalT.style(key, _$self._groupsOriginalStyleDefault[key]);
- }
- } else {
- var self = _$self;
- allGroupsSelection.each(function(data, index, indexGroup) {
- var group = rave.select(this);
- var chordReferenceCounter;
- if (group.property("chordReferenceCounter") == null) {
- chordReferenceCounter = 0;
- } else {
- chordReferenceCounter = (group.property("chordReferenceCounter"));
- }
- var tAll = rave.select(this).transition(".tAll").duration(duration);
- if (chordReferenceCounter == 0) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(self.secondaryStyleDefault), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- tAll.style(key, self.secondaryStyleDefault[key]);
- }
- } else {
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(self._groupsOriginalStyleDefault), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- tAll.style(key, self._groupsOriginalStyleDefault[key]);
- }
- }
- });
- }
- }
- };
- return _$self;
- },
- constructor : function(chordsOriginalStyle, groupsOriginalStyle) {
- this.primaryStyleDefault = {};
- this.secondaryStyleDefault = {};
- this._chordsOriginalStyleDefault = {};
- this._groupsOriginalStyleDefault = {};
- {
- this.primaryStyleDefault["stroke"] = function(data, index, groupIndex) {
- var color = this.rave_getProperty("_rave_initialColor");
- if (color == null) {
- if ("path" == this.rave_getName()) {
- color = this.rave_getStyle("stroke");
- if (((typeof color === "string" || color instanceof String)) && ((""+(color)).length == 0)) {
- color = this.rave_getStyle("fill");
- }
- } else {
- color = this.rave_getStyle("fill");
- }
- if (color != null) {
- this.rave_setProperty("_rave_initialColor", color.toString());
- }
- }
- return rave.rgb(color).darker(0.3);
- };
- this.primaryStyleDefault["stroke-width"] = "1pt";
- this.primaryStyleDefault["opacity"] = 0.8;
- this.secondaryStyleDefault["opacity"] = 0.3;
- this.secondaryStyleDefault["stroke"] = null;
- if (chordsOriginalStyle) {
- this._chordsOriginalStyleDefault = chordsOriginalStyle;
- }
- if (groupsOriginalStyle) {
- this._groupsOriginalStyleDefault = groupsOriginalStyle;
- }
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/ChordDeselectAllOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- var com_ibm_rave_library_action_internal_ChordDeselectAllOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //chordsOriginalStyleDefault : null,
- //groupsOriginalStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * Overrides the action run function, to restore all values to the default the bundle author specified for the chord bundle, takes a single parameter (Selector).
- * @param (java.lang.Object[]) args all the elements to be deselected.
- */
- function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (!args) {
- return;
- }
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 100;
- var allShapes = (args[0]);
- var chordsSelection = allShapes.filter(".chord");
- chordsSelection.property("selected", null).property("_rave_initialColor", null);
- var t = chordsSelection.transition("deselectAllChords").duration(duration);
- var attr = _$self.chordsOriginalStyleDefault;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(attr), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- t.style(key, attr[key]);
- }
- var groupsSelection = allShapes.filter(".groupPath");
- groupsSelection.property("chordReferenceCounter", null);
- var t2 = groupsSelection.transition("deselectAllGroups").duration(duration);
- attr = _$self.groupsOriginalStyleDefault;
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(attr), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- t2.style(key, attr[key]);
- }
- }
- };
- return _$self;
- },
- constructor : function(chordsOriginalStyle, groupsOriginalStyle) {
- this.chordsOriginalStyleDefault = {};
- this.groupsOriginalStyleDefault = {};
- {
- if (chordsOriginalStyle) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(chordsOriginalStyle), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- this.chordsOriginalStyleDefault[key] = chordsOriginalStyle[key];
- }
- } else {
- this.chordsOriginalStyleDefault["opacity"] = 0.8;
- this.chordsOriginalStyleDefault["stroke"] = null;
- }
- if (groupsOriginalStyle) {
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(groupsOriginalStyle), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- this.groupsOriginalStyleDefault[key] = groupsOriginalStyle[key];
- }
- } else {
- this.groupsOriginalStyleDefault["opacity"] = 1.0;
- this.groupsOriginalStyleDefault["stroke"] = null;
- }
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/SelectOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- //@import com/ibm/rave/library/action/FiltersUtil (runtime) // FiltersUtil
- var com_ibm_rave_library_action_internal_SelectOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //primaryStyleDefault : null,
- //secondaryStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * Overrides the action call function
- * @param (java.lang.Object[]) args
- */
- function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- var primaryStyles;
- var secondaryStyles;
- primaryStyles = (args.length > 2 && args[2] != null && !((typeof args[2] === "number" || args[2] instanceof Number)) ? args[2] : _$self.primaryStyleDefault);
- secondaryStyles = (args.length > 3 && args[3] != null && !((typeof args[3] === "number" || args[3] instanceof Number)) ? args[3] : _$self.secondaryStyleDefault);
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 100;
- (args[0]).property("selected", true);
- var context = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(args[1], true);
- var t = (args[0]).transition("__rave_bundle_action_selection__").duration(duration);
- var attr = primaryStyles;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(attr), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- t.style(key, attr[key]);
- }
- var t2 = context.transition("__rave_bundle_action_selection__").duration(duration);
- attr = secondaryStyles;
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(attr), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- t2.style(key, attr[key]);
- }
- }
- };
- return _$self;
- },
- constructor : function() {
- this.primaryStyleDefault = {};
- this.secondaryStyleDefault = {};
- {
- this.primaryStyleDefault["stroke"] = function(data, index, groupIndex) {
- return rave.rgb(rave.select(this).style("fill")).darker(0.3);
- };
- this.primaryStyleDefault["stroke-width"] = "2px";
- this.primaryStyleDefault["opacity"] = 1.0;
- this.secondaryStyleDefault["opacity"] = 0.3;
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/DeselectOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- //@import com/ibm/rave/library/action/FiltersUtil (runtime) // FiltersUtil
- var com_ibm_rave_library_action_internal_DeselectOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //primaryStyleDefault : null,
- //originalStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * Overrides the action call function.
- * @param (java.lang.Object[]) args
- */
- function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- var primaryStyles;
- var originalStyles;
- primaryStyles = (args.length > 2 && args[2] != null && !((typeof args[2] === "number" || args[2] instanceof Number)) ? args[2] : _$self.primaryStyleDefault);
- originalStyles = _$self.originalStyleDefault;
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 100;
- (args[0]).property("selected", null);
- var selectedItems = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(args[1], false);
- if (selectedItems.size() == 0) {
- var context = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(args[1], true);
- context.transition("__rave_bundle_action_selection__").duration(duration).style(originalStyles);
- } else {
- (args[0]).transition("__rave_bundle_action_selection__").duration(duration).style(primaryStyles);
- }
- }
- };
- return _$self;
- },
- constructor : function() {
- this.primaryStyleDefault = {};
- this.originalStyleDefault = {};
- {
- this.primaryStyleDefault["opacity"] = 0.3;
- this.originalStyleDefault["opacity"] = 1.0;
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/DeselectAllOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- var com_ibm_rave_library_action_internal_DeselectAllOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //originalStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * Overrides the action run function, to restore all values to the default the bundle author specified for the bundle, takes a single parameter (Selector).
- * @param (java.lang.Object[]) args all the elements to be deselected.
- */
- function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (!args) {
- return;
- }
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 100;
- (args[0]).property("selected", null).property("_rave_initialColor", null);
- var t = (args[0]).transition("__rave_bundle_action_selection__").duration(duration);
- var attr = _$self.originalStyleDefault;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(attr), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- t.style(key, attr[key]);
- }
- }
- };
- return _$self;
- },
- constructor : function(originalStyle) {
- this.originalStyleDefault = {};
- {
- if (originalStyle) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(originalStyle), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- this.originalStyleDefault[key] = originalStyle[key];
- }
- }
- this.originalStyleDefault["opacity"] = 1.0;
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/ToggleSelectionOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- //@import com/ibm/rave/library/action/FiltersUtil (runtime) // FiltersUtil
- var com_ibm_rave_library_action_internal_ToggleSelectionOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //primaryStyleDefault : null,
- //secondaryStyleDefault : null,
- //originalStyleDefault : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * Overrides the action run function. This is the default selection action for bundles. This adds a toggle selection to the bundle. When an item is clicked, it's marked as selected and emphasized, when it is clicked again the selected flag is turned off and the item is deemphasized. The default style fade the unselected elements.
- * @param (java.lang.Object[]) args
- */
- function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- var primaryStyles;
- var secondaryStyles;
- primaryStyles = (args.length > 2 && args[2] != null && !((typeof args[2] === "number" || args[2] instanceof Number)) ? args[2] : _$self.primaryStyleDefault);
- secondaryStyles = (args.length > 3 && args[3] != null && !((typeof args[3] === "number" || args[3] instanceof Number)) ? args[3] : _$self.secondaryStyleDefault);
- var duration = args[args.length - 1] != null && (typeof args[args.length - 1] === "number" || args[args.length - 1] instanceof Number) ? + (args[args.length - 1]) : 50;
- var selected = (args[0]);
- if ((selected.property("selected"))) {
- selected.property("selected", null);
- var selectedItems = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(args[1], false);
- if (selectedItems.size() == 0) {
- var tAll = (args[1]).transition("__rave_bundle_action_selection__").duration(duration);
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(_$self.originalStyleDefault), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- tAll.style(key, _$self.originalStyleDefault[key]);
- }
- } else {
- var t = selected.transition("__rave_bundle_action_selection__").duration(duration);
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(secondaryStyles), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var key = __exp_enFor1[__i_enFor1];
- t.style(key, secondaryStyles[key]);
- }
- }
- } else {
- selected.property("selected", true);
- var context = com_ibm_rave_library_action_FiltersUtil.INSTANCE.selectionFilter(args[1], true);
- var t = context.transition("__rave_bundle_action_selection__").duration(duration);
- var attr = secondaryStyles;
- for (var __i_enFor2 = 0, __exp_enFor2 = Object.keys(attr), __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var key = __exp_enFor2[__i_enFor2];
- t.style(key, attr[key]);
- }
- var t2 = selected.transition("__rave_bundle_action_selection__").duration(duration);
- attr = primaryStyles;
- for (var __i_enFor3 = 0, __exp_enFor3 = Object.keys(attr), __len_enFor3 = __exp_enFor3.length;
- __i_enFor3 < __len_enFor3; ++__i_enFor3) {
- var key = __exp_enFor3[__i_enFor3];
- t2.style(key, attr[key]);
- }
- }
- }
- };
- return _$self;
- },
- constructor : function(originalStyle) {
- this.primaryStyleDefault = {};
- this.secondaryStyleDefault = {};
- this.originalStyleDefault = {};
- {
- this.primaryStyleDefault["stroke"] = function(data, index, groupIndex) {
- var color = this.rave_getProperty("_rave_initialColor");
- if (color == null) {
- if ("path" == this.rave_getName() || "polygon" == this.rave_getName()) {
- color = this.rave_getStyle("fill");
- if (((typeof color === "string" || color instanceof String)) && ((""+(color)).length == 0)) {
- color = this.rave_getStyle("stroke");
- if (((typeof color === "string" || color instanceof String)) && ((""+(color)).length == 0)) {
- color = rave.rgb(this.rave_getComputedStyle("fill")).darker(0.3);
- }
- }
- } else {
- color = this.rave_getStyle("fill");
- }
- if (color != null) {
- this.rave_setProperty("_rave_initialColor", color.toString());
- }
- }
- return rave.rgb(color).darker(0.3);
- };
- this.primaryStyleDefault["stroke-width"] = "2px";
- this.primaryStyleDefault["opacity"] = 1.0;
- this.secondaryStyleDefault["opacity"] = 0.3;
- if (originalStyle) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(originalStyle), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- this.originalStyleDefault[key] = originalStyle[key];
- }
- }
- this.originalStyleDefault["opacity"] = 1.0;
- }
- }
- });
- // $source: com/ibm/rave/library/action/internal/PanZoomOperation
- /************************************************************************
- ** 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/action/ActionOperation (loadtime) // superclass
- var com_ibm_rave_library_action_internal_PanZoomOperation = rave['internal']['Declare'](com_ibm_rave_library_action_ActionOperation, {
- //_zoom : null,
- //_contextSelectionFn : null,
- _$functionClassMethod : function() {
- var _$self = /**
- * Execute the Zoom Operation to apply any changes to the translate/scale parameters of the underlying Zoom instance. To retrieve the Zoom instance, call <pre> get("zoom"). </pre>
- */
- function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- if (!_$self._zoom) {
- return;
- }
- var scaleFactor = 1;
- var translate_x = 0;
- var translate_y = 0;
- if (args.length > 0) {
- var scaleBy = (args[0]);
- scaleFactor = scaleBy != null ? scaleBy : 1;
- }
- if (args.length > 1) {
- translate_x = + (args[1]);
- }
- if (args.length > 2) {
- translate_y = + (args[2]);
- }
- var t = _$self._zoom.translate();
- _$self._zoom.translate([t[0] - translate_x, t[1] - translate_y]);
- var center0 = _$self._zoom.center() ? _$self._zoom.center() : [_$self._zoom.size()[0] / 2, _$self._zoom.size()[1] / 2];
- var translate0 = _$self._zoom.translate();
- var coordinates0 = _$self.coordinates(center0);
- var extent = _$self._zoom.scaleExtent();
- var scaleTo = Math.max(extent[0], Math.min(extent[1], _$self._zoom.scale() * scaleFactor));
- _$self._zoom.scale(scaleTo);
- var center1 = _$self.point(coordinates0);
- _$self._zoom.translate([translate0[0] + center0[0] - center1[0], translate0[1] + center0[1] - center1[1]]);
- var zoomContext = _$self._contextSelectionFn();
- _$self._zoom.event.call(null, zoomContext);
- }
- };
- return _$self;
- },
- constructor : function(z, selectionContext) {
- this._zoom = z;
- this._contextSelectionFn = selectionContext;
- },
- /** @expose */
- get : function(id) {
- if (id == "zoom") {
- return this._zoom;
- }
- return null;
- },
- coordinates : function(point) {
- var scale = this._zoom.scale();
- var translate = this._zoom.translate();
- return [(point[0] - translate[0]) / scale, (point[1] - translate[1]) / scale];
- },
- point : function(coordinates) {
- var scale = this._zoom.scale();
- var translate = this._zoom.translate();
- return [coordinates[0] * scale + translate[0], coordinates[1] * scale + translate[1]];
- }
- });
- // $source: com/ibm/rave/library/action/internal/OperationsUtil
- /************************************************************************
- ** 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/action/internal/HighlightOperation (static) // new
- //@import com/ibm/rave/library/action/internal/UnhighlightOperation (static) // new
- //@import com/ibm/rave/library/action/internal/ChordHighlightOperation (static) // new
- //@import com/ibm/rave/library/action/internal/ChordUnhighlightOperation (static) // new
- //@import com/ibm/rave/library/action/internal/ChordToggleSelectionOperation (static) // new
- //@import com/ibm/rave/library/action/internal/ChordDeselectAllOperation (static) // new
- //@import com/ibm/rave/library/action/internal/SelectOperation (static) // new
- //@import com/ibm/rave/library/action/internal/DeselectOperation (static) // new
- //@import com/ibm/rave/library/action/internal/DeselectAllOperation (static) // new
- //@import com/ibm/rave/library/action/internal/ToggleSelectionOperation (static) // new
- //@import com/ibm/rave/library/action/internal/PanZoomOperation (static) // new
- var com_ibm_rave_library_action_internal_OperationsUtil = rave['internal']['Declare']({
- });
- /**
- * Getter for the highlight operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the highlight operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.highlight = function() {
- return new com_ibm_rave_library_action_internal_HighlightOperation();
- };
- /**
- * Getter for the unhighlight operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the unhighlight operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.unhighlight = function(originalStyle) {
- return new com_ibm_rave_library_action_internal_UnhighlightOperation(originalStyle);
- };
- /**
- * Getter for the chord highlight operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the chord highlight operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.chordHighlight = function() {
- return new com_ibm_rave_library_action_internal_ChordHighlightOperation();
- };
- /**
- * Getter for the chord unhighlight operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the unhighlight operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.chordUnhighlight = function(chordsOriginalStyle, groupsOriginalStyle) {
- return new com_ibm_rave_library_action_internal_ChordUnhighlightOperation(chordsOriginalStyle, groupsOriginalStyle);
- };
- /**
- * Getter for the chordToggle operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the chordToggle operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.chordToggle = function(chordsOriginalStyle, groupsOriginalStyle) {
- return new com_ibm_rave_library_action_internal_ChordToggleSelectionOperation(chordsOriginalStyle, groupsOriginalStyle);
- };
- /**
- * Getter for the chord deselectAll operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the chord deselectAll operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.chordDeselectAll = function(chordsOriginalStyle, groupsOriginalStyle) {
- return new com_ibm_rave_library_action_internal_ChordDeselectAllOperation(chordsOriginalStyle, groupsOriginalStyle);
- };
- /**
- * Getter for the select operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the select operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.select = function() {
- return new com_ibm_rave_library_action_internal_SelectOperation();
- };
- /**
- * Getter for the deselect operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the deselect operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.deselect = function() {
- return new com_ibm_rave_library_action_internal_DeselectOperation();
- };
- /**
- * Getter for the deselectAll operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the deselectAll operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.deselectAll = function(originalStyle) {
- return new com_ibm_rave_library_action_internal_DeselectAllOperation(originalStyle);
- };
- /**
- * Getter for the toggleSelection operation
- * @return (com.ibm.rave.library.action.ActionOperation) new instance of the toggleSelection operation
- */
- com_ibm_rave_library_action_internal_OperationsUtil.toggleSelection = function(originalStyle) {
- return new com_ibm_rave_library_action_internal_ToggleSelectionOperation(originalStyle);
- };
- /**
- * Create a new operation instance for the pan zoom action.
- * @param (rave['internal']['Zoom']) zoom A Core Zoom behaviour.
- * @param (com.ibm.rave.library.action.internal.PanZoomOperation.ZoomContextFunction) contextSelection A function which returns the selection of elements which "zoom" events have been registered on.
- */
- com_ibm_rave_library_action_internal_OperationsUtil.panZoom = function(zoom, contextSelection) {
- return new com_ibm_rave_library_action_internal_PanZoomOperation(zoom, contextSelection);
- };
- // $source: com/ibm/rave/library/property/PropertyProcessor
- /************************************************************************
- ** 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/property/PropertyProcessingInfo (static) // new
- //@import com/ibm/rave/library/property/PropertyUtil (static) // PropertyUtil
- //@import com/ibm/rave/library/property/PropertyUnknownType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyObjectType (runtime) // new
- //@import com/ibm/rave/library/Library (static) // logError
- //@import com/ibm/rave/library/property/PropertyArrayType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyBooleanType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyColorType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyEnumType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyFontType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyNumericType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyPaletteType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyLengthType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyPaddingType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyDashArrayType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyStringType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyJSONObjectType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyGeoJsonType (runtime) // new
- //@import com/ibm/rave/library/property/PropertyShadowType (runtime) // new
- //@import com/ibm/rave/library/i18n/MessagesRegistry (runtime) // EmptyRegistry
- /**
- * A helper class that is responsible for parsing JSON propeties and creating a meta property object for them. Also, it is responsible for validating these JSON files.
- */
- var com_ibm_rave_library_property_PropertyProcessor = rave['internal']['Declare']({
- //constructor : function() {}
- });
- /**
- * Goes through a properties JSOn file and creates meta properties out of it. If error parameter was not not null, then the validation will be conducted while parsing the JSON object and the process will abort with failure the minutes it discovers an invalid property, if the error parameter was null, then the loader will continue creating meta properties without validation. If loading with no validation, then depending on the nature of the problem with a given property, it might be either skipped altogether or a meta property of type PropertyUnknownType will be created for it
- * @param (Object) props the JSOn file holding the properties to load
- * @param (boolean) validate whether or not validation should be on.
- * @return (com.ibm.rave.library.property.PropertyProcessingInfo) the processing result
- * @see (com.ibm.rave.library.property.PropertyProcessingInfo) PropertyProcessingInfo
- */
- /** @expose */
- com_ibm_rave_library_property_PropertyProcessor.processProperties = function(props, messages, validate) {
- var info = new com_ibm_rave_library_property_PropertyProcessingInfo(validate);
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(props), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validatePropertySimpleId(""+(propertyId)))) {
- info.processError();
- }
- var propertyJSON = com_ibm_rave_library_property_PropertyUtil.INSTANCE.propertyEntry(props, ""+(propertyId));
- if (!propertyJSON) {
- var property = new com_ibm_rave_library_property_PropertyUnknownType(""+(propertyId), ""+(propertyId), null, messages);
- info.properties.push(property);
- info.processError();
- if (info.validate) {
- break;
- }
- } else {
- var property = com_ibm_rave_library_property_PropertyProcessor.processProperty$3(propertyJSON, ""+(propertyId), ""+(propertyId), null, info, messages);
- info.properties.push(property);
- if (info.validate && info.hasInvalidProperties) {
- break;
- }
- }
- }
- return info;
- };
- /**
- * Process a JSON object for a single property and creates a meta property object for it. It is done with no validation and the property will have no parent
- * @param (Object) propertyJSON the JSON object representing the property to process
- * @param (String) propertyId the simple id of the property
- * @return (com.ibm.rave.library.framework.meta.PropertyMeta) the newly created meta property, which could be of type PropertyUnknownType if the JSON object is doesn't have enough to figure out which kind of property to create
- */
- com_ibm_rave_library_property_PropertyProcessor.processProperty$0 = function(propertyJSON, propertyId, messages) {
- return com_ibm_rave_library_property_PropertyProcessor.processProperty$2(propertyJSON, propertyId, null, messages, false);
- };
- /**
- * Process a JSON object for a single property and creates a meta property object for it. It is done with no validation
- * @param (Object) propertyJSON the JSOn object representing the property to process
- * @param (String) propertyId the simple id of the property
- * @param (com.ibm.rave.library.framework.meta.PropertyMeta) parent the parent property if any, could be null
- * @return (com.ibm.rave.library.framework.meta.PropertyMeta) the newly created meta property, which could be of type PropertyUnknownType if the JSON object is doesn't have enough to figure out which kind of property to create
- */
- com_ibm_rave_library_property_PropertyProcessor.processProperty$1 = function(propertyJSON, propertyId, parent, messages) {
- return com_ibm_rave_library_property_PropertyProcessor.processProperty$2(propertyJSON, propertyId, parent, messages, false);
- };
- /**
- * Process a JSON object for a single property and creates a meta property object for it.
- * @param (Object) propertyJSON the JSOn object representing the property to process
- * @param (String) propertyId the simple id of the property
- * @param (com.ibm.rave.library.framework.meta.PropertyMeta) parent the parent property if any, could be null
- * @param (boolean) validate whether or not validation is on.
- * @return (com.ibm.rave.library.framework.meta.PropertyMeta) the newly created meta property, which could be of type PropertyUnknownType if the JSON object is doesn't have enough to figure out which kind of property to create
- */
- com_ibm_rave_library_property_PropertyProcessor.processProperty$2 = function(propertyJSON, propertyId, parent, messages, validate) {
- var info = new com_ibm_rave_library_property_PropertyProcessingInfo(validate);
- var qualifiedId = (parent) ? parent.id() + "." + propertyId : propertyId;
- return com_ibm_rave_library_property_PropertyProcessor.processProperty$3(propertyJSON, propertyId, qualifiedId, parent, info, messages);
- };
- com_ibm_rave_library_property_PropertyProcessor.processProperty$3 = function(propertyJSON, propertyId, qualifiedId, parent, info, messages) {
- var type = com_ibm_rave_library_property_PropertyUtil.INSTANCE.type(propertyJSON);
- if (type == null) {
- var property = new com_ibm_rave_library_property_PropertyUnknownType(propertyId, qualifiedId, parent, messages);
- info.processError();
- return property;
- } else if ("object" == type) {
- var property = new com_ibm_rave_library_property_PropertyObjectType(propertyId, qualifiedId, parent, messages);
- var objectPropertiesEntry = com_ibm_rave_library_property_PropertyUtil.INSTANCE.propertyEntry(propertyJSON, "properties");
- if (!objectPropertiesEntry) {
- info.processError();
- return property;
- }
- if (Object.keys(objectPropertiesEntry).length == 0) {
- if (info.validate) {
- com_ibm_rave_library_Library.logError(28, "Property entry '" + propertyId + " @PropertyProcessor.processProperty");
- }
- info.processError();
- return property;
- }
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(objectPropertiesEntry), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var childPropertyId = __exp_enFor0[__i_enFor0];
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validatePropertySimpleId(""+(childPropertyId)))) {
- info.processError();
- return property;
- }
- var childQualifiedId = qualifiedId + "." + ""+(childPropertyId);
- var childPropertyEntry = com_ibm_rave_library_property_PropertyUtil.INSTANCE.propertyEntry(objectPropertiesEntry, ""+(childPropertyId));
- if (!childPropertyEntry) {
- var unknownChildProperty = new com_ibm_rave_library_property_PropertyUnknownType(""+(childPropertyId), childQualifiedId, property, messages);
- property._childProperties[""+(childPropertyId)] = unknownChildProperty;
- info.processError();
- if (info.validate) {
- return property;
- }
- } else {
- var childProperty = com_ibm_rave_library_property_PropertyProcessor.processProperty$3(childPropertyEntry, ""+(childPropertyId), childQualifiedId, property, info, messages);
- property._childProperties[""+(childPropertyId)] = childProperty;
- if (info.validate && info.hasInvalidProperties) {
- return property;
- }
- }
- }
- property.initType(propertyJSON, info);
- return property;
- } else if ("array" == type) {
- var property = new com_ibm_rave_library_property_PropertyArrayType(propertyId, qualifiedId, parent, messages);
- var itemsQualifiedId = qualifiedId + ".items";
- var itemsObj = com_ibm_rave_library_property_PropertyUtil.INSTANCE.propertyEntry(propertyJSON, "items");
- if (!itemsObj) {
- var unknownItemsProperty = new com_ibm_rave_library_property_PropertyUnknownType("items", itemsQualifiedId, property, messages);
- property._items = unknownItemsProperty;
- info.processError();
- return property;
- }
- var itemsProperty = com_ibm_rave_library_property_PropertyProcessor.processProperty$3(itemsObj, "items", itemsQualifiedId, property, info, messages);
- property._items = itemsProperty;
- if (info.validate && info.hasInvalidProperties) {
- return property;
- }
- property.initType(propertyJSON, info);
- return property;
- } else if ("boolean" == type) {
- var property = new com_ibm_rave_library_property_PropertyBooleanType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("color" == type) {
- var property = new com_ibm_rave_library_property_PropertyColorType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("enum" == type) {
- var property = new com_ibm_rave_library_property_PropertyEnumType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("font" == type) {
- var property = new com_ibm_rave_library_property_PropertyFontType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("numeric" == type) {
- var property = new com_ibm_rave_library_property_PropertyNumericType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("palette" == type) {
- var property = new com_ibm_rave_library_property_PropertyPaletteType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("length" == type) {
- var property = new com_ibm_rave_library_property_PropertyLengthType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("padding" == type) {
- var property = new com_ibm_rave_library_property_PropertyPaddingType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("dasharray" == type) {
- var property = new com_ibm_rave_library_property_PropertyDashArrayType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("string" == type) {
- var property = new com_ibm_rave_library_property_PropertyStringType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("jsonobject" == type) {
- var property = new com_ibm_rave_library_property_PropertyJSONObjectType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("geojson" == type) {
- var property = new com_ibm_rave_library_property_PropertyGeoJsonType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- } else if ("shadow" == type) {
- var property = new com_ibm_rave_library_property_PropertyShadowType(propertyId, qualifiedId, parent, messages);
- property.initType(propertyJSON, info);
- return property;
- }
- var property = new com_ibm_rave_library_property_PropertyUnknownType(propertyId, qualifiedId, parent, messages);
- if (info.validate) {
- com_ibm_rave_library_Library.logError(29, "Property entry '" + propertyId + "' with unknown type: " + type + " @PropertyProcessor.processProperty");
- }
- info.processError();
- return property;
- };
- /**
- * Validates the properties JSON object. If an error occurs, the validation will stop immediately and the cause of the error will be stored in the error object.
- * @param (Object) props A JSONArray of properties as JSONObjects
- * @param (boolean) validate TODO Whether or not validation is on.
- */
- com_ibm_rave_library_property_PropertyProcessor.validate$0 = function(props, validate) {
- var info = com_ibm_rave_library_property_PropertyProcessor.processProperties(props, com_ibm_rave_library_i18n_MessagesRegistry.EmptyRegistry(), validate);
- return !info.hasInvalidProperties;
- };
- /**
- * Validates a group of properties JSON files. Each file is validated on its own and if they all pass, the validation process will proceed to check for id collision amongst the properties and will fail validation in case two properties in two different JSON file had the same qualified id but of different type.
- * @param (Array) propsArray
- * @param (boolean) validate TODO
- * @return (boolean) true if validation succeeds
- */
- com_ibm_rave_library_property_PropertyProcessor.validate$1 = function(propsArray, validate) {
- var infos = [];
- for (var i = 0; i < propsArray.length; ++i) {
- var props = propsArray[i];
- var info = com_ibm_rave_library_property_PropertyProcessor.processProperties(props, com_ibm_rave_library_i18n_MessagesRegistry.EmptyRegistry(), validate);
- if (info.hasInvalidProperties) {
- return false;
- }
- infos.push(info);
- }
- if (infos.length > 1) {
- var flattennedPropTypeMap = {};
- var info = infos[0];
- com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$0(info, flattennedPropTypeMap);
- for (var i = 1; i < infos.length; ++i) {
- var map = {};
- info = infos[i];
- com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$0(info, map);
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(map), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var id = __exp_enFor0[__i_enFor0];
- var newProp = map[id];
- var existingProp = flattennedPropTypeMap[id];
- if (!existingProp || newProp.typeId() == existingProp.typeId()) {
- flattennedPropTypeMap[id] = newProp;
- } else {
- com_ibm_rave_library_Library.logError(30, "Property entry '" + id + " @PropertyProcessor.validate");
- return false;
- }
- }
- }
- }
- return true;
- };
- com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$0 = function(info, flattennedPropTypeMap) {
- for (var __i_enFor0 = 0, __exp_enFor0 = info.properties, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyMeta = __exp_enFor0[__i_enFor0];
- com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$1(propertyMeta, flattennedPropTypeMap);
- }
- };
- com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$1 = function(propertyType, flattennedPropTypeMap) {
- flattennedPropTypeMap[propertyType.id()] = propertyType;
- if (propertyType.typeId() == 21) {
- var objPropType = propertyType;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(objPropType._childProperties), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- var childProperty = objPropType._childProperties[key];
- com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$1(childProperty, flattennedPropTypeMap);
- }
- }
- };
- /** @expose */
- com_ibm_rave_library_property_PropertyProcessor.processProperty = function(a0, a1, a2, a3, a4, a5) {
- var args = arguments;
- if (args.length == 3) {
- return com_ibm_rave_library_property_PropertyProcessor.processProperty$0(a0, a1, a2);
- }
- if (args.length == 4) {
- return com_ibm_rave_library_property_PropertyProcessor.processProperty$1(a0, a1, a2, a3);
- }
- if (args.length == 5) {
- return com_ibm_rave_library_property_PropertyProcessor.processProperty$2(a0, a1, a2, a3, a4);
- }
- return com_ibm_rave_library_property_PropertyProcessor.processProperty$3(a0, a1, a2, a3, a4, a5);
- };
- /** @expose */
- com_ibm_rave_library_property_PropertyProcessor.validate = function(a0, a1) {
- var args = arguments;
- if (args.length == 2 && (a0 == null || Object.prototype.toString.call(a0) === "[object Array]")) {
- return com_ibm_rave_library_property_PropertyProcessor.validate$1(a0, a1);
- }
- return com_ibm_rave_library_property_PropertyProcessor.validate$0(a0, a1);
- };
- com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType = function(a0, a1) {
- var args = arguments;
- if (args.length == 2 && (a0 == null || rave['internal']['Object'].isInstanceOf(a0, com_ibm_rave_library_property_PropertyProcessingInfo))) {
- return com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$0(a0, a1);
- }
- return com_ibm_rave_library_property_PropertyProcessor.flattenPropertyType$1(a0, a1);
- };
- // $source: com/ibm/rave/library/property/PropertyType
- /************************************************************************
- ** 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/framework/meta/PropertyMeta (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * <p> The parent class for all of the propertyTypes
- * @param < (java.lang.Object) E > Type of options allowed in this type.
- */
- var com_ibm_rave_library_property_PropertyType = rave_library_externs["PropertyType"] = rave['internal']['Declare'](com_ibm_rave_library_framework_meta_PropertyMeta, {
- //_name : null,
- //_description : null,
- //_icon : null,
- //_defaultValue : null,
- //_tags : null,
- //_parent : null,
- //_qualifiedId : null,
- //_simpleId : null,
- /** @expose */
- _options : null,
- /** @expose */
- _messages : null,
- _required : false,
- _resetView : "redraw",
- constructor : function(propertyId, qualifiedId, parent, messages) {
- this._options = [];
- {
- this._messages = messages;
- this._simpleId = propertyId;
- this._qualifiedId = qualifiedId;
- this._parent = parent;
- this._tags = [];
- }
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- var obj = propertyJSON["name"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10))) {
- info.processError();
- return;
- }
- this._name = ""+(obj);
- }
- obj = propertyJSON["description"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10))) {
- info.processError();
- return;
- }
- this._description = ""+(obj);
- }
- obj = propertyJSON["icon"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10))) {
- info.processError();
- return;
- }
- this._icon = ""+(obj);
- }
- if (this.typeId() == 21) {
- this._defaultValue = {};
- return;
- }
- if (this._parent && this._parent.typeId() == 20) {
- return;
- }
- obj = propertyJSON["default"];
- if (obj != null) {
- this._defaultValue = obj;
- }
- obj = propertyJSON["required"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 12))) {
- info.processError();
- return;
- }
- this._required = (obj);
- }
- if (info.validate && this._required && (this._defaultValue == null)) {
- com_ibm_rave_library_Library.logError(39, "Property Validator");
- info.processError();
- return;
- }
- obj = propertyJSON["resetView"];
- if (obj != null) {
- this._resetView = ""+(obj);
- }
- obj = propertyJSON["tags"];
- if (obj != null) {
- if (com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 20)) {
- var tagsArray = obj;
- for (var i = 0; i < tagsArray.length; ++i) {
- this._tags.push(""+(tagsArray[i]));
- }
- }
- }
- },
- /** @expose */
- required : function() {
- return this._required;
- },
- /** @expose */
- simpleId : function() {
- return this._simpleId;
- },
- /** @expose */
- id : function() {
- return this._qualifiedId;
- },
- /** @expose */
- name : function() {
- return this._messages._nls(this._name, this._name);
- },
- /** @expose */
- description : function() {
- return this._messages._nls(this._description, this._description);
- },
- /** @expose */
- icon : function() {
- return this._icon;
- },
- /** @expose */
- defaultValue : function() {
- return this._defaultValue;
- },
- /** @expose */
- setDefaultValue : function(defaultValue) {
- this._defaultValue = defaultValue;
- },
- /** @expose */
- parent : function() {
- return this._parent;
- },
- /**
- * Get the value to be stored in a property. This allows property types to convert input values, for example the color type can convert the color to a canonical form, or an integer type can round a number. The default implementation returns the input value.
- * @param (Object) value The input value
- * @return (Object) The value to be stored as the property value
- */
- /** @expose */
- canonicalValue : function(value) {
- return value;
- },
- /**
- * Returns list of allowable localized string values this property is to have. For localized non-strings returns nls keys. NOTE: This method does real time catalog lookup, for optimal performance it recommended to call it to obtain all the values , unless locale is switched. E.g. instead of <code> property.options().get(0); property.options().get(1)</code> use <code> List<String> values = property.options(); values.get{0); values.get(1);</code>
- * @return (Array) the list of allowable localized string values this property is to have
- */
- /** @expose */
- options : function() {
- return this._options;
- },
- /** @expose */
- tags : function() {
- return this._tags;
- },
- /** @expose */
- resetView : function() {
- return this._resetView;
- },
- /** @expose */
- pTypeCopy : function(pType) {
- pType._required = this._required;
- pType._name = this._name;
- pType._description = this._description;
- pType._icon = this._icon;
- pType._defaultValue = this._defaultValue;
- pType._resetView = this._resetView;
- pType._options = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this._options, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var option = __exp_enFor0[__i_enFor0];
- pType._options.push(option);
- }
- pType._tags = [];
- for (var __i_enFor1 = 0, __exp_enFor1 = this._tags, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var tag = __exp_enFor1[__i_enFor1];
- pType._tags.push(tag);
- }
- }
- });
- // $source: com/ibm/rave/library/property/PropertyUnknownType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/framework/meta/PropertyMeta (runtime) // PropertyMeta
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * A property type that is created if the JSON object representing it didn't have a type specified. They can act as a place holder for these ill-formed properties. Unknown type will always fail validation
- */
- var com_ibm_rave_library_property_PropertyUnknownType = rave_library_externs["PropertyUnknownType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /** @expose */
- type : function() {
- return com_ibm_rave_library_framework_meta_PropertyMeta.UNKNOWN_TYPE;
- },
- /** @expose */
- typeId : function() {
- return -1;
- },
- /** @expose */
- validateValue : function(obj) {
- com_ibm_rave_library_Library.logError(38, "Property Id" + this.id() + " @PropertyImpl.value");
- return false;
- },
- /** @expose */
- copy : function(parent) {
- var put = new com_ibm_rave_library_property_PropertyUnknownType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(put);
- return put;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyObjectType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * <p> PropertyBooleanType </p> <p> Handles the boolean type for properties, allowing for any or all of the following: </p> <p> -a true label </p> <p> -a false label </p> <p> -a default boolean value </p> <p> The boolean property type supports only a single value, not an array of values. </p>
- */
- var com_ibm_rave_library_property_PropertyObjectType = rave_library_externs["PropertyObjectType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- //_childProperties : null,
- constructor : function(propertyId, qualifiedId, parent, messages) {
- this._childProperties = {};
- /**
- * @param (String) propertyId
- * @param (String) qualifiedId
- * @param (com.ibm.rave.library.property.PropertyType) parent
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages
- */
- {
- }
- },
- /** @expose */
- type : function() {
- return "object";
- },
- /** @expose */
- typeId : function() {
- return 21;
- },
- /**
- * Gets a map of child properties the key of which is the simpleId of each child This map should be treated as read-only map and should not be modified
- * @return (Object) the child properties of this object property
- */
- /** @expose */
- childProperties : function() {
- return this._childProperties;
- },
- /** @expose */
- validateValue : function(obj) {
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 21))) {
- return false;
- }
- var objJson = obj;
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(objJson), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- var childProperty = this._childProperties[""+(propertyId)];
- if (!childProperty) {
- com_ibm_rave_library_Library.logError(36, "Property Validator");
- return false;
- }
- var propVal = objJson[propertyId];
- if (!(childProperty.validateValue(propVal))) {
- return false;
- }
- }
- return true;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- this.buildDefaultValue();
- }
- },
- buildDefaultValue : function() {
- var defaultInstance = this.defaultValue();
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this._childProperties), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- var childProperty = this._childProperties[propertyId];
- defaultInstance[propertyId] = childProperty.defaultValue();
- }
- },
- /** @expose */
- copy : function(parent) {
- var pot = new com_ibm_rave_library_property_PropertyObjectType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pot);
- pot._childProperties = {};
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this._childProperties), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- pot._childProperties[key] = (this._childProperties[key].copy(pot));
- }
- return pot;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyArrayType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- /**
- * <p> The PropertyArrayType allows us to create properties that are arrays of other properties. These properties should be all the same type.
- */
- var com_ibm_rave_library_property_PropertyArrayType = rave_library_externs["PropertyArrayType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- //_items : null,
- _minLen : 0,
- _maxLen : 0,
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- this._minLen = -1;
- this._maxLen = -1;
- },
- /** @expose */
- type : function() {
- return "array";
- },
- /** @expose */
- typeId : function() {
- return 20;
- },
- /**
- * Gets the minimum length of the array
- * @return (int) the minimum length of the array or -1 if it wasn't specified
- */
- /** @expose */
- minLength : function() {
- return this._minLen;
- },
- /**
- * Gets the maximum length of the array
- * @return (int) the maximum length of the array or -1 if it wasn't specified
- */
- /** @expose */
- maxLength : function() {
- return this._maxLen;
- },
- /**
- * Gets the property meta type of the array's elements
- * @return (com.ibm.rave.library.property.PropertyType) the property meta type of the array's elements
- */
- /** @expose */
- items : function() {
- return this._items;
- },
- /** @expose */
- validateValue : function(obj) {
- if (!this._items) {
- return false;
- }
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 20))) {
- return false;
- }
- var maxNum = (this._maxLen != -1) ? this._maxLen : null;
- var minNum = (this._minLen != -1) ? this._minLen : null;
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateMinMaxPropertyValue(minNum, maxNum, false, (obj).length))) {
- return false;
- }
- var list = obj;
- var len = list.length;
- for (var i = 0; i < len; ++i) {
- var entry = list[i];
- if (!(this._items.validateValue(entry))) {
- return false;
- }
- }
- return true;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- var minObj = propertyJSON["minLength"];
- var maxObj = propertyJSON["maxLength"];
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateMinMaxProperties(minObj, maxObj, false, false))) {
- info.processError();
- return;
- }
- if (minObj != null) {
- this._minLen = ~~ (minObj);
- }
- if (maxObj != null) {
- this._maxLen = ~~ (maxObj);
- }
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pat = new com_ibm_rave_library_property_PropertyArrayType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pat);
- pat._minLen = this._minLen;
- pat._maxLen = this._maxLen;
- pat._items = this._items.copy(parent);
- return pat;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyBooleanType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * <p> PropertyBooleanType </p> <p> Handles the boolean type for properties, allowing for any or all of the following: </p> <p> -a true label </p> <p> -a false label </p> <p> -a default boolean value </p> <p> The boolean property type supports only a single value, not an array of values. </p>
- */
- var com_ibm_rave_library_property_PropertyBooleanType = rave_library_externs["PropertyBooleanType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- //_truLabel : null,
- //_falsLabel : null,
- /**
- * Constructor
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * @return (String) the false label
- */
- /** @expose */
- falseLabel : function() {
- return this._falsLabel;
- },
- /**
- * @return (String) the true label
- */
- /** @expose */
- trueLabel : function() {
- return this._truLabel;
- },
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 12);
- },
- /** @expose */
- type : function() {
- return "boolean";
- },
- /** @expose */
- typeId : function() {
- return 12;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- var obj = propertyJSON["trueLabel"];
- var obj2 = propertyJSON["falseLabel"];
- if (info.validate) {
- if ((obj != null || obj2 != null) && (obj == null || obj2 == null)) {
- com_ibm_rave_library_Library.logError(33, "PropertyBooleanType Constructor");
- info.processError();
- return;
- }
- if (obj != null && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10))) {
- info.processError();
- return;
- }
- if (obj2 != null && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj2, 10))) {
- info.processError();
- return;
- }
- }
- if (obj != null) {
- this._truLabel = ""+(obj);
- this._truLabel = this._messages._nls(this._truLabel, this._truLabel);
- }
- if (obj2 != null) {
- this._falsLabel = ""+(obj2);
- this._falsLabel = this._messages._nls(this._falsLabel, this._falsLabel);
- }
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pbt = new com_ibm_rave_library_property_PropertyBooleanType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pbt);
- pbt._truLabel = this._truLabel;
- pbt._falsLabel = this._falsLabel;
- return pbt;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyColorType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- /**
- * PropertyColorType Handles the color type for properties, allowing for any or all of the following: -a default color (default) -a color type
- */
- var com_ibm_rave_library_property_PropertyColorType = rave_library_externs["PropertyColorType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- //_colorType : null,
- /**
- * Takes a type object that is actually a CSS string for color. This can be and rgb value or a string name for a standard color. An error occurs if the color objects does not meet these criteria.
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * Returns the object (converted to a string) or returns the default if the object is null. If the object is the wrong type or null and there is no default, the error is set.
- * @param (Object) obj - a color object.
- * @return (boolean) the object converted to a string, the default if there is no object, or null if there is neither an object or a default.
- */
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10);
- },
- /**
- * Converts the input value to a canonical color. Invalid color-names become black. Returns null for null, and "" for "", to preserve existing GUI behavior.
- */
- /** @expose */
- canonicalValue : function(value) {
- if (value == null || "" == value) {
- return value;
- }
- return rave.rgb(value).toString();
- },
- /** @expose */
- type : function() {
- return "color";
- },
- /** @expose */
- typeId : function() {
- return 15;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- var obj = propertyJSON["colorType"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10))) {
- info.processError();
- return;
- }
- this._colorType = ""+(obj);
- }
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /**
- * gets the a string identifiying the color type. Could be any of the following: "rgb", "hsl", "hcl", "lab"
- * @return (String) the color type identifier
- */
- /** @expose */
- colorType : function() {
- return this._colorType;
- },
- /** @expose */
- copy : function(parent) {
- var pct = new com_ibm_rave_library_property_PropertyColorType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pct);
- pct._colorType = this._colorType;
- return pct;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyEnumType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- //@import com/ibm/rave/library/Library (runtime) // logError
- //@import com/ibm/rave/library/property/EnumPropertyOption (runtime) // new
- /**
- * PropertyEnumType Handles the enum type for properties, allowing for any or all of the following: -an array of enums mapped to strings -a default enum TODO: This shows the TODO: We don't have any uses of enums in the bundles yet. This assumes that they will be internationalized, meaning that the string labels will be message IDs.
- */
- var com_ibm_rave_library_property_PropertyEnumType = rave_library_externs["PropertyEnumType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- //_enums : null,
- /**
- * Constructor
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- this._enums = {};
- },
- /**
- * Value validation rules An error occurs if: 1) The enum object is the wrong type 2) The enumValue is not found in the options array 3) The object is null and there is no default
- * @param (Object) obj the enum value (should be an Integer)
- */
- /** @expose */
- validateValue : function(obj) {
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateNumeric(obj, false))) {
- return false;
- }
- if (this._enums[(~~ (obj))] == null) {
- com_ibm_rave_library_Library.logError(34, "Property Validator");
- return false;
- }
- return true;
- },
- /**
- * Returns the corresponding string value for the enum, or null if the enum is invalid
- * @param (int) num the enum number
- * @return (String) the corresponding string
- */
- /** @expose */
- enumValue : function(num) {
- return this._enums[num];
- },
- /** @expose */
- type : function() {
- return "enum";
- },
- /** @expose */
- typeId : function() {
- return 13;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- var obj = propertyJSON["options"];
- if (obj == null) {
- if (info.validate) {
- com_ibm_rave_library_Library.logError(41, "Property Validator");
- }
- info.processError();
- return;
- }
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 20))) {
- info.processError();
- return;
- }
- var optionsArray = obj;
- var len = optionsArray.length;
- for (var i = 0; i < len; ++i) {
- var optionObj = optionsArray[i];
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(optionObj, 21))) {
- info.processError();
- if (info.validate) {
- return;
- }
- continue;
- }
- var valueObj = (optionObj)["enum"];
- var labelObj = (optionObj)["enumLabel"];
- if (valueObj == null || labelObj == null) {
- if (info.validate) {
- com_ibm_rave_library_Library.logError(42, "Property Validator");
- }
- info.processError();
- if (info.validate) {
- return;
- }
- continue;
- }
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateNumeric(valueObj, false))) {
- info.processError();
- return;
- }
- var value = ~~ (valueObj);
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(labelObj, 10))) {
- info.processError();
- return;
- }
- var label = ""+(labelObj);
- if (this._enums[value] != null) {
- if (info.validate) {
- com_ibm_rave_library_Library.logError(43, "Property Validator");
- }
- info.processError();
- if (info.validate) {
- return;
- }
- continue;
- }
- this._enums[value] = label;
- this._options.push(new com_ibm_rave_library_property_EnumPropertyOption(value, label, this._messages));
- }
- }
- if (this.defaultValue() != null) {
- if (com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateNumeric(this.defaultValue(), false)) {
- com_ibm_rave_library_property_PropertyType.prototype.setDefaultValue.call(this, ~~ (this.defaultValue()));
- }
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pet = new com_ibm_rave_library_property_PropertyEnumType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pet);
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this._enums), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var key = __exp_enFor0[__i_enFor0];
- pet._enums[key] = this._enums[key];
- }
- return pet;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyFontType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- /**
- * <p> PropertyFontType </p> <p> Handles the font type for properties, which can only have a default field, stored as a single comma separated string, as in CSS font styles. </p>
- */
- var com_ibm_rave_library_property_PropertyFontType = rave_library_externs["PropertyFontType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /**
- * Constructor
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * Validation rules An error is triggered if: 1) The font family is not a string a String array 2) The object is null and there is no default to return.
- */
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10);
- },
- /** @expose */
- type : function() {
- return "font";
- },
- /** @expose */
- typeId : function() {
- return 14;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pft = new com_ibm_rave_library_property_PropertyFontType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pft);
- return pft;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyNumericType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- //@import com/ibm/rave/library/property/NumberPropertyOption (runtime) // new
- /**
- * <p> PropertyNumericType </p> <p> Numeric types can be whole or decimal, can be limited by a minimum and maximum, can have a default value, and may be limited to a set selection of values. Although the values may be limited to whole numbers (integers or longs) all particulars within this class are declared as doubles. </p> <p> Numeric types may have the following metadata that restricts permitted values: </p> <p> - the minimum value - the maximum value - the subtype: "whole" or "decimal" - an array of permitted options - the default value </p>
- */
- var com_ibm_rave_library_property_PropertyNumericType = rave_library_externs["PropertyNumericType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- _minVal : 0,
- _maxVal : 0,
- _decimal : false,
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- this._decimal = true;
- this._minVal = NaN;
- this._maxVal = NaN;
- },
- /**
- * @return (Array) the list of allowable numbers. Could be null if nothing was specified
- */
- /** @expose */
- options : function() {
- return this._options;
- },
- /**
- * Validation rules An error will be triggered if there is an error object and: 1) there is no numeric object, and no default value 2) the object type is not numeric 3) the value is below the minimum (if the min is specified.) 4) the value is above the maximum (if the max is specified.) 5) the value is decimal when the subtype is "whole" 6) the value is not amongst the specified options
- * @param (Object) obj A numeric object for validation
- * @return (boolean) the original object, or the default if it exists and the object passed in does not.
- */
- /** @expose */
- validateValue : function(obj) {
- var maxNum = (isNaN(this._maxVal)) ? null : this._maxVal;
- var minNum = (isNaN(this._minVal)) ? null : this._minVal;
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateNumeric(obj, this._decimal)) || !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateMinMaxPropertyValue(minNum, maxNum, this._decimal, + (obj)))) {
- return false;
- }
- if (this._options && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateNumericProperties(this._options, + (obj), this._decimal))) {
- return false;
- }
- return true;
- },
- /**
- * @return (double) the minimum value, which will be NaN if none was set
- */
- /** @expose */
- min : function() {
- return this._minVal;
- },
- /**
- * @return (double) the maximum value, which will be NaN if none was set
- */
- /** @expose */
- max : function() {
- return this._maxVal;
- },
- /**
- * @return (boolean) when true it means that this numeric property can have a fractional part, else it is an an integer
- */
- /** @expose */
- decimal : function() {
- return this._decimal;
- },
- /** @expose */
- type : function() {
- return "numeric";
- },
- /** @expose */
- typeId : function() {
- return 11;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- var obj = propertyJSON["decimal"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 12))) {
- info.processError();
- return;
- }
- this._decimal = (obj);
- }
- var minObj = propertyJSON["min"];
- var maxObj = propertyJSON["max"];
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateMinMaxProperties(minObj, maxObj, this._decimal, true))) {
- info.processError();
- return;
- }
- if (minObj != null) {
- this._minVal = + (minObj);
- }
- if (maxObj != null) {
- this._maxVal = + (maxObj);
- }
- obj = propertyJSON["options"];
- if (obj != null) {
- if (com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 20)) {
- var optionsArray = obj;
- if (info.validate) {
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateSimpleOptions(optionsArray, this))) {
- info.processError();
- return;
- }
- }
- var len = optionsArray.length;
- this._options = [];
- for (var i = 0; i < len; ++i) {
- var t = (this._decimal) ? + (optionsArray[i]) : ~~ (optionsArray[i]);
- this._options.push(new com_ibm_rave_library_property_NumberPropertyOption(t));
- }
- } else {
- info.processError();
- if (info.validate) {
- return;
- }
- }
- }
- if (this.defaultValue() != null) {
- if (com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateNumeric(this.defaultValue(), this._decimal)) {
- com_ibm_rave_library_property_PropertyType.prototype.setDefaultValue.call(this, (this._decimal) ? + (this.defaultValue()) : ~~ (this.defaultValue()));
- }
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pnt = new com_ibm_rave_library_property_PropertyNumericType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pnt);
- pnt._minVal = this._minVal;
- pnt._maxVal = this._maxVal;
- pnt._decimal = this._decimal;
- return pnt;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyPaletteType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/Library (runtime) // Library
- //@import com/ibm/rave/library/property/PalettePropertyOption (runtime) // new
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- /**
- * <p> Handles the palette type for properties, which is an extended string type that pulls some of it's option from the library's palette manager as well as the bundles properties
- */
- var com_ibm_rave_library_property_PropertyPaletteType = rave_library_externs["PropertyPaletteType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /**
- * based on these types we will get all palettes that are of the types listed in the options
- */
- //paletteTypes : null,
- /**
- * @param (String) propertyId
- * @param (String) qualifiedId
- * @param (com.ibm.rave.library.property.PropertyType) parent
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * Creates a new list of PropertyOption objects from the library's palette manager. These objects can be used to retrieve the pallet Id and localized label. TODO. All palettes should use IDs for the label and description, and those strings should be defined in the messages.
- * @return (Array) list of palette property option objects
- */
- /** @expose */
- options : function() {
- var dynamicOptions = [];
- var libraryOptions = com_ibm_rave_library_Library.palettes.getAllPalettes();
- for (var __i_enFor0 = 0, __exp_enFor0 = libraryOptions, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var palette = __exp_enFor0[__i_enFor0];
- if (this.paletteTypes.indexOf(palette.type)> -1) {
- dynamicOptions.push(new com_ibm_rave_library_property_PalettePropertyOption(palette._id, palette._label, this._messages));
- }
- }
- return dynamicOptions;
- },
- /**
- * Gets the default value for the property if there is no default we get the library's default value
- * @return (Object) the valid options
- */
- /** @expose */
- defaultValue : function() {
- var defaultValue = com_ibm_rave_library_property_PropertyType.prototype.defaultValue.call(this);
- if (defaultValue == null) {
- return com_ibm_rave_library_Library.palettes.getPaletteManagerData().defaultPalette;
- }
- return defaultValue;
- },
- /** @expose */
- type : function() {
- return "palette";
- },
- /** @expose */
- typeId : function() {
- return 16;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- var obj = propertyJSON["options"];
- if (obj != null) {
- if (com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 20)) {
- var optionsArray = obj;
- var len = optionsArray.length;
- this.paletteTypes = [];
- for (var i = 0; i < len; ++i) {
- this.paletteTypes.push(""+(optionsArray[i]));
- }
- if (info.validate) {
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateSimpleOptions(optionsArray, this))) {
- info.processError();
- return;
- }
- }
- } else {
- info.processError();
- if (info.validate) {
- return;
- }
- }
- }
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10) || !this.paletteTypes || this.paletteTypes.length < 1 || com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateObjectExistInList(this.paletteTypes, obj);
- },
- /** @expose */
- copy : function(parent) {
- var ppt = new com_ibm_rave_library_property_PropertyPaletteType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(ppt);
- ppt.paletteTypes = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this.paletteTypes, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var palette = __exp_enFor0[__i_enFor0];
- ppt.paletteTypes.push(palette);
- }
- return ppt;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyLengthType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- /**
- * <p> PropertyLengthType </p> <p> Handles the css length type for properties. </p>
- */
- var com_ibm_rave_library_property_PropertyLengthType = rave_library_externs["PropertyLengthType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /**
- * Constructor
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * Validation rules An error is triggered if: 1) The property is not a string 2) The object is null and there is no default to return.
- */
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10);
- },
- /** @expose */
- type : function() {
- return "length";
- },
- /** @expose */
- typeId : function() {
- return 17;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pft = new com_ibm_rave_library_property_PropertyLengthType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pft);
- return pft;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyPaddingType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- /**
- * <p> PropertyPaddingType </p> <p> Handles the css padding type for properties. Example: "padding-left:10px; padding-top:15px; padding-right:5px; padding-bottom:10px" For backwards compatibility, a single "length" can be specfied (eg. "10px") and this applies to all 4 </p>
- */
- var com_ibm_rave_library_property_PropertyPaddingType = rave_library_externs["PropertyPaddingType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /**
- * Constructor
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * Validation rules An error is triggered if: 1) The property is not a string 2) The object is null and there is no default to return.
- */
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10);
- },
- /** @expose */
- type : function() {
- return "padding";
- },
- /** @expose */
- typeId : function() {
- return 18;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pft = new com_ibm_rave_library_property_PropertyPaddingType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pft);
- return pft;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyDashArrayType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- /**
- * <p> PropertyDashArrayType </p> <p> Handles the css stroke-dasharray type for properties. A comma separated list of stroke,gap (stroke,gap...) for a line. Examples: "1,5" is dot "5,5" is dash "5,5,1,5" is dash-dot </p>
- */
- var com_ibm_rave_library_property_PropertyDashArrayType = rave_library_externs["PropertyDashArrayType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /**
- * Constructor
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * Validation rules An error is triggered if: 1) The property is not a string 2) The object is null and there is no default to return.
- */
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10);
- },
- /** @expose */
- type : function() {
- return "dasharray";
- },
- /** @expose */
- typeId : function() {
- return 19;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pft = new com_ibm_rave_library_property_PropertyDashArrayType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pft);
- return pft;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyStringType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- //@import com/ibm/rave/library/property/StringPropertyOption (runtime) // new
- //@import com/ibm/rave/library/internal/nativeImpl/PropertyNativeUtils (runtime) // stringMatchesRexExp
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * <p> Handles the string type for properties, allowing for any or all of the following: </p> -a minimum length (minLength) -a maximum length (maxLength) -a regular expression the string should match (regExp) -a flag which indicates whether the string is to be localized (localize) -an array of options, one of which any string value must match (options) -a default string value (default)
- */
- var com_ibm_rave_library_property_PropertyStringType = rave_library_externs["PropertyStringType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- //_regExp : null,
- _minLen : 0,
- _maxLen : 0,
- _localize : false,
- /**
- * Constructor This does no error or type checking. It is assumed that the JSONObject has already been validated.
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- this._minLen = -1;
- this._maxLen = -1;
- },
- /**
- * @return (int) the minimum length of the string or -1 if this constraint wasn't specified
- */
- /** @expose */
- minLength : function() {
- return this._minLen;
- },
- /**
- * @return (int) the maximum length of the string or -1 if this constraint wasn't specified
- */
- /** @expose */
- maxLength : function() {
- return this._maxLen;
- },
- optionsIDs : function() {
- var ids = [];
- if (this._options) {
- for (var __i_enFor0 = 0, __exp_enFor0 = this._options, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var option = __exp_enFor0[__i_enFor0];
- ids.push(option.value());
- }
- }
- return ids;
- },
- /**
- * @return (String) the regular expression -if any- which values of this property must match
- */
- /** @expose */
- regularExpression : function() {
- return this._regExp;
- },
- /** @expose */
- type : function() {
- return "string";
- },
- /** @expose */
- typeId : function() {
- return 10;
- },
- /**
- * @return (boolean) whether the value of the localize flag on the string property
- */
- /** @expose */
- localize : function() {
- return this._localize;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- var minObj = propertyJSON["minLength"];
- var maxObj = propertyJSON["maxLength"];
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateMinMaxProperties(minObj, maxObj, false, false))) {
- info.processError();
- return;
- }
- if (minObj != null) {
- this._minLen = ~~ (minObj);
- }
- if (maxObj != null) {
- this._maxLen = ~~ (maxObj);
- }
- var obj = propertyJSON["localize"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 12))) {
- info.processError();
- return;
- }
- this._localize = (obj);
- }
- obj = propertyJSON["regExp"];
- if (obj != null) {
- if (info.validate && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10))) {
- info.processError();
- return;
- }
- this._regExp = ""+(obj);
- }
- obj = propertyJSON["options"];
- if (obj != null) {
- if (com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 20)) {
- var optionsArray = obj;
- if (info.validate) {
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateStringOptions(optionsArray, this))) {
- info.processError();
- return;
- }
- }
- var len = optionsArray.length;
- this._options = [];
- for (var i = 0; i < len; ++i) {
- var o = optionsArray[i];
- this._options.push(new com_ibm_rave_library_property_StringPropertyOption(""+(o["value"]), ""+(o["id"]), this._messages));
- }
- } else {
- info.processError();
- if (info.validate) {
- return;
- }
- }
- }
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- },
- /** @expose */
- validateValue : function(obj) {
- var maxNum = (this._maxLen != -1) ? this._maxLen : null;
- var minNum = (this._minLen != -1) ? this._minLen : null;
- if (!(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10)) || !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateMinMaxPropertyValue(minNum, maxNum, false, (""+(obj)).length))) {
- return false;
- }
- if (this._regExp != null && this._regExp.length > 0 && !(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.stringMatchesRexExp((""+(obj)), this._regExp))) {
- com_ibm_rave_library_Library.logError(37, "Property Validator");
- return false;
- }
- if (this._options.length > 0 && !(com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateObjectExistInList(this.optionsIDs(), obj))) {
- return false;
- }
- return true;
- },
- /** @expose */
- copy : function(parent) {
- var pst = new com_ibm_rave_library_property_PropertyStringType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pst);
- pst._minLen = this._minLen;
- pst._maxLen = this._maxLen;
- pst._localize = this._localize;
- pst._regExp = this._regExp;
- return pst;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyJSONObjectType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/internal/nativeImpl/PropertyNativeUtils (runtime) // isJSONObject
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- * <p> PropertyJSONObjectType </p> <p> Handles the JSON Object type for properties. This type is used for passing JSON Objects between the application and the bundle, primarily for GeoJSONs. It is not validated, and cannot have a default, nor does it have any validation fields. </p> <p> The JSONObject property type supports only a single value, not an array of values. </p>
- */
- var com_ibm_rave_library_property_PropertyJSONObjectType = rave_library_externs["PropertyJSONObjectType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /**
- * Constructor
- */
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /**
- * For this type, we do NO validation. It is assumed that the JSON object (usually, a GeoJSON) will have been verified in advance before being submitted.
- */
- /** @expose */
- validateValue : function(obj) {
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONObject(obj))) {
- com_ibm_rave_library_Library.logError(31, "PropertyJSONObjectType validateValue");
- return false;
- }
- return true;
- },
- /** @expose */
- type : function() {
- return "jsonobject";
- },
- /** @expose */
- typeId : function() {
- return 22;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- }
- }
- },
- /** @expose */
- copy : function(parent) {
- var pjt = new com_ibm_rave_library_property_PropertyJSONObjectType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pjt);
- return pjt;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyGeoJsonType
- /************************************************************************
- ** 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/property/PropertyJSONObjectType (loadtime) // superclass
- var com_ibm_rave_library_property_PropertyGeoJsonType = rave_library_externs["PropertyGeoJsonType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyJSONObjectType, {
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /** @expose */
- type : function() {
- return "geojson";
- },
- /** @expose */
- typeId : function() {
- return 23;
- }
- });
- // $source: com/ibm/rave/library/property/PropertyShadowType
- /************************************************************************
- ** 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/property/PropertyType (loadtime) // superclass
- //@import com/ibm/rave/library/property/PropertyUtil (runtime) // PropertyUtil
- var com_ibm_rave_library_property_PropertyShadowType = rave_library_externs["PropertyShadowType"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyType, {
- /** @expose */
- constructor : function(propertyId, qualifiedId, parent, messages) {
- },
- /** @expose */
- type : function() {
- return "shadow";
- },
- /** @expose */
- typeId : function() {
- return 24;
- },
- /** @expose */
- validateValue : function(obj) {
- return com_ibm_rave_library_property_PropertyUtil.INSTANCE.validateBasicType(obj, 10);
- },
- /** @expose */
- copy : function(parent) {
- var pst = new com_ibm_rave_library_property_PropertyShadowType(this.simpleId(), this.id(), parent, this._messages);
- this.pTypeCopy(pst);
- return pst;
- },
- /** @expose */
- initType : function(propertyJSON, info) {
- com_ibm_rave_library_property_PropertyType.prototype.initType.call(this, propertyJSON, info);
- if (!(info.validate && info.hasInvalidProperties)) {
- if (this.defaultValue() != null) {
- if (info.validate && !(this.validateValue(this.defaultValue()))) {
- info.processError();
- return;
- }
- }
- }
- }
- });
- // $source: com/ibm/rave/library/datamodel/internal/BundleDataModels
- /************************************************************************
- ** 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/datamodel/internal/DataModelDescriptorImpl (runtime) // create
- //@import com/ibm/rave/library/datamodel/internal/DataModelImpl (runtime) // new
- //@import com/ibm/rave/library/Library (static) // logError
- /**
- * <p> Represents the data models of a bundle, and the current model. </p> <p> Two lists of models are kept, one with all models and one with only the visible (in public/integrator API) models. {@link #this.populate(Object, com_ibm_rave_library_i18n_MessagesRegistry)} adds new models to both lists. {@link #this.configure(Object)} filters the current visible models with a JSON configuration. Both methods can be used incrementally, to first define models from several files and then to repeatedly filter them with configurations. For correct behavior populate should not be called after configure, but this is not checked. </p> <p> There is at any time one current data model. {@link #this.createDataModel(String)} creates a new instance of the requested model with no data, makes it the current data model, and returns it. {@link #this.dataModel()} returns the current data model. </p>
- */
- var com_ibm_rave_library_datamodel_internal_BundleDataModels = rave['internal']['Declare']({
- /**
- * Descriptors of all defined models
- */
- //_allDescriptors : null,
- /**
- * Map from data model ID to descriptor, for all defined models
- */
- //_allIds : null,
- /**
- * IDs of hidden models.
- */
- //_hiddenIds : null,
- /**
- * List of visible model descriptors, null when it must be recreated.
- */
- //_visibleDescriptors : null,
- /**
- * Te default model id; null if not set
- */
- //_defaultModel : null,
- /**
- * The current data model
- */
- //_dataModel : null,
- constructor : function() {
- this._allDescriptors = [];
- this._allIds = {};
- this._hiddenIds = {};
- this._visibleDescriptors = [];
- },
- /**
- * <p> Populate models from the given JSON, which may be a data model schema. If it does not have a "datamodels" property, nothing is done. </p> <p> Otherwise, the "datamodels" property is taken as an array of objects describing data models, as in the schema. If the object "id" is already defined, it is skipped (no overwrite of existing models). Otherwise a new data model descriptor for the object is created and added to the collection. The current model is made null. </p> <p> If the object also has a "defaultModel" property, the default model is not yet defined, and the "defaultModel" id is a visible model, the default model is set to that id. </p>
- * @param (Object) json JSON descriptor
- */
- populate : function(json, messages) {
- var v = json["datamodels"];
- if (v != null) {
- for (var __i_enFor0 = 0, __exp_enFor0 = v, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var model = o;
- var id = (model["id"]);
- if (id != null && !(this._allIds.hasOwnProperty(id))) {
- var desc = com_ibm_rave_library_datamodel_internal_DataModelDescriptorImpl.create(model);
- (desc).setMessages(messages);
- this._allDescriptors.push(desc);
- this._allIds[id] = desc;
- }
- }
- this._dataModel = null;
- this._visibleDescriptors = [];
- this.setDefaultModel(json);
- }
- },
- /**
- * <p> Configure visible models from the given JSON. If it does not have a "datamodels" property, nothing is done. </p> <p> Otherwise, the "datamodels" property is an array of objects describing the datamodel configuration, as in the schema. The list of visible descriptors is traversed and filtered by the configurations, to rebuild the visible descriptors. The current model is made null. </p> <p> If the filtering hides the default model, the default model is made undefined. If the object also has a "defaultModel" property, the default model is not yet defined, and the "defaultModel" id is a visible model, the default model is set to that id. </p>
- */
- configure : function(json) {
- var v = json["datamodels"];
- if (v != null) {
- for (var __i_enFor0 = 0, __exp_enFor0 = v, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var model = o;
- var id = (model["id"]);
- var hidden = (model["hidden"]);
- if (id != null && hidden != null && hidden) {
- this._hiddenIds[id] = 1;
- }
- }
- this._dataModel = null;
- this._visibleDescriptors = [];
- if (this._defaultModel != null && this._hiddenIds.hasOwnProperty(this._defaultModel)) {
- this._defaultModel = null;
- }
- this.setDefaultModel(json);
- }
- v = json["dataSlots"];
- if (v != null) {
- for (var __i_enFor1 = 0, __exp_enFor1 = this._allDescriptors, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var model = __exp_enFor1[__i_enFor1];
- (model).configure(v);
- }
- }
- },
- /**
- * If the default model is not set and the JSON has a "defaultModel" property which is the ID of a visible model, set the default model to that ID.
- * @param (Object) json The JSON (from populate or configure)
- */
- setDefaultModel : function(json) {
- if (this._defaultModel == null) {
- var id = (json["defaultModel"]);
- if (id != null && this._allIds.hasOwnProperty(id) && !(this._hiddenIds.hasOwnProperty(id))) {
- this._defaultModel = id;
- }
- }
- },
- /**
- * Get descriptors of the data models supported by this bundle. The array will not be empty. In the current implementations each bundle has exactly one model.
- * @return (Array) Array of the model descriptors.
- */
- getDataModels : function() {
- if (this._visibleDescriptors.length == 0) {
- for (var __i_enFor0 = 0, __exp_enFor0 = this._allDescriptors, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dmd = __exp_enFor0[__i_enFor0];
- if (!(this._hiddenIds.hasOwnProperty(dmd.id()))) {
- this._visibleDescriptors.push(dmd);
- }
- }
- }
- return this._visibleDescriptors;
- },
- /**
- * Get the id of the default data model. If the default model has not been set and there are models defined, the default model is set to the first model. This will return null only if no models are defined; this is not reported as an error.
- * @return (String) Default model ID
- */
- getDefaultModelId : function() {
- if (this._defaultModel == null) {
- this.getDataModels();
- if (this._visibleDescriptors.length > 0) {
- this._defaultModel = this._visibleDescriptors[0].id();
- }
- }
- return this._defaultModel;
- },
- /**
- * <p> Get a data model by id. If the id is non-null, it must be that of one of the supported models or null is returned. If the id is null, the default model is returned. If the default model has not been set when this method is called, the default model is set to the first model if any are defined. </p> <p> The returned model becomes the current input model for the bundle and should be used to set data in the slots. The model is returned by {@link #this.dataModel()} . If this method is called again (even with the same argument as the previous call), a new model is created and becomes the current model; no data is used from the previous model. </p> <p> If no models are defined or an unknown id is requested, null is returned and an error is reported. The current model is not changed in this case. </p>
- * @param (String) modelId The model ID; if null, the default model is used
- * @return (com.ibm.rave.library.datamodel.DataModel) A data model for that ID, usable to set data; or null
- */
- createDataModel : function(modelId) {
- if (this._allDescriptors.length == 0) {
- com_ibm_rave_library_datamodel_internal_BundleDataModels.reportError(104, null);
- return null;
- }
- this.getDefaultModelId();
- if (modelId != null) {
- if (this._hiddenIds.hasOwnProperty(modelId)) {
- com_ibm_rave_library_datamodel_internal_BundleDataModels.reportError(105, modelId);
- return null;
- }
- var desc = this._allIds[modelId];
- if (desc) {
- this._dataModel = new com_ibm_rave_library_datamodel_internal_DataModelImpl(desc);
- return this._dataModel;
- }
- com_ibm_rave_library_datamodel_internal_BundleDataModels.reportError(105, modelId);
- return null;
- }
- this._dataModel = new com_ibm_rave_library_datamodel_internal_DataModelImpl(this._allIds[this._defaultModel]);
- return this._dataModel;
- },
- /**
- * <p> Get the current data model for this bundle. If no data model has been requested with {@link #this.createDataModel(String)} , an instance of the default data model will be created and made the current data model. This will also set the default model to the first model defined, if it has not already been set. </p>
- * @return (com.ibm.rave.library.datamodel.DataModel) The current data model
- */
- dataModel : function() {
- if (!this._dataModel) {
- this.createDataModel(null);
- }
- return this._dataModel;
- },
- /**
- * Deep copy of this data models object.
- * @return (com.ibm.rave.library.datamodel.internal.BundleDataModels) copy of all properties.
- */
- copy : function() {
- var models = new com_ibm_rave_library_datamodel_internal_BundleDataModels();
- for (var __i_enFor0 = 0, __exp_enFor0 = this._allDescriptors, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var model = __exp_enFor0[__i_enFor0];
- models._allDescriptors.push((model).copy());
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = models._allDescriptors, __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var model = __exp_enFor1[__i_enFor1];
- models._allIds[model.id()] = model;
- }
- for (var __i_enFor2 = 0, __exp_enFor2 = Object.keys(this._hiddenIds), __len_enFor2 = __exp_enFor2.length;
- __i_enFor2 < __len_enFor2; ++__i_enFor2) {
- var key = __exp_enFor2[__i_enFor2];
- models._hiddenIds[(key)] = 1;
- }
- this._visibleDescriptors = [];
- models._defaultModel = this._defaultModel;
- models._dataModel = this._dataModel;
- return models;
- }
- });
- /**
- * Report an error to the Library with code DATAMODEL_ERROR and the given message and location.
- * @param (int) code error code, may be null
- * @param (String) location Location, may be null
- */
- com_ibm_rave_library_datamodel_internal_BundleDataModels.reportError = function(code, location) {
- com_ibm_rave_library_Library.logError(code, location);
- };
- // $source: com/ibm/rave/library/datamodel/internal/DataSetDescriptorImpl
- /************************************************************************
- ** 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/datamodel/DataSetDescriptor (loadtime) // superclass
- //@import com/ibm/rave/library/datamodel/internal/DataSlotDescriptorImpl (runtime) // create
- /**
- * Implementation of the {@link DataSetDescriptor} . This is the only implementation of the interface used by VizLibrary.
- */
- var com_ibm_rave_library_datamodel_internal_DataSetDescriptorImpl = rave['internal']['Declare'](com_ibm_rave_library_datamodel_DataSetDescriptor, {
- /**
- * The id, set in the constructor
- */
- //_id : null,
- /**
- * The label, set in the constructor
- */
- //_label : null,
- /**
- * The descriptor, set in the constructor
- */
- //_description : null,
- /**
- * The tags, set in the constructor; never null, empty array if no tags defined
- */
- //_tags : null,
- /**
- * The icon, set in the constructor
- */
- //_icon : null,
- /**
- * The cardinality, set in the constructor
- */
- //_cardinality : null,
- /**
- * The type, set in the constructor
- */
- //_type : null,
- /**
- * The data slots, set in the constructor; never null, empty array if no slots defined
- */
- //_dataSlots : null,
- /**
- * Map from slot name to index
- */
- //_slotIndexes : null,
- /**
- * Localization Strings. These can change.
- */
- //_messages : null,
- /**
- * Private constructor used by factory methods. The data slots array is allocated but empty.
- * @param (String) id The id
- * @param (String) label The label
- * @param (String) description The description
- * @param (Array) tags The array of tags
- * @param (Object) icon The icon
- * @param (String) cardinality The cardinality
- * @param (String) type The type
- */
- constructor : function(id, label, description, tags, icon, cardinality, type) {
- this._id = id;
- this._label = label;
- this._description = description;
- this._tags = tags;
- this._icon = icon;
- this._cardinality = cardinality;
- this._type = type;
- this._dataSlots = [];
- this._slotIndexes = {};
- },
- /**
- * Clear any previous configuration settings.
- */
- clearConfiguration : function() {
- for (var __i_enFor0 = 0, __exp_enFor0 = this._dataSlots, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dataSlot = __exp_enFor0[__i_enFor0];
- (dataSlot).clearConfiguration();
- }
- return this;
- },
- /**
- * @param (Object) slotConfig
- */
- configure : function(slotConfig) {
- for (var __i_enFor0 = 0, __exp_enFor0 = this._dataSlots, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dataSlot = __exp_enFor0[__i_enFor0];
- if (dataSlot.id() == slotConfig["dataSlotId"]) {
- (dataSlot).configure(slotConfig);
- }
- }
- return this;
- },
- /**
- * Set the message registry for displaying the data in the current locale.
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages - the MessagesRegistry
- */
- setMessages : function(messages) {
- this._messages = messages;
- for (var __i_enFor0 = 0, __exp_enFor0 = this._dataSlots, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var slot = __exp_enFor0[__i_enFor0];
- (slot)._messages = messages;
- }
- },
- /** @expose */
- id : function() {
- return this._id;
- },
- /** @expose */
- label : function() {
- if (!this._messages) {
- return this._label;
- }
- return this._messages._nls(this._label, this._label);
- },
- /** @expose */
- description : function() {
- if (!this._messages) {
- return this._description;
- }
- return this._messages._nls(this._description, this._description);
- },
- /** @expose */
- tags : function() {
- if (!this._messages) {
- return this._tags;
- }
- var msgTags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this._tags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- msgTags.push(this._messages._nls(tag, tag));
- }
- return msgTags;
- },
- /** @expose */
- icon : function() {
- return this._icon;
- },
- /** @expose */
- cardinality : function() {
- return this._cardinality;
- },
- /** @expose */
- type : function() {
- return this._type;
- },
- /** @expose */
- dataSlots : function() {
- return this._dataSlots;
- },
- /**
- * @param (String) dataSlotId A slot identifier
- * @return (Number) Index of that slot in the descriptor array, or -1 if not defined
- */
- dataSlotIndex : function(dataSlotId) {
- return this._slotIndexes[dataSlotId];
- },
- /** @expose */
- copy : function() {
- var newDescriptor = new com_ibm_rave_library_datamodel_internal_DataSetDescriptorImpl(this._id, this._label, this._description, this._tags, this._icon, this._cardinality, this._type);
- for (var i = 0; i < this._dataSlots.length; ++i) {
- var slot = (this._dataSlots[i].copy());
- newDescriptor._dataSlots.push(slot);
- newDescriptor._slotIndexes[slot._id] = i;
- }
- newDescriptor._messages = this._messages;
- return newDescriptor;
- }
- });
- /**
- * Construct the data set description from the JSON, which conforms to the schema for data sets. This code assumes that the JSON has been checked against that schema and is valid (all required fields present, no illegal types or enum values, etc.).
- * @param (Object) json Description of data set
- */
- com_ibm_rave_library_datamodel_internal_DataSetDescriptorImpl.create = function(json) {
- var id = (json["id"]);
- var label = (json["label"]);
- var description = (json["description"]);
- var tags = [];
- var a = json["tags"];
- if (a) {
- var l = a.length;
- for (var i = 0; i < l; ++i) {
- tags.push(""+(a[i]));
- }
- }
- var icon = json["icon"];
- var cardinality = ""+(json["cardinality"]);
- if (!("0..1" == cardinality || "1" == cardinality)) {
- cardinality = "0..1";
- }
- var type = ""+(json["type"]);
- if (!("tabular" == type || "hierarchy" == type)) {
- type = "tabular";
- }
- var dsd = new com_ibm_rave_library_datamodel_internal_DataSetDescriptorImpl(id, label, description, tags, icon, cardinality, type);
- a = json["dataslots"];
- if (a) {
- var l = a.length;
- for (var i = 0; i < l; ++i) {
- var slot = com_ibm_rave_library_datamodel_internal_DataSlotDescriptorImpl.create(a[i]);
- dsd._dataSlots.push(slot);
- dsd._slotIndexes[slot._id] = i;
- }
- }
- return dsd;
- };
- // $source: com/ibm/rave/library/datamodel/internal/DataSlotDescriptorImpl
- /************************************************************************
- ** 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/datamodel/DataSlotDescriptor (loadtime) // superclass
- /**
- * Implementation of the {@link DataSlotDescriptor} . This is the only implementation of the interface used by VizLibrary.
- */
- var com_ibm_rave_library_datamodel_internal_DataSlotDescriptorImpl = rave['internal']['Declare'](com_ibm_rave_library_datamodel_DataSlotDescriptor, {
- /**
- * The id, set in the constructor
- */
- //_id : null,
- /**
- * The label, set in the constructor
- */
- //_label : null,
- //_labelDefault : null,
- /**
- * The descriptor, set in the constructor
- */
- //_description : null,
- /**
- * The tags, set in the constructor; never null, empty array if no tags defined
- */
- //_tags : null,
- /**
- * The image icon path, set in the constructor
- */
- //_imageIcon : null,
- /**
- * The svg icon path, set in the constructor
- */
- //_svgIcon : null,
- //_svgIconDefault : null,
- /**
- * The cardinality, set in the constructor
- */
- //_cardinality : null,
- //_cardinalityDefault : null,
- /**
- * The data types, set in the constructor; never null
- */
- //_dataTypes : null,
- /**
- * The data types, set by configuration, and can be null
- */
- //_configDataTypes : null,
- /**
- * Localization Strings. These can change.
- */
- //_messages : null,
- /**
- * The cardinality, set in the constructor
- */
- _hidden : false,
- /**
- * Private constructor used by factory methods.
- * @param (String) id The id
- * @param (String) label The label
- * @param (String) description The description
- * @param (Array) tags The array of tags
- * @param icon The icon
- * @param (String) cardinality The cardinality
- * @param (Array) dataTypes The array of data types
- */
- constructor : function(id, label, description, tags, imageIcon, svgIcon, cardinality, dataTypes) {
- this._id = id;
- this._label = label;
- this._labelDefault = label;
- this._description = description;
- this._tags = tags;
- this._imageIcon = imageIcon;
- this._svgIcon = svgIcon;
- this._svgIconDefault = svgIcon;
- this._cardinality = cardinality;
- this._cardinalityDefault = cardinality;
- this._dataTypes = dataTypes;
- },
- /**
- * Clear any previous configuration settings.
- */
- clearConfiguration : function() {
- this._hidden = false;
- this._configDataTypes = null;
- this._label = this._labelDefault;
- this._svgIcon = this._svgIconDefault;
- this._cardinality = this._cardinalityDefault;
- return this;
- },
- /**
- * Configures the configuration options for the slot: - determine whether the slot is hidden (and hence has no data) - determine whether its data types are more limited than those in the data model - determine if overriding label/icon for the slot
- */
- configure : function(slotConfig) {
- this._hidden = (slotConfig["hidden"]);
- var configDataTypes = slotConfig["dataTypes"];
- if (configDataTypes) {
- this._configDataTypes = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = configDataTypes, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var dataTypeObj = __exp_enFor0[__i_enFor0];
- var dataType = dataTypeObj;
- if (this._dataTypes.indexOf(dataType)> -1) {
- this._configDataTypes.push(dataType);
- }
- }
- }
- var cardinality = slotConfig["cardinality"];
- if (cardinality != null) {
- this._cardinality = cardinality;
- }
- var label = slotConfig["label"];
- if (label != null) {
- this._label = label;
- }
- var svgIcon = slotConfig["svgIcon"];
- if (svgIcon != null) {
- this._svgIcon = svgIcon;
- }
- var configTags = slotConfig["tags"];
- for (var i = 0; configTags && i < configTags.length; ++i) {
- var tag = configTags[i];
- if (this._tags.indexOf(tag) == -1) {
- this._tags.push(tag);
- }
- }
- return this;
- },
- /**
- * Set the message registry for displaying the meta data in the current locale.
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages - the MessagesRegistry
- */
- setMessages : function(messages) {
- this._messages = messages;
- },
- /** @expose */
- id : function() {
- return this._id;
- },
- /** @expose */
- label : function() {
- if (!this._messages) {
- return this._label;
- }
- return this._messages._nls(this._label, this._label);
- },
- /** @expose */
- description : function() {
- if (!this._messages) {
- return this._description;
- }
- return this._messages._nls(this._description, this._description);
- },
- /** @expose */
- tags : function() {
- if (!this._messages) {
- return this._tags;
- }
- var msgTags = [];
- for (var __i_enFor0 = 0, __exp_enFor0 = this._tags, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var tag = __exp_enFor0[__i_enFor0];
- msgTags.push(this._messages._nls(tag, tag));
- }
- return msgTags;
- },
- /** @expose */
- icon : function(type) {
- if ("image" == type) {
- return this._imageIcon;
- }
- return this._svgIcon;
- },
- /** @expose */
- cardinality : function() {
- return this._cardinality;
- },
- /** @expose */
- isMultiple : function() {
- return this._cardinality == "0..n" || this._cardinality == "1..n";
- },
- /** @expose */
- isRequired : function() {
- return this._cardinality == "1" || this._cardinality == "1..n";
- },
- /** @expose */
- dataTypes : function() {
- if (this._configDataTypes) {
- return this._configDataTypes;
- }
- return this._dataTypes;
- },
- /** @expose */
- isHidden : function() {
- return this._hidden;
- },
- /**
- * Check if a type-string is one allowed by the slot. If configuration has limited the types available, we use the more limited list.
- * @param (String) type Type string
- * @return (boolean) True if allowed
- */
- isValidType : function(type) {
- for (var __i_enFor0 = 0, __exp_enFor0 = this.dataTypes(), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var s = __exp_enFor0[__i_enFor0];
- if (s == type) {
- return true;
- }
- }
- return false;
- },
- /**
- * Perform a deep copy of this slot
- * @return (com.ibm.rave.library.datamodel.internal.DataSlotDescriptorImpl) A copy of this DataSlotDescriptorImpl
- */
- /** @expose */
- copy : function() {
- var slot = new com_ibm_rave_library_datamodel_internal_DataSlotDescriptorImpl(this._id, this._labelDefault, this._description, this._tags, this._imageIcon, this._svgIconDefault, this._cardinalityDefault, this._dataTypes);
- slot._messages = this._messages;
- slot._configDataTypes = null;
- slot._hidden = false;
- return slot;
- }
- });
- /**
- * Construct the data slot description from the JSON, which conforms to the schema for data slots. This code assumes that the JSON has been checked against that schema and is valid (all required fields present, no illegal types or enum values, etc.).
- * @param (Object) json Description of data slot
- */
- com_ibm_rave_library_datamodel_internal_DataSlotDescriptorImpl.create = function(json) {
- var id = (json["id"]);
- var label = (json["label"]);
- var description = (json["description"]);
- var tags = [];
- var t = json["tags"];
- if (t) {
- var l = t.length;
- for (var i = 0; i < l; ++i) {
- tags.push(""+(t[i]));
- }
- }
- var imageIcon, svgIcon;
- var icon = json["icon"];
- if (icon) {
- imageIcon = icon["image"];
- svgIcon = icon["svg"];
- }
- var cardinality = ""+(json["cardinality"]);
- if (!("0..1" == cardinality || "1" == cardinality || "0..n" == cardinality || "1..n" == cardinality)) {
- cardinality = "0..1";
- }
- var dataTypes = [];
- t = json["datatypes"];
- if (t) {
- var l = t.length;
- for (var i = 0; i < l; ++i) {
- var s = ""+(t[i]);
- if ("numeric" == s || "string" == s || "date" == s || "object" == s || "array" == s) {
- dataTypes.push(s);
- }
- }
- }
- return new com_ibm_rave_library_datamodel_internal_DataSlotDescriptorImpl(id, label, description, tags, imageIcon, svgIcon, cardinality, dataTypes);
- };
- // $source: com/ibm/rave/library/i18n/MessagesRegistry
- /************************************************************************
- ** 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/framework/Bundle (runtime) // Bundle
- //@import com/ibm/rave/library/i18n/Messages (static) // Messages
- /**
- * A registry of Messages files. Each Messages catalog is specific to a certain locale. Right now, this just delegates to a Map but may contain additional utilities in the future.
- */
- var com_ibm_rave_library_i18n_MessagesRegistry = rave_library_externs["MessagesRegistry"] = rave['internal']['Declare']({
- //_locale : null,
- //_currentMessages : null,
- //registry : null,
- constructor : function() {
- this._locale = com_ibm_rave_library_framework_Bundle.DEFAULT_LOCALE;
- this._currentMessages = com_ibm_rave_library_i18n_Messages.EMPTY_MESSAGES;
- this.registry = {};
- },
- /**
- * Add a new localized string catalog to the registry.
- * @param (String) locale String id of locale (ie "en-us").
- * @param (com.ibm.rave.library.i18n.Messages) catalog
- */
- /** @expose */
- add : function(locale, catalog) {
- this.registry[locale] = catalog;
- if (this._locale == locale) {
- this._currentMessages = catalog;
- }
- },
- /**
- * Set the current locale, provided there is a messages file for it, and return true. If there are no messages for this locale, nothing changes, and we return false.
- * @param (String) locale String id of locale (ie "en-us").
- * @return (boolean) true if we have messages for this locale loaded
- */
- locale$0 : function(locale) {
- var current = this.get(locale);
- if (current) {
- this._locale = locale;
- this._currentMessages = current;
- return true;
- }
- return false;
- },
- /**
- * @return (String) the current locale
- */
- locale$1 : function() {
- return this._locale;
- },
- /**
- * Get a localized Message catalog from the registry.
- * @param (String) locale String id of locale (ie "en") to retrieve.
- * @return (com.ibm.rave.library.i18n.Messages) Message Catalog for current locale.
- */
- /** @expose */
- get : function(locale) {
- return this.registry[locale];
- },
- /**
- * Get a localized Message catalog from catalog for the current locale.
- * @param (String) key The key to lookup in the catalog
- * @param (String) alt What to return if the key isn't found
- * @return (String) The localized message String
- */
- /** @expose */
- _nls : function(key, alt) {
- return this._currentMessages._nls(key, alt);
- },
- /** @expose */
- locale : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.locale$1();
- }
- return this.locale$0(a0);
- }
- });
- /** @expose */
- com_ibm_rave_library_i18n_MessagesRegistry.EmptyRegistry = function() {
- if (!com_ibm_rave_library_i18n_MessagesRegistry._emptyRegistry) {
- com_ibm_rave_library_i18n_MessagesRegistry._emptyRegistry = new com_ibm_rave_library_i18n_MessagesRegistry();
- com_ibm_rave_library_i18n_MessagesRegistry._emptyRegistry.add("en", com_ibm_rave_library_i18n_Messages.EMPTY_MESSAGES);
- }
- return com_ibm_rave_library_i18n_MessagesRegistry._emptyRegistry;
- };
- //com_ibm_rave_library_i18n_MessagesRegistry._emptyRegistry = null;
- // $source: com/ibm/rave/library/property/ObjectPropertyImpl
- /************************************************************************
- ** 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/property/PropertyImpl (loadtime) // superclass
- //@import com/ibm/rave/library/internal/nativeImpl/PropertyNativeUtils (runtime) // isJSONObject
- //@import com/ibm/rave/library/Library (runtime) // logError
- /**
- */
- var com_ibm_rave_library_property_ObjectPropertyImpl = rave_library_externs["ObjectPropertyImpl"] = rave['internal']['Declare'](com_ibm_rave_library_property_PropertyImpl, {
- //_childProperties : null,
- constructor : function(propertyType, parent) {
- this._childProperties = {};
- /**
- * @param (com.ibm.rave.library.property.PropertyObjectType) propertyType
- * @param (com.ibm.rave.library.property.PropertyImpl) parent
- */
- {
- this.buildValue();
- }
- },
- buildValue : function() {
- var defaultValue = this.meta().defaultValue();
- var valueInstance = this.value();
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(defaultValue), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- var def = defaultValue[propertyId];
- valueInstance[propertyId] = def;
- }
- },
- /** @expose */
- reset : function() {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this._childProperties), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- var childProperty = this._childProperties[propertyId];
- childProperty.reset();
- }
- return this.value();
- },
- /** @expose */
- value$1 : function(obj) {
- var result = true;
- var childPropertiesOriginalValues = {};
- if (obj == null) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(this._childProperties), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var propertyId = __exp_enFor0[__i_enFor0];
- var childProperty = this._childProperties[propertyId];
- childPropertiesOriginalValues[propertyId] = childProperty.value();
- if (!(childProperty.value(null))) {
- this.rollBackChildPropertiesValues(childPropertiesOriginalValues);
- result = false;
- }
- }
- return result;
- }
- if (!(com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils.isJSONObject(obj))) {
- com_ibm_rave_library_Library.logError(31, "Property validate");
- return false;
- }
- var val = obj;
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(val), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var propertyId = __exp_enFor1[__i_enFor1];
- var propVal = val[propertyId];
- var childProperty = this._childProperties[""+(propertyId)];
- if (!childProperty) {
- com_ibm_rave_library_Library.logError(32, "Property validate");
- this.rollBackChildPropertiesValues(childPropertiesOriginalValues);
- result = false;
- } else {
- childPropertiesOriginalValues[""+(propertyId)] = childProperty.value();
- if (!(childProperty.value(propVal))) {
- this.rollBackChildPropertiesValues(childPropertiesOriginalValues);
- result = false;
- }
- }
- }
- return result;
- },
- rollBackChildPropertiesValues : function(childPropertiesOriginalValues) {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(childPropertiesOriginalValues), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var childId = __exp_enFor0[__i_enFor0];
- var childProperty = this._childProperties[childId];
- childProperty.value(childPropertiesOriginalValues[childId]);
- }
- },
- /**
- * Gets a map of child properties the key of which is the simpleId of each child This map should be treated as read-only map and should not be modified
- * @return (Object) the child properties of this object property
- */
- /** @expose */
- childProperties : function() {
- return this._childProperties;
- }
- });
- // $source: com/ibm/rave/library/action/internal/ActionImpl
- /************************************************************************
- ** 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/action/Action (loadtime) // superclass
- //@import com/ibm/rave/library/action/ActionOperation (static)
- var com_ibm_rave_library_action_internal_ActionImpl = rave['internal']['Declare'](com_ibm_rave_library_action_Action, {
- //_meta : null,
- //_actionFunction : null,
- //_binding : null,
- //_unbinding : null,
- _autoBind : true,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- _$self._actionFunction.apply(_$self._actionFunction, args);
- }
- };
- return _$self;
- },
- constructor : function(meta) {
- this._actionFunction = com_ibm_rave_library_action_internal_ActionImpl.NO_OP_FUNCTION;
- this._binding = com_ibm_rave_library_action_internal_ActionImpl.NO_OP_BINDING_FUNCTION;
- this._unbinding = com_ibm_rave_library_action_internal_ActionImpl.NO_OP_BINDING_FUNCTION;
- /**
- * Construct instance with the metadata.
- * @param (com.ibm.rave.library.framework.meta.ActionMeta) meta Metadata
- */
- {
- this._meta = meta;
- }
- },
- /**
- * @return (com.ibm.rave.library.framework.meta.ActionMeta) Action metadata as passed to the constructor
- */
- meta : function() {
- return this._meta;
- },
- /**
- * Set a function to execute when this action is invoked. This is where the bundle author will implement their action logic.
- * @param (com.ibm.rave.library.action.ActionOperation) f An action function callback.
- */
- /** @expose */
- setOperation : function(f) {
- this._actionFunction = f ? f : com_ibm_rave_library_action_internal_ActionImpl.NO_OP_FUNCTION;
- return this;
- },
- setBindFn : function(f) {
- this._binding = f ? f : com_ibm_rave_library_action_internal_ActionImpl.NO_OP_BINDING_FUNCTION;
- return this;
- },
- setUnbindFn : function(f) {
- this._unbinding = f ? f : com_ibm_rave_library_action_internal_ActionImpl.NO_OP_BINDING_FUNCTION;
- return this;
- },
- autoBind$0 : function() {
- return this._autoBind;
- },
- autoBind$1 : function(bind) {
- this._autoBind = bind;
- if (!this._autoBind) {
- this._unbinding();
- }
- },
- getBinding : function() {
- return this._binding;
- },
- getUnBind : function() {
- return this._unbinding;
- },
- getOperation : function() {
- return this._actionFunction;
- },
- /**
- * @see ActionOperation#this.get(String) Delegates to the actionOperation's get method.
- */
- /** @expose */
- get : function(id) {
- return this._actionFunction.get(id);
- },
- /** @expose */
- autoBind : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.autoBind$0();
- }
- return this.autoBind$1(a0);
- }
- });
- com_ibm_rave_library_action_internal_ActionImpl.NO_OP_FUNCTION = new (rave['internal']['Declare']([com_ibm_rave_library_action_ActionOperation], {
- _$functionClassMethod : function() {
- var _$self = function(args) {};
- return _$self;
- },
- get : function(id) {
- return null;
- }
- }))();
- com_ibm_rave_library_action_internal_ActionImpl.NO_OP_BINDING_FUNCTION = function() {};
- // $source: com/ibm/rave/library/framework/internal/BundleContext
- /************************************************************************
- ** 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/property/PropertySet (runtime) // new
- //@import com/ibm/rave/library/action/internal/ActionsManager (runtime) // new
- //@import com/ibm/rave/library/framework/internal/ContextSize (runtime) // new
- //@import com/ibm/rave/library/framework/internal/CustomFormatInfoImpl (static) // new, makeForEntry
- //@import com/ibm/rave/library/framework/internal/CSSConverter (runtime) // convertCSSSizeToPixel
- //@import com/ibm/rave/library/framework/meta/internal/PropertyPresentationManager (runtime) // new
- /**
- * The BundleContext acts as the "Model" (in the MVC pattern) between the {@link (com.ibm.rave.library.framework.internal.AbstractController) AbstractController} and the {@link (com.ibm.rave.library.framework.internal.AbstractView) AbstractView} .
- */
- var com_ibm_rave_library_framework_internal_BundleContext = rave['internal']['Declare']({
- //_metadata : null,
- //_previewsMeta : null,
- //properties : null,
- //actions : null,
- //datamodels : null,
- //propertyPresentations : null,
- /**
- * Size (width, height) of the bundle context scene node at the time of the last call to {@link this.AbstractController#this.render()} .
- */
- //size : null,
- //node : null,
- //_customFormatters : null,
- //_messages : null,
- /**
- * Component pre-create callback
- */
- //_preExecuteCallback : null,
- /**
- * pre render callback
- */
- //_prerenderCallback : null,
- /**
- * Render callback
- */
- //_renderCallback : null,
- /**
- * post render callback
- */
- //_postrenderCallback : null,
- //_instanceId : null,
- constructor : function(instanceId, messages, dataModels, metaData, previews) {
- this.properties = new com_ibm_rave_library_property_PropertySet();
- this.actions = new com_ibm_rave_library_action_internal_ActionsManager();
- this.size = new com_ibm_rave_library_framework_internal_ContextSize();
- this.node = rave.selection();
- this._customFormatters = {};
- /**
- * Construct the context. The error reporter, which may be null, will be passed to the components that need to report errors.
- * @param (String) instanceId String id of this context
- * @param (com.ibm.rave.library.i18n.MessagesRegistry) messages Localized messages object associated with this context
- * @param (com.ibm.rave.library.datamodel.internal.BundleDataModels) dataModels Data models object
- * @param (com.ibm.rave.library.framework.meta.GenericMetadata) metaData Meta data object
- */
- {
- this._instanceId = instanceId;
- this._messages = messages;
- this._metadata = metaData;
- this._previewsMeta = previews;
- this.datamodels = dataModels;
- this.propertyPresentations = new com_ibm_rave_library_framework_meta_internal_PropertyPresentationManager(this._messages);
- }
- },
- /**
- * Get a data model by id. This is a utility method which calls datamodels.getInputDataModel(modelId).
- * @param (String) modelId The model ID; if null, the default model is used
- * @return (com.ibm.rave.library.datamodel.DataModel) A data model for that ID, usable to set data
- */
- getInputDataModel : function(modelId) {
- return this.datamodels.createDataModel(modelId);
- },
- /**
- * Get the current data model for this bundle. This is a utility method which calls datamodels.getDataModel.
- * @return (com.ibm.rave.library.datamodel.DataModel) The data model used for rendering
- */
- dataModel : function() {
- return this.datamodels.dataModel();
- },
- /**
- * Get the property value for the property with the given id, or null if the property does not exist. TODO. null may not be viable return value, or we may wish to leave properties undefined so that they do not override CSS values.
- * @return (Object) The value of the property
- */
- getPropertyValue : function(id) {
- var prop = this.properties.property(id);
- if (prop) {
- return prop.value();
- }
- return null;
- },
- /**
- * Get the property default value for the property with the given id, or null if the property does does not exist
- * @param target
- * @param formatter
- */
- getPropertyDefault : function(id) {
- var prop = this.properties.property(id);
- if (prop) {
- return prop.meta().defaultValue();
- }
- return null;
- },
- addCustomFormatter : function(target, formatter) {
- if (!formatter) {
- delete this._customFormatters[target];
- } else {
- this._customFormatters[target] = formatter;
- }
- },
- getCustomFormatters : function() {
- return this._customFormatters;
- },
- removeCustomFormatter : function(target) {
- if ("all" == target) {
- this._customFormatters = {};
- } else {
- delete this._customFormatters[target];
- }
- },
- /**
- * Search the list of targets for the first for which a custom formatter is defined. Return a value function that when called will invoke the custom formatter with the given info and flag. If none of the targets are defined, return the default function. This method can return null, if the default function is null.
- * @param (java.lang.String[]) targets Custom formatter targets (ALL, LEGEND, etc.)
- * @param (com.ibm.rave.library.framework.CustomFormatInfo) info The extra information passed to the custom formatter
- * @param (rave['internal']['ValueFunction']) defaultFunction Value when none of the targets are defined
- * @param (boolean) simplified This flag is passed down to the CustomFormatter and decides what the return value for its function will be. Axes use this method with the flag set to true, if they fail to fit a value on a vertical numeric axis. Integrators can implemented their CustomFormatter to provide different value when this flag is set see {@link this.CustomFormatter#this.getValue(Object, Object, , , com_ibm_rave_library_framework_CustomFormatInfo, )} .
- * @return (rave['internal']['ValueFunction']) Value function, either the first defined target or the default function
- */
- getCustomFormatterWithFlag : function(targets, info, defaultFunction, simplified) {
- for (var __i_enFor0 = 0, __len_enFor0 = targets.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var s = targets[__i_enFor0];
- var f = this._customFormatters[s];
- if (f) {
- return function(value, index, groupIndex) {
- return f.call(this, value, index, groupIndex, info, simplified);
- };
- }
- }
- return defaultFunction;
- },
- /**
- * Utility that builds a CustomFormatInfo for element labels with no special format (the common case) then calls {@link #this.getCustomFormatterWithFlag(, com_ibm_rave_library_framework_CustomFormatInfo, rave['internal']['ValueFunction'], )} with a null default function (also the common case).
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) entry The data slot entry used for the label
- * @return (rave['internal']['ValueFunction']) Value function, either the first defined target or the default function
- */
- getCustomFormatterForElementLabels$0 : function(entry) {
- return this.getCustomFormatterForElementLabels$1(entry, "ROLE_NONE");
- },
- /**
- * Utility that builds a CustomFormatInfo for element labels with no special format (the common case) then calls {@link #this.getCustomFormatterWithFlag(, com_ibm_rave_library_framework_CustomFormatInfo, rave['internal']['ValueFunction'], )} with a null default function (also the common case).
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) entry The data slot entry used for the label
- * @param (String) role Format info role
- * @return (rave['internal']['ValueFunction']) Value function, either the first defined target or the default function
- */
- getCustomFormatterForElementLabels$1 : function(entry, role) {
- return this.getCustomFormatterWithFlag(["label", "all"], com_ibm_rave_library_framework_internal_CustomFormatInfoImpl.makeForEntry("element-label", role, "none", entry), null, false);
- },
- /**
- * Retrieve internationalized text message for the key, if not found use alternative value
- * @param (String) key nls key
- * @param (String) alt alternative value, if the key is not present in the catalog
- * @return (String) internationalized text message
- */
- message : function(key, alt) {
- return this._messages._nls(key, alt);
- },
- instanceId : function() {
- return this._instanceId;
- },
- /**
- * Return the current locale set for this context.
- * @return (String) current locale code.
- */
- locale : function() {
- return this._messages.locale();
- },
- /**
- * Set the component pre-execute callback.
- * @param (com.ibm.rave.library.framework.ComponentCallback) callback The callback, may be null to disable callbacks
- */
- setPreExecute : function(callback) {
- this._preExecuteCallback = callback;
- },
- /**
- * @return (com.ibm.rave.library.framework.ComponentCallback) The bundle post-execute callback, may be null
- */
- getPreExecute : function() {
- return this._preExecuteCallback;
- },
- /**
- * Set the pre render callback.
- * @param (com.ibm.rave.library.framework.Controller.Callback) callback The callback, may be null to disable callbacks
- */
- setPrerenderCallback : function(callback) {
- this._prerenderCallback = callback;
- },
- /**
- * @return (com.ibm.rave.library.framework.Controller.Callback) The post render callback, may be null
- */
- getPrerenderCallback : function() {
- return this._prerenderCallback;
- },
- /**
- * Set the bundle render callback.
- * @param (rave['internal']['RunFunction']) callback The callback, may be null to disable callbacks
- */
- setRenderCallback : function(callback) {
- this._renderCallback = callback;
- },
- /**
- * @return (rave['internal']['RunFunction']) The render callback, may be null
- */
- getRenderCallback : function() {
- return this._renderCallback;
- },
- /**
- * Set the post render callback.
- * @param (com.ibm.rave.library.framework.Controller.Callback) callback The callback, may be null to disable callbacks
- */
- setPostrenderCallback : function(callback) {
- this._postrenderCallback = callback;
- },
- /**
- * @return (com.ibm.rave.library.framework.Controller.Callback) The post render callback, may be null
- */
- getPostrenderCallback : function() {
- return this._postrenderCallback;
- },
- /**
- * Convert a value representing a CSSSize to a string for the size with "px" units. For example, "0.5in" will become "48px". The number part is rounded to two digits. This method is included in the context because it will need to handle "%" size, which will depend on the context height and width. "%" is not handled yet, % values are treated as pixels. "em" depends on the font height, which is not available. It is treated as 10px.
- * @param (Object) value The value, may be null, number, or string
- * @return (String) Size as string ending with "px", or null
- */
- convertCSSSizeToPixels : function(value) {
- return com_ibm_rave_library_framework_internal_CSSConverter.convertCSSSizeToPixel(value, 100.0, 10.0);
- },
- /**
- * Retrieve a label for a given data slot, with a fallback property value. The provided property ID takes priority. If the property contains a non-empty string, the property value will be used as the label; otherwise the data slot entry label will be used. <br /> <br /> Note this method delegates to {@link #this.getDataSlotLabel(String, Array)} , by wrapping the entry parameter in an array.
- * @param (String) propertyId A property containing a string value that should take priority.
- * @param (com.ibm.rave.library.datamodel.DataSlotEntry) entry A data slot entry from which a label will be retrieved if the provided property does not contain a string.
- */
- getDataSlotLabel$0 : function(propertyId, entry) {
- return this.getDataSlotLabel$1(propertyId, [entry]);
- },
- /**
- * Retrieve a label for a given list of data slots, with a fallback property value. The provided property ID takes priority. If the property contains a non-empty string, the property value will be used as the label; otherwise the first data slot entry in the list with a non-null, non-empty label will be used.
- * @param (String) propertyId A property containing a string value that should take priority.
- * @param (Array) entries A list of data slot entries from which a label will be retrieved if the provided property does not contain a string.
- */
- getDataSlotLabel$1 : function(propertyId, entries) {
- var label = (this.getPropertyValue(propertyId));
- if (!((label)) && entries && entries.length > 0) {
- var entryLabel = null;
- var i = 0;
- while (entryLabel == null && i < entries.length) {
- var e = entries[i];
- if (e && (e.label$0())) {
- entryLabel = e.label$0();
- }
- i++;
- }
- label = entryLabel;
- }
- return label;
- },
- getCustomFormatterForElementLabels : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.getCustomFormatterForElementLabels$0(a0);
- }
- return this.getCustomFormatterForElementLabels$1(a0, a1);
- },
- getDataSlotLabel : function(a0, a1) {
- var args = arguments;
- if (args.length == 2 && typeof a1 === "function") {
- return this.getDataSlotLabel$0(a0, a1);
- }
- return this.getDataSlotLabel$1(a0, a1);
- }
- });
- /**
- * Create a CustomFormatInfoImpl for the given arguments. This is included so non-framework code doesn't have to access the internal CustomFormatInfoImpl constructor.
- * @param (String) type Format info type
- * @param (String) role Format info role
- * @param (String) format Format info format
- * @param (Array) entries List of entries
- */
- com_ibm_rave_library_framework_internal_BundleContext.makeCustomFormatInfo = function(type, role, format, entries) {
- return new com_ibm_rave_library_framework_internal_CustomFormatInfoImpl(type, role, format, entries);
- };
- // $source: com/ibm/rave/library/internal/nativeImpl/Module
- /************************************************************************
- ** IBM Confidential
- **
- ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
- **
- ** (C) Copyright IBM Corp. 2015, 2016
- **
- ** 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 ./ModuleHeader
- // @import com/ibm/rave/library/Library
- // @import com/ibm/rave/library/framework/internal/AbstractView
- // @import com/ibm/rave/library/framework/internal/BundleContext
- // @import com/ibm/rave/library/framework/internal/ScaleManager
- // @import com/ibm/rave/library/action/internal/OperationsUtil
- // @import com/ibm/rave/library/framework/internal/LinearCoordinateScale
- // @import com/ibm/rave/library/framework/internal/OrdinalCoordinateScale
- // @import com/ibm/rave/library/service/BundleService
- // @import com/ibm/rave/library/service/ErrorDispatcher
- // @import com/ibm/rave/library/service/LibraryError
- // @import com/ibm/rave/library/palette/internal/CategoricalPalette
- // @import com/ibm/rave/library/datamodel/internal/BundleDataModels
- // @import com/ibm/rave/library/framework/meta/internal/GenericMetadataImpl
- // @import com/ibm/rave/library/framework/internal/ContextSize
- // @import com/ibm/rave/library/property/PropertyProcessor
- // @import com/ibm/rave/library/datamodel/internal/DataModelDescriptorImpl
- // @import com/ibm/rave/library/datamodel/internal/DataModelImpl
- // @import com/ibm/rave/library/internal/nativeImpl/PropertyNativeUtils
- // @import com/ibm/rave/library/palette/internal/ContinuousPalette
- // @import com/ibm/rave/library/framework/internal/CSSConverter
- // @import com/ibm/rave/library/framework/internal/HierarchyUtility
- // @import com/ibm/rave/library/framework/internal/TimeCoordinateScale
- // @import com/ibm/rave/library/framework/internal/ClusteredCoordinateScale
- // @import com/ibm/rave/library/framework/internal/ClusteredCoordinateScale
- // @import com/ibm/rave/library/framework/internal/CSSConverter
- // @import com/ibm/rave/library/palette/internal/ConditionalPalette
- // @import com/ibm/rave/library/framework/CustomFormatter
- // @import com/ibm/rave/library/framework/meta/internal/PreviewsMetadataImpl
- // Expose library through rave entry point
- rave["library"] = com_ibm_rave_library_Library;
- rave["library"]["internal"] = rave_library_externs;
- rave["library"]["internal"]["AbstractView"]=com_ibm_rave_library_framework_internal_AbstractView;
- rave["library"]["internal"]["BundleContext"]=com_ibm_rave_library_framework_internal_BundleContext;
- rave["library"]["internal"]["ScaleManager"]=com_ibm_rave_library_framework_internal_ScaleManager;
- rave["library"]["internal"]["OperationsUtil"]=com_ibm_rave_library_action_internal_OperationsUtil;
- rave["library"]["internal"]["LinearCoordinateScale"]=com_ibm_rave_library_framework_internal_LinearCoordinateScale;
- rave["library"]["internal"]["OrdinalCoordinateScale"]=com_ibm_rave_library_framework_internal_OrdinalCoordinateScale;
- rave["library"]["internal"]["OrdinalCoordinateScaleDatum"]=com_ibm_rave_library_framework_internal_OrdinalCoordinateScaleDatum;
- rave["library"]["internal"]["TimeCoordinateScale"]=com_ibm_rave_library_framework_internal_TimeCoordinateScale;
- rave["library"]["internal"]["ClusteredCoordinateScale"]=com_ibm_rave_library_framework_internal_ClusteredCoordinateScale;
- rave["library"]["internal"]["BundleService"]=com_ibm_rave_library_service_BundleService;
- rave["library"]["internal"]["ErrorDispatcher"]=com_ibm_rave_library_service_ErrorDispatcher;
- rave["library"]["internal"]["LibraryError"]=com_ibm_rave_library_service_LibraryError;
- rave["library"]["internal"]["HierarchyUtility"]=com_ibm_rave_library_framework_internal_HierarchyUtility;
- rave["library"]["internal"]["HUFactory"]=com_ibm_rave_library_framework_internal_HierarchyUtility.HUFactory;
- rave["library"]["internal"]["HUResult"]=com_ibm_rave_library_framework_internal_HierarchyUtility.HUResult;
- //For Unit Tests
- rave["library"]["internal"]["CategoricalPalette"]=com_ibm_rave_library_palette_internal_CategoricalPalette;
- rave["library"]["internal"]["BundleDataModels"]=com_ibm_rave_library_datamodel_internal_BundleDataModels;
- rave["library"]["internal"]["GenericMetadataImpl"]=com_ibm_rave_library_framework_meta_internal_GenericMetadataImpl;
- rave["library"]["internal"]["ContextSize"]=com_ibm_rave_library_framework_internal_ContextSize;
- rave["library"]["internal"]["PropertyProcessor"]=com_ibm_rave_library_property_PropertyProcessor;
- rave["library"]["internal"]["DataModelDescriptorImpl"]=com_ibm_rave_library_datamodel_internal_DataModelDescriptorImpl;
- rave["library"]["internal"]["DataModelImpl"]=com_ibm_rave_library_datamodel_internal_DataModelImpl;
- rave["library"]["internal"]["PropertyNativeUtils"]=com_ibm_rave_library_internal_nativeImpl_PropertyNativeUtils;
- rave["library"]["internal"]["CSSConverter"]=com_ibm_rave_library_framework_internal_CSSConverter;
- rave["library"]["internal"]["ContinuousPalette"]=com_ibm_rave_library_palette_internal_ContinuousPalette;
- rave["library"]["internal"]["CustomFormatter"]=com_ibm_rave_library_framework_CustomFormatter;
- rave["library"]["internal"]["PreviewsMetadataImpl"]=com_ibm_rave_library_framework_meta_internal_PreviewsMetadataImpl;
- rave["library"]["internal"]["ConditionalPalette"]=com_ibm_rave_library_palette_internal_ConditionalPalette;
- rave["library"]["internal"]["CSSConverter"]=com_ibm_rave_library_framework_internal_CSSConverter;
- // $source: com/ibm/rave/library/action/BundleUtils
- /************************************************************************
- ** 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/action/internal/OperationsUtil (static) // highlight, unhighlight, select, deselectAll, deselect, panZoom, toggleSelection
- var com_ibm_rave_library_action_BundleUtils = rave_library_externs["BundleUtils"] = rave['internal']['Declare']({
- });
- /** @expose */
- com_ibm_rave_library_action_BundleUtils.setupDefaultActions = function(context, element, originalStyle) {
- var highlightAction = com_ibm_rave_library_action_BundleUtils.setupAction(context, element, "highlight", ["mouseenter.default"]);
- highlightAction.setOperation(com_ibm_rave_library_action_internal_OperationsUtil.highlight());
- var dehighlightAction = com_ibm_rave_library_action_BundleUtils.setupAction(context, element, "unhighlight", ["mouseout.default"]);
- dehighlightAction.setOperation(com_ibm_rave_library_action_internal_OperationsUtil.unhighlight(originalStyle));
- context.actions.action("select").setOperation(com_ibm_rave_library_action_internal_OperationsUtil.select());
- context.actions.action("deselect").setOperation(com_ibm_rave_library_action_internal_OperationsUtil.deselect());
- var deselectAllAction = context.actions.action("deselectAll");
- deselectAllAction.setOperation(com_ibm_rave_library_action_internal_OperationsUtil.deselectAll(originalStyle));
- var deselectAllEventListener = function(data, index, groupIndex, event) {
- deselectAllAction(context.node.selectAll(element));
- };
- deselectAllAction.setBindFn(com_ibm_rave_library_action_BundleUtils.bindOrUnbindActionFunctionCreater(context, ".background", ["click.default", "touchstart.default"], deselectAllEventListener));
- deselectAllAction.setUnbindFn(com_ibm_rave_library_action_BundleUtils.bindOrUnbindActionFunctionCreater(context, ".background", ["click.default", "touchstart.default"], null));
- var toggleSelectionAction = context.actions.action("toggleSelect").setOperation(com_ibm_rave_library_action_internal_OperationsUtil.toggleSelection(originalStyle));
- var toggleSelectionListener = function(data, index, groupIndex, event) {
- toggleSelectionAction(rave.select(this), context.node.selectAll(element));
- };
- toggleSelectionAction.setBindFn(com_ibm_rave_library_action_BundleUtils.bindOrUnbindActionFunctionCreater(context, element, ["click.default", "touchstart.default"], toggleSelectionListener));
- toggleSelectionAction.setUnbindFn(com_ibm_rave_library_action_BundleUtils.bindOrUnbindActionFunctionCreater(context, element, ["click.default", "touchstart.default"], null));
- com_ibm_rave_library_action_BundleUtils.setupZoomAction(context);
- };
- /**
- * Select the ".chart" shapes from the context (in the bundles this is the container for all chart shapes). Bind the "wheel.zoom", "dblclick.zoom", "mousedown.zoom", "mouseup.zoom", and "mousemove.zoom" actions to an 'OperationsUtil.panZoom(Zoom, ZoomContextFunction)' with a new Zoom (the Zoom will be available from the action's get() method).
- * @param (com.ibm.rave.library.framework.internal.BundleContext) context Bundle context
- */
- /** @expose */
- com_ibm_rave_library_action_BundleUtils.setupZoomAction = function(context) {
- var zoomAction = context.actions.action("zoom");
- if (zoomAction) {
- zoomAction.setBindFn(com_ibm_rave_library_action_BundleUtils.bindPanZoom(context, zoomAction, "zoom"));
- zoomAction.setUnbindFn(com_ibm_rave_library_action_BundleUtils.bindOrUnbindActionFunctionCreater(context, ".chart", ["wheel.zoom", "dblclick.zoom", "mousedown.zoom", "mouseup.zoom", "mousemove.zoom"], null));
- var fn = function() {
- return context.node.selectAll(".chart");
- };
- zoomAction.setOperation(com_ibm_rave_library_action_internal_OperationsUtil.panZoom(rave.behavior.zoom(), fn));
- }
- };
- com_ibm_rave_library_action_BundleUtils.setupAction = function(context, element, actionName, event) {
- var action = context.actions.action(actionName);
- if (action) {
- action.setBindFn(com_ibm_rave_library_action_BundleUtils.bindAction(context, element, action, event));
- action.setUnbindFn(com_ibm_rave_library_action_BundleUtils.bindOrUnbindActionFunctionCreater(context, element, event, null));
- }
- return action;
- };
- com_ibm_rave_library_action_BundleUtils.bindPanZoom = function(context, zoomAction, action) {
- return function() {
- context.node.selectAll(".chart").call(zoomAction.get(action));
- };
- };
- /** @expose */
- com_ibm_rave_library_action_BundleUtils.bindAction = function(context, element, action, events) {
- var listener = function(data, index, groupIndex, event) {
- action(rave.select(this));
- };
- return function() {
- for (var __i_enFor0 = 0, __len_enFor0 = events.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var event = events[__i_enFor0];
- context.node.selectAll(element).on(event, listener);
- }
- };
- };
- /**
- * setup a binding or unbinding action on one or more events
- * @param (com.ibm.rave.library.framework.internal.BundleContext) context the context
- * @param (String) element the element to select on the context
- * @param (java.lang.String[]) events the list of events that the actionListener should be invoked on
- * @param (rave['internal']['SelectorEventListener']) actionListener set actionListener to null if you want to setup an unbindfunction
- * @return (com.ibm.rave.library.action.BundleUtils.BindingOperation) returns a binding or unbinding function based on the value passed to the actionListener
- */
- /** @expose */
- com_ibm_rave_library_action_BundleUtils.bindOrUnbindActionFunctionCreater = function(context, element, events, actionListener) {
- return function() {
- for (var __i_enFor0 = 0, __len_enFor0 = events.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var event = events[__i_enFor0];
- context.node.selectAll(element).on(event, actionListener);
- }
- };
- };
- /** @expose */
- com_ibm_rave_library_action_BundleUtils.setupBreadcrumbDefaultActions = function(context, element) {
- var breadcrumbSelectAction = context.actions.action("breadcrumbSelect");
- breadcrumbSelectAction.setBindFn(function() {
- context.node.selectAll(element).on("click.default", function(data, index, groupIndex, event) {
- breadcrumbSelectAction(data);
- });
- });
- breadcrumbSelectAction.setUnbindFn(function() {
- context.node.selectAll(element).on("click.default", null);
- });
- };
- /**
- * Queries whether the node is part of the exit group
- */
- /** @expose */
- com_ibm_rave_library_action_BundleUtils.notExit = function(data, index, groupIndex) {
- if (this.rave_hasProperty("isExit")) {
- return false;
- }
- return true;
- };
- // $source: com/ibm/rave/library/property/CommonPropertyConstants
- /************************************************************************
- ** 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/framework/internal/CommonPropertyIDs (loadtime) // superclass
- /**
- * Catalog of common constants used by properties. The location of these constants may be temporary and some may need to be defined in their appropriate domains (e.g. data handling to Data model, palette ids in Palette). Also, the superclass catalog should probably be merged into this class, to keep all property related constants together
- */
- var com_ibm_rave_library_property_CommonPropertyConstants = rave_library_externs["CommonPropertyConstants"] = rave['internal']['Declare'](com_ibm_rave_library_framework_internal_CommonPropertyIDs, {
- });
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_MODEL_HIERACHY = "HierarchyData";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_MODEL_SIMPLE = "SimpleData";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DONUT_PLUS_RATIO = 0.6;
- /**
- * Used when setting the stroke color for highlighting and selection events
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INITIAL_COLOR = "_rave_initialColor";
- /**
- * The following represent options for data labels. Options are: "None", "Show", "Show as percentage"
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_LABEL_NONE = "None";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_LABEL_SHOW = "Show";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_LABEL_SHOW_AS_PERCENTAGE = "ShowAsPercentage";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_LABEL_VALUE = "Value";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_LABEL_PERCENT_BY_CATEGORY = "PercentOfCategory";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_LABEL_PERCENT_BY_COLOR = "PercentOfColor";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_HANDLING_NONE = "None";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_HANDLING_CLUSTERED = "Clustered";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_HANDLING_SIMPLE = "Simple";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_HANDLING_STACKED = "Stacked";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_HANDLING_STACKED100 = "Stacked100";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DATA_HANDLING_STREAM = "Stream";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.EFFECT_GROW = "grow";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.EFFECT_FROMBASE = "fromBase";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.EFFECT_GROW_FROMBASE = "growfromBase";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.EFFECT_TRANSITION = "transition";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.EFFECT_NONE = "none";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_CIRCLE = "circle";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_CROSS = "cross";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_DIAMOND = "diamond";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_SQUARE = "square";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_TRIANGLE_DOWN = "triangle-down";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_TRIANGLE_UP = "triangle-up";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_HORIZONTAL_RECTANGLE = "horizontal-rectangle";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_VERTICAL_RECTANGLE = "vertical-rectangle";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_TRIANGLE_LEFT = "triangle-left";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_TRIANGLE_RIGHT = "triangle-right";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_STAR = "star";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_DONUT = "donut";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_DONUT_THIN = "donut-thin";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SYMBOL_DONUT_PLUS = "donutPlus";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DONUT_PLUS = function(size) {
- var r = Math.sqrt(size / Math.PI);
- var circle = "M0," + r + "A" + r + "," + r + " 0 1,1 0," + (-r) + "A" + r + "," + r + " 0 1,1 0," + r + "Z";
- var r1 = Math.sqrt(size * 0.6 / Math.PI);
- var r2 = r1 * 0.7;
- var outer = "M0 0m-" + r1 + ",0a" + r1 + "," + r1 + ",0 1,0 " + (r1 * 2) + ",0a " + r1 + "," + r1 + " 0 1,0 -" + (r1 * 2) + ",0z";
- var inner = "M0 0m-" + r2 + ",0a" + r2 + "," + r2 + ",0 0,1 " + (r2 * 2) + ",0a " + r2 + "," + r2 + " 0 0,1 -" + (r2 * 2) + ",0z";
- return circle + outer + inner;
- };
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.DONUT_THIN = function(size) {
- var r1 = Math.sqrt(size / Math.PI);
- var r2 = r1 * 0.7;
- var outer = "M0 0m-" + r1 + ",0a" + r1 + "," + r1 + ",0 1,0 " + (r1 * 2) + ",0a " + r1 + "," + r1 + " 0 1,0 -" + (r1 * 2) + ",0z";
- var inner = "M0 0m-" + r2 + ",0a" + r2 + "," + r2 + ",0 0,1 " + (r2 * 2) + ",0a " + r2 + "," + r2 + " 0 0,1 -" + (r2 * 2) + ",0z";
- return outer + inner;
- };
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_SampleContinuous = "SampleContinuousPalette";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousFlow = "ContinuousFlow";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousClassic = "ContinuousClassic";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousContemporary = "ContinuousContemporary";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousActive = "ContinuousActive";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousCorporate = "ContinuousCorporate";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousDynamic = "ContinuousDynamic";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousExcel = "ContinuousExcel";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousExcel2007 = "ContinuousExcel2007";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousJazz = "ContinuousJazz";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousMetro = "ContinuousMetro";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousModern = "ContinuousModern";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.PALETTE_ID_ContinuousHeatMapFlow = "ContinuousHeatMapFlow";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.AXIS_LEFT = "left";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.AXIS_RIGHT = "right";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.AXIS_TOP = "top";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.AXIS_BOTTOM = "bottom";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ORIENTATION_VERTICAL = "vertical";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ORIENTATION_HORIZONTAL = "horizontal";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ZOOM_ALL = "all";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ZOOM_X = "x";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ZOOM_Y = "y";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ZOOM_X2 = "x2";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ZOOM_Y2 = "y2";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.ZOOM_NONE = "none";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SORT_NONE = "none";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SORT_ASCENDING = "ascending";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.SORT_DESCENDING = "descending";
- /**
- * line_points - show both line(s) and points line - show line(s) only points - show point(s) only
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LINE_AND_POINTS = "line_points";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LINE_ONLY = "line";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.POINTS_ONLY = "points";
- /**
- * linear - piecewise linear segments, as in a polyline. linear-closed - close the linear segments to form a polygon. step - alternate between horizontal and vertical segments, as in a step function. step-before - alternate between vertical and horizontal segments, as in a step function. step-after - alternate between horizontal and vertical segments, as in a step function. basis - a B-spline, with control point duplication on the ends. basis-open - an open B-spline; may not intersect the start or end. basis-closed - a closed B-spline, as in a loop. bundle - equivalent to basis, except the tension parameter is used to straighten the spline. cardinal - a Cardinal spline, with control point duplication on the ends. cardinal-open - an open Cardinal spline; may not intersect the start or end, but will intersect other control points. cardinal-closed - a closed Cardinal spline, as in a loop. monotone - cubic interpolation that preserves monotonicity in y.
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_LINEAR = "linear";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_STEP = "step";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_STEP_BEFORE = "step-before";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_STEP_AFTER = "step-after";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_BASIS = "basis";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_BASIS_OPEN = "basis-open";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_BASIS_CLOSED = "basis-closed";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_BUNDLE = "bundle";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_CARDINAL = "cardinal";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_CARDINAL_OPEN = "cardinal-open";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_CARDINAL_CLOSED = "cardinal-closed";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.INTERPOLATE_MONOTONE = "monotone";
- /**
- * The following represent legend positions. Possible positions are "top", "bottom", "right", and "left".
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LEGEND_POSITION_TOP = "top";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LEGEND_POSITION_BOTTOM = "bottom";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LEGEND_POSITION_RIGHT = "right";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LEGEND_POSITION_LEFT = "left";
- /**
- * The following represent options for text anchor positions for axis tick labels. Options are: "start", "middle", and "end".
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.TEXT_ANCHOR_START = "start";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.TEXT_ANCHOR_MIDDLE = "middle";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.TEXT_ANCHOR_END = "end";
- /**
- * The following represent options for vertical alignments for axis tick labels. Options are: "top", "middle", and "bottom".
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.VERTICAL_ALIGNMENT_TOP = "top";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.VERTICAL_ALIGNMENT_MIDDLE = "middle";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.VERTICAL_ALIGNMENT_END = "end";
- /**
- * The following represent options for the pattern of the connecting lines between bars in the Waterfall bundle. Options are: "solid" and "dashed".
- */
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LINE_PATTERN_SOLID = "solid";
- /** @expose */
- com_ibm_rave_library_property_CommonPropertyConstants.LINE_PATTERN_DASHED = "dashed";
- })();
- },{"./configuration/configuration.json":1}]},{},[2]);
- return rave.library;
- }));
|