@genspectrum/dashboard-components 1.1.0 → 1.3.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.
- package/custom-elements.json +22 -3
- package/dist/{NumberRangeFilterChangedEvent-B64OQZjX.js → NumberRangeFilterChangedEvent-CQ32Qy8D.js} +2 -2
- package/dist/NumberRangeFilterChangedEvent-CQ32Qy8D.js.map +1 -0
- package/dist/assets/mutationOverTimeWorker-C7saVShx.js.map +1 -0
- package/dist/components.d.ts +33 -27
- package/dist/components.js +119 -127
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +27 -27
- package/dist/util.js +1 -1
- package/package.json +7 -3
- package/src/lapisApi/lapisApi.ts +31 -2
- package/src/lapisApi/lapisTypes.ts +35 -1
- package/src/operator/DivisionOperator.ts +4 -2
- package/src/operator/FetchDetailsOperator.ts +1 -1
- package/src/operator/RenameFieldOperator.ts +3 -3
- package/src/preact/aggregatedData/aggregate.tsx +0 -5
- package/src/preact/components/annotated-mutation.tsx +0 -1
- package/src/preact/components/clearable-select.stories.tsx +1 -1
- package/src/preact/components/confidence-interval-selector.tsx +1 -1
- package/src/preact/components/error-boundary.tsx +1 -5
- package/src/preact/components/error-display.tsx +1 -1
- package/src/preact/components/fullscreen.tsx +2 -5
- package/src/preact/components/info.stories.tsx +1 -1
- package/src/preact/components/min-max-range-slider.tsx +1 -1
- package/src/preact/components/proportion-selector.tsx +4 -4
- package/src/preact/components/select.tsx +1 -1
- package/src/preact/components/table.tsx +1 -1
- package/src/preact/components/tabs.tsx +1 -1
- package/src/preact/components/tooltip.stories.tsx +1 -1
- package/src/preact/components/tooltip.tsx +1 -1
- package/src/preact/genomeViewer/CDSPlot.tsx +3 -3
- package/src/preact/genomeViewer/loadGff3.ts +5 -8
- package/src/preact/lineageFilter/lineage-filter.tsx +1 -1
- package/src/preact/locationFilter/location-filter.tsx +4 -4
- package/src/preact/mutationComparison/getMutationComparisonTableData.ts +1 -3
- package/src/preact/mutationComparison/mutation-comparison-venn.tsx +1 -1
- package/src/preact/mutationComparison/mutation-comparison.tsx +0 -5
- package/src/preact/mutationFilter/mutation-filter-info.tsx +2 -2
- package/src/preact/mutationFilter/mutation-filter.tsx +1 -1
- package/src/preact/mutations/getMutationsGridData.ts +2 -6
- package/src/preact/mutations/getMutationsTableData.ts +1 -1
- package/src/preact/mutations/mutations-grid.tsx +1 -1
- package/src/preact/mutations/mutations.tsx +0 -5
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/noDataWhenNoMutationsAreInFilter.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/noDataWhenThereAreNoDatesInFilter.ts +1 -0
- package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +1 -0
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +2 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +11 -11
- package/src/preact/numberRangeFilter/number-range-filter.tsx +4 -4
- package/src/preact/numberSequencesOverTime/getNumberOfSequencesOverTimeTableData.ts +1 -4
- package/src/preact/numberSequencesOverTime/number-sequences-over-time.tsx +0 -5
- package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +1 -1
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +1 -1
- package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +1 -1
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +1 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +5 -5
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +1 -4
- package/src/preact/sequencesByLocation/loadMapSource.tsx +5 -2
- package/src/preact/shared/aspectRatio/AspectRatio.tsx +1 -1
- package/src/preact/shared/floating-ui/hooks.ts +2 -2
- package/src/preact/shared/sort/sortMutationPositions.ts +2 -2
- package/src/preact/shared/tanstackTable/pagination.tsx +2 -2
- package/src/preact/shared/tanstackTable/tanstackTable.tsx +1 -1
- package/src/preact/statistic/statistics.tsx +0 -5
- package/src/preact/textFilter/fetchStringAutocompleteList.ts +1 -10
- package/src/preact/textFilter/text-filter.tsx +1 -6
- package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +1 -1
- package/src/preact/webWorkers/useWebWorker.ts +2 -1
- package/src/preact/webWorkers/workerFunction.ts +2 -2
- package/src/query/computeMapLocationData.ts +1 -1
- package/src/query/queryAggregatedDataOverTime.ts +3 -3
- package/src/query/queryMutationsOverTime.spec.ts +9 -9
- package/src/query/queryMutationsOverTime.ts +121 -37
- package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +935 -0
- package/src/query/queryRelativeGrowthAdvantage.ts +5 -9
- package/src/query/queryWastewaterMutationsOverTime.ts +1 -1
- package/src/types.ts +1 -1
- package/src/utils/mutations.ts +10 -10
- package/src/utils/type-utils.ts +1 -1
- package/src/utils/typeAssertions.spec.ts +1 -1
- package/src/web-components/gs-app.spec-d.ts +1 -1
- package/src/web-components/gs-app.stories.ts +1 -1
- package/src/web-components/input/gs-date-range-filter.tsx +2 -2
- package/src/web-components/input/gs-lineage-filter.tsx +2 -2
- package/src/web-components/input/gs-location-filter.tsx +3 -3
- package/src/web-components/input/gs-mutation-filter.tsx +2 -2
- package/src/web-components/input/gs-number-range-filter.spec.ts +1 -1
- package/src/web-components/input/gs-text-filter.tsx +2 -2
- package/src/web-components/visualization/gs-aggregate.tsx +2 -2
- package/src/web-components/visualization/gs-genome-data-viewer.spec-d.ts +1 -1
- package/src/web-components/visualization/gs-mutation-comparison.tsx +2 -2
- package/src/web-components/visualization/gs-mutations-over-time.spec-d.ts +3 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +3 -0
- package/src/web-components/visualization/gs-mutations-over-time.tsx +9 -0
- package/src/web-components/visualization/gs-mutations.tsx +2 -2
- package/src/web-components/visualization/gs-number-sequences-over-time.tsx +2 -2
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +2 -2
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +2 -2
- package/src/web-components/visualization/gs-sequences-by-location.tsx +2 -2
- package/src/web-components/visualization/gs-statistics.tsx +2 -2
- package/standalone-bundle/assets/mutationOverTimeWorker-DRRi3aMG.js.map +1 -0
- package/standalone-bundle/dashboard-components.js +4454 -4430
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/dist/NumberRangeFilterChangedEvent-B64OQZjX.js.map +0 -1
- package/dist/assets/mutationOverTimeWorker-DjH04AQB.js.map +0 -1
- package/standalone-bundle/assets/mutationOverTimeWorker-B6bf3R3j.js.map +0 -1
|
@@ -13,20 +13,16 @@ export class NotEnoughDataToComputeFitError extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export async function queryRelativeGrowthAdvantage
|
|
16
|
+
export async function queryRelativeGrowthAdvantage(
|
|
17
17
|
numerator: LapisFilter,
|
|
18
18
|
denominator: LapisFilter,
|
|
19
19
|
generationTime: number,
|
|
20
20
|
lapis: string,
|
|
21
|
-
lapisDateField:
|
|
21
|
+
lapisDateField: string,
|
|
22
22
|
signal?: AbortSignal,
|
|
23
23
|
) {
|
|
24
|
-
const fetchNumerator = new FetchAggregatedOperator<
|
|
25
|
-
|
|
26
|
-
}>(numerator, [lapisDateField]);
|
|
27
|
-
const fetchDenominator = new FetchAggregatedOperator<{
|
|
28
|
-
[key in LapisDateField]: string | null;
|
|
29
|
-
}>(denominator, [lapisDateField]);
|
|
24
|
+
const fetchNumerator = new FetchAggregatedOperator<Record<string, string | null>>(numerator, [lapisDateField]);
|
|
25
|
+
const fetchDenominator = new FetchAggregatedOperator<Record<string, string | null>>(denominator, [lapisDateField]);
|
|
30
26
|
const mapToFixedDateKeyNumerator = new RenameFieldOperator(fetchNumerator, lapisDateField, 'date');
|
|
31
27
|
const mapToFixedDateKeyDenominator = new RenameFieldOperator(fetchDenominator, lapisDateField, 'date');
|
|
32
28
|
const mapNumerator = new MapOperator(mapToFixedDateKeyNumerator, toYearMonthDay);
|
|
@@ -36,7 +32,7 @@ export async function queryRelativeGrowthAdvantage<LapisDateField extends string
|
|
|
36
32
|
mapDenominator.evaluate(lapis, signal),
|
|
37
33
|
]);
|
|
38
34
|
const { min: minDate, max: maxDate } = getMinMaxTemporal(denominatorData.content.map((d) => d.date));
|
|
39
|
-
if (!minDate
|
|
35
|
+
if (!minDate) {
|
|
40
36
|
return null;
|
|
41
37
|
}
|
|
42
38
|
|
|
@@ -41,7 +41,7 @@ export async function queryWastewaterMutationsOverTime(
|
|
|
41
41
|
};
|
|
42
42
|
} catch (e) {
|
|
43
43
|
throw new Error(
|
|
44
|
-
`Failed to parse row of wastewater data: ${JSON.stringify(row)}: ${(e as Error)?.message ?? 'Unknown error'}`,
|
|
44
|
+
`Failed to parse row of wastewater data: ${JSON.stringify(row)}: ${(e as Error | null)?.message ?? 'Unknown error'}`,
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
});
|
package/src/types.ts
CHANGED
|
@@ -28,7 +28,7 @@ export const namedLapisFilterSchema = z.object({
|
|
|
28
28
|
});
|
|
29
29
|
export type NamedLapisFilter = z.infer<typeof namedLapisFilterSchema>;
|
|
30
30
|
|
|
31
|
-
export const lapisLocationFilterSchema = z.record(z.union([z.string(), z.undefined()]));
|
|
31
|
+
export const lapisLocationFilterSchema = z.record(z.union([z.string(), z.undefined(), z.null()]));
|
|
32
32
|
export type LapisLocationFilter = z.infer<typeof lapisLocationFilterSchema>;
|
|
33
33
|
|
|
34
34
|
export const temporalGranularitySchema = z.union([
|
package/src/utils/mutations.ts
CHANGED
|
@@ -33,8 +33,8 @@ export class SubstitutionClass implements MutationClass, Substitution {
|
|
|
33
33
|
readonly position: number,
|
|
34
34
|
) {
|
|
35
35
|
const segmentString = this.segment ? `${this.segment}:` : '';
|
|
36
|
-
const valueAtReferenceString = this.valueAtReference
|
|
37
|
-
const substitutionValueString = this.substitutionValue
|
|
36
|
+
const valueAtReferenceString = this.valueAtReference ?? '';
|
|
37
|
+
const substitutionValueString = this.substitutionValue ?? '';
|
|
38
38
|
this.code = `${segmentString}${valueAtReferenceString}${this.position}${substitutionValueString}`;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -55,8 +55,8 @@ export class SubstitutionClass implements MutationClass, Substitution {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
static parse(mutationStr: string): SubstitutionClass | null {
|
|
58
|
-
const match =
|
|
59
|
-
if (match
|
|
58
|
+
const match = substitutionRegex.exec(mutationStr);
|
|
59
|
+
if (match?.groups === undefined) {
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
62
|
return new SubstitutionClass(
|
|
@@ -85,7 +85,7 @@ export class DeletionClass implements MutationClass, Deletion {
|
|
|
85
85
|
readonly position: number,
|
|
86
86
|
) {
|
|
87
87
|
const segmentString = this.segment ? `${this.segment}:` : '';
|
|
88
|
-
const valueAtReferenceString = this.valueAtReference
|
|
88
|
+
const valueAtReferenceString = this.valueAtReference ?? '';
|
|
89
89
|
this.code = `${segmentString}${valueAtReferenceString}${this.position}-`;
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -105,8 +105,8 @@ export class DeletionClass implements MutationClass, Deletion {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
static parse(mutationStr: string): DeletionClass | null {
|
|
108
|
-
const match =
|
|
109
|
-
if (match
|
|
108
|
+
const match = deletionRegex.exec(mutationStr);
|
|
109
|
+
if (match?.groups === undefined) {
|
|
110
110
|
return null;
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -154,8 +154,8 @@ export class InsertionClass implements MutationClass {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
static parse(mutationStr: string): InsertionClass | null {
|
|
157
|
-
const match =
|
|
158
|
-
if (match
|
|
157
|
+
const match = insertionRegexp.exec(mutationStr);
|
|
158
|
+
if (match?.groups === undefined) {
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -204,7 +204,7 @@ export function toSubstitutionOrDeletion(mutation: SubstitutionClass | DeletionC
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
export const bases:
|
|
207
|
+
export const bases: Record<SequenceType, string[]> = {
|
|
208
208
|
nucleotide: ['A', 'C', 'G', 'T', '-'],
|
|
209
209
|
'amino acid': [
|
|
210
210
|
'I',
|
package/src/utils/type-utils.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type NumberFields<S> = keyof S & { [P in keyof S]: S[P] extends number ?
|
|
|
7
7
|
/**
|
|
8
8
|
* MappedType<K, T> is a type that represents an object with keys of type K and values of type T.
|
|
9
9
|
*/
|
|
10
|
-
export type MappedType<K extends string | number | symbol, T> =
|
|
10
|
+
export type MappedType<K extends string | number | symbol, T> = Record<K, T>;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* MappedNumber<K> is a type that represents an object with keys of type K and values of type number.
|
|
@@ -2,7 +2,7 @@ import { describe, it } from 'vitest';
|
|
|
2
2
|
|
|
3
3
|
import { type Equals, type Expect } from './typeAssertions';
|
|
4
4
|
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
6
6
|
describe('Expect', () => {
|
|
7
7
|
it('should only accept true', () => {
|
|
8
8
|
type ShouldBeTrue = Expect<true>;
|
|
@@ -4,7 +4,7 @@ import { AppComponent } from './gs-app';
|
|
|
4
4
|
import { type MutationAnnotations } from './mutation-annotations-context';
|
|
5
5
|
|
|
6
6
|
describe('gs-app types', () => {
|
|
7
|
-
test('mutationAnnotations type should match', (
|
|
7
|
+
test('mutationAnnotations type should match', () => {
|
|
8
8
|
expectTypeOf(AppComponent.prototype).toHaveProperty('mutationAnnotations').toEqualTypeOf<MutationAnnotations>();
|
|
9
9
|
});
|
|
10
10
|
});
|
|
@@ -129,7 +129,7 @@ export const FailsToFetchReferenceGenome: StoryObj<StoryProps> = {
|
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
@customElement('gs-app-display')
|
|
132
|
-
// eslint-disable-next-line
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- it is used in the story above
|
|
133
133
|
class AppDisplay extends LitElement {
|
|
134
134
|
@consume({ context: lapisContext })
|
|
135
135
|
lapis: string = '';
|
|
@@ -151,7 +151,7 @@ declare global {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
154
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
155
155
|
type CustomSelectOptionsMatches = Expect<
|
|
156
156
|
Equals<typeof DateRangeFilterComponent.prototype.dateRangeOptions, DateRangeFilterProps['dateRangeOptions']>
|
|
157
157
|
>;
|
|
@@ -160,4 +160,4 @@ type WidthMatches = Expect<Equals<typeof DateRangeFilterComponent.prototype.widt
|
|
|
160
160
|
type DateColumnMatches = Expect<
|
|
161
161
|
Equals<typeof DateRangeFilterComponent.prototype.lapisDateField, DateRangeFilterProps['lapisDateField']>
|
|
162
162
|
>;
|
|
163
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
163
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -105,7 +105,7 @@ declare global {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
108
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
109
109
|
type InitialValueMatches = Expect<Equals<typeof LineageFilterComponent.prototype.value, LineageFilterProps['value']>>;
|
|
110
110
|
type LapisFieldMatches = Expect<
|
|
111
111
|
Equals<typeof LineageFilterComponent.prototype.lapisField, LineageFilterProps['lapisField']>
|
|
@@ -117,4 +117,4 @@ type PlaceholderTextMatches = Expect<
|
|
|
117
117
|
Equals<typeof LineageFilterComponent.prototype.placeholderText, LineageFilterProps['placeholderText']>
|
|
118
118
|
>;
|
|
119
119
|
type WidthMatches = Expect<Equals<typeof LineageFilterComponent.prototype.width, LineageFilterProps['width']>>;
|
|
120
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
120
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -37,7 +37,7 @@ export class LocationFilterComponent extends PreactLitAdapter {
|
|
|
37
37
|
* The initial value to use for this location filter.
|
|
38
38
|
*/
|
|
39
39
|
@property({ type: Object })
|
|
40
|
-
value: Record<string, string | undefined> | undefined = undefined;
|
|
40
|
+
value: Record<string, string | null | undefined> | undefined = undefined;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Required.
|
|
@@ -109,7 +109,7 @@ declare global {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
112
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
113
113
|
type InitialValueMatches = Expect<Equals<typeof LocationFilterComponent.prototype.value, LocationFilterProps['value']>>;
|
|
114
114
|
type FieldsMatches = Expect<Equals<typeof LocationFilterComponent.prototype.fields, LocationFilterProps['fields']>>;
|
|
115
115
|
type LapisFilterMatches = Expect<
|
|
@@ -119,4 +119,4 @@ type PlaceholderTextMatches = Expect<
|
|
|
119
119
|
Equals<typeof LocationFilterComponent.prototype.placeholderText, LocationFilterProps['placeholderText']>
|
|
120
120
|
>;
|
|
121
121
|
type WidthMatches = Expect<Equals<typeof LocationFilterComponent.prototype.width, LocationFilterProps['width']>>;
|
|
122
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
122
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -109,9 +109,9 @@ declare global {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
112
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
113
113
|
type InitialValueMatches = Expect<
|
|
114
114
|
Equals<typeof MutationFilterComponent.prototype.initialValue, MutationFilterProps['initialValue']>
|
|
115
115
|
>;
|
|
116
116
|
type WidthMatches = Expect<Equals<typeof MutationFilterComponent.prototype.width, MutationFilterProps['width']>>;
|
|
117
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
117
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -4,7 +4,7 @@ import { NumberRangeFilterComponent } from './gs-number-range-filter';
|
|
|
4
4
|
import { type NumberRangeFilterProps } from '../../preact/numberRangeFilter/number-range-filter';
|
|
5
5
|
|
|
6
6
|
describe('gs-number-range-filter types', () => {
|
|
7
|
-
test('should match', (
|
|
7
|
+
test('should match', () => {
|
|
8
8
|
expectTypeOf(NumberRangeFilterComponent.prototype)
|
|
9
9
|
.toHaveProperty('value')
|
|
10
10
|
.toEqualTypeOf<NumberRangeFilterProps['value']>();
|
|
@@ -99,7 +99,7 @@ declare global {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
102
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
103
103
|
type InitialValueMatches = Expect<Equals<typeof TextFilterComponent.prototype.value, TextFilterProps['value']>>;
|
|
104
104
|
type LapisFieldMatches = Expect<Equals<typeof TextFilterComponent.prototype.lapisField, TextFilterProps['lapisField']>>;
|
|
105
105
|
type LapisFilterMatches = Expect<
|
|
@@ -109,4 +109,4 @@ type PlaceholderTextMatches = Expect<
|
|
|
109
109
|
Equals<typeof TextFilterComponent.prototype.placeholderText, TextFilterProps['placeholderText']>
|
|
110
110
|
>;
|
|
111
111
|
type WidthMatches = Expect<Equals<typeof TextFilterComponent.prototype.width, TextFilterProps['width']>>;
|
|
112
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
112
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -138,7 +138,7 @@ declare global {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
141
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
142
142
|
type FieldsMatches = Expect<Equals<typeof AggregateComponent.prototype.fields, AggregateProps['fields']>>;
|
|
143
143
|
type ViewsMatches = Expect<Equals<typeof AggregateComponent.prototype.views, AggregateProps['views']>>;
|
|
144
144
|
type FilterMatches = Expect<Equals<typeof AggregateComponent.prototype.lapisFilter, AggregateProps['lapisFilter']>>;
|
|
@@ -154,4 +154,4 @@ type PageSizeMatches = Expect<Equals<typeof AggregateComponent.prototype.pageSiz
|
|
|
154
154
|
type MaxNumberOfBarsMatches = Expect<
|
|
155
155
|
Equals<typeof AggregateComponent.prototype.maxNumberOfBars, AggregateProps['maxNumberOfBars']>
|
|
156
156
|
>;
|
|
157
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
157
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -4,7 +4,7 @@ import { GenomeDataViewerComponent } from './gs-genome-data-viewer';
|
|
|
4
4
|
import type { GenomeDataViewerProps } from '../../preact/genomeViewer/genome-data-viewer';
|
|
5
5
|
|
|
6
6
|
describe('gs-app types', () => {
|
|
7
|
-
test('mutationAnnotations type should match', (
|
|
7
|
+
test('mutationAnnotations type should match', () => {
|
|
8
8
|
expectTypeOf(GenomeDataViewerComponent.prototype)
|
|
9
9
|
.toHaveProperty('gff3Source')
|
|
10
10
|
.toEqualTypeOf<GenomeDataViewerProps['gff3Source']>();
|
|
@@ -134,7 +134,7 @@ declare global {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
137
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
138
138
|
type LapisFiltersMatches = Expect<
|
|
139
139
|
Equals<typeof MutationComparisonComponent.prototype.lapisFilters, MutationComparisonProps['lapisFilters']>
|
|
140
140
|
>;
|
|
@@ -153,4 +153,4 @@ type HeightMatches = Expect<
|
|
|
153
153
|
type PageSizeMatches = Expect<
|
|
154
154
|
Equals<typeof MutationComparisonComponent.prototype.pageSize, MutationComparisonProps['pageSize']>
|
|
155
155
|
>;
|
|
156
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
156
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -32,6 +32,9 @@ describe('gs-mutations-over-time', () => {
|
|
|
32
32
|
expectTypeOf<typeof MutationsOverTimeComponent.prototype.initialMeanProportionInterval>().toEqualTypeOf<
|
|
33
33
|
MutationsOverTimeProps['initialMeanProportionInterval']
|
|
34
34
|
>();
|
|
35
|
+
expectTypeOf<typeof MutationsOverTimeComponent.prototype.useNewEndpoint>().toEqualTypeOf<
|
|
36
|
+
MutationsOverTimeProps['useNewEndpoint']
|
|
37
|
+
>();
|
|
35
38
|
expectTypeOf<typeof MutationsOverTimeComponent.prototype.pageSizes>().toEqualTypeOf<
|
|
36
39
|
MutationsOverTimeProps['pageSizes']
|
|
37
40
|
>();
|
|
@@ -42,6 +42,7 @@ const meta: Meta<Required<MutationsOverTimeProps>> = {
|
|
|
42
42
|
lapisDateField: { control: 'text' },
|
|
43
43
|
displayMutations: { control: 'object' },
|
|
44
44
|
initialMeanProportionInterval: { control: 'object' },
|
|
45
|
+
useNewEndpoint: { control: 'boolean' },
|
|
45
46
|
pageSizes: { control: 'object' },
|
|
46
47
|
},
|
|
47
48
|
args: {
|
|
@@ -52,6 +53,7 @@ const meta: Meta<Required<MutationsOverTimeProps>> = {
|
|
|
52
53
|
granularity: 'month',
|
|
53
54
|
lapisDateField: 'date',
|
|
54
55
|
initialMeanProportionInterval: { min: 0.05, max: 0.9 },
|
|
56
|
+
useNewEndpoint: false,
|
|
55
57
|
pageSizes: [10, 20, 30, 40, 50],
|
|
56
58
|
},
|
|
57
59
|
parameters: withComponentDocs({
|
|
@@ -99,6 +101,7 @@ const Template: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
99
101
|
.displayMutations=${args.displayMutations}
|
|
100
102
|
.initialMeanProportionInterval=${args.initialMeanProportionInterval}
|
|
101
103
|
.pageSizes=${args.pageSizes}
|
|
104
|
+
.useNewEndpoint=${args.useNewEndpoint}
|
|
102
105
|
></gs-mutations-over-time>
|
|
103
106
|
</gs-app>
|
|
104
107
|
`,
|
|
@@ -113,6 +113,14 @@ export class MutationsOverTimeComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
113
113
|
@property({ type: Object })
|
|
114
114
|
initialMeanProportionInterval: { min: number; max: number } = { min: 0.05, max: 0.9 };
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Whether to use the mutationsOverTime endpoint from LAPIS.
|
|
118
|
+
* If true, use the endpoint, if false, compute component data as before.
|
|
119
|
+
* Eventually, the new endpoint will become the default.
|
|
120
|
+
*/
|
|
121
|
+
@property({ type: Boolean })
|
|
122
|
+
useNewEndpoint?: boolean = false;
|
|
123
|
+
|
|
116
124
|
/**
|
|
117
125
|
* The number of rows per page, which can be selected by the user.
|
|
118
126
|
*/
|
|
@@ -138,6 +146,7 @@ export class MutationsOverTimeComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
138
146
|
lapisDateField={this.lapisDateField}
|
|
139
147
|
displayMutations={this.displayMutations}
|
|
140
148
|
initialMeanProportionInterval={this.initialMeanProportionInterval}
|
|
149
|
+
useNewEndpoint={this.useNewEndpoint}
|
|
141
150
|
pageSizes={this.pageSizes}
|
|
142
151
|
/>
|
|
143
152
|
</MutationAnnotationsContextProvider>
|
|
@@ -166,7 +166,7 @@ declare global {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
169
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
170
170
|
type LapisFilterMatches = Expect<
|
|
171
171
|
Equals<typeof MutationsComponent.prototype.lapisFilter, MutationsProps['lapisFilter']>
|
|
172
172
|
>;
|
|
@@ -180,4 +180,4 @@ type ViewsMatches = Expect<Equals<typeof MutationsComponent.prototype.views, Mut
|
|
|
180
180
|
type WidthMatches = Expect<Equals<typeof MutationsComponent.prototype.width, MutationsProps['width']>>;
|
|
181
181
|
type HeightMatches = Expect<Equals<typeof MutationsComponent.prototype.height, MutationsProps['height']>>;
|
|
182
182
|
type PageSizeMatches = Expect<Equals<typeof MutationsComponent.prototype.pageSize, MutationsProps['pageSize']>>;
|
|
183
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
183
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -133,7 +133,7 @@ declare global {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
136
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
137
137
|
type LapisFilterMatches = Expect<
|
|
138
138
|
Equals<typeof NumberSequencesOverTimeComponent.prototype.lapisFilters, NumberSequencesOverTimeProps['lapisFilters']>
|
|
139
139
|
>;
|
|
@@ -164,4 +164,4 @@ type SmoothingWindowMatches = Expect<
|
|
|
164
164
|
type PageSizeMatches = Expect<
|
|
165
165
|
Equals<typeof NumberSequencesOverTimeComponent.prototype.pageSize, NumberSequencesOverTimeProps['pageSize']>
|
|
166
166
|
>;
|
|
167
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
167
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -200,7 +200,7 @@ declare global {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
203
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
204
204
|
type NumeratorMatches = Expect<
|
|
205
205
|
Equals<typeof PrevalenceOverTimeComponent.prototype.numeratorFilters, PrevalenceOverTimeProps['numeratorFilters']>
|
|
206
206
|
>;
|
|
@@ -243,4 +243,4 @@ type YAxisMaxLogarithmicMatches = Expect<
|
|
|
243
243
|
PrevalenceOverTimeProps['yAxisMaxLogarithmic']
|
|
244
244
|
>
|
|
245
245
|
>;
|
|
246
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
246
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -154,7 +154,7 @@ declare global {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
157
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
158
158
|
type NumeratorMatches = Expect<
|
|
159
159
|
Equals<
|
|
160
160
|
typeof RelativeGrowthAdvantageComponent.prototype.numeratorFilter,
|
|
@@ -200,4 +200,4 @@ type YAxisMaxLogarithmicMatches = Expect<
|
|
|
200
200
|
RelativeGrowthAdvantageProps['yAxisMaxLogarithmic']
|
|
201
201
|
>
|
|
202
202
|
>;
|
|
203
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
203
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -226,7 +226,7 @@ declare global {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
229
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
230
230
|
type LapisFilterMatches = Expect<
|
|
231
231
|
Equals<typeof SequencesByLocationComponent.prototype.lapisFilter, SequencesByLocationProps['lapisFilter']>
|
|
232
232
|
>;
|
|
@@ -261,4 +261,4 @@ type OffsetXMatches = Expect<
|
|
|
261
261
|
type OffsetYMatches = Expect<
|
|
262
262
|
Equals<typeof SequencesByLocationComponent.prototype.offsetY, SequencesByLocationProps['offsetY']>
|
|
263
263
|
>;
|
|
264
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
264
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
@@ -83,7 +83,7 @@ declare global {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
/* eslint-disable @typescript-eslint/no-unused-vars
|
|
86
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
87
87
|
type WidthMatches = Expect<Equals<typeof StatisticsComponent.prototype.width, StatisticsProps['width']>>;
|
|
88
88
|
type HeightMatches = Expect<Equals<typeof StatisticsComponent.prototype.height, StatisticsProps['height']>>;
|
|
89
89
|
type DenominatorFilterMatches = Expect<
|
|
@@ -92,4 +92,4 @@ type DenominatorFilterMatches = Expect<
|
|
|
92
92
|
type NumeratorFilterMatches = Expect<
|
|
93
93
|
Equals<typeof StatisticsComponent.prototype.numeratorFilter, StatisticsProps['numeratorFilter']>
|
|
94
94
|
>;
|
|
95
|
-
/* eslint-enable @typescript-eslint/no-unused-vars
|
|
95
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|