@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/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import AreaChart from "./area-chart";
2
+ import StackedAreaChart from "./area-chart-stacked";
3
+ import GroupedBarChart from "./bar-chart-grouped";
4
+ import SimpleBarChart from "./bar-chart-simple";
5
+ import StackedBarChart from "./bar-chart-stacked";
6
+ import BubbleChart from "./bubble-chart";
7
+ import DonutChart from "./donut-chart";
8
+ import GaugeChart from "./gauge-chart";
9
+ import LineChart from "./line-chart";
10
+ import LollipopChart from "./lollipop-chart";
11
+ import PieChart from "./pie-chart";
12
+ import ScatterChart from "./scatter-chart";
13
+ import MeterChart from "./meter-chart";
14
+ import RadarChart from "./radar-chart";
15
+ import ComboChart from "./combo-chart";
16
+ import TreemapChart from "./treemap-chart";
17
+ export { AreaChart, StackedAreaChart, GroupedBarChart, SimpleBarChart, StackedBarChart, BubbleChart, DonutChart, GaugeChart, LineChart, LollipopChart, PieChart, ScatterChart, MeterChart, RadarChart, ComboChart, TreemapChart };
package/index.js CHANGED
@@ -1,17 +1,38 @@
1
- import AreaChart from "./area-chart";
2
- import StackedAreaChart from "./area-chart-stacked";
3
- import GroupedBarChart from "./bar-chart-grouped";
4
- import SimpleBarChart from "./bar-chart-simple";
5
- import StackedBarChart from "./bar-chart-stacked";
6
- import BubbleChart from "./bubble-chart";
7
- import DonutChart from "./donut-chart";
8
- import GaugeChart from "./gauge-chart";
9
- import LineChart from "./line-chart";
10
- import PieChart from "./pie-chart";
11
- import ScatterChart from "./scatter-chart";
12
- import MeterChart from "./meter-chart";
13
- import RadarChart from "./radar-chart";
14
- import ComboChart from "./combo-chart";
15
- import TreemapChart from "./treemap-chart";
16
-
17
- export { AreaChart, StackedAreaChart, GroupedBarChart, SimpleBarChart, StackedBarChart, BubbleChart, DonutChart, GaugeChart, LineChart, PieChart, ScatterChart, MeterChart, RadarChart, ComboChart, TreemapChart };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TreemapChart = exports.ComboChart = exports.RadarChart = exports.MeterChart = exports.ScatterChart = exports.PieChart = exports.LollipopChart = exports.LineChart = exports.GaugeChart = exports.DonutChart = exports.BubbleChart = exports.StackedBarChart = exports.SimpleBarChart = exports.GroupedBarChart = exports.StackedAreaChart = exports.AreaChart = void 0;
7
+ var area_chart_1 = __importDefault(require("./area-chart"));
8
+ exports.AreaChart = area_chart_1.default;
9
+ var area_chart_stacked_1 = __importDefault(require("./area-chart-stacked"));
10
+ exports.StackedAreaChart = area_chart_stacked_1.default;
11
+ var bar_chart_grouped_1 = __importDefault(require("./bar-chart-grouped"));
12
+ exports.GroupedBarChart = bar_chart_grouped_1.default;
13
+ var bar_chart_simple_1 = __importDefault(require("./bar-chart-simple"));
14
+ exports.SimpleBarChart = bar_chart_simple_1.default;
15
+ var bar_chart_stacked_1 = __importDefault(require("./bar-chart-stacked"));
16
+ exports.StackedBarChart = bar_chart_stacked_1.default;
17
+ var bubble_chart_1 = __importDefault(require("./bubble-chart"));
18
+ exports.BubbleChart = bubble_chart_1.default;
19
+ var donut_chart_1 = __importDefault(require("./donut-chart"));
20
+ exports.DonutChart = donut_chart_1.default;
21
+ var gauge_chart_1 = __importDefault(require("./gauge-chart"));
22
+ exports.GaugeChart = gauge_chart_1.default;
23
+ var line_chart_1 = __importDefault(require("./line-chart"));
24
+ exports.LineChart = line_chart_1.default;
25
+ var lollipop_chart_1 = __importDefault(require("./lollipop-chart"));
26
+ exports.LollipopChart = lollipop_chart_1.default;
27
+ var pie_chart_1 = __importDefault(require("./pie-chart"));
28
+ exports.PieChart = pie_chart_1.default;
29
+ var scatter_chart_1 = __importDefault(require("./scatter-chart"));
30
+ exports.ScatterChart = scatter_chart_1.default;
31
+ var meter_chart_1 = __importDefault(require("./meter-chart"));
32
+ exports.MeterChart = meter_chart_1.default;
33
+ var radar_chart_1 = __importDefault(require("./radar-chart"));
34
+ exports.RadarChart = radar_chart_1.default;
35
+ var combo_chart_1 = __importDefault(require("./combo-chart"));
36
+ exports.ComboChart = combo_chart_1.default;
37
+ var treemap_chart_1 = __importDefault(require("./treemap-chart"));
38
+ exports.TreemapChart = treemap_chart_1.default;
@@ -0,0 +1,12 @@
1
+ import { LineChart as LC } from "@carbon/charts";
2
+ import { ChartConfig, LineChartOptions } from "@carbon/charts/interfaces";
3
+ import BaseChart from "./base-chart";
4
+ declare type LineChartProps = ChartConfig<LineChartOptions>;
5
+ export default class LineChart extends BaseChart<LineChartOptions> {
6
+ chartRef?: HTMLDivElement;
7
+ props: LineChartProps;
8
+ chart: LC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/line-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 { LineChart as LC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var LineChart = function (_BaseChart) {
15
- _inherits(LineChart, _BaseChart);
16
-
17
- function LineChart() {
18
- _classCallCheck(this, LineChart);
19
-
20
- return _possibleConstructorReturn(this, (LineChart.__proto__ || Object.getPrototypeOf(LineChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(LineChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new LC(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 LineChart;
45
- }(BaseChart);
46
-
47
- export default LineChart;
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 LineChart = /** @class */ (function (_super) {
23
+ __extends(LineChart, _super);
24
+ function LineChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ LineChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.LineChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ LineChart.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 LineChart;
38
+ }(base_chart_1.default));
39
+ exports.default = LineChart;
@@ -0,0 +1,12 @@
1
+ import { LollipopChart as LC } from "@carbon/charts";
2
+ import { ChartConfig, LollipopChartOptions } from "@carbon/charts/interfaces";
3
+ import BaseChart from "./base-chart";
4
+ declare type LollipopChartProps = ChartConfig<LollipopChartOptions>;
5
+ export default class LollipopChart extends BaseChart<LollipopChartOptions> {
6
+ chartRef?: HTMLDivElement;
7
+ props: LollipopChartProps;
8
+ chart: LC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -0,0 +1,39 @@
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 LollipopChart = /** @class */ (function (_super) {
23
+ __extends(LollipopChart, _super);
24
+ function LollipopChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ LollipopChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.LollipopChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ LollipopChart.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 LollipopChart;
38
+ }(base_chart_1.default));
39
+ exports.default = LollipopChart;
@@ -0,0 +1,12 @@
1
+ import { MeterChart as MC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, MeterChartOptions } from "@carbon/charts/interfaces";
4
+ declare type MeterChartProps = ChartConfig<MeterChartOptions>;
5
+ export default class MeterChart extends BaseChart<MeterChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: MeterChartProps;
8
+ chart: MC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/meter-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 { MeterChart as MC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var MeterChart = function (_BaseChart) {
15
- _inherits(MeterChart, _BaseChart);
16
-
17
- function MeterChart() {
18
- _classCallCheck(this, MeterChart);
19
-
20
- return _possibleConstructorReturn(this, (MeterChart.__proto__ || Object.getPrototypeOf(MeterChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(MeterChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new MC(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 MeterChart;
45
- }(BaseChart);
46
-
47
- export default MeterChart;
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 MeterChart = /** @class */ (function (_super) {
23
+ __extends(MeterChart, _super);
24
+ function MeterChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ MeterChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.MeterChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ MeterChart.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 MeterChart;
38
+ }(base_chart_1.default));
39
+ exports.default = MeterChart;
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@carbon/charts-react",
3
- "version": "0.41.6",
3
+ "version": "0.41.11",
4
4
  "description": "Carbon charting components for React",
5
5
  "main": "./bundle.js",
6
6
  "module": "./index.js",
7
+ "types": "./index.d.ts",
7
8
  "scripts": {
8
9
  "start": "yarn run storybook",
9
10
  "build": "bash build.sh",
10
11
  "storybook": "start-storybook -p 9006 -c .storybook -s ./assets",
11
- "demo:build": "build-storybook -o demo/bundle --quiet",
12
+ "demo:build": "yarn build && build-storybook -o demo/bundle --quiet",
12
13
  "clean": "rm -rf dist demo/bundle"
13
14
  },
14
15
  "repository": {
@@ -46,7 +47,7 @@
46
47
  },
47
48
  "homepage": "https://github.com/carbon-design-system/carbon-charts#readme",
48
49
  "dependencies": {
49
- "@carbon/charts": "^0.41.6"
50
+ "@carbon/charts": "^0.41.11"
50
51
  },
51
52
  "peerDependencies": {
52
53
  "react": "^16.6.3",
@@ -56,6 +57,8 @@
56
57
  "@storybook/addon-knobs": "5.3.12",
57
58
  "@storybook/addon-options": "5.3.12",
58
59
  "@storybook/react": "5.3.12",
60
+ "@types/react": "17.0.0",
61
+ "@types/react-dom": "17.0.0",
59
62
  "babel-cli": "6.26.0",
60
63
  "babel-core": "6.26.0",
61
64
  "babel-loader": "7.1.2",
@@ -76,6 +79,7 @@
76
79
  "sass": "1.25.0",
77
80
  "sass-loader": "8.0.0",
78
81
  "style-loader": "0.19.0",
82
+ "typescript": "4.1.2",
79
83
  "url-loader": "0.6.2"
80
84
  },
81
85
  "publishConfig": {
package/pie-chart.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { PieChart as PC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, PieChartOptions } from "@carbon/charts/interfaces";
4
+ declare type PieChartProps = ChartConfig<PieChartOptions>;
5
+ export default class PieChart extends BaseChart<PieChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: PieChartProps;
8
+ chart: PC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/pie-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 { PieChart as PC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var PieChart = function (_BaseChart) {
15
- _inherits(PieChart, _BaseChart);
16
-
17
- function PieChart() {
18
- _classCallCheck(this, PieChart);
19
-
20
- return _possibleConstructorReturn(this, (PieChart.__proto__ || Object.getPrototypeOf(PieChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(PieChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new PC(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 PieChart;
45
- }(BaseChart);
46
-
47
- export default PieChart;
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 PieChart = /** @class */ (function (_super) {
23
+ __extends(PieChart, _super);
24
+ function PieChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ PieChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.PieChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ PieChart.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 PieChart;
38
+ }(base_chart_1.default));
39
+ exports.default = PieChart;
@@ -0,0 +1,12 @@
1
+ import { RadarChart as RC } from "@carbon/charts";
2
+ import BaseChart from "./base-chart";
3
+ import { ChartConfig, RadarChartOptions } from "@carbon/charts/interfaces";
4
+ declare type RadarChartProps = ChartConfig<RadarChartOptions>;
5
+ export default class RadarChart extends BaseChart<RadarChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: RadarChartProps;
8
+ chart: RC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
package/radar-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 { RadarChart as RC } from "@carbon/charts";
12
- import BaseChart from "./base-chart";
13
-
14
- var RadarChart = function (_BaseChart) {
15
- _inherits(RadarChart, _BaseChart);
16
-
17
- function RadarChart() {
18
- _classCallCheck(this, RadarChart);
19
-
20
- return _possibleConstructorReturn(this, (RadarChart.__proto__ || Object.getPrototypeOf(RadarChart)).apply(this, arguments));
21
- }
22
-
23
- _createClass(RadarChart, [{
24
- key: "componentDidMount",
25
- value: function componentDidMount() {
26
- this.chart = new RC(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 RadarChart;
45
- }(BaseChart);
46
-
47
- export default RadarChart;
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 RadarChart = /** @class */ (function (_super) {
23
+ __extends(RadarChart, _super);
24
+ function RadarChart() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ RadarChart.prototype.componentDidMount = function () {
28
+ this.chart = new charts_1.RadarChart(this.chartRef, {
29
+ data: this.props.data,
30
+ options: this.props.options,
31
+ });
32
+ };
33
+ RadarChart.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 RadarChart;
38
+ }(base_chart_1.default));
39
+ exports.default = RadarChart;
@@ -0,0 +1,12 @@
1
+ import { ScatterChart as SC } from "@carbon/charts";
2
+ import { ChartConfig, ScatterChartOptions } from "@carbon/charts/interfaces";
3
+ import BaseChart from "./base-chart";
4
+ declare type ScatterChartProps = ChartConfig<ScatterChartOptions>;
5
+ export default class ScatterChart extends BaseChart<ScatterChartOptions> {
6
+ chartRef: HTMLDivElement;
7
+ props: ScatterChartProps;
8
+ chart: SC;
9
+ componentDidMount(): void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};