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
package/dist/collection/components/beta/gux-chart-scatter-plot/tests/gux-chart-scatter-plot.spec.js
CHANGED
|
@@ -3,31 +3,31 @@ import { GuxScatterPlotChart } from "../gux-chart-scatter-plot";
|
|
|
3
3
|
const components = [GuxScatterPlotChart];
|
|
4
4
|
const language = 'en';
|
|
5
5
|
describe('gux-chart-scatter-plot-beta', () => {
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
6
|
+
it('should build', async () => {
|
|
7
|
+
const html = '<gux-chart-scatter-plot-beta x-field-name="date" y-field-name="value"></gux-chart-scatter-plot-beta>';
|
|
8
|
+
const page = await newSpecPage({ components, html, language });
|
|
9
|
+
expect(page.rootInstance).toBeInstanceOf(GuxScatterPlotChart);
|
|
10
|
+
});
|
|
11
|
+
it('should reflect the shape user has chosen', async () => {
|
|
12
|
+
let html = '<gux-chart-scatter-plot-beta x-field-name="date" y-field-name="value"></gux-chart-scatter-plot-beta>';
|
|
13
|
+
let page = await newSpecPage({ components, html, language });
|
|
14
|
+
expect(page.rootInstance.useShape).toBeUndefined();
|
|
15
|
+
expect(page.rootInstance.baseChartSpec.mark.type).toBe('circle');
|
|
16
|
+
html =
|
|
17
|
+
'<gux-chart-scatter-plot-beta x-field-name="date" y-field-name="value" use-shape="square"></gux-chart-scatter-plot-beta>';
|
|
18
|
+
page = await newSpecPage({ components, html, language });
|
|
19
|
+
expect(page.rootInstance.useShape).toBeTruthy();
|
|
20
|
+
expect(page.rootInstance.baseChartSpec.mark.type).toBe('square');
|
|
21
|
+
});
|
|
22
|
+
it('should reflect user option to make slant x axis tick labels', async () => {
|
|
23
|
+
let html = '<gux-chart-scatter-plot-beta x-field-name="date" y-field-name="value"></gux-chart-scatter-plot-beta>';
|
|
24
|
+
let page = await newSpecPage({ components, html, language });
|
|
25
|
+
expect(page.rootInstance.xTickLabelSlant).toBeUndefined();
|
|
26
|
+
expect(page.rootInstance.baseChartSpec.config.axisX.labelAngle).toBe(0);
|
|
27
|
+
html =
|
|
28
|
+
'<gux-chart-scatter-plot-beta x-field-name="date" y-field-name="value" x-tick-label-slant="true"></gux-chart-scatter-plot-beta>';
|
|
29
|
+
page = await newSpecPage({ components, html, language });
|
|
30
|
+
expect(page.rootInstance.xTickLabelSlant).toBeTruthy();
|
|
31
|
+
expect(page.rootInstance.baseChartSpec.config.axisX.labelAngle).toBe(-45);
|
|
32
|
+
});
|
|
33
33
|
});
|
|
@@ -5,139 +5,139 @@ import { getDesiredLocale } from "../../../i18n";
|
|
|
5
5
|
import { trackComponent } from "../../../utils/tracking/usage";
|
|
6
6
|
import { timeFormatLocale } from "./gux-visualization.locale";
|
|
7
7
|
export class GuxVisualization {
|
|
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
|
-
await embed(this.chartContainer, Object.assign({}, this.defaultVisualizationSpec, this.visualizationSpec), Object.assign({
|
|
40
|
-
timeFormatLocale: timeFormatLocale[locale]
|
|
41
|
-
}, this.defaultEmbedOptions, this.embedOptions, patchOption)).then(result => {
|
|
42
|
-
result.view.addSignalListener('chartClick', (name, value) => this.handleChartClick(name, value));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
componentDidLoad() {
|
|
46
|
-
this.chartComponentReady.emit();
|
|
47
|
-
}
|
|
48
|
-
render() {
|
|
49
|
-
return (h("div", { ref: el => (this.chartContainer = el) }));
|
|
50
|
-
}
|
|
51
|
-
static get is() { return "gux-visualization-beta"; }
|
|
52
|
-
static get encapsulation() { return "shadow"; }
|
|
53
|
-
static get originalStyleUrls() {
|
|
54
|
-
return {
|
|
55
|
-
"$": ["gux-visualization.scss"]
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
static get styleUrls() {
|
|
59
|
-
return {
|
|
60
|
-
"$": ["gux-visualization.css"]
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
static get properties() {
|
|
64
|
-
return {
|
|
65
|
-
"visualizationSpec": {
|
|
66
|
-
"type": "unknown",
|
|
67
|
-
"mutable": false,
|
|
68
|
-
"complexType": {
|
|
69
|
-
"original": "VisualizationSpec",
|
|
70
|
-
"resolved": "GenericConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | GenericFacetSpec<UnitSpecWithFrame<Field>, LayerSpec<Field>, Field> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } & DataMixins | GenericHConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | GenericUnitSpec<FacetedCompositeEncoding<Field>, AnyMark, TopLevelParameter> & ResolveMixins & GenericCompositionLayout & FrameMixins<ExprRef | SignalRef> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } & DataMixins | GenericVConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | LayerRepeatSpec & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | LayerSpec<Field> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | NonLayerRepeatSpec & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | Spec",
|
|
71
|
-
"references": {
|
|
72
|
-
"VisualizationSpec": {
|
|
73
|
-
"location": "import",
|
|
74
|
-
"path": "vega-embed",
|
|
75
|
-
"id": "../../node_modules/vega-embed/build/vega-embed.module.d.ts::VisualizationSpec"
|
|
8
|
+
constructor() {
|
|
9
|
+
this.defaultVisualizationSpec = {};
|
|
10
|
+
this.defaultEmbedOptions = {
|
|
11
|
+
actions: false,
|
|
12
|
+
renderer: 'svg'
|
|
13
|
+
};
|
|
14
|
+
this.visualizationSpec = undefined;
|
|
15
|
+
this.embedOptions = undefined;
|
|
16
|
+
}
|
|
17
|
+
componentWillLoad() {
|
|
18
|
+
trackComponent(this.root);
|
|
19
|
+
}
|
|
20
|
+
handleChartClick(_name, value) {
|
|
21
|
+
this.chartClicked.emit(value);
|
|
22
|
+
}
|
|
23
|
+
async componentDidRender() {
|
|
24
|
+
const locale = getDesiredLocale(this.root);
|
|
25
|
+
const patchOption = {
|
|
26
|
+
patch: (visSpec) => {
|
|
27
|
+
if (!(visSpec === null || visSpec === void 0 ? void 0 : visSpec.signals)) {
|
|
28
|
+
visSpec.signals = [];
|
|
29
|
+
}
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
31
|
+
visSpec.signals.push({
|
|
32
|
+
name: 'chartClick',
|
|
33
|
+
value: 0,
|
|
34
|
+
on: [{ events: 'rect:mousedown', update: 'datum' }]
|
|
35
|
+
});
|
|
36
|
+
return visSpec;
|
|
76
37
|
}
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
38
|
+
};
|
|
39
|
+
await embed(this.chartContainer, Object.assign({}, this.defaultVisualizationSpec, this.visualizationSpec), Object.assign({
|
|
40
|
+
timeFormatLocale: timeFormatLocale[locale]
|
|
41
|
+
}, this.defaultEmbedOptions, this.embedOptions, patchOption)).then(result => {
|
|
42
|
+
result.view.addSignalListener('chartClick', (name, value) => this.handleChartClick(name, value));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
componentDidLoad() {
|
|
46
|
+
this.chartComponentReady.emit();
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return (h("div", { key: '109a4cf0a395ef4d9b6a5aec9e306d416ae86e65', ref: el => (this.chartContainer = el) }));
|
|
50
|
+
}
|
|
51
|
+
static get is() { return "gux-visualization-beta"; }
|
|
52
|
+
static get encapsulation() { return "shadow"; }
|
|
53
|
+
static get originalStyleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["gux-visualization.scss"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get styleUrls() {
|
|
59
|
+
return {
|
|
60
|
+
"$": ["gux-visualization.css"]
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
static get properties() {
|
|
64
|
+
return {
|
|
65
|
+
"visualizationSpec": {
|
|
66
|
+
"type": "unknown",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "VisualizationSpec",
|
|
70
|
+
"resolved": "GenericConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | GenericFacetSpec<UnitSpecWithFrame<Field>, LayerSpec<Field>, Field> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } & DataMixins | GenericHConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | GenericUnitSpec<FacetedCompositeEncoding<Field>, AnyMark, TopLevelParameter> & ResolveMixins & GenericCompositionLayout & FrameMixins<ExprRef | SignalRef> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } & DataMixins | GenericVConcatSpec<NonNormalizedSpec> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | LayerRepeatSpec & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | LayerSpec<Field> & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | NonLayerRepeatSpec & TopLevelProperties<ExprRef | SignalRef> & { $schema?: string; config?: Config<ExprRef | SignalRef>; datasets?: Datasets; usermeta?: Dict<unknown>; } | Spec",
|
|
71
|
+
"references": {
|
|
72
|
+
"VisualizationSpec": {
|
|
73
|
+
"location": "import",
|
|
74
|
+
"path": "vega-embed",
|
|
75
|
+
"id": "../../node_modules/vega-embed/build/vega-embed.module.d.ts::VisualizationSpec"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": ""
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"embedOptions": {
|
|
87
|
+
"type": "unknown",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "EmbedOptions",
|
|
91
|
+
"resolved": "EmbedOptions<string, Renderers>",
|
|
92
|
+
"references": {
|
|
93
|
+
"EmbedOptions": {
|
|
94
|
+
"location": "import",
|
|
95
|
+
"path": "vega-embed",
|
|
96
|
+
"id": "../../node_modules/vega-embed/build/vega-embed.module.d.ts::EmbedOptions"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": false,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": ""
|
|
105
|
+
}
|
|
97
106
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
"complexType": {
|
|
136
|
-
"original": "any",
|
|
137
|
-
"resolved": "any",
|
|
138
|
-
"references": {}
|
|
139
|
-
}
|
|
140
|
-
}];
|
|
141
|
-
}
|
|
142
|
-
static get elementRef() { return "root"; }
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
static get events() {
|
|
110
|
+
return [{
|
|
111
|
+
"method": "chartComponentReady",
|
|
112
|
+
"name": "chartComponentReady",
|
|
113
|
+
"bubbles": true,
|
|
114
|
+
"cancelable": true,
|
|
115
|
+
"composed": true,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": ""
|
|
119
|
+
},
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "any",
|
|
122
|
+
"resolved": "any",
|
|
123
|
+
"references": {}
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
"method": "chartClicked",
|
|
127
|
+
"name": "chartClicked",
|
|
128
|
+
"bubbles": true,
|
|
129
|
+
"cancelable": true,
|
|
130
|
+
"composed": true,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": ""
|
|
134
|
+
},
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "any",
|
|
137
|
+
"resolved": "any",
|
|
138
|
+
"references": {}
|
|
139
|
+
}
|
|
140
|
+
}];
|
|
141
|
+
}
|
|
142
|
+
static get elementRef() { return "root"; }
|
|
143
143
|
}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
// https://github.com/d3/d3-time-format/tree/master/locale
|
|
2
2
|
// This is just a POC I would structure the files differently when implementing for production.
|
|
3
3
|
export const timeFormatLocale = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
4
|
+
en: {
|
|
5
|
+
dateTime: '%x, %X',
|
|
6
|
+
date: '%-m/%-d/%Y',
|
|
7
|
+
time: '%-I:%M:%S %p',
|
|
8
|
+
periods: ['AM', 'PM'],
|
|
9
|
+
days: [
|
|
10
|
+
'Sunday',
|
|
11
|
+
'Monday',
|
|
12
|
+
'Tuesday',
|
|
13
|
+
'Wednesday',
|
|
14
|
+
'Thursday',
|
|
15
|
+
'Friday',
|
|
16
|
+
'Saturday'
|
|
17
|
+
],
|
|
18
|
+
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
19
|
+
months: [
|
|
20
|
+
'January',
|
|
21
|
+
'February',
|
|
22
|
+
'March',
|
|
23
|
+
'April',
|
|
24
|
+
'May',
|
|
25
|
+
'June',
|
|
26
|
+
'July',
|
|
27
|
+
'August',
|
|
28
|
+
'September',
|
|
29
|
+
'October',
|
|
30
|
+
'November',
|
|
31
|
+
'December'
|
|
32
|
+
],
|
|
33
|
+
shortMonths: [
|
|
34
|
+
'Jan',
|
|
35
|
+
'Feb',
|
|
36
|
+
'Mar',
|
|
37
|
+
'Apr',
|
|
38
|
+
'May',
|
|
39
|
+
'Jun',
|
|
40
|
+
'Jul',
|
|
41
|
+
'Aug',
|
|
42
|
+
'Sep',
|
|
43
|
+
'Oct',
|
|
44
|
+
'Nov',
|
|
45
|
+
'Dec'
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
de: {
|
|
49
|
+
dateTime: '%A, der %e. %B %Y, %X',
|
|
50
|
+
date: '%d.%m.%Y',
|
|
51
|
+
time: '%H:%M:%S',
|
|
52
|
+
periods: ['AM', 'PM'],
|
|
53
|
+
days: [
|
|
54
|
+
'Sonntag',
|
|
55
|
+
'Montag',
|
|
56
|
+
'Dienstag',
|
|
57
|
+
'Mittwoch',
|
|
58
|
+
'Donnerstag',
|
|
59
|
+
'Freitag',
|
|
60
|
+
'Samstag'
|
|
61
|
+
],
|
|
62
|
+
shortDays: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
|
|
63
|
+
months: [
|
|
64
|
+
'Januar',
|
|
65
|
+
'Februar',
|
|
66
|
+
'März',
|
|
67
|
+
'April',
|
|
68
|
+
'Mai',
|
|
69
|
+
'Juni',
|
|
70
|
+
'Juli',
|
|
71
|
+
'August',
|
|
72
|
+
'September',
|
|
73
|
+
'Oktober',
|
|
74
|
+
'November',
|
|
75
|
+
'Dezember'
|
|
76
|
+
],
|
|
77
|
+
shortMonths: [
|
|
78
|
+
'Jan',
|
|
79
|
+
'Feb',
|
|
80
|
+
'Mrz',
|
|
81
|
+
'Apr',
|
|
82
|
+
'Mai',
|
|
83
|
+
'Jun',
|
|
84
|
+
'Jul',
|
|
85
|
+
'Aug',
|
|
86
|
+
'Sep',
|
|
87
|
+
'Okt',
|
|
88
|
+
'Nov',
|
|
89
|
+
'Dez'
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
92
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { newE2EPage } from "@stencil/core/testing";
|
|
2
2
|
const visualizationSpecLine = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
4
|
+
data: { url: 'https://vega.github.io/editor/data/seattle-weather.csv' },
|
|
5
|
+
mark: {
|
|
6
|
+
type: 'line',
|
|
7
|
+
interpolate: 'monotone'
|
|
8
|
+
},
|
|
9
|
+
encoding: {
|
|
10
|
+
x: { timeUnit: 'month', field: 'date', bandPosition: 0.5 },
|
|
11
|
+
y: { aggregate: 'mean', field: 'temp_max' }
|
|
12
|
+
}
|
|
13
13
|
};
|
|
14
14
|
describe('gux-visualization-beta', () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
describe('#render', () => {
|
|
16
|
+
[
|
|
17
|
+
{
|
|
18
|
+
description: 'should render default button',
|
|
19
|
+
html: '<gux-visualization-beta lang="en" id="visualization-1"></gux-visualization-beta>'
|
|
20
|
+
}
|
|
21
|
+
].forEach(({ description, html }) => {
|
|
22
|
+
it(description, async () => {
|
|
23
|
+
const page = await newE2EPage({ html });
|
|
24
|
+
const element = (await page.find('gux-visualization-beta'));
|
|
25
|
+
element.visualizationSpec = visualizationSpecLine;
|
|
26
|
+
await page.waitForChanges();
|
|
27
|
+
expect(element.outerHTML).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
29
30
|
});
|
|
30
|
-
});
|
|
31
31
|
});
|
|
@@ -3,33 +3,33 @@ import { GuxVisualization } from "../gux-visualization";
|
|
|
3
3
|
const components = [GuxVisualization];
|
|
4
4
|
const language = 'en';
|
|
5
5
|
const visualizationSpecLine = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
7
|
+
data: { url: 'https://vega.github.io/editor/data/seattle-weather.csv' },
|
|
8
|
+
mark: {
|
|
9
|
+
type: 'line',
|
|
10
|
+
interpolate: 'monotone'
|
|
11
|
+
},
|
|
12
|
+
encoding: {
|
|
13
|
+
x: { timeUnit: 'month', field: 'date', bandPosition: 0.5 },
|
|
14
|
+
y: { aggregate: 'mean', field: 'temp_max' }
|
|
15
|
+
}
|
|
16
16
|
};
|
|
17
17
|
describe.skip('gux-visualization-beta', () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
describe('#render', () => {
|
|
19
|
+
[
|
|
20
|
+
{
|
|
21
|
+
description: 'should render default button',
|
|
22
|
+
html: '<gux-visualization-beta></gux-visualization-beta>'
|
|
23
|
+
}
|
|
24
|
+
].forEach(({ description, html }) => {
|
|
25
|
+
it(description, async () => {
|
|
26
|
+
const page = await newSpecPage({ components, html, language });
|
|
27
|
+
const element = page.root;
|
|
28
|
+
element.visualizationSpec = visualizationSpecLine;
|
|
29
|
+
await page.waitForChanges();
|
|
30
|
+
expect(page.rootInstance).toBeInstanceOf(GuxVisualization);
|
|
31
|
+
expect(page.root).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
33
34
|
});
|
|
34
|
-
});
|
|
35
35
|
});
|