@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 +40 -0
- package/area-chart-stacked.d.ts +12 -0
- package/area-chart-stacked.js +39 -47
- package/area-chart.d.ts +12 -0
- package/area-chart.js +39 -47
- package/bar-chart-grouped.d.ts +12 -0
- package/bar-chart-grouped.js +39 -47
- package/bar-chart-simple.d.ts +12 -0
- package/bar-chart-simple.js +39 -47
- package/bar-chart-stacked.d.ts +12 -0
- package/bar-chart-stacked.js +39 -47
- package/base-chart.d.ts +17 -0
- package/base-chart.js +46 -53
- package/bubble-chart.d.ts +12 -0
- package/bubble-chart.js +39 -47
- package/bundle.js +1 -1
- package/combo-chart.d.ts +12 -0
- package/combo-chart.js +39 -47
- package/donut-chart.d.ts +12 -0
- package/donut-chart.js +39 -47
- package/gauge-chart.d.ts +12 -0
- package/gauge-chart.js +39 -47
- package/index.d.ts +17 -0
- package/index.js +38 -17
- package/line-chart.d.ts +12 -0
- package/line-chart.js +39 -47
- package/lollipop-chart.d.ts +12 -0
- package/lollipop-chart.js +39 -0
- package/meter-chart.d.ts +12 -0
- package/meter-chart.js +39 -47
- package/package.json +7 -3
- package/pie-chart.d.ts +12 -0
- package/pie-chart.js +39 -47
- package/radar-chart.d.ts +12 -0
- package/radar-chart.js +39 -47
- package/scatter-chart.d.ts +12 -0
- package/scatter-chart.js +39 -47
- package/treemap-chart.d.ts +12 -0
- package/treemap-chart.js +39 -47
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 {};
|
package/area-chart-stacked.js
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
package/area-chart.d.ts
ADDED
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 {};
|
package/bar-chart-grouped.js
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 {};
|
package/bar-chart-simple.js
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 {};
|
package/bar-chart-stacked.js
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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;
|
package/base-chart.d.ts
ADDED
|
@@ -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 {};
|