UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

1 lines 6.17 kB
module.exports=function(e){var i={};function r(t){if(i[t])return i[t].exports;var n=i[t]={exports:{},id:t,loaded:!1};return e[t].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}return r.m=e,r.c=i,r.p="",r(0)}({0:function(t,n,e){t.exports=e(916)},3:function(t,n){t.exports=function(){throw Error("define cannot be used indirect")}},896:function(t,n){t.exports=require("../../kendo.core")},916:function(t,n,e){var i;e(3),e=[e(896)],void 0===(n="function"==typeof(i=function(){var e=window.kendo.jQuery,h=void 0,n=window.kendo,r=n.dataviz.diagram={},l,i=Array.isArray,a=1e-6,u={};function t(t,n,e){if(typeof t=="undefined"||typeof n=="undefined")return[];if(e&&u.sign(n-t)!=u.sign(e))throw"The sign of the increment should allow to reach the stop-value.";e=e||1;t=t||0;n=n||t;if((n-t)/e===Infinity)throw"Infinite range defined.";var i=[],r=-1,a;function o(t){var n=1;while(t*n%1)n*=10;return n}var s=o(Math.abs(e));t*=s;n*=s;e*=s;if(t>n&&e>0)e=-e;if(e<0)while((a=t+e*++r)>=n)i.push(a/s);else while((a=t+e*++r)<=n)i.push(a/s);return i}function o(t,n){if(t==n)return 0;var e=n.x-t.x,i=t.y-n.y,r=Math.atan(e/i);if(i>=0)return e<0?r+2*Math.PI:r;return r+Math.PI}(0,n.deepExtend)(u,{isNearZero:function(t){return Math.abs(t)<a},isDefined:function(t){return typeof t!=="undefined"},isUndefined:function(t){return typeof t==="undefined"||t===null},isObject:function(t){return t===Object(t)},has:function(t,n){return Object.hasOwnProperty.call(t,n)},isString:function(t){return Object.prototype.toString.call(t)=="[object String]"},isBoolean:function(t){return Object.prototype.toString.call(t)=="[object Boolean]"},isType:function(t,n){return Object.prototype.toString.call(t)=="[object "+n+"]"},isNumber:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},isEmpty:function(t){if(t===null)return true;if(i(t)||u.isString(t))return t.length===0;for(var n in t)if(u.has(t,n))return false;return true},simpleExtend:function(t,n){if(!u.isObject(n))return;for(var e in n)t[e]=n[e]},initArray:function t(n,e){var i=[];for(var r=0;r<n;++r)i[r]=e;return i},serializePoints:function(t){var n=[];for(var e=0;e<t.length;e++){var i=t[e];n.push(i.x+";"+i.y)}return n.join(";")},deserializePoints:function(t){var n=t.split(";"),e=[];if(n.length%2!==0)throw"Not an array of points.";for(var i=0;i<n.length;i+=2)e.push(new r.Point(parseInt(n[i],10),parseInt(n[i+1],10)));return e},randomInteger:function(t,n){return parseInt(Math.floor(Math.random()*n)+t,10)},DFT:function(t,n){n(t);if(t.childNodes)for(var e=0;e<t.childNodes.length;e++){var i=t.childNodes[e];this.DFT(i,n)}},getMatrixAngle:function(t){if(t===null||t.d===0)return 0;return Math.atan2(t.b,t.d)*180/Math.PI},getMatrixScaling:function(t){var n=Math.sqrt(t.a*t.a+t.c*t.c);var e=Math.sqrt(t.b*t.b+t.d*t.d);return[n,e]}}),u.sign=function(t){return t?t<0?-1:1:0},u.findAngle=function(t,n){return o(t,n)*180/Math.PI},u.forEach=function(t,n,e){for(var i=0;i<t.length;i++)n.call(e,t[i],i,t)},u.any=function(t,n){for(var e=0;e<t.length;++e)if(n(t[e]))return t[e];return null},u.remove=function(t,n){var e;while((e=u.indexOf(t,n))!==-1)t.splice(e,1);return t},u.contains=function(t,n){return u.indexOf(t,n)!==-1},u.indexOf=function(t,n){return e.inArray(n,t)},u.fold=function(t,n,e,i){var r=arguments.length>2;for(var a=0;a<t.length;a++){var o=t[a];if(!r){e=o;r=true}else e=n.call(i,e,o,a,t)}if(!r)throw"Reduce of empty array with no initial value";return e},u.find=function(t,i,r){var a;u.any(t,function(t,n,e){if(i.call(r,t,n,e)){a=t;return true}return false});return a},u.first=function(t,n,e){if(t.length===0)return null;if(u.isUndefined(n))return t[0];return u.find(t,n,e)},u.insert=function(t,n,e){t.splice(e,0,n);return t},u.all=function(t,n,e){var i=true;var r;for(var a=0;a<t.length;a++){r=t[a];i=i&&n.call(e,r,a,t);if(!i)break}return i},u.clear=function(t){t.splice(0,t.length)},u.bisort=function(t,n,e){if(u.isUndefined(t))throw"First array is not specified.";if(u.isUndefined(n))throw"Second array is not specified.";if(t.length!=n.length)throw"The two arrays should have equal length";var i=[],r;for(r=0;r<t.length;r++)i.push({x:t[r],y:n[r]});if(u.isUndefined(e))i.sort(function(t,n){return t.x-n.x});else i.sort(function(t,n){return e(t.x,n.x)});u.clear(t);u.clear(n);for(r=0;r<i.length;r++){t.push(i[r].x);n.push(i[r].y)}},u.addRange=function(t,n){t.push.apply(t,n)};var s={easeInOut:function(t){return-Math.cos(t*Math.PI)/2+.5}},f=n.Class.extend({init:function(){this.adapters=[];this.target=0;this.tick=0;this.interval=20;this.duration=800;this.lastTime=null;this.handlers=[];var t=this;this.transition=s.easeInOut;this.timerDelegate=function(){t.onTimerEvent()}},addAdapter:function(t){this.adapters.push(t)},onComplete:function(t){this.handlers.push(t)},removeHandler:function(n){this.handlers=e.grep(this.handlers,function(t){return t!==n})},trigger:function(){var n=this;if(this.handlers)u.forEach(this.handlers,function(t){return t.call(n.caller!==null?n.caller:n)})},onStep:function(){},seekTo:function(t){this.seekFromTo(this.tick,t)},seekFromTo:function(t,n){this.target=Math.max(0,Math.min(1,n));this.tick=Math.max(0,Math.min(1,t));this.lastTime=(new Date).getTime();if(!this.intervalId)this.intervalId=window.setInterval(this.timerDelegate,this.interval)},stop:function(){if(this.intervalId){window.clearInterval(this.intervalId);this.intervalId=null;this.trigger()}},play:function(t){if(this.adapters.length===0)return;if(t!==null)this.caller=t;this.initState();this.seekFromTo(0,1)},reverse:function(){this.seekFromTo(1,0)},initState:function(){if(this.adapters.length===0)return;for(var t=0;t<this.adapters.length;t++)this.adapters[t].initState()},propagate:function(){var t=this.transition(this.tick);for(var n=0;n<this.adapters.length;n++)this.adapters[n].update(t)},onTimerEvent:function(){var t=(new Date).getTime();var n=t-this.lastTime;this.lastTime=t;var e=n/this.duration*(this.tick<this.target?1:-1);if(Math.abs(e)>=Math.abs(this.tick-this.target))this.tick=this.target;else this.tick+=e;try{this.propagate()}finally{this.onStep.call(this);if(this.target==this.tick)this.stop()}}});n.deepExtend(r,{init:function(t){n.init(t,r.ui)},Utils:u,Range:t,Ticker:f})})?i.apply(n,e):i)||(t.exports=n)}});