@genspectrum/dashboard-components 1.4.0 → 1.6.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 +134 -7
- package/dist/assets/{mutationOverTimeWorker-CQxrFo53.js.map → mutationOverTimeWorker-BmB6BvVM.js.map} +1 -1
- package/dist/components.d.ts +52 -11
- package/dist/components.js +189 -45
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +11 -11
- package/package.json +1 -1
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +24 -0
- package/src/preact/lineageFilter/lineage-filter.tsx +13 -2
- package/src/preact/locationFilter/location-filter.stories.tsx +24 -0
- package/src/preact/locationFilter/location-filter.tsx +19 -3
- package/src/preact/mutationFilter/mutation-filter-info.tsx +2 -2
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +71 -1
- package/src/preact/mutationFilter/mutation-filter.tsx +65 -24
- package/src/preact/mutationsOverTime/__mockData__/withGaps.ts +352 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTime.spec.ts +38 -0
- package/src/preact/mutationsOverTime/getFilteredMutationsOverTimeData.ts +10 -0
- package/src/preact/mutationsOverTime/mutationOverTimeWorker.mock.ts +2 -0
- package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +35 -0
- package/src/preact/mutationsOverTime/mutations-over-time.tsx +28 -4
- package/src/preact/textFilter/text-filter.stories.tsx +29 -4
- package/src/preact/textFilter/text-filter.tsx +13 -2
- package/src/query/queryMutationsOverTime.ts +37 -4
- package/src/query/queryMutationsOverTimeNewEndpoint.spec.ts +122 -0
- package/src/utils/map2d.spec.ts +30 -0
- package/src/utils/map2d.ts +14 -1
- package/src/utils/mutations.spec.ts +13 -0
- package/src/utils/mutations.ts +3 -3
- package/src/web-components/input/gs-lineage-filter.stories.ts +7 -0
- package/src/web-components/input/gs-lineage-filter.tsx +8 -0
- package/src/web-components/input/gs-location-filter.stories.ts +7 -0
- package/src/web-components/input/gs-location-filter.tsx +9 -1
- package/src/web-components/input/gs-mutation-filter.stories.ts +29 -1
- package/src/web-components/input/gs-mutation-filter.tsx +29 -2
- package/src/web-components/input/gs-text-filter.stories.ts +7 -0
- package/src/web-components/input/gs-text-filter.tsx +8 -0
- package/src/web-components/visualization/gs-mutations-over-time.stories.ts +14 -1
- package/src/web-components/visualization/gs-mutations-over-time.tsx +8 -0
- package/standalone-bundle/assets/{mutationOverTimeWorker-CDACUs6w.js.map → mutationOverTimeWorker-B_xP8pIC.js.map} +1 -1
- package/standalone-bundle/dashboard-components.js +3666 -3553
- package/standalone-bundle/dashboard-components.js.map +1 -1
|
@@ -59,6 +59,13 @@ export class TextFilterComponent extends PreactLitAdapter {
|
|
|
59
59
|
@property()
|
|
60
60
|
placeholderText: string | undefined = undefined;
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Whether to hide counts behind options in the drop down selection.
|
|
64
|
+
* Defaults to false.
|
|
65
|
+
*/
|
|
66
|
+
@property({ type: Boolean })
|
|
67
|
+
hideCounts: boolean | undefined = false;
|
|
68
|
+
|
|
62
69
|
/**
|
|
63
70
|
* The width of the component.
|
|
64
71
|
*
|
|
@@ -73,6 +80,7 @@ export class TextFilterComponent extends PreactLitAdapter {
|
|
|
73
80
|
lapisField={this.lapisField}
|
|
74
81
|
lapisFilter={this.lapisFilter}
|
|
75
82
|
placeholderText={this.placeholderText}
|
|
83
|
+
hideCounts={this.hideCounts}
|
|
76
84
|
value={this.value}
|
|
77
85
|
width={this.width}
|
|
78
86
|
/>
|
|
@@ -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
|
+
hideGaps: { control: 'boolean' },
|
|
45
46
|
useNewEndpoint: { control: 'boolean' },
|
|
46
47
|
pageSizes: { control: 'object' },
|
|
47
48
|
},
|
|
@@ -53,6 +54,7 @@ const meta: Meta<Required<MutationsOverTimeProps>> = {
|
|
|
53
54
|
granularity: 'month',
|
|
54
55
|
lapisDateField: 'date',
|
|
55
56
|
initialMeanProportionInterval: { min: 0.05, max: 0.9 },
|
|
57
|
+
hideGaps: false,
|
|
56
58
|
useNewEndpoint: false,
|
|
57
59
|
pageSizes: [10, 20, 30, 40, 50],
|
|
58
60
|
},
|
|
@@ -100,6 +102,7 @@ const Template: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
100
102
|
.lapisDateField=${args.lapisDateField}
|
|
101
103
|
.displayMutations=${args.displayMutations}
|
|
102
104
|
.initialMeanProportionInterval=${args.initialMeanProportionInterval}
|
|
105
|
+
.hideGaps=${args.hideGaps}
|
|
103
106
|
.pageSizes=${args.pageSizes}
|
|
104
107
|
.useNewEndpoint=${args.useNewEndpoint}
|
|
105
108
|
></gs-mutations-over-time>
|
|
@@ -112,7 +115,7 @@ export const ByMonth: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
|
112
115
|
...Template,
|
|
113
116
|
};
|
|
114
117
|
|
|
115
|
-
// This test uses mock data:
|
|
118
|
+
// This test uses mock data: withDisplayMutations.ts (through mutationOverTimeWorker.mock.ts)
|
|
116
119
|
export const ByMonthWithFilterOnDisplayedMutations: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
117
120
|
...Template,
|
|
118
121
|
args: {
|
|
@@ -121,6 +124,16 @@ export const ByMonthWithFilterOnDisplayedMutations: StoryObj<Required<MutationsO
|
|
|
121
124
|
},
|
|
122
125
|
};
|
|
123
126
|
|
|
127
|
+
// This test uses mock data: withGaps.ts (through mutationOverTimeWorker.mock.ts)
|
|
128
|
+
export const ByMonthWithFilterOnDisplayedMutationsAndGaps: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
129
|
+
...Template,
|
|
130
|
+
args: {
|
|
131
|
+
...Template.args,
|
|
132
|
+
displayMutations: ['A19722G', 'G21641T', 'T21652-'],
|
|
133
|
+
hideGaps: true,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
124
137
|
// This test uses mock data: byWeek.ts (through mutationOverTimeWorker.mock.ts)
|
|
125
138
|
export const ByWeek: StoryObj<Required<MutationsOverTimeProps>> = {
|
|
126
139
|
...Template,
|
|
@@ -113,6 +113,13 @@ 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
|
+
* If true, date ranges with no data will be hidden initially; if false, not.
|
|
118
|
+
* Can be switched with a button in the toolbar.
|
|
119
|
+
*/
|
|
120
|
+
@property({ type: Boolean })
|
|
121
|
+
hideGaps: boolean = false;
|
|
122
|
+
|
|
116
123
|
/**
|
|
117
124
|
* Whether to use the mutationsOverTime endpoint from LAPIS.
|
|
118
125
|
* If true, use the endpoint, if false, compute component data as before.
|
|
@@ -146,6 +153,7 @@ export class MutationsOverTimeComponent extends PreactLitAdapterWithGridJsStyles
|
|
|
146
153
|
lapisDateField={this.lapisDateField}
|
|
147
154
|
displayMutations={this.displayMutations}
|
|
148
155
|
initialMeanProportionInterval={this.initialMeanProportionInterval}
|
|
156
|
+
hideGaps={this.hideGaps}
|
|
149
157
|
useNewEndpoint={this.useNewEndpoint}
|
|
150
158
|
pageSizes={this.pageSizes}
|
|
151
159
|
/>
|