@genspectrum/dashboard-components 0.1.1 → 0.1.3
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 +1 -1
- package/custom-elements.json +151 -1
- package/dist/dashboard-components.js +164 -62
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +63 -23
- package/package.json +1 -1
- package/src/lapisApi/lapisApi.ts +1 -1
- package/src/preact/aggregatedData/__mockData__/aggregated.json +585 -0
- package/src/preact/aggregatedData/aggregate-table.tsx +32 -0
- package/src/preact/aggregatedData/aggregate.stories.tsx +53 -0
- package/src/preact/aggregatedData/aggregate.tsx +98 -0
- package/src/query/queryAggregateData.spec.ts +32 -0
- package/src/query/queryAggregateData.ts +25 -0
- package/src/web-components/display/aggregate-component.mdx +25 -0
- package/src/web-components/display/aggregate-component.stories.ts +63 -0
- package/src/web-components/display/aggregate-component.tsx +51 -0
- package/src/web-components/display/index.ts +1 -0
- package/src/web-components/input/location-filter-component.stories.ts +2 -4
|
@@ -7,6 +7,37 @@ import { PropertyValues } from '@lit/reactive-element';
|
|
|
7
7
|
import { ReactiveElement } from '@lit/reactive-element';
|
|
8
8
|
import { TemplateResult } from 'lit-html';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* ## Tag
|
|
12
|
+
*
|
|
13
|
+
* `gs-aggregate-component`
|
|
14
|
+
*
|
|
15
|
+
* ## Context
|
|
16
|
+
*
|
|
17
|
+
* This component displays aggregated data, which can provide an overview of the underlying data.
|
|
18
|
+
*
|
|
19
|
+
* It expects a list of fields to aggregate by and a filter to apply to the data.
|
|
20
|
+
*/
|
|
21
|
+
export declare class AggregateComponent extends PreactLitAdapterWithGridJsStyles {
|
|
22
|
+
/**
|
|
23
|
+
* The fields to aggregate by.
|
|
24
|
+
*/
|
|
25
|
+
fields: string[];
|
|
26
|
+
/**
|
|
27
|
+
* The views are used to display the aggregated data.
|
|
28
|
+
* In the table view, the data is presented in a table format where each field is a column,
|
|
29
|
+
* along with the aggregated value and its proportion.
|
|
30
|
+
* The proportion represents the ratio of the aggregated value to the total count of the data
|
|
31
|
+
* (considering the applied filter).
|
|
32
|
+
*/
|
|
33
|
+
views: View_5[];
|
|
34
|
+
/**
|
|
35
|
+
* The filter to apply to the data.
|
|
36
|
+
*/
|
|
37
|
+
filter: LapisFilter;
|
|
38
|
+
render(): JSX_2.Element;
|
|
39
|
+
}
|
|
40
|
+
|
|
10
41
|
export declare class App extends LitElement {
|
|
11
42
|
lapis: string;
|
|
12
43
|
referenceGenome: ReferenceGenome;
|
|
@@ -206,6 +237,8 @@ declare type View_3 = 'bar' | 'line' | 'bubble' | 'table';
|
|
|
206
237
|
|
|
207
238
|
declare type View_4 = 'line';
|
|
208
239
|
|
|
240
|
+
declare type View_5 = 'table';
|
|
241
|
+
|
|
209
242
|
export { }
|
|
210
243
|
|
|
211
244
|
|
|
@@ -218,72 +251,79 @@ declare global {
|
|
|
218
251
|
|
|
219
252
|
declare global {
|
|
220
253
|
interface HTMLElementTagNameMap {
|
|
221
|
-
'gs-
|
|
222
|
-
}
|
|
223
|
-
interface HTMLElementEventMap {
|
|
224
|
-
'gs-date-range-changed': CustomEvent<{
|
|
225
|
-
dateFrom: string;
|
|
226
|
-
dateTo: string;
|
|
227
|
-
}>;
|
|
254
|
+
'gs-mutation-comparison-component': MutationComparisonComponent;
|
|
228
255
|
}
|
|
229
256
|
}
|
|
230
257
|
|
|
231
258
|
|
|
232
259
|
declare global {
|
|
233
260
|
interface HTMLElementTagNameMap {
|
|
234
|
-
'gs-
|
|
235
|
-
}
|
|
236
|
-
interface HTMLElementEventMap {
|
|
237
|
-
'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
|
|
238
|
-
'gs-mutation-filter-on-blur': CustomEvent<SelectedMutationFilterStrings>;
|
|
261
|
+
'gs-mutations-component': MutationsComponent;
|
|
239
262
|
}
|
|
240
263
|
}
|
|
241
264
|
|
|
242
265
|
|
|
243
266
|
declare global {
|
|
244
267
|
interface HTMLElementTagNameMap {
|
|
245
|
-
'gs-
|
|
246
|
-
}
|
|
247
|
-
interface HTMLElementEventMap {
|
|
248
|
-
'gs-text-input-changed': CustomEvent<Record<string, string>>;
|
|
268
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
249
269
|
}
|
|
250
270
|
}
|
|
251
271
|
|
|
252
272
|
|
|
253
273
|
declare global {
|
|
254
274
|
interface HTMLElementTagNameMap {
|
|
255
|
-
'gs-
|
|
275
|
+
'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
|
|
256
276
|
}
|
|
257
|
-
|
|
258
|
-
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
declare global {
|
|
281
|
+
interface HTMLElementTagNameMap {
|
|
282
|
+
'gs-aggregate-component': AggregateComponent;
|
|
259
283
|
}
|
|
260
284
|
}
|
|
261
285
|
|
|
262
286
|
|
|
263
287
|
declare global {
|
|
264
288
|
interface HTMLElementTagNameMap {
|
|
265
|
-
'gs-
|
|
289
|
+
'gs-date-range-selector': DateRangeSelectorComponent;
|
|
290
|
+
}
|
|
291
|
+
interface HTMLElementEventMap {
|
|
292
|
+
'gs-date-range-changed': CustomEvent<{
|
|
293
|
+
dateFrom: string;
|
|
294
|
+
dateTo: string;
|
|
295
|
+
}>;
|
|
266
296
|
}
|
|
267
297
|
}
|
|
268
298
|
|
|
269
299
|
|
|
270
300
|
declare global {
|
|
271
301
|
interface HTMLElementTagNameMap {
|
|
272
|
-
'gs-
|
|
302
|
+
'gs-mutation-filter': TextInputComponent;
|
|
303
|
+
}
|
|
304
|
+
interface HTMLElementEventMap {
|
|
305
|
+
'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
|
|
306
|
+
'gs-mutation-filter-on-blur': CustomEvent<SelectedMutationFilterStrings>;
|
|
273
307
|
}
|
|
274
308
|
}
|
|
275
309
|
|
|
276
310
|
|
|
277
311
|
declare global {
|
|
278
312
|
interface HTMLElementTagNameMap {
|
|
279
|
-
'gs-
|
|
313
|
+
'gs-location-filter': LocationFilterComponent;
|
|
314
|
+
}
|
|
315
|
+
interface HTMLElementEventMap {
|
|
316
|
+
'gs-location-changed': CustomEvent<Record<string, string>>;
|
|
280
317
|
}
|
|
281
318
|
}
|
|
282
319
|
|
|
283
320
|
|
|
284
321
|
declare global {
|
|
285
322
|
interface HTMLElementTagNameMap {
|
|
286
|
-
'gs-
|
|
323
|
+
'gs-text-input': TextInputComponent;
|
|
324
|
+
}
|
|
325
|
+
interface HTMLElementEventMap {
|
|
326
|
+
'gs-text-input-changed': CustomEvent<Record<string, string>>;
|
|
287
327
|
}
|
|
288
328
|
}
|
|
289
329
|
|
package/package.json
CHANGED
package/src/lapisApi/lapisApi.ts
CHANGED
|
@@ -78,7 +78,7 @@ export async function fetchReferenceGenome(lapisUrl: string, signal?: AbortSigna
|
|
|
78
78
|
|
|
79
79
|
const handleErrors = async (response: Response) => {
|
|
80
80
|
if (!response.ok) {
|
|
81
|
-
if (response.status
|
|
81
|
+
if (response.status >= 400 && response.status < 500) {
|
|
82
82
|
throw new Error(`${response.statusText}: ${JSON.stringify(await response.json())}`);
|
|
83
83
|
}
|
|
84
84
|
throw new Error(`${response.statusText}: ${response.status}`);
|