@genspectrum/dashboard-components 0.1.1 → 0.1.3
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 +1 -1
- package/custom-elements.json +151 -1
- package/dist/dashboard-components.js +164 -62
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +63 -23
- package/package.json +1 -1
- package/src/lapisApi/lapisApi.ts +1 -1
- package/src/preact/aggregatedData/__mockData__/aggregated.json +585 -0
- package/src/preact/aggregatedData/aggregate-table.tsx +32 -0
- package/src/preact/aggregatedData/aggregate.stories.tsx +53 -0
- package/src/preact/aggregatedData/aggregate.tsx +98 -0
- package/src/query/queryAggregateData.spec.ts +32 -0
- package/src/query/queryAggregateData.ts +25 -0
- package/src/web-components/display/aggregate-component.mdx +25 -0
- package/src/web-components/display/aggregate-component.stories.ts +63 -0
- package/src/web-components/display/aggregate-component.tsx +51 -0
- package/src/web-components/display/index.ts +1 -0
- package/src/web-components/input/location-filter-component.stories.ts +2 -4
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"count": 3,
|
|
5
|
+
"division": "Mclean",
|
|
6
|
+
"host": "Homo sapiens"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"count": 1,
|
|
10
|
+
"division": "Woodbridge",
|
|
11
|
+
"host": "Homo sapiens"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"count": 9,
|
|
15
|
+
"division": "Fairfax",
|
|
16
|
+
"host": "Homo sapiens"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"count": 7,
|
|
20
|
+
"division": "Waynesboro",
|
|
21
|
+
"host": "Homo sapiens"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"count": 2,
|
|
25
|
+
"division": "Crozet",
|
|
26
|
+
"host": "Homo sapiens"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"count": 1,
|
|
30
|
+
"division": "Fishersville",
|
|
31
|
+
"host": "Homo sapiens"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"count": 6,
|
|
35
|
+
"division": "Alexandria",
|
|
36
|
+
"host": "Homo sapiens"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"count": 2,
|
|
40
|
+
"division": "Burke",
|
|
41
|
+
"host": "Homo sapiens"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"count": 1,
|
|
45
|
+
"division": "Chantilly",
|
|
46
|
+
"host": "Homo sapiens"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"count": 2,
|
|
50
|
+
"division": "Florida",
|
|
51
|
+
"host": "Gorilla"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"count": 1,
|
|
55
|
+
"division": "Temple Hills",
|
|
56
|
+
"host": "Homo sapiens"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"count": 1,
|
|
60
|
+
"division": "North America",
|
|
61
|
+
"host": "Homo sapiens"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"count": 3,
|
|
65
|
+
"division": "Texas",
|
|
66
|
+
"host": "Felis catus"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"count": 1,
|
|
70
|
+
"division": "Chesapeake",
|
|
71
|
+
"host": "Homo sapiens"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"count": 1,
|
|
75
|
+
"division": "USA",
|
|
76
|
+
"host": "Chlorocebus sabaeus"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"count": 45,
|
|
80
|
+
"division": "South Dakota",
|
|
81
|
+
"host": null
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"count": 2,
|
|
85
|
+
"division": "Afton",
|
|
86
|
+
"host": "Homo sapiens"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"count": 61,
|
|
90
|
+
"division": "Idaho",
|
|
91
|
+
"host": null
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"count": 1,
|
|
95
|
+
"division": "New York",
|
|
96
|
+
"host": "Panthera tigris jacksoni"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"count": 103,
|
|
100
|
+
"division": "USA",
|
|
101
|
+
"host": "Mink"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"count": 15,
|
|
105
|
+
"division": "USA",
|
|
106
|
+
"host": "Panthera leo"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"count": 14,
|
|
110
|
+
"division": "Louisiana",
|
|
111
|
+
"host": null
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"count": 1,
|
|
115
|
+
"division": "Paeonian Springs",
|
|
116
|
+
"host": "Homo sapiens"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"count": 2,
|
|
120
|
+
"division": "USA",
|
|
121
|
+
"host": "Crocuta crocuta"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"count": 34963,
|
|
125
|
+
"division": "West Virginia",
|
|
126
|
+
"host": "Homo sapiens"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"count": 11,
|
|
130
|
+
"division": "Falls Church",
|
|
131
|
+
"host": "Homo sapiens"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"count": 15258,
|
|
135
|
+
"division": "Alaska",
|
|
136
|
+
"host": "Homo sapiens"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"count": 1,
|
|
140
|
+
"division": "Great Falls",
|
|
141
|
+
"host": "Homo sapiens"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"count": 3,
|
|
145
|
+
"division": "Arlington",
|
|
146
|
+
"host": "Homo sapiens"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"count": 30502,
|
|
150
|
+
"division": "Arkansas",
|
|
151
|
+
"host": "Homo sapiens"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"count": 20748,
|
|
155
|
+
"division": "Rhode Island",
|
|
156
|
+
"host": "Homo sapiens"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"count": 5,
|
|
160
|
+
"division": "USA",
|
|
161
|
+
"host": "Panthera tigris"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"count": 8179,
|
|
165
|
+
"division": "Delaware",
|
|
166
|
+
"host": "Homo sapiens"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"count": 88083,
|
|
170
|
+
"division": "Michigan",
|
|
171
|
+
"host": "Homo sapiens"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"count": 6,
|
|
175
|
+
"division": "Springfield",
|
|
176
|
+
"host": "Homo sapiens"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"count": 25760,
|
|
180
|
+
"division": "Oregon",
|
|
181
|
+
"host": "Homo sapiens"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"count": 1,
|
|
185
|
+
"division": "Chilhowie",
|
|
186
|
+
"host": "Homo sapiens"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"count": 28786,
|
|
190
|
+
"division": "Oklahoma",
|
|
191
|
+
"host": "Homo sapiens"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"count": 1,
|
|
195
|
+
"division": "Fairfax Station",
|
|
196
|
+
"host": "Homo sapiens"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"count": 5,
|
|
200
|
+
"division": "Vienna",
|
|
201
|
+
"host": "Homo sapiens"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"count": 1,
|
|
205
|
+
"division": "Mt Solon",
|
|
206
|
+
"host": "Homo sapiens"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"count": 45100,
|
|
210
|
+
"division": "Wisconsin",
|
|
211
|
+
"host": "Homo sapiens"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"count": 1,
|
|
215
|
+
"division": "Severn",
|
|
216
|
+
"host": "Homo sapiens"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"count": 45510,
|
|
220
|
+
"division": "Maryland",
|
|
221
|
+
"host": "Homo sapiens"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"count": 21888,
|
|
225
|
+
"division": "Utah",
|
|
226
|
+
"host": "Homo sapiens"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"count": 24993,
|
|
230
|
+
"division": "Iowa",
|
|
231
|
+
"host": "Homo sapiens"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"count": 11587,
|
|
235
|
+
"division": "Washington DC",
|
|
236
|
+
"host": "Homo sapiens"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"count": 1,
|
|
240
|
+
"division": "Texas",
|
|
241
|
+
"host": "Canis lupus familiaris"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"count": 3,
|
|
245
|
+
"division": "Florida",
|
|
246
|
+
"host": null
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"count": 2,
|
|
250
|
+
"division": "Virginia Beach",
|
|
251
|
+
"host": "Homo sapiens"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"count": 49605,
|
|
255
|
+
"division": "Ohio",
|
|
256
|
+
"host": "Homo sapiens"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"count": 115921,
|
|
260
|
+
"division": "Washington",
|
|
261
|
+
"host": "Homo sapiens"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"count": 2095,
|
|
265
|
+
"division": "North Dakota",
|
|
266
|
+
"host": "Homo sapiens"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"count": 1,
|
|
270
|
+
"division": "Ohio",
|
|
271
|
+
"host": null
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"count": 34825,
|
|
275
|
+
"division": "Indiana",
|
|
276
|
+
"host": "Homo sapiens"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"count": 14,
|
|
280
|
+
"division": "Annandale",
|
|
281
|
+
"host": "Homo sapiens"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"count": 1,
|
|
285
|
+
"division": "Florida",
|
|
286
|
+
"host": "environment"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"count": 164,
|
|
290
|
+
"division": "New York",
|
|
291
|
+
"host": "Odocoileus virginianus"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"count": 1,
|
|
295
|
+
"division": "Beltsville",
|
|
296
|
+
"host": "Homo sapiens"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"count": 2,
|
|
300
|
+
"division": "Wisconsin",
|
|
301
|
+
"host": "Tadarida brasiliensis"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"count": 11110,
|
|
305
|
+
"division": "Kansas",
|
|
306
|
+
"host": "Homo sapiens"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"count": 3,
|
|
310
|
+
"division": "Florida",
|
|
311
|
+
"host": "Felis catus"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"count": 2554,
|
|
315
|
+
"division": "Wyoming",
|
|
316
|
+
"host": "Homo sapiens"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"count": 629330,
|
|
320
|
+
"division": "USA",
|
|
321
|
+
"host": "Homo sapiens"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"count": 91359,
|
|
325
|
+
"division": "New York",
|
|
326
|
+
"host": "Homo sapiens"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"count": 94,
|
|
330
|
+
"division": "USA",
|
|
331
|
+
"host": "Odocoileus virginianus"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"count": 813,
|
|
335
|
+
"division": "Guam",
|
|
336
|
+
"host": "Homo sapiens"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"count": 5,
|
|
340
|
+
"division": "American Samoa",
|
|
341
|
+
"host": "Homo sapiens"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"count": 3,
|
|
345
|
+
"division": "Virginia",
|
|
346
|
+
"host": "Panthera tigris"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"count": 148,
|
|
350
|
+
"division": "USA",
|
|
351
|
+
"host": null
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"count": 2,
|
|
355
|
+
"division": "USA",
|
|
356
|
+
"host": "Canis lupus familiaris"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"count": 7,
|
|
360
|
+
"division": "Pennsylvania",
|
|
361
|
+
"host": "Odocoileus virginianus"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"count": 34513,
|
|
365
|
+
"division": "South Carolina",
|
|
366
|
+
"host": "Homo sapiens"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"count": 42887,
|
|
370
|
+
"division": "Tennessee",
|
|
371
|
+
"host": "Homo sapiens"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"count": 81680,
|
|
375
|
+
"division": "Pennsylvania",
|
|
376
|
+
"host": "Homo sapiens"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"count": 174794,
|
|
380
|
+
"division": "Massachusetts",
|
|
381
|
+
"host": "Homo sapiens"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"count": 25595,
|
|
385
|
+
"division": "Vermont",
|
|
386
|
+
"host": "Homo sapiens"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"count": 72995,
|
|
390
|
+
"division": "Illinois",
|
|
391
|
+
"host": "Homo sapiens"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"count": 1,
|
|
395
|
+
"division": "Harrisonburg",
|
|
396
|
+
"host": "Homo sapiens"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"count": 194563,
|
|
400
|
+
"division": "Florida",
|
|
401
|
+
"host": "Homo sapiens"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"count": 1,
|
|
405
|
+
"division": "Stafford",
|
|
406
|
+
"host": "Homo sapiens"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"count": 19,
|
|
410
|
+
"division": "USA",
|
|
411
|
+
"host": "Mustela putorius furo"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"count": 44032,
|
|
415
|
+
"division": "New Mexico",
|
|
416
|
+
"host": "Homo sapiens"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"count": 8377,
|
|
420
|
+
"division": "South Dakota",
|
|
421
|
+
"host": "Homo sapiens"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"count": 1763,
|
|
425
|
+
"division": "Virgin Islands",
|
|
426
|
+
"host": "Homo sapiens"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"count": 1,
|
|
430
|
+
"division": "Virginia",
|
|
431
|
+
"host": "Felis catus"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"count": 78943,
|
|
435
|
+
"division": "Virginia",
|
|
436
|
+
"host": "Homo sapiens"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"count": 18835,
|
|
440
|
+
"division": "Louisiana",
|
|
441
|
+
"host": "Homo sapiens"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"count": 6152,
|
|
445
|
+
"division": "Hawaii",
|
|
446
|
+
"host": "Homo sapiens"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"count": 11851,
|
|
450
|
+
"division": "Mississippi",
|
|
451
|
+
"host": "Homo sapiens"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"count": 141274,
|
|
455
|
+
"division": "Texas",
|
|
456
|
+
"host": "Homo sapiens"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"count": 29034,
|
|
460
|
+
"division": "Connecticut",
|
|
461
|
+
"host": "Homo sapiens"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"count": 29016,
|
|
465
|
+
"division": "Nevada",
|
|
466
|
+
"host": "Homo sapiens"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"count": 90776,
|
|
470
|
+
"division": "North Carolina",
|
|
471
|
+
"host": "Homo sapiens"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"count": 8909,
|
|
475
|
+
"division": "Maine",
|
|
476
|
+
"host": "Homo sapiens"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"count": 130742,
|
|
480
|
+
"division": "Minnesota",
|
|
481
|
+
"host": "Homo sapiens"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"count": 25723,
|
|
485
|
+
"division": "Missouri",
|
|
486
|
+
"host": "Homo sapiens"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"count": 92606,
|
|
490
|
+
"division": "New Jersey",
|
|
491
|
+
"host": "Homo sapiens"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"count": 2,
|
|
495
|
+
"division": "Minnesota",
|
|
496
|
+
"host": "Odocoileus virginianus"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"count": 79863,
|
|
500
|
+
"division": "Colorado",
|
|
501
|
+
"host": "Homo sapiens"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"count": 7549,
|
|
505
|
+
"division": "Puerto Rico",
|
|
506
|
+
"host": "Homo sapiens"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"count": 1,
|
|
510
|
+
"division": "Grottoes",
|
|
511
|
+
"host": "Homo sapiens"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"count": 15919,
|
|
515
|
+
"division": "Idaho",
|
|
516
|
+
"host": "Homo sapiens"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"count": 2,
|
|
520
|
+
"division": "Indiana",
|
|
521
|
+
"host": "Felis catus"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"count": 2,
|
|
525
|
+
"division": "USA",
|
|
526
|
+
"host": "environment"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"count": 23475,
|
|
530
|
+
"division": "Nebraska",
|
|
531
|
+
"host": "Homo sapiens"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"count": 8868,
|
|
535
|
+
"division": "Montana",
|
|
536
|
+
"host": "Homo sapiens"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"count": 15,
|
|
540
|
+
"division": "USA",
|
|
541
|
+
"host": "Mustela lutreola"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"count": 18418,
|
|
545
|
+
"division": "Kentucky",
|
|
546
|
+
"host": "Homo sapiens"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"count": 17399,
|
|
550
|
+
"division": "Alabama",
|
|
551
|
+
"host": "Homo sapiens"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"count": 71522,
|
|
555
|
+
"division": "Arizona",
|
|
556
|
+
"host": "Homo sapiens"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"count": 3459,
|
|
560
|
+
"division": "Northern Mariana Islands",
|
|
561
|
+
"host": "Homo sapiens"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"count": 13625,
|
|
565
|
+
"division": "New Hampshire",
|
|
566
|
+
"host": "Homo sapiens"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"count": 67576,
|
|
570
|
+
"division": "Georgia",
|
|
571
|
+
"host": "Homo sapiens"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"count": 365045,
|
|
575
|
+
"division": "California",
|
|
576
|
+
"host": "Homo sapiens"
|
|
577
|
+
}
|
|
578
|
+
],
|
|
579
|
+
"info": {
|
|
580
|
+
"dataVersion": "1712315293",
|
|
581
|
+
"requestId": "4603a85e-ae5e-495d-aee5-778a3af862c1",
|
|
582
|
+
"requestInfo": "sars_cov-2_nextstrain_open on s1.int.genspectrum.org at 2024-04-24T15:31:40.596677441",
|
|
583
|
+
"reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report."
|
|
584
|
+
}
|
|
585
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type FunctionComponent } from 'preact';
|
|
2
|
+
|
|
3
|
+
import { type AggregateData } from '../../query/queryAggregateData';
|
|
4
|
+
import { Table } from '../components/table';
|
|
5
|
+
import { formatProportion } from '../shared/table/formatProportion';
|
|
6
|
+
|
|
7
|
+
type AggregateTableProps = {
|
|
8
|
+
fields: string[];
|
|
9
|
+
data: AggregateData;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const AggregateTable: FunctionComponent<AggregateTableProps> = ({ data, fields }) => {
|
|
13
|
+
const headers = [
|
|
14
|
+
...fields.map((field) => {
|
|
15
|
+
return {
|
|
16
|
+
name: field,
|
|
17
|
+
sort: true,
|
|
18
|
+
};
|
|
19
|
+
}),
|
|
20
|
+
{
|
|
21
|
+
name: 'count',
|
|
22
|
+
sort: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'proportion',
|
|
26
|
+
sort: true,
|
|
27
|
+
formatter: (cell: number) => formatProportion(cell),
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
return <Table data={data} columns={headers} pagination={true} />;
|
|
32
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/preact';
|
|
2
|
+
|
|
3
|
+
import aggregatedData from './__mockData__/aggregated.json';
|
|
4
|
+
import { Aggregate, type AggregateProps } from './aggregate';
|
|
5
|
+
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
|
|
6
|
+
import { LapisUrlContext } from '../LapisUrlContext';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<AggregateProps> = {
|
|
9
|
+
title: 'Visualization/Aggregate',
|
|
10
|
+
component: Aggregate,
|
|
11
|
+
argTypes: {
|
|
12
|
+
fields: [{ control: 'object' }],
|
|
13
|
+
},
|
|
14
|
+
parameters: {
|
|
15
|
+
fetchMock: {
|
|
16
|
+
mocks: [
|
|
17
|
+
{
|
|
18
|
+
matcher: {
|
|
19
|
+
name: 'aggregatedData',
|
|
20
|
+
url: AGGREGATED_ENDPOINT,
|
|
21
|
+
body: {
|
|
22
|
+
fields: ['division', 'host'],
|
|
23
|
+
country: 'USA',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
response: {
|
|
27
|
+
status: 200,
|
|
28
|
+
body: aggregatedData,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
37
|
+
|
|
38
|
+
export const Default: StoryObj<AggregateProps> = {
|
|
39
|
+
render: (args) => (
|
|
40
|
+
<div class='max-w-screen-lg'>
|
|
41
|
+
<LapisUrlContext.Provider value={LAPIS_URL}>
|
|
42
|
+
<Aggregate {...args} />
|
|
43
|
+
</LapisUrlContext.Provider>
|
|
44
|
+
</div>
|
|
45
|
+
),
|
|
46
|
+
args: {
|
|
47
|
+
fields: ['division', 'host'],
|
|
48
|
+
views: ['table'],
|
|
49
|
+
filter: {
|
|
50
|
+
country: 'USA',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|