@xplortech/apollo-data 0.0.4 → 0.0.6
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/README.md +15 -91
- package/dist/apollo-data/apollo-data.esm.js +1 -1
- package/dist/apollo-data/p-25841a73.entry.js +1 -0
- package/dist/apollo-data/p-2nuV5Vny.js +1 -0
- package/dist/apollo-data/p-839050b7.entry.js +1 -0
- package/dist/apollo-data/p-C2k3WBpi.js +11 -0
- package/dist/apollo-data/p-D64asVrg.js +2 -0
- package/dist/apollo-data/p-e2c3a317.entry.js +1 -0
- package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +315 -0
- package/dist/{esm/apollo-data-bar-chart_2.entry.js → cjs/apollo-data-base-COGMOEqL.js} +9 -724
- package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +408 -0
- package/dist/cjs/apollo-data-heat-map_4.cjs.entry.js +883 -0
- package/dist/cjs/apollo-data.cjs.js +3 -3
- package/dist/cjs/constants-B3weDEpc.js +5 -0
- package/dist/cjs/{index-Cl7HgRm0.js → index-Bd5risOy.js} +116 -63
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/apollo-data-base.js +4 -8
- package/dist/collection/collection-manifest.json +7 -2
- package/dist/collection/components/apollo-data-bar/apollo-data-bar.js +8 -7
- package/dist/collection/components/apollo-data-bar/apollo-data-bar.stories.js +122 -0
- package/dist/collection/components/apollo-data-donut/apollo-data-donut.js +1 -1
- package/dist/collection/components/apollo-data-donut/apollo-data-donut.stories.js +132 -0
- package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.js +208 -0
- package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.stories.js +137 -0
- package/dist/collection/components/apollo-data-line/apollo-data-line.js +348 -0
- package/dist/collection/components/apollo-data-line/apollo-data-line.stories.js +122 -0
- package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.js +329 -0
- package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.stories.js +147 -0
- package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.js +294 -0
- package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.stories.js +126 -0
- package/dist/collection/examples/apollo-data-heat-map.examples.js +131 -0
- package/dist/collection/examples/apollo-data-line.examples.js +91 -0
- package/dist/collection/examples/apollo-data-scatter.examples.js +94 -0
- package/dist/collection/examples/apollo-data-world-map.examples.js +45 -0
- package/dist/collection/examples/index.js +3 -0
- package/dist/collection/utils/code-generator.js +1 -1
- package/dist/components/apollo-data-bar-chart.js +1 -1
- package/dist/components/apollo-data-donut-chart.js +1 -1
- package/dist/components/apollo-data-heat-map.d.ts +11 -0
- package/dist/components/apollo-data-heat-map.js +1 -0
- package/dist/components/apollo-data-line-chart.d.ts +11 -0
- package/dist/components/apollo-data-line-chart.js +1 -0
- package/dist/components/apollo-data-scatter-chart.d.ts +11 -0
- package/dist/components/apollo-data-scatter-chart.js +1 -0
- package/dist/components/apollo-data-world-map-chart.d.ts +11 -0
- package/dist/components/apollo-data-world-map-chart.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-2nuV5Vny.js +1 -0
- package/dist/components/p-CfbMSXKd.js +11 -0
- package/dist/components/p-gcjU8DVr.js +1 -0
- package/dist/esm/apollo-data-bar-chart.entry.js +313 -0
- package/dist/{cjs/apollo-data-bar-chart_2.cjs.entry.js → esm/apollo-data-base-C2k3WBpi.js} +8 -728
- package/dist/esm/apollo-data-donut-chart.entry.js +406 -0
- package/dist/esm/apollo-data-heat-map_4.entry.js +878 -0
- package/dist/esm/apollo-data.js +4 -4
- package/dist/esm/constants-2nuV5Vny.js +3 -0
- package/dist/esm/{index-Bb2nY-Tf.js → index-D64asVrg.js} +116 -63
- package/dist/esm/loader.js +3 -3
- package/dist/types/apollo-data-base.d.ts +2 -2
- package/dist/types/components/apollo-data-bar/apollo-data-bar.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-donut/apollo-data-donut.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.d.ts +140 -0
- package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-line/apollo-data-line.d.ts +244 -0
- package/dist/types/components/apollo-data-line/apollo-data-line.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +327 -0
- package/dist/types/components/apollo-data-scatter/apollo-data-scatter.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-world-map/apollo-data-world-map.d.ts +281 -0
- package/dist/types/components/apollo-data-world-map/apollo-data-world-map.stories.d.ts +5 -0
- package/dist/types/components.d.ts +210 -4
- package/dist/types/examples/apollo-data-heat-map.examples.d.ts +11 -0
- package/dist/types/examples/apollo-data-line.examples.d.ts +12 -0
- package/dist/types/examples/apollo-data-scatter.examples.d.ts +11 -0
- package/dist/types/examples/apollo-data-world-map.examples.d.ts +11 -0
- package/dist/types/examples/index.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +23 -2
- package/dist/types/utils/code-generator.d.ts +1 -3
- package/package.json +8 -8
- package/src/examples/apollo-data-bar.examples.ts +157 -157
- package/src/examples/apollo-data-heat-map.examples.ts +147 -0
- package/src/examples/apollo-data-line.examples.ts +103 -0
- package/src/examples/apollo-data-scatter.examples.ts +109 -0
- package/src/examples/apollo-data-world-map.examples.ts +57 -0
- package/src/examples/index.ts +4 -1
- package/dist/apollo-data/p-Bb2nY-Tf.js +0 -2
- package/dist/apollo-data/p-e6584598.entry.js +0 -11
- package/dist/components/p-7XF5Cax8.js +0 -11
- package/dist/components/p-Dws5s-Xe.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xplortech/apollo-data",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Apollo Data",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -64,21 +64,21 @@
|
|
|
64
64
|
"start": "stencil build --dev --watch --serve",
|
|
65
65
|
"test": "stencil test --spec --e2e",
|
|
66
66
|
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
67
|
-
"generate": "stencil generate"
|
|
67
|
+
"generate": "stencil generate",
|
|
68
|
+
"lint:js": "prettier --check \"src/**/*.{js,ts,json,md}\"",
|
|
69
|
+
"lint:css": "stylelint 'src/**/*.css'",
|
|
70
|
+
"lint:ts": "eslint \"src/**/*.{ts,tsx}\" --ignore-pattern 'src/components/**/test/**' --no-warn-ignored",
|
|
71
|
+
"lint": "npm-run-all lint:ts lint:css lint:js",
|
|
72
|
+
"format": "npm run lint:ts -- --fix && npm run lint:css -- --fix && prettier --write \"src/**/*.{js,ts,json,md}\""
|
|
68
73
|
},
|
|
69
74
|
"devDependencies": {
|
|
70
|
-
"@kesills/eslint-config-airbnb-typescript": "^20.0.0",
|
|
71
75
|
"@stencil/core": "^4.38.2",
|
|
72
76
|
"@stencil/react-output-target": "^1.2.0",
|
|
73
77
|
"@stencil/vue-output-target": "^0.11.8",
|
|
74
78
|
"@testing-library/dom": "^10.4.0",
|
|
75
79
|
"@testing-library/jest-dom": "^6.6.3",
|
|
76
|
-
"eslint": "^8.57.1",
|
|
77
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
78
|
-
"eslint-config-prettier": "^10.1.1",
|
|
79
|
-
"eslint-plugin-prettier": "^5.2.5",
|
|
80
|
-
"eslint-plugin-testing-library": "^7.1.1",
|
|
81
80
|
"happy-dom": "^17.4.4",
|
|
81
|
+
"lit-html": "^3.3.2",
|
|
82
82
|
"npm-run-all": "^4.1.5",
|
|
83
83
|
"prettier": "^3.5.3",
|
|
84
84
|
"typescript": "^5.5.3",
|
|
@@ -1,172 +1,172 @@
|
|
|
1
1
|
import { BarDataItem, BarSpec } from '../components/apollo-data-bar/apollo-data-bar';
|
|
2
2
|
|
|
3
3
|
export interface BarExample {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
props: {
|
|
7
|
+
adData: BarDataItem[];
|
|
8
|
+
adSpec?: BarSpec;
|
|
9
|
+
};
|
|
10
|
+
notes?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/** periodId should be a date string (YYYY-MM-DD) representing the period. */
|
|
14
14
|
export const barExamples: BarExample[] = [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Revenue and Expenses by Day',
|
|
17
|
+
description: 'A stacked bar chart showing daily revenue and expenses over a week',
|
|
18
|
+
props: {
|
|
19
|
+
adData: [
|
|
20
|
+
{ label: 'Mon', category: 'Revenue', value: 5000, periodId: '2024-01-01' },
|
|
21
|
+
{ label: 'Mon', category: 'Expenses', value: 2000, periodId: '2024-01-01' },
|
|
22
|
+
{ label: 'Tue', category: 'Revenue', value: 6000, periodId: '2024-01-02' },
|
|
23
|
+
{ label: 'Tue', category: 'Expenses', value: 2500, periodId: '2024-01-02' },
|
|
24
|
+
{ label: 'Wed', category: 'Revenue', value: 5500, periodId: '2024-01-03' },
|
|
25
|
+
{ label: 'Wed', category: 'Expenses', value: 2200, periodId: '2024-01-03' },
|
|
26
|
+
{ label: 'Thu', category: 'Revenue', value: 7000, periodId: '2024-01-04' },
|
|
27
|
+
{ label: 'Thu', category: 'Expenses', value: 3000, periodId: '2024-01-04' },
|
|
28
|
+
{ label: 'Fri', category: 'Revenue', value: 6500, periodId: '2024-01-05' },
|
|
29
|
+
{ label: 'Fri', category: 'Expenses', value: 2800, periodId: '2024-01-05' },
|
|
30
|
+
],
|
|
31
|
+
adSpec: {
|
|
32
|
+
tooltipPrefix: '$',
|
|
33
|
+
currencySymbol: '$',
|
|
34
|
+
yAxisTitle: 'Amount',
|
|
35
|
+
colorSet: ['#FF8DF4', '#74FBD0'],
|
|
36
|
+
},
|
|
38
37
|
},
|
|
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
|
-
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Monthly Sales by Product',
|
|
41
|
+
description: 'Stacked bar chart showing sales across multiple products by month',
|
|
42
|
+
props: {
|
|
43
|
+
adData: [
|
|
44
|
+
{ label: 'Jan', category: 'Product A', value: 12000, periodId: '2024-01-01' },
|
|
45
|
+
{ label: 'Jan', category: 'Product B', value: 8000, periodId: '2024-01-01' },
|
|
46
|
+
{ label: 'Jan', category: 'Product C', value: 6000, periodId: '2024-01-01' },
|
|
47
|
+
{ label: 'Feb', category: 'Product A', value: 15000, periodId: '2024-02-01' },
|
|
48
|
+
{ label: 'Feb', category: 'Product B', value: 9000, periodId: '2024-02-01' },
|
|
49
|
+
{ label: 'Feb', category: 'Product C', value: 7000, periodId: '2024-02-01' },
|
|
50
|
+
{ label: 'Mar', category: 'Product A', value: 13000, periodId: '2024-03-01' },
|
|
51
|
+
{ label: 'Mar', category: 'Product B', value: 10000, periodId: '2024-03-01' },
|
|
52
|
+
{ label: 'Mar', category: 'Product C', value: 5500, periodId: '2024-03-01' },
|
|
53
|
+
{ label: 'Apr', category: 'Product A', value: 14000, periodId: '2024-04-01' },
|
|
54
|
+
{ label: 'Apr', category: 'Product B', value: 9500, periodId: '2024-04-01' },
|
|
55
|
+
{ label: 'Apr', category: 'Product C', value: 6500, periodId: '2024-04-01' },
|
|
56
|
+
],
|
|
57
|
+
adSpec: {
|
|
58
|
+
tooltipPrefix: '$',
|
|
59
|
+
currencySymbol: '$',
|
|
60
|
+
yAxisTitle: 'Monthly Sales',
|
|
61
|
+
colorSet: ['#FF8DF4', '#74FBD0', '#ECFD91'],
|
|
62
|
+
},
|
|
64
63
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'Weekly Revenue by Category',
|
|
67
|
+
description: 'Stacked bar chart showing revenue across Sales, Marketing, and Product',
|
|
68
|
+
props: {
|
|
69
|
+
adData: [
|
|
70
|
+
{ label: 'W1', category: 'Sales', value: 3500, periodId: '2024-01-01' },
|
|
71
|
+
{ label: 'W1', category: 'Marketing', value: 2200, periodId: '2024-01-01' },
|
|
72
|
+
{ label: 'W1', category: 'Product A', value: 1800, periodId: '2024-01-01' },
|
|
73
|
+
{ label: 'W2', category: 'Sales', value: 4200, periodId: '2024-01-08' },
|
|
74
|
+
{ label: 'W2', category: 'Marketing', value: 2800, periodId: '2024-01-08' },
|
|
75
|
+
{ label: 'W2', category: 'Product A', value: 2000, periodId: '2024-01-08' },
|
|
76
|
+
{ label: 'W3', category: 'Sales', value: 3800, periodId: '2024-01-15' },
|
|
77
|
+
{ label: 'W3', category: 'Marketing', value: 2500, periodId: '2024-01-15' },
|
|
78
|
+
{ label: 'W3', category: 'Product A', value: 1900, periodId: '2024-01-15' },
|
|
79
|
+
],
|
|
80
|
+
adSpec: {
|
|
81
|
+
tooltipPrefix: '$',
|
|
82
|
+
currencySymbol: '$',
|
|
83
|
+
yAxisTitle: 'Weekly Revenue',
|
|
84
|
+
},
|
|
86
85
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Yearly Regional Revenue',
|
|
89
|
+
description: 'Stacked bar chart showing revenue across regions by year',
|
|
90
|
+
props: {
|
|
91
|
+
adData: [
|
|
92
|
+
{ label: '2019', category: 'North America', value: 450000, periodId: '2019-01-01' },
|
|
93
|
+
{ label: '2019', category: 'Europe', value: 320000, periodId: '2019-01-01' },
|
|
94
|
+
{ label: '2019', category: 'Asia Pacific', value: 280000, periodId: '2019-01-01' },
|
|
95
|
+
{ label: '2020', category: 'North America', value: 380000, periodId: '2020-01-01' },
|
|
96
|
+
{ label: '2020', category: 'Europe', value: 290000, periodId: '2020-01-01' },
|
|
97
|
+
{ label: '2020', category: 'Asia Pacific', value: 310000, periodId: '2020-01-01' },
|
|
98
|
+
{ label: '2021', category: 'North America', value: 520000, periodId: '2021-01-01' },
|
|
99
|
+
{ label: '2021', category: 'Europe', value: 410000, periodId: '2021-01-01' },
|
|
100
|
+
{ label: '2021', category: 'Asia Pacific', value: 450000, periodId: '2021-01-01' },
|
|
101
|
+
{ label: '2022', category: 'North America', value: 580000, periodId: '2022-01-01' },
|
|
102
|
+
{ label: '2022', category: 'Europe', value: 460000, periodId: '2022-01-01' },
|
|
103
|
+
{ label: '2022', category: 'Asia Pacific', value: 520000, periodId: '2022-01-01' },
|
|
104
|
+
],
|
|
105
|
+
adSpec: {
|
|
106
|
+
tooltipPrefix: '$',
|
|
107
|
+
currencySymbol: '$',
|
|
108
|
+
yAxisTitle: 'Regional Revenue',
|
|
109
|
+
colorSet: ['#4d1ab2', '#f99170', '#e550c8'],
|
|
110
|
+
},
|
|
112
111
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'Order Counts by Channel',
|
|
115
|
+
description: 'Bar chart showing order counts by channel without currency formatting',
|
|
116
|
+
props: {
|
|
117
|
+
adData: [
|
|
118
|
+
{ label: 'Mon', category: 'Website', value: 1250, periodId: '2024-05-01' },
|
|
119
|
+
{ label: 'Mon', category: 'Mobile App', value: 890, periodId: '2024-05-01' },
|
|
120
|
+
{ label: 'Mon', category: 'In-Store', value: 450, periodId: '2024-05-01' },
|
|
121
|
+
{ label: 'Tue', category: 'Website', value: 1380, periodId: '2024-05-02' },
|
|
122
|
+
{ label: 'Tue', category: 'Mobile App', value: 920, periodId: '2024-05-02' },
|
|
123
|
+
{ label: 'Tue', category: 'In-Store', value: 480, periodId: '2024-05-02' },
|
|
124
|
+
{ label: 'Wed', category: 'Website', value: 1150, periodId: '2024-05-03' },
|
|
125
|
+
{ label: 'Wed', category: 'Mobile App', value: 850, periodId: '2024-05-03' },
|
|
126
|
+
{ label: 'Wed', category: 'In-Store', value: 420, periodId: '2024-05-03' },
|
|
127
|
+
],
|
|
128
|
+
adSpec: {
|
|
129
|
+
yAxisTitle: 'Order Count',
|
|
130
|
+
colorSet: ['#8857fa', '#52ebba', '#31cff8'],
|
|
131
|
+
},
|
|
133
132
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'Single Category',
|
|
136
|
+
description: 'Bar chart with a single category showing visitor counts by day',
|
|
137
|
+
props: {
|
|
138
|
+
adData: [
|
|
139
|
+
{ label: 'Mon', category: 'Visitors', value: 2450, periodId: '2024-04-01' },
|
|
140
|
+
{ label: 'Tue', category: 'Visitors', value: 2680, periodId: '2024-04-02' },
|
|
141
|
+
{ label: 'Wed', category: 'Visitors', value: 2320, periodId: '2024-04-03' },
|
|
142
|
+
{ label: 'Thu', category: 'Visitors', value: 2890, periodId: '2024-04-04' },
|
|
143
|
+
{ label: 'Fri', category: 'Visitors', value: 3150, periodId: '2024-04-05' },
|
|
144
|
+
{ label: 'Sat', category: 'Visitors', value: 3420, periodId: '2024-04-06' },
|
|
145
|
+
{ label: 'Sun', category: 'Visitors', value: 3280, periodId: '2024-04-07' },
|
|
146
|
+
],
|
|
147
|
+
adSpec: {
|
|
148
|
+
yAxisTitle: 'Daily Visitors',
|
|
149
|
+
colorSet: ['#6366f1'],
|
|
150
|
+
},
|
|
152
151
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'Custom Axis Titles',
|
|
155
|
+
description: 'Chart with custom x-axis and y-axis titles via xAxisTitle and yAxisTitle',
|
|
156
|
+
props: {
|
|
157
|
+
adData: [
|
|
158
|
+
{ label: 'Mon', category: 'Inbound', value: 120, periodId: '2024-06-01' },
|
|
159
|
+
{ label: 'Mon', category: 'Outbound', value: 80, periodId: '2024-06-01' },
|
|
160
|
+
{ label: 'Tue', category: 'Inbound', value: 95, periodId: '2024-06-02' },
|
|
161
|
+
{ label: 'Tue', category: 'Outbound', value: 110, periodId: '2024-06-02' },
|
|
162
|
+
{ label: 'Wed', category: 'Inbound', value: 130, periodId: '2024-06-03' },
|
|
163
|
+
{ label: 'Wed', category: 'Outbound', value: 70, periodId: '2024-06-03' },
|
|
164
|
+
],
|
|
165
|
+
adSpec: {
|
|
166
|
+
yAxisTitle: 'Calls',
|
|
167
|
+
xAxisTitle: 'Support queue (by day)',
|
|
168
|
+
colorSet: ['#4d1ab2', '#f99170'],
|
|
169
|
+
},
|
|
171
170
|
},
|
|
171
|
+
},
|
|
172
172
|
];
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { HeatMapDataItem, HeatMapSpec } from '../components/apollo-data-heat-map/apollo-data-heat-map';
|
|
2
|
+
|
|
3
|
+
export interface HeatMapExamples {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
props: {
|
|
7
|
+
adData: HeatMapDataItem[];
|
|
8
|
+
adSpec?: HeatMapSpec;
|
|
9
|
+
};
|
|
10
|
+
notes?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Average high temperature (°F) by day of month and month – weather heat map. */
|
|
14
|
+
const weatherDayVsMonth: HeatMapDataItem[] = (() => {
|
|
15
|
+
const days = ['1', '5', '10', '15', '20', '25', '30'];
|
|
16
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
17
|
+
// Base avg high °F by month (mid-latitude style), with slight variation by day-in-month
|
|
18
|
+
const baseByMonth = [42, 45, 54, 64, 74, 82, 87, 85, 78, 66, 54, 44];
|
|
19
|
+
const items: HeatMapDataItem[] = [];
|
|
20
|
+
days.forEach((day, i) => {
|
|
21
|
+
months.forEach((month, j) => {
|
|
22
|
+
const base = baseByMonth[j];
|
|
23
|
+
const dayOffset = (i - 3) * 2; // slightly warmer in middle of month
|
|
24
|
+
items.push({ xLabel: month, yLabel: `Day ${day}`, value: Math.round(base + dayOffset) });
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return items;
|
|
28
|
+
})();
|
|
29
|
+
|
|
30
|
+
/** Quarterly revenue (K) by region – typical sales dashboard. */
|
|
31
|
+
const salesByRegionQuarter: HeatMapDataItem[] = [
|
|
32
|
+
{ xLabel: 'Q1', yLabel: 'North', value: 142 },
|
|
33
|
+
{ xLabel: 'Q2', yLabel: 'North', value: 168 },
|
|
34
|
+
{ xLabel: 'Q3', yLabel: 'North', value: 195 },
|
|
35
|
+
{ xLabel: 'Q4', yLabel: 'North', value: 218 },
|
|
36
|
+
{ xLabel: 'Q1', yLabel: 'South', value: 98 },
|
|
37
|
+
{ xLabel: 'Q2', yLabel: 'South', value: 112 },
|
|
38
|
+
{ xLabel: 'Q3', yLabel: 'South', value: 134 },
|
|
39
|
+
{ xLabel: 'Q4', yLabel: 'South', value: 156 },
|
|
40
|
+
{ xLabel: 'Q1', yLabel: 'East', value: 187 },
|
|
41
|
+
{ xLabel: 'Q2', yLabel: 'East', value: 203 },
|
|
42
|
+
{ xLabel: 'Q3', yLabel: 'East', value: 221 },
|
|
43
|
+
{ xLabel: 'Q4', yLabel: 'East', value: 245 },
|
|
44
|
+
{ xLabel: 'Q1', yLabel: 'West', value: 76 },
|
|
45
|
+
{ xLabel: 'Q2', yLabel: 'West', value: 89 },
|
|
46
|
+
{ xLabel: 'Q3', yLabel: 'West', value: 102 },
|
|
47
|
+
{ xLabel: 'Q4', yLabel: 'West', value: 118 },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/** Support tickets by product and month. */
|
|
51
|
+
const supportTicketsByProductMonth: HeatMapDataItem[] = [
|
|
52
|
+
{ xLabel: 'Jan', yLabel: 'Billing', value: 124 },
|
|
53
|
+
{ xLabel: 'Feb', yLabel: 'Billing', value: 98 },
|
|
54
|
+
{ xLabel: 'Mar', yLabel: 'Billing', value: 156 },
|
|
55
|
+
{ xLabel: 'Apr', yLabel: 'Billing', value: 87 },
|
|
56
|
+
{ xLabel: 'May', yLabel: 'Billing', value: 112 },
|
|
57
|
+
{ xLabel: 'Jun', yLabel: 'Billing', value: 134 },
|
|
58
|
+
{ xLabel: 'Jan', yLabel: 'Onboarding', value: 89 },
|
|
59
|
+
{ xLabel: 'Feb', yLabel: 'Onboarding', value: 102 },
|
|
60
|
+
{ xLabel: 'Mar', yLabel: 'Onboarding', value: 145 },
|
|
61
|
+
{ xLabel: 'Apr', yLabel: 'Onboarding', value: 78 },
|
|
62
|
+
{ xLabel: 'May', yLabel: 'Onboarding', value: 91 },
|
|
63
|
+
{ xLabel: 'Jun', yLabel: 'Onboarding', value: 67 },
|
|
64
|
+
{ xLabel: 'Jan', yLabel: 'API', value: 45 },
|
|
65
|
+
{ xLabel: 'Feb', yLabel: 'API', value: 52 },
|
|
66
|
+
{ xLabel: 'Mar', yLabel: 'API', value: 61 },
|
|
67
|
+
{ xLabel: 'Apr', yLabel: 'API', value: 38 },
|
|
68
|
+
{ xLabel: 'May', yLabel: 'API', value: 49 },
|
|
69
|
+
{ xLabel: 'Jun', yLabel: 'API', value: 55 },
|
|
70
|
+
{ xLabel: 'Jan', yLabel: 'Mobile App', value: 203 },
|
|
71
|
+
{ xLabel: 'Feb', yLabel: 'Mobile App', value: 187 },
|
|
72
|
+
{ xLabel: 'Mar', yLabel: 'Mobile App', value: 221 },
|
|
73
|
+
{ xLabel: 'Apr', yLabel: 'Mobile App', value: 198 },
|
|
74
|
+
{ xLabel: 'May', yLabel: 'Mobile App', value: 234 },
|
|
75
|
+
{ xLabel: 'Jun', yLabel: 'Mobile App', value: 256 },
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
/** Average response time (ms) by service and environment. */
|
|
79
|
+
const responseTimeByServiceEnv: HeatMapDataItem[] = [
|
|
80
|
+
{ xLabel: 'Staging', yLabel: 'Auth', value: 42 },
|
|
81
|
+
{ xLabel: 'Production', yLabel: 'Auth', value: 38 },
|
|
82
|
+
{ xLabel: 'Staging', yLabel: 'Payments', value: 128 },
|
|
83
|
+
{ xLabel: 'Production', yLabel: 'Payments', value: 95 },
|
|
84
|
+
{ xLabel: 'Staging', yLabel: 'Search', value: 215 },
|
|
85
|
+
{ xLabel: 'Production', yLabel: 'Search', value: 178 },
|
|
86
|
+
{ xLabel: 'Staging', yLabel: 'Notifications', value: 56 },
|
|
87
|
+
{ xLabel: 'Production', yLabel: 'Notifications', value: 48 },
|
|
88
|
+
{ xLabel: 'Staging', yLabel: 'Reporting', value: 890 },
|
|
89
|
+
{ xLabel: 'Production', yLabel: 'Reporting', value: 720 },
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
export const heatMapExamples: HeatMapExamples[] = [
|
|
93
|
+
{
|
|
94
|
+
name: 'Weather: day vs month',
|
|
95
|
+
description: 'Average high temperature (°F) by day of month and month.',
|
|
96
|
+
props: {
|
|
97
|
+
adData: weatherDayVsMonth,
|
|
98
|
+
adSpec: {
|
|
99
|
+
xAxisTitle: 'Month',
|
|
100
|
+
yAxisTitle: 'Day of month',
|
|
101
|
+
colorRange: ['#2166ac', '#b2182b'],
|
|
102
|
+
tooltip: 'auto',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
notes: 'Cool (blue) to warm (red) temperature scale; diverging style.',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'Sales by region and quarter',
|
|
109
|
+
description: 'Quarterly revenue (K) by region – typical sales or revenue dashboard.',
|
|
110
|
+
props: {
|
|
111
|
+
adData: salesByRegionQuarter,
|
|
112
|
+
adSpec: {
|
|
113
|
+
xAxisTitle: 'Quarter',
|
|
114
|
+
yAxisTitle: 'Region',
|
|
115
|
+
tooltip: 'auto',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
notes: 'Useful for regional performance and seasonality.',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'Support tickets by product and month',
|
|
122
|
+
description: 'Monthly support ticket volume by product area.',
|
|
123
|
+
props: {
|
|
124
|
+
adData: supportTicketsByProductMonth,
|
|
125
|
+
adSpec: {
|
|
126
|
+
xAxisTitle: 'Month',
|
|
127
|
+
yAxisTitle: 'Product',
|
|
128
|
+
tooltip: 'auto',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
notes: 'Helps spot spikes by product and time.',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'API response time by service and environment',
|
|
135
|
+
description: 'Average response time (ms) by service and environment (green = fast, red = slow).',
|
|
136
|
+
props: {
|
|
137
|
+
adData: responseTimeByServiceEnv,
|
|
138
|
+
adSpec: {
|
|
139
|
+
xAxisTitle: 'Environment',
|
|
140
|
+
yAxisTitle: 'Service',
|
|
141
|
+
colorRange: ['#2ecc71', '#e74c3c'],
|
|
142
|
+
tooltip: 'auto',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
notes: 'Green–red scale for performance; lower is better.',
|
|
146
|
+
},
|
|
147
|
+
];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { LineDataItem, LineSpec } from '../components/apollo-data-line/apollo-data-line';
|
|
2
|
+
|
|
3
|
+
export interface LineExample {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
props: {
|
|
7
|
+
adData: LineDataItem[];
|
|
8
|
+
adSpec?: LineSpec;
|
|
9
|
+
};
|
|
10
|
+
notes?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Each item has category, xValue, yValue, and optional xLabel/yLabel. When labels are omitted, numeric values are shown. */
|
|
14
|
+
export const lineExamples: LineExample[] = [
|
|
15
|
+
{
|
|
16
|
+
name: 'Revenue and Expenses by Day',
|
|
17
|
+
description: 'Line chart showing daily revenue and expenses over a week',
|
|
18
|
+
props: {
|
|
19
|
+
adData: [
|
|
20
|
+
{ category: 'Revenue', xValue: 1, yValue: 5000, xLabel: 'Mon' },
|
|
21
|
+
{ category: 'Expenses', xValue: 1, yValue: 2000, xLabel: 'Mon' },
|
|
22
|
+
{ category: 'Revenue', xValue: 2, yValue: 6000, xLabel: 'Tue' },
|
|
23
|
+
{ category: 'Expenses', xValue: 2, yValue: 2500, xLabel: 'Tue' },
|
|
24
|
+
{ category: 'Revenue', xValue: 3, yValue: 5500, xLabel: 'Wed' },
|
|
25
|
+
{ category: 'Expenses', xValue: 3, yValue: 2200, xLabel: 'Wed' },
|
|
26
|
+
{ category: 'Revenue', xValue: 4, yValue: 7000, xLabel: 'Thu' },
|
|
27
|
+
{ category: 'Expenses', xValue: 4, yValue: 3000, xLabel: 'Thu' },
|
|
28
|
+
{ category: 'Revenue', xValue: 5, yValue: 6500, xLabel: 'Fri' },
|
|
29
|
+
{ category: 'Expenses', xValue: 5, yValue: 2800, xLabel: 'Fri' },
|
|
30
|
+
],
|
|
31
|
+
adSpec: {
|
|
32
|
+
tooltipPrefix: '$',
|
|
33
|
+
currencySymbol: '$',
|
|
34
|
+
yAxisTitle: 'Amount',
|
|
35
|
+
colorSet: ['#FF8DF4', '#74FBD0'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Monthly Sales by Product',
|
|
41
|
+
description: 'Multi-line chart showing sales across products by month',
|
|
42
|
+
props: {
|
|
43
|
+
adData: [
|
|
44
|
+
{ category: 'Product A', xValue: 1, yValue: 12000, xLabel: 'Jan' },
|
|
45
|
+
{ category: 'Product B', xValue: 1, yValue: 8000, xLabel: 'Jan' },
|
|
46
|
+
{ category: 'Product C', xValue: 1, yValue: 6000, xLabel: 'Jan' },
|
|
47
|
+
{ category: 'Product A', xValue: 2, yValue: 15000, xLabel: 'Feb' },
|
|
48
|
+
{ category: 'Product B', xValue: 2, yValue: 9000, xLabel: 'Feb' },
|
|
49
|
+
{ category: 'Product C', xValue: 2, yValue: 7000, xLabel: 'Feb' },
|
|
50
|
+
{ category: 'Product A', xValue: 3, yValue: 13000, xLabel: 'Mar' },
|
|
51
|
+
{ category: 'Product B', xValue: 3, yValue: 10000, xLabel: 'Mar' },
|
|
52
|
+
{ category: 'Product C', xValue: 3, yValue: 5500, xLabel: 'Mar' },
|
|
53
|
+
{ category: 'Product A', xValue: 4, yValue: 14000, xLabel: 'Apr' },
|
|
54
|
+
{ category: 'Product B', xValue: 4, yValue: 9500, xLabel: 'Apr' },
|
|
55
|
+
{ category: 'Product C', xValue: 4, yValue: 6500, xLabel: 'Apr' },
|
|
56
|
+
],
|
|
57
|
+
adSpec: {
|
|
58
|
+
tooltipPrefix: '$',
|
|
59
|
+
currencySymbol: '$',
|
|
60
|
+
yAxisTitle: 'Monthly Sales',
|
|
61
|
+
colorSet: ['#FF8DF4', '#74FBD0', '#ECFD91'],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'Single Series',
|
|
67
|
+
description: 'Line chart with one category (visitors over time)',
|
|
68
|
+
props: {
|
|
69
|
+
adData: [
|
|
70
|
+
{ category: 'Visitors', xValue: 1, yValue: 2450, xLabel: 'Mon' },
|
|
71
|
+
{ category: 'Visitors', xValue: 2, yValue: 2680, xLabel: 'Tue' },
|
|
72
|
+
{ category: 'Visitors', xValue: 3, yValue: 2320, xLabel: 'Wed' },
|
|
73
|
+
{ category: 'Visitors', xValue: 4, yValue: 2890, xLabel: 'Thu' },
|
|
74
|
+
{ category: 'Visitors', xValue: 5, yValue: 3150, xLabel: 'Fri' },
|
|
75
|
+
{ category: 'Visitors', xValue: 6, yValue: 3420, xLabel: 'Sat' },
|
|
76
|
+
{ category: 'Visitors', xValue: 7, yValue: 3280, xLabel: 'Sun' },
|
|
77
|
+
],
|
|
78
|
+
adSpec: {
|
|
79
|
+
yAxisTitle: 'Daily Visitors',
|
|
80
|
+
colorSet: ['#6366f1'],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Custom Axis Titles',
|
|
86
|
+
description: 'Line chart with custom x-axis and y-axis titles',
|
|
87
|
+
props: {
|
|
88
|
+
adData: [
|
|
89
|
+
{ category: 'Inbound', xValue: 1, yValue: 120, xLabel: 'Mon' },
|
|
90
|
+
{ category: 'Outbound', xValue: 1, yValue: 80, xLabel: 'Mon' },
|
|
91
|
+
{ category: 'Inbound', xValue: 2, yValue: 95, xLabel: 'Tue' },
|
|
92
|
+
{ category: 'Outbound', xValue: 2, yValue: 110, xLabel: 'Tue' },
|
|
93
|
+
{ category: 'Inbound', xValue: 3, yValue: 130, xLabel: 'Wed' },
|
|
94
|
+
{ category: 'Outbound', xValue: 3, yValue: 70, xLabel: 'Wed' },
|
|
95
|
+
],
|
|
96
|
+
adSpec: {
|
|
97
|
+
yAxisTitle: 'Calls',
|
|
98
|
+
xAxisTitle: 'Support queue (by day)',
|
|
99
|
+
colorSet: ['#4d1ab2', '#f99170'],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
];
|