Socket
Socket
Sign inDemoInstall

react-chartjs-2

Package Overview
Dependencies
Maintainers
2
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-chartjs-2 - npm Package Compare versions

Comparing version 2.7.6 to 2.8.0

2

dist/react-chartjs-2.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("chart.js")):"function"==typeof define&&define.amd?define(["exports","react","chart.js"],e):e(t.ReactChartjs2={},t.React,t.Chart)}(this,function(t,e,n){"use strict";function r(t,e){return e={exports:{}},t(e,e.exports),e.exports}function o(t){return function(){return t}}function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function i(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function c(t){var e=this.__data__=new E(t);this.size=e.size}function s(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new vt;++e<n;)this.add(t[e])}function f(t,e,n,r,o){return t===e||(null==t||null==e||!Zt(t)&&!Zt(e)?t!==t&&e!==e:He(t,e,n,r,f,o))}function p(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(yn);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(p.Cache||vt),n}function h(t){if("string"==typeof t)return t;if(Nt(t))return On(t,h)+"";if(pn(t))return Pn?Pn.call(t):"";var e=t+"";return"0"==e&&1/t==-wn?"-0":e}e=e&&e.hasOwnProperty("default")?e.default:e,n=n&&n.hasOwnProperty("default")?n.default:n;var l="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d=function(){};d.thatReturns=o,d.thatReturnsFalse=o(!1),d.thatReturnsTrue=o(!0),d.thatReturnsNull=o(null),d.thatReturnsThis=function(){return this},d.thatReturnsArgument=function(t){return t};var y=d,v=function(t){},b=function(t,e,n,r,o,a,i,u){if(v(e),!t){var c;if(void 0===e)c=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,a,i,u],f=0;(c=Error(e.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}},_="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",g=function(){function t(t,e,n,r,o,a){a!==_&&b(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=y,n.PropTypes=n,n},j=r(function(t){t.exports=g()}),m=function(t,e){return t===e||t!==t&&e!==e},O=function(t,e){for(var n=t.length;n--;)if(m(t[n][0],e))return n;return-1},w=Array.prototype.splice;a.prototype.clear=function(){this.__data__=[],this.size=0},a.prototype.delete=function(t){var e=this.__data__,n=O(e,t);return n>=0&&(n==e.length-1?e.pop():w.call(e,n,1),--this.size,!0)},a.prototype.get=function(t){var e=this.__data__,n=O(e,t);return 0>n?void 0:e[n][1]},a.prototype.has=function(t){return O(this.__data__,t)>-1},a.prototype.set=function(t,e){var n=this.__data__,r=O(n,t);return 0>r?(++this.size,n.push([t,e])):n[r][1]=e,this};var E=a,P="object"==typeof l&&l&&l.Object===Object&&l,A="object"==typeof self&&self&&self.Object===Object&&self,I=P||A||Function("return this")(),C=I.Symbol,D=Object.prototype,z=D.hasOwnProperty,k=D.toString,S=C?C.toStringTag:void 0,T=function(t){var e=z.call(t,S),n=t[S];try{t[S]=void 0;var r=!0}catch(t){}var o=k.call(t);return r&&(e?t[S]=n:delete t[S]),o},x=Object.prototype.toString,R=function(t){return x.call(t)},M="[object Null]",B="[object Undefined]",F=C?C.toStringTag:void 0,L=function(t){return null==t?void 0===t?B:M:F&&F in Object(t)?T(t):R(t)},U=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},K="[object AsyncFunction]",$="[object Function]",W="[object GeneratorFunction]",q="[object Proxy]",V=function(t){if(!U(t))return!1;var e=L(t);return e==$||e==W||e==K||e==q},N=I["__core-js_shared__"],H=function(){var t=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),G=function(t){return!!H&&H in t},Y=Function.prototype.toString,J=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Q=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,Z=Function.prototype,tt=Object.prototype,et=Z.toString,nt=tt.hasOwnProperty,rt=RegExp("^"+et.call(nt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=function(t){return!(!U(t)||G(t))&&(V(t)?rt:X).test(J(t))},at=function(t,e){return null==t?void 0:t[e]},it=function(t,e){var n=at(t,e);return ot(n)?n:void 0},ut=it(I,"Map"),ct=it(Object,"create"),st="__lodash_hash_undefined__",ft=Object.prototype.hasOwnProperty,pt=Object.prototype.hasOwnProperty,ht="__lodash_hash_undefined__";i.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},i.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},i.prototype.get=function(t){var e=this.__data__;if(ct){var n=e[t];return n===st?void 0:n}return ft.call(e,t)?e[t]:void 0},i.prototype.has=function(t){var e=this.__data__;return ct?void 0!==e[t]:pt.call(e,t)},i.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ct&&void 0===e?ht:e,this};var lt=i,dt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},yt=function(t,e){var n=t.__data__;return dt(e)?n["string"==typeof e?"string":"hash"]:n.map};u.prototype.clear=function(){this.size=0,this.__data__={hash:new lt,map:new(ut||E),string:new lt}},u.prototype.delete=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e},u.prototype.get=function(t){return yt(this,t).get(t)},u.prototype.has=function(t){return yt(this,t).has(t)},u.prototype.set=function(t,e){var n=yt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var vt=u,bt=200;c.prototype.clear=function(){this.__data__=new E,this.size=0},c.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},c.prototype.get=function(t){return this.__data__.get(t)},c.prototype.has=function(t){return this.__data__.has(t)},c.prototype.set=function(t,e){var n=this.__data__;if(n instanceof E){var r=n.__data__;if(!ut||bt-1>r.length)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new vt(r)}return n.set(t,e),this.size=n.size,this};var _t=c,gt="__lodash_hash_undefined__";s.prototype.add=s.prototype.push=function(t){return this.__data__.set(t,gt),this},s.prototype.has=function(t){return this.__data__.has(t)};var jt=s,mt=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},Ot=function(t,e){return t.has(e)},wt=1,Et=2,Pt=function(t,e,n,r,o,a){var i=n&wt,u=t.length,c=e.length;if(!(u==c||i&&c>u))return!1;var s=a.get(t);if(s&&a.get(e))return s==e;var f=-1,p=!0,h=n&Et?new jt:void 0;for(a.set(t,e),a.set(e,t);++f<u;){var l=t[f],d=e[f];if(r)var y=i?r(d,l,f,e,t,a):r(l,d,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!mt(e,function(t,e){if(!Ot(h,e)&&(l===t||o(l,t,n,r,a)))return h.push(e)})){p=!1;break}}else if(l!==d&&!o(l,d,n,r,a)){p=!1;break}}return a.delete(t),a.delete(e),p},At=I.Uint8Array,It=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n},Ct=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},Dt=1,zt=2,kt="[object Boolean]",St="[object Date]",Tt="[object Error]",xt="[object Map]",Rt="[object Number]",Mt="[object RegExp]",Bt="[object Set]",Ft="[object String]",Lt="[object Symbol]",Ut="[object ArrayBuffer]",Kt="[object DataView]",$t=C?C.prototype:void 0,Wt=$t?$t.valueOf:void 0,qt=function(t,e,n,r,o,a,i){switch(n){case Kt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ut:return!(t.byteLength!=e.byteLength||!a(new At(t),new At(e)));case kt:case St:case Rt:return m(+t,+e);case Tt:return t.name==e.name&&t.message==e.message;case Mt:case Ft:return t==e+"";case xt:var u=It;case Bt:var c=r&Dt;if(u||(u=Ct),t.size!=e.size&&!c)return!1;var s=i.get(t);if(s)return s==e;r|=zt,i.set(t,e);var f=Pt(u(t),u(e),r,o,a,i);return i.delete(t),f;case Lt:if(Wt)return Wt.call(t)==Wt.call(e)}return!1},Vt=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},Nt=Array.isArray,Ht=function(t,e,n){var r=e(t);return Nt(t)?r:Vt(r,n(t))},Gt=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[o++]=i)}return a},Yt=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Qt=Jt?function(t){return null==t?[]:(t=Object(t),Gt(Jt(t),function(e){return Yt.call(t,e)}))}:function(){return[]},Xt=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},Zt=function(t){return null!=t&&"object"==typeof t},te="[object Arguments]",ee=function(t){return Zt(t)&&L(t)==te},ne=Object.prototype,re=ne.hasOwnProperty,oe=ne.propertyIsEnumerable,ae=ee(function(){return arguments}())?ee:function(t){return Zt(t)&&re.call(t,"callee")&&!oe.call(t,"callee")},ie=function(){return!1},ue=r(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n?I.Buffer:void 0,a=(o?o.isBuffer:void 0)||ie;t.exports=a}),ce=9007199254740991,se=/^(?:0|[1-9]\d*)$/,fe=function(t,e){return!!(e=null==e?ce:e)&&("number"==typeof t||se.test(t))&&t>-1&&t%1==0&&e>t},pe=9007199254740991,he=function(t){return"number"==typeof t&&t>-1&&t%1==0&&pe>=t},le={};le["[object Float32Array]"]=le["[object Float64Array]"]=le["[object Int8Array]"]=le["[object Int16Array]"]=le["[object Int32Array]"]=le["[object Uint8Array]"]=le["[object Uint8ClampedArray]"]=le["[object Uint16Array]"]=le["[object Uint32Array]"]=!0,le["[object Arguments]"]=le["[object Array]"]=le["[object ArrayBuffer]"]=le["[object Boolean]"]=le["[object DataView]"]=le["[object Date]"]=le["[object Error]"]=le["[object Function]"]=le["[object Map]"]=le["[object Number]"]=le["[object Object]"]=le["[object RegExp]"]=le["[object Set]"]=le["[object String]"]=le["[object WeakMap]"]=!1;var de=function(t){return function(e){return t(e)}},ye=r(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n&&P.process,a=function(){try{return o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),ve=ye&&ye.isTypedArray,be=ve?de(ve):function(t){return Zt(t)&&he(t.length)&&!!le[L(t)]},_e=Object.prototype.hasOwnProperty,ge=function(t,e){var n=Nt(t),r=!n&&ae(t),o=!n&&!r&&ue(t),a=!n&&!r&&!o&&be(t),i=n||r||o||a,u=i?Xt(t.length,String):[],c=u.length;for(var s in t)!e&&!_e.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||fe(s,c))||u.push(s);return u},je=Object.prototype,me=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||je)},Oe=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),we=Object.prototype.hasOwnProperty,Ee=function(t){if(!me(t))return Oe(t);var e=[];for(var n in Object(t))we.call(t,n)&&"constructor"!=n&&e.push(n);return e},Pe=function(t){return null!=t&&he(t.length)&&!V(t)},Ae=function(t){return Pe(t)?ge(t):Ee(t)},Ie=function(t){return Ht(t,Ae,Qt)},Ce=1,De=Object.prototype.hasOwnProperty,ze=function(t,e,n,r,o,a){var i=n&Ce,u=Ie(t),c=u.length;if(c!=Ie(e).length&&!i)return!1;for(var s=c;s--;){var f=u[s];if(!(i?f in e:De.call(e,f)))return!1}var p=a.get(t);if(p&&a.get(e))return p==e;var h=!0;a.set(t,e),a.set(e,t);for(var l=i;++s<c;){var d=t[f=u[s]],y=e[f];if(r)var v=i?r(y,d,f,e,t,a):r(d,y,f,t,e,a);if(!(void 0===v?d===y||o(d,y,n,r,a):v)){h=!1;break}l||(l="constructor"==f)}if(h&&!l){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(h=!1)}return a.delete(t),a.delete(e),h},ke=it(I,"DataView"),Se=it(I,"Promise"),Te=it(I,"Set"),xe=it(I,"WeakMap"),Re=J(ke),Me=J(ut),Be=J(Se),Fe=J(Te),Le=J(xe),Ue=L;(ke&&"[object DataView]"!=Ue(new ke(new ArrayBuffer(1)))||ut&&"[object Map]"!=Ue(new ut)||Se&&"[object Promise]"!=Ue(Se.resolve())||Te&&"[object Set]"!=Ue(new Te)||xe&&"[object WeakMap]"!=Ue(new xe))&&(Ue=function(t){var e=L(t),n="[object Object]"==e?t.constructor:void 0,r=n?J(n):"";if(r)switch(r){case Re:return"[object DataView]";case Me:return"[object Map]";case Be:return"[object Promise]";case Fe:return"[object Set]";case Le:return"[object WeakMap]"}return e});var Ke=Ue,$e=1,We="[object Arguments]",qe="[object Array]",Ve="[object Object]",Ne=Object.prototype.hasOwnProperty,He=function(t,e,n,r,o,a){var i=Nt(t),u=Nt(e),c=i?qe:Ke(t),s=u?qe:Ke(e),f=(c=c==We?Ve:c)==Ve,p=(s=s==We?Ve:s)==Ve,h=c==s;if(h&&ue(t)){if(!ue(e))return!1;i=!0,f=!1}if(h&&!f)return a||(a=new _t),i||be(t)?Pt(t,e,n,r,o,a):qt(t,e,c,n,r,o,a);if(!(n&$e)){var l=f&&Ne.call(t,"__wrapped__"),d=p&&Ne.call(e,"__wrapped__");if(l||d){var y=l?t.value():t,v=d?e.value():e;return a||(a=new _t),o(y,v,n,r,a)}}return!!h&&(a||(a=new _t),ze(t,e,n,r,o,a))},Ge=f,Ye=function(t,e){return Ge(t,e)},Je=function(){try{var t=it(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Qe=function(t,e,n){"__proto__"==e&&Je?Je(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Xe=function(t,e,n,r){for(var o=-1,a=null==t?0:t.length;++o<a;){var i=t[o];e(r,i,n(i),t)}return r},Ze=function(t){return function(e,n,r){for(var o=-1,a=Object(e),i=r(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===n(a[c],c,a))break}return e}}(),tn=function(t,e){return function(n,r){if(null==n)return n;if(!Pe(n))return t(n,r);for(var o=n.length,a=e?o:-1,i=Object(n);(e?a--:++a<o)&&!1!==r(i[a],a,i););return n}}(function(t,e){return t&&Ze(t,e,Ae)}),en=function(t,e,n,r){return tn(t,function(t,o,a){e(r,t,n(t),a)}),r},nn=1,rn=2,on=function(t,e,n,r){var o=n.length,a=o,i=!r;if(null==t)return!a;for(t=Object(t);o--;){var u=n[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=n[o])[0],s=t[c],f=u[1];if(i&&u[2]){if(void 0===s&&!(c in t))return!1}else{var p=new _t;if(r)var h=r(s,f,c,t,e,p);if(!(void 0===h?Ge(f,s,nn|rn,r,p):h))return!1}}return!0},an=function(t){return t===t&&!U(t)},un=function(t){for(var e=Ae(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,an(o)]}return e},cn=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},sn=function(t){var e=un(t);return 1==e.length&&e[0][2]?cn(e[0][0],e[0][1]):function(n){return n===t||on(n,t,e)}},fn="[object Symbol]",pn=function(t){return"symbol"==typeof t||Zt(t)&&L(t)==fn},hn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ln=/^\w*$/,dn=function(t,e){if(Nt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!pn(t))||ln.test(t)||!hn.test(t)||null!=e&&t in Object(e)},yn="Expected a function";p.Cache=vt;var vn=p,bn=500,_n=/^\./,gn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jn=/\\(\\)?/g,mn=function(t){var e=vn(t,function(t){return n.size===bn&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return _n.test(t)&&e.push(""),t.replace(gn,function(t,n,r,o){e.push(r?o.replace(jn,"$1"):n||t)}),e}),On=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},wn=1/0,En=C?C.prototype:void 0,Pn=En?En.toString:void 0,An=h,In=function(t){return null==t?"":An(t)},Cn=function(t,e){return Nt(t)?t:dn(t,e)?[t]:mn(In(t))},Dn=1/0,zn=function(t){if("string"==typeof t||pn(t))return t;var e=t+"";return"0"==e&&1/t==-Dn?"-0":e},kn=function(t,e){for(var n=0,r=(e=Cn(e,t)).length;null!=t&&r>n;)t=t[zn(e[n++])];return n&&n==r?t:void 0},Sn=function(t,e,n){var r=null==t?void 0:kn(t,e);return void 0===r?n:r},Tn=function(t,e){return null!=t&&e in Object(t)},xn=function(t,e,n){for(var r=-1,o=(e=Cn(e,t)).length,a=!1;++r<o;){var i=zn(e[r]);if(!(a=null!=t&&n(t,i)))break;t=t[i]}return a||++r!=o?a:!!(o=null==t?0:t.length)&&he(o)&&fe(i,o)&&(Nt(t)||ae(t))},Rn=function(t,e){return null!=t&&xn(t,e,Tn)},Mn=1,Bn=2,Fn=function(t,e){return dn(t)&&an(e)?cn(zn(t),e):function(n){var r=Sn(n,t);return void 0===r&&r===e?Rn(n,t):Ge(e,r,Mn|Bn)}},Ln=function(t){return t},Un=function(t){return function(e){return null==e?void 0:e[t]}},Kn=function(t){return function(e){return kn(e,t)}},$n=function(t){return dn(t)?Un(zn(t)):Kn(t)},Wn=function(t){return"function"==typeof t?t:null==t?Ln:"object"==typeof t?Nt(t)?Fn(t[0],t[1]):sn(t):$n(t)},qn=function(t,e){return function(n,r){var o=Nt(n)?Xe:en,a=e?e():{};return o(n,t,Wn(r,2),a)}}(function(t,e,n){Qe(t,n,e)}),Vn=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Nn=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hn=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Gn=function(t,e){var n={};for(var r in t)0>e.indexOf(r)&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},Yn=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Jn="undefined"!=typeof process&&process.env&&"production",Qn=function(t){function r(){var e,n,o;Vn(this,r);for(var a=arguments.length,i=Array(a),u=0;a>u;u++)i[u]=arguments[u];return e=n=Yn(this,t.call.apply(t,[this].concat(i))),n.handleOnClick=function(t){var e=n.chartInstance,r=n.props,o=r.getDatasetAtEvent,a=r.getElementAtEvent,i=r.getElementsAtEvent,u=r.onElementsClick;o&&o(e.getDatasetAtEvent(t),t),a&&a(e.getElementAtEvent(t),t),i&&i(e.getElementsAtEvent(t),t),u&&u(e.getElementsAtEvent(t),t)},n.ref=function(t){n.element=t},o=e,Yn(n,o)}return Hn(r,t),r.prototype.componentWillMount=function(){this.chartInstance=void 0},r.prototype.componentDidMount=function(){this.renderChart()},r.prototype.componentDidUpdate=function(){if(this.props.redraw)return this.destroyChart(),void this.renderChart();this.updateChart()},r.prototype.shouldComponentUpdate=function(t){var e=this.props,n=e.type,r=e.options,o=e.plugins,a=e.legend,i=e.height,u=e.width;if(!0===t.redraw)return!0;if(i!==t.height||u!==t.width)return!0;if(n!==t.type)return!0;if(!Ye(a,t.legend))return!0;if(!Ye(r,t.options))return!0;var c=this.transformDataProp(t);return!Ye(this.shadowDataProp,c)||!Ye(o,t.plugins)},r.prototype.componentWillUnmount=function(){this.destroyChart()},r.prototype.transformDataProp=function(t){var e=t.data;return"function"==typeof e?e(this.element):e},r.prototype.memoizeDataProps=function(){if(this.props.data){var t=this.transformDataProp(this.props);return this.shadowDataProp=Nn({},t,{datasets:t.datasets&&t.datasets.map(function(t){return Nn({},t)})}),this.saveCurrentDatasets(),t}},r.prototype.checkDatasets=function(t){var e="production"!==Jn&&"prod"!==Jn,n=this.props.datasetKeyProvider!==r.getLabelAsKey,o=t.length>1;if(e&&o&&!n){var a=!1;t.forEach(function(t){t.label||(a=!0)}),a&&console.error('[react-chartjs-2] Warning: Each dataset needs a unique key. By default, the "label" property on each dataset is used. Alternatively, you may provide a "datasetKeyProvider" as a prop that returns a unique key.')}},r.prototype.getCurrentDatasets=function(){return this.chartInstance&&this.chartInstance.config.data&&this.chartInstance.config.data.datasets||[]},r.prototype.saveCurrentDatasets=function(){var t=this;this.datasets=this.datasets||{},this.getCurrentDatasets().forEach(function(e){t.datasets[t.props.datasetKeyProvider(e)]=e})},r.prototype.updateChart=function(){var t=this,e=this.props.options,r=this.memoizeDataProps(this.props);if(this.chartInstance){e&&(this.chartInstance.options=n.helpers.configMerge(this.chartInstance.options,e));var o=this.getCurrentDatasets(),a=r.datasets||[];this.checkDatasets(o);var i=qn(o,this.props.datasetKeyProvider);this.chartInstance.config.data.datasets=a.map(function(e){var n=i[t.props.datasetKeyProvider(e)];if(n&&n.type===e.type){n.data.splice(e.data.length),e.data.forEach(function(t,r){n.data[r]=e.data[r]});var r=Gn(e,["data"]);return Nn({},n,r)}return e});var u=Gn(r,["datasets"]);this.chartInstance.config.data=Nn({},this.chartInstance.config.data,u),this.chartInstance.update()}},r.prototype.renderChart=function(){var t=this.props,e=t.options,o=t.legend,a=t.type,i=t.plugins,u=this.element,c=this.memoizeDataProps();void 0===o||Ye(r.defaultProps.legend,o)||(e.legend=o),this.chartInstance=new n(u,{type:a,data:c,options:e,plugins:i})},r.prototype.destroyChart=function(){this.saveCurrentDatasets();var t=Object.values(this.datasets);this.chartInstance.config.data.datasets=t,this.chartInstance.destroy()},r.prototype.render=function(){var t=this.props,n=t.height,r=t.width,o=t.id;return e.createElement("canvas",{ref:this.ref,height:n,width:r,id:o,onClick:this.handleOnClick})},r}(e.Component);Qn.getLabelAsKey=function(t){return t.label},Qn.propTypes={data:j.oneOfType([j.object,j.func]).isRequired,getDatasetAtEvent:j.func,getElementAtEvent:j.func,getElementsAtEvent:j.func,height:j.number,legend:j.object,onElementsClick:j.func,options:j.object,plugins:j.arrayOf(j.object),redraw:j.bool,type:function(t,e,r){if(!n.controllers[t[e]])return Error("Invalid chart type `"+t[e]+"` supplied to `"+r+"`.")},width:j.number,datasetKeyProvider:j.func},Qn.defaultProps={legend:{display:!0,position:"bottom"},type:"doughnut",height:150,width:300,redraw:!1,options:{},datasetKeyProvider:Qn.getLabelAsKey};var Xn=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"doughnut"}))},n}(e.Component),Zn=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"pie"}))},n}(e.Component),tr=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"line"}))},n}(e.Component),er=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"bar"}))},n}(e.Component),nr=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"horizontalBar"}))},n}(e.Component),rr=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"radar"}))},n}(e.Component),or=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"polarArea"}))},n}(e.Component),ar=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"bubble"}))},n}(e.Component),ir=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"scatter"}))},n}(e.Component),ur=n.defaults;t.default=Qn,t.Doughnut=Xn,t.Pie=Zn,t.Line=tr,t.Bar=er,t.HorizontalBar=nr,t.Radar=rr,t.Polar=or,t.Bubble=ar,t.Scatter=ir,t.defaults=ur,t.Chart=n,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("chart.js")):"function"==typeof define&&define.amd?define(["exports","react","chart.js"],e):e(t.ReactChartjs2={},t.React,t.Chart)}(this,function(t,e,n){"use strict";function r(t,e){return e={exports:{}},t(e,e.exports),e.exports}function o(t){return function(){return t}}function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function i(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function c(t){var e=this.__data__=new E(t);this.size=e.size}function s(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new vt;++e<n;)this.add(t[e])}function f(t,e,n,r,o){return t===e||(null==t||null==e||!Zt(t)&&!Zt(e)?t!==t&&e!==e:He(t,e,n,r,f,o))}function p(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(yn);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(p.Cache||vt),n}function h(t){if("string"==typeof t)return t;if(Nt(t))return On(t,h)+"";if(pn(t))return Pn?Pn.call(t):"";var e=t+"";return"0"==e&&1/t==-wn?"-0":e}e=e&&e.hasOwnProperty("default")?e.default:e,n=n&&n.hasOwnProperty("default")?n.default:n;var l="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d=function(){};d.thatReturns=o,d.thatReturnsFalse=o(!1),d.thatReturnsTrue=o(!0),d.thatReturnsNull=o(null),d.thatReturnsThis=function(){return this},d.thatReturnsArgument=function(t){return t};var y=d,v=function(t){},b=function(t,e,n,r,o,a,i,u){if(v(e),!t){var c;if(void 0===e)c=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,a,i,u],f=0;(c=Error(e.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}},_="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",g=function(){function t(t,e,n,r,o,a){a!==_&&b(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=y,n.PropTypes=n,n},j=r(function(t){t.exports=g()}),m=function(t,e){return t===e||t!==t&&e!==e},O=function(t,e){for(var n=t.length;n--;)if(m(t[n][0],e))return n;return-1},w=Array.prototype.splice;a.prototype.clear=function(){this.__data__=[],this.size=0},a.prototype.delete=function(t){var e=this.__data__,n=O(e,t);return n>=0&&(n==e.length-1?e.pop():w.call(e,n,1),--this.size,!0)},a.prototype.get=function(t){var e=this.__data__,n=O(e,t);return 0>n?void 0:e[n][1]},a.prototype.has=function(t){return O(this.__data__,t)>-1},a.prototype.set=function(t,e){var n=this.__data__,r=O(n,t);return 0>r?(++this.size,n.push([t,e])):n[r][1]=e,this};var E=a,P="object"==typeof l&&l&&l.Object===Object&&l,A="object"==typeof self&&self&&self.Object===Object&&self,I=P||A||Function("return this")(),C=I.Symbol,D=Object.prototype,z=D.hasOwnProperty,k=D.toString,S=C?C.toStringTag:void 0,T=function(t){var e=z.call(t,S),n=t[S];try{t[S]=void 0;var r=!0}catch(t){}var o=k.call(t);return r&&(e?t[S]=n:delete t[S]),o},x=Object.prototype.toString,R=function(t){return x.call(t)},B="[object Null]",M="[object Undefined]",F=C?C.toStringTag:void 0,L=function(t){return null==t?void 0===t?M:B:F&&F in Object(t)?T(t):R(t)},U=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},K="[object AsyncFunction]",$="[object Function]",W="[object GeneratorFunction]",q="[object Proxy]",V=function(t){if(!U(t))return!1;var e=L(t);return e==$||e==W||e==K||e==q},N=I["__core-js_shared__"],H=function(){var t=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),G=function(t){return!!H&&H in t},Y=Function.prototype.toString,J=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Q=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,Z=Function.prototype,tt=Object.prototype,et=Z.toString,nt=tt.hasOwnProperty,rt=RegExp("^"+et.call(nt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=function(t){return!(!U(t)||G(t))&&(V(t)?rt:X).test(J(t))},at=function(t,e){return null==t?void 0:t[e]},it=function(t,e){var n=at(t,e);return ot(n)?n:void 0},ut=it(I,"Map"),ct=it(Object,"create"),st="__lodash_hash_undefined__",ft=Object.prototype.hasOwnProperty,pt=Object.prototype.hasOwnProperty,ht="__lodash_hash_undefined__";i.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},i.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},i.prototype.get=function(t){var e=this.__data__;if(ct){var n=e[t];return n===st?void 0:n}return ft.call(e,t)?e[t]:void 0},i.prototype.has=function(t){var e=this.__data__;return ct?void 0!==e[t]:pt.call(e,t)},i.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ct&&void 0===e?ht:e,this};var lt=i,dt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},yt=function(t,e){var n=t.__data__;return dt(e)?n["string"==typeof e?"string":"hash"]:n.map};u.prototype.clear=function(){this.size=0,this.__data__={hash:new lt,map:new(ut||E),string:new lt}},u.prototype.delete=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e},u.prototype.get=function(t){return yt(this,t).get(t)},u.prototype.has=function(t){return yt(this,t).has(t)},u.prototype.set=function(t,e){var n=yt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var vt=u,bt=200;c.prototype.clear=function(){this.__data__=new E,this.size=0},c.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},c.prototype.get=function(t){return this.__data__.get(t)},c.prototype.has=function(t){return this.__data__.has(t)},c.prototype.set=function(t,e){var n=this.__data__;if(n instanceof E){var r=n.__data__;if(!ut||bt-1>r.length)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new vt(r)}return n.set(t,e),this.size=n.size,this};var _t=c,gt="__lodash_hash_undefined__";s.prototype.add=s.prototype.push=function(t){return this.__data__.set(t,gt),this},s.prototype.has=function(t){return this.__data__.has(t)};var jt=s,mt=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},Ot=function(t,e){return t.has(e)},wt=1,Et=2,Pt=function(t,e,n,r,o,a){var i=n&wt,u=t.length,c=e.length;if(!(u==c||i&&c>u))return!1;var s=a.get(t);if(s&&a.get(e))return s==e;var f=-1,p=!0,h=n&Et?new jt:void 0;for(a.set(t,e),a.set(e,t);++f<u;){var l=t[f],d=e[f];if(r)var y=i?r(d,l,f,e,t,a):r(l,d,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!mt(e,function(t,e){if(!Ot(h,e)&&(l===t||o(l,t,n,r,a)))return h.push(e)})){p=!1;break}}else if(l!==d&&!o(l,d,n,r,a)){p=!1;break}}return a.delete(t),a.delete(e),p},At=I.Uint8Array,It=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n},Ct=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},Dt=1,zt=2,kt="[object Boolean]",St="[object Date]",Tt="[object Error]",xt="[object Map]",Rt="[object Number]",Bt="[object RegExp]",Mt="[object Set]",Ft="[object String]",Lt="[object Symbol]",Ut="[object ArrayBuffer]",Kt="[object DataView]",$t=C?C.prototype:void 0,Wt=$t?$t.valueOf:void 0,qt=function(t,e,n,r,o,a,i){switch(n){case Kt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ut:return!(t.byteLength!=e.byteLength||!a(new At(t),new At(e)));case kt:case St:case Rt:return m(+t,+e);case Tt:return t.name==e.name&&t.message==e.message;case Bt:case Ft:return t==e+"";case xt:var u=It;case Mt:var c=r&Dt;if(u||(u=Ct),t.size!=e.size&&!c)return!1;var s=i.get(t);if(s)return s==e;r|=zt,i.set(t,e);var f=Pt(u(t),u(e),r,o,a,i);return i.delete(t),f;case Lt:if(Wt)return Wt.call(t)==Wt.call(e)}return!1},Vt=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},Nt=Array.isArray,Ht=function(t,e,n){var r=e(t);return Nt(t)?r:Vt(r,n(t))},Gt=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[o++]=i)}return a},Yt=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Qt=Jt?function(t){return null==t?[]:(t=Object(t),Gt(Jt(t),function(e){return Yt.call(t,e)}))}:function(){return[]},Xt=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},Zt=function(t){return null!=t&&"object"==typeof t},te="[object Arguments]",ee=function(t){return Zt(t)&&L(t)==te},ne=Object.prototype,re=ne.hasOwnProperty,oe=ne.propertyIsEnumerable,ae=ee(function(){return arguments}())?ee:function(t){return Zt(t)&&re.call(t,"callee")&&!oe.call(t,"callee")},ie=function(){return!1},ue=r(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n?I.Buffer:void 0,a=(o?o.isBuffer:void 0)||ie;t.exports=a}),ce=9007199254740991,se=/^(?:0|[1-9]\d*)$/,fe=function(t,e){return!!(e=null==e?ce:e)&&("number"==typeof t||se.test(t))&&t>-1&&t%1==0&&e>t},pe=9007199254740991,he=function(t){return"number"==typeof t&&t>-1&&t%1==0&&pe>=t},le={};le["[object Float32Array]"]=le["[object Float64Array]"]=le["[object Int8Array]"]=le["[object Int16Array]"]=le["[object Int32Array]"]=le["[object Uint8Array]"]=le["[object Uint8ClampedArray]"]=le["[object Uint16Array]"]=le["[object Uint32Array]"]=!0,le["[object Arguments]"]=le["[object Array]"]=le["[object ArrayBuffer]"]=le["[object Boolean]"]=le["[object DataView]"]=le["[object Date]"]=le["[object Error]"]=le["[object Function]"]=le["[object Map]"]=le["[object Number]"]=le["[object Object]"]=le["[object RegExp]"]=le["[object Set]"]=le["[object String]"]=le["[object WeakMap]"]=!1;var de=function(t){return function(e){return t(e)}},ye=r(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n&&P.process,a=function(){try{return o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),ve=ye&&ye.isTypedArray,be=ve?de(ve):function(t){return Zt(t)&&he(t.length)&&!!le[L(t)]},_e=Object.prototype.hasOwnProperty,ge=function(t,e){var n=Nt(t),r=!n&&ae(t),o=!n&&!r&&ue(t),a=!n&&!r&&!o&&be(t),i=n||r||o||a,u=i?Xt(t.length,String):[],c=u.length;for(var s in t)!e&&!_e.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||fe(s,c))||u.push(s);return u},je=Object.prototype,me=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||je)},Oe=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),we=Object.prototype.hasOwnProperty,Ee=function(t){if(!me(t))return Oe(t);var e=[];for(var n in Object(t))we.call(t,n)&&"constructor"!=n&&e.push(n);return e},Pe=function(t){return null!=t&&he(t.length)&&!V(t)},Ae=function(t){return Pe(t)?ge(t):Ee(t)},Ie=function(t){return Ht(t,Ae,Qt)},Ce=1,De=Object.prototype.hasOwnProperty,ze=function(t,e,n,r,o,a){var i=n&Ce,u=Ie(t),c=u.length;if(c!=Ie(e).length&&!i)return!1;for(var s=c;s--;){var f=u[s];if(!(i?f in e:De.call(e,f)))return!1}var p=a.get(t);if(p&&a.get(e))return p==e;var h=!0;a.set(t,e),a.set(e,t);for(var l=i;++s<c;){var d=t[f=u[s]],y=e[f];if(r)var v=i?r(y,d,f,e,t,a):r(d,y,f,t,e,a);if(!(void 0===v?d===y||o(d,y,n,r,a):v)){h=!1;break}l||(l="constructor"==f)}if(h&&!l){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(h=!1)}return a.delete(t),a.delete(e),h},ke=it(I,"DataView"),Se=it(I,"Promise"),Te=it(I,"Set"),xe=it(I,"WeakMap"),Re=J(ke),Be=J(ut),Me=J(Se),Fe=J(Te),Le=J(xe),Ue=L;(ke&&"[object DataView]"!=Ue(new ke(new ArrayBuffer(1)))||ut&&"[object Map]"!=Ue(new ut)||Se&&"[object Promise]"!=Ue(Se.resolve())||Te&&"[object Set]"!=Ue(new Te)||xe&&"[object WeakMap]"!=Ue(new xe))&&(Ue=function(t){var e=L(t),n="[object Object]"==e?t.constructor:void 0,r=n?J(n):"";if(r)switch(r){case Re:return"[object DataView]";case Be:return"[object Map]";case Me:return"[object Promise]";case Fe:return"[object Set]";case Le:return"[object WeakMap]"}return e});var Ke=Ue,$e=1,We="[object Arguments]",qe="[object Array]",Ve="[object Object]",Ne=Object.prototype.hasOwnProperty,He=function(t,e,n,r,o,a){var i=Nt(t),u=Nt(e),c=i?qe:Ke(t),s=u?qe:Ke(e),f=(c=c==We?Ve:c)==Ve,p=(s=s==We?Ve:s)==Ve,h=c==s;if(h&&ue(t)){if(!ue(e))return!1;i=!0,f=!1}if(h&&!f)return a||(a=new _t),i||be(t)?Pt(t,e,n,r,o,a):qt(t,e,c,n,r,o,a);if(!(n&$e)){var l=f&&Ne.call(t,"__wrapped__"),d=p&&Ne.call(e,"__wrapped__");if(l||d){var y=l?t.value():t,v=d?e.value():e;return a||(a=new _t),o(y,v,n,r,a)}}return!!h&&(a||(a=new _t),ze(t,e,n,r,o,a))},Ge=f,Ye=function(t,e){return Ge(t,e)},Je=function(){try{var t=it(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Qe=function(t,e,n){"__proto__"==e&&Je?Je(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Xe=function(t,e,n,r){for(var o=-1,a=null==t?0:t.length;++o<a;){var i=t[o];e(r,i,n(i),t)}return r},Ze=function(t){return function(e,n,r){for(var o=-1,a=Object(e),i=r(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===n(a[c],c,a))break}return e}}(),tn=function(t,e){return function(n,r){if(null==n)return n;if(!Pe(n))return t(n,r);for(var o=n.length,a=e?o:-1,i=Object(n);(e?a--:++a<o)&&!1!==r(i[a],a,i););return n}}(function(t,e){return t&&Ze(t,e,Ae)}),en=function(t,e,n,r){return tn(t,function(t,o,a){e(r,t,n(t),a)}),r},nn=1,rn=2,on=function(t,e,n,r){var o=n.length,a=o,i=!r;if(null==t)return!a;for(t=Object(t);o--;){var u=n[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=n[o])[0],s=t[c],f=u[1];if(i&&u[2]){if(void 0===s&&!(c in t))return!1}else{var p=new _t;if(r)var h=r(s,f,c,t,e,p);if(!(void 0===h?Ge(f,s,nn|rn,r,p):h))return!1}}return!0},an=function(t){return t===t&&!U(t)},un=function(t){for(var e=Ae(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,an(o)]}return e},cn=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},sn=function(t){var e=un(t);return 1==e.length&&e[0][2]?cn(e[0][0],e[0][1]):function(n){return n===t||on(n,t,e)}},fn="[object Symbol]",pn=function(t){return"symbol"==typeof t||Zt(t)&&L(t)==fn},hn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ln=/^\w*$/,dn=function(t,e){if(Nt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!pn(t))||ln.test(t)||!hn.test(t)||null!=e&&t in Object(e)},yn="Expected a function";p.Cache=vt;var vn=p,bn=500,_n=/^\./,gn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jn=/\\(\\)?/g,mn=function(t){var e=vn(t,function(t){return n.size===bn&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return _n.test(t)&&e.push(""),t.replace(gn,function(t,n,r,o){e.push(r?o.replace(jn,"$1"):n||t)}),e}),On=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},wn=1/0,En=C?C.prototype:void 0,Pn=En?En.toString:void 0,An=h,In=function(t){return null==t?"":An(t)},Cn=function(t,e){return Nt(t)?t:dn(t,e)?[t]:mn(In(t))},Dn=1/0,zn=function(t){if("string"==typeof t||pn(t))return t;var e=t+"";return"0"==e&&1/t==-Dn?"-0":e},kn=function(t,e){for(var n=0,r=(e=Cn(e,t)).length;null!=t&&r>n;)t=t[zn(e[n++])];return n&&n==r?t:void 0},Sn=function(t,e,n){var r=null==t?void 0:kn(t,e);return void 0===r?n:r},Tn=function(t,e){return null!=t&&e in Object(t)},xn=function(t,e,n){for(var r=-1,o=(e=Cn(e,t)).length,a=!1;++r<o;){var i=zn(e[r]);if(!(a=null!=t&&n(t,i)))break;t=t[i]}return a||++r!=o?a:!!(o=null==t?0:t.length)&&he(o)&&fe(i,o)&&(Nt(t)||ae(t))},Rn=function(t,e){return null!=t&&xn(t,e,Tn)},Bn=1,Mn=2,Fn=function(t,e){return dn(t)&&an(e)?cn(zn(t),e):function(n){var r=Sn(n,t);return void 0===r&&r===e?Rn(n,t):Ge(e,r,Bn|Mn)}},Ln=function(t){return t},Un=function(t){return function(e){return null==e?void 0:e[t]}},Kn=function(t){return function(e){return kn(e,t)}},$n=function(t){return dn(t)?Un(zn(t)):Kn(t)},Wn=function(t){return"function"==typeof t?t:null==t?Ln:"object"==typeof t?Nt(t)?Fn(t[0],t[1]):sn(t):$n(t)},qn=function(t,e){return function(n,r){var o=Nt(n)?Xe:en,a=e?e():{};return o(n,t,Wn(r,2),a)}}(function(t,e,n){Qe(t,n,e)}),Vn=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Nn=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hn=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Gn=function(t,e){var n={};for(var r in t)0>e.indexOf(r)&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},Yn=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Jn="undefined"!=typeof process&&process.env&&"production",Qn=function(t){function r(){Vn(this,r);var e=Yn(this,t.call(this));return e.handleOnClick=function(t){var n=e.chartInstance,r=e.props,o=r.getDatasetAtEvent,a=r.getElementAtEvent,i=r.getElementsAtEvent,u=r.onElementsClick;o&&o(n.getDatasetAtEvent(t),t),a&&a(n.getElementAtEvent(t),t),i&&i(n.getElementsAtEvent(t),t),u&&u(n.getElementsAtEvent(t),t)},e.ref=function(t){e.element=t},e.chartInstance=void 0,e}return Hn(r,t),r.prototype.componentDidMount=function(){this.renderChart()},r.prototype.componentDidUpdate=function(){if(this.props.redraw)return this.destroyChart(),void this.renderChart();this.updateChart()},r.prototype.shouldComponentUpdate=function(t){var e=this.props,n=e.type,r=e.options,o=e.plugins,a=e.legend,i=e.height,u=e.width;if(!0===t.redraw)return!0;if(i!==t.height||u!==t.width)return!0;if(n!==t.type)return!0;if(!Ye(a,t.legend))return!0;if(!Ye(r,t.options))return!0;var c=this.transformDataProp(t);return!Ye(this.shadowDataProp,c)||!Ye(o,t.plugins)},r.prototype.componentWillUnmount=function(){this.destroyChart()},r.prototype.transformDataProp=function(t){var e=t.data;return"function"==typeof e?e(this.element):e},r.prototype.memoizeDataProps=function(){if(this.props.data){var t=this.transformDataProp(this.props);return this.shadowDataProp=Nn({},t,{datasets:t.datasets&&t.datasets.map(function(t){return Nn({},t)})}),this.saveCurrentDatasets(),t}},r.prototype.checkDatasets=function(t){var e="production"!==Jn&&"prod"!==Jn,n=this.props.datasetKeyProvider!==r.getLabelAsKey,o=t.length>1;if(e&&o&&!n){var a=!1;t.forEach(function(t){t.label||(a=!0)}),a&&console.error('[react-chartjs-2] Warning: Each dataset needs a unique key. By default, the "label" property on each dataset is used. Alternatively, you may provide a "datasetKeyProvider" as a prop that returns a unique key.')}},r.prototype.getCurrentDatasets=function(){return this.chartInstance&&this.chartInstance.config.data&&this.chartInstance.config.data.datasets||[]},r.prototype.saveCurrentDatasets=function(){var t=this;this.datasets=this.datasets||{},this.getCurrentDatasets().forEach(function(e){t.datasets[t.props.datasetKeyProvider(e)]=e})},r.prototype.updateChart=function(){var t=this,e=this.props.options,r=this.memoizeDataProps(this.props);if(this.chartInstance){e&&(this.chartInstance.options=n.helpers.configMerge(this.chartInstance.options,e));var o=this.getCurrentDatasets(),a=r.datasets||[];this.checkDatasets(o);var i=qn(o,this.props.datasetKeyProvider);this.chartInstance.config.data.datasets=a.map(function(e){var n=i[t.props.datasetKeyProvider(e)];if(n&&n.type===e.type&&e.data){n.data.splice(e.data.length),e.data.forEach(function(t,r){n.data[r]=e.data[r]});var r=Gn(e,["data"]);return Nn({},n,r)}return e});var u=Gn(r,["datasets"]);this.chartInstance.config.data=Nn({},this.chartInstance.config.data,u),this.chartInstance.update()}},r.prototype.renderChart=function(){var t=this.props,e=t.options,o=t.legend,a=t.type,i=t.plugins,u=this.element,c=this.memoizeDataProps();void 0===o||Ye(r.defaultProps.legend,o)||(e.legend=o),this.chartInstance=new n(u,{type:a,data:c,options:e,plugins:i})},r.prototype.destroyChart=function(){this.saveCurrentDatasets();var t=Object.values(this.datasets);this.chartInstance.config.data.datasets=t,this.chartInstance.destroy()},r.prototype.render=function(){var t=this.props,n=t.height,r=t.width,o=t.id;return e.createElement("canvas",{ref:this.ref,height:n,width:r,id:o,onClick:this.handleOnClick})},r}(e.Component);Qn.getLabelAsKey=function(t){return t.label},Qn.propTypes={data:j.oneOfType([j.object,j.func]).isRequired,getDatasetAtEvent:j.func,getElementAtEvent:j.func,getElementsAtEvent:j.func,height:j.number,legend:j.object,onElementsClick:j.func,options:j.object,plugins:j.arrayOf(j.object),redraw:j.bool,type:function(t,e,r){if(!n.controllers[t[e]])return Error("Invalid chart type `"+t[e]+"` supplied to `"+r+"`.")},width:j.number,datasetKeyProvider:j.func},Qn.defaultProps={legend:{display:!0,position:"bottom"},type:"doughnut",height:150,width:300,redraw:!1,options:{},datasetKeyProvider:Qn.getLabelAsKey};var Xn=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"doughnut"}))},n}(e.Component),Zn=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"pie"}))},n}(e.Component),tr=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"line"}))},n}(e.Component),er=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"bar"}))},n}(e.Component),nr=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"horizontalBar"}))},n}(e.Component),rr=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"radar"}))},n}(e.Component),or=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"polarArea"}))},n}(e.Component),ar=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"bubble"}))},n}(e.Component),ir=function(t){function n(){return Vn(this,n),Yn(this,t.apply(this,arguments))}return Hn(n,t),n.prototype.render=function(){var t=this;return e.createElement(Qn,Nn({},this.props,{ref:function(e){return t.chartInstance=e&&e.chartInstance},type:"scatter"}))},n}(e.Component),ur=n.defaults;t.default=Qn,t.Doughnut=Xn,t.Pie=Zn,t.Line=tr,t.Bar=er,t.HorizontalBar=nr,t.Radar=rr,t.Polar=or,t.Bubble=ar,t.Scatter=ir,t.defaults=ur,t.Chart=n,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -23,11 +23,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

function ChartComponent() {
var _temp, _this, _ret;
_classCallCheck(this, ChartComponent);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, _React$Component.call(this));
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleOnClick = function (event) {
_this.handleOnClick = function (event) {
var instance = _this.chartInstance;

@@ -46,11 +42,12 @@

onElementsClick && onElementsClick(instance.getElementsAtEvent(event), event); // Backward compatibility
}, _this.ref = function (element) {
};
_this.ref = function (element) {
_this.element = element;
}, _temp), _possibleConstructorReturn(_this, _ret);
};
_this.chartInstance = undefined;
return _this;
}
ChartComponent.prototype.componentWillMount = function componentWillMount() {
this.chartInstance = undefined;
};
ChartComponent.prototype.componentDidMount = function componentDidMount() {

@@ -209,3 +206,4 @@ this.renderChart();

if (current && current.type === next.type) {
if (current && current.type === next.type && next.data) {
// Be robust to no data. Relevant for other update mechanisms as in chartjs-plugin-streaming.
// The data array must be edited in place. As chart.js adds listeners to it.

@@ -212,0 +210,0 @@ current.data.splice(next.data.length);

@@ -60,2 +60,5 @@ // Type definitions for react-chartjs-2 2.0

export var defaults: {};
export var defaults: {
global: chartjs.ChartOptions & chartjs.ChartFontOptions;
[key: string]: any;
};

@@ -44,11 +44,7 @@ 'use strict';

function ChartComponent() {
var _temp, _this, _ret;
_classCallCheck(this, ChartComponent);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, _React$Component.call(this));
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleOnClick = function (event) {
_this.handleOnClick = function (event) {
var instance = _this.chartInstance;

@@ -67,11 +63,12 @@

onElementsClick && onElementsClick(instance.getElementsAtEvent(event), event); // Backward compatibility
}, _this.ref = function (element) {
};
_this.ref = function (element) {
_this.element = element;
}, _temp), _possibleConstructorReturn(_this, _ret);
};
_this.chartInstance = undefined;
return _this;
}
ChartComponent.prototype.componentWillMount = function componentWillMount() {
this.chartInstance = undefined;
};
ChartComponent.prototype.componentDidMount = function componentDidMount() {

@@ -230,3 +227,4 @@ this.renderChart();

if (current && current.type === next.type) {
if (current && current.type === next.type && next.data) {
// Be robust to no data. Relevant for other update mechanisms as in chartjs-plugin-streaming.
// The data array must be edited in place. As chart.js adds listeners to it.

@@ -233,0 +231,0 @@ current.data.splice(next.data.length);

{
"name": "react-chartjs-2",
"version": "2.7.6",
"version": "2.8.0",
"description": "react-chartjs-2",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc