@genspectrum/dashboard-components 0.6.18 → 0.6.19
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 +5 -12
- package/custom-elements.json +4 -4
- package/dist/assets/mutationOverTimeWorker-BdzqDqvO.js.map +1 -0
- package/dist/dashboard-components.js +216 -214
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +40 -40
- package/dist/style.css +3 -2
- package/package.json +13 -2
- package/src/operator/FetchInsertionsOperator.ts +2 -2
- package/src/operator/FetchSubstitutionsOrDeletionsOperator.ts +3 -3
- package/src/preact/mutationComparison/fetchMutationData.spec.ts +3 -3
- package/src/preact/mutationComparison/getMutationComparisonTableData.spec.ts +11 -11
- package/src/preact/mutationComparison/getMutationComparisonTableData.ts +4 -4
- package/src/preact/mutationComparison/mutation-comparison-table.tsx +2 -2
- package/src/preact/mutationFilter/mutation-filter.tsx +27 -18
- package/src/preact/mutationFilter/parseAndValidateMutation.ts +4 -4
- package/src/preact/mutationFilter/parseMutation.spec.ts +17 -17
- package/src/preact/mutations/getInsertionsTableData.spec.ts +3 -3
- package/src/preact/mutations/getMutationsGridData.spec.ts +9 -9
- package/src/preact/mutations/getMutationsTableData.spec.ts +7 -7
- package/src/preact/mutations/mutations-insertions-table.tsx +3 -3
- package/src/preact/mutations/mutations-table.tsx +3 -3
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +45686 -0
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +58989 -0
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +103991 -0
- package/src/preact/mutationsOverTime/__mockData__/mockConversion.ts +54 -0
- package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +63690 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +176 -159
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +17 -59
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +27 -0
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.ts +29 -0
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +13 -14
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +9 -334
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +68 -52
- package/src/preact/numberSequencesOverTime/getNumberOfSequencesOverTimeTableData.ts +3 -3
- package/src/preact/prevalenceOverTime/getPrevalenceOverTimeTableData.spec.ts +5 -5
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +1 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +2 -2
- package/src/preact/shared/sort/sortInsertions.spec.ts +11 -11
- package/src/preact/shared/sort/sortInsertions.ts +2 -2
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.spec.ts +13 -13
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.ts +7 -4
- package/src/preact/webWorkers/useWebWorker.ts +51 -0
- package/src/preact/webWorkers/workerFunction.ts +14 -0
- package/src/query/queryAggregatedDataOverTime.ts +3 -3
- package/src/query/queryMutationsOverTime.spec.ts +272 -51
- package/src/query/queryMutationsOverTime.ts +114 -45
- package/src/query/queryPrevalenceOverTime.ts +2 -2
- package/src/query/queryRelativeGrowthAdvantage.ts +3 -3
- package/src/types.ts +25 -5
- package/src/utils/map2d.spec.ts +29 -1
- package/src/utils/map2d.ts +22 -1
- package/src/utils/mutations.spec.ts +20 -20
- package/src/utils/mutations.ts +80 -17
- package/src/utils/sort.ts +5 -2
- package/src/utils/temporal.spec.ts +27 -24
- package/src/utils/{temporal.ts → temporalClass.ts} +170 -72
- package/src/utils/temporalTestHelpers.ts +3 -3
- package/src/web-components/introduction.mdx +46 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +6 -699
- package/src/web-components/visualization/gs-mutations-over-time.tsx +2 -2
- package/standalone-bundle/dashboard-components.js +13763 -13754
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_01.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_02.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_03.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_04.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_05.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_06.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_07.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_byDay.json +0 -38
- package/src/preact/mutationsOverTime/__mockData__/aggregated_byWeek.json +0 -122
- package/src/preact/mutationsOverTime/__mockData__/aggregated_date.json +0 -642
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations.json +0 -1470
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations_total.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_20_01_2024.json +0 -6778
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_21_01_2024.json +0 -7129
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_22_01_2024.json +0 -4681
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_23_01_2024.json +0 -10738
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_24_01_2024.json +0 -11710
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_25_01_2024.json +0 -11557
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_26_01_2024.json +0 -8596
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_byDayOverall.json +0 -4726
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_01.json +0 -1747
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_02.json +0 -1774
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_03.json +0 -1819
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_04.json +0 -1864
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_05.json +0 -1927
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_06.json +0 -1864
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_07.json +0 -9
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json +0 -11143
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byWeekOverall.json +0 -9154
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_tooManyMutations.json +0 -16453
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week3_2024.json +0 -8812
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week4_2024.json +0 -9730
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week5_2024.json +0 -9865
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week6_2024.json +0 -11314
|
@@ -4,54 +4,7 @@ import { html } from 'lit';
|
|
|
4
4
|
import './gs-mutations-over-time';
|
|
5
5
|
import '../app';
|
|
6
6
|
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
7
|
-
import {
|
|
8
|
-
AGGREGATED_ENDPOINT,
|
|
9
|
-
AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
10
|
-
LAPIS_URL,
|
|
11
|
-
NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
12
|
-
} from '../../constants';
|
|
13
|
-
import aggregated_01 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_01.json';
|
|
14
|
-
import aggregated_02 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_02.json';
|
|
15
|
-
import aggregated_03 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_03.json';
|
|
16
|
-
import aggregated_04 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_04.json';
|
|
17
|
-
import aggregated_05 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_05.json';
|
|
18
|
-
import aggregated_06 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_06.json';
|
|
19
|
-
import aggregated_07 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_07.json';
|
|
20
|
-
import aggregated_20_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json';
|
|
21
|
-
import aggregated_21_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json';
|
|
22
|
-
import aggregated_22_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json';
|
|
23
|
-
import aggregated_23_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json';
|
|
24
|
-
import aggregated_24_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json';
|
|
25
|
-
import aggregated_25_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json';
|
|
26
|
-
import aggregated_26_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json';
|
|
27
|
-
import aggregated_byDay from '../../preact/mutationsOverTime/__mockData__/aggregated_byDay.json';
|
|
28
|
-
import aggregated_byWeek from '../../preact/mutationsOverTime/__mockData__/aggregated_byWeek.json';
|
|
29
|
-
import aggregated_date from '../../preact/mutationsOverTime/__mockData__/aggregated_date.json';
|
|
30
|
-
import aggregated_week3 from '../../preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json';
|
|
31
|
-
import aggregated_week4 from '../../preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json';
|
|
32
|
-
import aggregated_week5 from '../../preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json';
|
|
33
|
-
import aggregated_week6 from '../../preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json';
|
|
34
|
-
import aminoAcidMutations_20_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_20_01_2024.json';
|
|
35
|
-
import aminoAcidMutations_21_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_21_01_2024.json';
|
|
36
|
-
import aminoAcidMutations_22_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_22_01_2024.json';
|
|
37
|
-
import aminoAcidMutations_23_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_23_01_2024.json';
|
|
38
|
-
import aminoAcidMutations_24_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_24_01_2024.json';
|
|
39
|
-
import aminoAcidMutations_25_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_25_01_2024.json';
|
|
40
|
-
import aminoAcidMutations_26_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_26_01_2024.json';
|
|
41
|
-
import aminoAcidMutations_byDayOverall from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_byDayOverall.json';
|
|
42
|
-
import nucleotideMutation_01 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_01.json';
|
|
43
|
-
import nucleotideMutation_02 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_02.json';
|
|
44
|
-
import nucleotideMutation_03 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_03.json';
|
|
45
|
-
import nucleotideMutation_04 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_04.json';
|
|
46
|
-
import nucleotideMutation_05 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_05.json';
|
|
47
|
-
import nucleotideMutation_06 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_06.json';
|
|
48
|
-
import nucleotideMutation_07 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_07.json';
|
|
49
|
-
import nucleotideMutations_byMonthOverall from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json';
|
|
50
|
-
import nucleotideMutations_byWeekOverall from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_byWeekOverall.json';
|
|
51
|
-
import nucleotideMutation_week3 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_week3_2024.json';
|
|
52
|
-
import nucleotideMutation_week4 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_week4_2024.json';
|
|
53
|
-
import nucleotideMutation_week5 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_week5_2024.json';
|
|
54
|
-
import nucleotideMutation_week6 from '../../preact/mutationsOverTime/__mockData__/nucleotideMutations_week6_2024.json';
|
|
7
|
+
import { LAPIS_URL } from '../../constants';
|
|
55
8
|
import { type MutationsOverTimeProps } from '../../preact/mutationsOverTime/mutations-over-time';
|
|
56
9
|
|
|
57
10
|
const codeExample = String.raw`
|
|
@@ -101,6 +54,7 @@ const meta: Meta<Required<MutationsOverTimeProps>> = {
|
|
|
101
54
|
expectsChildren: false,
|
|
102
55
|
codeExample,
|
|
103
56
|
},
|
|
57
|
+
fetchMock: {},
|
|
104
58
|
}),
|
|
105
59
|
tags: ['autodocs'],
|
|
106
60
|
};
|
|
@@ -123,273 +77,12 @@ const Template: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
123
77
|
`,
|
|
124
78
|
};
|
|
125
79
|
|
|
80
|
+
// This test uses mock data: defaultMockData.ts (through mutationOverTimeWorker.mock.ts)
|
|
126
81
|
export const ByMonth: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
127
82
|
...Template,
|
|
128
|
-
parameters: {
|
|
129
|
-
fetchMock: {
|
|
130
|
-
mocks: [
|
|
131
|
-
{
|
|
132
|
-
matcher: {
|
|
133
|
-
name: 'aggregated_dates',
|
|
134
|
-
url: AGGREGATED_ENDPOINT,
|
|
135
|
-
body: {
|
|
136
|
-
dateFrom: '2024-01-15',
|
|
137
|
-
dateTo: '2024-07-10',
|
|
138
|
-
fields: ['date'],
|
|
139
|
-
pangoLineage: 'JN.1*',
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
response: {
|
|
143
|
-
status: 200,
|
|
144
|
-
body: aggregated_date,
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
matcher: {
|
|
149
|
-
name: 'aggregated_01',
|
|
150
|
-
url: AGGREGATED_ENDPOINT,
|
|
151
|
-
body: {
|
|
152
|
-
dateFrom: '2024-01-01',
|
|
153
|
-
dateTo: '2024-01-31',
|
|
154
|
-
fields: [],
|
|
155
|
-
pangoLineage: 'JN.1*',
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
response: {
|
|
159
|
-
status: 200,
|
|
160
|
-
body: aggregated_01,
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
matcher: {
|
|
165
|
-
name: 'aggregated_02',
|
|
166
|
-
url: AGGREGATED_ENDPOINT,
|
|
167
|
-
body: {
|
|
168
|
-
dateFrom: '2024-02-01',
|
|
169
|
-
dateTo: '2024-02-29',
|
|
170
|
-
fields: [],
|
|
171
|
-
pangoLineage: 'JN.1*',
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
response: {
|
|
175
|
-
status: 200,
|
|
176
|
-
body: aggregated_02,
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
matcher: {
|
|
181
|
-
name: 'aggregated_03',
|
|
182
|
-
url: AGGREGATED_ENDPOINT,
|
|
183
|
-
body: {
|
|
184
|
-
dateFrom: '2024-03-01',
|
|
185
|
-
dateTo: '2024-03-31',
|
|
186
|
-
fields: [],
|
|
187
|
-
pangoLineage: 'JN.1*',
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
response: {
|
|
191
|
-
status: 200,
|
|
192
|
-
body: aggregated_03,
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
matcher: {
|
|
197
|
-
name: 'aggregated_04',
|
|
198
|
-
url: AGGREGATED_ENDPOINT,
|
|
199
|
-
body: {
|
|
200
|
-
dateFrom: '2024-04-01',
|
|
201
|
-
dateTo: '2024-04-30',
|
|
202
|
-
fields: [],
|
|
203
|
-
pangoLineage: 'JN.1*',
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
response: {
|
|
207
|
-
status: 200,
|
|
208
|
-
body: aggregated_04,
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
matcher: {
|
|
213
|
-
name: 'aggregated_05',
|
|
214
|
-
url: AGGREGATED_ENDPOINT,
|
|
215
|
-
body: {
|
|
216
|
-
dateFrom: '2024-05-01',
|
|
217
|
-
dateTo: '2024-05-31',
|
|
218
|
-
fields: [],
|
|
219
|
-
pangoLineage: 'JN.1*',
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
response: {
|
|
223
|
-
status: 200,
|
|
224
|
-
body: aggregated_05,
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
matcher: {
|
|
229
|
-
name: 'aggregated_06',
|
|
230
|
-
url: AGGREGATED_ENDPOINT,
|
|
231
|
-
body: {
|
|
232
|
-
dateFrom: '2024-06-01',
|
|
233
|
-
dateTo: '2024-06-30',
|
|
234
|
-
fields: [],
|
|
235
|
-
pangoLineage: 'JN.1*',
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
response: {
|
|
239
|
-
status: 200,
|
|
240
|
-
body: aggregated_06,
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
matcher: {
|
|
245
|
-
name: 'aggregated_07',
|
|
246
|
-
url: AGGREGATED_ENDPOINT,
|
|
247
|
-
body: {
|
|
248
|
-
dateFrom: '2024-07-01',
|
|
249
|
-
dateTo: '2024-07-31',
|
|
250
|
-
fields: [],
|
|
251
|
-
pangoLineage: 'JN.1*',
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
response: {
|
|
255
|
-
status: 200,
|
|
256
|
-
body: aggregated_07,
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
matcher: {
|
|
261
|
-
name: 'nucleotideMutations_overall',
|
|
262
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
263
|
-
body: {
|
|
264
|
-
pangoLineage: 'JN.1*',
|
|
265
|
-
dateFrom: '2024-01-15',
|
|
266
|
-
dateTo: '2024-07-10',
|
|
267
|
-
minProportion: 0.001,
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
response: {
|
|
271
|
-
status: 200,
|
|
272
|
-
body: nucleotideMutations_byMonthOverall,
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
matcher: {
|
|
277
|
-
name: 'nucleotideMutations_01',
|
|
278
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
279
|
-
body: {
|
|
280
|
-
pangoLineage: 'JN.1*',
|
|
281
|
-
dateFrom: '2024-01-01',
|
|
282
|
-
dateTo: '2024-01-31',
|
|
283
|
-
minProportion: 0.001,
|
|
284
|
-
},
|
|
285
|
-
},
|
|
286
|
-
response: {
|
|
287
|
-
status: 200,
|
|
288
|
-
body: nucleotideMutation_01,
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
matcher: {
|
|
293
|
-
name: 'nucleotideMutations_02',
|
|
294
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
295
|
-
body: {
|
|
296
|
-
pangoLineage: 'JN.1*',
|
|
297
|
-
dateFrom: '2024-02-01',
|
|
298
|
-
dateTo: '2024-02-29',
|
|
299
|
-
minProportion: 0.001,
|
|
300
|
-
},
|
|
301
|
-
},
|
|
302
|
-
response: {
|
|
303
|
-
status: 200,
|
|
304
|
-
body: nucleotideMutation_02,
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
matcher: {
|
|
309
|
-
name: 'nucleotideMutations_03',
|
|
310
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
311
|
-
body: {
|
|
312
|
-
pangoLineage: 'JN.1*',
|
|
313
|
-
dateFrom: '2024-03-01',
|
|
314
|
-
dateTo: '2024-03-31',
|
|
315
|
-
minProportion: 0.001,
|
|
316
|
-
},
|
|
317
|
-
response: {
|
|
318
|
-
status: 200,
|
|
319
|
-
body: nucleotideMutation_03,
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
matcher: {
|
|
325
|
-
name: 'nucleotideMutations_04',
|
|
326
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
327
|
-
body: {
|
|
328
|
-
pangoLineage: 'JN.1*',
|
|
329
|
-
dateFrom: '2024-04-01',
|
|
330
|
-
dateTo: '2024-04-30',
|
|
331
|
-
minProportion: 0.001,
|
|
332
|
-
},
|
|
333
|
-
response: {
|
|
334
|
-
status: 200,
|
|
335
|
-
body: nucleotideMutation_04,
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
matcher: {
|
|
341
|
-
name: 'nucleotideMutations_05',
|
|
342
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
343
|
-
body: {
|
|
344
|
-
pangoLineage: 'JN.1*',
|
|
345
|
-
dateFrom: '2024-05-01',
|
|
346
|
-
dateTo: '2024-05-31',
|
|
347
|
-
minProportion: 0.001,
|
|
348
|
-
},
|
|
349
|
-
response: {
|
|
350
|
-
status: 200,
|
|
351
|
-
body: nucleotideMutation_05,
|
|
352
|
-
},
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
matcher: {
|
|
357
|
-
name: 'nucleotideMutations_06',
|
|
358
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
359
|
-
body: {
|
|
360
|
-
pangoLineage: 'JN.1*',
|
|
361
|
-
dateFrom: '2024-06-01',
|
|
362
|
-
dateTo: '2024-06-30',
|
|
363
|
-
minProportion: 0.001,
|
|
364
|
-
},
|
|
365
|
-
response: {
|
|
366
|
-
status: 200,
|
|
367
|
-
body: nucleotideMutation_06,
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
{
|
|
373
|
-
matcher: {
|
|
374
|
-
name: 'nucleotideMutations_07',
|
|
375
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
376
|
-
body: {
|
|
377
|
-
pangoLineage: 'JN.1*',
|
|
378
|
-
dateFrom: '2024-07-01',
|
|
379
|
-
dateTo: '2024-07-31',
|
|
380
|
-
minProportion: 0.001,
|
|
381
|
-
},
|
|
382
|
-
response: {
|
|
383
|
-
status: 200,
|
|
384
|
-
body: nucleotideMutation_07,
|
|
385
|
-
},
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
|
-
],
|
|
389
|
-
},
|
|
390
|
-
},
|
|
391
83
|
};
|
|
392
84
|
|
|
85
|
+
// This test uses mock data: byWeek.ts (through mutationOverTimeWorker.mock.ts)
|
|
393
86
|
export const ByWeek: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
394
87
|
...Template,
|
|
395
88
|
args: {
|
|
@@ -397,174 +90,9 @@ export const ByWeek: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
397
90
|
lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11' },
|
|
398
91
|
granularity: 'week',
|
|
399
92
|
},
|
|
400
|
-
parameters: {
|
|
401
|
-
fetchMock: {
|
|
402
|
-
mocks: [
|
|
403
|
-
{
|
|
404
|
-
matcher: {
|
|
405
|
-
name: 'aggregated_dates',
|
|
406
|
-
url: AGGREGATED_ENDPOINT,
|
|
407
|
-
body: {
|
|
408
|
-
dateFrom: '2024-01-15',
|
|
409
|
-
dateTo: '2024-02-11',
|
|
410
|
-
fields: ['date'],
|
|
411
|
-
pangoLineage: 'JN.1*',
|
|
412
|
-
},
|
|
413
|
-
},
|
|
414
|
-
response: {
|
|
415
|
-
status: 200,
|
|
416
|
-
body: aggregated_byWeek,
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
matcher: {
|
|
421
|
-
name: 'aggregated_week3',
|
|
422
|
-
url: AGGREGATED_ENDPOINT,
|
|
423
|
-
body: {
|
|
424
|
-
dateFrom: '2024-01-15',
|
|
425
|
-
dateTo: '2024-01-21',
|
|
426
|
-
fields: [],
|
|
427
|
-
pangoLineage: 'JN.1*',
|
|
428
|
-
},
|
|
429
|
-
},
|
|
430
|
-
response: {
|
|
431
|
-
status: 200,
|
|
432
|
-
body: aggregated_week3,
|
|
433
|
-
},
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
matcher: {
|
|
437
|
-
name: 'aggregated_week4',
|
|
438
|
-
url: AGGREGATED_ENDPOINT,
|
|
439
|
-
body: {
|
|
440
|
-
dateFrom: '2024-01-22',
|
|
441
|
-
dateTo: '2024-01-28',
|
|
442
|
-
fields: [],
|
|
443
|
-
pangoLineage: 'JN.1*',
|
|
444
|
-
},
|
|
445
|
-
},
|
|
446
|
-
response: {
|
|
447
|
-
status: 200,
|
|
448
|
-
body: aggregated_week4,
|
|
449
|
-
},
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
matcher: {
|
|
453
|
-
name: 'aggregated_week5',
|
|
454
|
-
url: AGGREGATED_ENDPOINT,
|
|
455
|
-
body: {
|
|
456
|
-
dateFrom: '2024-01-29',
|
|
457
|
-
dateTo: '2024-02-04',
|
|
458
|
-
fields: [],
|
|
459
|
-
pangoLineage: 'JN.1*',
|
|
460
|
-
},
|
|
461
|
-
},
|
|
462
|
-
response: {
|
|
463
|
-
status: 200,
|
|
464
|
-
body: aggregated_week5,
|
|
465
|
-
},
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
matcher: {
|
|
469
|
-
name: 'aggregated_week6',
|
|
470
|
-
url: AGGREGATED_ENDPOINT,
|
|
471
|
-
body: {
|
|
472
|
-
dateFrom: '2024-02-05',
|
|
473
|
-
dateTo: '2024-02-11',
|
|
474
|
-
fields: [],
|
|
475
|
-
pangoLineage: 'JN.1*',
|
|
476
|
-
},
|
|
477
|
-
},
|
|
478
|
-
response: {
|
|
479
|
-
status: 200,
|
|
480
|
-
body: aggregated_week6,
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
matcher: {
|
|
485
|
-
name: 'nucleotideMutation_overall',
|
|
486
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
487
|
-
body: {
|
|
488
|
-
pangoLineage: 'JN.1*',
|
|
489
|
-
dateFrom: '2024-01-15',
|
|
490
|
-
dateTo: '2024-02-11',
|
|
491
|
-
minProportion: 0.001,
|
|
492
|
-
},
|
|
493
|
-
},
|
|
494
|
-
response: {
|
|
495
|
-
status: 200,
|
|
496
|
-
body: nucleotideMutations_byWeekOverall,
|
|
497
|
-
},
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
matcher: {
|
|
501
|
-
name: 'nucleotideMutation_week3',
|
|
502
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
503
|
-
body: {
|
|
504
|
-
pangoLineage: 'JN.1*',
|
|
505
|
-
dateFrom: '2024-01-15',
|
|
506
|
-
dateTo: '2024-01-21',
|
|
507
|
-
minProportion: 0.001,
|
|
508
|
-
},
|
|
509
|
-
},
|
|
510
|
-
response: {
|
|
511
|
-
status: 200,
|
|
512
|
-
body: nucleotideMutation_week3,
|
|
513
|
-
},
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
matcher: {
|
|
517
|
-
name: 'nucleotideMutation_week4',
|
|
518
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
519
|
-
body: {
|
|
520
|
-
pangoLineage: 'JN.1*',
|
|
521
|
-
dateFrom: '2024-01-22',
|
|
522
|
-
dateTo: '2024-01-28',
|
|
523
|
-
minProportion: 0.001,
|
|
524
|
-
},
|
|
525
|
-
},
|
|
526
|
-
response: {
|
|
527
|
-
status: 200,
|
|
528
|
-
body: nucleotideMutation_week4,
|
|
529
|
-
},
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
matcher: {
|
|
533
|
-
name: 'nucleotideMutation_week5',
|
|
534
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
535
|
-
body: {
|
|
536
|
-
pangoLineage: 'JN.1*',
|
|
537
|
-
dateFrom: '2024-01-29',
|
|
538
|
-
dateTo: '2024-02-04',
|
|
539
|
-
minProportion: 0.001,
|
|
540
|
-
},
|
|
541
|
-
},
|
|
542
|
-
response: {
|
|
543
|
-
status: 200,
|
|
544
|
-
body: nucleotideMutation_week5,
|
|
545
|
-
},
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
matcher: {
|
|
549
|
-
name: 'nucleotideMutation_week6',
|
|
550
|
-
url: NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
551
|
-
body: {
|
|
552
|
-
pangoLineage: 'JN.1*',
|
|
553
|
-
dateFrom: '2024-02-05',
|
|
554
|
-
dateTo: '2024-02-11',
|
|
555
|
-
minProportion: 0.001,
|
|
556
|
-
},
|
|
557
|
-
},
|
|
558
|
-
response: {
|
|
559
|
-
status: 200,
|
|
560
|
-
body: nucleotideMutation_week6,
|
|
561
|
-
},
|
|
562
|
-
},
|
|
563
|
-
],
|
|
564
|
-
},
|
|
565
|
-
},
|
|
566
93
|
};
|
|
567
94
|
|
|
95
|
+
// This test uses mock data: aminoAcidMutationsByDay.ts (through mutationOverTimeWorker.mock.ts)
|
|
568
96
|
export const AminoAcidMutationsByDay: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
569
97
|
...Template,
|
|
570
98
|
args: {
|
|
@@ -573,230 +101,9 @@ export const AminoAcidMutationsByDay: StoryObj<Required<MutationsOverTimeProps>>
|
|
|
573
101
|
granularity: 'day',
|
|
574
102
|
sequenceType: 'amino acid',
|
|
575
103
|
},
|
|
576
|
-
parameters: {
|
|
577
|
-
fetchMock: {
|
|
578
|
-
mocks: [
|
|
579
|
-
{
|
|
580
|
-
matcher: {
|
|
581
|
-
name: 'aggregated_byDay',
|
|
582
|
-
url: AGGREGATED_ENDPOINT,
|
|
583
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26', fields: ['date'] },
|
|
584
|
-
},
|
|
585
|
-
response: {
|
|
586
|
-
status: 200,
|
|
587
|
-
body: aggregated_byDay,
|
|
588
|
-
},
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
matcher: {
|
|
592
|
-
name: 'aggregated_20_01_2024',
|
|
593
|
-
url: AGGREGATED_ENDPOINT,
|
|
594
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-20', fields: [] },
|
|
595
|
-
},
|
|
596
|
-
response: {
|
|
597
|
-
status: 200,
|
|
598
|
-
body: aggregated_20_01_2024,
|
|
599
|
-
},
|
|
600
|
-
},
|
|
601
|
-
{
|
|
602
|
-
matcher: {
|
|
603
|
-
name: 'aggregated_21_01_2024',
|
|
604
|
-
url: AGGREGATED_ENDPOINT,
|
|
605
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-21', dateTo: '2024-01-21', fields: [] },
|
|
606
|
-
},
|
|
607
|
-
response: {
|
|
608
|
-
status: 200,
|
|
609
|
-
body: aggregated_21_01_2024,
|
|
610
|
-
},
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
matcher: {
|
|
614
|
-
name: 'aggregated_22_01_2024',
|
|
615
|
-
url: AGGREGATED_ENDPOINT,
|
|
616
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-22', dateTo: '2024-01-22', fields: [] },
|
|
617
|
-
},
|
|
618
|
-
response: {
|
|
619
|
-
status: 200,
|
|
620
|
-
body: aggregated_22_01_2024,
|
|
621
|
-
},
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
matcher: {
|
|
625
|
-
name: 'aggregated_23_01_2024',
|
|
626
|
-
url: AGGREGATED_ENDPOINT,
|
|
627
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-23', dateTo: '2024-01-23', fields: [] },
|
|
628
|
-
},
|
|
629
|
-
response: {
|
|
630
|
-
status: 200,
|
|
631
|
-
body: aggregated_23_01_2024,
|
|
632
|
-
},
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
matcher: {
|
|
636
|
-
name: 'aggregated_24_01_2024',
|
|
637
|
-
url: AGGREGATED_ENDPOINT,
|
|
638
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-24', dateTo: '2024-01-24', fields: [] },
|
|
639
|
-
},
|
|
640
|
-
response: {
|
|
641
|
-
status: 200,
|
|
642
|
-
body: aggregated_24_01_2024,
|
|
643
|
-
},
|
|
644
|
-
},
|
|
645
|
-
{
|
|
646
|
-
matcher: {
|
|
647
|
-
name: 'aggregated_25_01_2024',
|
|
648
|
-
url: AGGREGATED_ENDPOINT,
|
|
649
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-25', dateTo: '2024-01-25', fields: [] },
|
|
650
|
-
},
|
|
651
|
-
response: {
|
|
652
|
-
status: 200,
|
|
653
|
-
body: aggregated_25_01_2024,
|
|
654
|
-
},
|
|
655
|
-
},
|
|
656
|
-
{
|
|
657
|
-
matcher: {
|
|
658
|
-
name: 'aggregated_26_01_2024',
|
|
659
|
-
url: AGGREGATED_ENDPOINT,
|
|
660
|
-
body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-26', dateTo: '2024-01-26', fields: [] },
|
|
661
|
-
},
|
|
662
|
-
response: {
|
|
663
|
-
status: 200,
|
|
664
|
-
body: aggregated_26_01_2024,
|
|
665
|
-
},
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
matcher: {
|
|
669
|
-
name: 'aminoAcidMutations_overall',
|
|
670
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
671
|
-
body: {
|
|
672
|
-
pangoLineage: 'JN.1*',
|
|
673
|
-
dateFrom: '2024-01-20',
|
|
674
|
-
dateTo: '2024-01-26',
|
|
675
|
-
minProportion: 0.001,
|
|
676
|
-
},
|
|
677
|
-
},
|
|
678
|
-
response: {
|
|
679
|
-
status: 200,
|
|
680
|
-
body: aminoAcidMutations_byDayOverall,
|
|
681
|
-
},
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
matcher: {
|
|
685
|
-
name: 'aminoAcidMutations_20_01_2024',
|
|
686
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
687
|
-
body: {
|
|
688
|
-
pangoLineage: 'JN.1*',
|
|
689
|
-
dateFrom: '2024-01-20',
|
|
690
|
-
dateTo: '2024-01-20',
|
|
691
|
-
minProportion: 0.001,
|
|
692
|
-
},
|
|
693
|
-
},
|
|
694
|
-
response: {
|
|
695
|
-
status: 200,
|
|
696
|
-
body: aminoAcidMutations_20_01_2024,
|
|
697
|
-
},
|
|
698
|
-
},
|
|
699
|
-
{
|
|
700
|
-
matcher: {
|
|
701
|
-
name: 'aminoAcidMutations_21_01_2024',
|
|
702
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
703
|
-
body: {
|
|
704
|
-
pangoLineage: 'JN.1*',
|
|
705
|
-
dateFrom: '2024-01-21',
|
|
706
|
-
dateTo: '2024-01-21',
|
|
707
|
-
minProportion: 0.001,
|
|
708
|
-
},
|
|
709
|
-
},
|
|
710
|
-
response: {
|
|
711
|
-
status: 200,
|
|
712
|
-
body: aminoAcidMutations_21_01_2024,
|
|
713
|
-
},
|
|
714
|
-
},
|
|
715
|
-
{
|
|
716
|
-
matcher: {
|
|
717
|
-
name: 'aminoAcidMutations_22_01_2024',
|
|
718
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
719
|
-
body: {
|
|
720
|
-
pangoLineage: 'JN.1*',
|
|
721
|
-
dateFrom: '2024-01-22',
|
|
722
|
-
dateTo: '2024-01-22',
|
|
723
|
-
minProportion: 0.001,
|
|
724
|
-
},
|
|
725
|
-
},
|
|
726
|
-
response: {
|
|
727
|
-
status: 200,
|
|
728
|
-
body: aminoAcidMutations_22_01_2024,
|
|
729
|
-
},
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
matcher: {
|
|
733
|
-
name: 'aminoAcidMutations_23_01_2024',
|
|
734
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
735
|
-
body: {
|
|
736
|
-
pangoLineage: 'JN.1*',
|
|
737
|
-
dateFrom: '2024-01-23',
|
|
738
|
-
dateTo: '2024-01-23',
|
|
739
|
-
minProportion: 0.001,
|
|
740
|
-
},
|
|
741
|
-
},
|
|
742
|
-
response: {
|
|
743
|
-
status: 200,
|
|
744
|
-
body: aminoAcidMutations_23_01_2024,
|
|
745
|
-
},
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
matcher: {
|
|
749
|
-
name: 'aminoAcidMutations_24_01_2024',
|
|
750
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
751
|
-
body: {
|
|
752
|
-
pangoLineage: 'JN.1*',
|
|
753
|
-
dateFrom: '2024-01-24',
|
|
754
|
-
dateTo: '2024-01-24',
|
|
755
|
-
minProportion: 0.001,
|
|
756
|
-
},
|
|
757
|
-
},
|
|
758
|
-
response: {
|
|
759
|
-
status: 200,
|
|
760
|
-
body: aminoAcidMutations_24_01_2024,
|
|
761
|
-
},
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
matcher: {
|
|
765
|
-
name: 'aminoAcidMutations_25_01_2024',
|
|
766
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
767
|
-
body: {
|
|
768
|
-
pangoLineage: 'JN.1*',
|
|
769
|
-
dateFrom: '2024-01-25',
|
|
770
|
-
dateTo: '2024-01-25',
|
|
771
|
-
minProportion: 0.001,
|
|
772
|
-
},
|
|
773
|
-
},
|
|
774
|
-
response: {
|
|
775
|
-
status: 200,
|
|
776
|
-
body: aminoAcidMutations_25_01_2024,
|
|
777
|
-
},
|
|
778
|
-
},
|
|
779
|
-
{
|
|
780
|
-
matcher: {
|
|
781
|
-
name: 'aminoAcidMutations_26_01_2024',
|
|
782
|
-
url: AMINO_ACID_MUTATIONS_ENDPOINT,
|
|
783
|
-
body: {
|
|
784
|
-
pangoLineage: 'JN.1*',
|
|
785
|
-
dateFrom: '2024-01-26',
|
|
786
|
-
dateTo: '2024-01-26',
|
|
787
|
-
minProportion: 0.001,
|
|
788
|
-
},
|
|
789
|
-
},
|
|
790
|
-
response: {
|
|
791
|
-
status: 200,
|
|
792
|
-
body: aminoAcidMutations_26_01_2024,
|
|
793
|
-
},
|
|
794
|
-
},
|
|
795
|
-
],
|
|
796
|
-
},
|
|
797
|
-
},
|
|
798
104
|
};
|
|
799
105
|
|
|
106
|
+
// This test uses mock data: defaultMockData.ts (through mutationOverTimeWorker.mock.ts)
|
|
800
107
|
export const HideProportionOnSmallScreen: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
801
108
|
...ByMonth,
|
|
802
109
|
args: {
|