genesys-spark-chart-components 4.12.1-beta.1 → 4.29.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/genesys-chart-webcomponents.cjs.js +5 -3
- package/dist/cjs/gux-chart-column-beta.cjs.entry.js +124 -123
- package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +213 -212
- package/dist/cjs/gux-chart-line-beta.cjs.entry.js +120 -119
- package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +96 -95
- package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +126 -125
- package/dist/cjs/gux-visualization-beta.cjs.entry.js +213 -213
- package/dist/cjs/{index-1e13a15f.js → index-a4712860.js} +185 -63
- package/dist/cjs/loader.cjs.js +4 -2
- package/dist/cjs/log-error-28c7064e.js +21 -0
- package/dist/cjs/{usage-30f04ec3.js → usage-c351d7fb.js} +63 -63
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/beta/gux-chart-column/gux-chart-column.js +324 -324
- package/dist/collection/components/beta/gux-chart-column/gux-chart-column.locale.js +88 -88
- package/dist/collection/components/beta/gux-chart-column/tests/gux-column-chart.spec.js +16 -16
- package/dist/collection/components/beta/gux-chart-donut/gux-chart-donut.js +550 -550
- package/dist/collection/components/beta/gux-chart-donut/tests/gux-chart-donut.spec.js +5 -5
- package/dist/collection/components/beta/gux-chart-line/gux-chart-line.js +375 -375
- package/dist/collection/components/beta/gux-chart-line/gux-chart-line.locale.js +88 -88
- package/dist/collection/components/beta/gux-chart-line/tests/gux-chart-line.e2e.js +13 -13
- package/dist/collection/components/beta/gux-chart-line/tests/gux-chart-line.spec.js +16 -16
- package/dist/collection/components/beta/gux-chart-pie/gux-chart-pie.js +266 -266
- package/dist/collection/components/beta/gux-chart-pie/tests/gux-chart-pie.spec.js +5 -5
- package/dist/collection/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.js +347 -347
- package/dist/collection/components/beta/gux-chart-scatter-plot/tests/gux-chart-scatter-plot.spec.js +27 -27
- package/dist/collection/components/beta/gux-visualization/gux-visualization.js +133 -133
- package/dist/collection/components/beta/gux-visualization/gux-visualization.locale.js +88 -88
- package/dist/collection/components/beta/gux-visualization/tests/gux-visualization.e2e.js +25 -25
- package/dist/collection/components/beta/gux-visualization/tests/gux-visualization.spec.js +26 -26
- package/dist/collection/i18n/fetchResources.js +7 -7
- package/dist/collection/i18n/index.js +56 -56
- package/dist/collection/test/axeConfig.js +4 -4
- package/dist/collection/test/e2eTestUtils.js +14 -14
- package/dist/collection/test/specTestUtils.js +5 -5
- package/dist/collection/utils/dom/get-closest-element.js +12 -12
- package/dist/collection/utils/error/log-error.js +2 -2
- package/dist/collection/utils/theme/color-palette.js +10 -10
- package/dist/collection/utils/tracking/usage.js +47 -47
- package/dist/collection/utils/tracking/usage.spec.js +108 -108
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/genesys-chart-webcomponents.js +6 -4
- package/dist/esm/gux-chart-column-beta.entry.js +124 -123
- package/dist/esm/gux-chart-donut-beta.entry.js +213 -212
- package/dist/esm/gux-chart-line-beta.entry.js +120 -119
- package/dist/esm/gux-chart-pie-beta.entry.js +96 -95
- package/dist/esm/gux-chart-scatter-plot-beta.entry.js +126 -125
- package/dist/esm/gux-visualization-beta.entry.js +213 -213
- package/dist/esm/{index-701d93cf.js → index-82fd7406.js} +185 -63
- package/dist/esm/loader.js +5 -3
- package/dist/esm/log-error-ff9bdda4.js +18 -0
- package/dist/esm/{usage-61eee3bd.js → usage-6655c04e.js} +63 -63
- package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.css +1 -1
- package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -1
- package/dist/genesys-chart-webcomponents/p-1bc0cc3a.js +2 -0
- package/dist/genesys-chart-webcomponents/{p-d4a346df.entry.js → p-291b128b.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/p-51f2502a.entry.js +11 -0
- package/dist/genesys-chart-webcomponents/{p-137f5b8f.entry.js → p-64f0b385.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-b5179379.entry.js → p-65020b8a.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-d9928f8c.entry.js → p-83283e73.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/p-e1255160.js +1 -0
- package/dist/genesys-chart-webcomponents/{p-c3aa8578.entry.js → p-e42dd3ba.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-97c45977.js → p-f6832775.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/components/beta/gux-chart-column/gux-chart-column.d.ts +45 -45
- package/dist/types/components/beta/gux-chart-column/gux-chart-column.locale.d.ts +20 -20
- package/dist/types/components/beta/gux-chart-donut/gux-chart-donut.d.ts +30 -30
- package/dist/types/components/beta/gux-chart-line/gux-chart-line.d.ts +44 -44
- package/dist/types/components/beta/gux-chart-line/gux-chart-line.locale.d.ts +20 -20
- package/dist/types/components/beta/gux-chart-pie/gux-chart-pie.d.ts +19 -19
- package/dist/types/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.d.ts +48 -48
- package/dist/types/components/beta/gux-visualization/gux-visualization.d.ts +13 -13
- package/dist/types/components/beta/gux-visualization/gux-visualization.locale.d.ts +20 -20
- package/dist/types/components.d.ts +12 -0
- package/dist/types/i18n/fetchResources.d.ts +3 -3
- package/dist/types/i18n/index.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +10 -0
- package/dist/types/stencil-wrapper.d.ts +1 -1
- package/dist/types/test/axeConfig.d.ts +4 -4
- package/dist/types/test/e2eTestUtils.d.ts +4 -4
- package/dist/types/test/jestMatcherUtils.d.ts +4 -4
- package/dist/types/utils/tracking/usage.d.ts +11 -11
- package/package.json +24 -24
- package/dist/cjs/log-error-c46b4b4c.js +0 -21
- package/dist/component-specs.json +0 -187
- package/dist/esm/log-error-0fc61f6f.js +0 -18
- package/dist/genesys-chart-webcomponents/p-3e4b3dbc.js +0 -2
- package/dist/genesys-chart-webcomponents/p-b901e9e0.entry.js +0 -11
- /package/dist/genesys-chart-webcomponents/{p-82f0ea01.js → p-f50e3789.js} +0 -0
|
@@ -1,136 +1,137 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
2
|
-
import { t as trackComponent } from './usage-
|
|
3
|
-
import { V as VISUALIZATION_COLORS, l as logError } from './log-error-
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-82fd7406.js';
|
|
2
|
+
import { t as trackComponent } from './usage-6655c04e.js';
|
|
3
|
+
import { V as VISUALIZATION_COLORS, l as logError } from './log-error-ff9bdda4.js';
|
|
4
4
|
|
|
5
5
|
const guxChartColumnCss = "gux-visualization-beta{height:fit-content;color:#2e394c;}gux-visualization-beta .mark-rect.layer_0_marks path{fill:url(#diagonalHatch0)}gux-visualization-beta .mark-rect.layer_1_marks path{fill:#1da8b3}";
|
|
6
|
+
const GuxChartColumnBetaStyle0 = guxChartColumnCss;
|
|
6
7
|
|
|
7
8
|
const GuxColumnChart = class {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
parseData() {
|
|
52
|
-
if (!this.xFieldName || !this.yFieldName) {
|
|
53
|
-
logError(this.root, 'requires x-field-name and y-field-name');
|
|
54
|
-
}
|
|
55
|
-
let chartData = {};
|
|
56
|
-
if (this.chartData) {
|
|
57
|
-
chartData = { data: this.chartData };
|
|
58
|
-
}
|
|
59
|
-
if (this.xTickLabelSlant) {
|
|
60
|
-
this.baseChartSpec.config.axisX.labelAngle = 45;
|
|
61
|
-
}
|
|
62
|
-
if (this.includeLegend) {
|
|
63
|
-
this.baseChartSpec.encoding.color = { field: 'category' };
|
|
64
|
-
}
|
|
65
|
-
if (this.legendPosition) {
|
|
66
|
-
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
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: { type: 'bar' },
|
|
15
|
+
config: {
|
|
16
|
+
axis: {
|
|
17
|
+
ticks: false,
|
|
18
|
+
titlePadding: 8
|
|
19
|
+
},
|
|
20
|
+
axisX: {
|
|
21
|
+
labelAngle: 0
|
|
22
|
+
},
|
|
23
|
+
scale: {
|
|
24
|
+
bandPaddingInner: 0.4, // padding between columns / bars
|
|
25
|
+
bandPaddingOuter: 0.4 // padding between leftmost/rightmost column/bar from axes
|
|
26
|
+
},
|
|
27
|
+
legend: {
|
|
28
|
+
symbolType: 'circle'
|
|
29
|
+
},
|
|
30
|
+
bar: {
|
|
31
|
+
color: VISUALIZATION_COLORS[0]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
encoding: {
|
|
35
|
+
x: { type: 'nominal' },
|
|
36
|
+
y: { type: 'quantitative' },
|
|
37
|
+
tooltip: { aggregate: 'count', type: 'quantitative' }
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
this.chartData = undefined;
|
|
41
|
+
this.xTickLabelSlant = undefined;
|
|
42
|
+
this.includeLegend = undefined;
|
|
43
|
+
this.xFieldName = undefined;
|
|
44
|
+
this.yFieldName = undefined;
|
|
45
|
+
this.xAxisTitle = undefined;
|
|
46
|
+
this.yAxisTitle = undefined;
|
|
47
|
+
this.legendTitle = undefined;
|
|
48
|
+
this.legendPosition = 'right';
|
|
49
|
+
this.chartLayers = undefined;
|
|
50
|
+
this.embedOptions = undefined;
|
|
67
51
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
52
|
+
parseData() {
|
|
53
|
+
if (!this.xFieldName || !this.yFieldName) {
|
|
54
|
+
logError(this.root, 'requires x-field-name and y-field-name');
|
|
55
|
+
}
|
|
56
|
+
let chartData = {};
|
|
57
|
+
if (this.chartData) {
|
|
58
|
+
chartData = { data: this.chartData };
|
|
59
|
+
}
|
|
60
|
+
if (this.xTickLabelSlant) {
|
|
61
|
+
this.baseChartSpec.config.axisX.labelAngle = 45;
|
|
62
|
+
}
|
|
63
|
+
if (this.includeLegend) {
|
|
64
|
+
this.baseChartSpec.encoding.color = { field: 'category' };
|
|
65
|
+
}
|
|
66
|
+
if (this.legendPosition) {
|
|
67
|
+
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
68
|
+
}
|
|
69
|
+
const xFieldName = this.xFieldName;
|
|
70
|
+
const yFieldName = this.yFieldName;
|
|
71
|
+
const xAxisTitle = this.xAxisTitle;
|
|
72
|
+
const yAxisTitle = this.yAxisTitle;
|
|
73
|
+
const legendTitle = this.legendTitle;
|
|
74
|
+
if (this.chartLayers) {
|
|
75
|
+
const layers = this.chartLayers.map(layerName => {
|
|
76
|
+
return {
|
|
77
|
+
mark: 'bar',
|
|
78
|
+
transform: [
|
|
79
|
+
{
|
|
80
|
+
filter: { field: 'series', equal: layerName }
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
encoding: {
|
|
84
|
+
x: {
|
|
85
|
+
field: xFieldName,
|
|
86
|
+
type: 'nominal'
|
|
87
|
+
},
|
|
88
|
+
y: {
|
|
89
|
+
field: yFieldName,
|
|
90
|
+
type: 'quantitative'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
this.baseChartSpec.layer = layers;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
if (xFieldName) {
|
|
99
|
+
this.baseChartSpec.encoding.x.field = xFieldName;
|
|
80
100
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
x: {
|
|
84
|
-
field: xFieldName,
|
|
85
|
-
type: 'nominal'
|
|
86
|
-
},
|
|
87
|
-
y: {
|
|
88
|
-
field: yFieldName,
|
|
89
|
-
type: 'quantitative'
|
|
101
|
+
if (yFieldName) {
|
|
102
|
+
this.baseChartSpec.encoding.y.field = yFieldName;
|
|
90
103
|
}
|
|
91
|
-
|
|
104
|
+
if (xAxisTitle) {
|
|
105
|
+
this.baseChartSpec.encoding.x.title = xAxisTitle;
|
|
106
|
+
}
|
|
107
|
+
if (yAxisTitle) {
|
|
108
|
+
this.baseChartSpec.encoding.y.title = yAxisTitle;
|
|
109
|
+
}
|
|
110
|
+
if (legendTitle) {
|
|
111
|
+
this.baseChartSpec.encoding.color.title = legendTitle;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Set up colors for legend and bars
|
|
115
|
+
const rangeField = xFieldName;
|
|
116
|
+
const rangeConfig = {
|
|
117
|
+
[rangeField]: VISUALIZATION_COLORS
|
|
92
118
|
};
|
|
93
|
-
|
|
94
|
-
|
|
119
|
+
this.baseChartSpec.config.range = rangeConfig;
|
|
120
|
+
const spec = Object.assign(this.baseChartSpec, chartData);
|
|
121
|
+
this.visualizationSpec = spec;
|
|
122
|
+
}
|
|
123
|
+
componentWillLoad() {
|
|
124
|
+
trackComponent(this.root);
|
|
125
|
+
this.parseData();
|
|
95
126
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
this.baseChartSpec.encoding.x.field = xFieldName;
|
|
99
|
-
}
|
|
100
|
-
if (yFieldName) {
|
|
101
|
-
this.baseChartSpec.encoding.y.field = yFieldName;
|
|
102
|
-
}
|
|
103
|
-
if (xAxisTitle) {
|
|
104
|
-
this.baseChartSpec.encoding.x.title = xAxisTitle;
|
|
105
|
-
}
|
|
106
|
-
if (yAxisTitle) {
|
|
107
|
-
this.baseChartSpec.encoding.y.title = yAxisTitle;
|
|
108
|
-
}
|
|
109
|
-
if (legendTitle) {
|
|
110
|
-
this.baseChartSpec.encoding.color.title = legendTitle;
|
|
111
|
-
}
|
|
127
|
+
render() {
|
|
128
|
+
return (h("gux-visualization-beta", { key: '204c508da5ccda0059c2500fa91b06ad6ac91c2d', visualizationSpec: this.visualizationSpec }));
|
|
112
129
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
this.baseChartSpec.config.range = rangeConfig;
|
|
119
|
-
const spec = Object.assign(this.baseChartSpec, chartData);
|
|
120
|
-
this.visualizationSpec = spec;
|
|
121
|
-
}
|
|
122
|
-
componentWillLoad() {
|
|
123
|
-
trackComponent(this.root);
|
|
124
|
-
this.parseData();
|
|
125
|
-
}
|
|
126
|
-
render() {
|
|
127
|
-
return (h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
|
|
128
|
-
}
|
|
129
|
-
get root() { return getElement(this); }
|
|
130
|
-
static get watchers() { return {
|
|
131
|
-
"chartData": ["parseData"]
|
|
132
|
-
}; }
|
|
130
|
+
get root() { return getElement(this); }
|
|
131
|
+
static get watchers() { return {
|
|
132
|
+
"chartData": ["parseData"]
|
|
133
|
+
}; }
|
|
133
134
|
};
|
|
134
|
-
GuxColumnChart.style =
|
|
135
|
+
GuxColumnChart.style = GuxChartColumnBetaStyle0;
|
|
135
136
|
|
|
136
137
|
export { GuxColumnChart as gux_chart_column_beta };
|