@genspectrum/dashboard-components 0.19.7 → 0.19.8
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 +2 -2
- package/dist/assets/mutationOverTimeWorker-CBXsEsiT.js.map +1 -0
- package/dist/components.d.ts +29 -29
- package/dist/components.js +118 -16
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +29 -29
- package/package.json +1 -1
- package/src/lapisApi/LineageDefinition.ts +9 -0
- package/src/lapisApi/lapisApi.ts +27 -0
- package/src/preact/lineageFilter/__mockData__/lineageDefinition.json +38118 -0
- package/src/preact/lineageFilter/fetchLineageAutocompleteList.spec.ts +264 -6
- package/src/preact/lineageFilter/fetchLineageAutocompleteList.ts +104 -7
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +13 -1
- package/src/preact/lineageFilter/lineage-filter.tsx +21 -11
- package/src/web-components/input/gs-lineage-filter.stories.ts +13 -1
- package/standalone-bundle/assets/mutationOverTimeWorker-CN4SJC7C.js.map +1 -0
- package/standalone-bundle/dashboard-components.js +2548 -2463
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/dist/assets/mutationOverTimeWorker-DQGh08AS.js.map +0 -1
- package/standalone-bundle/assets/mutationOverTimeWorker-DAf2_NiP.js.map +0 -1
package/dist/util.d.ts
CHANGED
|
@@ -954,7 +954,7 @@ declare global {
|
|
|
954
954
|
|
|
955
955
|
declare global {
|
|
956
956
|
interface HTMLElementTagNameMap {
|
|
957
|
-
'gs-
|
|
957
|
+
'gs-mutation-comparison-component': MutationComparisonComponent;
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
960
|
|
|
@@ -962,7 +962,7 @@ declare global {
|
|
|
962
962
|
declare global {
|
|
963
963
|
namespace JSX {
|
|
964
964
|
interface IntrinsicElements {
|
|
965
|
-
'gs-
|
|
965
|
+
'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
}
|
|
@@ -970,7 +970,7 @@ declare global {
|
|
|
970
970
|
|
|
971
971
|
declare global {
|
|
972
972
|
interface HTMLElementTagNameMap {
|
|
973
|
-
'gs-
|
|
973
|
+
'gs-mutations-component': MutationsComponent;
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
976
|
|
|
@@ -978,7 +978,7 @@ declare global {
|
|
|
978
978
|
declare global {
|
|
979
979
|
namespace JSX {
|
|
980
980
|
interface IntrinsicElements {
|
|
981
|
-
'gs-
|
|
981
|
+
'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
}
|
|
@@ -1082,7 +1082,11 @@ declare global {
|
|
|
1082
1082
|
|
|
1083
1083
|
declare global {
|
|
1084
1084
|
interface HTMLElementTagNameMap {
|
|
1085
|
-
'gs-
|
|
1085
|
+
'gs-date-range-filter': DateRangeFilterComponent;
|
|
1086
|
+
}
|
|
1087
|
+
interface HTMLElementEventMap {
|
|
1088
|
+
[gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
|
|
1089
|
+
[gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
|
|
1086
1090
|
}
|
|
1087
1091
|
}
|
|
1088
1092
|
|
|
@@ -1090,7 +1094,7 @@ declare global {
|
|
|
1090
1094
|
declare global {
|
|
1091
1095
|
namespace JSX {
|
|
1092
1096
|
interface IntrinsicElements {
|
|
1093
|
-
'gs-
|
|
1097
|
+
'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1094
1098
|
}
|
|
1095
1099
|
}
|
|
1096
1100
|
}
|
|
@@ -1098,7 +1102,10 @@ declare global {
|
|
|
1098
1102
|
|
|
1099
1103
|
declare global {
|
|
1100
1104
|
interface HTMLElementTagNameMap {
|
|
1101
|
-
'gs-
|
|
1105
|
+
'gs-location-filter': LocationFilterComponent;
|
|
1106
|
+
}
|
|
1107
|
+
interface HTMLElementEventMap {
|
|
1108
|
+
[gsEventNames.locationChanged]: LocationChangedEvent;
|
|
1102
1109
|
}
|
|
1103
1110
|
}
|
|
1104
1111
|
|
|
@@ -1106,7 +1113,7 @@ declare global {
|
|
|
1106
1113
|
declare global {
|
|
1107
1114
|
namespace JSX {
|
|
1108
1115
|
interface IntrinsicElements {
|
|
1109
|
-
'gs-
|
|
1116
|
+
'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1110
1117
|
}
|
|
1111
1118
|
}
|
|
1112
1119
|
}
|
|
@@ -1114,11 +1121,7 @@ declare global {
|
|
|
1114
1121
|
|
|
1115
1122
|
declare global {
|
|
1116
1123
|
interface HTMLElementTagNameMap {
|
|
1117
|
-
'gs-
|
|
1118
|
-
}
|
|
1119
|
-
interface HTMLElementEventMap {
|
|
1120
|
-
[gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
|
|
1121
|
-
[gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
|
|
1124
|
+
'gs-statistics': StatisticsComponent;
|
|
1122
1125
|
}
|
|
1123
1126
|
}
|
|
1124
1127
|
|
|
@@ -1126,7 +1129,7 @@ declare global {
|
|
|
1126
1129
|
declare global {
|
|
1127
1130
|
namespace JSX {
|
|
1128
1131
|
interface IntrinsicElements {
|
|
1129
|
-
'gs-
|
|
1132
|
+
'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1130
1133
|
}
|
|
1131
1134
|
}
|
|
1132
1135
|
}
|
|
@@ -1134,10 +1137,10 @@ declare global {
|
|
|
1134
1137
|
|
|
1135
1138
|
declare global {
|
|
1136
1139
|
interface HTMLElementTagNameMap {
|
|
1137
|
-
'gs-
|
|
1140
|
+
'gs-text-filter': TextFilterComponent;
|
|
1138
1141
|
}
|
|
1139
1142
|
interface HTMLElementEventMap {
|
|
1140
|
-
[gsEventNames.
|
|
1143
|
+
[gsEventNames.textFilterChanged]: TextFilterChangedEvent;
|
|
1141
1144
|
}
|
|
1142
1145
|
}
|
|
1143
1146
|
|
|
@@ -1145,7 +1148,7 @@ declare global {
|
|
|
1145
1148
|
declare global {
|
|
1146
1149
|
namespace JSX {
|
|
1147
1150
|
interface IntrinsicElements {
|
|
1148
|
-
'gs-
|
|
1151
|
+
'gs-text-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1149
1152
|
}
|
|
1150
1153
|
}
|
|
1151
1154
|
}
|
|
@@ -1153,10 +1156,10 @@ declare global {
|
|
|
1153
1156
|
|
|
1154
1157
|
declare global {
|
|
1155
1158
|
interface HTMLElementTagNameMap {
|
|
1156
|
-
'gs-
|
|
1159
|
+
'gs-lineage-filter': LineageFilterComponent;
|
|
1157
1160
|
}
|
|
1158
1161
|
interface HTMLElementEventMap {
|
|
1159
|
-
[gsEventNames.
|
|
1162
|
+
[gsEventNames.lineageFilterChanged]: LineageFilterChangedEvent;
|
|
1160
1163
|
}
|
|
1161
1164
|
}
|
|
1162
1165
|
|
|
@@ -1164,7 +1167,7 @@ declare global {
|
|
|
1164
1167
|
declare global {
|
|
1165
1168
|
namespace JSX {
|
|
1166
1169
|
interface IntrinsicElements {
|
|
1167
|
-
'gs-
|
|
1170
|
+
'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1168
1171
|
}
|
|
1169
1172
|
}
|
|
1170
1173
|
}
|
|
@@ -1191,10 +1194,11 @@ declare global {
|
|
|
1191
1194
|
|
|
1192
1195
|
declare global {
|
|
1193
1196
|
interface HTMLElementTagNameMap {
|
|
1194
|
-
'gs-
|
|
1197
|
+
'gs-number-range-filter': NumberRangeFilterComponent;
|
|
1195
1198
|
}
|
|
1196
1199
|
interface HTMLElementEventMap {
|
|
1197
|
-
[gsEventNames.
|
|
1200
|
+
[gsEventNames.numberRangeFilterChanged]: NumberRangeFilterChangedEvent;
|
|
1201
|
+
[gsEventNames.numberRangeValueChanged]: NumberRangeValueChangedEvent;
|
|
1198
1202
|
}
|
|
1199
1203
|
}
|
|
1200
1204
|
|
|
@@ -1202,7 +1206,7 @@ declare global {
|
|
|
1202
1206
|
declare global {
|
|
1203
1207
|
namespace JSX {
|
|
1204
1208
|
interface IntrinsicElements {
|
|
1205
|
-
'gs-
|
|
1209
|
+
'gs-number-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1206
1210
|
}
|
|
1207
1211
|
}
|
|
1208
1212
|
}
|
|
@@ -1210,11 +1214,7 @@ declare global {
|
|
|
1210
1214
|
|
|
1211
1215
|
declare global {
|
|
1212
1216
|
interface HTMLElementTagNameMap {
|
|
1213
|
-
'gs-
|
|
1214
|
-
}
|
|
1215
|
-
interface HTMLElementEventMap {
|
|
1216
|
-
[gsEventNames.numberRangeFilterChanged]: NumberRangeFilterChangedEvent;
|
|
1217
|
-
[gsEventNames.numberRangeValueChanged]: NumberRangeValueChangedEvent;
|
|
1217
|
+
'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
@@ -1222,7 +1222,7 @@ declare global {
|
|
|
1222
1222
|
declare global {
|
|
1223
1223
|
namespace JSX {
|
|
1224
1224
|
interface IntrinsicElements {
|
|
1225
|
-
'gs-
|
|
1225
|
+
'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
const lineage = z.object({
|
|
4
|
+
parents: z.array(z.string()).optional(),
|
|
5
|
+
aliases: z.array(z.string()),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const lineageDefinitionResponseSchema = z.record(lineage);
|
|
9
|
+
export type LineageDefinitionResponse = z.infer<typeof lineageDefinitionResponseSchema>;
|
package/src/lapisApi/lapisApi.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type ProblemDetail,
|
|
12
12
|
} from './lapisTypes';
|
|
13
13
|
import { type SequenceType } from '../types';
|
|
14
|
+
import { lineageDefinitionResponseSchema } from './LineageDefinition';
|
|
14
15
|
|
|
15
16
|
export class UnknownLapisError extends Error {
|
|
16
17
|
constructor(
|
|
@@ -127,6 +128,30 @@ export async function fetchReferenceGenome(lapisUrl: string, signal?: AbortSigna
|
|
|
127
128
|
return referenceGenomeResponse.parse(await response.json());
|
|
128
129
|
}
|
|
129
130
|
|
|
131
|
+
export async function fetchLineageDefinition({
|
|
132
|
+
lapisUrl,
|
|
133
|
+
lapisField,
|
|
134
|
+
signal,
|
|
135
|
+
}: {
|
|
136
|
+
lapisUrl: string;
|
|
137
|
+
lapisField: string;
|
|
138
|
+
signal?: AbortSignal;
|
|
139
|
+
}) {
|
|
140
|
+
const response = await callLapis(
|
|
141
|
+
lineageDefinitionEndpoint(lapisUrl, lapisField),
|
|
142
|
+
{
|
|
143
|
+
method: 'GET',
|
|
144
|
+
headers: {
|
|
145
|
+
'Content-Type': 'application/json',
|
|
146
|
+
},
|
|
147
|
+
signal,
|
|
148
|
+
},
|
|
149
|
+
`${lapisField} lineage definition`,
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
return lineageDefinitionResponseSchema.parse(await response.json());
|
|
153
|
+
}
|
|
154
|
+
|
|
130
155
|
async function callLapis(
|
|
131
156
|
input: Parameters<typeof fetch>[0],
|
|
132
157
|
init: Parameters<typeof fetch>[1],
|
|
@@ -191,3 +216,5 @@ export const substitutionsOrDeletionsEndpoint = (lapisUrl: string, sequenceType:
|
|
|
191
216
|
: `${lapisUrl}/sample/nucleotideMutations`;
|
|
192
217
|
};
|
|
193
218
|
export const referenceGenomeEndpoint = (lapisUrl: string) => `${lapisUrl}/sample/referenceGenome`;
|
|
219
|
+
export const lineageDefinitionEndpoint = (lapisUrl: string, lapisField: string) =>
|
|
220
|
+
`${lapisUrl}/sample/lineageDefinition/${lapisField}`;
|