chartjs-plugin-dragdata
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
!function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(t,n){t.exports=Chart},function(t,n,e){"use strict";e.r(n);var r=e(0),i=e.n(r),o={value:function(){}};function a(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new u(r)}function u(t){this._=t}function c(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function s(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function l(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=o,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}u.prototype=a.prototype={constructor:u,on:function(t,n){var e,r=this._,i=c(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=l(r[e],t.name,n);else if(null==n)for(e in r)r[e]=l(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=s(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new u(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var f=a,h="http://www.w3.org/1999/xhtml",p={svg:"http://www.w3.org/2000/svg",xhtml:h,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},d=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),p.hasOwnProperty(n)?{space:p[n],local:t}:t};var v=function(t){var n=d(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===h&&n.documentElement.namespaceURI===h?n.createElement(t):n.createElementNS(e,t)}})(n)};function g(){}var y=function(t){return null==t?g:function(){return this.querySelector(t)}};function _(){return[]}var m=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var w=document.documentElement;if(!w.matches){var x=w.webkitMatchesSelector||w.msMatchesSelector||w.mozMatchesSelector||w.oMatchesSelector;m=function(t){return function(){return x.call(this,t)}}}}var b=m,S=function(t){return new Array(t.length)};function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var E="$";function M(t,n,e,r,i,o){for(var a,u=0,c=n.length,s=o.length;u<s;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<c;++u)(a=n[u])&&(i[u]=a)}function P(t,n,e,r,i,o,a){var u,c,s,l={},f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(c=n[u])&&(p[u]=s=E+a.call(c,c.__data__,u,n),s in l?i[u]=c:l[s]=c);for(u=0;u<h;++u)(c=l[s=E+a.call(t,o[u],u,o)])?(r[u]=c,c.__data__=o[u],l[s]=null):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(c=n[u])&&l[p[u]]===c&&(i[u]=c)}function C(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function B(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function D(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function O(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}var k=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function j(t){return function(){this.style.removeProperty(t)}}function I(t,n,e){return function(){this.style.setProperty(t,n,e)}}function L(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||k(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function z(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Y(t){return t.trim().split(/^|\s+/)}function U(t){return t.classList||new F(t)}function F(t){this._node=t,this._names=Y(t.getAttribute("class")||"")}function H(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function $(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function K(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}F.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Q(){this.textContent=""}function W(t){return function(){this.textContent=t}}function Z(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function ct(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var st={},lt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(st={mouseenter:"mouseover",mouseleave:"mouseout"}));function ft(t,n,e){return t=ht(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function ht(t,n,e){return function(r){var i=lt;lt=r;try{t.call(this,this.__data__,n,e)}finally{lt=i}}}function pt(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function dt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function vt(t,n,e){var r=st.hasOwnProperty(t.type)?ft:ht;return function(i,o,a){var u,c=this.__on,s=r(n,o,a);if(c)for(var l=0,f=c.length;l<f;++l)if((u=c[l]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=s,u.capture=e),void(u.value=n);this.addEventListener(t.type,s,e),u={type:t.type,name:t.name,value:n,listener:s,capture:e},c?c.push(u):this.__on=[u]}}function gt(t,n,e,r){var i=lt;t.sourceEvent=lt,lt=t;try{return n.apply(e,r)}finally{lt=i}}function yt(t,n,e){var r=k(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}var _t=[null];function mt(t,n){this._groups=t,this._parents=n}function wt(){return new mt([[document.documentElement]],_t)}mt.prototype=wt.prototype={constructor:mt,select:function(t){"function"!=typeof t&&(t=y(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],c=u.length,s=r[i]=new Array(c),l=0;l<c;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),s[l]=a);return new mt(r,this._parents)},selectAll:function(t){var n;"function"!=typeof t&&(t=null==(n=t)?_:function(){return this.querySelectorAll(n)});for(var e=this._groups,r=e.length,i=[],o=[],a=0;a<r;++a)for(var u,c=e[a],s=c.length,l=0;l<s;++l)(u=c[l])&&(i.push(t.call(u,u.__data__,l,c)),o.push(u));return new mt(i,o)},filter:function(t){"function"!=typeof t&&(t=b(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,c=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&c.push(o);return new mt(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),l=-1,this.each(function(t){d[++l]=t}),d;var e,r=n?P:M,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),c=new Array(a),s=new Array(a),l=0;l<a;++l){var f=i[l],h=o[l],p=h.length,d=t.call(f,f&&f.__data__,l,i),v=d.length,g=c[l]=new Array(v),y=u[l]=new Array(v);r(f,h,g,y,s[l]=new Array(p),d,n);for(var _,m,w=0,x=0;w<v;++w)if(_=g[w]){for(w>=x&&(x=w+1);!(m=y[x])&&++x<v;);_._next=m||null}}return(u=new mt(u,i))._enter=c,u._exit=s,u},enter:function(){return new mt(this._enter||this._groups.map(S),this._parents)},exit:function(){return new mt(this._exit||this._groups.map(S),this._parents)},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var c,s=n[u],l=e[u],f=s.length,h=a[u]=new Array(f),p=0;p<f;++p)(c=s[p]||l[p])&&(h[p]=c);for(;u<r;++u)a[u]=n[u];return new mt(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=C);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],c=u.length,s=i[o]=new Array(c),l=0;l<c;++l)(a=u[l])&&(s[l]=a);s.sort(n)}return new mt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=d(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?B:N:"function"==typeof n?e.local?R:O:e.local?D:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?L:I)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?z:q)(t,n)):this.node()[t]},classed:function(t,n){var e=Y(t+"");if(arguments.length<2){for(var r=U(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?K:n?$:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?Z:W)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:v(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:v(t),r=null==n?ot:"function"==typeof n?n:y(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(at)},clone:function(t){return this.select(t?ct:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=pt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?vt:dt,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var c,s=0,l=u.length;s<l;++s)for(r=0,c=u[s];r<a;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return yt(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return yt(this,t,n)}})(t,n))}};var xt=function(t){return"string"==typeof t?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],_t)},bt=0;function St(){this._="@"+(++bt).toString(36)}St.prototype=function(){return new St}.prototype={constructor:St,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var At=function(){for(var t,n=lt;t=n.sourceEvent;)n=t;return n},Et=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},Mt=function(t){var n=At();return n.changedTouches&&(n=n.changedTouches[0]),Et(t,n)},Pt=function(t,n,e){arguments.length<3&&(e=n,n=At().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Et(t,r);return null};function Ct(){lt.stopImmediatePropagation()}var Nt=function(){lt.preventDefault(),lt.stopImmediatePropagation()},Bt=function(t){var n=t.document.documentElement,e=xt(t).on("dragstart.drag",Nt,!0);"onselectstart"in n?e.on("selectstart.drag",Nt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};var Tt=function(t){return function(){return t}};function Dt(t,n,e,r,i,o,a,u,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=c,this._=s}function Ot(){return!lt.button}function Rt(){return this.parentNode}function kt(t){return null==t?{x:lt.x,y:lt.y}:t}function jt(){return"ontouchstart"in this}Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var It,Lt,Vt,Xt,qt,zt,Yt=function(){var t,n,e,r,i=Ot,o=Rt,a=kt,u=jt,c={},s=f("start","drag","end"),l=0,h=0;function p(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var a=w("mouse",o.apply(this,arguments),Mt,this,arguments);a&&(xt(lt.view).on("mousemove.drag",v,!0).on("mouseup.drag",g,!0),Bt(lt.view),Ct(),e=!1,t=lt.clientX,n=lt.clientY,a("start"))}}function v(){if(Nt(),!e){var r=lt.clientX-t,i=lt.clientY-n;e=r*r+i*i>h}c.mouse("drag")}function g(){var t,n,r,i;xt(lt.view).on("mousemove.drag mouseup.drag",null),t=lt.view,n=e,r=t.document.documentElement,i=xt(t).on("dragstart.drag",null),n&&(i.on("click.drag",Nt,!0),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect),Nt(),c.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=lt.changedTouches,r=o.apply(this,arguments),a=e.length;for(t=0;t<a;++t)(n=w(e[t].identifier,r,Pt,this,arguments))&&(Ct(),n("start"))}}function _(){var t,n,e=lt.changedTouches,r=e.length;for(t=0;t<r;++t)(n=c[e[t].identifier])&&(Nt(),n("drag"))}function m(){var t,n,e=lt.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=c[e[t].identifier])&&(Ct(),n("end"))}function w(t,n,e,r,i){var o,u,f,h=e(n,t),d=s.copy();if(gt(new Dt(p,"beforestart",o,t,l,h[0],h[1],0,0,d),function(){return null!=(lt.subject=o=a.apply(r,i))&&(u=o.x-h[0]||0,f=o.y-h[1]||0,!0)}))return function a(s){var v,g=h;switch(s){case"start":c[t]=a,v=l++;break;case"end":delete c[t],--l;case"drag":h=e(n,t),v=l}gt(new Dt(p,s,o,t,v,h[0]+u,h[1]+f,h[0]-g[0],h[1]-g[1],d),d.apply,d,[s,r,i])}}return p.filter=function(t){return arguments.length?(i="function"==typeof t?t:Tt(!!t),p):i},p.container=function(t){return arguments.length?(o="function"==typeof t?t:Tt(t),p):o},p.subject=function(t){return arguments.length?(a="function"==typeof t?t:Tt(t),p):a},p.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Tt(!!t),p):u},p.on=function(){var t=s.on.apply(s,arguments);return t===s?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p};function Ut(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ft(t,n,e,r,i){var o,a;return t.touches?(o=n.scales[Vt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Vt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ut(o,n.options.dragDataRound),a=Ut(a,n.options.dragDataRound),o=(o=o>n.scales[Vt].max?n.scales[Vt].max:o)<n.scales[Vt].min?n.scales[Vt].min:o,a=(a=a>n.scales[Lt].max?n.scales[Lt].max:a)<n.scales[Lt].min?n.scales[Lt].min:a,n.data.datasets[e].data[r].x&&n.options.dragX&&(i.x=o),n.data.datasets[e].data[r].y?(i.y=a,i):"horizontalBar"===Xt?o:a}function Ht(t,n){return function(){if(It&<){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];if("radar"===Xt)o=function(t,n){var e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);var o=n.scales[Lt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=(i=(i=Ut(i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,n.options.dragDataRound))>n.scale.max?n.scale.max:i)<n.scale.min?n.scale.min:i}(e,t);else if(qt){o=Ft(e,t,r,i,o)-zt}else o=Ft(e,t,r,i,o);"function"==typeof n?!1!==n(e,r,i,o)&&(t.data.datasets[r].data[i]=o,t.update(0)):(t.data.datasets[r].data[i]=o,t.update(0))}}}var Gt={id:"dragdata",afterInit:function(t){t.options.dragData&&xt(t.chart.canvas).call(Yt().container(t.chart.canvas).on("start",function(t,n){return function(){if(lt){var e=lt.sourceEvent;It=t.getElementAtEvent(e)[0];var r="radar"===(Xt=t.config.type)?"_scale":"_yScale";if(It){if(!1===t.data.datasets[It._datasetIndex].dragData||!1===It[r].options.dragData)return void(It=null);if(Lt=It[r].id,It._xScale&&(Vt=It._xScale.id),"bar"===Xt||"horizontalBar"===Xt){qt=t.config.options.scales.xAxes[0].stacked;var i=It._datasetIndex,o=It._index,a=Ft(e,t,i,o,void 0),u=t.data.datasets[i].data[o];zt=a-u}"function"==typeof n&&It&&!1===n(e,It)&&(It=null)}}}}(t,t.options.onDragStart)).on("drag",Ht(t,t.options.onDrag)).on("end",function(t,n){return function(){if("function"==typeof n&&It){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];return n(e,r,i,o)}}}(t,t.options.onDragEnd)))}};i.a.pluginService.register(Gt);n.default=Gt}]); | ||
!function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(t,n){t.exports=Chart},function(t,n,e){"use strict";e.r(n);var r=e(0),i=e.n(r),o={value:function(){}};function a(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new u(r)}function u(t){this._=t}function c(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function s(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function l(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=o,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}u.prototype=a.prototype={constructor:u,on:function(t,n){var e,r=this._,i=c(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=l(r[e],t.name,n);else if(null==n)for(e in r)r[e]=l(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=s(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new u(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var f=a,h="http://www.w3.org/1999/xhtml",p={svg:"http://www.w3.org/2000/svg",xhtml:h,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},d=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),p.hasOwnProperty(n)?{space:p[n],local:t}:t};var v=function(t){var n=d(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===h&&n.documentElement.namespaceURI===h?n.createElement(t):n.createElementNS(e,t)}})(n)};function g(){}var y=function(t){return null==t?g:function(){return this.querySelector(t)}};function _(){return[]}var m=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var w=document.documentElement;if(!w.matches){var x=w.webkitMatchesSelector||w.msMatchesSelector||w.mozMatchesSelector||w.oMatchesSelector;m=function(t){return function(){return x.call(this,t)}}}}var b=m,S=function(t){return new Array(t.length)};function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var E="$";function M(t,n,e,r,i,o){for(var a,u=0,c=n.length,s=o.length;u<s;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<c;++u)(a=n[u])&&(i[u]=a)}function P(t,n,e,r,i,o,a){var u,c,s,l={},f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(c=n[u])&&(p[u]=s=E+a.call(c,c.__data__,u,n),s in l?i[u]=c:l[s]=c);for(u=0;u<h;++u)(c=l[s=E+a.call(t,o[u],u,o)])?(r[u]=c,c.__data__=o[u],l[s]=null):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(c=n[u])&&l[p[u]]===c&&(i[u]=c)}function C(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function B(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function D(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function O(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}var k=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function j(t){return function(){this.style.removeProperty(t)}}function I(t,n,e){return function(){this.style.setProperty(t,n,e)}}function L(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||k(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function z(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Y(t){return t.trim().split(/^|\s+/)}function U(t){return t.classList||new F(t)}function F(t){this._node=t,this._names=Y(t.getAttribute("class")||"")}function H(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function $(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function K(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}F.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Q(){this.textContent=""}function W(t){return function(){this.textContent=t}}function Z(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function ct(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var st={},lt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(st={mouseenter:"mouseover",mouseleave:"mouseout"}));function ft(t,n,e){return t=ht(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function ht(t,n,e){return function(r){var i=lt;lt=r;try{t.call(this,this.__data__,n,e)}finally{lt=i}}}function pt(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function dt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function vt(t,n,e){var r=st.hasOwnProperty(t.type)?ft:ht;return function(i,o,a){var u,c=this.__on,s=r(n,o,a);if(c)for(var l=0,f=c.length;l<f;++l)if((u=c[l]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=s,u.capture=e),void(u.value=n);this.addEventListener(t.type,s,e),u={type:t.type,name:t.name,value:n,listener:s,capture:e},c?c.push(u):this.__on=[u]}}function gt(t,n,e,r){var i=lt;t.sourceEvent=lt,lt=t;try{return n.apply(e,r)}finally{lt=i}}function yt(t,n,e){var r=k(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}var _t=[null];function mt(t,n){this._groups=t,this._parents=n}function wt(){return new mt([[document.documentElement]],_t)}mt.prototype=wt.prototype={constructor:mt,select:function(t){"function"!=typeof t&&(t=y(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],c=u.length,s=r[i]=new Array(c),l=0;l<c;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),s[l]=a);return new mt(r,this._parents)},selectAll:function(t){var n;"function"!=typeof t&&(t=null==(n=t)?_:function(){return this.querySelectorAll(n)});for(var e=this._groups,r=e.length,i=[],o=[],a=0;a<r;++a)for(var u,c=e[a],s=c.length,l=0;l<s;++l)(u=c[l])&&(i.push(t.call(u,u.__data__,l,c)),o.push(u));return new mt(i,o)},filter:function(t){"function"!=typeof t&&(t=b(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,c=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&c.push(o);return new mt(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),l=-1,this.each(function(t){d[++l]=t}),d;var e,r=n?P:M,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),c=new Array(a),s=new Array(a),l=0;l<a;++l){var f=i[l],h=o[l],p=h.length,d=t.call(f,f&&f.__data__,l,i),v=d.length,g=c[l]=new Array(v),y=u[l]=new Array(v);r(f,h,g,y,s[l]=new Array(p),d,n);for(var _,m,w=0,x=0;w<v;++w)if(_=g[w]){for(w>=x&&(x=w+1);!(m=y[x])&&++x<v;);_._next=m||null}}return(u=new mt(u,i))._enter=c,u._exit=s,u},enter:function(){return new mt(this._enter||this._groups.map(S),this._parents)},exit:function(){return new mt(this._exit||this._groups.map(S),this._parents)},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var c,s=n[u],l=e[u],f=s.length,h=a[u]=new Array(f),p=0;p<f;++p)(c=s[p]||l[p])&&(h[p]=c);for(;u<r;++u)a[u]=n[u];return new mt(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=C);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],c=u.length,s=i[o]=new Array(c),l=0;l<c;++l)(a=u[l])&&(s[l]=a);s.sort(n)}return new mt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=d(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?B:N:"function"==typeof n?e.local?R:O:e.local?D:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?L:I)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?z:q)(t,n)):this.node()[t]},classed:function(t,n){var e=Y(t+"");if(arguments.length<2){for(var r=U(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?K:n?$:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?Z:W)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:v(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:v(t),r=null==n?ot:"function"==typeof n?n:y(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(at)},clone:function(t){return this.select(t?ct:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=pt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?vt:dt,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var c,s=0,l=u.length;s<l;++s)for(r=0,c=u[s];r<a;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return yt(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return yt(this,t,n)}})(t,n))}};var xt=function(t){return"string"==typeof t?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],_t)},bt=0;function St(){this._="@"+(++bt).toString(36)}St.prototype=function(){return new St}.prototype={constructor:St,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var At=function(){for(var t,n=lt;t=n.sourceEvent;)n=t;return n},Et=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},Mt=function(t){var n=At();return n.changedTouches&&(n=n.changedTouches[0]),Et(t,n)},Pt=function(t,n,e){arguments.length<3&&(e=n,n=At().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Et(t,r);return null};function Ct(){lt.stopImmediatePropagation()}var Nt=function(){lt.preventDefault(),lt.stopImmediatePropagation()},Bt=function(t){var n=t.document.documentElement,e=xt(t).on("dragstart.drag",Nt,!0);"onselectstart"in n?e.on("selectstart.drag",Nt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};var Tt=function(t){return function(){return t}};function Dt(t,n,e,r,i,o,a,u,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=c,this._=s}function Ot(){return!lt.button}function Rt(){return this.parentNode}function kt(t){return null==t?{x:lt.x,y:lt.y}:t}function jt(){return"ontouchstart"in this}Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var It,Lt,Vt,Xt,qt,zt,Yt=function(){var t,n,e,r,i=Ot,o=Rt,a=kt,u=jt,c={},s=f("start","drag","end"),l=0,h=0;function p(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var a=w("mouse",o.apply(this,arguments),Mt,this,arguments);a&&(xt(lt.view).on("mousemove.drag",v,!0).on("mouseup.drag",g,!0),Bt(lt.view),Ct(),e=!1,t=lt.clientX,n=lt.clientY,a("start"))}}function v(){if(Nt(),!e){var r=lt.clientX-t,i=lt.clientY-n;e=r*r+i*i>h}c.mouse("drag")}function g(){var t,n,r,i;xt(lt.view).on("mousemove.drag mouseup.drag",null),t=lt.view,n=e,r=t.document.documentElement,i=xt(t).on("dragstart.drag",null),n&&(i.on("click.drag",Nt,!0),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect),Nt(),c.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=lt.changedTouches,r=o.apply(this,arguments),a=e.length;for(t=0;t<a;++t)(n=w(e[t].identifier,r,Pt,this,arguments))&&(Ct(),n("start"))}}function _(){var t,n,e=lt.changedTouches,r=e.length;for(t=0;t<r;++t)(n=c[e[t].identifier])&&(Nt(),n("drag"))}function m(){var t,n,e=lt.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=c[e[t].identifier])&&(Ct(),n("end"))}function w(t,n,e,r,i){var o,u,f,h=e(n,t),d=s.copy();if(gt(new Dt(p,"beforestart",o,t,l,h[0],h[1],0,0,d),function(){return null!=(lt.subject=o=a.apply(r,i))&&(u=o.x-h[0]||0,f=o.y-h[1]||0,!0)}))return function a(s){var v,g=h;switch(s){case"start":c[t]=a,v=l++;break;case"end":delete c[t],--l;case"drag":h=e(n,t),v=l}gt(new Dt(p,s,o,t,v,h[0]+u,h[1]+f,h[0]-g[0],h[1]-g[1],d),d.apply,d,[s,r,i])}}return p.filter=function(t){return arguments.length?(i="function"==typeof t?t:Tt(!!t),p):i},p.container=function(t){return arguments.length?(o="function"==typeof t?t:Tt(t),p):o},p.subject=function(t){return arguments.length?(a="function"==typeof t?t:Tt(t),p):a},p.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Tt(!!t),p):u},p.on=function(){var t=s.on.apply(s,arguments);return t===s?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p};function Ut(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ft(t,n,e,r,i){var o,a;return t.touches?(o=n.scales[Vt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Vt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ut(o,n.options.dragDataRound),a=Ut(a,n.options.dragDataRound),o=(o=o>n.scales[Vt].max?n.scales[Vt].max:o)<n.scales[Vt].min?n.scales[Vt].min:o,a=(a=a>n.scales[Lt].max?n.scales[Lt].max:a)<n.scales[Lt].min?n.scales[Lt].min:a,n.data.datasets[e].data[r].x&&n.options.dragX&&(i.x=o),n.data.datasets[e].data[r].y?(i.y=a,i):"horizontalBar"===Xt?o:a}function Ht(t,n){return function(){if(It&<){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];if("radar"===Xt)o=function(t,n){var e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);var o=n.scales[Lt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=(i=(i=Ut(i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,n.options.dragDataRound))>n.scale.max?n.scale.max:i)<n.scale.min?n.scale.min:i}(e,t);else if(qt){o=Ft(e,t,r,i,o)-zt}else o=Ft(e,t,r,i,o);"function"==typeof n?!1!==n(e,r,i,o)&&(t.data.datasets[r].data[i]=o,t.update(0)):(t.data.datasets[r].data[i]=o,t.update(0))}}}var Gt={id:"dragdata",afterInit:function(t){t.options.dragData&&xt(t.chart.canvas).call(Yt().container(t.chart.canvas).on("start",function(t,n){return function(){if(lt){var e=lt.sourceEvent;It=t.getElementAtEvent(e)[0];var r="radar"===(Xt=t.config.type)?"_scale":"_yScale";if(It){if(!1===t.data.datasets[It._datasetIndex].dragData||!1===It[r].options.dragData)return void(It=null);if(Lt=It[r].id,It._xScale&&(Vt=It._xScale.id),"bar"===Xt||"horizontalBar"===Xt){qt=t.config.options.scales.xAxes[0].stacked;var i=It._datasetIndex,o=It._index,a=Ft(e,t,i,o,{}),u=t.data.datasets[i].data[o];zt=a-u}"function"==typeof n&&It&&!1===n(e,It)&&(It=null)}}}}(t,t.options.onDragStart)).on("drag",Ht(t,t.options.onDrag)).on("end",function(t,n){return function(){if("function"==typeof n&&It){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];return n(e,r,i,o)}}}(t,t.options.onDragEnd)))}};i.a.pluginService.register(Gt);n.default=Gt}]); |
@@ -1,1 +0,1 @@ | ||
!function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(t,n){t.exports=Chart},function(t,n,e){"use strict";e.r(n);var r=e(0),i=e.n(r),o={value:function(){}};function a(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new u(r)}function u(t){this._=t}function c(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function s(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function l(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=o,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}u.prototype=a.prototype={constructor:u,on:function(t,n){var e,r=this._,i=c(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=l(r[e],t.name,n);else if(null==n)for(e in r)r[e]=l(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=s(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new u(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var f=a,h="http://www.w3.org/1999/xhtml",p={svg:"http://www.w3.org/2000/svg",xhtml:h,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},d=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),p.hasOwnProperty(n)?{space:p[n],local:t}:t};var v=function(t){var n=d(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===h&&n.documentElement.namespaceURI===h?n.createElement(t):n.createElementNS(e,t)}})(n)};function g(){}var y=function(t){return null==t?g:function(){return this.querySelector(t)}};function _(){return[]}var m=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var w=document.documentElement;if(!w.matches){var x=w.webkitMatchesSelector||w.msMatchesSelector||w.mozMatchesSelector||w.oMatchesSelector;m=function(t){return function(){return x.call(this,t)}}}}var b=m,S=function(t){return new Array(t.length)};function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var E="$";function M(t,n,e,r,i,o){for(var a,u=0,c=n.length,s=o.length;u<s;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<c;++u)(a=n[u])&&(i[u]=a)}function P(t,n,e,r,i,o,a){var u,c,s,l={},f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(c=n[u])&&(p[u]=s=E+a.call(c,c.__data__,u,n),s in l?i[u]=c:l[s]=c);for(u=0;u<h;++u)(c=l[s=E+a.call(t,o[u],u,o)])?(r[u]=c,c.__data__=o[u],l[s]=null):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(c=n[u])&&l[p[u]]===c&&(i[u]=c)}function C(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function B(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function D(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function O(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}var k=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function j(t){return function(){this.style.removeProperty(t)}}function I(t,n,e){return function(){this.style.setProperty(t,n,e)}}function L(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||k(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function z(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Y(t){return t.trim().split(/^|\s+/)}function U(t){return t.classList||new F(t)}function F(t){this._node=t,this._names=Y(t.getAttribute("class")||"")}function H(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function $(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function K(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}F.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Q(){this.textContent=""}function W(t){return function(){this.textContent=t}}function Z(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function ct(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var st={},lt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(st={mouseenter:"mouseover",mouseleave:"mouseout"}));function ft(t,n,e){return t=ht(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function ht(t,n,e){return function(r){var i=lt;lt=r;try{t.call(this,this.__data__,n,e)}finally{lt=i}}}function pt(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function dt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function vt(t,n,e){var r=st.hasOwnProperty(t.type)?ft:ht;return function(i,o,a){var u,c=this.__on,s=r(n,o,a);if(c)for(var l=0,f=c.length;l<f;++l)if((u=c[l]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=s,u.capture=e),void(u.value=n);this.addEventListener(t.type,s,e),u={type:t.type,name:t.name,value:n,listener:s,capture:e},c?c.push(u):this.__on=[u]}}function gt(t,n,e,r){var i=lt;t.sourceEvent=lt,lt=t;try{return n.apply(e,r)}finally{lt=i}}function yt(t,n,e){var r=k(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}var _t=[null];function mt(t,n){this._groups=t,this._parents=n}function wt(){return new mt([[document.documentElement]],_t)}mt.prototype=wt.prototype={constructor:mt,select:function(t){"function"!=typeof t&&(t=y(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],c=u.length,s=r[i]=new Array(c),l=0;l<c;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),s[l]=a);return new mt(r,this._parents)},selectAll:function(t){var n;"function"!=typeof t&&(t=null==(n=t)?_:function(){return this.querySelectorAll(n)});for(var e=this._groups,r=e.length,i=[],o=[],a=0;a<r;++a)for(var u,c=e[a],s=c.length,l=0;l<s;++l)(u=c[l])&&(i.push(t.call(u,u.__data__,l,c)),o.push(u));return new mt(i,o)},filter:function(t){"function"!=typeof t&&(t=b(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,c=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&c.push(o);return new mt(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),l=-1,this.each(function(t){d[++l]=t}),d;var e,r=n?P:M,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),c=new Array(a),s=new Array(a),l=0;l<a;++l){var f=i[l],h=o[l],p=h.length,d=t.call(f,f&&f.__data__,l,i),v=d.length,g=c[l]=new Array(v),y=u[l]=new Array(v);r(f,h,g,y,s[l]=new Array(p),d,n);for(var _,m,w=0,x=0;w<v;++w)if(_=g[w]){for(w>=x&&(x=w+1);!(m=y[x])&&++x<v;);_._next=m||null}}return(u=new mt(u,i))._enter=c,u._exit=s,u},enter:function(){return new mt(this._enter||this._groups.map(S),this._parents)},exit:function(){return new mt(this._exit||this._groups.map(S),this._parents)},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var c,s=n[u],l=e[u],f=s.length,h=a[u]=new Array(f),p=0;p<f;++p)(c=s[p]||l[p])&&(h[p]=c);for(;u<r;++u)a[u]=n[u];return new mt(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=C);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],c=u.length,s=i[o]=new Array(c),l=0;l<c;++l)(a=u[l])&&(s[l]=a);s.sort(n)}return new mt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=d(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?B:N:"function"==typeof n?e.local?R:O:e.local?D:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?L:I)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?z:q)(t,n)):this.node()[t]},classed:function(t,n){var e=Y(t+"");if(arguments.length<2){for(var r=U(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?K:n?$:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?Z:W)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:v(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:v(t),r=null==n?ot:"function"==typeof n?n:y(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(at)},clone:function(t){return this.select(t?ct:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=pt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?vt:dt,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var c,s=0,l=u.length;s<l;++s)for(r=0,c=u[s];r<a;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return yt(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return yt(this,t,n)}})(t,n))}};var xt=function(t){return"string"==typeof t?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],_t)},bt=0;function St(){this._="@"+(++bt).toString(36)}St.prototype=function(){return new St}.prototype={constructor:St,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var At=function(){for(var t,n=lt;t=n.sourceEvent;)n=t;return n},Et=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},Mt=function(t){var n=At();return n.changedTouches&&(n=n.changedTouches[0]),Et(t,n)},Pt=function(t,n,e){arguments.length<3&&(e=n,n=At().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Et(t,r);return null};function Ct(){lt.stopImmediatePropagation()}var Nt=function(){lt.preventDefault(),lt.stopImmediatePropagation()},Bt=function(t){var n=t.document.documentElement,e=xt(t).on("dragstart.drag",Nt,!0);"onselectstart"in n?e.on("selectstart.drag",Nt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};var Tt=function(t){return function(){return t}};function Dt(t,n,e,r,i,o,a,u,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=c,this._=s}function Ot(){return!lt.button}function Rt(){return this.parentNode}function kt(t){return null==t?{x:lt.x,y:lt.y}:t}function jt(){return"ontouchstart"in this}Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var It,Lt,Vt,Xt,qt,zt,Yt=function(){var t,n,e,r,i=Ot,o=Rt,a=kt,u=jt,c={},s=f("start","drag","end"),l=0,h=0;function p(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var a=w("mouse",o.apply(this,arguments),Mt,this,arguments);a&&(xt(lt.view).on("mousemove.drag",v,!0).on("mouseup.drag",g,!0),Bt(lt.view),Ct(),e=!1,t=lt.clientX,n=lt.clientY,a("start"))}}function v(){if(Nt(),!e){var r=lt.clientX-t,i=lt.clientY-n;e=r*r+i*i>h}c.mouse("drag")}function g(){var t,n,r,i;xt(lt.view).on("mousemove.drag mouseup.drag",null),t=lt.view,n=e,r=t.document.documentElement,i=xt(t).on("dragstart.drag",null),n&&(i.on("click.drag",Nt,!0),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect),Nt(),c.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=lt.changedTouches,r=o.apply(this,arguments),a=e.length;for(t=0;t<a;++t)(n=w(e[t].identifier,r,Pt,this,arguments))&&(Ct(),n("start"))}}function _(){var t,n,e=lt.changedTouches,r=e.length;for(t=0;t<r;++t)(n=c[e[t].identifier])&&(Nt(),n("drag"))}function m(){var t,n,e=lt.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=c[e[t].identifier])&&(Ct(),n("end"))}function w(t,n,e,r,i){var o,u,f,h=e(n,t),d=s.copy();if(gt(new Dt(p,"beforestart",o,t,l,h[0],h[1],0,0,d),function(){return null!=(lt.subject=o=a.apply(r,i))&&(u=o.x-h[0]||0,f=o.y-h[1]||0,!0)}))return function a(s){var v,g=h;switch(s){case"start":c[t]=a,v=l++;break;case"end":delete c[t],--l;case"drag":h=e(n,t),v=l}gt(new Dt(p,s,o,t,v,h[0]+u,h[1]+f,h[0]-g[0],h[1]-g[1],d),d.apply,d,[s,r,i])}}return p.filter=function(t){return arguments.length?(i="function"==typeof t?t:Tt(!!t),p):i},p.container=function(t){return arguments.length?(o="function"==typeof t?t:Tt(t),p):o},p.subject=function(t){return arguments.length?(a="function"==typeof t?t:Tt(t),p):a},p.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Tt(!!t),p):u},p.on=function(){var t=s.on.apply(s,arguments);return t===s?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p};function Ut(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ft(t,n,e,r,i){var o,a;return t.touches?(o=n.scales[Vt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Vt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ut(o,n.options.dragDataRound),a=Ut(a,n.options.dragDataRound),o=(o=o>n.scales[Vt].max?n.scales[Vt].max:o)<n.scales[Vt].min?n.scales[Vt].min:o,a=(a=a>n.scales[Lt].max?n.scales[Lt].max:a)<n.scales[Lt].min?n.scales[Lt].min:a,n.data.datasets[e].data[r].x&&n.options.dragX&&(i.x=o),n.data.datasets[e].data[r].y?(i.y=a,i):"horizontalBar"===Xt?o:a}function Ht(t,n){return function(){if(It&<){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];if("radar"===Xt)o=function(t,n){var e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);var o=n.scales[Lt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=(i=(i=Ut(i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,n.options.dragDataRound))>n.scale.max?n.scale.max:i)<n.scale.min?n.scale.min:i}(e,t);else if(qt){o=Ft(e,t,r,i,o)-zt}else o=Ft(e,t,r,i,o);"function"==typeof n?!1!==n(e,r,i,o)&&(t.data.datasets[r].data[i]=o,t.update(0)):(t.data.datasets[r].data[i]=o,t.update(0))}}}var Gt={id:"dragdata",afterInit:function(t){t.options.dragData&&xt(t.chart.canvas).call(Yt().container(t.chart.canvas).on("start",function(t,n){return function(){if(lt){var e=lt.sourceEvent;It=t.getElementAtEvent(e)[0];var r="radar"===(Xt=t.config.type)?"_scale":"_yScale";if(It){if(!1===t.data.datasets[It._datasetIndex].dragData||!1===It[r].options.dragData)return void(It=null);if(Lt=It[r].id,It._xScale&&(Vt=It._xScale.id),"bar"===Xt||"horizontalBar"===Xt){qt=t.config.options.scales.xAxes[0].stacked;var i=It._datasetIndex,o=It._index,a=Ft(e,t,i,o,void 0),u=t.data.datasets[i].data[o];zt=a-u}"function"==typeof n&&It&&!1===n(e,It)&&(It=null)}}}}(t,t.options.onDragStart)).on("drag",Ht(t,t.options.onDrag)).on("end",function(t,n){return function(){if("function"==typeof n&&It){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];return n(e,r,i,o)}}}(t,t.options.onDragEnd)))}};i.a.pluginService.register(Gt);n.default=Gt}]); | ||
!function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(t,n){t.exports=Chart},function(t,n,e){"use strict";e.r(n);var r=e(0),i=e.n(r),o={value:function(){}};function a(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new u(r)}function u(t){this._=t}function c(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function s(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function l(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=o,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}u.prototype=a.prototype={constructor:u,on:function(t,n){var e,r=this._,i=c(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=l(r[e],t.name,n);else if(null==n)for(e in r)r[e]=l(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=s(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new u(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var f=a,h="http://www.w3.org/1999/xhtml",p={svg:"http://www.w3.org/2000/svg",xhtml:h,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},d=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),p.hasOwnProperty(n)?{space:p[n],local:t}:t};var v=function(t){var n=d(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===h&&n.documentElement.namespaceURI===h?n.createElement(t):n.createElementNS(e,t)}})(n)};function g(){}var y=function(t){return null==t?g:function(){return this.querySelector(t)}};function _(){return[]}var m=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var w=document.documentElement;if(!w.matches){var x=w.webkitMatchesSelector||w.msMatchesSelector||w.mozMatchesSelector||w.oMatchesSelector;m=function(t){return function(){return x.call(this,t)}}}}var b=m,S=function(t){return new Array(t.length)};function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var E="$";function M(t,n,e,r,i,o){for(var a,u=0,c=n.length,s=o.length;u<s;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<c;++u)(a=n[u])&&(i[u]=a)}function P(t,n,e,r,i,o,a){var u,c,s,l={},f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(c=n[u])&&(p[u]=s=E+a.call(c,c.__data__,u,n),s in l?i[u]=c:l[s]=c);for(u=0;u<h;++u)(c=l[s=E+a.call(t,o[u],u,o)])?(r[u]=c,c.__data__=o[u],l[s]=null):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(c=n[u])&&l[p[u]]===c&&(i[u]=c)}function C(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function B(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function D(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function O(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}var k=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function j(t){return function(){this.style.removeProperty(t)}}function I(t,n,e){return function(){this.style.setProperty(t,n,e)}}function L(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||k(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function z(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Y(t){return t.trim().split(/^|\s+/)}function U(t){return t.classList||new F(t)}function F(t){this._node=t,this._names=Y(t.getAttribute("class")||"")}function H(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=U(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function $(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function K(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}F.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Q(){this.textContent=""}function W(t){return function(){this.textContent=t}}function Z(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function ct(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var st={},lt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(st={mouseenter:"mouseover",mouseleave:"mouseout"}));function ft(t,n,e){return t=ht(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function ht(t,n,e){return function(r){var i=lt;lt=r;try{t.call(this,this.__data__,n,e)}finally{lt=i}}}function pt(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function dt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function vt(t,n,e){var r=st.hasOwnProperty(t.type)?ft:ht;return function(i,o,a){var u,c=this.__on,s=r(n,o,a);if(c)for(var l=0,f=c.length;l<f;++l)if((u=c[l]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=s,u.capture=e),void(u.value=n);this.addEventListener(t.type,s,e),u={type:t.type,name:t.name,value:n,listener:s,capture:e},c?c.push(u):this.__on=[u]}}function gt(t,n,e,r){var i=lt;t.sourceEvent=lt,lt=t;try{return n.apply(e,r)}finally{lt=i}}function yt(t,n,e){var r=k(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}var _t=[null];function mt(t,n){this._groups=t,this._parents=n}function wt(){return new mt([[document.documentElement]],_t)}mt.prototype=wt.prototype={constructor:mt,select:function(t){"function"!=typeof t&&(t=y(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],c=u.length,s=r[i]=new Array(c),l=0;l<c;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),s[l]=a);return new mt(r,this._parents)},selectAll:function(t){var n;"function"!=typeof t&&(t=null==(n=t)?_:function(){return this.querySelectorAll(n)});for(var e=this._groups,r=e.length,i=[],o=[],a=0;a<r;++a)for(var u,c=e[a],s=c.length,l=0;l<s;++l)(u=c[l])&&(i.push(t.call(u,u.__data__,l,c)),o.push(u));return new mt(i,o)},filter:function(t){"function"!=typeof t&&(t=b(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,c=r[i]=[],s=0;s<u;++s)(o=a[s])&&t.call(o,o.__data__,s,a)&&c.push(o);return new mt(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),l=-1,this.each(function(t){d[++l]=t}),d;var e,r=n?P:M,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),c=new Array(a),s=new Array(a),l=0;l<a;++l){var f=i[l],h=o[l],p=h.length,d=t.call(f,f&&f.__data__,l,i),v=d.length,g=c[l]=new Array(v),y=u[l]=new Array(v);r(f,h,g,y,s[l]=new Array(p),d,n);for(var _,m,w=0,x=0;w<v;++w)if(_=g[w]){for(w>=x&&(x=w+1);!(m=y[x])&&++x<v;);_._next=m||null}}return(u=new mt(u,i))._enter=c,u._exit=s,u},enter:function(){return new mt(this._enter||this._groups.map(S),this._parents)},exit:function(){return new mt(this._exit||this._groups.map(S),this._parents)},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var c,s=n[u],l=e[u],f=s.length,h=a[u]=new Array(f),p=0;p<f;++p)(c=s[p]||l[p])&&(h[p]=c);for(;u<r;++u)a[u]=n[u];return new mt(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=C);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],c=u.length,s=i[o]=new Array(c),l=0;l<c;++l)(a=u[l])&&(s[l]=a);s.sort(n)}return new mt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=d(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?B:N:"function"==typeof n?e.local?R:O:e.local?D:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?L:I)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?z:q)(t,n)):this.node()[t]},classed:function(t,n){var e=Y(t+"");if(arguments.length<2){for(var r=U(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?K:n?$:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?Z:W)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:v(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:v(t),r=null==n?ot:"function"==typeof n?n:y(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(at)},clone:function(t){return this.select(t?ct:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=pt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?vt:dt,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var c,s=0,l=u.length;s<l;++s)for(r=0,c=u[s];r<a;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return yt(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return yt(this,t,n)}})(t,n))}};var xt=function(t){return"string"==typeof t?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],_t)},bt=0;function St(){this._="@"+(++bt).toString(36)}St.prototype=function(){return new St}.prototype={constructor:St,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var At=function(){for(var t,n=lt;t=n.sourceEvent;)n=t;return n},Et=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},Mt=function(t){var n=At();return n.changedTouches&&(n=n.changedTouches[0]),Et(t,n)},Pt=function(t,n,e){arguments.length<3&&(e=n,n=At().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Et(t,r);return null};function Ct(){lt.stopImmediatePropagation()}var Nt=function(){lt.preventDefault(),lt.stopImmediatePropagation()},Bt=function(t){var n=t.document.documentElement,e=xt(t).on("dragstart.drag",Nt,!0);"onselectstart"in n?e.on("selectstart.drag",Nt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};var Tt=function(t){return function(){return t}};function Dt(t,n,e,r,i,o,a,u,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=c,this._=s}function Ot(){return!lt.button}function Rt(){return this.parentNode}function kt(t){return null==t?{x:lt.x,y:lt.y}:t}function jt(){return"ontouchstart"in this}Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var It,Lt,Vt,Xt,qt,zt,Yt=function(){var t,n,e,r,i=Ot,o=Rt,a=kt,u=jt,c={},s=f("start","drag","end"),l=0,h=0;function p(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var a=w("mouse",o.apply(this,arguments),Mt,this,arguments);a&&(xt(lt.view).on("mousemove.drag",v,!0).on("mouseup.drag",g,!0),Bt(lt.view),Ct(),e=!1,t=lt.clientX,n=lt.clientY,a("start"))}}function v(){if(Nt(),!e){var r=lt.clientX-t,i=lt.clientY-n;e=r*r+i*i>h}c.mouse("drag")}function g(){var t,n,r,i;xt(lt.view).on("mousemove.drag mouseup.drag",null),t=lt.view,n=e,r=t.document.documentElement,i=xt(t).on("dragstart.drag",null),n&&(i.on("click.drag",Nt,!0),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect),Nt(),c.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=lt.changedTouches,r=o.apply(this,arguments),a=e.length;for(t=0;t<a;++t)(n=w(e[t].identifier,r,Pt,this,arguments))&&(Ct(),n("start"))}}function _(){var t,n,e=lt.changedTouches,r=e.length;for(t=0;t<r;++t)(n=c[e[t].identifier])&&(Nt(),n("drag"))}function m(){var t,n,e=lt.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=c[e[t].identifier])&&(Ct(),n("end"))}function w(t,n,e,r,i){var o,u,f,h=e(n,t),d=s.copy();if(gt(new Dt(p,"beforestart",o,t,l,h[0],h[1],0,0,d),function(){return null!=(lt.subject=o=a.apply(r,i))&&(u=o.x-h[0]||0,f=o.y-h[1]||0,!0)}))return function a(s){var v,g=h;switch(s){case"start":c[t]=a,v=l++;break;case"end":delete c[t],--l;case"drag":h=e(n,t),v=l}gt(new Dt(p,s,o,t,v,h[0]+u,h[1]+f,h[0]-g[0],h[1]-g[1],d),d.apply,d,[s,r,i])}}return p.filter=function(t){return arguments.length?(i="function"==typeof t?t:Tt(!!t),p):i},p.container=function(t){return arguments.length?(o="function"==typeof t?t:Tt(t),p):o},p.subject=function(t){return arguments.length?(a="function"==typeof t?t:Tt(t),p):a},p.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Tt(!!t),p):u},p.on=function(){var t=s.on.apply(s,arguments);return t===s?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p};function Ut(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ft(t,n,e,r,i){var o,a;return t.touches?(o=n.scales[Vt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Vt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Lt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ut(o,n.options.dragDataRound),a=Ut(a,n.options.dragDataRound),o=(o=o>n.scales[Vt].max?n.scales[Vt].max:o)<n.scales[Vt].min?n.scales[Vt].min:o,a=(a=a>n.scales[Lt].max?n.scales[Lt].max:a)<n.scales[Lt].min?n.scales[Lt].min:a,n.data.datasets[e].data[r].x&&n.options.dragX&&(i.x=o),n.data.datasets[e].data[r].y?(i.y=a,i):"horizontalBar"===Xt?o:a}function Ht(t,n){return function(){if(It&<){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];if("radar"===Xt)o=function(t,n){var e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);var o=n.scales[Lt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=(i=(i=Ut(i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,n.options.dragDataRound))>n.scale.max?n.scale.max:i)<n.scale.min?n.scale.min:i}(e,t);else if(qt){o=Ft(e,t,r,i,o)-zt}else o=Ft(e,t,r,i,o);"function"==typeof n?!1!==n(e,r,i,o)&&(t.data.datasets[r].data[i]=o,t.update(0)):(t.data.datasets[r].data[i]=o,t.update(0))}}}var Gt={id:"dragdata",afterInit:function(t){t.options.dragData&&xt(t.chart.canvas).call(Yt().container(t.chart.canvas).on("start",function(t,n){return function(){if(lt){var e=lt.sourceEvent;It=t.getElementAtEvent(e)[0];var r="radar"===(Xt=t.config.type)?"_scale":"_yScale";if(It){if(!1===t.data.datasets[It._datasetIndex].dragData||!1===It[r].options.dragData)return void(It=null);if(Lt=It[r].id,It._xScale&&(Vt=It._xScale.id),"bar"===Xt||"horizontalBar"===Xt){qt=t.config.options.scales.xAxes[0].stacked;var i=It._datasetIndex,o=It._index,a=Ft(e,t,i,o,{}),u=t.data.datasets[i].data[o];zt=a-u}"function"==typeof n&&It&&!1===n(e,It)&&(It=null)}}}}(t,t.options.onDragStart)).on("drag",Ht(t,t.options.onDrag)).on("end",function(t,n){return function(){if("function"==typeof n&&It){var e=lt.sourceEvent,r=It._datasetIndex,i=It._index,o=t.data.datasets[r].data[i];return n(e,r,i,o)}}}(t,t.options.onDragEnd)))}};i.a.pluginService.register(Gt);n.default=Gt}]); |
{ | ||
"name": "chartjs-plugin-dragdata", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Draggable data points for Chart.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/chartjs-plugin-dragdata.js", |
@@ -23,3 +23,3 @@ # chartjs-plugin-dragdata.js | ||
``` | ||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-dragdata@1.0.0/dist/chartjs-plugin-dragdata.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-dragdata@1.0.1/dist/chartjs-plugin-dragdata.min.js"></script> | ||
``` | ||
@@ -26,0 +26,0 @@ |
@@ -27,3 +27,3 @@ import Chart from 'chart.js' | ||
stacked = chartInstance.config.options.scales.xAxes[0].stacked | ||
let data | ||
let data = {} | ||
let datasetIndex = element._datasetIndex | ||
@@ -30,0 +30,0 @@ let index = element._index |
Sorry, the diff of this file is too big to display
177048