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,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-1e13a15f.js');
|
|
6
|
+
|
|
7
|
+
const defineCustomElements = (win, options) => {
|
|
8
|
+
if (typeof window === 'undefined') return undefined;
|
|
9
|
+
return index.bootstrapLazy([["gux-visualization-beta.cjs",[[1,"gux-visualization-beta",{"visualizationSpec":[16],"embedOptions":[16]}]]],["gux-chart-column-beta.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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.cjs",[[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);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.setNonce = index.setNonce;
|
|
13
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const VISUALIZATION_COLORS = [
|
|
4
|
+
'#203B73',
|
|
5
|
+
'#1DA8B3',
|
|
6
|
+
'#75A8FF',
|
|
7
|
+
'#8452CF',
|
|
8
|
+
'#B5B5EB',
|
|
9
|
+
'#CC3EBE',
|
|
10
|
+
'#5E5782',
|
|
11
|
+
'#FF8FDD',
|
|
12
|
+
'#868C1E',
|
|
13
|
+
'#DDD933'
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
function logError(component, message) {
|
|
17
|
+
console.error(`[${component.tagName.toLowerCase()}] ${message}`, component);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.VISUALIZATION_COLORS = VISUALIZATION_COLORS;
|
|
21
|
+
exports.logError = logError;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const name = "genesys-spark-chart-components";
|
|
4
|
+
const version = "4.12.1-beta.1";
|
|
5
|
+
const description = "Common chart webcomponents";
|
|
6
|
+
const license = "MIT";
|
|
7
|
+
const main = "dist/stencil-wrapper.js";
|
|
8
|
+
const files = [
|
|
9
|
+
"dist/"
|
|
10
|
+
];
|
|
11
|
+
const scripts = {
|
|
12
|
+
build: "npm run clean && npm run i18n && npm run stencil && npm run build-wrapper",
|
|
13
|
+
"build-i18n": "./scripts/build-i18n.js",
|
|
14
|
+
"build-wrapper": "./scripts/wrap-stencil.js",
|
|
15
|
+
"check-a11y": "node ./scripts/check-a11y.mjs",
|
|
16
|
+
"check-readmes": "./scripts/check-readmes.sh",
|
|
17
|
+
clean: "rm -r ./dist ./build || true",
|
|
18
|
+
predev: "npm run i18n",
|
|
19
|
+
dev: "npm run stencil.dev",
|
|
20
|
+
eslint: "eslint --fix .",
|
|
21
|
+
i18n: "npm run update-en-i18n && npm run build-i18n",
|
|
22
|
+
"lint-all": "npm-run-all \"stylelint\" \"eslint\" \"prettier\" \"prettier-package-json\"",
|
|
23
|
+
"lint-staged": "lint-staged",
|
|
24
|
+
"list-checked-a11y-components": "node scripts/list-checked-a11y-components.js",
|
|
25
|
+
"list-component-tracking": "./scripts/list-component-tracking.js",
|
|
26
|
+
"list-i18n-files": "./scripts/list-i18n-files.js",
|
|
27
|
+
"predev.public": "npm run predev",
|
|
28
|
+
prepare: "npm run i18n",
|
|
29
|
+
prettier: "prettier --log-level silent --ignore-unknown --write .",
|
|
30
|
+
"prettier-package-json": "prettier-package-json --write ./package.json",
|
|
31
|
+
stencil: "stencil build --prod",
|
|
32
|
+
"stencil.dev": "stencil build --dev --watch --serve --no-open",
|
|
33
|
+
stylelint: "stylelint --fix \"**/*.{css,html,scss}\"",
|
|
34
|
+
test: "TZ=UTC stencil test --spec --e2e",
|
|
35
|
+
"test.ci": "TZ=UTC npm run test.ci.spec",
|
|
36
|
+
"test.ci.e2e": "TZ=UTC stencil test --e2e --max-workers=1",
|
|
37
|
+
"test.ci.spec": "TZ=UTC stencil test --spec --max-workers=1",
|
|
38
|
+
"test.e2e": "TZ=UTC stencil test --e2e",
|
|
39
|
+
"test.e2e.update-snapshot": "TZ=UTC stencil test --e2e --updateSnapshot",
|
|
40
|
+
"test.screenshot": "TZ=UTC stencil test --e2e --screenshot",
|
|
41
|
+
"test.unit": "TZ=UTC stencil build dev && stencil test --spec",
|
|
42
|
+
"test.unit.update-snapshot": "TZ=UTC stencil test --spec --updateSnapshot",
|
|
43
|
+
"test.update-snapshot": "TZ=UTC stencil test --spec --e2e --updateSnapshot",
|
|
44
|
+
"test.watch": "TZ=UTC stencil test --spec --e2e --watch",
|
|
45
|
+
"update-en-i18n": "./scripts/update-en-i18n.js",
|
|
46
|
+
"version-sync": "npm version --no-git-tag-version --allow-same-version"
|
|
47
|
+
};
|
|
48
|
+
const config = {
|
|
49
|
+
commitizen: {
|
|
50
|
+
path: "./node_modules/cz-conventional-changelog"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const types = "dist/types/index.d.ts";
|
|
54
|
+
const dependencies = {
|
|
55
|
+
vega: "*",
|
|
56
|
+
"vega-embed": "*",
|
|
57
|
+
"vega-lite": "*"
|
|
58
|
+
};
|
|
59
|
+
const devDependencies = {
|
|
60
|
+
"@babel/core": "^7.23.2",
|
|
61
|
+
"@babel/preset-env": "^7.23.2",
|
|
62
|
+
"@stencil/core": "4.5.0",
|
|
63
|
+
"@stencil/react-output-target": "^0.5.3",
|
|
64
|
+
"@stencil/sass": "^3.0.7",
|
|
65
|
+
"@stencil/utils": "0.0.5",
|
|
66
|
+
"@types/jest": "^27.5.2",
|
|
67
|
+
"@types/new-relic-browser": "^0.1118.2",
|
|
68
|
+
"@types/puppeteer": "^5.4.7",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
70
|
+
"@typescript-eslint/parser": "^6.9.1",
|
|
71
|
+
"axe-core": "^4.8.2",
|
|
72
|
+
"axe-live": "^1.0.1",
|
|
73
|
+
eslint: "^8.52.0",
|
|
74
|
+
"eslint-config-genesys-spark-components": "file:../../shared-configs/eslint-config-genesys-spark-components",
|
|
75
|
+
"eslint-config-prettier": "^8.10.0",
|
|
76
|
+
"file-loader": "^6.2.0",
|
|
77
|
+
"genesys-spark-tokens": "file:../genesys-spark-tokens",
|
|
78
|
+
glob: "^10.3.0",
|
|
79
|
+
handlebars: "^4.7.8",
|
|
80
|
+
inquirer: "^9.2.7",
|
|
81
|
+
jest: "^27.5.1",
|
|
82
|
+
"jest-cli": "^27.5.1",
|
|
83
|
+
"jest-config": "^27.5.1",
|
|
84
|
+
"jest-environment-node": "^27.5.1",
|
|
85
|
+
"jest-junit": "^13.2.0",
|
|
86
|
+
"jest-silent-reporter": "^0.5.0",
|
|
87
|
+
jsdom: "^22.1.0",
|
|
88
|
+
"lint-staged": "^13.3.0",
|
|
89
|
+
marked: "^4.3.0",
|
|
90
|
+
"node-fetch": "^3.3.2",
|
|
91
|
+
"npm-run-all": "^4.1.5",
|
|
92
|
+
"postcss-html": "^1.5.0",
|
|
93
|
+
"postcss-less": "^6.0.0",
|
|
94
|
+
"postcss-scss": "^4.0.9",
|
|
95
|
+
prettier: "^3.0.3",
|
|
96
|
+
"prettier-config-genesys-spark-components": "file:../../shared-configs/prettier-config-genesys-spark-components",
|
|
97
|
+
"prettier-package-json": "^2.8.0",
|
|
98
|
+
puppeteer: "^14.4.1",
|
|
99
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
100
|
+
"semver-sort": "^1.0.0",
|
|
101
|
+
stylelint: "^15.11.0",
|
|
102
|
+
"stylelint-config-genesys-spark-components": "file:../../shared-configs/stylelint-config-genesys-spark-components",
|
|
103
|
+
"stylelint-config-html": "^1.1.0",
|
|
104
|
+
"stylelint-config-recess-order": "^4.3.0",
|
|
105
|
+
"stylelint-config-standard": "^34.0.0",
|
|
106
|
+
"stylelint-scss": "^5.3.0",
|
|
107
|
+
"ts-loader": "^9.5.0",
|
|
108
|
+
typescript: "^4.9.5",
|
|
109
|
+
xmldom: "^0.6.0"
|
|
110
|
+
};
|
|
111
|
+
const publishConfig = {
|
|
112
|
+
registry: "https://registry.npmjs.org/"
|
|
113
|
+
};
|
|
114
|
+
const collection = "dist/collection/collection-manifest.json";
|
|
115
|
+
const prettier = "prettier-config-genesys-spark-components";
|
|
116
|
+
const volta = {
|
|
117
|
+
node: "18.16.1"
|
|
118
|
+
};
|
|
119
|
+
const packageInfo = {
|
|
120
|
+
name: name,
|
|
121
|
+
version: version,
|
|
122
|
+
description: description,
|
|
123
|
+
license: license,
|
|
124
|
+
main: main,
|
|
125
|
+
files: files,
|
|
126
|
+
scripts: scripts,
|
|
127
|
+
config: config,
|
|
128
|
+
types: types,
|
|
129
|
+
dependencies: dependencies,
|
|
130
|
+
devDependencies: devDependencies,
|
|
131
|
+
publishConfig: publishConfig,
|
|
132
|
+
collection: collection,
|
|
133
|
+
prettier: prettier,
|
|
134
|
+
volta: volta
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// The number of actions to process every interval
|
|
138
|
+
const ACTION_BATCH_SIZE = 20;
|
|
139
|
+
const NR_LIMIT_INTERVAL = 30000; // 30s
|
|
140
|
+
/**
|
|
141
|
+
* A queue of events that should be tracked by NewRelic.
|
|
142
|
+
* We initialize it with the library version to make sure that's always reported.
|
|
143
|
+
*/
|
|
144
|
+
const actionQueue = [
|
|
145
|
+
getVersionEvent(packageInfo.version)
|
|
146
|
+
];
|
|
147
|
+
/**
|
|
148
|
+
* Process the next batch items in the queue, set a timeout to recur.
|
|
149
|
+
* We use a recurring timeout instead of an interval because it guarantees
|
|
150
|
+
* a minimum of NR_LMIT_INTERVAL between batches, even if the browser is
|
|
151
|
+
* held up by processing elsewhere.
|
|
152
|
+
*/
|
|
153
|
+
function processActionQueue() {
|
|
154
|
+
const newrelic = window.newrelic;
|
|
155
|
+
if (!newrelic) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
for (let i = 0; i < ACTION_BATCH_SIZE; i++) {
|
|
159
|
+
if (actionQueue.length == 0) {
|
|
160
|
+
setTimeout(processActionQueue, NR_LIMIT_INTERVAL);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const action = actionQueue.shift();
|
|
164
|
+
newrelic.addPageAction(action.name, Object.assign(Object.assign({}, action.metadata), { queueDepth: actionQueue.length }));
|
|
165
|
+
}
|
|
166
|
+
setTimeout(processActionQueue, NR_LIMIT_INTERVAL);
|
|
167
|
+
}
|
|
168
|
+
let trackingStarted = false;
|
|
169
|
+
/**
|
|
170
|
+
* Begin action processing loop if it hasn't started.
|
|
171
|
+
*/
|
|
172
|
+
function ensureTracking() {
|
|
173
|
+
if (!trackingStarted) {
|
|
174
|
+
trackingStarted = true;
|
|
175
|
+
processActionQueue();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Submits a component for tracking by NewRelic.
|
|
180
|
+
*/
|
|
181
|
+
function trackComponent(element, metadata) {
|
|
182
|
+
if (!window.newrelic) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
ensureTracking();
|
|
186
|
+
// Ignore components in the shadow DOM of another component
|
|
187
|
+
// e.g. Only track components used directly by the app
|
|
188
|
+
if (!document.contains(element)) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
actionQueue.push({
|
|
192
|
+
name: 'spark-component',
|
|
193
|
+
metadata: Object.assign(Object.assign({}, metadata), { component: element.tagName.toLowerCase(), version: packageInfo.version })
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function getVersionEvent(packageInfoVersion) {
|
|
197
|
+
const [major, minor, ...patch] = packageInfoVersion.split('.');
|
|
198
|
+
return {
|
|
199
|
+
name: 'spark-library',
|
|
200
|
+
metadata: {
|
|
201
|
+
fullVersion: `${major}.${minor}.${patch.join('.')}`,
|
|
202
|
+
majorVersion: major,
|
|
203
|
+
minorVersion: `${major}.${minor}`
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
exports.trackComponent = trackComponent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"components/beta/gux-chart-column/gux-chart-column.js",
|
|
4
|
+
"components/beta/gux-chart-donut/gux-chart-donut.js",
|
|
5
|
+
"components/beta/gux-chart-line/gux-chart-line.js",
|
|
6
|
+
"components/beta/gux-chart-pie/gux-chart-pie.js",
|
|
7
|
+
"components/beta/gux-chart-scatter-plot/gux-chart-scatter-plot.js",
|
|
8
|
+
"components/beta/gux-visualization/gux-visualization.js"
|
|
9
|
+
],
|
|
10
|
+
"compiler": {
|
|
11
|
+
"name": "@stencil/core",
|
|
12
|
+
"version": "4.5.0",
|
|
13
|
+
"typescriptVersion": "5.2.2"
|
|
14
|
+
},
|
|
15
|
+
"collections": [],
|
|
16
|
+
"bundles": []
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
gux-visualization-beta {
|
|
2
|
+
height: fit-content;
|
|
3
|
+
color: #2e394c;
|
|
4
|
+
/* stylelint-disable-next-line selector-class-pattern */
|
|
5
|
+
/* stylelint-disable-next-line selector-class-pattern */
|
|
6
|
+
}
|
|
7
|
+
gux-visualization-beta .mark-rect.layer_0_marks path {
|
|
8
|
+
/* stylelint-disable-next-line function-url-quotes */
|
|
9
|
+
fill: url(#diagonalHatch0);
|
|
10
|
+
}
|
|
11
|
+
gux-visualization-beta .mark-rect.layer_1_marks path {
|
|
12
|
+
fill: #1da8b3;
|
|
13
|
+
}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
|
+
import { trackComponent } from "../../../utils/tracking/usage";
|
|
4
|
+
import { VISUALIZATION_COLORS } from "../../../utils/theme/color-palette";
|
|
5
|
+
import { logError } from "../../../utils/error/log-error";
|
|
6
|
+
export class GuxColumnChart {
|
|
7
|
+
constructor() {
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
this.baseChartSpec = {
|
|
10
|
+
$schema: 'https://vega.github.io/schema/vega-lite/v5.json',
|
|
11
|
+
mark: { type: 'bar' },
|
|
12
|
+
config: {
|
|
13
|
+
axis: {
|
|
14
|
+
ticks: false,
|
|
15
|
+
titlePadding: 8
|
|
16
|
+
},
|
|
17
|
+
axisX: {
|
|
18
|
+
labelAngle: 0
|
|
19
|
+
},
|
|
20
|
+
scale: {
|
|
21
|
+
bandPaddingInner: 0.4,
|
|
22
|
+
bandPaddingOuter: 0.4 // padding between leftmost/rightmost column/bar from axes
|
|
23
|
+
},
|
|
24
|
+
legend: {
|
|
25
|
+
symbolType: 'circle'
|
|
26
|
+
},
|
|
27
|
+
bar: {
|
|
28
|
+
color: VISUALIZATION_COLORS[0]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
encoding: {
|
|
32
|
+
x: { type: 'nominal' },
|
|
33
|
+
y: { type: 'quantitative' },
|
|
34
|
+
tooltip: { aggregate: 'count', type: 'quantitative' }
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
this.chartData = undefined;
|
|
38
|
+
this.xTickLabelSlant = undefined;
|
|
39
|
+
this.includeLegend = undefined;
|
|
40
|
+
this.xFieldName = undefined;
|
|
41
|
+
this.yFieldName = undefined;
|
|
42
|
+
this.xAxisTitle = undefined;
|
|
43
|
+
this.yAxisTitle = undefined;
|
|
44
|
+
this.legendTitle = undefined;
|
|
45
|
+
this.legendPosition = 'right';
|
|
46
|
+
this.chartLayers = undefined;
|
|
47
|
+
this.embedOptions = undefined;
|
|
48
|
+
}
|
|
49
|
+
parseData() {
|
|
50
|
+
if (!this.xFieldName || !this.yFieldName) {
|
|
51
|
+
logError(this.root, 'requires x-field-name and y-field-name');
|
|
52
|
+
}
|
|
53
|
+
let chartData = {};
|
|
54
|
+
if (this.chartData) {
|
|
55
|
+
chartData = { data: this.chartData };
|
|
56
|
+
}
|
|
57
|
+
if (this.xTickLabelSlant) {
|
|
58
|
+
this.baseChartSpec.config.axisX.labelAngle = 45;
|
|
59
|
+
}
|
|
60
|
+
if (this.includeLegend) {
|
|
61
|
+
this.baseChartSpec.encoding.color = { field: 'category' };
|
|
62
|
+
}
|
|
63
|
+
if (this.legendPosition) {
|
|
64
|
+
this.baseChartSpec.config.legend.orient = this.legendPosition;
|
|
65
|
+
}
|
|
66
|
+
const xFieldName = this.xFieldName;
|
|
67
|
+
const yFieldName = this.yFieldName;
|
|
68
|
+
const xAxisTitle = this.xAxisTitle;
|
|
69
|
+
const yAxisTitle = this.yAxisTitle;
|
|
70
|
+
const legendTitle = this.legendTitle;
|
|
71
|
+
if (this.chartLayers) {
|
|
72
|
+
const layers = this.chartLayers.map(layerName => {
|
|
73
|
+
return {
|
|
74
|
+
mark: 'bar',
|
|
75
|
+
transform: [
|
|
76
|
+
{
|
|
77
|
+
filter: { field: 'series', equal: layerName }
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
encoding: {
|
|
81
|
+
x: {
|
|
82
|
+
field: xFieldName,
|
|
83
|
+
type: 'nominal'
|
|
84
|
+
},
|
|
85
|
+
y: {
|
|
86
|
+
field: yFieldName,
|
|
87
|
+
type: 'quantitative'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
this.baseChartSpec.layer = layers;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
if (xFieldName) {
|
|
96
|
+
this.baseChartSpec.encoding.x.field = xFieldName;
|
|
97
|
+
}
|
|
98
|
+
if (yFieldName) {
|
|
99
|
+
this.baseChartSpec.encoding.y.field = yFieldName;
|
|
100
|
+
}
|
|
101
|
+
if (xAxisTitle) {
|
|
102
|
+
this.baseChartSpec.encoding.x.title = xAxisTitle;
|
|
103
|
+
}
|
|
104
|
+
if (yAxisTitle) {
|
|
105
|
+
this.baseChartSpec.encoding.y.title = yAxisTitle;
|
|
106
|
+
}
|
|
107
|
+
if (legendTitle) {
|
|
108
|
+
this.baseChartSpec.encoding.color.title = legendTitle;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Set up colors for legend and bars
|
|
112
|
+
const rangeField = xFieldName;
|
|
113
|
+
const rangeConfig = {
|
|
114
|
+
[rangeField]: VISUALIZATION_COLORS
|
|
115
|
+
};
|
|
116
|
+
this.baseChartSpec.config.range = rangeConfig;
|
|
117
|
+
const spec = Object.assign(this.baseChartSpec, chartData);
|
|
118
|
+
this.visualizationSpec = spec;
|
|
119
|
+
}
|
|
120
|
+
componentWillLoad() {
|
|
121
|
+
trackComponent(this.root);
|
|
122
|
+
this.parseData();
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
return (h("gux-visualization-beta", { visualizationSpec: this.visualizationSpec }));
|
|
126
|
+
}
|
|
127
|
+
static get is() { return "gux-chart-column-beta"; }
|
|
128
|
+
static get encapsulation() { return "shadow"; }
|
|
129
|
+
static get originalStyleUrls() {
|
|
130
|
+
return {
|
|
131
|
+
"$": ["gux-chart-column.scss"]
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
static get styleUrls() {
|
|
135
|
+
return {
|
|
136
|
+
"$": ["gux-chart-column.css"]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
static get properties() {
|
|
140
|
+
return {
|
|
141
|
+
"chartData": {
|
|
142
|
+
"type": "unknown",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "Record<string, any>",
|
|
146
|
+
"resolved": "{ [x: string]: any; }",
|
|
147
|
+
"references": {
|
|
148
|
+
"Record": {
|
|
149
|
+
"location": "global",
|
|
150
|
+
"id": "global::Record"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "Data to be rendered in the chart.\nData field names must match the values you set in xFieldName and yFieldName"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"xTickLabelSlant": {
|
|
162
|
+
"type": "boolean",
|
|
163
|
+
"mutable": false,
|
|
164
|
+
"complexType": {
|
|
165
|
+
"original": "boolean",
|
|
166
|
+
"resolved": "boolean",
|
|
167
|
+
"references": {}
|
|
168
|
+
},
|
|
169
|
+
"required": false,
|
|
170
|
+
"optional": false,
|
|
171
|
+
"docs": {
|
|
172
|
+
"tags": [],
|
|
173
|
+
"text": "If true, then make Axis tick label 45 degrees"
|
|
174
|
+
},
|
|
175
|
+
"attribute": "x-tick-label-slant",
|
|
176
|
+
"reflect": false
|
|
177
|
+
},
|
|
178
|
+
"includeLegend": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"mutable": false,
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "boolean",
|
|
183
|
+
"resolved": "boolean",
|
|
184
|
+
"references": {}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": ""
|
|
191
|
+
},
|
|
192
|
+
"attribute": "include-legend",
|
|
193
|
+
"reflect": false
|
|
194
|
+
},
|
|
195
|
+
"xFieldName": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "string",
|
|
200
|
+
"resolved": "string",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Name for the data field to use to populate the chart's x-axis\ne.g. xFieldName of \"category\" will map any \"category\" fields in chartData to the x-axis"
|
|
208
|
+
},
|
|
209
|
+
"attribute": "x-field-name",
|
|
210
|
+
"reflect": false
|
|
211
|
+
},
|
|
212
|
+
"yFieldName": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"mutable": false,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "string",
|
|
217
|
+
"resolved": "string",
|
|
218
|
+
"references": {}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": false,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": "Name for the data field to use to populate the chart's x-axis\ne.g. yFieldName of \"value\" will map any \"value\" fields in chartData to the y-axis"
|
|
225
|
+
},
|
|
226
|
+
"attribute": "y-field-name",
|
|
227
|
+
"reflect": false
|
|
228
|
+
},
|
|
229
|
+
"xAxisTitle": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"mutable": false,
|
|
232
|
+
"complexType": {
|
|
233
|
+
"original": "string",
|
|
234
|
+
"resolved": "string",
|
|
235
|
+
"references": {}
|
|
236
|
+
},
|
|
237
|
+
"required": false,
|
|
238
|
+
"optional": false,
|
|
239
|
+
"docs": {
|
|
240
|
+
"tags": [],
|
|
241
|
+
"text": "Title to display along the x-axis"
|
|
242
|
+
},
|
|
243
|
+
"attribute": "x-axis-title",
|
|
244
|
+
"reflect": false
|
|
245
|
+
},
|
|
246
|
+
"yAxisTitle": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"mutable": false,
|
|
249
|
+
"complexType": {
|
|
250
|
+
"original": "string",
|
|
251
|
+
"resolved": "string",
|
|
252
|
+
"references": {}
|
|
253
|
+
},
|
|
254
|
+
"required": false,
|
|
255
|
+
"optional": false,
|
|
256
|
+
"docs": {
|
|
257
|
+
"tags": [],
|
|
258
|
+
"text": "Title to display along the y-axis"
|
|
259
|
+
},
|
|
260
|
+
"attribute": "y-axis-title",
|
|
261
|
+
"reflect": false
|
|
262
|
+
},
|
|
263
|
+
"legendTitle": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": false,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": "Title to display above the optional legend"
|
|
276
|
+
},
|
|
277
|
+
"attribute": "legend-title",
|
|
278
|
+
"reflect": false
|
|
279
|
+
},
|
|
280
|
+
"legendPosition": {
|
|
281
|
+
"type": "string",
|
|
282
|
+
"mutable": false,
|
|
283
|
+
"complexType": {
|
|
284
|
+
"original": "| 'left'\n | 'right'\n | 'top'\n | 'bottom'\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n | 'none'",
|
|
285
|
+
"resolved": "\"bottom\" | \"bottom-left\" | \"bottom-right\" | \"left\" | \"none\" | \"right\" | \"top\" | \"top-left\" | \"top-right\"",
|
|
286
|
+
"references": {}
|
|
287
|
+
},
|
|
288
|
+
"required": false,
|
|
289
|
+
"optional": false,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": ""
|
|
293
|
+
},
|
|
294
|
+
"attribute": "legend-position",
|
|
295
|
+
"reflect": false,
|
|
296
|
+
"defaultValue": "'right'"
|
|
297
|
+
},
|
|
298
|
+
"chartLayers": {
|
|
299
|
+
"type": "unknown",
|
|
300
|
+
"mutable": false,
|
|
301
|
+
"complexType": {
|
|
302
|
+
"original": "string[]",
|
|
303
|
+
"resolved": "string[]",
|
|
304
|
+
"references": {}
|
|
305
|
+
},
|
|
306
|
+
"required": false,
|
|
307
|
+
"optional": false,
|
|
308
|
+
"docs": {
|
|
309
|
+
"tags": [],
|
|
310
|
+
"text": "List specifying the order of optional chart layers.\nFor correct chart layering, each chartData entry must also include a \"series\" field with a value indicating which layer the entry belongs to, e.g 'series': 'group1'"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"embedOptions": {
|
|
314
|
+
"type": "unknown",
|
|
315
|
+
"mutable": false,
|
|
316
|
+
"complexType": {
|
|
317
|
+
"original": "EmbedOptions",
|
|
318
|
+
"resolved": "EmbedOptions<string, Renderers>",
|
|
319
|
+
"references": {
|
|
320
|
+
"EmbedOptions": {
|
|
321
|
+
"location": "import",
|
|
322
|
+
"path": "vega-embed",
|
|
323
|
+
"id": "../../node_modules/vega-embed/build/vega-embed.module.d.ts::EmbedOptions"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"required": false,
|
|
328
|
+
"optional": false,
|
|
329
|
+
"docs": {
|
|
330
|
+
"tags": [],
|
|
331
|
+
"text": ""
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
static get elementRef() { return "root"; }
|
|
337
|
+
static get watchers() {
|
|
338
|
+
return [{
|
|
339
|
+
"propName": "chartData",
|
|
340
|
+
"methodName": "parseData"
|
|
341
|
+
}];
|
|
342
|
+
}
|
|
343
|
+
}
|