You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

react-highcharts

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.0 to 8.0.0

bundle/RedrawOnPrint.js

2

dist/index.js

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

!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.index=r(require("react")):t.index=r(t.react)}(this,function(t){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){t.exports=e(3)},function(r,e){r.exports=t},function(t,r,e){"use strict";var o=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};if("undefined"==typeof Highcharts)throw Error("Starting with version 3 of react-highcharts, Highcharts is not bundled by default. please include highcharts. ");!function(r){if(!r&&(r=e(1),!r))throw Error("react-highcharts does not include React");t.exports=function(t,e){var n="Highcharts"+e,i=r.createClass({displayName:n,propTypes:{config:r.PropTypes.object.isRequired,isPureConfig:r.PropTypes.bool},renderChart:function(r){if(!r)throw new Error("Config must be specified for the "+n+" component");var i=r.chart;this.chart=new t[e](o({},r,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(t){return this.props.isPureConfig&&this.props.config===t.config||this.renderChart(t.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var t=this.props;return t=o({},t,{ref:"chart"}),r.createElement("div",t)}});return i.Highcharts=t,i}}("undefined"!=typeof React&&React)},function(t,r,e){"use strict";var o=e(2);t.exports=o(Highcharts,"Chart")}])});
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("highcharts")):"function"==typeof define&&define.amd?define(["react","highcharts"],t):"object"==typeof exports?exports.index=t(require("react"),require("highcharts")):r.index=t(r.React,r.Highcharts)}(this,function(r,t){return function(r){function t(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return r[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){r.exports=e(3)},function(t,e){t.exports=r},function(r,t,e){"use strict";var o=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},n=e(1);r.exports=function(r,t){var e="Highcharts"+r,i=n.createClass({displayName:e,propTypes:{config:n.PropTypes.object.isRequired,isPureConfig:n.PropTypes.bool},renderChart:function(n){if(!n)throw new Error("Config must be specified for the "+e+" component");var i=n.chart;this.chart=new t[r](o({},n,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(r){return this.props.isPureConfig&&this.props.config===r.config||this.renderChart(r.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var r=this.props;return r=o({},r,{ref:"chart"}),n.createElement("div",r)}});return i.Highcharts=t,i}},function(r,t,e){"use strict";r.exports=e(2)("Chart",e(4))},function(r,e){r.exports=t}])});
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
module.exports = factory(require("react"), require("highcharts"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
define(["react", "highcharts"], factory);
else if(typeof exports === 'object')
exports["index"] = factory(require("react"));
exports["index"] = factory(require("react"), require("highcharts"));
else
root["index"] = factory(root["react"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {
root["index"] = factory(root["React"], root["Highcharts"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__) {
return /******/ (function(modules) { // webpackBootstrap

@@ -66,4 +66,3 @@ /******/ // The module cache

var chartFactory = __webpack_require__(2);
module.exports = chartFactory(Highcharts, 'Chart');
module.exports = __webpack_require__(2)('Chart', __webpack_require__(4));

@@ -78,67 +77,57 @@ /***/ },

if (typeof Highcharts === 'undefined') {
throw Error('Starting with version 3 of react-highcharts, Highcharts is not bundled by default. ' + ' please include highcharts. ');
}
var React = __webpack_require__(3);
(function (React) {
if (!React) {
React = __webpack_require__(3);
if (!React) {
throw Error("react-highcharts does not include React");
}
}
module.exports = function (chartType, Highcharts) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
module.exports = function (Highcharts, chartType) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
result.Highcharts = Highcharts;
return result;
};
})(typeof React !== 'undefined' && React);
result.Highcharts = Highcharts;
return result;
};

@@ -151,2 +140,8 @@ /***/ },

/***/ },
/* 4 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
/***/ }

@@ -153,0 +148,0 @@ /******/ ])

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

!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.ReactHighcharts=r(require("react")):t.ReactHighcharts=r(t.react)}(this,function(t){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){t.exports=e(3)},function(r,e){r.exports=t},function(t,r,e){"use strict";var o=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};if("undefined"==typeof Highcharts)throw Error("Starting with version 3 of react-highcharts, Highcharts is not bundled by default. please include highcharts. ");!function(r){if(!r&&(r=e(1),!r))throw Error("react-highcharts does not include React");t.exports=function(t,e){var n="Highcharts"+e,i=r.createClass({displayName:n,propTypes:{config:r.PropTypes.object.isRequired,isPureConfig:r.PropTypes.bool},renderChart:function(r){if(!r)throw new Error("Config must be specified for the "+n+" component");var i=r.chart;this.chart=new t[e](o({},r,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(t){return this.props.isPureConfig&&this.props.config===t.config||this.renderChart(t.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var t=this.props;return t=o({},t,{ref:"chart"}),r.createElement("div",t)}});return i.Highcharts=t,i}}("undefined"!=typeof React&&React)},function(t,r,e){"use strict";var o=e(2);t.exports=o(Highcharts,"Chart")}])});
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("highcharts")):"function"==typeof define&&define.amd?define(["react","highcharts"],t):"object"==typeof exports?exports.ReactHighcharts=t(require("react"),require("highcharts")):r.ReactHighcharts=t(r.React,r.Highcharts)}(this,function(r,t){return function(r){function t(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return r[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){r.exports=e(3)},function(t,e){t.exports=r},function(r,t,e){"use strict";var o=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},n=e(1);r.exports=function(r,t){var e="Highcharts"+r,i=n.createClass({displayName:e,propTypes:{config:n.PropTypes.object.isRequired,isPureConfig:n.PropTypes.bool},renderChart:function(n){if(!n)throw new Error("Config must be specified for the "+e+" component");var i=n.chart;this.chart=new t[r](o({},n,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(r){return this.props.isPureConfig&&this.props.config===r.config||this.renderChart(r.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var r=this.props;return r=o({},r,{ref:"chart"}),n.createElement("div",r)}});return i.Highcharts=t,i}},function(r,t,e){"use strict";r.exports=e(2)("Chart",e(4))},function(r,e){r.exports=t}])});
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
module.exports = factory(require("react"), require("highcharts"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
define(["react", "highcharts"], factory);
else if(typeof exports === 'object')
exports["ReactHighcharts"] = factory(require("react"));
exports["ReactHighcharts"] = factory(require("react"), require("highcharts"));
else
root["ReactHighcharts"] = factory(root["react"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {
root["ReactHighcharts"] = factory(root["React"], root["Highcharts"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__) {
return /******/ (function(modules) { // webpackBootstrap

@@ -66,4 +66,3 @@ /******/ // The module cache

var chartFactory = __webpack_require__(2);
module.exports = chartFactory(Highcharts, 'Chart');
module.exports = __webpack_require__(2)('Chart', __webpack_require__(4));

@@ -78,67 +77,57 @@ /***/ },

if (typeof Highcharts === 'undefined') {
throw Error('Starting with version 3 of react-highcharts, Highcharts is not bundled by default. ' + ' please include highcharts. ');
}
var React = __webpack_require__(3);
(function (React) {
if (!React) {
React = __webpack_require__(3);
if (!React) {
throw Error("react-highcharts does not include React");
}
}
module.exports = function (chartType, Highcharts) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
module.exports = function (Highcharts, chartType) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
result.Highcharts = Highcharts;
return result;
};
})(typeof React !== 'undefined' && React);
result.Highcharts = Highcharts;
return result;
};

@@ -151,2 +140,8 @@ /***/ },

/***/ },
/* 4 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
/***/ }

@@ -153,0 +148,0 @@ /******/ ])

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

!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.ReactHighmaps=r(require("react")):t.ReactHighmaps=r(t.react)}(this,function(t){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){t.exports=e(4)},function(r,e){r.exports=t},function(t,r,e){"use strict";var o=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};if("undefined"==typeof Highcharts)throw Error("Starting with version 3 of react-highcharts, Highcharts is not bundled by default. please include highcharts. ");!function(r){if(!r&&(r=e(1),!r))throw Error("react-highcharts does not include React");t.exports=function(t,e){var n="Highcharts"+e,i=r.createClass({displayName:n,propTypes:{config:r.PropTypes.object.isRequired,isPureConfig:r.PropTypes.bool},renderChart:function(r){if(!r)throw new Error("Config must be specified for the "+n+" component");var i=r.chart;this.chart=new t[e](o({},r,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(t){return this.props.isPureConfig&&this.props.config===t.config||this.renderChart(t.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var t=this.props;return t=o({},t,{ref:"chart"}),r.createElement("div",t)}});return i.Highcharts=t,i}}("undefined"!=typeof React&&React)},,function(t,r,e){"use strict";if(Highcharts&&!Highcharts.Map)throw Error("ReactHighmaps requires highmaps to be loaded");var o=e(2);t.exports=o(Highcharts,"Map")}])});
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("highcharts/highmaps")):"function"==typeof define&&define.amd?define(["react","highcharts/highmaps"],t):"object"==typeof exports?exports.ReactHighmaps=t(require("react"),require("highcharts/highmaps")):r.ReactHighmaps=t(r.React,r.Highcharts)}(this,function(r,t){return function(r){function t(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return r[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var e={};return t.m=r,t.c=e,t.p="",t(0)}([function(r,t,e){r.exports=e(5)},function(t,e){t.exports=r},function(r,t,e){"use strict";var o=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},n=e(1);r.exports=function(r,t){var e="Highcharts"+r,i=n.createClass({displayName:e,propTypes:{config:n.PropTypes.object.isRequired,isPureConfig:n.PropTypes.bool},renderChart:function(n){if(!n)throw new Error("Config must be specified for the "+e+" component");var i=n.chart;this.chart=new t[r](o({},n,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(r){return this.props.isPureConfig&&this.props.config===r.config||this.renderChart(r.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var r=this.props;return r=o({},r,{ref:"chart"}),n.createElement("div",r)}});return i.Highcharts=t,i}},,,function(r,t,e){"use strict";r.exports=e(2)("Map",e(8))},,,function(r,e){r.exports=t}])});
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
module.exports = factory(require("react"), require("highcharts/highmaps"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
define(["react", "highcharts/highmaps"], factory);
else if(typeof exports === 'object')
exports["ReactHighmaps"] = factory(require("react"));
exports["ReactHighmaps"] = factory(require("react"), require("highcharts/highmaps"));
else
root["ReactHighmaps"] = factory(root["react"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {
root["ReactHighmaps"] = factory(root["React"], root["Highcharts"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_6__) {
return /******/ (function(modules) { // webpackBootstrap

@@ -57,3 +57,3 @@ /******/ // The module cache

module.exports = __webpack_require__(4);
module.exports = __webpack_require__(5);

@@ -70,67 +70,57 @@

if (typeof Highcharts === 'undefined') {
throw Error('Starting with version 3 of react-highcharts, Highcharts is not bundled by default. ' + ' please include highcharts. ');
}
var React = __webpack_require__(3);
(function (React) {
if (!React) {
React = __webpack_require__(3);
if (!React) {
throw Error("react-highcharts does not include React");
}
}
module.exports = function (chartType, Highcharts) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
module.exports = function (Highcharts, chartType) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
result.Highcharts = Highcharts;
return result;
};
})(typeof React !== 'undefined' && React);
result.Highcharts = Highcharts;
return result;
};

@@ -144,3 +134,4 @@ /***/ },

/***/ },
/* 4 */
/* 4 */,
/* 5 */
/***/ function(module, exports, __webpack_require__) {

@@ -150,8 +141,10 @@

if (Highcharts && !Highcharts.Map) {
throw Error('ReactHighmaps requires highmaps to be loaded');
}
var chartFactory = __webpack_require__(2);
module.exports = chartFactory(Highcharts, 'Map');
module.exports = __webpack_require__(2)('Map', __webpack_require__(6));
/***/ },
/* 6 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
/***/ }

@@ -158,0 +151,0 @@ /******/ ])

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

!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.ReactHighstock=r(require("react")):t.ReactHighstock=r(t.react)}(this,function(t){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){t.exports=e(5)},function(r,e){r.exports=t},function(t,r,e){"use strict";var o=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};if("undefined"==typeof Highcharts)throw Error("Starting with version 3 of react-highcharts, Highcharts is not bundled by default. please include highcharts. ");!function(r){if(!r&&(r=e(1),!r))throw Error("react-highcharts does not include React");t.exports=function(t,e){var n="Highcharts"+e,i=r.createClass({displayName:n,propTypes:{config:r.PropTypes.object.isRequired,isPureConfig:r.PropTypes.bool},renderChart:function(r){if(!r)throw new Error("Config must be specified for the "+n+" component");var i=r.chart;this.chart=new t[e](o({},r,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(t){return this.props.isPureConfig&&this.props.config===t.config||this.renderChart(t.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var t=this.props;return t=o({},t,{ref:"chart"}),r.createElement("div",t)}});return i.Highcharts=t,i}}("undefined"!=typeof React&&React)},,,function(t,r,e){"use strict";if(Highcharts&&!Highcharts.StockChart)throw Error("ReactHighstock requires highstock to be loaded");var o=e(2);t.exports=o(Highcharts,"StockChart")}])});
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("highcharts/highstock")):"function"==typeof define&&define.amd?define(["react","highcharts/highstock"],r):"object"==typeof exports?exports.ReactHighstock=r(require("react"),require("highcharts/highstock")):t.ReactHighstock=r(t.React,t.Highcharts)}(this,function(t,r){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){t.exports=e(6)},function(r,e){r.exports=t},function(t,r,e){"use strict";var o=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},n=e(1);t.exports=function(t,r){var e="Highcharts"+t,i=n.createClass({displayName:e,propTypes:{config:n.PropTypes.object.isRequired,isPureConfig:n.PropTypes.bool},renderChart:function(n){if(!n)throw new Error("Config must be specified for the "+e+" component");var i=n.chart;this.chart=new r[t](o({},n,{chart:o({},i,{renderTo:this.refs.chart})}))},shouldComponentUpdate:function(t){return this.props.isPureConfig&&this.props.config===t.config||this.renderChart(t.config),!0},getChart:function(){if(!this.chart)throw new Error("getChart() should not be called before the component is mounted");return this.chart},componentDidMount:function(){this.renderChart(this.props.config)},render:function(){var t=this.props;return t=o({},t,{ref:"chart"}),n.createElement("div",t)}});return i.Highcharts=r,i}},,,,function(t,r,e){"use strict";t.exports=e(2)("StockChart",e(9))},,,function(t,e){t.exports=r}])});
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
module.exports = factory(require("react"), require("highcharts/highstock"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
define(["react", "highcharts/highstock"], factory);
else if(typeof exports === 'object')
exports["ReactHighstock"] = factory(require("react"));
exports["ReactHighstock"] = factory(require("react"), require("highcharts/highstock"));
else
root["ReactHighstock"] = factory(root["react"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {
root["ReactHighstock"] = factory(root["React"], root["Highcharts"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_8__) {
return /******/ (function(modules) { // webpackBootstrap

@@ -57,3 +57,3 @@ /******/ // The module cache

module.exports = __webpack_require__(5);
module.exports = __webpack_require__(7);

@@ -70,67 +70,57 @@

if (typeof Highcharts === 'undefined') {
throw Error('Starting with version 3 of react-highcharts, Highcharts is not bundled by default. ' + ' please include highcharts. ');
}
var React = __webpack_require__(3);
(function (React) {
if (!React) {
React = __webpack_require__(3);
if (!React) {
throw Error("react-highcharts does not include React");
}
}
module.exports = function (chartType, Highcharts) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
module.exports = function (Highcharts, chartType) {
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
renderChart: function renderChart(config) {
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
var chartConfig = config.chart;
this.chart = new Highcharts[chartType](_extends({}, config, {
chart: _extends({}, chartConfig, {
renderTo: this.refs.chart
})
}));
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
getChart: function getChart() {
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
componentDidMount: function componentDidMount() {
this.renderChart(this.props.config);
},
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
render: function render() {
var props = this.props;
props = _extends({}, props, {
ref: 'chart'
});
return React.createElement('div', props);
}
});
result.Highcharts = Highcharts;
return result;
};
})(typeof React !== 'undefined' && React);
result.Highcharts = Highcharts;
return result;
};

@@ -145,3 +135,5 @@ /***/ },

/* 4 */,
/* 5 */
/* 5 */,
/* 6 */,
/* 7 */
/***/ function(module, exports, __webpack_require__) {

@@ -151,8 +143,10 @@

if (Highcharts && !Highcharts.StockChart) {
throw Error('ReactHighstock requires highstock to be loaded');
}
var chartFactory = __webpack_require__(2);
module.exports = chartFactory(Highcharts, 'StockChart');
module.exports = __webpack_require__(2)('StockChart', __webpack_require__(8));
/***/ },
/* 8 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_8__;
/***/ }

@@ -159,0 +153,0 @@ /******/ ])

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

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.RedrawOnPrint=r(require("react")):e.RedrawOnPrint=r(e.react)}(this,function(e){return function(e){function r(t){if(n[t])return n[t].exports;var i=n[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}var n={};return r.m=e,r.c=n,r.p="",r(0)}([function(e,r,n){e.exports=n(7)},function(r,n){r.exports=e},,,,,,function(e,r,n){"use strict";var t=n(1),i=t.createClass({displayName:"RedrawOnPrint",componentDidMount:function(){if(window.matchMedia){var e=window.matchMedia("print");e.addListener(this._reflowChildren)}},componentWillUnmount:function(){if(window.matchMedia){var e=window.matchMedia("print");e.removeListener(this._reflowChildren)}},_reflowChildren:function(){this.children&&this.children.map(function(e){if(!e||!e.chart)throw new Error("RedrawOnPrint child should be a highcharts");e.chart.reflow()})},render:function(){var e=this;return t.createElement("div",null,t.Children.map(this.props.children,function(r){return t.cloneElement(r,{ref:function(r){e.children||(e.children=[]),e.children.push(r)}})}))}});e.exports=i}])});
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports.RedrawOnPrint=n(require("react")):e.RedrawOnPrint=n(e.React)}(this,function(e){return function(e){function n(t){if(r[t])return r[t].exports;var i=r[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){e.exports=r(7)},function(n,r){n.exports=e},,,,,,function(e,n,r){"use strict";var t=r(1),i=t.createClass({displayName:"RedrawOnPrint",componentDidMount:function(){if(window.matchMedia){var e=window.matchMedia("print");e.addListener(this._reflowChildren)}},componentWillUnmount:function(){if(window.matchMedia){var e=window.matchMedia("print");e.removeListener(this._reflowChildren)}},_reflowChildren:function(){this.children&&this.children.map(function(e){if(!e||!e.chart)throw new Error("RedrawOnPrint child should be a highcharts");e.chart.reflow()})},render:function(){var e=this;return t.createElement("div",null,t.Children.map(this.props.children,function(n){return t.cloneElement(n,{ref:function(n){e.children||(e.children=[]),e.children.push(n)}})}))}});e.exports=i}])});

@@ -9,3 +9,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

else
root["RedrawOnPrint"] = factory(root["react"]);
root["RedrawOnPrint"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {

@@ -54,13 +54,13 @@ return /******/ (function(modules) { // webpackBootstrap

/************************************************************************/
/******/ ([
/* 0 */
/******/ ({
/***/ 0:
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(6);
module.exports = __webpack_require__(9);
/***/ },
/* 1 */,
/* 2 */,
/* 3 */
/***/ 3:
/***/ function(module, exports) {

@@ -71,5 +71,4 @@

/***/ },
/* 4 */,
/* 5 */,
/* 6 */
/***/ 9:
/***/ function(module, exports, __webpack_require__) {

@@ -112,2 +111,3 @@

render: function render() {

@@ -136,4 +136,5 @@ var _this = this;

/***/ }
/******/ ])
/******/ })
});
;
{
"name": "react-highcharts",
"version": "7.0.0",
"version": "8.0.0",
"description": "React wrapper for highcharts",

@@ -8,3 +8,3 @@ "main": "dist/ReactHighcharts.js",

"test": "webpack && mocha",
"build": "webpack && webpack -p",
"build": "webpack && webpack -p && webpack -b && webpack -p -b",
"demo": "cd demo && webpack && sh generate-contents.sh && ../node_modules/.bin/webpack-dev-server --content-base dist/",

@@ -37,10 +37,14 @@ "prepublish": "npm run build && npm run copy-bundles",

"devDependencies": {
"babel-core": "^5.8.22",
"babel-loader": "^5.3.2",
"babel-core": "^6.6.0",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-2": "^6.5.0",
"exports-loader": "^0.6.2",
"file-loader": "^0.8.4",
"highlight.js": "^8.5.0",
"highlight.js": "^9.2.0",
"imports-loader": "^0.6.4",
"jsdom": "^6.3.0",
"jsdom": "^8.1.0",
"mocha": "^2.3.0",
"proxyquire": "^1.7.4",
"raw-loader": "^0.5.1",

@@ -47,0 +51,0 @@ "react": "~0.14",

@@ -8,7 +8,7 @@ react-highcharts

## Demo
* see [example of using react-highcharts](http://kirjs.github.io/react-highcharts/)
* see [example of using react-highcharts/more](http://kirjs.github.io/react-highcharts/more.html)
* see [example of using react-highcharts/highstock](http://kirjs.github.io/react-highcharts/highstock.html)
* see [example of using react-highcharts/highmaps](http://kirjs.github.io/react-highcharts/highmaps.html)
## Demos
[react-highcharts](http://kirjs.github.io/react-highcharts/)
| [react-highcharts/more](http://kirjs.github.io/react-highcharts/more.html)
| [react-highcharts/highstock](http://kirjs.github.io/react-highcharts/highstock.html)
| [react-highcharts/highmaps](http://kirjs.github.io/react-highcharts/highmaps.html)

@@ -19,39 +19,25 @@ You can find the full code for the examples [here](https://github.com/kirjs/react-highcharts/tree/master/demo)

1. Clone the repo
2. run:
```
1. run:
```bash
git clone https://github.com/kirjs/react-highcharts.git
npm install
npm run demo
```
3. Point your browser at http://localhost:8080
2. Point your browser at http://localhost:8080
## Installation
If you are using `React@0.14` just do this:
```bash
npm install react-highcharts --save
```
For `React@0.13` use:
```bash
npm install react-highcharts@^3.0.0 --save
```
## Usage
#### Basic Usage
Check out this [recipe](https://github.com/kirjs/react-highcharts/blob/master/recipes.md#using-with-highcharts-package)
to see how to install `Highcharts` with `npm`.
```jsx
var React = require('react');
var ReactHighcharts = require('react-highcharts'); // Expects that Highcharts was loaded in the code.
var config = {
/* HighchartsConfig */
};
React.render(<ReactHighcharts config = {config}></ReactHighcharts>, document.body);
#### Webpack/Browserify
```bash
npm install react-highcharts highcharts react --save
```
#### Bundled Usage (includes Highcharts)
```jsx
var React = require('react');
var ReactHighcharts = require('react-highcharts/bundle/ReactHighcharts'); // Highcharts is bundled
var Highcharts = require('highcharts');
var ReactHighcharts = require('react-highcharts')(Highcharts); // Expects that Highcharts was loaded in the code.

@@ -65,3 +51,4 @@ var config = {

#### Accessing Highcharts API After Render
For access to methods & properties from the Highcharts library you can use `ReactHighcharts.Highcharts`. For example, the Highcharts options are available via `ReactHighcharts.Highcharts.getOptions()`.
For access to methods & properties from the Highcharts library you can use `ReactHighcharts.Highcharts`.
For example, the Highcharts options are available via `ReactHighcharts.Highcharts.getOptions()`.

@@ -90,14 +77,20 @@ Highcharts provides an API for manipulating a chart after the initial render. See the **Methods and Properties** in [the documentation](http://api.highcharts.com/highcharts). Here's how you access it:

## Using highmaps
Require Highmaps first, and then `require('react-highcharts/ReactHighmaps');`
Or use bundled version: `require('react-highcharts/bundle/ReactHighmaps');`
```javascript
var ReactHighmaps = require('react-highcharts/ReactHighmaps');
```
* see [the demo](http://kirjs.github.io/react-highcharts/highmaps.html)
## Using highstock
Require Highstock first, and then `require('react-highcharts/ReactHighstock');`
Or use bundled version: `require('react-highcharts/bundle/ReactHighstock');`
* see [the demo](http://kirjs.github.io/react-highcharts/highstock.html)
## Using highstock ([demo](http://kirjs.github.io/react-highcharts/highstock.html))
```javascript
var ReactHighstock = require('react-highcharts/ReactHighstock')
```
## Using highcharts modules/add-ons like exporting, data, etc.
Everything related to modules was moved out of `react-highcharts`.
Now every highcharts module is published as a separate npm package.
Use `highcharts-more` npm package.
```javascript
var ReactHighcharts = require('react-highcharts')
require('highcharts-more')(ReactHighcharts.Highcharts)
```
You can find the full list list [here](https://github.com/kirjs/publish-highcharts-modules/blob/master/modules.md)

@@ -107,13 +100,11 @@ * see [the demo](http://kirjs.github.io/react-highcharts/more.html)

## For Contributors
### Update Highcharts Version
1. Install new highcharts version.
```
npm unistall highcharts --save-dev
npm install highcharts --save-dev
```
2. Increment the `react-highcharts` version such that a patch, minor release, or major release of
Higcharts is reflected in a corresponding version increase for `react-highcharts`.
#### Running tests
Run `npm tests`
#### Running demo
Run `npm run demo`
#### Using with React@0.13
```bash
npm install react-highcharts@^3.0.0 --save
```

@@ -26,3 +26,3 @@ # React-highcharts recipes

React.render(<Highcharts config = {config}></Highcharts>, document.body);
React.render(<ReactHighcharts config = {config}></ReactHighcharts>, document.body);
```

@@ -50,3 +50,3 @@

import ReactHighcharts from 'react-highcharts/bundle/ReactHighcharts';
import RedrawOnPrint from 'react-highcharts/RedrawOnPrint';
import RedrawOnPrint from 'react-highcharts/dist/RedrawOnPrint';

@@ -53,0 +53,0 @@ class MyComponent extends React.Component {

@@ -1,4 +0,8 @@

if(typeof global.Highcharts === "undefined") {
global.Highcharts = require("highcharts");
console.warn("ReactHighcharts: Bundled versions are deprecated");
if( typeof global.Highcharts !== "undefined"){
throw Error('ReachHighcharts: Using bundled version, ' +
'but Highcharts already defined.');
}
module.exports = require('../ReactHighcharts.jsx');
module.exports = require('../ReactHighcharts.jsx')(require("highcharts"));

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

if( typeof global.Highcharts !== "undefined" && !global.Highcharts.Map){
throw Error('React-highcharts Highmaps module expects Highmaps to be loaded, ' +
'but looks like a different copy of Highcharts was loaded before that');
console.warn("ReactHighcharts: Bundled versions are deprecated");
if( typeof global.Highcharts !== "undefined"){
throw Error('ReachHighmaps: Using bundled version, ' +
'but Highcharts already defined.');
}
if(typeof global.Highcharts === "undefined" ) {
global.Highcharts = require("highcharts/highmaps");
}
module.exports = require('../Highmaps.jsx');
module.exports = require('../Highmaps.jsx')(require("highcharts/highmaps"));

@@ -1,9 +0,8 @@

if( typeof global.Highcharts !== "undefined" && !global.Highcharts.Map){
throw Error('React-highcharts Highstock module expects Highstock to be loaded, ' +
'but looks like a different copy of Highcharts was loaded before that');
console.warn("ReactHighcharts: Bundled versions are deprecated");
if( typeof global.Highcharts !== "undefined"){
throw Error('ReachHighstock: Using bundled version, ' +
'but Highcharts already defined.');
}
if( typeof global.Highcharts === "undefined" ){
global.Highcharts = require("highcharts/highstock");
}
module.exports = require('../Highstock.jsx');
module.exports = require('../Highstock.jsx')(require("highcharts/highstock"));

@@ -1,71 +0,56 @@

if(typeof Highcharts === 'undefined'){
throw Error('Starting with version 3 of react-highcharts, Highcharts is not bundled by default. ' +
' please include highcharts. '
);
}
var React = require('react');
(function(React){
if(!React){
React = require('react');
if(!React) {
throw Error("react-highcharts does not include React");
}
}
module.exports = function (chartType, Highcharts){
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
module.exports = function (Highcharts, chartType){
var displayName = 'Highcharts' + chartType;
var result = React.createClass({
displayName: displayName,
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
propTypes: {
config: React.PropTypes.object.isRequired,
isPureConfig: React.PropTypes.bool
},
renderChart: function (config){
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
renderChart: function (config){
if (!config) {
throw new Error('Config must be specified for the ' + displayName + ' component');
}
let chartConfig = config.chart;
this.chart = new Highcharts[chartType]({
...config,
chart: {
...chartConfig,
renderTo: this.refs.chart
}
let chartConfig = config.chart;
this.chart = new Highcharts[chartType]({
...config,
chart: {
...chartConfig,
renderTo: this.refs.chart
}
});
},
});
},
shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
shouldComponentUpdate(nextProps) {
if (!this.props.isPureConfig || !(this.props.config === nextProps.config)) {
this.renderChart(nextProps.config);
}
return true;
},
getChart: function (){
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
getChart: function (){
if (!this.chart) {
throw new Error('getChart() should not be called before the component is mounted');
}
return this.chart;
},
componentDidMount: function (){
this.renderChart(this.props.config);
},
componentDidMount: function (){
this.renderChart(this.props.config);
},
render: function (){
let props = this.props;
props = {
...props,
ref: 'chart'
};
return <div {...props} />;
}
});
render: function (){
let props = this.props;
props = { ...props,
ref: 'chart'
};
return <div {...props} />;
}
});
result.Highcharts = Highcharts;
return result;
};
}(typeof React !== 'undefined' && React ));
result.Highcharts = Highcharts;
return result;
};

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

if( Highcharts && !Highcharts.Map){
throw Error('ReactHighmaps requires highmaps to be loaded');
}
var chartFactory = require('./chartsFactory.jsx');
module.exports = chartFactory(Highcharts, 'Map');
module.exports = require('./chartsFactory.jsx')('Map', require("highcharts/highmaps"));

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

if( Highcharts && !Highcharts.StockChart){
throw Error('ReactHighstock requires highstock to be loaded');
}
var chartFactory = require('./chartsFactory.jsx');
module.exports = chartFactory(Highcharts, 'StockChart');
module.exports = require('./chartsFactory.jsx')('StockChart', require("highcharts/highstock"));

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

var chartFactory = require('./chartsFactory.jsx');
module.exports = chartFactory(Highcharts, 'Chart');
module.exports = require('./chartsFactory.jsx')('Chart', require("highcharts"));
var React = require('react');
var assert = require('assert');
var TestUtils = require('react-addons-test-utils');
var proxyquire = require('proxyquire');

@@ -10,3 +11,3 @@ function unCacheLib(path){

for (var i = last; i > 0; i--) {
if(keys[i].indexOf(path) > -1){
if (keys[i].indexOf(path) > -1) {
delete require.cache[keys[i]];

@@ -18,3 +19,3 @@ return;

function nonBundleTest(lib, chartName, extra){
function nonBundleTest(lib, chartName, modulename){
var libPath = 'dist/' + lib + '.src.js';

@@ -25,14 +26,17 @@ describe('react-highcharts/' + lib, function (){

unCacheLib(libPath);
args = undefined;
});
afterEach(function (){
delete global.Highcharts;
});
it('Renders the chart with the appropriate parameters', function (){
global.Highcharts = require('../src/fakeHighcharts');
Component = require('../' + libPath);
var Highcharts = require('../src/fakeHighcharts');
Highcharts[chartName] = function (){
args = Array.prototype.slice.call(arguments);
delete args[0].chart;
};
args = undefined;
var fakeRequire = {};
fakeRequire[modulename] = Highcharts;
Component = proxyquire('../' + libPath, fakeRequire);
config = {

@@ -42,23 +46,8 @@ a: 1

global.Highcharts[chartName] = function (){
args = Array.prototype.slice.call(arguments);
delete args[0].chart;
};
TestUtils.renderIntoDocument(
React.createElement(Component, {config: config})
);
assert.deepEqual(args, [config]);
});
if (extra && extra.shouldThrow) {
it('Should throw if wrong version of Highcharts is loaded', function (){
global.Highcharts = {};
assert.throws(function(){
Component = require('../'+ libPath);
}, lib);
});
}
})

@@ -68,7 +57,7 @@ }

nonBundleTest('ReactHighcharts', 'Chart');
nonBundleTest('ReactHighstock', 'StockChart', {shouldThrow: true});
nonBundleTest('ReactHighmaps', 'Map', {shouldThrow: true});
nonBundleTest('ReactHighcharts', 'Chart', 'highcharts');
nonBundleTest('ReactHighstock', 'StockChart', 'highcharts/highstock');
nonBundleTest('ReactHighmaps', 'Map', 'highcharts/highmaps');
var path = require('path');
/**
* If -p flag is set, minify the files
* @type {boolean}
*/
var src = (process.argv.indexOf('-p') === -1);
var filenamePostfix = src ? '.src': '';
var filenamePostfix = src ? '.src' : '';
/**
* If -b flag is set, build bundles, and not exclude highcharts from the build
* @type {boolean}
*/
var bundles = (process.argv.indexOf('-b') !== -1);
var bundlePrefix = (bundles ? 'bundle/' : '');
var highchartsExternals = {
'highcharts/highmaps': {
root: 'Highcharts',
commonjs2: 'highcharts/highmaps',
commonjs: 'highcharts/highmaps',
amd: 'highcharts/highmaps'
},
'highcharts/highstock': {
root: 'Highcharts',
commonjs2: 'highcharts/highstock',
commonjs: 'highcharts/highstock',
amd: 'highcharts/highstock'
},
'highcharts': {
root: 'Highcharts',
commonjs2: 'highcharts',
commonjs: 'highcharts',
amd: 'highcharts'
}
};
var reactExternals = {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
}
};
var externals = [reactExternals];
if(!bundles){
externals.push(highchartsExternals);
}
module.exports = {

@@ -13,8 +67,3 @@ entry: {

'ReactHighmaps': ['./src/Highmaps.jsx'],
'RedrawOnPrint': ['./src/RedrawOnPrint.jsx'],
'bundle/index': './src/bundle/ReactHighcharts.jsx',
'bundle/ReactHighcharts': './src/bundle/ReactHighcharts.jsx',
'bundle/ReactHighstock': './src/bundle/ReactHighstock.jsx',
'bundle/ReactHighmaps': './src/bundle/ReactHighmaps.jsx'
'RedrawOnPrint': ['./src/RedrawOnPrint.jsx']
},

@@ -25,11 +74,11 @@ module: {

test: /\.jsx$/,
loader: 'babel'
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['react','es2015', 'stage-2']
}
}
]
},
externals: [
{
'react': true
}
],
externals: externals,
resolve: {

@@ -39,3 +88,3 @@ modulesDirectories: ['node_modules']

output: {
filename: 'dist/[name]' + filenamePostfix + '.js',
filename: 'dist/' + bundlePrefix + '[name]' + filenamePostfix + '.js',
libraryTarget: 'umd',

@@ -42,0 +91,0 @@ library: '[name]'

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc