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

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 (199) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE.md +201 -0
  3. package/README.md +23 -8
  4. package/{dist/alluvial-chart.component.d.ts → alluvial-chart.component.d.ts} +0 -0
  5. package/{dist/area-chart-stacked.component.d.ts → area-chart-stacked.component.d.ts} +0 -0
  6. package/{dist/area-chart.component.d.ts → area-chart.component.d.ts} +0 -0
  7. package/{dist/bar-chart-grouped.component.d.ts → bar-chart-grouped.component.d.ts} +0 -0
  8. package/{dist/bar-chart-simple.component.d.ts → bar-chart-simple.component.d.ts} +0 -0
  9. package/{dist/bar-chart-stacked.component.d.ts → bar-chart-stacked.component.d.ts} +0 -0
  10. package/{dist/base-chart.component.d.ts → base-chart.component.d.ts} +0 -0
  11. package/{dist/boxplot-chart.component.d.ts → boxplot-chart.component.d.ts} +0 -0
  12. package/{dist/bubble-chart.component.d.ts → bubble-chart.component.d.ts} +0 -0
  13. package/{dist/bullet-chart.component.d.ts → bullet-chart.component.d.ts} +0 -0
  14. package/{dist/bundles → bundles}/carbon-charts-angular.umd.js +0 -0
  15. package/{dist/bundles → bundles}/carbon-charts-angular.umd.js.map +0 -0
  16. package/{dist/bundles → bundles}/carbon-charts-angular.umd.min.js +0 -0
  17. package/{dist/bundles → bundles}/carbon-charts-angular.umd.min.js.map +0 -0
  18. package/{dist/carbon-charts-angular.d.ts → carbon-charts-angular.d.ts} +0 -0
  19. package/{dist/carbon-charts-angular.metadata.json → carbon-charts-angular.metadata.json} +0 -0
  20. package/{dist/charts.module.d.ts → charts.module.d.ts} +0 -0
  21. package/{dist/circle-pack-chart.component.d.ts → circle-pack-chart.component.d.ts} +0 -0
  22. package/{dist/combo-chart.component.d.ts → combo-chart.component.d.ts} +0 -0
  23. package/{dist/diagrams → diagrams}/card-node/card-node-column.component.d.ts +0 -0
  24. package/{dist/diagrams → diagrams}/card-node/card-node-label.component.d.ts +0 -0
  25. package/{dist/diagrams → diagrams}/card-node/card-node-subtitle.component.d.ts +0 -0
  26. package/{dist/diagrams → diagrams}/card-node/card-node-title.component.d.ts +0 -0
  27. package/{dist/diagrams → diagrams}/card-node/card-node.component.d.ts +0 -0
  28. package/{dist/diagrams → diagrams}/card-node/card-node.module.d.ts +0 -0
  29. package/{dist/diagrams → diagrams}/configs.d.ts +0 -0
  30. package/{dist/diagrams → diagrams}/edge/edge.component.d.ts +0 -0
  31. package/{dist/diagrams → diagrams}/edge/edge.module.d.ts +0 -0
  32. package/{dist/diagrams → diagrams}/marker/marker.component.d.ts +0 -0
  33. package/{dist/diagrams → diagrams}/marker/marker.module.d.ts +0 -0
  34. package/{dist/diagrams → diagrams}/shape-node/shape-node.component.d.ts +0 -0
  35. package/{dist/diagrams → diagrams}/shape-node/shape-node.module.d.ts +0 -0
  36. package/{dist/donut-chart.component.d.ts → donut-chart.component.d.ts} +0 -0
  37. package/{dist/esm2015 → esm2015}/alluvial-chart.component.js +0 -0
  38. package/{dist/esm2015 → esm2015}/area-chart-stacked.component.js +0 -0
  39. package/{dist/esm2015 → esm2015}/area-chart.component.js +0 -0
  40. package/{dist/esm2015 → esm2015}/bar-chart-grouped.component.js +0 -0
  41. package/{dist/esm2015 → esm2015}/bar-chart-simple.component.js +0 -0
  42. package/{dist/esm2015 → esm2015}/bar-chart-stacked.component.js +0 -0
  43. package/{dist/esm2015 → esm2015}/base-chart.component.js +0 -0
  44. package/{dist/esm2015 → esm2015}/boxplot-chart.component.js +0 -0
  45. package/{dist/esm2015 → esm2015}/bubble-chart.component.js +0 -0
  46. package/{dist/esm2015 → esm2015}/bullet-chart.component.js +0 -0
  47. package/{dist/esm2015 → esm2015}/carbon-charts-angular.js +0 -0
  48. package/{dist/esm2015 → esm2015}/charts.module.js +0 -0
  49. package/{dist/esm2015 → esm2015}/circle-pack-chart.component.js +0 -0
  50. package/{dist/esm2015 → esm2015}/combo-chart.component.js +0 -0
  51. package/{dist/esm2015 → esm2015}/diagrams/card-node/card-node-column.component.js +0 -0
  52. package/{dist/esm2015 → esm2015}/diagrams/card-node/card-node-label.component.js +0 -0
  53. package/{dist/esm2015 → esm2015}/diagrams/card-node/card-node-subtitle.component.js +0 -0
  54. package/{dist/esm2015 → esm2015}/diagrams/card-node/card-node-title.component.js +0 -0
  55. package/{dist/esm2015 → esm2015}/diagrams/card-node/card-node.component.js +0 -0
  56. package/{dist/esm2015 → esm2015}/diagrams/card-node/card-node.module.js +0 -0
  57. package/{dist/esm2015 → esm2015}/diagrams/configs.js +0 -0
  58. package/{dist/esm2015 → esm2015}/diagrams/edge/edge.component.js +0 -0
  59. package/{dist/esm2015 → esm2015}/diagrams/edge/edge.module.js +0 -0
  60. package/{dist/esm2015 → esm2015}/diagrams/marker/marker.component.js +0 -0
  61. package/{dist/esm2015 → esm2015}/diagrams/marker/marker.module.js +0 -0
  62. package/{dist/esm2015 → esm2015}/diagrams/shape-node/shape-node.component.js +0 -0
  63. package/{dist/esm2015 → esm2015}/diagrams/shape-node/shape-node.module.js +0 -0
  64. package/{dist/esm2015 → esm2015}/donut-chart.component.js +0 -0
  65. package/{dist/esm2015 → esm2015}/gauge-chart.component.js +0 -0
  66. package/{dist/esm2015 → esm2015}/heatmap-chart.component.js +0 -0
  67. package/{dist/esm2015 → esm2015}/histogram-chart.component.js +0 -0
  68. package/{dist/esm2015 → esm2015}/index.js +0 -0
  69. package/{dist/esm2015 → esm2015}/line-chart.component.js +0 -0
  70. package/{dist/esm2015 → esm2015}/lollipop-chart.component.js +0 -0
  71. package/{dist/esm2015 → esm2015}/meter-chart.component.js +0 -0
  72. package/{dist/esm2015 → esm2015}/pie-chart.component.js +0 -0
  73. package/{dist/esm2015 → esm2015}/radar-chart.component.js +0 -0
  74. package/{dist/esm2015 → esm2015}/scatter-chart.component.js +0 -0
  75. package/{dist/esm2015 → esm2015}/tree-chart.component.js +0 -0
  76. package/{dist/esm2015 → esm2015}/treemap-chart.component.js +0 -0
  77. package/{dist/esm2015 → esm2015}/wordcloud-chart.component.js +0 -0
  78. package/{dist/esm5 → esm5}/alluvial-chart.component.js +0 -0
  79. package/{dist/esm5 → esm5}/area-chart-stacked.component.js +0 -0
  80. package/{dist/esm5 → esm5}/area-chart.component.js +0 -0
  81. package/{dist/esm5 → esm5}/bar-chart-grouped.component.js +0 -0
  82. package/{dist/esm5 → esm5}/bar-chart-simple.component.js +0 -0
  83. package/{dist/esm5 → esm5}/bar-chart-stacked.component.js +0 -0
  84. package/{dist/esm5 → esm5}/base-chart.component.js +0 -0
  85. package/{dist/esm5 → esm5}/boxplot-chart.component.js +0 -0
  86. package/{dist/esm5 → esm5}/bubble-chart.component.js +0 -0
  87. package/{dist/esm5 → esm5}/bullet-chart.component.js +0 -0
  88. package/{dist/esm5 → esm5}/carbon-charts-angular.js +0 -0
  89. package/{dist/esm5 → esm5}/charts.module.js +0 -0
  90. package/{dist/esm5 → esm5}/circle-pack-chart.component.js +0 -0
  91. package/{dist/esm5 → esm5}/combo-chart.component.js +0 -0
  92. package/{dist/esm5 → esm5}/diagrams/card-node/card-node-column.component.js +0 -0
  93. package/{dist/esm5 → esm5}/diagrams/card-node/card-node-label.component.js +0 -0
  94. package/{dist/esm5 → esm5}/diagrams/card-node/card-node-subtitle.component.js +0 -0
  95. package/{dist/esm5 → esm5}/diagrams/card-node/card-node-title.component.js +0 -0
  96. package/{dist/esm5 → esm5}/diagrams/card-node/card-node.component.js +0 -0
  97. package/{dist/esm5 → esm5}/diagrams/card-node/card-node.module.js +0 -0
  98. package/{dist/esm5 → esm5}/diagrams/configs.js +0 -0
  99. package/{dist/esm5 → esm5}/diagrams/edge/edge.component.js +0 -0
  100. package/{dist/esm5 → esm5}/diagrams/edge/edge.module.js +0 -0
  101. package/{dist/esm5 → esm5}/diagrams/marker/marker.component.js +0 -0
  102. package/{dist/esm5 → esm5}/diagrams/marker/marker.module.js +0 -0
  103. package/{dist/esm5 → esm5}/diagrams/shape-node/shape-node.component.js +0 -0
  104. package/{dist/esm5 → esm5}/diagrams/shape-node/shape-node.module.js +0 -0
  105. package/{dist/esm5 → esm5}/donut-chart.component.js +0 -0
  106. package/{dist/esm5 → esm5}/gauge-chart.component.js +0 -0
  107. package/{dist/esm5 → esm5}/heatmap-chart.component.js +0 -0
  108. package/{dist/esm5 → esm5}/histogram-chart.component.js +0 -0
  109. package/{dist/esm5 → esm5}/index.js +0 -0
  110. package/{dist/esm5 → esm5}/line-chart.component.js +0 -0
  111. package/{dist/esm5 → esm5}/lollipop-chart.component.js +0 -0
  112. package/{dist/esm5 → esm5}/meter-chart.component.js +0 -0
  113. package/{dist/esm5 → esm5}/pie-chart.component.js +0 -0
  114. package/{dist/esm5 → esm5}/radar-chart.component.js +0 -0
  115. package/{dist/esm5 → esm5}/scatter-chart.component.js +0 -0
  116. package/{dist/esm5 → esm5}/tree-chart.component.js +0 -0
  117. package/{dist/esm5 → esm5}/treemap-chart.component.js +0 -0
  118. package/{dist/esm5 → esm5}/wordcloud-chart.component.js +0 -0
  119. package/{dist/fesm2015 → fesm2015}/carbon-charts-angular.js +0 -0
  120. package/{dist/fesm2015 → fesm2015}/carbon-charts-angular.js.map +0 -0
  121. package/{dist/fesm5 → fesm5}/carbon-charts-angular.js +0 -0
  122. package/{dist/fesm5 → fesm5}/carbon-charts-angular.js.map +0 -0
  123. package/{dist/gauge-chart.component.d.ts → gauge-chart.component.d.ts} +0 -0
  124. package/{dist/heatmap-chart.component.d.ts → heatmap-chart.component.d.ts} +0 -0
  125. package/{dist/histogram-chart.component.d.ts → histogram-chart.component.d.ts} +0 -0
  126. package/{dist/index.d.ts → index.d.ts} +0 -0
  127. package/{dist/line-chart.component.d.ts → line-chart.component.d.ts} +0 -0
  128. package/{dist/lollipop-chart.component.d.ts → lollipop-chart.component.d.ts} +0 -0
  129. package/{dist/meter-chart.component.d.ts → meter-chart.component.d.ts} +0 -0
  130. package/package.json +108 -103
  131. package/{dist/pie-chart.component.d.ts → pie-chart.component.d.ts} +0 -0
  132. package/{dist/radar-chart.component.d.ts → radar-chart.component.d.ts} +0 -0
  133. package/{dist/scatter-chart.component.d.ts → scatter-chart.component.d.ts} +0 -0
  134. package/{dist/tree-chart.component.d.ts → tree-chart.component.d.ts} +0 -0
  135. package/{dist/treemap-chart.component.d.ts → treemap-chart.component.d.ts} +0 -0
  136. package/{dist/wordcloud-chart.component.d.ts → wordcloud-chart.component.d.ts} +0 -0
  137. package/.storybook/addons.js +0 -2
  138. package/.storybook/assets/logo.svg +0 -1
  139. package/.storybook/assets/share.png +0 -0
  140. package/.storybook/assets/welcome.png +0 -0
  141. package/.storybook/config.js +0 -22
  142. package/.storybook/manager-head.html +0 -45
  143. package/.storybook/preview-head.html +0 -10
  144. package/.storybook/tsconfig.json +0 -10
  145. package/angular.json +0 -68
  146. package/build.sh +0 -13
  147. package/carbon.yml +0 -275
  148. package/dist/CHANGELOG.md +0 -3168
  149. package/dist/README.md +0 -40
  150. package/dist/package.json +0 -109
  151. package/ng-package.json +0 -8
  152. package/src/alluvial-chart.component.ts +0 -34
  153. package/src/area-chart-stacked.component.ts +0 -34
  154. package/src/area-chart.component.ts +0 -37
  155. package/src/bar-chart-grouped.component.ts +0 -34
  156. package/src/bar-chart-simple.component.ts +0 -34
  157. package/src/bar-chart-stacked.component.ts +0 -34
  158. package/src/base-chart.component.ts +0 -102
  159. package/src/boxplot-chart.component.ts +0 -34
  160. package/src/bubble-chart.component.ts +0 -34
  161. package/src/bullet-chart.component.ts +0 -34
  162. package/src/charts.module.ts +0 -87
  163. package/src/circle-pack-chart.component.ts +0 -34
  164. package/src/combo-chart.component.ts +0 -33
  165. package/src/diagrams/card-node/card-node-column.component.ts +0 -22
  166. package/src/diagrams/card-node/card-node-label.component.ts +0 -15
  167. package/src/diagrams/card-node/card-node-subtitle.component.ts +0 -15
  168. package/src/diagrams/card-node/card-node-title.component.ts +0 -15
  169. package/src/diagrams/card-node/card-node.component.ts +0 -100
  170. package/src/diagrams/card-node/card-node.module.ts +0 -18
  171. package/src/diagrams/configs.ts +0 -1
  172. package/src/diagrams/edge/edge.component.ts +0 -45
  173. package/src/diagrams/edge/edge.module.ts +0 -11
  174. package/src/diagrams/marker/marker.component.ts +0 -68
  175. package/src/diagrams/marker/marker.module.ts +0 -43
  176. package/src/diagrams/shape-node/shape-node.component.ts +0 -133
  177. package/src/diagrams/shape-node/shape-node.module.ts +0 -11
  178. package/src/donut-chart.component.ts +0 -34
  179. package/src/gauge-chart.component.ts +0 -34
  180. package/src/heatmap-chart.component.ts +0 -34
  181. package/src/histogram-chart.component.ts +0 -34
  182. package/src/index.ts +0 -44
  183. package/src/line-chart.component.ts +0 -34
  184. package/src/lollipop-chart.component.ts +0 -34
  185. package/src/meter-chart.component.ts +0 -33
  186. package/src/pie-chart.component.ts +0 -34
  187. package/src/radar-chart.component.ts +0 -34
  188. package/src/scatter-chart.component.ts +0 -34
  189. package/src/tree-chart.component.ts +0 -34
  190. package/src/treemap-chart.component.ts +0 -34
  191. package/src/wordcloud-chart.component.ts +0 -34
  192. package/stories/all.stories.ts +0 -99
  193. package/stories/diagrams/0_diagram.stories.ts +0 -224
  194. package/stories/diagrams/card-node.stories.ts +0 -181
  195. package/stories/diagrams/edge.stories.ts +0 -127
  196. package/stories/diagrams/marker.stories.ts +0 -140
  197. package/stories/diagrams/shape-node.stories.ts +0 -98
  198. package/tsconfig.json +0 -30
  199. package/tslint.json +0 -95
@@ -1,34 +0,0 @@
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
- }
@@ -1,33 +0,0 @@
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
- }
@@ -1,22 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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
- }
@@ -1,100 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
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 { }
@@ -1 +0,0 @@
1
- export const carbonPrefix = 'cds';
@@ -1,45 +0,0 @@
1
- import { Component, Input } from "@angular/core";
2
- import { buildStraightPathString } from "@carbon/charts/components/diagrams/buildPaths";
3
-
4
- import { carbonPrefix } from '../configs';
5
-
6
- interface Coordinates {
7
- x: number;
8
- y: number;
9
- }
10
- @Component({
11
- selector: "[ibm-graph-edge]",
12
- template: `
13
- <svg:g [ngClass]="[namespace, variant ? namespace + '--' + variant : '']">
14
- <svg:path
15
- [ngClass]="namespace + '__container'"
16
- [attr.d]="path ? path : straight(source, target)"
17
- />
18
- <svg:path
19
- [ngClass]="namespace + '__outer'"
20
- [attr.d]="path ? path : straight(source, target)"
21
- />
22
- <svg:path
23
- [ngClass]="namespace + '__inner'"
24
- [attr.d]="path ? path : straight(source, target)"
25
- [ngStyle]="{'stroke': color}"
26
- [attr.marker-start]="markerStart ? 'url(#' + markerStart + ')' : ''"
27
- [attr.marker-end]="markerEnd ? 'url(#' + markerEnd + ')' : ''"
28
- />
29
- </svg:g>
30
- `
31
- })
32
-
33
- export class EdgeComponent {
34
- @Input() color: string;
35
- @Input() markerEnd: string;
36
- @Input() markerStart: string;
37
- @Input() source: Coordinates;
38
- @Input() target: Coordinates;
39
- @Input() variant: "dash-sm" | "dash-md" | "dash-lg" | "dash-xl" | "double" | "tunnel";
40
- @Input() path: string;
41
-
42
- pathClasses;
43
- namespace = `${carbonPrefix}--cc--edge`;
44
- straight = buildStraightPathString;
45
- }
@@ -1,11 +0,0 @@
1
- import { NgModule } from "@angular/core";
2
- import { CommonModule } from "@angular/common";
3
- import { EdgeComponent } from "./edge.component";
4
- export { EdgeComponent } from "./edge.component";
5
-
6
- @NgModule({
7
- declarations: [EdgeComponent],
8
- exports: [EdgeComponent],
9
- imports: [CommonModule]
10
- })
11
- export class EdgeModule { }
@@ -1,68 +0,0 @@
1
- import { Component, Input, OnInit } from "@angular/core";
2
- import {
3
- arrowLeft,
4
- arrowRight,
5
- circle,
6
- diamond,
7
- square,
8
- tee,
9
- } from "@carbon/charts/components/diagrams/markerDefinitions";
10
-
11
- import { carbonPrefix } from '../configs';
12
-
13
- const template = `
14
- <svg:marker
15
- [ngClass]="namespace"
16
- [attr.markerHeight]="height"
17
- [attr.markerWidth]="width"
18
- [attr.orient]="orient"
19
- [attr.id]="id"
20
- [attr.refX]="refX"
21
- [attr.refY]="refY"
22
- markerUnits="userSpaceOnUse">
23
- <svg:path [attr.d]="d" [ngStyle]="{'fill': color}" ></svg:path>
24
- </svg:marker>
25
- `;
26
-
27
- @Component({
28
- selector: "[ibm-graph-marker]",
29
- template
30
- })
31
- export class MarkerComponent {
32
- @Input() d: string;
33
- @Input() color: string;
34
- @Input() id: string;
35
- @Input() orient: string | number = "auto";
36
- @Input() height: string | number;
37
- @Input() width: string | number;
38
- @Input() refX: string | number;
39
- @Input() refY: string | number;
40
- @Input() position: "start" | "end" = "end";
41
-
42
- namespace = `${carbonPrefix}--cc--marker`;
43
-
44
- setAttributes = ({d, id, height, width}) => {
45
- const xPos = (this.position === "end") ? (width / 2) + 0.5 : 0.5;
46
- const yPos = height / 2;
47
-
48
- this.d = this.d || d;
49
- this.id = this.id || id;
50
- this.height = this.height || height;
51
- this.width = this.width || width;
52
- this.refX = this.refX || xPos;
53
- this.refY = this.refY || yPos;
54
- }
55
- }
56
-
57
- @Component({ selector: "[ibm-graph-marker-arrow-left]", template})
58
- export class MarkerArrowLeftComponent extends MarkerComponent implements OnInit { ngOnInit() {this.setAttributes({...arrowLeft}); } }
59
- @Component({ selector: "[ibm-graph-marker-arrow-right]", template})
60
- export class MarkerArrowRightComponent extends MarkerComponent implements OnInit { ngOnInit() {this.setAttributes({...arrowRight}); } }
61
- @Component({ selector: "[ibm-graph-marker-circle]", template})
62
- export class MarkerShapeNodeComponent extends MarkerComponent implements OnInit { ngOnInit() {this.setAttributes({...circle}); } }
63
- @Component({ selector: "[ibm-graph-marker-diamond]", template})
64
- export class MarkerDiamondComponent extends MarkerComponent implements OnInit { ngOnInit() {this.setAttributes({...diamond}); } }
65
- @Component({ selector: "[ibm-graph-marker-square]", template})
66
- export class MarkerSquareComponent extends MarkerComponent implements OnInit { ngOnInit() {this.setAttributes({...square}); } }
67
- @Component({ selector: "[ibm-graph-marker-tee]", template})
68
- export class MarkerTeeComponent extends MarkerComponent implements OnInit { ngOnInit() {this.setAttributes({...tee}); } }
@@ -1,43 +0,0 @@
1
- import { NgModule } from "@angular/core";
2
- import { CommonModule } from "@angular/common";
3
- import {
4
- MarkerComponent,
5
- MarkerArrowLeftComponent,
6
- MarkerArrowRightComponent,
7
- MarkerShapeNodeComponent,
8
- MarkerDiamondComponent,
9
- MarkerSquareComponent,
10
- MarkerTeeComponent
11
- } from "./marker.component";
12
-
13
- export {
14
- MarkerComponent,
15
- MarkerArrowLeftComponent,
16
- MarkerArrowRightComponent,
17
- MarkerShapeNodeComponent,
18
- MarkerDiamondComponent,
19
- MarkerSquareComponent,
20
- MarkerTeeComponent
21
- };
22
- @NgModule({
23
- declarations: [
24
- MarkerComponent,
25
- MarkerArrowLeftComponent,
26
- MarkerArrowRightComponent,
27
- MarkerShapeNodeComponent,
28
- MarkerDiamondComponent,
29
- MarkerSquareComponent,
30
- MarkerTeeComponent
31
- ],
32
- exports: [
33
- MarkerComponent,
34
- MarkerArrowLeftComponent,
35
- MarkerArrowRightComponent,
36
- MarkerShapeNodeComponent,
37
- MarkerDiamondComponent,
38
- MarkerSquareComponent,
39
- MarkerTeeComponent
40
- ],
41
- imports: [CommonModule]
42
- })
43
- export class MarkerModule { }
@@ -1,133 +0,0 @@
1
- import {
2
- Component,
3
- Input,
4
- Output,
5
- EventEmitter,
6
- TemplateRef,
7
- OnInit,
8
- } from '@angular/core';
9
-
10
- import { carbonPrefix } from '../configs';
11
-
12
- @Component({
13
- selector: 'ibm-diagram-shape-node',
14
- template: `
15
- <ng-container [ngSwitch]="component">
16
- <xhtml:div
17
- *ngSwitchCase="'div'"
18
- [ngClass]="[
19
- namespace,
20
- stacked ? namespace + '--stacked' : '',
21
- shape ? namespace + '--' + shape : '',
22
- namespace + '--' + component
23
- ]"
24
- [ngStyle]="{
25
- 'height.px': size,
26
- 'width.px': size,
27
- position: position
28
- }"
29
- (mouseenter)="mouseEnter.emit($event)"
30
- (mouseover)="mouseOver.emit($event)"
31
- (mouseout)="mouseOut.emit($event)"
32
- (mouseleave)="mouseLeave.emit($event)"
33
- (mousemove)="mouseMove.emit($event)"
34
- tabindex="0"
35
- >
36
- <ng-container *ngTemplateOutlet="nodeTemplate"></ng-container>
37
- </xhtml:div>
38
-
39
- <xhtml:button
40
- *ngSwitchCase="'button'"
41
- [ngClass]="[
42
- namespace,
43
- stacked ? namespace + '--stacked' : '',
44
- shape ? namespace + '--' + shape : '',
45
- namespace + '--' + component
46
- ]"
47
- [ngStyle]="{
48
- 'height.px': size,
49
- 'width.px': size,
50
- position: position
51
- }"
52
- (click)="click.emit($event)"
53
- (mouseenter)="mouseEnter.emit($event)"
54
- (mouseover)="mouseOver.emit($event)"
55
- (mouseout)="mouseOut.emit($event)"
56
- (mouseleave)="mouseLeave.emit($event)"
57
- (mousemove)="mouseMove.emit($event)"
58
- tabindex="0"
59
- >
60
- <ng-container *ngTemplateOutlet="nodeTemplate"></ng-container>
61
- </xhtml:button>
62
-
63
- <xhtml:a
64
- *ngSwitchCase="'a'"
65
- [ngClass]="[
66
- namespace,
67
- stacked ? namespace + '--stacked' : '',
68
- shape ? namespace + '--' + shape : '',
69
- namespace + '--' + component
70
- ]"
71
- [attr.href]="href"
72
- [ngStyle]="{
73
- 'height.px': size,
74
- 'width.px': size,
75
- position: position
76
- }"
77
- (mouseenter)="mouseEnter.emit($event)"
78
- (mouseover)="mouseOver.emit($event)"
79
- (mouseout)="mouseOut.emit($event)"
80
- (mouseleave)="mouseLeave.emit($event)"
81
- (mousemove)="mouseMove.emit($event)"
82
- tabindex="0"
83
- >
84
- <ng-container *ngTemplateOutlet="nodeTemplate"></ng-container>
85
- </xhtml:a>
86
- </ng-container>
87
-
88
- <ng-template #nodeTemplate>
89
- <div *ngIf="renderIcon" attr.class="{{ namespace + '__icon' }}">
90
- <ng-container *ngTemplateOutlet="renderIcon"></ng-container>
91
- </div>
92
- <div
93
- attr.class="{{ namespace + '__body' }}"
94
- [ngStyle]="{ position: bodyPosition }"
95
- >
96
- <div attr.class="{{ namespace + '__title' }}">{{ title }}</div>
97
- <div attr.class="{{ namespace + '__subtitle' }}">
98
- {{ subtitle }}
99
- </div>
100
- </div>
101
- </ng-template>
102
- `,
103
- })
104
- export class ShapeNodeComponent implements OnInit {
105
- @Input() as = 'div';
106
- @Input() href: string = null;
107
- @Input() renderIcon: TemplateRef<any>;
108
- @Input() size = 48;
109
- @Input() stacked: boolean;
110
- @Input() shape: 'circle' | 'square' | 'rounded-square' = 'circle';
111
- @Input() subtitle: string;
112
- @Input() title: string;
113
- @Input() position: string = 'fixed';
114
- @Input() bodyPosition: string = 'absolute';
115
-
116
- @Output() click: EventEmitter<any> = new EventEmitter<any>();
117
- @Output() mouseEnter: EventEmitter<any> = new EventEmitter<any>();
118
- @Output() mouseOver: EventEmitter<any> = new EventEmitter<any>();
119
- @Output() mouseOut: EventEmitter<any> = new EventEmitter<any>();
120
- @Output() mouseLeave: EventEmitter<any> = new EventEmitter<any>();
121
- @Output() mouseMove: EventEmitter<any> = new EventEmitter<any>();
122
-
123
- namespace = `${carbonPrefix}--cc--shape-node`;
124
- component = 'div';
125
-
126
- ngOnInit() {
127
- if (this.href) {
128
- this.component = 'a';
129
- } else {
130
- this.component = this.as;
131
- }
132
- }
133
- }
@@ -1,11 +0,0 @@
1
- import { NgModule } from "@angular/core";
2
- import { CommonModule } from "@angular/common";
3
- import { ShapeNodeComponent } from "./shape-node.component";
4
- export { ShapeNodeComponent } from "./shape-node.component";
5
-
6
- @NgModule({
7
- declarations: [ShapeNodeComponent],
8
- exports: [ShapeNodeComponent],
9
- imports: [CommonModule]
10
- })
11
- export class ShapeNodeModule { }
@@ -1,34 +0,0 @@
1
- import {
2
- Component,
3
- AfterViewInit
4
- } from "@angular/core";
5
-
6
- import { BaseChart } from "./base-chart.component";
7
-
8
- import { DonutChart } from "@carbon/charts";
9
-
10
- /**
11
- * Wrapper around `DonutChart` in carbon charts library
12
- *
13
- * Most functions just call their equivalent from the chart library.
14
- */
15
- @Component({
16
- selector: "ibm-donut-chart",
17
- template: ``
18
- })
19
- export class DonutChartComponent 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 DonutChart(
25
- this.elementRef.nativeElement,
26
- {
27
- data: this.data,
28
- options: this.options
29
- }
30
- );
31
-
32
- Object.assign(this, this.chart);
33
- }
34
- }
@@ -1,34 +0,0 @@
1
- import {
2
- Component,
3
- AfterViewInit
4
- } from "@angular/core";
5
-
6
- import { BaseChart } from "./base-chart.component";
7
-
8
- import { GaugeChart } from "@carbon/charts";
9
-
10
- /**
11
- * Wrapper around `GaugeChart` in carbon charts library
12
- *
13
- * Most functions just call their equivalent from the chart library.
14
- */
15
- @Component({
16
- selector: "ibm-gauge-chart",
17
- template: ``
18
- })
19
- export class GaugeChartComponent 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 GaugeChart(
25
- this.elementRef.nativeElement,
26
- {
27
- data: this.data,
28
- options: this.options
29
- }
30
- );
31
-
32
- Object.assign(this, this.chart);
33
- }
34
- }
@@ -1,34 +0,0 @@
1
- import {
2
- Component,
3
- AfterViewInit
4
- } from "@angular/core";
5
-
6
- import { BaseChart } from "./base-chart.component";
7
-
8
- import { HeatmapChart } from "@carbon/charts";
9
-
10
- /**
11
- * Wrapper around `Heatmap` in carbon charts library
12
- *
13
- * Most functions just call their equivalent from the chart library.
14
- */
15
- @Component({
16
- selector: "ibm-heatmap-chart",
17
- template: ``
18
- })
19
- export class HeatmapChartComponent 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 HeatmapChart(
25
- this.elementRef.nativeElement,
26
- {
27
- data: this.data,
28
- options: this.options
29
- }
30
- );
31
-
32
- Object.assign(this, this.chart);
33
- }
34
- }