0&&(e=q+n*(o[f]/p)),a===f)return h=j.get("sliceColors")[f%j.get("sliceColors").length],c&&(h=this.calcHighlightColor(h,j)),i.drawPieSlice(k,k,k-l,d,e,void 0,h);q=e}},render:function(){var a,c,d=this.target,e=this.values,f=this.options,g=this.radius,h=f.get("borderWidth");if(z._super.render.call(this)){for(h&&d.drawCircle(g,g,b.floor(g-h/2),f.get("borderColor"),void 0,h).append(),c=e.length;c--;)e[c]&&(a=this.renderSlice(c).append(),this.valueShapes[c]=a.id,this.shapes[a.id]=c);d.render()}}}),c.fn.sparkline.box=A=e(c.fn.sparkline._base,{type:"box",init:function(a,b,d,e,f){A._super.init.call(this,a,b,d,e,f),this.values=c.map(b,Number),this.width="auto"===d.get("width")?"4.0em":e,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var a=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return void 0!==this.loutlier&&a.push({field:"lo",value:this.loutlier}),void 0!==this.routlier&&a.push({field:"ro",value:this.routlier}),void 0!==this.lwhisker&&a.push({field:"lw",value:this.lwhisker}),void 0!==this.rwhisker&&a.push({field:"rw",value:this.rwhisker}),a},render:function(){var a,c,d,e,f,g,i,j,k,l,m,n=this.target,o=this.values,p=o.length,q=this.options,r=this.canvasWidth,s=this.canvasHeight,t=void 0===q.get("chartRangeMin")?b.min.apply(b,o):q.get("chartRangeMin"),u=void 0===q.get("chartRangeMax")?b.max.apply(b,o):q.get("chartRangeMax"),v=0;if(A._super.render.call(this)){if(q.get("raw"))q.get("showOutliers")&&o.length>5?(c=o[0],a=o[1],e=o[2],f=o[3],g=o[4],i=o[5],j=o[6]):(a=o[0],e=o[1],f=o[2],g=o[3],i=o[4]);else if(o.sort(function(a,b){return a-b}),e=h(o,1),f=h(o,2),g=h(o,3),d=g-e,q.get("showOutliers")){for(a=i=void 0,k=0;ke-d*q.get("outlierIQR")&&(a=o[k]),o[k]i&&n.drawCircle((j-t)*m+v,s/2,q.get("spotRadius"),q.get("outlierLineColor"),q.get("outlierFillColor")).append()),n.drawRect(b.round((e-t)*m+v),b.round(.1*s),b.round((g-e)*m),b.round(.8*s),q.get("boxLineColor"),q.get("boxFillColor")).append(),n.drawLine(b.round((a-t)*m+v),b.round(s/2),b.round((e-t)*m+v),b.round(s/2),q.get("lineColor")).append(),n.drawLine(b.round((a-t)*m+v),b.round(s/4),b.round((a-t)*m+v),b.round(s-s/4),q.get("whiskerColor")).append(),n.drawLine(b.round((i-t)*m+v),b.round(s/2),b.round((g-t)*m+v),b.round(s/2),q.get("lineColor")).append(),n.drawLine(b.round((i-t)*m+v),b.round(s/4),b.round((i-t)*m+v),b.round(s-s/4),q.get("whiskerColor")).append(),n.drawLine(b.round((f-t)*m+v),b.round(.1*s),b.round((f-t)*m+v),b.round(.9*s),q.get("medianColor")).append(),q.get("target")&&(l=b.ceil(q.get("spotRadius")),n.drawLine(b.round((q.get("target")-t)*m+v),b.round(s/2-l),b.round((q.get("target")-t)*m+v),b.round(s/2+l),q.get("targetColor")).append(),n.drawLine(b.round((q.get("target")-t)*m+v-l),b.round(s/2),b.round((q.get("target")-t)*m+v+l),b.round(s/2),q.get("targetColor")).append()),n.render()}}}),D=e({init:function(a,b,c,d){this.target=a,this.id=b,this.type=c,this.args=d},append:function(){return this.target.appendShape(this),this}}),E=e({_pxregex:/(\d+)(px)?\s*$/i,init:function(a,b,d){a&&(this.width=a,this.height=b,this.target=d,this.lastShapeId=null,d[0]&&(d=d[0]),c.data(d,"_jqs_vcanvas",this))},drawLine:function(a,b,c,d,e,f){return this.drawShape([[a,b],[c,d]],e,f)},drawShape:function(a,b,c,d){return this._genShape("Shape",[a,b,c,d])},drawCircle:function(a,b,c,d,e,f){return this._genShape("Circle",[a,b,c,d,e,f])},drawPieSlice:function(a,b,c,d,e,f,g){return this._genShape("PieSlice",[a,b,c,d,e,f,g])},drawRect:function(a,b,c,d,e,f){return this._genShape("Rect",[a,b,c,d,e,f])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(a,b){c(b).html(a)},_calculatePixelDims:function(a,b,d){var e;e=this._pxregex.exec(b),this.pixelHeight=e?e[1]:c(d).height(),e=this._pxregex.exec(a),this.pixelWidth=e?e[1]:c(d).width()},_genShape:function(a,b){var c=J++;return b.unshift(c),new D(this,c,a,b)},appendShape:function(a){alert("appendShape not implemented")},replaceWithShape:function(a,b){alert("replaceWithShape not implemented")},insertAfterShape:function(a,b){alert("insertAfterShape not implemented")},removeShapeId:function(a){alert("removeShapeId not implemented")},getShapeAt:function(a,b,c){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),F=e(E,{init:function(b,d,e,f){F._super.init.call(this,b,d,e),this.canvas=a.createElement("canvas"),e[0]&&(e=e[0]),c.data(e,"_jqs_vcanvas",this),c(this.canvas).css({display:"inline-block",width:b,height:d,verticalAlign:"top"}),this._insert(this.canvas,e),this._calculatePixelDims(b,d,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=f,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=void 0,c(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(a,b,c){var d=this.canvas.getContext("2d");return void 0!==a&&(d.strokeStyle=a),d.lineWidth=void 0===c?1:c,void 0!==b&&(d.fillStyle=b),d},reset:function(){this._getContext().clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=void 0},_drawShape:function(a,b,c,d,e){var f,g,h=this._getContext(c,d,e);for(h.beginPath(),h.moveTo(b[0][0]+.5,b[0][1]+.5),f=1,g=b.length;f',this.canvas.insertAdjacentHTML("beforeEnd",f),this.group=c(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(a,b,c,d,e){var f,g,h,i,j,k,l=[];for(k=0,j=b.length;k '},_drawCircle:function(a,b,c,d,e,f,g){var h,i;return b-=d,c-=d,h=void 0===e?' stroked="false" ':' strokeWeight="'+g+'px" strokeColor="'+e+'" ',i=void 0===f?' filled="false"':' fillColor="'+f+'" filled="true" ',''},_drawPieSlice:function(a,c,d,e,f,g,h,i){var j,k,l,m,n,o,p;if(f===g)return"";if(g-f==2*b.PI&&(f=0,g=2*b.PI),k=c+b.round(b.cos(f)*e),l=d+b.round(b.sin(f)*e),m=c+b.round(b.cos(g)*e),n=d+b.round(b.sin(g)*e),k===m&&l===n){if(g-f ')},_drawRect:function(a,b,c,d,e,f,g){return this._drawShape(a,[[b,c],[b,c+e],[b+d,c+e],[b+d,c],[b,c]],f,g)},reset:function(){this.group.innerHTML=""},appendShape:function(a){var b=this["_draw"+a.type].apply(this,a.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",b):this.prerender+=b,this.lastShapeId=a.id,a.id},replaceWithShape:function(a,b){var d=c("#jqsshape"+a),e=this["_draw"+b.type].apply(this,b.args);d[0].outerHTML=e},replaceWithShapes:function(a,b){var d,e=c("#jqsshape"+a[0]),f="",g=b.length;for(d=0;d