1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755 |
- ;(function(root, factory) {
- if (typeof define === 'function' && define.amd) {
- define(['rave', 'rave-library', 'rave-utilities', 'rave-layouts', 'rave-legends'], factory);
- } else if (typeof exports === 'object') {
- module.exports = factory(require('rave'), require('rave-library'), require('rave-utilities'), require('rave-layouts'), require('rave-legends'));
- } else {
- root.raveLibraryBoxplot = factory(root.rave, root.raveLibrary, root.raveUtilities, root.raveLayouts, root.raveLegends);
- }
- }(this, function(rave, raveLibrary, raveUtilities, raveLayouts, raveLegends) {
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
- module.exports=[{"previews":{"image":[{"file":"resources\/preview_boxplot_small.png","tags":["small","notext"]}],"svg":[{"file":"resources\/preview_boxplot_small.svg","tags":["small","notext"]}]},"genericMeta":{"copyright":"IBM 2016","author":"IBM","description":"boxplot.description","id":"rave-library-boxplot","label":"boxplot.label","version":"1.0.0","tags":["boxplot"]}},{"datamodels":[{"description":"datamodel.tabular.boxplot.description","id":"tabular","label":"datamodel.tabular.label","datasets":[{"dataslots":[{"icon":{"image":"..\/rave-library\/resources\/x_axis_32.png","svg":"..\/rave-library\/resources\/x_axis_32.svg"},"description":"dataslot.x.boxplot.description","id":"x","label":"dataslot.x.label","cardinality":"1","datatypes":["string","numeric","date"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/y_axis_32.png","svg":"..\/rave-library\/resources\/y_axis_32.svg"},"description":"dataslot.y.boxplot.description","id":"y","label":"dataslot.y.label","cardinality":"1","datatypes":["numeric"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/color_by_32.png","svg":"..\/rave-library\/resources\/color_by_32.svg"},"description":"dataslot.color.description","id":"color","label":"dataslot.color.label","cardinality":"0..1","datatypes":["string"],"tags":[]},{"icon":{"image":"..\/rave-library\/resources\/primary_key_32.png","svg":"..\/rave-library\/resources\/primary_key_32.svg"},"description":"dataslot.key.description","id":"key","label":"dataslot.key.label","cardinality":"0..1","datatypes":["string","numeric"]}],"description":"dataset.tabular.description","id":"data","label":"dataset.tabular.label","type":"tabular","cardinality":"1","tags":["boxplot"]}],"tags":["boxplot"]}]},{"properties":{"boxplot":{"type":"object","properties":{"size":{"default":"10px","resetView":"layout","name":"boxplot.size.name","description":"boxplot.size.description","type":"length"},"median":{"type":"object","properties":{"style":{"type":"object","properties":{"stroke-width":{"default":null,"name":"boxplot.median.style.stroke-width.name","description":"boxplot.median.style.stroke-width.description","type":"length"},"stroke":{"default":null,"name":"boxplot.median.style.stroke.name","description":"boxplot.median.style.stroke.description","type":"color"}}}}},"mean":{"type":"object","properties":{"style":{"type":"object","properties":{"stroke-width":{"default":null,"name":"boxplot.mean.style.stroke-width.name","description":"boxplot.mean.style.stroke-width.description","type":"length"},"stroke":{"default":null,"name":"boxplot.mean.style.stroke.name","description":"boxplot.mean.style.stroke.description","type":"color"}}}}},"whisker":{"type":"object","properties":{"style":{"type":"object","properties":{"stroke-width":{"default":null,"name":"boxplot.whisker.style.stroke-width.name","description":"boxplot.whisker.style.stroke-width.description","type":"length"},"stroke":{"default":null,"name":"boxplot.whisker.style.stroke.name","description":"boxplot.whisker.style.stroke.description","type":"color"}}}}},"outlier":{"type":"object","properties":{"style":{"type":"object","properties":{"stroke-width":{"default":null,"name":"boxplot.outlier.style.stroke-width.name","description":"boxplot.outlier.style.stroke-width.description","type":"length"},"fill":{"default":null,"name":"boxplot.outlier.style.fill.name","description":"boxplot.outlier.style.fill.description","type":"color"},"stroke":{"default":null,"name":"boxplot.outlier.style.stroke.name","description":"boxplot.outlier.style.stroke.description","type":"color"}}}}},"applysize":{"trueLabel":"boxplot.applysize.trueLabel","default":false,"falseLabel":"boxplot.applysize.falseLabel","resetView":"layout","name":"boxplot.applysize.name","description":"boxplot.applysize.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-width":{"default":null,"name":"boxplot.style.stroke-width.name","description":"boxplot.style.stroke-width.description","type":"length"},"fill":{"default":null,"name":"boxplot.style.fill.name","description":"boxplot.style.fill.description","type":"color"},"stroke":{"default":null,"name":"boxplot.style.stroke.name","description":"boxplot.style.stroke.description","type":"color"}}},"extremum":{"type":"object","properties":{"style":{"type":"object","properties":{"stroke-width":{"default":null,"name":"boxplot.extremum.style.stroke-width.name","description":"boxplot.extremum.style.stroke-width.description","type":"length"},"fill":{"default":null,"name":"boxplot.extremum.style.fill.name","description":"boxplot.extremum.style.fill.description","type":"color"},"stroke":{"default":null,"name":"boxplot.extremum.style.stroke.name","description":"boxplot.extremum.style.stroke.description","type":"color"}}}}}}},"data":{"type":"object","properties":{"handling":{"default":"None","resetView":"data","name":"data.handling.name","options":[{"id":"data.handling.options.None","value":"None"},{"id":"data.handling.options.Clustered","value":"Clustered"}],"description":"data.handling.description","type":"string"}}},"color":{"type":"object","properties":{"null":{"default":"silver","name":"color.null.name","description":"color.null.description","type":"color"},"palette":{"name":"color.palette.name","options":["categorical"],"description":"color.palette.description","type":"palette"}}},"effect":{"type":"object","properties":{"duration":{"default":1000,"min":0,"name":"effect.duration.name","description":"effect.duration.description","type":"numeric"},"name":{"default":"none","name":"effect.name.name","options":[{"id":"effect.name.options.none","value":"none"},{"id":"effect.name.options.transition","value":"transition"},{"id":"effect.name.options.grow","value":"grow"}],"description":"effect.name.description","type":"string"}}},"zoom":{"default":"all","resetView":"zoom","name":"zoom.name","options":[{"id":"zoom.options.both","value":"all"},{"id":"zoom.options.x","value":"x"},{"id":"zoom.options.y","value":"y"},{"id":"zoom.options.none","value":"none"}],"description":"zoom.description","type":"string"}}},{"properties":{"axis":{"type":"object","properties":{"labels":{"type":"object","properties":{"truncationText":{"default":"...","name":"axis.labels.truncationText.name","description":"axis.labels.truncationText.description","type":"string"}}}}}}},{"properties":{"layout":{"type":"object","properties":{"axissize":{"type":"object","properties":{"left":{"type":"object","properties":{"min":{"default":"65","resetView":"layout","name":"layout.axissize.left.min.name","description":"layout.axissize.left.min.description","type":"length"},"max":{"default":"65","resetView":"layout","name":"layout.axissize.left.max.name","description":"layout.axissize.left.max.description","type":"length"},"preferred":{"default":"65","resetView":"layout","name":"layout.axissize.left.preferred.name","description":"layout.axissize.left.preferred.description","type":"length"}}}}}}}}},{"properties":{"layout":{"type":"object","properties":{"axissize":{"type":"object","properties":{"bottom":{"type":"object","properties":{"min":{"default":"55","resetView":"layout","name":"layout.axissize.bottom.min.name","description":"layout.axissize.bottom.min.description","type":"length"},"max":{"default":"55","resetView":"layout","name":"layout.axissize.bottom.max.name","description":"layout.axissize.bottom.max.description","type":"length"},"preferred":{"default":"55","resetView":"layout","name":"layout.axissize.bottom.preferred.name","description":"layout.axissize.bottom.preferred.description","type":"length"}}}}}}}}},{"properties":{"layout":{"type":"object","properties":{"padding":{"default":"10","resetView":"layout","name":"layout.padding.name","description":"layout.padding.description","type":"padding"},"legendsize":{"type":"object","properties":{"min":{"default":"0","resetView":"layout","name":"layout.legendsize.min.name","description":"layout.legendsize.min.description","type":"length"},"max":{"default":"20%","resetView":"layout","name":"layout.legendsize.max.name","description":"layout.legendsize.max.description","type":"length"},"preferred":{"default":"20%","resetView":"layout","name":"layout.legendsize.preferred.name","description":"layout.legendsize.preferred.description","type":"length"}}},"legendchart":{"type":"object","properties":{"gap":{"default":"10","resetView":"layout","name":"layout.legendchart.gap.name","description":"layout.legendchart.gap.description","type":"length"},"align":{"default":false,"resetView":"layout","name":"layout.legendchart.align.name","description":"layout.legendchart.align.description","type":"boolean"}}},"chart":{"type":"object","properties":{"padding":{"type":"object","properties":{"top":{"default":"0","resetView":"layout","name":"layout.chart.padding.top.name","description":"layout.chart.padding.top.description","type":"length"},"left":{"default":"0","resetView":"layout","name":"layout.chart.padding.left.name","description":"layout.chart.padding.left.description","type":"length"},"bottom":{"default":"0","resetView":"layout","name":"layout.chart.padding.bottom.name","description":"layout.chart.padding.bottom.description","type":"length"},"right":{"default":"0","resetView":"layout","name":"layout.chart.padding.right.name","description":"layout.chart.padding.right.description","type":"length"}}}}}}}}},{"properties":{"background":{"type":"object","properties":{"elements":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.elements.color.name","description":"background.elements.color.description","type":"color"}}},"chart":{"type":"object","properties":{"color":{"default":"#FFFFFF","name":"background.chart.color.name","description":"background.chart.color.description","type":"color"}}}}}}},{"properties":{"legend":{"type":"object","properties":{"display":{"trueLabel":"legend.display.trueLabel","default":true,"falseLabel":"legend.display.falseLabel","resetView":"layout","name":"legend.display.name","description":"legend.display.description","type":"boolean"},"entrystyle":{"type":"object","properties":{"font":{"name":"legend.entrystyle.font.name","description":"legend.entrystyle.font.description","type":"font"}}},"position":{"default":"right","resetView":"layout","name":"legend.position.name","options":[{"id":"legend.position.options.top","value":"top"},{"id":"legend.position.options.bottom","value":"bottom"},{"id":"legend.position.options.right","value":"right"},{"id":"legend.position.options.left","value":"left"}],"description":"legend.position.description","type":"string"},"title":{"default":"","resetView":"layout","name":"legend.title.name","description":"legend.title.description","type":"string"},"titlestyle":{"type":"object","properties":{"fontfamily":{"default":null,"name":"legend.titlestyle.fontfamily.name","description":"legend.titlestyle.fontfamily.description","type":"string"},"fontsize":{"default":null,"resetView":"layout","name":"legend.titlestyle.fontsize.name","description":"legend.titlestyle.fontsize.description","type":"string"},"fill":{"default":null,"name":"legend.titlestyle.fill.name","description":"legend.titlestyle.fill.description","type":"color"},"font":{"resetView":"layout","name":"legend.titlestyle.font.name","description":"legend.titlestyle.font.description","type":"font"}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.x.ticks.display.trueLabel","default":false,"falseLabel":"axis.x.ticks.display.falseLabel","name":"axis.x.ticks.display.name","description":"axis.x.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.ticks.style.stroke.name","description":"axis.x.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.x.line.display.trueLabel","default":false,"falseLabel":"axis.x.line.display.falseLabel","name":"axis.x.line.display.name","description":"axis.x.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.x.line.style.stroke.name","description":"axis.x.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.x.labels.display.trueLabel","default":true,"falseLabel":"axis.x.labels.display.falseLabel","resetView":"layout","name":"axis.x.labels.display.name","description":"axis.x.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.labels.style.font-size.name","description":"axis.x.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.labels.style.font-family.name","description":"axis.x.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.x.labels.style.fill.name","description":"axis.x.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.labels.style.font.name","description":"axis.x.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.x.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.x.labels.zoomPan.falseLabel","name":"axis.x.labels.zoomPan.name","description":"axis.x.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"labels":{"type":"object","properties":{"allowRotate90":{"trueLabel":"axis.x.labels.allowRotate90.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate90.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate90.name","description":"axis.x.labels.allowRotate90.description","type":"boolean"},"layoutMode":{"default":"automatic","resetView":"layout","name":"axis.x.labels.layoutMode.name","options":[{"id":"axis.x.labels.layoutMode.options.automatic","value":"automatic"},{"id":"axis.x.labels.layoutMode.options.horizontal","value":"horizontal"},{"id":"axis.x.labels.layoutMode.options.stagger","value":"stagger"},{"id":"axis.x.labels.layoutMode.options.rotate45","value":"rotate45"},{"id":"axis.x.labels.layoutMode.options.rotate90","value":"rotate90"}],"description":"axis.x.labels.layoutMode.description","type":"string"},"allowRotate45":{"trueLabel":"axis.x.labels.allowRotate45.trueLabel","default":true,"falseLabel":"axis.x.labels.allowRotate45.falseLabel","resetView":"layout","name":"axis.x.labels.allowRotate45.name","description":"axis.x.labels.allowRotate45.description","type":"boolean"},"allowStagger":{"trueLabel":"axis.x.labels.allowStagger.trueLabel","default":true,"falseLabel":"axis.x.labels.allowStagger.falseLabel","resetView":"layout","name":"axis.x.labels.allowStagger.name","description":"axis.x.labels.allowStagger.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.x.title.display.trueLabel","default":true,"falseLabel":"axis.x.title.display.falseLabel","resetView":"layout","name":"axis.x.title.display.name","description":"axis.x.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.x.title.style.font-size.name","description":"axis.x.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.x.title.style.font-family.name","description":"axis.x.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.x.title.style.fill.name","description":"axis.x.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.x.title.style.font.name","description":"axis.x.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.x.title.text.name","description":"axis.x.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.x.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.x.scale.includeZero.falseLabel","resetView":"layout","name":"axis.x.scale.includeZero.name","description":"axis.x.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.x.scale.nice.trueLabel","default":false,"falseLabel":"axis.x.scale.nice.falseLabel","resetView":"layout","name":"axis.x.scale.nice.name","description":"axis.x.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"x":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.x.gridlines.display.trueLabel","default":false,"falseLabel":"axis.x.gridlines.display.falseLabel","name":"axis.x.gridlines.display.name","description":"axis.x.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.x.gridlines.style.stroke-dasharray.name","description":"axis.x.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.x.gridlines.style.stroke.name","description":"axis.x.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"ticks":{"type":"object","properties":{"display":{"trueLabel":"axis.y.ticks.display.trueLabel","default":false,"falseLabel":"axis.y.ticks.display.falseLabel","name":"axis.y.ticks.display.name","description":"axis.y.ticks.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.ticks.style.stroke.name","description":"axis.y.ticks.style.stroke.description","type":"color"}}}}},"line":{"type":"object","properties":{"display":{"trueLabel":"axis.y.line.display.trueLabel","default":false,"falseLabel":"axis.y.line.display.falseLabel","name":"axis.y.line.display.name","description":"axis.y.line.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke":{"default":"#eeeeee","name":"axis.y.line.style.stroke.name","description":"axis.y.line.style.stroke.description","type":"color"}}}}},"labels":{"type":"object","properties":{"display":{"trueLabel":"axis.y.labels.display.trueLabel","default":true,"falseLabel":"axis.y.labels.display.falseLabel","resetView":"layout","name":"axis.y.labels.display.name","description":"axis.y.labels.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.labels.style.font-size.name","description":"axis.y.labels.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.labels.style.font-family.name","description":"axis.y.labels.style.font-family.description","type":"string"},"fill":{"default":"#3c4646","name":"axis.y.labels.style.fill.name","description":"axis.y.labels.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.labels.style.font.name","description":"axis.y.labels.style.font.description","type":"font"}}},"zoomPan":{"trueLabel":"axis.y.labels.zoomPan.trueLabel","default":false,"falseLabel":"axis.y.labels.zoomPan.falseLabel","name":"axis.y.labels.zoomPan.name","description":"axis.y.labels.zoomPan.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"title":{"type":"object","properties":{"display":{"trueLabel":"axis.y.title.display.trueLabel","default":true,"falseLabel":"axis.y.title.display.falseLabel","resetView":"layout","name":"axis.y.title.display.name","description":"axis.y.title.display.description","type":"boolean"},"style":{"type":"object","properties":{"font-size":{"default":null,"resetView":"layout","name":"axis.y.title.style.font-size.name","description":"axis.y.title.style.font-size.description","type":"string"},"font-family":{"default":null,"name":"axis.y.title.style.font-family.name","description":"axis.y.title.style.font-family.description","type":"string"},"fill":{"default":"#323c3c","name":"axis.y.title.style.fill.name","description":"axis.y.title.style.fill.description","type":"color"},"font":{"resetView":"layout","name":"axis.y.title.style.font.name","description":"axis.y.title.style.font.description","type":"font"}}},"text":{"default":"","resetView":"layout","name":"axis.y.title.text.name","description":"axis.y.title.text.description","type":"string"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"scale":{"type":"object","properties":{"includeZero":{"trueLabel":"axis.y.scale.includeZero.trueLabel","default":false,"falseLabel":"axis.y.scale.includeZero.falseLabel","resetView":"layout","name":"axis.y.scale.includeZero.name","description":"axis.y.scale.includeZero.description","type":"boolean"},"nice":{"trueLabel":"axis.y.scale.nice.trueLabel","default":false,"falseLabel":"axis.y.scale.nice.falseLabel","resetView":"layout","name":"axis.y.scale.nice.name","description":"axis.y.scale.nice.description","type":"boolean"}}}}}}}}},{"properties":{"axis":{"type":"object","properties":{"y":{"type":"object","properties":{"gridlines":{"type":"object","properties":{"display":{"trueLabel":"axis.y.gridlines.display.trueLabel","default":true,"falseLabel":"axis.y.gridlines.display.falseLabel","name":"axis.y.gridlines.display.name","description":"axis.y.gridlines.display.description","type":"boolean"},"style":{"type":"object","properties":{"stroke-dasharray":{"default":null,"name":"axis.y.gridlines.style.stroke-dasharray.name","description":"axis.y.gridlines.style.stroke-dasharray.description","type":"dasharray"},"stroke":{"default":"#dfe9e9","name":"axis.y.gridlines.style.stroke.name","description":"axis.y.gridlines.style.stroke.description","type":"color"}}}}}}}}}}},{"actions":[{"args":[],"icon":null,"options":[],"description":"actions.applyHighlight.description","binding":[{"event":"mouseover","target":".element-shape"}],"id":"highlight","label":"actions.applyHighlight.label","tags":[]},{"args":[],"icon":null,"options":[],"description":"actions.removeHighlight.description","binding":[{"event":"mouseout","target":".element-shape"}],"id":"unhighlight","label":"actions.removeHighlight.label","tags":[]},{"args":[],"icon":null,"options":[],"description":"actions.applySelection.description","binding":[{"event":"mouseover","target":".element-shape"}],"id":"select","label":"actions.applySelection.label","tags":[]},{"args":[],"icon":null,"options":[],"description":"actions.removeSelection.description","binding":[{"event":"mouseout","target":".element-shape"}],"id":"deselect","label":"actions.removeSelection.label","tags":[]},{"args":[],"icon":null,"options":[],"description":"actions.removeAllSelect.description","binding":[{"event":"click","target":".background"}],"id":"deselectAll","label":"actions.removeAllSelect.label","tags":[]},{"args":[],"icon":null,"options":[],"description":"actions.toggleSelect.description","binding":[{"event":"click","target":".element-shape"}],"id":"toggleSelect","label":"actions.toggleSelect.label","tags":[]},{"icon":null,"options":[],"description":"actions.zoom.description","binding":[],"id":"zoom","label":"actions.zoom.label","tags":[]}]},{"propertyPresentations":[{"presentationItems":[{"propertyID":"background.chart.color"},{"propertyID":"color.palette"},{"propertyID":"axis.x.title.text"},{"propertyID":"axis.y.title.text"},{"propertyID":"axis.x.title.display"},{"propertyID":"axis.y.title.display"},{"propertyID":"legend.display"},{"propertyID":"legend.position"},{"propertyID":"legend.title"}],"icon":"","description":"propertyPresentation.simple.description","id":"simple","label":"propertyPresentation.simple.label","tags":["Boxplot","Boxplot Properties Presentation","Simple","ca.dashboard"]},{"presentationItems":[{"propertyGroup":{"presentationItems":[{"propertyID":"background.chart.color"},{"propertyID":"background.elements.color"},{"propertyID":"color.palette"},{"propertyID":"layout.padding"}],"icon":"","description":"propertyPresentation.advanced.commonProperties.description","id":"commonProperties","label":"propertyPresentation.advanced.commonProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"boxplot.applysize"},{"propertyID":"boxplot.extremum.style.fill"},{"propertyID":"boxplot.extremum.style.stroke"},{"propertyID":"boxplot.extremum.style.stroke-width"},{"propertyID":"boxplot.mean.style.stroke"},{"propertyID":"boxplot.mean.style.stroke-width"},{"propertyID":"boxplot.outlier.style.fill"},{"propertyID":"boxplot.outlier.style.stroke"},{"propertyID":"boxplot.outlier.style.stroke-width"},{"propertyID":"boxplot.median.style.stroke"},{"propertyID":"boxplot.median.style.stroke-width"},{"propertyID":"boxplot.size"},{"propertyID":"boxplot.style.fill"},{"propertyID":"boxplot.style.stroke"},{"propertyID":"boxplot.style.stroke-width"},{"propertyID":"boxplot.whisker.style.stroke"},{"propertyID":"boxplot.whisker.style.stroke-width"},{"propertyID":"data.handling"}],"icon":"","description":"boxplot.propertyPresentation.advanced.boxplotSpecificProperties.description","id":"boxplotSpecificProperties","label":"boxplot.propertyPresentation.advanced.boxplotSpecificProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"axis.x.gridlines.display"},{"propertyID":"axis.x.gridlines.style.stroke"},{"propertyID":"axis.x.gridlines.style.stroke-dasharray"},{"propertyID":"axis.x.labels.display"},{"propertyID":"axis.x.labels.style.font"},{"propertyID":"axis.x.line.display"},{"propertyID":"axis.x.line.style.stroke"},{"propertyID":"axis.x.ticks.display"},{"propertyID":"axis.x.ticks.style.stroke"},{"propertyID":"axis.x.title.display"},{"propertyID":"axis.x.title.style.font"},{"propertyID":"axis.x.title.text"}],"icon":"","description":"propertyPresentation.advanced.xAxisProperties.description","id":"xAxisProperties","label":"propertyPresentation.advanced.xAxisProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"axis.y.gridlines.display"},{"propertyID":"axis.y.gridlines.style.stroke"},{"propertyID":"axis.y.gridlines.style.stroke-dasharray"},{"propertyID":"axis.y.labels.display"},{"propertyID":"axis.y.labels.style.font"},{"propertyID":"axis.y.line.display"},{"propertyID":"axis.y.line.style.stroke"},{"propertyID":"axis.y.ticks.display"},{"propertyID":"axis.y.ticks.style.stroke"},{"propertyID":"axis.y.title.display"},{"propertyID":"axis.y.title.style.font"},{"propertyID":"axis.y.title.text"}],"icon":"","description":"propertyPresentation.advanced.yAxisProperties.description","id":"yAxisProperties","label":"propertyPresentation.advanced.yAxisProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"legend.display"},{"propertyID":"legend.position"},{"propertyID":"layout.legendchart.gap"},{"propertyID":"layout.legendchart.align"},{"propertyID":"legend.title"},{"propertyID":"legend.titlestyle.font"},{"propertyID":"legend.entrystyle.font"}],"icon":"","description":"propertyPresentation.advanced.legendProperties.description","id":"legendProperties","label":"propertyPresentation.advanced.legendProperties.label","tags":[]}},{"propertyGroup":{"presentationItems":[{"propertyID":"effect.duration"},{"propertyID":"effect.name"}],"icon":"","description":"propertyPresentation.advanced.clientBehaviorProperties.description","id":"clientBehaviorProperties","label":"propertyPresentation.advanced.clientBehaviorProperties.label","tags":["ca.chart.definition.outputType=interactive"]}}],"icon":"","description":"propertyPresentation.advanced.description","id":"advanced","label":"propertyPresentation.advanced.label","tags":["Boxplot","Boxplot Properties Presentation","advanced","ca.reporting"]}]},{"configurations":[{"dataSlots":[{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"x","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","dataSlotId":"color","tags":["ca.chart.definition.categoryValues=indexedFull"]},{"dataTypes":["string"],"dataModelId":"tabular","dataSetId":"data","hidden":false,"dataSlotId":"key","cardinality":"1"}],"previews":{"image":[{"file":"resources\/boxplot_icon_48.png","tags":["small","nocolor"]},{"file":"resources\/boxplot_preview_320.png","tags":["medium","color"]},{"file":"resources\/boxplot_preview_500.png","tags":["large","nocolor"]}],"svg":[{"file":"resources\/boxplot_icon_48.svg","tags":["small","nocolor"]},{"file":"resources\/boxplot_preview_320.svg","tags":["medium","color"]},{"file":"resources\/boxplot_preview_500.svg","tags":["large","nocolor"]}]},"genericMeta":{"description":"boxplot.config.boxplot.description","id":"boxplot","label":"boxplot.config.boxplot.label","tags":["ca.reporting"]},"properties":[{"id":"effect.duration","value":500},{"id":"data.handling","value":"Clustered"},{"id":"background.chart.color","value":"transparent"},{"id":"background.elements.color","value":"transparent"},{"id":"layout.padding","value":"padding-top:10;padding-left:10;padding-bottom:10;padding-right:10"},{"id":"layout.axissize.bottom.min","value":"5"},{"id":"layout.axissize.bottom.preferred","value":"15%"},{"id":"layout.axissize.bottom.max","value":"200"},{"id":"layout.axissize.left.min","value":"5"},{"id":"layout.axissize.left.preferred","value":"15%"},{"id":"layout.axissize.left.max","value":"200"}]}]},{"build":"development","name":"rave-library-boxplot","description":"This is the IBM Rave boxplot bundle.","ignore":["bower.json"],"main":"bundle.js","version":"1.0.0","dependencies":{"rave-legends":"<2.0.0","rave-library":"<2.0.0","rave":"<3.0.0","rave-layouts":"<2.0.0","rave-utilities":"<2.0.0"}}]
- },{}],2:[function(require,module,exports){
- module.exports={
- "actions.applyHighlight.description": "Highlights a node.",
- "actions.applyHighlight.label": "Apply highlight action",
- "actions.applySelection.description": "Selects a node.",
- "actions.applySelection.label": "Apply selection action",
- "actions.args.attributes.description": "Optional map of attribute to value that is applied during the action.",
- "actions.args.attributes.label": "Optional attributes function argument",
- "actions.args.primaryAttributes.description": "Optional map of primary attributes that are applied during the action.",
- "actions.args.primaryAttributes.label": "Optional primary attributes function argument",
- "actions.args.primarySelector.description": "Primary selector for the nodes that the action is to apply to.",
- "actions.args.primarySelector.label": "Primary selector function argument",
- "actions.args.secondaryAttributes.description": "Optional map of secondary attributes that are applied during the action.",
- "actions.args.secondaryAttributes.label": "Optional secondary attributes function argument",
- "actions.args.secondarySelector.description": "Secondary selector for the nodes that the action is to apply to.",
- "actions.args.secondarySelector.label": "Secondary selector function argument",
- "actions.args.selector.description": "Selector of the node that the action will apply to.",
- "actions.args.selector.label": "Selector function argument",
- "actions.breadCrumb.description": "Navigates up and down in detail through a bread crumb.",
- "actions.breadCrumb.label": "Bread crumb navigation action",
- "actions.chord.selector.description": "Selector for the chords that the action will apply to.",
- "actions.chord.selector.label": "Selector function argument for chords",
- "actions.chord.toggleSelect.description": "Toggles selection on a chord.",
- "actions.chord.toggleSelect.label": "Toggle select on chord action",
- "actions.chordGroup.highlight.description": "Highlights a chord group and everything that is connected to it.",
- "actions.chordGroup.highlight.label": "Chord group highlight action",
- "actions.chordGroup.removeHighlight.description": "Removes highlights from a chord group and everything connected to it.",
- "actions.chordGroup.removeHighlight.label": "Chord group remove highlight action",
- "actions.chordGroup.selector.description": "Selector for the chord groups that the action will apply to.",
- "actions.chordGroup.selector.label": "Selector function argument for chord groups",
- "actions.drillDown.description": "Drills down to the next level of detail.",
- "actions.drillDown.label": "Drill down action",
- "actions.removeAllSelect.description": "Removes all selections from all nodes.",
- "actions.removeAllSelect.label": "Remove all selections action",
- "actions.removeHighlight.description": "Removes a highlight from a node.",
- "actions.removeHighlight.label": "Remove highlight action",
- "actions.removeSelection.description": "Removes a selection from a node.",
- "actions.removeSelection.label": "Remove selection action",
- "actions.toggleSelect.description": "Toggles the selection on a node.",
- "actions.toggleSelect.label": "Toggle selection action",
- "actions.zoom.args.panX.description": "The amount to pan in the x direction.",
- "actions.zoom.args.panX.label": "Zoom x pan amount function argument",
- "actions.zoom.args.panY.description": "The amount to pan in the y direction.",
- "actions.zoom.args.panY.label": "Zoom y pan amount function argument",
- "actions.zoom.args.scale.description": "The scale amount for the zoom action.",
- "actions.zoom.args.scale.label": "Zoom scale function argument",
- "actions.zoom.description": "Zoom action",
- "actions.zoom.label": "Zoom action",
- "actions.zoomPackedBubble.description": "Zoom for a packed bubble.",
- "actions.zoomPackedBubble.label": "Zoom packed bubble action",
- "axis.labels.truncationText.description": "The text that is placed at the end of labels to indicate truncation.",
- "axis.labels.truncationText.name": "Axis truncation text",
- "axis.x.gridlines.display.description": "Shows or hides the X-axis gridlines.",
- "axis.x.gridlines.display.falseLabel": "Hide",
- "axis.x.gridlines.display.name": "Show gridlines",
- "axis.x.gridlines.display.trueLabel": "Show",
- "axis.x.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the X-axis gridlines.",
- "axis.x.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
- "axis.x.gridlines.style.stroke.description": "The color of the X-axis gridline.",
- "axis.x.gridlines.style.stroke.name": "Gridline color",
- "axis.x.labels.allowRotate45.description": "Enables or disables the rotate45 option for labels automatic layout.",
- "axis.x.labels.allowRotate45.falseLabel": "Disable rotate45 option",
- "axis.x.labels.allowRotate45.name": "Allow rotate 45",
- "axis.x.labels.allowRotate45.trueLabel": "Enable rotate45 option",
- "axis.x.labels.allowRotate90.description": "Enables or disables the rotate90 option for labels automatic layout.",
- "axis.x.labels.allowRotate90.falseLabel": "Disable rotate90 option",
- "axis.x.labels.allowRotate90.name": "Allow rotate 90",
- "axis.x.labels.allowRotate90.trueLabel": "Enable rotate90 option",
- "axis.x.labels.allowStagger.description": "Allows the stagger option for labels automatic layout.",
- "axis.x.labels.allowStagger.falseLabel": "X-axis do not allow stagger",
- "axis.x.labels.allowStagger.name": "Allow stagger",
- "axis.x.labels.allowStagger.trueLabel": "X-axis allow stagger",
- "axis.x.labels.display.description": "Shows or hides the X-axis labels.",
- "axis.x.labels.display.falseLabel": "Hide",
- "axis.x.labels.display.name": "Show labels",
- "axis.x.labels.display.trueLabel": "Show",
- "axis.x.labels.layoutMode.description": "Configure the layout mode for the X-axis labels.",
- "axis.x.labels.layoutMode.name": "Layout Mode",
- "axis.x.labels.layoutMode.options.automatic": "Automatic",
- "axis.x.labels.layoutMode.options.horizontal": "Horizontal",
- "axis.x.labels.layoutMode.options.rotate45": "Rotated 45 degrees",
- "axis.x.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
- "axis.x.labels.layoutMode.options.stagger": "Stagger",
- "axis.x.labels.style.fill.description": "The color of X-axis labels.",
- "axis.x.labels.style.fill.name": "Label color",
- "axis.x.labels.style.font-family.description": "The font families of the X-axis labels.",
- "axis.x.labels.style.font-family.name": "Label font families",
- "axis.x.labels.style.font-size.description": "The size of X-axis labels (CSS size).",
- "axis.x.labels.style.font-size.name": "Label font size",
- "axis.x.labels.style.font.description": "The font properties of X-axis labels (CSS styles).",
- "axis.x.labels.style.font.name": "Label font",
- "axis.x.labels.zoomPan.description": "Shows or hides X-axis labels when panning and zooming.",
- "axis.x.labels.zoomPan.falseLabel": "Show",
- "axis.x.labels.zoomPan.name": "Label pan-zoom",
- "axis.x.labels.zoomPan.trueLabel": "Hide",
- "axis.x.line.display.description": "Shows or hides the X-axis line.",
- "axis.x.line.display.falseLabel": "Hide",
- "axis.x.line.display.name": "Show line",
- "axis.x.line.display.trueLabel": "Show",
- "axis.x.line.style.stroke.description": "The color of the X-axis line.",
- "axis.x.line.style.stroke.name": "Line color",
- "axis.x.scale.includeZero.description": "When set to Yes, includes 0 on the X-axis.",
- "axis.x.scale.includeZero.falseLabel": "Do not include",
- "axis.x.scale.includeZero.name": "Includes zero",
- "axis.x.scale.includeZero.trueLabel": "Include",
- "axis.x.scale.max.description": "The maximum value that appears on the X-axis.",
- "axis.x.scale.max.name": "Maximum value",
- "axis.x.scale.min.description": "The minimum value that appears on the X-axis.",
- "axis.x.scale.min.name": "Minimum value",
- "axis.x.scale.nice.description": "When set to Yes, uses nice endpoint values on the X-axis.",
- "axis.x.scale.nice.falseLabel": "Do not nice",
- "axis.x.scale.nice.name": "Nicing",
- "axis.x.scale.nice.trueLabel": "Apply nicing",
- "axis.x.ticks.display.description": "Shows or hides the X-axis tick marks.",
- "axis.x.ticks.display.falseLabel": "Hide",
- "axis.x.ticks.display.name": "Show ticks",
- "axis.x.ticks.display.trueLabel": "Show",
- "axis.x.ticks.style.stroke.description": "The color of the X-axis ticks.",
- "axis.x.ticks.style.stroke.name": "Tick color",
- "axis.x.title.display.description": "Shows or hides the X-axis title.",
- "axis.x.title.display.falseLabel": "Hide",
- "axis.x.title.display.name": "Show title",
- "axis.x.title.display.trueLabel": "Show",
- "axis.x.title.style.fill.description": "The color of the X-axis title.",
- "axis.x.title.style.fill.name": "Title color",
- "axis.x.title.style.font-family.description": "The font family names of the X-axis title.",
- "axis.x.title.style.font-family.name": "Title font families",
- "axis.x.title.style.font-size.description": "The X-axis title font size (CSS size).",
- "axis.x.title.style.font-size.name": "Title font size",
- "axis.x.title.style.font.description": "The X-axis title font properties (CSS style).",
- "axis.x.title.style.font.name": "Title font",
- "axis.x.title.text.description": "The title of the X-axis.",
- "axis.x.title.text.name": "Title",
- "axis.y.gridlines.display.description": "Shows or hides the Y-axis gridlines.",
- "axis.y.gridlines.display.falseLabel": "Hide",
- "axis.y.gridlines.display.name": "Show gridlines",
- "axis.y.gridlines.display.trueLabel": "Show",
- "axis.y.gridlines.style.stroke-dasharray.description": "The dash pattern that is applied to the Y-axis gridlines.",
- "axis.y.gridlines.style.stroke-dasharray.name": "Gridline dash pattern",
- "axis.y.gridlines.style.stroke.description": "The color of the Y-axis gridline.",
- "axis.y.gridlines.style.stroke.name": "Gridline color",
- "axis.y.labels.display.description": "Shows or hides the Y-axis labels.",
- "axis.y.labels.display.falseLabel": "Hide",
- "axis.y.labels.display.name": "Show labels",
- "axis.y.labels.display.trueLabel": "Show",
- "axis.y.labels.layoutMode.description": "Configure the layout mode for the Y-axis labels.",
- "axis.y.labels.layoutMode.name": "Layout Mode",
- "axis.y.labels.layoutMode.options.horizontal": "Horizontal",
- "axis.y.labels.layoutMode.options.rotate90": "Rotated 90 degrees",
- "axis.y.labels.style.fill.description": "The color of Y-axis labels.",
- "axis.y.labels.style.fill.name": "Label color",
- "axis.y.labels.style.font-family.description": "The font families of the Y-axis labels.",
- "axis.y.labels.style.font-family.name": "Label font families",
- "axis.y.labels.style.font-size.description": "The size of Y-axis labels (CSS size).",
- "axis.y.labels.style.font-size.name": "Label font size",
- "axis.y.labels.style.font.description": "The font properties of Y-axis labels (CSS styles).",
- "axis.y.labels.style.font.name": "Label font",
- "axis.y.labels.zoomPan.description": "Shows or hides Y-axis labels when panning and zooming.",
- "axis.y.labels.zoomPan.falseLabel": "Show",
- "axis.y.labels.zoomPan.name": "Label pan-zoom",
- "axis.y.labels.zoomPan.trueLabel": "Hide",
- "axis.y.line.display.description": "Shows or hides the Y-axis line.",
- "axis.y.line.display.falseLabel": "Hide",
- "axis.y.line.display.name": "Show line",
- "axis.y.line.display.trueLabel": "Show",
- "axis.y.line.style.stroke.description": "The color of the Y-axis line.",
- "axis.y.line.style.stroke.name": "Line color",
- "axis.y.scale.includeZero.description": "When set to Yes, includes 0 on the Y-axis.",
- "axis.y.scale.includeZero.falseLabel": "Do not include",
- "axis.y.scale.includeZero.name": "Includes zero",
- "axis.y.scale.includeZero.trueLabel": "Include",
- "axis.y.scale.max.description": "The maximum value that appears on the Y-axis.",
- "axis.y.scale.max.name": "Maximum value",
- "axis.y.scale.min.description": "The minimum value tha appears on the Y-axis.",
- "axis.y.scale.min.name": "Minimum value",
- "axis.y.scale.nice.description": "When set to Yes, uses nice endpoint values on the Y-axis.",
- "axis.y.scale.nice.falseLabel": "Do not nice",
- "axis.y.scale.nice.name": "Nicing",
- "axis.y.scale.nice.trueLabel": "Apply nicing",
- "axis.y.ticks.display.description": "Shows or hides the Y-axis tick marks.",
- "axis.y.ticks.display.falseLabel": "Hide",
- "axis.y.ticks.display.name": "Show ticks",
- "axis.y.ticks.display.trueLabel": "Show",
- "axis.y.ticks.style.stroke.description": "The color of the Y-axis ticks.",
- "axis.y.ticks.style.stroke.name": "Tick color",
- "axis.y.title.display.description": "Shows or hides the Y-axis title.",
- "axis.y.title.display.falseLabel": "Hide",
- "axis.y.title.display.name": "Show title",
- "axis.y.title.display.trueLabel": "Show",
- "axis.y.title.style.fill.description": "The color of the Y-axis title.",
- "axis.y.title.style.fill.name": "Title color",
- "axis.y.title.style.font-family.description": "The font family names of the Y-axis title.",
- "axis.y.title.style.font-family.name": "Title font families",
- "axis.y.title.style.font-size.description": "The size of the Y-axis title font (CSS size).",
- "axis.y.title.style.font-size.name": "Title font size",
- "axis.y.title.style.font.description": "The Y-axis title font properties (CSS styles).",
- "axis.y.title.style.font.name": "Title font",
- "axis.y.title.text.description": "The title of the Y-axis.",
- "axis.y.title.text.name": "Title",
- "background.chart.color.description": "The background color of the chart.",
- "background.chart.color.name": "Background color",
- "background.elements.color.description": "The background color behind the elements of the chart.",
- "background.elements.color.name": "Elements background color",
- "boxplot.applysize.description": "When set to Yes, the size of the box plots is controlled by ordinal data.",
- "boxplot.applysize.falseLabel": "Use column width",
- "boxplot.applysize.name": "Apply size to ordinal data",
- "boxplot.applysize.trueLabel": "Use size",
- "boxplot.config.boxplot.description": "Box plots show the statistical summary of a distribution of numbers, such as median values, upper and lower quartiles and outliers.",
- "boxplot.config.boxplot.label": "Box plot",
- "boxplot.description": "Box plots show the statistical summary of a distribution of numbers, such as median values, upper and lower quartiles and outliers.",
- "boxplot.extremum.style.fill.description": "The fill color that is applied to the box plot extreme outliers.",
- "boxplot.extremum.style.fill.name": "Extreme outlier fill color",
- "boxplot.extremum.style.stroke-width.description": "The width of the box plot extreme outliers.",
- "boxplot.extremum.style.stroke-width.name": "Extreme outlier width",
- "boxplot.extremum.style.stroke.description": "The color that is applied to the box plot extreme outliers.",
- "boxplot.extremum.style.stroke.name": "Extreme outlier color",
- "boxplot.label": "Box plot",
- "boxplot.mean.style.stroke-width.description": "The width of each box plot mean.",
- "boxplot.mean.style.stroke-width.name": "Mean stroke width",
- "boxplot.mean.style.stroke.description": "The color that is applied to each box plot mean.",
- "boxplot.mean.style.stroke.name": "Mean color",
- "boxplot.median.style.stroke-width.description": "The width of the box plot median strokes.",
- "boxplot.median.style.stroke-width.name": "Median stroke width",
- "boxplot.median.style.stroke.description": "The color that is applied to each box plot median.",
- "boxplot.median.style.stroke.name": "Median color",
- "boxplot.outlier.style.fill.description": "The fill color that is applied to the box plot outliers.",
- "boxplot.outlier.style.fill.name": "Outlier fill color",
- "boxplot.outlier.style.stroke-width.description": "The width of the box plot outliers.",
- "boxplot.outlier.style.stroke-width.name": "Outlier width",
- "boxplot.outlier.style.stroke.description": "The color that is applied to the box plot outliers.",
- "boxplot.outlier.style.stroke.name": "Outlier color",
- "boxplot.propertyPresentation.advanced.boxplotSpecificProperties.description": "Box plot-specific properties",
- "boxplot.propertyPresentation.advanced.boxplotSpecificProperties.label": "Box plot",
- "boxplot.size.description": "The width, in pixels, of box plots when continuous data is used.",
- "boxplot.size.name": "Size",
- "boxplot.style.fill.description": "The fill color that is applied to the box plots.",
- "boxplot.style.fill.name": "Fill color",
- "boxplot.style.stroke-width.description": "The width of the box plot strokes.",
- "boxplot.style.stroke-width.name": "Stroke width",
- "boxplot.style.stroke.description": "The color that is applied to the box plot strokes.",
- "boxplot.style.stroke.name": "Stroke color",
- "boxplot.whisker.style.stroke-width.description": "The width of the box plot whiskers.",
- "boxplot.whisker.style.stroke-width.name": "Whisker stroke width",
- "boxplot.whisker.style.stroke.description": "The color that is applied to the box plot whiskers.",
- "boxplot.whisker.style.stroke.name": "Whisker color",
- "color.null.description": "The color palette that controls the colors or patterns that are applied to null values.",
- "color.null.name": "Color palette null value",
- "color.palette.description": "The color palette that controls the colors or patterns that are applied to data elements in the chart.",
- "color.palette.name": "Color palette",
- "data.handling.description": "The configuration that is used to plot the data.",
- "data.handling.name": "Configuration",
- "data.handling.options.Clustered": "Clustered",
- "data.handling.options.None": "None",
- "datamodel.hierarchial.label": "Hierarchical data model",
- "datamodel.tabular.boxplot.description": "The tabular data model for the box plot.",
- "datamodel.tabular.label": "Tabular data model",
- "dataset.hierarchial.label": "Hierarchical data set",
- "dataset.tabular.description": "The tabular data set of rows and columns.",
- "dataset.tabular.label": "Tabular data set",
- "dataset.tabular.link.description": "Determines the links between the nodes.",
- "dataset.tabular.link.label": "Tabular links data set",
- "dataset.tabular.node.description": "The tabular data set that defines the nodes.",
- "dataset.tabular.node.label": "Tabular node data set",
- "dataslot.categories.label": "Categories",
- "dataslot.category.label": "Category",
- "dataslot.children.description": "When applied to a tree node, returns the children of that node as an array-list.",
- "dataslot.children.label": "Children",
- "dataslot.color.description": "Determines the color of the shape.",
- "dataslot.color.label": "Color",
- "dataslot.key.description": "Called for each row to match elements. Primarily used for transitions.",
- "dataslot.key.label": "Key",
- "dataslot.label.description": "Determines the label of the shape.",
- "dataslot.label.label": "Label",
- "dataslot.maximumValue.label": "Maximum value",
- "dataslot.source.label": "Source",
- "dataslot.sourceValue.label": "Source value",
- "dataslot.tabular.id.description": "The identifier for the nodes.",
- "dataslot.tabular.id.label": "Identifier",
- "dataslot.tabular.size.description": "Determines the size of the shape.",
- "dataslot.tabular.size.label": "Size",
- "dataslot.target.label": "Target",
- "dataslot.targetValue.label": "Target value",
- "dataslot.value.label": "Value",
- "dataslot.x.boxplot.description": "The x coordinate of the box plot. The value can be a number, string, or date.",
- "dataslot.x.label": "X axis",
- "dataslot.y.boxplot.description": "The y coordinate of the box plot. The value must be a number.",
- "dataslot.y.label": "Y axis",
- "defaultPalette.description": "Rave2 default description",
- "defaultPalette.label": "Rave2 default",
- "effect.duration.description": "The animation duration, in ms.",
- "effect.duration.name": "Animation duration (ms)",
- "effect.name.description": "The effect that is used when the chart is drawn.",
- "effect.name.name": "Animation",
- "effect.name.options.grow": "Grow",
- "effect.name.options.none": "None",
- "effect.name.options.transition": "Transition",
- "layout.axissize.bottom.max.description": "The maximum size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.max.name": "Bottom axis maximum size",
- "layout.axissize.bottom.min.description": "The minimum size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.min.name": "Bottom axis minimum size",
- "layout.axissize.bottom.preferred.description": "The preferred size of the bottom axis, as a CSS size or percentage.",
- "layout.axissize.bottom.preferred.name": "Bottom axis preferred size",
- "layout.axissize.left.max.description": "The maximum size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.max.name": "Left axis maximum size",
- "layout.axissize.left.min.description": "The minimum size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.min.name": "Left axis minimum size",
- "layout.axissize.left.preferred.description": "The preferred size of the left axis, as a CSS size or percentage.",
- "layout.axissize.left.preferred.name": "Left axis preferred size",
- "layout.axissize.right.max.description": "The maximum size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.max.name": "Right axis maximum size",
- "layout.axissize.right.min.description": "The minimum size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.min.name": "Right axis minimum size",
- "layout.axissize.right.preferred.description": "The preferred size of the right axis, as a CSS size or percentage.",
- "layout.axissize.right.preferred.name": "Right axis preferred size",
- "layout.axissize.top.max.description": "The maximum size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.max.name": "Top axis maximum size",
- "layout.axissize.top.min.description": "The minimum size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.min.name": "Top axis minimum size",
- "layout.axissize.top.preferred.description": "The preferred size of the top axis, as a CSS size or percentage.",
- "layout.axissize.top.preferred.name": "Top axis preferred size",
- "layout.chart.padding.bottom.description": "The bottom padding for the chart.",
- "layout.chart.padding.bottom.name": "Bottom padding",
- "layout.chart.padding.left.description": "The left padding for the chart.",
- "layout.chart.padding.left.name": "Left padding",
- "layout.chart.padding.right.description": "Right padding for the chart.",
- "layout.chart.padding.right.name": "Right padding",
- "layout.chart.padding.top.description": "The top padding for the chart.",
- "layout.chart.padding.top.name": "Top padding",
- "layout.legendchart.align.description": "Whether to align the legend to the interior of the chart.",
- "layout.legendchart.align.name": "Align legend to chart",
- "layout.legendchart.gap.description": "Space between the chart and the legend, as a CSS size or percentage.",
- "layout.legendchart.gap.name": "Space between legend and chart",
- "layout.legendsize.max.description": "The maximum size of the legend, as a CSS size or percentage.",
- "layout.legendsize.max.name": "Maximum size",
- "layout.legendsize.min.description": "The minimum size of the legend, as a CSS size or percentage.",
- "layout.legendsize.min.name": "Minimum size",
- "layout.legendsize.preferred.description": "The preferred size of the legend, as a CSS size or percentage.",
- "layout.legendsize.preferred.name": "Preferred size",
- "layout.padding.description": "The padding around the chart and legend.",
- "layout.padding.name": "Padding",
- "legend.display.description": "Shows or hides the legend.",
- "legend.display.falseLabel": "Hide",
- "legend.display.name": "Show legend",
- "legend.display.trueLabel": "Show",
- "legend.entrystyle.font.description": "The font properties of the legend entry.",
- "legend.entrystyle.font.name": "Entry font",
- "legend.position.description": "The position of the legend in the chart.",
- "legend.position.name": "Legend position",
- "legend.position.options.bottom": "Bottom",
- "legend.position.options.left": "Left",
- "legend.position.options.right": "Right",
- "legend.position.options.top": "Top",
- "legend.title.description": "The title of the legend.",
- "legend.title.name": "Title",
- "legend.titlestyle.fill.description": "The color of the legend title.",
- "legend.titlestyle.fill.name": "Title color",
- "legend.titlestyle.font.description": "The font properties of the legend title.",
- "legend.titlestyle.font.name": "Title font",
- "legend.titlestyle.fontfamily.description": "The font family of the legend title.",
- "legend.titlestyle.fontfamily.name": "Title font family",
- "legend.titlestyle.fontsize.description": "The font size of the legend title.",
- "legend.titlestyle.fontsize.name": "Title font size",
- "propertyPresentation.advanced.axisSizeProperties.description": "Axis size properties.",
- "propertyPresentation.advanced.axisSizeProperties.label": "Axis size",
- "propertyPresentation.advanced.clientBehaviorProperties.description": "Client side properties.",
- "propertyPresentation.advanced.clientBehaviorProperties.label": "Client behavior",
- "propertyPresentation.advanced.commonProperties.description": "Common properties.",
- "propertyPresentation.advanced.commonProperties.label": "Common",
- "propertyPresentation.advanced.description": "Advanced list of all properties in a grouped structure.",
- "propertyPresentation.advanced.label": "Advanced",
- "propertyPresentation.advanced.labelProperties.description": "Label properties",
- "propertyPresentation.advanced.labelProperties.label": "Label",
- "propertyPresentation.advanced.legendProperties.description": "Legend properties.",
- "propertyPresentation.advanced.legendProperties.label": "Legend",
- "propertyPresentation.advanced.xAxisProperties.description": "X-axis properties.",
- "propertyPresentation.advanced.xAxisProperties.label": "X-axis",
- "propertyPresentation.advanced.yAxisProperties.description": "Y-axis properties.",
- "propertyPresentation.advanced.yAxisProperties.label": "Y-axis",
- "propertyPresentation.simple.description": "Simple list of the most common properties.",
- "propertyPresentation.simple.label": "Simple",
- "rave2.colorpalette.blueContinuousSequential.description": "Blue continuous sequential description",
- "rave2.colorpalette.blueContinuousSequential.label": "Blue continuous sequential",
- "rave2.colorpalette.blueDiscreteSequential.description": "Blue discrete sequential description",
- "rave2.colorpalette.blueDiscreteSequential.label": "Blue discrete sequential",
- "rave2.colorpalette.blueGreenContinuousDivergent.description": "Blue green continuous divergent description",
- "rave2.colorpalette.blueGreenContinuousDivergent.label": "Blue green continuous divergent",
- "rave2.colorpalette.blueGreenDiscreteDivergent.description": "Blue green discrete divergent description",
- "rave2.colorpalette.blueGreenDiscreteDivergent.label": "Blue green discrete divergent",
- "rave2.colorpalette.dark.description": "Dark description",
- "rave2.colorpalette.dark.label": "Dark",
- "rave2.colorpalette.financial.description": "Financial description",
- "rave2.colorpalette.financial.label": "Financial",
- "rave2.colorpalette.greenContinuousSequential.description": "Green continuous sequential description",
- "rave2.colorpalette.greenContinuousSequential.label": "Green continuous sequential",
- "rave2.colorpalette.greenDiscreteSequential.description": "Green discrete sequential description",
- "rave2.colorpalette.greenDiscreteSequential.label": "Green discrete sequential",
- "rave2.colorpalette.light.description": "Light description",
- "rave2.colorpalette.light.label": "Light",
- "rave2.colorpalette.medical.description": "Medical description",
- "rave2.colorpalette.medical.label": "Medical",
- "rave2.colorpalette.orangeContinuousSequential.description": "Orange continuous sequential description",
- "rave2.colorpalette.orangeContinuousSequential.label": "Orange continuous sequential",
- "rave2.colorpalette.orangeDiscreteSequential.description": "Orange discrete sequential description",
- "rave2.colorpalette.orangeDiscreteSequential.label": " Orange discrete sequential",
- "rave2.colorpalette.purpleContinuousSequential.description": "Purple continuous sequential description",
- "rave2.colorpalette.purpleContinuousSequential.label": "Purple continuous sequential",
- "rave2.colorpalette.purpleDiscreteSequential.description": "Purple discrete sequential description",
- "rave2.colorpalette.purpleDiscreteSequential.label": "Purple discrete sequential",
- "rave2.colorpalette.redBlueContinuousDivergent.description": "Red blue continuous divergent description",
- "rave2.colorpalette.redBlueContinuousDivergent.label": "Red blue continuous divergent",
- "rave2.colorpalette.redBlueDiscreteDivergent.description": "Red blue discrete divergent description",
- "rave2.colorpalette.redBlueDiscreteDivergent.label": "Red blue discrete divergent",
- "rave2.colorpalette.redBlueInverseContinuousDivergent.description": "Red blue inverse continuous divergent description",
- "rave2.colorpalette.redBlueInverseContinuousDivergent.label": "Red blue inverse continuous divergent",
- "rave2.colorpalette.redBlueInverseDiscreteDivergent.description": "Red blue inverse discrete divergent description",
- "rave2.colorpalette.redBlueInverseDiscreteDivergent.label": "Red blue inverse discrete divergent",
- "rave2.colorpalette.redContinuousSequential.description": "Red continuous sequential description",
- "rave2.colorpalette.redContinuousSequential.label": "Red continuous sequential",
- "rave2.colorpalette.redDiscreteSequential.description": "Red discrete sequential description",
- "rave2.colorpalette.redDiscreteSequential.label": " Red discrete sequential",
- "rave2.colorpalette.redGreenContinuousDivergent.description": "Red green continuous divergent description",
- "rave2.colorpalette.redGreenContinuousDivergent.label": "Red green continuous divergent",
- "rave2.colorpalette.redGreenDiscreteDivergent.description": "Red green discrete divergent description",
- "rave2.colorpalette.redGreenDiscreteDivergent.label": "Red green discrete divergent",
- "rave2.colorpalette.redGreenInverseContinuousDivergent.description": "Red green inverse continuous divergent description",
- "rave2.colorpalette.redGreenInverseContinuousDivergent.label": "Red green inverse continuous divergent",
- "rave2.colorpalette.redGreenInverseDiscreteDivergent.description": "Red green inverse discrete divergent description",
- "rave2.colorpalette.redGreenInverseDiscreteDivergent.label": "Red green inverse discrete divergent",
- "rave2.colorpalette.tealContinuousSequential.description": "Teal continuous sequential description",
- "rave2.colorpalette.tealContinuousSequential.label": "Teal continuous sequential",
- "rave2.colorpalette.tealDiscreteSequential.description": "Teal discrete sequential description",
- "rave2.colorpalette.tealDiscreteSequential.label": "Teal discrete sequential",
- "rave2.colorpalette.tealPurpleContinuousDivergent.description": "Teal purple continuous divergent description",
- "rave2.colorpalette.tealPurpleContinuousDivergent.label": "Teal purple continuous divergent",
- "rave2.colorpalette.tealPurpleDiscreteDivergent.description": "Teal purple discrete divergent description",
- "rave2.colorpalette.tealPurpleDiscreteDivergent.label": "Teal purple discrete divergent",
- "rave2.colorpalette.violetContinuousSequential.description": "Violet continuous sequential description",
- "rave2.colorpalette.violetContinuousSequential.label": "Violet continuous sequential",
- "rave2.colorpalette.violetDiscreteSequential.description": "Violet discrete sequential description",
- "rave2.colorpalette.violetDiscreteSequential.label": "Violet discrete sequential",
- "rave2.colorpalette.yellowContinuousSequential.description": "Yellow continuous sequential description",
- "rave2.colorpalette.yellowContinuousSequential.label": "Yellow continuous sequential",
- "rave2.colorpalette.yellowDiscreteSequential.description": "Yellow discrete sequential description",
- "rave2.colorpalette.yellowDiscreteSequential.label": "Yellow discrete sequential",
- "zoom.description": "Zooms the chart in the X, Y, or both directions.",
- "zoom.name": "Zoom",
- "zoom.options.both": "Both",
- "zoom.options.none": "None",
- "zoom.options.x": "X",
- "zoom.options.y": "Y"
- }
- },{}],3:[function(require,module,exports){
- (function() {
- var $ = {};
- var com_ibm_rave_library_Library = rave["library"];
- rave["internal"]["Declare"] = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"];
- rave["internal"]["CSSUtil"]= rave["_"]["com_ibm_rave_core_internal_css_CSSUtil"];
- var com_ibm_rave_bundles_RaveBundle = rave['internal']['Declare'](rave['library']['internal']['Bundle'], {
-
- loader : null,
-
- constructor : function() {
- ;
- ;
- ;
- ;
- ;
- ;
- this.loader = new com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader("/com/ibm/rave/bundles/" + this.getName());
- },
-
-
- loadResources : function() {
- this.setMessageCatalog(rave['library']['internal']['Bundle'].DEFAULT_LOCALE, require("./i18n/messages_en.json"));
- var array = require("./configuration/configuration.json");
- if (array) {
- for (var __i_enFor0 = 0, __exp_enFor0 = array, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var artifact = __exp_enFor0[__i_enFor0];
- this.initialize(artifact);
- }
- }
- require("./vizlibrary.css");
- }
- });
- var com_ibm_rave_bundles_internal_nativeImpl_RaveBundleResourceLoader = function(){};
- var com_ibm_rave_bundles_views_BundleView = rave['internal']['Declare'](rave['library']['internal']['AbstractView'], {
-
-
- _backgroundComponent : null,
-
-
- _layoutComponent : null,
-
-
- _clip : null,
-
-
- _axes : null,
-
-
- _legends : null,
-
-
- _chart : null,
-
- dataModel : null,
-
- _zoomP : null,
-
- _zoomS : null,
-
- constructor : function(context) {
- },
-
- getGroupStructure : function() {},
-
- setup : function() {
- rave['library']['internal']['AbstractView'].prototype.setup.call(this);
- this._backgroundComponent = new com_ibm_rave_bundles_components_BackgroundComponentImpl();
- this._layoutComponent = new com_ibm_rave_bundles_components_ChartLayoutComponentImpl();
- this._clip = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this.context.instanceId() + "clipViewport");
- if (this.isZoomSupported()) {
- this.resetZoom();
- }
- this._legends = new com_ibm_rave_bundles_components_LegendsManager(this.context, this.getLegendCount());
- if (this.isAxesManagerRequired()) {
- this._axes = new com_ibm_rave_bundles_components_AxesManager(this.context);
- }
- this._groupStructure = this.getGroupStructure();
- },
-
- preDraw : function(chartId) {
- this.cancelTransitions();
- rave['library']['internal']['AbstractView'].createGroupStructure(this.context.node, this._groupStructure);
- this._chart = this.context.node.selectAll(chartId);
- },
-
- resetZoom : function() {
- this._zoomP = [0, 0, 0, 0];
- this._zoomS = [1, 1, 1, 1];
- },
-
- validateDataModel : function(elementsToRemove) {
- if (elementsToRemove !== null || arguments.length > 1){
- elementsToRemove = Array.prototype.slice.call(arguments);
- }
- {
- this.dataModel = this.context.dataModel();
- if (!(this.dataValid())) {
- for (var __i_enFor0 = 0, __len_enFor0 = elementsToRemove.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var e = elementsToRemove[__i_enFor0];
- this._chart.selectAll(e).selectAll("*").remove();
- }
- this._legends.visible(false).draw();
- return false;
- }
- return true;
- }
- },
-
- dataValid : function() {
- return this.dataModel.validate();
- },
-
- getLegendCount : function() {
- return 1;
- },
-
- isAxesManagerRequired : function() {
- return false;
- },
-
- isZoomSupported : function() {
- return true;
- },
-
- getProperty : function(s) {
- return this.context.getPropertyValue(s);
- },
-
- getPropertyDefault : function(s) {
- return this.context.getPropertyDefault(s);
- },
-
- getBooleanProperty : function(s) {
- var obj = this.getProperty(s);
- return (obj);
- },
-
- getDoubleProperty : function(s) {
- var obj = this.getProperty(s);
- return + (obj);
- },
-
- getIntProperty : function(s) {
- var obj = this.getProperty(s);
- return ~~ (obj);
- },
-
-
- getStringProperty : function(id) {
- var obj = this.getProperty(id);
- return (obj == null) ? null : ""+(obj);
- },
-
-
- getStringPropertyEmptyAsNull : function(id) {
- var s = this.getStringProperty(id);
- return (s == null || s.length == 0) ? null : s;
- },
-
-
- getCSSSizeToPixelNumber : function(id) {
- var cssSize = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.context.getPropertyValue(id), 100.0, 10.0);
- return (cssSize == null) ? 0.0 : cssSize;
- },
-
-
- getEffectDuration : function(effect) {
- var duration = this.getIntProperty("effect.duration");
- if ((duration < 0) || (effect == null) || "none" == effect) {
- duration = 0;
- }
- return duration;
- },
-
- getTopPadding : function() {
- return this.getProperty("layout.chart.padding.top");
- },
-
- getLeftPadding : function() {
- return this.getProperty("layout.chart.padding.left");
- },
-
- getBottomPadding : function() {
- return this.getProperty("layout.chart.padding.bottom");
- },
-
- getRightPadding : function() {
- return this.getProperty("layout.chart.padding.right");
- },
-
- getLayoutPadding : function() {
- return this.getProperty("layout.padding");
- },
-
- getLegendChartGap : function() {
- return this.getProperty("layout.legendchart.gap");
- },
-
- getLegendChartAlign : function() {
- return this.getBooleanProperty("layout.legendchart.align");
- },
-
- getLegendPosition : function() {
- return this.getStringProperty("legend.position");
- },
- getPalette$0 : function() {
- return this.getPalette$1("color.palette");
- },
- getPalette$1 : function(paletteID) {
- var id = this.getStringProperty(paletteID);
- var colorPalette = com_ibm_rave_library_Library.palettes.getPalette(id);
- return (!colorPalette) ? com_ibm_rave_library_Library.palettes.getDefaultPalette() : colorPalette;
- },
- getDynamicPalette$0 : function() {
- return this.getDynamicPalette$1("color.palette", "color.dynamicPalette.min", "color.dynamicPalette.mid", "color.dynamicPalette.max");
- },
-
- getDynamicPalette$1 : function(paletteID, minId, midId, maxId) {
- var colorPalette;
- var min = this.getStringProperty(minId);
- if (min != null) {
- var mid = this.getStringProperty(midId);
- if (mid != null) {
- var max = this.getStringProperty(maxId);
- if (max != null) {
- var fills = [min, mid, max];
- colorPalette = rave['library']['internal']['AbstractView'].getFillPalette(fills);
- }
- }
- }
- return (!colorPalette) ? this.getPalette(paletteID) : colorPalette;
- },
-
- prepareLayoutComponent : function() {
- this._layoutComponent.setPreExecute(this.context.getPreExecute()).overall(new rave['internal']['RectStruct'](0, 0, this.context.size.w, this.context.size.h)).legendPosition(this.getLegendPosition()).padding(this.getLayoutPadding()).chartPadding(this.getTopPadding(), this.getLeftPadding(), this.getBottomPadding(), this.getRightPadding()).legendChartGap(this.getLegendChartGap()).legendChartAlign(this.getLegendChartAlign());
- },
-
- prepareLayoutSizables : function(layoutComponent, useX2, useY1, useX1, useY2, useLegend) {
- layoutComponent.removeAxisSizables();
- if (useX1) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(0));
- }
- if (useY1) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(2));
- }
- if (useX2) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(1));
- }
- if (useY2) {
- layoutComponent.addAxisSizable(this._axes.axisComponent(3));
- }
- layoutComponent.legendSize(useLegend ? this._legends : null);
- },
-
- resetUpdate : function() {
- this.updateType = 4;
- },
-
- isUpdateNothing : function() {
- return this.updateType == 4;
- },
-
- isShowLegend : function() {
- return this.getBooleanProperty("legend.display");
- },
- cancelTransitions : function() {
- this.context.node.selectAll("*").interrupt();
- },
-
- setBackgroundProperties : function(elementRect, duration) {
- this._backgroundComponent.setPreExecute(this.context.getPreExecute()).size(this.context.size).backgroundColor(this.getStringProperty("background.chart.color"));
- this.context.node.selectAll("rect.background.chart").transition().duration(duration).call(this._backgroundComponent);
- this._backgroundComponent.setPreExecute(this.context.getPreExecute()).rect(elementRect).backgroundColor(this.getStringProperty("background.elements.color"));
- this.context.node.selectAll("rect.background.elements").transition().duration(duration).call(this._backgroundComponent);
- },
-
- isShowDataLabels : function() {
- return this.getBooleanProperty("data.label.display");
- },
-
- isShowDataLabelsAsPercentageOfColor : function() {
- var dataLabel = this.getStringProperty("data.label.type");
- return "PercentOfColor" == dataLabel;
- },
-
- isShowDataLabelsAsPercentageOfCategory : function() {
- var dataLabel = this.getStringProperty("data.label.type");
- return "PercentOfCategory" == dataLabel;
- },
-
- getlDataLabelAccessor : function(dataSet, slot, isInterval) {
- var labelAccessor;
- var labelEntry = dataSet.slot(slot).entry();
- if (!labelEntry) {
- if (this.isShowDataLabelsAsPercentageOfCategory()) {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR;
- } else if (this.isShowDataLabelsAsPercentageOfColor()) {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR;
- } else {
- labelAccessor = isInterval ? com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR : com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR;
- }
- } else {
- labelAccessor = rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(labelEntry));
- }
- return labelAccessor;
- },
-
- getEntryForDataLabelFormatter : function(dataSet, labelSlot, defaultSlot) {
- var labelEntry = dataSet.slot(labelSlot).entry();
- return labelEntry ? labelEntry : dataSet.slot(defaultSlot).entry();
- },
-
- getBackgroundConstrastLabelStyle : function() {
- var labelFontStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(this.getStringProperty("labelstyle.font"));
- if (this.getBooleanProperty("contrast.label.color") == false) {
- return labelFontStyle;
- }
- var defaultFillColor;
- if (labelFontStyle) {
- defaultFillColor = labelFontStyle["fill"];
- if (defaultFillColor == null) {
- defaultFillColor = labelFontStyle["color"];
- }
- } else {
- labelFontStyle = {};
- }
- if (defaultFillColor == null) {
- defaultFillColor = "#000000";
- }
- labelFontStyle["fill"] = com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor(this.getStringProperty("background.elements.color"), defaultFillColor);
- return labelFontStyle;
- },
-
- getPalette : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.getPalette$0();
- }
- if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
- return this.getPalette$1(a0);
- }
- return rave['library']['internal']['AbstractView'].prototype.getPalette.apply(this, args);
- },
-
- getDynamicPalette : function(a0, a1, a2, a3) {
- var args = arguments;
- if (args.length == 0) {
- return this.getDynamicPalette$0();
- }
- return this.getDynamicPalette$1(a0, a1, a2, a3);
- }
- });
- var com_ibm_rave_bundles_components_BundleComponentImpl = rave['internal']['Declare']({
-
-
-
-
- _renderCallback : null,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var self = _$self;
- this.each(function(data, index, groupIndex) {
- self.execute(rave.select(this));
- });
- return null;
- }
- };
- return _$self;
- },
-
-
- execute : function(g) {},
-
-
- setPreExecute : function(callback) {
- this._preExecuteCallback = callback;
- return this;
- },
-
-
- preExecute : function() {
- if (this._preExecuteCallback) {
- this._preExecuteCallback(this);
- }
- },
-
-
- setRenderCallback : function(callback) {
- this._renderCallback = callback;
- return this;
- },
-
-
- type : function() {},
-
- updateBorder : function(s, borderWidth, borderColor) {
- if (borderWidth != null) {
- s.each(function(data, index, groupIndex) {
- if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
- this.rave_setStyle("stroke-width", borderWidth, "");
- }
- });
- }
- if (borderColor != null) {
- s.each(function(data, index, groupIndex) {
- if (!((this.rave_getProperty("selected"))) && !((this.rave_getProperty("highlighted")))) {
- this.rave_setStyle("stroke", borderColor, "");
- }
- });
- }
- },
-
- getDefaultLabelColor : function(_labelStyle) {
- if (!_labelStyle) {
- return "#000000";
- }
- var defaultFillColor;
- if (_labelStyle) {
- defaultFillColor = _labelStyle["fill"];
- if (defaultFillColor == null) {
- defaultFillColor = _labelStyle["color"];
- }
- }
- if (defaultFillColor == null) {
- defaultFillColor = "#000000";
- }
- return defaultFillColor.toString();
- }
- });
- var com_ibm_rave_bundles_component_BackgroundComponent = rave['internal']['Declare'].implement(
-
-
-
-
- );
-
- com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE = "BackgroundComponent";
- var com_ibm_rave_bundles_component_ChartLayoutComponent = rave['internal']['Declare'].implement(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-
- com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE = "ChartLayoutComponent";
- var com_ibm_rave_bundles_components_LegendsManager = rave['internal']['Declare']({
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _numLegends : 0,
-
- _doTransition : false,
-
- _duration : 0,
- _spaceUsed : 0,
-
-
- constructor : function(context, numLegends) {
- this._context = context;
- this._numLegends = numLegends;
- this._comp = new com_ibm_rave_bundles_components_LegendComponentImpl();
- this._rectangle = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._orient = "vertical";
- this._preExecute = null;
- this._selectors = [];
- this._palettes = [];
- this._scale = [];
- this._swatchSizes = [];
- this._shapes = [];
- this._titles = [];
- this._titleFonts = [];
- this._titleFills = [];
- this._titleFontSizes = [];
- this._titleFontFamilies = [];
- this._entryFonts = [];
- this._formatters = [];
- this._lastVisible = [];
- this._visible = [];
- this._dataSlotEntries = [];
- for (var i = 0; i < this._numLegends; ++i) {
- this._selectors[i] = null;
- this._palettes[i] = null;
- this._swatchSizes[i] = null;
- this._shapes[i] = null;
- this._titles[i] = null;
- this._formatters[i] = null;
- this._lastVisible[i] = false;
- this._visible[i] = true;
- }
- },
-
- getLegendComponent : function() {
- return this._comp;
- },
-
- visible$0 : function(legendIndex, visible) {
- if (legendIndex < this._visible.length) {
- this._visible[legendIndex] = visible;
- }
- return this;
- },
-
- visible$1 : function(visible) {
- for (var i = 0; i < this._visible.length; ++i) {
- this._visible[i] = visible;
- }
- return this;
- },
-
-
- rectangle : function(rect) {
- if (rect) {
- this._rectangle = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
- }
- return this;
- },
-
-
- orient : function(orient) {
- if ("horizontal" == orient || "vertical" == orient) {
- this._orient = orient;
- }
- return this;
- },
-
-
- position : function(position) {
- return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
- },
-
-
- transition : function(doTransition, duration) {
- this._doTransition = doTransition;
- this._duration = (duration >= 0) ? duration : 0;
- return this;
- },
-
-
- setPreExecute : function(callback) {
- this._preExecute = callback;
- return this;
- },
-
-
- selector : function(index, selector) {
- if (index >= 0 && index < this._numLegends) {
- this._selectors[index] = selector;
- }
- return this;
- },
-
-
- palette : function(index, palette) {
- if (index >= 0 && index < this._numLegends) {
- this._palettes[index] = palette;
- }
- return this;
- },
-
-
- shape : function(index, shape) {
- if (index >= 0 && index < this._numLegends) {
- this._shapes[index] = shape;
- }
- return this;
- },
-
-
- title : function(index, title) {
- if (index >= 0 && index < this._numLegends) {
- this._titles[index] = title;
- }
- return this;
- },
-
-
- titleFont : function(index, titleFont) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFonts[index] = titleFont;
- }
- return this;
- },
-
-
- entryFont : function(index, entryFont) {
- if (index >= 0 && index < this._numLegends) {
- this._entryFonts[index] = entryFont;
- }
- return this;
- },
-
-
- titleFill : function(index, titleFill) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFills[index] = titleFill;
- }
- return this;
- },
-
-
- titleFontSize : function(index, titleFontSize) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFontSizes[index] = titleFontSize;
- }
- return this;
- },
-
-
- titleFontFamily : function(index, titleFontFamily) {
- if (index >= 0 && index < this._numLegends) {
- this._titleFontFamilies[index] = titleFontFamily;
- }
- return this;
- },
-
-
- scale : function(index, scale) {
- if (index >= 0 && index < this._numLegends) {
- this._scale[index] = scale;
- }
- return this;
- },
-
-
- swatchSize : function(index, swatchSize) {
- if (index >= 0 && index < this._numLegends) {
- this._swatchSizes[index] = swatchSize;
- }
- return this;
- },
-
-
- formatterList : function(index, entries, format, defaultFunction) {
- if (index >= 0 && index < this._numLegends) {
- this._formatters[index] = this._context.getCustomFormatterWithFlag(["legend", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("legend-label", "ROLE_NONE", format, entries), defaultFunction, false);
- }
- return this;
- },
-
-
- formatter : function(index, entry) {
- var entries = [];
- if (entry) {
- entries.push(entry);
- }
- return this.formatterList(index, entries, "none", null);
- },
-
-
- anyVisible : function() {
- for (var i = 0; i < this._numLegends; ++i) {
- if (this._visible[i] == true && (this._palettes[i] || this._swatchSizes[i])) {
- return true;
- }
- }
- return false;
- },
-
-
- setDataSlot : function(index, entry) {
- if (index >= 0 && index < this._numLegends) {
- this._dataSlotEntries[index] = entry;
- }
- return this.formatter(index, entry);
- },
- preLayout$0 : function(layoutComponent) {
- this.preLayout$1(layoutComponent, true);
- return this;
- },
- preLayout$1 : function(layoutComponent, axesBeforeLegend) {
- var layoutTransition = this._doTransition;
- var layoutDuration = this._duration;
- this._doTransition = false;
- this._duration = 0;
- var children = [];
- for (var i = 0; i < this._numLegends; ++i) {
- children[i] = "g.layoutLegend-" + i;
- }
- rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.legends-layout"), children);
- var layoutSelectors = [];
- var layoutLastVisible = [];
- for (var i = 0; i < this._numLegends; ++i) {
- layoutSelectors[i] = this._selectors[i];
- layoutLastVisible[i] = this._lastVisible[i];
- this._lastVisible[i] = false;
- if (this._selectors[i]) {
- this._selectors[i] = this._context.node.select("g.layoutLegend-" + i);
- }
- }
- layoutComponent.preLayout(true, !axesBeforeLegend);
- this.rectangle(layoutComponent.legendRect());
- this.draw();
- this._doTransition = layoutTransition;
- this._duration = layoutDuration;
- this._context.node.select("g.legends-layout").selectAll("*").remove();
- for (var i = 0; i < this._numLegends; ++i) {
- this._lastVisible[i] = layoutLastVisible[i];
- this._selectors[i] = layoutSelectors[i];
- }
- return this;
- },
-
-
- draw : function() {
- var nVisible = 0;
- for (var i = 0; i < this._numLegends; ++i) {
- if ((this._swatchSizes[i] || this._palettes[i]) && this._visible[i]) {
- nVisible++;
- }
- }
- var x = this._rectangle.x;
- var y = this._rectangle.y;
- var dx;
- var dy;
- var size;
- if (nVisible == 0) {
- dx = 0;
- dy = 0;
- size = [this._rectangle.width, this._rectangle.height];
- } else if ("horizontal" == this._orient) {
- dx = this._rectangle.width / nVisible;
- dy = 0;
- size = [dx, this._rectangle.height];
- } else {
- dx = 0;
- dy = this._rectangle.height / nVisible;
- size = [this._rectangle.width, dy];
- }
- this._comp.orient(this._orient).size(size);
- this._spaceUsed = 0;
- for (var i = 0; i < this._numLegends; ++i) {
- if (this._selectors[i]) {
- var visible = this._visible[i] && (this._palettes[i] || this._swatchSizes[i]);
- this._comp.visible(visible).colorPalette(this._palettes[i]).orient(this._orient).setPreExecute(this._preExecute).shape(this._shapes[i] != null ? this._shapes[i] : "square").title(this._titles[i]).titleFill(this._titleFills[i]).titleFontSize(this._titleFontSizes[i]).titleFontFamily(this._titleFontFamilies[i]).labelFormat(this._formatters[i]).swatchSize(this._swatchSizes[i]).scale(this._scale[i]);
- var fontStyle = this._context.getPropertyValue("legend.titlestyle.font");
- if (this._titleFonts[i] != null && !(this._titleFonts[i] == "")) {
- this._comp.titleFont(this._titleFonts[i]);
- } else if (fontStyle != null && !(fontStyle == "")) {
- this._comp.titleFont(this._context.getPropertyValue("legend.titlestyle.font"));
- }
- fontStyle = this._context.getPropertyValue("legend.entrystyle.font");
- if (this._entryFonts[i] != null) {
- this._comp.entryFont(this._entryFonts[i]);
- } else if (fontStyle != null && !(fontStyle == "")) {
- this._comp.entryFont(this._context.getPropertyValue("legend.entrystyle.font"));
- }
- var s = (this._doTransition && this._lastVisible[i]) ? this._selectors[i].transition("transition").duration(this._duration) : this._selectors[i];
- s.attr("transform", "translate(" + x + "," + y + ")").call(this._comp);
- var dataSlotEntries = [];
- if (this._dataSlotEntries[i]) {
- dataSlotEntries.push(this._dataSlotEntries[i]);
- }
- this._selectors[i].selectAll(".legendTitle").property("dataSlots", dataSlotEntries);
- if (visible) {
- x += dx;
- y += dy;
- if (this._comp.getSpaceUsed() > this._spaceUsed) {
- this._spaceUsed = this._comp.getSpaceUsed();
- }
- }
- this._lastVisible[i] = visible;
- } else {
- this._lastVisible[i] = false;
- }
- }
- return this;
- },
-
- getSizableType : function() {
- return 2;
- },
-
- getSizableOrientation : function() {
- return this._orient;
- },
-
- getPreferredSize : function() {
- return this._spaceUsed;
- },
-
- getSpillOverSize : function() {
- return 0;
- },
-
- visible : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.visible$1(a0);
- }
- return this.visible$0(a0, a1);
- },
-
- preLayout : function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return this.preLayout$0(a0);
- }
- return this.preLayout$1(a0, a1);
- }
- });
- var com_ibm_rave_bundles_utilities_FontPropertyParser = rave['internal']['Declare']({
- });
-
- com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont = function(fontStyle) {
- if (fontStyle != null && fontStyle.length > 0) {
- var properties = fontStyle.split(new RegExp(";"));
- var fontStyles = {};
- for (var __i_enFor0 = 0, __len_enFor0 = properties.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var property = properties[__i_enFor0];
- var fontMap = property.split(new RegExp(":"));
- if (fontMap.length == 2) {
- var key = fontMap[0].trim();
- fontStyles[key == "color" ? "fill" : key] = fontMap[1].trim();
- }
- }
- return fontStyles;
- }
- return null;
- };
- var com_ibm_rave_bundles_components_AxesManager = rave['internal']['Declare']({
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _firstDraw : false,
-
- _visible : true,
-
- _duration : 0,
-
- _transpose : false,
-
- _swapX : false,
-
- _swapY : false,
- _layoutInProgress : false,
- _layoutMaxWidth : 0,
- _layoutMaxHeight : 0,
- _xPadding : 0, _xOuterPadding : 0, _yPadding : 0, _yOuterPadding : 0,
- _xPixelPad : 0, _yPixelPad : 0,
-
- _preventStaggerRotate45 : false,
- constructor : function(context) {
- this._scales = [];
- this._suppressPanLabels = [];
- this._drawAxisLabels = [];
- this._axisComponents = [];
- this._lastAxisDrawSelectors = [];
- this._gridComponents = [];
- this._lastGridDrawSelectors = [];
- this._clearAxis = new com_ibm_rave_bundles_components_AxisComponentImpl();
- this._clearGrid = new com_ibm_rave_bundles_components_GridComponentImpl();
- this._axisSelectors = [];
- this._gridSelectors = [];
- this._axisRects = [];
- this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._lastAxisDrew = [];
- this._lastGridDrew = [];
- this._dataSlotEntries = [];
- this._layoutAxisOrder = [];
-
- {
- this._context = context;
- for (var i = 0; i < 4; ++i) {
- this._scales[i] = null;
- this._suppressPanLabels[i] = false;
- this._axisComponents[i] = null;
- this._lastAxisDrawSelectors[i] = null;
- this._gridComponents[i] = null;
- this._lastGridDrawSelectors[i] = null;
- this._axisSelectors[i] = null;
- this._gridSelectors[i] = null;
- this._axisRects[i] = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._lastAxisDrew[i] = false;
- this._lastGridDrew[i] = false;
- this._dataSlotEntries[i] = [];
- }
- }
- },
-
- preLayout : function(layoutComponent, axesBeforeLegend, xPadding, xOuterPadding, xPixelPad, yPadding, yOuterPadding, yPixelPad) {
- this._xPadding = xPadding;
- this._xOuterPadding = xOuterPadding;
- this._xPixelPad = xPixelPad;
- this._yPadding = yPadding;
- this._yOuterPadding = yOuterPadding;
- this._yPixelPad = yPixelPad;
- this._layoutInProgress = true;
- var layoutDuration = this._duration;
- this._duration = 0;
- var children = ["g.layoutAxis-bottom", "g.layoutAxis-top", "g.layoutAxis-left", "g.layoutAxis-right", "g.layoutGrid-bottom", "g.layoutGrid-top", "g.layoutGrid-left", "g.layoutGrid-right"];
- rave['library']['internal']['AbstractView'].createGroupStructure(this._context.node.select("g.axes-layout"), children);
- var layoutAxisSelectors = [];
- var layoutGridSelectors = [];
- var layoutLastAxisDrew = [];
- for (var position = 0; position < 4; ++position) {
- if (this._axisComponents[position]) {
- this._axisComponents[position].preLayout();
- }
- layoutAxisSelectors[position] = this._axisSelectors[position];
- layoutGridSelectors[position] = this._gridSelectors[position];
- layoutLastAxisDrew[position] = this._lastAxisDrew[position];
- if (this._axisSelectors[position]) {
- this.axisSelector(position, this._context.node.select("g.layoutAxis-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
- }
- if (this._gridSelectors[position]) {
- this.gridSelector(position, this._context.node.select("g.layoutGrid-" + com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position]));
- }
- }
- layoutComponent.preLayout(axesBeforeLegend, true);
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutComponent.elementRect());
- var countHorz = 0;
- var countVert = 0;
- var axes = [];
- for (var position = 0; position < 4; ++position) {
- var role = this.positionToRole(position);
- var isHorz = position == 1 || position == 0;
- if (this._axisSelectors[position] && this._scales[role]) {
- if (isHorz) {
- countHorz++;
- } else {
- countVert++;
- }
- if (this._scales[role].isOrdinal() || this._scales[role].isClustered()) {
- var score = isHorz ? 4 : 2;
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
- } else {
- var score = isHorz ? 3 : 1;
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, score));
- }
- } else {
- axes.push(new com_ibm_rave_bundles_components_AxesManager.AxisLayout(position, 5));
- }
- }
- axes.sort(function(a1, a2) {
- var a1value = a1.score;
- var a2value = a2.score;
- return a1value < a2value ? -1 : a1value > a2value ? 1 : 0;
- });
- this._layoutAxisOrder = [];
- for (var i = 0; i < 4; ++i) {
- this._layoutAxisOrder[i] = axes[i].position;
- }
- this._layoutMaxWidth = this._elementRect.width * (countVert > 1 ? 0.5 : 0.4);
- this._layoutMaxHeight = this._elementRect.height * (countHorz > 1 ? 0.5 : 0.4);
- for (var index = 0; index < 4; ++index) {
- var position = this._layoutAxisOrder[index];
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], this._elementRect);
- }
- this.draw();
- this._duration = layoutDuration;
- this._context.node.select("g.axes-layout").selectAll("*").remove();
- for (var position = 0; position < 4; ++position) {
- this._lastAxisDrew[position] = layoutLastAxisDrew[position];
- this._axisSelectors[position] = layoutAxisSelectors[position];
- this._gridSelectors[position] = layoutGridSelectors[position];
- }
- this._layoutInProgress = false;
- return this;
- },
- getPositionToDraw : function(index) {
- return this._layoutInProgress ? this._layoutAxisOrder[index] : index;
- },
- preDrawAxis : function(index) {
- if (this._layoutInProgress) {
- var position = this._layoutAxisOrder[index];
- var role = this.positionToRole(position);
- if (role == 0 || role == 1) {
- this.setScaleRangePadded(this._scales[role], false, this._xPadding, this._xOuterPadding, this._xPixelPad);
- } else {
- this.setScaleRangePadded(this._scales[role], true, this._yPadding, this._yOuterPadding, this._yPixelPad);
- }
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(true);
- }
- },
- postDrawAxis : function(index) {
- if (this._layoutInProgress) {
- var position = this._layoutAxisOrder[index];
- var role = this.positionToRole(position);
- var axis = this._axisComponents[role];
- var size = axis.getPreferredSize();
- if (position == 1 || position == 0) {
- if (size > this._layoutMaxHeight) {
- size = this._layoutMaxHeight;
- }
- this._elementRect.height -= size;
- if (position == 1) {
- this._elementRect.y += size;
- }
- } else {
- if (size > this._layoutMaxWidth) {
- size = this._layoutMaxWidth;
- }
- this._elementRect.width -= size;
- if (position == 2) {
- this._elementRect.x += size;
- }
- }
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
- }
- },
-
-
- draw : function() {
- for (var role = 0; role < 4; ++role) {
- this._lastAxisDrawSelectors[role] = null;
- this._lastGridDrawSelectors[role] = null;
- }
- for (var index = 0; index < 4; ++index) {
- var position = this.getPositionToDraw(index);
- var role = this.positionToRole(position);
- if (!this._visible || !this._axisSelectors[position] || !this._scales[role]) {
- this.clearAxis(position);
- this.clearGrid(position);
- } else {
- this.preDrawAxis(index);
- this.drawAxis(position, role);
- this.postDrawAxis(index);
- if (this._gridSelectors[position]) {
- this.drawGrid(position, role);
- }
- }
- }
- this._firstDraw = false;
- },
-
-
- hideAnyPanZoom : function() {
- return (this._suppressPanLabels[0] || this._suppressPanLabels[1] || this._suppressPanLabels[2] || this._suppressPanLabels[3]);
- },
-
-
- redraw : function(panning) {
- for (var role = 0; role < 4; ++role) {
- if (this._axisComponents[role] && this._lastAxisDrawSelectors[role]) {
- this._axisComponents[role].displayTickLabels(this._drawAxisLabels[role]);
- this._axisComponents[role].showPanZoomTickLabels(!panning || !this._suppressPanLabels[role]);
- var isAllow = this._axisComponents[role].isAllowAutomaticAxisLayoutToChangeOrientation();
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(false);
- this._lastAxisDrawSelectors[role].call(this._axisComponents[role]);
- this._axisComponents[role].allowAutomaticAxisLayoutToChangeOrientation(isAllow);
- }
- if (this._gridComponents[role] && this._lastGridDrawSelectors[role]) {
- this._lastGridDrawSelectors[role].call(this._gridComponents[role]);
- }
- }
- },
-
- preventStaggerRotate45 : function(preventStaggerRotate45) {
- this._preventStaggerRotate45 = preventStaggerRotate45;
- },
-
- drawAxis : function(position, role) {
- var axisGroup = this._axisSelectors[position];
- this._lastAxisDrawSelectors[role] = axisGroup;
- var comp = this.axisComponent(role);
- var layoutModeID = role == 2 ? "axis.y.labels.layoutMode" : role == 3 ? "axis.y2.labels.layoutMode" : "axis.x.labels.layoutMode";
- var allowStaggerID = role == 2 ? "axis.y.labels.allowStagger" : role == 3 ? "axis.y2.labels.allowStagger" : "axis.x.labels.allowStagger";
- var allowRotate45ID = role == 2 ? "axis.y.labels.allowRotate45" : role == 3 ? "axis.y2.labels.allowRotate45" : "axis.x.labels.allowRotate45";
- var allowRotate90ID = role == 2 ? "axis.y.labels.allowRotate90" : role == 3 ? "axis.y2.labels.allowRotate90" : "axis.x.labels.allowRotate90";
- var layoutMode = ""+(this._context.getPropertyValue(layoutModeID));
- var allowStagger = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowStaggerID));
- var allowRotate45 = !this._preventStaggerRotate45 && (this._context.getPropertyValue(allowRotate45ID));
- var allowRotate90 = (this._context.getPropertyValue(allowRotate90ID));
- var textTruncateIndicator = (this._context.getPropertyValue("axis.labels.truncationText"));
- var axisBounds = this._axisRects[position];
- var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
- var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
- var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
- comp.scale(this._scales[role]).setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).bounds(axisBounds).elementRect(this._elementRect).orient(orient).layoutMode(layoutMode).allowStagger(allowStagger).allowRotate45(allowRotate45).allowRotate90(allowRotate90).setPreExecute(this._context.getPreExecute()).textTruncateIndicator(textTruncateIndicator);
- this._drawAxisLabels[role] = comp._displayTickLabels;
- var axisGroupUpdate = axisGroup;
- if (this._duration > 0 && !this._firstDraw && this._lastAxisDrew[position]) {
- axisGroupUpdate = axisGroup.transition().duration(this._duration);
- }
- axisGroupUpdate.attr("transform", axisTransform);
- axisGroupUpdate.call(comp);
- var dataSlotEntryList = this._dataSlotEntries[role];
- axisGroup.selectAll(".axis-title").property("dataSlots", dataSlotEntryList);
- this._lastAxisDrew[position] = comp.renderedShapes();
- if (this._defs) {
- var clipAxis = new com_ibm_rave_bundles_components_ClipPathComponentImpl(this._context.instanceId() + "clip" + orient);
- var text = axisGroup.append("text").text("000,000");
- var bbox = text.node().getBBox();
- var w = bbox.width;
- var h = bbox.height;
- text.remove();
- var clipRect;
- if (position == 0 || position == 1) {
- var leftEdge = axisBounds.x + transform[0] * -1;
- var rightEdge = leftEdge + axisBounds.width;
- if (!(this._scales[role].isOrdinal()) && !(this._scales[role].isClustered())) {
- var numericLeftEdge = this._elementRect.x - w + transform[0] * -1;
- var numericRightEdge = numericLeftEdge + this._elementRect.width + w * 2;
- if (numericLeftEdge < leftEdge) {
- leftEdge = numericLeftEdge;
- }
- if (numericRightEdge > rightEdge) {
- rightEdge = numericRightEdge;
- }
- }
- clipRect = new rave['internal']['RectStruct'](leftEdge, axisBounds.y + transform[1] * -1, rightEdge - leftEdge, axisBounds.height);
- } else {
- clipRect = new rave['internal']['RectStruct'](axisBounds.x + transform[0] * -1, this._elementRect.y - h / 2 + transform[1] * -1, axisBounds.width, this._elementRect.height + h);
- }
- clipAxis.clipRect(clipRect).applyTo(axisGroup.select(".axis." + orient)).call(this._defs);
- }
- },
-
- clearAxis : function(position) {
- if (this._axisSelectors[position]) {
- this._clearAxis.scale(null);
- this._axisSelectors[position].call(this._clearAxis);
- }
- this._lastAxisDrew[position] = false;
- },
-
- drawGrid : function(position, role) {
- var gridGroup = this._gridSelectors[position];
- this._lastGridDrawSelectors[role] = gridGroup;
- var comp = this.gridComponent(role);
- var axisBounds = this._axisRects[position];
- var orient = com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS[position];
- var transform = com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation(axisBounds, orient);
- var axisTransform = "translate(" + transform[0] + "," + transform[1] + ")";
- comp.setRole(com_ibm_rave_bundles_components_AxesManager.ROLES[role]).orient(orient).setPreExecute(this._context.getPreExecute()).bounds(this._elementRect).axis(this._axisComponents[role].axis());
- if (this._duration <= 0 || this._firstDraw || !this._lastAxisDrew[position]) {
- gridGroup.attr("transform", axisTransform).call(comp);
- } else {
- gridGroup.transition().duration(this._duration).attr("transform", axisTransform).call(comp);
- }
- this._lastGridDrew[position] = comp.renderedShapes();
- },
-
- clearGrid : function(position) {
- if (this._gridSelectors[position]) {
- this._clearGrid.axis(null);
- this._gridSelectors[position].call(this._clearGrid);
- }
- this._lastGridDrew[position] = false;
- },
-
-
- visible : function(visible) {
- this._visible = visible;
- return this;
- },
-
-
- duration : function(duration) {
- this._duration = duration;
- return this;
- },
-
-
- transpose : function(transpose) {
- this._transpose = transpose;
- return this;
- },
-
-
- swapX : function(swapX) {
- this._swapX = swapX;
- return this;
- },
-
-
- swapY : function(swapY) {
- this._swapY = swapY;
- return this;
- },
-
-
- scale : function(role, scale) {
- this._scales[role] = scale;
- return this;
- },
-
-
- suppressPanLabels : function(role, suppressLabels) {
- this._suppressPanLabels[role] = suppressLabels;
- return this;
- },
-
-
- axisComponent : function(role) {
- if (!this._axisComponents[role]) {
- this._axisComponents[role] = new com_ibm_rave_bundles_components_AxisComponentImpl();
- }
- return this._axisComponents[role];
- },
-
-
- gridComponent : function(role) {
- if (!this._gridComponents[role]) {
- this._gridComponents[role] = new com_ibm_rave_bundles_components_GridComponentImpl();
- }
- return this._gridComponents[role];
- },
-
-
- defsSelector : function(defs) {
- this._defs = com_ibm_rave_bundles_components_AxesManager.checkSelector(defs);
- return this;
- },
-
-
- axisSelector : function(position, axisGroup) {
- this._axisSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(axisGroup);
- return this;
- },
-
-
- gridSelector : function(position, gridGroup) {
- this._gridSelectors[position] = com_ibm_rave_bundles_components_AxesManager.checkSelector(gridGroup);
- return this;
- },
-
-
- elementRect : function(elementRect) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, elementRect);
- return this;
- },
-
-
- axisRect : function(position, axisRect) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[position], axisRect);
- return this;
- },
-
-
- useDefaultSelectors : function() {
- this.defsSelector(this._context.node.select("defs"));
- this.axisSelector(0, this._context.node.select("g.axisTransform.bottom"));
- this.axisSelector(1, this._context.node.select("g.axisTransform.top"));
- this.axisSelector(2, this._context.node.select("g.axisTransform.left"));
- this.axisSelector(3, this._context.node.select("g.axisTransform.right"));
- this.gridSelector(0, this._context.node.select("g.grid.bottom"));
- this.gridSelector(1, this._context.node.select("g.grid.top"));
- this.gridSelector(2, this._context.node.select("g.grid.left"));
- this.gridSelector(3, this._context.node.select("g.grid.right"));
- return this;
- },
-
-
- useBoundsFromLayout : function(layoutInfo) {
- com_ibm_rave_bundles_components_AxesManager.setRect(this._elementRect, layoutInfo.elementRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[0], layoutInfo.bottomRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[1], layoutInfo.topRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[2], layoutInfo.leftRect());
- com_ibm_rave_bundles_components_AxesManager.setRect(this._axisRects[3], layoutInfo.rightRect());
- return this;
- },
-
-
- useDefaultX1Properties : function(setGridParameters) {
- this.axisComponent(0).padding(16).displayAxisTitle(((this._context.getPropertyValue("axis.x.title.display")))).axisTitle(this._context.getDataSlotLabel("axis.x.title.text", this._dataSlotEntries[0])).displayAxisLine(((this._context.getPropertyValue("axis.x.line.display")))).lineColor((this._context.getPropertyValue("axis.x.line.style.stroke"))).displayTicks(((this._context.getPropertyValue("axis.x.ticks.display")))).tickColor((this._context.getPropertyValue("axis.x.ticks.style.stroke"))).displayTickLabels(((this._context.getPropertyValue("axis.x.labels.display"))));
- var titleFontStyle = (this._context.getPropertyValue("axis.x.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.x.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(0).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(0).labelStyle((this._context.getPropertyValue("axis.x.labels.style.fill")), (this._context.getPropertyValue("axis.x.labels.style.font-size")), (this._context.getPropertyValue("axis.x.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(0).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(0).titleStyle((this._context.getPropertyValue("axis.x.title.style.fill")), (this._context.getPropertyValue("axis.x.title.style.font-size")), (this._context.getPropertyValue("axis.x.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(0).displayGridlines(((this._context.getPropertyValue("axis.x.gridlines.display")))).gridlineStyle((this._context.getPropertyValue("axis.x.gridlines.style.stroke")), (this._context.getPropertyValue("axis.x.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(0, (this._context.getPropertyValue("axis.x.labels.zoomPan")));
- return this;
- },
-
-
- useDefaultY1Properties : function(setGridParameters) {
- this.axisComponent(2).padding(16).displayAxisTitle((this._context.getPropertyValue("axis.y.title.display"))).axisTitle(this._context.getDataSlotLabel("axis.y.title.text", this._dataSlotEntries[2])).displayAxisLine((this._context.getPropertyValue("axis.y.line.display"))).lineColor((this._context.getPropertyValue("axis.y.line.style.stroke"))).displayTicks((this._context.getPropertyValue("axis.y.ticks.display"))).tickColor((this._context.getPropertyValue("axis.y.ticks.style.stroke"))).displayTickLabels((this._context.getPropertyValue("axis.y.labels.display")));
- var titleFontStyle = (this._context.getPropertyValue("axis.y.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.y.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(2).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(2).labelStyle((this._context.getPropertyValue("axis.y.labels.style.fill")), (this._context.getPropertyValue("axis.y.labels.style.font-size")), (this._context.getPropertyValue("axis.y.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(2).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(2).titleStyle((this._context.getPropertyValue("axis.y.title.style.fill")), (this._context.getPropertyValue("axis.y.title.style.font-size")), (this._context.getPropertyValue("axis.y.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(2).displayGridlines((this._context.getPropertyValue("axis.y.gridlines.display"))).gridlineStyle((this._context.getPropertyValue("axis.y.gridlines.style.stroke")), (this._context.getPropertyValue("axis.y.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(2, (this._context.getPropertyValue("axis.y.labels.zoomPan")));
- return this;
- },
-
-
- useDefaultY2Properties : function(setGridParameters) {
- this.axisComponent(3).padding(16).displayAxisTitle((this._context.getPropertyValue("axis.y2.title.display"))).axisTitle(this._context.getDataSlotLabel("axis.y2.title.text", this._dataSlotEntries[3])).displayAxisLine((this._context.getPropertyValue("axis.y2.line.display"))).lineColor((this._context.getPropertyValue("axis.y2.line.style.stroke"))).displayTicks((this._context.getPropertyValue("axis.y2.ticks.display"))).tickColor((this._context.getPropertyValue("axis.y2.ticks.style.stroke"))).displayTickLabels((this._context.getPropertyValue("axis.y2.labels.display")));
- var titleFontStyle = (this._context.getPropertyValue("axis.y2.title.style.font"));
- var labelFontStyle = (this._context.getPropertyValue("axis.y2.labels.style.font"));
- if (labelFontStyle != null && labelFontStyle.length > 0) {
- this.axisComponent(3).labelStyle(labelFontStyle);
- } else {
- this.axisComponent(3).labelStyle((this._context.getPropertyValue("axis.y2.labels.style.fill")), (this._context.getPropertyValue("axis.y2.labels.style.font-size")), (this._context.getPropertyValue("axis.y2.labels.style.font-family")));
- }
- if (titleFontStyle != null && titleFontStyle.length > 0) {
- this.axisComponent(3).titleStyle(titleFontStyle);
- } else {
- this.axisComponent(3).titleStyle((this._context.getPropertyValue("axis.y2.title.style.fill")), (this._context.getPropertyValue("axis.y2.title.style.font-size")), (this._context.getPropertyValue("axis.y2.title.style.font-family")));
- }
- if (setGridParameters) {
- this.gridComponent(3).displayGridlines((this._context.getPropertyValue("axis.y2.gridlines.display"))).gridlineStyle((this._context.getPropertyValue("axis.y2.gridlines.style.stroke")), (this._context.getPropertyValue("axis.y2.gridlines.style.stroke-dasharray")));
- }
- this.suppressPanLabels(3, (this._context.getPropertyValue("axis.y2.labels.zoomPan")));
- return this;
- },
-
-
- setTickFormatterList : function(role, entries, format, defaultFunction) {
- var fmtRole;
- switch (role) {
- case 2:
- fmtRole = "ROLE_Y1";
- break;
- case 1:
- fmtRole = "ROLE_X2";
- break;
- case 3:
- fmtRole = "ROLE_Y2";
- break;
- case 0:
- default:
- fmtRole = "ROLE_X1";
- break;
- }
- var fmt = this._context.getCustomFormatterWithFlag([com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS[role], com_ibm_rave_bundles_components_AxesManager.FORMATTERS[this.roleToPosition(role)], "axis", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("axis-label", fmtRole, format, entries), defaultFunction, false);
- this.axisComponent(role).tickFormat(fmt);
- var simplefmt = this._context.getCustomFormatterWithFlag([com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS[role], com_ibm_rave_bundles_components_AxesManager.FORMATTERS[this.roleToPosition(role)], "axis", "all"], rave['library']['internal']['BundleContext'].makeCustomFormatInfo("axis-label", fmtRole, format, entries), defaultFunction, true);
- this.axisComponent(role).simplifiedTickFormat(simplefmt);
- return this;
- },
-
-
- setTickFormatter : function(role, entry) {
- var entries = [];
- if (entry) {
- entries.push(entry);
- }
- return this.setTickFormatterList(role, entries, "none", null);
- },
-
-
- setScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setIndependentScaleRanges(padding, outerPadding, pixelPad);
- this.setDependentScaleRanges(padding, outerPadding, pixelPad);
- return this;
- },
-
-
- setIndependentScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setScaleRangePadded(this._scales[0], false, padding, outerPadding, pixelPad);
- this.setScaleRangePadded(this._scales[1], false, padding, outerPadding, pixelPad);
- return this;
- },
-
-
- setDependentScaleRanges : function(padding, outerPadding, pixelPad) {
- this.setScaleRangePadded(this._scales[2], true, padding, outerPadding, pixelPad);
- this.setScaleRangePadded(this._scales[3], true, padding, outerPadding, pixelPad);
- return this;
- },
-
- setDataSlot$0 : function(role, slot) {
- this.setDataSlot$1(role, [slot]);
- return this;
- },
-
- setDataSlot$1 : function(role, slots) {
- if (role < 4 && role >= 0) {
- this._dataSlotEntries[role].length = 0;
- if (slots) {
- for (var __i_enFor0 = 0, __exp_enFor0 = slots, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var slot = __exp_enFor0[__i_enFor0];
- this._dataSlotEntries[role].push(slot);
- }
- }
- }
- return this;
- },
-
- setScaleRangePadded : function(scale, dependent, padding, outerPadding, pixelPad) {
- if (scale) {
- var min, max;
- if (dependent == this._transpose) {
- min = this._elementRect.x + pixelPad;
- max = this._elementRect.x + this._elementRect.width - pixelPad;
- } else {
- if (scale.isContinuous()) {
- min = this._elementRect.y + this._elementRect.height - pixelPad;
- max = this._elementRect.y + pixelPad;
- } else {
- min = this._elementRect.y + pixelPad;
- max = this._elementRect.y + this._elementRect.height - pixelPad;
- }
- }
- scale.range(min, max, padding, outerPadding);
- }
- },
-
- positionToRole : function(position) {
- var r = position;
- if (this._transpose) {
- r = (r + 2) % 4;
- }
- if (this._swapX && r < 2) {
- r = 1 - r;
- }
- if (this._swapY && r > 1) {
- r = 5 - r;
- }
- return r;
- },
-
- roleToPosition : function(role) {
- var p = role;
- if (this._swapX && role < 2) {
- p = 1 - p;
- }
- if (this._swapY && p > 1) {
- p = 5 - p;
- }
- if (this._transpose) {
- p = (p + 2) % 4;
- }
- return p;
- },
-
-
- scaleTickMagnitude : function(role, tickMagnitude) {
- this.axisComponent(role).scaleTickMagnitude(tickMagnitude);
- return this;
- },
-
- setDataSlot : function(a0, a1) {
- var args = arguments;
- if (args.length == 2 && typeof a1 === "function") {
- return this.setDataSlot$0(a0, a1);
- }
- return this.setDataSlot$1(a0, a1);
- }
- });
- com_ibm_rave_bundles_components_AxesManager.checkSelector = function(s) {
- return s && !(s.empty()) ? s : null;
- };
- com_ibm_rave_bundles_components_AxesManager.setRect = function(target, source) {
- if (source) {
- target.x = source.x;
- target.y = source.y;
- target.width = source.width;
- target.height = source.height;
- } else {
- target.x = 0;
- target.y = 0;
- target.width = 0;
- target.height = 0;
- }
- };
-
- com_ibm_rave_bundles_components_AxesManager.percentFormat = function(n) {
- var digits = "." + n + "f";
- var format = rave.format(digits);
- return function(value, ix, gix) {
- return format.call(null, value, 0, 0) + "%";
- };
- };
- com_ibm_rave_bundles_components_AxesManager.AxisLayout = rave['internal']['Declare']({
-
- position : 0,
-
- score : 0,
- constructor : function(position, score) {
- this.position = position;
- this.score = score;
- }
- });
-
- com_ibm_rave_bundles_components_AxesManager.X1 = 0;
-
- com_ibm_rave_bundles_components_AxesManager.X2 = 1;
-
- com_ibm_rave_bundles_components_AxesManager.Y1 = 2;
-
- com_ibm_rave_bundles_components_AxesManager.Y2 = 3;
-
- com_ibm_rave_bundles_components_AxesManager.BOTTOM = 0;
-
- com_ibm_rave_bundles_components_AxesManager.TOP = 1;
-
- com_ibm_rave_bundles_components_AxesManager.LEFT = 2;
-
- com_ibm_rave_bundles_components_AxesManager.RIGHT = 3;
- com_ibm_rave_bundles_components_AxesManager.ROLES = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
- com_ibm_rave_bundles_components_AxesManager.ROLE_FORMATTERS = ["ROLE_X1", "ROLE_X2", "ROLE_Y1", "ROLE_Y2"];
- com_ibm_rave_bundles_components_AxesManager.ORIENTATIONS = ["bottom", "top", "left", "right"];
- com_ibm_rave_bundles_components_AxesManager.FORMATTERS = ["bottom", "top", "left", "right"];
- var com_ibm_rave_bundles_component_AxisComponent = rave['internal']['Declare'].implement(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-
- com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE = "AxisComponent";
-
- com_ibm_rave_bundles_component_AxisComponent.ROLE_X1 = "ROLE_X1";
-
- com_ibm_rave_bundles_component_AxisComponent.ROLE_Y1 = "ROLE_Y1";
-
- com_ibm_rave_bundles_component_AxisComponent.ROLE_X2 = "ROLE_X2";
-
- com_ibm_rave_bundles_component_AxisComponent.ROLE_Y2 = "ROLE_Y2";
- var com_ibm_rave_bundles_utilities_TextCrossfader = rave['internal']['Declare']({
- });
-
- com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade = function(selection, oldText, newText, fillOpacity, delay) {
- if (!(selection.isTransition())) {
- return selection.text(newText);
- }
- var _t = (selection).tween("text", function(data, index, groupIndex) {
- return function(t) {
- this.rave_setText(t < 0.5 ? oldText : newText);
- };
- });
- var t0 = Math.max(0.0, Math.min(0.5, delay));
- if (t0 == 0.5 || (oldText == null && newText == null) || (oldText != null && oldText == newText)) {
- return selection;
- }
- var opacity = fillOpacity == null ? 1.0 : + (fillOpacity);
- var tf = 1.0 / (0.5 - t0);
- return _t.tween("fill-opacity", function(data, index, groupIndex) {
- return function(t) {
- if (t <= t0 || t >= (1.0 - t0)) {
- this.rave_setStyle("fill-opacity", fillOpacity);
- } else {
- this.rave_setStyle("fill-opacity", opacity * Math.abs(t - 0.5) * tf);
- }
- };
- });
- };
- var com_ibm_rave_bundles_utilities_BundleLabelDropper = rave['internal']['Declare']({
-
- labelCount : 0,
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- _$self.drop(args[0], ((args[1])));
- return null;
- }
- };
- return _$self;
- },
-
- constructor : function() {
- this._dropOverlap = (rave.capabilities.extension("position")).drop().remove(false);
- this._dropOverlap.setOverlapGap(4.0);
- },
-
-
- drop : function(labels, removeOverlap) {
- if (!(labels.isTransition())) {
- this.applyLabelDrop(labels, removeOverlap);
- } else {
- var steps = [0, 25, 75];
- var self = this;
- (labels).tween("__pointLabelDrop__", function(data, index, groupIndex) {
- if (index == 0) {
- return function(t) {
- var currentStep = Math.floor(t * 100);
- if (steps.length > 0 && currentStep < 100 && currentStep >= steps[0]) {
- steps.splice(0, 1);
- self.applyLabelDrop(labels, removeOverlap);
- }
- };
- }
- return null;
- });
- this.labelCount = 0;
- (labels).each(function(data, index, groupIndex) {
- ++self.labelCount;
- }).each("end", function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- if (--self.labelCount == 0) {
- self.applyLabelDrop(labels, removeOverlap);
- }
- return null;
- }
- });
- }
- },
- applyLabelDrop : function(labels, removeOverlap) {
- if (removeOverlap) {
- labels.call(this._dropOverlap);
- } else {
- this._dropOverlap.reset(labels);
- }
- },
-
- configureForDataLabels : function(rect) {
- if (rect) {
- var ex = [[rect.x, rect.y], [rect.x + rect.width, rect.y + rect.height]];
- this._dropOverlap.extent(ex);
- }
- this._dropOverlap.noClipping();
- }
- });
- com_ibm_rave_bundles_utilities_BundleLabelDropper.OVERLAP_GAP = 4;
- var com_ibm_rave_bundles_components_StyleStructs = rave['internal']['Declare']({
- });
- com_ibm_rave_bundles_components_StyleStructs.ShapeStyle = function() {
- this._fill = null;
- this._stroke = null;
- this._strokeWidth = null;
- };
- com_ibm_rave_bundles_components_StyleStructs.LineStyle = function() {
- this._stroke = null;
- this._strokeWidth = null;
- this._dashArray = null;
- };
- var com_ibm_rave_bundles_component_GridComponent = rave['internal']['Declare'].implement(
-
-
-
-
-
-
-
-
-
-
- );
-
- com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE = "GridComponent";
- var com_ibm_rave_bundles_components_IntervalDataUtilities = rave['internal']['Declare']({
- });
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.simpleBars = function(data, x, xScale, y, yStart, color, label) {
- var result = [];
- if (!data || data.length == 0 || !x || !y) {
- return result;
- }
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- var yvStart = !yStart ? 0 : yStart(d);
- if (yv != null && yvStart != null) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = r.ind1;
- r.cind = r.ind1;
- r.dep1 = yvStart;
- r.dep2 = yv;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = r.dep2;
- r._originalData = d;
- r.valueAsPercentOfCategory = 100;
- result.push(r);
- }
- }
- return null;
- });
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- if (sum != 0) {
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- return result;
- };
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.clusteredBars = function(data, x, xScale, y, yStart, color, label) {
- var result = [];
- if (!data || data.length == 0 || !x || x.length == 0 || !y) {
- return result;
- }
- var len = x.length;
- var categories = {};
- var colors = {};
- data.forEach(function(d, ix, list) {
- var OK = true;
- var ind = [];
- for (var i = 0; i < len; ++i) {
- var xv = x[i](d);
- if (xv == null || (xScale[i] && xScale[i](xv) == null)) {
- OK = false;
- break;
- }
- ind.push(xv);
- if (i == 0) {
- if (!(categories.hasOwnProperty(xv))) {
- categories[""+(xv)] = 1;
- }
- } else if (!(colors.hasOwnProperty(xv))) {
- colors[""+(xv)] = 1;
- }
- }
- var dep = y(d);
- var depStart = !yStart ? 0 : yStart(d);
- if (OK && dep != null && depStart != null) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = ind;
- r.ind2 = ind;
- r.cind = ind;
- r.dep1 = depStart;
- r.dep2 = dep;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = r.dep2;
- r._originalData = d;
- result.push(r);
- }
- return null;
- });
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == (iData.ind1)[0]) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == (iData.ind1)[0]) {
- var value = + (iData.value);
- iData.valueAsPercentOfCategory = value / sum * 100;
- }
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- }
- return result;
- };
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.stackedBars = function(data, x, xScale, y, color, label, percent) {
- var result = [];
- if (!data || data.length == 0 || !x || !y) {
- return result;
- }
- var stacks = {};
- var categories = {};
- var colors = {};
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- if (yv != null) {
- var stack = stacks[xv];
- if (!stack) {
- stack = new com_ibm_rave_bundles_components_IntervalDataUtilities.Stack();
- stacks[xv] = stack;
- }
- var dVal = + (yv);
- if (!percent) {
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = xv;
- r.cind = xv;
- var sum = dVal < 0.0 ? stack.negativeSum : stack.positiveSum;
- r.dep1 = sum;
- r.dep2 = sum + dVal;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = dVal;
- r._originalData = d;
- result.push(r);
- }
- if (dVal < 0.0) {
- stack.negativeSum += dVal;
- } else {
- stack.positiveCount++;
- stack.positiveSum += dVal;
- }
- if (!(categories.hasOwnProperty(xv))) {
- categories[""+(xv)] = 1;
- }
- if (color) {
- var o = color(d);
- if ((o != null) && !(colors.hasOwnProperty(o))) {
- colors[""+(o)] = 1;
- }
- }
- }
- }
- return null;
- });
- if (percent) {
- data.forEach(function(d, ix, list) {
- var xv = x(d);
- if (xv != null && (!xScale || xScale(xv) != null)) {
- var yv = y(d);
- if (yv != null) {
- var stack = stacks[xv];
- var dVal = + (yv);
- var percent;
- if (dVal < 0.0) {
- percent = -100.0 * dVal / stack.negativeSum;
- } else if (stack.positiveSum > 0) {
- percent = 100.0 * dVal / stack.positiveSum;
- } else {
- percent = 100.0 / stack.positiveCount;
- }
- var r = new com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData();
- r.key = ix;
- r.ind1 = xv;
- r.ind2 = xv;
- r.cind = xv;
- var sum = dVal < 0.0 ? stack.negativePercent : stack.positivePercent;
- r.dep1 = sum;
- r.dep2 = sum + percent;
- r.cdep = r.dep2;
- r.color = color ? color(d) : null;
- r.label = label ? label(d) : null;
- r.value = dVal;
- r.valueAsPercentOfCategory = percent;
- r._originalData = d;
- result.push(r);
- if (dVal < 0.0) {
- stack.negativePercent += percent;
- } else {
- stack.positivePercent += percent;
- }
- }
- }
- return null;
- });
- } else {
- for (var __i_enFor0 = 0, __exp_enFor0 = Object.keys(categories), __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.ind1) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.ind1) {
- var value = + (iData.value);
- iData.valueAsPercentOfCategory = value / sum * 100;
- }
- }
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(colors), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var o = __exp_enFor1[__i_enFor1];
- var s = ""+(o);
- var sum = 0;
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- sum += Math.abs(value);
- }
- }
- if (sum == 0) {
- continue;
- }
- for (var i = 0; i < result.length; ++i) {
- var iData = result[i];
- if (s == iData.color) {
- var value = + (iData.value);
- iData.valueAsPercentOfColor = value / sum * 100;
- }
- }
- }
- return result;
- };
- com_ibm_rave_bundles_components_IntervalDataUtilities.IntervalData = rave['internal']['Declare']({
-
-
- key : null,
-
-
- ind1 : null,
-
-
- ind2 : null,
-
-
- dep1 : null,
-
-
- dep2 : null,
-
-
- value : null,
-
-
- color : null,
-
-
- label : null,
-
-
- cind : null,
-
-
- cdep : null,
-
- _originalData : null,
-
-
- valueAsPercentOfCategory : NaN,
-
-
- valueAsPercentOfColor : NaN,
-
- originalData : function() {
- return this._originalData;
- },
-
- originalDataList : function() {
- var list = [];
- list.push(this._originalData);
- return list;
- }
- });
- com_ibm_rave_bundles_components_IntervalDataUtilities.Stack = function() {
- this.positiveCount = 0;
- this.positiveSum = 0;
- this.negativeSum = 0;
- this.positivePercent = 0;
- this.negativePercent = 0;
- };
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_DEPENDENT_ACCESSOR = function(data) {
- return (data).cdep;
- };
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.CALLOUT_INDEPENDENT_ACCESSOR = function(data) {
- return (data).cind;
- };
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.VALUE_ACCESSOR = function(data) {
- return (data).value;
- };
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(data) {
- var percent = (data).valueAsPercentOfCategory;
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
-
- com_ibm_rave_bundles_components_IntervalDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(data) {
- var percent = (data).valueAsPercentOfColor;
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- var com_ibm_rave_bundles_data_PointDataUtilities = rave['internal']['Declare']({
- });
-
- com_ibm_rave_bundles_data_PointDataUtilities.buildPoints = function(data, xAccessor, xScale, yAccessor, yScale) {
- var result = [];
- if (data) {
- for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var o = __exp_enFor0[__i_enFor0];
- if (o != null) {
- var xv = null;
- if (xAccessor) {
- xv = xAccessor(o);
- if (xv == null || (xScale && xScale(xv) == null)) {
- continue;
- }
- }
- var yv = null;
- if (yAccessor) {
- yv = yAccessor(o);
- if (yv == null || (yScale && yScale(yv) == null)) {
- continue;
- }
- }
- var datum = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
- datum._x = xv;
- datum._y = yv;
- datum._originalData = o;
- result.push(datum);
- }
- }
- }
- return result;
- };
- com_ibm_rave_bundles_data_PointDataUtilities.PointDatum = rave['internal']['Declare']({
-
-
- _x : null,
-
-
- _y : null,
-
-
- _yAsPercentOfCategory : null,
-
-
- _yAsPercentOfColor : null,
-
-
- _originalData : null,
-
- originalData : function() {
- return this._originalData;
- },
-
- originalDataList : function() {
- var list = [];
- list.push(this._originalData);
- return list;
- }
- });
-
- com_ibm_rave_bundles_data_PointDataUtilities.X_ACCESSOR = function(d) {
- return (d)._x;
- };
-
- com_ibm_rave_bundles_data_PointDataUtilities.Y_ACCESSOR = function(d) {
- return (d)._y;
- };
-
- com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_CATEGORY_ACCESSOR = function(d) {
- var percent = + ((d)._yAsPercentOfCategory);
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
-
- com_ibm_rave_bundles_data_PointDataUtilities.PERCENT_OF_COLOR_ACCESSOR = function(d) {
- var percent = + ((d)._yAsPercentOfColor);
- return isNaN(percent) ? "" : percent.toFixed(1) + "%";
- };
- var com_ibm_rave_bundles_utilities_ColorUtil = rave['internal']['Declare']({
- });
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0 = function(bg, fg) {
- var contrastRatio = com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio(bg, fg);
- if (contrastRatio < 4.5) {
- var bgHSL = rave.hsl(bg);
- var fgHSL = rave.hsl(fg);
- var brightness = 0.33 * (rave.rgb(bg).getR() / 255.0) + 0.5 * (rave.rgb(bg).getG() / 255.0) + 0.16 * (rave.rgb(bg).getB() / 255.0);
- if (brightness > 0.5) {
- if (bgHSL.getL() > 0.5) {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), bgHSL.getL() - 0.4));
- } else {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.min(fgHSL.getL(), 0.1));
- }
- } else {
- if (bgHSL.getL() < 0.5) {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), bgHSL.getL() + 0.4));
- } else {
- return rave.hsl(fgHSL.getH(), fgHSL.getS(), Math.max(fgHSL.getL(), 0.9));
- }
- }
- }
- return fg;
- };
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1 = function(labelColor) {
- var labelRGB = rave.rgb(labelColor);
- return labelRGB.contrastShift(21);
- };
-
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastRatio = function(colorA, colorB) {
- var foregroundLuminance = rave.rgb(colorA).getLuminance();
- var backgroundLuminance = rave.rgb(colorB).getLuminance();
- var contrastRatio = (foregroundLuminance >= backgroundLuminance) ? (foregroundLuminance + 0.05) / (backgroundLuminance + 0.05) : (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
- return contrastRatio;
- };
-
- com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor = function(a0, a1) {
- var args = arguments;
- if (args.length == 1) {
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$1(a0);
- }
- return com_ibm_rave_bundles_utilities_ColorUtil.getContrastColor$0(a0, a1);
- };
- var com_ibm_rave_bundles_component_BoxplotComponent = rave['internal']['Declare'].implement(
- );
-
- com_ibm_rave_bundles_component_BoxplotComponent.COMPONENT_TYPE = "BoxplotComponent";
- var com_ibm_rave_bundles_data_BoxplotDatum = rave['internal']['Declare']({
-
-
-
-
- _mean : 0,
- _min : 0,
- _lowerHinge : 0,
- _median : 0,
- _upperHinge : 0,
- _max : 0,
-
- constructor : function(x, key, mean, min, lowerHinge, median, upperHinge, max, outliers, data) {
- this._x = x;
- this._key = key;
- this._mean = mean;
- this._min = min;
- this._lowerHinge = lowerHinge;
- this._median = median;
- this._upperHinge = upperHinge;
- this._max = max;
- this._outliers = outliers;
- this._data = data;
- },
-
-
- x : function() {
- return this._x;
- },
-
-
- key : function() {
- return this._key;
- },
-
-
- mean : function() {
- return this._mean;
- },
-
-
- min : function() {
- return this._min;
- },
-
-
- lowerExtreme : function() {
- return Math.max(this._min, this._lowerHinge - 3.0 * (this._upperHinge - this._lowerHinge));
- },
-
-
- lowerFence : function() {
- return Math.max(this._min, this._lowerHinge - 1.5 * (this._upperHinge - this._lowerHinge));
- },
-
-
- lowerHinge : function() {
- return this._lowerHinge;
- },
-
-
- median : function() {
- return this._median;
- },
-
-
- upperHinge : function() {
- return this._upperHinge;
- },
-
-
- upperFence : function() {
- return Math.min(this._max, this._upperHinge + 1.5 * (this._upperHinge - this._lowerHinge));
- },
-
-
- upperExtremum : function() {
- return Math.min(this._max, this._upperHinge + 3.0 * (this._upperHinge - this._lowerHinge));
- },
-
-
- max : function() {
- return this._max;
- },
-
-
- outliers : function() {
- return this._outliers;
- },
-
-
- originalData : function() {
- return this._data;
- },
-
-
- originalDataList : function() {
- return this._data;
- }
- });
- var com_ibm_rave_bundles_components_ComponentConfiguration = rave['internal']['Declare']({
-
- });
-
- com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom = function(chart, zoom, xScale, yScale, x2Scale, y2Scale, scaleExtent, chartRect, p, s, zoomOps, callback) {
- var z = zoom ? zoom : rave.behavior.zoom();
- var z1 = (x2Scale || y2Scale) && zoomOps == "all" ? rave.behavior.zoom() : null;
- var dummyScale = (rave.scale.linear());
- z.x(dummyScale);
- z.y(dummyScale);
- if (xScale && zoomOps == "x") {
- z.x(xScale.scale());
- z.scale(s[0]);
- z.translate([p[0], 0]);
- }
- if (yScale && zoomOps == "y") {
- z.y(yScale.scale());
- z.scale(s[1]);
- z.translate([0, p[1]]);
- }
- if (x2Scale && zoomOps == "x2") {
- z.x(x2Scale.scale());
- z.scale(s[2]);
- z.translate([p[2], 0]);
- }
- if (y2Scale && zoomOps == "y2") {
- z.y(y2Scale.scale());
- z.scale(s[3]);
- z.translate([0, p[3]]);
- }
- if (zoomOps == "all") {
- if (xScale) {
- z.x(xScale.scale());
- }
- if (yScale) {
- z.y(yScale.scale());
- }
- z.scale(1);
- z.translate([0, 0]);
- if (z1) {
- if (x2Scale) {
- z1.x(x2Scale.scale());
- }
- if (y2Scale) {
- z1.y(y2Scale.scale());
- }
- z1.scale(1);
- z1.translate([0, 0]);
- }
- }
- z.scaleExtent(scaleExtent ? scaleExtent : [1, Infinity]).on("zoom.default", function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var event = args[3];
- var scale = event.scale;
- var translate = event.translate;
- var scaledX = chartRect.x * (scale - 1);
- var scaledXExtent = (chartRect.width * (1 - scale)) - scaledX;
- translate[0] = Math.min(-scaledX, Math.max(scaledXExtent, translate[0]));
- var scaledY = chartRect.y * (scale - 1);
- var scaledYExtent = (chartRect.height * (1 - scale)) - scaledY;
- translate[1] = Math.min(-scaledY, Math.max(scaledYExtent, translate[1]));
- z.translate([translate[0], translate[1]]);
- if (z1) {
- z1.translate([translate[0], translate[1]]);
- z1.scale(scale);
- }
- if (zoomOps == "x") {
- p[0] = translate[0];
- s[0] = scale;
- } else if (zoomOps == "y") {
- p[1] = translate[1];
- s[1] = scale;
- } else if (zoomOps == "x2") {
- p[2] = translate[0];
- s[2] = scale;
- } else if (zoomOps == "y2") {
- p[3] = translate[1];
- s[3] = scale;
- } else if (zoomOps == "all") {
- p[0] = translate[0];
- p[1] = translate[1];
- p[2] = translate[0];
- p[3] = translate[1];
- s[0] = scale;
- s[1] = scale;
- s[2] = scale;
- s[3] = scale;
- }
- return callback.apply(this, args);
- }
- });
- return z;
- };
- var com_ibm_rave_bundles_boxplotBundle_BoxplotBundle = rave['internal']['Declare'](com_ibm_rave_bundles_RaveBundle, {
-
- getName : function() {
- return com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.BUNDLE_NAME;
- },
-
- createView : function(ctx) {
- return new com_ibm_rave_bundles_boxplotBundle_BoxplotView(ctx);
- }
-
- });
-
- com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.init = function() {
- if (!(com_ibm_rave_library_Library.bundle.isRegistered(com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.BUNDLE_NAME))) {
- var bundle;
- com_ibm_rave_library_Library.bundle.extension(com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.BUNDLE_NAME, function() {
- if (!bundle) {
- bundle = new com_ibm_rave_bundles_boxplotBundle_BoxplotBundle();
- bundle.loadResources();
- require("./vizlibrary-boxplot.css");
- }
- return bundle;
- });
- }
- return com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.BUNDLE_NAME;
- };
- com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.BUNDLE_NAME = "boxplotBundle";
- com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.init();
- if (!com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.BUNDLE_NAME]) {
- com_ibm_rave_library_Library.bundle[com_ibm_rave_bundles_boxplotBundle_BoxplotBundle.BUNDLE_NAME] = function() {
- if (!bundle) {
- bundle = new com_ibm_rave_bundles_boxplotBundle_BoxplotBundle();
- bundle.loadResources();
- require("./vizlibrary-boxplot.css");
- }
- return bundle;
- };
- } else {
- console.log("Could not register extension: BoxplotBundle");
- }
- var com_ibm_rave_bundles_boxplotBundle_BoxplotView = rave['internal']['Declare'](com_ibm_rave_bundles_views_BundleView, {
-
-
-
-
-
-
-
-
-
-
-
-
-
- constructor : function(context) {
- },
-
- setup : function() {
- com_ibm_rave_bundles_views_BundleView.prototype.setup.call(this);
- this._boxplotData = [];
- this._xScale = null;
- this._yScale = null;
- this._boxplotComponent = new com_ibm_rave_bundles_components_BoxplotComponentImpl(this.context);
- var component = this._boxplotComponent;
- rave['library']['internal']['BundleUtils'].setupZoomAction(this.context);
- var action = this.context.actions.action("highlight");
- action.setBindFn(rave['library']['internal']['BundleUtils'].bindAction(this.context, ".chart .element-shape", action, ["mouseenter.default"]));
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- component.highlight(args[0]);
- }
- };
- return _$self;
- }
- }))());
- action = this.context.actions.action("unhighlight");
- action.setBindFn(rave['library']['internal']['BundleUtils'].bindAction(this.context, ".chart .element-shape", action, ["mouseout.default"]));
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- component.unhighlight(args[0]);
- }
- };
- return _$self;
- }
- }))());
- action = this.context.actions.action("toggleSelect");
- action.setBindFn(rave['library']['internal']['BundleUtils'].bindAction(this.context, ".chart .element-shape", action, ["click.default", "touchstart.default"]));
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- component.toggleSelect(args[0]);
- }
- };
- return _$self;
- }
- }))());
- action = this.context.actions.action("deselectAll");
- action.setBindFn(rave['library']['internal']['BundleUtils'].bindAction(this.context, ".background", action, ["click.default", "touchstart.default"]));
- action.setOperation(new (rave['internal']['Declare']([rave['library']['internal']['ActionOperation']], {
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments);
- }
- {
- component.deselectAll(args[0]);
- }
- };
- return _$self;
- }
- }))());
- },
-
- isAxesManagerRequired : function() {
- return true;
- },
-
- draw : function() {
- if (this.isUpdateNothing()) {
- return;
- }
- this.preDraw("g.vizlibrary-boxplot");
- if (!(this.validateDataModel("g.element-group", "g.grid", "g.axis"))) {
- return;
- }
- var self = this;
- var effect = this.getStringProperty("effect.name");
- var duration = this.getEffectDuration(effect);
- var dataSet = this.dataModel.dataset("data");
- var data = (dataSet.data());
- var xEntry = dataSet.slot("x").entry();
- var yEntry = dataSet.slot("y").entry();
- var colorEntry = dataSet.slot("color").entry();
- var keyEntry = dataSet.slot("key").entry();
- if (!colorEntry && yEntry) {
- dataSet.slot("color").overrideLabel(yEntry.label());
- }
- if (this.updateType == 0) {
- var dataScale = colorEntry ? rave['library']['internal']['ScaleManager'].makeClusteredScale(data, [xEntry, colorEntry]) : rave['library']['internal']['ScaleManager'].makeCoordinateScale(data, xEntry);
- var isClustered = colorEntry && "Clustered" == this.getStringProperty("data.handling");
- if (dataScale) {
- dataScale.range(0.0, 1.0, null, null);
- }
- this._boxplotData = com_ibm_rave_bundles_data_BoxplotDataUtilities.makeData(dataSet.data(), dataScale, isClustered, rave['library']['internal']['AbstractView'].accessorOf(xEntry), rave['library']['internal']['AbstractView'].accessorOf(yEntry), rave['library']['internal']['AbstractView'].accessorOf(colorEntry));
- this._boxplotComponent.data(this._boxplotData);
- }
- var colorPalette = this.getPalette();
- colorPalette.setData(dataSet, "color");
- colorPalette.setNullColor(this.getStringProperty("color.null"));
- var showLegend = this.isShowLegend();
- var legendPosition = this.getLegendPosition();
- this._legends.visible(showLegend).position(legendPosition).transition(!("none" == effect), duration).setPreExecute(this.context.getPreExecute()).selector(0, this.context.node.selectAll("g.legend")).palette(0, colorPalette).title(0, this.context.getDataSlotLabel("legend.title", colorEntry)).titleFill(0, (this.context.getPropertyValue("legend.titlestyle.fill"))).titleFontSize(0, (this.context.getPropertyValue("legend.titlestyle.fontsize"))).titleFontFamily(0, (this.context.getPropertyValue("legend.titlestyle.fontfamily"))).setDataSlot(0, colorEntry);
- if (this.updateType <= 1) {
- var isClustered = colorEntry && "Clustered" == this.getStringProperty("data.handling");
- if (isClustered) {
- this._xScale = rave['library']['internal']['ScaleManager'].makeClusteredScale(data, [xEntry, colorEntry]);
- } else {
- this._xScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(data, xEntry);
- }
- this._yScale = rave['library']['internal']['ScaleManager'].makeCoordinateScale(data, yEntry);
- this._axes.visible(true).duration(duration).transpose(false).scale(0, this._xScale).scale(2, this._yScale).setDataSlot(0, xEntry).setDataSlot(2, yEntry).useDefaultSelectors().useDefaultX1Properties(true).useDefaultY1Properties(true).setTickFormatter(0, xEntry).setTickFormatter(2, yEntry);
- this.prepareLayoutComponent();
- this.prepareLayoutSizables(this._layoutComponent, false, true, true, false, showLegend);
- var isLegendLeftOrRight = "left" == legendPosition || "right" == legendPosition;
- if (isLegendLeftOrRight) {
- this._legends.preLayout(this._layoutComponent, false);
- this._axes.preLayout(this._layoutComponent, false, 0.1, 0.0, 0, 0.1, 0.05, 0);
- } else {
- this._axes.preLayout(this._layoutComponent, true, 0.1, 0.0, 0, 0.1, 0.05, 0);
- this._legends.preLayout(this._layoutComponent, true);
- }
- this._layoutComponent.layout();
- this._axes.useBoundsFromLayout(this._layoutComponent).setScaleRanges(0.1, 0.0, 0);
- this._legends.rectangle(this._layoutComponent.legendRect());
- if (this._xScale) {
- this._xScale.expandZeroExtent(false);
- this._xScale.expandPixels(this.getBoxplotSize() / 2.0, false);
- if (this.getBooleanProperty("axis.x.scale.includeZero")) {
- this._xScale.includeZero();
- }
- if (this.getBooleanProperty("axis.x.scale.nice")) {
- this._xScale.nice();
- }
- this._xDomain = this._xScale.scale().copy().domain();
- }
- if (this._yScale) {
- this._yScale.expandZeroExtent(false);
- this._yScale.expandPixels(4.0 + 3, true);
- if (this.getBooleanProperty("axis.y.scale.includeZero")) {
- this._yScale.includeZero();
- }
- if (this.getBooleanProperty("axis.y.scale.nice")) {
- this._yScale.nice();
- }
- this._yDomain = this._yScale.scale().copy().domain();
- }
- this.resetZoom();
- }
- this.setBackgroundProperties(this._layoutComponent.elementRect(), duration);
- this._clip.clipRect(this._layoutComponent.elementRect()).applyTo(this.context.node.select(".content")).call(this.context.node.select("defs"));
- this._axes.visible(true).duration(duration).useDefaultSelectors().useDefaultX1Properties(true).useDefaultY1Properties(true).setTickFormatter(0, xEntry).setTickFormatter(2, yEntry);
- this._axes.draw();
- this._legends.draw();
- this._boxplotComponent.xScale(this._xScale).yScale(this._yScale).key(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(keyEntry))).yAccessor(rave['library']['internal']['AbstractView'].originalDatumAccessor(rave['library']['internal']['AbstractView'].accessorOf(yEntry))).colorPalette(colorPalette).colorAccessor(rave['library']['internal']['AbstractView'].accessorOf(colorEntry)).effect(effect).duration(duration).boxplotSize(this.getBoxplotSize()).boxStyle(this.getStringPropertyEmptyAsNull("boxplot.style.fill"), this.getStringPropertyEmptyAsNull("boxplot.style.stroke"), this.context.convertCSSSizeToPixels(this.getStringProperty("boxplot.style.stroke-width"))).whiskerStyle(this.getStringPropertyEmptyAsNull("boxplot.whisker.style.stroke"), this.context.convertCSSSizeToPixels(this.getStringProperty("boxplot.whisker.style.stroke-width"))).meanStyle(this.getStringPropertyEmptyAsNull("boxplot.mean.style.stroke"), this.context.convertCSSSizeToPixels(this.getStringProperty("boxplot.mean.style.stroke-width"))).medianStyle(this.getStringPropertyEmptyAsNull("boxplot.median.style.stroke"), this.context.convertCSSSizeToPixels(this.getStringProperty("boxplot.median.style.stroke-width"))).outlierStyle(this.getStringPropertyEmptyAsNull("boxplot.outlier.style.fill"), this.getStringPropertyEmptyAsNull("boxplot.outlier.style.stroke"), this.context.convertCSSSizeToPixels(this.getStringProperty("boxplot.outlier.style.stroke-width"))).extremeStyle(this.getStringPropertyEmptyAsNull("boxplot.extremum.style.fill"), this.getStringPropertyEmptyAsNull("boxplot.extremum.style.stroke"), this.context.convertCSSSizeToPixels(this.getStringProperty("boxplot.extremum.style.stroke-width")));
- this.context.node.selectAll("g.elements").call(this._boxplotComponent);
- if (this.updateType <= 2) {
- var zoomOp = this.getStringProperty("zoom");
- if (this._xScale && ("all" == zoomOp || "x" == zoomOp)) {
- (this._xScale.scale()).domain(this._xDomain);
- }
- if (this._yScale && ("all" == zoomOp || "y" == zoomOp)) {
- (this._yScale.scale()).domain(this._yDomain);
- }
- var zoom = this.context.actions.action("zoom").get("zoom");
- com_ibm_rave_bundles_components_ComponentConfiguration.configureZoom(this._chart, zoom, this._xScale, this._yScale, null, null, null, this._layoutComponent.elementRect(), this._zoomP, this._zoomS, zoomOp, function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- self._boxplotComponent.boxplotSize(self.getBoxplotSize());
- self.context.node.selectAll("g.elements").call(self._boxplotComponent);
- self._axes.redraw(false);
- return self._chart;
- }
- });
- }
- this.resetUpdate();
- },
-
- getCoordinateScale : function(role) {
- if ("ROLE_X1" == role) {
- return this._xScale;
- }
- if ("ROLE_Y1" == role) {
- return this._yScale;
- }
- return null;
- },
-
- getBoxplotSize : function() {
- if (this._xScale && !(this._xScale.isContinuous()) && !(this.getBooleanProperty("boxplot.applysize"))) {
- return this._xScale.width() - 8;
- }
- var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(this.getStringProperty("boxplot.size"), this._layoutComponent.elementRect().width, 10.0);
- return v != null ? v : 10.0;
- },
-
- getGroupStructure : function() {
- return ["defs", "g.vizlibrary vizlibrary-boxplot", "(", "rect.background chart", "g.chart", "(", "g.content", "(", "rect.background elements", "g.gridlines", "(", "g.grid left", "g.grid bottom", ")", "g.elements", ")", "g.axes", "(", "g.axes-layout", "g.axisTransform left", "g.axisTransform bottom", ")", ")", "g.legends", "(", "g.legends-layout", "g.legend", ")", ")"];
- }
- });
- var com_ibm_rave_bundles_components_BackgroundComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
-
-
-
- constructor : function() {
- this._rect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- },
-
- execute : function(g) {
- this.preExecute();
- g.style("fill", this._backgroundColor != null ? this._backgroundColor : "#FFFFFF").style("fill-opacity", 1.0);
- g.attr("x", this._rect.x).attr("y", this._rect.y).attr("width", this._rect.width).attr("height", this._rect.height);
- },
-
- type : function() {
- return com_ibm_rave_bundles_component_BackgroundComponent.COMPONENT_TYPE;
- },
- backgroundColor$0 : function() {
- return this._backgroundColor;
- },
- backgroundColor$1 : function(backgroundColor) {
- this._backgroundColor = backgroundColor;
- return this;
- },
-
-
- size : function(size) {
- this._rect.x = 0;
- this._rect.y = 0;
- this._rect.width = size.w;
- this._rect.height = size.h;
- return this;
- },
-
- rect : function(rect) {
- var r = new rave['internal']['RectStruct'](rect.x, rect.y, rect.width, rect.height);
- this._rect = r;
- return this;
- },
-
- backgroundColor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.backgroundColor$0();
- }
- return this.backgroundColor$1(a0);
- }
- });
- var com_ibm_rave_bundles_components_ChartLayoutComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _leftPadding : 0, _topPadding : 0, _rightPadding : 0, _bottomPadding : 0,
- _legendChartAlign : false,
- _preLegendAtMax : false,
- _preAxesAtZero : false,
- constructor : function() {
- this._axisSizables = [];
-
- {
- this._padding = 0.0;
- this._topPadding = 0;
- this._leftPadding = 0;
- this._bottomPadding = 0;
- this._rightPadding = 0;
- this._topChartPadding = 0.0;
- this._leftChartPadding = 0.0;
- this._bottomChartPadding = 0.0;
- this._rightChartPadding = 0.0;
- this._legendChartGap = 0.0;
- this._legendPosition = "right";
- this._overallRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._legendRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._chartRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._topRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._leftRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._bottomRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._rightRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._elementRect = new rave['internal']['RectStruct'](0, 0, 0, 0);
- this._legendChartAlign = true;
- }
- },
-
- execute : function(g) {
- this.layout();
- },
-
-
- preLayout : function(legendAtMax, axesAtZero) {
- this._preLegendAtMax = legendAtMax;
- this._preAxesAtZero = axesAtZero;
- this.layout();
- this._preLegendAtMax = false;
- this._preAxesAtZero = false;
- },
-
-
- layout : function() {
- this.preExecute();
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._chartRect, this._overallRect);
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._legendRect, this._overallRect);
- var x = this._overallRect.x;
- var y = this._overallRect.y;
- var w = this._overallRect.width;
- var h = this._overallRect.height;
- var maxWH = Math.max(w, h);
- var tbLegend = "top" == this._legendPosition || "bottom" == this._legendPosition;
- var legendPercent = this._axisSizables.length == 0 ? 0.5 : 0.3;
- var legendMaxSize = (tbLegend ? this._legendRect.height : this._legendRect.width) * legendPercent;
- var legendDynamicSize = this._legendSizable ? (this._preLegendAtMax ? maxWH : this._legendSizable.getPreferredSize()) : 0;
- if (legendDynamicSize > legendMaxSize) {
- legendDynamicSize = legendMaxSize;
- }
- var isLegendTop = false;
- var isLegendBottom = false;
- var isLegendLeft = false;
- var isLegendRight = false;
- if ("top" == this._legendPosition) {
- this._legendRect.height = legendDynamicSize;
- this._chartRect.height -= this._legendRect.height;
- this._chartRect.y += this._legendRect.height;
- isLegendTop = true;
- } else if ("bottom" == this._legendPosition) {
- this._legendRect.height = legendDynamicSize;
- this._chartRect.height -= this._legendRect.height;
- this._legendRect.y = y + h - this._legendRect.height;
- isLegendBottom = true;
- } else if ("left" == this._legendPosition) {
- this._legendRect.width = legendDynamicSize;
- this._chartRect.width -= this._legendRect.width;
- this._chartRect.x += this._legendRect.width;
- isLegendLeft = true;
- } else {
- this._legendRect.width = legendDynamicSize;
- this._chartRect.width -= this._legendRect.width;
- this._legendRect.x = x + w - this._legendRect.width;
- isLegendRight = true;
- }
- if (this.evaluatePadding(this._padding, w, h)) {
- var lrgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, w);
- var tbgap = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._legendChartGap, h);
- var chartTop = isLegendTop && this._legendSizable ? tbgap : this._topPadding;
- var chartLeft = isLegendLeft && this._legendSizable ? lrgap : this._leftPadding;
- var chartBottom = isLegendBottom && this._legendSizable ? tbgap : this._bottomPadding;
- var chartRight = isLegendRight && this._legendSizable ? lrgap : this._rightPadding;
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
- } else {
- var lrpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, w);
- var tbpadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._padding, h);
- var chartTop = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);
- var chartLeft = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding, w);
- var chartBottom = tbpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding, h);
- var chartRight = lrpadding + com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._rightChartPadding, w);
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset(this._chartRect, chartTop, chartLeft, chartBottom, chartRight);
- this._topPadding = tbpadding;
- this._leftPadding = lrpadding;
- this._bottomPadding = tbpadding;
- this._rightPadding = lrpadding;
- }
- if (this._legendSizable) {
- if (isLegendRight) {
- this._legendRect.x -= this._rightPadding;
- this._chartRect.width -= this._rightPadding;
- this._legendRect.y += this._topPadding;
- this._legendRect.height -= (this._topPadding + this._bottomPadding);
- } else if (isLegendLeft) {
- this._legendRect.x += this._leftPadding;
- this._chartRect.x += this._leftPadding;
- this._chartRect.width -= this._leftPadding;
- this._legendRect.y += this._topPadding;
- this._legendRect.height -= (this._topPadding + this._bottomPadding);
- } else if (isLegendTop) {
- this._legendRect.y += this._topPadding;
- this._chartRect.y += this._topPadding;
- this._chartRect.height -= this._topPadding;
- this._legendRect.x += this._leftPadding;
- this._legendRect.width -= (this._leftPadding + this._rightPadding);
- } else {
- this._legendRect.y -= this._bottomPadding;
- this._chartRect.height -= this._bottomPadding;
- this._legendRect.x += this._leftPadding;
- this._legendRect.width -= (this._leftPadding + this._rightPadding);
- }
- }
- x = this._chartRect.x;
- y = this._chartRect.y;
- w = this._chartRect.width;
- h = this._chartRect.height;
- var bottomH = 0;
- var topH = 0;
- var leftW = 0;
- var rightW = 0;
- var tbSO = 0;
- var lrSO = 0;
- if (!this._preAxesAtZero) {
- var countHorz = 0;
- var countVert = 0;
- for (var i = 0; i < this._axisSizables.length; ++i) {
- var sizable = this._axisSizables[i];
- if (sizable) {
- var orientation = sizable.getSizableOrientation();
- if ("top" == orientation || "bottom" == orientation) {
- countHorz++;
- } else {
- countVert++;
- }
- }
- }
- for (var i = 0; i < this._axisSizables.length; ++i) {
- var sizable = this._axisSizables[i];
- if (sizable) {
- var orientation = sizable.getSizableOrientation();
- var tbAxis = "top" == orientation || "bottom" == orientation;
- var axisDynamicSize = sizable.getPreferredSize();
- var spillOver = sizable.getSpillOverSize();
- if (tbAxis) {
- var axisPercent = countHorz > 1 ? 0.4 : 0.5;
- if (axisDynamicSize > this._chartRect.height * axisPercent) {
- axisDynamicSize = this._chartRect.height * axisPercent;
- }
- if ("top" == orientation) {
- topH = axisDynamicSize;
- } else {
- bottomH = axisDynamicSize;
- }
- if (spillOver > lrSO) {
- lrSO = spillOver;
- }
- } else {
- var axisPercent = countVert > 1 ? 0.4 : 0.5;
- if (axisDynamicSize > this._chartRect.width * axisPercent) {
- axisDynamicSize = this._chartRect.width * axisPercent;
- }
- if ("left" == orientation) {
- leftW = axisDynamicSize;
- } else {
- rightW = axisDynamicSize;
- }
- if (spillOver > tbSO) {
- tbSO = spillOver;
- }
- }
- }
- }
- }
- if (lrSO > leftW) {
- leftW = lrSO;
- }
- if (lrSO > rightW) {
- rightW = lrSO;
- }
- if (tbSO > topH) {
- topH = tbSO;
- }
- if (tbSO > bottomH) {
- bottomH = tbSO;
- }
- this._leftRect.x = x;
- this._leftRect.width = leftW;
- this._leftRect.y = y;
- this._leftRect.height = h;
- this._rightRect.x = x + w - rightW;
- this._rightRect.width = rightW;
- this._rightRect.y = y;
- this._rightRect.height = h;
- this._topRect.y = y;
- this._topRect.height = topH;
- this._topRect.x = x;
- this._topRect.width = w;
- this._bottomRect.y = y + h - bottomH;
- this._bottomRect.height = bottomH;
- this._bottomRect.x = x;
- this._bottomRect.width = w;
- this._elementRect.x = x + leftW;
- this._elementRect.y = y + topH;
- this._elementRect.width = w - (leftW + rightW);
- this._elementRect.height = h - (topH + bottomH);
- if (this._legendSizable && this._legendChartAlign) {
- if (tbLegend) {
- this._legendRect.x = this._elementRect.x;
- this._legendRect.width = this._elementRect.width;
- } else {
- this._legendRect.y = this._elementRect.y;
- this._legendRect.height = this._elementRect.height;
- }
- }
- },
- evaluatePadding : function(padding, horizontalExtent, verticalExtent) {
- if (padding == null) {
- return false;
- }
- var paddingString = (padding) + "";
- if (paddingString.length == 0) {
- return false;
- }
- this._topPadding = 0;
- this._leftPadding = 0;
- this._bottomPadding = 0;
- this._rightPadding = 0;
- var items = paddingString.split(new RegExp(";"));
- for (var __i_enFor0 = 0, __len_enFor0 = items.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var item = items[__i_enFor0];
- var parts = item.split(new RegExp(":"));
- if (items.length == 1 && parts.length != 2) {
- return false;
- }
- if (parts.length == 2) {
- if (0 <= parts[0].indexOf("top")) {
- this._topPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
- } else if (0 <= parts[0].indexOf("left")) {
- this._leftPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
- } else if (0 <= parts[0].indexOf("bottom")) {
- this._bottomPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], verticalExtent);
- } else if (0 <= parts[0].indexOf("right")) {
- this._rightPadding = com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(parts[1], horizontalExtent);
- }
- }
- }
- return true;
- },
-
-
- legendRect : function() {
- return this._legendRect;
- },
-
-
- chartRect : function() {
- return this._chartRect;
- },
-
-
- topRect : function() {
- return this._topRect;
- },
-
-
- leftRect : function() {
- return this._leftRect;
- },
-
-
- bottomRect : function() {
- return this._bottomRect;
- },
-
-
- rightRect : function() {
- return this._rightRect;
- },
-
-
- elementRect : function() {
- return this._elementRect;
- },
-
-
- overall : function(overall) {
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect(this._overallRect, overall);
- return this;
- },
- padding$0 : function() {
- return this._padding;
- },
- legendChartAlign$0 : function() {
- return this._legendChartAlign;
- },
- legendChartGap$0 : function() {
- return this._legendChartGap;
- },
- topPadding$0 : function() {
- return this._topChartPadding;
- },
- leftPadding$0 : function() {
- return this._leftChartPadding;
- },
- bottomPadding$0 : function() {
- return this._bottomChartPadding;
- },
- rightPadding$0 : function() {
- return this._rightChartPadding;
- },
- legendPosition$0 : function() {
- return this._legendPosition;
- },
- topPadding$1 : function(padding) {
- this._topChartPadding = padding;
- return this;
- },
- leftPadding$1 : function(padding) {
- this._leftChartPadding = padding;
- return this;
- },
- bottomPadding$1 : function(padding) {
- this._bottomChartPadding = padding;
- return this;
- },
- rightPadding$1 : function(padding) {
- this._rightChartPadding = padding;
- return this;
- },
-
- type : function() {
- return com_ibm_rave_bundles_component_ChartLayoutComponent.COMPONENT_TYPE;
- },
- padding$1 : function(value) {
- this._padding = value;
- return this;
- },
-
- chartPadding : function(top, left, bottom, right) {
- this._topChartPadding = top;
- this._leftChartPadding = left;
- this._bottomChartPadding = bottom;
- this._rightChartPadding = right;
- return this;
- },
- legendChartAlign$1 : function(legendChartAlign) {
- this._legendChartAlign = legendChartAlign;
- return this;
- },
- legendChartGap$1 : function(value) {
- this._legendChartGap = value;
- return this;
- },
- legendPosition$1 : function(position) {
- if ("top" == position || "bottom" == position || "left" == position || "right" == position) {
- this._legendPosition = position;
- }
- return this;
- },
-
- legendSize : function(sizable) {
- this._legendSizable = sizable;
- return this;
- },
-
- removeAxisSizables : function() {
- this._axisSizables.length = 0;
- return this;
- },
-
- addAxisSizable : function(sizable) {
- this._axisSizables.push(sizable);
- return this;
- },
-
- padding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.padding$0();
- }
- return this.padding$1(a0);
- },
-
- legendChartAlign : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendChartAlign$0();
- }
- return this.legendChartAlign$1(a0);
- },
-
- legendChartGap : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendChartGap$0();
- }
- return this.legendChartGap$1(a0);
- },
-
- topPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.topPadding$0();
- }
- return this.topPadding$1(a0);
- },
-
- leftPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.leftPadding$0();
- }
- return this.leftPadding$1(a0);
- },
-
- bottomPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.bottomPadding$0();
- }
- return this.bottomPadding$1(a0);
- },
-
- rightPadding : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.rightPadding$0();
- }
- return this.rightPadding$1(a0);
- },
-
- legendPosition : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.legendPosition$0();
- }
- return this.legendPosition$1(a0);
- }
- });
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.copyRect = function(t, s) {
- t.x = s.x;
- t.y = s.y;
- t.width = s.width;
- t.height = s.height;
- return t;
- };
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.inset = function(r, top, left, bottom, right) {
- var ileft = Math.max(0.0, left);
- var iright = Math.max(0.0, right);
- if (ileft + iright <= r.width) {
- r.x += ileft;
- r.width -= ileft + iright;
- }
- var itop = Math.max(0.0, top);
- var ibottom = Math.max(0.0, bottom);
- if (itop + ibottom <= r.height) {
- r.y += itop;
- r.height -= itop + ibottom;
- }
- return r;
- };
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize = function(value, extent) {
- var v = rave['library']['internal']['CSSConverter'].convertCSSSizeToPixelNumber(value, extent, 10.0);
- var d = v != null ? v : 0;
- return Math.max(0.0, Math.min(d, extent));
- };
-
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT = 0.4;
-
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_AXIS_PERCENT_SINGLE_PER_ORIENTATION = 0.5;
-
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT = 0.3;
-
- com_ibm_rave_bundles_components_ChartLayoutComponentImpl.MAX_LEGEND_PERCENT_NO_AXIS = 0.5;
- var com_ibm_rave_bundles_components_ClipPathComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
-
-
- constructor : function(id) {
- this._clipRect = new rave['internal']['RectStruct'](0, 0, 100, 100);
-
- {
- this._id = id;
- }
- },
-
- type : function() {
- return "ClipPathComponent";
- },
-
-
- clipRect : function(rect) {
- this._clipRect = new rave['internal']['RectStruct'](rect.x - 1, rect.y - 1, rect.width + 2, rect.height + 2);
- return this;
- },
-
-
- applyTo : function(s) {
- s.attr("clip-path", "url(" + this.url() + ")");
- return this;
- },
-
-
- id : function() {
- return this._id;
- },
-
-
- url : function() {
- return "#" + this._id;
- },
-
- execute : function(g) {
- var clipPath = g.selectAll("#" + this._id).data([0]);
- clipPath.enter().append("clipPath").attr("id", this._id).append("rect");
- rave.transition(clipPath.select("rect")).attr("x", this._clipRect.x).attr("y", this._clipRect.y).attr("width", this._clipRect.width).attr("height", this._clipRect.height);
- }
- });
- var com_ibm_rave_bundles_components_LegendComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _visible : false,
-
- _swatchSize : 0,
-
-
- constructor : function() {
- this._visible = true;
- this._size = null;
- this._colorPalette = null;
- this._orient = "horizontal";
- this._swatchSize = 16.0 * 16.0;
- this._swatchSizeFunc = null;
- this._scale = null;
- this._shape = "square";
- this._title = null;
- this._titleStyle = {};
- this._entryStyle = {};
- this._labelFormat = null;
- this._swatchLegend = null;
- this._continuousLegend = null;
- this._legendType = null;
- },
-
- type : function() {
- return "LegendComponent";
- },
-
- execute : function(g) {
- if (this._colorPalette) {
- if ("continuous" == this._colorPalette.getType()) {
- if (!this._continuousLegend) {
- this._continuousLegend = (rave.capabilities.extension("legend")).continuous();
- }
- this._legendType = "ContinuousLegend";
- } else {
- if (!this._swatchLegend) {
- this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
- }
- this._legendType = "SwatchLegend";
- }
- } else if (this._swatchSizeFunc) {
- if (!this._swatchLegend) {
- this._swatchLegend = (rave.capabilities.extension("legend")).swatch();
- }
- this._legendType = "SwatchLegend";
- } else {
- this._legendType = null;
- }
- this.preExecute();
- if (!this._visible || (!this._colorPalette && !this._swatchSizeFunc) || !this._size || this._size[0] <= 0 || this._size[1] <= 0) {
- g.selectAll("*").remove();
- return;
- }
- var fontChecker = rave.capabilities.extension("fontchecker");
- if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
- this._continuousLegend.shapeRectSize("horizontal" == this._orient ? [-1.0, 16.0] : [16.0, -1.0]).size(this._size).scale(this._colorPalette.getScale()).orient(this._orient).title(this._title).titleFill(this._titleStyle["fill"]).titleFontSize(this._titleStyle["font-size"]).titleFontFamily(this._titleStyle["font-Family"]).titleAlignment("start").labelFormat(this._labelFormat);
- var legend = g.call(this._continuousLegend);
- if (this._entryStyle) {
- legend.selectAll(".legendLabel").style(this._entryStyle);
- }
- if (this._titleStyle) {
- legend.selectAll(".legendTitle").style(this._titleStyle);
- }
- if (fontChecker) {
- legend.selectAll(".legendLabel").call(fontChecker);
- legend.selectAll(".legendTitle").call(fontChecker);
- }
- } else {
- var insets = {};
- insets["bottom"] = 5;
- var swatchSize = this._swatchSize;
- var scale = null;
- var labelFormatter = this._labelFormat;
- if (this._swatchSizeFunc && this._scale) {
- swatchSize = this._swatchSizeFunc;
- scale = this._scale;
- }
- if (this._colorPalette) {
- scale = this._colorPalette.getScale();
- var originalDomain = this._colorPalette.originalDomain();
- if (originalDomain) {
- scale.domain(originalDomain);
- var f = this._colorPalette.originalDomainLabelAccessor();
- if (this._labelFormat) {
- var self = this;
- labelFormatter = function(data, index, groupIndex) {
- return self._labelFormat.call(this, f.call(this, data, index, groupIndex), index, groupIndex);
- };
- } else {
- labelFormatter = f;
- }
- }
- }
- this._swatchLegend.labelPadding(8).size(this._size).scale(scale).orient(this._orient).swatchSize(swatchSize).shape(this._shape).title(this._title).titleFill(this._titleStyle["fill"]).titleFontSize(this._titleStyle["font-size"]).titleFontFamily(this._titleStyle["font-family"]).titleAlignment("start").labelFormat(labelFormatter).titleInsets(insets);
- var legend = g.call(this._swatchLegend);
- if (this._entryStyle) {
- legend.selectAll(".legendLabel").style(this._entryStyle);
- }
- if (this._titleStyle) {
- legend.selectAll(".legendTitle").style(this._titleStyle);
- }
- if (fontChecker) {
- legend.selectAll(".legendLabel").call(fontChecker);
- legend.selectAll(".legendTitle").call(fontChecker);
- }
- }
- },
-
- legend : function() {
- if ("ContinuousLegend" == this._legendType) {
- return this._continuousLegend;
- }
- if ("SwatchLegend" == this._legendType) {
- return this._swatchLegend;
- }
- return null;
- },
-
- legendType : function() {
- return this._legendType;
- },
-
-
- visible : function(visible) {
- this._visible = visible;
- return this;
- },
-
-
- isVisible : function() {
- return this._visible;
- },
-
-
- size : function(size) {
- this._size = size;
- return this;
- },
-
-
- colorPalette : function(colorPalette) {
- this._colorPalette = colorPalette;
- return this;
- },
-
-
- orient : function(orient) {
- if ("horizontal" == orient || "vertical" == orient) {
- this._orient = orient;
- }
- return this;
- },
-
-
- position : function(position) {
- return this.orient(com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf(position));
- },
- swatchSize$0 : function(swatchSize) {
- if (swatchSize >= 0.0 && swatchSize != null) {
- this._swatchSize = swatchSize;
- }
- return this;
- },
-
- scale : function(scale) {
- this._scale = scale;
- return this;
- },
- swatchSize$1 : function(swatchSize) {
- if (swatchSize) {
- this._swatchSizeFunc = swatchSize;
- }
- return this;
- },
-
- shape : function(shape) {
- this._shape = shape;
- return this;
- },
-
- title : function(title) {
- this._title = (title != null && title.length > 0) ? title : null;
- return this;
- },
-
- titleFill : function(titleFill) {
- this._titleStyle["fill"] = titleFill;
- return this;
- },
-
- titleFontSize : function(titleFontSize) {
- this._titleStyle["font-size"] = titleFontSize;
- return this;
- },
-
- titleFontFamily : function(titleFontFamily) {
- this._titleStyle["font-family"] = titleFontFamily;
- return this;
- },
-
- labelFormat : function(labelFormat) {
- this._labelFormat = labelFormat;
- return this;
- },
-
- titleFont : function(titleFontStyle) {
- this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(titleFontStyle);
- return this;
- },
-
- entryFont : function(entryFontStyle) {
- this._entryStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(entryFontStyle);
- return this;
- },
-
- getSpaceUsed : function() {
- if (this._colorPalette && "continuous" == this._colorPalette.getType()) {
- return this._continuousLegend.getUsedSize() + 2;
- } else {
- return this._swatchLegend.getUsedSize() + 2;
- }
- },
-
- swatchSize : function(a0) {
- var args = arguments;
- if (args.length == 1 && typeof a0 === "function") {
- return this.swatchSize$1(a0);
- }
- return this.swatchSize$0(a0);
- }
- });
-
- com_ibm_rave_bundles_components_LegendComponentImpl.orientationOf = function(position) {
- if ("top" == position || "bottom" == position) {
- return "horizontal";
- }
- return "vertical";
- };
- com_ibm_rave_bundles_components_LegendComponentImpl.BAR_THINKNESS = 16;
- com_ibm_rave_bundles_components_LegendComponentImpl.SWATCH_SIZE = 16;
-
- com_ibm_rave_bundles_components_LegendComponentImpl.TOP = "top";
-
- com_ibm_rave_bundles_components_LegendComponentImpl.BOTTOM = "bottom";
-
- com_ibm_rave_bundles_components_LegendComponentImpl.LEFT = "left";
-
- com_ibm_rave_bundles_components_LegendComponentImpl.RIGHT = "right";
-
- com_ibm_rave_bundles_components_LegendComponentImpl.ADJUSTABLE = -1;
- var com_ibm_rave_bundles_components_AxisComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
-
-
-
-
-
-
-
-
-
-
-
-
-
- _axisTitle : null,
-
-
- _titleStyle : null,
-
-
- _lineColor : null,
-
-
- _tickColor : null,
-
-
- _labelStyle : null,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _displayAxisTitle : false,
-
-
- _displayAxisLine : false,
-
-
- _displayTicks : false,
-
-
- _displayTickLabels : false,
-
-
- _showPanZoomTickLabels : false,
-
- _rotateLabels : false,
- _staggerCellWidth : 0,
- _staggerAlignFirstAtStart : false,
- _staggerAlignLastAtEnd : false,
- _layoutTimerId : 0,
- _layoutTitleSize : 0,
- _layoutLabelSize : 0,
- _layoutLabelHeight : 0,
- _layoutAverageDigitWidth : 0,
- _layoutSpillOver : 0,
-
-
- _hideOverlappingLabels : false,
-
- _pendingLabelTimer : false,
-
- _padding : 0,
-
- _renderedShapes : false,
- _layoutMode : -1,
- _allowAutoAxisLayoutToChangeOrientaiton : true,
- _lastAutomaticAxisLayoutOrientation : -1,
- _allowStagger : false,
- _allowRotate45 : false,
- _allowRotate90 : false,
- constructor : function() {
- {
- var self = this;
- this._axisLineProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var line = this.selectAll("path.domain");
- if (self._lineColor != null) {
- line.style("stroke", self._lineColor);
- }
- if (self._displayAxisLine) {
- line.attr("visibility", null);
- } else {
- line.attr("visibility", "hidden");
- }
- return null;
- }
- };
- this._axisTickProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var tickLines = this.selectAll("line");
- if (self._displayTicks) {
- tickLines.attr("visibility", null);
- } else {
- tickLines.attr("visibility", "hidden");
- }
- if (self._lineColor != null) {
- tickLines.style("stroke", self._tickColor);
- }
- return null;
- }
- };
- this._axisTickLabelProperties = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- var labels = this.selectAll("text");
- labels.each(self._displayHideLabels);
- labels.each(self._panZoomLabels);
- labels.style(self._labelStyle);
- self._axis.ticksHandler(null);
- return null;
- }
- };
- this._displayHideLabels = function(obj, group, index) {
- if (self._displayTickLabels) {
- if (this.rave_hasProperty("__tickLabelHidden__")) {
- this.rave_removeProperty("__tickLabelHidden__");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- if (count <= 1) {
- this.rave_removeProperty("__hiddenCount__");
- this.removeAttribute("visibility");
- } else {
- this.rave_setProperty("__hiddenCount__", count - 1);
- }
- }
- } else {
- if (!(this.rave_hasProperty("__tickLabelHidden__"))) {
- this.setAttribute("visibility", "hidden");
- this.rave_setProperty("__tickLabelHidden__", "hidden");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- this.rave_setProperty("__hiddenCount__", count + 1);
- }
- }
- };
- this._panZoomLabels = function(obj, group, index) {
- if (self._showPanZoomTickLabels) {
- if (this.rave_hasProperty("__panZoomHidden__")) {
- this.rave_removeProperty("__panZoomHidden__");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- if (count <= 1) {
- this.rave_removeProperty("__hiddenCount__");
- this.removeAttribute("visibility");
- } else {
- this.rave_setProperty("__hiddenCount__", count - 1);
- }
- }
- } else {
- if (!(this.rave_hasProperty("__panZoomHidden__"))) {
- this.setAttribute("visibility", "hidden");
- this.rave_setProperty("__panZoomHidden__", "hidden");
- var count = ~~ (this.rave_getProperty("__hiddenCount__"));
- this.rave_setProperty("__hiddenCount__", count + 1);
- }
- }
- };
- }
- this._tickHandler = new com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler(this._axisTickLabelProperties, this._axisTickProperties);
-
- {
- this._axis = null;
- this._role = null;
- this._scale = null;
- this._orient = "bottom";
- this._bounds = null;
- this._displayAxisTitle = true;
- this._axisTitle = null;
- this._titleStyle = {};
- this._displayAxisLine = true;
- this._lineColor = null;
- this._displayTicks = true;
- this._tickColor = null;
- this._displayTickLabels = true;
- this._labelStyle = {};
- this._rotateLabels = false;
- this._hideOverlappingLabels = true;
- this._dropOverlap = new com_ibm_rave_bundles_utilities_BundleLabelDropper();
- this._tickFormat = null;
- this._showPanZoomTickLabels = true;
- this._pendingLabelTimer = false;
- this._padding = 16;
- this._textFlow = rave.capabilities.extension("textflow");
- this._fontChecker = rave.capabilities.extension("fontchecker");
- this._renderedShapes = false;
- }
- },
-
- type : function() {
- return com_ibm_rave_bundles_component_AxisComponent.COMPONENT_TYPE;
- },
-
- role : function() {
- return this._role;
- },
-
- execute : function(g) {
- this.preExecute();
- if (!this._scale) {
- g.selectAll("*").remove();
- this._renderedShapes = false;
- return;
- }
- this._renderedShapes = true;
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- this._hideOverlappingLabels = false;
- this._rotateLabels = true;
- } else {
- this._hideOverlappingLabels = true;
- this._rotateLabels = true;
- }
- this.drawTitle(g);
- this.drawAxis(g);
- this.handleAxisText(g);
- this.drawTitle(g);
- },
-
- handleAxisText : function(g) {
- this.stopLabelDroppingUpdate();
- var duration = 0, delay = 0;
- var g2 = rave.transition(g);
- if (g2.isTransition()) {
- var t2 = (g2);
- duration = t2.duration();
- delay = t2.delay();
- }
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("g.tick").filter(rave['library']['internal']['BundleUtils'].notExit).selectAll("text");
- var fontChecker = rave.capabilities.extension("fontchecker");
- labels.style(this._labelStyle);
- if (fontChecker) {
- labels.call(fontChecker);
- }
- var mode = this._allowAutoAxisLayoutToChangeOrientaiton ? this.determineWhichAutoMode(g) : this._lastAutomaticAxisLayoutOrientation;
- this.configureStaggerData(g, mode);
- this.handleLabelsRotationAndPosition(g, labels, mode);
- this.hashingNumericScales(labels, this.labelExtent(g), mode);
- if (duration == 0) {
- this.doLabelWrapping(g, mode);
- this.handleLabelsRotationAndPosition(g, labels, mode);
- }
- this._lastAutomaticAxisLayoutOrientation = mode;
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var tick = axisSelector.append("g").classed("tick", true);
- var tickText = tick.append("text");
- if (labels.size() == 0) {
- var singleValue = this._scale.scale().domain()[0];
- var formatter = this._tickFormat;
- if (!formatter) {
- var tickFunc = this._scale.scale().tickFormat;
- if (tickFunc) {
- formatter = tickFunc.apply(tickFunc, [singleValue]);
- }
- }
- var node = tickText[0][0];
- var stringValue = formatter ? formatter.call(node, singleValue, 0, 0) : ""+(singleValue);
- tickText.text(stringValue);
- var dim = node.getBBox();
- this._layoutLabelSize = isHorizontal ? dim.height : dim.width;
- if (!isHorizontal || mode != 0) {
- tickText.text(".0");
- this._layoutLabelSize += node.getBBox().width;
- }
- }
- if (!isHorizontal || mode != 0) {
- tickText.text(".0");
- var node = tickText[0][0];
- var dim = node.getBBox();
- this._layoutAverageDigitWidth = dim.width;
- }
- tick.remove();
- }
- if (this._hideOverlappingLabels && duration > 0) {
- this.updateLabelDropping(labels, duration, delay);
- }
- if (duration > 0) {
- this.doLabelWrappingAfterAnimation(g, labels, mode, duration, delay);
- }
- if (!this._displayTickLabels) {
- this._layoutLabelSize = 0;
- this._layoutAverageDigitWidth = 0;
- }
- },
-
- handleLabelsRotationAndPosition : function(g, labels, mode) {
- if (mode == 2 || mode == 1) {
- if (this._orient == "bottom") {
- this.rotateLabels(g, labels, "end", mode);
- } else if (this._orient == "top") {
- this.rotateLabels(g, labels, "start", mode);
- } else {
- this.rotateLabels(g, labels, "middle", mode);
- }
- } else {
- if (this._orient == "bottom" || this._orient == "top") {
- this.rotateLabels(g, labels, "middle", mode);
- } else if (this._orient == "right") {
- this.rotateLabels(g, labels, "start", mode);
- } else {
- this.rotateLabels(g, labels, "end", mode);
- }
- }
- },
-
- hashingNumericScales : function(labels, extent, mode) {
- if (!labels || !extent) {
- return;
- }
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var tickSpace = mode == 1 ? extent[1] : extent[0];
- this._textTruncationIndicator = "";
- this._layoutLabelSize = 0;
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[i][0];
- var dim = node.getBBox();
- var width = dim.width;
- var height = dim.height;
- var size = !isHorizontal || mode == 1 ? width : height;
- if (size > this._layoutLabelSize) {
- this._layoutLabelSize = size;
- }
- if (width >= tickSpace) {
- if (this._simplifiedTickFormat) {
- var newText = this._simplifiedTickFormat.call(null, node.rave_getData(), 0, 0);
- if (newText != null) {
- node.rave_setText(newText);
- }
- if (node.getBBox().width >= tickSpace) {
- node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
- }
- } else {
- node.rave_setText(this.stringOfSize(node.rave_getText().length, "#"));
- }
- }
- }
- }
- },
-
- stringOfSize : function(size, ch) {
- var returnString = "";
- for (var i = 0; i < size; ++i) {
- returnString += ch;
- }
- return returnString;
- },
- configureStaggerData : function(g, mode) {
- if (mode == 3 || mode == 2) {
- var horizontalDimensions = this.labelExtent(g);
- var cellWidth = horizontalDimensions[0];
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("text");
- var domain = this._scale.scale().domain();
- var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
- this._staggerRotate45Nodes = [];
- this._staggerFirstNode = null;
- this._staggerLastNode = null;
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[0][i];
- if (this.isValid(node.rave_getData())) {
- var domainIndex = -1;
- if (mode == 3) {
- var domainLabel = !this._tickFormat ? node.rave_getText() : originalDataLabelAccessor.call(node, node.rave_getData(), 0, 0);
- for (var index = 0; index < domain.length; ++index) {
- if (domain[index].toString() == domainLabel) {
- domainIndex = index;
- break;
- }
- }
- }
- this._staggerRotate45Nodes.push(new com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex(node, domainIndex));
- if (domainIndex == 0) {
- this._staggerFirstNode = node;
- }
- if (domainIndex == domain.length - 1) {
- this._staggerLastNode = node;
- }
- }
- }
- this._staggerCellWidth = cellWidth * 2;
- this._staggerAlignFirstAtStart = this._staggerFirstNode ? this._staggerFirstNode.getBBox().width > cellWidth : false;
- this._staggerAlignLastAtEnd = this._staggerLastNode ? this._staggerLastNode.getBBox().width > cellWidth : false;
- }
- },
- getStaggerIndex : function(node) {
- for (var index = 0; index < this._staggerRotate45Nodes.length; ++index) {
- if (this._staggerRotate45Nodes[index].contains(node)) {
- var domainIndex = this._staggerRotate45Nodes[index].getIndex();
- return domainIndex == -1 ? 0 : domainIndex;
- }
- }
- return -1;
- },
- getStaggerCount : function() {
- var domain = this._scale.scale().domain();
- return domain.length;
- },
-
- determineWhichAutoMode : function(g) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var axisSelector = g.selectAll("g.axis");
- var labels = axisSelector.selectAll("text");
- var dim = this.labelExtent(g);
- var cellWidth = dim[0];
- var cellWidth90 = dim[1];
- var layoutLabelHeight = 0;
- var layoutLabelWidth = 0;
- var horizontalScore = 0;
- var staggerScore = 0;
- var rotate45Score = 0;
- var rotate90Score = 0;
- var validNodes = [];
- for (var i = 0; i < labels.size(); ++i) {
- var node = labels[0][i];
- if (this.isValid(node.rave_getData())) {
- validNodes.push(node);
- }
- }
- var labelCount = validNodes.length;
- if (!(this._scale.isOrdinal()) && !(this._scale.isClustered())) {
- var mode = 0;
- if (isHorizontal) {
- mode = this._layoutMode == 1 ? 1 : 0;
- var tick = axisSelector.append("g").classed("tick", true);
- var tickText = tick.append("text");
- tickText.style(this._labelStyle);
- tickText.text(",0");
- var node = tickText[0][0];
- var zeroWidth = node.getBBox().width;
- tick.remove();
- var widestLabel = 0;
- for (var i = 0; i < labelCount; ++i) {
- node = validNodes[i];
- var nodeRect = node.getBBox();
- if (nodeRect.width > widestLabel) {
- widestLabel = nodeRect.width;
- }
- if (nodeRect.height > this._layoutLabelHeight) {
- this._layoutLabelHeight = nodeRect.height;
- }
- }
- widestLabel += zeroWidth;
- this._layoutSpillOver = mode == 1 ? this._layoutLabelHeight / 2 : widestLabel / 2 + 2;
- } else {
- for (var i = 0; i < labelCount; ++i) {
- var node = validNodes[i];
- var nodeRect = node.getBBox();
- if (nodeRect.height > this._layoutLabelHeight) {
- this._layoutLabelHeight = nodeRect.height;
- }
- }
- this._layoutSpillOver = this._layoutLabelHeight / 2;
- }
- return mode;
- }
- var originalDataLabelAccessor = (this._scale).originalDomainLabelAccessor();
- var staggerStringsWontMatch = this._tickFormat && !originalDataLabelAccessor;
- var calcStagger = ((this._allowStagger && this._layoutMode == -1) || this._layoutMode == 3) && !staggerStringsWontMatch;
- var calcRotate45 = (this._allowRotate45 && this._layoutMode == -1) || this._layoutMode == 2;
- var calcRotate90 = (this._allowRotate90 && this._layoutMode == -1) || this._layoutMode == 1;
- var spaceFor45Label = 0;
- for (var i = 0; i < labelCount; ++i) {
- var node = validNodes[i];
- var nodeRect = node.getBBox();
- layoutLabelHeight = nodeRect.height;
- var labelWidth = nodeRect.width;
- if (labelWidth > layoutLabelWidth) {
- layoutLabelWidth = labelWidth;
- }
- horizontalScore += (labelWidth <= cellWidth ? 1 : cellWidth / labelWidth);
- if (isHorizontal) {
- if (calcStagger) {
- var spaceForLabel = cellWidth * 2;
- if (i == 0 && i == labelCount - 1) {
- spaceForLabel *= 0.5;
- } else if (i == 0 || i == labelCount - 1) {
- spaceForLabel *= 0.75;
- }
- staggerScore += (labelWidth <= spaceForLabel ? 1 : spaceForLabel / labelWidth);
- }
- if (calcRotate45) {
- if (spaceFor45Label == 0) {
- spaceFor45Label = cellWidth90 / 0.7071 - layoutLabelHeight;
- }
- var space = this.calculate45DegreeSpace(node, spaceFor45Label);
- rotate45Score += (labelWidth <= space ? 1 : space / labelWidth);
- }
- if (calcRotate90) {
- rotate90Score += (labelWidth <= cellWidth90 ? 1 : cellWidth90 / labelWidth);
- }
- }
- }
- var mode = 0;
- if (this._layoutMode == -1) {
- if (isHorizontal && this._allowStagger) {
- horizontalScore *= 1.1;
- staggerScore *= 1.1;
- }
- if ((staggerScore > horizontalScore) && (staggerScore >= rotate45Score) && (staggerScore >= rotate90Score)) {
- mode = 3;
- } else if ((rotate45Score > horizontalScore) && (rotate45Score >= rotate90Score)) {
- mode = 2;
- } else if (rotate90Score > horizontalScore) {
- mode = 1;
- }
- } else {
- if ((this._layoutMode == 3 && staggerStringsWontMatch) || !isHorizontal) {
- mode = 0;
- } else {
- mode = this._layoutMode;
- }
- }
- if (isHorizontal) {
- switch (mode) {
- case 3:
- this._layoutLabelSize = layoutLabelHeight * 2;
- break;
- case 2:
- this._layoutLabelSize = (layoutLabelWidth + layoutLabelHeight) * 0.7071;
- break;
- case 1:
- this._layoutLabelSize = layoutLabelWidth;
- break;
- case 0:
- default:
- this._layoutLabelSize = layoutLabelHeight;
- break;
- }
- } else {
- this._layoutLabelSize = layoutLabelWidth;
- }
- this._layoutLabelHeight = layoutLabelHeight;
- return mode;
- },
- calculate45DegreeSpace : function(node, maxWidth) {
- var width = maxWidth;
- var tfm = node.rave_getParentNode().getAttribute("transform");
- if (tfm != null) {
- var tfmString = tfm.toString();
- var indexOfTrans = tfmString.indexOf("translate(");
- if (indexOfTrans != -1) {
- indexOfTrans += 10;
- var indexOfComma = tfmString.indexOf(",", indexOfTrans);
- if (indexOfComma != -1) {
- var xAmount = tfmString.substring(indexOfTrans, indexOfComma);
- var xLabelPos = + (xAmount);
- var width45Degrees = node.getBBox().width;
- var xLabelWidth = width45Degrees * 0.7071;
- var isBottom = this._orient == "bottom";
- if (isBottom) {
- xLabelPos -= node.getBBox().height / 4;
- if (xLabelPos - xLabelWidth < this._bounds.x) {
- xLabelWidth = xLabelPos - this._bounds.x;
- width = xLabelWidth / 0.7071;
- }
- } else {
- if (xLabelPos + xLabelWidth > this._bounds.x + this._bounds.width) {
- xLabelWidth = (this._bounds.x + this._bounds.width) - xLabelPos;
- width = xLabelWidth / 0.7071;
- }
- }
- if (width > maxWidth) {
- width = maxWidth;
- }
- }
- }
- }
- return width;
- },
-
- rotateLabels : function(g, labels, textAnchor, mode) {
- if (this._rotateLabels) {
- var self = this;
- var positioning = function(data, index, groupIndex) {
- var x = 0;
- var y = 0;
- var rotation_cy = 0;
- var isBottom = self._orient == "bottom";
- if (mode == 3) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- if (cellIndex % 2 == 1) {
- var staggerDirection = isBottom ? 1 : -1;
- y += (self._layoutLabelHeight * staggerDirection);
- }
- if (cellIndex == 0 && self._staggerAlignFirstAtStart) {
- x -= self._staggerCellWidth / 4;
- } else if (cellIndex == self.getStaggerCount() - 1 && self._staggerAlignLastAtEnd) {
- x += self._staggerCellWidth / 4;
- }
- }
- } else if (mode == 2) {
- if (isBottom) {
- x -= self._layoutLabelHeight;
- } else {
- x += self._layoutLabelHeight / 2;
- }
- } else if (mode == 1) {
- if (isBottom) {
- x -= (this.getBBox().height / 2 + self._layoutLabelHeight / 4);
- rotation_cy = ~~(self._padding / 4 + self._axis.tickSize());
- } else {
- x -= (this.getBBox().height / 2 - self._layoutLabelHeight);
- rotation_cy = ~~-(self._padding / 4 + self._axis.tickSize());
- }
- }
- var rotationDegrees = mode == 1 ? -90 : mode == 2 ? -45 : 0;
- return "translate(" + x + "," + y + ") rotate(" + rotationDegrees + ",0," + rotation_cy + ")";
- };
- labels.attr("transform", positioning).style("text-anchor", textAnchor);
- if (mode == 3) {
- if (this._staggerAlignFirstAtStart) {
- this._staggerFirstNode.rave_setStyle("text-anchor", "start");
- }
- if (this._staggerAlignLastAtEnd) {
- this._staggerLastNode.rave_setStyle("text-anchor", "end");
- }
- }
- }
- },
-
- axis : function() {
- return this._axis;
- },
-
- drawAxis : function(g) {
- var axisSelector = g.selectAll("g.axis").data([0]);
- axisSelector.enter().append("g").classed("axis", true).classed(this._orient, true);
- if (!this._axis) {
- this._axis = new rave['internal']['Axis']();
- }
- if (this._hideOverlappingLabels) {
- this._textFlow.valignment("top").dropTextOnFail(false);
- }
- this._axis.ticksHandler(this._tickHandler);
- this._axis.orient(this._orient);
- this._axis.tickFormat(this._tickFormat);
- this._axis.tickPadding(10.0);
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- var labelHeight = 20.0;
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- if (isHorizontal) {
- labelHeight /= 0.7071;
- }
- var range = this._scale.scale().rangeExtent();
- var extent = + (range[1]) - + (range[0]);
- this._axis.ticks(extent / labelHeight);
- } else {
- if (this._tickMagnitude == null) {
- this._axis.ticks(10.0);
- } else {
- this._axis.ticks.apply(this._axis, [10.0, this._scale.scale().getTickFormat(), this._tickMagnitude]);
- }
- }
- var s = this._scale.scale();
- if (this._scale.originalDomain()) {
- var sOrdinal = s.copy();
- sOrdinal.domain(this._scale.originalDomain());
- s = sOrdinal;
- var self = this;
- var originalDataLabelAccessor = (self._scale).originalDomainLabelAccessor();
- var tickFormatter;
- if (originalDataLabelAccessor) {
- if (this._tickFormat) {
- tickFormatter = function(data, index, groupIndex) {
- return self._tickFormat.call(this, originalDataLabelAccessor.call(this, data, index, groupIndex), index, groupIndex);
- };
- } else {
- tickFormatter = originalDataLabelAccessor;
- }
- } else {
- tickFormatter = this._tickFormat;
- }
- this._axis.tickFormat(tickFormatter);
- }
- this._axis.scale(s);
- axisSelector.call(this._axis);
- var g2 = rave.transition(axisSelector);
- if (!(g2.isTransition())) {
- axisSelector.selectAll("text").call(this._dropOverlap, this._hideOverlappingLabels);
- }
- axisSelector.selectAll("path.domain").classed("axis-line", true);
- axisSelector.selectAll("g.tick line").classed("axis-tick", true);
- if (this._fontChecker) {
- axisSelector.selectAll("g.tick text").classed("axis-label", true).call(this._fontChecker);
- } else {
- axisSelector.selectAll("g.tick text").classed("axis-label", true);
- }
- axisSelector.call(this._axisLineProperties);
- },
-
- drawTitle : function(g) {
- if (!this._displayAxisTitle || this._axisTitle == null || this._axisTitle.trim().length == 0 || !this._bounds) {
- g.selectAll("text.axis-title." + this._orient).remove();
- return;
- }
- var x = 0;
- var y = 0;
- var dy = "";
- var transform;
- if ("top" == this._orient) {
- x = this._elementRect.x + this._elementRect.width / 2;
- y = -this._bounds.height + this._padding / 4;
- dy = "0.75em";
- } else if ("bottom" == this._orient) {
- x = this._elementRect.x + this._elementRect.width / 2;
- y = this._bounds.height - this._padding / 4;
- dy = "-0.25em";
- } else if ("left" == this._orient) {
- x = -this._elementRect.y - this._elementRect.height / 2;
- y = -this._bounds.width + this._padding / 4;
- dy = "0.75em";
- transform = "rotate(-90)";
- } else {
- x = this._elementRect.y + this._elementRect.height / 2;
- y = -this._bounds.width + this._padding / 4;
- dy = "0.75em";
- transform = "rotate(90)";
- }
- var fillOpacity;
- {
- var tmp = g.append("text").attr("class", "axis-title " + this._orient);
- fillOpacity = tmp.style("fill-opacity");
- tmp.remove();
- } var label = g.selectAll("text.axis-title." + this._orient);
- if (label.size() == 0) {
- label.data([0]).enter().append("text").attr("class", "axis-title " + this._orient).style("text-anchor", "middle").attr("x", x).attr("y", y).attr("transform", transform).attr("dy", dy).style(this._titleStyle).text(this._axisTitle);
- if (this._fontChecker) {
- g.selectAll("text.axis-title." + this._orient).call(this._fontChecker);
- }
- }
- com_ibm_rave_bundles_utilities_TextCrossfader.textCrossFade(rave.transition(label), label.text(), this._axisTitle, fillOpacity, 0.25).style("text-anchor", "middle").attr("x", x).attr("y", y).attr("transform", transform).attr("dy", dy).style(this._titleStyle);
- },
- getUnZoomedScale : function(scale) {
- var s = scale.copy();
- if (s.getZoomTransform()) {
- s.getZoomTransform()(1, 0);
- }
- return s;
- },
- isValid : function(data) {
- var s = this.getUnZoomedScale(this._axis.scale());
- var v = + (s.call(null, data, 0, 0));
- var range = this._axis.scale().range();
- if (this._axis.scale().range().indexOf(v)> -1) {
- return true;
- }
- if (range[0] < v && v < range[1]) {
- return true;
- }
- if (range[0] > v && v > range[1]) {
- return true;
- }
- return false;
- },
-
- doLabelWrapping : function(g, mode) {
- if (this._displayTickLabels) {
- this._textFlow.valignment("top");
- if (!this._hideOverlappingLabels) {
- this._textFlow.dropTextOnFail(true);
- }
- var d = this.labelExtent(g);
- if (!d || d[0] < 0 || d[1] < 0) {
- return;
- }
- var w = ~~ (d[0]);
- var h = ~~ (d[1]);
- if (mode == 2) {
- w = ~~(d[1] / 0.7071 - this._layoutLabelHeight);
- h = ~~(this._layoutLabelHeight / 0.7071);
- } else if (mode == 1) {
- var tmp = w;
- w = h;
- h = tmp;
- }
- var allowWrap = mode == 1;
- if (this._scale.isOrdinal() || this._scale.isClustered()) {
- var hActual = ~~ (this._layoutLabelHeight * 1.2);
- if (hActual > h) {
- h = hActual;
- }
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- if (mode == 0 && !isHorizontal) {
- allowWrap = true;
- }
- }
- var self = this;
- var cellWidth = w;
- var cellHeight = h;
- this._textFlow.wrap(allowWrap).truncate(true).textTruncateIndicator(this._textTruncationIndicator != null ? this._textTruncationIndicator : "...").spacing(1.2).extent(function(data, index, groupIndex) {
- var width = cellWidth;
- var height = cellHeight;
- if (mode == 2) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- width = ~~self.calculate45DegreeSpace(this, cellWidth);
- }
- } else if (mode == 3) {
- var cellIndex = self.getStaggerIndex(this);
- if (cellIndex != -1) {
- if (cellIndex == 0 && cellIndex == self.getStaggerCount() - 1) {
- width = cellWidth;
- } else if (cellIndex == 0 || cellIndex == self.getStaggerCount() - 1) {
- width = cellWidth * 3 / 2;
- } else {
- width = cellWidth * 2;
- }
- height = cellHeight / 2;
- }
- }
- return [width, height];
- });
- g.selectAll("g.tick > text").call(this._textFlow);
- }
- },
-
-
- labelExtent : function(g) {
- var isHorizontal = this._orient == "bottom" || this._orient == "top";
- var w = this._bounds.width;
- var h = this._bounds.height;
- if (this._scale.scale().rangeBand) {
- var rangeBandValue = + (this._scale.scale().rangeBand());
- if (isHorizontal) {
- w = rangeBandValue;
- } else {
- h = rangeBandValue;
- }
- }
- this.calcTitleExtent(g);
- if (isHorizontal) {
- h -= this._axis.tickSize();
- h -= this._padding / 2;
- if (this._layoutTitleSize != 0) {
- h -= this._layoutTitleSize;
- h -= this._padding / 2;
- }
- } else {
- w -= this._axis.tickSize();
- w -= this._padding / 2;
- if (this._layoutTitleSize != 0) {
- w -= this._layoutTitleSize;
- w -= this._padding / 2;
- }
- }
- return [w, h];
- },
- calcTitleExtent : function(g) {
- this._layoutTitleSize = 0;
- var title = g.selectAll("text.axis-title");
- if (title.size() > 0) {
- var textHeight = title[0][0].getBBox().height;
- this._layoutTitleSize = textHeight;
- }
- },
-
-
- setRole : function(role) {
- this._role = role;
- return this;
- },
-
-
- scaleTickMagnitude : function(tickMagnitude) {
- this._tickMagnitude = tickMagnitude;
- return this;
- },
-
-
- scale : function(scale) {
- this._scale = scale ? scale : null;
- return this;
- },
-
- orient$0 : function(orient) {
- if ("left" == orient || "bottom" == orient || "right" == orient || "top" == orient) {
- this._orient = orient;
- if (this._role == null) {
- if ("left" == orient) {
- this._role = "ROLE_Y1";
- } else if ("bottom" == orient) {
- this._role = "ROLE_X1";
- } else if ("right" == orient) {
- this._role = "ROLE_Y2";
- } else {
- this._role = "ROLE_X2";
- }
- }
- }
- return this;
- },
-
- orient$1 : function() {
- return this._orient;
- },
-
-
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
-
- elementRect : function(elementRect) {
- this._elementRect = elementRect;
- return this;
- },
- tickFormat$0 : function(tickFormat) {
- this._tickFormat = tickFormat;
- return this;
- },
- tickFormat$1 : function() {
- return this._tickFormat;
- },
- simplifiedTickFormat$0 : function(tickFormat) {
- this._simplifiedTickFormat = tickFormat;
- return this;
- },
- simplifiedTickFormat$1 : function() {
- return this._simplifiedTickFormat;
- },
-
- displayAxisTitle : function(displayAxisTitle) {
- this._displayAxisTitle = displayAxisTitle;
- return this;
- },
-
- displayAxisLine : function(displayAxisLine) {
- this._displayAxisLine = displayAxisLine;
- return this;
- },
-
- displayTicks : function(displayTicks) {
- this._displayTicks = displayTicks;
- return this;
- },
-
- displayTickLabels : function(displayTickLabels) {
- this._displayTickLabels = displayTickLabels;
- return this;
- },
-
- allowAutomaticAxisLayoutToChangeOrientation : function(state) {
- this._allowAutoAxisLayoutToChangeOrientaiton = state;
- return this;
- },
-
- isAllowAutomaticAxisLayoutToChangeOrientation : function() {
- return this._allowAutoAxisLayoutToChangeOrientaiton;
- },
-
- showPanZoomTickLabels : function(showPanZoomTickLabels) {
- this._showPanZoomTickLabels = showPanZoomTickLabels;
- return this;
- },
-
- axisTitle : function(axisTitle) {
- this._axisTitle = axisTitle;
- return this;
- },
-
- axisColor : function(axisColor) {
- this._lineColor = axisColor;
- this._tickColor = axisColor;
- return this;
- },
-
- lineColor : function(lineColor) {
- this._lineColor = lineColor;
- return this;
- },
-
- tickColor : function(tickColor) {
- this._tickColor = tickColor;
- return this;
- },
-
- labelColor : function(labelColor) {
- this._labelStyle["fill"] = labelColor;
- return this;
- },
- labelStyle$0 : function(fill, fontSize, fontFamily) {
- this._labelStyle["fill"] = fill;
- this._labelStyle["font-size"] = fontSize;
- this._labelStyle["font-family"] = fontFamily;
- return this;
- },
-
- titleColor : function(titleColor) {
- this._titleStyle["fill"] = titleColor;
- return this;
- },
- titleStyle$0 : function(fill, fontSize, fontFamily) {
- this._titleStyle["fill"] = fill;
- this._titleStyle["font-size"] = fontSize;
- this._titleStyle["font-family"] = fontFamily;
- return this;
- },
-
-
- padding : function(padding) {
- this._padding = padding;
- return this;
- },
-
-
- layoutMode : function(layoutMode) {
- this._layoutMode = -1;
- if (layoutMode != null) {
- if (layoutMode == "horizontal") {
- this._layoutMode = 0;
- } else if (layoutMode == "stagger") {
- this._layoutMode = 3;
- } else if (layoutMode == "rotate45") {
- this._layoutMode = 2;
- } else if (layoutMode == "rotate90") {
- this._layoutMode = 1;
- }
- }
- return this;
- },
-
-
- allowStagger : function(allow) {
- this._allowStagger = allow;
- return this;
- },
-
-
- allowRotate45 : function(allow) {
- this._allowRotate45 = allow;
- return this;
- },
-
-
- allowRotate90 : function(allow) {
- this._allowRotate90 = allow;
- return this;
- },
-
- renderedShapes : function() {
- return this._renderedShapes;
- },
- labelStyle$1 : function(fontStyle) {
- this._labelStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
- return this;
- },
- titleStyle$1 : function(fontStyle) {
- this._titleStyle = com_ibm_rave_bundles_utilities_FontPropertyParser.parseCSSFont(fontStyle);
- return this;
- },
-
- isAxisSwapped : function() {
- return (((this._role == "ROLE_Y1" || this._role == "ROLE_Y2") && (this._orient == "top" || this._orient == "bottom")) || ((this._role == "ROLE_X1" || this._role == "ROLE_X2") && (this._orient == "right" || this._orient == "left")));
- },
-
-
- textTruncateIndicator : function(indicator) {
- this._textTruncationIndicator = indicator;
- return this;
- },
-
- stopLabelDroppingUpdate : function() {
- this._pendingLabelTimer = false;
- },
-
- updateLabelDropping : function(labels, duration, delay) {
- var self = this;
- var start = delay + duration;
- var labelCollideCallback = function(elapsed) {
- if (!self._pendingLabelTimer) {
- return true;
- }
- labels.call(self._dropOverlap, self._hideOverlappingLabels);
- if (elapsed >= start) {
- self._pendingLabelTimer = false;
- return true;
- }
- return false;
- };
- if (duration > 0) {
- this._pendingLabelTimer = true;
- rave.timer(labelCollideCallback, start);
- }
- },
- doLabelWrappingAfterAnimation : function(g, labels, mode, duration, delay) {
- this._layoutTimerId++;
- var timerId = this._layoutTimerId;
- var self = this;
- var wrapCallback = function(elapsed) {
- if (self._layoutTimerId == timerId) {
- self.doLabelWrapping(g, mode);
- self.handleLabelsRotationAndPosition(g, labels, mode);
- }
- return true;
- };
- rave.timer(wrapCallback, delay + duration);
- },
-
- preLayout : function() {
- this._layoutTitleSize = 0;
- this._layoutLabelSize = 0;
- this._layoutLabelHeight = 0;
- this._layoutAverageDigitWidth = 0;
- this._layoutSpillOver = 0;
- },
-
- getSizableType : function() {
- return this._scale.isOrdinal() || this._scale.isClustered() ? 1 : 0;
- },
-
- getSizableOrientation : function() {
- return this._orient;
- },
-
- getPreferredSize : function() {
- var layoutPaddingSize = 0;
- if (this._axis) {
- layoutPaddingSize = this._axis.tickSize();
- if (this._layoutLabelSize != 0) {
- layoutPaddingSize += this._padding / 2;
- }
- if (this._layoutTitleSize != 0) {
- layoutPaddingSize += this._padding / 2;
- }
- }
- return this._layoutLabelSize + this._layoutAverageDigitWidth + this._layoutTitleSize + layoutPaddingSize + 2;
- },
-
- getSpillOverSize : function() {
- return this._layoutSpillOver;
- },
-
- orient : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.orient$1();
- }
- return this.orient$0(a0);
- },
-
- tickFormat : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.tickFormat$1();
- }
- return this.tickFormat$0(a0);
- },
-
- simplifiedTickFormat : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.simplifiedTickFormat$1();
- }
- return this.simplifiedTickFormat$0(a0);
- },
-
- labelStyle : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.labelStyle$1(a0);
- }
- return this.labelStyle$0(a0, a1, a2);
- },
-
- titleStyle : function(a0, a1, a2) {
- var args = arguments;
- if (args.length == 1) {
- return this.titleStyle$1(a0);
- }
- return this.titleStyle$0(a0, a1, a2);
- }
- });
-
- com_ibm_rave_bundles_components_AxisComponentImpl.getTranslation = function(bounds, orient) {
- if ("left" == orient) {
- return [bounds.x + bounds.width, 0.0];
- }
- if ("right" == orient) {
- return [bounds.x, 0.0];
- }
- if ("top" == orient) {
- return [0.0, bounds.y + bounds.height];
- }
- return [0.0, bounds.y];
- };
- com_ibm_rave_bundles_components_AxisComponentImpl.NodeIndex = rave['internal']['Declare']({
-
- _domainIndex : 0,
-
- constructor : function(node, domainIndex) {
- this._node = node;
- this._domainIndex = domainIndex;
- },
-
- contains : function(node) {
- return node == this._node;
- },
-
- getIndex : function() {
- return this._domainIndex;
- }
- });
- com_ibm_rave_bundles_components_AxisComponentImpl.AxisTickHandler = rave['internal']['Declare'](rave['internal']['AbstractTickHandler'], {
-
-
- _$functionClassMethod : function() {
- var _$self = function(args) {
- if (args !== null || arguments.length > 1){
- args = Array.prototype.slice.call(arguments, 0);
- }
- {
- _$self.handle(args[0]);
- return null;
- }
- };
- return _$self;
- },
- constructor : function(label, tick) {
- this._label = label;
- this._tick = tick;
- },
-
- handle : function(ticks) {
- ticks.call(this._tick);
- ticks.call(this._label);
- }
- });
-
- com_ibm_rave_bundles_components_AxisComponentImpl.LABEL_HIDDEN_FLAG = "__tickLabelHidden__";
-
- com_ibm_rave_bundles_components_AxisComponentImpl.PANZOOM_HIDDEN_FLAG = "__panZoomHidden__";
-
- com_ibm_rave_bundles_components_AxisComponentImpl.HIDDEN_COUNT = "__hiddenCount__";
-
- com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_SPACE_PER_TICK = 20;
-
- com_ibm_rave_bundles_components_AxisComponentImpl.PREFERRED_TICK_COUNT = 10;
-
- com_ibm_rave_bundles_components_AxisComponentImpl.TICK_PADDING = 10;
- com_ibm_rave_bundles_components_AxisComponentImpl.HORIZONTAL = 0;
- com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE90 = 1;
- com_ibm_rave_bundles_components_AxisComponentImpl.ROTATE45 = 2;
- com_ibm_rave_bundles_components_AxisComponentImpl.STAGGER = 3;
- com_ibm_rave_bundles_components_AxisComponentImpl.TEXTFLOW_SPACING = 1.2;
-
- com_ibm_rave_bundles_components_AxisComponentImpl.BOTTOM_ORIENTATION = "bottom";
-
- com_ibm_rave_bundles_components_AxisComponentImpl.TOP_ORIENTATION = "top";
-
- com_ibm_rave_bundles_components_AxisComponentImpl.LEFT_ORIENTATION = "left";
-
- com_ibm_rave_bundles_components_AxisComponentImpl.RIGHT_ORIENTATION = "right";
- com_ibm_rave_bundles_components_AxisComponentImpl.AUTOMODE = -1;
- var com_ibm_rave_bundles_components_GridComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
-
-
-
-
-
-
-
-
-
-
-
- _displayGridlines : false,
-
- _renderedShapes : false,
-
-
- constructor : function() {
- this._axis = null;
- this._role = null;
- this._orient = "bottom";
- this._bounds = null;
- this._displayGridlines = true;
- this._gridlineStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
- this._renderedShapes = false;
- },
-
- type : function() {
- return com_ibm_rave_bundles_component_GridComponent.COMPONENT_TYPE;
- },
-
- role : function() {
- return this._role;
- },
-
- execute : function(g) {
- this.preExecute();
- if (!this._displayGridlines || !this._axis || !this._bounds) {
- g.selectAll("*").remove();
- this._renderedShapes = false;
- return;
- }
- this._renderedShapes = true;
- var size = ("bottom" == this._orient || "top" == this._orient) ? this._bounds.height : this._bounds.width;
- var ticksHandler = this._axis.ticksHandler();
- var tickSize = this._axis.tickSize();
- var outerTickSize = this._axis.outerTickSize();
- var tickFormat = this._axis.tickFormat();
- var ax = this._axis.tickSize(-size, 0).tickFormat("").ticksHandler(null);
- g.call(ax);
- this._axis.tickSize(tickSize, outerTickSize).tickFormat(tickFormat).ticksHandler(ticksHandler);
- g.selectAll("g.tick line").classed("grid-tick", true);
- g.selectAll(".grid-tick").style("stroke", this._gridlineStyle._stroke).style("stroke-dasharray", (this._gridlineStyle._dashArray));
- g.selectAll("path.domain").remove();
- },
-
-
- axis : function(axis) {
- this._axis = axis;
- return this;
- },
-
-
- setRole : function(role) {
- this._role = role;
- return this;
- },
-
- orient$0 : function(orient) {
- if ("left" == orient || "right" == orient || "bottom" == orient || "top" == orient) {
- this._orient = orient;
- }
- return this;
- },
-
-
- bounds : function(bounds) {
- this._bounds = bounds;
- return this;
- },
- displayGridlines$0 : function(displayGridlines) {
- this._displayGridlines = displayGridlines;
- return this;
- },
-
- gridlineStyle : function(gridlineColor, dashArray) {
- this.gridlineColor(gridlineColor);
- this.dashArray(dashArray);
- return this;
- },
- gridlineColor$0 : function(gridlineColor) {
- this._gridlineStyle._stroke = (gridlineColor != null && gridlineColor.length > 0) ? gridlineColor : null;
- return this;
- },
- dashArray$0 : function(dashArray) {
- this._gridlineStyle._dashArray = (dashArray != null && dashArray.length > 0) ? dashArray : null;
- return this;
- },
-
- orient$1 : function() {
- return this._orient;
- },
- displayGridlines$1 : function() {
- return this._displayGridlines;
- },
- gridlineColor$1 : function() {
- return this._gridlineStyle._stroke;
- },
- dashArray$1 : function() {
- return this._gridlineStyle._dashArray;
- },
-
- renderedShapes : function() {
- return this._renderedShapes;
- },
-
- orient : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.orient$1();
- }
- return this.orient$0(a0);
- },
-
- displayGridlines : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.displayGridlines$1();
- }
- return this.displayGridlines$0(a0);
- },
-
- gridlineColor : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.gridlineColor$1();
- }
- return this.gridlineColor$0(a0);
- },
-
- dashArray : function(a0) {
- var args = arguments;
- if (args.length == 0) {
- return this.dashArray$1();
- }
- return this.dashArray$0(a0);
- }
- });
- var com_ibm_rave_bundles_components_KeyedBundleComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_BundleComponentImpl, {
-
-
-
- key : function(keyFunction) {
- this.keyFunction = keyFunction;
- return this;
- },
-
-
- getKey : function() {
- if (!this.keyFunction) {
- return null;
- }
- var self = this;
- return function(datum, index, groupIndex) {
- return self.keyFunction(datum);
- };
- }
- });
- var com_ibm_rave_bundles_components_BoxplotComponentImpl = rave['internal']['Declare'](com_ibm_rave_bundles_components_KeyedBundleComponentImpl, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _duration : 0,
-
- _boxplotSize : 0,
-
- _dataChanged : false,
-
-
- constructor : function(context) {
- this._context = context;
- this._data = null;
- this._xScale = null;
- this._yScale = null;
- this._originalDataYAccessor = null;
- this._colorPalette = null;
- this._originalDataColorAccessor = null;
- this._effect = "none";
- this._duration = 0;
- this._dataChanged = false;
- this._boxStyle = new com_ibm_rave_bundles_components_StyleStructs.ShapeStyle();
- this._whiskerStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
- this._medianStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
- this._meanStyle = new com_ibm_rave_bundles_components_StyleStructs.LineStyle();
- this._outlierStyle = new com_ibm_rave_bundles_components_StyleStructs.ShapeStyle();
- this._extremeStyle = new com_ibm_rave_bundles_components_StyleStructs.ShapeStyle();
- this._boxplotDatumKeyAccessor = function(data, index, groupIndex) {
- return (data)._key;
- };
- },
-
- type : function() {
- return com_ibm_rave_bundles_component_BoxplotComponent.COMPONENT_TYPE;
- },
-
- data : function(data) {
- this._data = data;
- this._dataChanged = true;
- return this;
- },
-
- xScale : function(xScale) {
- this._xScale = xScale;
- return this;
- },
-
- yScale : function(yScale) {
- this._yScale = yScale;
- return this;
- },
-
- yAccessor : function(yAccessor) {
- this._originalDataYAccessor = yAccessor;
- return this;
- },
-
- colorAccessor : function(colorAccessor) {
- this._originalDataColorAccessor = colorAccessor;
- return this;
- },
-
- colorPalette : function(colorPalette) {
- this._colorPalette = colorPalette;
- return this;
- },
-
- effect : function(effect) {
- this._effect = effect;
- return this;
- },
-
- duration : function(duration) {
- this._duration = (duration > 0) ? duration : 0;
- return this;
- },
-
- boxplotSize : function(boxplotSize) {
- this._boxplotSize = Math.max(2.0, boxplotSize);
- return this;
- },
-
- boxStyle : function(fill, stroke, strokeWidth) {
- this._boxStyle._fill = fill;
- this._boxStyle._stroke = stroke;
- this._boxStyle._strokeWidth = strokeWidth;
- return this;
- },
-
- whiskerStyle : function(stroke, strokeWidth) {
- this._whiskerStyle._stroke = stroke;
- this._whiskerStyle._strokeWidth = strokeWidth;
- return this;
- },
-
- medianStyle : function(stroke, strokeWidth) {
- this._medianStyle._stroke = stroke;
- this._medianStyle._strokeWidth = strokeWidth;
- return this;
- },
-
- meanStyle : function(stroke, strokeWidth) {
- this._meanStyle._stroke = stroke;
- this._meanStyle._strokeWidth = strokeWidth;
- return this;
- },
-
- outlierStyle : function(fill, stroke, strokeWidth) {
- this._outlierStyle._fill = fill;
- this._outlierStyle._stroke = stroke;
- this._outlierStyle._strokeWidth = strokeWidth;
- return this;
- },
-
- extremeStyle : function(fill, stroke, strokeWidth) {
- this._extremeStyle._fill = fill;
- this._extremeStyle._stroke = stroke;
- this._extremeStyle._strokeWidth = strokeWidth;
- return this;
- },
-
- execute : function(g) {
- this.preExecute();
- if (!this._data || !this._xScale || !this._yScale || !this._originalDataYAccessor) {
- g.selectAll("g." + "boxplot-element").remove();
- return;
- }
- var boxplotGroups = g.selectAll("g." + "boxplot-element").data(this._data, this._boxplotDatumKeyAccessor);
- boxplotGroups.exit().remove();
- this.enterBoxplotGroups(boxplotGroups.enter());
- this.updateBoxplotGroups(boxplotGroups);
- this._dataChanged = false;
- this._duration = 0;
- },
-
- enterBoxplotGroups : function(groups) {
- var self = this;
- var grow = "grow" == this._effect && this._duration > 0;
- groups.append("g").attr("class", "boxplot-element").each(function(data, index, groupIndex) {
- var g = rave.select(this);
- var d = data;
- var c = g.append("g").classed("boxplot-boxcontainer", true);
- c.append("rect").classed("element-shape", true).classed("boxplot-box", true);
- c.append("line").classed("element-shape", true).classed("boxplot-whisker", true).classed("boxplot-upperwhiskerbar", true);
- c.append("line").classed("element-shape", true).classed("boxplot-whisker", true).classed("boxplot-upperwhiskerline", true);
- c.append("line").classed("element-shape", true).classed("boxplot-whisker", true).classed("boxplot-lowerwhiskerline", true);
- c.append("line").classed("element-shape", true).classed("boxplot-whisker", true).classed("boxplot-lowerwhiskerbar", true);
- c.append("line").classed("element-shape", true).classed("boxplot-median", true);
- c.append("path").classed("element-shape", true).classed("boxplot-mean", true);
- self.updateOutliers(g, d);
- self.setStyleProperties(g, d);
- self.updateBoxplot(g, d, grow);
- });
- },
-
- updateBoxplotGroups : function(groups) {
- var self = this;
- var grow = this._duration > 0 && "grow" == this._effect;
- var doTransition = this._duration > 0 && !("none" == this._effect);
- groups.each(function(data, index, groupIndex) {
- var g = rave.select(this);
- var d = data;
- self.updateOutliers(g, d);
- self.setStyleProperties(g, d);
- if (grow) {
- self.updateBoxplot(g, d, grow);
- }
- self.updateBoxplot(doTransition ? g.transition().duration(self._duration) : g, d, false);
- });
- },
-
- updateOutliers : function(g, d) {
- var self = this;
- var outliers = g.selectAll("circle." + "boxplot-point").data(d._outliers, this.getKey());
- outliers.enter().append("circle").classed("element-shape", true).classed("boxplot-point", true);
- outliers.exit().remove();
- var lowerExtreme = d.lowerExtreme();
- var upperExtreme = d.upperExtremum();
- g.selectAll("circle." + "boxplot-point").classed("boxplot-outlier-point", function(data, index, groupIndex) {
- var yv = + (self._originalDataYAccessor(data));
- return !(yv < lowerExtreme || yv > upperExtreme);
- }).classed("boxplot-extreme-point", function(data, index, groupIndex) {
- var yv = + (self._originalDataYAccessor(data));
- return (yv < lowerExtreme || yv > upperExtreme);
- });
- },
-
- updateBoxplot : function(g, d, grow) {
- var self = this;
- g.attr("transform", "translate(" + this._xScale.center(d._x) + ",0)");
- var median = this._yScale.center(d._median);
- var lowerFence = grow ? median : this._yScale.center(d.lowerFence());
- var lowerHinge = grow ? median : this._yScale.center(d._lowerHinge);
- var mean = grow ? median : this._yScale.center(d._mean);
- var upperHinge = grow ? median : this._yScale.center(d._upperHinge);
- var upperFence = grow ? median : this._yScale.center(d.upperFence());
- var rectHalfWidth = this._boxplotSize / 2.0;
- var whiskerHalfWidth = 0.8 * rectHalfWidth;
- var medianHalfWidth = rectHalfWidth - 1;
- var meanHalfWidth = Math.min(6.0, rectHalfWidth);
- var outlierRadius = Math.min(4.0, rectHalfWidth);
- var s;
- s = g.select("rect." + "boxplot-box");
- s.attr("x", -rectHalfWidth).attr("y", Math.min(lowerHinge, upperHinge)).attr("width", 2.0 * rectHalfWidth).attr("height", Math.abs(upperHinge - lowerHinge));
- s = g.select("line." + "boxplot-upperwhiskerbar");
- s.attr("x1", -whiskerHalfWidth).attr("x2", whiskerHalfWidth).attr("y1", upperFence).attr("y2", upperFence);
- s = g.select("line." + "boxplot-upperwhiskerline");
- s.attr("x1", 0).attr("x2", 0).attr("y1", upperHinge).attr("y2", upperFence);
- s = g.select("line." + "boxplot-lowerwhiskerbar");
- s.attr("x1", -whiskerHalfWidth).attr("x2", whiskerHalfWidth).attr("y1", lowerFence).attr("y2", lowerFence);
- s = g.select("line." + "boxplot-lowerwhiskerline");
- s.attr("x1", 0).attr("x2", 0).attr("y1", lowerHinge).attr("y2", lowerFence);
- s = g.selectAll("line." + "boxplot-whisker");
- s = g.select("line." + "boxplot-median");
- s.attr("x1", -medianHalfWidth).attr("x2", medianHalfWidth).attr("y1", median).attr("y2", median);
- s = g.select("path." + "boxplot-mean");
- s.attr("d", "M" + (-meanHalfWidth) + "," + mean + "L" + meanHalfWidth + "," + mean + "M0," + (mean - meanHalfWidth) + "L0," + (mean + meanHalfWidth));
- s = g.selectAll("circle." + "boxplot-point");
- s.attr("cx", 0).attr("cy", 0).attr("r", outlierRadius);
- if (grow) {
- s.attr("transform", "translate(0," + median + ")");
- } else {
- s.attr("transform", function(data, index, groupIndex) {
- return "translate(0," + + (self._yScale.center(self._originalDataYAccessor(data))) + ")";
- });
- }
- this.applyShapeStyles(g.selectAll("." + "element-shape"));
- },
-
- setStyleProperties : function(g, d) {
- if (this._dataChanged) {
- g.selectAll("*").property("__rave_highlight", null).property("__rave_selection", null);
- }
- var color = "#4b8400";
- if (this._colorPalette) {
- if (this._originalDataColorAccessor) {
- this._colorPalette.setAccessor(this._originalDataColorAccessor);
- color = this._colorPalette.call(null, d._data[0], 0, 0);
- } else {
- color = this._colorPalette.call(null, null, 0, 0);
- }
- }
- this.setShapeStyleProperties(g.select("rect." + "boxplot-box"), this._boxStyle, color, color);
- this.setLineStyleProperties(g.selectAll("line." + "boxplot-whisker"), this._whiskerStyle, color);
- this.setLineStyleProperties(g.select("line." + "boxplot-median"), this._medianStyle, null);
- this.setLineStyleProperties(g.select("path." + "boxplot-mean"), this._meanStyle, null);
- this.setShapeStyleProperties(g.selectAll("circle." + "boxplot-outlier-point"), this._outlierStyle, null, color);
- this.setShapeStyleProperties(g.selectAll("circle." + "boxplot-extreme-point"), this._extremeStyle, color, color);
- },
-
- setShapeStyleProperties : function(g, style, fill, stroke) {
- g.property("__rave_originalstyle_fill", style._fill != null ? style._fill : fill).property("__rave_originalstyle_stroke", style._stroke != null ? style._stroke : stroke).property("__rave_originalstyle_strokewidth", style._strokeWidth).property("__rave_originalstyle_opacity", null);
- },
-
- setLineStyleProperties : function(g, style, stroke) {
- g.property("__rave_originalstyle_fill", null).property("__rave_originalstyle_stroke", style._stroke != null ? style._stroke : stroke).property("__rave_originalstyle_strokewidth", style._strokeWidth).property("__rave_originalstyle_opacity", null);
- },
-
-
- highlight : function(s) {
- var self = this;
- s.each(function(data, index, groupIndex) {
- var shape = self.logicalShape(this);
- if (shape && shape.rave_getProperty("__rave_highlight") == null) {
- self.updateSelectionState(shape, "__rave_highlight", "1");
- }
- });
- },
-
-
- unhighlight : function(s) {
- var self = this;
- s.each(function(data, index, groupIndex) {
- var shape = self.logicalShape(this);
- if (shape && shape.rave_getProperty("__rave_highlight") != null) {
- self.updateSelectionState(shape, "__rave_highlight", null);
- }
- });
- },
-
-
- toggleSelect : function(s) {
- var self = this;
- s.each(function(data, index, groupIndex) {
- var shape = self.logicalShape(this);
- if (shape) {
- self.updateSelectionState(shape, "__rave_selection", "1" == shape.rave_getProperty("__rave_selection") ? "0" : "1");
- }
- });
- var all = this._context.node.selectAll("." + "boxplot-boxcontainer" + ", ." + "boxplot-point");
- all.each(function(data, index, groupIndex) {
- if (this.rave_getProperty("__rave_selection") == null) {
- self.updateSelectionState(this, "__rave_selection", "0");
- }
- });
- },
-
-
- deselectAll : function(s) {
- var self = this;
- var all = this._context.node.selectAll("." + "boxplot-boxcontainer" + ", ." + "boxplot-point");
- all.each(function(data, index, groupIndex) {
- if (this.rave_getProperty("__rave_selection") != null) {
- self.updateSelectionState(this, "__rave_selection", null);
- }
- });
- },
-
- logicalShape : function(node) {
- if (!node) {
- return null;
- }
- if (node.rave_containsClass("boxplot-point")) {
- return node;
- }
- var parent = node.rave_getParentNode();
- if (parent && parent.rave_containsClass("boxplot-boxcontainer")) {
- return parent;
- }
- return null;
- },
-
- updateSelectionState : function(node, property, value) {
- node.rave_setProperty(property, value);
- if (node.rave_containsClass("boxplot-boxcontainer")) {
- var self = this;
- rave.select(node).selectAll("." + "element-shape").each(function(data, index, groupIndex) {
- self.updateSelectionState(this, property, value);
- });
- } else {
- this.applyShapeStyles(rave.select(node));
- }
- },
-
- applyShapeStyles : function(s) {
- var self = this;
- s.style("fill", function(data, index, groupIndex) {
- return self.shapeFill(this);
- }).style("stroke", function(data, index, groupIndex) {
- return self.shapeStroke(this);
- }).style("stroke-width", function(data, index, groupIndex) {
- return self.shapeStrokeWidth(this);
- }).style("opacity", function(data, index, groupIndex) {
- return self.shapeOpacity(this);
- });
- },
-
- shapeFill : function(node) {
- var fill = node.rave_getProperty("__rave_originalstyle_fill");
- if (node.rave_getProperty("__rave_highlight") != null || "1" == node.rave_getProperty("__rave_selection")) {
- if (node.rave_containsClass("boxplot-box") || node.rave_containsClass("boxplot-extreme-point")) {
- return rave.rgb(fill).brighter(0.2).toString();
- }
- }
- return fill;
- },
-
- shapeStroke : function(node) {
- var stroke = node.rave_getProperty("__rave_originalstyle_stroke");
- if (node.rave_getProperty("__rave_highlight") != null || "1" == node.rave_getProperty("__rave_selection")) {
- if (node.rave_containsClass("boxplot-box") || node.rave_containsClass("boxplot-whisker") || node.rave_containsClass("boxplot-point")) {
- return rave.rgb(stroke).darker(0.3).toString();
- }
- }
- return stroke;
- },
-
- shapeStrokeWidth : function(node) {
- if (node.rave_getProperty("__rave_highlight") != null || "1" == node.rave_getProperty("__rave_selection")) {
- if (node.rave_containsClass("boxplot-box") || node.rave_containsClass("boxplot-whisker") || node.rave_containsClass("boxplot-point")) {
- return "2px";
- }
- }
- return node.rave_getProperty("__rave_originalstyle_strokewidth");
- },
-
- shapeOpacity : function(node) {
- if ("0" == node.rave_getProperty("__rave_selection")) {
- return 0.3;
- }
- return node.rave_getProperty("__rave_originalstyle_opacity");
- }
- });
-
- com_ibm_rave_bundles_components_BoxplotComponentImpl.BOXPLOT_OUTLIER_MAX_RADIUS = 4.0;
- var com_ibm_rave_bundles_data_BoxplotDataUtilities = rave['internal']['Declare']({
- });
-
- com_ibm_rave_bundles_data_BoxplotDataUtilities.makeData = function(data, dataScale, isClustered, x, y, c) {
- var result = [];
- if (!dataScale) {
- return result;
- }
- var clustered = isClustered && c;
- var keyFunc = (!c) ? x : function(d) {
- var xv = x(d);
- var cv = c(d);
- return (xv != null && cv != null) ? [xv, cv] : null;
- };
- var dataMap = {};
- var xMap = {};
- for (var __i_enFor0 = 0, __exp_enFor0 = data, __len_enFor0 = __exp_enFor0.length;
- __i_enFor0 < __len_enFor0; ++__i_enFor0) {
- var d = __exp_enFor0[__i_enFor0];
- var key = keyFunc(d);
- var yv = y(d);
- if (key != null && yv != null) {
- var xc = dataScale.center(key);
- if (xc != null) {
- var v = dataMap[xc];
- if (!v) {
- v = [];
- dataMap[xc] = v;
- xMap[xc] = clustered ? key : x(d);
- }
- v.push(d);
- }
- }
- }
- for (var __i_enFor1 = 0, __exp_enFor1 = Object.keys(dataMap), __len_enFor1 = __exp_enFor1.length;
- __i_enFor1 < __len_enFor1; ++__i_enFor1) {
- var xv = __exp_enFor1[__i_enFor1];
- result.push(com_ibm_rave_bundles_data_BoxplotDataUtilities.create(xMap[xv], xv, dataMap[xv], y));
- }
- return result;
- };
- com_ibm_rave_bundles_data_BoxplotDataUtilities.create = function(xValue, keyValue, data, y) {
- var len = data.length;
- if (len == 1) {
- var m = + (y(data[0]));
- return new com_ibm_rave_bundles_data_BoxplotDatum(xValue, keyValue, m, m, m, m, m, m, [], data);
- }
- var sorted = [];
- var mean = 0.0;
- for (var i = 0; i < len; ++i) {
- var v = (y(data[i]));
- sorted.push(v);
- mean += v;
- }
- mean /= len;
- sorted.sort(function(obj1, obj2) {
- var v = obj1 - obj2;
- return (v < 0) ? -1 : (v > 0) ? 1 : 0;
- });
- var values = [];
- for (var i = 0; i < len; ++i) {
- values[i] = sorted[i];
- }
- var median = com_ibm_rave_bundles_data_BoxplotDataUtilities.quantile(values, 0.5);
- var upperHinge = com_ibm_rave_bundles_data_BoxplotDataUtilities.quantile(values, 0.75);
- var lowerHinge = com_ibm_rave_bundles_data_BoxplotDataUtilities.quantile(values, 0.25);
- var del = 1.5 * (upperHinge - lowerHinge);
- var lowerFence = lowerHinge - del;
- var upperFence = upperHinge + del;
- var outliers = [];
- for (var i = 0; i < len; ++i) {
- var datum = data[i];
- var yv = y(datum);
- var v = + (yv);
- if (v < lowerFence || v > upperFence) {
- var d = new com_ibm_rave_bundles_data_PointDataUtilities.PointDatum();
- d._x = xValue;
- d._y = yv;
- d._originalData = datum;
- outliers.push(d);
- }
- }
- return new com_ibm_rave_bundles_data_BoxplotDatum(xValue, keyValue, mean, values[0], lowerHinge, median, upperHinge, values[len - 1], outliers, data);
- };
- com_ibm_rave_bundles_data_BoxplotDataUtilities.quantile = function(values, q) {
- var f = (values.length - 1) * q + 1;
- var i = Math.floor(f);
- var v = values[i - 1];
- var r = f - i;
- return (r != 0) ? v + r * (values[i] - v) : v;
- };
- })();
- },{"./configuration/configuration.json":1,"./i18n/messages_en.json":2,"./vizlibrary-boxplot.css":4,"./vizlibrary.css":5}],4:[function(require,module,exports){
- var css = ".vizlibrary-boxplot .bundle-shape {\n fill: #ccc;\n fill-opacity: 1.0;\n}\n.vizlibrary-boxplot .boxplot-box {\n fill: #4b8400;\n}\n.vizlibrary-boxplot .boxplot-whisker {\n stroke: #4b8400;\n stroke-width: 1px;\n}\n.vizlibrary-boxplot .boxplot-mean {\n stroke: white;\n stroke-width: 1.5px;\n pointer-events: none;\n}\n.vizlibrary-boxplot .boxplot-median {\n stroke: white;\n stroke-width: 1.5px;\n pointer-events: none;\n}\n.vizlibrary-boxplot .boxplot-outlier-point {\n fill: white;\n stroke: #4b8400;\n stroke-width: 1px;\n}\n.vizlibrary-boxplot .boxplot-extreme-point {\n fill: #4b8400;\n stroke: #4b8400;\n stroke-width: 1px;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-boxplot/node/rave-library-boxplot/vizlibrary-boxplot.css"})); module.exports = css;
- },{"browserify-css":6}],5:[function(require,module,exports){
- var css = ".vizlibrary {\n font-family: Arial, Tahoma, 'Arial Unicode MS', 'Andale WT', 'MS UI Gothic', Gulim, SimSun, PMingLiU, Raghu8, sans-serif;\n font-style: normal;\n}\n/*\n * Chart background rectangle, transparent\n */\n.vizlibrary rect.background.elements {\n fill-opacity: 0.0;\n}\n/*\n * Axes.\n */\n.vizlibrary .axis .tick text {\n font-weight: 300;\n font-size: 14px;\n fill: #3c4646;\n}\n.vizlibrary .axis .tick line {\n fill: none;\n stroke: #eee;\n}\n.vizlibrary .axis path {\n fill: none;\n stroke: #eee;\n}\n/*Axis title\n*/\n.vizlibrary .axis .axislabel {\n font-weight: 500;\n font-size: 14px;\n fill: #323c3c;\n}\n/*\n * Axis callout.\n */\n.vizlibrary .axis-callout {\n pointer-events: none;\n /* Prevent the callout lines from intercepting mouseover events on the element shapes */\n}\n.vizlibrary .callout line {\n stroke: #3c4646;\n stroke-dasharray: 5,5;\n}\n.vizlibrary .callout .label path {\n fill: #3c4646;\n stroke-width: 0px;\n}\n.vizlibrary .callout .label text {\n font-weight: 300;\n font-size: 14px;\n fill: white;\n}\n/*Grid lines*/\n.vizlibrary g.grid g.tick {\n stroke: #dfe9e9;\n stroke-width: 1px;\n}\n/*Legend title*/\n.vizlibrary .legendTitle {\n font-weight: 500;\n font-size: 18px;\n fill: #323c3c;\n}\n/*Legend label*/\n.vizlibrary .legendLabel {\n font-weight: 300;\n font-size: 14px;\n fill: #3c4646;\n}\n.vizlibrary .legendBBox {\n pointer-events: none;\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-boxplot/node/rave-library-boxplot/vizlibrary.css"})); module.exports = css;
- },{"browserify-css":6}],6:[function(require,module,exports){
- 'use strict';
- module.exports = {
-
- createLink: function(href, attributes) {
- var head = document.head || document.getElementsByTagName('head')[0];
- var link = document.createElement('link');
- link.href = href;
- link.rel = 'stylesheet';
- for (var key in attributes) {
- if ( ! attributes.hasOwnProperty(key)) {
- continue;
- }
- var value = attributes[key];
- link.setAttribute('data-' + key, value);
- }
- head.appendChild(link);
- },
-
- createStyle: function(cssText, attributes) {
- var head = document.head || document.getElementsByTagName('head')[0],
- style = document.createElement('style');
- style.type = 'text/css';
- for (var key in attributes) {
- if ( ! attributes.hasOwnProperty(key)) {
- continue;
- }
- var value = attributes[key];
- style.setAttribute('data-' + key, value);
- }
-
- if (style.sheet) {
- style.innerHTML = cssText;
- style.sheet.cssText = cssText;
- head.appendChild(style);
- } else if (style.styleSheet) {
- head.appendChild(style);
- style.styleSheet.cssText = cssText;
- } else {
- style.appendChild(document.createTextNode(cssText));
- head.appendChild(style);
- }
- }
- };
- },{}]},{},[3]);
- return rave.library.bundle.extension('boxplotBundle');
- }));
|