if(!window.ChartUtils){var ChartUtils=(function(){"use strict";if(!Object.hasOwnProperty("init")){Object.init=function(proto,properties){if(arguments.length!==2){throw new Error('Object.init implementation only accepts 2 parameters.');}var key,new_obj=Object.create(proto);if(properties){for(key in properties){if(properties.hasHownProperty(key)){Object.defineProperty(new_obj,key,{value:properties[key],writable:true,enumerable:true,configurable:false});}}}return new_obj;};}if(Object.prototype.clear){Object.prototype.clear=function(){for(var prop in this){if(this.hasOwnProperty(prop)){delete this[prop];}}return this;};}if(!Object.prototype.createSafeProxy){Object.prototype.createSafeProxy=function(canDestroy){var property;var proxy=Object.create(null);var obj=this;for(property in obj){if(Object.isFunction(obj[property])){proxy[property]=(function(p){return function(){var result;if(obj){result=obj[p].apply(obj,Array.prototype.slice.apply(arguments,[0]));if(result===obj){return proxy;}else{return result;}}else{throw"Null reference: the object has been already destroyed";}};})(property);}}proxy.destroy=function(){try{if(canDestroy){obj.destroy();}}finally{obj=null;}};return proxy;};}if(Array.prototype.clear){Array.prototype.clear=function(deepClear){if(deepClear){for(var i=0;i=24||v[1]>=60){return null;}else{return v;}},addTimeStrings:function(timeString_1,timeString_2){var t1=this.validateTimeString(timeString_1);if(!t1){throw"Invalid Argument: timeString_1";}var t2=this.validateTimeString(timeString_2);if(!t2){throw"Invalid Argument: timeString_2";}t1[1]+=t2[1];t1[0]+=t2[0];return formatTimeString(t1[0],t1[1]);},addIntToTimeString:function(timeString,minutes){var t=this.validateTimeString(timeString);if(!t){throw"Invalid Argument: timeString";}if(minutes<0){throw"Invalid Argument: minutes";}t[1]+=minutes;return formatTimeString(t[0],t[1]);}};Object.freeze(utils);return utils;})();}if(!window.DynamicChart){var DynamicChart=(function(){"use strict";var MAX_SPACE_DIMENSION=10;var FILL_COLORS=["blue","red","green","orange","purple","cyan","magenta","yellow","limegreen","brown"];var DEFAULT_LABEL_SIZE=12;var DEFAULT_TITLE_SIZE=22;var LEGEND_ITEM_WIDTH=25,LEGEND_ITEM_HEIGHT=15,LEGEND_MARGIN=5,LEGEND_ITEM_LEFT=LEGEND_MARGIN,LEGEND_ITEM_FONT_SIZE=11;var legendPrototype={setPosition:function(left,top){left=parseInt(left,10);top=parseInt(top,10);if(this.__divElement__&&!isNaN(left)&&!isNaN(top)){this.__divElement__.attr("style","position:absolute; left:"+left+"px; top:"+top+"px;");}return this;},setWidth:function(width){width=parseInt(width,10);if(this.__svgElement__&&!isNaN(width)&&width>=0){this.__svgElement__.attr("width",width);this.__divElement__.attr("width",width);}else{throw"Illegal Argument: width";}return this;},setHeight:function(height){height=parseInt(height,10);if(this.__svgElement__&&!isNaN(height)&&height>=0){this.__svgElement__.attr("height",height);}else{throw"Illegal Argument: height";}return this;},addItem:function(labelText,labelColor,fillColor){if(labelText===undefined||labelColor===undefined||fillColor===undefined){throw"Wrong number of arguments: label and color are both mandatory";}this.__items__.push({labelText:labelText,labelColor:labelColor,fillColor:fillColor});var n=this.__items__.length-1;this.__svgElement__.append("rect").attr("stroke","black").attr("fill",fillColor).attr("width",LEGEND_ITEM_WIDTH).attr("height",LEGEND_ITEM_HEIGHT).attr("x",LEGEND_ITEM_LEFT).attr("y",LEGEND_MARGIN+n*(LEGEND_ITEM_HEIGHT+LEGEND_MARGIN));this.__svgElement__.append("text").text(labelText).attr("fill",labelColor).attr("x",LEGEND_ITEM_LEFT+LEGEND_ITEM_WIDTH+LEGEND_MARGIN).attr("y",n*(LEGEND_ITEM_HEIGHT+LEGEND_MARGIN)+LEGEND_ITEM_HEIGHT).attr("font-family","sans-serif").attr("font-size",LEGEND_ITEM_FONT_SIZE).attr("text-anchor","left");},removeItem:function(index){index=parseInt(index,10);if(isNaN(index)||index<0||index>=this.__items__.length){throw"Illegal Argument: index";}this.__items__.splice(index,1);this.__svgElement__.selectAll("rect").data(this.__items__).exit().remove();this.__svgElement__.selectAll("text").data(this.__items__).exit().remove();this.__redrawLegend__();return this;},updateItem:function(index,newLabelText,newLabelColor,newFillColor){index=parseInt(index,10);if(isNaN(index)||index<0||index>=this.__items__.length){throw"Illegal Argument: index";}var oldItem=this.__items__[index];if(newLabelText!==undefined){oldItem.labelText=newLabelText;}if(newLabelColor!==undefined){oldItem.labelColor=newLabelColor;}if(newFillColor!==undefined){oldItem.fillColor=newFillColor;}this.__redrawLegend__();return this;},destroy:function(){this.__items__.length=0;this.__svgElement__.remove();this.__divElement__.remove();return null;}};function LegendFactory(width,height,left,top,parent){function __init__(legend,width,height){legend.setWidth(width);legend.setHeight(height);legend.setPosition(left,top);legend.__svgElement__.append("rect").attr("stroke","black").attr("width",width).attr("fill","none").attr("height",height);}var legend=Object.create(legendPrototype);Object.defineProperty(legend,"__redrawLegend__",{value:function(){this.__svgElement__.selectAll("rect").data(this.__items__).attr("stroke","black").attr("fill",function(item){return item.fillColor;}).attr("width",LEGEND_ITEM_WIDTH).attr("height",LEGEND_ITEM_HEIGHT).attr("x",LEGEND_ITEM_LEFT).attr("y",function(item,i){return LEGEND_MARGIN+i*(LEGEND_ITEM_HEIGHT+LEGEND_MARGIN);});this.__svgElement__.selectAll("text").data(this.__items__).text(function(item){return item.labelText;}).attr("fill",function(item){return item.labelColor;}).attr("x",LEGEND_ITEM_LEFT+LEGEND_ITEM_WIDTH+LEGEND_MARGIN).attr("y",function(item,i){return i*(LEGEND_ITEM_HEIGHT+LEGEND_MARGIN)+LEGEND_ITEM_HEIGHT;}).attr("font-family","sans-serif").attr("font-size",LEGEND_ITEM_FONT_SIZE).attr("text-anchor","left");return;},writable:false,enumerable:false,configurable:false});if(width===undefined||height===undefined){throw"Wrong number of arguments: width and height are mandatory";}if(parent===undefined){parent=d3.select("body");}var div=parent.append("div");var svg=div.append("svg").attr("id","chart_legend");Object.defineProperty(legend,"__divElement__",{value:div,writable:false,enumerable:false,configurable:false});Object.defineProperty(legend,"__svgElement__",{value:svg,writable:false,enumerable:false,configurable:false});Object.defineProperty(legend,"__items__",{value:[],writable:false,enumerable:false,configurable:false});__init__(legend,width,height);Object.seal(legend);return legend;}var next_id=0;var basicBarChartSharedPrototype={setPosition:function(left,top){left=parseInt(left,10);top=parseInt(top,10);if(this.__divElement__&&!isNaN(left)&&!isNaN(top)){this.__divElement__.attr("style","position:absolute; left:"+left+"px; top:"+top+"px;");}return this;},setWidth:function(width){width=parseInt(width,10);if(this.__svgElement__&&!isNaN(width)&&width>=0){this.__svgElement__.attr("width",width);this.__divElement__.attr("width",width);}else{throw"Illegal Argument: width";}return this;},setHeight:function(height){height=parseInt(height,10);if(this.__svgElement__&&!isNaN(height)&&height>=0){this.__svgElement__.attr("height",height);}else{throw"Illegal Argument: height";}return this;},setTitle:function(title,size,color,left,top){var titleElement=this.__svgElement__.selectAll("text[type=title_element]");size=parseInt(size,10);if(!Object.isNumber(size)){size=DEFAULT_TITLE_SIZE;}left=parseInt(left,10);if(!Object.isNumber(left)){left=this.__svgElement__.attr("width")/2;}top=parseInt(top,10);if(!Object.isNumber(top)){top=size;}if(titleElement.empty()){titleElement=this.__svgElement__.append("text").attr("type","title_element").attr("text-anchor","middle").attr("font-family","sans-serif");}titleElement.text(title).attr("font-size",size).attr("x",left).attr("y",top).attr("fill",color);return this;},addLegend:function(labels,width,height,left,top,parent){if(this.hasOwnProperty("__legend__")){if(!Object.isArray(labels)){throw"Illegal Argument: labels";}else if(labels.length!==this.__dataDim__){throw"Invalid array size: "+this.__dataDim__+" labels needed";}if(this.__legend__&&this.__legend__.destroy){this.__legend__.destroy();}if(parent===undefined){parent=this.__parent__;}this.__legend__=LegendFactory(width,height,left,top,parent);for(var i=0;ithis.__maxVals__[j]){this.__maxVals__[j]=val[j];}}}}}else{throw"Illegal Argument: newDataArray must be an Array";}var newDataLength=this.__getDatasetLength__()*this.__dataDim__;var max_val;if(this.__scaleGlobally__){max_val=ChartUtils.fillArray(this.__maxVals__.max(),this.__dataDim__);}else{max_val=this.__maxVals__;}for(j=0;jthis.__getDatasetLength__()){throw"Illegal Argument: n";}}else{n=this.__getDatasetLength__();}for(i=0;iindex){if(visible!==undefined){this.__labelsVisible__[index]=visible?true:false;}else{this.__labelsVisible__[index]=!this.__labelsVisible__;}}else{throw"Invalid Index";}return this;},areLabelsVisible:function(index){if(!index){index=0;}if(this.__labelsVisible__.length>index){return this.__labelsVisible__[index];}else{throw"Invalid Index";}},setGlobalScaling:function(){if(this.hasOwnProperty("__scaleGlobally__")){this.__scaleGlobally__=true;}else{var proto=this.prototype?this.prototype:this.__proto__;if(proto&&proto.setGlobalScaling){proto.setGlobalScaling();}}return this;},setLocalScaling:function(){if(this.hasOwnProperty("__scaleGlobally__")){this.__scaleGlobally__=false;}else{var proto=this.prototype?this.prototype:this.__proto__;if(proto&&proto.setLocalScaling){proto.setLocalScaling();}}return this;},getFillColor:function(index){if(!index){index=0;}if(this.__fillColors__.length>index){return this.__fillColors__[index];}else{throw"Invalid Index";}},getStrokeColor:function(index){if(!index){index=0;}if(this.__strokeColors__.length>index){return this.__strokeColors__[index];}else{throw"Invalid Index";}},getLabelColor:function(index){if(!index){index=0;}if(this.__labelColors__.length>index){return this.__labelColors__[index];}else{throw"Invalid Index";}},getLabelsSize:function(index){if(!index){index=0;}if(this.__labelsSize__.length>index){return this.__labelsSize__[index];}else{throw"Invalid Index";}},setFillColor:function(color,index){if(!index){index=0;}if(this.__fillColors__.length>index){this.__fillColors__[index]=color;}else{throw"Invalid Index";}if(this.__legend__){this.__legend__.updateItem(index,undefined,undefined,color);}return this;},setStrokeColor:function(color,index){if(!index){index=0;}if(this.__strokeColors__.length>index){this.__strokeColors__[index]=color;}else{throw"Invalid Index";}return this;},setLabelColor:function(color,index){if(!index){index=0;}if(this.__labelColors__.length>index){this.__labelColors__[index]=color;}else{throw"Invalid Index";}if(this.__legend__){this.__legend__.updateItem(index,undefined,color,undefined);}return this;},setLabelSize:function(size,index){size=parseInt(size,10);if(isNaN(size)||size<=0){throw"Illegal Argument: size";}if(!index){index=0;}if(this.__labelsSize__.length>index){this.__labelsSize__[index]=size;}else{throw"Invalid Index";}return this;},setBarWidth:function(){throw"Read only property: barWidth";},getBarWidth:function(xScale){if(xScale===undefined){xScale=this.__xScale__;}if(!xScale){throw"Illegal Argument: xScale";}return xScale(1)-xScale(0)-1;},destroy:function(){this.clearData();this.__data__.length=0;this.__maxVals__.length=0;this.__yScale__.length=0;this.__strokeColors__.length=0;this.__fillColors__.length=0;this.__labelColors__.length=0;this.__labelsSize__.length=0;this.__labelsVisible__.length=0;this.__svgElement__.remove();this.__divElement__.remove();if(this.__legend__&&this.__legend__.destroy){this.__legend__.destroy();}return null;}};Object.defineProperty(basicBarChartSharedPrototype,"__getDatasetLength__",{value:function(){return this.__data__[0].length;},writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChartSharedPrototype,"__canAppendData__",{value:function(newDataArray){if(!Object.isArray(newDataArray)){return[];}return this.__getDatasetLength__()===0||this.getBarWidth(this.__xScale__)>0?newDataArray:[];},writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChartSharedPrototype,"__formatValue__",{value:function(value){if(Object.isArray(value)){if(value.length!==this.__dataDim__){return null;}for(var i=0;iMAX_SPACE_DIMENSION){throw"Max number of subvalues for each point ("+MAX_SPACE_DIMENSION+") exceeded";}}Object.defineProperty(basicBarChart,"__dataDim__",{value:dataDim,writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__data__",{value:ChartUtils.fillArray(function(){return[];},basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__maxVals__",{value:ChartUtils.fillArray(0,basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});return;}if(width===undefined||height===undefined){throw"Wrong number of arguments: width and height are mandatory";}if(parent===undefined){parent=d3.select("body");}var div=parent.append("div");var svg=div.append("svg").attr("id","dynamic_chart_"+next_id);next_id+=1;var basicBarChart=Object.create(basicBarChartSharedPrototype);__initData__(basicBarChart,dataDim);var __xScale__=d3.scale.linear().range([0,width]);var __yScaleGenerator__=function(){return d3.scale.linear().range([0,height]);};Object.defineProperty(basicBarChart,"__parent__",{value:parent,writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__divElement__",{value:div,writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__svgElement__",{value:svg,writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__xScale__",{value:__xScale__,writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__yScale__",{value:ChartUtils.fillArray(__yScaleGenerator__,basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__scaleGlobally__",{value:true,writable:true,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__labelsSize__",{value:ChartUtils.fillArray(DEFAULT_LABEL_SIZE,basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__labelsVisible__",{value:ChartUtils.fillArray(true,basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__fillColors__",{value:FILL_COLORS.shallowCopy(basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__strokeColors__",{value:ChartUtils.fillArray("black",basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__labelColors__",{value:ChartUtils.fillArray("black",basicBarChart.__dataDim__),writable:false,enumerable:false,configurable:false});Object.defineProperty(basicBarChart,"__legend__",{value:null,writable:true,enumerable:false,configurable:false});__initChart__(basicBarChart,width,height);Object.seal(basicBarChart);return basicBarChart;}function FixedWidthBarChart(ticks,startingPoint,width,height,dataDim,parent){ticks=parseInt(ticks,10);if(isNaN(ticks)||ticks<=0){throw"Illegal Argument: ticks";}var proto=BasicBarChart(width,height,dataDim,parent);var fixedWidthBarChart=Object.create(proto);Object.defineProperty(fixedWidthBarChart,"__ticks__",{value:ticks,writable:false,enumerable:false,configurable:false});Object.defineProperty(fixedWidthBarChart,"__tickLength__",{value:1,writable:true,enumerable:false,configurable:false});Object.defineProperty(fixedWidthBarChart,"__ticksToRemoveOnFullQueue__",{value:0,writable:true,enumerable:false,configurable:false});Object.defineProperty(fixedWidthBarChart,"setFixedDataLengthMode",{value:function(){if(this.hasOwnProperty("__ticksToRemoveOnFullQueue__")){this.__ticksToRemoveOnFullQueue__=0;}else{var proto=this.prototype?this.prototype:this.__proto__;if(proto&&proto.setFixedDataLengthMode){proto.setFixedDataLengthMode();}}return this;},writable:false,enumerable:false,configurable:false});Object.defineProperty(fixedWidthBarChart,"setShifitingDataMode",{value:function(ticksToRemove){ticksToRemove=parseInt(ticksToRemove,10);if(isNaN(ticksToRemove)||ticksToRemove<=0){throw"Illegal Arguments: ticksToRemove";}if(this.hasOwnProperty("__ticksToRemoveOnFullQueue__")){this.__ticksToRemoveOnFullQueue__=ticksToRemove;}else{var proto=this.prototype?this.prototype:this.__proto__;if(proto&&proto.setShifitingDataMode){proto.setShifitingDataMode(ticksToRemove);}}return this;},writable:false,enumerable:true,configurable:false});Object.defineProperty(fixedWidthBarChart,"getBarWidth",{value:function(){return this.__barWidth__;},writable:false,enumerable:true,configurable:false});Object.defineProperty(fixedWidthBarChart,"__canAppendData__",{value:function(newDataArray){if(!Object.isArray(newDataArray)){return[];}var m=this.__getDatasetLength__(),n=this.__ticks__-m;if(newDataArray.length<=n){return newDataArray;}else if(this.__ticksToRemoveOnFullQueue__===0){if(n<=0){return[];}else{return newDataArray.splice(0,n);}}else{m=Math.min(this.__ticksToRemoveOnFullQueue__,m);this.clearData(m);return this.__canAppendData__(newDataArray);}},writable:false,enumerable:false,configurable:false});Object.defineProperty(fixedWidthBarChart,"__drawNewData__",{value:function(dataSet,labelsSet,dataIndex,xScale,yScale){var that=this;var height=parseInt(this.__svgElement__.attr("height"),10);var barWidth=this.getBarWidth(xScale);dataSet.enter().append("rect").attr("index","data_"+dataIndex).attr("x",function(d,i){return(i*that.__dataDim__+dataIndex)*barWidth;}).attr("y",height).attr("width",barWidth).attr("height",0).attr("fill",that.getFillColor(dataIndex)).attr("stroke",that.getStrokeColor(dataIndex)).attr("opacity",function(d){return that.__getBarOpacity__((0.0+yScale(d))/height);});if(that.areLabelsVisible(dataIndex)&&barWidth>that.getLabelsSize(dataIndex)){labelsSet.enter().append("text").attr("index","data_"+dataIndex).text(function(d){return d;}).attr("text-anchor","middle").attr("x",function(d,i){return(i*that.__dataDim__+dataIndex+0.5)*barWidth;}).attr("y",height).attr("font-family","sans-serif").attr("font-size",that.getLabelsSize(dataIndex)).attr("fill",that.getLabelColor(dataIndex));}else{labelsSet.remove();}return;},writable:false,enumerable:false,configurable:false});Object.defineProperty(fixedWidthBarChart,"__updateDrawing__",{value:function(dataSet,labelsSet,dataIndex,xScale,yScale){var that=this;var height=parseInt(this.__svgElement__.attr("height"),10);var barWidth=this.getBarWidth(xScale);dataSet.transition().attr("x",function(d,i){return(i*that.__dataDim__+dataIndex)*barWidth;}).attr("y",function(d){return height-yScale(d);}).attr("width",barWidth).attr("height",function(d){return yScale(d);}).attr("opacity",function(d){return that.__getBarOpacity__((0.0+yScale(d))/height);});if(that.areLabelsVisible(dataIndex)&&barWidth>that.getLabelsSize(dataIndex)){labelsSet.transition().text(function(d){return d;}).attr("x",function(d,i){return(i*that.__dataDim__+dataIndex+0.5)*barWidth;}).attr("y",function(d){return height-yScale(d)+that.getLabelsSize(dataIndex);});}else{labelsSet.remove();}return;},writable:false,enumerable:false,configurable:false});function __init__(chart,width,height){var barWidth=width/(chart.__dataDim__*chart.__ticks__);if(barWidth<=0){throw"Illegal Arguments combination: width too small to draw 'ticks' values";}Object.defineProperty(chart,"__barWidth__",{value:barWidth,writable:false,enumerable:false,configurable:false});return;}__init__(fixedWidthBarChart,width,height);Object.seal(fixedWidthBarChart);return fixedWidthBarChart;}function SlidingBarChart(ticks,width,height,dataDim,parent){ticks=parseInt(ticks,10);if(isNaN(ticks)||ticks<=0){throw"Illegal Argument: ticks";}var DEFAULT_BACKGROUND="lightgrey";var DEFAULT_BACKGROUND_HIGHLIGHT="lightpink";var AXES_LABEL_SIZE=14;var AXES_LABEL_WIDTH=50;var AXES_LABEL_MARGIN=5;var proto=FixedWidthBarChart(ticks,0,width,height,dataDim,parent);var slidingBarChart=Object.create(proto);Object.defineProperty(slidingBarChart,"__dataCounter__",{value:0,writable:true,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"__ticksBetweenHighlights__",{value:10,writable:true,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"getTicksBetweenHighlights",{value:function(){return this.__ticksBetweenHighlights__;},writable:false,enumerable:true,configurable:false});Object.defineProperty(slidingBarChart,"setTicksBetweenHighlights",{value:function(ticks){if(this.hasOwnProperty("__ticksBetweenHighlights__")){this.__ticksBetweenHighlights__=ticks;}else{var proto=this.prototype?this.prototype:this.__proto__;if(proto&&proto.setTicksBetweenHighlights){proto.setTicksBetweenHighlights(ticks);}}return this;},writable:false,enumerable:true,configurable:false});Object.defineProperty(slidingBarChart,"__backgroundColor__",{value:DEFAULT_BACKGROUND,writable:true,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"__backgroundHighlightColor__",{value:DEFAULT_BACKGROUND_HIGHLIGHT,writable:true,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"setBackgroundColor",{value:function(bgColor){if(this.hasOwnProperty("__backgroundColor__")){this.__backgroundColor__=bgColor;}else{var proto=this.prototype?this.prototype:this.__proto__;if(proto&&proto.setBackgroundColor){proto.setBackgroundColor(bgColor);}}return this;},writable:false,enumerable:true,configurable:false});Object.defineProperty(slidingBarChart,"getBackgroundColor",{value:function(){return this.__backgroundColor__;},writable:false,enumerable:true,configurable:false});Object.defineProperty(slidingBarChart,"setBackgroundHighlightColor",{value:function(bgHColor){if(this.hasOwnProperty("__backgroundHighlightColor__")){this.__backgroundHighlightColor__=bgHColor;}else{var proto=this.prototype?this.prototype:this.__proto__;if(proto&&proto.setBackgroundHighlightColor){proto.setBackgroundHighlightColor(bgHColor);}}return this;},writable:false,enumerable:true,configurable:false});Object.defineProperty(slidingBarChart,"getBackgroundHighlightColor",{value:function(){return this.__backgroundHighlightColor__;},writable:false,enumerable:true,configurable:false});Object.defineProperty(slidingBarChart,"__canAppendData__",{value:function(newDataArray){if(!Object.isArray(newDataArray)){return[];}var m=this.__getDatasetLength__(),n=this.__ticks__-m,k=newDataArray.length;if(k>this.__ticks__){newDataArray.splice(0,k-this.__ticks__);k=this.__ticks__;}this.__dataCounter__+=k;if(k<=n){return newDataArray;}else{m=Math.min(k,m);this.clearData(m);return newDataArray;}},writable:false,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"__selectBackgroundBars__",{value:function(filter){if(filter===undefined){return this.__svgElement__.selectAll("rect[type=back]");}else{return this.__svgElement__.selectAll("rect[type=back]").filter(filter);}},writable:false,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"__updateBackground__",{value:function(){var counter=this.__dataCounter__,ticks=this.getTicksBetweenHighlights();var bgColor=this.getBackgroundColor(),bgHColor=this.getBackgroundHighlightColor();this.__selectBackgroundBars__().attr("fill",bgColor);this.__selectBackgroundBars__(function(){return counter>this.d_index&&(counter-this.d_index)%ticks===0;}).attr("fill",bgHColor);return;},writable:false,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"__updateAxes__",{value:function(yScale){var axeLabels,m;if(this.__scaleGlobally__||this.__dataDim__===1){m=this.__maxVals__.max();axeLabels=[m,m/2,0];}else{axeLabels=[];}var labels=this.__axeArea__.selectAll("text").data(axeLabels);var height=parseInt(this.__svgElement__.attr("height"),10);labels.exit().remove();labels.enter().append("text").attr("font-family","sans-serif").attr("font-size",AXES_LABEL_SIZE).attr("fill","black");labels.text(function(d){return d;}).attr("x",AXES_LABEL_MARGIN).attr("y",function(d){return Math.max(AXES_LABEL_SIZE,height-yScale(d));});return;},writable:false,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"__drawNewData__",{value:function(dataSet,labelsSet,dataIndex,xScale,yScale){var that=this;var height=parseInt(this.__svgElement__.attr("height"),10);var barWidth=this.getBarWidth(xScale);var initial_x=(this.__ticks__-this.__getDatasetLength__())*that.__dataDim__*barWidth;if(dataIndex===0){this.__updateBackground__();}dataSet.enter().append("rect").attr("index","data_"+dataIndex).attr("x",function(d,i){return initial_x+(i*that.__dataDim__+dataIndex)*barWidth+1;}).attr("y",height).attr("width",barWidth-3).attr("height",0).attr("fill",that.getFillColor(dataIndex)).attr("stroke",that.getStrokeColor(dataIndex)).attr("opacity",function(d){return that.__getBarOpacity__((0.0+yScale(d))/height);});if(that.areLabelsVisible(dataIndex)&&barWidth>that.getLabelsSize(dataIndex)){labelsSet.enter().append("text").attr("index","data_"+dataIndex).text(function(d){return d;}).attr("text-anchor","middle").attr("x",function(d,i){return initial_x+(i*that.__dataDim__+dataIndex+0.5)*barWidth+1;}).attr("y",height).attr("font-family","sans-serif").attr("font-size",that.getLabelsSize(dataIndex)).attr("fill",that.getLabelColor(dataIndex));}else{labelsSet.remove();}return;},writable:false,enumerable:false,configurable:false});Object.defineProperty(slidingBarChart,"__updateDrawing__",{value:function(dataSet,labelsSet,dataIndex,xScale,yScale){var that=this;var height=parseInt(this.__svgElement__.attr("height"),10);var barWidth=this.getBarWidth(xScale);var initial_x=(this.__ticks__-this.__getDatasetLength__())*that.__dataDim__*barWidth;if(dataIndex===0){this.__updateBackground__();this.__updateAxes__(yScale);}dataSet.transition().duration(100).attr("x",function(d,i){return initial_x+(i*that.__dataDim__+dataIndex)*barWidth+1;}).attr("y",function(d){return height-yScale(d);}).attr("width",barWidth-3).attr("height",function(d){return yScale(d);}).attr("opacity",function(d){return that.__getBarOpacity__((0.0+yScale(d))/height);});if(that.areLabelsVisible(dataIndex)&&barWidth>that.getLabelsSize(dataIndex)){labelsSet.transition().text(function(d){return d;}).attr("x",function(d,i){return initial_x+(i*that.__dataDim__+dataIndex+0.5)*barWidth+1;}).attr("y",function(d){return height-yScale(d)+that.getLabelsSize(dataIndex);});}else{labelsSet.remove();}return;},writable:false,enumerable:false,configurable:false});function __init__(chart,width,height){for(var i=0;i0){__r__=wheelRadius;__barHeight__=Math.min(width,height)/4;}else{__barHeight__=((Math.min(width,height)-2*wheelRadius)/2)*0.75;__r__=__barHeight__*0.75;}Object.defineProperty(chart,"__r__",{value:__r__,writable:false,enumerable:false,configurable:false});Object.defineProperty(chart,"__barHeight__",{value:__barHeight__,writable:false,enumerable:false,configurable:false});for(var i=0;i