accounting-dashboard/src/main/java/org/gcube/portlets/user/accountingdashboard/client/resources/chartjs-plugin-zoom.min.js

10 lines
8.1 KiB
JavaScript
Raw Normal View History

/*!
* chartjs-plugin-zoom
* http://chartjs.org/
* Version: 0.6.3
*
* Copyright 2016 Evert Timberg
* Released under the MIT license
* https://github.com/chartjs/chartjs-plugin-zoom/blob/master/LICENSE.md
*/
!function e(t,o,n){function a(r,l){if(!o[r]){if(!t[r]){var m="function"==typeof require&&require;if(!l&&m)return m(r,!0);if(i)return i(r,!0);var s=new Error("Cannot find module '"+r+"'");throw s.code="MODULE_NOT_FOUND",s}var u=o[r]={exports:{}};t[r][0].call(u.exports,function(e){var o=t[r][1][e];return a(o?o:e)},u,u.exports,e,t,o,n)}return o[r].exports}for(var i="function"==typeof require&&require,r=0;r<n.length;r++)a(n[r]);return a}({1:[function(e,t,o){},{}],2:[function(e,t,o){function n(e,t){return void 0===e||"string"==typeof e&&e.indexOf(t)!==-1}function a(e,t){if(e.scaleAxes&&e.rangeMax&&!z.isNullOrUndef(e.rangeMax[e.scaleAxes])){var o=e.rangeMax[e.scaleAxes];t>o&&(t=o)}return t}function i(e,t){if(e.scaleAxes&&e.rangeMin&&!z.isNullOrUndef(e.rangeMin[e.scaleAxes])){var o=e.rangeMin[e.scaleAxes];t<o&&(t=o)}return t}function r(e,t,o,n){var r=e.chart.data.labels,l=e.minIndex,m=r.length-1,s=e.maxIndex,u=n.sensitivity,c=e.isHorizontal()?e.left+e.width/2:e.top+e.height/2,d=e.isHorizontal()?o.x:o.y;y.zoomCumulativeDelta=t>1?y.zoomCumulativeDelta+1:y.zoomCumulativeDelta-1,Math.abs(y.zoomCumulativeDelta)>u&&(y.zoomCumulativeDelta<0?(d>=c?l<=0?s=Math.min(m,s+1):l=Math.max(0,l-1):d<c&&(s>=m?l=Math.max(0,l-1):s=Math.min(m,s+1)),y.zoomCumulativeDelta=0):y.zoomCumulativeDelta>0&&(d>=c?l=l<s?l=Math.min(s,l+1):l:d<c&&(s=s>l?s=Math.max(l,s-1):s),y.zoomCumulativeDelta=0),e.options.ticks.min=i(n,r[l]),e.options.ticks.max=a(n,r[s]))}function l(e,t,o,n){var r,l,m=e.options;e.isHorizontal()?(r=e.right-e.left,l=(o.x-e.left)/r):(r=e.bottom-e.top,l=(o.y-e.top)/r);var s=1-l,u=r*(t-1),c=u*l,d=u*s,p=e.getValueForPixel(e.getPixelForValue(e.min)+c),f=e.getValueForPixel(e.getPixelForValue(e.max)-d),v=f.diff(p),x=i(n,v)!=v,g=a(n,v)!=v;x||g||(m.time.min=p,m.time.max=f)}function m(e,t,o,n){var r=e.max-e.min,l=r*(t-1),m=e.isHorizontal()?o.x:o.y,s=(e.getValueForPixel(m)-e.min)/r,u=1-s,c=l*s,d=l*u;e.options.ticks.min=i(n,e.min+c),e.options.ticks.max=a(n,e.max-d)}function s(e,t,o,n){var a=D[e.options.type];a&&a(e,t,o,n)}function u(e,t,o,a){var i=e.chartArea;o||(o={x:(i.left+i.right)/2,y:(i.top+i.bottom)/2});var r=e.options.zoom;if(r&&z.getValueOrDefault(r.enabled,M.zoom.enabled)){var l=z.getValueOrDefault(e.options.zoom.mode,M.zoom.mode);r.sensitivity=z.getValueOrDefault(e.options.zoom.sensitivity,M.zoom.sensitivity);var m;m="xy"==l&&void 0!==a?a:"xy",z.each(e.scales,function(e,a){e.isHorizontal()&&n(l,"x")&&n(m,"x")?(r.scaleAxes="x",s(e,t,o,r)):!e.isHorizontal()&&n(l,"y")&&n(m,"y")&&(r.scaleAxes="y",s(e,t,o,r))}),e.update(0)}}function c(e,t,o){var n,r=e.chart.data.labels,l=r.length-1,m=Math.max(e.ticks.length-(e.options.gridLines.offsetGridLines?0:1),1),s=o.speed,u=e.minIndex,c=Math.round(e.width/(m*s));y.panCumulativeDelta+=t,u=y.panCumulativeDelta>c?Math.max(0,u-1):y.panCumulativeDelta<-c?Math.min(l-m+1,u+1):u,y.panCumulativeDelta=u!==e.minIndex?0:y.panCumulativeDelta,n=Math.min(l,u+m-1),e.options.ticks.min=i(o,r[u]),e.options.ticks.max=a(o,r[n])}function d(e,t,o){var n=e.options,r=a(o,e.getValueForPixel(e.getPixelForValue(e.max)-t)),l=i(o,e.getValueForPixel(e.getPixelForValue(e.min)-t)),m=t<0?r-e.max:l-e.min;n.time.max=e.max+m,n.time.min=e.min+m}function p(e,t,o){var n=e.options.ticks,r=e.start,l=e.end;n.reverse?(n.max=e.getValueForPixel(e.getPixelForValue(r)-t),n.min=e.getValueForPixel(e.getPixelForValue(l)-t)):(n.min=e.getValueForPixel(e.getPixelForValue(r)-t),n.max=e.getValueForPixel(e.getPixelForValue(l)-t)),n.min=i(o,n.min),n.max=a(o,n.max)}function f(e,t,o){var n=F[e.options.type];n&&n(e,t,o)}function v(e,t,o){var a=e.options.pan;if(a&&z.getValueOrDefault(a.enabled,M.pan.enabled)){var i=z.getValueOrDefault(e.options.pan.mode,M.pan.mode);a.speed=z.getValueOrDefault(e.options.pan.speed,M.pan.speed),z.each(e.scales,function(e,r){e.isHorizontal()&&n(i,"x")&&0!==t?(a.scaleAxes="x",f(e,t,a)):!e.isHorizontal()&&n(i,"y")&&0!==o&&(a.scaleAxes="y",f(e,o,a))}),e.update(0)}}function x(e){var t=e.scales;for(var o in t){var n=t[o];if(!n.isHorizontal())return n}}var g=e("hammerjs");g="function"==typeof g?g:window.Hammer;var h=e("chart.js");h="function"==type