@xplortech/apollo-data 0.0.5 → 0.0.7
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-4d3f0792.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-b7471c12.entry.js → p-e2c3a317.entry.js} +1 -1
- package/dist/cjs/apollo-data-bar-chart_5.cjs.entry.js +1193 -0
- package/dist/cjs/{apollo-data-base-CxVQ-WVP.js → apollo-data-base-COGMOEqL.js} +7 -11
- package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +3 -3
- package/dist/cjs/apollo-data.cjs.js +3 -3
- 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 +5 -2
- package/dist/collection/components/apollo-data-bar/apollo-data-bar.js +10 -9
- 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 +8 -6
- 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 +1 -1
- 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-world-map.examples.js +45 -0
- package/dist/collection/examples/index.js +2 -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.js +1 -1
- package/dist/components/apollo-data-scatter-chart.js +1 -1
- 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-CfbMSXKd.js +11 -0
- package/dist/components/p-gcjU8DVr.js +1 -0
- package/dist/esm/apollo-data-bar-chart_5.entry.js +1187 -0
- package/dist/esm/{apollo-data-base-BWkrM8dc.js → apollo-data-base-C2k3WBpi.js} +7 -11
- package/dist/esm/apollo-data-donut-chart.entry.js +3 -3
- package/dist/esm/apollo-data.js +4 -4
- 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.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +1 -3
- 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 +128 -8
- package/dist/types/examples/apollo-data-heat-map.examples.d.ts +11 -0
- package/dist/types/examples/apollo-data-scatter.examples.d.ts +1 -1
- package/dist/types/examples/apollo-data-world-map.examples.d.ts +11 -0
- package/dist/types/examples/index.d.ts +2 -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 +91 -91
- package/src/examples/apollo-data-scatter.examples.ts +1 -1
- package/src/examples/apollo-data-world-map.examples.ts +57 -0
- package/src/examples/index.ts +3 -1
- package/dist/apollo-data/p-2nuV5Vny.js +0 -1
- package/dist/apollo-data/p-4ac3c97c.entry.js +0 -1
- package/dist/apollo-data/p-BWkrM8dc.js +0 -11
- package/dist/apollo-data/p-Bb2nY-Tf.js +0 -2
- package/dist/apollo-data/p-e518baac.entry.js +0 -1
- package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +0 -314
- package/dist/cjs/apollo-data-line-chart_2.cjs.entry.js +0 -534
- package/dist/cjs/constants-B3weDEpc.js +0 -5
- package/dist/components/p-7XF5Cax8.js +0 -11
- package/dist/components/p-Dws5s-Xe.js +0 -1
- package/dist/esm/apollo-data-bar-chart.entry.js +0 -312
- package/dist/esm/apollo-data-line-chart_2.entry.js +0 -531
- package/dist/esm/constants-2nuV5Vny.js +0 -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
|
+
];
|