@genspectrum/dashboard-components 0.6.13 → 0.6.15

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 (78) hide show
  1. package/README.md +29 -0
  2. package/custom-elements.json +23 -17
  3. package/dist/dashboard-components.js +8237 -37898
  4. package/dist/dashboard-components.js.map +1 -1
  5. package/dist/genspectrum-components.d.ts +26 -8
  6. package/dist/style.css +3 -3
  7. package/package.json +9 -8
  8. package/src/index.ts +8 -0
  9. package/src/lapisApi/lapisApi.ts +15 -7
  10. package/src/operator/FetchAggregatedOperator.ts +2 -7
  11. package/src/preact/components/color-scale-selector-dropdown.stories.tsx +1 -1
  12. package/src/preact/components/error-boundary.stories.tsx +21 -4
  13. package/src/preact/components/error-display.stories.tsx +20 -2
  14. package/src/preact/components/error-display.tsx +64 -10
  15. package/src/preact/components/info.stories.tsx +5 -5
  16. package/src/preact/components/info.tsx +2 -4
  17. package/src/preact/components/percent-intput.tsx +7 -2
  18. package/src/preact/components/proportion-selector.tsx +12 -2
  19. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +2 -3
  20. package/src/preact/dateRangeSelector/date-range-selector.tsx +4 -4
  21. package/src/preact/lineageFilter/lineage-filter.stories.tsx +2 -3
  22. package/src/preact/lineageFilter/lineage-filter.tsx +2 -2
  23. package/src/preact/locationFilter/fetchAutocompletionList.ts +1 -14
  24. package/src/preact/locationFilter/location-filter.stories.tsx +2 -3
  25. package/src/preact/locationFilter/location-filter.tsx +2 -2
  26. package/src/preact/mutationFilter/mutation-filter.stories.tsx +2 -3
  27. package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_01.json +13 -0
  28. package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_02.json +13 -0
  29. package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_03.json +13 -0
  30. package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_04.json +13 -0
  31. package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_05.json +13 -0
  32. package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_06.json +13 -0
  33. package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_07.json +13 -0
  34. package/src/preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json +13 -0
  35. package/src/preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json +13 -0
  36. package/src/preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json +13 -0
  37. package/src/preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json +13 -0
  38. package/src/preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json +13 -0
  39. package/src/preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json +13 -0
  40. package/src/preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json +13 -0
  41. package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations_total.json +13 -0
  42. package/src/preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json +13 -0
  43. package/src/preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json +13 -0
  44. package/src/preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json +13 -0
  45. package/src/preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json +13 -0
  46. package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +56 -8
  47. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +4 -2
  48. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +135 -0
  49. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +3 -3
  50. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +1 -1
  51. package/src/preact/shared/floating-ui/hooks.ts +1 -1
  52. package/src/preact/textInput/text-input.stories.tsx +2 -3
  53. package/src/preact/textInput/text-input.tsx +2 -2
  54. package/src/query/queryMutationsOverTime.spec.ts +210 -64
  55. package/src/query/queryMutationsOverTime.ts +10 -2
  56. package/src/web-components/app.stories.ts +0 -2
  57. package/src/web-components/errorHandling.mdx +8 -0
  58. package/src/web-components/input/gs-date-range-selector.stories.ts +2 -3
  59. package/src/web-components/input/gs-date-range-selector.tsx +24 -4
  60. package/src/web-components/input/gs-lineage-filter.stories.ts +2 -3
  61. package/src/web-components/input/gs-lineage-filter.tsx +15 -1
  62. package/src/web-components/input/gs-location-filter.stories.ts +2 -3
  63. package/src/web-components/input/gs-location-filter.tsx +13 -1
  64. package/src/web-components/input/gs-mutation-filter.stories.ts +2 -3
  65. package/src/web-components/input/gs-mutation-filter.tsx +1 -0
  66. package/src/web-components/input/gs-text-input.stories.ts +2 -3
  67. package/src/web-components/input/gs-text-input.tsx +13 -1
  68. package/src/web-components/visualization/gs-aggregate.tsx +17 -1
  69. package/src/web-components/visualization/gs-mutation-comparison.tsx +9 -0
  70. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +271 -0
  71. package/src/web-components/visualization/gs-mutations-over-time.tsx +7 -0
  72. package/src/web-components/visualization/gs-mutations.tsx +11 -5
  73. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +15 -0
  74. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -9
  75. package/src/web-components/visualization/gs-prevalence-over-time.tsx +26 -8
  76. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +43 -5
  77. package/standalone-bundle/dashboard-components.js +30920 -0
  78. package/standalone-bundle/dashboard-components.js.map +1 -0
package/README.md CHANGED
@@ -19,6 +19,35 @@ To install the package, run:
19
19
  npm i @genspectrum/dashboard-components
20
20
  ```
21
21
 
22
+ Usage with a bundler in HTML:
23
+
24
+ ```html
25
+ <body>
26
+ <script>
27
+ import '@genspectrum/dashboard-components';
28
+ import '@genspectrum/dashboard-components/style.css';
29
+ </script>
30
+ <gs-app lapis="https://your.lapis.url"></gs-app>
31
+ </body>
32
+ ```
33
+
34
+ We also provide a standalone version of the components that can be used without installing the dependencies:
35
+
36
+ ```html
37
+ <html>
38
+ <head>
39
+ <script
40
+ type="module"
41
+ src="https://unpkg.com/@genspectrum/dashboard-components@latest/standalone-bundle/dashboard-components.js"
42
+ ></script>
43
+ <link rel="stylesheet" href="https://unpkg.com/@genspectrum/dashboard-components@latest/dist/style.css" />
44
+ </head>
45
+ <body>
46
+ <gs-app lapis="https://your.lapis.url"></gs-app>
47
+ </body>
48
+ </html>
49
+ ```
50
+
22
51
  ### Core Concepts
23
52
 
24
53
  Internally, the components use [Preact](https://preactjs.com/).
@@ -70,7 +70,7 @@
70
70
  "type": {
71
71
  "text": "Meta"
72
72
  },
73
- "default": "{ title: 'Wrapper/App', component: 'gs-app', parameters: withComponentDocs({ fetchMock: {}, componentDocs: { opensShadowDom: false, expectsChildren: true, codeExample, }, }), decorators: [withActions], tags: ['autodocs'], }"
73
+ "default": "{ title: 'Wrapper/App', component: 'gs-app', parameters: withComponentDocs({ fetchMock: {}, componentDocs: { opensShadowDom: false, expectsChildren: true, codeExample, }, }), tags: ['autodocs'], }"
74
74
  },
75
75
  {
76
76
  "kind": "variable",
@@ -227,6 +227,12 @@
227
227
  }
228
228
  ]
229
229
  },
230
+ {
231
+ "kind": "javascript-module",
232
+ "path": "src/web-components/errorHandling.mdx",
233
+ "declarations": [],
234
+ "exports": []
235
+ },
230
236
  {
231
237
  "kind": "javascript-module",
232
238
  "path": "src/web-components/index.ts",
@@ -268,7 +274,7 @@
268
274
  "type": {
269
275
  "text": "Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>>"
270
276
  },
271
- "default": "{ title: 'Input/DateRangeSelector', component: 'gs-date-range-selector', parameters: withComponentDocs({ actions: { handles: ['gs-date-range-changed'], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'select', }, options: [ PRESET_VALUE_CUSTOM, PRESET_VALUE_ALL_TIMES, PRESET_VALUE_LAST_2_WEEKS, PRESET_VALUE_LAST_MONTH, PRESET_VALUE_LAST_2_MONTHS, PRESET_VALUE_LAST_3_MONTHS, PRESET_VALUE_LAST_6_MONTHS, 'CustomDateRange', ], }, dateColumn: { control: { type: 'text' } }, customSelectOptions: { control: { type: 'object', }, }, earliestDate: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, args: { customSelectOptions: [{ label: 'CustomDateRange', dateFrom: '2021-01-01', dateTo: '2021-12-31' }], earliestDate: '1970-01-01', initialValue: PRESET_VALUE_LAST_6_MONTHS, dateColumn: 'aDateColumn', width: '100%', initialDateFrom: '', initialDateTo: '', }, decorators: [withActions], tags: ['autodocs'], }"
277
+ "default": "{ title: 'Input/DateRangeSelector', component: 'gs-date-range-selector', parameters: withComponentDocs({ actions: { handles: ['gs-date-range-changed', ...previewHandles], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'select', }, options: [ PRESET_VALUE_CUSTOM, PRESET_VALUE_ALL_TIMES, PRESET_VALUE_LAST_2_WEEKS, PRESET_VALUE_LAST_MONTH, PRESET_VALUE_LAST_2_MONTHS, PRESET_VALUE_LAST_3_MONTHS, PRESET_VALUE_LAST_6_MONTHS, 'CustomDateRange', ], }, dateColumn: { control: { type: 'text' } }, customSelectOptions: { control: { type: 'object', }, }, earliestDate: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, args: { customSelectOptions: [{ label: 'CustomDateRange', dateFrom: '2021-01-01', dateTo: '2021-12-31' }], earliestDate: '1970-01-01', initialValue: PRESET_VALUE_LAST_6_MONTHS, dateColumn: 'aDateColumn', width: '100%', initialDateFrom: '', initialDateTo: '', }, tags: ['autodocs'], }"
272
278
  },
273
279
  {
274
280
  "kind": "variable",
@@ -489,7 +495,7 @@
489
495
  "type": {
490
496
  "text": "Meta<Required<LineageFilterProps>>"
491
497
  },
492
- "default": "{ title: 'Input/Lineage filter', component: 'gs-lineage-filter', parameters: withComponentDocs({ actions: { handles: ['gs-lineage-filter-changed'], }, fetchMock: { mocks: [ { matcher: { name: 'pangoLineage', url: AGGREGATED_ENDPOINT, body: { fields: ['pangoLineage'], }, }, response: { status: 200, body: aggregatedData, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), decorators: [withActions], tags: ['autodocs'], }"
498
+ "default": "{ title: 'Input/Lineage filter', component: 'gs-lineage-filter', parameters: withComponentDocs({ actions: { handles: ['gs-lineage-filter-changed', ...previewHandles], }, fetchMock: { mocks: [ { matcher: { name: 'pangoLineage', url: AGGREGATED_ENDPOINT, body: { fields: ['pangoLineage'], }, }, response: { status: 200, body: aggregatedData, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], }"
493
499
  },
494
500
  {
495
501
  "kind": "variable",
@@ -669,7 +675,7 @@
669
675
  "type": {
670
676
  "text": "Meta"
671
677
  },
672
- "default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: ['gs-location-changed'], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { fields: { control: { type: 'object', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, }, decorators: [withActions], tags: ['autodocs'], }"
678
+ "default": "{ title: 'Input/Location filter', component: 'gs-location-filter', parameters: withComponentDocs({ actions: { handles: ['gs-location-changed', ...previewHandles], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { fields: { control: { type: 'object', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, }, tags: ['autodocs'], }"
673
679
  },
674
680
  {
675
681
  "kind": "variable",
@@ -881,7 +887,7 @@
881
887
  "type": {
882
888
  "text": "Meta<MutationFilterProps>"
883
889
  },
884
- "default": "{ title: 'Input/Mutation filter', component: 'gs-mutation-filter', parameters: withComponentDocs({ actions: { handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur'], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'object', }, }, width: { control: 'text' }, }, decorators: [withActions], tags: ['autodocs'], }"
890
+ "default": "{ title: 'Input/Mutation filter', component: 'gs-mutation-filter', parameters: withComponentDocs({ actions: { handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur', ...previewHandles], }, fetchMock: {}, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { initialValue: { control: { type: 'object', }, }, width: { control: 'text' }, }, tags: ['autodocs'], }"
885
891
  },
886
892
  {
887
893
  "kind": "variable",
@@ -1062,7 +1068,7 @@
1062
1068
  "type": {
1063
1069
  "text": "Meta<Required<TextInputProps>>"
1064
1070
  },
1065
- "default": "{ title: 'Input/Text input', component: 'gs-text-input', parameters: withComponentDocs({ actions: { handles: ['gs-text-input-changed'], }, fetchMock: { mocks: [ { matcher: { name: 'hosts', url: AGGREGATED_ENDPOINT, body: { fields: ['host'], }, }, response: { status: 200, body: data, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { lapisField: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, decorators: [withActions], tags: ['autodocs'], }"
1071
+ "default": "{ title: 'Input/Text input', component: 'gs-text-input', parameters: withComponentDocs({ actions: { handles: ['gs-text-input-changed', ...previewHandles], }, fetchMock: { mocks: [ { matcher: { name: 'hosts', url: AGGREGATED_ENDPOINT, body: { fields: ['host'], }, }, response: { status: 200, body: data, }, }, ], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), argTypes: { lapisField: { control: { type: 'text', }, }, placeholderText: { control: { type: 'text', }, }, initialValue: { control: { type: 'text', }, }, width: { control: { type: 'text', }, }, }, tags: ['autodocs'], }"
1066
1072
  },
1067
1073
  {
1068
1074
  "kind": "variable",
@@ -1795,7 +1801,7 @@
1795
1801
  "type": {
1796
1802
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
1797
1803
  },
1798
- "default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregated_dates', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-15', dateTo: '2024-07-10', fields: ['date'], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_date, }, }, { matcher: { name: 'nucleotideMutations_overall', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutations_byMonthOverall, }, }, { matcher: { name: 'nucleotideMutations_01', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-01', dateTo: '2024-01-31', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_01, }, }, { matcher: { name: 'nucleotideMutations_02', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-02-01', dateTo: '2024-02-29', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_02, }, }, { matcher: { name: 'nucleotideMutations_03', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-03-01', dateTo: '2024-03-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_03, }, }, }, { matcher: { name: 'nucleotideMutations_04', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-04-01', dateTo: '2024-04-30', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_04, }, }, }, { matcher: { name: 'nucleotideMutations_05', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-05-01', dateTo: '2024-05-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_05, }, }, }, { matcher: { name: 'nucleotideMutations_06', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-06-01', dateTo: '2024-06-30', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_06, }, }, }, { matcher: { name: 'nucleotideMutations_07', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-07-01', dateTo: '2024-07-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_07, }, }, }, ], }, }, }"
1804
+ "default": "{ ...Template, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregated_dates', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-15', dateTo: '2024-07-10', fields: ['date'], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_date, }, }, { matcher: { name: 'aggregated_01', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-01', dateTo: '2024-01-31', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_01, }, }, { matcher: { name: 'aggregated_02', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-02-01', dateTo: '2024-02-29', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_02, }, }, { matcher: { name: 'aggregated_03', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-03-01', dateTo: '2024-03-31', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_03, }, }, { matcher: { name: 'aggregated_04', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-04-01', dateTo: '2024-04-30', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_04, }, }, { matcher: { name: 'aggregated_05', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-05-01', dateTo: '2024-05-31', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_05, }, }, { matcher: { name: 'aggregated_06', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-06-01', dateTo: '2024-06-30', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_06, }, }, { matcher: { name: 'aggregated_07', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-07-01', dateTo: '2024-07-31', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_07, }, }, { matcher: { name: 'nucleotideMutations_overall', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-07-10', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutations_byMonthOverall, }, }, { matcher: { name: 'nucleotideMutations_01', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-01', dateTo: '2024-01-31', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_01, }, }, { matcher: { name: 'nucleotideMutations_02', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-02-01', dateTo: '2024-02-29', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_02, }, }, { matcher: { name: 'nucleotideMutations_03', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-03-01', dateTo: '2024-03-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_03, }, }, }, { matcher: { name: 'nucleotideMutations_04', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-04-01', dateTo: '2024-04-30', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_04, }, }, }, { matcher: { name: 'nucleotideMutations_05', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-05-01', dateTo: '2024-05-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_05, }, }, }, { matcher: { name: 'nucleotideMutations_06', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-06-01', dateTo: '2024-06-30', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_06, }, }, }, { matcher: { name: 'nucleotideMutations_07', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-07-01', dateTo: '2024-07-31', minProportion: 0.001, }, response: { status: 200, body: nucleotideMutation_07, }, }, }, ], }, }, }"
1799
1805
  },
1800
1806
  {
1801
1807
  "kind": "variable",
@@ -1803,7 +1809,7 @@
1803
1809
  "type": {
1804
1810
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
1805
1811
  },
1806
- "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11' }, granularity: 'week', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregated_dates', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-15', dateTo: '2024-02-11', fields: ['date'], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_byWeek, }, }, { matcher: { name: 'nucleotideMutation_overall', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutations_byWeekOverall, }, }, { matcher: { name: 'nucleotideMutation_week3', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-01-21', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week3, }, }, { matcher: { name: 'nucleotideMutation_week4', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-22', dateTo: '2024-01-28', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week4, }, }, { matcher: { name: 'nucleotideMutation_week5', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-29', dateTo: '2024-02-04', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week5, }, }, { matcher: { name: 'nucleotideMutation_week6', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-02-05', dateTo: '2024-02-11', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week6, }, }, ], }, }, }"
1812
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11' }, granularity: 'week', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregated_dates', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-15', dateTo: '2024-02-11', fields: ['date'], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_byWeek, }, }, { matcher: { name: 'aggregated_week3', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-15', dateTo: '2024-01-21', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_week3, }, }, { matcher: { name: 'aggregated_week4', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-22', dateTo: '2024-01-28', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_week4, }, }, { matcher: { name: 'aggregated_week5', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-01-29', dateTo: '2024-02-04', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_week5, }, }, { matcher: { name: 'aggregated_week6', url: AGGREGATED_ENDPOINT, body: { dateFrom: '2024-02-05', dateTo: '2024-02-11', fields: [], pangoLineage: 'JN.1*', }, }, response: { status: 200, body: aggregated_week6, }, }, { matcher: { name: 'nucleotideMutation_overall', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-02-11', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutations_byWeekOverall, }, }, { matcher: { name: 'nucleotideMutation_week3', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-15', dateTo: '2024-01-21', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week3, }, }, { matcher: { name: 'nucleotideMutation_week4', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-22', dateTo: '2024-01-28', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week4, }, }, { matcher: { name: 'nucleotideMutation_week5', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-29', dateTo: '2024-02-04', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week5, }, }, { matcher: { name: 'nucleotideMutation_week6', url: NUCLEOTIDE_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-02-05', dateTo: '2024-02-11', minProportion: 0.001, }, }, response: { status: 200, body: nucleotideMutation_week6, }, }, ], }, }, }"
1807
1813
  },
1808
1814
  {
1809
1815
  "kind": "variable",
@@ -1811,7 +1817,7 @@
1811
1817
  "type": {
1812
1818
  "text": "StoryObj<Required<MutationsOverTimeProps>>"
1813
1819
  },
1814
- "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26' }, granularity: 'day', sequenceType: 'amino acid', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregated_byDay', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26', fields: ['date'] }, }, response: { status: 200, body: aggregated_byDay, }, }, { matcher: { name: 'aminoAcidMutations_overall', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_byDayOverall, }, }, { matcher: { name: 'aminoAcidMutations_20_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-20', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_20_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_21_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-21', dateTo: '2024-01-21', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_21_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_22_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-22', dateTo: '2024-01-22', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_22_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_23_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-23', dateTo: '2024-01-23', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_23_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_24_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-24', dateTo: '2024-01-24', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_24_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_25_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-25', dateTo: '2024-01-25', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_25_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_26_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-26', dateTo: '2024-01-26', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_26_01_2024, }, }, ], }, }, }"
1820
+ "default": "{ ...Template, args: { ...Template.args, lapisFilter: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26' }, granularity: 'day', sequenceType: 'amino acid', }, parameters: { fetchMock: { mocks: [ { matcher: { name: 'aggregated_byDay', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26', fields: ['date'] }, }, response: { status: 200, body: aggregated_byDay, }, }, { matcher: { name: 'aggregated_20_01_2024', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-20', fields: [] }, }, response: { status: 200, body: aggregated_20_01_2024, }, }, { matcher: { name: 'aggregated_21_01_2024', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-21', dateTo: '2024-01-21', fields: [] }, }, response: { status: 200, body: aggregated_21_01_2024, }, }, { matcher: { name: 'aggregated_22_01_2024', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-22', dateTo: '2024-01-22', fields: [] }, }, response: { status: 200, body: aggregated_22_01_2024, }, }, { matcher: { name: 'aggregated_23_01_2024', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-23', dateTo: '2024-01-23', fields: [] }, }, response: { status: 200, body: aggregated_23_01_2024, }, }, { matcher: { name: 'aggregated_24_01_2024', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-24', dateTo: '2024-01-24', fields: [] }, }, response: { status: 200, body: aggregated_24_01_2024, }, }, { matcher: { name: 'aggregated_25_01_2024', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-25', dateTo: '2024-01-25', fields: [] }, }, response: { status: 200, body: aggregated_25_01_2024, }, }, { matcher: { name: 'aggregated_26_01_2024', url: AGGREGATED_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-26', dateTo: '2024-01-26', fields: [] }, }, response: { status: 200, body: aggregated_26_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_overall', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-26', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_byDayOverall, }, }, { matcher: { name: 'aminoAcidMutations_20_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-20', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_20_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_21_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-21', dateTo: '2024-01-21', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_21_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_22_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-22', dateTo: '2024-01-22', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_22_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_23_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-23', dateTo: '2024-01-23', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_23_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_24_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-24', dateTo: '2024-01-24', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_24_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_25_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-25', dateTo: '2024-01-25', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_25_01_2024, }, }, { matcher: { name: 'aminoAcidMutations_26_01_2024', url: AMINO_ACID_MUTATIONS_ENDPOINT, body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-26', dateTo: '2024-01-26', minProportion: 0.001, }, }, response: { status: 200, body: aminoAcidMutations_26_01_2024, }, }, ], }, }, }"
1815
1821
  },
1816
1822
  {
1817
1823
  "kind": "variable",
@@ -2565,7 +2571,7 @@
2565
2571
  "kind": "variable",
2566
2572
  "name": "meta",
2567
2573
  "type": {
2568
- "text": "Meta<Required<PrevalenceOverTimeComponentProps>>"
2574
+ "text": "Meta<Required<PrevalenceOverTimeProps>>"
2569
2575
  },
2570
2576
  "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: ['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'], }"
2571
2577
  },
@@ -2573,7 +2579,7 @@
2573
2579
  "kind": "variable",
2574
2580
  "name": "TwoDatasets",
2575
2581
  "type": {
2576
- "text": "StoryObj<Required<PrevalenceOverTimeComponentProps>>"
2582
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
2577
2583
  },
2578
2584
  "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, }, }, ], }, }, }"
2579
2585
  },
@@ -2581,7 +2587,7 @@
2581
2587
  "kind": "variable",
2582
2588
  "name": "OneDataset",
2583
2589
  "type": {
2584
- "text": "StoryObj<Required<PrevalenceOverTimeComponentProps>>"
2590
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
2585
2591
  },
2586
2592
  "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, }, }, ], }, }, }"
2587
2593
  },
@@ -2589,7 +2595,7 @@
2589
2595
  "kind": "variable",
2590
2596
  "name": "OneDatasetOnLineTab",
2591
2597
  "type": {
2592
- "text": "StoryObj<Required<PrevalenceOverTimeComponentProps>>"
2598
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
2593
2599
  },
2594
2600
  "default": "{ ...OneDataset, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Line' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Line' })); }, }"
2595
2601
  },
@@ -2597,7 +2603,7 @@
2597
2603
  "kind": "variable",
2598
2604
  "name": "OneDatasetOnBubbleTab",
2599
2605
  "type": {
2600
- "text": "StoryObj<Required<PrevalenceOverTimeComponentProps>>"
2606
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
2601
2607
  },
2602
2608
  "default": "{ ...OneDataset, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Bubble' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Bubble' })); }, }"
2603
2609
  },
@@ -2605,7 +2611,7 @@
2605
2611
  "kind": "variable",
2606
2612
  "name": "OneDatasetOnTableTab",
2607
2613
  "type": {
2608
- "text": "StoryObj<Required<PrevalenceOverTimeComponentProps>>"
2614
+ "text": "StoryObj<Required<PrevalenceOverTimeProps>>"
2609
2615
  },
2610
2616
  "default": "{ ...OneDataset, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time'); await waitFor(() => expect(canvas.getByRole('button', { name: 'Table' })).toBeInTheDocument()); await fireEvent.click(canvas.getByRole('button', { name: 'Table' })); }, }"
2611
2617
  }
@@ -2676,7 +2682,7 @@
2676
2682
  "type": {
2677
2683
  "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 }[]"
2678
2684
  },
2679
- "default": "{ displayName: '', lapisFilter: {} }",
2685
+ "default": "{displayName: '', lapisFilter: {}}",
2680
2686
  "description": "Required.\nEither 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.",
2681
2687
  "attribute": "numeratorFilter"
2682
2688
  },
@@ -2797,7 +2803,7 @@
2797
2803
  "type": {
2798
2804
  "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 }[]"
2799
2805
  },
2800
- "default": "{ displayName: '', lapisFilter: {} }",
2806
+ "default": "{displayName: '', lapisFilter: {}}",
2801
2807
  "description": "Required.\nEither 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.",
2802
2808
  "fieldName": "numeratorFilter"
2803
2809
  },