genesys-spark-chart-components 4.12.1-beta.1

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 (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/cjs/genesys-chart-webcomponents.cjs.js +23 -0
  4. package/dist/cjs/gux-chart-column-beta.cjs.entry.js +140 -0
  5. package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +229 -0
  6. package/dist/cjs/gux-chart-line-beta.cjs.entry.js +135 -0
  7. package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +113 -0
  8. package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +143 -0
  9. package/dist/cjs/gux-visualization-beta.cjs.entry.js +71953 -0
  10. package/dist/cjs/index-1e13a15f.js +1647 -0
  11. package/dist/cjs/index.cjs.js +2 -0
  12. package/dist/cjs/loader.cjs.js +13 -0
  13. package/dist/cjs/log-error-c46b4b4c.js +21 -0
  14. package/dist/cjs/usage-30f04ec3.js +208 -0
  15. package/dist/collection/collection-manifest.json +17 -0
  16. package/dist/collection/components/beta/gux-chart-column/gux-chart-column.css +13 -0
  17. package/dist/collection/components/beta/gux-chart-column/gux-chart-column.js +343 -0
  18. package/dist/collection/components/beta/gux-chart-column/gux-chart-column.locale.js +92 -0
  19. package/dist/collection/components/beta/gux-chart-column/tests/gux-column-chart.spec.js +22 -0
  20. package/dist/collection/components/beta/gux-chart-donut/gux-chart-donut.css +4 -0
  21. package/dist/collection/components/beta/gux-chart-donut/gux-chart-donut.js +575 -0
  22. package/dist/collection/components/beta/gux-chart-donut/tests/gux-chart-donut.spec.js +11 -0
  23. package/dist/collection/components/beta/gux-chart-line/gux-chart-line.css +4 -0
  24. package/dist/collection/components/beta/gux-chart-line/gux-chart-line.js +391 -0
  25. package/dist/collection/components/beta/gux-chart-line/gux-chart-line.locale.js +92 -0
  26. package/dist/collection/components/beta/gux-chart-line/tests/gux-chart-line.e2e.js +17 -0
  27. package/dist/collection/components/beta/gux-chart-line/tests/gux-chart-line.spec.js +22 -0
  28. package/dist/collection/components/beta/gux-chart-pie/gux-chart-pie.css +4 -0
  29. package/dist/collection/components/beta/gux-chart-pie/gux-chart-pie.js +284 -0
  30. package/dist/collection/components/beta/gux-chart-pie/tests/gux-chart-pie.spec.js +11 -0
  31. package/dist/collection/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.css +4 -0
  32. package/dist/collection/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.js +365 -0
  33. package/dist/collection/components/beta/gux-chart-scatter-plot/tests/gux-chart-scatter-plot.spec.js +33 -0
  34. package/dist/collection/components/beta/gux-visualization/gux-visualization.css +19 -0
  35. package/dist/collection/components/beta/gux-visualization/gux-visualization.js +143 -0
  36. package/dist/collection/components/beta/gux-visualization/gux-visualization.locale.js +92 -0
  37. package/dist/collection/components/beta/gux-visualization/tests/gux-visualization.e2e.js +31 -0
  38. package/dist/collection/components/beta/gux-visualization/tests/gux-visualization.spec.js +35 -0
  39. package/dist/collection/i18n/fetchResources.js +12 -0
  40. package/dist/collection/i18n/index.js +73 -0
  41. package/dist/collection/index.js +2 -0
  42. package/dist/collection/test/axeConfig.js +7 -0
  43. package/dist/collection/test/e2eTestUtils.js +20 -0
  44. package/dist/collection/test/jestMatcherUtils.js +1 -0
  45. package/dist/collection/test/setupAxeTests.js +75 -0
  46. package/dist/collection/test/setupTests.js +9 -0
  47. package/dist/collection/test/specTestUtils.js +10 -0
  48. package/dist/collection/utils/dom/get-closest-element.js +15 -0
  49. package/dist/collection/utils/error/log-error.js +6 -0
  50. package/dist/collection/utils/theme/color-palette.js +12 -0
  51. package/dist/collection/utils/tracking/usage.js +81 -0
  52. package/dist/collection/utils/tracking/usage.spec.js +121 -0
  53. package/dist/component-specs.json +187 -0
  54. package/dist/esm/genesys-chart-webcomponents.js +18 -0
  55. package/dist/esm/gux-chart-column-beta.entry.js +136 -0
  56. package/dist/esm/gux-chart-donut-beta.entry.js +225 -0
  57. package/dist/esm/gux-chart-line-beta.entry.js +131 -0
  58. package/dist/esm/gux-chart-pie-beta.entry.js +109 -0
  59. package/dist/esm/gux-chart-scatter-plot-beta.entry.js +139 -0
  60. package/dist/esm/gux-visualization-beta.entry.js +71949 -0
  61. package/dist/esm/index-701d93cf.js +1619 -0
  62. package/dist/esm/index.js +1 -0
  63. package/dist/esm/loader.js +9 -0
  64. package/dist/esm/log-error-0fc61f6f.js +18 -0
  65. package/dist/esm/polyfills/core-js.js +11 -0
  66. package/dist/esm/polyfills/dom.js +79 -0
  67. package/dist/esm/polyfills/es5-html-element.js +1 -0
  68. package/dist/esm/polyfills/index.js +34 -0
  69. package/dist/esm/polyfills/system.js +6 -0
  70. package/dist/esm/usage-61eee3bd.js +206 -0
  71. package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.css +1 -0
  72. package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -0
  73. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ar.json +1 -0
  74. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.cs.json +1 -0
  75. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.da.json +1 -0
  76. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.de.json +1 -0
  77. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.en.json +1 -0
  78. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.es-es.json +1 -0
  79. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.es.json +1 -0
  80. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.fi.json +1 -0
  81. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.fr-ca.json +1 -0
  82. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.fr.json +1 -0
  83. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.he.json +1 -0
  84. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.it.json +1 -0
  85. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ja.json +1 -0
  86. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ko.json +1 -0
  87. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.nl.json +1 -0
  88. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.no.json +1 -0
  89. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.pl.json +1 -0
  90. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.pt-br.json +1 -0
  91. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.pt-pt.json +1 -0
  92. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ru.json +1 -0
  93. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.sv.json +1 -0
  94. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.th.json +1 -0
  95. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.tr.json +1 -0
  96. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.uk.json +1 -0
  97. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.zh-cn.json +1 -0
  98. package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.zh-tw.json +1 -0
  99. package/dist/genesys-chart-webcomponents/index.esm.js +0 -0
  100. package/dist/genesys-chart-webcomponents/p-137f5b8f.entry.js +1 -0
  101. package/dist/genesys-chart-webcomponents/p-3e4b3dbc.js +2 -0
  102. package/dist/genesys-chart-webcomponents/p-82f0ea01.js +1 -0
  103. package/dist/genesys-chart-webcomponents/p-97c45977.js +1 -0
  104. package/dist/genesys-chart-webcomponents/p-b5179379.entry.js +1 -0
  105. package/dist/genesys-chart-webcomponents/p-b901e9e0.entry.js +11 -0
  106. package/dist/genesys-chart-webcomponents/p-c3aa8578.entry.js +1 -0
  107. package/dist/genesys-chart-webcomponents/p-d4a346df.entry.js +1 -0
  108. package/dist/genesys-chart-webcomponents/p-d9928f8c.entry.js +1 -0
  109. package/dist/index.cjs.js +1 -0
  110. package/dist/index.js +1 -0
  111. package/dist/loader/cdn.js +3 -0
  112. package/dist/loader/index.cjs.js +3 -0
  113. package/dist/loader/index.d.ts +21 -0
  114. package/dist/loader/index.es2017.js +3 -0
  115. package/dist/loader/index.js +4 -0
  116. package/dist/loader/package.json +11 -0
  117. package/dist/stencil-wrapper.js +58 -0
  118. package/dist/types/components/beta/gux-chart-column/gux-chart-column.d.ts +49 -0
  119. package/dist/types/components/beta/gux-chart-column/gux-chart-column.locale.d.ts +22 -0
  120. package/dist/types/components/beta/gux-chart-donut/gux-chart-donut.d.ts +34 -0
  121. package/dist/types/components/beta/gux-chart-line/gux-chart-line.d.ts +48 -0
  122. package/dist/types/components/beta/gux-chart-line/gux-chart-line.locale.d.ts +22 -0
  123. package/dist/types/components/beta/gux-chart-pie/gux-chart-pie.d.ts +23 -0
  124. package/dist/types/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.d.ts +52 -0
  125. package/dist/types/components/beta/gux-visualization/gux-visualization.d.ts +17 -0
  126. package/dist/types/components/beta/gux-visualization/gux-visualization.locale.d.ts +22 -0
  127. package/dist/types/components.d.ts +480 -0
  128. package/dist/types/i18n/fetchResources.d.ts +11 -0
  129. package/dist/types/i18n/index.d.ts +9 -0
  130. package/dist/types/index.d.ts +3 -0
  131. package/dist/types/stencil-public-runtime.d.ts +1671 -0
  132. package/dist/types/stencil-wrapper.d.ts +2 -0
  133. package/dist/types/test/axeConfig.d.ts +6 -0
  134. package/dist/types/test/e2eTestUtils.d.ts +9 -0
  135. package/dist/types/test/jestMatcherUtils.d.ts +8 -0
  136. package/dist/types/test/specTestUtils.d.ts +2 -0
  137. package/dist/types/typings.d.ts +4 -0
  138. package/dist/types/utils/dom/get-closest-element.d.ts +1 -0
  139. package/dist/types/utils/error/log-error.d.ts +2 -0
  140. package/dist/types/utils/theme/color-palette.d.ts +1 -0
  141. package/dist/types/utils/tracking/usage.d.ts +27 -0
  142. package/package.json +118 -0
@@ -0,0 +1,92 @@
1
+ // https://github.com/d3/d3-time-format/tree/master/locale
2
+ // This is just a POC I would structure the files differently when implementing for production.
3
+ export const timeFormatLocale = {
4
+ en: {
5
+ dateTime: '%x, %X',
6
+ date: '%-m/%-d/%Y',
7
+ time: '%-I:%M:%S %p',
8
+ periods: ['AM', 'PM'],
9
+ days: [
10
+ 'Sunday',
11
+ 'Monday',
12
+ 'Tuesday',
13
+ 'Wednesday',
14
+ 'Thursday',
15
+ 'Friday',
16
+ 'Saturday'
17
+ ],
18
+ shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
19
+ months: [
20
+ 'January',
21
+ 'February',
22
+ 'March',
23
+ 'April',
24
+ 'May',
25
+ 'June',
26
+ 'July',
27
+ 'August',
28
+ 'September',
29
+ 'October',
30
+ 'November',
31
+ 'December'
32
+ ],
33
+ shortMonths: [
34
+ 'Jan',
35
+ 'Feb',
36
+ 'Mar',
37
+ 'Apr',
38
+ 'May',
39
+ 'Jun',
40
+ 'Jul',
41
+ 'Aug',
42
+ 'Sep',
43
+ 'Oct',
44
+ 'Nov',
45
+ 'Dec'
46
+ ]
47
+ },
48
+ de: {
49
+ dateTime: '%A, der %e. %B %Y, %X',
50
+ date: '%d.%m.%Y',
51
+ time: '%H:%M:%S',
52
+ periods: ['AM', 'PM'],
53
+ days: [
54
+ 'Sonntag',
55
+ 'Montag',
56
+ 'Dienstag',
57
+ 'Mittwoch',
58
+ 'Donnerstag',
59
+ 'Freitag',
60
+ 'Samstag'
61
+ ],
62
+ shortDays: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
63
+ months: [
64
+ 'Januar',
65
+ 'Februar',
66
+ 'März',
67
+ 'April',
68
+ 'Mai',
69
+ 'Juni',
70
+ 'Juli',
71
+ 'August',
72
+ 'September',
73
+ 'Oktober',
74
+ 'November',
75
+ 'Dezember'
76
+ ],
77
+ shortMonths: [
78
+ 'Jan',
79
+ 'Feb',
80
+ 'Mrz',
81
+ 'Apr',
82
+ 'Mai',
83
+ 'Jun',
84
+ 'Jul',
85
+ 'Aug',
86
+ 'Sep',
87
+ 'Okt',
88
+ 'Nov',
89
+ 'Dez'
90
+ ]
91
+ }
92
+ };
@@ -0,0 +1,22 @@
1
+ import { newSpecPage } from "../../../../test/specTestUtils";
2
+ import { GuxColumnChart } from "../gux-chart-column";
3
+ const components = [GuxColumnChart];
4
+ const language = 'en';
5
+ describe('gux-chart-column-beta', () => {
6
+ it('should build', async () => {
7
+ const html = '<gux-chart-column-beta x-field-name="date" y-field-name="value"></gux-chart-column-beta>';
8
+ const page = await newSpecPage({ components, html, language });
9
+ expect(page.rootInstance).toBeInstanceOf(GuxColumnChart);
10
+ });
11
+ it('should reflect user option to make slant x axis tick labels', async () => {
12
+ let html = '<gux-chart-column-beta x-field-name="date" y-field-name="value"></gux-chart-column-beta>';
13
+ let page = await newSpecPage({ components, html, language });
14
+ expect(page.rootInstance.xTickLabelSlant).toBeUndefined();
15
+ expect(page.rootInstance.baseChartSpec.config.axisX.labelAngle).toBe(0);
16
+ html =
17
+ '<gux-chart-column-beta x-field-name="date" y-field-name="value" x-tick-label-slant="true"></gux-chart-column-beta>';
18
+ page = await newSpecPage({ components, html, language });
19
+ expect(page.rootInstance.xTickLabelSlant).toBeTruthy();
20
+ expect(page.rootInstance.baseChartSpec.config.axisX.labelAngle).toBe(45);
21
+ });
22
+ });
@@ -0,0 +1,4 @@
1
+ gux-visualization-beta {
2
+ height: fit-content;
3
+ color: #2e394c;
4
+ }
@@ -0,0 +1,575 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ import { h } from "@stencil/core";
3
+ import { trackComponent } from "../../../utils/tracking/usage";
4
+ import { logError } from "../../../utils/error/log-error";
5
+ import { VISUALIZATION_COLORS } from "../../../utils/theme/color-palette";
6
+ const DEFAULT_COLOR_FIELD_NAME = 'category';
7
+ const DEFAULT_LABEL_FIELD_NAME = 'value';
8
+ const DEFAULT_RING_WIDTH = 32;
9
+ export class GuxDonutChart {
10
+ constructor() {
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ this.baseChartSpec = {
13
+ $schema: 'https://vega.github.io/schema/vega-lite/v5.json',
14
+ config: {
15
+ legend: {
16
+ symbolType: 'circle'
17
+ }
18
+ },
19
+ encoding: {
20
+ theta: { field: 'value', type: 'quantitative', stack: true },
21
+ color: {
22
+ field: DEFAULT_COLOR_FIELD_NAME,
23
+ type: 'nominal',
24
+ scale: { range: VISUALIZATION_COLORS },
25
+ legend: null
26
+ }
27
+ },
28
+ layer: [
29
+ {
30
+ mark: { type: 'arc', outerRadius: 80 }
31
+ },
32
+ {
33
+ mark: { type: 'text', radius: 90 },
34
+ encoding: {
35
+ text: { field: DEFAULT_LABEL_FIELD_NAME, type: 'quantitative' }
36
+ }
37
+ }
38
+ ],
39
+ view: { stroke: null }
40
+ };
41
+ this.chartData = undefined;
42
+ this.includeLegend = undefined;
43
+ this.legendPosition = 'right';
44
+ this.legendTitle = undefined;
45
+ this.colorFieldName = undefined;
46
+ this.outerRadius = undefined;
47
+ this.innerRadius = undefined;
48
+ this.labelRadius = undefined;
49
+ this.labelField = undefined;
50
+ this.gauge = undefined;
51
+ this.centerText = undefined;
52
+ this.centerSubText = undefined;
53
+ this.showTooltip = true;
54
+ this.tooltipOptions = undefined;
55
+ this.legendX = undefined;
56
+ this.legendY = undefined;
57
+ this.legendFontSize = undefined;
58
+ this.legendSymbolSize = undefined;
59
+ this.embedOptions = undefined;
60
+ }
61
+ parseData() {
62
+ if (!this.outerRadius && !this.innerRadius) {
63
+ logError(this.root, 'requires at least one of outer-radius or inner-radius');
64
+ }
65
+ let chartData = {};
66
+ if (this.chartData) {
67
+ chartData = { data: this.chartData };
68
+ }
69
+ if (this.legendPosition) {
70
+ this.baseChartSpec.config.legend.orient = this.legendPosition;
71
+ }
72
+ if (this.includeLegend) {
73
+ this.baseChartSpec.encoding.color.legend = {};
74
+ if (this.legendX || this.legendY) {
75
+ this.baseChartSpec.config.legend.orient = 'none';
76
+ if (this.legendX) {
77
+ this.baseChartSpec.encoding.color.legend.legendX = this.legendX;
78
+ }
79
+ if (this.legendY) {
80
+ this.baseChartSpec.encoding.color.legend.legendY = this.legendY;
81
+ }
82
+ }
83
+ if (this.legendFontSize) {
84
+ this.baseChartSpec.encoding.color.legend.labelFontSize =
85
+ this.legendFontSize;
86
+ }
87
+ if (this.legendSymbolSize) {
88
+ this.baseChartSpec.encoding.color.legend.symbolSize =
89
+ this.legendSymbolSize;
90
+ }
91
+ }
92
+ else {
93
+ this.baseChartSpec.encoding.color.legend = null;
94
+ }
95
+ const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
96
+ if (colorFieldName) {
97
+ this.baseChartSpec.encoding.color.field = colorFieldName;
98
+ }
99
+ const legendTitle = this.legendTitle;
100
+ if (legendTitle) {
101
+ this.baseChartSpec.encoding.color.title = legendTitle;
102
+ }
103
+ else {
104
+ this.baseChartSpec.encoding.color.title = '';
105
+ }
106
+ let outerRadius = this.outerRadius;
107
+ let innerRadius = this.innerRadius;
108
+ if (!outerRadius) {
109
+ outerRadius = innerRadius + DEFAULT_RING_WIDTH;
110
+ }
111
+ if (!innerRadius) {
112
+ innerRadius = outerRadius - DEFAULT_RING_WIDTH;
113
+ }
114
+ let layerFiels = 1;
115
+ if (this.gauge) {
116
+ this.baseChartSpec.layer = [
117
+ {
118
+ data: { values: [{ progress: 'default', value: 100 }] },
119
+ mark: { type: 'arc', innerRadius },
120
+ encoding: {
121
+ theta: { field: 'value', type: 'quantitative' },
122
+ color: { value: '#E4E9F0' },
123
+ tooltip: null
124
+ }
125
+ },
126
+ {
127
+ mark: { type: 'arc', outerRadius, innerRadius, padAngle: 0.01 }
128
+ },
129
+ {
130
+ mark: { type: 'arc', innerRadius, padAngle: 0.01 }
131
+ }
132
+ ];
133
+ layerFiels = 2;
134
+ }
135
+ else {
136
+ this.baseChartSpec.layer = [
137
+ {
138
+ mark: { type: 'arc', outerRadius, innerRadius }
139
+ },
140
+ {
141
+ mark: { type: 'arc', innerRadius, stroke: '#fff' }
142
+ }
143
+ ];
144
+ }
145
+ const centerText = this.centerText;
146
+ if (centerText) {
147
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
148
+ this.baseChartSpec.layer.push({
149
+ data: { values: [{ centerText: centerText, value: 0 }] },
150
+ mark: { align: 'center', type: 'text', baseline: 'middle' },
151
+ encoding: {
152
+ color: { value: '#4C5054' },
153
+ text: { field: 'centerText' },
154
+ size: { value: { expr: 'height * 0.09' } },
155
+ tooltip: null
156
+ }
157
+ });
158
+ }
159
+ const centerSubText = this.centerSubText;
160
+ if (centerSubText) {
161
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
162
+ this.baseChartSpec.layer.push({
163
+ data: { values: [{ centerSubText: centerSubText, value: 0 }] },
164
+ mark: {
165
+ align: 'center',
166
+ type: 'text',
167
+ baseline: 'middle',
168
+ y: { expr: 'height/2 + 20' }
169
+ },
170
+ encoding: {
171
+ color: { value: '#6A6D70' },
172
+ text: { field: 'centerSubText' },
173
+ size: { value: { expr: 'height * 0.06' } },
174
+ tooltip: null
175
+ }
176
+ });
177
+ }
178
+ const labelRadius = this.labelRadius;
179
+ const labelField = this.labelField || DEFAULT_LABEL_FIELD_NAME;
180
+ if (labelRadius) {
181
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
182
+ this.baseChartSpec.layer.push({
183
+ mark: { type: 'text', radius: labelRadius },
184
+ encoding: {
185
+ text: { field: labelField, type: 'quantitative' }
186
+ }
187
+ });
188
+ }
189
+ if (this.showTooltip) {
190
+ if (this.tooltipOptions) {
191
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
192
+ this.baseChartSpec.layer[layerFiels].mark.tooltip = { content: 'data' };
193
+ this.tooltipSpec = {
194
+ actions: false,
195
+ tooltip: this.tooltipOptions
196
+ };
197
+ }
198
+ else {
199
+ this.baseChartSpec.encoding.tooltip = {
200
+ field: labelField,
201
+ aggregate: 'count',
202
+ type: 'quantitative'
203
+ };
204
+ }
205
+ }
206
+ const spec = Object.assign(this.baseChartSpec, chartData);
207
+ this.visualizationSpec = spec;
208
+ }
209
+ componentWillLoad() {
210
+ trackComponent(this.root);
211
+ this.parseData();
212
+ }
213
+ render() {
214
+ return (h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec, embedOptions: this.tooltipSpec }));
215
+ }
216
+ static get is() { return "gux-chart-donut-beta"; }
217
+ static get encapsulation() { return "shadow"; }
218
+ static get originalStyleUrls() {
219
+ return {
220
+ "$": ["gux-chart-donut.scss"]
221
+ };
222
+ }
223
+ static get styleUrls() {
224
+ return {
225
+ "$": ["gux-chart-donut.css"]
226
+ };
227
+ }
228
+ static get properties() {
229
+ return {
230
+ "chartData": {
231
+ "type": "unknown",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "Record<string, any>",
235
+ "resolved": "{ [x: string]: any; }",
236
+ "references": {
237
+ "Record": {
238
+ "location": "global",
239
+ "id": "global::Record"
240
+ }
241
+ }
242
+ },
243
+ "required": false,
244
+ "optional": false,
245
+ "docs": {
246
+ "tags": [],
247
+ "text": "Data to be rendered in the chart.\nData field names must match the values you set in xFieldName and yFieldName"
248
+ }
249
+ },
250
+ "includeLegend": {
251
+ "type": "boolean",
252
+ "mutable": false,
253
+ "complexType": {
254
+ "original": "boolean",
255
+ "resolved": "boolean",
256
+ "references": {}
257
+ },
258
+ "required": false,
259
+ "optional": false,
260
+ "docs": {
261
+ "tags": [],
262
+ "text": ""
263
+ },
264
+ "attribute": "include-legend",
265
+ "reflect": false
266
+ },
267
+ "legendPosition": {
268
+ "type": "string",
269
+ "mutable": false,
270
+ "complexType": {
271
+ "original": "| 'left'\n | 'right'\n | 'top'\n | 'bottom'\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n | 'none'",
272
+ "resolved": "\"bottom\" | \"bottom-left\" | \"bottom-right\" | \"left\" | \"none\" | \"right\" | \"top\" | \"top-left\" | \"top-right\"",
273
+ "references": {}
274
+ },
275
+ "required": false,
276
+ "optional": false,
277
+ "docs": {
278
+ "tags": [],
279
+ "text": ""
280
+ },
281
+ "attribute": "legend-position",
282
+ "reflect": false,
283
+ "defaultValue": "'right'"
284
+ },
285
+ "legendTitle": {
286
+ "type": "string",
287
+ "mutable": false,
288
+ "complexType": {
289
+ "original": "string",
290
+ "resolved": "string",
291
+ "references": {}
292
+ },
293
+ "required": false,
294
+ "optional": false,
295
+ "docs": {
296
+ "tags": [],
297
+ "text": ""
298
+ },
299
+ "attribute": "legend-title",
300
+ "reflect": false
301
+ },
302
+ "colorFieldName": {
303
+ "type": "string",
304
+ "mutable": false,
305
+ "complexType": {
306
+ "original": "string",
307
+ "resolved": "string",
308
+ "references": {}
309
+ },
310
+ "required": false,
311
+ "optional": false,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": ""
315
+ },
316
+ "attribute": "color-field-name",
317
+ "reflect": false
318
+ },
319
+ "outerRadius": {
320
+ "type": "number",
321
+ "mutable": false,
322
+ "complexType": {
323
+ "original": "number",
324
+ "resolved": "number",
325
+ "references": {}
326
+ },
327
+ "required": false,
328
+ "optional": false,
329
+ "docs": {
330
+ "tags": [],
331
+ "text": ""
332
+ },
333
+ "attribute": "outer-radius",
334
+ "reflect": false
335
+ },
336
+ "innerRadius": {
337
+ "type": "number",
338
+ "mutable": false,
339
+ "complexType": {
340
+ "original": "number",
341
+ "resolved": "number",
342
+ "references": {}
343
+ },
344
+ "required": false,
345
+ "optional": false,
346
+ "docs": {
347
+ "tags": [],
348
+ "text": ""
349
+ },
350
+ "attribute": "inner-radius",
351
+ "reflect": false
352
+ },
353
+ "labelRadius": {
354
+ "type": "number",
355
+ "mutable": false,
356
+ "complexType": {
357
+ "original": "number",
358
+ "resolved": "number",
359
+ "references": {}
360
+ },
361
+ "required": false,
362
+ "optional": false,
363
+ "docs": {
364
+ "tags": [],
365
+ "text": ""
366
+ },
367
+ "attribute": "label-radius",
368
+ "reflect": false
369
+ },
370
+ "labelField": {
371
+ "type": "string",
372
+ "mutable": false,
373
+ "complexType": {
374
+ "original": "string",
375
+ "resolved": "string",
376
+ "references": {}
377
+ },
378
+ "required": false,
379
+ "optional": false,
380
+ "docs": {
381
+ "tags": [],
382
+ "text": ""
383
+ },
384
+ "attribute": "label-field",
385
+ "reflect": false
386
+ },
387
+ "gauge": {
388
+ "type": "boolean",
389
+ "mutable": false,
390
+ "complexType": {
391
+ "original": "boolean",
392
+ "resolved": "boolean",
393
+ "references": {}
394
+ },
395
+ "required": false,
396
+ "optional": false,
397
+ "docs": {
398
+ "tags": [],
399
+ "text": ""
400
+ },
401
+ "attribute": "gauge",
402
+ "reflect": false
403
+ },
404
+ "centerText": {
405
+ "type": "string",
406
+ "mutable": false,
407
+ "complexType": {
408
+ "original": "string",
409
+ "resolved": "string",
410
+ "references": {}
411
+ },
412
+ "required": false,
413
+ "optional": false,
414
+ "docs": {
415
+ "tags": [],
416
+ "text": ""
417
+ },
418
+ "attribute": "center-text",
419
+ "reflect": false
420
+ },
421
+ "centerSubText": {
422
+ "type": "string",
423
+ "mutable": false,
424
+ "complexType": {
425
+ "original": "string",
426
+ "resolved": "string",
427
+ "references": {}
428
+ },
429
+ "required": false,
430
+ "optional": false,
431
+ "docs": {
432
+ "tags": [],
433
+ "text": ""
434
+ },
435
+ "attribute": "center-sub-text",
436
+ "reflect": false
437
+ },
438
+ "showTooltip": {
439
+ "type": "boolean",
440
+ "mutable": false,
441
+ "complexType": {
442
+ "original": "boolean",
443
+ "resolved": "boolean",
444
+ "references": {}
445
+ },
446
+ "required": false,
447
+ "optional": false,
448
+ "docs": {
449
+ "tags": [],
450
+ "text": ""
451
+ },
452
+ "attribute": "show-tooltip",
453
+ "reflect": false,
454
+ "defaultValue": "true"
455
+ },
456
+ "tooltipOptions": {
457
+ "type": "unknown",
458
+ "mutable": false,
459
+ "complexType": {
460
+ "original": "EmbedOptions",
461
+ "resolved": "EmbedOptions<string, Renderers>",
462
+ "references": {
463
+ "EmbedOptions": {
464
+ "location": "import",
465
+ "path": "vega-embed",
466
+ "id": "../../node_modules/vega-embed/build/vega-embed.module.d.ts::EmbedOptions"
467
+ }
468
+ }
469
+ },
470
+ "required": false,
471
+ "optional": false,
472
+ "docs": {
473
+ "tags": [],
474
+ "text": ""
475
+ }
476
+ },
477
+ "legendX": {
478
+ "type": "number",
479
+ "mutable": false,
480
+ "complexType": {
481
+ "original": "number",
482
+ "resolved": "number",
483
+ "references": {}
484
+ },
485
+ "required": false,
486
+ "optional": false,
487
+ "docs": {
488
+ "tags": [],
489
+ "text": ""
490
+ },
491
+ "attribute": "legend-x",
492
+ "reflect": false
493
+ },
494
+ "legendY": {
495
+ "type": "number",
496
+ "mutable": false,
497
+ "complexType": {
498
+ "original": "number",
499
+ "resolved": "number",
500
+ "references": {}
501
+ },
502
+ "required": false,
503
+ "optional": false,
504
+ "docs": {
505
+ "tags": [],
506
+ "text": ""
507
+ },
508
+ "attribute": "legend-y",
509
+ "reflect": false
510
+ },
511
+ "legendFontSize": {
512
+ "type": "number",
513
+ "mutable": false,
514
+ "complexType": {
515
+ "original": "number",
516
+ "resolved": "number",
517
+ "references": {}
518
+ },
519
+ "required": false,
520
+ "optional": false,
521
+ "docs": {
522
+ "tags": [],
523
+ "text": ""
524
+ },
525
+ "attribute": "legend-font-size",
526
+ "reflect": false
527
+ },
528
+ "legendSymbolSize": {
529
+ "type": "number",
530
+ "mutable": false,
531
+ "complexType": {
532
+ "original": "number",
533
+ "resolved": "number",
534
+ "references": {}
535
+ },
536
+ "required": false,
537
+ "optional": false,
538
+ "docs": {
539
+ "tags": [],
540
+ "text": ""
541
+ },
542
+ "attribute": "legend-symbol-size",
543
+ "reflect": false
544
+ },
545
+ "embedOptions": {
546
+ "type": "unknown",
547
+ "mutable": false,
548
+ "complexType": {
549
+ "original": "EmbedOptions",
550
+ "resolved": "EmbedOptions<string, Renderers>",
551
+ "references": {
552
+ "EmbedOptions": {
553
+ "location": "import",
554
+ "path": "vega-embed",
555
+ "id": "../../node_modules/vega-embed/build/vega-embed.module.d.ts::EmbedOptions"
556
+ }
557
+ }
558
+ },
559
+ "required": false,
560
+ "optional": false,
561
+ "docs": {
562
+ "tags": [],
563
+ "text": ""
564
+ }
565
+ }
566
+ };
567
+ }
568
+ static get elementRef() { return "root"; }
569
+ static get watchers() {
570
+ return [{
571
+ "propName": "chartData",
572
+ "methodName": "parseData"
573
+ }];
574
+ }
575
+ }
@@ -0,0 +1,11 @@
1
+ import { newSpecPage } from "../../../../test/specTestUtils";
2
+ import { GuxDonutChart } from "../gux-chart-donut";
3
+ const components = [GuxDonutChart];
4
+ const language = 'en';
5
+ describe('gux-chart-donut-beta', () => {
6
+ it('should build', async () => {
7
+ const html = '<gux-chart-donut-beta inner-radius="20" outer-radius="80"></gux-chart-donut-beta>';
8
+ const page = await newSpecPage({ components, html, language });
9
+ expect(page.rootInstance).toBeInstanceOf(GuxDonutChart);
10
+ });
11
+ });