⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plotkit_packed.js

📁 ntop网络监控软件,使用方面
💻 JS
📖 第 1 页 / 共 5 页
字号:
return;}_341.save();_341.shadowBlur=5;_341.shadowColor=Color.fromHexString("#888888").toRGBString();if(this.isIE){_341.save();_341.fillStyle="#cccccc";_341.fillRect(x-2,y-2,w+4,h+2);_341.restore();}else{_333(_341,x,y,w,h);}if(this.options.shouldFill){_341.fillStyle=_339(bar.name).toRGBString();_341.fillRect(x,y,w,h);}_341.shadowBlur=0;_341.strokeStyle=Color.whiteColor().toRGBString();_341.lineWidth=2;if(this.options.shouldStroke){_341.strokeRect(x,y,w,h);}_341.restore();};this._renderBarChartWrap(this.layout.bars,bind(_340,this));};PlotKit.SweetCanvasRenderer.prototype._renderLineChart=function(){var _342=this.element.getContext("2d");var _343=this.options.colorScheme.length;var _344=this.options.colorScheme;var _345=PlotKit.Base.keys(this.layout.datasets);var _346=_345.length;var bind=MochiKit.Base.bind;for(var i=0;i<_346;i++){var _347=_345[i];var _348=_344[i%_343];var _349=this.options.strokeColorTransform;_342.save();var _350=function(ctx){ctx.beginPath();ctx.moveTo(this.area.x,this.area.y+this.area.h);var _351=function(ctx_,_352){if(_352.name==_347){ctx_.lineTo(this.area.w*_352.x+this.area.x,this.area.h*_352.y+this.area.y);}};MochiKit.Iter.forEach(this.layout.points,partial(_351,ctx),this);ctx.lineTo(this.area.w+this.area.x,this.area.h+this.area.y);ctx.lineTo(this.area.x,this.area.y+this.area.h);ctx.closePath();};if(this.options.shouldFill){_342.save();if(this.isIE){_342.fillStyle="#cccccc";}else{_342.fillStyle=Color.blackColor().colorWithAlpha(0.2).toRGBString();}_342.translate(-1,-2);bind(_350,this)(_342);if(this.options.shouldFill){_342.fill();}_342.restore();}_342.shadowBlur=5;_342.shadowColor=Color.fromHexString("#888888").toRGBString();_342.fillStyle=_348.toRGBString();_342.lineWidth=2;_342.strokeStyle=Color.whiteColor().toRGBString();if(this.options.shouldFill){bind(_350,this)(_342);_342.fill();}if(this.options.shouldStroke){bind(_350,this)(_342);_342.stroke();}_342.restore();}};PlotKit.SweetCanvasRenderer.prototype._renderPieChart=function(){var _353=this.element.getContext("2d");var _354=this.options.colorScheme.length;var _355=this.layout.slices;var _356=this.area.x+this.area.w*0.5;var _357=this.area.y+this.area.h*0.5;var _358=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);if(this.isIE){_356=parseInt(_356);_357=parseInt(_357);_358=parseInt(_358);}if(!this.isIE){_353.save();var _359=Color.blackColor().colorWithAlpha(0.2);_353.fillStyle=_359.toRGBString();_353.shadowBlur=5;_353.shadowColor=Color.fromHexString("#888888").toRGBString();_353.translate(1,1);_353.beginPath();_353.moveTo(_356,_357);_353.arc(_356,_357,_358+2,0,Math.PI*2,false);_353.closePath();_353.fill();_353.restore();}_353.save();_353.strokeStyle=Color.whiteColor().toRGBString();_353.lineWidth=2;for(var i=0;i<_355.length;i++){var _360=this.options.colorScheme[i%_354];_353.fillStyle=_360.toRGBString();var _361=function(){_353.beginPath();_353.moveTo(_356,_357);_353.arc(_356,_357,_358,_355[i].startAngle-Math.PI/2,_355[i].endAngle-Math.PI/2,false);_353.lineTo(_356,_357);_353.closePath();};if(Math.abs(_355[i].startAngle-_355[i].endAngle)>0.0001){if(this.options.shouldFill){_361();_353.fill();}if(this.options.shouldStroke){_361();_353.stroke();}}}_353.restore();};PlotKit.SweetCanvasRenderer.prototype._renderBackground=function(){var _362=this.element.getContext("2d");if(this.layout.style=="bar"||this.layout.style=="line"){_362.save();_362.fillStyle=this.options.backgroundColor.toRGBString();_362.fillRect(this.area.x,this.area.y,this.area.w,this.area.h);_362.strokeStyle=this.options.axisLineColor.toRGBString();_362.lineWidth=1;var _363=this.layout.yticks;var _364=false;if(this.layout.style=="bar"&&this.layout.options.barOrientation=="horizontal"){_363=this.layout.xticks;_364=true;}for(var i=0;i<_363.length;i++){var x1=0;var y1=0;var x2=0;var y2=0;if(_364){x1=_363[i][0]*this.area.w+this.area.x;y1=this.area.y;x2=x1;y2=y1+this.area.h;}else{x1=this.area.x;y1=_363[i][0]*this.area.h+this.area.y;x2=x1+this.area.w;y2=y1;}_362.beginPath();_362.moveTo(x1,y1);_362.lineTo(x2,y2);_362.closePath();_362.stroke();}_362.restore();}else{PlotKit.SweetCanvasRenderer.__super__._renderBackground.call(this);}};PlotKit.SweetCanvas={};PlotKit.SweetCanvas.SweetCanvasRenderer=PlotKit.SweetCanvasRenderer;PlotKit.SweetCanvas.EXPORT=["SweetCanvasRenderer"];PlotKit.SweetCanvas.EXPORT_OK=["SweetCanvasRenderer"];PlotKit.SweetCanvas.__new__=function(){var m=MochiKit.Base;m.nameFunctions(this);this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};};PlotKit.SweetCanvas.__new__();MochiKit.Base._exportSymbols(this,PlotKit.SweetCanvas);try{if(typeof (PlotKit.SVGRenderer)=="undefined"){throw "";}}catch(e){throw "SweetSVG depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Layout, SVG}";}if(typeof (PlotKit.SweetSVGRenderer)=="undefined"){PlotKit.SweetSVGRenderer={};}PlotKit.SweetSVGRenderer=function(_365,_366,_367){if(arguments.length>0){this.__init__(_365,_366,_367);}};PlotKit.SweetSVGRenderer.NAME="PlotKit.SweetSVGRenderer";PlotKit.SweetSVGRenderer.VERSION=PlotKit.VERSION;PlotKit.SweetSVGRenderer.__repr__=function(){return "["+this.NAME+" "+this.VERSION+"]";};PlotKit.SweetSVGRenderer.toString=function(){return this.__repr__();};PlotKit.SweetSVGRenderer.prototype=new PlotKit.SVGRenderer();PlotKit.SweetSVGRenderer.prototype.constructor=PlotKit.SweetSVGRenderer;PlotKit.SweetSVGRenderer.__super__=PlotKit.SVGRenderer.prototype;PlotKit.SweetSVGRenderer.prototype.__init__=function(_368,_369,_370){var _371=PlotKit.Base.officeBlue();MochiKit.Base.update(_371,_370);PlotKit.SweetSVGRenderer.__super__.__init__.call(this,_368,_369,_371);};PlotKit.SweetSVGRenderer.prototype._addDropShadowFilter=function(){var _372=this.createSVGElement("filter",{x:0,y:0,"id":"dropShadow"});var _373=this.createSVGElement("feOffset",{"in":"SourceGraphic","dx":0,"dy":0,"result":"topCopy"});var blur=this.createSVGElement("feGaussianBlur",{"in":"SourceAlpha","StdDeviation":2,"result":"shadow"});var _375=this.createSVGElement("feOffset",{"in":"shadow","dx":-1,"dy":-2,"result":"movedShadow"});var _376=this.createSVGElement("feMerge");var _377=this.createSVGElement("feMergeNode",{"in":"topCopy"});var _378=this.createSVGElement("feMergeNode",{"in":"movedShadow"});_376.appendChild(_377);_376.appendChild(_378);_372.appendChild(_373);_372.appendChild(blur);_372.appendChild(_375);_372.appendChild(_376);this.defs.appendChild(_372);};PlotKit.SweetSVGRenderer.prototype._renderBarChart=function(){var bind=MochiKit.Base.bind;var _379=Color.blackColor().toRGBString();var _380="fill:"+_379+";fill-opacity:0.15";var _381="stroke-width: 2.0; stroke:"+Color.whiteColor().toRGBString();var _382=function(_383,bar){var x=this.area.w*bar.x+this.area.x;var y=this.area.h*bar.y+this.area.y;var w=this.area.w*bar.w;var h=this.area.h*bar.h;if((w<1)||(h<1)){return;}_383["style"]=_381;this._drawRect(x-2,y-1,w+4,h+2,{"style":_380});this._drawRect(x,y,w,h,_383);};this._renderBarOrLine(this.layout.bars,bind(_382,this));};PlotKit.SweetSVGRenderer.prototype._renderLineChart=function(){var bind=MochiKit.Base.bind;var _384=Color.blackColor().toRGBString();var _385="fill:"+_384+";fill-opacity:0.15";var _386="stroke-width: 2.0; stroke:"+Color.whiteColor().toRGBString();var _387=function(_388,_389){this._tempPointsBuffer+=(this.area.w*_389.x+this.area.x)+","+(this.area.h*_389.y+this.area.y)+" ";};var _390=function(_391){this._tempPointsBuffer="";this._tempPointsBuffer+=(this.area.x)+","+(this.area.y+this.area.h)+" ";};var _392=function(_393){this._tempPointsBuffer+=(this.area.w+this.area.x)+","+(this.area.h+this.area.y);_393["points"]=this._tempPointsBuffer;_393["stroke"]="none";_393["transform"]="translate(-2, -1)";_393["style"]=_385;var _394=this.createSVGElement("polygon",_393);this.root.appendChild(_394);_393["transform"]="";_393["style"]=_386;var elem=this.createSVGElement("polygon",_393);this.root.appendChild(elem);};this._renderBarOrLine(this.layout.points,bind(_387,this),bind(_390,this),bind(_392,this));};PlotKit.SweetSVGRenderer.prototype._renderPieChart=function(){var _395=this.area.x+this.area.w*0.5;var _396=this.area.y+this.area.h*0.5;var _397=Color.blackColor().toRGBString();var _398=Math.min(this.area.w*this.options.pieRadius,this.area.h*this.options.pieRadius);var _399="fill:"+_397+";fill-opacity:0.15";var _400=this.createSVGElement("circle",{"style":_399,"cx":_395+1,"cy":_396+1,"r":_398+1});this.root.appendChild(_400);PlotKit.SweetSVGRenderer.__super__._renderPieChart.call(this);};PlotKit.SweetSVGRenderer.prototype._renderBackground=function(){var _401={"fill":this.options.backgroundColor.toRGBString(),"stroke":"none"};if(this.layout.style=="bar"||this.layout.style=="line"){this._drawRect(this.area.x,this.area.y,this.area.w,this.area.h,_401);var _402=this.layout.yticks;var _403=false;if(this.layout.style=="bar"&&this.layout.options.barOrientation=="horizontal"){_402=this.layout.xticks;_403=true;}for(var i=0;i<_402.length;i++){var x=0;var y=0;var w=0;var h=0;if(_403){x=_402[i][0]*this.area.w+this.area.x;y=this.area.y;w=1;h=this.area.w;}else{x=this.area.x;y=_402[i][0]*this.area.h+this.area.y;w=this.area.w;h=1;}this._drawRect(x,y,w,h,{"fill":this.options.axisLineColor.toRGBString()});}}else{PlotKit.SweetSVGRenderer.__super__._renderBackground.call(this);}};PlotKit.SweetSVG={};PlotKit.SweetSVG.SweetSVGRenderer=PlotKit.SweetSVGRenderer;PlotKit.SweetSVG.EXPORT=["SweetSVGRenderer"];PlotKit.SweetSVG.EXPORT_OK=["SweetSVGRenderer"];PlotKit.SweetSVG.__new__=function(){var m=MochiKit.Base;m.nameFunctions(this);this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};};PlotKit.SweetSVG.__new__();MochiKit.Base._exportSymbols(this,PlotKit.SweetSVG);try{if(typeof (PlotKit.CanvasRenderer)=="undefined"){throw "";}}catch(e){throw "PlotKit.EasyPlot depends on all of PlotKit's components";}if(typeof (PlotKit.EasyPlot)=="undefined"){PlotKit.EasyPlot={};}PlotKit.EasyPlot.NAME="PlotKit.EasyPlot";PlotKit.EasyPlot.VERSION=PlotKit.VERSION;PlotKit.EasyPlot.__repr__=function(){return "["+this.NAME+" "+this.VERSION+"]";};PlotKit.EasyPlot.toString=function(){return this.__repr__();};PlotKit.EasyPlot=function(_404,_405,_406,_407){this.layout=new Layout(_404,_405);this.divElem=_406;this.width=parseInt(_406.getAttribute("width"));this.height=parseInt(_406.getAttribute("height"));this.deferredCount=0;if(this.width<1){this.width=this.divElem.width?this.divElem.width:300;}if(this.height<1){this.height=this.divElem.height?this.divElem.height:300;}if(isArrayLike(_407)){for(var i=0;i<_407.length;i++){if(typeof (_407[i])=="string"){this.deferredCount++;var d=MochiKit.Async.doSimpleXMLHttpRequest(_407[i]);d.addCallback(MochiKit.Base.bind(PlotKit.EasyPlot.onDataLoaded,this));}else{if(isArrayLike(_407[i])){this.layout.addDataset("data-"+i,_407[i]);}}}}else{if(!isUndefinedOrNull(_407)){throw "Passed datasources are not Array like";}}if(CanvasRenderer.isSupported()){this.element=CANVAS({"id":this.divElem.getAttribute("id")+"-canvas","width":this.width,"height":this.height},"");this.divElem.appendChild(this.element);this.renderer=new SweetCanvasRenderer(this.element,this.layout,_405);}else{if(SVGRenderer.isSupported()){this.element=SVGRenderer.SVG({"id":this.divElem.getAttribute("id")+"-svg","width":this.width,"height":this.height,"version":"1.1","baseProfile":"full"},"");this.divElem.appendChild(this.element);this.renderer=new SweetSVGRenderer(this.element,this.layout,_405);}}if((this.deferredCount==0)&&(PlotKit.Base.keys(this.layout.datasets).length>0)){this.layout.evaluate();this.renderer.clear();this.renderer.render();}};PlotKit.EasyPlot.onDataLoaded=function(_409){var _410=new Array();var _411=_409.responseText.split("\n");for(var i=0;i<_411.length;i++){var _412=MochiKit.Format.strip(_411[i]);if((_412.length>1)&&(_412.charAt(0)!="#")){_410.push(_412.split(","));}}this.layout.addDataset("data-ajax-"+this.deferredCount,_410);this.deferredCount--;if((this.deferredCount==0)&&(PlotKit.Base.keys(this.layout.datasets).length>0)){this.layout.evaluate();this.renderer.clear();this.renderer.render();}};PlotKit.EasyPlot.prototype.reload=function(){this.layout.evaluate();this.renderer.clear();this.renderer.render();};PlotKit.EasyPlotModule={};PlotKit.EasyPlotModule.EasyPlot=PlotKit.EasyPlot;PlotKit.EasyPlotModule.EXPORT=["EasyPlot"];PlotKit.EasyPlotModule.EXPORT_OK=[];PlotKit.EasyPlotModule.__new__=function(){var m=MochiKit.Base;m.nameFunctions(this);this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};};PlotKit.EasyPlotModule.__new__();MochiKit.Base._exportSymbols(this,PlotKit.EasyPlotModule);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -