@carbon/charts-react 0.41.6 → 0.41.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/base-chart.js CHANGED
@@ -1,53 +1,46 @@
1
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
-
7
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
-
9
- import React from "react";
10
-
11
- var BaseChart = function (_React$Component) {
12
- _inherits(BaseChart, _React$Component);
13
-
14
- function BaseChart(props) {
15
- _classCallCheck(this, BaseChart);
16
-
17
- var _this = _possibleConstructorReturn(this, (BaseChart.__proto__ || Object.getPrototypeOf(BaseChart)).call(this, props));
18
-
19
- var options = props.options,
20
- data = props.data;
21
-
22
- if (!options) {
23
- console.error("Missing options!");
24
- }
25
-
26
- if (!data) {
27
- console.error("Missing data!");
28
- }
29
-
30
- _this.data = props.data || {};
31
- _this.options = props.options || {};
32
-
33
- Object.assign(_this, _this.chart);
34
- return _this;
35
- }
36
-
37
- _createClass(BaseChart, [{
38
- key: "shouldComponentUpdate",
39
- value: function shouldComponentUpdate(nextProps, nextState) {
40
- return this.props.data !== nextProps.data || this.props.options !== nextProps.options;
41
- }
42
- }, {
43
- key: "componentDidUpdate",
44
- value: function componentDidUpdate() {
45
- this.chart.model.setData(this.props.data);
46
- this.chart.model.setOptions(this.props.options);
47
- }
48
- }]);
49
-
50
- return BaseChart;
51
- }(React.Component);
52
-
53
- export default BaseChart;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ var react_1 = __importDefault(require("react"));
20
+ var BaseChart = /** @class */ (function (_super) {
21
+ __extends(BaseChart, _super);
22
+ function BaseChart(props) {
23
+ var _this = _super.call(this, props) || this;
24
+ var options = props.options, data = props.data;
25
+ if (!options) {
26
+ console.error("Missing options!");
27
+ }
28
+ if (!data) {
29
+ console.error("Missing data!");
30
+ }
31
+ _this.data = props.data || [];
32
+ _this.options = props.options || {};
33
+ Object.assign(_this, _this.chart);
34
+ return _this;
35
+ }
36
+ BaseChart.prototype.shouldComponentUpdate = function (nextProps) {
37
+ return (this.props.data !== nextProps.data ||
38
+ this.props.options !== nextProps.options);
39
+ };
40
+ BaseChart.prototype.componentDidUpdate = function () {
41
+ this.chart.model.setData(this.props.data);
42
+ this.chart.model.setOptions(this.props.options);
43
+ };
44
+ return BaseChart;
45
+ }(react_1.default.Component));
46
+ exports.default = BaseChart;
@@ -0,0 +1,12 @@
1
+ import { BubbleChart as BC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, BubbleChartOptions } from "@carbon/charts/interfaces";
4
+ declare type BubbleChartProps = ChartConfig<BubbleChartOptions>;
5
+ export default class BubbleChart extends BaseChart<BubbleChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: BubbleChartProps;
8
+ chart: BC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/bubble-chart.js CHANGED
@@ -1,47 +1,39 @@
1
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
-
7
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
-
9
- import React from "react";
10
-
11
- import { BubbleChart as BC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var BubbleChart = function (_BaseChart) {
15
- _inherits(BubbleChart, _BaseChart);
16
-
17
- function BubbleChart() {
18
- _classCallCheck(this, BubbleChart);
19
-
20
- return _possibleConstructorReturn(this, (BubbleChart.__proto__ || Object.getPrototypeOf(BubbleChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(BubbleChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new BC(this.chartRef, {
27
- data: this.props.data,
28
- options: this.props.options
29
- });
30
- }
31
- }, {
32
- key: "render",
33
- value: function render() {
34
- var _this2 = this;
35
-
36
- return React.createElement("div", {
37
- ref: function ref(chartRef) {
38
- return _this2.chartRef = chartRef;
39
- },
40
- className: "chart-holder" });
41
- }
42
- }]);
43
-
44
- return BubbleChart;
45
- }(BaseChart);
46
-
47
- export default BubbleChart;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ var react_1 = __importDefault(require("react"));
20
+ var charts_1 = require("@carbon/charts");
21
+ var base_chart_1 = __importDefault(require("./base-chart"));
22
+ var BubbleChart = /** @class */ (function (_super) {
23
+ __extends(BubbleChart, _super);
24
+ function BubbleChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ BubbleChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.BubbleChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ BubbleChart.prototype.render = function () {
34
+ var _this = this;
35
+ return (react_1.default.createElement("div", { ref: function (chartRef) { return (_this.chartRef = chartRef); }, className: "chart-holder" }));
36
+ };
37
+ return BubbleChart;
38
+ }(base_chart_1.default));
39
+ exports.default = BubbleChart;
package/bundle.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("@carbon/charts")):"function"==typeof define&&define.amd?define(["exports","react","@carbon/charts"],e):e((t=t||self).ChartsReact={},t.React,t.Charts)}(this,(function(t,e,n){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var o=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),r=t.options,o=t.data;return r||console.error("Missing options!"),o||console.error("Missing data!"),n.data=t.data||{},n.options=t.options||{},Object.assign(n,n.chart),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"shouldComponentUpdate",value:function(t,e){return this.props.data!==t.data||this.props.options!==t.options}},{key:"componentDidUpdate",value:function(){this.chart.model.setData(this.props.data),this.chart.model.setOptions(this.props.options)}}]),e}(e.Component),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function r(){return a(this,r),c(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),i(r,[{key:"componentDidMount",value:function(){this.chart=new n.AreaChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var l=function(t){function r(){return p(this,r),s(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),f(r,[{key:"componentDidMount",value:function(){this.chart=new n.StackedAreaChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),h=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var d=function(t){function r(){return y(this,r),b(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),h(r,[{key:"componentDidMount",value:function(){this.chart=new n.GroupedBarChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),v=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var _=function(t){function r(){return w(this,r),O(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),v(r,[{key:"componentDidMount",value:function(){this.chart=new n.SimpleBarChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),m=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var P=function(t){function r(){return j(this,r),g(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),m(r,[{key:"componentDidMount",value:function(){this.chart=new n.StackedBarChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),E=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function k(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var R=function(t){function r(){return k(this,r),C(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),E(r,[{key:"componentDidMount",value:function(){this.chart=new n.BubbleChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),T=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var x=function(t){function r(){return S(this,r),M(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),T(r,[{key:"componentDidMount",value:function(){this.chart=new n.DonutChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),D=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var A=function(t){function r(){return N(this,r),B(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),D(r,[{key:"componentDidMount",value:function(){this.chart=new n.GaugeChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),G=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var U=function(t){function r(){return q(this,r),L(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),G(r,[{key:"componentDidMount",value:function(){this.chart=new n.LineChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),z=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var I=function(t){function r(){return F(this,r),H(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),z(r,[{key:"componentDidMount",value:function(){this.chart=new n.PieChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),J=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function K(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var V=function(t){function r(){return K(this,r),Q(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),J(r,[{key:"componentDidMount",value:function(){this.chart=new n.ScatterChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),W=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function X(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Z=function(t){function r(){return X(this,r),Y(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),W(r,[{key:"componentDidMount",value:function(){this.chart=new n.MeterChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),$=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var nt=function(t){function r(){return tt(this,r),et(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),$(r,[{key:"componentDidMount",value:function(){this.chart=new n.RadarChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),rt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var at=function(t){function r(){return ot(this,r),it(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),rt(r,[{key:"componentDidMount",value:function(){this.chart=new n.ComboChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o),ct=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function ut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ft(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var pt=function(t){function r(){return ut(this,r),ft(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),ct(r,[{key:"componentDidMount",value:function(){this.chart=new n.TreemapChart(this.chartRef,{data:this.props.data,options:this.props.options})}},{key:"render",value:function(){var t=this;return e.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})}}]),r}(o);t.AreaChart=u,t.BubbleChart=R,t.ComboChart=at,t.DonutChart=x,t.GaugeChart=A,t.GroupedBarChart=d,t.LineChart=U,t.MeterChart=Z,t.PieChart=I,t.RadarChart=nt,t.ScatterChart=V,t.SimpleBarChart=_,t.StackedAreaChart=l,t.StackedBarChart=P,t.TreemapChart=pt,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("@carbon/charts")):"function"==typeof define&&define.amd?define(["exports","react","@carbon/charts"],e):e((t=t||self).ChartsReact={},t.React,t.Charts)}(this,(function(t,e,r){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,r=r&&r.hasOwnProperty("default")?r.default:r;var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function a(t,e){return t(e={exports:{}},e.exports),e.exports}var u=a((function(t,r){var n,a=o&&o.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),u=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var i=function(t){function e(e){var r=t.call(this,e)||this,o=e.options,n=e.data;return o||console.error("Missing options!"),n||console.error("Missing data!"),r.data=e.data||[],r.options=e.options||{},Object.assign(r,r.chart),r}return a(e,t),e.prototype.shouldComponentUpdate=function(t){return this.props.data!==t.data||this.props.options!==t.options},e.prototype.componentDidUpdate=function(){this.chart.model.setData(this.props.data),this.chart.model.setOptions(this.props.options)},e}(u(e).default.Component);r.default=i}));n(u);var i=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.AreaChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(i);var p=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.StackedAreaChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(p);var c=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.GroupedBarChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(c);var f=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.SimpleBarChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(f);var s=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.StackedBarChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(s);var l=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.BubbleChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(l);var h=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.DonutChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(h);var d=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.GaugeChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(d);var _=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.LineChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(_);var y=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.LollipopChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(y);var v=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.PieChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(v);var O=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.ScatterChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(O);var b=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.MeterChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(b);var C=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.RadarChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(C);var m=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.ComboChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(m);var j=a((function(t,n){var a,i=o&&o.__extends||(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var c=p(e),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.componentDidMount=function(){this.chart=new r.TreemapChart(this.chartRef,{data:this.props.data,options:this.props.options})},e.prototype.render=function(){var t=this;return c.default.createElement("div",{ref:function(e){return t.chartRef=e},className:"chart-holder"})},e}(p(u).default);n.default=f}));n(j);var M=a((function(t,e){var r=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TreemapChart=e.ComboChart=e.RadarChart=e.MeterChart=e.ScatterChart=e.PieChart=e.LollipopChart=e.LineChart=e.GaugeChart=e.DonutChart=e.BubbleChart=e.StackedBarChart=e.SimpleBarChart=e.GroupedBarChart=e.StackedAreaChart=e.AreaChart=void 0;var n=r(i);e.AreaChart=n.default;var a=r(p);e.StackedAreaChart=a.default;var u=r(c);e.GroupedBarChart=u.default;var M=r(f);e.SimpleBarChart=M.default;var P=r(s);e.StackedBarChart=P.default;var w=r(l);e.BubbleChart=w.default;var D=r(h);e.DonutChart=D.default;var R=r(d);e.GaugeChart=R.default;var A=r(_);e.LineChart=A.default;var x=r(y);e.LollipopChart=x.default;var B=r(v);e.PieChart=B.default;var S=r(O);e.ScatterChart=S.default;var E=r(b);e.MeterChart=E.default;var N=r(C);e.RadarChart=N.default;var g=r(m);e.ComboChart=g.default;var k=r(j);e.TreemapChart=k.default})),P=n(M),w=M.TreemapChart,D=M.ComboChart,R=M.RadarChart,A=M.MeterChart,x=M.ScatterChart,B=M.PieChart,S=M.LollipopChart,E=M.LineChart,N=M.GaugeChart,g=M.DonutChart,k=M.BubbleChart,G=M.StackedBarChart,L=M.SimpleBarChart,T=M.GroupedBarChart,q=M.StackedAreaChart,U=M.AreaChart;t.AreaChart=U,t.BubbleChart=k,t.ComboChart=D,t.DonutChart=g,t.GaugeChart=N,t.GroupedBarChart=T,t.LineChart=E,t.LollipopChart=S,t.MeterChart=A,t.PieChart=B,t.RadarChart=R,t.ScatterChart=x,t.SimpleBarChart=L,t.StackedAreaChart=q,t.StackedBarChart=G,t.TreemapChart=w,t.default=P,Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -0,0 +1,12 @@
1
+ import { ComboChart as CC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, ComboChartOptions } from "@carbon/charts/interfaces";
4
+ declare type ComboChartProps = ChartConfig<ComboChartOptions>;
5
+ export default class ComboChart extends BaseChart<ComboChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: ComboChartProps;
8
+ chart: CC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/combo-chart.js CHANGED
@@ -1,47 +1,39 @@
1
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
-
7
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
-
9
- import React from "react";
10
-
11
- import { ComboChart as CC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var ComboChart = function (_BaseChart) {
15
- _inherits(ComboChart, _BaseChart);
16
-
17
- function ComboChart() {
18
- _classCallCheck(this, ComboChart);
19
-
20
- return _possibleConstructorReturn(this, (ComboChart.__proto__ || Object.getPrototypeOf(ComboChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(ComboChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new CC(this.chartRef, {
27
- data: this.props.data,
28
- options: this.props.options
29
- });
30
- }
31
- }, {
32
- key: "render",
33
- value: function render() {
34
- var _this2 = this;
35
-
36
- return React.createElement("div", {
37
- ref: function ref(chartRef) {
38
- return _this2.chartRef = chartRef;
39
- },
40
- className: "chart-holder" });
41
- }
42
- }]);
43
-
44
- return ComboChart;
45
- }(BaseChart);
46
-
47
- export default ComboChart;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ var react_1 = __importDefault(require("react"));
20
+ var charts_1 = require("@carbon/charts");
21
+ var base_chart_1 = __importDefault(require("./base-chart"));
22
+ var ComboChart = /** @class */ (function (_super) {
23
+ __extends(ComboChart, _super);
24
+ function ComboChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ ComboChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.ComboChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ ComboChart.prototype.render = function () {
34
+ var _this = this;
35
+ return (react_1.default.createElement("div", { ref: function (chartRef) { return (_this.chartRef = chartRef); }, className: "chart-holder" }));
36
+ };
37
+ return ComboChart;
38
+ }(base_chart_1.default));
39
+ exports.default = ComboChart;
@@ -0,0 +1,12 @@
1
+ import { DonutChart as DC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, DonutChartOptions } from "@carbon/charts/interfaces";
4
+ declare type DonutChartProps = ChartConfig<DonutChartOptions>;
5
+ export default class DonutChart extends BaseChart<DonutChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: DonutChartProps;
8
+ chart: DC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/donut-chart.js CHANGED
@@ -1,47 +1,39 @@
1
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
-
7
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
-
9
- import React from "react";
10
-
11
- import { DonutChart as DC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var DonutChart = function (_BaseChart) {
15
- _inherits(DonutChart, _BaseChart);
16
-
17
- function DonutChart() {
18
- _classCallCheck(this, DonutChart);
19
-
20
- return _possibleConstructorReturn(this, (DonutChart.__proto__ || Object.getPrototypeOf(DonutChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(DonutChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new DC(this.chartRef, {
27
- data: this.props.data,
28
- options: this.props.options
29
- });
30
- }
31
- }, {
32
- key: "render",
33
- value: function render() {
34
- var _this2 = this;
35
-
36
- return React.createElement("div", {
37
- ref: function ref(chartRef) {
38
- return _this2.chartRef = chartRef;
39
- },
40
- className: "chart-holder" });
41
- }
42
- }]);
43
-
44
- return DonutChart;
45
- }(BaseChart);
46
-
47
- export default DonutChart;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ var react_1 = __importDefault(require("react"));
20
+ var charts_1 = require("@carbon/charts");
21
+ var base_chart_1 = __importDefault(require("./base-chart"));
22
+ var DonutChart = /** @class */ (function (_super) {
23
+ __extends(DonutChart, _super);
24
+ function DonutChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ DonutChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.DonutChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ DonutChart.prototype.render = function () {
34
+ var _this = this;
35
+ return (react_1.default.createElement("div", { ref: function (chartRef) { return (_this.chartRef = chartRef); }, className: "chart-holder" }));
36
+ };
37
+ return DonutChart;
38
+ }(base_chart_1.default));
39
+ exports.default = DonutChart;
@@ -0,0 +1,12 @@
1
+ import { GaugeChart as GC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, GaugeChartOptions } from "@carbon/charts/interfaces";
4
+ declare type GaugeChartProps = ChartConfig<GaugeChartOptions>;
5
+ export default class GaugeChart extends BaseChart<GaugeChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: GaugeChartProps;
8
+ chart: GC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/gauge-chart.js CHANGED
@@ -1,47 +1,39 @@
1
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
-
7
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
-
9
- import React from "react";
10
-
11
- import { GaugeChart as GC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var GaugeChart = function (_BaseChart) {
15
- _inherits(GaugeChart, _BaseChart);
16
-
17
- function GaugeChart() {
18
- _classCallCheck(this, GaugeChart);
19
-
20
- return _possibleConstructorReturn(this, (GaugeChart.__proto__ || Object.getPrototypeOf(GaugeChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(GaugeChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new GC(this.chartRef, {
27
- data: this.props.data,
28
- options: this.props.options
29
- });
30
- }
31
- }, {
32
- key: "render",
33
- value: function render() {
34
- var _this2 = this;
35
-
36
- return React.createElement("div", {
37
- ref: function ref(chartRef) {
38
- return _this2.chartRef = chartRef;
39
- },
40
- className: "chart-holder" });
41
- }
42
- }]);
43
-
44
- return GaugeChart;
45
- }(BaseChart);
46
-
47
- export default GaugeChart;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ var react_1 = __importDefault(require("react"));
20
+ var charts_1 = require("@carbon/charts");
21
+ var base_chart_1 = __importDefault(require("./base-chart"));
22
+ var GaugeChart = /** @class */ (function (_super) {
23
+ __extends(GaugeChart, _super);
24
+ function GaugeChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ GaugeChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.GaugeChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ GaugeChart.prototype.render = function () {
34
+ var _this = this;
35
+ return (react_1.default.createElement("div", { ref: function (chartRef) { return (_this.chartRef = chartRef); }, className: "chart-holder" }));
36
+ };
37
+ return GaugeChart;
38
+ }(base_chart_1.default));
39
+ exports.default = GaugeChart;