@genspectrum/dashboard-components 0.6.12 → 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 +8219 -37937
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +11 -11
- package/dist/style.css +5 -25
- package/package.json +7 -6
- package/src/operator/FetchAggregatedOperator.ts +2 -7
- package/src/preact/components/info.tsx +1 -1
- package/src/preact/components/loading-display.tsx +8 -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
|
@@ -8,15 +8,44 @@ describe('queryMutationsOverTime', () => {
|
|
|
8
8
|
const lapisFilter = { field1: 'value1', field2: 'value2' };
|
|
9
9
|
const dateField = 'dateField';
|
|
10
10
|
|
|
11
|
-
lapisRequestMocks.
|
|
12
|
-
{ ...lapisFilter, fields: [dateField] },
|
|
11
|
+
lapisRequestMocks.multipleAggregated([
|
|
13
12
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
body: { ...lapisFilter, fields: [dateField] },
|
|
14
|
+
response: {
|
|
15
|
+
data: [
|
|
16
|
+
{ count: 1, [dateField]: '2023-01-01' },
|
|
17
|
+
{ count: 2, [dateField]: '2023-01-03' },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
18
20
|
},
|
|
19
|
-
|
|
21
|
+
{
|
|
22
|
+
body: {
|
|
23
|
+
...lapisFilter,
|
|
24
|
+
dateFieldFrom: '2023-01-01',
|
|
25
|
+
dateFieldTo: '2023-01-01',
|
|
26
|
+
fields: [],
|
|
27
|
+
},
|
|
28
|
+
response: { data: [{ count: 11 }] },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
body: {
|
|
32
|
+
...lapisFilter,
|
|
33
|
+
dateFieldFrom: '2023-01-02',
|
|
34
|
+
dateFieldTo: '2023-01-02',
|
|
35
|
+
fields: [],
|
|
36
|
+
},
|
|
37
|
+
response: { data: [{ count: 12 }] },
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
body: {
|
|
41
|
+
...lapisFilter,
|
|
42
|
+
dateFieldFrom: '2023-01-03',
|
|
43
|
+
dateFieldTo: '2023-01-03',
|
|
44
|
+
fields: [],
|
|
45
|
+
},
|
|
46
|
+
response: { data: [{ count: 13 }] },
|
|
47
|
+
},
|
|
48
|
+
]);
|
|
20
49
|
|
|
21
50
|
lapisRequestMocks.multipleMutations(
|
|
22
51
|
[
|
|
@@ -53,16 +82,16 @@ describe('queryMutationsOverTime', () => {
|
|
|
53
82
|
|
|
54
83
|
const result = await queryMutationsOverTimeData(lapisFilter, 'nucleotide', DUMMY_LAPIS_URL, dateField, 'day');
|
|
55
84
|
|
|
56
|
-
expect(result.getAsArray({ count: 0, proportion: 0 })).to.deep.equal([
|
|
85
|
+
expect(result.getAsArray({ count: 0, proportion: 0, totalCount: 0 })).to.deep.equal([
|
|
57
86
|
[
|
|
58
|
-
{ proportion: 0.1, count: 1 },
|
|
59
|
-
{ proportion: 0.2, count: 2 },
|
|
60
|
-
{ proportion: 0.3, count: 3 },
|
|
87
|
+
{ proportion: 0.1, count: 1, totalCount: 11 },
|
|
88
|
+
{ proportion: 0.2, count: 2, totalCount: 12 },
|
|
89
|
+
{ proportion: 0.3, count: 3, totalCount: 13 },
|
|
61
90
|
],
|
|
62
91
|
[
|
|
63
|
-
{ proportion: 0.4, count: 4 },
|
|
64
|
-
{ proportion: 0, count: 0 },
|
|
65
|
-
{ proportion: 0, count: 0 },
|
|
92
|
+
{ proportion: 0.4, count: 4, totalCount: 11 },
|
|
93
|
+
{ proportion: 0, count: 0, totalCount: 0 },
|
|
94
|
+
{ proportion: 0, count: 0, totalCount: 0 },
|
|
66
95
|
],
|
|
67
96
|
]);
|
|
68
97
|
|
|
@@ -80,15 +109,44 @@ describe('queryMutationsOverTime', () => {
|
|
|
80
109
|
const lapisFilter = { field1: 'value1', field2: 'value2' };
|
|
81
110
|
const dateField = 'dateField';
|
|
82
111
|
|
|
83
|
-
lapisRequestMocks.
|
|
84
|
-
{
|
|
112
|
+
lapisRequestMocks.multipleAggregated([
|
|
113
|
+
{
|
|
114
|
+
body: { ...lapisFilter, fields: [dateField] },
|
|
115
|
+
response: {
|
|
116
|
+
data: [
|
|
117
|
+
{ count: 1, [dateField]: '2023-01-01' },
|
|
118
|
+
{ count: 2, [dateField]: '2023-01-03' },
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
85
122
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
123
|
+
body: {
|
|
124
|
+
...lapisFilter,
|
|
125
|
+
dateFieldFrom: '2023-01-01',
|
|
126
|
+
dateFieldTo: '2023-01-01',
|
|
127
|
+
fields: [],
|
|
128
|
+
},
|
|
129
|
+
response: { data: [{ count: 11 }] },
|
|
90
130
|
},
|
|
91
|
-
|
|
131
|
+
{
|
|
132
|
+
body: {
|
|
133
|
+
...lapisFilter,
|
|
134
|
+
dateFieldFrom: '2023-01-02',
|
|
135
|
+
dateFieldTo: '2023-01-02',
|
|
136
|
+
fields: [],
|
|
137
|
+
},
|
|
138
|
+
response: { data: [{ count: 12 }] },
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
body: {
|
|
142
|
+
...lapisFilter,
|
|
143
|
+
dateFieldFrom: '2023-01-03',
|
|
144
|
+
dateFieldTo: '2023-01-03',
|
|
145
|
+
fields: [],
|
|
146
|
+
},
|
|
147
|
+
response: { data: [{ count: 13 }] },
|
|
148
|
+
},
|
|
149
|
+
]);
|
|
92
150
|
|
|
93
151
|
lapisRequestMocks.multipleMutations(
|
|
94
152
|
[
|
|
@@ -125,16 +183,16 @@ describe('queryMutationsOverTime', () => {
|
|
|
125
183
|
|
|
126
184
|
const result = await queryMutationsOverTimeData(lapisFilter, 'nucleotide', DUMMY_LAPIS_URL, dateField, 'day');
|
|
127
185
|
|
|
128
|
-
expect(result.getAsArray({ count: 0, proportion: 0 })).to.deep.equal([
|
|
186
|
+
expect(result.getAsArray({ count: 0, proportion: 0, totalCount: 0 })).to.deep.equal([
|
|
129
187
|
[
|
|
130
|
-
{ proportion: 0.1, count: 1 },
|
|
131
|
-
{ proportion: 0.3, count: 3 },
|
|
132
|
-
{ proportion: 0, count: 0 },
|
|
188
|
+
{ proportion: 0.1, count: 1, totalCount: 11 },
|
|
189
|
+
{ proportion: 0.3, count: 3, totalCount: 13 },
|
|
190
|
+
{ proportion: 0, count: 0, totalCount: 0 },
|
|
133
191
|
],
|
|
134
192
|
[
|
|
135
|
-
{ proportion: 0.4, count: 4 },
|
|
136
|
-
{ proportion: 0, count: 0 },
|
|
137
|
-
{ proportion: 0, count: 0 },
|
|
193
|
+
{ proportion: 0.4, count: 4, totalCount: 11 },
|
|
194
|
+
{ proportion: 0, count: 0, totalCount: 0 },
|
|
195
|
+
{ proportion: 0, count: 0, totalCount: 0 },
|
|
138
196
|
],
|
|
139
197
|
]);
|
|
140
198
|
|
|
@@ -152,15 +210,44 @@ describe('queryMutationsOverTime', () => {
|
|
|
152
210
|
const lapisFilter = { field1: 'value1', field2: 'value2' };
|
|
153
211
|
const dateField = 'dateField';
|
|
154
212
|
|
|
155
|
-
lapisRequestMocks.
|
|
156
|
-
{
|
|
213
|
+
lapisRequestMocks.multipleAggregated([
|
|
214
|
+
{
|
|
215
|
+
body: { ...lapisFilter, fields: [dateField] },
|
|
216
|
+
response: {
|
|
217
|
+
data: [
|
|
218
|
+
{ count: 1, [dateField]: '2023-01-01' },
|
|
219
|
+
{ count: 2, [dateField]: '2023-01-03' },
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
},
|
|
157
223
|
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
224
|
+
body: {
|
|
225
|
+
...lapisFilter,
|
|
226
|
+
dateFieldFrom: '2023-01-01',
|
|
227
|
+
dateFieldTo: '2023-01-01',
|
|
228
|
+
fields: [],
|
|
229
|
+
},
|
|
230
|
+
response: { data: [{ count: 11 }] },
|
|
162
231
|
},
|
|
163
|
-
|
|
232
|
+
{
|
|
233
|
+
body: {
|
|
234
|
+
...lapisFilter,
|
|
235
|
+
dateFieldFrom: '2023-01-02',
|
|
236
|
+
dateFieldTo: '2023-01-02',
|
|
237
|
+
fields: [],
|
|
238
|
+
},
|
|
239
|
+
response: { data: [{ count: 12 }] },
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
body: {
|
|
243
|
+
...lapisFilter,
|
|
244
|
+
dateFieldFrom: '2023-01-03',
|
|
245
|
+
dateFieldTo: '2023-01-03',
|
|
246
|
+
fields: [],
|
|
247
|
+
},
|
|
248
|
+
response: { data: [{ count: 13 }] },
|
|
249
|
+
},
|
|
250
|
+
]);
|
|
164
251
|
|
|
165
252
|
lapisRequestMocks.multipleMutations(
|
|
166
253
|
[
|
|
@@ -197,7 +284,7 @@ describe('queryMutationsOverTime', () => {
|
|
|
197
284
|
|
|
198
285
|
const result = await queryMutationsOverTimeData(lapisFilter, 'nucleotide', DUMMY_LAPIS_URL, dateField, 'day');
|
|
199
286
|
|
|
200
|
-
expect(result.getAsArray({ count: 0, proportion: 0 })).to.deep.equal([]);
|
|
287
|
+
expect(result.getAsArray({ count: 0, proportion: 0, totalCount: 0 })).to.deep.equal([]);
|
|
201
288
|
expect(result.getFirstAxisKeys()).to.deep.equal([]);
|
|
202
289
|
expect(result.getSecondAxisKeys()).to.deep.equal([]);
|
|
203
290
|
});
|
|
@@ -206,15 +293,35 @@ describe('queryMutationsOverTime', () => {
|
|
|
206
293
|
const dateField = 'dateField';
|
|
207
294
|
const lapisFilter = { field1: 'value1', field2: 'value2', [`${dateField}From`]: '2023-01-02' };
|
|
208
295
|
|
|
209
|
-
lapisRequestMocks.
|
|
210
|
-
{
|
|
296
|
+
lapisRequestMocks.multipleAggregated([
|
|
297
|
+
{
|
|
298
|
+
body: { ...lapisFilter, fields: [dateField] },
|
|
299
|
+
response: {
|
|
300
|
+
data: [
|
|
301
|
+
{ count: 1, [dateField]: '2023-01-01' },
|
|
302
|
+
{ count: 2, [dateField]: '2023-01-03' },
|
|
303
|
+
],
|
|
304
|
+
},
|
|
305
|
+
},
|
|
211
306
|
{
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
307
|
+
body: {
|
|
308
|
+
...lapisFilter,
|
|
309
|
+
dateFieldFrom: '2023-01-02',
|
|
310
|
+
dateFieldTo: '2023-01-02',
|
|
311
|
+
fields: [],
|
|
312
|
+
},
|
|
313
|
+
response: { data: [{ count: 11 }] },
|
|
216
314
|
},
|
|
217
|
-
|
|
315
|
+
{
|
|
316
|
+
body: {
|
|
317
|
+
...lapisFilter,
|
|
318
|
+
dateFieldFrom: '2023-01-03',
|
|
319
|
+
dateFieldTo: '2023-01-03',
|
|
320
|
+
fields: [],
|
|
321
|
+
},
|
|
322
|
+
response: { data: [{ count: 12 }] },
|
|
323
|
+
},
|
|
324
|
+
]);
|
|
218
325
|
|
|
219
326
|
lapisRequestMocks.multipleMutations(
|
|
220
327
|
[
|
|
@@ -242,10 +349,10 @@ describe('queryMutationsOverTime', () => {
|
|
|
242
349
|
|
|
243
350
|
const result = await queryMutationsOverTimeData(lapisFilter, 'nucleotide', DUMMY_LAPIS_URL, dateField, 'day');
|
|
244
351
|
|
|
245
|
-
expect(result.getAsArray({ count: 0, proportion: 0 })).to.deep.equal([
|
|
352
|
+
expect(result.getAsArray({ count: 0, proportion: 0, totalCount: 0 })).to.deep.equal([
|
|
246
353
|
[
|
|
247
|
-
{ proportion: 0.2, count: 2 },
|
|
248
|
-
{ proportion: 0.3, count: 3 },
|
|
354
|
+
{ proportion: 0.2, count: 2, totalCount: 11 },
|
|
355
|
+
{ proportion: 0.3, count: 3, totalCount: 12 },
|
|
249
356
|
],
|
|
250
357
|
]);
|
|
251
358
|
|
|
@@ -261,15 +368,35 @@ describe('queryMutationsOverTime', () => {
|
|
|
261
368
|
const dateField = 'dateField';
|
|
262
369
|
const lapisFilter = { field1: 'value1', field2: 'value2', [`${dateField}To`]: '2023-01-02' };
|
|
263
370
|
|
|
264
|
-
lapisRequestMocks.
|
|
265
|
-
{ ...lapisFilter, fields: [dateField] },
|
|
371
|
+
lapisRequestMocks.multipleAggregated([
|
|
266
372
|
{
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
373
|
+
body: { ...lapisFilter, fields: [dateField] },
|
|
374
|
+
response: {
|
|
375
|
+
data: [
|
|
376
|
+
{ count: 1, [dateField]: '2023-01-01' },
|
|
377
|
+
{ count: 2, [dateField]: '2023-01-03' },
|
|
378
|
+
],
|
|
379
|
+
},
|
|
271
380
|
},
|
|
272
|
-
|
|
381
|
+
{
|
|
382
|
+
body: {
|
|
383
|
+
...lapisFilter,
|
|
384
|
+
dateFieldFrom: '2023-01-01',
|
|
385
|
+
dateFieldTo: '2023-01-01',
|
|
386
|
+
fields: [],
|
|
387
|
+
},
|
|
388
|
+
response: { data: [{ count: 11 }] },
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
body: {
|
|
392
|
+
...lapisFilter,
|
|
393
|
+
dateFieldFrom: '2023-01-02',
|
|
394
|
+
dateFieldTo: '2023-01-02',
|
|
395
|
+
fields: [],
|
|
396
|
+
},
|
|
397
|
+
response: { data: [{ count: 12 }] },
|
|
398
|
+
},
|
|
399
|
+
]);
|
|
273
400
|
|
|
274
401
|
lapisRequestMocks.multipleMutations(
|
|
275
402
|
[
|
|
@@ -297,10 +424,10 @@ describe('queryMutationsOverTime', () => {
|
|
|
297
424
|
|
|
298
425
|
const result = await queryMutationsOverTimeData(lapisFilter, 'nucleotide', DUMMY_LAPIS_URL, dateField, 'day');
|
|
299
426
|
|
|
300
|
-
expect(result.getAsArray({ count: 0, proportion: 0 })).to.deep.equal([
|
|
427
|
+
expect(result.getAsArray({ count: 0, proportion: 0, totalCount: 0 })).to.deep.equal([
|
|
301
428
|
[
|
|
302
|
-
{ proportion: 0.1, count: 1 },
|
|
303
|
-
{ proportion: 0.2, count: 2 },
|
|
429
|
+
{ proportion: 0.1, count: 1, totalCount: 11 },
|
|
430
|
+
{ proportion: 0.2, count: 2, totalCount: 12 },
|
|
304
431
|
],
|
|
305
432
|
]);
|
|
306
433
|
|
|
@@ -316,15 +443,26 @@ describe('queryMutationsOverTime', () => {
|
|
|
316
443
|
const dateField = 'dateField';
|
|
317
444
|
const lapisFilter = { field1: 'value1', field2: 'value2', [dateField]: '2023-01-02' };
|
|
318
445
|
|
|
319
|
-
lapisRequestMocks.
|
|
320
|
-
{ ...lapisFilter, fields: [dateField] },
|
|
446
|
+
lapisRequestMocks.multipleAggregated([
|
|
321
447
|
{
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
448
|
+
body: { ...lapisFilter, fields: [dateField] },
|
|
449
|
+
response: {
|
|
450
|
+
data: [
|
|
451
|
+
{ count: 1, [dateField]: '2023-01-01' },
|
|
452
|
+
{ count: 2, [dateField]: '2023-01-03' },
|
|
453
|
+
],
|
|
454
|
+
},
|
|
326
455
|
},
|
|
327
|
-
|
|
456
|
+
{
|
|
457
|
+
body: {
|
|
458
|
+
...lapisFilter,
|
|
459
|
+
dateFieldFrom: '2023-01-02',
|
|
460
|
+
dateFieldTo: '2023-01-02',
|
|
461
|
+
fields: [],
|
|
462
|
+
},
|
|
463
|
+
response: { data: [{ count: 11 }] },
|
|
464
|
+
},
|
|
465
|
+
]);
|
|
328
466
|
|
|
329
467
|
lapisRequestMocks.multipleMutations(
|
|
330
468
|
[
|
|
@@ -343,7 +481,15 @@ describe('queryMutationsOverTime', () => {
|
|
|
343
481
|
|
|
344
482
|
const result = await queryMutationsOverTimeData(lapisFilter, 'nucleotide', DUMMY_LAPIS_URL, dateField, 'day');
|
|
345
483
|
|
|
346
|
-
expect(result.getAsArray({ count: 0, proportion: 0 })).to.deep.equal([
|
|
484
|
+
expect(result.getAsArray({ count: 0, proportion: 0, totalCount: 0 })).to.deep.equal([
|
|
485
|
+
[
|
|
486
|
+
{
|
|
487
|
+
proportion: 0.2,
|
|
488
|
+
count: 2,
|
|
489
|
+
totalCount: 11,
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
]);
|
|
347
493
|
|
|
348
494
|
const sequences = result.getFirstAxisKeys();
|
|
349
495
|
expect(sequences[0].code).toBe('sequenceName:A123T');
|
|
@@ -25,9 +25,10 @@ import {
|
|
|
25
25
|
export type MutationOverTimeData = {
|
|
26
26
|
date: Temporal;
|
|
27
27
|
mutations: SubstitutionOrDeletionEntry[];
|
|
28
|
+
totalCount: number;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
export type MutationOverTimeMutationValue = { proportion: number; count: number };
|
|
31
|
+
export type MutationOverTimeMutationValue = { proportion: number; count: number; totalCount: number };
|
|
31
32
|
export type MutationOverTimeDataGroupedByMutation = Map2d<
|
|
32
33
|
Substitution | Deletion,
|
|
33
34
|
Temporal,
|
|
@@ -75,9 +76,11 @@ export async function queryMutationsOverTimeData(
|
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
const data = await fetchAndPrepareSubstitutionsOrDeletions(filter, sequenceType).evaluate(lapis, signal);
|
|
79
|
+
const totalCountQuery = await getTotalNumberOfSequencesInDateRange(filter).evaluate(lapis, signal);
|
|
78
80
|
return {
|
|
79
81
|
date,
|
|
80
82
|
mutations: data.content,
|
|
83
|
+
totalCount: totalCountQuery.content[0].count,
|
|
81
84
|
};
|
|
82
85
|
});
|
|
83
86
|
|
|
@@ -164,6 +167,7 @@ export function groupByMutation(data: MutationOverTimeData[]) {
|
|
|
164
167
|
dataArray.set(mutationEntry.mutation, mutationData.date, {
|
|
165
168
|
count: mutationEntry.count,
|
|
166
169
|
proportion: mutationEntry.proportion,
|
|
170
|
+
totalCount: mutationData.totalCount,
|
|
167
171
|
});
|
|
168
172
|
});
|
|
169
173
|
});
|
|
@@ -181,8 +185,12 @@ function addZeroValuesForDatesWithNoMutationData(
|
|
|
181
185
|
const someMutation = dataArray.getFirstAxisKeys()[0];
|
|
182
186
|
data.forEach((mutationData) => {
|
|
183
187
|
if (mutationData.mutations.length === 0) {
|
|
184
|
-
dataArray.set(someMutation, mutationData.date, { count: 0, proportion: 0 });
|
|
188
|
+
dataArray.set(someMutation, mutationData.date, { count: 0, proportion: 0, totalCount: 0 });
|
|
185
189
|
}
|
|
186
190
|
});
|
|
187
191
|
}
|
|
188
192
|
}
|
|
193
|
+
|
|
194
|
+
function getTotalNumberOfSequencesInDateRange(filter: LapisFilter) {
|
|
195
|
+
return new FetchAggregatedOperator<{ count: number }>(filter);
|
|
196
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
|
|
3
|
-
import { DateRangeSelector } from '../../preact/dateRangeSelector/date-range-selector';
|
|
4
|
-
import { type CustomSelectOption, type PresetOptionValues } from '../../preact/dateRangeSelector/selectableOptions';
|
|
3
|
+
import { DateRangeSelector, type DateRangeSelectorProps } from '../../preact/dateRangeSelector/date-range-selector';
|
|
5
4
|
import { type Equals, type Expect } from '../../utils/typeAssertions';
|
|
6
5
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
7
6
|
|
|
@@ -129,9 +128,30 @@ declare global {
|
|
|
129
128
|
|
|
130
129
|
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
131
130
|
type CustomSelectOptionsMatches = Expect<
|
|
132
|
-
Equals<
|
|
131
|
+
Equals<
|
|
132
|
+
typeof DateRangeSelectorComponent.prototype.customSelectOptions,
|
|
133
|
+
DateRangeSelectorProps<string>['customSelectOptions']
|
|
134
|
+
>
|
|
135
|
+
>;
|
|
136
|
+
type EarliestDateMatches = Expect<
|
|
137
|
+
Equals<typeof DateRangeSelectorComponent.prototype.earliestDate, DateRangeSelectorProps<string>['earliestDate']>
|
|
133
138
|
>;
|
|
134
139
|
type InitialValueMatches = Expect<
|
|
135
|
-
Equals<typeof DateRangeSelectorComponent.prototype.initialValue,
|
|
140
|
+
Equals<typeof DateRangeSelectorComponent.prototype.initialValue, DateRangeSelectorProps<string>['initialValue']>
|
|
141
|
+
>;
|
|
142
|
+
type InitialDateFromMatches = Expect<
|
|
143
|
+
Equals<
|
|
144
|
+
typeof DateRangeSelectorComponent.prototype.initialDateFrom,
|
|
145
|
+
DateRangeSelectorProps<string>['initialDateFrom']
|
|
146
|
+
>
|
|
147
|
+
>;
|
|
148
|
+
type InitialDateToMatches = Expect<
|
|
149
|
+
Equals<typeof DateRangeSelectorComponent.prototype.initialDateTo, DateRangeSelectorProps<string>['initialDateTo']>
|
|
150
|
+
>;
|
|
151
|
+
type WidthMatches = Expect<
|
|
152
|
+
Equals<typeof DateRangeSelectorComponent.prototype.width, DateRangeSelectorProps<string>['width']>
|
|
153
|
+
>;
|
|
154
|
+
type DateColumnMatches = Expect<
|
|
155
|
+
Equals<typeof DateRangeSelectorComponent.prototype.dateColumn, DateRangeSelectorProps<string>['dateColumn']>
|
|
136
156
|
>;
|
|
137
157
|
/* 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 { 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 */
|