@genspectrum/dashboard-components 0.10.4 → 0.11.1

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.
Files changed (53) hide show
  1. package/custom-elements.json +58 -58
  2. package/dist/components.d.ts +82 -32
  3. package/dist/components.js +57 -65
  4. package/dist/components.js.map +1 -1
  5. package/dist/{dateRangeOption-Doo6WHKu.js → dateRangeOption-Bh2p78z0.js} +9 -4
  6. package/dist/dateRangeOption-Bh2p78z0.js.map +1 -0
  7. package/dist/util.d.ts +623 -14
  8. package/dist/util.js +1 -1
  9. package/package.json +5 -5
  10. package/src/preact/aggregatedData/aggregate.stories.tsx +1 -1
  11. package/src/preact/aggregatedData/aggregate.tsx +11 -8
  12. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +3 -11
  13. package/src/preact/dateRangeSelector/date-range-selector.tsx +4 -4
  14. package/src/preact/mutationComparison/mutation-comparison.tsx +4 -6
  15. package/src/preact/mutationFilter/mutation-filter.tsx +4 -13
  16. package/src/preact/mutations/mutations.tsx +4 -4
  17. package/src/preact/mutationsOverTime/mutations-over-time.tsx +4 -4
  18. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +4 -13
  19. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -4
  20. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +14 -25
  21. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +8 -8
  22. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +3 -14
  23. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +11 -7
  24. package/src/query/queryNumberOfSequencesOverTime.spec.ts +4 -4
  25. package/src/query/queryNumberOfSequencesOverTime.ts +1 -4
  26. package/src/query/queryPrevalenceOverTime.ts +1 -4
  27. package/src/types.ts +11 -4
  28. package/src/utilEntrypoint.ts +17 -4
  29. package/src/utils/utils.ts +0 -29
  30. package/src/web-components/app.ts +1 -1
  31. package/src/web-components/input/gs-date-range-selector.stories.ts +4 -4
  32. package/src/web-components/input/gs-date-range-selector.tsx +5 -5
  33. package/src/web-components/input/gs-lineage-filter.tsx +1 -1
  34. package/src/web-components/input/gs-location-filter.tsx +1 -1
  35. package/src/web-components/input/gs-mutation-filter.tsx +5 -8
  36. package/src/web-components/input/gs-text-input.tsx +1 -1
  37. package/src/web-components/visualization/gs-aggregate.stories.ts +3 -3
  38. package/src/web-components/visualization/gs-aggregate.tsx +10 -6
  39. package/src/web-components/visualization/gs-mutation-comparison.tsx +7 -2
  40. package/src/web-components/visualization/gs-mutations-over-time.tsx +7 -2
  41. package/src/web-components/visualization/gs-mutations.tsx +7 -2
  42. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +5 -5
  43. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +13 -15
  44. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -8
  45. package/src/web-components/visualization/gs-prevalence-over-time.tsx +17 -14
  46. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +4 -5
  47. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +17 -15
  48. package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -1
  49. package/src/web-components/visualization/gs-statistics.tsx +12 -3
  50. package/standalone-bundle/dashboard-components.js +2520 -2516
  51. package/standalone-bundle/dashboard-components.js.map +1 -1
  52. package/dist/dateRangeOption-Doo6WHKu.js.map +0 -1
  53. package/src/utils/utils.spec.ts +0 -16
@@ -290,7 +290,7 @@
290
290
  "type": {
291
291
  "text": "Meta<Required<DateRangeSelectorProps>>"
292
292
  },
293
- "default": "{ title: 'Input/DateRangeSelector', component: 'gs-date-range-selector', parameters: withComponentDocs({ actions: { handles: ['gs-date-range-filter-changed', 'gs-date-range-option-changed', ...previewHandles], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'select', }, options: [dateRangeOptionPresets.lastMonth.label, dateRangeOptionPresets.allTimes.label, 'CustomDateRange'], }, dateColumn: { control: { type: 'text' } }, dateRangeOptions: { control: { type: 'object', }, }, earliestDate: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, args: { dateRangeOptions: [ dateRangeOptionPresets.lastMonth, dateRangeOptionPresets.last3Months, dateRangeOptionPresets.allTimes, customDateRange, ], earliestDate: '1970-01-01', initialValue: dateRangeOptionPresets.lastMonth.label, dateColumn: 'aDateColumn', width: '100%', initialDateFrom: undefined, initialDateTo: undefined, }, tags: ['autodocs'], }"
293
+ "default": "{ title: 'Input/DateRangeSelector', component: 'gs-date-range-selector', parameters: withComponentDocs({ actions: { handles: ['gs-date-range-filter-changed', 'gs-date-range-option-changed', ...previewHandles], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'select', }, options: [dateRangeOptionPresets.lastMonth.label, dateRangeOptionPresets.allTimes.label, 'CustomDateRange'], }, lapisDateField: { control: { type: 'text' } }, dateRangeOptions: { control: { type: 'object', }, }, earliestDate: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, args: { dateRangeOptions: [ dateRangeOptionPresets.lastMonth, dateRangeOptionPresets.last3Months, dateRangeOptionPresets.allTimes, customDateRange, ], earliestDate: '1970-01-01', initialValue: dateRangeOptionPresets.lastMonth.label, lapisDateField: 'aDateColumn', width: '100%', initialDateFrom: undefined, initialDateTo: undefined, }, tags: ['autodocs'], }"
294
294
  },
295
295
  {
296
296
  "kind": "variable",
@@ -298,7 +298,7 @@
298
298
  "type": {
299
299
  "text": "StoryObj<Required<DateRangeSelectorProps>>"
300
300
  },
301
- "default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-screen-lg\"> <gs-date-range-selector .dateRangeOptions=${args.dateRangeOptions} .earliestDate=${args.earliestDate} .initialValue=${args.initialValue} .initialDateFrom=${args.initialDateFrom} .initialDateTo=${args.initialDateTo} .width=${args.width} .dateColumn=${args.dateColumn} ></gs-date-range-selector> </div> </gs-app>`, }"
301
+ "default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-screen-lg\"> <gs-date-range-selector .dateRangeOptions=${args.dateRangeOptions} .earliestDate=${args.earliestDate} .initialValue=${args.initialValue} .initialDateFrom=${args.initialDateFrom} .initialDateTo=${args.initialDateTo} .width=${args.width} .lapisDateField=${args.lapisDateField} ></gs-date-range-selector> </div> </gs-app>`, }"
302
302
  },
303
303
  {
304
304
  "kind": "variable",
@@ -407,13 +407,13 @@
407
407
  },
408
408
  {
409
409
  "kind": "field",
410
- "name": "dateColumn",
410
+ "name": "lapisDateField",
411
411
  "type": {
412
412
  "text": "string"
413
413
  },
414
414
  "default": "''",
415
- "description": "The name of the column in LAPIS that contains the date information.",
416
- "attribute": "dateColumn"
415
+ "description": "The name of the metadata field in LAPIS that contains the date information.",
416
+ "attribute": "lapisDateField"
417
417
  }
418
418
  ],
419
419
  "events": [
@@ -488,13 +488,13 @@
488
488
  "fieldName": "width"
489
489
  },
490
490
  {
491
- "name": "dateColumn",
491
+ "name": "lapisDateField",
492
492
  "type": {
493
493
  "text": "string"
494
494
  },
495
495
  "default": "''",
496
- "description": "The name of the column in LAPIS that contains the date information.",
497
- "fieldName": "dateColumn"
496
+ "description": "The name of the metadata field in LAPIS that contains the date information.",
497
+ "fieldName": "lapisDateField"
498
498
  }
499
499
  ],
500
500
  "superclass": {
@@ -1377,7 +1377,7 @@
1377
1377
  "type": {
1378
1378
  "text": "StoryObj<Required<AggregateProps>>"
1379
1379
  },
1380
- "default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <gs-aggregate .fields=${args.fields} .filter=${args.filter} .views=${args.views} .width=${args.width} .height=${args.height} .initialSortField=${args.initialSortField} .initialSortDirection=${args.initialSortDirection} .pageSize=${args.pageSize} ></gs-aggregate> </gs-app> `, args: { fields: ['division', 'host'], views: ['table'], filter: { country: 'USA', }, width: '100%', height: '700px', initialSortField: 'count', initialSortDirection: 'descending', pageSize: 10, }, }"
1380
+ "default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <gs-aggregate .fields=${args.fields} .lapisFilter=${args.lapisFilter} .views=${args.views} .width=${args.width} .height=${args.height} .initialSortField=${args.initialSortField} .initialSortDirection=${args.initialSortDirection} .pageSize=${args.pageSize} ></gs-aggregate> </gs-app> `, args: { fields: ['division', 'host'], views: ['table'], lapisFilter: { country: 'USA', }, width: '100%', height: '700px', initialSortField: 'count', initialSortDirection: 'descending', pageSize: 10, }, }"
1381
1381
  }
1382
1382
  ],
1383
1383
  "exports": [
@@ -1422,7 +1422,7 @@
1422
1422
  "kind": "field",
1423
1423
  "name": "views",
1424
1424
  "type": {
1425
- "text": "View[]"
1425
+ "text": "AggregateView[]"
1426
1426
  },
1427
1427
  "default": "['table']",
1428
1428
  "description": "A list of tabs with views that this component should provide.",
@@ -1430,13 +1430,13 @@
1430
1430
  },
1431
1431
  {
1432
1432
  "kind": "field",
1433
- "name": "filter",
1433
+ "name": "lapisFilter",
1434
1434
  "type": {
1435
- "text": "LapisFilter"
1435
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
1436
1436
  },
1437
1437
  "default": "{}",
1438
1438
  "description": "The filter to apply to the data.\nIt must be a valid LAPIS filter object.",
1439
- "attribute": "filter"
1439
+ "attribute": "lapisFilter"
1440
1440
  },
1441
1441
  {
1442
1442
  "kind": "field",
@@ -1502,20 +1502,20 @@
1502
1502
  {
1503
1503
  "name": "views",
1504
1504
  "type": {
1505
- "text": "View[]"
1505
+ "text": "AggregateView[]"
1506
1506
  },
1507
1507
  "default": "['table']",
1508
1508
  "description": "A list of tabs with views that this component should provide.",
1509
1509
  "fieldName": "views"
1510
1510
  },
1511
1511
  {
1512
- "name": "filter",
1512
+ "name": "lapisFilter",
1513
1513
  "type": {
1514
- "text": "LapisFilter"
1514
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
1515
1515
  },
1516
1516
  "default": "{}",
1517
1517
  "description": "The filter to apply to the data.\nIt must be a valid LAPIS filter object.",
1518
- "fieldName": "filter"
1518
+ "fieldName": "lapisFilter"
1519
1519
  },
1520
1520
  {
1521
1521
  "name": "width",
@@ -1659,7 +1659,7 @@
1659
1659
  "kind": "field",
1660
1660
  "name": "lapisFilters",
1661
1661
  "type": {
1662
- "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
1662
+ "text": "{\n lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n };\n displayName: string;\n }[]"
1663
1663
  },
1664
1664
  "default": "[]",
1665
1665
  "description": "Required.\n\nAn array of LAPIS filters to select the data to compare.\n\nThe `lapisFilter` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used as the label for the filtered dataset in the views.\nIt should be human-readable.",
@@ -1720,7 +1720,7 @@
1720
1720
  {
1721
1721
  "name": "lapisFilters",
1722
1722
  "type": {
1723
- "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
1723
+ "text": "{\n lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n };\n displayName: string;\n }[]"
1724
1724
  },
1725
1725
  "default": "[]",
1726
1726
  "description": "Required.\n\nAn array of LAPIS filters to select the data to compare.\n\nThe `lapisFilter` will be sent as is to LAPIS to filter the mutation data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used as the label for the filtered dataset in the views.\nIt should be human-readable.",
@@ -1900,7 +1900,7 @@
1900
1900
  "kind": "field",
1901
1901
  "name": "lapisFilter",
1902
1902
  "type": {
1903
- "text": "Record<string, string | number | null | boolean>"
1903
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
1904
1904
  },
1905
1905
  "default": "{}",
1906
1906
  "description": "LAPIS filter to select the displayed data. If not provided, all data is displayed.",
@@ -1971,7 +1971,7 @@
1971
1971
  {
1972
1972
  "name": "lapisFilter",
1973
1973
  "type": {
1974
- "text": "Record<string, string | number | null | boolean>"
1974
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
1975
1975
  },
1976
1976
  "default": "{}",
1977
1977
  "description": "LAPIS filter to select the displayed data. If not provided, all data is displayed.",
@@ -2144,7 +2144,7 @@
2144
2144
  "kind": "field",
2145
2145
  "name": "lapisFilter",
2146
2146
  "type": {
2147
- "text": "Record<string, string | number | null | boolean>"
2147
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
2148
2148
  },
2149
2149
  "default": "{}",
2150
2150
  "description": "LAPIS filter to select the displayed data. If not provided, all data is displayed.",
@@ -2205,7 +2205,7 @@
2205
2205
  {
2206
2206
  "name": "lapisFilter",
2207
2207
  "type": {
2208
- "text": "Record<string, string | number | null | boolean>"
2208
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
2209
2209
  },
2210
2210
  "default": "{}",
2211
2211
  "description": "LAPIS filter to select the displayed data. If not provided, all data is displayed.",
@@ -2326,7 +2326,7 @@
2326
2326
  "type": {
2327
2327
  "text": "StoryObj<NumberSequencesOverTimeProps>"
2328
2328
  },
2329
- "default": "{ ...Template, args: { ...Template.args, lapisFilter: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2022-10-01' }, }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregatedEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2022-10-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsEG, }, }, { matcher: { name: 'aggregatedJN.1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsJN1, }, }, ], }, }, }"
2329
+ "default": "{ ...Template, args: { ...Template.args, lapisFilters: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2022-10-01' }, }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregatedEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2022-10-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsEG, }, }, { matcher: { name: 'aggregatedJN.1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsJN1, }, }, ], }, }, }"
2330
2330
  },
2331
2331
  {
2332
2332
  "kind": "variable",
@@ -2334,7 +2334,7 @@
2334
2334
  "type": {
2335
2335
  "text": "StoryObj<NumberSequencesOverTimeProps>"
2336
2336
  },
2337
- "default": "{ ...Template, args: { ...Template.args, lapisFilter: [ { displayName: 'XBB', lapisFilter: { country: 'USA', pangoLineage: 'XBB*', dateFrom: '2022-01-01', dateTo: '2022-12-31' }, }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregatedEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'XBB*', dateFrom: '2022-01-01', dateTo: '2022-12-31', fields: ['date'], }, }, response: { status: 200, body: twoVariantsXBB, }, }, { matcher: { name: 'aggregatedJN.1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsJN1, }, }, ], }, }, }"
2337
+ "default": "{ ...Template, args: { ...Template.args, lapisFilters: [ { displayName: 'XBB', lapisFilter: { country: 'USA', pangoLineage: 'XBB*', dateFrom: '2022-01-01', dateTo: '2022-12-31' }, }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregatedEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'XBB*', dateFrom: '2022-01-01', dateTo: '2022-12-31', fields: ['date'], }, }, response: { status: 200, body: twoVariantsXBB, }, }, { matcher: { name: 'aggregatedJN.1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: twoVariantsJN1, }, }, ], }, }, }"
2338
2338
  }
2339
2339
  ],
2340
2340
  "exports": [
@@ -2399,13 +2399,13 @@
2399
2399
  "members": [
2400
2400
  {
2401
2401
  "kind": "field",
2402
- "name": "lapisFilter",
2402
+ "name": "lapisFilters",
2403
2403
  "type": {
2404
- "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
2404
+ "text": "{\n lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n };\n displayName: string;\n }[]"
2405
2405
  },
2406
- "default": "{ displayName: '', lapisFilter: {} }",
2406
+ "default": "[]",
2407
2407
  "description": "Either a LAPIS filter or an array of LAPIS filters to fetch the number of sequences for.\n\nThe `lapisFilter` will be sent as is to LAPIS to select the data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used to label the component views.\nIt should be human-readable.",
2408
- "attribute": "lapisFilter"
2408
+ "attribute": "lapisFilters"
2409
2409
  },
2410
2410
  {
2411
2411
  "kind": "field",
@@ -2480,13 +2480,13 @@
2480
2480
  ],
2481
2481
  "attributes": [
2482
2482
  {
2483
- "name": "lapisFilter",
2483
+ "name": "lapisFilters",
2484
2484
  "type": {
2485
- "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
2485
+ "text": "{\n lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n };\n displayName: string;\n }[]"
2486
2486
  },
2487
- "default": "{ displayName: '', lapisFilter: {} }",
2487
+ "default": "[]",
2488
2488
  "description": "Either a LAPIS filter or an array of LAPIS filters to fetch the number of sequences for.\n\nThe `lapisFilter` will be sent as is to LAPIS to select the data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used to label the component views.\nIt should be human-readable.",
2489
- "fieldName": "lapisFilter"
2489
+ "fieldName": "lapisFilters"
2490
2490
  },
2491
2491
  {
2492
2492
  "name": "lapisDateField",
@@ -2589,7 +2589,7 @@
2589
2589
  "type": {
2590
2590
  "text": "Meta<Required<PrevalenceOverTimeProps>>"
2591
2591
  },
2592
- "default": "{ title: 'Visualization/Prevalence over time', component: 'gs-prevalence-over-time', argTypes: { numeratorFilter: { control: 'object' }, denominatorFilter: { control: 'object' }, granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, smoothingWindow: { control: 'number' }, views: { options: ['bar', 'line', 'bubble', 'table'], control: { type: 'check' }, }, confidenceIntervalMethods: { options: ['none', 'wilson'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, pageSize: { control: 'object' }, yAxisMaxLinear: { control: 'object' }, yAxisMaxLogarithmic: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
2592
+ "default": "{ title: 'Visualization/Prevalence over time', component: 'gs-prevalence-over-time', argTypes: { granularity: { options: ['day', 'week', 'month', 'year'], control: { type: 'radio' }, }, smoothingWindow: { control: 'number' }, views: { options: ['bar', 'line', 'bubble', 'table'], control: { type: 'check' }, }, confidenceIntervalMethods: { options: ['none', 'wilson'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, pageSize: { control: 'object' }, yAxisMaxLinear: { control: 'object' }, yAxisMaxLogarithmic: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
2593
2593
  },
2594
2594
  {
2595
2595
  "kind": "variable",
@@ -2597,7 +2597,7 @@
2597
2597
  "type": {
2598
2598
  "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
2599
2599
  },
2600
- "default": "{ ...Template, args: { numeratorFilter: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' } }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], denominatorFilter: { country: 'USA', dateFrom: '2023-01-01' }, granularity: 'month', smoothingWindow: 0, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px', lapisDateField: 'date', pageSize: 10, yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterEG, }, }, { matcher: { name: 'numeratorJN1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterJN1, }, }, { matcher: { name: 'denominator', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilter, }, }, ], }, }, }"
2600
+ "default": "{ ...Template, args: { numeratorFilters: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' } }, { displayName: 'JN.1', lapisFilter: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' } }, ], denominatorFilter: { country: 'USA', dateFrom: '2023-01-01' }, granularity: 'month', smoothingWindow: 0, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px', lapisDateField: 'date', pageSize: 10, yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorEG', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterEG, }, }, { matcher: { name: 'numeratorJN1', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterJN1, }, }, { matcher: { name: 'denominator', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-01-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilter, }, }, ], }, }, }"
2601
2601
  },
2602
2602
  {
2603
2603
  "kind": "variable",
@@ -2605,7 +2605,7 @@
2605
2605
  "type": {
2606
2606
  "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
2607
2607
  },
2608
- "default": "{ ...Template, args: { numeratorFilter: { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' }, }, denominatorFilter: { country: 'USA', dateFrom: '2023-10-01' }, granularity: 'week', smoothingWindow: 2, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px', lapisDateField: 'date', pageSize: 10, yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorOneDataset', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterOneDataset, }, }, { matcher: { name: 'denominatorOneDataset', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilterOneDataset, }, }, ], }, }, }"
2608
+ "default": "{ ...Template, args: { numeratorFilters: [ { displayName: 'EG', lapisFilter: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' }, }, ], denominatorFilter: { country: 'USA', dateFrom: '2023-10-01' }, granularity: 'week', smoothingWindow: 2, views: ['bar', 'line', 'bubble', 'table'], confidenceIntervalMethods: ['wilson'], width: '100%', height: '700px', lapisDateField: 'date', pageSize: 10, yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorOneDataset', url: AGGREGATED_ENDPOINT, body: { country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilterOneDataset, }, }, { matcher: { name: 'denominatorOneDataset', url: AGGREGATED_ENDPOINT, body: { country: 'USA', dateFrom: '2023-10-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilterOneDataset, }, }, ], }, }, }"
2609
2609
  },
2610
2610
  {
2611
2611
  "kind": "variable",
@@ -2694,19 +2694,19 @@
2694
2694
  "members": [
2695
2695
  {
2696
2696
  "kind": "field",
2697
- "name": "numeratorFilter",
2697
+ "name": "numeratorFilters",
2698
2698
  "type": {
2699
- "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
2699
+ "text": "{\n lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n };\n displayName: string;\n }[]"
2700
2700
  },
2701
- "default": "{ displayName: '', lapisFilter: {} }",
2701
+ "default": "[]",
2702
2702
  "description": "Either a LAPIS filter or an array of LAPIS filters to calculate the prevalence for.\n\nThe `lapisFilter` will be sent as is to LAPIS to select the data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used as the label the prevalence in the views.\nIt should be human-readable.",
2703
- "attribute": "numeratorFilter"
2703
+ "attribute": "numeratorFilters"
2704
2704
  },
2705
2705
  {
2706
2706
  "kind": "field",
2707
2707
  "name": "denominatorFilter",
2708
2708
  "type": {
2709
- "text": "Record<string, string | number | null | boolean>"
2709
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
2710
2710
  },
2711
2711
  "default": "{}",
2712
2712
  "description": "The LAPIS filter, to select the data of the reference.\nIt must be a valid LAPIS filter object.",
@@ -2815,18 +2815,18 @@
2815
2815
  ],
2816
2816
  "attributes": [
2817
2817
  {
2818
- "name": "numeratorFilter",
2818
+ "name": "numeratorFilters",
2819
2819
  "type": {
2820
- "text": "{\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }\n | {\n lapisFilter: Record<string, string | number | null | boolean>;\n displayName: string;\n }[]"
2820
+ "text": "{\n lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n };\n displayName: string;\n }[]"
2821
2821
  },
2822
- "default": "{ displayName: '', lapisFilter: {} }",
2822
+ "default": "[]",
2823
2823
  "description": "Either a LAPIS filter or an array of LAPIS filters to calculate the prevalence for.\n\nThe `lapisFilter` will be sent as is to LAPIS to select the data.\nIt must be a valid LAPIS filter object.\n\nThe `displayName` will be used as the label the prevalence in the views.\nIt should be human-readable.",
2824
- "fieldName": "numeratorFilter"
2824
+ "fieldName": "numeratorFilters"
2825
2825
  },
2826
2826
  {
2827
2827
  "name": "denominatorFilter",
2828
2828
  "type": {
2829
- "text": "Record<string, string | number | null | boolean>"
2829
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
2830
2830
  },
2831
2831
  "default": "{}",
2832
2832
  "description": "The LAPIS filter, to select the data of the reference.\nIt must be a valid LAPIS filter object.",
@@ -2958,7 +2958,7 @@
2958
2958
  "kind": "variable",
2959
2959
  "name": "meta",
2960
2960
  "type": {
2961
- "text": "Meta<RelativeGrowthAdvantageComponentProps>"
2961
+ "text": "Meta<RelativeGrowthAdvantageProps>"
2962
2962
  },
2963
2963
  "default": "{ title: 'Visualization/Relative growth advantage', component: 'gs-relative-growth-advantage', argTypes: { numeratorFilter: { control: 'object' }, denominatorFilter: { control: 'object' }, generationTime: { control: 'number' }, views: { options: ['line'], control: { type: 'check' }, }, width: { control: 'text' }, height: { control: 'text' }, yAxisMaxLinear: { control: 'object' }, yAxisMaxLogarithmic: { control: 'object' }, }, parameters: withComponentDocs({ componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
2964
2964
  },
@@ -2966,7 +2966,7 @@
2966
2966
  "kind": "variable",
2967
2967
  "name": "Default",
2968
2968
  "type": {
2969
- "text": "StoryObj<Required<RelativeGrowthAdvantageComponentProps>>"
2969
+ "text": "StoryObj<Required<RelativeGrowthAdvantageProps>>"
2970
2970
  },
2971
2971
  "default": "{ ...Template, args: { numeratorFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01', }, denominatorFilter: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01' }, generationTime: 7, views: ['line'], width: '100%', height: '700px', lapisDateField: 'date', yAxisMaxLinear: 1, yAxisMaxLogarithmic: 'limitTo1', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'numeratorFilter', url: AGGREGATED_ENDPOINT, body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01', fields: ['date'], }, }, response: { status: 200, body: numeratorFilter, }, }, { matcher: { name: 'denominatorFilter', url: AGGREGATED_ENDPOINT, body: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01', fields: ['date'], }, }, response: { status: 200, body: denominatorFilter, }, }, ], }, }, }"
2972
2972
  }
@@ -3003,7 +3003,7 @@
3003
3003
  "kind": "field",
3004
3004
  "name": "numeratorFilter",
3005
3005
  "type": {
3006
- "text": "Record<string, string | number | null | boolean>"
3006
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3007
3007
  },
3008
3008
  "default": "{}",
3009
3009
  "description": "LAPIS filter to select the data of the focal variant.\nIt must be a valid LAPIS filter object.",
@@ -3013,7 +3013,7 @@
3013
3013
  "kind": "field",
3014
3014
  "name": "denominatorFilter",
3015
3015
  "type": {
3016
- "text": "Record<string, string | number | null | boolean>"
3016
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3017
3017
  },
3018
3018
  "default": "{}",
3019
3019
  "description": "LAPIS filter to select the data of the baseline variant.\nIt must be a valid LAPIS filter object.",
@@ -3094,7 +3094,7 @@
3094
3094
  {
3095
3095
  "name": "numeratorFilter",
3096
3096
  "type": {
3097
- "text": "Record<string, string | number | null | boolean>"
3097
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3098
3098
  },
3099
3099
  "default": "{}",
3100
3100
  "description": "LAPIS filter to select the data of the focal variant.\nIt must be a valid LAPIS filter object.",
@@ -3103,7 +3103,7 @@
3103
3103
  {
3104
3104
  "name": "denominatorFilter",
3105
3105
  "type": {
3106
- "text": "Record<string, string | number | null | boolean>"
3106
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3107
3107
  },
3108
3108
  "default": "{}",
3109
3109
  "description": "LAPIS filter to select the data of the baseline variant.\nIt must be a valid LAPIS filter object.",
@@ -3285,7 +3285,7 @@
3285
3285
  "kind": "field",
3286
3286
  "name": "lapisFilter",
3287
3287
  "type": {
3288
- "text": "Record<string, string | number | null | boolean>"
3288
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3289
3289
  },
3290
3290
  "default": "{}",
3291
3291
  "description": "LAPIS filter to select the displayed data.\nIf you want to display the distribution over the states of a certain country,\nyou should usually filter by that country here (e.g. { country: 'USA' }).",
@@ -3396,7 +3396,7 @@
3396
3396
  {
3397
3397
  "name": "lapisFilter",
3398
3398
  "type": {
3399
- "text": "Record<string, string | number | null | boolean>"
3399
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3400
3400
  },
3401
3401
  "default": "{}",
3402
3402
  "description": "LAPIS filter to select the displayed data.\nIf you want to display the distribution over the states of a certain country,\nyou should usually filter by that country here (e.g. { country: 'USA' }).",
@@ -3573,7 +3573,7 @@
3573
3573
  "kind": "field",
3574
3574
  "name": "numeratorFilter",
3575
3575
  "type": {
3576
- "text": "LapisFilter"
3576
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3577
3577
  },
3578
3578
  "default": "{}",
3579
3579
  "description": "The filter to apply to the data for the overall number of sequences and as the numerator for the proportion.\nIt must be a valid LAPIS filter object.",
@@ -3583,7 +3583,7 @@
3583
3583
  "kind": "field",
3584
3584
  "name": "denominatorFilter",
3585
3585
  "type": {
3586
- "text": "LapisFilter"
3586
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3587
3587
  },
3588
3588
  "default": "{}",
3589
3589
  "description": "The filter to apply to the data for the denominator of the proportion.\nIt must be a valid LAPIS filter object.",
@@ -3614,7 +3614,7 @@
3614
3614
  {
3615
3615
  "name": "numeratorFilter",
3616
3616
  "type": {
3617
- "text": "LapisFilter"
3617
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3618
3618
  },
3619
3619
  "default": "{}",
3620
3620
  "description": "The filter to apply to the data for the overall number of sequences and as the numerator for the proportion.\nIt must be a valid LAPIS filter object.",
@@ -3623,7 +3623,7 @@
3623
3623
  {
3624
3624
  "name": "denominatorFilter",
3625
3625
  "type": {
3626
- "text": "LapisFilter"
3626
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3627
3627
  },
3628
3628
  "default": "{}",
3629
3629
  "description": "The filter to apply to the data for the denominator of the proportion.\nIt must be a valid LAPIS filter object.",