UNPKG

highcharts-react-official

Version:

Official minimal [Highcharts](https://www.highcharts.com/) wrapper for React.

2 lines 3.25 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.HighchartsReact=t(require("React")):e.HighchartsReact=t(e.React)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(1),f=function(e){return e&&e.__esModule?e:{default:e}}(s),p=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.container=f.default.createRef(),r}return c(t,e),u(t,[{key:"createChart",value:function(){var e=this.props,t=e.highcharts||window.Highcharts,r=e.constructorType||"chart";t?t[r]?e.options?this.chart=t[r](this.container.current,e.options,e.callback?e.callback:void 0):console.warn('The "options" property was not passed.'):console.warn('The "constructorType" property is incorrect or some required module is not imported.'):console.warn('The "highcharts" property was not passed.')}},{key:"componentDidMount",value:function(){this.createChart()}},{key:"componentDidUpdate",value:function(){var e=this.props;if(!1!==e.allowChartUpdate)if(!e.immutable&&this.chart){var t;(t=this.chart).update.apply(t,[e.options].concat(n(e.updateArgs||[!0,!0])))}else this.createChart()}},{key:"componentWillUnmount",value:function(){this.chart&&(this.chart.destroy(),this.chart=null)}},{key:"render",value:function(){return f.default.createElement("div",i({},this.props.containerProps,{ref:this.container}))}}]),t}(f.default.PureComponent);t.default=p},function(t,r){t.exports=e}])}); //# sourceMappingURL=highcharts-react.min.js.map