@carbon/charts-angular 1.8.0 → 1.9.0-rc.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.
- package/.eslintrc.json +51 -0
- package/.storybook/carbon-charts-theme.ts +8 -0
- package/.storybook/main.ts +39 -0
- package/.storybook/manager-head.html +22 -0
- package/.storybook/manager.ts +6 -0
- package/.storybook/preview-head.html +6 -0
- package/.storybook/preview.ts +42 -0
- package/.storybook/tsconfig.json +21 -0
- package/.storybook/typings.d.ts +4 -0
- package/README.md +0 -2
- package/angular.json +91 -0
- package/carbon.yml +277 -0
- package/ng-package.json +14 -0
- package/package.json +89 -63
- package/src/index.ts +53 -0
- package/src/lib/charts/alluvial-chart.component.ts +30 -0
- package/src/lib/charts/area-chart-stacked.component.ts +30 -0
- package/src/lib/charts/area-chart.component.ts +30 -0
- package/src/lib/charts/bar-chart-grouped.component.ts +30 -0
- package/src/lib/charts/bar-chart-simple.component.ts +30 -0
- package/src/lib/charts/bar-chart-stacked.component.ts +30 -0
- package/src/lib/charts/base-chart.component.ts +91 -0
- package/src/lib/charts/boxplot-chart.component.ts +30 -0
- package/src/lib/charts/bubble-chart.component.ts +30 -0
- package/src/lib/charts/bullet-chart.component.ts +30 -0
- package/src/lib/charts/charts.module.ts +92 -0
- package/src/lib/charts/choropleth.component.ts +33 -0
- package/src/lib/charts/circle-pack-chart.component.ts +30 -0
- package/src/lib/charts/combo-chart.component.ts +30 -0
- package/src/lib/charts/donut-chart.component.ts +30 -0
- package/src/lib/charts/gauge-chart.component.ts +30 -0
- package/src/lib/charts/heatmap-chart.component.ts +30 -0
- package/src/lib/charts/histogram-chart.component.ts +30 -0
- package/src/lib/charts/index.ts +28 -0
- package/src/lib/charts/line-chart.component.ts +30 -0
- package/src/lib/charts/lollipop-chart.component.ts +30 -0
- package/src/lib/charts/meter-chart.component.ts +30 -0
- package/src/lib/charts/pie-chart.component.ts +30 -0
- package/src/lib/charts/radar-chart.component.ts +30 -0
- package/src/lib/charts/scatter-chart.component.ts +30 -0
- package/src/lib/charts/tree-chart.component.ts +30 -0
- package/src/lib/charts/treemap-chart.component.ts +30 -0
- package/src/lib/charts/wordcloud-chart.component.ts +30 -0
- package/src/lib/diagrams/config.ts +1 -0
- package/src/lib/diagrams/edges/edge.component.ts +41 -0
- package/src/lib/diagrams/edges/edge.module.ts +11 -0
- package/src/lib/diagrams/edges/marker/marker.component.ts +112 -0
- package/src/lib/diagrams/edges/marker/marker.module.ts +43 -0
- package/src/lib/diagrams/index.ts +23 -0
- package/src/lib/diagrams/nodes/cards/card-node-column.component.ts +22 -0
- package/src/lib/diagrams/nodes/cards/card-node-label.component.ts +14 -0
- package/src/lib/diagrams/nodes/cards/card-node-subtitle.component.ts +14 -0
- package/src/lib/diagrams/nodes/cards/card-node-title.component.ts +14 -0
- package/src/lib/diagrams/nodes/cards/card-node.component.ts +98 -0
- package/src/lib/diagrams/nodes/cards/card-node.module.ts +32 -0
- package/src/lib/diagrams/nodes/shape/shape-node.component.ts +120 -0
- package/src/lib/diagrams/nodes/shape/shape-node.module.ts +11 -0
- package/src/lib/index.ts +50 -0
- package/src/stories/0-api.stories.mdx +69 -0
- package/src/stories/1-color-palette.stories.mdx +73 -0
- package/src/stories/2-combo-charts.stories.mdx +107 -0
- package/src/stories/3-dual-axes-charts.stories.mdx +51 -0
- package/src/stories/4-event-listeners.stories.mdx +26 -0
- package/src/stories/5-tabular-data-format.stories.mdx +132 -0
- package/src/stories/6-themes.stories.mdx +50 -0
- package/src/stories/all.stories.ts +104 -0
- package/src/stories/angular.stories.mdx +136 -0
- package/src/stories/diagrams/0-diagrams-start-here.stories.ts +219 -0
- package/src/stories/diagrams/diagrams-edges-marker.stories.ts +189 -0
- package/src/stories/diagrams/diagrams-edges.stories.ts +177 -0
- package/src/stories/diagrams/diagrams-nodes-card.stories.ts +245 -0
- package/src/stories/diagrams/diagrams-nodes-shape.stories.ts +141 -0
- package/src/stories/diagrams/utils.ts +5 -0
- package/src/test.ts +28 -0
- package/tsconfig.json +43 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +17 -0
- package/tsconfig.vite.json +13 -0
- package/vite.config.ts +22 -0
- package/LICENSE.md +0 -201
- package/alluvial-chart.component.d.ts +0 -13
- package/area-chart-stacked.component.d.ts +0 -13
- package/area-chart.component.d.ts +0 -13
- package/bar-chart-grouped.component.d.ts +0 -13
- package/bar-chart-simple.component.d.ts +0 -13
- package/bar-chart-stacked.component.d.ts +0 -13
- package/base-chart.component.d.ts +0 -44
- package/boxplot-chart.component.d.ts +0 -13
- package/bubble-chart.component.d.ts +0 -13
- package/bullet-chart.component.d.ts +0 -13
- package/bundles/carbon-charts-angular.umd.js +0 -2156
- package/bundles/carbon-charts-angular.umd.js.map +0 -1
- package/bundles/carbon-charts-angular.umd.min.js +0 -16
- package/bundles/carbon-charts-angular.umd.min.js.map +0 -1
- package/carbon-charts-angular.d.ts +0 -5
- package/carbon-charts-angular.metadata.json +0 -1
- package/charts.module.d.ts +0 -2
- package/choropleth.component.d.ts +0 -13
- package/circle-pack-chart.component.d.ts +0 -13
- package/combo-chart.component.d.ts +0 -13
- package/diagrams/card-node/card-node-column.component.d.ts +0 -4
- package/diagrams/card-node/card-node-label.component.d.ts +0 -3
- package/diagrams/card-node/card-node-subtitle.component.d.ts +0 -3
- package/diagrams/card-node/card-node-title.component.d.ts +0 -3
- package/diagrams/card-node/card-node.component.d.ts +0 -17
- package/diagrams/card-node/card-node.module.d.ts +0 -8
- package/diagrams/configs.d.ts +0 -1
- package/diagrams/edge/edge.component.d.ts +0 -17
- package/diagrams/edge/edge.module.d.ts +0 -3
- package/diagrams/marker/marker.component.d.ts +0 -37
- package/diagrams/marker/marker.module.d.ts +0 -4
- package/diagrams/shape-node/shape-node.component.d.ts +0 -22
- package/diagrams/shape-node/shape-node.module.d.ts +0 -3
- package/donut-chart.component.d.ts +0 -13
- package/esm2015/alluvial-chart.component.js +0 -33
- package/esm2015/area-chart-stacked.component.js +0 -33
- package/esm2015/area-chart.component.js +0 -36
- package/esm2015/bar-chart-grouped.component.js +0 -33
- package/esm2015/bar-chart-simple.component.js +0 -33
- package/esm2015/bar-chart-stacked.component.js +0 -33
- package/esm2015/base-chart.component.js +0 -137
- package/esm2015/boxplot-chart.component.js +0 -33
- package/esm2015/bubble-chart.component.js +0 -33
- package/esm2015/bullet-chart.component.js +0 -33
- package/esm2015/carbon-charts-angular.js +0 -11
- package/esm2015/charts.module.js +0 -97
- package/esm2015/choropleth.component.js +0 -33
- package/esm2015/circle-pack-chart.component.js +0 -33
- package/esm2015/combo-chart.component.js +0 -33
- package/esm2015/diagrams/card-node/card-node-column.component.js +0 -41
- package/esm2015/diagrams/card-node/card-node-label.component.js +0 -27
- package/esm2015/diagrams/card-node/card-node-subtitle.component.js +0 -27
- package/esm2015/diagrams/card-node/card-node-title.component.js +0 -27
- package/esm2015/diagrams/card-node/card-node.component.js +0 -148
- package/esm2015/diagrams/card-node/card-node.module.js +0 -23
- package/esm2015/diagrams/configs.js +0 -8
- package/esm2015/diagrams/edge/edge.component.js +0 -80
- package/esm2015/diagrams/edge/edge.module.js +0 -19
- package/esm2015/diagrams/marker/marker.component.js +0 -141
- package/esm2015/diagrams/marker/marker.module.js +0 -35
- package/esm2015/diagrams/shape-node/shape-node.component.js +0 -187
- package/esm2015/diagrams/shape-node/shape-node.module.js +0 -19
- package/esm2015/donut-chart.component.js +0 -33
- package/esm2015/gauge-chart.component.js +0 -33
- package/esm2015/heatmap-chart.component.js +0 -33
- package/esm2015/histogram-chart.component.js +0 -33
- package/esm2015/index.js +0 -45
- package/esm2015/line-chart.component.js +0 -33
- package/esm2015/lollipop-chart.component.js +0 -33
- package/esm2015/meter-chart.component.js +0 -33
- package/esm2015/pie-chart.component.js +0 -33
- package/esm2015/radar-chart.component.js +0 -33
- package/esm2015/scatter-chart.component.js +0 -33
- package/esm2015/tree-chart.component.js +0 -33
- package/esm2015/treemap-chart.component.js +0 -33
- package/esm2015/wordcloud-chart.component.js +0 -33
- package/esm5/alluvial-chart.component.js +0 -47
- package/esm5/area-chart-stacked.component.js +0 -47
- package/esm5/area-chart.component.js +0 -47
- package/esm5/bar-chart-grouped.component.js +0 -47
- package/esm5/bar-chart-simple.component.js +0 -47
- package/esm5/bar-chart-stacked.component.js +0 -47
- package/esm5/base-chart.component.js +0 -160
- package/esm5/boxplot-chart.component.js +0 -47
- package/esm5/bubble-chart.component.js +0 -47
- package/esm5/bullet-chart.component.js +0 -47
- package/esm5/carbon-charts-angular.js +0 -11
- package/esm5/charts.module.js +0 -101
- package/esm5/choropleth.component.js +0 -47
- package/esm5/circle-pack-chart.component.js +0 -47
- package/esm5/combo-chart.component.js +0 -47
- package/esm5/diagrams/card-node/card-node-column.component.js +0 -43
- package/esm5/diagrams/card-node/card-node-label.component.js +0 -25
- package/esm5/diagrams/card-node/card-node-subtitle.component.js +0 -25
- package/esm5/diagrams/card-node/card-node-title.component.js +0 -25
- package/esm5/diagrams/card-node/card-node.component.js +0 -86
- package/esm5/diagrams/card-node/card-node.module.js +0 -27
- package/esm5/diagrams/configs.js +0 -8
- package/esm5/diagrams/edge/edge.component.js +0 -64
- package/esm5/diagrams/edge/edge.module.js +0 -23
- package/esm5/diagrams/marker/marker.component.js +0 -188
- package/esm5/diagrams/marker/marker.module.js +0 -39
- package/esm5/diagrams/shape-node/shape-node.component.js +0 -104
- package/esm5/diagrams/shape-node/shape-node.module.js +0 -23
- package/esm5/donut-chart.component.js +0 -47
- package/esm5/gauge-chart.component.js +0 -47
- package/esm5/heatmap-chart.component.js +0 -47
- package/esm5/histogram-chart.component.js +0 -47
- package/esm5/index.js +0 -45
- package/esm5/line-chart.component.js +0 -47
- package/esm5/lollipop-chart.component.js +0 -47
- package/esm5/meter-chart.component.js +0 -47
- package/esm5/pie-chart.component.js +0 -47
- package/esm5/radar-chart.component.js +0 -47
- package/esm5/scatter-chart.component.js +0 -47
- package/esm5/tree-chart.component.js +0 -47
- package/esm5/treemap-chart.component.js +0 -47
- package/esm5/wordcloud-chart.component.js +0 -47
- package/fesm2015/carbon-charts-angular.js +0 -1722
- package/fesm2015/carbon-charts-angular.js.map +0 -1
- package/fesm5/carbon-charts-angular.js +0 -1924
- package/fesm5/carbon-charts-angular.js.map +0 -1
- package/gauge-chart.component.d.ts +0 -13
- package/heatmap-chart.component.d.ts +0 -13
- package/histogram-chart.component.d.ts +0 -13
- package/index.d.ts +0 -38
- package/line-chart.component.d.ts +0 -13
- package/lollipop-chart.component.d.ts +0 -13
- package/meter-chart.component.d.ts +0 -13
- package/pie-chart.component.d.ts +0 -13
- package/radar-chart.component.d.ts +0 -13
- package/scatter-chart.component.d.ts +0 -13
- package/tree-chart.component.d.ts +0 -13
- package/treemap-chart.component.d.ts +0 -13
- package/wordcloud-chart.component.d.ts +0 -13
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
ExperimentalChoroplethChart as ChoroplethChartCore,
|
|
5
|
+
type ChoroplethChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `Choropleth` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-experimental-choropleth-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class ExperimentalChoroplethChartComponent
|
|
19
|
+
extends BaseChartComponent
|
|
20
|
+
implements AfterViewInit
|
|
21
|
+
{
|
|
22
|
+
/**
|
|
23
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
24
|
+
*/
|
|
25
|
+
override ngAfterViewInit() {
|
|
26
|
+
this.chart = new ChoroplethChartCore(this.elementRef.nativeElement, {
|
|
27
|
+
data: this.data as ChartTabularData,
|
|
28
|
+
options: this.options as ChoroplethChartOptions
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
Object.assign(this, this.chart)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
CirclePackChart as CirclePackChartCore,
|
|
5
|
+
type CirclePackChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `CirclePackChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-circle-pack-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class CirclePackChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new CirclePackChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as CirclePackChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
ComboChart as ComboChartCore,
|
|
5
|
+
type ComboChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} 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 BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new ComboChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as ComboChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
DonutChart as DonutChartCore,
|
|
5
|
+
type DonutChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `DonutChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-donut-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class DonutChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new DonutChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as DonutChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
GaugeChart as GaugeChartCore,
|
|
5
|
+
type GaugeChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `GaugeChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-gauge-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class GaugeChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new GaugeChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as GaugeChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
HeatmapChart as HeatmapChartCore,
|
|
5
|
+
type HeatmapChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `Heatmap` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-heatmap-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class HeatmapChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new HeatmapChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as HeatmapChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
HistogramChart as HistogramChartCore,
|
|
5
|
+
type HistogramChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `HistogramChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-histogram-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class HistogramChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new HistogramChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as HistogramChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { AlluvialChartComponent } from './alluvial-chart.component'
|
|
2
|
+
export { AreaChartComponent } from './area-chart.component'
|
|
3
|
+
export { BaseChartComponent } from './base-chart.component'
|
|
4
|
+
export { BoxplotChartComponent } from './boxplot-chart.component'
|
|
5
|
+
export { BubbleChartComponent } from './bubble-chart.component'
|
|
6
|
+
export { BulletChartComponent } from './bullet-chart.component'
|
|
7
|
+
export { CirclePackChartComponent } from './circle-pack-chart.component'
|
|
8
|
+
export { ComboChartComponent } from './combo-chart.component'
|
|
9
|
+
export { DonutChartComponent } from './donut-chart.component'
|
|
10
|
+
export { ExperimentalChoroplethChartComponent } from './choropleth.component'
|
|
11
|
+
export { GaugeChartComponent } from './gauge-chart.component'
|
|
12
|
+
export { GroupedBarChartComponent } from './bar-chart-grouped.component'
|
|
13
|
+
export { HeatmapChartComponent } from './heatmap-chart.component'
|
|
14
|
+
export { HistogramChartComponent } from './histogram-chart.component'
|
|
15
|
+
export { LineChartComponent } from './line-chart.component'
|
|
16
|
+
export { LollipopChartComponent } from './lollipop-chart.component'
|
|
17
|
+
export { MeterChartComponent } from './meter-chart.component'
|
|
18
|
+
export { PieChartComponent } from './pie-chart.component'
|
|
19
|
+
export { RadarChartComponent } from './radar-chart.component'
|
|
20
|
+
export { ScatterChartComponent } from './scatter-chart.component'
|
|
21
|
+
export { SimpleBarChartComponent } from './bar-chart-simple.component'
|
|
22
|
+
export { StackedAreaChartComponent } from './area-chart-stacked.component'
|
|
23
|
+
export { StackedBarChartComponent } from './bar-chart-stacked.component'
|
|
24
|
+
export { TreeChartComponent } from './tree-chart.component'
|
|
25
|
+
export { TreemapChartComponent } from './treemap-chart.component'
|
|
26
|
+
export { WordCloudChartComponent } from './wordcloud-chart.component'
|
|
27
|
+
|
|
28
|
+
export { ChartsModule } from './charts.module'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
LineChart as LineChartCore,
|
|
5
|
+
type LineChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `LineChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-line-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class LineChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new LineChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as LineChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
LollipopChart as LollipopChartCore,
|
|
5
|
+
type LollipopChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `LollipopChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-lollipop-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class LollipopChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new LollipopChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as LollipopChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
MeterChart as MeterChartCore,
|
|
5
|
+
type MeterChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `MeterChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-meter-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class MeterChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new MeterChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as MeterChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
PieChart as PieChartCore,
|
|
5
|
+
type PieChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `PieChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-pie-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class PieChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new PieChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as PieChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
RadarChart as RadarChartCore,
|
|
5
|
+
type RadarChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `RadarChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-radar-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class RadarChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new RadarChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as RadarChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
ScatterChart as ScatterChartCore,
|
|
5
|
+
type ScatterChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `ScatterChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-scatter-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class ScatterChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new ScatterChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as ScatterChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
TreeChart as TreeChartCore,
|
|
5
|
+
type TreemapChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `TreeChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-tree-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class TreeChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new TreeChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as TreemapChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
TreemapChart as TreemapChartCore,
|
|
5
|
+
type TreemapChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `TreemapChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-treemap-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class TreemapChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new TreemapChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as TreemapChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, AfterViewInit } from '@angular/core'
|
|
2
|
+
import { BaseChartComponent } from './base-chart.component'
|
|
3
|
+
import {
|
|
4
|
+
WordCloudChart as WordCloudChartCore,
|
|
5
|
+
type WorldCloudChartOptions,
|
|
6
|
+
type ChartTabularData
|
|
7
|
+
} from '@carbon/charts'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper around `WordCloudChart` in carbon charts library
|
|
11
|
+
*
|
|
12
|
+
* Most functions just call their equivalent from the chart library.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'ibm-wordcloud-chart',
|
|
16
|
+
template: ``
|
|
17
|
+
})
|
|
18
|
+
export class WordCloudChartComponent extends BaseChartComponent implements AfterViewInit {
|
|
19
|
+
/**
|
|
20
|
+
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
|
|
21
|
+
*/
|
|
22
|
+
override ngAfterViewInit() {
|
|
23
|
+
this.chart = new WordCloudChartCore(this.elementRef.nativeElement, {
|
|
24
|
+
data: this.data as ChartTabularData,
|
|
25
|
+
options: this.options as WorldCloudChartOptions
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
Object.assign(this, this.chart)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const carbonPrefix = 'cds'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core'
|
|
2
|
+
import { buildStraightPathString } from '@carbon/charts'
|
|
3
|
+
|
|
4
|
+
import { carbonPrefix } from '../config'
|
|
5
|
+
|
|
6
|
+
interface Coordinates {
|
|
7
|
+
x: number
|
|
8
|
+
y: number
|
|
9
|
+
}
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'ibm-graph-edge, [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
|
+
<svg:path
|
|
18
|
+
[ngClass]="namespace + '__outer'"
|
|
19
|
+
[attr.d]="path ? path : straight(source, target)" />
|
|
20
|
+
<svg:path
|
|
21
|
+
[ngClass]="namespace + '__inner'"
|
|
22
|
+
[attr.d]="path ? path : straight(source, target)"
|
|
23
|
+
[ngStyle]="{ stroke: color }"
|
|
24
|
+
[attr.marker-start]="markerStart ? 'url(#' + markerStart + ')' : ''"
|
|
25
|
+
[attr.marker-end]="markerEnd ? 'url(#' + markerEnd + ')' : ''" />
|
|
26
|
+
</svg:g>
|
|
27
|
+
`
|
|
28
|
+
})
|
|
29
|
+
export class EdgeComponent {
|
|
30
|
+
@Input() color = ''
|
|
31
|
+
@Input() markerEnd = ''
|
|
32
|
+
@Input() markerStart = ''
|
|
33
|
+
@Input() source: Coordinates = { x: 0, y: 0 }
|
|
34
|
+
@Input() target: Coordinates = { x: 0, y: 0 }
|
|
35
|
+
@Input() variant?: 'dash-sm' | 'dash-md' | 'dash-lg' | 'dash-xl' | 'double' | 'tunnel'
|
|
36
|
+
@Input() path = ''
|
|
37
|
+
|
|
38
|
+
pathClasses = ''
|
|
39
|
+
namespace = `${carbonPrefix}--cc--edge`
|
|
40
|
+
straight = buildStraightPathString
|
|
41
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
imports: [CommonModule],
|
|
9
|
+
exports: [EdgeComponent]
|
|
10
|
+
})
|
|
11
|
+
export class EdgeModule {}
|