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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/cjs/genesys-chart-webcomponents.cjs.js +23 -0
- package/dist/cjs/gux-chart-column-beta.cjs.entry.js +140 -0
- package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +229 -0
- package/dist/cjs/gux-chart-line-beta.cjs.entry.js +135 -0
- package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +113 -0
- package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +143 -0
- package/dist/cjs/gux-visualization-beta.cjs.entry.js +71953 -0
- package/dist/cjs/index-1e13a15f.js +1647 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/log-error-c46b4b4c.js +21 -0
- package/dist/cjs/usage-30f04ec3.js +208 -0
- package/dist/collection/collection-manifest.json +17 -0
- package/dist/collection/components/beta/gux-chart-column/gux-chart-column.css +13 -0
- package/dist/collection/components/beta/gux-chart-column/gux-chart-column.js +343 -0
- package/dist/collection/components/beta/gux-chart-column/gux-chart-column.locale.js +92 -0
- package/dist/collection/components/beta/gux-chart-column/tests/gux-column-chart.spec.js +22 -0
- package/dist/collection/components/beta/gux-chart-donut/gux-chart-donut.css +4 -0
- package/dist/collection/components/beta/gux-chart-donut/gux-chart-donut.js +575 -0
- package/dist/collection/components/beta/gux-chart-donut/tests/gux-chart-donut.spec.js +11 -0
- package/dist/collection/components/beta/gux-chart-line/gux-chart-line.css +4 -0
- package/dist/collection/components/beta/gux-chart-line/gux-chart-line.js +391 -0
- package/dist/collection/components/beta/gux-chart-line/gux-chart-line.locale.js +92 -0
- package/dist/collection/components/beta/gux-chart-line/tests/gux-chart-line.e2e.js +17 -0
- package/dist/collection/components/beta/gux-chart-line/tests/gux-chart-line.spec.js +22 -0
- package/dist/collection/components/beta/gux-chart-pie/gux-chart-pie.css +4 -0
- package/dist/collection/components/beta/gux-chart-pie/gux-chart-pie.js +284 -0
- package/dist/collection/components/beta/gux-chart-pie/tests/gux-chart-pie.spec.js +11 -0
- package/dist/collection/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.css +4 -0
- package/dist/collection/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.js +365 -0
- package/dist/collection/components/beta/gux-chart-scatter-plot/tests/gux-chart-scatter-plot.spec.js +33 -0
- package/dist/collection/components/beta/gux-visualization/gux-visualization.css +19 -0
- package/dist/collection/components/beta/gux-visualization/gux-visualization.js +143 -0
- package/dist/collection/components/beta/gux-visualization/gux-visualization.locale.js +92 -0
- package/dist/collection/components/beta/gux-visualization/tests/gux-visualization.e2e.js +31 -0
- package/dist/collection/components/beta/gux-visualization/tests/gux-visualization.spec.js +35 -0
- package/dist/collection/i18n/fetchResources.js +12 -0
- package/dist/collection/i18n/index.js +73 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/test/axeConfig.js +7 -0
- package/dist/collection/test/e2eTestUtils.js +20 -0
- package/dist/collection/test/jestMatcherUtils.js +1 -0
- package/dist/collection/test/setupAxeTests.js +75 -0
- package/dist/collection/test/setupTests.js +9 -0
- package/dist/collection/test/specTestUtils.js +10 -0
- package/dist/collection/utils/dom/get-closest-element.js +15 -0
- package/dist/collection/utils/error/log-error.js +6 -0
- package/dist/collection/utils/theme/color-palette.js +12 -0
- package/dist/collection/utils/tracking/usage.js +81 -0
- package/dist/collection/utils/tracking/usage.spec.js +121 -0
- package/dist/component-specs.json +187 -0
- package/dist/esm/genesys-chart-webcomponents.js +18 -0
- package/dist/esm/gux-chart-column-beta.entry.js +136 -0
- package/dist/esm/gux-chart-donut-beta.entry.js +225 -0
- package/dist/esm/gux-chart-line-beta.entry.js +131 -0
- package/dist/esm/gux-chart-pie-beta.entry.js +109 -0
- package/dist/esm/gux-chart-scatter-plot-beta.entry.js +139 -0
- package/dist/esm/gux-visualization-beta.entry.js +71949 -0
- package/dist/esm/index-701d93cf.js +1619 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +9 -0
- package/dist/esm/log-error-0fc61f6f.js +18 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/usage-61eee3bd.js +206 -0
- package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.css +1 -0
- package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ar.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.cs.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.da.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.de.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.en.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.es-es.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.es.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.fi.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.fr-ca.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.fr.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.he.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.it.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ja.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ko.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.nl.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.no.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.pl.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.pt-br.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.pt-pt.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.ru.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.sv.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.th.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.tr.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.uk.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.zh-cn.json +1 -0
- package/dist/genesys-chart-webcomponents/i18n/genesys-webcomponents.i18n.zh-tw.json +1 -0
- package/dist/genesys-chart-webcomponents/index.esm.js +0 -0
- package/dist/genesys-chart-webcomponents/p-137f5b8f.entry.js +1 -0
- package/dist/genesys-chart-webcomponents/p-3e4b3dbc.js +2 -0
- package/dist/genesys-chart-webcomponents/p-82f0ea01.js +1 -0
- package/dist/genesys-chart-webcomponents/p-97c45977.js +1 -0
- package/dist/genesys-chart-webcomponents/p-b5179379.entry.js +1 -0
- package/dist/genesys-chart-webcomponents/p-b901e9e0.entry.js +11 -0
- package/dist/genesys-chart-webcomponents/p-c3aa8578.entry.js +1 -0
- package/dist/genesys-chart-webcomponents/p-d4a346df.entry.js +1 -0
- package/dist/genesys-chart-webcomponents/p-d9928f8c.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +3 -0
- package/dist/loader/index.cjs.js +3 -0
- package/dist/loader/index.d.ts +21 -0
- package/dist/loader/index.es2017.js +3 -0
- package/dist/loader/index.js +4 -0
- package/dist/loader/package.json +11 -0
- package/dist/stencil-wrapper.js +58 -0
- package/dist/types/components/beta/gux-chart-column/gux-chart-column.d.ts +49 -0
- package/dist/types/components/beta/gux-chart-column/gux-chart-column.locale.d.ts +22 -0
- package/dist/types/components/beta/gux-chart-donut/gux-chart-donut.d.ts +34 -0
- package/dist/types/components/beta/gux-chart-line/gux-chart-line.d.ts +48 -0
- package/dist/types/components/beta/gux-chart-line/gux-chart-line.locale.d.ts +22 -0
- package/dist/types/components/beta/gux-chart-pie/gux-chart-pie.d.ts +23 -0
- package/dist/types/components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.d.ts +52 -0
- package/dist/types/components/beta/gux-visualization/gux-visualization.d.ts +17 -0
- package/dist/types/components/beta/gux-visualization/gux-visualization.locale.d.ts +22 -0
- package/dist/types/components.d.ts +480 -0
- package/dist/types/i18n/fetchResources.d.ts +11 -0
- package/dist/types/i18n/index.d.ts +9 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +1671 -0
- package/dist/types/stencil-wrapper.d.ts +2 -0
- package/dist/types/test/axeConfig.d.ts +6 -0
- package/dist/types/test/e2eTestUtils.d.ts +9 -0
- package/dist/types/test/jestMatcherUtils.d.ts +8 -0
- package/dist/types/test/specTestUtils.d.ts +2 -0
- package/dist/types/typings.d.ts +4 -0
- package/dist/types/utils/dom/get-closest-element.d.ts +1 -0
- package/dist/types/utils/error/log-error.d.ts +2 -0
- package/dist/types/utils/theme/color-palette.d.ts +1 -0
- package/dist/types/utils/tracking/usage.d.ts +27 -0
- package/package.json +118 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-1e13a15f.js');
|
|
6
|
+
const usage = require('./usage-30f04ec3.js');
|
|
7
|
+
const logError = require('./log-error-c46b4b4c.js');
|
|
8
|
+
|
|
9
|
+
const guxChartScatterPlotCss = "gux-visualization-beta{height:fit-content;color:#2e394c}";
|
|
10
|
+
|
|
11
|
+
const DEFAULT_COLOR_FIELD_NAME = 'category';
|
|
12
|
+
const GuxScatterPlotChart = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
index.registerInstance(this, hostRef);
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
this.baseChartSpec = {
|
|
17
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
18
|
+
params: [
|
|
19
|
+
{
|
|
20
|
+
name: 'onHover',
|
|
21
|
+
select: { type: 'point', on: 'mouseover' }
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
config: {
|
|
25
|
+
axis: {
|
|
26
|
+
ticks: false,
|
|
27
|
+
titlePadding: 8,
|
|
28
|
+
gridColor: '#F6F7F9'
|
|
29
|
+
},
|
|
30
|
+
axisX: {
|
|
31
|
+
labelAngle: 0,
|
|
32
|
+
grid: true
|
|
33
|
+
},
|
|
34
|
+
legend: {
|
|
35
|
+
symbolType: 'circle'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
width: { step: 40 },
|
|
39
|
+
encoding: {
|
|
40
|
+
x: { type: 'nominal' },
|
|
41
|
+
y: { type: 'quantitative' },
|
|
42
|
+
color: {
|
|
43
|
+
field: DEFAULT_COLOR_FIELD_NAME,
|
|
44
|
+
type: 'nominal',
|
|
45
|
+
scale: { range: logError.VISUALIZATION_COLORS },
|
|
46
|
+
legend: null
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
condition: [
|
|
50
|
+
{
|
|
51
|
+
param: 'onHover',
|
|
52
|
+
empty: false,
|
|
53
|
+
value: 100
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
value: 40
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
this.chartData = undefined;
|
|
61
|
+
this.xTickLabelSlant = undefined;
|
|
62
|
+
this.includeLegend = undefined;
|
|
63
|
+
this.legendPosition = 'right';
|
|
64
|
+
this.xFieldName = undefined;
|
|
65
|
+
this.xAxisTitle = undefined;
|
|
66
|
+
this.yFieldName = undefined;
|
|
67
|
+
this.yAxisTitle = undefined;
|
|
68
|
+
this.legendTitle = undefined;
|
|
69
|
+
this.colorFieldName = undefined;
|
|
70
|
+
this.useShape = undefined;
|
|
71
|
+
this.embedOptions = undefined;
|
|
72
|
+
}
|
|
73
|
+
parseData() {
|
|
74
|
+
if (!this.xFieldName || !this.yFieldName) {
|
|
75
|
+
logError.logError(this.root, 'requires x-field-name and y-field-name');
|
|
76
|
+
}
|
|
77
|
+
let chartData = {};
|
|
78
|
+
if (this.chartData) {
|
|
79
|
+
chartData = { data: this.chartData };
|
|
80
|
+
}
|
|
81
|
+
if (this.xTickLabelSlant) {
|
|
82
|
+
this.baseChartSpec.config.axisX.labelAngle = -45;
|
|
83
|
+
}
|
|
84
|
+
if (this.legendPosition) {
|
|
85
|
+
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
86
|
+
}
|
|
87
|
+
const xFieldName = this.xFieldName;
|
|
88
|
+
const xAxisTitle = this.xAxisTitle;
|
|
89
|
+
const yFieldName = this.yFieldName;
|
|
90
|
+
const yAxisTitle = this.yAxisTitle;
|
|
91
|
+
const legendTitle = this.legendTitle;
|
|
92
|
+
const useShape = this.useShape || 'circle';
|
|
93
|
+
const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
|
|
94
|
+
if (this.includeLegend) {
|
|
95
|
+
this.baseChartSpec.encoding.color.legend = true;
|
|
96
|
+
}
|
|
97
|
+
if (xFieldName) {
|
|
98
|
+
this.baseChartSpec.encoding.x.field = xFieldName;
|
|
99
|
+
}
|
|
100
|
+
if (xAxisTitle) {
|
|
101
|
+
this.baseChartSpec.encoding.x.title = xAxisTitle;
|
|
102
|
+
}
|
|
103
|
+
if (yFieldName) {
|
|
104
|
+
this.baseChartSpec.encoding.y.field = yFieldName;
|
|
105
|
+
}
|
|
106
|
+
if (yAxisTitle) {
|
|
107
|
+
this.baseChartSpec.encoding.y.title = yAxisTitle;
|
|
108
|
+
}
|
|
109
|
+
if (colorFieldName) {
|
|
110
|
+
this.baseChartSpec.encoding.color.field = colorFieldName;
|
|
111
|
+
}
|
|
112
|
+
if (legendTitle) {
|
|
113
|
+
this.baseChartSpec.encoding.color.title = legendTitle;
|
|
114
|
+
}
|
|
115
|
+
this.baseChartSpec.mark = { type: useShape, filled: true };
|
|
116
|
+
this.baseChartSpec.config.legend.symbolType = useShape;
|
|
117
|
+
this.baseChartSpec.encoding.shape = {
|
|
118
|
+
field: colorFieldName,
|
|
119
|
+
type: 'nominal'
|
|
120
|
+
};
|
|
121
|
+
this.baseChartSpec.encoding.tooltip = [
|
|
122
|
+
{ field: xFieldName, type: 'nominal', title: xAxisTitle },
|
|
123
|
+
{ field: yFieldName, type: 'quantitative', title: yAxisTitle },
|
|
124
|
+
{ field: colorFieldName, type: 'nominal', title: legendTitle }
|
|
125
|
+
];
|
|
126
|
+
const spec = Object.assign(this.baseChartSpec, chartData);
|
|
127
|
+
this.visualizationSpec = spec;
|
|
128
|
+
}
|
|
129
|
+
componentWillLoad() {
|
|
130
|
+
usage.trackComponent(this.root);
|
|
131
|
+
this.parseData();
|
|
132
|
+
}
|
|
133
|
+
render() {
|
|
134
|
+
return (index.h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
|
|
135
|
+
}
|
|
136
|
+
get root() { return index.getElement(this); }
|
|
137
|
+
static get watchers() { return {
|
|
138
|
+
"chartData": ["parseData"]
|
|
139
|
+
}; }
|
|
140
|
+
};
|
|
141
|
+
GuxScatterPlotChart.style = guxChartScatterPlotCss;
|
|
142
|
+
|
|
143
|
+
exports.gux_chart_scatter_plot_beta = GuxScatterPlotChart;
|