react-chartjs-2
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -59,4 +59,4 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Chart = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
type: 'doughnut', | ||
height: 200, | ||
width: 200, | ||
height: 150, | ||
width: 300, | ||
redraw: false | ||
@@ -63,0 +63,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Chart=e()}}(function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[a]={exports:{}};t[a][0].call(d.exports,function(e){var n=t[a][1][e];return o(n?n:e)},d,d.exports,e,t,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(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return l["default"].createElement(b,s({},e,{type:"doughnut"}))}function i(e){return l["default"].createElement(b,s({},e,{type:"pie"}))}function a(e){return l["default"].createElement(b,s({},e,{type:"line"}))}function u(e){return l["default"].createElement(b,s({},e,{type:"bar"}))}function f(e){return l["default"].createElement(b,s({},e,{type:"horizontalBar"}))}function c(e){return l["default"].createElement(b,s({},e,{type:"radar"}))}function d(e){return l["default"].createElement(b,s({},e,{type:"polarArea"}))}Object.defineProperty(n,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.Doughnut=o,n.Pie=i,n.Line=a,n.Bar=u,n.HorizontalBar=f,n.Radar=c,n.Polar=d;var p="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=r(p),h=e("react-dom"),y=r(h),m=e("chart.js"),v=r(m),g=e("./utils/deepEqual"),w=r(g),b=l["default"].createClass({displayName:"ChartComponent",propTypes:{data:p.PropTypes.object.isRequired,height:p.PropTypes.number,legend:p.PropTypes.object,onElementsClick:p.PropTypes.func,options:p.PropTypes.object,redraw:p.PropTypes.bool,type:p.PropTypes.oneOf(["doughnut","pie","line","bar","horizontalBar","radar","polarArea"]),width:p.PropTypes.number},getDefaultProps:function(){return{legend:{display:!0,position:"bottom"},type:"doughnut",height:200,width:200,redraw:!1}},componentWillMount:function(){this.chart_instance=void 0},componentDidMount:function(){this.renderChart()},componentDidUpdate:function(){this.props.redraw?(this.chart_instance.destroy(),this.renderChart()):this.updateChart()},_objectWithoutProperties:function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},shouldComponentUpdate:function(e,t){var n=this._objectWithoutProperties(e,["id","width","height"]),r=this._objectWithoutProperties(this.props,["id","width","height"]);return!(0,w["default"])(n,r,{strict:!0})},componentWillUnmount:function(){this.chart_instance.destroy()},updateChart:function(){var e=this.props,t=e.data,n=e.options;this.chart_instance&&(n&&(this.chart_instance.options=v["default"].helpers.configMerge(this.chart_instance.options,n)),this.chart_instance.config.data=s({},this.chart_instance.config.data,t),this.chart_instance.update())},renderChart:function(){var e=this.props,t=e.data,n=e.options,r=(e.legend,e.type),o=y["default"].findDOMNode(this);this.chart_instance=new v["default"](o,{type:r,data:t,options:n})},handleOnClick:function(e){var t=this.chart_instance.getElementsAtEvent(e);if(t.length){var n=this.props.onElementsClick;n(t)}},render:function(){var e=this.props,t=e.height,n=e.width,r=e.onElementsClick;return l["default"].createElement("canvas",{height:t,width:n,onClick:"function"==typeof r?this.handleOnClick:null})}});n["default"]=b}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/deepEqual":2,"chart.js":void 0,"react-dom":void 0}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=Object.prototype.hasOwnProperty,o=function(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t},i=function a(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;for(var n=Object.keys(e),i=0;i<n.length;i++)if(!r.call(t,n[i]))return!1;for(var u in e){if(!t.hasOwnProperty(u))return!1;if(!a(e[u],t[u]))return!1}return!0};n["default"]=i,t.exports=n["default"]},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Chart=e()}}(function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[a]={exports:{}};t[a][0].call(d.exports,function(e){var n=t[a][1][e];return o(n?n:e)},d,d.exports,e,t,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(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return l["default"].createElement(b,s({},e,{type:"doughnut"}))}function i(e){return l["default"].createElement(b,s({},e,{type:"pie"}))}function a(e){return l["default"].createElement(b,s({},e,{type:"line"}))}function u(e){return l["default"].createElement(b,s({},e,{type:"bar"}))}function f(e){return l["default"].createElement(b,s({},e,{type:"horizontalBar"}))}function c(e){return l["default"].createElement(b,s({},e,{type:"radar"}))}function d(e){return l["default"].createElement(b,s({},e,{type:"polarArea"}))}Object.defineProperty(n,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.Doughnut=o,n.Pie=i,n.Line=a,n.Bar=u,n.HorizontalBar=f,n.Radar=c,n.Polar=d;var p="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=r(p),h=e("react-dom"),y=r(h),m=e("chart.js"),v=r(m),g=e("./utils/deepEqual"),w=r(g),b=l["default"].createClass({displayName:"ChartComponent",propTypes:{data:p.PropTypes.object.isRequired,height:p.PropTypes.number,legend:p.PropTypes.object,onElementsClick:p.PropTypes.func,options:p.PropTypes.object,redraw:p.PropTypes.bool,type:p.PropTypes.oneOf(["doughnut","pie","line","bar","horizontalBar","radar","polarArea"]),width:p.PropTypes.number},getDefaultProps:function(){return{legend:{display:!0,position:"bottom"},type:"doughnut",height:150,width:300,redraw:!1}},componentWillMount:function(){this.chart_instance=void 0},componentDidMount:function(){this.renderChart()},componentDidUpdate:function(){this.props.redraw?(this.chart_instance.destroy(),this.renderChart()):this.updateChart()},_objectWithoutProperties:function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},shouldComponentUpdate:function(e,t){var n=this._objectWithoutProperties(e,["id","width","height"]),r=this._objectWithoutProperties(this.props,["id","width","height"]);return!(0,w["default"])(n,r,{strict:!0})},componentWillUnmount:function(){this.chart_instance.destroy()},updateChart:function(){var e=this.props,t=e.data,n=e.options;this.chart_instance&&(n&&(this.chart_instance.options=v["default"].helpers.configMerge(this.chart_instance.options,n)),this.chart_instance.config.data=s({},this.chart_instance.config.data,t),this.chart_instance.update())},renderChart:function(){var e=this.props,t=e.data,n=e.options,r=(e.legend,e.type),o=y["default"].findDOMNode(this);this.chart_instance=new v["default"](o,{type:r,data:t,options:n})},handleOnClick:function(e){var t=this.chart_instance.getElementsAtEvent(e);if(t.length){var n=this.props.onElementsClick;n(t)}},render:function(){var e=this.props,t=e.height,n=e.width,r=e.onElementsClick;return l["default"].createElement("canvas",{height:t,width:n,onClick:"function"==typeof r?this.handleOnClick:null})}});n["default"]=b}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/deepEqual":2,"chart.js":void 0,"react-dom":void 0}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=Object.prototype.hasOwnProperty,o=function(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t},i=function a(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;for(var n=Object.keys(e),i=0;i<n.length;i++)if(!r.call(t,n[i]))return!1;for(var u in e){if(!t.hasOwnProperty(u))return!1;if(!a(e[u],t[u]))return!1}return!0};n["default"]=i,t.exports=n["default"]},{}]},{},[1])(1)}); |
@@ -57,4 +57,4 @@ 'use strict'; | ||
type: 'doughnut', | ||
height: 200, | ||
width: 200, | ||
height: 150, | ||
width: 300, | ||
redraw: false | ||
@@ -61,0 +61,0 @@ }; |
{ | ||
"name": "react-chartjs-2", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "react-chartjs-2", | ||
@@ -5,0 +5,0 @@ "main": "lib/Chart.js", |
@@ -28,4 +28,4 @@ import React, {PropTypes} from 'react'; | ||
type: 'doughnut', | ||
height: 200, | ||
width: 200, | ||
height: 150, | ||
width: 300, | ||
redraw: false, | ||
@@ -32,0 +32,0 @@ }; |