From 3ca6e84d88fab1ce00c7417d315916876ed597c0 Mon Sep 17 00:00:00 2001 From: Joe Hudson Date: Sun, 28 Dec 2014 08:20:34 -0500 Subject: [PATCH] v0.1.0 --- .gitignore | 1 + bower.json | 2 +- package.json | 2 +- react-chartjs.js | 33 ++++++++++++++++++++++----------- react-chartjs.min.js | 4 ++-- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 3c7f67a..dfad54d 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ node_modules .DS_Store showcase +.generator-release diff --git a/bower.json b/bower.json index 178ae29..7381981 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "react-chartjs", "main": "react-chartjs.js", - "version": "0.0.1", + "version": "0.1.0", "homepage": "https://github.com/jhudson8/react-chartjs", "authors": [ "Joe Hudson " diff --git a/package.json b/package.json index a02a2f8..cc3a083 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-chartjs", - "version": "0.0.1", + "version": "0.1.0", "description": "react charting components using the chartjs lib", "main": "index.js", "scripts": { diff --git a/react-chartjs.js b/react-chartjs.js index 4bd3aa4..38d30d4 100644 --- a/react-chartjs.js +++ b/react-chartjs.js @@ -1,5 +1,5 @@ /*! - * react-charts v0.0.1 + * react-charts v0.1.0 * https://github.com/jhudson8/react-charts * * @@ -69,16 +69,27 @@ /* 0 */ /***/ function(module, exports, __webpack_require__) { - Chart.React = { - Bar: __webpack_require__(1), - Doughnut: __webpack_require__(2), - Line: __webpack_require__(3), - Pie: __webpack_require__(4), - PolarArea: __webpack_require__(5), - Radar: __webpack_require__(6) - }; - - + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(main) { + if (typeof Chart === 'function') { + // script include + main(Chart); + } else { + // AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { + return main; + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } + })(function(Chart) { + Chart.React = { + Bar: __webpack_require__(1), + Doughnut: __webpack_require__(2), + Line: __webpack_require__(3), + Pie: __webpack_require__(4), + PolarArea: __webpack_require__(5), + Radar: __webpack_require__(6) + }; + return Chart; + }); diff --git a/react-chartjs.min.js b/react-chartjs.min.js index 90efe0b..f454cfc 100644 --- a/react-chartjs.min.js +++ b/react-chartjs.min.js @@ -1,4 +1,4 @@ /*! - * [react-chartjs](https://github.com/jhudson8/react-chartjs) v0.0.1; MIT license; Joe Hudson + * [react-chartjs](https://github.com/jhudson8/react-chartjs) v0.1.0; MIT license; Joe Hudson */ -!function(t){function e(r){if(a[r])return a[r].exports;var n=a[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var a={};return e.m=t,e.c=a,e.p="",e(0)}([function(t,e,a){Chart.React={Bar:a(1),Doughnut:a(2),Line:a(3),Pie:a(4),PolarArea:a(5),Radar:a(6)}},function(t,e,a){var r=a(7);t.exports=r.createClass("Bar",["getBarsAtEvent"])},function(t,e,a){var r=a(7);t.exports=r.createClass("Doughnut",["getSegmentsAtEvent"])},function(t,e,a){var r=a(7);t.exports=r.createClass("Line",["getPointsAtEvent"])},function(t,e,a){var r=a(7);t.exports=r.createClass("Pie",["getSegmentsAtEvent"])},function(t,e,a){var r=a(7);t.exports=r.createClass("PolarArea",["getSegmentsAtEvent"])},function(t,e,a){var r=a(7);t.exports=r.createClass("Radar",["getPointsAtEvent"])},function(t,e){(function(e){t.exports={createClass:function(t,a){function r(t){n[t]=function(){this.state.chart[name].apply(this.state.chart,arguments)}}var n={displayName:t+"Chart",getInitialState:function(){return{}},render:function(){var t={};for(var e in this.props)this.props.hasOwnProperty(e)&&"data"!==e&&"options"!==e&&(t[e]=this.props[e]);return o.createElement("canvas",t)}},i=["clear","stop","resize","toBase64Image","generateLegend","update","addData","removeData"];if(e.Chart){n.componentDidMount=function(){this.initializeChart(this.props)},n.componentWillUnmount=function(){var t=this.state.chart;t.destroy()},n.componentWillReceiveProps=function(t){var e=this.state.chart;e.destroy(),this.initializeChart(t)},n.initializeChart=function(){var e=this.getDOMNode(),a=e.getContext("2d"),r=new Chart(a)[t](this.props.data,this.props.options||{});this.state.chart=r};var s;for(s=0;s