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,131 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-701d93cf.js';
2
+ import { t as trackComponent } from './usage-61eee3bd.js';
3
+ import { V as VISUALIZATION_COLORS, l as logError } from './log-error-0fc61f6f.js';
4
+
5
+ const guxChartLineCss = "gux-visualization-beta{height:fit-content;color:#2e394c}";
6
+
7
+ const DEFAULT_COLOR_FIELD_NAME = 'category';
8
+ const GuxLineChart = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
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
+ mark: {
15
+ type: 'line',
16
+ interpolate: 'linear',
17
+ point: false
18
+ },
19
+ config: {
20
+ axis: {
21
+ ticks: false,
22
+ titlePadding: 8
23
+ },
24
+ axisX: {
25
+ labelAngle: 0
26
+ },
27
+ legend: {
28
+ symbolType: 'circle'
29
+ }
30
+ },
31
+ encoding: {
32
+ x: { type: 'nominal' },
33
+ y: { type: 'quantitative' },
34
+ color: {
35
+ field: DEFAULT_COLOR_FIELD_NAME,
36
+ type: 'nominal',
37
+ scale: { range: VISUALIZATION_COLORS },
38
+ legend: null
39
+ },
40
+ tooltip: { aggregate: 'count', type: 'quantitative' }
41
+ }
42
+ };
43
+ this.chartData = undefined;
44
+ this.xTickLabelSlant = undefined;
45
+ this.includeLegend = undefined;
46
+ this.legendPosition = 'right';
47
+ this.includeDataPointMarkers = undefined;
48
+ this.xFieldName = undefined;
49
+ this.xAxisTitle = undefined;
50
+ this.yFieldName = undefined;
51
+ this.yAxisTitle = undefined;
52
+ this.legendTitle = undefined;
53
+ this.colorFieldName = undefined;
54
+ this.strokeDash = undefined;
55
+ this.interpolation = undefined;
56
+ this.embedOptions = undefined;
57
+ }
58
+ parseData() {
59
+ if (!this.xFieldName || !this.yFieldName) {
60
+ logError(this.root, 'requires x-field-name and y-field-name');
61
+ }
62
+ let chartData = {};
63
+ if (this.chartData) {
64
+ chartData = { data: this.chartData };
65
+ }
66
+ if (this.xTickLabelSlant) {
67
+ this.baseChartSpec.config.axisX.labelAngle = 45;
68
+ }
69
+ if (this.includeLegend) {
70
+ this.baseChartSpec.encoding.color.legend = true;
71
+ }
72
+ if (this.legendPosition) {
73
+ this.baseChartSpec.config.legend.orient = this.legendPosition;
74
+ }
75
+ const xFieldName = this.xFieldName;
76
+ const xAxisTitle = this.xAxisTitle;
77
+ const yFieldName = this.yFieldName;
78
+ const yAxisTitle = this.yAxisTitle;
79
+ const legendTitle = this.legendTitle;
80
+ const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
81
+ const interpolation = this.interpolation;
82
+ const strokeDash = this.strokeDash;
83
+ const includeDataPointMarkers = this.includeDataPointMarkers;
84
+ if (xFieldName) {
85
+ this.baseChartSpec.encoding.x.field = xFieldName;
86
+ }
87
+ if (xAxisTitle) {
88
+ this.baseChartSpec.encoding.x.title = xAxisTitle;
89
+ }
90
+ if (yFieldName) {
91
+ this.baseChartSpec.encoding.y.field = yFieldName;
92
+ }
93
+ if (yAxisTitle) {
94
+ this.baseChartSpec.encoding.y.title = yAxisTitle;
95
+ }
96
+ if (colorFieldName) {
97
+ this.baseChartSpec.encoding.color.field = colorFieldName;
98
+ }
99
+ if (legendTitle) {
100
+ this.baseChartSpec.encoding.color.title = legendTitle;
101
+ }
102
+ if (strokeDash) {
103
+ this.baseChartSpec.encoding.strokeDash = {
104
+ field: colorFieldName,
105
+ type: 'nominal'
106
+ };
107
+ }
108
+ if (interpolation) {
109
+ this.baseChartSpec.mark.interpolate = interpolation;
110
+ }
111
+ if (includeDataPointMarkers) {
112
+ this.baseChartSpec.mark.point = includeDataPointMarkers;
113
+ }
114
+ const spec = Object.assign(this.baseChartSpec, chartData);
115
+ this.visualizationSpec = spec;
116
+ }
117
+ componentWillLoad() {
118
+ trackComponent(this.root);
119
+ this.parseData();
120
+ }
121
+ render() {
122
+ return (h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
123
+ }
124
+ get root() { return getElement(this); }
125
+ static get watchers() { return {
126
+ "chartData": ["parseData"]
127
+ }; }
128
+ };
129
+ GuxLineChart.style = guxChartLineCss;
130
+
131
+ export { GuxLineChart as gux_chart_line_beta };
@@ -0,0 +1,109 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-701d93cf.js';
2
+ import { t as trackComponent } from './usage-61eee3bd.js';
3
+ import { V as VISUALIZATION_COLORS, l as logError } from './log-error-0fc61f6f.js';
4
+
5
+ const guxChartPieCss = "gux-visualization-beta{height:fit-content;color:#2e394c}";
6
+
7
+ const DEFAULT_COLOR_FIELD_NAME = 'category';
8
+ const DEFAULT_LABEL_FIELD_NAME = 'value';
9
+ const GuxPieChart = class {
10
+ constructor(hostRef) {
11
+ registerInstance(this, hostRef);
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
+ this.baseChartSpec = {
14
+ $schema: 'https://vega.github.io/schema/vega-lite/v5.json',
15
+ config: {
16
+ legend: {
17
+ symbolType: 'circle'
18
+ }
19
+ },
20
+ encoding: {
21
+ theta: { field: 'value', type: 'quantitative', stack: true },
22
+ color: {
23
+ field: DEFAULT_COLOR_FIELD_NAME,
24
+ type: 'nominal',
25
+ scale: { range: VISUALIZATION_COLORS },
26
+ legend: null
27
+ },
28
+ tooltip: { aggregate: 'count', type: 'quantitative' }
29
+ },
30
+ layer: [
31
+ {
32
+ mark: { type: 'arc', outerRadius: 80 }
33
+ },
34
+ {
35
+ mark: { type: 'text', radius: 90 },
36
+ encoding: {
37
+ text: { field: DEFAULT_LABEL_FIELD_NAME, type: 'quantitative' }
38
+ }
39
+ }
40
+ ],
41
+ view: { stroke: null }
42
+ };
43
+ this.chartData = undefined;
44
+ this.includeLegend = undefined;
45
+ this.legendPosition = 'right';
46
+ this.legendTitle = undefined;
47
+ this.colorFieldName = undefined;
48
+ this.outerRadius = undefined;
49
+ this.labelRadius = undefined;
50
+ this.labelField = undefined;
51
+ this.embedOptions = undefined;
52
+ }
53
+ parseData() {
54
+ if (!this.outerRadius) {
55
+ logError(this.root, 'requires outer-radius');
56
+ }
57
+ let chartData = {};
58
+ if (this.chartData) {
59
+ chartData = { data: this.chartData };
60
+ }
61
+ if (this.includeLegend) {
62
+ this.baseChartSpec.encoding.color.legend = true;
63
+ }
64
+ if (this.legendPosition) {
65
+ this.baseChartSpec.config.legend.orient = this.legendPosition;
66
+ }
67
+ const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
68
+ if (colorFieldName) {
69
+ this.baseChartSpec.encoding.color.field = colorFieldName;
70
+ }
71
+ const legendTitle = this.legendTitle;
72
+ if (legendTitle) {
73
+ this.baseChartSpec.encoding.color.title = legendTitle;
74
+ }
75
+ const outerRadius = this.outerRadius;
76
+ this.baseChartSpec.layer = [
77
+ {
78
+ mark: { type: 'arc', outerRadius }
79
+ }
80
+ ];
81
+ const labelRadius = this.labelRadius;
82
+ const labelField = this.labelField || DEFAULT_LABEL_FIELD_NAME;
83
+ if (labelRadius) {
84
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
85
+ this.baseChartSpec.layer.push({
86
+ mark: { type: 'text', radius: labelRadius },
87
+ encoding: {
88
+ text: { field: labelField, type: 'quantitative' }
89
+ }
90
+ });
91
+ }
92
+ const spec = Object.assign(this.baseChartSpec, chartData);
93
+ this.visualizationSpec = spec;
94
+ }
95
+ componentWillLoad() {
96
+ trackComponent(this.root);
97
+ this.parseData();
98
+ }
99
+ render() {
100
+ return (h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
101
+ }
102
+ get root() { return getElement(this); }
103
+ static get watchers() { return {
104
+ "chartData": ["parseData"]
105
+ }; }
106
+ };
107
+ GuxPieChart.style = guxChartPieCss;
108
+
109
+ export { GuxPieChart as gux_chart_pie_beta };
@@ -0,0 +1,139 @@
1
+ import { r as registerInstance, h, g as getElement } from './index-701d93cf.js';
2
+ import { t as trackComponent } from './usage-61eee3bd.js';
3
+ import { V as VISUALIZATION_COLORS, l as logError } from './log-error-0fc61f6f.js';
4
+
5
+ const guxChartScatterPlotCss = "gux-visualization-beta{height:fit-content;color:#2e394c}";
6
+
7
+ const DEFAULT_COLOR_FIELD_NAME = 'category';
8
+ const GuxScatterPlotChart = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
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
+ params: [
15
+ {
16
+ name: 'onHover',
17
+ select: { type: 'point', on: 'mouseover' }
18
+ }
19
+ ],
20
+ config: {
21
+ axis: {
22
+ ticks: false,
23
+ titlePadding: 8,
24
+ gridColor: '#F6F7F9'
25
+ },
26
+ axisX: {
27
+ labelAngle: 0,
28
+ grid: true
29
+ },
30
+ legend: {
31
+ symbolType: 'circle'
32
+ }
33
+ },
34
+ width: { step: 40 },
35
+ encoding: {
36
+ x: { type: 'nominal' },
37
+ y: { type: 'quantitative' },
38
+ color: {
39
+ field: DEFAULT_COLOR_FIELD_NAME,
40
+ type: 'nominal',
41
+ scale: { range: VISUALIZATION_COLORS },
42
+ legend: null
43
+ },
44
+ size: {
45
+ condition: [
46
+ {
47
+ param: 'onHover',
48
+ empty: false,
49
+ value: 100
50
+ }
51
+ ],
52
+ value: 40
53
+ }
54
+ }
55
+ };
56
+ this.chartData = undefined;
57
+ this.xTickLabelSlant = undefined;
58
+ this.includeLegend = undefined;
59
+ this.legendPosition = 'right';
60
+ this.xFieldName = undefined;
61
+ this.xAxisTitle = undefined;
62
+ this.yFieldName = undefined;
63
+ this.yAxisTitle = undefined;
64
+ this.legendTitle = undefined;
65
+ this.colorFieldName = undefined;
66
+ this.useShape = undefined;
67
+ this.embedOptions = undefined;
68
+ }
69
+ parseData() {
70
+ if (!this.xFieldName || !this.yFieldName) {
71
+ logError(this.root, 'requires x-field-name and y-field-name');
72
+ }
73
+ let chartData = {};
74
+ if (this.chartData) {
75
+ chartData = { data: this.chartData };
76
+ }
77
+ if (this.xTickLabelSlant) {
78
+ this.baseChartSpec.config.axisX.labelAngle = -45;
79
+ }
80
+ if (this.legendPosition) {
81
+ this.baseChartSpec.config.legend.orient = this.legendPosition;
82
+ }
83
+ const xFieldName = this.xFieldName;
84
+ const xAxisTitle = this.xAxisTitle;
85
+ const yFieldName = this.yFieldName;
86
+ const yAxisTitle = this.yAxisTitle;
87
+ const legendTitle = this.legendTitle;
88
+ const useShape = this.useShape || 'circle';
89
+ const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
90
+ if (this.includeLegend) {
91
+ this.baseChartSpec.encoding.color.legend = true;
92
+ }
93
+ if (xFieldName) {
94
+ this.baseChartSpec.encoding.x.field = xFieldName;
95
+ }
96
+ if (xAxisTitle) {
97
+ this.baseChartSpec.encoding.x.title = xAxisTitle;
98
+ }
99
+ if (yFieldName) {
100
+ this.baseChartSpec.encoding.y.field = yFieldName;
101
+ }
102
+ if (yAxisTitle) {
103
+ this.baseChartSpec.encoding.y.title = yAxisTitle;
104
+ }
105
+ if (colorFieldName) {
106
+ this.baseChartSpec.encoding.color.field = colorFieldName;
107
+ }
108
+ if (legendTitle) {
109
+ this.baseChartSpec.encoding.color.title = legendTitle;
110
+ }
111
+ this.baseChartSpec.mark = { type: useShape, filled: true };
112
+ this.baseChartSpec.config.legend.symbolType = useShape;
113
+ this.baseChartSpec.encoding.shape = {
114
+ field: colorFieldName,
115
+ type: 'nominal'
116
+ };
117
+ this.baseChartSpec.encoding.tooltip = [
118
+ { field: xFieldName, type: 'nominal', title: xAxisTitle },
119
+ { field: yFieldName, type: 'quantitative', title: yAxisTitle },
120
+ { field: colorFieldName, type: 'nominal', title: legendTitle }
121
+ ];
122
+ const spec = Object.assign(this.baseChartSpec, chartData);
123
+ this.visualizationSpec = spec;
124
+ }
125
+ componentWillLoad() {
126
+ trackComponent(this.root);
127
+ this.parseData();
128
+ }
129
+ render() {
130
+ return (h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
131
+ }
132
+ get root() { return getElement(this); }
133
+ static get watchers() { return {
134
+ "chartData": ["parseData"]
135
+ }; }
136
+ };
137
+ GuxScatterPlotChart.style = guxChartScatterPlotCss;
138
+
139
+ export { GuxScatterPlotChart as gux_chart_scatter_plot_beta };