highcharts-react-official
Version:
Official minimal [Highcharts](https://www.highcharts.com/) integration for React.
2 lines • 3.55 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.HighchartsReact=e(require("react")):t.HighchartsReact=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,r){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},n.apply(this,arguments)}function o(t){return a(t)||i(t)||u(t)||c()}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){if(t){if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(t,e):void 0}}function i(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t){if(Array.isArray(t))return f(t)}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t){"@babel/helpers - typeof";return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),r.d(e,"HighchartsReact",function(){return d});var p=r(1),l=r.n(p),y="undefined"!=typeof window?p.useLayoutEffect:p.useEffect,d=Object(p.memo)(Object(p.forwardRef)(function(t,e){var r=Object(p.useRef)(),c=Object(p.useRef)(),u=Object(p.useRef)(t.constructorType),i=Object(p.useRef)(t.highcharts);return y(function(){function e(){var e=t.highcharts||"object"===("undefined"==typeof window?"undefined":s(window))&&window.Highcharts,n=t.constructorType||"chart";e?e[n]?t.options?c.current=e[n](r.current,t.options,t.callback):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.')}if(c.current){if(!1!==t.allowChartUpdate)if(t.constructorType!==u.current||t.highcharts!==i.current)u.current=t.constructorType,i.current=t.highcharts,e();else if(!t.immutable&&c.current){var n;(n=c.current).update.apply(n,[t.options].concat(o(t.updateArgs||[!0,!0])))}else e()}else e()},[t.options,t.allowChartUpdate,t.updateArgs,t.containerProps,t.highcharts,t.constructorType]),y(function(){return function(){c.current&&(c.current.destroy(),c.current=null)}},[]),Object(p.useImperativeHandle)(e,function(){return{get chart(){return c.current},container:r}},[]),l.a.createElement("div",n({},t.containerProps,{ref:r}))}));e.default=d},function(e,r){e.exports=t}])});
//# sourceMappingURL=highcharts-react.min.js.map