@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/CHANGELOG.md CHANGED
@@ -3,6 +3,46 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.41.11](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.10...v0.41.11) (2020-12-04)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-react
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.41.10](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.9...v0.41.10) (2020-12-01)
15
+
16
+ **Note:** Version bump only for package @carbon/charts-react
17
+
18
+
19
+
20
+
21
+
22
+ ## [0.41.9](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.8...v0.41.9) (2020-11-27)
23
+
24
+ **Note:** Version bump only for package @carbon/charts-react
25
+
26
+
27
+
28
+
29
+
30
+ ## [0.41.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.7...v0.41.8) (2020-11-26)
31
+
32
+ **Note:** Version bump only for package @carbon/charts-react
33
+
34
+
35
+
36
+
37
+
38
+ ## [0.41.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.6...v0.41.7) (2020-11-26)
39
+
40
+ **Note:** Version bump only for package @carbon/charts-react
41
+
42
+
43
+
44
+
45
+
6
46
  ## [0.41.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.41.5...v0.41.6) (2020-11-20)
7
47
 
8
48
  **Note:** Version bump only for package @carbon/charts-react
@@ -0,0 +1,12 @@
1
+ import { StackedAreaChart as SAC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, StackedAreaChartOptions } from "@carbon/charts/interfaces";
4
+ declare type StackedAreaChartProps = ChartConfig<StackedAreaChartOptions>;
5
+ export default class StackedAreaChart extends BaseChart<StackedAreaChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: StackedAreaChartProps;
8
+ chart: SAC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -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 { StackedAreaChart as SAC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var StackedAreaChart = function (_BaseChart) {
15
- _inherits(StackedAreaChart, _BaseChart);
16
-
17
- function StackedAreaChart() {
18
- _classCallCheck(this, StackedAreaChart);
19
-
20
- return _possibleConstructorReturn(this, (StackedAreaChart.__proto__ || Object.getPrototypeOf(StackedAreaChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(StackedAreaChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new SAC(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 StackedAreaChart;
45
- }(BaseChart);
46
-
47
- export default StackedAreaChart;
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 StackedAreaChart = /** @class */ (function (_super) {
23
+ __extends(StackedAreaChart, _super);
24
+ function StackedAreaChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ StackedAreaChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.StackedAreaChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ StackedAreaChart.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 StackedAreaChart;
38
+ }(base_chart_1.default));
39
+ exports.default = StackedAreaChart;
@@ -0,0 +1,12 @@
1
+ import { AreaChart as AC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, AreaChartOptions } from "@carbon/charts/interfaces";
4
+ declare type AreaChartProps = ChartConfig<AreaChartOptions>;
5
+ export default class AreaChart extends BaseChart<AreaChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: AreaChartProps;
8
+ chart: AC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/area-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 { AreaChart as AC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var AreaChart = function (_BaseChart) {
15
- _inherits(AreaChart, _BaseChart);
16
-
17
- function AreaChart() {
18
- _classCallCheck(this, AreaChart);
19
-
20
- return _possibleConstructorReturn(this, (AreaChart.__proto__ || Object.getPrototypeOf(AreaChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(AreaChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new AC(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 AreaChart;
45
- }(BaseChart);
46
-
47
- export default AreaChart;
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 AreaChart = /** @class */ (function (_super) {
23
+ __extends(AreaChart, _super);
24
+ function AreaChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ AreaChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.AreaChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ AreaChart.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 AreaChart;
38
+ }(base_chart_1.default));
39
+ exports.default = AreaChart;
@@ -0,0 +1,12 @@
1
+ import { GroupedBarChart as GBC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, BarChartOptions } from "@carbon/charts/interfaces";
4
+ declare type GroupedBarChartProps = ChartConfig<BarChartOptions>;
5
+ export default class GroupedBarChart extends BaseChart<BarChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: GroupedBarChartProps;
8
+ chart: GBC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -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 { GroupedBarChart as GBC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var GroupedBarChart = function (_BaseChart) {
15
- _inherits(GroupedBarChart, _BaseChart);
16
-
17
- function GroupedBarChart() {
18
- _classCallCheck(this, GroupedBarChart);
19
-
20
- return _possibleConstructorReturn(this, (GroupedBarChart.__proto__ || Object.getPrototypeOf(GroupedBarChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(GroupedBarChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new GBC(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 GroupedBarChart;
45
- }(BaseChart);
46
-
47
- export default GroupedBarChart;
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 GroupedBarChart = /** @class */ (function (_super) {
23
+ __extends(GroupedBarChart, _super);
24
+ function GroupedBarChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ GroupedBarChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.GroupedBarChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ GroupedBarChart.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 GroupedBarChart;
38
+ }(base_chart_1.default));
39
+ exports.default = GroupedBarChart;
@@ -0,0 +1,12 @@
1
+ import { SimpleBarChart as SBC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, BarChartOptions } from "@carbon/charts/interfaces";
4
+ declare type SimpleBarChartProps = ChartConfig<BarChartOptions>;
5
+ export default class SimpleBarChart extends BaseChart<BarChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: SimpleBarChartProps;
8
+ chart: SBC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -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 { SimpleBarChart as SBC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var SimpleBarChart = function (_BaseChart) {
15
- _inherits(SimpleBarChart, _BaseChart);
16
-
17
- function SimpleBarChart() {
18
- _classCallCheck(this, SimpleBarChart);
19
-
20
- return _possibleConstructorReturn(this, (SimpleBarChart.__proto__ || Object.getPrototypeOf(SimpleBarChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(SimpleBarChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new SBC(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 SimpleBarChart;
45
- }(BaseChart);
46
-
47
- export default SimpleBarChart;
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 SimpleBarChart = /** @class */ (function (_super) {
23
+ __extends(SimpleBarChart, _super);
24
+ function SimpleBarChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ SimpleBarChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.SimpleBarChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ SimpleBarChart.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 SimpleBarChart;
38
+ }(base_chart_1.default));
39
+ exports.default = SimpleBarChart;
@@ -0,0 +1,12 @@
1
+ import { StackedBarChart as SBC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, StackedBarChartOptions } from "@carbon/charts/interfaces";
4
+ declare type StackedBarChartProps = ChartConfig<StackedBarChartOptions>;
5
+ export default class StackedBarChart extends BaseChart<StackedBarChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: StackedBarChartProps;
8
+ chart: SBC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -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 { StackedBarChart as SBC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var StackedBarChart = function (_BaseChart) {
15
- _inherits(StackedBarChart, _BaseChart);
16
-
17
- function StackedBarChart() {
18
- _classCallCheck(this, StackedBarChart);
19
-
20
- return _possibleConstructorReturn(this, (StackedBarChart.__proto__ || Object.getPrototypeOf(StackedBarChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(StackedBarChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new SBC(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 StackedBarChart;
45
- }(BaseChart);
46
-
47
- export default StackedBarChart;
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 StackedBarChart = /** @class */ (function (_super) {
23
+ __extends(StackedBarChart, _super);
24
+ function StackedBarChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ StackedBarChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.StackedBarChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ StackedBarChart.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 StackedBarChart;
38
+ }(base_chart_1.default));
39
+ exports.default = StackedBarChart;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { Chart as BaseChartType } from "@carbon/charts/chart";
3
+ import { ChartTabularData, BaseChartOptions } from "@carbon/charts/interfaces";
4
+ declare type Props<Options> = {
5
+ options?: Options;
6
+ data?: ChartTabularData;
7
+ };
8
+ export default class BaseChart<Options = BaseChartOptions> extends React.Component<Props<Options>> {
9
+ data: ChartTabularData | [];
10
+ options: Options | {};
11
+ props: Props<Options>;
12
+ chart: BaseChartType;
13
+ constructor(props: Props<Options>);
14
+ shouldComponentUpdate(nextProps: Props<Options>): boolean;
15
+ componentDidUpdate(): void;
16
+ }
17
+ export {};