@genspectrum/dashboard-components 0.6.18 → 0.7.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/README.md +5 -12
- package/custom-elements.json +22 -22
- package/dist/assets/mutationOverTimeWorker-BOCXtKzd.js.map +1 -0
- package/dist/dashboard-components.js +301 -302
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +60 -10
- package/dist/style.css +3 -2
- package/package.json +13 -4
- package/src/index.ts +1 -0
- package/src/operator/FetchInsertionsOperator.ts +2 -2
- package/src/operator/FetchSubstitutionsOrDeletionsOperator.ts +3 -3
- package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +53 -38
- package/src/preact/dateRangeSelector/computeInitialValues.ts +17 -23
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +46 -32
- package/src/preact/dateRangeSelector/date-range-selector.tsx +24 -26
- package/src/preact/dateRangeSelector/dateRangeOption.ts +65 -0
- package/src/preact/dateRangeSelector/selectableOptions.ts +17 -66
- package/src/preact/mutationComparison/fetchMutationData.spec.ts +3 -3
- package/src/preact/mutationComparison/getMutationComparisonTableData.spec.ts +11 -11
- package/src/preact/mutationComparison/getMutationComparisonTableData.ts +4 -4
- package/src/preact/mutationComparison/mutation-comparison-table.tsx +2 -2
- package/src/preact/mutationFilter/mutation-filter.tsx +27 -18
- package/src/preact/mutationFilter/parseAndValidateMutation.ts +4 -4
- package/src/preact/mutationFilter/parseMutation.spec.ts +17 -17
- package/src/preact/mutations/getInsertionsTableData.spec.ts +3 -3
- package/src/preact/mutations/getMutationsGridData.spec.ts +9 -9
- package/src/preact/mutations/getMutationsTableData.spec.ts +7 -7
- package/src/preact/mutations/mutations-insertions-table.tsx +3 -3
- package/src/preact/mutations/mutations-table.tsx +3 -3
- package/src/preact/mutationsOverTime/MutationOverTimeData.ts +20 -0
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutationsByDay.ts +45686 -0
- package/src/preact/mutationsOverTime/__mockData__/byWeek.ts +58989 -0
- package/src/preact/mutationsOverTime/__mockData__/defaultMockData.ts +103991 -0
- package/src/preact/mutationsOverTime/__mockData__/mockConversion.ts +54 -0
- package/src/preact/mutationsOverTime/__mockData__/showsMessageWhenTooManyMutations.ts +63690 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +177 -161
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +17 -59
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +27 -0
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.ts +29 -0
- package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +13 -14
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +9 -334
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +59 -54
- package/src/preact/numberSequencesOverTime/getNumberOfSequencesOverTimeTableData.ts +3 -3
- package/src/preact/prevalenceOverTime/getPrevalenceOverTimeTableData.spec.ts +5 -5
- package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +1 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +2 -2
- package/src/preact/shared/sort/sortInsertions.spec.ts +11 -11
- package/src/preact/shared/sort/sortInsertions.ts +2 -2
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.spec.ts +13 -13
- package/src/preact/shared/sort/sortSubstitutionsAndDeletions.ts +7 -4
- package/src/preact/webWorkers/useWebWorker.ts +51 -0
- package/src/preact/webWorkers/workerFunction.ts +14 -0
- package/src/query/queryAggregatedDataOverTime.ts +3 -3
- package/src/query/queryMutationsOverTime.spec.ts +272 -51
- package/src/query/queryMutationsOverTime.ts +114 -47
- package/src/query/queryPrevalenceOverTime.ts +2 -2
- package/src/query/queryRelativeGrowthAdvantage.ts +3 -3
- package/src/types.ts +25 -5
- package/src/utils/map2d.spec.ts +79 -12
- package/src/utils/map2d.ts +25 -5
- package/src/utils/mutations.spec.ts +20 -20
- package/src/utils/mutations.ts +80 -17
- package/src/utils/sort.ts +5 -2
- package/src/utils/temporal.spec.ts +27 -24
- package/src/utils/{temporal.ts → temporalClass.ts} +170 -72
- package/src/utils/temporalTestHelpers.ts +3 -3
- package/src/web-components/input/gs-date-range-selector.stories.ts +16 -28
- package/src/web-components/input/gs-date-range-selector.tsx +17 -32
- package/src/web-components/introduction.mdx +46 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +6 -699
- package/src/web-components/visualization/gs-mutations-over-time.tsx +2 -2
- package/standalone-bundle/dashboard-components.js +12011 -12778
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_01.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_02.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_03.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_04.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_05.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_06.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_2024_07.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_20_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_21_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_22_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_23_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_24_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_25_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_26_01_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_byDay.json +0 -38
- package/src/preact/mutationsOverTime/__mockData__/aggregated_byWeek.json +0 -122
- package/src/preact/mutationsOverTime/__mockData__/aggregated_date.json +0 -642
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations.json +0 -1470
- package/src/preact/mutationsOverTime/__mockData__/aggregated_tooManyMutations_total.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week3_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week4_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week5_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aggregated_week6_2024.json +0 -13
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_20_01_2024.json +0 -6778
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_21_01_2024.json +0 -7129
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_22_01_2024.json +0 -4681
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_23_01_2024.json +0 -10738
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_24_01_2024.json +0 -11710
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_25_01_2024.json +0 -11557
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_26_01_2024.json +0 -8596
- package/src/preact/mutationsOverTime/__mockData__/aminoAcidMutations_byDayOverall.json +0 -4726
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_01.json +0 -1747
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_02.json +0 -1774
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_03.json +0 -1819
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_04.json +0 -1864
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_05.json +0 -1927
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_06.json +0 -1864
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_2024_07.json +0 -9
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byMonthOverall.json +0 -11143
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_byWeekOverall.json +0 -9154
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_tooManyMutations.json +0 -16453
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week3_2024.json +0 -8812
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week4_2024.json +0 -9730
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week5_2024.json +0 -9865
- package/src/preact/mutationsOverTime/__mockData__/nucleotideMutations_week6_2024.json +0 -11314
|
@@ -9,29 +9,21 @@ import { type DateRangeSelectorProps } from '../../preact/dateRangeSelector/date
|
|
|
9
9
|
import './gs-date-range-selector';
|
|
10
10
|
import '../app';
|
|
11
11
|
import { toYYYYMMDD } from '../../preact/dateRangeSelector/dateConversion';
|
|
12
|
-
import {
|
|
13
|
-
PRESET_VALUE_ALL_TIMES,
|
|
14
|
-
PRESET_VALUE_CUSTOM,
|
|
15
|
-
PRESET_VALUE_LAST_2_MONTHS,
|
|
16
|
-
PRESET_VALUE_LAST_2_WEEKS,
|
|
17
|
-
PRESET_VALUE_LAST_3_MONTHS,
|
|
18
|
-
PRESET_VALUE_LAST_6_MONTHS,
|
|
19
|
-
PRESET_VALUE_LAST_MONTH,
|
|
20
|
-
} from '../../preact/dateRangeSelector/selectableOptions';
|
|
12
|
+
import { dateRangeOptionPresets } from '../../preact/dateRangeSelector/dateRangeOption';
|
|
21
13
|
import { withinShadowRoot } from '../withinShadowRoot.story';
|
|
22
14
|
|
|
23
15
|
const codeExample = String.raw`
|
|
24
16
|
<gs-date-range-selector
|
|
25
|
-
|
|
17
|
+
dateRangeOptions='[{ "label": "Year 2021", "dateFrom": "2021-01-01", "dateTo": "2021-12-31" }]'
|
|
26
18
|
earliestDate="1970-01-01"
|
|
27
|
-
initialValue="
|
|
19
|
+
initialValue="Year 2021"
|
|
28
20
|
initialDateFrom="2020-01-01"
|
|
29
21
|
initialDateTo="2021-01-01"
|
|
30
22
|
width="100%"
|
|
31
23
|
dateColumn="myDateColumn"
|
|
32
24
|
></gs-date-range-selector>`;
|
|
33
25
|
|
|
34
|
-
const meta: Meta<Required<DateRangeSelectorProps
|
|
26
|
+
const meta: Meta<Required<DateRangeSelectorProps>> = {
|
|
35
27
|
title: 'Input/DateRangeSelector',
|
|
36
28
|
component: 'gs-date-range-selector',
|
|
37
29
|
parameters: withComponentDocs({
|
|
@@ -50,19 +42,10 @@ const meta: Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>> = {
|
|
|
50
42
|
control: {
|
|
51
43
|
type: 'select',
|
|
52
44
|
},
|
|
53
|
-
options: [
|
|
54
|
-
PRESET_VALUE_CUSTOM,
|
|
55
|
-
PRESET_VALUE_ALL_TIMES,
|
|
56
|
-
PRESET_VALUE_LAST_2_WEEKS,
|
|
57
|
-
PRESET_VALUE_LAST_MONTH,
|
|
58
|
-
PRESET_VALUE_LAST_2_MONTHS,
|
|
59
|
-
PRESET_VALUE_LAST_3_MONTHS,
|
|
60
|
-
PRESET_VALUE_LAST_6_MONTHS,
|
|
61
|
-
'CustomDateRange',
|
|
62
|
-
],
|
|
45
|
+
options: [dateRangeOptionPresets.lastMonth.label, dateRangeOptionPresets.allTimes.label, 'CustomDateRange'],
|
|
63
46
|
},
|
|
64
47
|
dateColumn: { control: { type: 'text' } },
|
|
65
|
-
|
|
48
|
+
dateRangeOptions: {
|
|
66
49
|
control: {
|
|
67
50
|
type: 'object',
|
|
68
51
|
},
|
|
@@ -79,9 +62,14 @@ const meta: Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>> = {
|
|
|
79
62
|
},
|
|
80
63
|
},
|
|
81
64
|
args: {
|
|
82
|
-
|
|
65
|
+
dateRangeOptions: [
|
|
66
|
+
dateRangeOptionPresets.lastMonth,
|
|
67
|
+
dateRangeOptionPresets.last3Months,
|
|
68
|
+
dateRangeOptionPresets.allTimes,
|
|
69
|
+
{ label: 'CustomDateRange', dateFrom: '2021-01-01', dateTo: '2021-12-31' },
|
|
70
|
+
],
|
|
83
71
|
earliestDate: '1970-01-01',
|
|
84
|
-
initialValue:
|
|
72
|
+
initialValue: dateRangeOptionPresets.lastMonth.label,
|
|
85
73
|
dateColumn: 'aDateColumn',
|
|
86
74
|
width: '100%',
|
|
87
75
|
initialDateFrom: '',
|
|
@@ -92,12 +80,12 @@ const meta: Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>> = {
|
|
|
92
80
|
|
|
93
81
|
export default meta;
|
|
94
82
|
|
|
95
|
-
export const DateRangeSelectorStory: StoryObj<Required<DateRangeSelectorProps
|
|
83
|
+
export const DateRangeSelectorStory: StoryObj<Required<DateRangeSelectorProps>> = {
|
|
96
84
|
render: (args) =>
|
|
97
85
|
html` <gs-app lapis="${LAPIS_URL}">
|
|
98
86
|
<div class="max-w-screen-lg">
|
|
99
87
|
<gs-date-range-selector
|
|
100
|
-
.
|
|
88
|
+
.dateRangeOptions=${args.dateRangeOptions}
|
|
101
89
|
.earliestDate=${args.earliestDate}
|
|
102
90
|
.initialValue=${args.initialValue}
|
|
103
91
|
.initialDateFrom=${args.initialDateFrom}
|
|
@@ -112,7 +100,7 @@ export const DateRangeSelectorStory: StoryObj<Required<DateRangeSelectorProps<'C
|
|
|
112
100
|
const dateTo = () => canvas.getByPlaceholderText('Date to');
|
|
113
101
|
|
|
114
102
|
await step('Expect last 6 months to be selected', async () => {
|
|
115
|
-
await expect(canvas.getByRole('combobox')).toHaveValue('
|
|
103
|
+
await expect(canvas.getByRole('combobox')).toHaveValue('Last month');
|
|
116
104
|
await waitFor(() => {
|
|
117
105
|
expect(dateTo()).toHaveValue(toYYYYMMDD(new Date()));
|
|
118
106
|
});
|
|
@@ -37,13 +37,14 @@ import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
|
37
37
|
@customElement('gs-date-range-selector')
|
|
38
38
|
export class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
39
39
|
/**
|
|
40
|
-
* An array of
|
|
41
|
-
* in addition to the predefined options.
|
|
40
|
+
* An array of date range options that the select field should provide.
|
|
42
41
|
* The `label` will be shown to the user, and it will be available as `initialValue`.
|
|
43
42
|
* The dates must be in the format `YYYY-MM-DD`.
|
|
43
|
+
*
|
|
44
|
+
* If dateFrom or dateTo is not set, the component will default to the `earliestDate` or the current date.
|
|
44
45
|
*/
|
|
45
46
|
@property({ type: Array })
|
|
46
|
-
|
|
47
|
+
dateRangeOptions: { label: string; dateFrom?: string; dateTo?: string }[] = [];
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* The `dateFrom` value to use in the `allTimes` preset in the format `YYYY-MM-DD`.
|
|
@@ -51,26 +52,18 @@ export class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
|
51
52
|
@property({ type: String })
|
|
52
53
|
earliestDate: string = '1900-01-01';
|
|
53
54
|
|
|
54
|
-
// prettier-ignore
|
|
55
|
-
// The multiline union type must not start with `| 'custom'` - Storybook will list "" as the first type which is wrong
|
|
56
55
|
/**
|
|
57
56
|
* The initial value to use for this date range selector.
|
|
58
|
-
* Must be a valid label from the
|
|
57
|
+
* Must be a valid label from the `dateRangeOptions`.
|
|
59
58
|
*
|
|
60
|
-
* If the value is
|
|
59
|
+
* If the value is not set, the component will default to the range `earliestDate` until today.
|
|
61
60
|
*
|
|
62
61
|
* It will be overwritten if `initialDateFrom` or `initialDateTo` is set.
|
|
62
|
+
*
|
|
63
|
+
* We provide some options in `dateRangeOptionPresets` for convenience.
|
|
63
64
|
*/
|
|
64
65
|
@property()
|
|
65
|
-
initialValue:
|
|
66
|
-
'custom'
|
|
67
|
-
| 'allTimes'
|
|
68
|
-
| 'last2Weeks'
|
|
69
|
-
| 'lastMonth'
|
|
70
|
-
| 'last2Months'
|
|
71
|
-
| 'last3Months'
|
|
72
|
-
| 'last6Months'
|
|
73
|
-
| string = 'last6Months';
|
|
66
|
+
initialValue: string | undefined = undefined;
|
|
74
67
|
|
|
75
68
|
/**
|
|
76
69
|
* A date string in the format `YYYY-MM-DD`.
|
|
@@ -105,7 +98,7 @@ export class DateRangeSelectorComponent extends PreactLitAdapter {
|
|
|
105
98
|
override render() {
|
|
106
99
|
return (
|
|
107
100
|
<DateRangeSelector
|
|
108
|
-
|
|
101
|
+
dateRangeOptions={this.dateRangeOptions}
|
|
109
102
|
earliestDate={this.earliestDate}
|
|
110
103
|
initialValue={this.initialValue}
|
|
111
104
|
initialDateFrom={this.initialDateFrom}
|
|
@@ -138,30 +131,22 @@ declare global {
|
|
|
138
131
|
|
|
139
132
|
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
140
133
|
type CustomSelectOptionsMatches = Expect<
|
|
141
|
-
Equals<
|
|
142
|
-
typeof DateRangeSelectorComponent.prototype.customSelectOptions,
|
|
143
|
-
DateRangeSelectorProps<string>['customSelectOptions']
|
|
144
|
-
>
|
|
134
|
+
Equals<typeof DateRangeSelectorComponent.prototype.dateRangeOptions, DateRangeSelectorProps['dateRangeOptions']>
|
|
145
135
|
>;
|
|
146
136
|
type EarliestDateMatches = Expect<
|
|
147
|
-
Equals<typeof DateRangeSelectorComponent.prototype.earliestDate, DateRangeSelectorProps
|
|
137
|
+
Equals<typeof DateRangeSelectorComponent.prototype.earliestDate, DateRangeSelectorProps['earliestDate']>
|
|
148
138
|
>;
|
|
149
139
|
type InitialValueMatches = Expect<
|
|
150
|
-
Equals<typeof DateRangeSelectorComponent.prototype.initialValue, DateRangeSelectorProps
|
|
140
|
+
Equals<typeof DateRangeSelectorComponent.prototype.initialValue, DateRangeSelectorProps['initialValue']>
|
|
151
141
|
>;
|
|
152
142
|
type InitialDateFromMatches = Expect<
|
|
153
|
-
Equals<
|
|
154
|
-
typeof DateRangeSelectorComponent.prototype.initialDateFrom,
|
|
155
|
-
DateRangeSelectorProps<string>['initialDateFrom']
|
|
156
|
-
>
|
|
143
|
+
Equals<typeof DateRangeSelectorComponent.prototype.initialDateFrom, DateRangeSelectorProps['initialDateFrom']>
|
|
157
144
|
>;
|
|
158
145
|
type InitialDateToMatches = Expect<
|
|
159
|
-
Equals<typeof DateRangeSelectorComponent.prototype.initialDateTo, DateRangeSelectorProps
|
|
160
|
-
>;
|
|
161
|
-
type WidthMatches = Expect<
|
|
162
|
-
Equals<typeof DateRangeSelectorComponent.prototype.width, DateRangeSelectorProps<string>['width']>
|
|
146
|
+
Equals<typeof DateRangeSelectorComponent.prototype.initialDateTo, DateRangeSelectorProps['initialDateTo']>
|
|
163
147
|
>;
|
|
148
|
+
type WidthMatches = Expect<Equals<typeof DateRangeSelectorComponent.prototype.width, DateRangeSelectorProps['width']>>;
|
|
164
149
|
type DateColumnMatches = Expect<
|
|
165
|
-
Equals<typeof DateRangeSelectorComponent.prototype.dateColumn, DateRangeSelectorProps
|
|
150
|
+
Equals<typeof DateRangeSelectorComponent.prototype.dateColumn, DateRangeSelectorProps['dateColumn']>
|
|
166
151
|
>;
|
|
167
152
|
/* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
@@ -4,6 +4,21 @@ import { Meta } from '@storybook/blocks';
|
|
|
4
4
|
|
|
5
5
|
# Introduction
|
|
6
6
|
|
|
7
|
+
<a
|
|
8
|
+
style={{ display: 'flex', 'align-items': 'center', 'justify-content': 'right' }}
|
|
9
|
+
href='https://github.com/GenSpectrum/dashboard-components'
|
|
10
|
+
>
|
|
11
|
+
<svg style={{ width: '3%', height: '3%' }} viewBox='0 0 98 96' xmlns='http://www.w3.org/2000/svg'>
|
|
12
|
+
<path
|
|
13
|
+
fill-rule='evenodd'
|
|
14
|
+
clip-rule='evenodd'
|
|
15
|
+
d='M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z'
|
|
16
|
+
fill='#24292f'
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
<span style={{ 'margin-left': '4px' }}>Visit on GitHub</span>
|
|
20
|
+
</a>
|
|
21
|
+
|
|
7
22
|
This package provides a collection of web components to build interactive dashboards that visualize
|
|
8
23
|
data of a specific instance of [LAPIS](https://github.com/GenSpectrum/LAPIS).
|
|
9
24
|
|
|
@@ -13,3 +28,34 @@ We primarily provide two kinds of components:
|
|
|
13
28
|
Those components fetch data from the LAPIS instance and visualize it.
|
|
14
29
|
- Input components that let you specify sequence filters for the LAPIS requests.
|
|
15
30
|
Input changes will fire events that can be listened to by the visualization components. It is the responsibility of the dashbaord maintainer to listen to those events and to wire the data correctly into the visualization components.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm i @genspectrum/dashboard-components
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
All components must be children of a `gs-app` element.
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<gs-app lapis="https://url.to.lapis">
|
|
44
|
+
<gs-location-filter
|
|
45
|
+
fields='["region", "country"]'
|
|
46
|
+
initialValue="Europe / Switzerland"
|
|
47
|
+
width="100%"
|
|
48
|
+
placeholderText="Enter a location"
|
|
49
|
+
></gs-location-filter>
|
|
50
|
+
<gs-aggregate
|
|
51
|
+
fields='["division", "host"]'
|
|
52
|
+
filter='{"country": "USA"}'
|
|
53
|
+
views='["table"]'
|
|
54
|
+
width="100%"
|
|
55
|
+
height="700px"
|
|
56
|
+
initialSortField="count"
|
|
57
|
+
initialSortDirection="descending"
|
|
58
|
+
pageSize="10"
|
|
59
|
+
></gs-aggregate>
|
|
60
|
+
</gs-app>
|
|
61
|
+
```
|