PHP Classes

File: public/flat-admin/js/plugins/flot/jquery.flot.spider.min.js

Recommend this page to a friend!
  Classes of adriano123456   Budget System   public/flat-admin/js/plugins/flot/jquery.flot.spider.min.js   Download  
File: public/flat-admin/js/plugins/flot/jquery.flot.spider.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Budget System
Elaborate budgets for purchases of products
Author: By
Last change:
Date: 4 months ago
Size: 7,684 bytes
 

Contents

Class file image Download
/* * The MIT License Copyright (c) 2010, 2011, 2012, 2013 by Juergen Marsch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */(function(e){"use strict";function o(n){function p(t,n){if(n.series.spider.active){e.extend(!0,n,s);e.plot.JUMlib.data.extendEmpty(n,i);f=n;t.hooks.processRawData.push(d);t.hooks.draw.push(m);f.series.spider.debug.active===!0&&(f.series.spider.debug.createDocuTemplate=v)}}function d(e,t,n,r){if(t.spider.show===!0){t.nearBy.drawEdit=M;t.nearBy.findItem=O;t.nearBy.drawHover=_}}function v(){var n,i;n=e.plot.JUMExample.docuObjectToTemplate([{name:"data",tree:c.data},{name:"options.series.spider",tree:r.series.spider,takeDefault:!0},{name:"options.series.spider",tree:f.series.spider},{name:"options.series.editMode",tree:r.series.editMode,takeDefault:!0},{name:"options.series.editMode",tree:f.series.editMode},{name:"options.series.nearBy",tree:r.series.nearBy,takeDefault:!0},{name:"options.series.nearBy",tree:f.series.nearBy}],t);e.plot.JUMExample.extendDocuObject(n,t);i=e.plot.JUMlib.docu.docuObjectToEdit(n,"");return{data:n,form:i}}function m(e,t){h=e.getData();f=e.getOptions();f.series.spider.debug.active===!0&&(c=h[0]);w(t);E(t);g();N(t,f.grid)}function g(){var e=[],t;if(h[0].spider.scaleMode==="leg")for(t=0;t<h[0].data.length;t++)e.push(y(t));else{var n=b();for(t=0;t<h[0].data.length;t++)e.push(n)}h.ranges=e}function y(e){var t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(var r=0;r<h.length;r++){t=Math.min(t,h[r].data[e][1]);n=Math.max(n,h[r].data[e][1])}t*=h[0].spider.legs.legScaleMin;n*=h[0].spider.legs.legScaleMax;f.series.spider.legMin&&(t=f.series.spider.legMin);f.series.spider.legMax&&(n=f.series.spider.legMax);return{min:t,max:n,range:n-t}}function b(){var e=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY;for(var n=0;n<h[0].data.length;n++)for(var r=0;r<h.length;r++){e=Math.min(e,h[r].data[n][1]);t=Math.max(t,h[r].data[n][1])}e*=h[0].spider.legs.legScaleMin;t*=h[0].spider.legs.legScaleMax;f.series.spider.legMin&&(e=f.series.spider.legMin);f.series.spider.legMax&&(t=f.series.spider.legMax);return{min:e,max:t,range:t-e}}function w(e){e.clearRect(0,0,e.canvas.width,e.canvas.height)}function E(e){o=Math.min(e.canvas.width,e.canvas.height)/2*h[0].spider.spiderSize;l=e.canvas.height/2;a=e.canvas.width/2}function S(e,t,n,r){for(var i=0;i<n.data.length;i++)x(e,t,n,i,r)}function x(e,t,n,r,i){var s,o=C(n,h.ranges,r);s=k(t,r,o);e.beginPath();e.lineWidth=1;e.fillStyle=i;e.strokeStyle=i;e.arc(s.x,s.y,n.spider.pointSize,0,Math.PI*2,!0);e.closePath();e.fill()}function T(e,t,n,r,i){var s,o;i||(i=!1);e.beginPath();e.lineWidth=n.spider.connection.width;e.strokeStyle=r;e.fillStyle=r;o=C(n,h.ranges,0);s=k(t,0,o);e.moveTo(s.x,s.y);for(var u=1;u<n.data.length;u++){o=C(n,h.ranges,u);s=k(t,u,o);e.lineTo(s.x,s.y)}o=C(n,h.ranges,0);s=k(t,0,o);e.lineTo(s.x,s.y);i===!0?e.fill():n.spider.fill===!0?e.fill():e.stroke()}function N(e,t){function s(e,t){e.lineWidth=1;e.strokeStyle=t.tickColor;for(var r=1;r<=t.ticks;r++){e.beginPath();e.arc(a,l,o/t.ticks*r,0,Math.PI*2,!0);e.closePath();e.stroke()}var i=null,s=null;for(var u=0;u<n;u++){if(i===null){i=k(n,u,100);s=k(n,Math.floor(n/4),100)}d(e,u);v(e,u,i,s)}}function f(e,t){var r,i;e.linewidth=1;e.strokeStyle=t.tickColor;for(r=0;r<=t.ticks;r++){var s=k(n,0,100/t.ticks*r);e.beginPath();e.moveTo(s.x,s.y);for(i=1;i<n;i++){s=k(n,i,100/t.ticks*r);e.lineTo(s.x,s.y)}e.closePath();e.stroke()}var o=null,u=null;for(i=0;i<n;i++){if(o===null){o=k(n,i,100);u=k(n,Math.floor(n/4),100)}d(e,i);v(e,i,o,u)}}function c(e,t){switch(t.mode){case"radar":s(e,t);break;case"spider":f(e,t);break;default:s(e,t)}}function p(e,t){if(t.series.spider.scaleMode!=="leg")for(var n=0;n<=t.ticks;n++);}function d(e,t){var i;e.beginPath();e.lineWidth=r.series.spider.lineWidth;e.strokeStyle=r.series.spider.lineStyle;e.moveTo(a,l);i=k(n,t,100);e.lineTo(i.x,i.y);e.stroke()}function v(e,t,r,i,s){var o,a,f,l;o=k(n,t,100);e.font=h[0].spider.legs.font;e.fillStyle=h[0].spider.legs.fillStyle;a=e.measureText(h[0].spider.legs.data[t].label);o.y>r.y?l=15:l=-15;u(o.y,r.y+10,r.y-10)&&(l=0);o.x<i.x?f=a.width*-1-a.width/2:f=0;u(o.x,r.x+10,r.x-10)&&(f=a.width/2);e.fillText(h[0].spider.legs.data[t].label,o.x+f,o.y+l)}var n=h[0].data.length,i;for(i=0;i<h.length;i++)T(e,n,h[i],h[i].color);for(i=0;i<h.length;i++)S(e,n,h[i],h[i].color);c(e,t)}function C(e,t,n,r){var i;if(r)i=(r-t[n].min)/t[n].range*100;else{i=Math.max(Math.min(e.data[n][1],t[n].max),t[n].min);i=(i-t[n].min)/t[n].range*100}return i}function k(e,t,n){var r,i,s;s=2*Math.PI*f.series.spider.legs.legStartAngle/360;r=a+Math.round(Math.cos(2*Math.PI/e*t+s)*o*n/100);i=l+Math.round(Math.sin(2*Math.PI/e*t+s)*o*n/100);return{x:r,y:i}}function L(e,t){var n;n=(e-a)*(e-a)+(t-l)*(t-l);n=Math.sqrt(n);n=n/o*100;return n}function A(e,t){var n,r=h.ranges[e];n=r.min+r.range/100*t;return n}function O(e,t,n,r){function s(e,t,n,r){var i,s,o,u,a,f=null,l=r.data.length;for(i=0;i<l;i++){s=k(l,i,C(r,h.ranges,i));o=Math.abs(s.x-e);u=Math.abs(s.y-t);a=Math.sqrt(o*o+u*u);a<=r.nearBy.distance&&(f=[n,i])}return f}function o(e,t,n,r){var i,s,o,u,a,l,c=null,h=r.data.length,p=f.series.justEditing[1].dataIndex;l=L(e,t);i=A(p,l);a=k(h,p,l);s=Math.abs(a.x-e);o=Math.abs(a.y-t);u=Math.sqrt(s*s+o*o);u<=r.spider.pointSize&&(c=[n,p,i,0]);return c}var i=null;f.series.justEditing?f.series.justEditing[1].seriesIndex===n&&(i=o(e,t,n,r)):i=s(e,t,n,r);return i}function M(e,t,n,r){e.beginPath();e.lineWidth=1;var i="rgba(255, 0, 0, "+r.spider.highlight.opacity+")";e.fillStyle=i;e.strokeStyle=i;var s=C(r,h.ranges,f.series.justEditing[1].dataIndex,f.series.justEditing[0].value),o=k(r.data.length,f.series.justEditing[1].dataIndex,s);e.arc(o.x,o.y,f.series.spider.pointSize,0,Math.PI*2,!0);e.closePath();e.fill()}function _(e,t,n){if(!t.justEditing){var r="rgba(255, 255, 255, "+t.spider.highlight.opacity+")",i=t.data.length;switch(t.spider.highlight.mode){case"point":S(e,i,t,r);break;case"line":T(e,i,t,r,!1);break;case"area":T(e,i,t,t.color,!0);break;default:}}}var o=null,a=null,f=null,l=null,c=null,h;n.hooks.processOptions.push(p)}var t="spider",n="0.6",r={series:{spider:{active:!1,show:!1,spiderSize:.8,lineWidth:1,lineStyle:"rgba(0,0,0,0.15)",pointSize:6,scaleMode:"leg",legMin:null,legMax:null,connection:{width:4},highlight:{opacity:.5,mode:"point"},legs:{font:"20px Times New Roman",fillStyle:"Black",legScaleMin:.95,legScaleMax:1.05,legStartAngle:0},debug:{active:!1,createDocuTemplate:null}}}},i={series:{editMode:"xy",nearBy:{distance:6,findItem:null,findMode:"circle",drawEdit:null,drawHover:null}},grid:{mode:"radar"}},s={grid:{show:!1,tickColor:"rgba(0,0,0,0.15)",ticks:5}},u=e.plot.JUMlib.library.between;e.plot.plugins.push({init:o,options:r,name:t,version:n})})(jQuery);