genesys-spark-chart-components 4.12.1-beta.1 → 4.29.0-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-3d9281d1.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-4d835ee1.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-01bbadbf.entry.js +11 -0
- package/dist/genesys-chart-webcomponents/{p-137f5b8f.entry.js → p-12eb9928.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/p-1bc0cc3a.js +2 -0
- package/dist/genesys-chart-webcomponents/{p-b5179379.entry.js → p-25bdbf17.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-c3aa8578.entry.js → p-74011efc.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-97c45977.js → p-7e62b207.js} +1 -1
- package/dist/genesys-chart-webcomponents/p-e1255160.js +1 -0
- package/dist/genesys-chart-webcomponents/{p-d9928f8c.entry.js → p-e80b1b1c.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-d4a346df.entry.js → p-f6cebcf8.entry.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
|
@@ -2,134 +2,135 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const usage = require('./usage-
|
|
7
|
-
const logError = require('./log-error-
|
|
5
|
+
const index = require('./index-a4712860.js');
|
|
6
|
+
const usage = require('./usage-3d9281d1.js');
|
|
7
|
+
const logError = require('./log-error-28c7064e.js');
|
|
8
8
|
|
|
9
9
|
const guxChartLineCss = "gux-visualization-beta{height:fit-content;color:#2e394c}";
|
|
10
|
+
const GuxChartLineBetaStyle0 = guxChartLineCss;
|
|
10
11
|
|
|
11
12
|
const DEFAULT_COLOR_FIELD_NAME = 'category';
|
|
12
13
|
const GuxLineChart = class {
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
parseData() {
|
|
63
|
-
if (!this.xFieldName || !this.yFieldName) {
|
|
64
|
-
logError.logError(this.root, 'requires x-field-name and y-field-name');
|
|
65
|
-
}
|
|
66
|
-
let chartData = {};
|
|
67
|
-
if (this.chartData) {
|
|
68
|
-
chartData = { data: this.chartData };
|
|
69
|
-
}
|
|
70
|
-
if (this.xTickLabelSlant) {
|
|
71
|
-
this.baseChartSpec.config.axisX.labelAngle = 45;
|
|
72
|
-
}
|
|
73
|
-
if (this.includeLegend) {
|
|
74
|
-
this.baseChartSpec.encoding.color.legend = true;
|
|
75
|
-
}
|
|
76
|
-
if (this.legendPosition) {
|
|
77
|
-
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
78
|
-
}
|
|
79
|
-
const xFieldName = this.xFieldName;
|
|
80
|
-
const xAxisTitle = this.xAxisTitle;
|
|
81
|
-
const yFieldName = this.yFieldName;
|
|
82
|
-
const yAxisTitle = this.yAxisTitle;
|
|
83
|
-
const legendTitle = this.legendTitle;
|
|
84
|
-
const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
|
|
85
|
-
const interpolation = this.interpolation;
|
|
86
|
-
const strokeDash = this.strokeDash;
|
|
87
|
-
const includeDataPointMarkers = this.includeDataPointMarkers;
|
|
88
|
-
if (xFieldName) {
|
|
89
|
-
this.baseChartSpec.encoding.x.field = xFieldName;
|
|
90
|
-
}
|
|
91
|
-
if (xAxisTitle) {
|
|
92
|
-
this.baseChartSpec.encoding.x.title = xAxisTitle;
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
index.registerInstance(this, hostRef);
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
this.baseChartSpec = {
|
|
18
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
19
|
+
mark: {
|
|
20
|
+
type: 'line',
|
|
21
|
+
interpolate: 'linear',
|
|
22
|
+
point: false
|
|
23
|
+
},
|
|
24
|
+
config: {
|
|
25
|
+
axis: {
|
|
26
|
+
ticks: false,
|
|
27
|
+
titlePadding: 8
|
|
28
|
+
},
|
|
29
|
+
axisX: {
|
|
30
|
+
labelAngle: 0
|
|
31
|
+
},
|
|
32
|
+
legend: {
|
|
33
|
+
symbolType: 'circle'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
encoding: {
|
|
37
|
+
x: { type: 'nominal' },
|
|
38
|
+
y: { type: 'quantitative' },
|
|
39
|
+
color: {
|
|
40
|
+
field: DEFAULT_COLOR_FIELD_NAME,
|
|
41
|
+
type: 'nominal',
|
|
42
|
+
scale: { range: logError.VISUALIZATION_COLORS },
|
|
43
|
+
legend: null
|
|
44
|
+
},
|
|
45
|
+
tooltip: { aggregate: 'count', type: 'quantitative' }
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
this.chartData = undefined;
|
|
49
|
+
this.xTickLabelSlant = undefined;
|
|
50
|
+
this.includeLegend = undefined;
|
|
51
|
+
this.legendPosition = 'right';
|
|
52
|
+
this.includeDataPointMarkers = undefined;
|
|
53
|
+
this.xFieldName = undefined;
|
|
54
|
+
this.xAxisTitle = undefined;
|
|
55
|
+
this.yFieldName = undefined;
|
|
56
|
+
this.yAxisTitle = undefined;
|
|
57
|
+
this.legendTitle = undefined;
|
|
58
|
+
this.colorFieldName = undefined;
|
|
59
|
+
this.strokeDash = undefined;
|
|
60
|
+
this.interpolation = undefined;
|
|
61
|
+
this.embedOptions = undefined;
|
|
93
62
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
63
|
+
parseData() {
|
|
64
|
+
if (!this.xFieldName || !this.yFieldName) {
|
|
65
|
+
logError.logError(this.root, 'requires x-field-name and y-field-name');
|
|
66
|
+
}
|
|
67
|
+
let chartData = {};
|
|
68
|
+
if (this.chartData) {
|
|
69
|
+
chartData = { data: this.chartData };
|
|
70
|
+
}
|
|
71
|
+
if (this.xTickLabelSlant) {
|
|
72
|
+
this.baseChartSpec.config.axisX.labelAngle = 45;
|
|
73
|
+
}
|
|
74
|
+
if (this.includeLegend) {
|
|
75
|
+
this.baseChartSpec.encoding.color.legend = true;
|
|
76
|
+
}
|
|
77
|
+
if (this.legendPosition) {
|
|
78
|
+
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
79
|
+
}
|
|
80
|
+
const xFieldName = this.xFieldName;
|
|
81
|
+
const xAxisTitle = this.xAxisTitle;
|
|
82
|
+
const yFieldName = this.yFieldName;
|
|
83
|
+
const yAxisTitle = this.yAxisTitle;
|
|
84
|
+
const legendTitle = this.legendTitle;
|
|
85
|
+
const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
|
|
86
|
+
const interpolation = this.interpolation;
|
|
87
|
+
const strokeDash = this.strokeDash;
|
|
88
|
+
const includeDataPointMarkers = this.includeDataPointMarkers;
|
|
89
|
+
if (xFieldName) {
|
|
90
|
+
this.baseChartSpec.encoding.x.field = xFieldName;
|
|
91
|
+
}
|
|
92
|
+
if (xAxisTitle) {
|
|
93
|
+
this.baseChartSpec.encoding.x.title = xAxisTitle;
|
|
94
|
+
}
|
|
95
|
+
if (yFieldName) {
|
|
96
|
+
this.baseChartSpec.encoding.y.field = yFieldName;
|
|
97
|
+
}
|
|
98
|
+
if (yAxisTitle) {
|
|
99
|
+
this.baseChartSpec.encoding.y.title = yAxisTitle;
|
|
100
|
+
}
|
|
101
|
+
if (colorFieldName) {
|
|
102
|
+
this.baseChartSpec.encoding.color.field = colorFieldName;
|
|
103
|
+
}
|
|
104
|
+
if (legendTitle) {
|
|
105
|
+
this.baseChartSpec.encoding.color.title = legendTitle;
|
|
106
|
+
}
|
|
107
|
+
if (strokeDash) {
|
|
108
|
+
this.baseChartSpec.encoding.strokeDash = {
|
|
109
|
+
field: colorFieldName,
|
|
110
|
+
type: 'nominal'
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (interpolation) {
|
|
114
|
+
this.baseChartSpec.mark.interpolate = interpolation;
|
|
115
|
+
}
|
|
116
|
+
if (includeDataPointMarkers) {
|
|
117
|
+
this.baseChartSpec.mark.point = includeDataPointMarkers;
|
|
118
|
+
}
|
|
119
|
+
const spec = Object.assign(this.baseChartSpec, chartData);
|
|
120
|
+
this.visualizationSpec = spec;
|
|
111
121
|
}
|
|
112
|
-
|
|
113
|
-
|
|
122
|
+
componentWillLoad() {
|
|
123
|
+
usage.trackComponent(this.root);
|
|
124
|
+
this.parseData();
|
|
114
125
|
}
|
|
115
|
-
|
|
116
|
-
|
|
126
|
+
render() {
|
|
127
|
+
return (index.h("gux-visualization-beta", { key: 'd312d8b365db65c08f3631bb4976e74f7bf077ac', visualizationSpec: this.visualizationSpec }));
|
|
117
128
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
usage.trackComponent(this.root);
|
|
123
|
-
this.parseData();
|
|
124
|
-
}
|
|
125
|
-
render() {
|
|
126
|
-
return (index.h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
|
|
127
|
-
}
|
|
128
|
-
get root() { return index.getElement(this); }
|
|
129
|
-
static get watchers() { return {
|
|
130
|
-
"chartData": ["parseData"]
|
|
131
|
-
}; }
|
|
129
|
+
get root() { return index.getElement(this); }
|
|
130
|
+
static get watchers() { return {
|
|
131
|
+
"chartData": ["parseData"]
|
|
132
|
+
}; }
|
|
132
133
|
};
|
|
133
|
-
GuxLineChart.style =
|
|
134
|
+
GuxLineChart.style = GuxChartLineBetaStyle0;
|
|
134
135
|
|
|
135
136
|
exports.gux_chart_line_beta = GuxLineChart;
|
|
@@ -2,112 +2,113 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const usage = require('./usage-
|
|
7
|
-
const logError = require('./log-error-
|
|
5
|
+
const index = require('./index-a4712860.js');
|
|
6
|
+
const usage = require('./usage-3d9281d1.js');
|
|
7
|
+
const logError = require('./log-error-28c7064e.js');
|
|
8
8
|
|
|
9
9
|
const guxChartPieCss = "gux-visualization-beta{height:fit-content;color:#2e394c}";
|
|
10
|
+
const GuxChartPieBetaStyle0 = guxChartPieCss;
|
|
10
11
|
|
|
11
12
|
const DEFAULT_COLOR_FIELD_NAME = 'category';
|
|
12
13
|
const DEFAULT_LABEL_FIELD_NAME = 'value';
|
|
13
14
|
const GuxPieChart = class {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
constructor(hostRef) {
|
|
16
|
+
index.registerInstance(this, hostRef);
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
this.baseChartSpec = {
|
|
19
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
20
|
+
config: {
|
|
21
|
+
legend: {
|
|
22
|
+
symbolType: 'circle'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
encoding: {
|
|
26
|
+
theta: { field: 'value', type: 'quantitative', stack: true },
|
|
27
|
+
color: {
|
|
28
|
+
field: DEFAULT_COLOR_FIELD_NAME,
|
|
29
|
+
type: 'nominal',
|
|
30
|
+
scale: { range: logError.VISUALIZATION_COLORS },
|
|
31
|
+
legend: null
|
|
32
|
+
},
|
|
33
|
+
tooltip: { aggregate: 'count', type: 'quantitative' }
|
|
34
|
+
},
|
|
35
|
+
layer: [
|
|
36
|
+
{
|
|
37
|
+
mark: { type: 'arc', outerRadius: 80 }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
mark: { type: 'text', radius: 90 },
|
|
41
|
+
encoding: {
|
|
42
|
+
text: { field: DEFAULT_LABEL_FIELD_NAME, type: 'quantitative' }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
view: { stroke: null }
|
|
47
|
+
};
|
|
48
|
+
this.chartData = undefined;
|
|
49
|
+
this.includeLegend = undefined;
|
|
50
|
+
this.legendPosition = 'right';
|
|
51
|
+
this.legendTitle = undefined;
|
|
52
|
+
this.colorFieldName = undefined;
|
|
53
|
+
this.outerRadius = undefined;
|
|
54
|
+
this.labelRadius = undefined;
|
|
55
|
+
this.labelField = undefined;
|
|
56
|
+
this.embedOptions = undefined;
|
|
57
|
+
}
|
|
58
|
+
parseData() {
|
|
59
|
+
if (!this.outerRadius) {
|
|
60
|
+
logError.logError(this.root, 'requires outer-radius');
|
|
22
61
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
color: {
|
|
27
|
-
field: DEFAULT_COLOR_FIELD_NAME,
|
|
28
|
-
type: 'nominal',
|
|
29
|
-
scale: { range: logError.VISUALIZATION_COLORS },
|
|
30
|
-
legend: null
|
|
31
|
-
},
|
|
32
|
-
tooltip: { aggregate: 'count', type: 'quantitative' }
|
|
33
|
-
},
|
|
34
|
-
layer: [
|
|
35
|
-
{
|
|
36
|
-
mark: { type: 'arc', outerRadius: 80 }
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
mark: { type: 'text', radius: 90 },
|
|
40
|
-
encoding: {
|
|
41
|
-
text: { field: DEFAULT_LABEL_FIELD_NAME, type: 'quantitative' }
|
|
42
|
-
}
|
|
62
|
+
let chartData = {};
|
|
63
|
+
if (this.chartData) {
|
|
64
|
+
chartData = { data: this.chartData };
|
|
43
65
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
if (this.includeLegend) {
|
|
67
|
+
this.baseChartSpec.encoding.color.legend = true;
|
|
68
|
+
}
|
|
69
|
+
if (this.legendPosition) {
|
|
70
|
+
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
71
|
+
}
|
|
72
|
+
const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
|
|
73
|
+
if (colorFieldName) {
|
|
74
|
+
this.baseChartSpec.encoding.color.field = colorFieldName;
|
|
75
|
+
}
|
|
76
|
+
const legendTitle = this.legendTitle;
|
|
77
|
+
if (legendTitle) {
|
|
78
|
+
this.baseChartSpec.encoding.color.title = legendTitle;
|
|
79
|
+
}
|
|
80
|
+
const outerRadius = this.outerRadius;
|
|
81
|
+
this.baseChartSpec.layer = [
|
|
82
|
+
{
|
|
83
|
+
mark: { type: 'arc', outerRadius }
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
const labelRadius = this.labelRadius;
|
|
87
|
+
const labelField = this.labelField || DEFAULT_LABEL_FIELD_NAME;
|
|
88
|
+
if (labelRadius) {
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
90
|
+
this.baseChartSpec.layer.push({
|
|
91
|
+
mark: { type: 'text', radius: labelRadius },
|
|
92
|
+
encoding: {
|
|
93
|
+
text: { field: labelField, type: 'quantitative' }
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const spec = Object.assign(this.baseChartSpec, chartData);
|
|
98
|
+
this.visualizationSpec = spec;
|
|
74
99
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
100
|
+
componentWillLoad() {
|
|
101
|
+
usage.trackComponent(this.root);
|
|
102
|
+
this.parseData();
|
|
78
103
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
mark: { type: 'arc', outerRadius }
|
|
83
|
-
}
|
|
84
|
-
];
|
|
85
|
-
const labelRadius = this.labelRadius;
|
|
86
|
-
const labelField = this.labelField || DEFAULT_LABEL_FIELD_NAME;
|
|
87
|
-
if (labelRadius) {
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
89
|
-
this.baseChartSpec.layer.push({
|
|
90
|
-
mark: { type: 'text', radius: labelRadius },
|
|
91
|
-
encoding: {
|
|
92
|
-
text: { field: labelField, type: 'quantitative' }
|
|
93
|
-
}
|
|
94
|
-
});
|
|
104
|
+
render() {
|
|
105
|
+
return (index.h("gux-visualization-beta", { key: 'b3049772a9d436bf4d6aa1b0e9ebe21a9d9e84e9', visualizationSpec: this.visualizationSpec }));
|
|
95
106
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
usage.trackComponent(this.root);
|
|
101
|
-
this.parseData();
|
|
102
|
-
}
|
|
103
|
-
render() {
|
|
104
|
-
return (index.h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
|
|
105
|
-
}
|
|
106
|
-
get root() { return index.getElement(this); }
|
|
107
|
-
static get watchers() { return {
|
|
108
|
-
"chartData": ["parseData"]
|
|
109
|
-
}; }
|
|
107
|
+
get root() { return index.getElement(this); }
|
|
108
|
+
static get watchers() { return {
|
|
109
|
+
"chartData": ["parseData"]
|
|
110
|
+
}; }
|
|
110
111
|
};
|
|
111
|
-
GuxPieChart.style =
|
|
112
|
+
GuxPieChart.style = GuxChartPieBetaStyle0;
|
|
112
113
|
|
|
113
114
|
exports.gux_chart_pie_beta = GuxPieChart;
|