@carbon/charts-angular 0.58.0 → 0.59.0-beta.0

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.
Files changed (214) hide show
  1. package/.storybook/addons.js +2 -0
  2. package/.storybook/assets/logo.svg +1 -0
  3. package/.storybook/assets/share.png +0 -0
  4. package/.storybook/assets/welcome.png +0 -0
  5. package/.storybook/config.js +22 -0
  6. package/.storybook/manager-head.html +45 -0
  7. package/.storybook/preview-head.html +10 -0
  8. package/.storybook/tsconfig.json +10 -0
  9. package/CHANGELOG.md +8 -0
  10. package/angular.json +68 -0
  11. package/build.sh +13 -0
  12. package/carbon.yml +275 -0
  13. package/dist/CHANGELOG.md +3168 -0
  14. package/dist/README.md +40 -0
  15. package/{alluvial-chart.component.d.ts → dist/alluvial-chart.component.d.ts} +0 -0
  16. package/{area-chart-stacked.component.d.ts → dist/area-chart-stacked.component.d.ts} +0 -0
  17. package/{area-chart.component.d.ts → dist/area-chart.component.d.ts} +0 -0
  18. package/{bar-chart-grouped.component.d.ts → dist/bar-chart-grouped.component.d.ts} +0 -0
  19. package/{bar-chart-simple.component.d.ts → dist/bar-chart-simple.component.d.ts} +0 -0
  20. package/{bar-chart-stacked.component.d.ts → dist/bar-chart-stacked.component.d.ts} +0 -0
  21. package/{base-chart.component.d.ts → dist/base-chart.component.d.ts} +0 -0
  22. package/{boxplot-chart.component.d.ts → dist/boxplot-chart.component.d.ts} +0 -0
  23. package/{bubble-chart.component.d.ts → dist/bubble-chart.component.d.ts} +0 -0
  24. package/{bullet-chart.component.d.ts → dist/bullet-chart.component.d.ts} +0 -0
  25. package/{bundles → dist/bundles}/carbon-charts-angular.umd.js +21 -23
  26. package/dist/bundles/carbon-charts-angular.umd.js.map +1 -0
  27. package/dist/bundles/carbon-charts-angular.umd.min.js +16 -0
  28. package/dist/bundles/carbon-charts-angular.umd.min.js.map +1 -0
  29. package/{carbon-charts-angular.d.ts → dist/carbon-charts-angular.d.ts} +0 -0
  30. package/{carbon-charts-angular.metadata.json → dist/carbon-charts-angular.metadata.json} +1 -1
  31. package/{charts.module.d.ts → dist/charts.module.d.ts} +0 -0
  32. package/{circle-pack-chart.component.d.ts → dist/circle-pack-chart.component.d.ts} +0 -0
  33. package/{combo-chart.component.d.ts → dist/combo-chart.component.d.ts} +0 -0
  34. package/{diagrams → dist/diagrams}/card-node/card-node-column.component.d.ts +0 -0
  35. package/{diagrams → dist/diagrams}/card-node/card-node-label.component.d.ts +0 -0
  36. package/{diagrams → dist/diagrams}/card-node/card-node-subtitle.component.d.ts +0 -0
  37. package/{diagrams → dist/diagrams}/card-node/card-node-title.component.d.ts +0 -0
  38. package/{diagrams → dist/diagrams}/card-node/card-node.component.d.ts +0 -0
  39. package/{diagrams → dist/diagrams}/card-node/card-node.module.d.ts +0 -0
  40. package/dist/diagrams/configs.d.ts +1 -0
  41. package/{diagrams → dist/diagrams}/edge/edge.component.d.ts +0 -0
  42. package/{diagrams → dist/diagrams}/edge/edge.module.d.ts +0 -0
  43. package/{diagrams → dist/diagrams}/marker/marker.component.d.ts +0 -0
  44. package/{diagrams → dist/diagrams}/marker/marker.module.d.ts +0 -0
  45. package/{diagrams → dist/diagrams}/shape-node/shape-node.component.d.ts +0 -0
  46. package/{diagrams → dist/diagrams}/shape-node/shape-node.module.d.ts +0 -0
  47. package/{donut-chart.component.d.ts → dist/donut-chart.component.d.ts} +0 -0
  48. package/{esm2015 → dist/esm2015}/alluvial-chart.component.js +0 -0
  49. package/{esm2015 → dist/esm2015}/area-chart-stacked.component.js +0 -0
  50. package/{esm2015 → dist/esm2015}/area-chart.component.js +0 -0
  51. package/{esm2015 → dist/esm2015}/bar-chart-grouped.component.js +0 -0
  52. package/{esm2015 → dist/esm2015}/bar-chart-simple.component.js +0 -0
  53. package/{esm2015 → dist/esm2015}/bar-chart-stacked.component.js +0 -0
  54. package/{esm2015 → dist/esm2015}/base-chart.component.js +0 -0
  55. package/{esm2015 → dist/esm2015}/boxplot-chart.component.js +0 -0
  56. package/{esm2015 → dist/esm2015}/bubble-chart.component.js +0 -0
  57. package/{esm2015 → dist/esm2015}/bullet-chart.component.js +0 -0
  58. package/{esm2015 → dist/esm2015}/carbon-charts-angular.js +0 -0
  59. package/{esm2015 → dist/esm2015}/charts.module.js +0 -0
  60. package/{esm2015 → dist/esm2015}/circle-pack-chart.component.js +0 -0
  61. package/{esm2015 → dist/esm2015}/combo-chart.component.js +0 -0
  62. package/dist/esm2015/diagrams/card-node/card-node-column.component.js +41 -0
  63. package/dist/esm2015/diagrams/card-node/card-node-label.component.js +27 -0
  64. package/dist/esm2015/diagrams/card-node/card-node-subtitle.component.js +27 -0
  65. package/dist/esm2015/diagrams/card-node/card-node-title.component.js +27 -0
  66. package/dist/esm2015/diagrams/card-node/card-node.component.js +148 -0
  67. package/{esm2015 → dist/esm2015}/diagrams/card-node/card-node.module.js +0 -0
  68. package/dist/esm2015/diagrams/configs.js +8 -0
  69. package/dist/esm2015/diagrams/edge/edge.component.js +80 -0
  70. package/{esm2015 → dist/esm2015}/diagrams/edge/edge.module.js +0 -0
  71. package/dist/esm2015/diagrams/marker/marker.component.js +141 -0
  72. package/{esm2015 → dist/esm2015}/diagrams/marker/marker.module.js +0 -0
  73. package/dist/esm2015/diagrams/shape-node/shape-node.component.js +187 -0
  74. package/{esm2015 → dist/esm2015}/diagrams/shape-node/shape-node.module.js +0 -0
  75. package/{esm2015 → dist/esm2015}/donut-chart.component.js +0 -0
  76. package/{esm2015 → dist/esm2015}/gauge-chart.component.js +0 -0
  77. package/{esm2015 → dist/esm2015}/heatmap-chart.component.js +0 -0
  78. package/{esm2015 → dist/esm2015}/histogram-chart.component.js +0 -0
  79. package/{esm2015 → dist/esm2015}/index.js +0 -0
  80. package/{esm2015 → dist/esm2015}/line-chart.component.js +0 -0
  81. package/{esm2015 → dist/esm2015}/lollipop-chart.component.js +0 -0
  82. package/{esm2015 → dist/esm2015}/meter-chart.component.js +0 -0
  83. package/{esm2015 → dist/esm2015}/pie-chart.component.js +0 -0
  84. package/{esm2015 → dist/esm2015}/radar-chart.component.js +0 -0
  85. package/{esm2015 → dist/esm2015}/scatter-chart.component.js +0 -0
  86. package/{esm2015 → dist/esm2015}/tree-chart.component.js +0 -0
  87. package/{esm2015 → dist/esm2015}/treemap-chart.component.js +0 -0
  88. package/{esm2015 → dist/esm2015}/wordcloud-chart.component.js +0 -0
  89. package/{esm5 → dist/esm5}/alluvial-chart.component.js +0 -0
  90. package/{esm5 → dist/esm5}/area-chart-stacked.component.js +0 -0
  91. package/{esm5 → dist/esm5}/area-chart.component.js +0 -0
  92. package/{esm5 → dist/esm5}/bar-chart-grouped.component.js +0 -0
  93. package/{esm5 → dist/esm5}/bar-chart-simple.component.js +0 -0
  94. package/{esm5 → dist/esm5}/bar-chart-stacked.component.js +0 -0
  95. package/{esm5 → dist/esm5}/base-chart.component.js +0 -0
  96. package/{esm5 → dist/esm5}/boxplot-chart.component.js +0 -0
  97. package/{esm5 → dist/esm5}/bubble-chart.component.js +0 -0
  98. package/{esm5 → dist/esm5}/bullet-chart.component.js +0 -0
  99. package/{esm5 → dist/esm5}/carbon-charts-angular.js +0 -0
  100. package/{esm5 → dist/esm5}/charts.module.js +0 -0
  101. package/{esm5 → dist/esm5}/circle-pack-chart.component.js +0 -0
  102. package/{esm5 → dist/esm5}/combo-chart.component.js +0 -0
  103. package/{esm5 → dist/esm5}/diagrams/card-node/card-node-column.component.js +4 -5
  104. package/{esm5 → dist/esm5}/diagrams/card-node/card-node-label.component.js +3 -4
  105. package/{esm5 → dist/esm5}/diagrams/card-node/card-node-subtitle.component.js +3 -4
  106. package/{esm5 → dist/esm5}/diagrams/card-node/card-node-title.component.js +3 -4
  107. package/dist/esm5/diagrams/card-node/card-node.component.js +86 -0
  108. package/{esm5 → dist/esm5}/diagrams/card-node/card-node.module.js +0 -0
  109. package/dist/esm5/diagrams/configs.js +8 -0
  110. package/dist/esm5/diagrams/edge/edge.component.js +64 -0
  111. package/{esm5 → dist/esm5}/diagrams/edge/edge.module.js +0 -0
  112. package/{esm5 → dist/esm5}/diagrams/marker/marker.component.js +3 -4
  113. package/{esm5 → dist/esm5}/diagrams/marker/marker.module.js +0 -0
  114. package/dist/esm5/diagrams/shape-node/shape-node.component.js +104 -0
  115. package/{esm5 → dist/esm5}/diagrams/shape-node/shape-node.module.js +0 -0
  116. package/{esm5 → dist/esm5}/donut-chart.component.js +0 -0
  117. package/{esm5 → dist/esm5}/gauge-chart.component.js +0 -0
  118. package/{esm5 → dist/esm5}/heatmap-chart.component.js +0 -0
  119. package/{esm5 → dist/esm5}/histogram-chart.component.js +0 -0
  120. package/{esm5 → dist/esm5}/index.js +0 -0
  121. package/{esm5 → dist/esm5}/line-chart.component.js +0 -0
  122. package/{esm5 → dist/esm5}/lollipop-chart.component.js +0 -0
  123. package/{esm5 → dist/esm5}/meter-chart.component.js +0 -0
  124. package/{esm5 → dist/esm5}/pie-chart.component.js +0 -0
  125. package/{esm5 → dist/esm5}/radar-chart.component.js +0 -0
  126. package/{esm5 → dist/esm5}/scatter-chart.component.js +0 -0
  127. package/{esm5 → dist/esm5}/tree-chart.component.js +0 -0
  128. package/{esm5 → dist/esm5}/treemap-chart.component.js +0 -0
  129. package/{esm5 → dist/esm5}/wordcloud-chart.component.js +0 -0
  130. package/{fesm2015 → dist/fesm2015}/carbon-charts-angular.js +17 -18
  131. package/dist/fesm2015/carbon-charts-angular.js.map +1 -0
  132. package/{fesm5 → dist/fesm5}/carbon-charts-angular.js +17 -18
  133. package/dist/fesm5/carbon-charts-angular.js.map +1 -0
  134. package/{gauge-chart.component.d.ts → dist/gauge-chart.component.d.ts} +0 -0
  135. package/{heatmap-chart.component.d.ts → dist/heatmap-chart.component.d.ts} +0 -0
  136. package/{histogram-chart.component.d.ts → dist/histogram-chart.component.d.ts} +0 -0
  137. package/{index.d.ts → dist/index.d.ts} +0 -0
  138. package/{line-chart.component.d.ts → dist/line-chart.component.d.ts} +0 -0
  139. package/{lollipop-chart.component.d.ts → dist/lollipop-chart.component.d.ts} +0 -0
  140. package/{meter-chart.component.d.ts → dist/meter-chart.component.d.ts} +0 -0
  141. package/dist/package.json +109 -0
  142. package/{pie-chart.component.d.ts → dist/pie-chart.component.d.ts} +0 -0
  143. package/{radar-chart.component.d.ts → dist/radar-chart.component.d.ts} +0 -0
  144. package/{scatter-chart.component.d.ts → dist/scatter-chart.component.d.ts} +0 -0
  145. package/{tree-chart.component.d.ts → dist/tree-chart.component.d.ts} +0 -0
  146. package/{treemap-chart.component.d.ts → dist/treemap-chart.component.d.ts} +0 -0
  147. package/{wordcloud-chart.component.d.ts → dist/wordcloud-chart.component.d.ts} +0 -0
  148. package/ng-package.json +8 -0
  149. package/package.json +103 -108
  150. package/src/alluvial-chart.component.ts +34 -0
  151. package/src/area-chart-stacked.component.ts +34 -0
  152. package/src/area-chart.component.ts +37 -0
  153. package/src/bar-chart-grouped.component.ts +34 -0
  154. package/src/bar-chart-simple.component.ts +34 -0
  155. package/src/bar-chart-stacked.component.ts +34 -0
  156. package/src/base-chart.component.ts +102 -0
  157. package/src/boxplot-chart.component.ts +34 -0
  158. package/src/bubble-chart.component.ts +34 -0
  159. package/src/bullet-chart.component.ts +34 -0
  160. package/src/charts.module.ts +87 -0
  161. package/src/circle-pack-chart.component.ts +34 -0
  162. package/src/combo-chart.component.ts +33 -0
  163. package/src/diagrams/card-node/card-node-column.component.ts +22 -0
  164. package/src/diagrams/card-node/card-node-label.component.ts +15 -0
  165. package/src/diagrams/card-node/card-node-subtitle.component.ts +15 -0
  166. package/src/diagrams/card-node/card-node-title.component.ts +15 -0
  167. package/src/diagrams/card-node/card-node.component.ts +100 -0
  168. package/src/diagrams/card-node/card-node.module.ts +18 -0
  169. package/src/diagrams/configs.ts +1 -0
  170. package/src/diagrams/edge/edge.component.ts +45 -0
  171. package/src/diagrams/edge/edge.module.ts +11 -0
  172. package/src/diagrams/marker/marker.component.ts +68 -0
  173. package/src/diagrams/marker/marker.module.ts +43 -0
  174. package/src/diagrams/shape-node/shape-node.component.ts +133 -0
  175. package/src/diagrams/shape-node/shape-node.module.ts +11 -0
  176. package/src/donut-chart.component.ts +34 -0
  177. package/src/gauge-chart.component.ts +34 -0
  178. package/src/heatmap-chart.component.ts +34 -0
  179. package/src/histogram-chart.component.ts +34 -0
  180. package/src/index.ts +44 -0
  181. package/src/line-chart.component.ts +34 -0
  182. package/src/lollipop-chart.component.ts +34 -0
  183. package/src/meter-chart.component.ts +33 -0
  184. package/src/pie-chart.component.ts +34 -0
  185. package/src/radar-chart.component.ts +34 -0
  186. package/src/scatter-chart.component.ts +34 -0
  187. package/src/tree-chart.component.ts +34 -0
  188. package/src/treemap-chart.component.ts +34 -0
  189. package/src/wordcloud-chart.component.ts +34 -0
  190. package/stories/all.stories.ts +99 -0
  191. package/stories/diagrams/0_diagram.stories.ts +224 -0
  192. package/stories/diagrams/card-node.stories.ts +181 -0
  193. package/stories/diagrams/edge.stories.ts +127 -0
  194. package/stories/diagrams/marker.stories.ts +140 -0
  195. package/stories/diagrams/shape-node.stories.ts +98 -0
  196. package/tsconfig.json +30 -0
  197. package/tslint.json +95 -0
  198. package/LICENSE.md +0 -201
  199. package/bundles/carbon-charts-angular.umd.js.map +0 -1
  200. package/bundles/carbon-charts-angular.umd.min.js +0 -17
  201. package/bundles/carbon-charts-angular.umd.min.js.map +0 -1
  202. package/esm2015/diagrams/card-node/card-node-column.component.js +0 -42
  203. package/esm2015/diagrams/card-node/card-node-label.component.js +0 -28
  204. package/esm2015/diagrams/card-node/card-node-subtitle.component.js +0 -28
  205. package/esm2015/diagrams/card-node/card-node-title.component.js +0 -28
  206. package/esm2015/diagrams/card-node/card-node.component.js +0 -149
  207. package/esm2015/diagrams/edge/edge.component.js +0 -81
  208. package/esm2015/diagrams/marker/marker.component.js +0 -142
  209. package/esm2015/diagrams/shape-node/shape-node.component.js +0 -188
  210. package/esm5/diagrams/card-node/card-node.component.js +0 -87
  211. package/esm5/diagrams/edge/edge.component.js +0 -65
  212. package/esm5/diagrams/shape-node/shape-node.component.js +0 -105
  213. package/fesm2015/carbon-charts-angular.js.map +0 -1
  214. package/fesm5/carbon-charts-angular.js.map +0 -1
@@ -0,0 +1,34 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+
8
+ import { GroupedBarChart } from "@carbon/charts";
9
+
10
+ /**
11
+ * Wrapper around `GroupedBarChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-grouped-bar-chart",
17
+ template: ``
18
+ })
19
+ export class GroupedBarChartComponent extends BaseChart implements AfterViewInit {
20
+ /**
21
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
22
+ */
23
+ ngAfterViewInit() {
24
+ this.chart = new GroupedBarChart(
25
+ this.elementRef.nativeElement,
26
+ {
27
+ data: this.data,
28
+ options: this.options
29
+ }
30
+ );
31
+
32
+ Object.assign(this, this.chart);
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+
8
+ import { SimpleBarChart } from "@carbon/charts";
9
+
10
+ /**
11
+ * Wrapper around `SimpleBarChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-simple-bar-chart",
17
+ template: ``
18
+ })
19
+ export class SimpleBarChartComponent extends BaseChart implements AfterViewInit {
20
+ /**
21
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
22
+ */
23
+ ngAfterViewInit() {
24
+ this.chart = new SimpleBarChart(
25
+ this.elementRef.nativeElement,
26
+ {
27
+ data: this.data,
28
+ options: this.options
29
+ }
30
+ );
31
+
32
+ Object.assign(this, this.chart);
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+
8
+ import { StackedBarChart } from "@carbon/charts";
9
+
10
+ /**
11
+ * Wrapper around `StackedBarChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-stacked-bar-chart",
17
+ template: ``
18
+ })
19
+ export class StackedBarChartComponent extends BaseChart implements AfterViewInit {
20
+ /**
21
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
22
+ */
23
+ ngAfterViewInit() {
24
+ this.chart = new StackedBarChart(
25
+ this.elementRef.nativeElement,
26
+ {
27
+ data: this.data,
28
+ options: this.options
29
+ }
30
+ );
31
+
32
+ Object.assign(this, this.chart);
33
+ }
34
+ }
@@ -0,0 +1,102 @@
1
+ import {
2
+ Component,
3
+ Input,
4
+ ViewChild,
5
+ OnInit,
6
+ AfterViewInit,
7
+ ElementRef
8
+ } from "@angular/core";
9
+
10
+ /**
11
+ * Wrapper around `BaseChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-base-chart",
17
+ template: ``
18
+ })
19
+ export class BaseChart implements AfterViewInit, OnInit {
20
+ constructor(protected elementRef: ElementRef) {}
21
+
22
+ /**
23
+ * Data passed to charts library for displaying
24
+ */
25
+ @Input() set data(newData) {
26
+ // If data already exists, that means the chart has been initialized
27
+ const dataExistsAlready = this._data !== null && this._data !== undefined;
28
+
29
+ this._data = newData;
30
+
31
+ if (dataExistsAlready) {
32
+ this.chart.model.setData(newData);
33
+ }
34
+ }
35
+
36
+ get data() {
37
+ return this._data;
38
+ }
39
+
40
+ /**
41
+ * Options passed to charts library
42
+ */
43
+ @Input() set options(newOptions) {
44
+ // If data already exists, that means the chart has been initialized
45
+ const optionsExistAlready = this._options !== null && this._options !== undefined;
46
+
47
+ this._options = newOptions;
48
+
49
+ if (optionsExistAlready) {
50
+ this.chart.model.setOptions(newOptions);
51
+ }
52
+ }
53
+
54
+ get options() {
55
+ return this._options;
56
+ }
57
+
58
+ /**
59
+ * Chart width
60
+ */
61
+ @Input() width: any;
62
+
63
+ /**
64
+ * Chart height
65
+ */
66
+ @Input() height: any;
67
+
68
+ /**
69
+ * Chart container element ref
70
+ */
71
+ @ViewChild("nChart") chartRef;
72
+
73
+ /**
74
+ * Chart object instance
75
+ *
76
+ * You can use this to do whatever you would normally do with a chart if you used
77
+ * charts library directly.
78
+ */
79
+ chart;
80
+
81
+ private _data: any;
82
+ private _options: any;
83
+
84
+ ngOnInit() {
85
+ // Width prop is mandatory for the wrappers
86
+ if (this.width) {
87
+ this.options.width = this.width;
88
+ }
89
+
90
+ // Height prop is mandatory for the wrappers
91
+ if (this.height) {
92
+ this.options.height = this.height;
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Runs after view init to create a chart, attach it to `chartRef` and draw it.
98
+ */
99
+ ngAfterViewInit() {
100
+ console.log("You need to implement your own `ngAfterViewInit()` function");
101
+ }
102
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+
8
+ import { BoxplotChart } from "@carbon/charts";
9
+
10
+ /**
11
+ * Wrapper around `BoxplotChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-boxplot-chart",
17
+ template: ``
18
+ })
19
+ export class BoxplotChartComponent extends BaseChart implements AfterViewInit {
20
+ /**
21
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
22
+ */
23
+ ngAfterViewInit() {
24
+ this.chart = new BoxplotChart(
25
+ this.elementRef.nativeElement,
26
+ {
27
+ data: this.data,
28
+ options: this.options
29
+ }
30
+ );
31
+
32
+ Object.assign(this, this.chart);
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+
8
+ import { BubbleChart } from "@carbon/charts";
9
+
10
+ /**
11
+ * Wrapper around `BubbleChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-bubble-chart",
17
+ template: ``
18
+ })
19
+ export class BubbleChartComponent extends BaseChart implements AfterViewInit {
20
+ /**
21
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
22
+ */
23
+ ngAfterViewInit() {
24
+ this.chart = new BubbleChart(
25
+ this.elementRef.nativeElement,
26
+ {
27
+ data: this.data,
28
+ options: this.options
29
+ }
30
+ );
31
+
32
+ Object.assign(this, this.chart);
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+
8
+ import { BulletChart } from "@carbon/charts";
9
+
10
+ /**
11
+ * Wrapper around `BulletChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-bullet-chart",
17
+ template: ``
18
+ })
19
+ export class BulletChartComponent extends BaseChart implements AfterViewInit {
20
+ /**
21
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
22
+ */
23
+ ngAfterViewInit() {
24
+ this.chart = new BulletChart(
25
+ this.elementRef.nativeElement,
26
+ {
27
+ data: this.data,
28
+ options: this.options
29
+ }
30
+ );
31
+
32
+ Object.assign(this, this.chart);
33
+ }
34
+ }
@@ -0,0 +1,87 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ import { BaseChart } from './base-chart.component';
5
+ import { AlluvialChartComponent } from './alluvial-chart.component';
6
+ import { AreaChartComponent } from './area-chart.component';
7
+ import { StackedAreaChartComponent } from './area-chart-stacked.component';
8
+ import { SimpleBarChartComponent } from './bar-chart-simple.component';
9
+ import { GroupedBarChartComponent } from './bar-chart-grouped.component';
10
+ import { StackedBarChartComponent } from './bar-chart-stacked.component';
11
+ import { BoxplotChartComponent } from './boxplot-chart.component';
12
+ import { BubbleChartComponent } from './bubble-chart.component';
13
+ import { BulletChartComponent } from './bullet-chart.component';
14
+ import { DonutChartComponent } from './donut-chart.component';
15
+ import { GaugeChartComponent } from './gauge-chart.component';
16
+ import { HistogramChartComponent } from './histogram-chart.component';
17
+ import { LineChartComponent } from './line-chart.component';
18
+ import { LollipopChartComponent } from './lollipop-chart.component';
19
+ import { PieChartComponent } from './pie-chart.component';
20
+ import { ScatterChartComponent } from './scatter-chart.component';
21
+ import { MeterChartComponent } from './meter-chart.component';
22
+ import { RadarChartComponent } from './radar-chart.component';
23
+ import { ComboChartComponent } from './combo-chart.component';
24
+ import { TreeChartComponent } from './tree-chart.component';
25
+ import { TreemapChartComponent } from './treemap-chart.component';
26
+ import { CirclePackChartComponent } from './circle-pack-chart.component';
27
+ import { WordCloudChartComponent } from './wordcloud-chart.component';
28
+ import { HeatmapChartComponent } from './heatmap-chart.component';
29
+
30
+ @NgModule({
31
+ imports: [CommonModule],
32
+ declarations: [
33
+ BaseChart,
34
+ AlluvialChartComponent,
35
+ AreaChartComponent,
36
+ StackedAreaChartComponent,
37
+ SimpleBarChartComponent,
38
+ GroupedBarChartComponent,
39
+ StackedBarChartComponent,
40
+ BoxplotChartComponent,
41
+ BubbleChartComponent,
42
+ BulletChartComponent,
43
+ DonutChartComponent,
44
+ GaugeChartComponent,
45
+ HeatmapChartComponent,
46
+ HistogramChartComponent,
47
+ LineChartComponent,
48
+ LollipopChartComponent,
49
+ PieChartComponent,
50
+ ScatterChartComponent,
51
+ MeterChartComponent,
52
+ RadarChartComponent,
53
+ ComboChartComponent,
54
+ TreeChartComponent,
55
+ TreemapChartComponent,
56
+ CirclePackChartComponent,
57
+ WordCloudChartComponent,
58
+ ],
59
+ exports: [
60
+ BaseChart,
61
+ AlluvialChartComponent,
62
+ AreaChartComponent,
63
+ StackedAreaChartComponent,
64
+ SimpleBarChartComponent,
65
+ GroupedBarChartComponent,
66
+ StackedBarChartComponent,
67
+ BoxplotChartComponent,
68
+ BubbleChartComponent,
69
+ BulletChartComponent,
70
+ DonutChartComponent,
71
+ GaugeChartComponent,
72
+ HeatmapChartComponent,
73
+ HistogramChartComponent,
74
+ LineChartComponent,
75
+ LollipopChartComponent,
76
+ PieChartComponent,
77
+ ScatterChartComponent,
78
+ MeterChartComponent,
79
+ RadarChartComponent,
80
+ ComboChartComponent,
81
+ TreeChartComponent,
82
+ TreemapChartComponent,
83
+ CirclePackChartComponent,
84
+ WordCloudChartComponent
85
+ ],
86
+ })
87
+ export class ChartsModule {}
@@ -0,0 +1,34 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+
8
+ import { CirclePackChart } from "@carbon/charts";
9
+
10
+ /**
11
+ * Wrapper around `BubbleChart` in carbon charts library
12
+ *
13
+ * Most functions just call their equivalent from the chart library.
14
+ */
15
+ @Component({
16
+ selector: "ibm-circle-pack-chart",
17
+ template: ``
18
+ })
19
+ export class CirclePackChartComponent extends BaseChart implements AfterViewInit {
20
+ /**
21
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
22
+ */
23
+ ngAfterViewInit() {
24
+ this.chart = new CirclePackChart(
25
+ this.elementRef.nativeElement,
26
+ {
27
+ data: this.data,
28
+ options: this.options
29
+ }
30
+ );
31
+
32
+ Object.assign(this, this.chart);
33
+ }
34
+ }
@@ -0,0 +1,33 @@
1
+ import {
2
+ Component,
3
+ AfterViewInit
4
+ } from "@angular/core";
5
+
6
+ import { BaseChart } from "./base-chart.component";
7
+ import { ComboChart } from "@carbon/charts";
8
+
9
+ /**
10
+ * Wrapper around `ComboChart` in carbon charts library
11
+ *
12
+ * Most functions just call their equivalent from the chart library.
13
+ */
14
+ @Component({
15
+ selector: "ibm-combo-chart",
16
+ template: ``
17
+ })
18
+ export class ComboChartComponent extends BaseChart implements AfterViewInit {
19
+ /**
20
+ * Runs after view init to create a chart, attach it to `elementRef` and draw it.
21
+ */
22
+ ngAfterViewInit() {
23
+ this.chart = new ComboChart(
24
+ this.elementRef.nativeElement,
25
+ {
26
+ data: this.data,
27
+ options: this.options
28
+ }
29
+ );
30
+
31
+ Object.assign(this, this.chart);
32
+ }
33
+ }
@@ -0,0 +1,22 @@
1
+ import { Component, Input, HostBinding } from '@angular/core';
2
+ import { carbonPrefix } from '../configs';
3
+
4
+ @Component({
5
+ selector: 'ibm-diagram-card-node-column',
6
+ template: `
7
+ <xhtml:div>
8
+ <ng-content></ng-content>
9
+ </xhtml:div>
10
+ `,
11
+ })
12
+ export class CardNodeColumnComponent {
13
+ @Input() farsideColumn = false;
14
+
15
+ @HostBinding('class') get class() {
16
+ const farsideClassName = this.farsideColumn
17
+ ? `${carbonPrefix}--cc--card-node__column--farside`
18
+ : '';
19
+
20
+ return `${carbonPrefix}--cc--card-node__column ${farsideClassName}`;
21
+ }
22
+ }
@@ -0,0 +1,15 @@
1
+ import { Component } from "@angular/core";
2
+ import { carbonPrefix } from '../configs';
3
+
4
+ @Component({
5
+ selector: "ibm-diagram-card-node-label",
6
+ template: `
7
+ <xhtml:label [ngClass]="namespace">
8
+ <ng-content></ng-content>
9
+ </xhtml:label>
10
+ `
11
+ })
12
+
13
+ export class CardNodeLabelComponent {
14
+ namespace = `${carbonPrefix}--cc--card-node__label`;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Component } from "@angular/core";
2
+ import { carbonPrefix } from '../configs';
3
+
4
+ @Component({
5
+ selector: "ibm-diagram-card-node-subtitle",
6
+ template: `
7
+ <xhtml:div [ngClass]="namespace">
8
+ <ng-content></ng-content>
9
+ </xhtml:div>
10
+ `
11
+ })
12
+
13
+ export class CardNodeSubtitleComponent {
14
+ namespace = `${carbonPrefix}--cc--card-node__subtitle`;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Component } from "@angular/core";
2
+ import { carbonPrefix } from '../configs';
3
+
4
+ @Component({
5
+ selector: "ibm-diagram-card-node-title",
6
+ template: `
7
+ <xhtml:div [ngClass]="namespace">
8
+ <ng-content></ng-content>
9
+ </xhtml:div>
10
+ `
11
+ })
12
+
13
+ export class CardNodeTitleComponent {
14
+ namespace = `${carbonPrefix}--cc--card-node__title`;
15
+ }
@@ -0,0 +1,100 @@
1
+ import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
2
+ import { carbonPrefix } from '../configs';
3
+
4
+ @Component({
5
+ selector: 'ibm-diagram-card-node',
6
+ template: `
7
+ <ng-container [ngSwitch]="component">
8
+ <xhtml:div
9
+ *ngSwitchCase="'div'"
10
+ [ngClass]="[
11
+ namespace,
12
+ stacked ? namespace + '--stacked' : '',
13
+ namespace + '--' + component
14
+ ]"
15
+ [ngStyle]="{
16
+ 'border-color': color,
17
+ position: position
18
+ }"
19
+ (mouseenter)="mouseEnter.emit($event)"
20
+ (mouseover)="mouseOver.emit($event)"
21
+ (mouseout)="mouseOut.emit($event)"
22
+ (mouseleave)="mouseLeave.emit($event)"
23
+ (mousemove)="mouseMove.emit($event)"
24
+ tabindex="0"
25
+ >
26
+ <ng-container *ngTemplateOutlet="nodeTemplate"></ng-container>
27
+ </xhtml:div>
28
+
29
+ <xhtml:button
30
+ *ngSwitchCase="'button'"
31
+ [ngClass]="[
32
+ namespace,
33
+ stacked ? namespace + '--stacked' : '',
34
+ namespace + '--' + component
35
+ ]"
36
+ [ngStyle]="{
37
+ 'border-color': color,
38
+ position: position
39
+ }"
40
+ (click)="click.emit($event)"
41
+ (mouseenter)="mouseEnter.emit($event)"
42
+ (mouseover)="mouseOver.emit($event)"
43
+ (mouseout)="mouseOut.emit($event)"
44
+ (mouseleave)="mouseLeave.emit($event)"
45
+ (mousemove)="mouseMove.emit($event)"
46
+ tabindex="0"
47
+ >
48
+ <ng-container *ngTemplateOutlet="nodeTemplate"></ng-container>
49
+ </xhtml:button>
50
+
51
+ <xhtml:a
52
+ *ngSwitchCase="'a'"
53
+ [ngClass]="[
54
+ namespace,
55
+ stacked ? namespace + '--stacked' : '',
56
+ namespace + '--' + component
57
+ ]"
58
+ [attr.href]="href"
59
+ [ngStyle]="{ 'border-color': color, position: position }"
60
+ (mouseenter)="mouseEnter.emit($event)"
61
+ (mouseover)="mouseOver.emit($event)"
62
+ (mouseout)="mouseOut.emit($event)"
63
+ (mouseleave)="mouseLeave.emit($event)"
64
+ (mousemove)="mouseMove.emit($event)"
65
+ tabindex="0"
66
+ >
67
+ <ng-container *ngTemplateOutlet="nodeTemplate"></ng-container>
68
+ </xhtml:a>
69
+ </ng-container>
70
+ <ng-template #nodeTemplate>
71
+ <ng-content></ng-content>
72
+ </ng-template>
73
+ `,
74
+ })
75
+ export class CardNodeComponent implements OnInit {
76
+ @Input() as = 'div';
77
+ @Input() href: string = null;
78
+ @Input() color;
79
+ @Input() stacked;
80
+ @Input() position: string = 'static';
81
+
82
+ @Output() click: EventEmitter<any> = new EventEmitter<any>();
83
+ @Output() mouseEnter: EventEmitter<any> = new EventEmitter<any>();
84
+ @Output() mouseOver: EventEmitter<any> = new EventEmitter<any>();
85
+ @Output() mouseOut: EventEmitter<any> = new EventEmitter<any>();
86
+ @Output() mouseLeave: EventEmitter<any> = new EventEmitter<any>();
87
+ @Output() mouseMove: EventEmitter<any> = new EventEmitter<any>();
88
+
89
+ namespace = `${carbonPrefix}--cc--card-node`;
90
+
91
+ component = 'div';
92
+
93
+ ngOnInit() {
94
+ if (this.href) {
95
+ this.component = 'a';
96
+ } else {
97
+ this.component = this.as;
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,18 @@
1
+ import { NgModule } from "@angular/core";
2
+ import { CommonModule } from "@angular/common";
3
+ import { CardNodeComponent } from "./card-node.component";
4
+ import { CardNodeColumnComponent } from "./card-node-column.component";
5
+ import { CardNodeLabelComponent } from "./card-node-label.component";
6
+ import { CardNodeSubtitleComponent } from "./card-node-subtitle.component";
7
+ import { CardNodeTitleComponent } from "./card-node-title.component";
8
+ export { CardNodeComponent,
9
+ CardNodeColumnComponent,
10
+ CardNodeLabelComponent,
11
+ CardNodeSubtitleComponent,
12
+ CardNodeTitleComponent };
13
+ @NgModule({
14
+ declarations: [CardNodeComponent, CardNodeColumnComponent, CardNodeLabelComponent, CardNodeSubtitleComponent, CardNodeTitleComponent],
15
+ exports: [CardNodeComponent, CardNodeColumnComponent, CardNodeLabelComponent, CardNodeSubtitleComponent, CardNodeTitleComponent],
16
+ imports: [CommonModule]
17
+ })
18
+ export class CardNodeModule { }
@@ -0,0 +1 @@
1
+ export const carbonPrefix = 'cds';