;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['rave', 'rave-library', 'rave-utilities', 'rave-legends', 'mapboxgl'], factory); } else if (typeof exports === 'object') { module.exports = factory(require('rave'), require('rave-library'), require('rave-utilities'), require('rave-legends'), require('mapboxgl')); } else { root.raveLibraryTiledmapV2Min = factory(root.rave, root.raveLibrary, root.raveUtilities, root.raveLegends, root.mapboxgl); } }(this, function(rave, raveLibrary, raveUtilities, raveLegends, mapboxgl) { (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.mapboxgl-ctrl-attrib.mapboxgl-compact:hover,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:hover{padding:2px 4px 2px 24px;border-radius:12px 3px 3px 12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact:after{content:\"\";cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgba(0,0,0,.35);\n}\n@-webkit-keyframes mapboxgl-user-location-dot-pulse {\n 0% {\n -webkit-transform: scale(1);\n opacity: 1;\n }\n\n 70% {\n -webkit-transform: scale(3);\n opacity: 0;\n }\n\n to {\n -webkit-transform: scale(1);\n opacity: 0;\n }\n}\n@-ms-keyframes mapboxgl-user-location-dot-pulse {\n 0% {\n -ms-transform: scale(1);\n opacity: 1;\n }\n\n 70% {\n -ms-transform: scale(3);\n opacity: 0;\n }\n\n to {\n -ms-transform: scale(1);\n opacity: 0;\n }\n}\n@keyframes mapboxgl-user-location-dot-pulse {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n\n 70% {\n transform: scale(3);\n opacity: 0;\n }\n\n to {\n transform: scale(1);\n opacity: 0;\n }\n}\n.mapboxgl-user-location-dot-stale {\n background-color: #aaa;\n}\n.mapboxgl-user-location-dot-stale:after {\n display: none;\n}\n.mapboxgl-user-location-accuracy-circle {\n background-color: rgba(29,161,242,.2);\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n.mapboxgl-crosshair,\n.mapboxgl-crosshair .mapboxgl-interactive,\n.mapboxgl-crosshair .mapboxgl-interactive:active {\n cursor: crosshair;\n}\n.mapboxgl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: .5;\n}\n@media print {\n .mapbox-improve-map {\n display: none;\n }\n}\n"; (require("browserify-css").createStyle(css, { "href": "dist/bundles/rave-library-tiledmapV2/node/rave-library-tiledmapV2/mapbox-gl.css"})); module.exports = css; },{"browserify-css":7}],4:[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){var __i_enFor0=0;var __exp_enFor0=array;for(var __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"]()){var __i_enFor0=0;for(var __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,10);return cssSize==null?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=0?duration:0;return this},"setPreExecute":function(callback){this._preExecute=callback;return this},"selector":function(index,selector){if(index>=0&&index= 0&&index=0&&index=0&&index=0&&index=0&&index=0&&index=0&&index=0&&index=0&&index=0&&index=0&&index=0&&indexthis._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={};var __i_enFor0=0;for(var __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(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{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 a1valuea2value?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){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(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);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(numericLeftEdgerightEdge)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){var __i_enFor0=0;var __exp_enFor0=slots;for(var __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;var 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,Math.min(0.5,delay));if(t0==0.5||oldText==null&&newText==null||oldText!=null&&oldText==newText)return selection;var opacity=fillOpacity==null?1:+fillOpacity;var tf=1/(0.5-t0);return _t.tween("fill-opacity",function(data,index,groupIndex){return function(t){if(t<=t0||t>=1-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)},"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&¤tStep<100&¤tStep>=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;i0)percent=100*dVal/stack.positiveSum; else percent=100/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?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)stack.negativePercent+=percent;else stack.positivePercent+= percent}}return null});else{var __i_enFor0=0;var __exp_enFor0=Object.keys(categories);for(var __len_enFor0=__exp_enFor0.length;__i_enFor0<__len_enFor0;++__i_enFor0){var o$$0=__exp_enFor0[__i_enFor0];var s=""+o$$0;var sum$$0=0;for(var i=0;i0.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_nativeImpl_components_TiledmapV2DataLayerImpl=function(){function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl(_type){this._type= _type;this.data=null;this.mapData=null;this.combined=false;this.featureAccessors=null;this.typeData=rave.map()}com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.getType=function(){return this._type};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setData=function(_data){this.data=_data};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setMapData=function(_mapData){this.mapData=_mapData};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setCombined= function(_combined){this.combined=_combined};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setFeatureAccessors=function(_accessors){this.featureAccessors=_accessors};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl.prototype.setTypeData=function(_type,_data){this.typeData.set(_type,_data)};return com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl}();var com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap=function(){function _sortByPointSizeDesc(_itemA, _itemB){var sizeA=_itemA.properties.pointSize?_itemA.properties.pointSize:null;var sizeB=_itemB.properties.pointSize?_itemB.properties.pointSize:null;if(sizeA===null&&sizeB===null)return 0;if(sizeA===null)return 1;if(sizeB===null)return-1;return sizeB-sizeA}function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap(){this._itemMapById=rave.map();this._itemMapByKey=rave.map();this._itemMap=rave.map();this._featuresByTileSet=rave.map();this._featureById=rave.map();this._fidIdx=0;this._tileSets= rave.map();this._combinedLayers=false}var guid=function(){var buf=typeof Uint8Array==="undefined"?new Array(16):new Uint8Array(16);var lut=new Array(256);for(var i$$0=0;i$$0<256;++i$$0)lut[i$$0]=(i$$0<16?"0":"")+i$$0.toString(16);var getRandomValues=function(crypto){if(crypto)return function(_target){return crypto.getRandomValues(_target)};else return function(_target){var r;var i=0;for(var l=_target.length;i>>24&255;case 3:_target[i+ 2]=r>>>16&255;case 2:_target[i+1]=r>>>8&255;case 1:_target[i]=r&255}}return _target}}(typeof crypto!=="undefined"?crypto:typeof msCrypto!=="undefined"?msCrypto:null);return function(){getRandomValues(buf);return lut[buf[0]]+lut[buf[1]]+lut[buf[2]]+lut[buf[3]]+lut[buf[4]]+lut[buf[5]]+lut[buf[6]|64]+lut[buf[7]]+lut[buf[8]|128]+lut[buf[9]]+lut[buf[10]]+lut[buf[11]]+lut[buf[12]]+lut[buf[13]]+lut[buf[14]]+lut[buf[15]]}}();com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._itemMapById= null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._itemMapByKey=null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._itemMap=null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._fidIdx=null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._tileSets=null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._featuresByTileSet=null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._featureById= null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._combinedLayers=null;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.setCombinedLayers=function(_combinedLayers){this._combinedLayers=_combinedLayers};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.add=function(_dataLayer,_data,_key,_feature){var item={"id":guid(),data:{},dataSet:{},layerIds:{},tileSets:{},"key":_key,hasValueAccessor:false,hasPointColorAccessor:false, hasPointSizeAccessor:false};var feature;if(_feature){feature=_feature;if(feature.pk){var pkNumber=false;var version=+feature.mapid.substr(feature.mapid.length-6,6);if(version>=170513)item.pk=feature.pk;else item.pk=+feature.pk}if(feature.location)item.fid="f"+this._nextFid();if(feature.bbox)item.bbox=feature.bbox;if(feature.mapid)feature.mapid="ibmrave."+feature.mapid}else if(!this._combinedLayers&&this._hasCustomPolygonData(_dataLayer)){feature=this._getCustomPolygonFeature(_dataLayer);var featureId= this._getFeatureId(_dataLayer,_data);item[feature.property]=featureId}else{item.fid="f"+this._nextFid();feature=this._buildFeatureFromGeoData(_dataLayer,_data);if(!feature)return}this._setupData(item,_dataLayer,feature,_data);this._itemMapById.set(item["id"],item);if(item["key"])this._itemMapByKey.set(item["key"],item);if(item.fid)this._createGeoJSON(_dataLayer,item);if(item.bbox)this._addGeoJSONBBox(_dataLayer,item)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.update= function(_dataLayer,_data,_key,_feature){var item=this._itemMapByKey.get(_key);if(!item)return;this._setupData(item,_dataLayer,_feature,_data);if(item.fid)this._createGeoJSON(_dataLayer,item);if(item.bbox)this._addGeoJSONBBox(_dataLayer,item)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.hasFeature=function(_featureKey){return this._itemMapByKey.has(_featureKey)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getById=function(_id){return this._itemMapById.get(_id)}; com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getByKey=function(_key){return this._itemMapByKey.get(_key)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getItem=function(_tileSetId,_layerId,_properties){var tileSets=this.getTileSets({"id":_tileSetId});var tileSet=null;var key=null;if(!tileSets.length)return null;tileSets.some(function(_tileSet){if(_tileSet[_tileSet.layer]===_layerId){tileSet=_tileSet;return true}return false});if(!tileSet)return null; if(this._combinedLayers)key=tileSet.property+"-"+_properties[tileSet.property];else key=tileSet["id"]+"-"+tileSet[tileSet.layer]+"-"+tileSet.property+"-"+_properties[tileSet.property];return this._itemMap.get(key)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getMapFilter=function(_tileSet){var expression=["in",_tileSet.property];var keysForTileSet=this._itemMapById.values().filter(function(_item){return _item.tileSets[_tileSet["type"]]&&_item.tileSets[_tileSet["type"]]["id"]=== _tileSet["id"]}).forEach(function(_item){expression.push(_item[_tileSet.property])});return expression},com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getFeatures=function(_tileSetId){var featuresInfo=this._featuresByTileSet.get(_tileSetId);if(featuresInfo){if(!featuresInfo.sorted){featuresInfo.features.sort(_sortByPointSizeDesc);featuresInfo.sorted=true}return featuresInfo.features}return[]};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.getTileSets= function(_filter){var tileSets=[];var keys=_filter?Object.keys(_filter):null;this._tileSets.forEach(function(_tileSetKey,_tileSet){if(!keys||keys.every(function(_key){return _filter[_key]===_tileSet[_key]}))tileSets.push(_tileSet)});return tileSets};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype["size"]=function(){return this._itemMapById["size"]()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.clear=function(){this._itemMapById=rave.map(); this._itemMapByKey=rave.map();this._itemMap=rave.map();this._fidIdx=0;this._tileSets=rave.map();this._featuresByTileSet=rave.map();this._featureById=rave.map()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.updateDataLayerProperties=function(_dataLayer){var self=this;this._itemMapById.forEach(function(_id,_item){var dataSetId=_dataLayer.getType();_dataLayer.typeData.forEach(function(_type,_typeData){var tileSet=_item.tileSets[_type];if(tileSet&&(tileSet.tileType=== "vector"||tileSet["id"]===self._getAdhocTileId(_type,dataSetId)))self._updateTypeDataProperties(_type,_typeData,_item)})})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype.filter=function(_filter,_sortBy){if(_sortBy){var sorted=rave.map();this._itemMapById.values().forEach(function(_item){if(_item.tileSets[_filter["type"]]&&_item.tileSets[_filter["type"]]["id"]===_filter.tileSet&&_item.layerIds[_filter["type"]]&&_item.layerIds[_filter["type"]]===_filter.layer)sorted.set(_item[_sortBy], _item)});return sorted.values()}else return this._itemMapById.values().filter(function(_item){return _item.tileSets[_filter["type"]]&&_item.tileSets[_filter["type"]]["id"]===_filter.tileSet&&_item[_filter.property]})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._addItem=function(_tileSet,_item){var key;if(this._combinedLayers)key=_tileSet.property+"-"+_item[_tileSet.property];else key=_tileSet["id"]+"-"+_tileSet[_tileSet.layer]+"-"+_tileSet.property+"-"+_item[_tileSet.property]; this._itemMap.set(key,_item)},com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._hasCustomPolygonData=function(_dataLayer){var hasCustomPolygonData=false;_dataLayer.typeData.forEach(function(_type,_typeData){hasCustomPolygonData=hasCustomPolygonData||_typeData.hasOwnProperty("customPolygon")&&_typeData.customPolygon!==null&&typeof _typeData.customPolygon!=="undefined"});return hasCustomPolygonData};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getCustomPolygonFeature= function(_dataLayer){var feature={mapid:null,polyLayer:null,pointLayer:null,property:null,customPolygon:true};_dataLayer.typeData.forEach(function(_type,_typeData){feature.mapid=_typeData.customPolygon.mapId;if(_type==="region")feature.polyLayer=_typeData.customPolygon.layerName;else feature.pointLayer=_typeData.customPolygon.layerName;feature.property=_typeData.customPolygon.propertyName});return feature};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getFeatureId= function(_dataLayer,_data){var featureAccessor=_dataLayer.featureAccessors[0];if(featureAccessor){var geoData=featureAccessor(_data);if(typeof geoData==="object"&&geoData["featureId"]!==null)return geoData["featureId"]}return null};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._setupData=function(_item,_dataLayer,_feature,_data){var dataSetId=_dataLayer.getType();var self=this;var nullColor=null;_dataLayer.typeData.forEach(function(_type,_typeData){if(_type==="region"){self._setupRegionData(_item, _feature,_data,dataSetId,_type,_typeData);nullColor=_typeData.nullColor}else self._setupPointData(_item,_feature,_data,dataSetId,_type,_typeData)});if(this._combinedLayers&&!_item.hasValueAccessor&&!_item.hasPointColorAccessor&&!_item.hasPointSizeAccessor)_item.fillColor=nullColor};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._setupRegionData=function(_item,_feature,_data,_dataSetId,_type,_typeData){if(_feature.mapid&&_feature.polyLayer||_feature.location){var tileSet; if(_feature.mapid&&_feature.polyLayer){tileSet={"type":_type,"id":_feature.mapid,tileType:"vector",layer:"polyLayer",polyLayer:_type+"-"+_feature.polyLayer,sourceLayer:_feature.polyLayer,opacityProp:"fill-opacity",transparency:_typeData.transparency};tileSet.property=_feature.property?_feature.property:"pk"}else{tileSet={"type":_type,"id":this._getAdhocTileId(_type,_dataSetId),tileType:"geojson",layer:"polyLayer",polyLayer:this._getAdhocLayerId(_dataSetId,"geopoly"),opacityProp:"circle-opacity",property:"fid", transparency:_typeData.transparency};if(_feature.location)_item[_type]=_feature.location}tileSet.customPolygon=_feature.customPolygon||false;tileSet.propertyType=tileSet.customPolygon?null:typeof _item[tileSet.property];_item.tileSets[_type]=tileSet;this._addTileSet(tileSet);layerId=tileSet.polyLayer;_item.layerIds[_type]=layerId;_item.data[layerId]=_data;_item.dataSet[layerId]=_dataSetId;if(_typeData.valueAccessor){_item["value"]=_typeData.valueAccessor(_data);_item.hasValueAccessor=true}else if(!this._combinedLayers)_item["value"]= null;this._addItem(tileSet,_item);this._updateTypeDataProperties(_type,_typeData,_item)}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._setupPointData=function(_item,_feature,_data,_dataSetId,_type,_typeData){var tileSet;if(_feature.location)tileSet={"type":_type,"id":this._getAdhocTileId(_type,_dataSetId),tileType:"geojson",layer:"pointLayer",pointLayer:this._getAdhocLayerId(_dataSetId,"geopoint"),property:"fid",transparency:_typeData.transparency};else{tileSet={"type":_type, "id":_feature.mapid,tileType:"vector",layer:"pointLayer",pointLayer:_type+"-"+_feature.pointLayer,sourceLayer:_feature.pointLayer,transparency:_typeData.transparency};tileSet.property=_feature.property?_feature.property:"pk"}tileSet.customPolygon=_feature.customPolygon||false;tileSet.propertyType=tileSet.customPolygon?null:typeof _item[tileSet.property];_item.tileSets[_type]=tileSet;this._addTileSet(tileSet);layerId=tileSet.pointLayer;_item.layerIds[_type]=layerId;_item.data[layerId]=_data;_item.dataSet[layerId]= _dataSetId;if(_feature.location)_item[_type]=_feature.location;if(_typeData.pointColorAccessor||_typeData.pointSizeAccessor){if(_typeData.pointColorAccessor){_item.pointColorValue=_typeData.pointColorAccessor(_data);_item.hasPointColorAccessor=true}else _item.pointColorValue=null;if(_typeData.pointSizeAccessor){_item.pointSizeValue=_typeData.pointSizeAccessor(_data);_item.hasPointSizeAccessor=true}else _item.pointSizeValue=null}else if(!this._combinedLayers){_item.pointColor=_typeData.nullColor;_item.pointSize= _typeData.defaultPointSize}this._addItem(tileSet,_item);this._updateTypeDataProperties(_type,_typeData,_item)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getAdhocTileId=function(_type,_dataLayerId){return _type+"."+_dataLayerId+".adhocGeo"};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._getAdhocLayerId=function(_dataLayerId,_layer){return _dataLayerId+"."+_layer};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap.prototype._createGeoJSON= function(_dataLayer,_item){var keys=_dataLayer.typeData.keys();var idx=0;for(var size=keys.length;idx0){var self=this;curKeys.forEach(function(_key){self._itemMap.remove(_key)}); cacheUpdated=true}if(cacheUpdated)this.version++};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.get=function(_key){return this._itemMap.get(_key)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype["size"]=function(){return this._itemMap["size"]()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.clear=function(){this._itemMap=rave.map()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype.getKey= function(_layerType,_arrKeys){return this._buildKey(_layerType,_arrKeys)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype._buildKey=function(_layerType,_arrKeys){return _layerType+"|"+_arrKeys.join("|")};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache.prototype._extractNames=function(_item){var names=arguments.length>1?arguments[1]:[];names.push(_item.name);if(_item.refine){var idx=0;for(var size=_item.refine.length;idx1)args=Array.prototype.slice.call(arguments);if(self._mapComponent)self._mapComponent.highlightAction(args[0])};return _$self}})));action=this.context.actions.action("select");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);if(self._mapComponent)self._mapComponent.selectAction(args[0])};return _$self}})));action=this.context.actions.action("deselect");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);if(self._mapComponent)self._mapComponent.deselectAction(args[0])}; return _$self}})));action=this.context.actions.action("deselectAll");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);if(self._mapComponent)self._mapComponent.deselectAllAction()};return _$self}})));action=this.context.actions.action("locate");action.setOperation(new (rave["internal"]["Declare"]([rave["library"]["internal"]["ActionOperation"]], {_$functionClassMethod:function(){var _$self=function(args){};return _$self},get:function(_id){if(_id=="locator")return new (rave["internal"]["Declare"]({getItemsAtPoint:function(_point){if(self._mapComponent)return self._mapComponent.getItemsAtPoint(_point);return[]},getItemsInRect:function(_points){if(self._mapComponent)return self._mapComponent.getItemsInRect(_points);return[]}}));return null}})));action=this.context.actions.action("zoom");action.setOperation(new (rave["internal"]["Declare"]([rave["library"]["internal"]["ActionOperation"]], {_$functionClassMethod:function(){var _$self=function(args){};return _$self},get:function(_id){if(_id=="state")return new (rave["internal"]["Declare"]({getBoundingBox:function(){if(self._mapComponent)return self._mapComponent.getBoundingBox();return null},setBoundingBox:function(_bbox){if(self._mapComponent)self._mapComponent.setBoundingBox(_bbox)}}));return null}})));this._combinedLayerMapping={};this._combinedLayerMapping["featureLvl1"]="featureLvl1";this._combinedLayerMapping["featureLvl2"]="featureLvl2"; this._combinedLayerMapping["featureLvl3"]="featureLvl3";this._combinedLayerMapping["fill"]="value";this._combinedLayerMapping["pointSize"]="pointSize";this._combinedLayerMapping["pointColor"]="pointColor";this._combinedLayerMapping["region.palette"]="color.palette";this._combinedLayerMapping["region.alt.palette"]="region.palette";this._combinedLayerMapping["region.transparency"]="color.fillTransparency";this._combinedLayerMapping["region.mapData"]="region.mapData";this._combinedLayerMapping["region.custom.mapId"]= "region.custom.mapId";this._combinedLayerMapping["region.custom.layerName"]="region.custom.layerName";this._combinedLayerMapping["region.custom.propertyName"]="region.custom.propertyName";this._combinedLayerMapping["point.palette"]="color.palette";this._combinedLayerMapping["point.alt.palette"]="point.palette";this._combinedLayerMapping["point.transparency"]="color.pointTransparency";this._combinedLayerMapping["point.mapData"]="point.mapData";this._combinedLayerMapping["point.minSize"]="minPointSize"; this._combinedLayerMapping["point.maxSize"]="maxPointSize";this._combinedLayerMapping["point.defaultSize"]="point.defaultSize";this._combinedLayerMapping["point.staticZeroValueSize"]="staticZeroValuePointSize";this._combinedLayerMapping["point.custom.mapId"]="point.custom.mapId";this._combinedLayerMapping["point.custom.layerName"]="point.custom.layerName";this._combinedLayerMapping["point.custom.propertyName"]="point.custom.propertyName";this._combinedLayerMapping["legend.pointsize.title"]="legend.pointsize.title"; this._combinedLayerMapping["legend.pointcolor.title"]="legend.pointcolor.title";this._combinedLegendMapping={};this._combinedLegendMapping["pointSize"]=0;this._combinedLegendMapping["pointColor"]=1;this._regionLayerMapping={};this._regionLayerMapping["featureLvl1"]="featureLvl1";this._regionLayerMapping["featureLvl2"]="featureLvl2";this._regionLayerMapping["featureLvl3"]="featureLvl3";this._regionLayerMapping["fill"]="fill";this._regionLayerMapping["region.palette"]="region.palette";this._regionLayerMapping["region.alt.palette"]= "region.palette";this._regionLayerMapping["region.transparency"]="region.transparency";this._regionLayerMapping["region.mapData"]="region.mapData";this._regionLayerMapping["region.custom.mapId"]="region.custom.mapId";this._regionLayerMapping["region.custom.layerName"]="region.custom.layerName";this._regionLayerMapping["region.custom.propertyName"]="region.custom.propertyName";this._pointLayerMapping={};this._pointLayerMapping["featureLvl1"]="featureLvl1";this._pointLayerMapping["featureLvl2"]="featureLvl2"; this._pointLayerMapping["featureLvl3"]="featureLvl3";this._pointLayerMapping["pointSize"]="pointSize";this._pointLayerMapping["pointColor"]="pointColor";this._pointLayerMapping["point.palette"]="point.palette";this._pointLayerMapping["point.alt.palette"]="point.palette";this._pointLayerMapping["point.transparency"]="point.transparency";this._pointLayerMapping["point.mapData"]="point.mapData";this._pointLayerMapping["point.minSize"]="point.minSize";this._pointLayerMapping["point.maxSize"]="point.maxSize"; this._pointLayerMapping["point.defaultSize"]="point.defaultSize";this._pointLayerMapping["point.staticZeroValueSize"]="point.staticZeroValueSize";this._pointLayerMapping["point.custom.mapId"]="point.custom.mapId";this._pointLayerMapping["point.custom.layerName"]="point.custom.layerName";this._pointLayerMapping["point.custom.propertyName"]="point.custom.propertyName";this._pointLayerMapping["legend.pointsize.title"]="legend.pointsize.title";this._pointLayerMapping["legend.pointcolor.title"]="legend.pointcolor.title"; this._pointLayerMapping["sizeLegend"]="g.legend.size";this._pointLayerMapping["colorLegend"]="g.legend.point";this._pointLegendMapping={};this._pointLegendMapping["pointSize"]=0;this._pointLegendMapping["pointColor"]=1;this._latlongLayerMapping={};this._latlongLayerMapping["pointSize"]="latlongSize";this._latlongLayerMapping["pointColor"]="latlongColor";this._latlongLayerMapping["point.palette"]="latlong.palette";this._latlongLayerMapping["point.alt.palette"]="latlong.palette";this._latlongLayerMapping["point.transparency"]= "latlong.transparency";this._latlongLayerMapping["point.minSize"]="latlong.minSize";this._latlongLayerMapping["point.maxSize"]="latlong.maxSize";this._latlongLayerMapping["point.defaultSize"]="latlong.defaultSize";this._latlongLayerMapping["point.staticZeroValueSize"]="latlong.staticZeroValueSize";this._latlongLayerMapping["legend.pointsize.title"]="legend.latlong.pointsize.title";this._latlongLayerMapping["legend.pointcolor.title"]="legend.latlong.pointcolor.title";this._latlongLayerMapping["sizeLegend"]= "g.legend.latlongSize";this._latlongLayerMapping["colorLegend"]="g.legend.latlongPoint";this._latlongLegendMapping={};this._latlongLegendMapping["pointSize"]=2;this._latlongLegendMapping["pointColor"]=3;this._registeredEventHandlers=[];this._delayedInit=null},"dispose":function(){if(this._mapComponent)this._mapComponent["dispose"]()},"on":function(_eventName,_callback){rave["library"]["internal"]["AbstractView"].prototype["on"].call(this,_eventName,_callback);if(this._mapComponent)this._mapComponent["on"](_eventName, function(_e){_callback(_e)});this._registeredEventHandlers.push(new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.EventHandler(_eventName,_callback))},"draw":function(){var accessToken=this["getStringProperty"]("tiledmap.token");if(accessToken==null||accessToken=="")return;var self=this;this["preDraw"]("g.vizlibrary-tiledmap");this.context.node.selectAll("g.legends").style("pointer-events","all");if(!this["validateDataModel"]("*"))return;var legendPosition=this["getLegendPosition"]();var showLegend= this["isShowLegend"]();this["_legends"]["visible"](showLegend)["position"](legendPosition)["transition"](false,0)["setPreExecute"](this.context.getPreExecute());var maxZoom=this["getProperty"]("tiledmap.maxZoom");var mapLocale=this["getStringPropertyEmptyAsNull"]("tiledmap.mapLocale");if(mapLocale==null)mapLocale=this.context.locale();var mapStyle=this["getStringProperty"]("tiledmap.style");var combinedLayers=false;var dataLayers=[];if(this["dataModel"].getDescriptor()["id"]()=="tabular"){combinedLayers= true;var combinedDataSet=this["dataModel"].dataset("data");var data=combinedDataSet.data();var geoJson=this["getProperty"]("tiledmap.geoJson");var mapData=null;if(geoJson!=null)if(typeof geoJson==="array"||geoJson instanceof Array)mapData=geoJson;else mapData=geoJson["mapboxData"];var dataLayer=new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data");dataLayers.push(dataLayer);dataLayer.setData(data);dataLayer.setMapData(mapData);var dseFeatureLvl1=combinedDataSet.slot(this._combinedLayerMapping["featureLvl1"]).entry(); var dseFeatureLvl2=combinedDataSet.slot(this._combinedLayerMapping["featureLvl2"]).entry();var dseFeatureLvl3=combinedDataSet.slot(this._combinedLayerMapping["featureLvl3"]).entry();var dsePointSize=combinedDataSet.slot(this._combinedLayerMapping["pointSize"]).entry();var dsePointColor=combinedDataSet.slot(this._combinedLayerMapping["pointColor"]).entry();var featureAccessors=[];featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl1));featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl2)); featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl3));dataLayer.setFeatureAccessors(featureAccessors);if(dseFeatureLvl1)this._setupRegionDataLayer(dataLayer,combinedDataSet,data,this._combinedLayerMapping,false,showLegend);else this["_legends"]["visible"](4,false);if(dseFeatureLvl1&&(dsePointSize||dsePointColor))this._setupPointDataLayer(dataLayer,combinedDataSet,data,this._combinedLayerMapping,this._pointLegendMapping,false,showLegend);else{this["_legends"]["visible"](0, false);this["_legends"]["visible"](1,false)}this["_legends"]["visible"](2,false);this["_legends"]["visible"](3,false)}else if(this["dataModel"].getDescriptor()["id"]()=="multiTable"){var regionDataSet=this["dataModel"].dataset("data.region");var pointDataSet=this["dataModel"].dataset("data.point");var latlongDataSet=this["dataModel"].dataset("data.latlong");if(regionDataSet.data()!=null){data=regionDataSet.data();var regionLayer=new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data.region"); dataLayers.push(regionLayer);regionLayer.setData(data);regionLayer.setMapData(this["getProperty"](this._regionLayerMapping["region.mapData"]));dseFeatureLvl1=regionDataSet.slot(this._regionLayerMapping["featureLvl1"]).entry();dseFeatureLvl2=regionDataSet.slot(this._regionLayerMapping["featureLvl2"]).entry();dseFeatureLvl3=regionDataSet.slot(this._regionLayerMapping["featureLvl3"]).entry();var hasGeo=dseFeatureLvl1&&this["getStringProperty"](this._regionLayerMapping["region.custom.mapId"]).length> 0&&this["getStringProperty"](this._regionLayerMapping["region.custom.layerName"]).length>0&&this["getStringProperty"](this._regionLayerMapping["region.custom.propertyName"]).length>0;featureAccessors=[];if(hasGeo)featureAccessors.push(this._createGeoDataAccessor(null,null,null,dseFeatureLvl1));else{featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl1));featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl2));featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl3))}regionLayer.setFeatureAccessors(featureAccessors); this._setupRegionDataLayer(regionLayer,regionDataSet,data,this._regionLayerMapping,hasGeo,showLegend)}else this["_legends"]["visible"](4,false);if(pointDataSet.data()!=null){data=pointDataSet.data();var pointLayer=new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data.point");dataLayers.push(pointLayer);pointLayer.setData(data);pointLayer.setMapData(this["getProperty"](this._pointLayerMapping["point.mapData"]));dseFeatureLvl1=pointDataSet.slot(this._pointLayerMapping["featureLvl1"]).entry(); dseFeatureLvl2=pointDataSet.slot(this._pointLayerMapping["featureLvl2"]).entry();dseFeatureLvl3=pointDataSet.slot(this._pointLayerMapping["featureLvl3"]).entry();hasGeo=dseFeatureLvl1&&this["getStringProperty"](this._pointLayerMapping["point.custom.mapId"]).length>0&&this["getStringProperty"](this._pointLayerMapping["point.custom.layerName"]).length>0&&this["getStringProperty"](this._pointLayerMapping["point.custom.propertyName"]).length>0;featureAccessors=[];if(hasGeo)featureAccessors.push(this._createGeoDataAccessor(null, null,null,dseFeatureLvl1));else{featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl1));featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl2));featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseFeatureLvl3))}pointLayer.setFeatureAccessors(featureAccessors);this._setupPointDataLayer(pointLayer,pointDataSet,data,this._pointLayerMapping,this._pointLegendMapping,hasGeo,showLegend)}else{this["_legends"]["visible"](0, false);this["_legends"]["visible"](1,false)}if(latlongDataSet.data()!=null){var dseLatitude=latlongDataSet.slot("latitude").entry();var dseLongitude=latlongDataSet.slot("longitude").entry();var dseLabel=latlongDataSet.slot("label").entry();hasGeo=dseLatitude||dseLongitude;if(hasGeo){featureAccessors=[];if(dseLatitude&&dseLatitude["type"]()=="object")featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseLatitude));else if(dseLongitude&&dseLongitude["type"]()=="object")featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseLongitude)); else if(dseLabel&&dseLabel["type"]()=="object")featureAccessors.push(rave["library"]["internal"]["AbstractView"].accessorOf(dseLabel));else if(dseLatitude&&dseLongitude)featureAccessors.push(this._createGeoDataAccessor(dseLabel,dseLatitude,dseLongitude,null));if(featureAccessors.length>0){data=latlongDataSet.data();var latlongLayer=new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2DataLayerImpl("data.latlong");dataLayers.push(latlongLayer);latlongLayer.setData(data);latlongLayer.setFeatureAccessors(featureAccessors); this._setupPointDataLayer(latlongLayer,latlongDataSet,data,this._latlongLayerMapping,this._latlongLegendMapping,hasGeo,showLegend)}}}else{this["_legends"]["visible"](2,false);this["_legends"]["visible"](3,false)}}if(this.updateType<=1){this["prepareLayoutComponent"]();this["prepareLayoutSizables"](this["_layoutComponent"],false,false,false,false,this["_legends"]["anyVisible"]());this["_legends"]["preLayout"](this["_layoutComponent"]);this["_layoutComponent"]["layout"]()}var chartRect=this["_layoutComponent"]["elementRect"](); this["_legends"]["rectangle"](this["_layoutComponent"]["legendRect"]());this["_legends"]["draw"]();var maxPointSize=this.evaluateSize(this["getStringProperty"]("point.maxSize"),chartRect.width,10);var autoZoom=this["getBooleanProperty"]("tiledmap.autoZoom");if(!this._mapComponent){this._mapComponent=new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl;this._mapComponent.accessToken(accessToken);this._mapComponent.setContainerRect(chartRect);this._mapComponent["setup"](this.context.node, this.getNLS());this._mapComponent["setDataLayers"](dataLayers,true,combinedLayers);this._mapComponent["draw"](this.context.node);this._mapComponent["mapStyle"](mapStyle);this._mapComponent.setMaxBounds(com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.BASE_BOUNDS);if(maxZoom!=this._maxZoom)this._mapComponent["setMaxZoom"](maxZoom);this._mapComponent["setMapLocale"](mapLocale);this._mapComponent["setMaxPointSize"](maxPointSize);this._mapComponent["setAutoZoom"](autoZoom);if(this._registeredEventHandlers.length> 0){var idx=0;for(var size=this._registeredEventHandlers.length;idx=90||_latitude<=-90)return false;return _longitude!=null},normalizeLongitude:function(_longitude){var longitude= _longitude;for(var correction=_longitude<0?360:-360;longitude<-180||longitude>180;)longitude+=correction;return longitude}});com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.GeoDataAccessor=rave["internal"]["Declare"]({"constructor":function(_caption,_latitude,_longitude,_featureId){this.captionAccessor=_caption;this.latitudeAccessor=_latitude;this.longitudeAccessor=_longitude;this.featureIdAccessor=_featureId},"getAccessor":function(){var self=this;return function(_data){return new com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.GeoData(self.captionAccessor? self.captionAccessor(_data):null,self.latitudeAccessor?self.latitudeAccessor(_data):0,self.longitudeAccessor?self.longitudeAccessor(_data):0,self.featureIdAccessor?self.featureIdAccessor(_data):null)}}});com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_POINTSIZE=0;com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_POINTCOLOR=1;com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_LATLONG_POINTSIZE=2;com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_LATLONG_POINTCOLOR= 3;com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.LEGEND_REGIONCOLOR=4;com_ibm_rave_bundles_tiledmapV2Bundle_TiledmapV2View.BASE_BOUNDS=[[-180,-85.05112],[180,85.05112]];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);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;this._topPadding=0;this._leftPadding=0;this._bottomPadding=0;this._rightPadding=0;this._topChartPadding=0;this._leftChartPadding=0;this._bottomChartPadding=0;this._rightChartPadding=0;this._legendChartGap=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);chartTop=tbpadding+com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._topChartPadding, h);chartLeft=lrpadding+com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._leftChartPadding,w);chartBottom=tbpadding+com_ibm_rave_bundles_components_ChartLayoutComponentImpl.evaluateSize(this._bottomChartPadding,h);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;i1?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{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(";"));var __i_enFor0=0;for(var __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,left);var iright=Math.max(0,right);if(ileft+iright<=r.width){r.x+=ileft;r.width-=ileft+iright}var itop=Math.max(0,top);var ibottom=Math.max(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);var d=v!=null?v:0;return Math.max(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*16;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,16]:[16,-1])["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); 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&&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");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");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;var 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");node=tickText[0][0];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;ithis._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;icellWidth:false;this._staggerAlignLastAtEnd=this._staggerLastNode?this._staggerLastNode.getBBox().width>cellWidth:false}},getStaggerIndex:function(node){for(var index=0;indexwidestLabel)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(i=0;ithis._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(i=0;ilayoutLabelWidth)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}}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-xLabelWidththis._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);if(this._scale.isOrdinal()|| this._scale.isClustered()){var labelHeight=20;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);else this._axis.ticks.apply(this._axis,[10,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;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){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 \x3e 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];if("right"==orient)return[bounds.x,0];if("top"==orient)return[0,bounds.y+bounds.height];return[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_nativeImpl_components_TiledmapV2NativeSubComponentImpl=function(){function getBalancedBoundingBox(_geo,_bbox){var coords=flattenCoords(_geo);var minbbox=_bbox?[_bbox[0],_bbox[1],_bbox[2],_bbox[3]]:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];var bbox=_bbox?[_bbox[0], _bbox[1],_bbox[2],_bbox[3]]:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(var i=coords.length-1;i>=0;--i){var coord=coords[i];var coord0=coord[0];if(coord0-minbbox[0]<0){if(coord0+360-minbbox[2]0)if(minbbox[0]-coord0+360270)return bbox;if(bbExtend>240&&(minbbox[0]<-180&&minbbox[2]<0||minbbox[2]>180&&minbbox[0]>0))return bbox;return minbbox}function flattenCoords(_geo){var src;var src2;var dest;var i;var j;var len;switch(_geo["type"].toLowerCase()){case "point":return[_geo.coordinates];case "linestring":case "multipoint":return _geo.coordinates; case "polygon":case "multilinestring":src=_geo.coordinates;for(dest=[],i=0,len=src.length;i=0||ua.indexOf("Trident/")>=0;if(isIE)_mapOptions.maxTileCacheSize=6}function easing(_t){return _t*(2-_t)}function com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl(node){this._featureDataMap=new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2FeatureDataMap; this._mapCache=new com_ibm_rave_bundles_nativeImpl_components_TiledmapV2MapDataCache;this._mapCacheVersion=this._mapCache.version;this._map=null;this._nls=null;this._mapLoaded=false;this._mapboxToken="";this._mapboxStyle="mapbox://style/mapbox/streets-v9";this._mapboxStyleDirty=true;this._mapboxDataDirty=true;this._mapBBox=null;this._containerRect={x:0,y:0,width:960,height:500};this._svg=null;this._mapContainer=null;this._selectedItems=rave.set();this._addedResources=rave.map();this._highlights={items:[]}; this._dataLayers=[];this._mapLocale="en";this._styleDataCache=rave.map();this._maxPointSize=null;this._maxZoom=null;this._zoomStart=null;this._zoomStartHandler=null;this._zoomEndHandler=null;this._maxZoomCallbacks=[];this._mappingErrorCallbacks=[];this._autoZoom=true}var reLayerError=/source layer "([^"]+)".*on source "([^"]+)".*style layer "([^"]+)"/i;var reNameField=/^\{name/;var FILTER_NONE=false;com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["draw"]=function(_svg){var self= this;mapboxgl.accessToken=this._mapboxToken;this._svg=_svg;var svgOwner=rave.select(this._svg.node().parentNode);var containerNode=svgOwner.append("div").classed("vizlibrary-tiledmap",true).classed("tiledmap-container",true).style("position","relative").style("width","100%").style("height","100%");this._mapContainer=containerNode.append("div").style("position","absolute").style("text-align","left").style("left",this._containerRect.x+"px").style("top",this._containerRect.y+"px").style("width",this._containerRect.width+ "px").style("height",this._containerRect.height+"px");containerNode.node().appendChild(this._svg.node());this._svg.style("position","absolute").style("top","0px").style("left","0px").style("pointer-events","none");var options={container:this._mapContainer.node(),attributionControl:false,style:this._mapboxStyle};setMaxTileCacheSize(options);this._map=new mapboxgl.Map(options);this._map.dragRotate.disable();this._map.addControl(new mapboxgl.NavigationControl);this._map.addControl(new mapboxgl.AttributionControl({compact:true}), "bottom-right");var onStyleLoaded=function(){self._applyMapLocale();if(self._mapboxStyleDirty)self._addedResources=rave.map();else self._clearAddedResources();self._mapboxStyleDirty=false;self._loadLayers();if(self._autoZoom&&self._mapboxDataDirty&&self._featureDataMap["size"]()===0)self._map.setZoom(0);if(self._mapBBox){self._fitBounds(self._mapBBox);self._mapBBox=null}if(self._selectedItems["size"]())self._updateSelectedItemFilters();if(self._highlights.items.length)self.highlightAction(self._highlights); self._mapboxDataDirty=false};this._map["on"]("style.load",function(){if(self._mapLoaded)onStyleLoaded();else self._map.once("load",onStyleLoaded)});this._map["on"]("load",function(){self._mapLoaded=true})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.fire=function(_type){this._map.fire(_type)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._loadLayers=function(){var self=this;var styleData=this._styleDataCache.get(this._mapboxStyle); var filter;if(!styleData||this._featureDataMap["size"]()===0)return;["region","point"].forEach(function(_type){self._featureDataMap.getTileSets({"type":_type}).forEach(function(_tileSet){if(!self._map.getSource(_tileSet["id"])){var source={"type":_tileSet.tileType};var actionSourceId=null;switch(_tileSet.tileType){case "vector":filter=self._featureDataMap.getMapFilter(_tileSet);source["url"]="mapbox://"+_tileSet["id"];self._map.addSource(_tileSet["id"],source);self._addResource({"type":"source",tileType:_tileSet.tileType, "id":_tileSet["id"]});actionSourceId=_tileSet["id"]+"Action";self._map.addSource(actionSourceId,source);self._addResource({"type":"source",tileType:_tileSet.tileType,"id":actionSourceId});break;case "geojson":source.data={"type":"FeatureCollection",features:self._featureDataMap.getFeatures(_tileSet["id"])};self._map.addSource(_tileSet["id"],source);self._addResource({"type":"source",tileType:_tileSet.tileType,"id":_tileSet["id"]});break}}if(_tileSet.polyLayer){var polyLayerId=_tileSet.polyLayer;if(_tileSet.tileType=== "vector"){if(!self._map.getLayer(polyLayerId)){self._map.addLayer({"id":polyLayerId,"type":"fill","source":_tileSet["id"],"source-layer":_tileSet.sourceLayer,"paint":{"fill-opacity":1-_tileSet.transparency/100}},styleData.baseLayer);self._addResource({"type":"layer",source:_tileSet["id"],tileType:_tileSet.tileType,"id":polyLayerId});if(filter)self._map.setFilter(polyLayerId,filter)}layerId=polyLayerId+"Focus";if(!self._map.getLayer(layerId)){self._map.addLayer({"id":layerId,"type":"fill","source":actionSourceId, "source-layer":_tileSet.sourceLayer,"paint":{"fill-opacity":1},"filter":["\x3d\x3d",_tileSet.property,FILTER_NONE]},styleData.baseLayer);self._addResource({"type":"layer",source:actionSourceId,tileType:_tileSet.tileType,"id":layerId})}layerId=polyLayerId+"Select";if(!self._map.getLayer(layerId)){self._map.addLayer({"id":layerId,"type":"line","source":actionSourceId,"source-layer":_tileSet.sourceLayer,"paint":{"line-width":2,"line-opacity":1},"filter":["\x3d\x3d",_tileSet.property,FILTER_NONE]},styleData.baseLayer); self._addResource({"type":"layer",source:actionSourceId,tileType:_tileSet.tileType,"id":layerId})}layerId=polyLayerId+"Hover";if(!self._map.getLayer(layerId)){self._map.addLayer({"id":layerId,"type":"line","source":actionSourceId,"source-layer":_tileSet.sourceLayer,"paint":{"line-width":2,"line-opacity":1},"filter":["\x3d\x3d",_tileSet.property,FILTER_NONE]},styleData.baseLayer);self._addResource({"type":"layer",source:actionSourceId,tileType:_tileSet.tileType,"id":layerId})}}else if(_tileSet.tileType=== "geojson"){layerId=polyLayerId;if(!self._map.getLayer(layerId)){self._map.addLayer({"id":layerId,"type":"circle","source":_tileSet["id"],"paint":{"circle-opacity":1-_tileSet.transparency/100,"circle-radius":10,"circle-stroke-width":0}},styleData.baseLayer);self._addResource({"type":"layer",source:_tileSet["id"],tileType:_tileSet.tileType,"id":layerId})}layerId=polyLayerId+"Focus";if(!self._map.getLayer(layerId)){self._map.addLayer({"id":layerId,"type":"circle","source":_tileSet["id"],"paint":{"circle-opacity":1- _tileSet.transparency/100,"circle-radius":10,"circle-stroke-width":0}},styleData.baseLayer);self._addResource({"type":"layer",source:_tileSet["id"],tileType:_tileSet.tileType,"id":layerId})}layerId=polyLayerId+"Select";if(!self._map.getLayer(layerId)){self._map.addLayer({"id":layerId,"type":"circle","source":_tileSet["id"],"paint":{"circle-opacity":0,"circle-radius":10,"circle-stroke-width":2},"filter":["\x3d\x3d",_tileSet.property,FILTER_NONE]},styleData.baseLayer);self._addResource({"type":"layer", source:_tileSet["id"],tileType:_tileSet.tileType,"id":layerId})}layerId=polyLayerId+"Hover";if(!self._map.getLayer(layerId)){self._map.addLayer({"id":layerId,"type":"circle","source":_tileSet["id"],"paint":{"circle-opacity":0,"circle-radius":10,"circle-stroke-width":2},"filter":["\x3d\x3d",_tileSet.property,FILTER_NONE]},styleData.baseLayer);self._addResource({"type":"layer",source:_tileSet["id"],tileType:_tileSet.tileType,"id":layerId})}}}if(_tileSet.pointLayer){var pointLayerId=_tileSet.pointLayer; var layerDef;if(!self._map.getLayer(pointLayerId)){layerDef={"id":pointLayerId,"type":"circle","source":_tileSet["id"],"paint":{"circle-opacity":1-_tileSet.transparency/100,"circle-radius":10,"circle-stroke-width":2}};if(_tileSet.sourceLayer)layerDef["source-layer"]=_tileSet.sourceLayer;self._map.addLayer(layerDef,styleData.baseLayer);self._addResource({"type":"layer",source:_tileSet["id"],tileType:_tileSet.tileType,"id":pointLayerId})}layerId=pointLayerId+"Hover";if(!self._map.getLayer(layerId)){layerDef= {"id":layerId,"type":"circle","source":_tileSet["id"],"paint":{"circle-opacity":0,"circle-radius":10,"circle-stroke-width":2},"filter":["\x3d\x3d",_tileSet.property,FILTER_NONE]};if(actionSourceId)layerDef["source"]=actionSourceId;else layerDef["source"]=_tileSet["id"];if(_tileSet.sourceLayer)layerDef["source-layer"]=_tileSet.sourceLayer;self._map.addLayer(layerDef,styleData.baseLayer);self._addResource({"type":"layer",source:layerDef["source"],tileType:_tileSet.tileType,"id":layerId})}}})});self._setupLayerStops(); if(this._autoZoom&&this._mapboxDataDirty)self._setBbox()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setBbox=function(){function afterChangeComplete(){if(!self._map.loaded())return;self._setBboxFeatures();self._map.off("render",afterChangeComplete)}var self=this;var allTileSetsHaveCoordinates=this._featureDataMap.getTileSets().every(function(_tileSet){if(_tileSet.tileType==="geojson"||self._featureDataMap.getFeatures(_tileSet["id"]).length>0)return true; return false});if(!allTileSetsHaveCoordinates)this._map.setZoom(0);this._map["on"]("render",afterChangeComplete)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setBboxFeatures=function(){var featureSet=[];var self=this;this._featureDataMap.getTileSets().forEach(function(_tileSet){var features=self._featureDataMap.getFeatures(_tileSet["id"]);if(_tileSet.tileType==="geojson")featureSet=featureSet.concat(features);else if(features.length>0)featureSet=featureSet.concat(features); else{var ids=[];self._featureDataMap.filter({"type":_tileSet["type"],tileSet:_tileSet["id"],property:_tileSet.property}).forEach(function(_item){if(_item[_tileSet.property]!==null)ids.push(_item[_tileSet.property])});if(ids.length>0){var queriedFeatures=self._map.querySourceFeatures(_tileSet["id"],{sourceLayer:_tileSet.sourceLayer,filter:["all",["in",_tileSet.property].concat(ids)]});featureSet=featureSet.concat(queriedFeatures)}}});if(!featureSet.length)return;var allFeatures={"type":"FeatureCollection", "features":[]};featureSet.forEach(function(f){allFeatures.features.push({"type":"feature","geometry":f.geometry})});var bbox=getBalancedBoundingBox(allFeatures);var mapBbox=[[bbox[0],bbox[1]],[bbox[2],bbox[3]]];this._fitBounds(mapBbox)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._addStop=function(_stopContainer,_stopKey,_stopValue){if(!_stopContainer.has(_stopValue))_stopContainer.set(_stopValue,_stopKey);else{var currValue=_stopContainer.get(_stopValue); if(!Array.isArray(currValue))_stopContainer.set(_stopValue,[currValue,_stopKey]);else _stopContainer.get(_stopValue).push(_stopKey)}},com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._buildStopsExpression=function(_property,_stops,_default){if(!_stops||_stops["size"]()===0)return _default;var expression=["match",["to-string",["get",_property]]];_stops.forEach(function(_key,_value){expression.push(_value);expression.push(_key)});expression.push(_default);return expression}, com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setupLayerStops=function(){var self=this;if(this._featureDataMap["size"]())self._featureDataMap.getTileSets().forEach(function(_tileSet){var fillStops=rave.map();var fillDarkStops=rave.map();var circleColorStops=rave.map();var circleDarkColorStops=rave.map();var circleHighlightStops=rave.map();var circleSizeStops=rave.map();var layerId=_tileSet[_tileSet.layer];var property=_tileSet.property;if(_tileSet.propertyType){var featureDataItems= self._featureDataMap.filter({tileSet:_tileSet["id"],"type":_tileSet["type"],layer:layerId},property);var idx=0;for(var size=featureDataItems.length;idx 0)this._setupLayerStops();else this._loadLayers()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.deselectAllAction=function(){if(!this._mapLoaded||!this._featureDataMap["size"]())return;var self=this;var type="region";this._featureDataMap.getTileSets({"type":type}).forEach(function(_tileSet){var filter=["in",_tileSet.property,FILTER_NONE];self._map.setPaintProperty(_tileSet[_tileSet.layer],_tileSet.opacityProp,1-_tileSet.transparency/100);self._map.setFilter(_tileSet[_tileSet.layer]+ "Select",filter);self._map.setFilter(_tileSet[_tileSet.layer]+"Focus",filter)});this._selectedItems=rave.set()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.deselectAction=function(_deselections){if(!this._mapLoaded)this._map.once("load",this._toggleSelect.bind(this,_deselections,false));else this._toggleSelect(_deselections,false)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._updateSelectedItemFilters=function(){var self= this;var type="region";this._featureDataMap.getTileSets({"type":type}).forEach(function(_tileSet){var filter=["in",_tileSet.property];self._selectedItems.forEach(function(_id){var item=self._featureDataMap.getById(_id);if(item&&_tileSet["id"]===item.tileSets[_tileSet["type"]]["id"])filter.push(item[_tileSet.property])});if(filter.length===2)filter.push(FILTER_NONE);self._map.setPaintProperty(_tileSet[_tileSet.layer],_tileSet.opacityProp,self._selectedItems["size"]()===0?1-_tileSet.transparency/100: 0.5);self._map.setFilter(_tileSet[_tileSet.layer]+"Select",filter);self._map.setFilter(_tileSet[_tileSet.layer]+"Focus",filter)})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._toggleSelect=function(_selections,_select){if(!_selections||!_selections.items||!this._featureDataMap["size"]())return;var itemsByLayer=this._getItemsByLayer(_selections);if(!itemsByLayer["size"]())return;var self=this;this._featureDataMap.getTileSets({"type":"region"}).forEach(function(_tileSet){var itemList= itemsByLayer.get(_tileSet["type"]);if(itemList)if(_select)itemList.forEach(function(_item){if(_tileSet["id"]===_item.tileSets[_tileSet["type"]]["id"]&&!self._selectedItems.has(_item["id"]))self._selectedItems.add(_item["id"])});else itemList.forEach(function(_item){if(_tileSet["id"]===_item.tileSets[_tileSet["type"]]["id"]&&self._selectedItems.has(_item["id"]))self._selectedItems.remove(_item["id"])})});this._updateSelectedItemFilters()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.selectAction= function(_selections){if(!this._mapLoaded)this._map.once("load",this._toggleSelect.bind(this,_selections,true));else this._toggleSelect(_selections,true)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.highlightAction=function(_highlights){if(!this._mapLoaded||!_highlights||!this._featureDataMap["size"]())return;var self=this;var itemsByLayer=this._getItemsByLayer(_highlights);if(itemsByLayer["size"]()===0&&this._highlights.items.length===0)return;var baseFilter= ["in"];var filter;var itemList;this._featureDataMap.getTileSets().forEach(function(_tileSet){filter=baseFilter.concat(_tileSet.property);itemList=[];if(itemsByLayer.has(_tileSet["type"]))itemsByLayer.get(_tileSet["type"]).forEach(function(_item){if(_item.tileSets[_tileSet["type"]]&&_item.tileSets[_tileSet["type"]]["id"]===_tileSet["id"]&&_item[_tileSet.property]!==null)itemList.push(_item[_tileSet.property])});filter=filter.concat(itemList.length?itemList:FILTER_NONE);self._map.setFilter(_tileSet[_tileSet.layer]+ "Hover",filter)});this._highlights=_highlights};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getItemsByLayer=function(_query){var self=this;var itemsByLayer=rave.map();var itemList;if(_query.items&&_query.items.length)_query.items.forEach(function(_item){var dataLayer=self._getDataLayer(_item.dataSet);if(!dataLayer)return;var layerType=dataLayer.getType();var featureData=null;if(_item["id"])featureData=self._featureDataMap.getById(_item["id"]);if(!featureData&& _item.datum)featureData=self._featureDataMap.getByKey(self._getFeatureKeyFromAssignedSlots(dataLayer,_item.datum));if(featureData)dataLayer.typeData.forEach(function(_type,_typeData){if(featureData.tileSets[_type]){if(itemsByLayer.has(_type))itemList=itemsByLayer.get(_type);else{itemList=[];itemsByLayer.set(_type,itemList)}itemList.push(featureData)}})});return itemsByLayer};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["setup"]=function(_node,_nls){var self= this;this._nls=_nls;_node[0][0].addEventListener("resizeVisContainer",function(){if(self._map)window.setTimeout(function(){self._map.resize()},10)})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.off=function(_eventName,_callback){switch(_eventName){case "maxZoomReached":var pos=this._maxZoomCallbacks.indexOf(_callback);if(pos!==-1){this._maxZoomCallbacks.splice(pos,1);if(this._maxZoomCallbacks.length===0){this._map.off("zoomstart",this._zoomStartHandler);this._map.off("zoomend", this._zoomEndHandler);this._zoomStartHandler=null;this._zoomEndHandler=null}}break;case "mappingError":pos=this._mappingErrorCallbacks.indexOf(_callback);if(pos!==-1)this._mappingErrorCallbacks.splice(pos,1);if(this._mappingErrorCallbacks.length===0){this._map.off("error",this._onMapError);this._map.off("data",this._onMapData)}break;default:this._map.off(_eventName,_callback);break}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["on"]=function(_eventName,_callback){var self= this;switch(_eventName){case "maxZoomReached":if(!this._maxZoomCallbacks.length){this._zoomStartHandler=function(){self._zoomStart=self._map.getZoom()};this._zoomEndHandler=function(){var zoomEnd=self._map.getZoom();if(zoomEnd===self._zoomStart&&zoomEnd===self._maxZoom)self._maxZoomCallbacks.forEach(function(_clb){_clb()});self._zoomStart=null};this._map["on"]("zoomstart",this._zoomStartHandler);this._map["on"]("zoomend",this._zoomEndHandler)}if(this._maxZoomCallbacks.indexOf(_callback)===-1)this._maxZoomCallbacks.push(_callback); break;case "mappingError":if(this._mappingErrorCallbacks.indexOf(_callback)===-1)this._mappingErrorCallbacks.push(_callback);if(this._mappingErrorCallbacks.length===1){this._map["on"]("error",this._onMapError.bind(this));this._map["on"]("data",this._onMapData.bind(this))}break;case "load":case "style.load":this._map["on"](_eventName,_callback);break;default:this._map["on"](_eventName,function(_event){var items=[];if(self._mapLoaded)items=self._queryRenderedFeatures(_event.point);_callback({items:items, _mapboxEvent:_event,originalEvent:_event.originalEvent})});break}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.emit=function(_eventName,_data){switch(_eventName){case "mappingError":this._mappingErrorCallbacks.forEach(function(_callback){_callback(_data)});break}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setMaxBounds=function(_lnglat){return};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setContainerRect= function(_rect){this._containerRect=_rect;if(this._map){var self=this;this._mapContainer.style("left",this._containerRect.x+"px").style("top",this._containerRect.y+"px").style("width",this._containerRect.width+"px").style("height",this._containerRect.height+"px");window.setTimeout(function(){self._map.resize()},10)}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["setMaxZoom"]=function(_maxZoom){this._maxZoom=_maxZoom;this._map["setMaxZoom"](_maxZoom)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["setMaxPointSize"]= function(_maxPointSize){this._maxPointSize=_maxPointSize};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["setMapLocale"]=function(_mapLocale){if(_mapLocale){var mapLocale=_mapLocale.toLowerCase();var pos=mapLocale.indexOf("-");if(pos>-1)mapLocale=mapLocale.substr(0,pos);switch(mapLocale){case "es":case "fr":case "de":case "pt":case "ru":case "zh":this._mapLocale=mapLocale;break;case "en":default:this._mapLocale="en";break}}else this._mapLocale="en";if(this._mapLoaded)this._applyMapLocale()}; com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._applyMapLocale=function(){if(this._map.style.stylesheet){var self=this;var localizedField="{name_"+this._mapLocale+"}";var styleData=this._styleDataCache.get(this._mapboxStyle);if(!styleData){styleData={baseLayer:"",symbolLayers:[]};this._map.style.stylesheet.layers.forEach(function(_layer){if(_layer["type"]==="symbol"){if(!styleData.baseLayer.length)styleData.baseLayer=_layer["id"];styleData.symbolLayers.push(_layer["id"]); self._setLocalizedField(_layer,localizedField)}else if(styleData.baseLayer.length)styleData.baseLayer=""});this._styleDataCache.set(this._mapboxStyle,styleData)}else this._map.style.stylesheet.layers.forEach(function(_layer){if(_layer["type"]==="symbol")self._setLocalizedField(_layer,localizedField)})}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._setLocalizedField=function(_layer,_localizedField){var textField=_layer["layout"]&&_layer["layout"]["text-field"]|| null;if(!textField)return;if(typeof textField==="string"&&reNameField.test(textField))this._map.setLayoutProperty(_layer["id"],"text-field",_localizedField);else if(typeof textField==="object"&&textField.hasOwnProperty("stops")){var replacedStops=false;var patchedStops=textField.stops.map(function(_stop){if(reNameField.test(_stop[1])){replacedStops=true;_stop[1]=_localizedField}return _stop});if(replacedStops){textField.stops=patchedStops;this._map.setLayoutProperty(_layer["id"],"text-field",textField)}}}; com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.bindHandlers=function(context){function eventName(name){return name+".mapboxRebind"}function dispatchMouseEvent(name){var e;if(typeof MouseEvent==="object"){e=document.createEvent("MouseEvent");e.initMouseEvent(name,false,false,null,0,0,0,rave.event.clientX,rave.event.clientY,rave.event.ctrlKey,rave.event.altKey,rave.event.shiftKey,rave.event.metaKey,0,null)}else e=new MouseEvent(name,{"clientX":rave.event.clientX, "clientY":rave.event.clientY,"ctrlKey":rave.event.ctrlKey,"shiftKey":rave.event.shiftKey,"altKey":rave.event.altKey,"metaKey":rave.event.metaKey});self._map.getCanvasContainer().dispatchEvent(e)}function dispatchTouchEvent(name){if(typeof MouseEvent!=="object"){var e=new TouchEvent(name,{"touches":rave.event.touches,"targetTouches":rave.event.targetTouches,"changedTouches":rave.event.changedTouches,"ctrlKey":rave.event.ctrlKey,"shiftKey":rave.event.shiftKey,"altKey":rave.event.altKey,"metaKey":rave.event.metaKey}); self._map.getCanvasContainer().dispatchEvent(e)}}function dispatchWheelEvent(name){var e;if(typeof MouseEvent==="object"){e=document.createEvent("WheelEvent");var modifiers="";e.initWheelEvent(name,false,false,null,0,0,0,rave.event.clientX,rave.event.clientY,0,null,modifiers,rave.event.deltaX,rave.event.deltaY,rave.event.deltaZ,rave.event.deltaMode)}else e=new WheelEvent(name,{"clientX":rave.event.clientX,"clientY":rave.event.clientY,"deltaX":rave.event.deltaX,"deltaY":rave.event.deltaY,"deltaZ":rave.event.deltaZ, "deltaMode":rave.event.deltaMode,"ctrlKey":rave.event.ctrlKey,"shiftKey":rave.event.shiftKey,"altKey":rave.event.altKey,"metaKey":rave.event.metaKey});self._map.getCanvasContainer().dispatchEvent(e)}var self=this;var mouseEvents=["click","contextmenu","dblclick","mousedown","mousemove","mouseout","mouseup"];var touchEvents=["touchcancel","touchend","touchmove","touchstart"];var wheelEvents=["mousewheel","wheel"];for(var e$$0=0;e$$00){var curLayerHasGeoData= self._dataLayerHasGeoData(_dataLayer);if(rebuild)if(curLayerHasGeoData)_dataLayer.data.forEach(function(_data){self._featureDataMap.add(_dataLayer,_data)});else _dataLayer.data.forEach(function(_data){var featureKey=self._getFeatureKeyFromAssignedSlots(_dataLayer,_data);var feature=self._mapCache.get(featureKey);if(feature)if(self._featureDataMap.hasFeature(featureKey))self._featureDataMap.update(_dataLayer,_data,featureKey,feature);else self._featureDataMap.add(_dataLayer,_data,featureKey,feature)}); else self._featureDataMap.updateDataLayerProperties(_dataLayer)}})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["setDataLayers"]=function(_dataLayers,_dataDirty,_combinedLayers){if(_dataDirty){this._mapboxDataDirty=_dataDirty;this._clearMapsCache()}this._featureDataMap.setCombinedLayers(_combinedLayers);this._dataLayers=_dataLayers;this._mapFeaturesToData(_dataDirty)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._sortBySize= function(_renderedFeatures){var self=this;var featureA;var featureB;if(_renderedFeatures&&_renderedFeatures.length>1)_renderedFeatures.sort(function(a,b){featureA=self._featureDataMap.getById(a["id"]);featureB=self._featureDataMap.getById(b["id"]);if(featureB&&featureB.hasOwnProperty("pointSize")&&featureA&&featureA.hasOwnProperty("pointSize"))return featureA.pointSize-featureB.pointSize;else return 0});return _renderedFeatures};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.getItemsAtPoint= function(_point){return this._queryRenderedFeatures([_point.x,_point.y])};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.getItemsInRect=function(_points){return this._queryRenderedFeatures([[_points[0].x,_points[0].y],[_points[1].x,_points[1].y]])};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.getBoundingBox=function(_points){var bounds=this._map.getBounds();return[[bounds._sw.lng,bounds._sw.lat],[bounds._ne.lng,bounds._ne.lat]]}; com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype.setBoundingBox=function(_points){if(_points&&_points.length===2){var bbox=[{lng:_points[0][0],lat:_points[0][1]},{lng:_points[1][0],lat:_points[1][1]}];if(this._mapLoaded)this._fitBounds(bbox);else this._mapBBox=bbox}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["setAutoZoom"]=function(_autoZoom){this._autoZoom=_autoZoom};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype["dispose"]= function(){if(this._map)this._map.remove()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._queryRenderedFeatures=function(_geometry){var self=this;var layersToQuery=[];var items=[];this._featureDataMap.getTileSets().forEach(function(_tileSet){layersToQuery.push(_tileSet[_tileSet.layer])});if(layersToQuery.length){var features=_geometry?this._map.queryRenderedFeatures(_geometry,{layers:layersToQuery}):[];var duplicates=rave.set();if(features&&features.length)features.forEach(function(_feature){var layerId= _feature.layer["id"];var sourceId=_feature.layer.source;var featureData=null;featureData=self._featureDataMap.getItem(sourceId,layerId,_feature.properties);if(featureData&&featureData.data[layerId])items.push({"id":featureData["id"],dataSet:featureData.dataSet[layerId],datum:featureData.data[layerId]})})}return this._sortBySize(items)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getFeatureKeyFromAssignedSlots=function(_dataLayer,_data){if(this._dataLayerHasGeoData(_dataLayer))return this._getGeoFeatureKey(_dataLayer.getType(), this._getGeoData(_dataLayer,_data));else{var keyParts=[];_dataLayer.featureAccessors.forEach(function(_accessor){if(_accessor){var value=_accessor(_data);if(value)keyParts.push(_accessor(_data))}});return this._mapCache.getKey(_dataLayer.getType(),keyParts)}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getGeoData=function(_dataLayer,_data){return _dataLayer.featureAccessors[0](_data)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getGeoFeatureKey= function(_type,_geoData){var keyParts=[_type];Object.keys(_geoData).forEach(function(_key){var value=_geoData[_key];if(value!==null)keyParts.push(value)});return keyParts.join("|")};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._getDataLayer=function(_type){var dataLayer=null;this._dataLayers.some(function(_dataLayer){if(_dataLayer.getType()===_type){dataLayer=_dataLayer;return true}return false});return dataLayer};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._addResource= function(_resource){var resources=this._addedResources.get(_resource["type"]);if(!resources){resources=[];this._addedResources.set(_resource["type"],resources)}resources.push(_resource)};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._removeResource=function(_id,_type){var resources=this._addedResources.get(_type);var resource;var idx;if(resources){if(_type==="source"){var layerResources=this._addedResources.get("layer");if(layerResources){for(idx=layerResources.length- 1;idx>=0;--idx){resource=layerResources[idx];if(resource.source===_id){this._map.removeLayer(resource["id"]);layerResources.splice(idx,1)}}if(layerResources.length===0)this._addedResources.remove("layer")}}for(idx=resources.length-1;idx>=0;--idx){resource=resources[idx];if(resource["id"]===_id){if(resource["type"]==="source")this._map.removeSource(resource["id"]);else this._map.removeLayer(resource["id"]);resources.splice(idx,1);break}}if(resources.length===0)this._addedResources.remove(_type)}}; com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._clearAddedResources=function(){var self=this;if(this._addedResources.has("layer"))this._addedResources.get("layer").forEach(function(_resouce){self._map.removeLayer(_resouce["id"])});if(this._addedResources.has("source"))this._addedResources.get("source").forEach(function(_resouce){self._map.removeSource(_resouce["id"])});this._addedResources=rave.map()};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._fitBounds= function(_bounds){try{var options={linear:true,"padding":this._maxPointSize+2+5,easing:easing};if(_bounds[0][0]===0&&_bounds[0][1]===0&&_bounds[1][0]===0&&_bounds[1][1]===0)options["maxZoom"]=4;this._map.fitBounds(_bounds,options)}catch(_err){}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._hasGeoDataLayer=function(){var self=this;return this._dataLayers.some(function(_dataLayer){return self._dataLayerHasGeoData(_dataLayer)})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._dataLayerHasGeoData= function(_dataLayer){return _dataLayer.typeData.values().some(function(_typeData){return _typeData.hasGeoData})};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._endsWith=function(_source,_part){return _source.indexOf(_part)===_source.length-_part.length};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._onMapError=function(_event){if(_event["type"]==="error"){var skipLog=false;if(_event.status&&_event.sourceId&&_event.status=== 404){skipLog=true;if(!this._endsWith(_event.sourceId,"Action")){this.emit("mappingError",this._getErrorDetails(_event.sourceId,null,null,null));this._removeResource(_event.sourceId,"source");this._removeResource(_event.sourceId+"Action","source")}}else if(_event.error){var match=reLayerError.exec(_event.error);if(match)if("region-"+match[1]===match[3]||"point-"+match[1]===match[3]){this.emit("mappingError",this._getErrorDetails(match[2],match[1],null,null));this._removeResource(match[3],"layer"); skipLog=true}else{if(this._endsWith(match[3],"Select")||this._endsWith(match[3],"Focus")||this._endsWith(match[3],"Hover")){this._removeResource(match[3],"layer");skipLog=true}}else if(_event.tile&&_event.tile.state==="errored")skipLog=true}if(!skipLog)console.error(_event&&_event.error||_event||"Empty error event")}};com_ibm_rave_bundles_nativeImpl_components_TiledmapV2NativeSubComponentImpl.prototype._onMapData=function(_event){var updateMap=false;if(_event.dataType==="source"&&_event.sourceId!== "mapbox"&&_event.sourceDataType==="metadata")this._featureDataMap.getTileSets({"id":_event.sourceId}).forEach(function(_tileSet){if(_tileSet.customPolygon){var source=this._map.getSource(_event.sourceId);if(source&&source.vectorLayers){var layer;var idx=0;for(var size=source.vectorLayers.length;idx tag with optional data attributes createLink: function(href, attributes) { var head = document.head || document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.href = href; link.rel = 'stylesheet'; for (var key in attributes) { if ( ! attributes.hasOwnProperty(key)) { continue; } var value = attributes[key]; link.setAttribute('data-' + key, value); } head.appendChild(link); }, // Create a