@genspectrum/dashboard-components 0.6.13 → 0.6.14
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 +29 -0
- package/custom-elements.json +11 -11
- package/dist/dashboard-components.js +8213 -37918
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +7 -7
- package/dist/style.css +1 -1
- package/package.json +7 -6
- package/src/operator/FetchAggregatedOperator.ts +2 -7
- package/src/preact/components/info.tsx +1 -1
- package/src/preact/components/percent-intput.tsx +7 -2
- package/src/preact/components/proportion-selector.tsx +12 -2
- package/src/preact/dateRangeSelector/date-range-selector.tsx +4 -4
- package/src/preact/lineageFilter/lineage-filter.tsx +2 -2
- package/src/preact/locationFilter/location-filter.tsx +2 -2
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_01.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_02.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_03.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_04.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_05.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_06.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_07.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations_total.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json +13 -0
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json +13 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +56 -8
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +4 -2
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +135 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +2 -2
- package/src/preact/textInput/text-input.tsx +2 -2
- package/src/query/queryMutationsOverTime.spec.ts +210 -64
- package/src/query/queryMutationsOverTime.ts +10 -2
- package/src/web-components/input/gs-date-range-selector.tsx +24 -4
- package/src/web-components/input/gs-lineage-filter.tsx +15 -1
- package/src/web-components/input/gs-location-filter.tsx +13 -1
- package/src/web-components/input/gs-mutation-filter.tsx +1 -0
- package/src/web-components/input/gs-text-input.tsx +13 -1
- package/src/web-components/visualization/gs-aggregate.tsx +17 -1
- package/src/web-components/visualization/gs-mutation-comparison.tsx +9 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +271 -0
- package/src/web-components/visualization/gs-mutations-over-time.tsx +7 -0
- package/src/web-components/visualization/gs-mutations.tsx +11 -5
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +15 -0
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -9
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +26 -8
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +43 -5
- package/standalone-bundle/dashboard-components.js +30887 -0
- package/standalone-bundle/dashboard-components.js.map +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
|
|
3
|
-
import { LineageFilter } from '../../preact/lineageFilter/lineage-filter';
|
|
3
|
+
import { LineageFilter, type LineageFilterProps } from '../../preact/lineageFilter/lineage-filter';
|
|
4
|
+
import type { Equals, Expect } from '../../utils/typeAssertions';
|
|
4
5
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -77,3 +78,16 @@ declare global {
|
|
|
77
78
|
'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
|
|
78
79
|
}
|
|
79
80
|
}
|
|
81
|
+
|
|
82
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
83
|
+
type InitialValueMatches = Expect<
|
|
84
|
+
Equals<typeof LineageFilterComponent.prototype.initialValue, LineageFilterProps['initialValue']>
|
|
85
|
+
>;
|
|
86
|
+
type LapisFieldMatches = Expect<
|
|
87
|
+
Equals<typeof LineageFilterComponent.prototype.lapisField, LineageFilterProps['lapisField']>
|
|
88
|
+
>;
|
|
89
|
+
type PlaceholderTextMatches = Expect<
|
|
90
|
+
Equals<typeof LineageFilterComponent.prototype.placeholderText, LineageFilterProps['placeholderText']>
|
|
91
|
+
>;
|
|
92
|
+
type WidthMatches = Expect<Equals<typeof LineageFilterComponent.prototype.width, LineageFilterProps['width']>>;
|
|
93
|
+
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
|
|
3
|
-
import { LocationFilter } from '../../preact/locationFilter/location-filter';
|
|
3
|
+
import { LocationFilter, type LocationFilterProps } from '../../preact/locationFilter/location-filter';
|
|
4
|
+
import type { Equals, Expect } from '../../utils/typeAssertions';
|
|
4
5
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -86,3 +87,14 @@ declare global {
|
|
|
86
87
|
'gs-location-changed': CustomEvent<Record<string, string>>;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
90
|
+
|
|
91
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
92
|
+
type InitialValueMatches = Expect<
|
|
93
|
+
Equals<typeof LocationFilterComponent.prototype.initialValue, LocationFilterProps['initialValue']>
|
|
94
|
+
>;
|
|
95
|
+
type FieldsMatches = Expect<Equals<typeof LocationFilterComponent.prototype.fields, LocationFilterProps['fields']>>;
|
|
96
|
+
type PlaceholderTextMatches = Expect<
|
|
97
|
+
Equals<typeof LocationFilterComponent.prototype.placeholderText, LocationFilterProps['placeholderText']>
|
|
98
|
+
>;
|
|
99
|
+
type WidthMatches = Expect<Equals<typeof LocationFilterComponent.prototype.width, LocationFilterProps['width']>>;
|
|
100
|
+
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -115,4 +115,5 @@ declare global {
|
|
|
115
115
|
type InitialValueMatches = Expect<
|
|
116
116
|
Equals<typeof MutationFilterComponent.prototype.initialValue, MutationFilterProps['initialValue']>
|
|
117
117
|
>;
|
|
118
|
+
type WidthMatches = Expect<Equals<typeof MutationFilterComponent.prototype.width, MutationFilterProps['width']>>;
|
|
118
119
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
|
|
3
|
-
import { TextInput } from '../../preact/textInput/text-input';
|
|
3
|
+
import { TextInput, type TextInputProps } from '../../preact/textInput/text-input';
|
|
4
|
+
import type { Equals, Expect } from '../../utils/typeAssertions';
|
|
4
5
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -71,3 +72,14 @@ declare global {
|
|
|
71
72
|
'gs-text-input-changed': CustomEvent<Record<string, string>>;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
75
|
+
|
|
76
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
77
|
+
type InitialValueMatches = Expect<
|
|
78
|
+
Equals<typeof TextInputComponent.prototype.initialValue, TextInputProps['initialValue']>
|
|
79
|
+
>;
|
|
80
|
+
type LapisFieldMatches = Expect<Equals<typeof TextInputComponent.prototype.lapisField, TextInputProps['lapisField']>>;
|
|
81
|
+
type PlaceholderTextMatches = Expect<
|
|
82
|
+
Equals<typeof TextInputComponent.prototype.placeholderText, TextInputProps['placeholderText']>
|
|
83
|
+
>;
|
|
84
|
+
type WidthMatches = Expect<Equals<typeof TextInputComponent.prototype.width, TextInputProps['width']>>;
|
|
85
|
+
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
|
|
3
|
-
import { Aggregate, type View } from '../../preact/aggregatedData/aggregate';
|
|
3
|
+
import { Aggregate, type AggregateProps, type View } from '../../preact/aggregatedData/aggregate';
|
|
4
4
|
import { type LapisFilter } from '../../types';
|
|
5
|
+
import { type Equals, type Expect } from '../../utils/typeAssertions';
|
|
5
6
|
import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -102,3 +103,18 @@ declare global {
|
|
|
102
103
|
'gs-aggregate-component': AggregateComponent;
|
|
103
104
|
}
|
|
104
105
|
}
|
|
106
|
+
|
|
107
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
108
|
+
type FieldsMatches = Expect<Equals<typeof AggregateComponent.prototype.fields, AggregateProps['fields']>>;
|
|
109
|
+
type ViewsMatches = Expect<Equals<typeof AggregateComponent.prototype.views, AggregateProps['views']>>;
|
|
110
|
+
type FilterMatches = Expect<Equals<typeof AggregateComponent.prototype.filter, AggregateProps['filter']>>;
|
|
111
|
+
type WidthMatches = Expect<Equals<typeof AggregateComponent.prototype.width, AggregateProps['width']>>;
|
|
112
|
+
type HeightMatches = Expect<Equals<typeof AggregateComponent.prototype.height, AggregateProps['height']>>;
|
|
113
|
+
type InitialSortFieldMatches = Expect<
|
|
114
|
+
Equals<typeof AggregateComponent.prototype.initialSortField, AggregateProps['initialSortField']>
|
|
115
|
+
>;
|
|
116
|
+
type InitialSortDirectionMatches = Expect<
|
|
117
|
+
Equals<typeof AggregateComponent.prototype.initialSortDirection, AggregateProps['initialSortDirection']>
|
|
118
|
+
>;
|
|
119
|
+
type PageSizeMatches = Expect<Equals<typeof AggregateComponent.prototype.pageSize, AggregateProps['pageSize']>>;
|
|
120
|
+
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -112,4 +112,13 @@ type SequenceTypeMatches = Expect<
|
|
|
112
112
|
type ViewsMatches = Expect<
|
|
113
113
|
Equals<typeof MutationComparisonComponent.prototype.views, MutationComparisonProps['views']>
|
|
114
114
|
>;
|
|
115
|
+
type WidthMatches = Expect<
|
|
116
|
+
Equals<typeof MutationComparisonComponent.prototype.width, MutationComparisonProps['width']>
|
|
117
|
+
>;
|
|
118
|
+
type HeightMatches = Expect<
|
|
119
|
+
Equals<typeof MutationComparisonComponent.prototype.height, MutationComparisonProps['height']>
|
|
120
|
+
>;
|
|
121
|
+
type PageSizeMatches = Expect<
|
|
122
|
+
Equals<typeof MutationComparisonComponent.prototype.pageSize, MutationComparisonProps['pageSize']>
|
|
123
|
+
>;
|
|
115
124
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -10,9 +10,27 @@ import {
|
|
|
10
10
|
LAPIS_URL,
|
|
11
11
|
NUCLEOTIDE_MUTATIONS_ENDPOINT,
|
|
12
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';
|
|
13
27
|
import aggregated_byDay from '../../preact/mutationsOverTime/__mockData__/aggregated_byDay.json';
|
|
14
28
|
import aggregated_byWeek from '../../preact/mutationsOverTime/__mockData__/aggregated_byWeek.json';
|
|
15
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';
|
|
16
34
|
import aminoAcidMutations_20_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_20_01_2024.json';
|
|
17
35
|
import aminoAcidMutations_21_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_21_01_2024.json';
|
|
18
36
|
import aminoAcidMutations_22_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_22_01_2024.json';
|
|
@@ -126,6 +144,118 @@ export const ByMonth: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
126
144
|
body: aggregated_date,
|
|
127
145
|
},
|
|
128
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
|
+
},
|
|
129
259
|
{
|
|
130
260
|
matcher: {
|
|
131
261
|
name: 'nucleotideMutations_overall',
|
|
@@ -286,6 +416,70 @@ export const ByWeek: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
286
416
|
body: aggregated_byWeek,
|
|
287
417
|
},
|
|
288
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
|
+
},
|
|
289
483
|
{
|
|
290
484
|
matcher: {
|
|
291
485
|
name: 'nucleotideMutation_overall',
|
|
@@ -393,6 +587,83 @@ export const AminoAcidMutationsByDay: StoryObj<Required<MutationsOverTimeProps>>
|
|
|
393
587
|
body: aggregated_byDay,
|
|
394
588
|
},
|
|
395
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
|
+
},
|
|
396
667
|
{
|
|
397
668
|
matcher: {
|
|
398
669
|
name: 'aminoAcidMutations_overall',
|
|
@@ -112,7 +112,14 @@ type SequenceTypeMatches = Expect<
|
|
|
112
112
|
Equals<typeof MutationsOverTimeComponent.prototype.sequenceType, MutationsOverTimeProps['sequenceType']>
|
|
113
113
|
>;
|
|
114
114
|
type ViewsMatches = Expect<Equals<typeof MutationsOverTimeComponent.prototype.views, MutationsOverTimeProps['views']>>;
|
|
115
|
+
type WidthMatches = Expect<Equals<typeof MutationsOverTimeComponent.prototype.width, MutationsOverTimeProps['width']>>;
|
|
116
|
+
type HeightMatches = Expect<
|
|
117
|
+
Equals<typeof MutationsOverTimeComponent.prototype.height, MutationsOverTimeProps['height']>
|
|
118
|
+
>;
|
|
115
119
|
type GranularityMatches = Expect<
|
|
116
120
|
Equals<typeof MutationsOverTimeComponent.prototype.granularity, MutationsOverTimeProps['granularity']>
|
|
117
121
|
>;
|
|
122
|
+
type LapisDateFieldMatches = Expect<
|
|
123
|
+
Equals<typeof MutationsOverTimeComponent.prototype.lapisDateField, MutationsOverTimeProps['lapisDateField']>
|
|
124
|
+
>;
|
|
118
125
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
|
|
3
|
-
import { Mutations, type
|
|
4
|
-
import { type LapisFilter, type SequenceType } from '../../types';
|
|
3
|
+
import { Mutations, type MutationsProps } from '../../preact/mutations/mutations';
|
|
5
4
|
import type { Equals, Expect } from '../../utils/typeAssertions';
|
|
6
5
|
import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
|
|
7
6
|
|
|
@@ -98,7 +97,14 @@ declare global {
|
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
101
|
-
type LapisFilterMatches = Expect<
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
type LapisFilterMatches = Expect<
|
|
101
|
+
Equals<typeof MutationsComponent.prototype.lapisFilter, MutationsProps['lapisFilter']>
|
|
102
|
+
>;
|
|
103
|
+
type SequenceTypeMatches = Expect<
|
|
104
|
+
Equals<typeof MutationsComponent.prototype.sequenceType, MutationsProps['sequenceType']>
|
|
105
|
+
>;
|
|
106
|
+
type ViewsMatches = Expect<Equals<typeof MutationsComponent.prototype.views, MutationsProps['views']>>;
|
|
107
|
+
type WidthMatches = Expect<Equals<typeof MutationsComponent.prototype.width, MutationsProps['width']>>;
|
|
108
|
+
type HeightMatches = Expect<Equals<typeof MutationsComponent.prototype.height, MutationsProps['height']>>;
|
|
109
|
+
type PageSizeMatches = Expect<Equals<typeof MutationsComponent.prototype.pageSize, MutationsProps['pageSize']>>;
|
|
104
110
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -128,9 +128,21 @@ declare global {
|
|
|
128
128
|
type LapisFilterMatches = Expect<
|
|
129
129
|
Equals<typeof NumberSequencesOverTimeComponent.prototype.lapisFilter, NumberSequencesOverTimeProps['lapisFilter']>
|
|
130
130
|
>;
|
|
131
|
+
type LapisDateFieldMatches = Expect<
|
|
132
|
+
Equals<
|
|
133
|
+
typeof NumberSequencesOverTimeComponent.prototype.lapisDateField,
|
|
134
|
+
NumberSequencesOverTimeProps['lapisDateField']
|
|
135
|
+
>
|
|
136
|
+
>;
|
|
131
137
|
type ViewsMatches = Expect<
|
|
132
138
|
Equals<typeof NumberSequencesOverTimeComponent.prototype.views, NumberSequencesOverTimeProps['views']>
|
|
133
139
|
>;
|
|
140
|
+
type WidhtMatches = Expect<
|
|
141
|
+
Equals<typeof NumberSequencesOverTimeComponent.prototype.width, NumberSequencesOverTimeProps['width']>
|
|
142
|
+
>;
|
|
143
|
+
type HeightMatches = Expect<
|
|
144
|
+
Equals<typeof NumberSequencesOverTimeComponent.prototype.height, NumberSequencesOverTimeProps['height']>
|
|
145
|
+
>;
|
|
134
146
|
type GranularityMatches = Expect<
|
|
135
147
|
Equals<typeof NumberSequencesOverTimeComponent.prototype.granularity, NumberSequencesOverTimeProps['granularity']>
|
|
136
148
|
>;
|
|
@@ -140,4 +152,7 @@ type SmoothingWindowMatches = Expect<
|
|
|
140
152
|
NumberSequencesOverTimeProps['smoothingWindow']
|
|
141
153
|
>
|
|
142
154
|
>;
|
|
155
|
+
type PageSizeMatches = Expect<
|
|
156
|
+
Equals<typeof NumberSequencesOverTimeComponent.prototype.pageSize, NumberSequencesOverTimeProps['pageSize']>
|
|
157
|
+
>;
|
|
143
158
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -4,8 +4,6 @@ import { html } from 'lit';
|
|
|
4
4
|
|
|
5
5
|
import '../app';
|
|
6
6
|
import './gs-prevalence-over-time';
|
|
7
|
-
// eslint-disable-next-line no-duplicate-imports
|
|
8
|
-
import { type PrevalenceOverTimeComponentProps } from './gs-prevalence-over-time';
|
|
9
7
|
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
10
8
|
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
|
|
11
9
|
import denominatorFilter from '../../preact/prevalenceOverTime/__mockData__/denominatorFilter.json';
|
|
@@ -13,6 +11,7 @@ import denominatorFilterOneDataset from '../../preact/prevalenceOverTime/__mockD
|
|
|
13
11
|
import numeratorFilterEG from '../../preact/prevalenceOverTime/__mockData__/numeratorFilterEG.json';
|
|
14
12
|
import numeratorFilterJN1 from '../../preact/prevalenceOverTime/__mockData__/numeratorFilterJN1.json';
|
|
15
13
|
import numeratorFilterOneDataset from '../../preact/prevalenceOverTime/__mockData__/numeratorFilterOneDataset.json';
|
|
14
|
+
import { type PrevalenceOverTimeProps } from '../../preact/prevalenceOverTime/prevalence-over-time';
|
|
16
15
|
import { withinShadowRoot } from '../withinShadowRoot.story';
|
|
17
16
|
|
|
18
17
|
const codeExample = String.raw`
|
|
@@ -31,7 +30,7 @@ const codeExample = String.raw`
|
|
|
31
30
|
yAxisMaxLogarithmic="limitTo1"
|
|
32
31
|
></gs-prevalence-over-time>`;
|
|
33
32
|
|
|
34
|
-
const meta: Meta<Required<
|
|
33
|
+
const meta: Meta<Required<PrevalenceOverTimeProps>> = {
|
|
35
34
|
title: 'Visualization/Prevalence over time',
|
|
36
35
|
component: 'gs-prevalence-over-time',
|
|
37
36
|
argTypes: {
|
|
@@ -68,7 +67,7 @@ const meta: Meta<Required<PrevalenceOverTimeComponentProps>> = {
|
|
|
68
67
|
|
|
69
68
|
export default meta;
|
|
70
69
|
|
|
71
|
-
const Template: StoryObj<Required<
|
|
70
|
+
const Template: StoryObj<Required<PrevalenceOverTimeProps>> = {
|
|
72
71
|
render: (args) => html`
|
|
73
72
|
<gs-app lapis="${LAPIS_URL}">
|
|
74
73
|
<gs-prevalence-over-time
|
|
@@ -89,7 +88,7 @@ const Template: StoryObj<Required<PrevalenceOverTimeComponentProps>> = {
|
|
|
89
88
|
`,
|
|
90
89
|
};
|
|
91
90
|
|
|
92
|
-
export const TwoDatasets: StoryObj<Required<
|
|
91
|
+
export const TwoDatasets: StoryObj<Required<PrevalenceOverTimeProps>> = {
|
|
93
92
|
...Template,
|
|
94
93
|
args: {
|
|
95
94
|
numeratorFilter: [
|
|
@@ -163,7 +162,7 @@ export const TwoDatasets: StoryObj<Required<PrevalenceOverTimeComponentProps>> =
|
|
|
163
162
|
},
|
|
164
163
|
};
|
|
165
164
|
|
|
166
|
-
export const OneDataset: StoryObj<Required<
|
|
165
|
+
export const OneDataset: StoryObj<Required<PrevalenceOverTimeProps>> = {
|
|
167
166
|
...Template,
|
|
168
167
|
args: {
|
|
169
168
|
numeratorFilter: {
|
|
@@ -221,7 +220,7 @@ export const OneDataset: StoryObj<Required<PrevalenceOverTimeComponentProps>> =
|
|
|
221
220
|
},
|
|
222
221
|
};
|
|
223
222
|
|
|
224
|
-
export const OneDatasetOnLineTab: StoryObj<Required<
|
|
223
|
+
export const OneDatasetOnLineTab: StoryObj<Required<PrevalenceOverTimeProps>> = {
|
|
225
224
|
...OneDataset,
|
|
226
225
|
play: async ({ canvasElement }) => {
|
|
227
226
|
const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time');
|
|
@@ -232,7 +231,7 @@ export const OneDatasetOnLineTab: StoryObj<Required<PrevalenceOverTimeComponentP
|
|
|
232
231
|
},
|
|
233
232
|
};
|
|
234
233
|
|
|
235
|
-
export const OneDatasetOnBubbleTab: StoryObj<Required<
|
|
234
|
+
export const OneDatasetOnBubbleTab: StoryObj<Required<PrevalenceOverTimeProps>> = {
|
|
236
235
|
...OneDataset,
|
|
237
236
|
play: async ({ canvasElement }) => {
|
|
238
237
|
const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time');
|
|
@@ -243,7 +242,7 @@ export const OneDatasetOnBubbleTab: StoryObj<Required<PrevalenceOverTimeComponen
|
|
|
243
242
|
},
|
|
244
243
|
};
|
|
245
244
|
|
|
246
|
-
export const OneDatasetOnTableTab: StoryObj<Required<
|
|
245
|
+
export const OneDatasetOnTableTab: StoryObj<Required<PrevalenceOverTimeProps>> = {
|
|
247
246
|
...OneDataset,
|
|
248
247
|
play: async ({ canvasElement }) => {
|
|
249
248
|
const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
|
|
3
3
|
import { PrevalenceOverTime, type PrevalenceOverTimeProps } from '../../preact/prevalenceOverTime/prevalence-over-time';
|
|
4
|
-
import { type AxisMax } from '../../preact/shared/charts/getYAxisMax';
|
|
5
4
|
import { type Equals, type Expect } from '../../utils/typeAssertions';
|
|
6
5
|
import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
|
|
7
6
|
|
|
@@ -57,7 +56,7 @@ export class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyle
|
|
|
57
56
|
* It should be human-readable.
|
|
58
57
|
*
|
|
59
58
|
*/
|
|
60
|
-
@property({
|
|
59
|
+
@property({type: Object})
|
|
61
60
|
numeratorFilter:
|
|
62
61
|
{
|
|
63
62
|
lapisFilter: Record<string, string | number | null | boolean>;
|
|
@@ -66,7 +65,7 @@ export class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyle
|
|
|
66
65
|
| {
|
|
67
66
|
lapisFilter: Record<string, string | number | null | boolean>;
|
|
68
67
|
displayName: string;
|
|
69
|
-
}[] = {
|
|
68
|
+
}[] = {displayName: '', lapisFilter: {}};
|
|
70
69
|
|
|
71
70
|
/**
|
|
72
71
|
* Required.
|
|
@@ -182,11 +181,6 @@ export class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyle
|
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
183
|
|
|
185
|
-
export interface PrevalenceOverTimeComponentProps extends Omit<PrevalenceOverTimeProps, 'yAxisMaxConfig'> {
|
|
186
|
-
yAxisMaxLinear?: AxisMax;
|
|
187
|
-
yAxisMaxLogarithmic?: AxisMax;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
184
|
declare global {
|
|
191
185
|
interface HTMLElementTagNameMap {
|
|
192
186
|
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
@@ -203,6 +197,9 @@ type DenominatorMatches = Expect<
|
|
|
203
197
|
type GranularityMatches = Expect<
|
|
204
198
|
Equals<typeof PrevalenceOverTimeComponent.prototype.granularity, PrevalenceOverTimeProps['granularity']>
|
|
205
199
|
>;
|
|
200
|
+
type SmoothingWindowMatches = Expect<
|
|
201
|
+
Equals<typeof PrevalenceOverTimeComponent.prototype.smoothingWindow, PrevalenceOverTimeProps['smoothingWindow']>
|
|
202
|
+
>;
|
|
206
203
|
type ViewsMatches = Expect<
|
|
207
204
|
Equals<typeof PrevalenceOverTimeComponent.prototype.views, PrevalenceOverTimeProps['views']>
|
|
208
205
|
>;
|
|
@@ -212,4 +209,25 @@ type ConfidenceIntervalMethodsMatches = Expect<
|
|
|
212
209
|
PrevalenceOverTimeProps['confidenceIntervalMethods']
|
|
213
210
|
>
|
|
214
211
|
>;
|
|
212
|
+
type WidhtMatches = Expect<
|
|
213
|
+
Equals<typeof PrevalenceOverTimeComponent.prototype.width, PrevalenceOverTimeProps['width']>
|
|
214
|
+
>;
|
|
215
|
+
type HeightMatches = Expect<
|
|
216
|
+
Equals<typeof PrevalenceOverTimeComponent.prototype.height, PrevalenceOverTimeProps['height']>
|
|
217
|
+
>;
|
|
218
|
+
type LapisDateFieldMatches = Expect<
|
|
219
|
+
Equals<typeof PrevalenceOverTimeComponent.prototype.lapisDateField, PrevalenceOverTimeProps['lapisDateField']>
|
|
220
|
+
>;
|
|
221
|
+
type PageSizeMatches = Expect<
|
|
222
|
+
Equals<typeof PrevalenceOverTimeComponent.prototype.pageSize, PrevalenceOverTimeProps['pageSize']>
|
|
223
|
+
>;
|
|
224
|
+
type YAxisMaxLinearMatches = Expect<
|
|
225
|
+
Equals<typeof PrevalenceOverTimeComponent.prototype.yAxisMaxLinear, PrevalenceOverTimeProps['yAxisMaxLinear']>
|
|
226
|
+
>;
|
|
227
|
+
type YAxisMaxLogarithmicMatches = Expect<
|
|
228
|
+
Equals<
|
|
229
|
+
typeof PrevalenceOverTimeComponent.prototype.yAxisMaxLogarithmic,
|
|
230
|
+
PrevalenceOverTimeProps['yAxisMaxLogarithmic']
|
|
231
|
+
>
|
|
232
|
+
>;
|
|
215
233
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|