@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
@@ -0,0 +1,8 @@
1
+ import { Meta } from '@storybook/blocks';
2
+
3
+ <Meta title='Components/Error Handling' />
4
+
5
+ # Error Handling
6
+
7
+ All components dispatch a `gs-error` event of type `ErrorEvent` when an error occurs.
8
+ The event contains an `error` property that holds the `Error` object.
@@ -1,9 +1,9 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
1
  import { expect, waitFor } from '@storybook/test';
3
2
  import type { Meta, StoryObj } from '@storybook/web-components';
4
3
  import { html } from 'lit';
5
4
 
6
5
  import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
6
+ import { previewHandles } from '../../../.storybook/preview';
7
7
  import { LAPIS_URL } from '../../constants';
8
8
  import { type DateRangeSelectorProps } from '../../preact/dateRangeSelector/date-range-selector';
9
9
  import './gs-date-range-selector';
@@ -36,7 +36,7 @@ const meta: Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>> = {
36
36
  component: 'gs-date-range-selector',
37
37
  parameters: withComponentDocs({
38
38
  actions: {
39
- handles: ['gs-date-range-changed'],
39
+ handles: ['gs-date-range-changed', ...previewHandles],
40
40
  },
41
41
  fetchMock: {},
42
42
  componentDocs: {
@@ -87,7 +87,6 @@ const meta: Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>> = {
87
87
  initialDateFrom: '',
88
88
  initialDateTo: '',
89
89
  },
90
- decorators: [withActions],
91
90
  tags: ['autodocs'],
92
91
  };
93
92
 
@@ -1,7 +1,6 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
2
 
3
- import { DateRangeSelector } from '../../preact/dateRangeSelector/date-range-selector';
4
- import { type CustomSelectOption, type PresetOptionValues } from '../../preact/dateRangeSelector/selectableOptions';
3
+ import { DateRangeSelector, type DateRangeSelectorProps } from '../../preact/dateRangeSelector/date-range-selector';
5
4
  import { type Equals, type Expect } from '../../utils/typeAssertions';
6
5
  import { PreactLitAdapter } from '../PreactLitAdapter';
7
6
 
@@ -129,9 +128,30 @@ declare global {
129
128
 
130
129
  /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
131
130
  type CustomSelectOptionsMatches = Expect<
132
- Equals<typeof DateRangeSelectorComponent.prototype.customSelectOptions, CustomSelectOption<string>[]>
131
+ Equals<
132
+ typeof DateRangeSelectorComponent.prototype.customSelectOptions,
133
+ DateRangeSelectorProps<string>['customSelectOptions']
134
+ >
135
+ >;
136
+ type EarliestDateMatches = Expect<
137
+ Equals<typeof DateRangeSelectorComponent.prototype.earliestDate, DateRangeSelectorProps<string>['earliestDate']>
133
138
  >;
134
139
  type InitialValueMatches = Expect<
135
- Equals<typeof DateRangeSelectorComponent.prototype.initialValue, PresetOptionValues | string>
140
+ Equals<typeof DateRangeSelectorComponent.prototype.initialValue, DateRangeSelectorProps<string>['initialValue']>
141
+ >;
142
+ type InitialDateFromMatches = Expect<
143
+ Equals<
144
+ typeof DateRangeSelectorComponent.prototype.initialDateFrom,
145
+ DateRangeSelectorProps<string>['initialDateFrom']
146
+ >
147
+ >;
148
+ type InitialDateToMatches = Expect<
149
+ Equals<typeof DateRangeSelectorComponent.prototype.initialDateTo, DateRangeSelectorProps<string>['initialDateTo']>
150
+ >;
151
+ type WidthMatches = Expect<
152
+ Equals<typeof DateRangeSelectorComponent.prototype.width, DateRangeSelectorProps<string>['width']>
153
+ >;
154
+ type DateColumnMatches = Expect<
155
+ Equals<typeof DateRangeSelectorComponent.prototype.dateColumn, DateRangeSelectorProps<string>['dateColumn']>
136
156
  >;
137
157
  /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -1,9 +1,9 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
1
  import { expect, fn, userEvent, waitFor } from '@storybook/test';
3
2
  import type { Meta, StoryObj } from '@storybook/web-components';
4
3
  import { html } from 'lit';
5
4
 
6
5
  import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
6
+ import { previewHandles } from '../../../.storybook/preview';
7
7
  import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
8
8
  import '../app';
9
9
  import './gs-lineage-filter';
@@ -24,7 +24,7 @@ const meta: Meta<Required<LineageFilterProps>> = {
24
24
  component: 'gs-lineage-filter',
25
25
  parameters: withComponentDocs({
26
26
  actions: {
27
- handles: ['gs-lineage-filter-changed'],
27
+ handles: ['gs-lineage-filter-changed', ...previewHandles],
28
28
  },
29
29
  fetchMock: {
30
30
  mocks: [
@@ -49,7 +49,6 @@ const meta: Meta<Required<LineageFilterProps>> = {
49
49
  codeExample,
50
50
  },
51
51
  }),
52
- decorators: [withActions],
53
52
  tags: ['autodocs'],
54
53
  };
55
54
 
@@ -1,6 +1,7 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
2
 
3
- import { LineageFilter } from '../../preact/lineageFilter/lineage-filter';
3
+ import { LineageFilter, type LineageFilterProps } from '../../preact/lineageFilter/lineage-filter';
4
+ import type { Equals, Expect } from '../../utils/typeAssertions';
4
5
  import { PreactLitAdapter } from '../PreactLitAdapter';
5
6
 
6
7
  /**
@@ -77,3 +78,16 @@ declare global {
77
78
  'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
78
79
  }
79
80
  }
81
+
82
+ /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
83
+ type InitialValueMatches = Expect<
84
+ Equals<typeof LineageFilterComponent.prototype.initialValue, LineageFilterProps['initialValue']>
85
+ >;
86
+ type LapisFieldMatches = Expect<
87
+ Equals<typeof LineageFilterComponent.prototype.lapisField, LineageFilterProps['lapisField']>
88
+ >;
89
+ type PlaceholderTextMatches = Expect<
90
+ Equals<typeof LineageFilterComponent.prototype.placeholderText, LineageFilterProps['placeholderText']>
91
+ >;
92
+ type WidthMatches = Expect<Equals<typeof LineageFilterComponent.prototype.width, LineageFilterProps['width']>>;
93
+ /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -1,10 +1,10 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
1
  import { expect, fn, userEvent, waitFor } from '@storybook/test';
3
2
  import type { Meta, StoryObj } from '@storybook/web-components';
4
3
  import { html } from 'lit';
5
4
  import { ifDefined } from 'lit/directives/if-defined.js';
6
5
 
7
6
  import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
7
+ import { previewHandles } from '../../../.storybook/preview';
8
8
  import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
9
9
  import '../app';
10
10
  import './gs-location-filter';
@@ -25,7 +25,7 @@ const meta: Meta = {
25
25
  component: 'gs-location-filter',
26
26
  parameters: withComponentDocs({
27
27
  actions: {
28
- handles: ['gs-location-changed'],
28
+ handles: ['gs-location-changed', ...previewHandles],
29
29
  },
30
30
  componentDocs: {
31
31
  opensShadowDom: true,
@@ -55,7 +55,6 @@ const meta: Meta = {
55
55
  },
56
56
  },
57
57
  },
58
- decorators: [withActions],
59
58
  tags: ['autodocs'],
60
59
  };
61
60
 
@@ -1,6 +1,7 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
2
 
3
- import { LocationFilter } from '../../preact/locationFilter/location-filter';
3
+ import { LocationFilter, type LocationFilterProps } from '../../preact/locationFilter/location-filter';
4
+ import type { Equals, Expect } from '../../utils/typeAssertions';
4
5
  import { PreactLitAdapter } from '../PreactLitAdapter';
5
6
 
6
7
  /**
@@ -86,3 +87,14 @@ declare global {
86
87
  'gs-location-changed': CustomEvent<Record<string, string>>;
87
88
  }
88
89
  }
90
+
91
+ /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
92
+ type InitialValueMatches = Expect<
93
+ Equals<typeof LocationFilterComponent.prototype.initialValue, LocationFilterProps['initialValue']>
94
+ >;
95
+ type FieldsMatches = Expect<Equals<typeof LocationFilterComponent.prototype.fields, LocationFilterProps['fields']>>;
96
+ type PlaceholderTextMatches = Expect<
97
+ Equals<typeof LocationFilterComponent.prototype.placeholderText, LocationFilterProps['placeholderText']>
98
+ >;
99
+ type WidthMatches = Expect<Equals<typeof LocationFilterComponent.prototype.width, LocationFilterProps['width']>>;
100
+ /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -1,9 +1,9 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
1
  import { expect, fn, userEvent, waitFor } from '@storybook/test';
3
2
  import type { Meta, StoryObj } from '@storybook/web-components';
4
3
  import { html } from 'lit';
5
4
 
6
5
  import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
6
+ import { previewHandles } from '../../../.storybook/preview';
7
7
  import { LAPIS_URL, REFERENCE_GENOME_ENDPOINT } from '../../constants';
8
8
  import '../app';
9
9
  import { type MutationFilterProps } from '../../preact/mutationFilter/mutation-filter';
@@ -21,7 +21,7 @@ const meta: Meta<MutationFilterProps> = {
21
21
  component: 'gs-mutation-filter',
22
22
  parameters: withComponentDocs({
23
23
  actions: {
24
- handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur'],
24
+ handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur', ...previewHandles],
25
25
  },
26
26
  fetchMock: {},
27
27
  componentDocs: {
@@ -38,7 +38,6 @@ const meta: Meta<MutationFilterProps> = {
38
38
  },
39
39
  width: { control: 'text' },
40
40
  },
41
- decorators: [withActions],
42
41
  tags: ['autodocs'],
43
42
  };
44
43
 
@@ -115,4 +115,5 @@ declare global {
115
115
  type InitialValueMatches = Expect<
116
116
  Equals<typeof MutationFilterComponent.prototype.initialValue, MutationFilterProps['initialValue']>
117
117
  >;
118
+ type WidthMatches = Expect<Equals<typeof MutationFilterComponent.prototype.width, MutationFilterProps['width']>>;
118
119
  /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -1,9 +1,9 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
1
  import { expect, fn, userEvent, waitFor } from '@storybook/test';
3
2
  import type { Meta, StoryObj } from '@storybook/web-components';
4
3
  import { html } from 'lit';
5
4
 
6
5
  import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
6
+ import { previewHandles } from '../../../.storybook/preview';
7
7
  import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
8
8
  import '../app';
9
9
  import './gs-text-input';
@@ -24,7 +24,7 @@ const meta: Meta<Required<TextInputProps>> = {
24
24
  component: 'gs-text-input',
25
25
  parameters: withComponentDocs({
26
26
  actions: {
27
- handles: ['gs-text-input-changed'],
27
+ handles: ['gs-text-input-changed', ...previewHandles],
28
28
  },
29
29
  fetchMock: {
30
30
  mocks: [
@@ -71,7 +71,6 @@ const meta: Meta<Required<TextInputProps>> = {
71
71
  },
72
72
  },
73
73
  },
74
- decorators: [withActions],
75
74
  tags: ['autodocs'],
76
75
  };
77
76
 
@@ -1,6 +1,7 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
2
 
3
- import { TextInput } from '../../preact/textInput/text-input';
3
+ import { TextInput, type TextInputProps } from '../../preact/textInput/text-input';
4
+ import type { Equals, Expect } from '../../utils/typeAssertions';
4
5
  import { PreactLitAdapter } from '../PreactLitAdapter';
5
6
 
6
7
  /**
@@ -71,3 +72,14 @@ declare global {
71
72
  'gs-text-input-changed': CustomEvent<Record<string, string>>;
72
73
  }
73
74
  }
75
+
76
+ /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
77
+ type InitialValueMatches = Expect<
78
+ Equals<typeof TextInputComponent.prototype.initialValue, TextInputProps['initialValue']>
79
+ >;
80
+ type LapisFieldMatches = Expect<Equals<typeof TextInputComponent.prototype.lapisField, TextInputProps['lapisField']>>;
81
+ type PlaceholderTextMatches = Expect<
82
+ Equals<typeof TextInputComponent.prototype.placeholderText, TextInputProps['placeholderText']>
83
+ >;
84
+ type WidthMatches = Expect<Equals<typeof TextInputComponent.prototype.width, TextInputProps['width']>>;
85
+ /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -1,7 +1,8 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
2
 
3
- import { Aggregate, type View } from '../../preact/aggregatedData/aggregate';
3
+ import { Aggregate, type AggregateProps, type View } from '../../preact/aggregatedData/aggregate';
4
4
  import { type LapisFilter } from '../../types';
5
+ import { type Equals, type Expect } from '../../utils/typeAssertions';
5
6
  import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
6
7
 
7
8
  /**
@@ -102,3 +103,18 @@ declare global {
102
103
  'gs-aggregate-component': AggregateComponent;
103
104
  }
104
105
  }
106
+
107
+ /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
108
+ type FieldsMatches = Expect<Equals<typeof AggregateComponent.prototype.fields, AggregateProps['fields']>>;
109
+ type ViewsMatches = Expect<Equals<typeof AggregateComponent.prototype.views, AggregateProps['views']>>;
110
+ type FilterMatches = Expect<Equals<typeof AggregateComponent.prototype.filter, AggregateProps['filter']>>;
111
+ type WidthMatches = Expect<Equals<typeof AggregateComponent.prototype.width, AggregateProps['width']>>;
112
+ type HeightMatches = Expect<Equals<typeof AggregateComponent.prototype.height, AggregateProps['height']>>;
113
+ type InitialSortFieldMatches = Expect<
114
+ Equals<typeof AggregateComponent.prototype.initialSortField, AggregateProps['initialSortField']>
115
+ >;
116
+ type InitialSortDirectionMatches = Expect<
117
+ Equals<typeof AggregateComponent.prototype.initialSortDirection, AggregateProps['initialSortDirection']>
118
+ >;
119
+ type PageSizeMatches = Expect<Equals<typeof AggregateComponent.prototype.pageSize, AggregateProps['pageSize']>>;
120
+ /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -112,4 +112,13 @@ type SequenceTypeMatches = Expect<
112
112
  type ViewsMatches = Expect<
113
113
  Equals<typeof MutationComparisonComponent.prototype.views, MutationComparisonProps['views']>
114
114
  >;
115
+ type WidthMatches = Expect<
116
+ Equals<typeof MutationComparisonComponent.prototype.width, MutationComparisonProps['width']>
117
+ >;
118
+ type HeightMatches = Expect<
119
+ Equals<typeof MutationComparisonComponent.prototype.height, MutationComparisonProps['height']>
120
+ >;
121
+ type PageSizeMatches = Expect<
122
+ Equals<typeof MutationComparisonComponent.prototype.pageSize, MutationComparisonProps['pageSize']>
123
+ >;
115
124
  /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -10,9 +10,27 @@ import {
10
10
  LAPIS_URL,
11
11
  NUCLEOTIDE_MUTATIONS_ENDPOINT,
12
12
  } from '../../constants';
13
+ import aggregated_01 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_01.json';
14
+ import aggregated_02 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_02.json';
15
+ import aggregated_03 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_03.json';
16
+ import aggregated_04 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_04.json';
17
+ import aggregated_05 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_05.json';
18
+ import aggregated_06 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_06.json';
19
+ import aggregated_07 from '../../preact/mutationsOverTime/__mockData__/aggregated_2024_07.json';
20
+ import aggregated_20_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json';
21
+ import aggregated_21_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json';
22
+ import aggregated_22_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json';
23
+ import aggregated_23_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json';
24
+ import aggregated_24_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json';
25
+ import aggregated_25_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json';
26
+ import aggregated_26_01_2024 from '../../preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json';
13
27
  import aggregated_byDay from '../../preact/mutationsOverTime/__mockData__/aggregated_byDay.json';
14
28
  import aggregated_byWeek from '../../preact/mutationsOverTime/__mockData__/aggregated_byWeek.json';
15
29
  import aggregated_date from '../../preact/mutationsOverTime/__mockData__/aggregated_date.json';
30
+ import aggregated_week3 from '../../preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json';
31
+ import aggregated_week4 from '../../preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json';
32
+ import aggregated_week5 from '../../preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json';
33
+ import aggregated_week6 from '../../preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json';
16
34
  import aminoAcidMutations_20_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_20_01_2024.json';
17
35
  import aminoAcidMutations_21_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_21_01_2024.json';
18
36
  import aminoAcidMutations_22_01_2024 from '../../preact/mutationsOverTime/__mockData__/aminoAcidMutations_22_01_2024.json';
@@ -126,6 +144,118 @@ export const ByMonth: StoryObj<Required<MutationsOverTimeProps>> = {
126
144
  body: aggregated_date,
127
145
  },
128
146
  },
147
+ {
148
+ matcher: {
149
+ name: 'aggregated_01',
150
+ url: AGGREGATED_ENDPOINT,
151
+ body: {
152
+ dateFrom: '2024-01-01',
153
+ dateTo: '2024-01-31',
154
+ fields: [],
155
+ pangoLineage: 'JN.1*',
156
+ },
157
+ },
158
+ response: {
159
+ status: 200,
160
+ body: aggregated_01,
161
+ },
162
+ },
163
+ {
164
+ matcher: {
165
+ name: 'aggregated_02',
166
+ url: AGGREGATED_ENDPOINT,
167
+ body: {
168
+ dateFrom: '2024-02-01',
169
+ dateTo: '2024-02-29',
170
+ fields: [],
171
+ pangoLineage: 'JN.1*',
172
+ },
173
+ },
174
+ response: {
175
+ status: 200,
176
+ body: aggregated_02,
177
+ },
178
+ },
179
+ {
180
+ matcher: {
181
+ name: 'aggregated_03',
182
+ url: AGGREGATED_ENDPOINT,
183
+ body: {
184
+ dateFrom: '2024-03-01',
185
+ dateTo: '2024-03-31',
186
+ fields: [],
187
+ pangoLineage: 'JN.1*',
188
+ },
189
+ },
190
+ response: {
191
+ status: 200,
192
+ body: aggregated_03,
193
+ },
194
+ },
195
+ {
196
+ matcher: {
197
+ name: 'aggregated_04',
198
+ url: AGGREGATED_ENDPOINT,
199
+ body: {
200
+ dateFrom: '2024-04-01',
201
+ dateTo: '2024-04-30',
202
+ fields: [],
203
+ pangoLineage: 'JN.1*',
204
+ },
205
+ },
206
+ response: {
207
+ status: 200,
208
+ body: aggregated_04,
209
+ },
210
+ },
211
+ {
212
+ matcher: {
213
+ name: 'aggregated_05',
214
+ url: AGGREGATED_ENDPOINT,
215
+ body: {
216
+ dateFrom: '2024-05-01',
217
+ dateTo: '2024-05-31',
218
+ fields: [],
219
+ pangoLineage: 'JN.1*',
220
+ },
221
+ },
222
+ response: {
223
+ status: 200,
224
+ body: aggregated_05,
225
+ },
226
+ },
227
+ {
228
+ matcher: {
229
+ name: 'aggregated_06',
230
+ url: AGGREGATED_ENDPOINT,
231
+ body: {
232
+ dateFrom: '2024-06-01',
233
+ dateTo: '2024-06-30',
234
+ fields: [],
235
+ pangoLineage: 'JN.1*',
236
+ },
237
+ },
238
+ response: {
239
+ status: 200,
240
+ body: aggregated_06,
241
+ },
242
+ },
243
+ {
244
+ matcher: {
245
+ name: 'aggregated_07',
246
+ url: AGGREGATED_ENDPOINT,
247
+ body: {
248
+ dateFrom: '2024-07-01',
249
+ dateTo: '2024-07-31',
250
+ fields: [],
251
+ pangoLineage: 'JN.1*',
252
+ },
253
+ },
254
+ response: {
255
+ status: 200,
256
+ body: aggregated_07,
257
+ },
258
+ },
129
259
  {
130
260
  matcher: {
131
261
  name: 'nucleotideMutations_overall',
@@ -286,6 +416,70 @@ export const ByWeek: StoryObj<Required<MutationsOverTimeProps>> = {
286
416
  body: aggregated_byWeek,
287
417
  },
288
418
  },
419
+ {
420
+ matcher: {
421
+ name: 'aggregated_week3',
422
+ url: AGGREGATED_ENDPOINT,
423
+ body: {
424
+ dateFrom: '2024-01-15',
425
+ dateTo: '2024-01-21',
426
+ fields: [],
427
+ pangoLineage: 'JN.1*',
428
+ },
429
+ },
430
+ response: {
431
+ status: 200,
432
+ body: aggregated_week3,
433
+ },
434
+ },
435
+ {
436
+ matcher: {
437
+ name: 'aggregated_week4',
438
+ url: AGGREGATED_ENDPOINT,
439
+ body: {
440
+ dateFrom: '2024-01-22',
441
+ dateTo: '2024-01-28',
442
+ fields: [],
443
+ pangoLineage: 'JN.1*',
444
+ },
445
+ },
446
+ response: {
447
+ status: 200,
448
+ body: aggregated_week4,
449
+ },
450
+ },
451
+ {
452
+ matcher: {
453
+ name: 'aggregated_week5',
454
+ url: AGGREGATED_ENDPOINT,
455
+ body: {
456
+ dateFrom: '2024-01-29',
457
+ dateTo: '2024-02-04',
458
+ fields: [],
459
+ pangoLineage: 'JN.1*',
460
+ },
461
+ },
462
+ response: {
463
+ status: 200,
464
+ body: aggregated_week5,
465
+ },
466
+ },
467
+ {
468
+ matcher: {
469
+ name: 'aggregated_week6',
470
+ url: AGGREGATED_ENDPOINT,
471
+ body: {
472
+ dateFrom: '2024-02-05',
473
+ dateTo: '2024-02-11',
474
+ fields: [],
475
+ pangoLineage: 'JN.1*',
476
+ },
477
+ },
478
+ response: {
479
+ status: 200,
480
+ body: aggregated_week6,
481
+ },
482
+ },
289
483
  {
290
484
  matcher: {
291
485
  name: 'nucleotideMutation_overall',
@@ -393,6 +587,83 @@ export const AminoAcidMutationsByDay: StoryObj<Required<MutationsOverTimeProps>>
393
587
  body: aggregated_byDay,
394
588
  },
395
589
  },
590
+ {
591
+ matcher: {
592
+ name: 'aggregated_20_01_2024',
593
+ url: AGGREGATED_ENDPOINT,
594
+ body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-20', dateTo: '2024-01-20', fields: [] },
595
+ },
596
+ response: {
597
+ status: 200,
598
+ body: aggregated_20_01_2024,
599
+ },
600
+ },
601
+ {
602
+ matcher: {
603
+ name: 'aggregated_21_01_2024',
604
+ url: AGGREGATED_ENDPOINT,
605
+ body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-21', dateTo: '2024-01-21', fields: [] },
606
+ },
607
+ response: {
608
+ status: 200,
609
+ body: aggregated_21_01_2024,
610
+ },
611
+ },
612
+ {
613
+ matcher: {
614
+ name: 'aggregated_22_01_2024',
615
+ url: AGGREGATED_ENDPOINT,
616
+ body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-22', dateTo: '2024-01-22', fields: [] },
617
+ },
618
+ response: {
619
+ status: 200,
620
+ body: aggregated_22_01_2024,
621
+ },
622
+ },
623
+ {
624
+ matcher: {
625
+ name: 'aggregated_23_01_2024',
626
+ url: AGGREGATED_ENDPOINT,
627
+ body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-23', dateTo: '2024-01-23', fields: [] },
628
+ },
629
+ response: {
630
+ status: 200,
631
+ body: aggregated_23_01_2024,
632
+ },
633
+ },
634
+ {
635
+ matcher: {
636
+ name: 'aggregated_24_01_2024',
637
+ url: AGGREGATED_ENDPOINT,
638
+ body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-24', dateTo: '2024-01-24', fields: [] },
639
+ },
640
+ response: {
641
+ status: 200,
642
+ body: aggregated_24_01_2024,
643
+ },
644
+ },
645
+ {
646
+ matcher: {
647
+ name: 'aggregated_25_01_2024',
648
+ url: AGGREGATED_ENDPOINT,
649
+ body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-25', dateTo: '2024-01-25', fields: [] },
650
+ },
651
+ response: {
652
+ status: 200,
653
+ body: aggregated_25_01_2024,
654
+ },
655
+ },
656
+ {
657
+ matcher: {
658
+ name: 'aggregated_26_01_2024',
659
+ url: AGGREGATED_ENDPOINT,
660
+ body: { pangoLineage: 'JN.1*', dateFrom: '2024-01-26', dateTo: '2024-01-26', fields: [] },
661
+ },
662
+ response: {
663
+ status: 200,
664
+ body: aggregated_26_01_2024,
665
+ },
666
+ },
396
667
  {
397
668
  matcher: {
398
669
  name: 'aminoAcidMutations_overall',
@@ -112,7 +112,14 @@ type SequenceTypeMatches = Expect<
112
112
  Equals<typeof MutationsOverTimeComponent.prototype.sequenceType, MutationsOverTimeProps['sequenceType']>
113
113
  >;
114
114
  type ViewsMatches = Expect<Equals<typeof MutationsOverTimeComponent.prototype.views, MutationsOverTimeProps['views']>>;
115
+ type WidthMatches = Expect<Equals<typeof MutationsOverTimeComponent.prototype.width, MutationsOverTimeProps['width']>>;
116
+ type HeightMatches = Expect<
117
+ Equals<typeof MutationsOverTimeComponent.prototype.height, MutationsOverTimeProps['height']>
118
+ >;
115
119
  type GranularityMatches = Expect<
116
120
  Equals<typeof MutationsOverTimeComponent.prototype.granularity, MutationsOverTimeProps['granularity']>
117
121
  >;
122
+ type LapisDateFieldMatches = Expect<
123
+ Equals<typeof MutationsOverTimeComponent.prototype.lapisDateField, MutationsOverTimeProps['lapisDateField']>
124
+ >;
118
125
  /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */