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,121 @@
|
|
|
1
|
+
import { trackComponent, trackAction, getVersionEvent } from "./usage";
|
|
2
|
+
import packageInfo from "../../../package.json";
|
|
3
|
+
const component = document.createElement('gux-button');
|
|
4
|
+
const addPageAction = jest.fn();
|
|
5
|
+
describe('tracking/usage', () => {
|
|
6
|
+
beforeAll(() => {
|
|
7
|
+
jest.useFakeTimers();
|
|
8
|
+
});
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
addPageAction.mockClear();
|
|
11
|
+
window.newrelic = {
|
|
12
|
+
addPageAction
|
|
13
|
+
};
|
|
14
|
+
window.document.contains = jest.fn().mockReturnValue(true);
|
|
15
|
+
});
|
|
16
|
+
describe('Component usage tracking', () => {
|
|
17
|
+
test("Doesn't throw when newrelic is not present", () => {
|
|
18
|
+
window.newrelic = undefined;
|
|
19
|
+
expect(() => {
|
|
20
|
+
trackComponent(component);
|
|
21
|
+
}).not.toThrow();
|
|
22
|
+
});
|
|
23
|
+
test('Logs the library after the first component loads', () => {
|
|
24
|
+
trackComponent(component);
|
|
25
|
+
jest.runOnlyPendingTimers();
|
|
26
|
+
expect(addPageAction).toHaveBeenCalledTimes(2);
|
|
27
|
+
expect(addPageAction.mock.calls[0][0]).toBe('spark-library');
|
|
28
|
+
const versionInfo = addPageAction.mock.calls[0][1];
|
|
29
|
+
expect(versionInfo.fullVersion).toBe(packageInfo.version);
|
|
30
|
+
expect(packageInfo.version.startsWith(versionInfo.majorVersion)).toBe(true);
|
|
31
|
+
expect(packageInfo.version.startsWith(versionInfo.minorVersion)).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
test('Logs the tag name when a component is tracked', () => {
|
|
34
|
+
trackComponent(component);
|
|
35
|
+
jest.runOnlyPendingTimers();
|
|
36
|
+
expect(addPageAction).toHaveBeenCalledWith('spark-component', {
|
|
37
|
+
component: 'gux-button',
|
|
38
|
+
version: packageInfo.version,
|
|
39
|
+
queueDepth: 0
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
test('Optionally logs a tag variant', () => {
|
|
43
|
+
trackComponent(component, { variant: 'test' });
|
|
44
|
+
jest.runOnlyPendingTimers();
|
|
45
|
+
expect(addPageAction).toHaveBeenCalledWith('spark-component', {
|
|
46
|
+
component: 'gux-button',
|
|
47
|
+
version: packageInfo.version,
|
|
48
|
+
variant: 'test',
|
|
49
|
+
queueDepth: 0
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('Component action tracking', () => {
|
|
54
|
+
test("Doesn't throw when newrelic is not present", () => {
|
|
55
|
+
window.newrelic = undefined;
|
|
56
|
+
expect(() => {
|
|
57
|
+
trackAction(component, 'click');
|
|
58
|
+
}).not.toThrow();
|
|
59
|
+
});
|
|
60
|
+
test('Logs the component tag and action', () => {
|
|
61
|
+
trackAction(component, 'click');
|
|
62
|
+
jest.runOnlyPendingTimers();
|
|
63
|
+
expect(addPageAction).toHaveBeenCalledWith('spark-action', {
|
|
64
|
+
component: 'gux-button',
|
|
65
|
+
action: 'click',
|
|
66
|
+
queueDepth: 0
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
test('Optionally logs metadata', () => {
|
|
70
|
+
trackAction(component, 'click', { strength: 'real hard' });
|
|
71
|
+
jest.runOnlyPendingTimers();
|
|
72
|
+
expect(addPageAction).toHaveBeenCalledWith('spark-action', {
|
|
73
|
+
component: 'gux-button',
|
|
74
|
+
action: 'click',
|
|
75
|
+
strength: 'real hard',
|
|
76
|
+
queueDepth: 0
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
describe('getVersionObject', () => {
|
|
82
|
+
[
|
|
83
|
+
{
|
|
84
|
+
packageLockVersion: '0.0.1',
|
|
85
|
+
expectedVersionObject: {
|
|
86
|
+
fullVersion: '0.0.1',
|
|
87
|
+
majorVersion: '0',
|
|
88
|
+
minorVersion: '0.0'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
packageLockVersion: '0.1.1',
|
|
93
|
+
expectedVersionObject: {
|
|
94
|
+
fullVersion: '0.1.1',
|
|
95
|
+
majorVersion: '0',
|
|
96
|
+
minorVersion: '0.1'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
packageLockVersion: '1.1.1',
|
|
101
|
+
expectedVersionObject: {
|
|
102
|
+
fullVersion: '1.1.1',
|
|
103
|
+
majorVersion: '1',
|
|
104
|
+
minorVersion: '1.1'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
packageLockVersion: '2.0.0-alpha.0',
|
|
109
|
+
expectedVersionObject: {
|
|
110
|
+
fullVersion: '2.0.0-alpha.0',
|
|
111
|
+
majorVersion: '2',
|
|
112
|
+
minorVersion: '2.0'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
].forEach(({ packageLockVersion, expectedVersionObject }, index) => {
|
|
116
|
+
it(`should return expected versionObject (${index + 1})`, async () => {
|
|
117
|
+
const versionEvent = getVersionEvent(packageLockVersion);
|
|
118
|
+
expect(versionEvent.metadata).toEqual(expectedVersionObject);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
{
|
|
2
|
+
"gux-visualization": {
|
|
3
|
+
"beta": true,
|
|
4
|
+
"attributes": {
|
|
5
|
+
"--": [
|
|
6
|
+
"GenericConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef",
|
|
7
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
8
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; }",
|
|
9
|
+
"GenericFacetSpec<UnitSpecWithFrame<Field>, LayerSpec<Field>, Field> & TopLevelProperties<ExprRef",
|
|
10
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
11
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } & DataMixins",
|
|
12
|
+
"GenericHConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef",
|
|
13
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
14
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; }",
|
|
15
|
+
"GenericUnitSpec<FacetedCompositeEncoding<Field>, AnyMark, TopLevelParameter> & ResolveMixins & GenericCompositionLayout & FrameMixins<ExprRef",
|
|
16
|
+
"SignalRef> & TopLevelProperties<ExprRef",
|
|
17
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
18
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } & DataMixins",
|
|
19
|
+
"GenericVConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef",
|
|
20
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
21
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; }",
|
|
22
|
+
"LayerRepeatSpec & TopLevelProperties<ExprRef",
|
|
23
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
24
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; }",
|
|
25
|
+
"LayerSpec<Field> & TopLevelProperties<ExprRef",
|
|
26
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
27
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; }",
|
|
28
|
+
"NonLayerRepeatSpec & TopLevelProperties<ExprRef",
|
|
29
|
+
"SignalRef> & { $schema?: string; config?: Config<ExprRef",
|
|
30
|
+
"SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; }",
|
|
31
|
+
"Spec"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"events": {
|
|
35
|
+
"chartClicked": "",
|
|
36
|
+
"chartComponentReady": ""
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"gux-chart-scatter-plot": {
|
|
40
|
+
"beta": true,
|
|
41
|
+
"attributes": {
|
|
42
|
+
"--": [
|
|
43
|
+
"EmbedOptions<string, Renderers>"
|
|
44
|
+
],
|
|
45
|
+
"color-field-name": "text",
|
|
46
|
+
"include-legend": "checkbox",
|
|
47
|
+
"legend-position": [
|
|
48
|
+
"bottom",
|
|
49
|
+
"bottom-left",
|
|
50
|
+
"bottom-right",
|
|
51
|
+
"left",
|
|
52
|
+
"none",
|
|
53
|
+
"right",
|
|
54
|
+
"top",
|
|
55
|
+
"top-left",
|
|
56
|
+
"top-right"
|
|
57
|
+
],
|
|
58
|
+
"legend-title": "text",
|
|
59
|
+
"use-shape": "text",
|
|
60
|
+
"x-axis-title": "text",
|
|
61
|
+
"x-field-name": "text",
|
|
62
|
+
"x-tick-label-slant": "checkbox",
|
|
63
|
+
"y-axis-title": "text",
|
|
64
|
+
"y-field-name": "text"
|
|
65
|
+
},
|
|
66
|
+
"events": []
|
|
67
|
+
},
|
|
68
|
+
"gux-chart-pie": {
|
|
69
|
+
"beta": true,
|
|
70
|
+
"attributes": {
|
|
71
|
+
"--": [
|
|
72
|
+
"EmbedOptions<string, Renderers>"
|
|
73
|
+
],
|
|
74
|
+
"color-field-name": "text",
|
|
75
|
+
"include-legend": "checkbox",
|
|
76
|
+
"label-field": "text",
|
|
77
|
+
"label-radius": "text",
|
|
78
|
+
"legend-position": [
|
|
79
|
+
"bottom",
|
|
80
|
+
"bottom-left",
|
|
81
|
+
"bottom-right",
|
|
82
|
+
"left",
|
|
83
|
+
"none",
|
|
84
|
+
"right",
|
|
85
|
+
"top",
|
|
86
|
+
"top-left",
|
|
87
|
+
"top-right"
|
|
88
|
+
],
|
|
89
|
+
"legend-title": "text",
|
|
90
|
+
"outer-radius": "text"
|
|
91
|
+
},
|
|
92
|
+
"events": []
|
|
93
|
+
},
|
|
94
|
+
"gux-chart-line": {
|
|
95
|
+
"beta": true,
|
|
96
|
+
"attributes": {
|
|
97
|
+
"--": [
|
|
98
|
+
"EmbedOptions<string, Renderers>"
|
|
99
|
+
],
|
|
100
|
+
"color-field-name": "text",
|
|
101
|
+
"include-data-point-markers": "checkbox",
|
|
102
|
+
"include-legend": "checkbox",
|
|
103
|
+
"interpolation": "text",
|
|
104
|
+
"legend-position": [
|
|
105
|
+
"bottom",
|
|
106
|
+
"bottom-left",
|
|
107
|
+
"bottom-right",
|
|
108
|
+
"left",
|
|
109
|
+
"none",
|
|
110
|
+
"right",
|
|
111
|
+
"top",
|
|
112
|
+
"top-left",
|
|
113
|
+
"top-right"
|
|
114
|
+
],
|
|
115
|
+
"legend-title": "text",
|
|
116
|
+
"stroke-dash": "checkbox",
|
|
117
|
+
"x-axis-title": "text",
|
|
118
|
+
"x-field-name": "text",
|
|
119
|
+
"x-tick-label-slant": "checkbox",
|
|
120
|
+
"y-axis-title": "text",
|
|
121
|
+
"y-field-name": "text"
|
|
122
|
+
},
|
|
123
|
+
"events": []
|
|
124
|
+
},
|
|
125
|
+
"gux-chart-donut": {
|
|
126
|
+
"beta": true,
|
|
127
|
+
"attributes": {
|
|
128
|
+
"center-sub-text": "text",
|
|
129
|
+
"center-text": "text",
|
|
130
|
+
"--": [
|
|
131
|
+
"EmbedOptions<string, Renderers>"
|
|
132
|
+
],
|
|
133
|
+
"color-field-name": "text",
|
|
134
|
+
"gauge": "checkbox",
|
|
135
|
+
"include-legend": "checkbox",
|
|
136
|
+
"inner-radius": "text",
|
|
137
|
+
"label-field": "text",
|
|
138
|
+
"label-radius": "text",
|
|
139
|
+
"legend-font-size": "text",
|
|
140
|
+
"legend-position": [
|
|
141
|
+
"bottom",
|
|
142
|
+
"bottom-left",
|
|
143
|
+
"bottom-right",
|
|
144
|
+
"left",
|
|
145
|
+
"none",
|
|
146
|
+
"right",
|
|
147
|
+
"top",
|
|
148
|
+
"top-left",
|
|
149
|
+
"top-right"
|
|
150
|
+
],
|
|
151
|
+
"legend-symbol-size": "text",
|
|
152
|
+
"legend-title": "text",
|
|
153
|
+
"legend-x": "text",
|
|
154
|
+
"legend-y": "text",
|
|
155
|
+
"outer-radius": "text",
|
|
156
|
+
"show-tooltip": "checkbox"
|
|
157
|
+
},
|
|
158
|
+
"events": []
|
|
159
|
+
},
|
|
160
|
+
"gux-chart-column": {
|
|
161
|
+
"beta": true,
|
|
162
|
+
"attributes": {
|
|
163
|
+
"--": [
|
|
164
|
+
"EmbedOptions<string, Renderers>"
|
|
165
|
+
],
|
|
166
|
+
"include-legend": "checkbox",
|
|
167
|
+
"legend-position": [
|
|
168
|
+
"bottom",
|
|
169
|
+
"bottom-left",
|
|
170
|
+
"bottom-right",
|
|
171
|
+
"left",
|
|
172
|
+
"none",
|
|
173
|
+
"right",
|
|
174
|
+
"top",
|
|
175
|
+
"top-left",
|
|
176
|
+
"top-right"
|
|
177
|
+
],
|
|
178
|
+
"legend-title": "text",
|
|
179
|
+
"x-axis-title": "text",
|
|
180
|
+
"x-field-name": "text",
|
|
181
|
+
"x-tick-label-slant": "checkbox",
|
|
182
|
+
"y-axis-title": "text",
|
|
183
|
+
"y-field-name": "text"
|
|
184
|
+
},
|
|
185
|
+
"events": []
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-701d93cf.js';
|
|
2
|
+
export { s as setNonce } from './index-701d93cf.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Stencil Client Patch Browser v4.5.0 | MIT Licensed | https://stenciljs.com
|
|
6
|
+
*/
|
|
7
|
+
const patchBrowser = () => {
|
|
8
|
+
const importMeta = import.meta.url;
|
|
9
|
+
const opts = {};
|
|
10
|
+
if (importMeta !== '') {
|
|
11
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
12
|
+
}
|
|
13
|
+
return promiseResolve(opts);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
patchBrowser().then(options => {
|
|
17
|
+
return bootstrapLazy([["gux-visualization-beta",[[1,"gux-visualization-beta",{"visualizationSpec":[16],"embedOptions":[16]}]]],["gux-chart-column-beta",[[1,"gux-chart-column-beta",{"chartData":[16],"xTickLabelSlant":[4,"x-tick-label-slant"],"includeLegend":[4,"include-legend"],"xFieldName":[1,"x-field-name"],"yFieldName":[1,"y-field-name"],"xAxisTitle":[1,"x-axis-title"],"yAxisTitle":[1,"y-axis-title"],"legendTitle":[1,"legend-title"],"legendPosition":[1,"legend-position"],"chartLayers":[16],"embedOptions":[16]},null,{"chartData":["parseData"]}]]],["gux-chart-donut-beta",[[1,"gux-chart-donut-beta",{"chartData":[16],"includeLegend":[4,"include-legend"],"legendPosition":[1,"legend-position"],"legendTitle":[1,"legend-title"],"colorFieldName":[1,"color-field-name"],"outerRadius":[2,"outer-radius"],"innerRadius":[2,"inner-radius"],"labelRadius":[2,"label-radius"],"labelField":[1,"label-field"],"gauge":[4],"centerText":[1,"center-text"],"centerSubText":[1,"center-sub-text"],"showTooltip":[4,"show-tooltip"],"tooltipOptions":[16],"legendX":[2,"legend-x"],"legendY":[2,"legend-y"],"legendFontSize":[2,"legend-font-size"],"legendSymbolSize":[2,"legend-symbol-size"],"embedOptions":[16]},null,{"chartData":["parseData"]}]]],["gux-chart-line-beta",[[1,"gux-chart-line-beta",{"chartData":[16],"xTickLabelSlant":[4,"x-tick-label-slant"],"includeLegend":[4,"include-legend"],"legendPosition":[1,"legend-position"],"includeDataPointMarkers":[4,"include-data-point-markers"],"xFieldName":[1,"x-field-name"],"xAxisTitle":[1,"x-axis-title"],"yFieldName":[1,"y-field-name"],"yAxisTitle":[1,"y-axis-title"],"legendTitle":[1,"legend-title"],"colorFieldName":[1,"color-field-name"],"strokeDash":[4,"stroke-dash"],"interpolation":[1],"embedOptions":[16]},null,{"chartData":["parseData"]}]]],["gux-chart-pie-beta",[[1,"gux-chart-pie-beta",{"chartData":[16],"includeLegend":[4,"include-legend"],"legendPosition":[1,"legend-position"],"legendTitle":[1,"legend-title"],"colorFieldName":[1,"color-field-name"],"outerRadius":[2,"outer-radius"],"labelRadius":[2,"label-radius"],"labelField":[1,"label-field"],"embedOptions":[16]},null,{"chartData":["parseData"]}]]],["gux-chart-scatter-plot-beta",[[1,"gux-chart-scatter-plot-beta",{"chartData":[16],"xTickLabelSlant":[4,"x-tick-label-slant"],"includeLegend":[4,"include-legend"],"legendPosition":[1,"legend-position"],"xFieldName":[1,"x-field-name"],"xAxisTitle":[1,"x-axis-title"],"yFieldName":[1,"y-field-name"],"yAxisTitle":[1,"y-axis-title"],"legendTitle":[1,"legend-title"],"colorFieldName":[1,"color-field-name"],"useShape":[1,"use-shape"],"embedOptions":[16]},null,{"chartData":["parseData"]}]]]], options);
|
|
18
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
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 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
|
+
|
|
7
|
+
const GuxColumnChart = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
this.baseChartSpec = {
|
|
12
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
13
|
+
mark: { type: 'bar' },
|
|
14
|
+
config: {
|
|
15
|
+
axis: {
|
|
16
|
+
ticks: false,
|
|
17
|
+
titlePadding: 8
|
|
18
|
+
},
|
|
19
|
+
axisX: {
|
|
20
|
+
labelAngle: 0
|
|
21
|
+
},
|
|
22
|
+
scale: {
|
|
23
|
+
bandPaddingInner: 0.4,
|
|
24
|
+
bandPaddingOuter: 0.4 // padding between leftmost/rightmost column/bar from axes
|
|
25
|
+
},
|
|
26
|
+
legend: {
|
|
27
|
+
symbolType: 'circle'
|
|
28
|
+
},
|
|
29
|
+
bar: {
|
|
30
|
+
color: VISUALIZATION_COLORS[0]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
encoding: {
|
|
34
|
+
x: { type: 'nominal' },
|
|
35
|
+
y: { type: 'quantitative' },
|
|
36
|
+
tooltip: { aggregate: 'count', type: 'quantitative' }
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.chartData = undefined;
|
|
40
|
+
this.xTickLabelSlant = undefined;
|
|
41
|
+
this.includeLegend = undefined;
|
|
42
|
+
this.xFieldName = undefined;
|
|
43
|
+
this.yFieldName = undefined;
|
|
44
|
+
this.xAxisTitle = undefined;
|
|
45
|
+
this.yAxisTitle = undefined;
|
|
46
|
+
this.legendTitle = undefined;
|
|
47
|
+
this.legendPosition = 'right';
|
|
48
|
+
this.chartLayers = undefined;
|
|
49
|
+
this.embedOptions = undefined;
|
|
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;
|
|
67
|
+
}
|
|
68
|
+
const xFieldName = this.xFieldName;
|
|
69
|
+
const yFieldName = this.yFieldName;
|
|
70
|
+
const xAxisTitle = this.xAxisTitle;
|
|
71
|
+
const yAxisTitle = this.yAxisTitle;
|
|
72
|
+
const legendTitle = this.legendTitle;
|
|
73
|
+
if (this.chartLayers) {
|
|
74
|
+
const layers = this.chartLayers.map(layerName => {
|
|
75
|
+
return {
|
|
76
|
+
mark: 'bar',
|
|
77
|
+
transform: [
|
|
78
|
+
{
|
|
79
|
+
filter: { field: 'series', equal: layerName }
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
encoding: {
|
|
83
|
+
x: {
|
|
84
|
+
field: xFieldName,
|
|
85
|
+
type: 'nominal'
|
|
86
|
+
},
|
|
87
|
+
y: {
|
|
88
|
+
field: yFieldName,
|
|
89
|
+
type: 'quantitative'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
this.baseChartSpec.layer = layers;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
if (xFieldName) {
|
|
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
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Set up colors for legend and bars
|
|
114
|
+
const rangeField = xFieldName;
|
|
115
|
+
const rangeConfig = {
|
|
116
|
+
[rangeField]: VISUALIZATION_COLORS
|
|
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
|
+
}; }
|
|
133
|
+
};
|
|
134
|
+
GuxColumnChart.style = guxChartColumnCss;
|
|
135
|
+
|
|
136
|
+
export { GuxColumnChart as gux_chart_column_beta };
|
|
@@ -0,0 +1,225 @@
|
|
|
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 guxChartDonutCss = "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 DEFAULT_RING_WIDTH = 32;
|
|
10
|
+
const GuxDonutChart = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
registerInstance(this, hostRef);
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
this.baseChartSpec = {
|
|
15
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
16
|
+
config: {
|
|
17
|
+
legend: {
|
|
18
|
+
symbolType: 'circle'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
encoding: {
|
|
22
|
+
theta: { field: 'value', type: 'quantitative', stack: true },
|
|
23
|
+
color: {
|
|
24
|
+
field: DEFAULT_COLOR_FIELD_NAME,
|
|
25
|
+
type: 'nominal',
|
|
26
|
+
scale: { range: VISUALIZATION_COLORS },
|
|
27
|
+
legend: null
|
|
28
|
+
}
|
|
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.innerRadius = undefined;
|
|
50
|
+
this.labelRadius = undefined;
|
|
51
|
+
this.labelField = undefined;
|
|
52
|
+
this.gauge = undefined;
|
|
53
|
+
this.centerText = undefined;
|
|
54
|
+
this.centerSubText = undefined;
|
|
55
|
+
this.showTooltip = true;
|
|
56
|
+
this.tooltipOptions = undefined;
|
|
57
|
+
this.legendX = undefined;
|
|
58
|
+
this.legendY = undefined;
|
|
59
|
+
this.legendFontSize = undefined;
|
|
60
|
+
this.legendSymbolSize = undefined;
|
|
61
|
+
this.embedOptions = undefined;
|
|
62
|
+
}
|
|
63
|
+
parseData() {
|
|
64
|
+
if (!this.outerRadius && !this.innerRadius) {
|
|
65
|
+
logError(this.root, 'requires at least one of outer-radius or inner-radius');
|
|
66
|
+
}
|
|
67
|
+
let chartData = {};
|
|
68
|
+
if (this.chartData) {
|
|
69
|
+
chartData = { data: this.chartData };
|
|
70
|
+
}
|
|
71
|
+
if (this.legendPosition) {
|
|
72
|
+
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
73
|
+
}
|
|
74
|
+
if (this.includeLegend) {
|
|
75
|
+
this.baseChartSpec.encoding.color.legend = {};
|
|
76
|
+
if (this.legendX || this.legendY) {
|
|
77
|
+
this.baseChartSpec.config.legend.orient = 'none';
|
|
78
|
+
if (this.legendX) {
|
|
79
|
+
this.baseChartSpec.encoding.color.legend.legendX = this.legendX;
|
|
80
|
+
}
|
|
81
|
+
if (this.legendY) {
|
|
82
|
+
this.baseChartSpec.encoding.color.legend.legendY = this.legendY;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (this.legendFontSize) {
|
|
86
|
+
this.baseChartSpec.encoding.color.legend.labelFontSize =
|
|
87
|
+
this.legendFontSize;
|
|
88
|
+
}
|
|
89
|
+
if (this.legendSymbolSize) {
|
|
90
|
+
this.baseChartSpec.encoding.color.legend.symbolSize =
|
|
91
|
+
this.legendSymbolSize;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.baseChartSpec.encoding.color.legend = null;
|
|
96
|
+
}
|
|
97
|
+
const colorFieldName = this.colorFieldName || DEFAULT_COLOR_FIELD_NAME;
|
|
98
|
+
if (colorFieldName) {
|
|
99
|
+
this.baseChartSpec.encoding.color.field = colorFieldName;
|
|
100
|
+
}
|
|
101
|
+
const legendTitle = this.legendTitle;
|
|
102
|
+
if (legendTitle) {
|
|
103
|
+
this.baseChartSpec.encoding.color.title = legendTitle;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.baseChartSpec.encoding.color.title = '';
|
|
107
|
+
}
|
|
108
|
+
let outerRadius = this.outerRadius;
|
|
109
|
+
let innerRadius = this.innerRadius;
|
|
110
|
+
if (!outerRadius) {
|
|
111
|
+
outerRadius = innerRadius + DEFAULT_RING_WIDTH;
|
|
112
|
+
}
|
|
113
|
+
if (!innerRadius) {
|
|
114
|
+
innerRadius = outerRadius - DEFAULT_RING_WIDTH;
|
|
115
|
+
}
|
|
116
|
+
let layerFiels = 1;
|
|
117
|
+
if (this.gauge) {
|
|
118
|
+
this.baseChartSpec.layer = [
|
|
119
|
+
{
|
|
120
|
+
data: { values: [{ progress: 'default', value: 100 }] },
|
|
121
|
+
mark: { type: 'arc', innerRadius },
|
|
122
|
+
encoding: {
|
|
123
|
+
theta: { field: 'value', type: 'quantitative' },
|
|
124
|
+
color: { value: '#E4E9F0' },
|
|
125
|
+
tooltip: null
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
mark: { type: 'arc', outerRadius, innerRadius, padAngle: 0.01 }
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
mark: { type: 'arc', innerRadius, padAngle: 0.01 }
|
|
133
|
+
}
|
|
134
|
+
];
|
|
135
|
+
layerFiels = 2;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.baseChartSpec.layer = [
|
|
139
|
+
{
|
|
140
|
+
mark: { type: 'arc', outerRadius, innerRadius }
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
mark: { type: 'arc', innerRadius, stroke: '#fff' }
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
const centerText = this.centerText;
|
|
148
|
+
if (centerText) {
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
150
|
+
this.baseChartSpec.layer.push({
|
|
151
|
+
data: { values: [{ centerText: centerText, value: 0 }] },
|
|
152
|
+
mark: { align: 'center', type: 'text', baseline: 'middle' },
|
|
153
|
+
encoding: {
|
|
154
|
+
color: { value: '#4C5054' },
|
|
155
|
+
text: { field: 'centerText' },
|
|
156
|
+
size: { value: { expr: 'height * 0.09' } },
|
|
157
|
+
tooltip: null
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const centerSubText = this.centerSubText;
|
|
162
|
+
if (centerSubText) {
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
164
|
+
this.baseChartSpec.layer.push({
|
|
165
|
+
data: { values: [{ centerSubText: centerSubText, value: 0 }] },
|
|
166
|
+
mark: {
|
|
167
|
+
align: 'center',
|
|
168
|
+
type: 'text',
|
|
169
|
+
baseline: 'middle',
|
|
170
|
+
y: { expr: 'height/2 + 20' }
|
|
171
|
+
},
|
|
172
|
+
encoding: {
|
|
173
|
+
color: { value: '#6A6D70' },
|
|
174
|
+
text: { field: 'centerSubText' },
|
|
175
|
+
size: { value: { expr: 'height * 0.06' } },
|
|
176
|
+
tooltip: null
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
const labelRadius = this.labelRadius;
|
|
181
|
+
const labelField = this.labelField || DEFAULT_LABEL_FIELD_NAME;
|
|
182
|
+
if (labelRadius) {
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
184
|
+
this.baseChartSpec.layer.push({
|
|
185
|
+
mark: { type: 'text', radius: labelRadius },
|
|
186
|
+
encoding: {
|
|
187
|
+
text: { field: labelField, type: 'quantitative' }
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (this.showTooltip) {
|
|
192
|
+
if (this.tooltipOptions) {
|
|
193
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
194
|
+
this.baseChartSpec.layer[layerFiels].mark.tooltip = { content: 'data' };
|
|
195
|
+
this.tooltipSpec = {
|
|
196
|
+
actions: false,
|
|
197
|
+
tooltip: this.tooltipOptions
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
this.baseChartSpec.encoding.tooltip = {
|
|
202
|
+
field: labelField,
|
|
203
|
+
aggregate: 'count',
|
|
204
|
+
type: 'quantitative'
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const spec = Object.assign(this.baseChartSpec, chartData);
|
|
209
|
+
this.visualizationSpec = spec;
|
|
210
|
+
}
|
|
211
|
+
componentWillLoad() {
|
|
212
|
+
trackComponent(this.root);
|
|
213
|
+
this.parseData();
|
|
214
|
+
}
|
|
215
|
+
render() {
|
|
216
|
+
return (h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec, embedOptions: this.tooltipSpec }));
|
|
217
|
+
}
|
|
218
|
+
get root() { return getElement(this); }
|
|
219
|
+
static get watchers() { return {
|
|
220
|
+
"chartData": ["parseData"]
|
|
221
|
+
}; }
|
|
222
|
+
};
|
|
223
|
+
GuxDonutChart.style = guxChartDonutCss;
|
|
224
|
+
|
|
225
|
+
export { GuxDonutChart as gux_chart_donut_beta };
|