react-chartjs-2
Advanced tools
Comparing version 2.0.5 to 2.1.0
@@ -1,1 +0,1 @@ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.reactChartjs2=t()}}(function(){return function t(e,n,r){function o(i,u){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(a)return a(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[i]={exports:{}};e[i][0].call(f.exports,function(t){var n=e[i][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,e,n){(function(t){function r(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}function o(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function a(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function i(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function u(t){return function(e){return t(e)}}function c(t,e){return t.has(e)}function s(t,e){return null==t?void 0:t[e]}function f(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function l(t,e){return function(n){return t(e(n))}}function p(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function h(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 d(){this.__data__=Ue?Ue(null):{},this.size=0}function y(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function _(t){var e=this.__data__;if(Ue){var n=e[t];return n===wt?void 0:n}return ge.call(e,t)?e[t]:void 0}function v(t){var e=this.__data__;return Ue?void 0!==e[t]:ge.call(e,t)}function b(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ue&&void 0===e?wt:e,this}function g(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 w(){this.__data__=[],this.size=0}function j(t){var e=this.__data__,n=$(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ke.call(e,n,1),--this.size,!0}function m(t){var e=this.__data__,n=$(e,t);return n<0?void 0:e[n][1]}function O(t){return $(this.__data__,t)>-1}function P(t,e){var n=this.__data__,r=$(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function E(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 A(){this.size=0,this.__data__={hash:new h,map:new(Me||g),string:new h}}function k(t){var e=tt(this,t)["delete"](t);return this.size-=e?1:0,e}function z(t){return tt(this,t).get(t)}function C(t){return tt(this,t).has(t)}function D(t,e){var n=tt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function T(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new E;++e<n;)this.add(t[e])}function x(t){return this.__data__.set(t,wt),this}function M(t){return this.__data__.has(t)}function B(t){var e=this.__data__=new g(t);this.size=e.size}function S(){this.__data__=new g,this.size=0}function R(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}function U(t){return this.__data__.get(t)}function F(t){return this.__data__.has(t)}function L(t,e){var n=this.__data__;if(n instanceof g){var r=n.__data__;if(!Me||r.length<gt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new E(r)}return n.set(t,e),this.size=n.size,this}function q(t,e){var n=Je(t),r=!n&&Ge(t),o=!n&&!r&&Ke(t),a=!n&&!r&&!o&&Qe(t),u=n||r||o||a,c=u?i(t.length,String):[],s=c.length;for(var f in t)!e&&!ge.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||a&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||rt(f,s))||c.push(f);return c}function $(t,e){for(var n=t.length;n--;)if(st(t[n][0],e))return n;return-1}function N(t,e,n){var r=e(t);return Je(t)?r:o(r,n(t))}function I(t){return null==t?void 0===t?Nt:Bt:ze&&ze in Object(t)?nt(t):ut(t)}function W(t){return yt(t)&&I(t)==Pt}function H(t,e,n,r,o){return t===e||(null==t||null==e||!yt(t)&&!yt(e)?t!==t&&e!==e:V(t,e,n,r,H,o))}function V(t,e,n,r,o,a){var i=Je(t),u=Je(e),c=i?Et:Ve(t),s=u?Et:Ve(e);c=c==Pt?St:c,s=s==Pt?St:s;var f=c==St,l=s==St,p=c==s;if(p&&Ke(t)){if(!Ke(e))return!1;i=!0,f=!1}if(p&&!f)return a||(a=new B),i||Qe(t)?Q(t,e,n,r,o,a):X(t,e,c,n,r,o,a);if(!(n&jt)){var h=f&&ge.call(t,"__wrapped__"),d=l&&ge.call(e,"__wrapped__");if(h||d){var y=h?t.value():t,_=d?e.value():e;return a||(a=new B),o(y,_,n,r,a)}}return!!p&&(a||(a=new B),Y(t,e,n,r,o,a))}function G(t){if(!dt(t)||at(t))return!1;var e=pt(t)?me:ne;return e.test(ct(t))}function J(t){return yt(t)&&ht(t.length)&&!!oe[I(t)]}function K(t){if(!it(t))return Te(t);var e=[];for(var n in Object(t))ge.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Q(t,e,n,r,o,i){var u=n&jt,s=t.length,f=e.length;if(s!=f&&!(u&&f>s))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var p=-1,h=!0,d=n&mt?new T:void 0;for(i.set(t,e),i.set(e,t);++p<s;){var y=t[p],_=e[p];if(r)var v=u?r(_,y,p,e,t,i):r(y,_,p,t,e,i);if(void 0!==v){if(v)continue;h=!1;break}if(d){if(!a(e,function(t,e){if(!c(d,e)&&(y===t||o(y,t,n,r,i)))return d.push(e)})){h=!1;break}}else if(y!==_&&!o(y,_,n,r,i)){h=!1;break}}return i["delete"](t),i["delete"](e),h}function X(t,e,n,r,o,a,i){switch(n){case Ht:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Wt:return!(t.byteLength!=e.byteLength||!a(new Ee(t),new Ee(e)));case kt:case zt:case Mt:return st(+t,+e);case Ct:return t.name==e.name&&t.message==e.message;case Ft:case qt:return t==e+"";case xt:var u=f;case Lt:var c=r&jt;if(u||(u=p),t.size!=e.size&&!c)return!1;var s=i.get(t);if(s)return s==e;r|=mt,i.set(t,e);var l=Q(u(t),u(e),r,o,a,i);return i["delete"](t),l;case $t:if(We)return We.call(t)==We.call(e)}return!1}function Y(t,e,n,r,o,a){var i=n&jt,u=Z(t),c=u.length,s=Z(e),f=s.length;if(c!=f&&!i)return!1;for(var l=c;l--;){var p=u[l];if(!(i?p in e:ge.call(e,p)))return!1}var h=a.get(t);if(h&&a.get(e))return h==e;var d=!0;a.set(t,e),a.set(e,t);for(var y=i;++l<c;){p=u[l];var _=t[p],v=e[p];if(r)var b=i?r(v,_,p,e,t,a):r(_,v,p,t,e,a);if(!(void 0===b?_===v||o(_,v,n,r,a):b)){d=!1;break}y||(y="constructor"==p)}if(d&&!y){var g=t.constructor,w=e.constructor;g!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof w&&w instanceof w)&&(d=!1)}return a["delete"](t),a["delete"](e),d}function Z(t){return N(t,_t,He)}function tt(t,e){var n=t.__data__;return ot(e)?n["string"==typeof e?"string":"hash"]:n.map}function et(t,e){var n=s(t,e);return G(n)?n:void 0}function nt(t){var e=ge.call(t,ze),n=t[ze];try{t[ze]=void 0;var r=!0}catch(o){}var a=je.call(t);return r&&(e?t[ze]=n:delete t[ze]),a}function rt(t,e){return e=null==e?Ot:e,!!e&&("number"==typeof t||re.test(t))&&t>-1&&t%1==0&&t<e}function ot(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function at(t){return!!we&&we in t}function it(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||_e;return t===n}function ut(t){return je.call(t)}function ct(t){if(null!=t){try{return be.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function st(t,e){return t===e||t!==t&&e!==e}function ft(t){return null!=t&&ht(t.length)&&!pt(t)}function lt(t,e){return H(t,e)}function pt(t){if(!dt(t))return!1;var e=I(t);return e==Dt||e==Tt||e==At||e==Ut}function ht(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ot}function dt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function yt(t){return null!=t&&"object"==typeof t}function _t(t){return ft(t)?q(t):K(t)}function vt(){return[]}function bt(){return!1}var gt=200,wt="__lodash_hash_undefined__",jt=1,mt=2,Ot=9007199254740991,Pt="[object Arguments]",Et="[object Array]",At="[object AsyncFunction]",kt="[object Boolean]",zt="[object Date]",Ct="[object Error]",Dt="[object Function]",Tt="[object GeneratorFunction]",xt="[object Map]",Mt="[object Number]",Bt="[object Null]",St="[object Object]",Rt="[object Promise]",Ut="[object Proxy]",Ft="[object RegExp]",Lt="[object Set]",qt="[object String]",$t="[object Symbol]",Nt="[object Undefined]",It="[object WeakMap]",Wt="[object ArrayBuffer]",Ht="[object DataView]",Vt="[object Float32Array]",Gt="[object Float64Array]",Jt="[object Int8Array]",Kt="[object Int16Array]",Qt="[object Int32Array]",Xt="[object Uint8Array]",Yt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",te="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,ne=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,oe={};oe[Vt]=oe[Gt]=oe[Jt]=oe[Kt]=oe[Qt]=oe[Xt]=oe[Yt]=oe[Zt]=oe[te]=!0,oe[Pt]=oe[Et]=oe[Wt]=oe[kt]=oe[Ht]=oe[zt]=oe[Ct]=oe[Dt]=oe[xt]=oe[Mt]=oe[St]=oe[Ft]=oe[Lt]=oe[qt]=oe[It]=!1;var ae="object"==typeof t&&t&&t.Object===Object&&t,ie="object"==typeof self&&self&&self.Object===Object&&self,ue=ae||ie||Function("return this")(),ce="object"==typeof n&&n&&!n.nodeType&&n,se=ce&&"object"==typeof e&&e&&!e.nodeType&&e,fe=se&&se.exports===ce,le=fe&&ae.process,pe=function(){try{return le&&le.binding&&le.binding("util")}catch(t){}}(),he=pe&&pe.isTypedArray,de=Array.prototype,ye=Function.prototype,_e=Object.prototype,ve=ue["__core-js_shared__"],be=ye.toString,ge=_e.hasOwnProperty,we=function(){var t=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),je=_e.toString,me=RegExp("^"+be.call(ge).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=fe?ue.Buffer:void 0,Pe=ue.Symbol,Ee=ue.Uint8Array,Ae=_e.propertyIsEnumerable,ke=de.splice,ze=Pe?Pe.toStringTag:void 0,Ce=Object.getOwnPropertySymbols,De=Oe?Oe.isBuffer:void 0,Te=l(Object.keys,Object),xe=et(ue,"DataView"),Me=et(ue,"Map"),Be=et(ue,"Promise"),Se=et(ue,"Set"),Re=et(ue,"WeakMap"),Ue=et(Object,"create"),Fe=ct(xe),Le=ct(Me),qe=ct(Be),$e=ct(Se),Ne=ct(Re),Ie=Pe?Pe.prototype:void 0,We=Ie?Ie.valueOf:void 0;h.prototype.clear=d,h.prototype["delete"]=y,h.prototype.get=_,h.prototype.has=v,h.prototype.set=b,g.prototype.clear=w,g.prototype["delete"]=j,g.prototype.get=m,g.prototype.has=O,g.prototype.set=P,E.prototype.clear=A,E.prototype["delete"]=k,E.prototype.get=z,E.prototype.has=C,E.prototype.set=D,T.prototype.add=T.prototype.push=x,T.prototype.has=M,B.prototype.clear=S,B.prototype["delete"]=R,B.prototype.get=U,B.prototype.has=F,B.prototype.set=L;var He=Ce?function(t){return null==t?[]:(t=Object(t),r(Ce(t),function(e){return Ae.call(t,e)}))}:vt,Ve=I;(xe&&Ve(new xe(new ArrayBuffer(1)))!=Ht||Me&&Ve(new Me)!=xt||Be&&Ve(Be.resolve())!=Rt||Se&&Ve(new Se)!=Lt||Re&&Ve(new Re)!=It)&&(Ve=function(t){var e=I(t),n=e==St?t.constructor:void 0,r=n?ct(n):"";if(r)switch(r){case Fe:return Ht;case Le:return xt;case qe:return Rt;case $e:return Lt;case Ne:return It}return e});var Ge=W(function(){return arguments}())?W:function(t){return yt(t)&&ge.call(t,"callee")&&!Ae.call(t,"callee")},Je=Array.isArray,Ke=De||bt,Qe=he?u(he):J;e.exports=lt}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){(function(e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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}function u(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)}Object.defineProperty(n,"__esModule",{value:!0}),n.Chart=n.defaults=n.Bubble=n.Polar=n.Radar=n.HorizontalBar=n.Bar=n.Line=n.Pie=n.Doughnut=void 0;var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,l=r(f),p="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof e?e.ReactDOM:null,h=r(p),d="undefined"!=typeof window?window.Chart:"undefined"!=typeof e?e.Chart:null,y=r(d),_=t("lodash.isequal"),v=r(_),b=function(t){function e(){var t,n,r,o;a(this,e);for(var u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];return n=r=i(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(c))),r.handleOnClick=function(t){var e=r.chart_instance,n=r.props,o=n.getDatasetAtEvent,a=n.getElementAtEvent,i=n.getElementsAtEvent,u=n.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)},o=n,i(r,o)}return u(e,t),s(e,[{key:"componentWillMount",value:function(){this.chart_instance=void 0}},{key:"componentDidMount",value:function(){this.renderChart()}},{key:"componentDidUpdate",value:function(){return this.props.redraw?(this.chart_instance.destroy(),void this.renderChart()):void this.updateChart()}},{key:"shouldComponentUpdate",value:function(t){var e=this.props,n=(e.redraw,e.type),r=e.options,o=e.legend,a=e.height,i=e.width;if(t.redraw===!0)return!0;if(a!==t.height||i!==t.width)return!0;if(n!==t.type)return!0;if(!(0,v["default"])(o,t.legend))return!0;if(!(0,v["default"])(r,t.options))return!0;var u=this.transformDataProp(t);return!(0,v["default"])(this.shadowDataProp,u)}},{key:"componentWillUnmount",value:function(){this.chart_instance.destroy()}},{key:"transformDataProp",value:function(t){var e=t.data;if("function"==typeof e){var n=h["default"].findDOMNode(this);return e(n)}return e}},{key:"memoizeDataProps",value:function(){if(this.props.data){var t=this.transformDataProp(this.props);return this.shadowDataProp=c({},t,{datasets:t.datasets&&t.datasets.map(function(t){return c({},t)})}),t}}},{key:"updateChart",value:function(){var t=this.props.options,e=this.memoizeDataProps(this.props);if(this.chart_instance){t&&(this.chart_instance.options=y["default"].helpers.configMerge(this.chart_instance.options,t));for(var n=this.chart_instance.config.data&&this.chart_instance.config.data.datasets||[],r=e.datasets||[];n.length>r.length;)n.pop();r.forEach(function(t,e){if(n[e]&&n[e].data){n[e].data.splice(r[e].data.length),t.data.forEach(function(t,o){n[e].data[o]=r[e].data[o]});var a=(t.data,o(t,["data"]));n[e]=c({data:n[e].data},n[e],a)}else n[e]=r[e]});var a=(e.datasets,o(e,["datasets"]));this.chart_instance.config.data=c({},this.chart_instance.config.data,a),this.chart_instance.update()}}},{key:"renderChart",value:function(){var t=this.props,e=t.options,n=(t.legend,t.type),r=(t.redraw,h["default"].findDOMNode(this)),o=this.memoizeDataProps();this.chart_instance=new y["default"](r,{type:n,data:o,options:e})}},{key:"render",value:function(){var t=this.props,e=t.height,n=t.width;t.onElementsClick;return l["default"].createElement("canvas",{height:e,width:n,onClick:this.handleOnClick})}}]),e}(l["default"].Component);b.propTypes={data:f.PropTypes.oneOfType([f.PropTypes.object,f.PropTypes.func]).isRequired,getDatasetAtEvent:f.PropTypes.func,getElementAtEvent:f.PropTypes.func,getElementsAtEvent:f.PropTypes.func,height:f.PropTypes.number,legend:f.PropTypes.object,onElementsClick:f.PropTypes.func,options:f.PropTypes.object,redraw:f.PropTypes.bool,type:f.PropTypes.oneOf(["doughnut","pie","line","bar","horizontalBar","radar","polarArea","bubble"]),width:f.PropTypes.number},b.defaultProps={legend:{display:!0,position:"bottom"},type:"doughnut",height:150,width:300,redraw:!1,options:{}},n["default"]=b;n.Doughnut=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"doughnut"}))}}]),e}(l["default"].Component),n.Pie=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"pie"}))}}]),e}(l["default"].Component),n.Line=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"line"}))}}]),e}(l["default"].Component),n.Bar=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"bar"}))}}]),e}(l["default"].Component),n.HorizontalBar=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"horizontalBar"}))}}]),e}(l["default"].Component),n.Radar=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"radar"}))}}]),e}(l["default"].Component),n.Polar=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"polarArea"}))}}]),e}(l["default"].Component),n.Bubble=function(t){function e(){return a(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(b,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"bubble"}))}}]),e}(l["default"].Component),n.defaults=y["default"].defaults;n.Chart=y["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash.isequal":1}]},{},[2])(2)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.reactChartjs2=t()}}(function(){return function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},e.exports=o},{}],2:[function(t,e,n){"use strict";function r(t,e,n,r,i,a,u,c){if(o(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,i,a,u,c],l=0;s=new Error(e.replace(/%s/g,function(){return f[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(t){};e.exports=r},{}],3:[function(t,e,n){"use strict";var r=t("./emptyFunction"),o=r;e.exports=o},{"./emptyFunction":1}],4:[function(t,e,n){(function(t){function r(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function o(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function i(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function a(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function u(t){return function(e){return t(e)}}function c(t,e){return t.has(e)}function s(t,e){return null==t?void 0:t[e]}function f(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function l(t,e){return function(n){return t(e(n))}}function p(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function d(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 h(){this.__data__=Fe?Fe(null):{},this.size=0}function y(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function v(t){var e=this.__data__;if(Fe){var n=e[t];return n===mt?void 0:n}return ge.call(e,t)?e[t]:void 0}function b(t){var e=this.__data__;return Fe?void 0!==e[t]:ge.call(e,t)}function _(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Fe&&void 0===e?mt:e,this}function g(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 m(){this.__data__=[],this.size=0}function w(t){var e=this.__data__,n=U(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ke.call(e,n,1),--this.size,!0}function j(t){var e=this.__data__,n=U(e,t);return n<0?void 0:e[n][1]}function O(t){return U(this.__data__,t)>-1}function E(t,e){var n=this.__data__,r=U(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function P(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 T(){this.size=0,this.__data__={hash:new d,map:new(Se||g),string:new d}}function k(t){var e=tt(this,t)["delete"](t);return this.size-=e?1:0,e}function A(t){return tt(this,t).get(t)}function x(t){return tt(this,t).has(t)}function R(t,e){var n=tt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function C(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new P;++e<n;)this.add(t[e])}function D(t){return this.__data__.set(t,mt),this}function S(t){return this.__data__.has(t)}function z(t){var e=this.__data__=new g(t);this.size=e.size}function N(){this.__data__=new g,this.size=0}function I(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}function F(t){return this.__data__.get(t)}function L(t){return this.__data__.has(t)}function M(t,e){var n=this.__data__;if(n instanceof g){var r=n.__data__;if(!Se||r.length<gt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new P(r)}return n.set(t,e),this.size=n.size,this}function B(t,e){var n=He(t),r=!n&&Ye(t),o=!n&&!r&&Ge(t),i=!n&&!r&&!o&&Je(t),u=n||r||o||i,c=u?a(t.length,String):[],s=c.length;for(var f in t)!e&&!ge.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||rt(f,s))||c.push(f);return c}function U(t,e){for(var n=t.length;n--;)if(st(t[n][0],e))return n;return-1}function q(t,e,n){var r=e(t);return He(t)?r:o(r,n(t))}function V(t){return null==t?void 0===t?qt:zt:Ae&&Ae in Object(t)?nt(t):ut(t)}function K(t){return yt(t)&&V(t)==Et}function W(t,e,n,r,o){return t===e||(null==t||null==e||!yt(t)&&!yt(e)?t!==t&&e!==e:$(t,e,n,r,W,o))}function $(t,e,n,r,o,i){var a=He(t),u=He(e),c=a?Pt:$e(t),s=u?Pt:$e(e);c=c==Et?Nt:c,s=s==Et?Nt:s;var f=c==Nt,l=s==Nt,p=c==s;if(p&&Ge(t)){if(!Ge(e))return!1;a=!0,f=!1}if(p&&!f)return i||(i=new z),a||Je(t)?J(t,e,n,r,o,i):Q(t,e,c,n,r,o,i);if(!(n&wt)){var d=f&&ge.call(t,"__wrapped__"),h=l&&ge.call(e,"__wrapped__");if(d||h){var y=d?t.value():t,v=h?e.value():e;return i||(i=new z),o(y,v,n,r,i)}}return!!p&&(i||(i=new z),X(t,e,n,r,o,i))}function Y(t){if(!ht(t)||it(t))return!1;var e=pt(t)?je:ne;return e.test(ct(t))}function H(t){return yt(t)&&dt(t.length)&&!!oe[V(t)]}function G(t){if(!at(t))return Ce(t);var e=[];for(var n in Object(t))ge.call(t,n)&&"constructor"!=n&&e.push(n);return e}function J(t,e,n,r,o,a){var u=n&wt,s=t.length,f=e.length;if(s!=f&&!(u&&f>s))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var p=-1,d=!0,h=n&jt?new C:void 0;for(a.set(t,e),a.set(e,t);++p<s;){var y=t[p],v=e[p];if(r)var b=u?r(v,y,p,e,t,a):r(y,v,p,t,e,a);if(void 0!==b){if(b)continue;d=!1;break}if(h){if(!i(e,function(t,e){if(!c(h,e)&&(y===t||o(y,t,n,r,a)))return h.push(e)})){d=!1;break}}else if(y!==v&&!o(y,v,n,r,a)){d=!1;break}}return a["delete"](t),a["delete"](e),d}function Q(t,e,n,r,o,i,a){switch(n){case Wt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Kt:return!(t.byteLength!=e.byteLength||!i(new Pe(t),new Pe(e)));case kt:case At:case St:return st(+t,+e);case xt:return t.name==e.name&&t.message==e.message;case Lt:case Bt:return t==e+"";case Dt:var u=f;case Mt:var c=r&wt;if(u||(u=p),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;r|=jt,a.set(t,e);var l=J(u(t),u(e),r,o,i,a);return a["delete"](t),l;case Ut:if(Ke)return Ke.call(t)==Ke.call(e)}return!1}function X(t,e,n,r,o,i){var a=n&wt,u=Z(t),c=u.length,s=Z(e),f=s.length;if(c!=f&&!a)return!1;for(var l=c;l--;){var p=u[l];if(!(a?p in e:ge.call(e,p)))return!1}var d=i.get(t);if(d&&i.get(e))return d==e;var h=!0;i.set(t,e),i.set(e,t);for(var y=a;++l<c;){p=u[l];var v=t[p],b=e[p];if(r)var _=a?r(b,v,p,e,t,i):r(v,b,p,t,e,i);if(!(void 0===_?v===b||o(v,b,n,r,i):_)){h=!1;break}y||(y="constructor"==p)}if(h&&!y){var g=t.constructor,m=e.constructor;g!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m)&&(h=!1)}return i["delete"](t),i["delete"](e),h}function Z(t){return q(t,vt,We)}function tt(t,e){var n=t.__data__;return ot(e)?n["string"==typeof e?"string":"hash"]:n.map}function et(t,e){var n=s(t,e);return Y(n)?n:void 0}function nt(t){var e=ge.call(t,Ae),n=t[Ae];try{t[Ae]=void 0;var r=!0}catch(o){}var i=we.call(t);return r&&(e?t[Ae]=n:delete t[Ae]),i}function rt(t,e){return e=null==e?Ot:e,!!e&&("number"==typeof t||re.test(t))&&t>-1&&t%1==0&&t<e}function ot(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function it(t){return!!me&&me in t}function at(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||ve;return t===n}function ut(t){return we.call(t)}function ct(t){if(null!=t){try{return _e.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function st(t,e){return t===e||t!==t&&e!==e}function ft(t){return null!=t&&dt(t.length)&&!pt(t)}function lt(t,e){return W(t,e)}function pt(t){if(!ht(t))return!1;var e=V(t);return e==Rt||e==Ct||e==Tt||e==Ft}function dt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ot}function ht(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function yt(t){return null!=t&&"object"==typeof t}function vt(t){return ft(t)?B(t):G(t)}function bt(){return[]}function _t(){return!1}var gt=200,mt="__lodash_hash_undefined__",wt=1,jt=2,Ot=9007199254740991,Et="[object Arguments]",Pt="[object Array]",Tt="[object AsyncFunction]",kt="[object Boolean]",At="[object Date]",xt="[object Error]",Rt="[object Function]",Ct="[object GeneratorFunction]",Dt="[object Map]",St="[object Number]",zt="[object Null]",Nt="[object Object]",It="[object Promise]",Ft="[object Proxy]",Lt="[object RegExp]",Mt="[object Set]",Bt="[object String]",Ut="[object Symbol]",qt="[object Undefined]",Vt="[object WeakMap]",Kt="[object ArrayBuffer]",Wt="[object DataView]",$t="[object Float32Array]",Yt="[object Float64Array]",Ht="[object Int8Array]",Gt="[object Int16Array]",Jt="[object Int32Array]",Qt="[object Uint8Array]",Xt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",te="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,ne=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,oe={};oe[$t]=oe[Yt]=oe[Ht]=oe[Gt]=oe[Jt]=oe[Qt]=oe[Xt]=oe[Zt]=oe[te]=!0,oe[Et]=oe[Pt]=oe[Kt]=oe[kt]=oe[Wt]=oe[At]=oe[xt]=oe[Rt]=oe[Dt]=oe[St]=oe[Nt]=oe[Lt]=oe[Mt]=oe[Bt]=oe[Vt]=!1;var ie="object"==typeof t&&t&&t.Object===Object&&t,ae="object"==typeof self&&self&&self.Object===Object&&self,ue=ie||ae||Function("return this")(),ce="object"==typeof n&&n&&!n.nodeType&&n,se=ce&&"object"==typeof e&&e&&!e.nodeType&&e,fe=se&&se.exports===ce,le=fe&&ie.process,pe=function(){try{return le&&le.binding&&le.binding("util")}catch(t){}}(),de=pe&&pe.isTypedArray,he=Array.prototype,ye=Function.prototype,ve=Object.prototype,be=ue["__core-js_shared__"],_e=ye.toString,ge=ve.hasOwnProperty,me=function(){var t=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),we=ve.toString,je=RegExp("^"+_e.call(ge).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=fe?ue.Buffer:void 0,Ee=ue.Symbol,Pe=ue.Uint8Array,Te=ve.propertyIsEnumerable,ke=he.splice,Ae=Ee?Ee.toStringTag:void 0,xe=Object.getOwnPropertySymbols,Re=Oe?Oe.isBuffer:void 0,Ce=l(Object.keys,Object),De=et(ue,"DataView"),Se=et(ue,"Map"),ze=et(ue,"Promise"),Ne=et(ue,"Set"),Ie=et(ue,"WeakMap"),Fe=et(Object,"create"),Le=ct(De),Me=ct(Se),Be=ct(ze),Ue=ct(Ne),qe=ct(Ie),Ve=Ee?Ee.prototype:void 0,Ke=Ve?Ve.valueOf:void 0;d.prototype.clear=h,d.prototype["delete"]=y,d.prototype.get=v,d.prototype.has=b,d.prototype.set=_,g.prototype.clear=m,g.prototype["delete"]=w,g.prototype.get=j,g.prototype.has=O,g.prototype.set=E,P.prototype.clear=T,P.prototype["delete"]=k,P.prototype.get=A,P.prototype.has=x,P.prototype.set=R,C.prototype.add=C.prototype.push=D,C.prototype.has=S,z.prototype.clear=N,z.prototype["delete"]=I,z.prototype.get=F,z.prototype.has=L,z.prototype.set=M;var We=xe?function(t){return null==t?[]:(t=Object(t),r(xe(t),function(e){return Te.call(t,e)}))}:bt,$e=V;(De&&$e(new De(new ArrayBuffer(1)))!=Wt||Se&&$e(new Se)!=Dt||ze&&$e(ze.resolve())!=It||Ne&&$e(new Ne)!=Mt||Ie&&$e(new Ie)!=Vt)&&($e=function(t){var e=V(t),n=e==Nt?t.constructor:void 0,r=n?ct(n):"";if(r)switch(r){case Le:return Wt;case Me:return Dt;case Be:return It;case Ue:return Mt;case qe:return Vt}return e});var Ye=K(function(){return arguments}())?K:function(t){return yt(t)&&ge.call(t,"callee")&&!Te.call(t,"callee")},He=Array.isArray,Ge=Re||_t,Je=de?u(de):H;e.exports=lt}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(t,e,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function a(t){if(p===clearTimeout)return clearTimeout(t);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function u(){v&&h&&(v=!1,h.length?y=h.concat(y):b=-1,y.length&&c())}function c(){if(!v){var t=i(u);v=!0;for(var e=y.length;e;){for(h=y,y=[];++b<e;)h&&h[b].run();b=-1,e=y.length}h=null,v=!1,a(t)}}function s(t,e){this.fun=t,this.array=e}function f(){}var l,p,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(t){l=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(t){p=o}}();var h,y=[],v=!1,b=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];y.push(new s(t,e)),1!==y.length||v||i(c)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],6:[function(t,e,n){(function(n){"use strict";function r(t,e,r,c,s){if("production"!==n.env.NODE_ENV)for(var f in t)if(t.hasOwnProperty(f)){var l;try{o("function"==typeof t[f],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",c||"React class",r,f),l=t[f](e,f,c,r,null,a)}catch(p){l=p}if(i(!l||l instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",r,f,typeof l),l instanceof Error&&!(l.message in u)){u[l.message]=!0;var d=s?s():"";i(!1,"Failed %s type: %s%s",r,l.message,null!=d?d:"")}}}if("production"!==n.env.NODE_ENV)var o=t("fbjs/lib/invariant"),i=t("fbjs/lib/warning"),a=t("./lib/ReactPropTypesSecret"),u={};e.exports=r}).call(this,t("_process"))},{"./lib/ReactPropTypesSecret":10,_process:5,"fbjs/lib/invariant":2,"fbjs/lib/warning":3}],7:[function(t,e,n){"use strict";var r=t("fbjs/lib/emptyFunction"),o=t("fbjs/lib/invariant");e.exports=function(){function t(){o(!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=r,n.PropTypes=n,n}},{"fbjs/lib/emptyFunction":1,"fbjs/lib/invariant":2}],8:[function(t,e,n){(function(n){"use strict";var r=t("fbjs/lib/emptyFunction"),o=t("fbjs/lib/invariant"),i=t("fbjs/lib/warning"),a=t("./lib/ReactPropTypesSecret"),u=t("./checkPropTypes");e.exports=function(t,e){function c(t){var e=t&&(k&&t[k]||t[A]);if("function"==typeof e)return e}function s(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}function f(t){this.message=t,this.stack=""}function l(t){function r(r,s,l,p,d,h,y){if(p=p||x,h=h||l,y!==a)if(e)o(!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");else if("production"!==n.env.NODE_ENV&&"undefined"!=typeof console){var v=p+":"+l;!u[v]&&c<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,p),u[v]=!0,c++)}return null==s[l]?r?new f(null===s[l]?"The "+d+" `"+h+"` is marked as required "+("in `"+p+"`, but its value is `null`."):"The "+d+" `"+h+"` is marked as required in "+("`"+p+"`, but its value is `undefined`.")):null:t(s,l,p,d,h)}if("production"!==n.env.NODE_ENV)var u={},c=0;var s=r.bind(null,!1);return s.isRequired=r.bind(null,!0),s}function p(t){function e(e,n,r,o,i,a){var u=e[n],c=E(u);if(c!==t){var s=P(u);return new f("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("`"+t+"`."))}return null}return l(e)}function d(){return l(r.thatReturnsNull)}function h(t){function e(e,n,r,o,i){if("function"!=typeof t)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=e[n];if(!Array.isArray(u)){var c=E(u);return new f("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var s=0;s<u.length;s++){var l=t(u,s,r,o,i+"["+s+"]",a);if(l instanceof Error)return l}return null}return l(e)}function y(){function e(e,n,r,o,i){var a=e[n];if(!t(a)){var u=E(a);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return l(e)}function v(t){function e(e,n,r,o,i){if(!(e[n]instanceof t)){var a=t.name||x,u=T(e[n]);return new f("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return l(e)}function b(t){function e(e,n,r,o,i){for(var a=e[n],u=0;u<t.length;u++)if(s(a,t[u]))return null;var c=JSON.stringify(t);return new f("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+c+"."))}return Array.isArray(t)?l(e):("production"!==n.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function _(t){function e(e,n,r,o,i){if("function"!=typeof t)return new f("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=e[n],c=E(u);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an object."));for(var s in u)if(u.hasOwnProperty(s)){var l=t(u,s,r,o,i+"."+s,a);if(l instanceof Error)return l}return null}return l(e)}function g(t){function e(e,n,r,o,i){for(var u=0;u<t.length;u++){var c=t[u];if(null==c(e,n,r,o,i,a))return null}return new f("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}return Array.isArray(t)?l(e):("production"!==n.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull)}function m(){function t(t,e,n,r,o){return j(t[e])?null:new f("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return l(t)}function w(t){function e(e,n,r,o,i){var u=e[n],c=E(u);if("object"!==c)return new f("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var s in t){var l=t[s];if(l){var p=l(u,s,r,o,i+"."+s,a);if(p)return p}}return null}return l(e)}function j(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(j);if(null===e||t(e))return!0;var n=c(e);if(!n)return!1;var r,o=n.call(e);if(n!==e.entries){for(;!(r=o.next()).done;)if(!j(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!j(i[1]))return!1}return!0;default:return!1}}function O(t,e){return"symbol"===t||("Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol)}function E(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":O(e,t)?"symbol":e}function P(t){var e=E(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function T(t){return t.constructor&&t.constructor.name?t.constructor.name:x}var k="function"==typeof Symbol&&Symbol.iterator,A="@@iterator",x="<<anonymous>>",R={array:p("array"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:d(),arrayOf:h,element:y(),instanceOf:v,node:m(),objectOf:_,oneOf:b,oneOfType:g,shape:w};return f.prototype=Error.prototype,R.checkPropTypes=u,R.PropTypes=R,R}}).call(this,t("_process"))},{"./checkPropTypes":6,"./lib/ReactPropTypesSecret":10,_process:5,"fbjs/lib/emptyFunction":1,"fbjs/lib/invariant":2,"fbjs/lib/warning":3}],9:[function(t,e,n){(function(n){if("production"!==n.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,o=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},i=!0;e.exports=t("./factoryWithTypeCheckers")(o,i)}else e.exports=t("./factoryWithThrowingShims")()}).call(this,t("_process"))},{"./factoryWithThrowingShims":7,"./factoryWithTypeCheckers":8,_process:5}],10:[function(t,e,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=r},{}],11:[function(t,e,n){(function(e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function u(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)}Object.defineProperty(n,"__esModule",{value:!0}),n.Chart=n.defaults=n.Bubble=n.Polar=n.Radar=n.HorizontalBar=n.Bar=n.Line=n.Pie=n.Doughnut=void 0;var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,l=r(f),p=t("prop-types"),d=r(p),h="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof e?e.ReactDOM:null,y=r(h),v="undefined"!=typeof window?window.Chart:"undefined"!=typeof e?e.Chart:null,b=r(v),_=t("lodash.isequal"),g=r(_),m=function(t){function e(){var t,n,r,o;i(this,e);for(var u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];return n=r=a(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(c))),r.handleOnClick=function(t){var e=r.chart_instance,n=r.props,o=n.getDatasetAtEvent,i=n.getElementAtEvent,a=n.getElementsAtEvent,u=n.onElementsClick;o&&o(e.getDatasetAtEvent(t),t),i&&i(e.getElementAtEvent(t),t),a&&a(e.getElementsAtEvent(t),t),u&&u(e.getElementsAtEvent(t),t)},o=n,a(r,o)}return u(e,t),s(e,[{key:"componentWillMount",value:function(){this.chart_instance=void 0}},{key:"componentDidMount",value:function(){this.renderChart()}},{key:"componentDidUpdate",value:function(){return this.props.redraw?(this.chart_instance.destroy(),void this.renderChart()):void this.updateChart()}},{key:"shouldComponentUpdate",value:function(t){var e=this.props,n=(e.redraw,e.type),r=e.options,o=e.plugins,i=e.legend,a=e.height,u=e.width;if(t.redraw===!0)return!0;if(a!==t.height||u!==t.width)return!0;if(n!==t.type)return!0;if(!(0,g["default"])(i,t.legend))return!0;if(!(0,g["default"])(r,t.options))return!0;var c=this.transformDataProp(t);return!(0,g["default"])(this.shadowDataProp,c)||!(0,g["default"])(o,t.plugins)}},{key:"componentWillUnmount",value:function(){this.chart_instance.destroy()}},{key:"transformDataProp",value:function(t){var e=t.data;if("function"==typeof e){var n=y["default"].findDOMNode(this);return e(n)}return e}},{key:"memoizeDataProps",value:function(){if(this.props.data){var t=this.transformDataProp(this.props);return this.shadowDataProp=c({},t,{datasets:t.datasets&&t.datasets.map(function(t){return c({},t)})}),t}}},{key:"updateChart",value:function(){var t=this,e=this.props.options,n=this.memoizeDataProps(this.props);if(this.chart_instance){e&&(this.chart_instance.options=b["default"].helpers.configMerge(this.chart_instance.options,e));for(var r=this.chart_instance.config.data&&this.chart_instance.config.data.datasets||[],i=n.datasets||[],a=r.map(this.props.datasetKeyProvider),u=i.map(this.props.datasetKeyProvider),s=i.filter(function(e){return a.indexOf(t.props.datasetKeyProvider(e))===-1}),f=function(e){var n=t.props.datasetKeyProvider(r[e]);if(u.indexOf(n)===-1)r.splice(e,1);else{var a=i.find(function(e){return t.props.datasetKeyProvider(e)===n});if(a){r[e].data.splice(a.data.length),a.data.forEach(function(t,n){r[e].data[n]=a.data[n]});var s=(a.data,o(a,["data"]));r[e]=c({data:r[e].data},r[e],s)}}},l=r.length-1;l>=0;l-=1)f(l);s.forEach(function(t){return r.push(t)});var p=(n.datasets,o(n,["datasets"]));this.chart_instance.config.data=c({},this.chart_instance.config.data,p),this.chart_instance.update()}}},{key:"renderChart",value:function(){var t=this.props,e=t.options,n=(t.legend,t.type),r=(t.redraw,t.plugins),o=y["default"].findDOMNode(this),i=this.memoizeDataProps();this.chart_instance=new b["default"](o,{type:n,data:i,options:e,plugins:r})}},{key:"render",value:function(){var t=this.props,e=t.height,n=t.width;t.onElementsClick;return l["default"].createElement("canvas",{height:e,width:n,onClick:this.handleOnClick})}}]),e}(l["default"].Component);m.getLabelAsKey=function(t){return t.label},m.propTypes={data:d["default"].oneOfType([d["default"].object,d["default"].func]).isRequired,getDatasetAtEvent:d["default"].func,getElementAtEvent:d["default"].func,getElementsAtEvent:d["default"].func,height:d["default"].number,legend:d["default"].object,onElementsClick:d["default"].func,options:d["default"].object,plugins:d["default"].arrayOf(d["default"].object),redraw:d["default"].bool,type:d["default"].oneOf(["doughnut","pie","line","bar","horizontalBar","radar","polarArea","bubble"]),width:d["default"].number,datasetKeyProvider:d["default"].func},m.defaultProps={legend:{display:!0,position:"bottom"},type:"doughnut",height:150,width:300,redraw:!1,options:{},datasetKeyProvider:m.getLabelAsKey},n["default"]=m;n.Doughnut=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"doughnut"}))}}]),e}(l["default"].Component),n.Pie=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"pie"}))}}]),e}(l["default"].Component),n.Line=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"line"}))}}]),e}(l["default"].Component),n.Bar=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"bar"}))}}]),e}(l["default"].Component),n.HorizontalBar=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"horizontalBar"}))}}]),e}(l["default"].Component),n.Radar=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"radar"}))}}]),e}(l["default"].Component),n.Polar=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"polarArea"}))}}]),e}(l["default"].Component),n.Bubble=function(t){function e(){return i(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),s(e,[{key:"render",value:function(){var t=this;return l["default"].createElement(m,c({},this.props,{ref:function(e){return t.chart_instance=e&&e.chart_instance},type:"bubble"}))}}]),e}(l["default"].Component),n.defaults=b["default"].defaults;n.Chart=b["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash.isequal":4,"prop-types":9}]},{},[11])(11)}); |
136
lib/index.js
@@ -16,2 +16,6 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _reactDom = require('react-dom'); | ||
@@ -98,2 +102,3 @@ | ||
options = _props.options, | ||
plugins = _props.plugins, | ||
legend = _props.legend, | ||
@@ -125,3 +130,8 @@ height = _props.height, | ||
var nextData = this.transformDataProp(nextProps); | ||
return !(0, _lodash2.default)(this.shadowDataProp, nextData); | ||
if (!(0, _lodash2.default)(this.shadowDataProp, nextData)) { | ||
return true; | ||
} | ||
return !(0, _lodash2.default)(plugins, nextProps.plugins); | ||
} | ||
@@ -138,3 +148,3 @@ }, { | ||
if (typeof data == "function") { | ||
if (typeof data == 'function') { | ||
var node = _reactDom2.default.findDOMNode(this); | ||
@@ -172,2 +182,4 @@ return data(node); | ||
value: function updateChart() { | ||
var _this2 = this; | ||
var options = this.props.options; | ||
@@ -189,24 +201,43 @@ | ||
// Prevent charting of legend items that no longer exist | ||
while (currentDatasets.length > nextDatasets.length) { | ||
currentDatasets.pop(); | ||
} | ||
// use the key provider to work out which series have been added/removed/changed | ||
var currentDatasetKeys = currentDatasets.map(this.props.datasetKeyProvider); | ||
var nextDatasetKeys = nextDatasets.map(this.props.datasetKeyProvider); | ||
var newDatasets = nextDatasets.filter(function (d) { | ||
return currentDatasetKeys.indexOf(_this2.props.datasetKeyProvider(d)) === -1; | ||
}); | ||
nextDatasets.forEach(function (dataset, sid) { | ||
if (currentDatasets[sid] && currentDatasets[sid].data) { | ||
currentDatasets[sid].data.splice(nextDatasets[sid].data.length); | ||
// process the updates (via a reverse for loop so we can safely splice deleted datasets out of the array | ||
dataset.data.forEach(function (point, pid) { | ||
currentDatasets[sid].data[pid] = nextDatasets[sid].data[pid]; | ||
var _loop = function _loop(idx) { | ||
var currentDatasetKey = _this2.props.datasetKeyProvider(currentDatasets[idx]); | ||
if (nextDatasetKeys.indexOf(currentDatasetKey) === -1) { | ||
// deleted series | ||
currentDatasets.splice(idx, 1); | ||
} else { | ||
var retainedDataset = nextDatasets.find(function (d) { | ||
return _this2.props.datasetKeyProvider(d) === currentDatasetKey; | ||
}); | ||
if (retainedDataset) { | ||
// update it in place if it is a retained dataset | ||
currentDatasets[idx].data.splice(retainedDataset.data.length); | ||
retainedDataset.data.forEach(function (point, pid) { | ||
currentDatasets[idx].data[pid] = retainedDataset.data[pid]; | ||
}); | ||
var _data = dataset.data, | ||
otherProps = _objectWithoutProperties(dataset, ['data']); | ||
var _data = retainedDataset.data, | ||
otherProps = _objectWithoutProperties(retainedDataset, ['data']); | ||
currentDatasets[sid] = _extends({ | ||
data: currentDatasets[sid].data | ||
}, currentDatasets[sid], otherProps); | ||
} else { | ||
currentDatasets[sid] = nextDatasets[sid]; | ||
currentDatasets[idx] = _extends({ | ||
data: currentDatasets[idx].data | ||
}, currentDatasets[idx], otherProps); | ||
} | ||
} | ||
}; | ||
for (var idx = currentDatasets.length - 1; idx >= 0; idx -= 1) { | ||
_loop(idx); | ||
} | ||
// finally add any new series | ||
newDatasets.forEach(function (d) { | ||
return currentDatasets.push(d); | ||
}); | ||
@@ -228,3 +259,4 @@ | ||
type = _props2.type, | ||
redraw = _props2.redraw; | ||
redraw = _props2.redraw, | ||
plugins = _props2.plugins; | ||
@@ -237,3 +269,4 @@ var node = _reactDom2.default.findDOMNode(this); | ||
data: data, | ||
options: options | ||
options: options, | ||
plugins: plugins | ||
}); | ||
@@ -261,14 +294,20 @@ } | ||
ChartComponent.getLabelAsKey = function (d) { | ||
return d.label; | ||
}; | ||
ChartComponent.propTypes = { | ||
data: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.func]).isRequired, | ||
getDatasetAtEvent: _react.PropTypes.func, | ||
getElementAtEvent: _react.PropTypes.func, | ||
getElementsAtEvent: _react.PropTypes.func, | ||
height: _react.PropTypes.number, | ||
legend: _react.PropTypes.object, | ||
onElementsClick: _react.PropTypes.func, | ||
options: _react.PropTypes.object, | ||
redraw: _react.PropTypes.bool, | ||
type: _react.PropTypes.oneOf(['doughnut', 'pie', 'line', 'bar', 'horizontalBar', 'radar', 'polarArea', 'bubble']), | ||
width: _react.PropTypes.number | ||
data: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]).isRequired, | ||
getDatasetAtEvent: _propTypes2.default.func, | ||
getElementAtEvent: _propTypes2.default.func, | ||
getElementsAtEvent: _propTypes2.default.func, | ||
height: _propTypes2.default.number, | ||
legend: _propTypes2.default.object, | ||
onElementsClick: _propTypes2.default.func, | ||
options: _propTypes2.default.object, | ||
plugins: _propTypes2.default.arrayOf(_propTypes2.default.object), | ||
redraw: _propTypes2.default.bool, | ||
type: _propTypes2.default.oneOf(['doughnut', 'pie', 'line', 'bar', 'horizontalBar', 'radar', 'polarArea', 'bubble']), | ||
width: _propTypes2.default.number, | ||
datasetKeyProvider: _propTypes2.default.func | ||
}; | ||
@@ -284,3 +323,4 @@ ChartComponent.defaultProps = { | ||
redraw: false, | ||
options: {} | ||
options: {}, | ||
datasetKeyProvider: ChartComponent.getLabelAsKey | ||
}; | ||
@@ -301,7 +341,7 @@ exports.default = ChartComponent; | ||
value: function render() { | ||
var _this3 = this; | ||
var _this4 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref2) { | ||
return _this3.chart_instance = _ref2 && _ref2.chart_instance; | ||
return _this4.chart_instance = _ref2 && _ref2.chart_instance; | ||
}, | ||
@@ -328,7 +368,7 @@ type: 'doughnut' | ||
value: function render() { | ||
var _this5 = this; | ||
var _this6 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref3) { | ||
return _this5.chart_instance = _ref3 && _ref3.chart_instance; | ||
return _this6.chart_instance = _ref3 && _ref3.chart_instance; | ||
}, | ||
@@ -355,7 +395,7 @@ type: 'pie' | ||
value: function render() { | ||
var _this7 = this; | ||
var _this8 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref4) { | ||
return _this7.chart_instance = _ref4 && _ref4.chart_instance; | ||
return _this8.chart_instance = _ref4 && _ref4.chart_instance; | ||
}, | ||
@@ -382,7 +422,7 @@ type: 'line' | ||
value: function render() { | ||
var _this9 = this; | ||
var _this10 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref5) { | ||
return _this9.chart_instance = _ref5 && _ref5.chart_instance; | ||
return _this10.chart_instance = _ref5 && _ref5.chart_instance; | ||
}, | ||
@@ -409,7 +449,7 @@ type: 'bar' | ||
value: function render() { | ||
var _this11 = this; | ||
var _this12 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref6) { | ||
return _this11.chart_instance = _ref6 && _ref6.chart_instance; | ||
return _this12.chart_instance = _ref6 && _ref6.chart_instance; | ||
}, | ||
@@ -436,7 +476,7 @@ type: 'horizontalBar' | ||
value: function render() { | ||
var _this13 = this; | ||
var _this14 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref7) { | ||
return _this13.chart_instance = _ref7 && _ref7.chart_instance; | ||
return _this14.chart_instance = _ref7 && _ref7.chart_instance; | ||
}, | ||
@@ -463,7 +503,7 @@ type: 'radar' | ||
value: function render() { | ||
var _this15 = this; | ||
var _this16 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref8) { | ||
return _this15.chart_instance = _ref8 && _ref8.chart_instance; | ||
return _this16.chart_instance = _ref8 && _ref8.chart_instance; | ||
}, | ||
@@ -490,7 +530,7 @@ type: 'polarArea' | ||
value: function render() { | ||
var _this17 = this; | ||
var _this18 = this; | ||
return _react2.default.createElement(ChartComponent, _extends({}, this.props, { | ||
ref: function ref(_ref9) { | ||
return _this17.chart_instance = _ref9 && _ref9.chart_instance; | ||
return _this18.chart_instance = _ref9 && _ref9.chart_instance; | ||
}, | ||
@@ -497,0 +537,0 @@ type: 'bubble' |
{ | ||
"name": "react-chartjs-2", | ||
"version": "2.0.5", | ||
"version": "2.1.0", | ||
"description": "react-chartjs-2", | ||
@@ -16,5 +16,7 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"lodash.isequal": "^4.4.0" | ||
"lodash.isequal": "^4.4.0", | ||
"prop-types": "^15.5.8" | ||
}, | ||
"devDependencies": { | ||
"@kadira/storybook": "^2.35.3", | ||
"babel-core": "^6.18.2", | ||
@@ -38,2 +40,3 @@ "babel-eslint": "^4.1.3", | ||
"mocha": "^3.1.2", | ||
"rcolor": "^1.0.1", | ||
"react": "^0.14 || ^15.0.0-rc || ^15.0", | ||
@@ -63,3 +66,5 @@ "react-addons-test-utils": "^15.3.2", | ||
"test": "mocha test/config/setup.js test/__tests__/**/*", | ||
"watch": "gulp watch:lib" | ||
"watch": "gulp watch:lib", | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook" | ||
}, | ||
@@ -66,0 +71,0 @@ "keywords": [ |
@@ -9,3 +9,3 @@ [![build status]( https://img.shields.io/travis/gor181/react-chartjs-2.svg?branch=master&style=flat-square)](https://travis-ci.org/gor181/react-chartjs-2) | ||
React wrapper for [Chart.js 2](http://www.chartjs.org/docs/#getting-started) | ||
Open for PR's and contributions! | ||
Open for PRs and contributions! | ||
@@ -32,3 +32,14 @@ # UPDATE to 2.x | ||
## Demo & Examples via React Storybook | ||
We have to build the package, then you can run storybook. | ||
```bash | ||
npm run build | ||
npm run storybook | ||
``` | ||
Then open [`localhost:6006`](http://localhost:6006) in a browser. | ||
## Installation via NPM | ||
@@ -35,0 +46,0 @@ |
@@ -215,3 +215,3 @@ import React from 'react'; | ||
it('calls data func with canvas node', () => { | ||
const resultData = { test: 1 } | ||
const resultData = { test: 1 }; | ||
const dataFn = sinon.spy((canvas) => resultData); | ||
@@ -225,3 +225,3 @@ const wrapper = mountComponent({ data: dataFn }); | ||
}); | ||
}) | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
2958051
33
71193
223
5
25
20
+ Addedprop-types@^15.5.8