Searched defs:reverse_each (Results 1 - 4 of 4) sorted by relevance

/forgerock/openam-v13/openam-server-only/src/main/webapp/js/Bluff-0.3.6.2/
H A Dbluff-min.js1 Bluff={VERSION:'0.3.6',array:function(c){if(c.length===undefined)return[c];var d=[],f=c.length;while(f--)d[f]=c[f];return d},array_new:function(c,d){var f=[];while(c--)f.push(d);return f},each:function(c,d,f){for(var g=0,h=c.length;g<h;g++){d.call(f||null,c[g],g)}},index:function(c,d){for(var f=0,g=c.length;f<g;f++){if(c[f]===d)return f}return-1},keys:function(c){var d=[],f;for(f in c)d.push(f);return d},map:function(d,f,g){var h=[];this.each(d,function(c){h.push(f.call(g||null,c))});return h},reverse_each:function(c,d,f){var g=c.length;while(g--)d.call(f||null,c[g],g)},sum:function(c){var d=0,f=c.length;while(f--)d+=c[f];return d},Mini:{}};Bluff.Base=new JS.Class({extend:{DEBUG:false,DATA_LABEL_INDEX:0,DATA_VALUES_INDEX:1,DATA_COLOR_INDEX:2,LEGEND_MARGIN:20,TITLE_MARGIN:20,LABEL_MARGIN:10,DEFAULT_MARGIN:20,DEFAULT_TARGET_WIDTH:800,THOUSAND_SEPARATOR:','},top_margin:null,bottom_margin:null,right_margin:null,left_margin:null,title_margin:null,legend_margin:null,labels:null,center_labels_over_point:null,has_left_labels:null,x_axis_label:null,y_axis_label:null,y_axis_increment:null,colors:null,title:null,font:null,font_color:null,hide_line_markers:null,hide_legend:null,hide_title:null,hide_line_numbers:null,no_data_message:null,title_font_size:null,legend_font_size:null,marker_font_size:null,marker_color:null,marker_count:null,minimum_value:null,maximum_value:null,sort:null,additional_line_values:null,stacked:null,legend_box_size:null,tooltips:false,initialize:function(c,d){this._0=new Bluff.Renderer(c);d=d||this.klass.DEFAULT_TARGET_WIDTH;var f;if(typeof d!=='number'){f=d.split('x');this._j=parseFloat(f[0]);this._t=parseFloat(f[1])}else{this._j=parseFloat(d);this._t=this._j*0.75}this.initialize_ivars();this._1j();this.theme_keynote();this._10={}},initialize_ivars:function(){this._b=800;this._L=800*(this._t/this._j);this._5=0;this.marker_count=null;this.maximum_value=this.minimum_value=null;this._c=false;this._1=[];this.labels={};this._u={};this.sort=true;this.title=null;this._a=this._j/this._b;this.marker_font_size=21.0;this.legend_font_size=20.0;this.title_font_size=36.0;this.top_margin=this.bottom_margin=this.left_margin=this.right_margin=this.klass.DEFAULT_MARGIN;this.legend_margin=this.klass.LEGEND_MARGIN;this.title_margin=this.klass.TITLE_MARGIN;this.legend_box_size=20.0;this.no_data_message="No Data";this.hide_line_markers=this.hide_legend=this.hide_title=this.hide_line_numbers=false;this.center_labels_over_point=true;this.has_left_labels=false;this.additional_line_values=[];this._1C=[];this._k={};this.x_axis_label=this.y_axis_label=null;this.y_axis_increment=null;this.stacked=null;this._9=null},set_margins:function(c){this.top_margin=this.left_margin=this.right_margin=this.bottom_margin=c},set_font:function(c){this.font=c;this._0.font=this.font},add_color:function(c){this.colors.push(c)},replace_colors:function(c){this.colors=c||[];this._w=0},set_theme:function(c){this._1j();this._k={colors:['black','white'],additional_line_colors:[],marker_color:'white',font_color:'black',background_colors:null,background_image:null};for(var d in c)this._k[d]=c[d];this.colors=this._k.colors;this.marker_color=this._k.marker_color;this.font_color=this._k.font_color||this.marker_color;this._1C=this._k.additional_line_colors;this._M()},set_background:function(c){if(c.colors)this._k.background_colors=c.colors;if(c.image)this._k.background_image=c.image;this._M()},theme_keynote:function(){this._11='#6886B4';this._12='#FDD84E';this._v='#72AE6E';this._D='#D1695E';this._13='#8A6EAF';this._E='#EFAA43';this._F='white';this.colors=[this._12,this._11,this._v,this._D,this._13,this._E,this._F];this.set_theme({colors:this.colors,marker_color:'white',font_color:'white',background_colors:['black','#4a465a']})},theme_37signals:function(){this._v='#339933';this._13='#cc99cc';this._11='#336699';this._12='#FFF804';this._D='#ff0000';this._E='#cf5910';this._G='black';this.colors=[this._12,this._11,this._v,this._D,this._13,this._E,this._G];this.set_theme({colors:this.colors,marker_color:'black',font_color:'black',background_colors:['#d1edf5','white']})},theme_rails_keynote:function(){this._v='#00ff00';this._14='#333333';this._E='#ff5d00';this._D='#f61100';this._F='white';this._15='#999999';this._G='black';this.colors=[this._v,this._14,this._E,this._D,this._F,this._15,this._G];this.set_theme({colors:this.colors,marker_color:'white',font_color:'white',background_colors:['#0083a3','#0083a3']})},theme_odeo:function(){this._14='#202020';this._F='white';this._1D='#a21764';this._v='#8ab438';this._15='#999999';this._1E='#3a5b87';this._G='black';this.colors=[this._14,this._F,this._1E,this._1D,this._v,this._15,this._G];this.set_theme({colors:this.colors,marker_color:'white',font_color:'white',background_colors:['#ff47a4','#ff1f81']})},theme_pastel:function(){this.colors=['#a9dada','#aedaa9','#daaea9','#dadaa9','#a9a9da','#daaeda','#dadada'];this.set_theme({colors:this.colors,marker_color:'#aea9a9',font_color:'black',background_colors:'white'})},theme_greyscale:function(){this.colors=['#282828','#383838','#686868','#989898','#c8c8c8','#e8e8e8'];this.set_theme({colors:this.colors,marker_color:'#aea9a9',font_color:'black',background_colors:'white'})},data:function(f,g,h){g=(g===undefined)?[]:g;h=h||null;g=Bluff.array(g);this._1.push([f,g,(h||this._1F())]);this._5=(g.length>this._5)?g.length:this._5;Bluff.each(g,function(c,d){if(c===undefined)return;if(this.maximum_value===null&&this.minimum_value===null)this.maximum_value=this.minimum_value=c;this.maximum_value=this._1k(c)?c:this.maximum_value;if(this.maximum_value>=0)this._c=true;this.minimum_value=this._1G(c)?c:this.minimum_value;if(this.minimum_value<0)this._c=true},this)},draw:function(){if(this.stacked)this._1H();this._1I();this._x(function(){this._0.rectangle(this.left_margin,this.top_margin,this._b-this.right_margin,this._L-this.bottom_margin);this._0.rectangle(this._2,this._7,this._l,this._g)})},clear:function(){this._M()},on:function(c,d,f){var g=this._10[c]=this._10[c]||[];g.push([d,f])},trigger:function(d,f){var g=this._10[d];if(!g)return;Bluff.each(g,function(c){c[0].call(c[1],f)})},_1I:function(){if(!this._c)return this._1J();this._16();this._1K();if(this.sort)this._1L();this._1M();this._N();this._1N();this._1O()},_16:function(g){if(this._9===null||g===true){this._9=[];if(!this._c)return;this._1l();Bluff.each(this._1,function(d){var f=[];Bluff.each(d[this.klass.DATA_VALUES_INDEX],function(c){if(c===null||c===undefined)f.push(null);else f.push((c-this.minimum_value)/this._i)},this);this._9.push([d[this.klass.DATA_LABEL_INDEX],f,d[this.klass.DATA_COLOR_INDEX]])},this)}},_1l:function(){this._i=this.maximum_value-this.minimum_value;this._i=this._i>0?this._i:1;var c=Math.round(Math.LOG10E*Math.log(this._i));this._1m=Math.pow(10,3-c)},_1K:function(){this._O=this.hide_line_markers?0:this._P(this.marker_font_size);this._1n=this.hide_title?0:this._P(this.title_font_size);this._1o=this.hide_legend?0:this._P(this.legend_font_size);var c,d,f,g,h,i,j;if(this.hide_line_markers){this._2=this.left_margin;this._17=this.right_margin;this._1p=this.bottom_margin}else{d=0;if(this.has_left_labels){c='';for(j in this.labels){c=c.length>this.labels[j].length?c:this.labels[j]}d=this._H(this.marker_font_size,c)*1.25}else{d=this._H(this.marker_font_size,this._Q(this.maximum_value))}f=this.hide_line_numbers&&!this.has_left_labels?0.0:d+this.klass.LABEL_MARGIN*2;this._2=this.left_margin+f+(this.y_axis_label===null?0.0:this._O+this.klass.LABEL_MARGIN*2);g=-Infinity;for(j in this.labels)g=g>Number(j)?g:Number(j);g=Math.round(g);h=(g>=(this._5-1)&&this.center_labels_over_point)?this._H(this.marker_font_size,this.labels[g])/2:0;this._17=this.right_margin+h;this._1p=this.bottom_margin+this._O+this.klass.LABEL_MARGIN}this._l=this._b-this._17;this._6=this._b-this._2-this._17;this._7=this.top_margin+(this.hide_title?this.title_margin:this._1n+this.title_margin)+(this.hide_legend?this.legend_margin:this._1o+this.legend_margin);i=(this.x_axis_label===null)?0.0:this._O+this.klass.LABEL_MARGIN;this._g=this._L-this._1p-i;this._3=this._g-this._7},_1N:function(){if(this.x_axis_label){var c=this._g+this.klass.LABEL_MARGIN*2+this._O;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='north';this._0.annotate_scaled(this._b,1.0,0.0,c,this.x_axis_label,this._a);this._x(function(){this._0.line(0.0,c,this._b,c)})}},_N:function(){if(this.hide_line_markers)return;if(this.y_axis_increment===null){if(this.marker_count===null){Bluff.each([3,4,5,6,7],function(c){if(!this.marker_count&&this._i%c===0)this.marker_count=c},this);this.marker_count=this.marker_count||4}this._18=(this._i>0)?this._19(this._i/this.marker_count):1}else{this.maximum_value=Math.max(Math.ceil(this.maximum_value),this.y_axis_increment);this.minimum_value=Math.floor(this.minimum_value);this._1l();this._16(true);this.marker_count=Math.round(this._i/this.y_axis_increment);this._18=this.y_axis_increment}this._1P=this._3/(this._i/this._18);var d,f,g,h;for(d=0,f=this.marker_count;d<=f;d++){g=this._7+this._3-d*this._1P;this._0.stroke=this.marker_color;this._0.stroke_width=1;this._0.line(this._2,g,this._l,g);h=d*this._18+this.minimum_value;if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.font_weight='normal';this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(this._2-this.klass.LABEL_MARGIN,1.0,0.0,g,this._Q(h),this._a)}}},_1q:function(c){return(this._b-c)/2},_1M:function(){if(this.hide_legend)return;this._I=Bluff.map(this._1,function(c){return c[this.klass.DATA_LABEL_INDEX]},this);var i=this.legend_box_size;if(this.font)this._0.font=this.font;this._0.pointsize=this.legend_font_size;var j=[[]];Bluff.each(this._I,function(c){var d=j.length-1;var f=this._0.get_type_metrics(c);var g=f.width+i*2.7;j[d].push(g);if(Bluff.sum(j[d])>(this._b*0.9))j.push([j[d].pop()])},this);var k=this._1q(Bluff.sum(j[0]));var m=this.hide_title?this.top_margin+this.title_margin:this.top_margin+this.title_margin+this._1n;this._x(function(){this._0.stroke_width=1;this._0.line(0,m,this._b,m)});Bluff.each(this._I,function(c,d){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.legend_font_size);this._0.stroke='transparent';this._0.font_weight='normal';this._0.gravity='west';this._0.annotate_scaled(this._b,1.0,k+(i*1.7),m,c,this._a);this._0.stroke='transparent';this._0.fill=this._1[d][this.klass.DATA_COLOR_INDEX];this._0.rectangle(k,m-i/2.0,k+i,m+i/2.0);this._0.pointsize=this.legend_font_size;var f=this._0.get_type_metrics(c);var g=f.width+(i*2.7),h;j[0].shift();if(j[0].length==0){this._x(function(){this._0.line(0.0,m,this._b,m)});j.shift();if(j.length>0)k=this._1q(Bluff.sum(j[0]));h=Math.max(this._1o,i)+this.legend_margin;if(j.length>0){m+=h;this._7+=h;this._3=this._g-this._7}}else{k+=g}},this);this._w=0},_1O:function(){if(this.hide_title||!this.title)return;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.title_font_size);this._0.font_weight='bold';this._0.gravity='north';this._0.annotate_scaled(this._b,1.0,0,this.top_margin,this.title,this._a)},_e:function(c,d){if(this.hide_line_markers)return;var f;if(this.labels[d]&&!this._u[d]){f=this._g+this.klass.LABEL_MARGIN;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='north';this._0.annotate_scaled(1.0,1.0,c,f,this.labels[d],this._a);this._u[d]=true;this._x(function(){this._0.stroke_width=1;this._0.line(0.0,f,this._b,f)})}},_y:function(d,f,g,h,i,j,k,m){if(!this.tooltips)return;var n=this._0.tooltip(d,f,g,h,i,j,k);Bluff.Event.observe(n,'click',function(){var c={series:i,label:this.labels[m],value:k,color:j};this.trigger('click:datapoint',c)},this)},_1J:function(){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(80);this._0.gravity='center';this._0.annotate_scaled(this._b,this._L/2,0,10,this.no_data_message,this._a)},_M:function(){var c=this._k.background_colors;switch(true){case c instanceof Array:this._1Q.apply(this,c);break;case typeof c==='string':this._1R(c);break;default:this._1S(this._k.background_image);break}},_1R:function(c){this._0.render_solid_background(this._j,this._t,c)},_1Q:function(c,d){this._0.render_gradiated_background(this._j,this._t,c,d)},_1S:function(c){},_1j:function(){this._w=0;this._u={};this._k={};this._0.scale(this._a,this._a)},_2k:function(c){return this._a*c},_d:function(c){var d=c*this._a;return d},_R:function(c,d){return(c>d)?d:c},_1k:function(c,d){return c>this.maximum_value},_1G:function(c,d){return c<this.minimum_value},_1r:function(c,d){return c},_2l:function(c,d){return c},_19:function(c){if(c==0)return 1.0;var d=1.0;while(c<10){c*=10;d/=10}while(c>100){c/=10;d*=10}return Math.floor(c)*d},_1L:function(){var f=this._1T,g=this.klass.DATA_VALUES_INDEX;this._9.sort(function(c,d){return f(d[g])-f(c[g])});this._1.sort(function(c,d){return f(d[g])-f(c[g])})},_1T:function(d){var f=0;Bluff.each(d,function(c){f+=(c||0)});return f},_1H:function(){var g=[],h=this._5;while(h--)g[h]=0;Bluff.each(this._1,function(f){Bluff.each(f[this.klass.DATA_VALUES_INDEX],function(c,d){g[d]+=c},this);f[this.klass.DATA_VALUES_INDEX]=Bluff.array(g)},this)},_x:function(c){if(this.klass.DEBUG){this._0.fill='transparent';this._0.stroke='turquoise';c.call(this)}},_1F:function(){var c=this._w;this._w=(this._w+1)%this.colors.length;return this.colors[c]},_Q:function(c){var d=this.klass.THOUSAND_SEPARATOR,f=(this._i%this.marker_count==0||this.y_axis_increment!==null)?String(Math.round(c)):String(Math.floor(c*this._1m)/this._1m);var g=f.split('.');g[0]=g[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,'$1'+d);return g.join('.')},_P:function(c){return this._0.caps_height(c)},_H:function(c,d){return this._0.text_width(c,d)}});Bluff.Area=new JS.Class(Bluff.Base,{draw:function(){this.callSuper();if(!this._c)return;this._S=this._6/(this._5-1);this._0.stroke='transparent';Bluff.each(this._9,function(h){var i=[],j=0.0,k=0.0;Bluff.each(h[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this._S*d);var g=this._7+(this._3-c*this._3);if(j>0&&k>0){i.push(f);i.push(g)}else{i.push(this._2);i.push(this._g-1);i.push(f);i.push(g)}this._e(f,d);j=f;k=g},this);i.push(this._l);i.push(this._g-1);i.push(this._2);i.push(this._g-1);this._0.fill=h[this.klass.DATA_COLOR_INDEX];this._0.polyline(i)},this)}});Bluff.BarConversion=new JS.Class({mode:null,zero:null,graph_top:null,graph_height:null,minimum_value:null,spread:null,getLeftYRightYscaled:function(c,d){var f;switch(this.mode){case 1:d[0]=this.graph_top+this.graph_height*(1-c)+1;d[1]=this.graph_top+this.graph_height-1;break;case 2:d[0]=this.graph_top+1;d[1]=this.graph_top+this.graph_height*(1-c)-1;break;case 3:f=c-this.minimum_value/this.spread;if(c>=this.zero){d[0]=this.graph_top+this.graph_height*(1-(f-this.zero))+1;d[1]=this.graph_top+this.graph_height*(1-this.zero)-1}else{d[0]=this.graph_top+this.graph_height*(1-(f-this.zero))+1;d[1]=this.graph_top+this.graph_height*(1-this.zero)-1}break;default:d[0]=0.0;d[1]=0.0}}});Bluff.Bar=new JS.Class(Bluff.Base,{bar_spacing:0.9,draw:function(){this.center_labels_over_point=(Bluff.keys(this.labels).length>this._5);this.callSuper();if(!this._c)return;this._T()},_T:function(){this._8=this._6/(this._5*this._1.length);var n=(this._8*(1-this.bar_spacing))/2;this._0.stroke_opacity=0.0;var l=new Bluff.BarConversion();l.graph_height=this._3;l.graph_top=this._7;if(this.minimum_value>=0){l.mode=1}else{if(this.maximum_value<=0){l.mode=2}else{l.mode=3;l.spread=this._i;l.minimum_value=this.minimum_value;l.zero=-this.minimum_value/this._i}}Bluff.each(this._9,function(j,k){var m=this._1[k][this.klass.DATA_VALUES_INDEX];Bluff.each(j[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this._8*(k+d+((this._1.length-1)*d)))+n;var g=f+this._8*this.bar_spacing;var h=[];l.getLeftYRightYscaled(c,h);this._0.fill=j[this.klass.DATA_COLOR_INDEX];this._0.rectangle(f,h[0],g,h[1]);this._y(f,h[0],g-f,h[1]-h[0],j[this.klass.DATA_LABEL_INDEX],j[this.klass.DATA_COLOR_INDEX],m[d],d);var i=this._2+(this._1.length*this._8*d)+(this._1.length*this._8/2.0);this._e(i-(this.center_labels_over_point?this._8/2.0:0.0),d)},this)},this);if(this.center_labels_over_point)this._e(this._l,this._5)}});Bluff.Line=new JS.Class(Bluff.Base,{baseline_value:null,baseline_color:null,line_width:null,dot_radius:null,hide_dots:null,hide_lines:null,initialize:function(c){if(arguments.length>3)throw'Wrong number of arguments';if(arguments.length===1||(typeof arguments[1]!=='number'&&typeof arguments[1]!=='string'))this.callSuper(c,null);else this.callSuper();this.hide_dots=this.hide_lines=false;this.baseline_color='red';this.baseline_value=null},draw:function(){this.callSuper();if(!this._c)return;this.x_increment=(this._5>1)?(this._6/(this._5-1)):this._6;var l;if(this._U!==undefined){l=this._7+(this._3-this._U*this._3);this._0.push();this._0.stroke=this.baseline_color;this._0.fill_opacity=0.0;this._0.stroke_width=3.0;this._0.line(this._2,l,this._2+this._6,l);this._0.pop()}Bluff.each(this._9,function(i,j){var k=null,m=null;var n=this._1[j][this.klass.DATA_VALUES_INDEX];this._1U=this._1V(i);Bluff.each(i[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this.x_increment*d);if(typeof c!=='number')return;this._e(f,d);var g=this._7+(this._3-c*this._3);this._0.stroke=i[this.klass.DATA_COLOR_INDEX];this._0.fill=i[this.klass.DATA_COLOR_INDEX];this._0.stroke_opacity=1.0;this._0.stroke_width=this.line_width||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*6),3.0);var h=this.dot_radius||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*2),7.0);if(!this.hide_lines&&k!==null&&m!==null){this._0.line(k,m,f,g)}else if(this._1U){this._0.circle(f,g,f-h,g)}if(!this.hide_dots)this._0.circle(f,g,f-h,g);this._y(f-h,g-h,2*h,2*h,i[this.klass.DATA_LABEL_INDEX],i[this.klass.DATA_COLOR_INDEX],n[d],d);k=f;m=g},this)},this)},_16:function(){this.maximum_value=Math.max(this.maximum_value,this.baseline_value);this.callSuper();if(this.baseline_value!==null)this._U=this.baseline_value/this.maximum_value},_1V:function(d){var f=0;Bluff.each(d[this.klass.DATA_VALUES_INDEX],function(c){if(c!==undefined)f+=1});return f===1}});Bluff.Dot=new JS.Class(Bluff.Base,{draw:function(){this.has_left_labels=true;this.callSuper();if(!this._c)return;var k=1.0;this._J=this._3/this._5;this._1a=this._J*k/this._9.length;this._0.stroke_opacity=0.0;var m=Bluff.array_new(this._5,0),n=Bluff.array_new(this._5,this._2),l=(this._J*(1-k))/2;Bluff.each(this._9,function(i,j){Bluff.each(i[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(c*this._6)-Math.round(this._1a/6.0);var g=this._7+(this._J*d)+l+Math.round(this._1a/2.0);if(j===0){this._0.stroke=this.marker_color;this._0.stroke_width=1.0;this._0.opacity=0.1;this._0.line(this._2,g,this._2+this._6,g)}this._0.fill=i[this.klass.DATA_COLOR_INDEX];this._0.stroke='transparent';this._0.circle(f,g,f+Math.round(this._1a/3.0),g);var h=this._7+(this._J*d+this._J/2)+l;this._e(h,d)},this)},this)},_N:function(){if(this.hide_line_markers)return;this._0.stroke_antialias=false;this._0.stroke_width=1;var c=5;var d=this._19(this.maximum_value/c);for(var f=0;f<=c;f++){var g=(this._l-this._2)/c,h=this._l-(g*f)-1,i=f-c,j=Math.abs(i)*d;this._0.stroke=this.marker_color;this._0.line(h,this._g,h,this._g+0.5*this.klass.LABEL_MARGIN);if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='center';this._0.annotate_scaled(0,0,h,this._g+(this.klass.LABEL_MARGIN*2.0),j,this._a)}this._0.stroke_antialias=true}},_e:function(c,d){if(this.labels[d]&&!this._u[d]){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(1,1,this._2-this.klass.LABEL_MARGIN*2.0,c,this.labels[d],this._a);this._u[d]=true}}});Bluff.Net=new JS.Class(Bluff.Base,{hide_dots:null,line_width:null,dot_radius:null,initialize:function(){this.callSuper();this.hide_dots=false;this.hide_line_numbers=true},draw:function(){this.callSuper();if(!this._c)return;this._z=this._3/2.0;this._A=this._2+(this._6/2.0);this._B=this._7+(this._3/2.0)-10;this._S=this._6/(this._5-1);var s=this.dot_radius||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*2.5),7.0);this._0.stroke_opacity=1.0;this._0.stroke_width=this.line_width||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*4),3.0);var r;if(this._U!==undefined){r=this._7+(this._3-this._U*this._3);this._0.push();this._0.stroke_color=this.baseline_color;this._0.fill_opacity=0.0;this._0.stroke_width=5;this._0.line(this._2,r,this._2+this._6,r);this._0.pop()}Bluff.each(this._9,function(o){var p=null,q=null;Bluff.each(o[this.klass.DATA_VALUES_INDEX],function(c,d){if(c===undefined)return;var f=d*Math.PI*2/this._5,g=c*this._z,h=this._A+Math.sin(f)*g,i=this._B-Math.cos(f)*g,j=(d+1<o[this.klass.DATA_VALUES_INDEX].length)?d+1:0,k=j*Math.PI*2/this._5,m=o[this.klass.DATA_VALUES_INDEX][j]*this._z,n=this._A+Math.sin(k)*m,l=this._B-Math.cos(k)*m;this._0.stroke=o[this.klass.DATA_COLOR_INDEX];this._0.fill=o[this.klass.DATA_COLOR_INDEX];this._0.line(h,i,n,l);if(!this.hide_dots)this._0.circle(h,i,h-s,i)},this)},this)},_N:function(){if(this.hide_line_markers)return;this._z=this._3/2.0;this._A=this._2+(this._6/2.0);this._B=this._7+(this._3/2.0)-10;var c,d;for(var f=0,g=this._5;f<g;f++){c=f*Math.PI*2/this._5;this._0.stroke=this.marker_color;this._0.stroke_width=1;this._0.line(this._A,this._B,this._A+Math.sin(c)*this._z,this._B-Math.cos(c)*this._z);d=this.labels[f]?this.labels[f]:'000';this._e(this._A,this._B,c*360/(2*Math.PI),this._z,d)}},_e:function(c,d,f,g,h){var i=1.1,j=c,k=d,m=f*Math.PI/180,n=j+(g*i*Math.sin(m)),l=k-(g*i*Math.cos(m));this._0.fill=this.marker_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(20);this._0.stroke='transparent';this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,n,l,h,this._a)}});Bluff.Pie=new JS.Class(Bluff.Base,{extend:{TEXT_OFFSET_PERCENTAGE:0.08},zero_degreee:null,hide_labels_less_than:null,initialize_ivars:function(){this.callSuper();this.zero_degree=0.0;this.hide_labels_less_than=0.0},draw:function(){this.hide_line_markers=true;this.callSuper();if(!this._c)return;var j=this._3,k=(Math.min(this._6,this._3)/2.0)*0.8,m=this._2+(this._6-j)/2.0,n=this._2+(this._6/2.0),l=this._7+(this._3/2.0)-10,o=this._1W(),p=this.zero_degree,q=this.klass.DATA_VALUES_INDEX;if(this.sort)this._1.sort(function(a,b){return a[q][0]-b[q][0]});Bluff.each(this._1,function(c,d){if(c[this.klass.DATA_VALUES_INDEX][0]>0){this._0.fill=c[this.klass.DATA_COLOR_INDEX];var f=(c[this.klass.DATA_VALUES_INDEX][0]/o)*360;this._0.circle(n,l,n+k,l,p,p+f+0.5);var g=p+((p+f)-p)/2,h=Math.round((c[this.klass.DATA_VALUES_INDEX][0]/o)*100.0),i;if(h>=this.hide_labels_less_than){i=this._Q(c[this.klass.DATA_VALUES_INDEX][0]);this._e(n,l,g,k+(k*this.klass.TEXT_OFFSET_PERCENTAGE),i,c,d)}p+=f}},this)},_e:function(c,d,f,g,h,i,j){var k=20.0,m=c,n=d,l=g+k,o=l*0.15,p=m+((l+o)*Math.cos(f*Math.PI/180)),q=n+(l*Math.sin(f*Math.PI/180));this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.marker_font_size);this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,p,q,h,this._a);this._y(p-20,q-20,40,40,i[this.klass.DATA_LABEL_INDEX],i[this.klass.DATA_COLOR_INDEX],h,j)},_1W:function(){var d=0;Bluff.each(this._1,function(c){d+=c[this.klass.DATA_VALUES_INDEX][0]},this);return d}});Bluff.SideBar=new JS.Class(Bluff.Base,{bar_spacing:0.9,draw:function(){this.has_left_labels=true;this.callSuper();if(!this._c)return;this._T()},_T:function(){this._V=this._3/this._5;this._8=this._V/this._9.length;this._0.stroke_opacity=0.0;var q=Bluff.array_new(this._5,0),s=Bluff.array_new(this._5,this._2),r=(this._8*(1-this.bar_spacing))/2;Bluff.each(this._9,function(l,o){var p=this._1[o][this.klass.DATA_VALUES_INDEX];Bluff.each(l[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this._6-c*this._6-q[d]),g=this._2+this._6-q[d],h=g-f,i=s[d]-1,j=this._7+(this._V*d)+(this._8*o)+r,k=i+h,m=j+this._8*this.bar_spacing;q[d]+=(c*this._6);this._0.stroke='transparent';this._0.fill=l[this.klass.DATA_COLOR_INDEX];this._0.rectangle(i,j,k,m);this._y(i,j,k-i,m-j,l[this.klass.DATA_LABEL_INDEX],l[this.klass.DATA_COLOR_INDEX],p[d],d);var n=this._7+(this._V*d+this._V/2);this._e(n,d)},this)},this)},_N:function(){if(this.hide_line_markers)return;this._0.stroke_antialias=false;this._0.stroke_width=1;var c=5;var d=this._19(this._i/c),f,g,h,i;for(var j=0;j<=c;j++){f=(this._l-this._2)/c;g=this._l-(f*j)-1;h=j-c;i=Math.abs(h)*d+this.minimum_value;this._0.stroke=this.marker_color;this._0.line(g,this._g,g,this._7);if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='center';this._0.annotate_scaled(0,0,g,this._g+(this.klass.LABEL_MARGIN*2.0),this._Q(i),this._a)}}},_e:function(c,d){if(this.labels[d]&&!this._u[d]){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(1,1,this._2-this.klass.LABEL_MARGIN*2.0,c,this.labels[d],this._a);this._u[d]=true}}});Bluff.Spider=new JS.Class(Bluff.Base,{hide_text:null,hide_axes:null,transparent_background:null,initialize:function(c,d,f){this.callSuper(c,f);this._1X=d;this.hide_legend=true},draw:function(){this.hide_line_markers=true;this.callSuper();if(!this._c)return;var c=this._3,d=this._3/2.0,f=this._2+(this._6-c)/2.0,g=this._2+(this._6/2.0),h=this._7+(this._3/2.0)-25;this._1Y=d/this._1X;var i=this._1Z(),j=0.0,k=(2*Math.PI)/this._1.length,m=0.0;if(!this.hide_axes)this._20(g,h,d,k);this._21(g,h,k)},_1s:function(c){return c*this._1Y},_e:function(c,d,f,g,h){var i=50,j=c,k=d+0,m=j+((g+i)*Math.cos(f)),n=k+((g+i)*Math.sin(f));this._0.fill=this.marker_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.legend_font_size);this._0.stroke='transparent';this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,m,n,h,this._a)},_20:function(g,h,i,j,k){if(this.hide_axes)return;var m=0.0;Bluff.each(this._1,function(c){this._0.stroke=k||c[this.klass.DATA_COLOR_INDEX];this._0.stroke_width=5.0;var d=i*Math.cos(m);var f=i*Math.sin(m);this._0.line(g,h,g+d,h+f);if(!this.hide_text)this._e(g,h,m,i,c[this.klass.DATA_LABEL_INDEX]);m+=j},this)},_21:function(d,f,g,h){var i=[],j=0.0;Bluff.each(this._1,function(c){i.push(d+this._1s(c[this.klass.DATA_VALUES_INDEX][0])*Math.cos(j));i.push(f+this._1s(c[this.klass.DATA_VALUES_INDEX][0])*Math.sin(j));j+=g},this);this._0.stroke_width=1.0;this._0.stroke=h||this.marker_color;this._0.fill=h||this.marker_color;this._0.fill_opacity=0.4;this._0.polyline(i)},_1Z:function(){var d=0.0;Bluff.each(this._1,function(c){d+=c[this.klass.DATA_VALUES_INDEX][0]},this);return d}});Bluff.Base.StackedMixin=new JS.Module({_1b:function(){var g={};Bluff.each(this._1,function(f){Bluff.each(f[this.klass.DATA_VALUES_INDEX],function(c,d){if(!g[d])g[d]=0.0;g[d]+=c},this)},this);for(var h in g){if(g[h]>this.maximum_value)this.maximum_value=g[h]}this.minimum_value=0}});Bluff.StackedArea=new JS.Class(Bluff.Base,{include:Bluff.Base.StackedMixin,last_series_goes_on_bottom:null,draw:function(){this._1b();this.callSuper();if(!this._c)return;this._S=this._6/(this._5-1);this._0.stroke='transparent';var n=Bluff.array_new(this._5,0);var l=null;var o=this.last_series_goes_on_bottom?'reverse_each':'each';Bluff[o](this._9,function(h){var i=l;l=[];Bluff.each(h[this.klass.DATA_VALUES_INDEX],funct (…)
H A Dbluff-src.js59 reverse_each: function(list, block, context) {
2030 var iterator = this.last_series_goes_on_bottom ? 'reverse_each' : 'each';
/forgerock/openam/openam-server-only/src/main/webapp/js/Bluff-0.3.6.2/
H A Dbluff-min.js1 Bluff={VERSION:'0.3.6',array:function(c){if(c.length===undefined)return[c];var d=[],f=c.length;while(f--)d[f]=c[f];return d},array_new:function(c,d){var f=[];while(c--)f.push(d);return f},each:function(c,d,f){for(var g=0,h=c.length;g<h;g++){d.call(f||null,c[g],g)}},index:function(c,d){for(var f=0,g=c.length;f<g;f++){if(c[f]===d)return f}return-1},keys:function(c){var d=[],f;for(f in c)d.push(f);return d},map:function(d,f,g){var h=[];this.each(d,function(c){h.push(f.call(g||null,c))});return h},reverse_each:function(c,d,f){var g=c.length;while(g--)d.call(f||null,c[g],g)},sum:function(c){var d=0,f=c.length;while(f--)d+=c[f];return d},Mini:{}};Bluff.Base=new JS.Class({extend:{DEBUG:false,DATA_LABEL_INDEX:0,DATA_VALUES_INDEX:1,DATA_COLOR_INDEX:2,LEGEND_MARGIN:20,TITLE_MARGIN:20,LABEL_MARGIN:10,DEFAULT_MARGIN:20,DEFAULT_TARGET_WIDTH:800,THOUSAND_SEPARATOR:','},top_margin:null,bottom_margin:null,right_margin:null,left_margin:null,title_margin:null,legend_margin:null,labels:null,center_labels_over_point:null,has_left_labels:null,x_axis_label:null,y_axis_label:null,y_axis_increment:null,colors:null,title:null,font:null,font_color:null,hide_line_markers:null,hide_legend:null,hide_title:null,hide_line_numbers:null,no_data_message:null,title_font_size:null,legend_font_size:null,marker_font_size:null,marker_color:null,marker_count:null,minimum_value:null,maximum_value:null,sort:null,additional_line_values:null,stacked:null,legend_box_size:null,tooltips:false,initialize:function(c,d){this._0=new Bluff.Renderer(c);d=d||this.klass.DEFAULT_TARGET_WIDTH;var f;if(typeof d!=='number'){f=d.split('x');this._j=parseFloat(f[0]);this._t=parseFloat(f[1])}else{this._j=parseFloat(d);this._t=this._j*0.75}this.initialize_ivars();this._1j();this.theme_keynote();this._10={}},initialize_ivars:function(){this._b=800;this._L=800*(this._t/this._j);this._5=0;this.marker_count=null;this.maximum_value=this.minimum_value=null;this._c=false;this._1=[];this.labels={};this._u={};this.sort=true;this.title=null;this._a=this._j/this._b;this.marker_font_size=21.0;this.legend_font_size=20.0;this.title_font_size=36.0;this.top_margin=this.bottom_margin=this.left_margin=this.right_margin=this.klass.DEFAULT_MARGIN;this.legend_margin=this.klass.LEGEND_MARGIN;this.title_margin=this.klass.TITLE_MARGIN;this.legend_box_size=20.0;this.no_data_message="No Data";this.hide_line_markers=this.hide_legend=this.hide_title=this.hide_line_numbers=false;this.center_labels_over_point=true;this.has_left_labels=false;this.additional_line_values=[];this._1C=[];this._k={};this.x_axis_label=this.y_axis_label=null;this.y_axis_increment=null;this.stacked=null;this._9=null},set_margins:function(c){this.top_margin=this.left_margin=this.right_margin=this.bottom_margin=c},set_font:function(c){this.font=c;this._0.font=this.font},add_color:function(c){this.colors.push(c)},replace_colors:function(c){this.colors=c||[];this._w=0},set_theme:function(c){this._1j();this._k={colors:['black','white'],additional_line_colors:[],marker_color:'white',font_color:'black',background_colors:null,background_image:null};for(var d in c)this._k[d]=c[d];this.colors=this._k.colors;this.marker_color=this._k.marker_color;this.font_color=this._k.font_color||this.marker_color;this._1C=this._k.additional_line_colors;this._M()},set_background:function(c){if(c.colors)this._k.background_colors=c.colors;if(c.image)this._k.background_image=c.image;this._M()},theme_keynote:function(){this._11='#6886B4';this._12='#FDD84E';this._v='#72AE6E';this._D='#D1695E';this._13='#8A6EAF';this._E='#EFAA43';this._F='white';this.colors=[this._12,this._11,this._v,this._D,this._13,this._E,this._F];this.set_theme({colors:this.colors,marker_color:'white',font_color:'white',background_colors:['black','#4a465a']})},theme_37signals:function(){this._v='#339933';this._13='#cc99cc';this._11='#336699';this._12='#FFF804';this._D='#ff0000';this._E='#cf5910';this._G='black';this.colors=[this._12,this._11,this._v,this._D,this._13,this._E,this._G];this.set_theme({colors:this.colors,marker_color:'black',font_color:'black',background_colors:['#d1edf5','white']})},theme_rails_keynote:function(){this._v='#00ff00';this._14='#333333';this._E='#ff5d00';this._D='#f61100';this._F='white';this._15='#999999';this._G='black';this.colors=[this._v,this._14,this._E,this._D,this._F,this._15,this._G];this.set_theme({colors:this.colors,marker_color:'white',font_color:'white',background_colors:['#0083a3','#0083a3']})},theme_odeo:function(){this._14='#202020';this._F='white';this._1D='#a21764';this._v='#8ab438';this._15='#999999';this._1E='#3a5b87';this._G='black';this.colors=[this._14,this._F,this._1E,this._1D,this._v,this._15,this._G];this.set_theme({colors:this.colors,marker_color:'white',font_color:'white',background_colors:['#ff47a4','#ff1f81']})},theme_pastel:function(){this.colors=['#a9dada','#aedaa9','#daaea9','#dadaa9','#a9a9da','#daaeda','#dadada'];this.set_theme({colors:this.colors,marker_color:'#aea9a9',font_color:'black',background_colors:'white'})},theme_greyscale:function(){this.colors=['#282828','#383838','#686868','#989898','#c8c8c8','#e8e8e8'];this.set_theme({colors:this.colors,marker_color:'#aea9a9',font_color:'black',background_colors:'white'})},data:function(f,g,h){g=(g===undefined)?[]:g;h=h||null;g=Bluff.array(g);this._1.push([f,g,(h||this._1F())]);this._5=(g.length>this._5)?g.length:this._5;Bluff.each(g,function(c,d){if(c===undefined)return;if(this.maximum_value===null&&this.minimum_value===null)this.maximum_value=this.minimum_value=c;this.maximum_value=this._1k(c)?c:this.maximum_value;if(this.maximum_value>=0)this._c=true;this.minimum_value=this._1G(c)?c:this.minimum_value;if(this.minimum_value<0)this._c=true},this)},draw:function(){if(this.stacked)this._1H();this._1I();this._x(function(){this._0.rectangle(this.left_margin,this.top_margin,this._b-this.right_margin,this._L-this.bottom_margin);this._0.rectangle(this._2,this._7,this._l,this._g)})},clear:function(){this._M()},on:function(c,d,f){var g=this._10[c]=this._10[c]||[];g.push([d,f])},trigger:function(d,f){var g=this._10[d];if(!g)return;Bluff.each(g,function(c){c[0].call(c[1],f)})},_1I:function(){if(!this._c)return this._1J();this._16();this._1K();if(this.sort)this._1L();this._1M();this._N();this._1N();this._1O()},_16:function(g){if(this._9===null||g===true){this._9=[];if(!this._c)return;this._1l();Bluff.each(this._1,function(d){var f=[];Bluff.each(d[this.klass.DATA_VALUES_INDEX],function(c){if(c===null||c===undefined)f.push(null);else f.push((c-this.minimum_value)/this._i)},this);this._9.push([d[this.klass.DATA_LABEL_INDEX],f,d[this.klass.DATA_COLOR_INDEX]])},this)}},_1l:function(){this._i=this.maximum_value-this.minimum_value;this._i=this._i>0?this._i:1;var c=Math.round(Math.LOG10E*Math.log(this._i));this._1m=Math.pow(10,3-c)},_1K:function(){this._O=this.hide_line_markers?0:this._P(this.marker_font_size);this._1n=this.hide_title?0:this._P(this.title_font_size);this._1o=this.hide_legend?0:this._P(this.legend_font_size);var c,d,f,g,h,i,j;if(this.hide_line_markers){this._2=this.left_margin;this._17=this.right_margin;this._1p=this.bottom_margin}else{d=0;if(this.has_left_labels){c='';for(j in this.labels){c=c.length>this.labels[j].length?c:this.labels[j]}d=this._H(this.marker_font_size,c)*1.25}else{d=this._H(this.marker_font_size,this._Q(this.maximum_value))}f=this.hide_line_numbers&&!this.has_left_labels?0.0:d+this.klass.LABEL_MARGIN*2;this._2=this.left_margin+f+(this.y_axis_label===null?0.0:this._O+this.klass.LABEL_MARGIN*2);g=-Infinity;for(j in this.labels)g=g>Number(j)?g:Number(j);g=Math.round(g);h=(g>=(this._5-1)&&this.center_labels_over_point)?this._H(this.marker_font_size,this.labels[g])/2:0;this._17=this.right_margin+h;this._1p=this.bottom_margin+this._O+this.klass.LABEL_MARGIN}this._l=this._b-this._17;this._6=this._b-this._2-this._17;this._7=this.top_margin+(this.hide_title?this.title_margin:this._1n+this.title_margin)+(this.hide_legend?this.legend_margin:this._1o+this.legend_margin);i=(this.x_axis_label===null)?0.0:this._O+this.klass.LABEL_MARGIN;this._g=this._L-this._1p-i;this._3=this._g-this._7},_1N:function(){if(this.x_axis_label){var c=this._g+this.klass.LABEL_MARGIN*2+this._O;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='north';this._0.annotate_scaled(this._b,1.0,0.0,c,this.x_axis_label,this._a);this._x(function(){this._0.line(0.0,c,this._b,c)})}},_N:function(){if(this.hide_line_markers)return;if(this.y_axis_increment===null){if(this.marker_count===null){Bluff.each([3,4,5,6,7],function(c){if(!this.marker_count&&this._i%c===0)this.marker_count=c},this);this.marker_count=this.marker_count||4}this._18=(this._i>0)?this._19(this._i/this.marker_count):1}else{this.maximum_value=Math.max(Math.ceil(this.maximum_value),this.y_axis_increment);this.minimum_value=Math.floor(this.minimum_value);this._1l();this._16(true);this.marker_count=Math.round(this._i/this.y_axis_increment);this._18=this.y_axis_increment}this._1P=this._3/(this._i/this._18);var d,f,g,h;for(d=0,f=this.marker_count;d<=f;d++){g=this._7+this._3-d*this._1P;this._0.stroke=this.marker_color;this._0.stroke_width=1;this._0.line(this._2,g,this._l,g);h=d*this._18+this.minimum_value;if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.font_weight='normal';this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(this._2-this.klass.LABEL_MARGIN,1.0,0.0,g,this._Q(h),this._a)}}},_1q:function(c){return(this._b-c)/2},_1M:function(){if(this.hide_legend)return;this._I=Bluff.map(this._1,function(c){return c[this.klass.DATA_LABEL_INDEX]},this);var i=this.legend_box_size;if(this.font)this._0.font=this.font;this._0.pointsize=this.legend_font_size;var j=[[]];Bluff.each(this._I,function(c){var d=j.length-1;var f=this._0.get_type_metrics(c);var g=f.width+i*2.7;j[d].push(g);if(Bluff.sum(j[d])>(this._b*0.9))j.push([j[d].pop()])},this);var k=this._1q(Bluff.sum(j[0]));var m=this.hide_title?this.top_margin+this.title_margin:this.top_margin+this.title_margin+this._1n;this._x(function(){this._0.stroke_width=1;this._0.line(0,m,this._b,m)});Bluff.each(this._I,function(c,d){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.legend_font_size);this._0.stroke='transparent';this._0.font_weight='normal';this._0.gravity='west';this._0.annotate_scaled(this._b,1.0,k+(i*1.7),m,c,this._a);this._0.stroke='transparent';this._0.fill=this._1[d][this.klass.DATA_COLOR_INDEX];this._0.rectangle(k,m-i/2.0,k+i,m+i/2.0);this._0.pointsize=this.legend_font_size;var f=this._0.get_type_metrics(c);var g=f.width+(i*2.7),h;j[0].shift();if(j[0].length==0){this._x(function(){this._0.line(0.0,m,this._b,m)});j.shift();if(j.length>0)k=this._1q(Bluff.sum(j[0]));h=Math.max(this._1o,i)+this.legend_margin;if(j.length>0){m+=h;this._7+=h;this._3=this._g-this._7}}else{k+=g}},this);this._w=0},_1O:function(){if(this.hide_title||!this.title)return;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.title_font_size);this._0.font_weight='bold';this._0.gravity='north';this._0.annotate_scaled(this._b,1.0,0,this.top_margin,this.title,this._a)},_e:function(c,d){if(this.hide_line_markers)return;var f;if(this.labels[d]&&!this._u[d]){f=this._g+this.klass.LABEL_MARGIN;this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='north';this._0.annotate_scaled(1.0,1.0,c,f,this.labels[d],this._a);this._u[d]=true;this._x(function(){this._0.stroke_width=1;this._0.line(0.0,f,this._b,f)})}},_y:function(d,f,g,h,i,j,k,m){if(!this.tooltips)return;var n=this._0.tooltip(d,f,g,h,i,j,k);Bluff.Event.observe(n,'click',function(){var c={series:i,label:this.labels[m],value:k,color:j};this.trigger('click:datapoint',c)},this)},_1J:function(){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(80);this._0.gravity='center';this._0.annotate_scaled(this._b,this._L/2,0,10,this.no_data_message,this._a)},_M:function(){var c=this._k.background_colors;switch(true){case c instanceof Array:this._1Q.apply(this,c);break;case typeof c==='string':this._1R(c);break;default:this._1S(this._k.background_image);break}},_1R:function(c){this._0.render_solid_background(this._j,this._t,c)},_1Q:function(c,d){this._0.render_gradiated_background(this._j,this._t,c,d)},_1S:function(c){},_1j:function(){this._w=0;this._u={};this._k={};this._0.scale(this._a,this._a)},_2k:function(c){return this._a*c},_d:function(c){var d=c*this._a;return d},_R:function(c,d){return(c>d)?d:c},_1k:function(c,d){return c>this.maximum_value},_1G:function(c,d){return c<this.minimum_value},_1r:function(c,d){return c},_2l:function(c,d){return c},_19:function(c){if(c==0)return 1.0;var d=1.0;while(c<10){c*=10;d/=10}while(c>100){c/=10;d*=10}return Math.floor(c)*d},_1L:function(){var f=this._1T,g=this.klass.DATA_VALUES_INDEX;this._9.sort(function(c,d){return f(d[g])-f(c[g])});this._1.sort(function(c,d){return f(d[g])-f(c[g])})},_1T:function(d){var f=0;Bluff.each(d,function(c){f+=(c||0)});return f},_1H:function(){var g=[],h=this._5;while(h--)g[h]=0;Bluff.each(this._1,function(f){Bluff.each(f[this.klass.DATA_VALUES_INDEX],function(c,d){g[d]+=c},this);f[this.klass.DATA_VALUES_INDEX]=Bluff.array(g)},this)},_x:function(c){if(this.klass.DEBUG){this._0.fill='transparent';this._0.stroke='turquoise';c.call(this)}},_1F:function(){var c=this._w;this._w=(this._w+1)%this.colors.length;return this.colors[c]},_Q:function(c){var d=this.klass.THOUSAND_SEPARATOR,f=(this._i%this.marker_count==0||this.y_axis_increment!==null)?String(Math.round(c)):String(Math.floor(c*this._1m)/this._1m);var g=f.split('.');g[0]=g[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,'$1'+d);return g.join('.')},_P:function(c){return this._0.caps_height(c)},_H:function(c,d){return this._0.text_width(c,d)}});Bluff.Area=new JS.Class(Bluff.Base,{draw:function(){this.callSuper();if(!this._c)return;this._S=this._6/(this._5-1);this._0.stroke='transparent';Bluff.each(this._9,function(h){var i=[],j=0.0,k=0.0;Bluff.each(h[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this._S*d);var g=this._7+(this._3-c*this._3);if(j>0&&k>0){i.push(f);i.push(g)}else{i.push(this._2);i.push(this._g-1);i.push(f);i.push(g)}this._e(f,d);j=f;k=g},this);i.push(this._l);i.push(this._g-1);i.push(this._2);i.push(this._g-1);this._0.fill=h[this.klass.DATA_COLOR_INDEX];this._0.polyline(i)},this)}});Bluff.BarConversion=new JS.Class({mode:null,zero:null,graph_top:null,graph_height:null,minimum_value:null,spread:null,getLeftYRightYscaled:function(c,d){var f;switch(this.mode){case 1:d[0]=this.graph_top+this.graph_height*(1-c)+1;d[1]=this.graph_top+this.graph_height-1;break;case 2:d[0]=this.graph_top+1;d[1]=this.graph_top+this.graph_height*(1-c)-1;break;case 3:f=c-this.minimum_value/this.spread;if(c>=this.zero){d[0]=this.graph_top+this.graph_height*(1-(f-this.zero))+1;d[1]=this.graph_top+this.graph_height*(1-this.zero)-1}else{d[0]=this.graph_top+this.graph_height*(1-(f-this.zero))+1;d[1]=this.graph_top+this.graph_height*(1-this.zero)-1}break;default:d[0]=0.0;d[1]=0.0}}});Bluff.Bar=new JS.Class(Bluff.Base,{bar_spacing:0.9,draw:function(){this.center_labels_over_point=(Bluff.keys(this.labels).length>this._5);this.callSuper();if(!this._c)return;this._T()},_T:function(){this._8=this._6/(this._5*this._1.length);var n=(this._8*(1-this.bar_spacing))/2;this._0.stroke_opacity=0.0;var l=new Bluff.BarConversion();l.graph_height=this._3;l.graph_top=this._7;if(this.minimum_value>=0){l.mode=1}else{if(this.maximum_value<=0){l.mode=2}else{l.mode=3;l.spread=this._i;l.minimum_value=this.minimum_value;l.zero=-this.minimum_value/this._i}}Bluff.each(this._9,function(j,k){var m=this._1[k][this.klass.DATA_VALUES_INDEX];Bluff.each(j[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this._8*(k+d+((this._1.length-1)*d)))+n;var g=f+this._8*this.bar_spacing;var h=[];l.getLeftYRightYscaled(c,h);this._0.fill=j[this.klass.DATA_COLOR_INDEX];this._0.rectangle(f,h[0],g,h[1]);this._y(f,h[0],g-f,h[1]-h[0],j[this.klass.DATA_LABEL_INDEX],j[this.klass.DATA_COLOR_INDEX],m[d],d);var i=this._2+(this._1.length*this._8*d)+(this._1.length*this._8/2.0);this._e(i-(this.center_labels_over_point?this._8/2.0:0.0),d)},this)},this);if(this.center_labels_over_point)this._e(this._l,this._5)}});Bluff.Line=new JS.Class(Bluff.Base,{baseline_value:null,baseline_color:null,line_width:null,dot_radius:null,hide_dots:null,hide_lines:null,initialize:function(c){if(arguments.length>3)throw'Wrong number of arguments';if(arguments.length===1||(typeof arguments[1]!=='number'&&typeof arguments[1]!=='string'))this.callSuper(c,null);else this.callSuper();this.hide_dots=this.hide_lines=false;this.baseline_color='red';this.baseline_value=null},draw:function(){this.callSuper();if(!this._c)return;this.x_increment=(this._5>1)?(this._6/(this._5-1)):this._6;var l;if(this._U!==undefined){l=this._7+(this._3-this._U*this._3);this._0.push();this._0.stroke=this.baseline_color;this._0.fill_opacity=0.0;this._0.stroke_width=3.0;this._0.line(this._2,l,this._2+this._6,l);this._0.pop()}Bluff.each(this._9,function(i,j){var k=null,m=null;var n=this._1[j][this.klass.DATA_VALUES_INDEX];this._1U=this._1V(i);Bluff.each(i[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this.x_increment*d);if(typeof c!=='number')return;this._e(f,d);var g=this._7+(this._3-c*this._3);this._0.stroke=i[this.klass.DATA_COLOR_INDEX];this._0.fill=i[this.klass.DATA_COLOR_INDEX];this._0.stroke_opacity=1.0;this._0.stroke_width=this.line_width||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*6),3.0);var h=this.dot_radius||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*2),7.0);if(!this.hide_lines&&k!==null&&m!==null){this._0.line(k,m,f,g)}else if(this._1U){this._0.circle(f,g,f-h,g)}if(!this.hide_dots)this._0.circle(f,g,f-h,g);this._y(f-h,g-h,2*h,2*h,i[this.klass.DATA_LABEL_INDEX],i[this.klass.DATA_COLOR_INDEX],n[d],d);k=f;m=g},this)},this)},_16:function(){this.maximum_value=Math.max(this.maximum_value,this.baseline_value);this.callSuper();if(this.baseline_value!==null)this._U=this.baseline_value/this.maximum_value},_1V:function(d){var f=0;Bluff.each(d[this.klass.DATA_VALUES_INDEX],function(c){if(c!==undefined)f+=1});return f===1}});Bluff.Dot=new JS.Class(Bluff.Base,{draw:function(){this.has_left_labels=true;this.callSuper();if(!this._c)return;var k=1.0;this._J=this._3/this._5;this._1a=this._J*k/this._9.length;this._0.stroke_opacity=0.0;var m=Bluff.array_new(this._5,0),n=Bluff.array_new(this._5,this._2),l=(this._J*(1-k))/2;Bluff.each(this._9,function(i,j){Bluff.each(i[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(c*this._6)-Math.round(this._1a/6.0);var g=this._7+(this._J*d)+l+Math.round(this._1a/2.0);if(j===0){this._0.stroke=this.marker_color;this._0.stroke_width=1.0;this._0.opacity=0.1;this._0.line(this._2,g,this._2+this._6,g)}this._0.fill=i[this.klass.DATA_COLOR_INDEX];this._0.stroke='transparent';this._0.circle(f,g,f+Math.round(this._1a/3.0),g);var h=this._7+(this._J*d+this._J/2)+l;this._e(h,d)},this)},this)},_N:function(){if(this.hide_line_markers)return;this._0.stroke_antialias=false;this._0.stroke_width=1;var c=5;var d=this._19(this.maximum_value/c);for(var f=0;f<=c;f++){var g=(this._l-this._2)/c,h=this._l-(g*f)-1,i=f-c,j=Math.abs(i)*d;this._0.stroke=this.marker_color;this._0.line(h,this._g,h,this._g+0.5*this.klass.LABEL_MARGIN);if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='center';this._0.annotate_scaled(0,0,h,this._g+(this.klass.LABEL_MARGIN*2.0),j,this._a)}this._0.stroke_antialias=true}},_e:function(c,d){if(this.labels[d]&&!this._u[d]){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(1,1,this._2-this.klass.LABEL_MARGIN*2.0,c,this.labels[d],this._a);this._u[d]=true}}});Bluff.Net=new JS.Class(Bluff.Base,{hide_dots:null,line_width:null,dot_radius:null,initialize:function(){this.callSuper();this.hide_dots=false;this.hide_line_numbers=true},draw:function(){this.callSuper();if(!this._c)return;this._z=this._3/2.0;this._A=this._2+(this._6/2.0);this._B=this._7+(this._3/2.0)-10;this._S=this._6/(this._5-1);var s=this.dot_radius||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*2.5),7.0);this._0.stroke_opacity=1.0;this._0.stroke_width=this.line_width||this._R(this._j/(this._9[0][this.klass.DATA_VALUES_INDEX].length*4),3.0);var r;if(this._U!==undefined){r=this._7+(this._3-this._U*this._3);this._0.push();this._0.stroke_color=this.baseline_color;this._0.fill_opacity=0.0;this._0.stroke_width=5;this._0.line(this._2,r,this._2+this._6,r);this._0.pop()}Bluff.each(this._9,function(o){var p=null,q=null;Bluff.each(o[this.klass.DATA_VALUES_INDEX],function(c,d){if(c===undefined)return;var f=d*Math.PI*2/this._5,g=c*this._z,h=this._A+Math.sin(f)*g,i=this._B-Math.cos(f)*g,j=(d+1<o[this.klass.DATA_VALUES_INDEX].length)?d+1:0,k=j*Math.PI*2/this._5,m=o[this.klass.DATA_VALUES_INDEX][j]*this._z,n=this._A+Math.sin(k)*m,l=this._B-Math.cos(k)*m;this._0.stroke=o[this.klass.DATA_COLOR_INDEX];this._0.fill=o[this.klass.DATA_COLOR_INDEX];this._0.line(h,i,n,l);if(!this.hide_dots)this._0.circle(h,i,h-s,i)},this)},this)},_N:function(){if(this.hide_line_markers)return;this._z=this._3/2.0;this._A=this._2+(this._6/2.0);this._B=this._7+(this._3/2.0)-10;var c,d;for(var f=0,g=this._5;f<g;f++){c=f*Math.PI*2/this._5;this._0.stroke=this.marker_color;this._0.stroke_width=1;this._0.line(this._A,this._B,this._A+Math.sin(c)*this._z,this._B-Math.cos(c)*this._z);d=this.labels[f]?this.labels[f]:'000';this._e(this._A,this._B,c*360/(2*Math.PI),this._z,d)}},_e:function(c,d,f,g,h){var i=1.1,j=c,k=d,m=f*Math.PI/180,n=j+(g*i*Math.sin(m)),l=k-(g*i*Math.cos(m));this._0.fill=this.marker_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(20);this._0.stroke='transparent';this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,n,l,h,this._a)}});Bluff.Pie=new JS.Class(Bluff.Base,{extend:{TEXT_OFFSET_PERCENTAGE:0.08},zero_degreee:null,hide_labels_less_than:null,initialize_ivars:function(){this.callSuper();this.zero_degree=0.0;this.hide_labels_less_than=0.0},draw:function(){this.hide_line_markers=true;this.callSuper();if(!this._c)return;var j=this._3,k=(Math.min(this._6,this._3)/2.0)*0.8,m=this._2+(this._6-j)/2.0,n=this._2+(this._6/2.0),l=this._7+(this._3/2.0)-10,o=this._1W(),p=this.zero_degree,q=this.klass.DATA_VALUES_INDEX;if(this.sort)this._1.sort(function(a,b){return a[q][0]-b[q][0]});Bluff.each(this._1,function(c,d){if(c[this.klass.DATA_VALUES_INDEX][0]>0){this._0.fill=c[this.klass.DATA_COLOR_INDEX];var f=(c[this.klass.DATA_VALUES_INDEX][0]/o)*360;this._0.circle(n,l,n+k,l,p,p+f+0.5);var g=p+((p+f)-p)/2,h=Math.round((c[this.klass.DATA_VALUES_INDEX][0]/o)*100.0),i;if(h>=this.hide_labels_less_than){i=this._Q(c[this.klass.DATA_VALUES_INDEX][0]);this._e(n,l,g,k+(k*this.klass.TEXT_OFFSET_PERCENTAGE),i,c,d)}p+=f}},this)},_e:function(c,d,f,g,h,i,j){var k=20.0,m=c,n=d,l=g+k,o=l*0.15,p=m+((l+o)*Math.cos(f*Math.PI/180)),q=n+(l*Math.sin(f*Math.PI/180));this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.marker_font_size);this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,p,q,h,this._a);this._y(p-20,q-20,40,40,i[this.klass.DATA_LABEL_INDEX],i[this.klass.DATA_COLOR_INDEX],h,j)},_1W:function(){var d=0;Bluff.each(this._1,function(c){d+=c[this.klass.DATA_VALUES_INDEX][0]},this);return d}});Bluff.SideBar=new JS.Class(Bluff.Base,{bar_spacing:0.9,draw:function(){this.has_left_labels=true;this.callSuper();if(!this._c)return;this._T()},_T:function(){this._V=this._3/this._5;this._8=this._V/this._9.length;this._0.stroke_opacity=0.0;var q=Bluff.array_new(this._5,0),s=Bluff.array_new(this._5,this._2),r=(this._8*(1-this.bar_spacing))/2;Bluff.each(this._9,function(l,o){var p=this._1[o][this.klass.DATA_VALUES_INDEX];Bluff.each(l[this.klass.DATA_VALUES_INDEX],function(c,d){var f=this._2+(this._6-c*this._6-q[d]),g=this._2+this._6-q[d],h=g-f,i=s[d]-1,j=this._7+(this._V*d)+(this._8*o)+r,k=i+h,m=j+this._8*this.bar_spacing;q[d]+=(c*this._6);this._0.stroke='transparent';this._0.fill=l[this.klass.DATA_COLOR_INDEX];this._0.rectangle(i,j,k,m);this._y(i,j,k-i,m-j,l[this.klass.DATA_LABEL_INDEX],l[this.klass.DATA_COLOR_INDEX],p[d],d);var n=this._7+(this._V*d+this._V/2);this._e(n,d)},this)},this)},_N:function(){if(this.hide_line_markers)return;this._0.stroke_antialias=false;this._0.stroke_width=1;var c=5;var d=this._19(this._i/c),f,g,h,i;for(var j=0;j<=c;j++){f=(this._l-this._2)/c;g=this._l-(f*j)-1;h=j-c;i=Math.abs(h)*d+this.minimum_value;this._0.stroke=this.marker_color;this._0.line(g,this._g,g,this._7);if(!this.hide_line_numbers){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='center';this._0.annotate_scaled(0,0,g,this._g+(this.klass.LABEL_MARGIN*2.0),this._Q(i),this._a)}}},_e:function(c,d){if(this.labels[d]&&!this._u[d]){this._0.fill=this.font_color;if(this.font)this._0.font=this.font;this._0.stroke='transparent';this._0.font_weight='normal';this._0.pointsize=this._d(this.marker_font_size);this._0.gravity='east';this._0.annotate_scaled(1,1,this._2-this.klass.LABEL_MARGIN*2.0,c,this.labels[d],this._a);this._u[d]=true}}});Bluff.Spider=new JS.Class(Bluff.Base,{hide_text:null,hide_axes:null,transparent_background:null,initialize:function(c,d,f){this.callSuper(c,f);this._1X=d;this.hide_legend=true},draw:function(){this.hide_line_markers=true;this.callSuper();if(!this._c)return;var c=this._3,d=this._3/2.0,f=this._2+(this._6-c)/2.0,g=this._2+(this._6/2.0),h=this._7+(this._3/2.0)-25;this._1Y=d/this._1X;var i=this._1Z(),j=0.0,k=(2*Math.PI)/this._1.length,m=0.0;if(!this.hide_axes)this._20(g,h,d,k);this._21(g,h,k)},_1s:function(c){return c*this._1Y},_e:function(c,d,f,g,h){var i=50,j=c,k=d+0,m=j+((g+i)*Math.cos(f)),n=k+((g+i)*Math.sin(f));this._0.fill=this.marker_color;if(this.font)this._0.font=this.font;this._0.pointsize=this._d(this.legend_font_size);this._0.stroke='transparent';this._0.font_weight='bold';this._0.gravity='center';this._0.annotate_scaled(0,0,m,n,h,this._a)},_20:function(g,h,i,j,k){if(this.hide_axes)return;var m=0.0;Bluff.each(this._1,function(c){this._0.stroke=k||c[this.klass.DATA_COLOR_INDEX];this._0.stroke_width=5.0;var d=i*Math.cos(m);var f=i*Math.sin(m);this._0.line(g,h,g+d,h+f);if(!this.hide_text)this._e(g,h,m,i,c[this.klass.DATA_LABEL_INDEX]);m+=j},this)},_21:function(d,f,g,h){var i=[],j=0.0;Bluff.each(this._1,function(c){i.push(d+this._1s(c[this.klass.DATA_VALUES_INDEX][0])*Math.cos(j));i.push(f+this._1s(c[this.klass.DATA_VALUES_INDEX][0])*Math.sin(j));j+=g},this);this._0.stroke_width=1.0;this._0.stroke=h||this.marker_color;this._0.fill=h||this.marker_color;this._0.fill_opacity=0.4;this._0.polyline(i)},_1Z:function(){var d=0.0;Bluff.each(this._1,function(c){d+=c[this.klass.DATA_VALUES_INDEX][0]},this);return d}});Bluff.Base.StackedMixin=new JS.Module({_1b:function(){var g={};Bluff.each(this._1,function(f){Bluff.each(f[this.klass.DATA_VALUES_INDEX],function(c,d){if(!g[d])g[d]=0.0;g[d]+=c},this)},this);for(var h in g){if(g[h]>this.maximum_value)this.maximum_value=g[h]}this.minimum_value=0}});Bluff.StackedArea=new JS.Class(Bluff.Base,{include:Bluff.Base.StackedMixin,last_series_goes_on_bottom:null,draw:function(){this._1b();this.callSuper();if(!this._c)return;this._S=this._6/(this._5-1);this._0.stroke='transparent';var n=Bluff.array_new(this._5,0);var l=null;var o=this.last_series_goes_on_bottom?'reverse_each':'each';Bluff[o](this._9,function(h){var i=l;l=[];Bluff.each(h[this.klass.DATA_VALUES_INDEX],funct (…)
H A Dbluff-src.js59 reverse_each: function(list, block, context) {
2030 var iterator = this.last_series_goes_on_bottom ? 'reverse_each' : 'each';

Completed in 94 milliseconds