@genspectrum/dashboard-components 0.10.4 → 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 (53) hide show
  1. package/custom-elements.json +58 -58
  2. package/dist/components.d.ts +97 -47
  3. package/dist/components.js +57 -65
  4. package/dist/components.js.map +1 -1
  5. package/dist/{dateRangeOption-Doo6WHKu.js → dateRangeOption-Bh2p78z0.js} +9 -4
  6. package/dist/dateRangeOption-Bh2p78z0.js.map +1 -0
  7. package/dist/util.d.ts +624 -31
  8. package/dist/util.js +1 -1
  9. package/package.json +5 -5
  10. package/src/preact/aggregatedData/aggregate.stories.tsx +1 -1
  11. package/src/preact/aggregatedData/aggregate.tsx +11 -8
  12. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +3 -11
  13. package/src/preact/dateRangeSelector/date-range-selector.tsx +4 -4
  14. package/src/preact/mutationComparison/mutation-comparison.tsx +4 -6
  15. package/src/preact/mutationFilter/mutation-filter.tsx +4 -13
  16. package/src/preact/mutations/mutations.tsx +4 -4
  17. package/src/preact/mutationsOverTime/mutations-over-time.tsx +4 -4
  18. package/src/preact/numberSequencesOverTime/number-sequences-over-time.stories.tsx +4 -13
  19. package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +4 -4
  20. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +14 -25
  21. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +8 -8
  22. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +3 -14
  23. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +11 -7
  24. package/src/query/queryNumberOfSequencesOverTime.spec.ts +4 -4
  25. package/src/query/queryNumberOfSequencesOverTime.ts +1 -4
  26. package/src/query/queryPrevalenceOverTime.ts +1 -4
  27. package/src/types.ts +11 -4
  28. package/src/utilEntrypoint.ts +16 -4
  29. package/src/utils/utils.ts +0 -29
  30. package/src/web-components/app.ts +1 -1
  31. package/src/web-components/input/gs-date-range-selector.stories.ts +4 -4
  32. package/src/web-components/input/gs-date-range-selector.tsx +5 -5
  33. package/src/web-components/input/gs-lineage-filter.tsx +1 -1
  34. package/src/web-components/input/gs-location-filter.tsx +1 -1
  35. package/src/web-components/input/gs-mutation-filter.tsx +5 -8
  36. package/src/web-components/input/gs-text-input.tsx +1 -1
  37. package/src/web-components/visualization/gs-aggregate.stories.ts +3 -3
  38. package/src/web-components/visualization/gs-aggregate.tsx +10 -6
  39. package/src/web-components/visualization/gs-mutation-comparison.tsx +7 -2
  40. package/src/web-components/visualization/gs-mutations-over-time.tsx +7 -2
  41. package/src/web-components/visualization/gs-mutations.tsx +7 -2
  42. package/src/web-components/visualization/gs-number-sequences-over-time.stories.ts +5 -5
  43. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +13 -15
  44. package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +8 -8
  45. package/src/web-components/visualization/gs-prevalence-over-time.tsx +17 -14
  46. package/src/web-components/visualization/gs-relative-growth-advantage.stories.ts +4 -5
  47. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +17 -15
  48. package/src/web-components/visualization/gs-sequences-by-location.tsx +6 -1
  49. package/src/web-components/visualization/gs-statistics.tsx +12 -3
  50. package/standalone-bundle/dashboard-components.js +2520 -2516
  51. package/standalone-bundle/dashboard-components.js.map +1 -1
  52. package/dist/dateRangeOption-Doo6WHKu.js.map +0 -1
  53. package/src/utils/utils.spec.ts +0 -16
@@ -1,11 +1,10 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
- import { type DetailedHTMLProps, type HTMLAttributes } from 'react';
2
+ import type { DetailedHTMLProps, HTMLAttributes } from 'react';
3
3
 
4
4
  import {
5
5
  RelativeGrowthAdvantage,
6
6
  type RelativeGrowthAdvantageProps,
7
7
  } from '../../preact/relativeGrowthAdvantage/relative-growth-advantage';
8
- import { type AxisMax } from '../../preact/shared/charts/getYAxisMax';
9
8
  import { type Equals, type Expect } from '../../utils/typeAssertions';
10
9
  import { PreactLitAdapter } from '../PreactLitAdapter';
11
10
 
@@ -42,14 +41,24 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
42
41
  * It must be a valid LAPIS filter object.
43
42
  */
44
43
  @property({ type: Object })
45
- numeratorFilter: Record<string, string | number | null | boolean> = {};
44
+ numeratorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
45
+ nucleotideMutations?: string[];
46
+ aminoAcidMutations?: string[];
47
+ nucleotideInsertions?: string[];
48
+ aminoAcidInsertions?: string[];
49
+ } = {};
46
50
 
47
51
  /**
48
52
  * LAPIS filter to select the data of the baseline variant.
49
53
  * It must be a valid LAPIS filter object.
50
54
  */
51
55
  @property({ type: Object })
52
- denominatorFilter: Record<string, string | number | null | boolean> = {};
56
+ denominatorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
57
+ nucleotideMutations?: string[];
58
+ aminoAcidMutations?: string[];
59
+ nucleotideInsertions?: string[];
60
+ aminoAcidInsertions?: string[];
61
+ } = {};
53
62
 
54
63
  /**
55
64
  * The generation time represents the number of days over which the variant's relative growth advantage is measured.
@@ -120,20 +129,13 @@ export class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
120
129
  width={this.width}
121
130
  height={this.height}
122
131
  lapisDateField={this.lapisDateField}
123
- yAxisMaxConfig={{
124
- linear: this.yAxisMaxLinear,
125
- logarithmic: this.yAxisMaxLogarithmic,
126
- }}
132
+ yAxisMaxLinear={this.yAxisMaxLinear}
133
+ yAxisMaxLogarithmic={this.yAxisMaxLogarithmic}
127
134
  />
128
135
  );
129
136
  }
130
137
  }
131
138
 
132
- export interface RelativeGrowthAdvantageComponentProps extends Omit<RelativeGrowthAdvantageProps, 'yAxisMaxConfig'> {
133
- yAxisMaxLinear?: AxisMax;
134
- yAxisMaxLogarithmic?: AxisMax;
135
- }
136
-
137
139
  declare global {
138
140
  interface HTMLElementTagNameMap {
139
141
  'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
@@ -186,13 +188,13 @@ type LapisDateFieldMatches = Expect<
186
188
  type YAxisMaxLinearMatches = Expect<
187
189
  Equals<
188
190
  typeof RelativeGrowthAdvantageComponent.prototype.yAxisMaxLinear,
189
- Required<RelativeGrowthAdvantageProps['yAxisMaxConfig']>['linear']
191
+ RelativeGrowthAdvantageProps['yAxisMaxLinear']
190
192
  >
191
193
  >;
192
194
  type YAxisMaxLogarithmicMatches = Expect<
193
195
  Equals<
194
196
  typeof RelativeGrowthAdvantageComponent.prototype.yAxisMaxLogarithmic,
195
- Required<RelativeGrowthAdvantageProps['yAxisMaxConfig']>['logarithmic']
197
+ RelativeGrowthAdvantageProps['yAxisMaxLogarithmic']
196
198
  >
197
199
  >;
198
200
  /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
@@ -102,7 +102,12 @@ export class SequencesByLocationComponent extends PreactLitAdapterWithGridJsStyl
102
102
  * you should usually filter by that country here (e.g. { country: 'USA' }).
103
103
  */
104
104
  @property({ type: Object })
105
- lapisFilter: Record<string, string | number | null | boolean> = {};
105
+ lapisFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
106
+ nucleotideMutations?: string[];
107
+ aminoAcidMutations?: string[];
108
+ nucleotideInsertions?: string[];
109
+ aminoAcidInsertions?: string[];
110
+ } = {};
106
111
 
107
112
  /**
108
113
  * Required.
@@ -2,7 +2,6 @@ import { customElement, property } from 'lit/decorators.js';
2
2
  import type { DetailedHTMLProps, HTMLAttributes } from 'react';
3
3
 
4
4
  import { Statistics, type StatisticsProps } from '../../preact/statistic/statistics';
5
- import type { LapisFilter } from '../../types';
6
5
  import type { Equals, Expect } from '../../utils/typeAssertions';
7
6
  import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
8
7
 
@@ -19,14 +18,24 @@ export class StatisticsComponent extends PreactLitAdapterWithGridJsStyles {
19
18
  * It must be a valid LAPIS filter object.
20
19
  */
21
20
  @property({ type: Object })
22
- numeratorFilter: LapisFilter = {};
21
+ numeratorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
22
+ nucleotideMutations?: string[];
23
+ aminoAcidMutations?: string[];
24
+ nucleotideInsertions?: string[];
25
+ aminoAcidInsertions?: string[];
26
+ } = {};
23
27
 
24
28
  /**
25
29
  * The filter to apply to the data for the denominator of the proportion.
26
30
  * It must be a valid LAPIS filter object.
27
31
  */
28
32
  @property({ type: Object })
29
- denominatorFilter: LapisFilter = {};
33
+ denominatorFilter: Record<string, string | string[] | number | null | boolean | undefined> & {
34
+ nucleotideMutations?: string[];
35
+ aminoAcidMutations?: string[];
36
+ nucleotideInsertions?: string[];
37
+ aminoAcidInsertions?: string[];
38
+ } = {};
30
39
 
31
40
  /**
32
41
  * The width of the component.