@genspectrum/dashboard-components 0.10.3 → 0.11.0

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 (80) hide show
  1. package/custom-elements.json +384 -56
  2. package/dist/assets/mutationOverTimeWorker-BjjkMGzd.js.map +1 -0
  3. package/dist/components.d.ts +250 -31
  4. package/dist/components.js +1220 -198
  5. package/dist/components.js.map +1 -1
  6. package/dist/{dateRangeOption-DjtcAEWq.js → dateRangeOption-Bh2p78z0.js} +11 -5
  7. package/dist/dateRangeOption-Bh2p78z0.js.map +1 -0
  8. package/dist/style.css +5 -1
  9. package/dist/util.d.ts +626 -16
  10. package/dist/util.js +1 -1
  11. package/package.json +13 -7
  12. package/src/preact/aggregatedData/aggregate.stories.tsx +2 -2
  13. package/src/preact/aggregatedData/aggregate.tsx +11 -8
  14. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +4 -12
  15. package/src/preact/dateRangeSelector/date-range-selector.tsx +4 -4
  16. package/src/preact/lineageFilter/lineage-filter.stories.tsx +1 -1
  17. package/src/preact/locationFilter/location-filter.stories.tsx +1 -1
  18. package/src/preact/map/__mockData__/aggregatedGermany.json +83 -0
  19. package/src/preact/map/__mockData__/aggregatedWorld.json +259 -0
  20. package/src/preact/map/__mockData__/germanyMap.json +9083 -0
  21. package/src/preact/map/__mockData__/howToGenerateWorldMap.md +9 -0
  22. package/src/preact/map/__mockData__/worldAtlas.json +497127 -0
  23. package/src/preact/map/leafletStyleModifications.css +3 -0
  24. package/src/preact/map/sequences-by-location-map.tsx +202 -0
  25. package/src/preact/map/sequences-by-location-table.tsx +18 -0
  26. package/src/preact/map/sequences-by-location.stories.tsx +144 -0
  27. package/src/preact/map/sequences-by-location.tsx +151 -0
  28. package/src/preact/map/useGeoJsonMap.tsx +62 -0
  29. package/src/preact/mutationComparison/mutation-comparison.tsx +5 -7
  30. package/src/preact/mutationFilter/mutation-filter.tsx +4 -13
  31. package/src/preact/mutations/mutations.tsx +4 -4
  32. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +1 -1
  33. package/src/preact/mutationsOverTime/mutations-over-time.tsx +4 -4
  34. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +5 -14
  35. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -4
  36. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +15 -26
  37. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +8 -8
  38. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +4 -15
  39. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +11 -7
  40. package/src/preact/shared/stories/expectErrorMessage.ts +21 -0
  41. package/src/preact/textInput/text-input.stories.tsx +1 -1
  42. package/src/preact/useQuery.ts +9 -1
  43. package/src/query/queryNumberOfSequencesOverTime.spec.ts +4 -4
  44. package/src/query/queryNumberOfSequencesOverTime.ts +1 -4
  45. package/src/query/queryPrevalenceOverTime.ts +1 -4
  46. package/src/styles/tailwind.css +1 -1
  47. package/src/types.ts +12 -4
  48. package/src/utilEntrypoint.ts +16 -4
  49. package/src/utils/utils.ts +0 -29
  50. package/src/web-components/app.ts +1 -1
  51. package/src/web-components/input/gs-date-range-selector.stories.ts +4 -4
  52. package/src/web-components/input/gs-date-range-selector.tsx +5 -5
  53. package/src/web-components/input/gs-lineage-filter.tsx +1 -1
  54. package/src/web-components/input/gs-location-filter.tsx +1 -1
  55. package/src/web-components/input/gs-mutation-filter.tsx +5 -8
  56. package/src/web-components/input/gs-text-input.tsx +1 -1
  57. package/src/web-components/visualization/gs-aggregate.stories.ts +3 -3
  58. package/src/web-components/visualization/gs-aggregate.tsx +10 -6
  59. package/src/web-components/visualization/gs-mutation-comparison.tsx +7 -2
  60. package/src/web-components/visualization/gs-mutations-over-time.tsx +7 -2
  61. package/src/web-components/visualization/gs-mutations.tsx +7 -2
  62. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +5 -5
  63. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +13 -15
  64. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -8
  65. package/src/web-components/visualization/gs-prevalence-over-time.tsx +17 -14
  66. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +4 -5
  67. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +17 -15
  68. package/src/web-components/visualization/gs-sequences-by-location.stories.ts +234 -0
  69. package/src/web-components/visualization/gs-sequences-by-location.tsx +258 -0
  70. package/src/web-components/visualization/gs-statistics.tsx +12 -3
  71. package/src/web-components/visualization/index.ts +1 -0
  72. package/standalone-bundle/assets/mutationOverTimeWorker-DoUBht2e.js.map +1 -0
  73. package/standalone-bundle/dashboard-components.js +16208 -9408
  74. package/standalone-bundle/dashboard-components.js.map +1 -1
  75. package/standalone-bundle/style.css +1 -1
  76. package/dist/assets/mutationOverTimeWorker-CNg_ztNp.js.map +0 -1
  77. package/dist/dateRangeOption-DjtcAEWq.js.map +0 -1
  78. package/src/preact/shared/stories/expectInvalidAttributesErrorMessage.ts +0 -13
  79. package/src/utils/utils.spec.ts +0 -16
  80. package/standalone-bundle/assets/mutationOverTimeWorker-cIyshfj_.js.map +0 -1
@@ -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.",
@@ -3200,6 +3200,326 @@
3200
3200
  }
3201
3201
  ]
3202
3202
  },
3203
+ {
3204
+ "kind": "javascript-module",
3205
+ "path": "src/web-components/visualization/gs-sequences-by-location.stories.ts",
3206
+ "declarations": [
3207
+ {
3208
+ "kind": "variable",
3209
+ "name": "meta",
3210
+ "type": {
3211
+ "text": "Meta<Required<SequencesByLocationProps>>"
3212
+ },
3213
+ "default": "{ title: 'Visualization/Sequences by location', component: 'gs-sequences-by-location', argTypes: {}, parameters: withComponentDocs({ fetchMock: { mocks: [ { matcher: { name: 'aggregatedData', url: AGGREGATED_ENDPOINT, body: { fields: ['division', 'host'], country: 'USA', }, }, response: { status: 200, body: aggregatedData, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
3214
+ },
3215
+ {
3216
+ "kind": "variable",
3217
+ "name": "WorldMap",
3218
+ "type": {
3219
+ "text": "StoryObj<SequencesByLocationProps>"
3220
+ },
3221
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { dateFrom: '2022-01-01', dateTo: '2022-04-01' }, lapisLocationField: 'country', mapSource: { type: 'topojson', url: mockMapUrl, topologyObjectsKey: 'countries', }, zoom: 2, offsetX: 0, offsetY: 10, }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'worldMap', url: mockMapUrl, }, response: { status: 200, body: worldAtlas, }, }, { matcher: { name: 'aggregatedData', url: AGGREGATED_ENDPOINT, body: { fields: ['country'], dateFrom: '2022-01-01', dateTo: '2022-04-01', }, }, response: { status: 200, body: aggregatedWorld, }, }, ], }, }, }"
3222
+ },
3223
+ {
3224
+ "kind": "variable",
3225
+ "name": "Germany",
3226
+ "type": {
3227
+ "text": "StoryObj<SequencesByLocationProps>"
3228
+ },
3229
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { dateFrom: '2022-01-01', dateTo: '2022-04-01', country: 'Germany' }, lapisLocationField: 'division', mapSource: { type: 'topojson', url: mockMapUrl, topologyObjectsKey: 'deu', }, views: ['map', 'table'], zoom: 6.3, offsetX: 10, offsetY: 51.4, }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'worldMap', url: mockMapUrl, }, response: { status: 200, body: mapOfGermany, }, }, { matcher: { name: 'aggregatedData', url: AGGREGATED_ENDPOINT, body: { fields: ['division'], dateFrom: '2022-01-01', dateTo: '2022-04-01', country: 'Germany', }, }, response: { status: 200, body: aggregatedGermany, }, }, ], }, }, }"
3230
+ },
3231
+ {
3232
+ "kind": "variable",
3233
+ "name": "GermanyTableOnly",
3234
+ "type": {
3235
+ "text": "StoryObj<SequencesByLocationProps>"
3236
+ },
3237
+ "default": "{ render: (args) => html` <gs-app lapis=\"${LAPIS_URL}\"> <gs-sequences-by-location .lapisFilter=${args.lapisFilter} .lapisLocationField=${args.lapisLocationField} .width=${args.width} .height=${args.height} .views=${args.views} .pageSize=${args.pageSize} ></gs-sequences-by-location> </gs-app> `, args: { lapisFilter: { dateFrom: '2022-01-01', dateTo: '2022-04-01', country: 'Germany' }, lapisLocationField: 'division', width: '100%', height: '700px', views: ['table'], pageSize: 10, }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregatedData', url: AGGREGATED_ENDPOINT, body: { fields: ['division'], dateFrom: '2022-01-01', dateTo: '2022-04-01', country: 'Germany', }, }, response: { status: 200, body: aggregatedGermany, }, }, ], }, }, }"
3238
+ }
3239
+ ],
3240
+ "exports": [
3241
+ {
3242
+ "kind": "js",
3243
+ "name": "default",
3244
+ "declaration": {
3245
+ "name": "meta",
3246
+ "module": "src/web-components/visualization/gs-sequences-by-location.stories.ts"
3247
+ }
3248
+ },
3249
+ {
3250
+ "kind": "js",
3251
+ "name": "WorldMap",
3252
+ "declaration": {
3253
+ "name": "WorldMap",
3254
+ "module": "src/web-components/visualization/gs-sequences-by-location.stories.ts"
3255
+ }
3256
+ },
3257
+ {
3258
+ "kind": "js",
3259
+ "name": "Germany",
3260
+ "declaration": {
3261
+ "name": "Germany",
3262
+ "module": "src/web-components/visualization/gs-sequences-by-location.stories.ts"
3263
+ }
3264
+ },
3265
+ {
3266
+ "kind": "js",
3267
+ "name": "GermanyTableOnly",
3268
+ "declaration": {
3269
+ "name": "GermanyTableOnly",
3270
+ "module": "src/web-components/visualization/gs-sequences-by-location.stories.ts"
3271
+ }
3272
+ }
3273
+ ]
3274
+ },
3275
+ {
3276
+ "kind": "javascript-module",
3277
+ "path": "src/web-components/visualization/gs-sequences-by-location.tsx",
3278
+ "declarations": [
3279
+ {
3280
+ "kind": "class",
3281
+ "description": "## Context\n\nThis component shows the geographic distribution of sequence data from LAPIS.\nIt displays the count and proportion (number of sample per `lapisLocationField` / number of samples matching the `lapisFilter`)\nof the data by location.\n\n## Views\n\n### Map View\n\nThis view displays a chloropleth map based on [Leaflet](https://leafletjs.com/).\nThe component expects a `mapSource` object that specifies where the map data can be downloaded from.\nWe can imagine that we add other map source types later (for example, GeoJSON).\n\n#### TopoJSON\n\nSuppose you provide this example object as `mapSource`:\n\n```json\n{\n \"type\": \"topojson\",\n \"url\": \"https://example.com/map.topojson\",\n \"topologyObjectsKey\": \"myObjectKey\"\n}\n```\n\nThe URL must point to a [TopoJSON file](https://github.com/topojson/topojson) that contains the map data.\nThe TopoJSON file must schematically look like this,\nwhere `objects[topologyObjectsKey]` must be a valid GeometryCollection (`objects.myObjectKey` in this example):\n\n```json\n{\n \"type\": \"Topology\",\n \"objects\": {\n \"myObjectKey\": {\n \"type\": \"GeometryCollection\",\n \"geometries\": [\n {\n \"type\": \"Polygon\",\n \"properties\": {\n \"name\": \"North Rhine Westphalia\"\n },\n \"id\": \"DE.NW\",\n \"arcs\": [...]\n },\n ...\n ]\n }\n },\n \"arcs\": [...],\n \"transform\": {...}\n}\n```\n\nYou can use any valid TopoJSON file.\nhttps://github.com/markmarkoh/datamaps/tree/master/src/js/data contains TopoJSON files for many countries.\n\nThe `lapisFilter` is used to select the data to display, and it is aggregated by the `lapisLocationField`.\nThis component assumes that every geometry object in the TopoJSON file has a `properties.name` field.\n\nThe values that LAPIS returns for `lapisLocationField` must match the `properties.name` in the map data.\nLAPIS entries where `lapisLocationField` is `null` are ignored on the map.\n\nThe names of the locations in the TopoJSON map and in LAPIS should match.\nHowever, there are two cases of misalignment:\n- If there is a LAPIS location that does not match any location in the TopoJSON map,\n the component will log a console warning to assist in creating map data that aligns with the LAPIS data.\n- If a TopoJSON location does not match any LAPIS location for the given filter,\n no data will be displayed for this location.\n This is expected, as LAPIS will only return locations where sequences have been collected for that filter.\n\n### Table View\n\nThis view displays the data in a table format.\nIt is similar to the table view of the `gs-aggregate` component.\nThe table has three columns:\n- `lapisLocationField`,\n- `count` (the number of samples in this location matching the `lapisFilter`),\n- `proportion` (`count` / sum of the `count` of all locations).",
3282
+ "name": "SequencesByLocationComponent",
3283
+ "members": [
3284
+ {
3285
+ "kind": "field",
3286
+ "name": "lapisFilter",
3287
+ "type": {
3288
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3289
+ },
3290
+ "default": "{}",
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' }).",
3292
+ "attribute": "lapisFilter"
3293
+ },
3294
+ {
3295
+ "kind": "field",
3296
+ "name": "lapisLocationField",
3297
+ "type": {
3298
+ "text": "string"
3299
+ },
3300
+ "default": "''",
3301
+ "description": "Required.\n\nThe location field to aggregate the data by.\nThis should match the selected map location granularity.",
3302
+ "attribute": "lapisLocationField"
3303
+ },
3304
+ {
3305
+ "kind": "field",
3306
+ "name": "mapSource",
3307
+ "type": {
3308
+ "text": "{ type: 'topojson'; url: string; topologyObjectsKey: string } | undefined"
3309
+ },
3310
+ "default": "undefined",
3311
+ "description": "Required when using the map view.\n\nThe source of the map data. See component level docs for more information.",
3312
+ "attribute": "mapSource"
3313
+ },
3314
+ {
3315
+ "kind": "field",
3316
+ "name": "enableMapNavigation",
3317
+ "type": {
3318
+ "text": "boolean"
3319
+ },
3320
+ "default": "true",
3321
+ "description": "Enable map navigation (dragging, keyboard navigation, zooming).",
3322
+ "attribute": "enableMapNavigation"
3323
+ },
3324
+ {
3325
+ "kind": "field",
3326
+ "name": "width",
3327
+ "type": {
3328
+ "text": "string"
3329
+ },
3330
+ "default": "'100%'",
3331
+ "description": "The width of the component.\nNot that the map in the map view is not responsive\n(i.e. does not adjust its size when the component is resized).\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
3332
+ "attribute": "width"
3333
+ },
3334
+ {
3335
+ "kind": "field",
3336
+ "name": "height",
3337
+ "type": {
3338
+ "text": "string"
3339
+ },
3340
+ "default": "'700px'",
3341
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
3342
+ "attribute": "height"
3343
+ },
3344
+ {
3345
+ "kind": "field",
3346
+ "name": "views",
3347
+ "type": {
3348
+ "text": "('map' | 'table')[]"
3349
+ },
3350
+ "default": "['map', 'table']",
3351
+ "description": "A list of tabs with views that this component should provide.",
3352
+ "attribute": "views"
3353
+ },
3354
+ {
3355
+ "kind": "field",
3356
+ "name": "zoom",
3357
+ "type": {
3358
+ "text": "number"
3359
+ },
3360
+ "default": "1",
3361
+ "description": "The initial zoom level of the map.",
3362
+ "attribute": "zoom"
3363
+ },
3364
+ {
3365
+ "kind": "field",
3366
+ "name": "offsetX",
3367
+ "type": {
3368
+ "text": "number"
3369
+ },
3370
+ "default": "0",
3371
+ "description": "Initially shift the center of the map in x direction (longitude).\n\n`-180` is the International Date Line with the map shifted to the right, `0` is the prime meridian,\n`180` is the International Date Line with the map shifted to the left.",
3372
+ "attribute": "offsetX"
3373
+ },
3374
+ {
3375
+ "kind": "field",
3376
+ "name": "offsetY",
3377
+ "type": {
3378
+ "text": "number"
3379
+ },
3380
+ "default": "0",
3381
+ "description": "Initially shift the center of the map in y direction (latitude).\n\n`-90` is the South Pole, `0` is the equator, `90` is the North Pole.",
3382
+ "attribute": "offsetY"
3383
+ },
3384
+ {
3385
+ "kind": "field",
3386
+ "name": "pageSize",
3387
+ "type": {
3388
+ "text": "boolean | number"
3389
+ },
3390
+ "default": "false",
3391
+ "description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
3392
+ "attribute": "pageSize"
3393
+ }
3394
+ ],
3395
+ "attributes": [
3396
+ {
3397
+ "name": "lapisFilter",
3398
+ "type": {
3399
+ "text": "Record<string, string | string[] | number | null | boolean | undefined> & {\n nucleotideMutations?: string[];\n aminoAcidMutations?: string[];\n nucleotideInsertions?: string[];\n aminoAcidInsertions?: string[];\n }"
3400
+ },
3401
+ "default": "{}",
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' }).",
3403
+ "fieldName": "lapisFilter"
3404
+ },
3405
+ {
3406
+ "name": "lapisLocationField",
3407
+ "type": {
3408
+ "text": "string"
3409
+ },
3410
+ "default": "''",
3411
+ "description": "Required.\n\nThe location field to aggregate the data by.\nThis should match the selected map location granularity.",
3412
+ "fieldName": "lapisLocationField"
3413
+ },
3414
+ {
3415
+ "name": "mapSource",
3416
+ "type": {
3417
+ "text": "{ type: 'topojson'; url: string; topologyObjectsKey: string } | undefined"
3418
+ },
3419
+ "default": "undefined",
3420
+ "description": "Required when using the map view.\n\nThe source of the map data. See component level docs for more information.",
3421
+ "fieldName": "mapSource"
3422
+ },
3423
+ {
3424
+ "name": "enableMapNavigation",
3425
+ "type": {
3426
+ "text": "boolean"
3427
+ },
3428
+ "default": "true",
3429
+ "description": "Enable map navigation (dragging, keyboard navigation, zooming).",
3430
+ "fieldName": "enableMapNavigation"
3431
+ },
3432
+ {
3433
+ "name": "width",
3434
+ "type": {
3435
+ "text": "string"
3436
+ },
3437
+ "default": "'100%'",
3438
+ "description": "The width of the component.\nNot that the map in the map view is not responsive\n(i.e. does not adjust its size when the component is resized).\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
3439
+ "fieldName": "width"
3440
+ },
3441
+ {
3442
+ "name": "height",
3443
+ "type": {
3444
+ "text": "string"
3445
+ },
3446
+ "default": "'700px'",
3447
+ "description": "The height of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.",
3448
+ "fieldName": "height"
3449
+ },
3450
+ {
3451
+ "name": "views",
3452
+ "type": {
3453
+ "text": "('map' | 'table')[]"
3454
+ },
3455
+ "default": "['map', 'table']",
3456
+ "description": "A list of tabs with views that this component should provide.",
3457
+ "fieldName": "views"
3458
+ },
3459
+ {
3460
+ "name": "zoom",
3461
+ "type": {
3462
+ "text": "number"
3463
+ },
3464
+ "default": "1",
3465
+ "description": "The initial zoom level of the map.",
3466
+ "fieldName": "zoom"
3467
+ },
3468
+ {
3469
+ "name": "offsetX",
3470
+ "type": {
3471
+ "text": "number"
3472
+ },
3473
+ "default": "0",
3474
+ "description": "Initially shift the center of the map in x direction (longitude).\n\n`-180` is the International Date Line with the map shifted to the right, `0` is the prime meridian,\n`180` is the International Date Line with the map shifted to the left.",
3475
+ "fieldName": "offsetX"
3476
+ },
3477
+ {
3478
+ "name": "offsetY",
3479
+ "type": {
3480
+ "text": "number"
3481
+ },
3482
+ "default": "0",
3483
+ "description": "Initially shift the center of the map in y direction (latitude).\n\n`-90` is the South Pole, `0` is the equator, `90` is the North Pole.",
3484
+ "fieldName": "offsetY"
3485
+ },
3486
+ {
3487
+ "name": "pageSize",
3488
+ "type": {
3489
+ "text": "boolean | number"
3490
+ },
3491
+ "default": "false",
3492
+ "description": "The maximum number of rows to display in the table view.\nSet to `false` to disable pagination. Set to `true` to enable pagination with a default limit (10).",
3493
+ "fieldName": "pageSize"
3494
+ }
3495
+ ],
3496
+ "superclass": {
3497
+ "name": "PreactLitAdapterWithGridJsStyles",
3498
+ "module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
3499
+ },
3500
+ "tagName": "gs-sequences-by-location",
3501
+ "customElement": true
3502
+ }
3503
+ ],
3504
+ "exports": [
3505
+ {
3506
+ "kind": "js",
3507
+ "name": "SequencesByLocationComponent",
3508
+ "declaration": {
3509
+ "name": "SequencesByLocationComponent",
3510
+ "module": "src/web-components/visualization/gs-sequences-by-location.tsx"
3511
+ }
3512
+ },
3513
+ {
3514
+ "kind": "custom-element-definition",
3515
+ "name": "gs-sequences-by-location",
3516
+ "declaration": {
3517
+ "name": "SequencesByLocationComponent",
3518
+ "module": "src/web-components/visualization/gs-sequences-by-location.tsx"
3519
+ }
3520
+ }
3521
+ ]
3522
+ },
3203
3523
  {
3204
3524
  "kind": "javascript-module",
3205
3525
  "path": "src/web-components/visualization/gs-statistics.stories.ts",
@@ -3253,7 +3573,7 @@
3253
3573
  "kind": "field",
3254
3574
  "name": "numeratorFilter",
3255
3575
  "type": {
3256
- "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 }"
3257
3577
  },
3258
3578
  "default": "{}",
3259
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.",
@@ -3263,7 +3583,7 @@
3263
3583
  "kind": "field",
3264
3584
  "name": "denominatorFilter",
3265
3585
  "type": {
3266
- "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 }"
3267
3587
  },
3268
3588
  "default": "{}",
3269
3589
  "description": "The filter to apply to the data for the denominator of the proportion.\nIt must be a valid LAPIS filter object.",
@@ -3294,7 +3614,7 @@
3294
3614
  {
3295
3615
  "name": "numeratorFilter",
3296
3616
  "type": {
3297
- "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 }"
3298
3618
  },
3299
3619
  "default": "{}",
3300
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.",
@@ -3303,7 +3623,7 @@
3303
3623
  {
3304
3624
  "name": "denominatorFilter",
3305
3625
  "type": {
3306
- "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 }"
3307
3627
  },
3308
3628
  "default": "{}",
3309
3629
  "description": "The filter to apply to the data for the denominator of the proportion.\nIt must be a valid LAPIS filter object.",
@@ -3416,6 +3736,14 @@
3416
3736
  "module": "./gs-mutations-over-time"
3417
3737
  }
3418
3738
  },
3739
+ {
3740
+ "kind": "js",
3741
+ "name": "SequencesByLocationComponent",
3742
+ "declaration": {
3743
+ "name": "SequencesByLocationComponent",
3744
+ "module": "./gs-sequences-by-location"
3745
+ }
3746
+ },
3419
3747
  {
3420
3748
  "kind": "js",
3421
3749
  "name": "StatisticsComponent",