@genspectrum/dashboard-components 0.1.4 → 0.2.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 +1021 -804
- package/dist/dashboard-components.js +647 -218
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +336 -126
- package/dist/style.css +214 -36
- package/package.json +4 -4
- package/src/preact/aggregatedData/aggregate.stories.tsx +2 -0
- package/src/preact/aggregatedData/aggregate.tsx +33 -28
- package/src/preact/components/error-boundary.stories.tsx +62 -0
- package/src/preact/components/error-boundary.tsx +31 -0
- package/src/preact/components/error-display.stories.tsx +24 -3
- package/src/preact/components/error-display.tsx +14 -1
- package/src/preact/components/headline.stories.tsx +19 -1
- package/src/preact/components/headline.tsx +9 -1
- package/src/preact/components/info.stories.tsx +24 -3
- package/src/preact/components/info.tsx +49 -5
- package/src/preact/components/loading-display.stories.tsx +6 -6
- package/src/preact/components/loading-display.tsx +1 -1
- package/src/preact/components/no-data-display.tsx +5 -1
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +17 -0
- package/src/preact/dateRangeSelector/date-range-selector.tsx +43 -15
- package/src/preact/locationFilter/location-filter.stories.tsx +23 -6
- package/src/preact/locationFilter/location-filter.tsx +29 -18
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +3 -0
- package/src/preact/mutationComparison/mutation-comparison.tsx +31 -27
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +17 -2
- package/src/preact/mutationFilter/mutation-filter.tsx +26 -8
- package/src/preact/mutations/mutations.stories.tsx +3 -0
- package/src/preact/mutations/mutations.tsx +32 -26
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +4 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +57 -31
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +3 -0
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +89 -32
- package/src/preact/textInput/text-input.tsx +26 -3
- package/src/web-components/app.stories.ts +1 -2
- package/src/web-components/app.ts +4 -2
- package/src/web-components/index.ts +1 -1
- package/src/web-components/input/{date-range-selector-component.stories.ts → gs-date-range-selector.stories.ts} +35 -3
- package/src/web-components/input/gs-date-range-selector.tsx +110 -0
- package/src/web-components/input/{location-filter-component.stories.ts → gs-location-filter.stories.ts} +29 -4
- package/src/web-components/input/{location-filter-component.tsx → gs-location-filter.tsx} +12 -1
- package/src/web-components/input/{mutation-filter-component.stories.ts → gs-mutation-filter.stories.ts} +30 -4
- package/src/web-components/input/gs-mutation-filter.tsx +114 -0
- package/src/web-components/input/{text-input-component.stories.ts → gs-text-input.stories.ts} +42 -3
- package/src/web-components/input/gs-text-input.tsx +73 -0
- package/src/web-components/input/index.ts +4 -4
- package/src/web-components/visualization/data_visualization_statistical_analysis.mdx +26 -0
- package/src/web-components/{display/aggregate-component.stories.ts → visualization/gs-aggregate.stories.ts} +8 -6
- package/src/web-components/{display/aggregate-component.tsx → visualization/gs-aggregate.tsx} +16 -2
- package/src/web-components/{display/mutation-comparison-component.stories.ts → visualization/gs-mutation-comparison.stories.ts} +11 -9
- package/src/web-components/{display/mutation-comparison-component.tsx → visualization/gs-mutation-comparison.tsx} +8 -1
- package/src/web-components/{display/mutations-component.stories.ts → visualization/gs-mutations.stories.ts} +30 -11
- package/src/web-components/visualization/gs-mutations.tsx +94 -0
- package/src/web-components/{display/prevalence-over-time-component.stories.ts → visualization/gs-prevalence-over-time.stories.ts} +24 -1
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +148 -0
- package/src/web-components/{display/relative-growth-advantage-component.stories.ts → visualization/gs-relative-growth-advantage.stories.ts} +21 -1
- package/src/web-components/visualization/gs-relative-growth-advantage.tsx +100 -0
- package/src/web-components/visualization/index.ts +5 -0
- package/src/web-components/display/index.ts +0 -5
- package/src/web-components/display/mutations-component.tsx +0 -40
- package/src/web-components/display/prevalence-over-time-component.tsx +0 -58
- package/src/web-components/display/relative-growth-advantage-component.tsx +0 -49
- package/src/web-components/input/date-range-selector-component.tsx +0 -46
- package/src/web-components/input/mutation-filter-component.tsx +0 -35
- package/src/web-components/input/text-input-component.tsx +0 -39
|
@@ -26,7 +26,7 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
26
26
|
* The proportion represents the ratio of the aggregated value to the total count of the data
|
|
27
27
|
* (considering the applied filter).
|
|
28
28
|
*/
|
|
29
|
-
views:
|
|
29
|
+
views: View[];
|
|
30
30
|
/**
|
|
31
31
|
* The filter to apply to the data.
|
|
32
32
|
*/
|
|
@@ -43,6 +43,10 @@ export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
43
43
|
width?: string;
|
|
44
44
|
height?: string;
|
|
45
45
|
} | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The headline of the component. Set to an empty string to hide the headline.
|
|
48
|
+
*/
|
|
49
|
+
headline: string | undefined;
|
|
46
50
|
render(): JSX_2.Element;
|
|
47
51
|
}
|
|
48
52
|
|
|
@@ -73,46 +77,60 @@ export declare class App extends LitElement {
|
|
|
73
77
|
createRenderRoot(): this;
|
|
74
78
|
}
|
|
75
79
|
|
|
76
|
-
declare type ConfidenceIntervalMethod = 'wilson' | 'none';
|
|
77
|
-
|
|
78
|
-
declare type CustomSelectOption<CustomLabel extends string> = {
|
|
79
|
-
label: CustomLabel;
|
|
80
|
-
dateFrom: string;
|
|
81
|
-
dateTo: string;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
80
|
/**
|
|
85
|
-
*
|
|
81
|
+
* ## Context
|
|
82
|
+
* This component is a group of input fields designed to specify a date range. It consists of 3 fields:
|
|
83
|
+
*
|
|
84
|
+
* - a select field to choose a predefined date range,
|
|
85
|
+
* - an input field with an attached date picker for the start date,
|
|
86
|
+
* - an input field with an attached date picker for the end date.
|
|
87
|
+
*
|
|
88
|
+
* Setting a value in the select field will overwrite the previous values of the start and end date.
|
|
89
|
+
* Setting a value in either of the date pickers will set the select field to "custom",
|
|
90
|
+
* which represents an arbitrary date range.
|
|
91
|
+
*
|
|
92
|
+
* @fires {CustomEvent<{ dateFrom: string; dateTo: string; }>} gs-date-range-changed
|
|
93
|
+
* Fired when:
|
|
94
|
+
* - The select field is changed,
|
|
95
|
+
* - A date is selected in either of the date pickers,
|
|
96
|
+
* - A date was typed into either of the date input fields, and the input field loses focus ("on blur").
|
|
97
|
+
* Contains the dates in the format `YYYY-MM-DD`.
|
|
86
98
|
*/
|
|
87
|
-
export declare class DateRangeSelectorComponent
|
|
88
|
-
|
|
99
|
+
export declare class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
100
|
+
/**
|
|
101
|
+
* An array of custom options that the select field should provide,
|
|
102
|
+
* in addition to the predefined options.
|
|
103
|
+
* The `label` will be shown to the user, and it will be available as `initialValue`.
|
|
104
|
+
* The dates must be in the format `YYYY-MM-DD`.
|
|
105
|
+
*/
|
|
106
|
+
customSelectOptions: {
|
|
107
|
+
label: string;
|
|
108
|
+
dateFrom: string;
|
|
109
|
+
dateTo: string;
|
|
110
|
+
}[];
|
|
111
|
+
/**
|
|
112
|
+
* The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.
|
|
113
|
+
*/
|
|
89
114
|
earliestDate: string | undefined;
|
|
90
|
-
|
|
115
|
+
/**
|
|
116
|
+
* The initial value to use for this date range selector.
|
|
117
|
+
* Must be a valid label from the preset labels or a `label` given in the `customSelectOptions`.
|
|
118
|
+
*
|
|
119
|
+
* If the value is invalid, the component will default to `'last6Months'`.
|
|
120
|
+
*/
|
|
121
|
+
initialValue: 'custom' | 'allTimes' | 'last2Weeks' | 'lastMonth' | 'last2Months' | 'last3Months' | 'last6Months' | string | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* The width of the component.
|
|
124
|
+
*
|
|
125
|
+
* If not set, the component will take the full width of its container.
|
|
126
|
+
*
|
|
127
|
+
* The width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.
|
|
128
|
+
* If the unit is %, the size will be relative to the container of the component.
|
|
129
|
+
*/
|
|
130
|
+
width: string | undefined;
|
|
91
131
|
render(): JSX_2.Element;
|
|
92
132
|
}
|
|
93
133
|
|
|
94
|
-
declare class Deletion implements Mutation {
|
|
95
|
-
readonly segment: string | undefined;
|
|
96
|
-
readonly valueAtReference: string | undefined;
|
|
97
|
-
readonly position: number;
|
|
98
|
-
readonly code: string;
|
|
99
|
-
constructor(segment: string | undefined, valueAtReference: string | undefined, position: number);
|
|
100
|
-
equals(other: Mutation): boolean;
|
|
101
|
-
toString(): string;
|
|
102
|
-
static parse(mutationStr: string): Deletion | null;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
declare class Insertion implements Mutation {
|
|
106
|
-
readonly segment: string | undefined;
|
|
107
|
-
readonly position: number;
|
|
108
|
-
readonly insertedSymbols: string;
|
|
109
|
-
readonly code: string;
|
|
110
|
-
constructor(segment: string | undefined, position: number, insertedSymbols: string);
|
|
111
|
-
equals(other: Mutation): boolean;
|
|
112
|
-
toString(): string;
|
|
113
|
-
static parse(mutationStr: string): Insertion | null;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
134
|
declare type LapisFilter = Record<string, string | number | null | boolean>;
|
|
117
135
|
|
|
118
136
|
/**
|
|
@@ -155,17 +173,18 @@ export declare class LocationFilterComponent extends PreactLitAdapter {
|
|
|
155
173
|
* (e.g., `fields = ['continent', 'country', 'city']`).
|
|
156
174
|
*/
|
|
157
175
|
fields: string[];
|
|
176
|
+
/**
|
|
177
|
+
* The width of the component.
|
|
178
|
+
*
|
|
179
|
+
* If not set, the component will take the full width of its container.
|
|
180
|
+
*
|
|
181
|
+
* The width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.
|
|
182
|
+
* If the unit is %, the size will be relative to the container of the component.
|
|
183
|
+
*/
|
|
184
|
+
width: string | undefined;
|
|
158
185
|
render(): JSX_2.Element;
|
|
159
186
|
}
|
|
160
187
|
|
|
161
|
-
declare interface Mutation {
|
|
162
|
-
readonly segment: string | undefined;
|
|
163
|
-
readonly position: number;
|
|
164
|
-
readonly code: string;
|
|
165
|
-
equals(other: Mutation): boolean;
|
|
166
|
-
toString(): string;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
188
|
/**
|
|
170
189
|
* This component allows to compare mutations between different variants.
|
|
171
190
|
* A variant is defined by its LAPIS filter.
|
|
@@ -223,22 +242,126 @@ export declare class MutationComparisonComponent extends PreactLitAdapterWithGri
|
|
|
223
242
|
width?: string;
|
|
224
243
|
height?: string;
|
|
225
244
|
} | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* The headline of the component. Set to an empty string to hide the headline.
|
|
247
|
+
*/
|
|
248
|
+
headline: string | undefined;
|
|
226
249
|
render(): JSX_2.Element;
|
|
227
250
|
}
|
|
228
251
|
|
|
229
252
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
253
|
+
* ## Context
|
|
254
|
+
* This component provides an input field to specify filters for nucleotide and amino acid mutations and insertions.
|
|
255
|
+
*
|
|
256
|
+
* Input values have to be provided one at a time and submitted by pressing the Enter key or by clicking the '+' button.
|
|
257
|
+
* After submission, the component validates the input and fires an event with the selected mutations.
|
|
258
|
+
* All previously selected mutations are displayed at the input field and added to the event.
|
|
259
|
+
* Users can remove a mutation by clicking the 'x' button next to the mutation.
|
|
260
|
+
*
|
|
261
|
+
* Validation of the input is performed according to the following rules:
|
|
262
|
+
*
|
|
263
|
+
* Mutations have to conform to the following format: `<gene/segment>:<symbol at reference><position><Substituted symbol/Deletion>`
|
|
264
|
+
* - Gene/segment: The gene or segment where the mutation occurs. Must be contained in the reference genome
|
|
265
|
+
* (Optional for elements with only one gene/segment)
|
|
266
|
+
* - Symbol at reference: The symbol at the reference position. (Optional)
|
|
267
|
+
* - Position: The position of the mutation. (Required)
|
|
268
|
+
* - Substituted symbol/Deletion: The substituted symbol or '-' for a deletion. (Required)
|
|
269
|
+
* Example: S:614G, 614G, 614- or 614G
|
|
270
|
+
*
|
|
271
|
+
* Insertions have to conform to the following format: `ins_<gene/segment>:<position>:<Inserted symbols>`
|
|
272
|
+
* - Gene/segment: The gene or segment where the insertion occurs. Must be contained in the reference genome
|
|
273
|
+
* (Optional for elements with only one gene/segment)
|
|
274
|
+
* - Position: The position of the insertion. (Required)
|
|
275
|
+
* - Inserted symbols: The symbols that are inserted. (Required)
|
|
276
|
+
* Example: ins_S:614:G, ins_614:G
|
|
277
|
+
*
|
|
278
|
+
* @fires {CustomEvent<{
|
|
279
|
+
* nucleotideMutations: string[],
|
|
280
|
+
* aminoAcidMutations: string[],
|
|
281
|
+
* nucleotideInsertions: string[],
|
|
282
|
+
* aminoAcidInsertions: string[]
|
|
283
|
+
* }>} gs-mutation-filter-changed
|
|
284
|
+
* Fired when:
|
|
285
|
+
* - The user has submitted a valid mutation or insertion
|
|
286
|
+
* - The user has removed a mutation or insertion
|
|
287
|
+
*
|
|
288
|
+
* @fires {CustomEvent<{
|
|
289
|
+
* nucleotideMutations: string[],
|
|
290
|
+
* aminoAcidMutations: string[],
|
|
291
|
+
* nucleotideInsertions: string[],
|
|
292
|
+
* aminoAcidInsertions: string[]
|
|
293
|
+
* }>} gs-mutation-filter-on-blur
|
|
294
|
+
* Fired when:
|
|
295
|
+
* - the mutation filter has lost focus
|
|
296
|
+
* Contains the selected mutations in the format
|
|
232
297
|
*/
|
|
233
298
|
export declare class MutationFilterComponent extends PreactLitAdapter {
|
|
234
|
-
|
|
299
|
+
/**
|
|
300
|
+
* The initial value to use for this mutation filter.
|
|
301
|
+
* Must be either
|
|
302
|
+
* - an array of strings of valid mutations.
|
|
303
|
+
* - an object with the keys `nucleotideMutations`, `aminoAcidMutations`, `nucleotideInsertions` and `aminoAcidInsertions` and corresponding string arrays.
|
|
304
|
+
*/
|
|
305
|
+
initialValue: {
|
|
306
|
+
nucleotideMutations: string[];
|
|
307
|
+
aminoAcidMutations: string[];
|
|
308
|
+
nucleotideInsertions: string[];
|
|
309
|
+
aminoAcidInsertions: string[];
|
|
310
|
+
} | string[] | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* The size of the component.
|
|
313
|
+
*
|
|
314
|
+
* If not set, the component will take the full width of its container with height 700px.
|
|
315
|
+
*
|
|
316
|
+
* The width and height should be a string with a unit in css style, e.g. '100%', '500px' or '50vh'.
|
|
317
|
+
* If the unit is %, the size will be relative to the container of the component.
|
|
318
|
+
*/
|
|
319
|
+
size: {
|
|
320
|
+
width?: string;
|
|
321
|
+
height?: string;
|
|
322
|
+
} | undefined;
|
|
235
323
|
render(): JSX_2.Element;
|
|
236
324
|
}
|
|
237
325
|
|
|
326
|
+
/**
|
|
327
|
+
* This component displays mutations (substitutions, deletions and insertions) for a given variant.
|
|
328
|
+
*
|
|
329
|
+
* ## Views
|
|
330
|
+
*
|
|
331
|
+
* ### Table View
|
|
332
|
+
*
|
|
333
|
+
* The table view shows all substitutions and deletions for the given variant.
|
|
334
|
+
* It shows the type (substitution or deletion), the total count of the mutation
|
|
335
|
+
* and the proportion of the mutation in the variant.
|
|
336
|
+
* The proportion is relative to the total number of sequences matching
|
|
337
|
+
* the specified sequence filters with non-ambiguous reads at that position.
|
|
338
|
+
*
|
|
339
|
+
* The proportion interval filter can be used to filter the displayed mutations on client side.
|
|
340
|
+
*
|
|
341
|
+
* ### Grid View
|
|
342
|
+
*
|
|
343
|
+
* The grid view shows the proportion of each sequence symbol (nucleotide or amino acid) for each position that has a mutation.
|
|
344
|
+
* Only positions with at least one mutation in the selected proportion interval are shown.
|
|
345
|
+
*
|
|
346
|
+
* ### Insertions View
|
|
347
|
+
*
|
|
348
|
+
* The insertions view shows the count of all insertions for the given variant.
|
|
349
|
+
*
|
|
350
|
+
*/
|
|
238
351
|
export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
352
|
+
/**
|
|
353
|
+
* The `variant` will be sent as is to LAPIS to filter the mutation data.
|
|
354
|
+
* It must be a valid LAPIS filter object.
|
|
355
|
+
*/
|
|
356
|
+
variant: Record<string, string | number | null | boolean>;
|
|
357
|
+
/**
|
|
358
|
+
* The type of the sequence for which the mutations should be shown.
|
|
359
|
+
*/
|
|
360
|
+
sequenceType: 'nucleotide' | 'amino acid';
|
|
361
|
+
/**
|
|
362
|
+
* A list of tabs with views that this component should provide.
|
|
363
|
+
*/
|
|
364
|
+
views: ('table' | 'grid' | 'insertions')[];
|
|
242
365
|
/**
|
|
243
366
|
* The size of the component.
|
|
244
367
|
*
|
|
@@ -251,13 +374,13 @@ export declare class MutationsComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
251
374
|
width?: string;
|
|
252
375
|
height?: string;
|
|
253
376
|
} | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* The headline of the component. Set to an empty string to hide the headline.
|
|
379
|
+
*/
|
|
380
|
+
headline: string | undefined;
|
|
254
381
|
render(): JSX_2.Element;
|
|
255
382
|
}
|
|
256
383
|
|
|
257
|
-
declare type NamedLapisFilter = LapisFilter & {
|
|
258
|
-
displayName: string;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
384
|
declare abstract class PreactLitAdapter extends ReactiveElement {
|
|
262
385
|
static styles: CSSResult[];
|
|
263
386
|
/* Excluded from this release type: lapis */
|
|
@@ -270,39 +393,87 @@ declare abstract class PreactLitAdapterWithGridJsStyles extends PreactLitAdapter
|
|
|
270
393
|
static styles: CSSResult[];
|
|
271
394
|
}
|
|
272
395
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
396
|
+
/**
|
|
397
|
+
* This component displays the prevalence over time of one or more variants.
|
|
398
|
+
* The prevalence is calculated as the ratio of the number of cases of each variant given as `numerator`
|
|
399
|
+
* to the number of cases of the variant given as `denominator`.
|
|
400
|
+
*
|
|
401
|
+
* In the chart views,
|
|
402
|
+
* - the user can select whether to display a confidence interval (not available in the bubble chart).
|
|
403
|
+
* The confidence interval is calculated using [Wilson score interval](https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval),
|
|
404
|
+
* with a confidence level of 95%.
|
|
405
|
+
* - the x-axis shows time steps in the selected `granularity`.
|
|
406
|
+
* - the user can select the y-axis scale (linear, logistic, logit).
|
|
407
|
+
*
|
|
408
|
+
* ## Views
|
|
409
|
+
*
|
|
410
|
+
* ### Bar View
|
|
411
|
+
*
|
|
412
|
+
* Displays the prevalence over time as a bar chart.
|
|
413
|
+
* Shows a bar for each variant in the `numerator` on every time step.
|
|
414
|
+
*
|
|
415
|
+
* ### Line View
|
|
416
|
+
*
|
|
417
|
+
* Displays the prevalence over time as a line chart.
|
|
418
|
+
* Each data point is connected for better visibility.
|
|
419
|
+
* Shows a line for each variant in the `numerator`.
|
|
420
|
+
*
|
|
421
|
+
* ### Bubble View
|
|
422
|
+
*
|
|
423
|
+
* Displays the prevalence over time as a bubble chart.
|
|
424
|
+
* The size of the bubbles represents the number of cases of the `denominator` variant.
|
|
425
|
+
* The height of the bubbles represents the prevalence of the `numerator` variants.
|
|
426
|
+
*
|
|
427
|
+
* ### Table View
|
|
428
|
+
*
|
|
429
|
+
* Displays the prevalence over time as a table with one row per time point.
|
|
430
|
+
*/
|
|
299
431
|
export declare class PrevalenceOverTimeComponent extends PreactLitAdapterWithGridJsStyles {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
432
|
+
/**
|
|
433
|
+
* Either a single variant or an array of variants to compare.
|
|
434
|
+
* This must be a valid LAPIS filter object with an additional `displayName` property
|
|
435
|
+
* which will be used as the label for the variant in the views,
|
|
436
|
+
* or an array of such objects.
|
|
437
|
+
*/
|
|
438
|
+
numerator: (Record<string, string | number | null | boolean> & {
|
|
439
|
+
displayName: string;
|
|
440
|
+
}) | (Record<string, string | number | null | boolean> & {
|
|
441
|
+
displayName: string;
|
|
442
|
+
})[];
|
|
443
|
+
/**
|
|
444
|
+
* The variant that the variants in `numerator` are compared to.
|
|
445
|
+
*/
|
|
446
|
+
denominator: Record<string, string | number | null | boolean> & {
|
|
447
|
+
displayName: string;
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* The granularity of the time axis.
|
|
451
|
+
*/
|
|
452
|
+
granularity: 'day' | 'week' | 'month' | 'year';
|
|
453
|
+
/**
|
|
454
|
+
* The number of time steps to use for smoothing the data.
|
|
455
|
+
* `0` means no smoothing.
|
|
456
|
+
* Must be a non-negative integer.
|
|
457
|
+
*
|
|
458
|
+
* For a given time, the shown value is the mean of the neighbouring measured values.
|
|
459
|
+
* The `smoothingWindow` value provides the number of neighbouring values to take into account.
|
|
460
|
+
* The resulting time is computed via `Math.floor(smoothingWindow / 2)`.
|
|
461
|
+
*/
|
|
303
462
|
smoothingWindow: number;
|
|
304
|
-
|
|
305
|
-
|
|
463
|
+
/**
|
|
464
|
+
* A list of tabs with views that this component should provide.
|
|
465
|
+
*/
|
|
466
|
+
views: ('bar' | 'line' | 'bubble' | 'table')[];
|
|
467
|
+
/**
|
|
468
|
+
* A list of methods to calculate the confidence interval.
|
|
469
|
+
* The option `none` is always available and disables confidence intervals.
|
|
470
|
+
* Pass an empty array to disable the confidence interval selector.
|
|
471
|
+
*/
|
|
472
|
+
confidenceIntervalMethods: ('wilson' | 'none')[];
|
|
473
|
+
/**
|
|
474
|
+
* The headline of the component. Set to an empty string to hide the headline.
|
|
475
|
+
*/
|
|
476
|
+
headline: string | undefined;
|
|
306
477
|
/**
|
|
307
478
|
* The size of the component.
|
|
308
479
|
*
|
|
@@ -361,11 +532,52 @@ declare const referenceGenomeResponse: default_2.ZodObject<{
|
|
|
361
532
|
}[];
|
|
362
533
|
}>;
|
|
363
534
|
|
|
535
|
+
/**
|
|
536
|
+
* We assume a discrete time model, where new infections happen exactly every `generationTime` days.
|
|
537
|
+
* This is what we call a "generation".
|
|
538
|
+
*
|
|
539
|
+
* This component estimates the relative growth advantage of a variant by performing a logistic regression.
|
|
540
|
+
* Based on the inferred logistic growth rate, we derive the relative growth advantage (per generation).
|
|
541
|
+
*
|
|
542
|
+
* For details on the scientific method, see:
|
|
543
|
+
* Chen, Chaoran, et al. "Quantification of the spread of SARS-CoV-2 variant B.1.1.7 in Switzerland." Epidemics (2021);
|
|
544
|
+
* doi: [10.1016/j.epidem.2021.100480](https://doi.org/10.1016/j.epidem.2021.100480)
|
|
545
|
+
*
|
|
546
|
+
* This component fetches aggregated data from LAPIS.
|
|
547
|
+
* Then the data is sent to `https://cov-spectrum.org/api/v2/computed/model/chen2021Fitness`
|
|
548
|
+
* which performs the logistic regression and calculates the relative growth advantage.
|
|
549
|
+
*
|
|
550
|
+
* ## Views
|
|
551
|
+
*
|
|
552
|
+
* ### Line View
|
|
553
|
+
*
|
|
554
|
+
* The line view shows the relative growth advantage over time in a line chart.
|
|
555
|
+
* The dots in the plot show the proportions of the focal variant (`numerator`) to the `denominator` variant
|
|
556
|
+
* for every day as observed in the data.
|
|
557
|
+
* The line shows a logistic curve fitted to the data points, including a 95% confidence interval.
|
|
558
|
+
*/
|
|
364
559
|
export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
365
|
-
|
|
366
|
-
|
|
560
|
+
/**
|
|
561
|
+
* The LAPIS filter for the focal variant.
|
|
562
|
+
*/
|
|
563
|
+
numerator: Record<string, string | number | null | boolean>;
|
|
564
|
+
/**
|
|
565
|
+
* The LAPIS filter for the variant that the focal variant (`numerator`) should be compared to.
|
|
566
|
+
*/
|
|
567
|
+
denominator: Record<string, string | number | null | boolean>;
|
|
568
|
+
/**
|
|
569
|
+
* The generation time represents the number of days over which the variant's relative growth advantage is measured.
|
|
570
|
+
* For example, if we set a generation time of 7 days, then we estimate the growth advantage per week.
|
|
571
|
+
*/
|
|
367
572
|
generationTime: number;
|
|
368
|
-
|
|
573
|
+
/**
|
|
574
|
+
* A list of tabs with views that this component should provide.
|
|
575
|
+
*/
|
|
576
|
+
views: 'line'[];
|
|
577
|
+
/**
|
|
578
|
+
* The headline of the component. Set to an empty string to hide the headline.
|
|
579
|
+
*/
|
|
580
|
+
headline: string | undefined;
|
|
369
581
|
/**
|
|
370
582
|
* The size of the component.
|
|
371
583
|
*
|
|
@@ -381,50 +593,48 @@ export declare class RelativeGrowthAdvantageComponent extends PreactLitAdapter {
|
|
|
381
593
|
render(): JSX_2.Element;
|
|
382
594
|
}
|
|
383
595
|
|
|
384
|
-
declare type SelectedFilters = {
|
|
385
|
-
nucleotideMutations: (Substitution | Deletion)[];
|
|
386
|
-
aminoAcidMutations: (Substitution | Deletion)[];
|
|
387
|
-
nucleotideInsertions: Insertion[];
|
|
388
|
-
aminoAcidInsertions: Insertion[];
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
declare type SelectedMutationFilterStrings = {
|
|
392
|
-
[Key in keyof SelectedFilters]: string[];
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
declare type SequenceType = 'nucleotide' | 'amino acid';
|
|
396
|
-
|
|
397
|
-
declare class Substitution implements Mutation {
|
|
398
|
-
readonly segment: string | undefined;
|
|
399
|
-
readonly valueAtReference: string | undefined;
|
|
400
|
-
readonly substitutionValue: string | undefined;
|
|
401
|
-
readonly position: number;
|
|
402
|
-
readonly code: string;
|
|
403
|
-
constructor(segment: string | undefined, valueAtReference: string | undefined, substitutionValue: string | undefined, position: number);
|
|
404
|
-
equals(other: Mutation): boolean;
|
|
405
|
-
toString(): string;
|
|
406
|
-
static parse(mutationStr: string): Substitution | null;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
declare type TemporalGranularity = 'day' | 'week' | 'month' | 'year';
|
|
410
|
-
|
|
411
596
|
/**
|
|
412
|
-
*
|
|
597
|
+
*
|
|
598
|
+
* ## Context
|
|
599
|
+
*
|
|
600
|
+
* This component provides a text input field to specify filters for arbitrary fields of this Lapis instance.
|
|
601
|
+
*
|
|
602
|
+
* @fires {CustomEvent<Record<string, string>>} gs-text-input-changed
|
|
603
|
+
* Fired when the input field is changed.
|
|
604
|
+
* The `details` of this event contain an object with the `lapisField` as key and the input value as value.
|
|
605
|
+
* Example:
|
|
606
|
+
* ```
|
|
607
|
+
* {
|
|
608
|
+
* "host": "Homo sapiens"
|
|
609
|
+
* }
|
|
610
|
+
* ```
|
|
413
611
|
*/
|
|
414
612
|
export declare class TextInputComponent extends PreactLitAdapter {
|
|
613
|
+
/**
|
|
614
|
+
* The initial value to use for this text input.
|
|
615
|
+
*/
|
|
415
616
|
initialValue: string | undefined;
|
|
617
|
+
/**
|
|
618
|
+
* The Lapis field name to use for this text input.
|
|
619
|
+
*/
|
|
416
620
|
lapisField: string;
|
|
621
|
+
/**
|
|
622
|
+
* The placeholder text to display in the input field.
|
|
623
|
+
*/
|
|
417
624
|
placeholderText: string | undefined;
|
|
625
|
+
/**
|
|
626
|
+
* The width of the component.
|
|
627
|
+
*
|
|
628
|
+
* If not set, the component will take the full width of its container.
|
|
629
|
+
*
|
|
630
|
+
* The width should be a string with a unit in css style, e.g. '100%', '500px' or '50vw'.
|
|
631
|
+
* If the unit is %, the size will be relative to the container of the component.
|
|
632
|
+
*/
|
|
633
|
+
width: string | undefined;
|
|
418
634
|
render(): JSX_2.Element;
|
|
419
635
|
}
|
|
420
636
|
|
|
421
|
-
declare type View = 'table'
|
|
422
|
-
|
|
423
|
-
declare type View_2 = 'bar' | 'line' | 'bubble' | 'table';
|
|
424
|
-
|
|
425
|
-
declare type View_3 = 'line';
|
|
426
|
-
|
|
427
|
-
declare type View_4 = 'table';
|
|
637
|
+
declare type View = 'table';
|
|
428
638
|
|
|
429
639
|
export { }
|
|
430
640
|
|
|
@@ -459,21 +669,21 @@ declare global {
|
|
|
459
669
|
|
|
460
670
|
declare global {
|
|
461
671
|
interface HTMLElementTagNameMap {
|
|
462
|
-
'gs-
|
|
672
|
+
'gs-aggregate-component': AggregateComponent;
|
|
463
673
|
}
|
|
464
674
|
}
|
|
465
675
|
|
|
466
676
|
|
|
467
677
|
declare global {
|
|
468
678
|
interface HTMLElementTagNameMap {
|
|
469
|
-
'gs-
|
|
679
|
+
'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
|
|
470
680
|
}
|
|
471
681
|
}
|
|
472
682
|
|
|
473
683
|
|
|
474
684
|
declare global {
|
|
475
685
|
interface HTMLElementTagNameMap {
|
|
476
|
-
'gs-date-range-selector': DateRangeSelectorComponent
|
|
686
|
+
'gs-date-range-selector': DateRangeSelectorComponent;
|
|
477
687
|
}
|
|
478
688
|
interface HTMLElementEventMap {
|
|
479
689
|
'gs-date-range-changed': CustomEvent<{
|
|
@@ -506,7 +716,7 @@ declare global {
|
|
|
506
716
|
|
|
507
717
|
declare global {
|
|
508
718
|
interface HTMLElementTagNameMap {
|
|
509
|
-
'gs-mutation-filter':
|
|
719
|
+
'gs-mutation-filter': MutationFilterComponent;
|
|
510
720
|
}
|
|
511
721
|
interface HTMLElementEventMap {
|
|
512
722
|
'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
|